@interactive-inc/claude-funnel 0.39.0 → 0.40.0
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/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -481,7 +481,7 @@ Since you have not provided a token or authorize, you might be missing one or mo
|
|
|
481
481
|
* Copyright(c) 2013 Roman Shtylman
|
|
482
482
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
483
483
|
* MIT Licensed
|
|
484
|
-
*/var UI=pr1(),hL6=v("events").EventEmitter,Ze1=lr1(),Ke1=as1(),We1=Vl(),Ve1=It1(),He1=Qe1();i7=Ge1.exports=gL6;function gL6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return Ze1($,hL6.prototype,!1),Ze1($,Ke1,!1),$.request=Object.create(Ve1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(He1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=Ke1;i7.request=Ve1;i7.response=He1;i7.Route=We1.Route;i7.Router=We1;i7.json=UI.json;i7.raw=UI.raw;i7.static=ze1();i7.text=UI.text;i7.urlencoded=UI.urlencoded});var je1=x((Q8)=>{var mL6=Q8&&Q8.__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]}),pL6=Q8&&Q8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),xe1=Q8&&Q8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))mL6(Y,$,Q)}return pL6(Y,$),Y},xI=Q8&&Q8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.buildBodyParserMiddleware=Q8.verifySignatureAndParseBody=Q8.verifySignatureAndParseRawBody=Q8.respondToUrlVerification=Q8.respondToSslCheck=void 0;var iL6=xI(v("crypto")),lL6=v("http"),nL6=v("https"),dL6=xI(v("querystring")),we1=L$(),aL6=fw(),Ue1=xe1(Je1()),oL6=xI(_P()),rL6=xI(RP()),qQ=P$(),v2=xe1(pw()),sL6=kP(),tL6=fP(),eL6=["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"],bl="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",$N6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};Q8.respondToSslCheck=$N6;var YN6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};Q8.respondToUrlVerification=YN6;class Be1{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=we1.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:V=void 0,redirectUri:H=void 0,installationStore:G=void 0,scopes:J=void 0,installerOptions:w={},app:U=void 0,router:B=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:q=v2.defaultAsyncDispatchErrorHandler,processEventErrorHandler:F=v2.defaultProcessEventErrorHandler,unhandledRequestHandler:P=v2.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:L=3001}){if(this.app=U!==void 0?U:(0,Ue1.default)(),typeof Y<"u")this.logger=Y;else this.logger=new we1.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let O=[this.signatureVerification?qe1(this.logger,$):Fe1(this.logger),Q8.respondToSslCheck,Q8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let m=typeof X==="string"?[X]:Object.values(X);this.router=B!==void 0?B:(0,Ue1.Router)();for(let H1 of m)this.router.post(H1,...O);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=q,this.processEventErrorHandler=F,this.unhandledRequestHandler=P,this.unhandledRequestTimeoutMillis=L,(0,tL6.verifyRedirectOpts)({redirectUri:H,redirectUriPath:w.redirectUriPath}),K!==void 0&&W!==void 0&&(w.stateVerification===!1||V!==void 0||w.stateStore!==void 0))this.installer=new aL6.InstallProvider({clientId:K,clientSecret:W,stateSecret:V,installationStore:G,logLevel:Q,logger:Y,directInstall:w.directInstall,stateStore:w.stateStore,stateVerification:w.stateVerification,legacyStateVerification:w.legacyStateVerification,stateCookieName:w.stateCookieName,stateCookieExpirationSeconds:w.stateCookieExpirationSeconds,renderHtmlForInstallPath:w.renderHtmlForInstallPath,authVersion:w.authVersion??"v2",clientOptions:w.clientOptions,authorizationUrl:w.authorizationUrl});let V1={metadata:w.metadata,scopes:J??[],userScopes:w.userScopes,redirectUri:H};if(this.installer!==void 0){let{installer:H1}=this,p=w.redirectUriPath===void 0?"/slack/oauth_redirect":w.redirectUriPath,{callbackOptions:i,stateVerification:X1}=w;this.router.use(p,async(I1,O1)=>{try{if(X1===!1)await H1.handleCallback(I1,O1,i,V1);else await H1.handleCallback(I1,O1,i)}catch(S1){await this.dispatchErrorHandler({error:S1,logger:this.logger,request:I1,response:O1})}});let G1=w.installPath===void 0?"/slack/install":w.installPath,{installPathOptions:A1}=w;this.router.get(G1,async(I1,O1,S1)=>{try{try{await H1.handleInstallPath(I1,O1,A1,V1)}catch(f1){S1(f1)}}catch(f1){await this.dispatchErrorHandler({error:f1,logger:this.logger,request:I1,response:O1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new sL6.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:v2.extractRetryNumFromHTTPRequest($),retryReason:v2.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)v2.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=lL6.createServer;if(Object.keys(Y).filter((X)=>eL6.includes(X)).length>0)Q=nL6.createServer;if(this.server!==void 0)return Promise.reject(new qQ.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 qQ.ReceiverInconsistentStateError(bl);this.server.on("error",(Z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(bl);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new qQ.ReceiverInconsistentStateError(bl));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new qQ.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,$()})})}}Q8.default=Be1;function QN6($,Y){return qe1($,Y)}Q8.verifySignatureAndParseRawBody=QN6;function qe1($,Y){return async(Q,X,z)=>{let Z=await Ne1(Q);try{Q.body=De1(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof qQ.ReceiverAuthenticityError){Al($,"Request verification failed",K),X.status(401).send();return}Al($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function Al($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function XN6($,Y,Q,X){if(Q===void 0||X===void 0)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=iL6.default.createHmac("sha256",$),[W,V]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,rL6.default)(V,K.digest("hex")))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function De1($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return XN6($,Y,X,z),Le1(Y,Z)}Q8.verifySignatureAndParseBody=De1;function Fe1($){return async(Y,Q,X)=>{let z=await Ne1(Y);try{let{"content-type":Z}=Y.headers;Y.body=Le1(z,Z)}catch(Z){if(Z){Al($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}Q8.buildBodyParserMiddleware=Fe1;function Le1($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=dL6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function Ne1($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,oL6.default)($)).toString()}});var ve1=x((Me1)=>{Object.defineProperty(Me1,"__esModule",{value:!0});Me1.DefaultThreadContextStore=void 0;var Pe1=_l();class Ie1{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,Pe1.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let V=W.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);return(V?.metadata?V.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,Pe1.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let V=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!V.messages)return;let H=V.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);if(H?.ts){let G={channel:Z,ts:H.ts,text:H.text,blocks:H.blocks?H.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(G)}this.context=W}}Me1.DefaultThreadContextStore=Ie1});var _l=x((u8)=>{var zN6=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 ZN6=ve1(),be1=Cg(),QK=P$(),BI=Fj(),KN6=zN6(Lj()),WN6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class Ae1{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){Se1($);let{threadContextStore:Y=new ZN6.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(Re1($)&&Te1($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=_e1(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return fe1(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=Ae1;function _e1($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=VN6(z),z.sayStream=HN6(z),z.setStatus=GN6(z),z.setSuggestedPrompts=JN6(z),z.setTitle=wN6(z),z}u8.enrichAssistantArgs=_e1;function Re1($){return WN6.has($.payload.type)}u8.isAssistantEvent=Re1;function Te1($){return $.payload.type==="message"?ke1($.payload):!0}u8.matchesConstraints=Te1;function ke1($){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=ke1;function Se1($){if(typeof $!=="object")throw new QK.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 QK.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 QK.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new QK.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 QK.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let V=`threadContextStore ${W} property must be a function`;throw new QK.AssistantInitializationError(V)}}}u8.validate=Se1;async function fe1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,KN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}u8.processAssistantMiddleware=fe1;function VN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=b2(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),V=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||V.metadata)V.metadata={event_type:V.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...V.metadata?.event_payload??{}}};return Y.chat.postMessage(V)}}function HN6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=b2(X);return(0,be1.createSayStream)(Y,Q,z,Z)}function GN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(0,be1.createSetStatus)(Y,X,z)}function JN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(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 wN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function b2($){let Y={};if("assistant_thread"in $&&(0,BI.isRecord)($.assistant_thread)){if((0,BI.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,BI.extractEventChannelId)($),X=(0,BI.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new QK.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}u8.extractThreadInfo=b2});var he1=x((a9)=>{var UN6=a9&&a9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(a9,"__esModule",{value:!0});a9.prepareStepArgs=a9.isStepEvent=a9.processStepMiddleware=a9.validate=a9.WorkflowStep=void 0;var qI=P$(),xN6=UN6(Lj()),BN6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class Ee1{callbackId;edit;save;execute;constructor($,Y){Ce1($,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(ce1($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=ye1($),X=this.getStepMiddleware(Y);return ue1(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[]}}}a9.WorkflowStep=Ee1;function Ce1($,Y){if(typeof $!=="string")throw new qI.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new qI.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 qI.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 qI.WorkflowStepInitializationError(K)}}a9.validate=Ce1;async function ue1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,xN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}a9.processStepMiddleware=ue1;function ce1($){return BN6.has($.payload.type)}a9.isStepEvent=ce1;function DI($){return $.botToken!==void 0?$.botToken:$.userToken}function qN6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=DI(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function DN6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=DI(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function FN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=DI(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function LN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=DI(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function ye1($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=qN6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=DN6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=FN6(X),X.fail=LN6(X);break;default:break}return X}a9.prepareStepArgs=ye1});var le1=x((Q0)=>{var ge1=Q0&&Q0.__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]}),NN6=Q0&&Q0.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),Rl=Q0&&Q0.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))ge1(Y,$,Q)}return NN6(Y,$),Y},Tl=Q0&&Q0.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))ge1(Y,$,Q)},xU=Q0&&Q0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.webApi=Q0.types=Q0.FileInstallationStore=Q0.MemoryInstallationStore=Q0.WorkflowStep=Q0.Assistant=Q0.buildReceiverRoutes=Q0.MemoryStore=Q0.defaultProcessEventErrorHandler=Q0.HTTPResponseAck=Q0.HTTPModuleFunctions=Q0.AwsLambdaReceiver=Q0.HTTPReceiver=Q0.SocketModeReceiver=Q0.ExpressReceiver=Q0.isValidSlackRequest=Q0.verifySlackRequest=Q0.App=Q0.LogLevel=void 0;var me1=xU(ji());Q0.App=me1.default;var jN6=ji();Object.defineProperty(Q0,"LogLevel",{enumerable:!0,get:function(){return jN6.LogLevel}});Q0.default=me1.default;var pe1=Wi();Object.defineProperty(Q0,"verifySlackRequest",{enumerable:!0,get:function(){return pe1.verifySlackRequest}});Object.defineProperty(Q0,"isValidSlackRequest",{enumerable:!0,get:function(){return pe1.isValidSlackRequest}});var PN6=xU(Jo1());Q0.AwsLambdaReceiver=PN6.default;var IN6=xU(je1());Q0.ExpressReceiver=IN6.default;var MN6=xU(Hi());Q0.HTTPReceiver=MN6.default;var ON6=xU(Bi());Q0.SocketModeReceiver=ON6.default;Q0.HTTPModuleFunctions=Rl(pw());var vN6=kP();Object.defineProperty(Q0,"HTTPResponseAck",{enumerable:!0,get:function(){return vN6.HTTPResponseAck}});var bN6=xi();Object.defineProperty(Q0,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return bN6.defaultProcessEventErrorHandler}});Tl(P$(),Q0);Tl(Dj(),Q0);Tl(Di(),Q0);var AN6=ug();Object.defineProperty(Q0,"MemoryStore",{enumerable:!0,get:function(){return AN6.MemoryStore}});var _N6=SP();Object.defineProperty(Q0,"buildReceiverRoutes",{enumerable:!0,get:function(){return _N6.buildReceiverRoutes}});var RN6=_l();Object.defineProperty(Q0,"Assistant",{enumerable:!0,get:function(){return RN6.Assistant}});var TN6=he1();Object.defineProperty(Q0,"WorkflowStep",{enumerable:!0,get:function(){return TN6.WorkflowStep}});var ie1=fw();Object.defineProperty(Q0,"MemoryInstallationStore",{enumerable:!0,get:function(){return ie1.MemoryInstallationStore}});Object.defineProperty(Q0,"FileInstallationStore",{enumerable:!0,get:function(){return ie1.FileInstallationStore}});Q0.types=Rl(Og());Q0.webApi=Rl(qj())});import{homedir as KP6}from"os";var Zd={name:"@interactive-inc/claude-funnel",version:"0.39.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"},"./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"},"./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"},engines:{bun:">=1.3.0"}};var W0=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={};s7(N,{xor:()=>ua,xid:()=>Ka,void:()=>Ta,uuidv7:()=>td,uuidv6:()=>sd,uuidv4:()=>rd,uuid:()=>od,util:()=>D1,url:()=>ed,uppercase:()=>AK,unknown:()=>NZ,union:()=>VB,undefined:()=>_a,ulid:()=>Za,uint64:()=>ba,uint32:()=>Ma,tuple:()=>MA,trim:()=>fK,treeifyError:()=>BM,transform:()=>GB,toUpperCase:()=>CK,toLowerCase:()=>EK,toJSONSchema:()=>Ex,templateLiteral:()=>sa,symbol:()=>Aa,superRefine:()=>tA,success:()=>da,stringbool:()=>Zo,stringFormat:()=>Da,string:()=>zV,strictObject:()=>Ea,startsWith:()=>RK,slugify:()=>uK,size:()=>DZ,setErrorMap:()=>h$0,set:()=>ma,safeParseAsync:()=>tb,safeParse:()=>sb,safeEncodeAsync:()=>ZA,safeEncode:()=>XA,safeDecodeAsync:()=>KA,safeDecode:()=>zA,registry:()=>Kx,regexes:()=>t9,regex:()=>vK,refine:()=>sA,record:()=>OA,readonly:()=>lA,property:()=>Tx,promise:()=>ta,prettifyError:()=>qM,preprocess:()=>Wo,prefault:()=>uA,positive:()=>bx,pipe:()=>mx,partialRecord:()=>ya,parseAsync:()=>rb,parse:()=>ob,overwrite:()=>t7,optional:()=>KV,object:()=>fa,number:()=>VA,nullish:()=>na,nullable:()=>WV,null:()=>UA,normalize:()=>SK,nonpositive:()=>_x,nonoptional:()=>cA,nonnegative:()=>Rx,never:()=>WB,negative:()=>Ax,nativeEnum:()=>pa,nanoid:()=>Qa,nan:()=>aa,multipleOf:()=>CX,minSize:()=>uY,minLength:()=>AQ,mime:()=>kK,meta:()=>Xo,maxSize:()=>uX,maxLength:()=>FZ,map:()=>ga,mac:()=>Ha,lte:()=>e9,lt:()=>EY,lowercase:()=>bK,looseRecord:()=>ha,looseObject:()=>Ca,locales:()=>$V,literal:()=>ia,length:()=>LZ,lazy:()=>aA,ksuid:()=>Wa,keyof:()=>Sa,jwt:()=>qa,json:()=>Ko,iso:()=>hK,ipv6:()=>Ga,ipv4:()=>Va,invertCodec:()=>ra,intersection:()=>PA,int64:()=>va,int32:()=>Ia,int:()=>gx,instanceof:()=>zo,includes:()=>_K,httpUrl:()=>$a,hostname:()=>Fa,hex:()=>La,hash:()=>Na,guid:()=>ad,gte:()=>r$,gt:()=>CY,globalRegistry:()=>W$,getErrorMap:()=>g$0,function:()=>ea,fromJSONSchema:()=>Ho,formatError:()=>p2,float64:()=>Pa,float32:()=>ja,flattenError:()=>m2,file:()=>la,exactOptional:()=>kA,enum:()=>HB,endsWith:()=>TK,encodeAsync:()=>YA,encode:()=>eb,emoji:()=>Ya,email:()=>dd,e164:()=>Ba,discriminatedUnion:()=>ca,describe:()=>Qo,decodeAsync:()=>QA,decode:()=>$A,date:()=>ka,custom:()=>Yo,cuid2:()=>za,cuid:()=>Xa,core:()=>_Q,config:()=>K8,coerce:()=>$_,codec:()=>oa,clone:()=>a$,cidrv6:()=>wa,cidrv4:()=>Ja,check:()=>$o,catch:()=>gA,boolean:()=>HA,bigint:()=>Oa,base64url:()=>xa,base64:()=>Ua,array:()=>JV,any:()=>Ra,_function:()=>ea,_default:()=>EA,_ZodString:()=>px,ZodXor:()=>LA,ZodXID:()=>rx,ZodVoid:()=>DA,ZodUnknown:()=>BA,ZodUnion:()=>UV,ZodUndefined:()=>JA,ZodUUID:()=>cY,ZodURL:()=>HV,ZodULID:()=>ox,ZodType:()=>N0,ZodTuple:()=>IA,ZodTransform:()=>RA,ZodTemplateLiteral:()=>nA,ZodSymbol:()=>GA,ZodSuccess:()=>yA,ZodStringFormat:()=>G6,ZodString:()=>pK,ZodSet:()=>bA,ZodRecord:()=>gK,ZodRealError:()=>O9,ZodReadonly:()=>iA,ZodPromise:()=>oA,ZodPreprocess:()=>pA,ZodPrefault:()=>CA,ZodPipe:()=>xV,ZodOptional:()=>JB,ZodObject:()=>wV,ZodNumberFormat:()=>jZ,ZodNumber:()=>lK,ZodNullable:()=>SA,ZodNull:()=>wA,ZodNonOptional:()=>wB,ZodNever:()=>qA,ZodNanoID:()=>nx,ZodNaN:()=>mA,ZodMap:()=>vA,ZodMAC:()=>WA,ZodLiteral:()=>AA,ZodLazy:()=>dA,ZodKSUID:()=>sx,ZodJWT:()=>ZB,ZodIssueCode:()=>y$0,ZodIntersection:()=>jA,ZodISOTime:()=>yx,ZodISODuration:()=>hx,ZodISODateTime:()=>ux,ZodISODate:()=>cx,ZodIPv6:()=>ex,ZodIPv4:()=>tx,ZodGUID:()=>ZV,ZodFunction:()=>rA,ZodFirstPartyTypeKind:()=>eA,ZodFile:()=>_A,ZodExactOptional:()=>TA,ZodError:()=>u$0,ZodEnum:()=>mK,ZodEmoji:()=>lx,ZodEmail:()=>ix,ZodE164:()=>zB,ZodDiscriminatedUnion:()=>NA,ZodDefault:()=>fA,ZodDate:()=>GV,ZodCustomStringFormat:()=>iK,ZodCustom:()=>qV,ZodCodec:()=>BV,ZodCatch:()=>hA,ZodCUID2:()=>ax,ZodCUID:()=>dx,ZodCIDRv6:()=>YB,ZodCIDRv4:()=>$B,ZodBoolean:()=>nK,ZodBigIntFormat:()=>KB,ZodBigInt:()=>dK,ZodBase64URL:()=>XB,ZodBase64:()=>QB,ZodArray:()=>FA,ZodAny:()=>xA,TimePrecision:()=>Mv,NEVER:()=>XM,$output:()=>Fv,$input:()=>Lv,$brand:()=>zM});var _Q={};s7(_Q,{version:()=>w3,util:()=>D1,treeifyError:()=>BM,toJSONSchema:()=>Ex,toDotPath:()=>wd,safeParseAsync:()=>FM,safeParse:()=>DM,safeEncodeAsync:()=>y60,safeEncode:()=>u60,safeDecodeAsync:()=>h60,safeDecode:()=>c60,registry:()=>Kx,regexes:()=>t9,process:()=>K6,prettifyError:()=>qM,parseAsync:()=>cU,parse:()=>uU,meta:()=>zb,locales:()=>$V,isValidJWT:()=>fd,isValidBase64URL:()=>Sd,isValidBase64:()=>f3,initializeContext:()=>cX,globalRegistry:()=>W$,globalConfig:()=>wZ,formatError:()=>p2,flattenError:()=>m2,finalize:()=>hX,extractDefs:()=>yX,encodeAsync:()=>E60,encode:()=>S60,describe:()=>Xb,decodeAsync:()=>C60,decode:()=>f60,createToJSONSchemaMethod:()=>Kb,createStandardJSONSchemaMethod:()=>yK,config:()=>K8,clone:()=>a$,_xor:()=>U$0,_xid:()=>Dx,_void:()=>av,_uuidv7:()=>Jx,_uuidv6:()=>Gx,_uuidv4:()=>Hx,_uuid:()=>Vx,_url:()=>QV,_uppercase:()=>AK,_unknown:()=>nv,_union:()=>w$0,_undefined:()=>pv,_ulid:()=>qx,_uint64:()=>gv,_uint32:()=>Ev,_tuple:()=>q$0,_trim:()=>fK,_transform:()=>I$0,_toUpperCase:()=>CK,_toLowerCase:()=>EK,_templateLiteral:()=>k$0,_symbol:()=>mv,_superRefine:()=>Qb,_success:()=>A$0,_stringbool:()=>Zb,_stringFormat:()=>cK,_string:()=>jv,_startsWith:()=>RK,_slugify:()=>uK,_size:()=>DZ,_set:()=>L$0,_safeParseAsync:()=>IK,_safeParse:()=>PK,_safeEncodeAsync:()=>lU,_safeEncode:()=>pU,_safeDecodeAsync:()=>nU,_safeDecode:()=>iU,_regex:()=>vK,_refine:()=>Yb,_record:()=>D$0,_readonly:()=>T$0,_property:()=>Tx,_promise:()=>f$0,_positive:()=>bx,_pipe:()=>R$0,_parseAsync:()=>jK,_parse:()=>NK,_overwrite:()=>t7,_optional:()=>M$0,_number:()=>_v,_nullable:()=>O$0,_null:()=>iv,_normalize:()=>SK,_nonpositive:()=>_x,_nonoptional:()=>b$0,_nonnegative:()=>Rx,_never:()=>dv,_negative:()=>Ax,_nativeEnum:()=>j$0,_nanoid:()=>Ux,_nan:()=>sv,_multipleOf:()=>CX,_minSize:()=>uY,_minLength:()=>AQ,_min:()=>r$,_mime:()=>kK,_maxSize:()=>uX,_maxLength:()=>FZ,_max:()=>e9,_map:()=>F$0,_mac:()=>Iv,_lte:()=>e9,_lt:()=>EY,_lowercase:()=>bK,_literal:()=>P$0,_length:()=>LZ,_lazy:()=>S$0,_ksuid:()=>Fx,_jwt:()=>vx,_isoTime:()=>bv,_isoDuration:()=>Av,_isoDateTime:()=>Ov,_isoDate:()=>vv,_ipv6:()=>Nx,_ipv4:()=>Lx,_intersection:()=>B$0,_int64:()=>hv,_int32:()=>fv,_int:()=>Tv,_includes:()=>_K,_guid:()=>YV,_gte:()=>r$,_gt:()=>CY,_float64:()=>Sv,_float32:()=>kv,_file:()=>ev,_enum:()=>N$0,_endsWith:()=>TK,_encodeAsync:()=>gU,_encode:()=>yU,_emoji:()=>wx,_email:()=>Wx,_e164:()=>Ox,_discriminatedUnion:()=>x$0,_default:()=>v$0,_decodeAsync:()=>mU,_decode:()=>hU,_date:()=>ov,_custom:()=>$b,_cuid2:()=>Bx,_cuid:()=>xx,_coercedString:()=>Pv,_coercedNumber:()=>Rv,_coercedDate:()=>rv,_coercedBoolean:()=>uv,_coercedBigint:()=>yv,_cidrv6:()=>Px,_cidrv4:()=>jx,_check:()=>pd,_catch:()=>_$0,_boolean:()=>Cv,_bigint:()=>cv,_base64url:()=>Mx,_base64:()=>Ix,_array:()=>tv,_any:()=>lv,TimePrecision:()=>Mv,NEVER:()=>XM,JSONSchemaGenerator:()=>ib,JSONSchema:()=>id,Doc:()=>rU,$output:()=>Fv,$input:()=>Lv,$constructor:()=>y,$brand:()=>zM,$ZodXor:()=>t3,$ZodXID:()=>I3,$ZodVoid:()=>a3,$ZodUnknown:()=>n3,$ZodUnion:()=>a2,$ZodUndefined:()=>p3,$ZodUUID:()=>B3,$ZodURL:()=>D3,$ZodULID:()=>P3,$ZodType:()=>w0,$ZodTuple:()=>Xx,$ZodTransform:()=>WO,$ZodTemplateLiteral:()=>FO,$ZodSymbol:()=>m3,$ZodSuccess:()=>UO,$ZodStringFormat:()=>H6,$ZodString:()=>qZ,$ZodSet:()=>XO,$ZodRegistry:()=>Nv,$ZodRecord:()=>YO,$ZodRealError:()=>M9,$ZodReadonly:()=>DO,$ZodPromise:()=>NO,$ZodPreprocess:()=>qO,$ZodPrefault:()=>JO,$ZodPipe:()=>Zx,$ZodOptional:()=>zx,$ZodObjectJIT:()=>s3,$ZodObject:()=>ud,$ZodNumberFormat:()=>h3,$ZodNumber:()=>Yx,$ZodNullable:()=>HO,$ZodNull:()=>i3,$ZodNonOptional:()=>wO,$ZodNever:()=>d3,$ZodNanoID:()=>L3,$ZodNaN:()=>BO,$ZodMap:()=>QO,$ZodMAC:()=>T3,$ZodLiteral:()=>ZO,$ZodLazy:()=>jO,$ZodKSUID:()=>M3,$ZodJWT:()=>c3,$ZodIntersection:()=>$O,$ZodISOTime:()=>b3,$ZodISODuration:()=>A3,$ZodISODateTime:()=>O3,$ZodISODate:()=>v3,$ZodIPv6:()=>R3,$ZodIPv4:()=>_3,$ZodGUID:()=>x3,$ZodFunction:()=>LO,$ZodFile:()=>KO,$ZodExactOptional:()=>VO,$ZodError:()=>g2,$ZodEnum:()=>zO,$ZodEncodeError:()=>UZ,$ZodEmoji:()=>F3,$ZodEmail:()=>q3,$ZodE164:()=>u3,$ZodDiscriminatedUnion:()=>e3,$ZodDefault:()=>GO,$ZodDate:()=>o3,$ZodCustomStringFormat:()=>y3,$ZodCustom:()=>PO,$ZodCodec:()=>o2,$ZodCheckUpperCase:()=>Z3,$ZodCheckStringFormat:()=>MK,$ZodCheckStartsWith:()=>W3,$ZodCheckSizeEquals:()=>eM,$ZodCheckRegex:()=>X3,$ZodCheckProperty:()=>H3,$ZodCheckOverwrite:()=>J3,$ZodCheckNumberFormat:()=>oM,$ZodCheckMultipleOf:()=>aM,$ZodCheckMinSize:()=>tM,$ZodCheckMinLength:()=>Y3,$ZodCheckMimeType:()=>G3,$ZodCheckMaxSize:()=>sM,$ZodCheckMaxLength:()=>$3,$ZodCheckLowerCase:()=>z3,$ZodCheckLessThan:()=>aU,$ZodCheckLengthEquals:()=>Q3,$ZodCheckIncludes:()=>K3,$ZodCheckGreaterThan:()=>oU,$ZodCheckEndsWith:()=>V3,$ZodCheckBigIntFormat:()=>rM,$ZodCheck:()=>q6,$ZodCatch:()=>xO,$ZodCUID2:()=>j3,$ZodCUID:()=>N3,$ZodCIDRv6:()=>S3,$ZodCIDRv4:()=>k3,$ZodBoolean:()=>d2,$ZodBigIntFormat:()=>g3,$ZodBigInt:()=>Qx,$ZodBase64URL:()=>C3,$ZodBase64:()=>E3,$ZodAsyncError:()=>fY,$ZodArray:()=>r3,$ZodAny:()=>l3});var Kd,XM=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,V){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:V,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,V);let H=K.prototype,G=Object.keys(H);for(let J=0;J<G.length;J++){let w=G[J];if(!(w in W))W[w]=H[w].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var V;let H=Q?.Parent?new Z:this;X(H,W),(V=H._zod).deferred??(V.deferred=[]);for(let G of H._zod.deferred)G();return H}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 zM=Symbol("zod_brand");class fY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var wZ=globalThis.__zod_globalConfig;function K8($){if($)Object.assign(wZ,$);return wZ}var D1={};s7(D1,{unwrapMessage:()=>E2,uint8ArrayToHex:()=>T60,uint8ArrayToBase64url:()=>_60,uint8ArrayToBase64:()=>Hd,stringifyPrimitive:()=>U1,slugify:()=>WM,shallowClone:()=>HM,safeExtend:()=>I60,required:()=>v60,randomString:()=>q60,propertyKeyTypes:()=>c2,promiseAllObject:()=>B60,primitiveTypes:()=>GM,prefixIssues:()=>I9,pick:()=>N60,partial:()=>O60,parsedType:()=>q1,optionalKeys:()=>JM,omit:()=>j60,objectClone:()=>w60,numKeys:()=>D60,nullish:()=>kX,normalizeParams:()=>j1,mergeDefs:()=>bQ,merge:()=>M60,jsonStringifyReplacer:()=>DK,joinValues:()=>n,issue:()=>LK,isPlainObject:()=>fX,isObject:()=>xZ,hexToUint8Array:()=>R60,getSizableOrigin:()=>y2,getParsedType:()=>F60,getLengthableOrigin:()=>h2,getEnumValues:()=>C2,getElementAtPath:()=>x60,floatSafeRemainder:()=>KM,finalizeIssue:()=>o$,extend:()=>P60,explicitlyAborted:()=>xM,escapeRegex:()=>B7,esc:()=>EU,defineLazy:()=>A0,createTransparentProxy:()=>L60,cloneDef:()=>U60,clone:()=>a$,cleanRegex:()=>u2,cleanEnum:()=>b60,captureStackTrace:()=>CU,cached:()=>FK,base64urlToUint8Array:()=>A60,base64ToUint8Array:()=>Vd,assignProp:()=>SX,assertNotEqual:()=>V60,assertNever:()=>G60,assertIs:()=>H60,assertEqual:()=>W60,assert:()=>J60,allowsEval:()=>VM,aborted:()=>EX,NUMBER_FORMAT_RANGES:()=>wM,Class:()=>Gd,BIGINT_FORMAT_RANGES:()=>UM});function W60($){return $}function V60($){return $}function H60($){}function G60($){throw Error("Unexpected value in exhaustive check")}function J60($){}function C2($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function n($,Y="|"){return $.map((Q)=>U1(Q)).join(Y)}function DK($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function FK($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function kX($){return $===null||$===void 0}function u2($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function KM($,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 Wd=Symbol("evaluating");function A0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===Wd)return;if(X===void 0)X=Wd,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function w60($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function SX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function bQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function U60($){return bQ($._zod.def)}function x60($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function B60($){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 q60($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function EU($){return JSON.stringify($)}function WM($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var CU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function xZ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var VM=FK(()=>{if(wZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function fX($){if(xZ($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(xZ(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function HM($){if(fX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function D60($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var F60=($)=>{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}`)}},c2=new Set(["string","number","symbol"]),GM=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function j1($){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 L60($){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 U1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function JM($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var wM={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]},UM={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function N60($,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=bQ($._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 SX(this,"shape",K),K},checks:[]});return a$($,Z)}function j60($,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=bQ($._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 SX(this,"shape",K),K},checks:[]});return a$($,Z)}function P60($,Y){if(!fX(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=bQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return SX(this,"shape",Z),Z}});return a$($,z)}function I60($,Y){if(!fX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return SX(this,"shape",X),X}});return a$($,Q)}function M60($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return SX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return a$($,Q)}function O60($,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=bQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,V={...W};if(Q)for(let H in Q){if(!(H in W))throw Error(`Unrecognized key: "${H}"`);if(!Q[H])continue;V[H]=$?new $({type:"optional",innerType:W[H]}):W[H]}else for(let H in W)V[H]=$?new $({type:"optional",innerType:W[H]}):W[H];return SX(this,"shape",V),V},checks:[]});return a$(Y,K)}function v60($,Y,Q){let X=bQ(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 SX(this,"shape",Z),Z}});return a$(Y,X)}function EX($,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 xM($,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 I9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function E2($){return typeof $==="string"?$:$?.message}function o$($,Y,Q){let X=$.message?$.message:E2($.inst?._zod.def?.error?.($))??E2(Y?.error?.($))??E2(Q.customError?.($))??E2(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 y2($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function h2($){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 LK(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function b60($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function Vd($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function Hd($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function A60($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return Vd(Y+Q)}function _60($){return Hd($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function R60($){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 T60($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class Gd{constructor(...$){}}var Jd=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,DK,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},g2=y("$ZodError",Jd),M9=y("$ZodError",Jd,{Parent:Error});function m2($,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 p2($,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 V=Q,H=0;while(H<W.length){let G=W[H];if(H!==W.length-1)V[G]=V[G]||{_errors:[]};else V[G]=V[G]||{_errors:[]},V[G]._errors.push(Y(K));V=V[G],H++}}}};return X($),Q}function BM($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let V of z.issues)if(V.code==="invalid_union"&&V.errors.length)V.errors.map((H)=>X({issues:H},[...Z,...V.path]));else if(V.code==="invalid_key")X({issues:V.issues},[...Z,...V.path]);else if(V.code==="invalid_element")X({issues:V.issues},[...Z,...V.path]);else{let H=[...Z,...V.path];if(H.length===0){Q.errors.push(Y(V));continue}let G=Q,J=0;while(J<H.length){let w=H[J],U=J===H.length-1;if(typeof w==="string")G.properties??(G.properties={}),(K=G.properties)[w]??(K[w]={errors:[]}),G=G.properties[w];else G.items??(G.items=[]),(W=G.items)[w]??(W[w]={errors:[]}),G=G.items[w];if(U)G.errors.push(Y(V));J++}}};return X($),Q}function wd($){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 qM($){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 ${wd(X.path)}`);return Y.join(`
|
|
484
|
+
*/var UI=pr1(),hL6=v("events").EventEmitter,Ze1=lr1(),Ke1=as1(),We1=Vl(),Ve1=It1(),He1=Qe1();i7=Ge1.exports=gL6;function gL6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return Ze1($,hL6.prototype,!1),Ze1($,Ke1,!1),$.request=Object.create(Ve1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(He1,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=Ke1;i7.request=Ve1;i7.response=He1;i7.Route=We1.Route;i7.Router=We1;i7.json=UI.json;i7.raw=UI.raw;i7.static=ze1();i7.text=UI.text;i7.urlencoded=UI.urlencoded});var je1=x((Q8)=>{var mL6=Q8&&Q8.__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]}),pL6=Q8&&Q8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),xe1=Q8&&Q8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))mL6(Y,$,Q)}return pL6(Y,$),Y},xI=Q8&&Q8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.buildBodyParserMiddleware=Q8.verifySignatureAndParseBody=Q8.verifySignatureAndParseRawBody=Q8.respondToUrlVerification=Q8.respondToSslCheck=void 0;var iL6=xI(v("crypto")),lL6=v("http"),nL6=v("https"),dL6=xI(v("querystring")),we1=L$(),aL6=fw(),Ue1=xe1(Je1()),oL6=xI(_P()),rL6=xI(RP()),qQ=P$(),v2=xe1(pw()),sL6=kP(),tL6=fP(),eL6=["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"],bl="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",$N6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};Q8.respondToSslCheck=$N6;var YN6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};Q8.respondToUrlVerification=YN6;class Be1{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=we1.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:V=void 0,redirectUri:H=void 0,installationStore:G=void 0,scopes:J=void 0,installerOptions:w={},app:U=void 0,router:B=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:q=v2.defaultAsyncDispatchErrorHandler,processEventErrorHandler:F=v2.defaultProcessEventErrorHandler,unhandledRequestHandler:P=v2.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:L=3001}){if(this.app=U!==void 0?U:(0,Ue1.default)(),typeof Y<"u")this.logger=Y;else this.logger=new we1.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let O=[this.signatureVerification?qe1(this.logger,$):Fe1(this.logger),Q8.respondToSslCheck,Q8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let m=typeof X==="string"?[X]:Object.values(X);this.router=B!==void 0?B:(0,Ue1.Router)();for(let H1 of m)this.router.post(H1,...O);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=q,this.processEventErrorHandler=F,this.unhandledRequestHandler=P,this.unhandledRequestTimeoutMillis=L,(0,tL6.verifyRedirectOpts)({redirectUri:H,redirectUriPath:w.redirectUriPath}),K!==void 0&&W!==void 0&&(w.stateVerification===!1||V!==void 0||w.stateStore!==void 0))this.installer=new aL6.InstallProvider({clientId:K,clientSecret:W,stateSecret:V,installationStore:G,logLevel:Q,logger:Y,directInstall:w.directInstall,stateStore:w.stateStore,stateVerification:w.stateVerification,legacyStateVerification:w.legacyStateVerification,stateCookieName:w.stateCookieName,stateCookieExpirationSeconds:w.stateCookieExpirationSeconds,renderHtmlForInstallPath:w.renderHtmlForInstallPath,authVersion:w.authVersion??"v2",clientOptions:w.clientOptions,authorizationUrl:w.authorizationUrl});let V1={metadata:w.metadata,scopes:J??[],userScopes:w.userScopes,redirectUri:H};if(this.installer!==void 0){let{installer:H1}=this,p=w.redirectUriPath===void 0?"/slack/oauth_redirect":w.redirectUriPath,{callbackOptions:i,stateVerification:X1}=w;this.router.use(p,async(I1,O1)=>{try{if(X1===!1)await H1.handleCallback(I1,O1,i,V1);else await H1.handleCallback(I1,O1,i)}catch(S1){await this.dispatchErrorHandler({error:S1,logger:this.logger,request:I1,response:O1})}});let G1=w.installPath===void 0?"/slack/install":w.installPath,{installPathOptions:A1}=w;this.router.get(G1,async(I1,O1,S1)=>{try{try{await H1.handleInstallPath(I1,O1,A1,V1)}catch(f1){S1(f1)}}catch(f1){await this.dispatchErrorHandler({error:f1,logger:this.logger,request:I1,response:O1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new sL6.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:v2.extractRetryNumFromHTTPRequest($),retryReason:v2.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)v2.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=lL6.createServer;if(Object.keys(Y).filter((X)=>eL6.includes(X)).length>0)Q=nL6.createServer;if(this.server!==void 0)return Promise.reject(new qQ.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 qQ.ReceiverInconsistentStateError(bl);this.server.on("error",(Z)=>{if(this.server===void 0)throw new qQ.ReceiverInconsistentStateError(bl);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new qQ.ReceiverInconsistentStateError(bl));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new qQ.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,$()})})}}Q8.default=Be1;function QN6($,Y){return qe1($,Y)}Q8.verifySignatureAndParseRawBody=QN6;function qe1($,Y){return async(Q,X,z)=>{let Z=await Ne1(Q);try{Q.body=De1(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof qQ.ReceiverAuthenticityError){Al($,"Request verification failed",K),X.status(401).send();return}Al($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function Al($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function XN6($,Y,Q,X){if(Q===void 0||X===void 0)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=iL6.default.createHmac("sha256",$),[W,V]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,rL6.default)(V,K.digest("hex")))throw new qQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function De1($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return XN6($,Y,X,z),Le1(Y,Z)}Q8.verifySignatureAndParseBody=De1;function Fe1($){return async(Y,Q,X)=>{let z=await Ne1(Y);try{let{"content-type":Z}=Y.headers;Y.body=Le1(z,Z)}catch(Z){if(Z){Al($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}Q8.buildBodyParserMiddleware=Fe1;function Le1($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=dL6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function Ne1($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,oL6.default)($)).toString()}});var ve1=x((Me1)=>{Object.defineProperty(Me1,"__esModule",{value:!0});Me1.DefaultThreadContextStore=void 0;var Pe1=_l();class Ie1{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,Pe1.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let V=W.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);return(V?.metadata?V.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,Pe1.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let V=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!V.messages)return;let H=V.messages.find((G)=>!("subtype"in G)&&G.user===Y.botUserId);if(H?.ts){let G={channel:Z,ts:H.ts,text:H.text,blocks:H.blocks?H.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(G)}this.context=W}}Me1.DefaultThreadContextStore=Ie1});var _l=x((u8)=>{var zN6=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 ZN6=ve1(),be1=Cg(),QK=P$(),BI=Fj(),KN6=zN6(Lj()),WN6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class Ae1{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){Se1($);let{threadContextStore:Y=new ZN6.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(Re1($)&&Te1($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=_e1(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return fe1(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=Ae1;function _e1($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=VN6(z),z.sayStream=HN6(z),z.setStatus=GN6(z),z.setSuggestedPrompts=JN6(z),z.setTitle=wN6(z),z}u8.enrichAssistantArgs=_e1;function Re1($){return WN6.has($.payload.type)}u8.isAssistantEvent=Re1;function Te1($){return $.payload.type==="message"?ke1($.payload):!0}u8.matchesConstraints=Te1;function ke1($){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=ke1;function Se1($){if(typeof $!=="object")throw new QK.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 QK.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 QK.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new QK.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 QK.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let V=`threadContextStore ${W} property must be a function`;throw new QK.AssistantInitializationError(V)}}}u8.validate=Se1;async function fe1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,KN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}u8.processAssistantMiddleware=fe1;function VN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=b2(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),V=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||V.metadata)V.metadata={event_type:V.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...V.metadata?.event_payload??{}}};return Y.chat.postMessage(V)}}function HN6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=b2(X);return(0,be1.createSayStream)(Y,Q,z,Z)}function GN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(0,be1.createSetStatus)(Y,X,z)}function JN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(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 wN6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=b2(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function b2($){let Y={};if("assistant_thread"in $&&(0,BI.isRecord)($.assistant_thread)){if((0,BI.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,BI.extractEventChannelId)($),X=(0,BI.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new QK.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}u8.extractThreadInfo=b2});var he1=x((a9)=>{var UN6=a9&&a9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(a9,"__esModule",{value:!0});a9.prepareStepArgs=a9.isStepEvent=a9.processStepMiddleware=a9.validate=a9.WorkflowStep=void 0;var qI=P$(),xN6=UN6(Lj()),BN6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class Ee1{callbackId;edit;save;execute;constructor($,Y){Ce1($,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(ce1($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=ye1($),X=this.getStepMiddleware(Y);return ue1(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[]}}}a9.WorkflowStep=Ee1;function Ce1($,Y){if(typeof $!=="string")throw new qI.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new qI.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 qI.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 qI.WorkflowStepInitializationError(K)}}a9.validate=Ce1;async function ue1($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,xN6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}a9.processStepMiddleware=ue1;function ce1($){return BN6.has($.payload.type)}a9.isStepEvent=ce1;function DI($){return $.botToken!==void 0?$.botToken:$.userToken}function qN6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=DI(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function DN6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=DI(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function FN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=DI(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function LN6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=DI(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function ye1($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=qN6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=DN6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=FN6(X),X.fail=LN6(X);break;default:break}return X}a9.prepareStepArgs=ye1});var le1=x((Q0)=>{var ge1=Q0&&Q0.__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]}),NN6=Q0&&Q0.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),Rl=Q0&&Q0.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))ge1(Y,$,Q)}return NN6(Y,$),Y},Tl=Q0&&Q0.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))ge1(Y,$,Q)},xU=Q0&&Q0.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Q0,"__esModule",{value:!0});Q0.webApi=Q0.types=Q0.FileInstallationStore=Q0.MemoryInstallationStore=Q0.WorkflowStep=Q0.Assistant=Q0.buildReceiverRoutes=Q0.MemoryStore=Q0.defaultProcessEventErrorHandler=Q0.HTTPResponseAck=Q0.HTTPModuleFunctions=Q0.AwsLambdaReceiver=Q0.HTTPReceiver=Q0.SocketModeReceiver=Q0.ExpressReceiver=Q0.isValidSlackRequest=Q0.verifySlackRequest=Q0.App=Q0.LogLevel=void 0;var me1=xU(ji());Q0.App=me1.default;var jN6=ji();Object.defineProperty(Q0,"LogLevel",{enumerable:!0,get:function(){return jN6.LogLevel}});Q0.default=me1.default;var pe1=Wi();Object.defineProperty(Q0,"verifySlackRequest",{enumerable:!0,get:function(){return pe1.verifySlackRequest}});Object.defineProperty(Q0,"isValidSlackRequest",{enumerable:!0,get:function(){return pe1.isValidSlackRequest}});var PN6=xU(Jo1());Q0.AwsLambdaReceiver=PN6.default;var IN6=xU(je1());Q0.ExpressReceiver=IN6.default;var MN6=xU(Hi());Q0.HTTPReceiver=MN6.default;var ON6=xU(Bi());Q0.SocketModeReceiver=ON6.default;Q0.HTTPModuleFunctions=Rl(pw());var vN6=kP();Object.defineProperty(Q0,"HTTPResponseAck",{enumerable:!0,get:function(){return vN6.HTTPResponseAck}});var bN6=xi();Object.defineProperty(Q0,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return bN6.defaultProcessEventErrorHandler}});Tl(P$(),Q0);Tl(Dj(),Q0);Tl(Di(),Q0);var AN6=ug();Object.defineProperty(Q0,"MemoryStore",{enumerable:!0,get:function(){return AN6.MemoryStore}});var _N6=SP();Object.defineProperty(Q0,"buildReceiverRoutes",{enumerable:!0,get:function(){return _N6.buildReceiverRoutes}});var RN6=_l();Object.defineProperty(Q0,"Assistant",{enumerable:!0,get:function(){return RN6.Assistant}});var TN6=he1();Object.defineProperty(Q0,"WorkflowStep",{enumerable:!0,get:function(){return TN6.WorkflowStep}});var ie1=fw();Object.defineProperty(Q0,"MemoryInstallationStore",{enumerable:!0,get:function(){return ie1.MemoryInstallationStore}});Object.defineProperty(Q0,"FileInstallationStore",{enumerable:!0,get:function(){return ie1.FileInstallationStore}});Q0.types=Rl(Og());Q0.webApi=Rl(qj())});import{homedir as KP6}from"os";var Zd={name:"@interactive-inc/claude-funnel",version:"0.40.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"},"./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"},"./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"},engines:{bun:">=1.3.0"}};var W0=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={};s7(N,{xor:()=>ua,xid:()=>Ka,void:()=>Ta,uuidv7:()=>td,uuidv6:()=>sd,uuidv4:()=>rd,uuid:()=>od,util:()=>D1,url:()=>ed,uppercase:()=>AK,unknown:()=>NZ,union:()=>VB,undefined:()=>_a,ulid:()=>Za,uint64:()=>ba,uint32:()=>Ma,tuple:()=>MA,trim:()=>fK,treeifyError:()=>BM,transform:()=>GB,toUpperCase:()=>CK,toLowerCase:()=>EK,toJSONSchema:()=>Ex,templateLiteral:()=>sa,symbol:()=>Aa,superRefine:()=>tA,success:()=>da,stringbool:()=>Zo,stringFormat:()=>Da,string:()=>zV,strictObject:()=>Ea,startsWith:()=>RK,slugify:()=>uK,size:()=>DZ,setErrorMap:()=>h$0,set:()=>ma,safeParseAsync:()=>tb,safeParse:()=>sb,safeEncodeAsync:()=>ZA,safeEncode:()=>XA,safeDecodeAsync:()=>KA,safeDecode:()=>zA,registry:()=>Kx,regexes:()=>t9,regex:()=>vK,refine:()=>sA,record:()=>OA,readonly:()=>lA,property:()=>Tx,promise:()=>ta,prettifyError:()=>qM,preprocess:()=>Wo,prefault:()=>uA,positive:()=>bx,pipe:()=>mx,partialRecord:()=>ya,parseAsync:()=>rb,parse:()=>ob,overwrite:()=>t7,optional:()=>KV,object:()=>fa,number:()=>VA,nullish:()=>na,nullable:()=>WV,null:()=>UA,normalize:()=>SK,nonpositive:()=>_x,nonoptional:()=>cA,nonnegative:()=>Rx,never:()=>WB,negative:()=>Ax,nativeEnum:()=>pa,nanoid:()=>Qa,nan:()=>aa,multipleOf:()=>CX,minSize:()=>uY,minLength:()=>AQ,mime:()=>kK,meta:()=>Xo,maxSize:()=>uX,maxLength:()=>FZ,map:()=>ga,mac:()=>Ha,lte:()=>e9,lt:()=>EY,lowercase:()=>bK,looseRecord:()=>ha,looseObject:()=>Ca,locales:()=>$V,literal:()=>ia,length:()=>LZ,lazy:()=>aA,ksuid:()=>Wa,keyof:()=>Sa,jwt:()=>qa,json:()=>Ko,iso:()=>hK,ipv6:()=>Ga,ipv4:()=>Va,invertCodec:()=>ra,intersection:()=>PA,int64:()=>va,int32:()=>Ia,int:()=>gx,instanceof:()=>zo,includes:()=>_K,httpUrl:()=>$a,hostname:()=>Fa,hex:()=>La,hash:()=>Na,guid:()=>ad,gte:()=>r$,gt:()=>CY,globalRegistry:()=>W$,getErrorMap:()=>g$0,function:()=>ea,fromJSONSchema:()=>Ho,formatError:()=>p2,float64:()=>Pa,float32:()=>ja,flattenError:()=>m2,file:()=>la,exactOptional:()=>kA,enum:()=>HB,endsWith:()=>TK,encodeAsync:()=>YA,encode:()=>eb,emoji:()=>Ya,email:()=>dd,e164:()=>Ba,discriminatedUnion:()=>ca,describe:()=>Qo,decodeAsync:()=>QA,decode:()=>$A,date:()=>ka,custom:()=>Yo,cuid2:()=>za,cuid:()=>Xa,core:()=>_Q,config:()=>K8,coerce:()=>$_,codec:()=>oa,clone:()=>a$,cidrv6:()=>wa,cidrv4:()=>Ja,check:()=>$o,catch:()=>gA,boolean:()=>HA,bigint:()=>Oa,base64url:()=>xa,base64:()=>Ua,array:()=>JV,any:()=>Ra,_function:()=>ea,_default:()=>EA,_ZodString:()=>px,ZodXor:()=>LA,ZodXID:()=>rx,ZodVoid:()=>DA,ZodUnknown:()=>BA,ZodUnion:()=>UV,ZodUndefined:()=>JA,ZodUUID:()=>cY,ZodURL:()=>HV,ZodULID:()=>ox,ZodType:()=>N0,ZodTuple:()=>IA,ZodTransform:()=>RA,ZodTemplateLiteral:()=>nA,ZodSymbol:()=>GA,ZodSuccess:()=>yA,ZodStringFormat:()=>G6,ZodString:()=>pK,ZodSet:()=>bA,ZodRecord:()=>gK,ZodRealError:()=>O9,ZodReadonly:()=>iA,ZodPromise:()=>oA,ZodPreprocess:()=>pA,ZodPrefault:()=>CA,ZodPipe:()=>xV,ZodOptional:()=>JB,ZodObject:()=>wV,ZodNumberFormat:()=>jZ,ZodNumber:()=>lK,ZodNullable:()=>SA,ZodNull:()=>wA,ZodNonOptional:()=>wB,ZodNever:()=>qA,ZodNanoID:()=>nx,ZodNaN:()=>mA,ZodMap:()=>vA,ZodMAC:()=>WA,ZodLiteral:()=>AA,ZodLazy:()=>dA,ZodKSUID:()=>sx,ZodJWT:()=>ZB,ZodIssueCode:()=>y$0,ZodIntersection:()=>jA,ZodISOTime:()=>yx,ZodISODuration:()=>hx,ZodISODateTime:()=>ux,ZodISODate:()=>cx,ZodIPv6:()=>ex,ZodIPv4:()=>tx,ZodGUID:()=>ZV,ZodFunction:()=>rA,ZodFirstPartyTypeKind:()=>eA,ZodFile:()=>_A,ZodExactOptional:()=>TA,ZodError:()=>u$0,ZodEnum:()=>mK,ZodEmoji:()=>lx,ZodEmail:()=>ix,ZodE164:()=>zB,ZodDiscriminatedUnion:()=>NA,ZodDefault:()=>fA,ZodDate:()=>GV,ZodCustomStringFormat:()=>iK,ZodCustom:()=>qV,ZodCodec:()=>BV,ZodCatch:()=>hA,ZodCUID2:()=>ax,ZodCUID:()=>dx,ZodCIDRv6:()=>YB,ZodCIDRv4:()=>$B,ZodBoolean:()=>nK,ZodBigIntFormat:()=>KB,ZodBigInt:()=>dK,ZodBase64URL:()=>XB,ZodBase64:()=>QB,ZodArray:()=>FA,ZodAny:()=>xA,TimePrecision:()=>Mv,NEVER:()=>XM,$output:()=>Fv,$input:()=>Lv,$brand:()=>zM});var _Q={};s7(_Q,{version:()=>w3,util:()=>D1,treeifyError:()=>BM,toJSONSchema:()=>Ex,toDotPath:()=>wd,safeParseAsync:()=>FM,safeParse:()=>DM,safeEncodeAsync:()=>y60,safeEncode:()=>u60,safeDecodeAsync:()=>h60,safeDecode:()=>c60,registry:()=>Kx,regexes:()=>t9,process:()=>K6,prettifyError:()=>qM,parseAsync:()=>cU,parse:()=>uU,meta:()=>zb,locales:()=>$V,isValidJWT:()=>fd,isValidBase64URL:()=>Sd,isValidBase64:()=>f3,initializeContext:()=>cX,globalRegistry:()=>W$,globalConfig:()=>wZ,formatError:()=>p2,flattenError:()=>m2,finalize:()=>hX,extractDefs:()=>yX,encodeAsync:()=>E60,encode:()=>S60,describe:()=>Xb,decodeAsync:()=>C60,decode:()=>f60,createToJSONSchemaMethod:()=>Kb,createStandardJSONSchemaMethod:()=>yK,config:()=>K8,clone:()=>a$,_xor:()=>U$0,_xid:()=>Dx,_void:()=>av,_uuidv7:()=>Jx,_uuidv6:()=>Gx,_uuidv4:()=>Hx,_uuid:()=>Vx,_url:()=>QV,_uppercase:()=>AK,_unknown:()=>nv,_union:()=>w$0,_undefined:()=>pv,_ulid:()=>qx,_uint64:()=>gv,_uint32:()=>Ev,_tuple:()=>q$0,_trim:()=>fK,_transform:()=>I$0,_toUpperCase:()=>CK,_toLowerCase:()=>EK,_templateLiteral:()=>k$0,_symbol:()=>mv,_superRefine:()=>Qb,_success:()=>A$0,_stringbool:()=>Zb,_stringFormat:()=>cK,_string:()=>jv,_startsWith:()=>RK,_slugify:()=>uK,_size:()=>DZ,_set:()=>L$0,_safeParseAsync:()=>IK,_safeParse:()=>PK,_safeEncodeAsync:()=>lU,_safeEncode:()=>pU,_safeDecodeAsync:()=>nU,_safeDecode:()=>iU,_regex:()=>vK,_refine:()=>Yb,_record:()=>D$0,_readonly:()=>T$0,_property:()=>Tx,_promise:()=>f$0,_positive:()=>bx,_pipe:()=>R$0,_parseAsync:()=>jK,_parse:()=>NK,_overwrite:()=>t7,_optional:()=>M$0,_number:()=>_v,_nullable:()=>O$0,_null:()=>iv,_normalize:()=>SK,_nonpositive:()=>_x,_nonoptional:()=>b$0,_nonnegative:()=>Rx,_never:()=>dv,_negative:()=>Ax,_nativeEnum:()=>j$0,_nanoid:()=>Ux,_nan:()=>sv,_multipleOf:()=>CX,_minSize:()=>uY,_minLength:()=>AQ,_min:()=>r$,_mime:()=>kK,_maxSize:()=>uX,_maxLength:()=>FZ,_max:()=>e9,_map:()=>F$0,_mac:()=>Iv,_lte:()=>e9,_lt:()=>EY,_lowercase:()=>bK,_literal:()=>P$0,_length:()=>LZ,_lazy:()=>S$0,_ksuid:()=>Fx,_jwt:()=>vx,_isoTime:()=>bv,_isoDuration:()=>Av,_isoDateTime:()=>Ov,_isoDate:()=>vv,_ipv6:()=>Nx,_ipv4:()=>Lx,_intersection:()=>B$0,_int64:()=>hv,_int32:()=>fv,_int:()=>Tv,_includes:()=>_K,_guid:()=>YV,_gte:()=>r$,_gt:()=>CY,_float64:()=>Sv,_float32:()=>kv,_file:()=>ev,_enum:()=>N$0,_endsWith:()=>TK,_encodeAsync:()=>gU,_encode:()=>yU,_emoji:()=>wx,_email:()=>Wx,_e164:()=>Ox,_discriminatedUnion:()=>x$0,_default:()=>v$0,_decodeAsync:()=>mU,_decode:()=>hU,_date:()=>ov,_custom:()=>$b,_cuid2:()=>Bx,_cuid:()=>xx,_coercedString:()=>Pv,_coercedNumber:()=>Rv,_coercedDate:()=>rv,_coercedBoolean:()=>uv,_coercedBigint:()=>yv,_cidrv6:()=>Px,_cidrv4:()=>jx,_check:()=>pd,_catch:()=>_$0,_boolean:()=>Cv,_bigint:()=>cv,_base64url:()=>Mx,_base64:()=>Ix,_array:()=>tv,_any:()=>lv,TimePrecision:()=>Mv,NEVER:()=>XM,JSONSchemaGenerator:()=>ib,JSONSchema:()=>id,Doc:()=>rU,$output:()=>Fv,$input:()=>Lv,$constructor:()=>y,$brand:()=>zM,$ZodXor:()=>t3,$ZodXID:()=>I3,$ZodVoid:()=>a3,$ZodUnknown:()=>n3,$ZodUnion:()=>a2,$ZodUndefined:()=>p3,$ZodUUID:()=>B3,$ZodURL:()=>D3,$ZodULID:()=>P3,$ZodType:()=>w0,$ZodTuple:()=>Xx,$ZodTransform:()=>WO,$ZodTemplateLiteral:()=>FO,$ZodSymbol:()=>m3,$ZodSuccess:()=>UO,$ZodStringFormat:()=>H6,$ZodString:()=>qZ,$ZodSet:()=>XO,$ZodRegistry:()=>Nv,$ZodRecord:()=>YO,$ZodRealError:()=>M9,$ZodReadonly:()=>DO,$ZodPromise:()=>NO,$ZodPreprocess:()=>qO,$ZodPrefault:()=>JO,$ZodPipe:()=>Zx,$ZodOptional:()=>zx,$ZodObjectJIT:()=>s3,$ZodObject:()=>ud,$ZodNumberFormat:()=>h3,$ZodNumber:()=>Yx,$ZodNullable:()=>HO,$ZodNull:()=>i3,$ZodNonOptional:()=>wO,$ZodNever:()=>d3,$ZodNanoID:()=>L3,$ZodNaN:()=>BO,$ZodMap:()=>QO,$ZodMAC:()=>T3,$ZodLiteral:()=>ZO,$ZodLazy:()=>jO,$ZodKSUID:()=>M3,$ZodJWT:()=>c3,$ZodIntersection:()=>$O,$ZodISOTime:()=>b3,$ZodISODuration:()=>A3,$ZodISODateTime:()=>O3,$ZodISODate:()=>v3,$ZodIPv6:()=>R3,$ZodIPv4:()=>_3,$ZodGUID:()=>x3,$ZodFunction:()=>LO,$ZodFile:()=>KO,$ZodExactOptional:()=>VO,$ZodError:()=>g2,$ZodEnum:()=>zO,$ZodEncodeError:()=>UZ,$ZodEmoji:()=>F3,$ZodEmail:()=>q3,$ZodE164:()=>u3,$ZodDiscriminatedUnion:()=>e3,$ZodDefault:()=>GO,$ZodDate:()=>o3,$ZodCustomStringFormat:()=>y3,$ZodCustom:()=>PO,$ZodCodec:()=>o2,$ZodCheckUpperCase:()=>Z3,$ZodCheckStringFormat:()=>MK,$ZodCheckStartsWith:()=>W3,$ZodCheckSizeEquals:()=>eM,$ZodCheckRegex:()=>X3,$ZodCheckProperty:()=>H3,$ZodCheckOverwrite:()=>J3,$ZodCheckNumberFormat:()=>oM,$ZodCheckMultipleOf:()=>aM,$ZodCheckMinSize:()=>tM,$ZodCheckMinLength:()=>Y3,$ZodCheckMimeType:()=>G3,$ZodCheckMaxSize:()=>sM,$ZodCheckMaxLength:()=>$3,$ZodCheckLowerCase:()=>z3,$ZodCheckLessThan:()=>aU,$ZodCheckLengthEquals:()=>Q3,$ZodCheckIncludes:()=>K3,$ZodCheckGreaterThan:()=>oU,$ZodCheckEndsWith:()=>V3,$ZodCheckBigIntFormat:()=>rM,$ZodCheck:()=>q6,$ZodCatch:()=>xO,$ZodCUID2:()=>j3,$ZodCUID:()=>N3,$ZodCIDRv6:()=>S3,$ZodCIDRv4:()=>k3,$ZodBoolean:()=>d2,$ZodBigIntFormat:()=>g3,$ZodBigInt:()=>Qx,$ZodBase64URL:()=>C3,$ZodBase64:()=>E3,$ZodAsyncError:()=>fY,$ZodArray:()=>r3,$ZodAny:()=>l3});var Kd,XM=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,V){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:V,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,V);let H=K.prototype,G=Object.keys(H);for(let J=0;J<G.length;J++){let w=G[J];if(!(w in W))W[w]=H[w].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var V;let H=Q?.Parent?new Z:this;X(H,W),(V=H._zod).deferred??(V.deferred=[]);for(let G of H._zod.deferred)G();return H}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 zM=Symbol("zod_brand");class fY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Kd=globalThis).__zod_globalConfig??(Kd.__zod_globalConfig={});var wZ=globalThis.__zod_globalConfig;function K8($){if($)Object.assign(wZ,$);return wZ}var D1={};s7(D1,{unwrapMessage:()=>E2,uint8ArrayToHex:()=>T60,uint8ArrayToBase64url:()=>_60,uint8ArrayToBase64:()=>Hd,stringifyPrimitive:()=>U1,slugify:()=>WM,shallowClone:()=>HM,safeExtend:()=>I60,required:()=>v60,randomString:()=>q60,propertyKeyTypes:()=>c2,promiseAllObject:()=>B60,primitiveTypes:()=>GM,prefixIssues:()=>I9,pick:()=>N60,partial:()=>O60,parsedType:()=>q1,optionalKeys:()=>JM,omit:()=>j60,objectClone:()=>w60,numKeys:()=>D60,nullish:()=>kX,normalizeParams:()=>j1,mergeDefs:()=>bQ,merge:()=>M60,jsonStringifyReplacer:()=>DK,joinValues:()=>n,issue:()=>LK,isPlainObject:()=>fX,isObject:()=>xZ,hexToUint8Array:()=>R60,getSizableOrigin:()=>y2,getParsedType:()=>F60,getLengthableOrigin:()=>h2,getEnumValues:()=>C2,getElementAtPath:()=>x60,floatSafeRemainder:()=>KM,finalizeIssue:()=>o$,extend:()=>P60,explicitlyAborted:()=>xM,escapeRegex:()=>B7,esc:()=>EU,defineLazy:()=>A0,createTransparentProxy:()=>L60,cloneDef:()=>U60,clone:()=>a$,cleanRegex:()=>u2,cleanEnum:()=>b60,captureStackTrace:()=>CU,cached:()=>FK,base64urlToUint8Array:()=>A60,base64ToUint8Array:()=>Vd,assignProp:()=>SX,assertNotEqual:()=>V60,assertNever:()=>G60,assertIs:()=>H60,assertEqual:()=>W60,assert:()=>J60,allowsEval:()=>VM,aborted:()=>EX,NUMBER_FORMAT_RANGES:()=>wM,Class:()=>Gd,BIGINT_FORMAT_RANGES:()=>UM});function W60($){return $}function V60($){return $}function H60($){}function G60($){throw Error("Unexpected value in exhaustive check")}function J60($){}function C2($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function n($,Y="|"){return $.map((Q)=>U1(Q)).join(Y)}function DK($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function FK($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function kX($){return $===null||$===void 0}function u2($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function KM($,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 Wd=Symbol("evaluating");function A0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===Wd)return;if(X===void 0)X=Wd,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function w60($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function SX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function bQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function U60($){return bQ($._zod.def)}function x60($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function B60($){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 q60($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function EU($){return JSON.stringify($)}function WM($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var CU="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function xZ($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var VM=FK(()=>{if(wZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function fX($){if(xZ($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(xZ(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function HM($){if(fX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function D60($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var F60=($)=>{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}`)}},c2=new Set(["string","number","symbol"]),GM=new Set(["string","number","bigint","boolean","symbol","undefined"]);function B7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function j1($){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 L60($){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 U1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function JM($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var wM={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]},UM={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function N60($,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=bQ($._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 SX(this,"shape",K),K},checks:[]});return a$($,Z)}function j60($,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=bQ($._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 SX(this,"shape",K),K},checks:[]});return a$($,Z)}function P60($,Y){if(!fX(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=bQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return SX(this,"shape",Z),Z}});return a$($,z)}function I60($,Y){if(!fX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return SX(this,"shape",X),X}});return a$($,Q)}function M60($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=bQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return SX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return a$($,Q)}function O60($,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=bQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,V={...W};if(Q)for(let H in Q){if(!(H in W))throw Error(`Unrecognized key: "${H}"`);if(!Q[H])continue;V[H]=$?new $({type:"optional",innerType:W[H]}):W[H]}else for(let H in W)V[H]=$?new $({type:"optional",innerType:W[H]}):W[H];return SX(this,"shape",V),V},checks:[]});return a$(Y,K)}function v60($,Y,Q){let X=bQ(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 SX(this,"shape",Z),Z}});return a$(Y,X)}function EX($,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 xM($,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 I9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function E2($){return typeof $==="string"?$:$?.message}function o$($,Y,Q){let X=$.message?$.message:E2($.inst?._zod.def?.error?.($))??E2(Y?.error?.($))??E2(Q.customError?.($))??E2(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 y2($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function h2($){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 LK(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function b60($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function Vd($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function Hd($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function A60($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return Vd(Y+Q)}function _60($){return Hd($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function R60($){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 T60($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class Gd{constructor(...$){}}var Jd=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,DK,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},g2=y("$ZodError",Jd),M9=y("$ZodError",Jd,{Parent:Error});function m2($,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 p2($,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 V=Q,H=0;while(H<W.length){let G=W[H];if(H!==W.length-1)V[G]=V[G]||{_errors:[]};else V[G]=V[G]||{_errors:[]},V[G]._errors.push(Y(K));V=V[G],H++}}}};return X($),Q}function BM($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let V of z.issues)if(V.code==="invalid_union"&&V.errors.length)V.errors.map((H)=>X({issues:H},[...Z,...V.path]));else if(V.code==="invalid_key")X({issues:V.issues},[...Z,...V.path]);else if(V.code==="invalid_element")X({issues:V.issues},[...Z,...V.path]);else{let H=[...Z,...V.path];if(H.length===0){Q.errors.push(Y(V));continue}let G=Q,J=0;while(J<H.length){let w=H[J],U=J===H.length-1;if(typeof w==="string")G.properties??(G.properties={}),(K=G.properties)[w]??(K[w]={errors:[]}),G=G.properties[w];else G.items??(G.items=[]),(W=G.items)[w]??(W[w]={errors:[]}),G=G.items[w];if(U)G.errors.push(Y(V));J++}}};return X($),Q}function wd($){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 qM($){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 ${wd(X.path)}`);return Y.join(`
|
|
485
485
|
`)}var NK=($)=>(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 fY;if(K.issues.length){let W=new(z?.Err??$)(K.issues.map((V)=>o$(V,Z,K8())));throw CU(W,z?.callee),W}return K.value},uU=NK(M9),jK=($)=>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((V)=>o$(V,Z,K8())));throw CU(W,z?.callee),W}return K.value},cU=jK(M9),PK=($)=>(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 fY;return Z.issues.length?{success:!1,error:new($??g2)(Z.issues.map((K)=>o$(K,z,K8())))}:{success:!0,data:Z.value}},DM=PK(M9),IK=($)=>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)=>o$(K,z,K8())))}:{success:!0,data:Z.value}},FM=IK(M9),yU=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return NK($)(Y,Q,z)},S60=yU(M9),hU=($)=>(Y,Q,X)=>{return NK($)(Y,Q,X)},f60=hU(M9),gU=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return jK($)(Y,Q,z)},E60=gU(M9),mU=($)=>async(Y,Q,X)=>{return jK($)(Y,Q,X)},C60=mU(M9),pU=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return PK($)(Y,Q,z)},u60=pU(M9),iU=($)=>(Y,Q,X)=>{return PK($)(Y,Q,X)},c60=iU(M9),lU=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return IK($)(Y,Q,z)},y60=lU(M9),nU=($)=>async(Y,Q,X)=>{return IK($)(Y,Q,X)},h60=nU(M9);var t9={};s7(t9,{xid:()=>PM,uuid7:()=>i60,uuid6:()=>p60,uuid4:()=>m60,uuid:()=>BZ,uppercase:()=>dM,unicodeEmail:()=>Ud,undefined:()=>lM,ulid:()=>jM,time:()=>cM,string:()=>hM,sha512_hex:()=>J80,sha512_base64url:()=>U80,sha512_base64:()=>w80,sha384_hex:()=>V80,sha384_base64url:()=>G80,sha384_base64:()=>H80,sha256_hex:()=>Z80,sha256_base64url:()=>W80,sha256_base64:()=>K80,sha1_hex:()=>Q80,sha1_base64url:()=>z80,sha1_base64:()=>X80,rfc5322Email:()=>n60,number:()=>i2,null:()=>iM,nanoid:()=>MM,md5_hex:()=>e60,md5_base64url:()=>Y80,md5_base64:()=>$80,mac:()=>TM,lowercase:()=>nM,ksuid:()=>IM,ipv6:()=>RM,ipv4:()=>_M,integer:()=>mM,idnEmail:()=>d60,httpProtocol:()=>EM,html5Email:()=>l60,hostname:()=>r60,hex:()=>t60,guid:()=>vM,extendedDuration:()=>g60,emoji:()=>AM,email:()=>bM,e164:()=>CM,duration:()=>OM,domain:()=>s60,datetime:()=>yM,date:()=>uM,cuid2:()=>NM,cuid:()=>LM,cidrv6:()=>SM,cidrv4:()=>kM,browserEmail:()=>a60,boolean:()=>pM,bigint:()=>gM,base64url:()=>dU,base64:()=>fM});var LM=/^[cC][0-9a-z]{6,}$/,NM=/^[0-9a-z]+$/,jM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,PM=/^[0-9a-vA-V]{20}$/,IM=/^[A-Za-z0-9]{27}$/,MM=/^[a-zA-Z0-9_-]{21}$/,OM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,g60=/^[-+]?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)?)??$/,vM=/^([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})$/,BZ=($)=>{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})$`)},m60=BZ(4),p60=BZ(6),i60=BZ(7),bM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,l60=/^[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])?)*$/,n60=/^(([^<>()\[\]\\.,;:\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,}))$/,Ud=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,d60=Ud,a60=/^[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])?)*$/,o60="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function AM(){return new RegExp(o60,"u")}var _M=/^(?:(?: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])$/,RM=/^(([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}|:))$/,TM=($)=>{let Y=B7($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},kM=/^((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])$/,SM=/^(([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])$/,fM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dU=/^[A-Za-z0-9_-]*$/,r60=/^(?=.{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])?)*\.?$/,s60=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,EM=/^https?$/,CM=/^\+[1-9]\d{6,14}$/,xd="(?:(?:\\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])))",uM=new RegExp(`^${xd}$`);function Bd($){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 cM($){return new RegExp(`^${Bd($)}$`)}function yM($){let Y=Bd({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(`^${xd}T(?:${X})$`)}var hM=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},gM=/^-?\d+n?$/,mM=/^-?\d+$/,i2=/^-?\d+(?:\.\d+)?$/,pM=/^(?:true|false)$/i,iM=/^null$/i;var lM=/^undefined$/i;var nM=/^[^A-Z]*$/,dM=/^[^a-z]*$/,t60=/^[0-9a-fA-F]*$/;function l2($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function n2($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var e60=/^[0-9a-fA-F]{32}$/,$80=l2(22,"=="),Y80=n2(22),Q80=/^[0-9a-fA-F]{40}$/,X80=l2(27,"="),z80=n2(27),Z80=/^[0-9a-fA-F]{64}$/,K80=l2(43,"="),W80=n2(43),V80=/^[0-9a-fA-F]{96}$/,H80=l2(64,""),G80=n2(64),J80=/^[0-9a-fA-F]{128}$/,w80=l2(86,"=="),U80=n2(86);var q6=y("$ZodCheck",($,Y)=>{var Q;$._zod??($._zod={}),$._zod.def=Y,(Q=$._zod).onattach??(Q.onattach=[])}),Dd={number:"number",bigint:"bigint",object:"date"},aU=y("$ZodCheckLessThan",($,Y)=>{q6.init($,Y);let Q=Dd[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})}}),oU=y("$ZodCheckGreaterThan",($,Y)=>{q6.init($,Y);let Q=Dd[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})}}),aM=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):KM(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})}}),oM=y("$ZodCheckNumberFormat",($,Y)=>{q6.init($,Y),Y.format=Y.format||"float64";let Q=Y.format?.includes("int"),X=Q?"int":"number",[z,Z]=wM[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=mM}),$._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})}}),rM=y("$ZodCheckBigIntFormat",($,Y)=>{q6.init($,Y);let[Q,X]=UM[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})}}),sM=y("$ZodCheckMaxSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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:y2(z),code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),tM=y("$ZodCheckMinSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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:y2(z),code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),eM=y("$ZodCheckSizeEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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:y2(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})}}),$3=y("$ZodCheckMaxLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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=h2(z);X.issues.push({origin:K,code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),Y3=y("$ZodCheckMinLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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=h2(z);X.issues.push({origin:K,code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),Q3=y("$ZodCheckLengthEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!kX(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=h2(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})}}),MK=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=()=>{})}),X3=y("$ZodCheckRegex",($,Y)=>{MK.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})}}),z3=y("$ZodCheckLowerCase",($,Y)=>{Y.pattern??(Y.pattern=nM),MK.init($,Y)}),Z3=y("$ZodCheckUpperCase",($,Y)=>{Y.pattern??(Y.pattern=dM),MK.init($,Y)}),K3=y("$ZodCheckIncludes",($,Y)=>{q6.init($,Y);let Q=B7(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})}}),W3=y("$ZodCheckStartsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`^${B7(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})}}),V3=y("$ZodCheckEndsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`.*${B7(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 qd($,Y,Q){if($.issues.length)Y.issues.push(...I9(Q,$.issues))}var H3=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)=>qd(z,Q,Y.property));qd(X,Q,Y.property);return}}),G3=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})}}),J3=y("$ZodCheckOverwrite",($,Y)=>{q6.init($,Y),$._zod.check=(Q)=>{Q.value=Y.tx(Q.value)}});class rU{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(`
|
|
486
486
|
`).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(`
|
|
487
487
|
`))}}var w3={major:4,minor:4,patch:3};var w0=y("$ZodType",($,Y)=>{var Q;$??($={}),$._zod.def=Y,$._zod.bag=$._zod.bag||{},$._zod.version=w3;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,V)=>{let H=EX(K),G;for(let J of W){if(J._zod.def.when){if(xM(K))continue;if(!J._zod.def.when(K))continue}else if(H)continue;let w=K.issues.length,U=J._zod.check(K);if(U instanceof Promise&&V?.async===!1)throw new fY;if(G||U instanceof Promise)G=(G??Promise.resolve()).then(async()=>{if(await U,K.issues.length===w)return;if(!H)H=EX(K,w)});else{if(K.issues.length===w)continue;if(!H)H=EX(K,w)}}if(G)return G.then(()=>{return K});return K},Z=(K,W,V)=>{if(EX(K))return K.aborted=!0,K;let H=z(W,X,V);if(H instanceof Promise){if(V.async===!1)throw new fY;return H.then((G)=>$._zod.parse(G,V))}return $._zod.parse(H,V)};$._zod.run=(K,W)=>{if(W.skipChecks)return $._zod.parse(K,W);if(W.direction==="backward"){let H=$._zod.parse({value:K.value,issues:[]},{...W,skipChecks:!0});if(H instanceof Promise)return H.then((G)=>{return Z(G,K,W)});return Z(H,K,W)}let V=$._zod.parse(K,W);if(V instanceof Promise){if(W.async===!1)throw new fY;return V.then((H)=>z(H,X,W))}return z(V,X,W)}}A0($,"~standard",()=>({validate:(z)=>{try{let Z=DM($,z);return Z.success?{value:Z.data}:{issues:Z.error?.issues}}catch(Z){return FM($,z).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),qZ=y("$ZodString",($,Y)=>{w0.init($,Y),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??hM($._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}}),H6=y("$ZodStringFormat",($,Y)=>{MK.init($,Y),qZ.init($,Y)}),x3=y("$ZodGUID",($,Y)=>{Y.pattern??(Y.pattern=vM),H6.init($,Y)}),B3=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=BZ(X))}else Y.pattern??(Y.pattern=BZ());H6.init($,Y)}),q3=y("$ZodEmail",($,Y)=>{Y.pattern??(Y.pattern=bM),H6.init($,Y)}),D3=y("$ZodURL",($,Y)=>{H6.init($,Y),$._zod.check=(Q)=>{try{let X=Q.value.trim();if(!Y.normalize&&Y.protocol?.source===EM.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})}}}),F3=y("$ZodEmoji",($,Y)=>{Y.pattern??(Y.pattern=AM()),H6.init($,Y)}),L3=y("$ZodNanoID",($,Y)=>{Y.pattern??(Y.pattern=MM),H6.init($,Y)}),N3=y("$ZodCUID",($,Y)=>{Y.pattern??(Y.pattern=LM),H6.init($,Y)}),j3=y("$ZodCUID2",($,Y)=>{Y.pattern??(Y.pattern=NM),H6.init($,Y)}),P3=y("$ZodULID",($,Y)=>{Y.pattern??(Y.pattern=jM),H6.init($,Y)}),I3=y("$ZodXID",($,Y)=>{Y.pattern??(Y.pattern=PM),H6.init($,Y)}),M3=y("$ZodKSUID",($,Y)=>{Y.pattern??(Y.pattern=IM),H6.init($,Y)}),O3=y("$ZodISODateTime",($,Y)=>{Y.pattern??(Y.pattern=yM(Y)),H6.init($,Y)}),v3=y("$ZodISODate",($,Y)=>{Y.pattern??(Y.pattern=uM),H6.init($,Y)}),b3=y("$ZodISOTime",($,Y)=>{Y.pattern??(Y.pattern=cM(Y)),H6.init($,Y)}),A3=y("$ZodISODuration",($,Y)=>{Y.pattern??(Y.pattern=OM),H6.init($,Y)}),_3=y("$ZodIPv4",($,Y)=>{Y.pattern??(Y.pattern=_M),H6.init($,Y),$._zod.bag.format="ipv4"}),R3=y("$ZodIPv6",($,Y)=>{Y.pattern??(Y.pattern=RM),H6.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})}}}),T3=y("$ZodMAC",($,Y)=>{Y.pattern??(Y.pattern=TM(Y.delimiter)),H6.init($,Y),$._zod.bag.format="mac"}),k3=y("$ZodCIDRv4",($,Y)=>{Y.pattern??(Y.pattern=kM),H6.init($,Y)}),S3=y("$ZodCIDRv6",($,Y)=>{Y.pattern??(Y.pattern=SM),H6.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 f3($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var E3=y("$ZodBase64",($,Y)=>{Y.pattern??(Y.pattern=fM),H6.init($,Y),$._zod.bag.contentEncoding="base64",$._zod.check=(Q)=>{if(f3(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64",input:Q.value,inst:$,continue:!Y.abort})}});function Sd($){if(!dU.test($))return!1;let Y=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),Q=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return f3(Q)}var C3=y("$ZodBase64URL",($,Y)=>{Y.pattern??(Y.pattern=dU),H6.init($,Y),$._zod.bag.contentEncoding="base64url",$._zod.check=(Q)=>{if(Sd(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64url",input:Q.value,inst:$,continue:!Y.abort})}}),u3=y("$ZodE164",($,Y)=>{Y.pattern??(Y.pattern=CM),H6.init($,Y)});function fd($,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 c3=y("$ZodJWT",($,Y)=>{H6.init($,Y),$._zod.check=(Q)=>{if(fd(Q.value,Y.alg))return;Q.issues.push({code:"invalid_format",format:"jwt",input:Q.value,inst:$,continue:!Y.abort})}}),y3=y("$ZodCustomStringFormat",($,Y)=>{H6.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})}}),Yx=y("$ZodNumber",($,Y)=>{w0.init($,Y),$._zod.pattern=$._zod.bag.pattern??i2,$._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}}),h3=y("$ZodNumberFormat",($,Y)=>{oM.init($,Y),Yx.init($,Y)}),d2=y("$ZodBoolean",($,Y)=>{w0.init($,Y),$._zod.pattern=pM,$._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}}),Qx=y("$ZodBigInt",($,Y)=>{w0.init($,Y),$._zod.pattern=gM,$._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}}),g3=y("$ZodBigIntFormat",($,Y)=>{rM.init($,Y),Qx.init($,Y)}),m3=y("$ZodSymbol",($,Y)=>{w0.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}}),p3=y("$ZodUndefined",($,Y)=>{w0.init($,Y),$._zod.pattern=lM,$._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}}),i3=y("$ZodNull",($,Y)=>{w0.init($,Y),$._zod.pattern=iM,$._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}}),l3=y("$ZodAny",($,Y)=>{w0.init($,Y),$._zod.parse=(Q)=>Q}),n3=y("$ZodUnknown",($,Y)=>{w0.init($,Y),$._zod.parse=(Q)=>Q}),d3=y("$ZodNever",($,Y)=>{w0.init($,Y),$._zod.parse=(Q,X)=>{return Q.issues.push({expected:"never",code:"invalid_type",input:Q.value,inst:$}),Q}}),a3=y("$ZodVoid",($,Y)=>{w0.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}}),o3=y("$ZodDate",($,Y)=>{w0.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 Ld($,Y,Q){if($.issues.length)Y.issues.push(...I9(Q,$.issues));Y.value[Q]=$.value}var r3=y("$ZodArray",($,Y)=>{w0.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],V=Y.element._zod.run({value:W,issues:[]},X);if(V instanceof Promise)Z.push(V.then((H)=>Ld(H,Q,K)));else Ld(V,Q,K)}if(Z.length)return Promise.all(Z).then(()=>Q);return Q}});function $x($,Y,Q,X,z,Z){let K=Q in X;if($.issues.length){if(z&&Z&&!K)return;Y.issues.push(...I9(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 Ed($){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=JM($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(Q)}}function Cd($,Y,Q,X,z,Z){let K=[],W=z.keySet,V=z.catchall._zod,H=V.def.type,G=V.optin==="optional",J=V.optout==="optional";for(let w in Y){if(w==="__proto__")continue;if(W.has(w))continue;if(H==="never"){K.push(w);continue}let U=V.run({value:Y[w],issues:[]},X);if(U instanceof Promise)$.push(U.then((B)=>$x(B,Q,w,Y,G,J)));else $x(U,Q,w,Y,G,J)}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 ud=y("$ZodObject",($,Y)=>{if(w0.init($,Y),!Object.getOwnPropertyDescriptor(Y,"shape")?.get){let W=Y.shape;Object.defineProperty(Y,"shape",{get:()=>{let V={...W};return Object.defineProperty(Y,"shape",{value:V}),V}})}let X=FK(()=>Ed(Y));A0($._zod,"propValues",()=>{let W=Y.shape,V={};for(let H in W){let G=W[H]._zod;if(G.values){V[H]??(V[H]=new Set);for(let J of G.values)V[H].add(J)}}return V});let z=xZ,Z=Y.catchall,K;$._zod.parse=(W,V)=>{K??(K=X.value);let H=W.value;if(!z(H))return W.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),W;W.value={};let G=[],J=K.shape;for(let w of K.keys){let U=J[w],B=U._zod.optin==="optional",D=U._zod.optout==="optional",q=U._zod.run({value:H[w],issues:[]},V);if(q instanceof Promise)G.push(q.then((F)=>$x(F,W,w,H,B,D)));else $x(q,W,w,H,B,D)}if(!Z)return G.length?Promise.all(G).then(()=>W):W;return Cd(G,H,W,V,X.value,$)}}),s3=y("$ZodObjectJIT",($,Y)=>{ud.init($,Y);let Q=$._zod.parse,X=FK(()=>Ed(Y)),z=(w)=>{let U=new rU(["shape","payload","ctx"]),B=X.value,D=(L)=>{let I=EU(L);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};U.write("const input = payload.value;");let q=Object.create(null),F=0;for(let L of B.keys)q[L]=`key_${F++}`;U.write("const newResult = {};");for(let L of B.keys){let I=q[L],O=EU(L),m=w[L],V1=m?._zod?.optin==="optional",H1=m?._zod?.optout==="optional";if(U.write(`const ${I} = ${D(L)};`),V1&&H1)U.write(`
|
package/dist/index.d.ts
CHANGED
|
@@ -2372,7 +2372,7 @@ declare const routes: _$hono_hono_base0.HonoBase<Env, {
|
|
|
2372
2372
|
connectors: {
|
|
2373
2373
|
id: string;
|
|
2374
2374
|
name: string;
|
|
2375
|
-
type: "discord" | "
|
|
2375
|
+
type: "discord" | "schedule" | "slack" | "gh";
|
|
2376
2376
|
}[];
|
|
2377
2377
|
}[];
|
|
2378
2378
|
outputFormat: "json";
|
package/package.json
CHANGED