UNPKG

svix-react

Version:

React components for using Svix in your dashboard.

21 lines (20 loc) 39.8 kB
(function(U,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("svix")):typeof define=="function"&&define.amd?define(["exports","react","svix"],b):(U=typeof globalThis<"u"?globalThis:U||self,b(U.SvixReact={},U.React,U.svix))})(this,function(U,b,ft){"use strict";function lt(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const oe=lt(b);function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={exports:{}},Re={exports:{}},N={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ge;function pt(){if(Ge)return N;Ge=1;var e=typeof Symbol=="function"&&Symbol.for,i=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,v=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,M=e?Symbol.for("react.suspense"):60113,t=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,W=e?Symbol.for("react.lazy"):60116,$=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,Z=e?Symbol.for("react.responder"):60118,ye=e?Symbol.for("react.scope"):60119;function G(d){if(typeof d=="object"&&d!==null){var P=d.$$typeof;switch(P){case i:switch(d=d.type,d){case v:case m:case o:case s:case a:case M:return d;default:switch(d=d&&d.$$typeof,d){case c:case h:case W:case R:case f:return d;default:return P}}case r:return P}}}function X(d){return G(d)===m}return N.AsyncMode=v,N.ConcurrentMode=m,N.ContextConsumer=c,N.ContextProvider=f,N.Element=i,N.ForwardRef=h,N.Fragment=o,N.Lazy=W,N.Memo=R,N.Portal=r,N.Profiler=s,N.StrictMode=a,N.Suspense=M,N.isAsyncMode=function(d){return X(d)||G(d)===v},N.isConcurrentMode=X,N.isContextConsumer=function(d){return G(d)===c},N.isContextProvider=function(d){return G(d)===f},N.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===i},N.isForwardRef=function(d){return G(d)===h},N.isFragment=function(d){return G(d)===o},N.isLazy=function(d){return G(d)===W},N.isMemo=function(d){return G(d)===R},N.isPortal=function(d){return G(d)===r},N.isProfiler=function(d){return G(d)===s},N.isStrictMode=function(d){return G(d)===a},N.isSuspense=function(d){return G(d)===M},N.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===o||d===m||d===s||d===a||d===M||d===t||typeof d=="object"&&d!==null&&(d.$$typeof===W||d.$$typeof===R||d.$$typeof===f||d.$$typeof===c||d.$$typeof===h||d.$$typeof===O||d.$$typeof===Z||d.$$typeof===ye||d.$$typeof===$)},N.typeOf=G,N}var q={};/** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Qe;function gt(){return Qe||(Qe=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,i=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,a=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,v=e?Symbol.for("react.async_mode"):60111,m=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,M=e?Symbol.for("react.suspense"):60113,t=e?Symbol.for("react.suspense_list"):60120,R=e?Symbol.for("react.memo"):60115,W=e?Symbol.for("react.lazy"):60116,$=e?Symbol.for("react.block"):60121,O=e?Symbol.for("react.fundamental"):60117,Z=e?Symbol.for("react.responder"):60118,ye=e?Symbol.for("react.scope"):60119;function G(y){return typeof y=="string"||typeof y=="function"||y===o||y===m||y===s||y===a||y===M||y===t||typeof y=="object"&&y!==null&&(y.$$typeof===W||y.$$typeof===R||y.$$typeof===f||y.$$typeof===c||y.$$typeof===h||y.$$typeof===O||y.$$typeof===Z||y.$$typeof===ye||y.$$typeof===$)}function X(y){if(typeof y=="object"&&y!==null){var n=y.$$typeof;switch(n){case i:var l=y.type;switch(l){case v:case m:case o:case s:case a:case M:return l;default:var C=l&&l.$$typeof;switch(C){case c:case h:case W:case R:case f:return C;default:return n}}case r:return n}}}var d=v,P=m,Me=c,ie=f,he=i,Ce=h,be=o,Se=W,ce=R,Oe=r,ae=s,pe=a,Pe=M,we=!1;function u(y){return we||(we=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),p(y)||X(y)===v}function p(y){return X(y)===m}function I(y){return X(y)===c}function F(y){return X(y)===f}function x(y){return typeof y=="object"&&y!==null&&y.$$typeof===i}function j(y){return X(y)===h}function _(y){return X(y)===o}function k(y){return X(y)===W}function L(y){return X(y)===R}function D(y){return X(y)===r}function Y(y){return X(y)===s}function se(y){return X(y)===a}function ne(y){return X(y)===M}q.AsyncMode=d,q.ConcurrentMode=P,q.ContextConsumer=Me,q.ContextProvider=ie,q.Element=he,q.ForwardRef=Ce,q.Fragment=be,q.Lazy=Se,q.Memo=ce,q.Portal=Oe,q.Profiler=ae,q.StrictMode=pe,q.Suspense=Pe,q.isAsyncMode=u,q.isConcurrentMode=p,q.isContextConsumer=I,q.isContextProvider=F,q.isElement=x,q.isForwardRef=j,q.isFragment=_,q.isLazy=k,q.isMemo=L,q.isPortal=D,q.isProfiler=Y,q.isStrictMode=se,q.isSuspense=ne,q.isValidElementType=G,q.typeOf=X}()),q}var Ke;function Ze(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?Re.exports=pt():Re.exports=gt()),Re.exports}/* object-assign (c) Sindre Sorhus @license MIT */var ze,et;function mt(){if(et)return ze;et=1;var e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function a(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var f={},c=0;c<10;c++)f["_"+String.fromCharCode(c)]=c;var v=Object.getOwnPropertyNames(f).map(function(h){return f[h]});if(v.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(h){m[h]=h}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ze=a()?Object.assign:function(s,f){for(var c,v=o(s),m,h=1;h<arguments.length;h++){c=Object(arguments[h]);for(var M in c)i.call(c,M)&&(v[M]=c[M]);if(e){m=e(c);for(var t=0;t<m.length;t++)r.call(c,m[t])&&(v[m[t]]=c[m[t]])}}return v},ze}var je,tt;function Le(){if(tt)return je;tt=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return je=e,je}var We,nt;function vt(){if(nt)return We;nt=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var i=Le(),r={},o=Function.call.bind(Object.prototype.hasOwnProperty);e=function(s){var f="Warning: "+s;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}}}function a(s,f,c,v,m){if(process.env.NODE_ENV!=="production"){for(var h in s)if(o(s,h)){var M;try{if(typeof s[h]!="function"){var t=Error((v||"React class")+": "+c+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[h]+"`.");throw t.name="Invariant Violation",t}M=s[h](f,h,v,c,null,i)}catch(W){M=W}if(M&&!(M instanceof Error)&&e((v||"React class")+": type specification of "+c+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof M+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),M instanceof Error&&!(M.message in r)){r[M.message]=!0;var R=m?m():"";e("Failed "+c+" type: "+M.message+(R??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},We=a,We}var He,rt;function yt(){if(rt)return He;rt=1;var e=Ze(),i=mt(),r=Le(),o=vt(),a=Function.call.bind(Object.prototype.hasOwnProperty),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(c){var v="Warning: "+c;typeof console<"u"&&console.error(v);try{throw new Error(v)}catch{}});function f(){return null}return He=function(c,v){var m=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function M(u){var p=u&&(m&&u[m]||u[h]);if(typeof p=="function")return p}var t="<<anonymous>>",R={array:Z("array"),bool:Z("boolean"),func:Z("function"),number:Z("number"),object:Z("object"),string:Z("string"),symbol:Z("symbol"),any:ye(),arrayOf:G,element:X(),elementType:d(),instanceOf:P,node:Ce(),objectOf:ie,oneOf:Me,oneOfType:he,shape:be,exact:Se};function W(u,p){return u===p?u!==0||1/u===1/p:u!==u&&p!==p}function $(u){this.message=u,this.stack=""}$.prototype=Error.prototype;function O(u){if(process.env.NODE_ENV!=="production")var p={},I=0;function F(j,_,k,L,D,Y,se){if(L=L||t,Y=Y||k,se!==r){if(v){var ne=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ne.name="Invariant Violation",ne}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var y=L+":"+k;!p[y]&&I<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+L+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),p[y]=!0,I++)}}return _[k]==null?j?_[k]===null?new $("The "+D+" `"+Y+"` is marked as required "+("in `"+L+"`, but its value is `null`.")):new $("The "+D+" `"+Y+"` is marked as required in "+("`"+L+"`, but its value is `undefined`.")):null:u(_,k,L,D,Y)}var x=F.bind(null,!1);return x.isRequired=F.bind(null,!0),x}function Z(u){function p(I,F,x,j,_,k){var L=I[F],D=ae(L);if(D!==u){var Y=pe(L);return new $("Invalid "+j+" `"+_+"` of type "+("`"+Y+"` supplied to `"+x+"`, expected ")+("`"+u+"`."))}return null}return O(p)}function ye(){return O(f)}function G(u){function p(I,F,x,j,_){if(typeof u!="function")return new $("Property `"+_+"` of component `"+x+"` has invalid PropType notation inside arrayOf.");var k=I[F];if(!Array.isArray(k)){var L=ae(k);return new $("Invalid "+j+" `"+_+"` of type "+("`"+L+"` supplied to `"+x+"`, expected an array."))}for(var D=0;D<k.length;D++){var Y=u(k,D,x,j,_+"["+D+"]",r);if(Y instanceof Error)return Y}return null}return O(p)}function X(){function u(p,I,F,x,j){var _=p[I];if(!c(_)){var k=ae(_);return new $("Invalid "+x+" `"+j+"` of type "+("`"+k+"` supplied to `"+F+"`, expected a single ReactElement."))}return null}return O(u)}function d(){function u(p,I,F,x,j){var _=p[I];if(!e.isValidElementType(_)){var k=ae(_);return new $("Invalid "+x+" `"+j+"` of type "+("`"+k+"` supplied to `"+F+"`, expected a single ReactElement type."))}return null}return O(u)}function P(u){function p(I,F,x,j,_){if(!(I[F]instanceof u)){var k=u.name||t,L=we(I[F]);return new $("Invalid "+j+" `"+_+"` of type "+("`"+L+"` supplied to `"+x+"`, expected ")+("instance of `"+k+"`."))}return null}return O(p)}function Me(u){if(!Array.isArray(u))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),f;function p(I,F,x,j,_){for(var k=I[F],L=0;L<u.length;L++)if(W(k,u[L]))return null;var D=JSON.stringify(u,function(se,ne){var y=pe(ne);return y==="symbol"?String(ne):ne});return new $("Invalid "+j+" `"+_+"` of value `"+String(k)+"` "+("supplied to `"+x+"`, expected one of "+D+"."))}return O(p)}function ie(u){function p(I,F,x,j,_){if(typeof u!="function")return new $("Property `"+_+"` of component `"+x+"` has invalid PropType notation inside objectOf.");var k=I[F],L=ae(k);if(L!=="object")return new $("Invalid "+j+" `"+_+"` of type "+("`"+L+"` supplied to `"+x+"`, expected an object."));for(var D in k)if(a(k,D)){var Y=u(k,D,x,j,_+"."+D,r);if(Y instanceof Error)return Y}return null}return O(p)}function he(u){if(!Array.isArray(u))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),f;for(var p=0;p<u.length;p++){var I=u[p];if(typeof I!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Pe(I)+" at index "+p+"."),f}function F(x,j,_,k,L){for(var D=0;D<u.length;D++){var Y=u[D];if(Y(x,j,_,k,L,r)==null)return null}return new $("Invalid "+k+" `"+L+"` supplied to "+("`"+_+"`."))}return O(F)}function Ce(){function u(p,I,F,x,j){return ce(p[I])?null:new $("Invalid "+x+" `"+j+"` supplied to "+("`"+F+"`, expected a ReactNode."))}return O(u)}function be(u){function p(I,F,x,j,_){var k=I[F],L=ae(k);if(L!=="object")return new $("Invalid "+j+" `"+_+"` of type `"+L+"` "+("supplied to `"+x+"`, expected `object`."));for(var D in u){var Y=u[D];if(Y){var se=Y(k,D,x,j,_+"."+D,r);if(se)return se}}return null}return O(p)}function Se(u){function p(I,F,x,j,_){var k=I[F],L=ae(k);if(L!=="object")return new $("Invalid "+j+" `"+_+"` of type `"+L+"` "+("supplied to `"+x+"`, expected `object`."));var D=i({},I[F],u);for(var Y in D){var se=u[Y];if(!se)return new $("Invalid "+j+" `"+_+"` key `"+Y+"` supplied to `"+x+"`.\nBad object: "+JSON.stringify(I[F],null," ")+` Valid keys: `+JSON.stringify(Object.keys(u),null," "));var ne=se(k,Y,x,j,_+"."+Y,r);if(ne)return ne}return null}return O(p)}function ce(u){switch(typeof u){case"number":case"string":case"undefined":return!0;case"boolean":return!u;case"object":if(Array.isArray(u))return u.every(ce);if(u===null||c(u))return!0;var p=M(u);if(p){var I=p.call(u),F;if(p!==u.entries){for(;!(F=I.next()).done;)if(!ce(F.value))return!1}else for(;!(F=I.next()).done;){var x=F.value;if(x&&!ce(x[1]))return!1}}else return!1;return!0;default:return!1}}function Oe(u,p){return u==="symbol"?!0:p?p["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&p instanceof Symbol:!1}function ae(u){var p=typeof u;return Array.isArray(u)?"array":u instanceof RegExp?"object":Oe(p,u)?"symbol":p}function pe(u){if(typeof u>"u"||u===null)return""+u;var p=ae(u);if(p==="object"){if(u instanceof Date)return"date";if(u instanceof RegExp)return"regexp"}return p}function Pe(u){var p=pe(u);switch(p){case"array":case"object":return"an "+p;case"boolean":case"date":case"regexp":return"a "+p;default:return p}}function we(u){return!u.constructor||!u.constructor.name?t:u.constructor.name}return R.checkPropTypes=o,R.resetWarningCache=o.resetWarningCache,R.PropTypes=R,R},He}var De,it;function ht(){if(it)return De;it=1;var e=Le();function i(){}function r(){}return r.resetWarningCache=i,De=function(){function o(f,c,v,m,h,M){if(M!==e){var t=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw t.name="Invariant Violation",t}}o.isRequired=o;function a(){return o}var s={array:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,elementType:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:i};return s.PropTypes=s,s},De}if(process.env.NODE_ENV!=="production"){var bt=Ze(),wt=!0;Ie.exports=yt()(bt.isElement,wt)}else Ie.exports=ht()();var Et=Ie.exports;const Tt=dt(Et);function Fe(){return Fe=Object.assign||function(e){for(var i=1;i<arguments.length;i++){var r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Fe.apply(this,arguments)}function ot(e,i){if(e==null)return{};var r={},o=Object.keys(e),a,s;for(s=0;s<o.length;s++)a=o[s],!(i.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Mt(e,i){return i={exports:{}},e(i,i.exports),i.exports}var St=Mt(function(e){(function(i){if(typeof window>"u")return;var r=0,o=!1,a=!1,s="message",f=s.length,c="[iFrameSizer]",v=c.length,m=null,h=window.requestAnimationFrame,M={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},t={},R=null,W={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){ie("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}};function $(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function O(n,l,C){n.addEventListener(l,C,!1)}function Z(n,l,C){n.removeEventListener(l,C,!1)}function ye(){var n=["moz","webkit","o","ms"],l;for(l=0;l<n.length&&!h;l+=1)h=window[n[l]+"RequestAnimationFrame"];h?h=h.bind(window):P("setup","RequestAnimationFrame not supported")}function G(n){var l="Host page: "+n;return window.top!==window.self&&(window.parentIFrame&&window.parentIFrame.getId?l=window.parentIFrame.getId()+": "+n:l="Nested host page: "+n),l}function X(n){return c+"["+G(n)+"]"}function d(n){return t[n]?t[n].log:o}function P(n,l){he("log",n,l,d(n))}function Me(n,l){he("info",n,l,d(n))}function ie(n,l){he("warn",n,l,!0)}function he(n,l,C,E){E===!0&&typeof window.console=="object"&&console[n](X(l),C)}function Ce(n){function l(){function g(){we(B),ae(S),Te("onResized",B)}z("Height"),z("Width"),u(g,B,"init")}function C(){var g=ue.substr(v).split(":"),A=g[1]?parseInt(g[1],10):0,J=t[g[0]]&&t[g[0]].iframe,V=getComputedStyle(J);return{iframe:J,id:g[0],height:A+E(V)+H(V),width:g[2],type:g[3]}}function E(g){if(g.boxSizing!=="border-box")return 0;var A=g.paddingTop?parseInt(g.paddingTop,10):0,J=g.paddingBottom?parseInt(g.paddingBottom,10):0;return A+J}function H(g){if(g.boxSizing!=="border-box")return 0;var A=g.borderTopWidth?parseInt(g.borderTopWidth,10):0,J=g.borderBottomWidth?parseInt(g.borderBottomWidth,10):0;return A+J}function z(g){var A=Number(t[S]["max"+g]),J=Number(t[S]["min"+g]),V=g.toLowerCase(),ee=Number(B[V]);P(S,"Checking "+V+" is in range "+J+"-"+A),ee<J&&(ee=J,P(S,"Set "+V+" to min value")),ee>A&&(ee=A,P(S,"Set "+V+" to max value")),B[V]=""+ee}function fe(){function g(){function V(){var re=0,de=!1;for(P(S,"Checking connection is from allowed list of origins: "+J);re<J.length;re++)if(J[re]===A){de=!0;break}return de}function ee(){var re=t[S]&&t[S].remoteHost;return P(S,"Checking connection is from: "+re),A===re}return J.constructor===Array?V():ee()}var A=n.origin,J=t[S]&&t[S].checkOrigin;if(J&&""+A!="null"&&!g())throw new Error("Unexpected message received from: "+A+" for "+B.iframe.id+". Message was: "+n.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Ee(){return c===(""+ue).substr(0,v)&&ue.substr(v).split(":")[0]in t}function le(){var g=B.type in{true:1,false:1,undefined:1};return g&&P(S,"Ignoring init message from meta parent page"),g}function ge(g){return ue.substr(ue.indexOf(":")+f+g)}function me(g){P(S,"onMessage passed: {iframe: "+B.iframe.id+", message: "+g+"}"),Te("onMessage",{iframe:B.iframe,message:JSON.parse(g)}),P(S,"--")}function qe(){var g=document.body.getBoundingClientRect(),A=B.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:A.height,iframeWidth:A.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(A.top-g.top,10),offsetLeft:parseInt(A.left-g.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function Ae(g,A){function J(){p("Send Page Info","pageInfo:"+qe(),g,A)}_(J,32,A)}function $e(){function g(ee,re){function de(){t[V]?Ae(t[V].iframe,V):A()}["scroll","resize"].forEach(function(ct){P(V,ee+ct+" listener for sendPageInfo"),re(window,ct,de)})}function A(){g("Remove ",Z)}function J(){g("Add ",O)}var V=S;J(),t[V]&&(t[V].stopPageInfo=A)}function Ye(){t[S]&&t[S].stopPageInfo&&(t[S].stopPageInfo(),delete t[S].stopPageInfo)}function Be(){var g=!0;return B.iframe===null&&(ie(S,"IFrame ("+B.id+") not found"),g=!1),g}function w(g){var A=g.getBoundingClientRect();return Oe(S),{x:Math.floor(Number(A.left)+Number(m.x)),y:Math.floor(Number(A.top)+Number(m.y))}}function T(g){function A(){m=re,Q(),P(S,"--")}function J(){return{x:Number(B.width)+ee.x,y:Number(B.height)+ee.y}}function V(){window.parentIFrame?window.parentIFrame["scrollTo"+(g?"Offset":"")](re.x,re.y):ie(S,"Unable to scroll to requested position, window.parentIFrame not found")}var ee=g?w(B.iframe):{x:0,y:0},re=J();P(S,"Reposition requested from iFrame (offset x:"+ee.x+" y:"+ee.y+")"),window.top!==window.self?V():A()}function Q(){Te("onScroll",m)!==!1?ae(S):pe()}function K(g){function A(){var de=w(re);P(S,"Moving to in page link (#"+V+") at x: "+de.x+" y: "+de.y),m={x:de.x,y:de.y},Q(),P(S,"--")}function J(){window.parentIFrame?window.parentIFrame.moveToAnchor(V):P(S,"In page link #"+V+" not found and window.parentIFrame not found")}var V=g.split("#")[1]||"",ee=decodeURIComponent(V),re=document.getElementById(ee)||document.getElementsByName(ee)[0];re?A():window.top!==window.self?J():P(S,"In page link #"+V+" not found")}function ke(g){Te(g,{iframe:B.iframe,screenX:B.width,screenY:B.height,type:B.type})}function Te(g,A){return be(S,g,A)}function Ue(){switch(t[S]&&t[S].firstRun&&Xe(),B.type){case"close":ce(B.iframe);break;case"message":me(ge(6));break;case"mouseenter":ke("onMouseEnter");break;case"mouseleave":ke("onMouseLeave");break;case"autoResize":t[S].autoResize=JSON.parse(ge(9));break;case"scrollTo":T(!1);break;case"scrollToOffset":T(!0);break;case"pageInfo":Ae(t[S]&&t[S].iframe,S),$e();break;case"pageInfoStop":Ye();break;case"inPageLink":K(ge(9));break;case"reset":Pe(B);break;case"init":l(),Te("onInit",B.iframe);break;default:l()}}function Ve(g){var A=!0;return t[g]||(A=!1,ie(B.type+" No settings for "+g+". Message was: "+ue)),A}function Je(){for(var g in t)p("iFrame requested init",I(g),t[g].iframe,g)}function Xe(){t[S]&&(t[S].firstRun=!1)}var ue=n.data,B={},S=null;ue==="[iFrameResizerChild]Ready"?Je():Ee()?(B=C(),S=B.id,t[S]&&(t[S].loaded=!0),!le()&&Ve(S)&&(P(S,"Received: "+ue),Be()&&fe()&&Ue())):Me(S,"Ignored: "+ue)}function be(n,l,C){var E=null,H=null;if(t[n])if(E=t[n][l],typeof E=="function")H=E(C);else throw new TypeError(l+" on iFrame["+n+"] is not a function");return H}function Se(n){var l=n.id;delete t[l]}function ce(n){var l=n.id;if(be(l,"onClose",l)===!1){P(l,"Close iframe cancelled by onClose event");return}P(l,"Removing iFrame: "+l);try{n.parentNode&&n.parentNode.removeChild(n)}catch(C){ie(C)}be(l,"onClosed",l),P(l,"--"),Se(n)}function Oe(n){m===null&&(m={x:window.pageXOffset!==i?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==i?window.pageYOffset:document.documentElement.scrollTop},P(n,"Get page position: "+m.x+","+m.y))}function ae(n){m!==null&&(window.scrollTo(m.x,m.y),P(n,"Set page position: "+m.x+","+m.y),pe())}function pe(){m=null}function Pe(n){function l(){we(n),p("reset","reset",n.iframe,n.id)}P(n.id,"Size reset requested by "+(n.type==="init"?"host page":"iFrame")),Oe(n.id),u(l,n,"reset")}function we(n){function l(z){if(!n.id){P("undefined","messageData id not set");return}n.iframe.style[z]=n[z]+"px",P(n.id,"IFrame ("+H+") "+z+" set to "+n[z]+"px")}function C(z){!a&&n[z]==="0"&&(a=!0,P(H,"Hidden iFrame detected, creating visibility listener"),k())}function E(z){l(z),C(z)}var H=n.iframe.id;t[H]&&(t[H].sizeHeight&&E("height"),t[H].sizeWidth&&E("width"))}function u(n,l,C){C!==l.type&&h&&!window.jasmine?(P(l.id,"Requesting animation frame"),h(n)):n()}function p(n,l,C,E,H){function z(){var me=t[E]&&t[E].targetOrigin;P(E,"["+n+"] Sending msg to iframe["+E+"] ("+l+") targetOrigin: "+me),C.contentWindow.postMessage(c+l,me)}function fe(){ie(E,"["+n+"] IFrame("+E+") not found")}function Ee(){C&&"contentWindow"in C&&C.contentWindow!==null?z():fe()}function le(){function me(){t[E]&&!t[E].loaded&&!ge&&(ge=!0,ie(E,"IFrame has not responded within "+t[E].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}H&&t[E]&&t[E].warningTimeout&&(t[E].msgTimeout=setTimeout(me,t[E].warningTimeout))}var ge=!1;E=E||C.id,t[E]&&(Ee(),le())}function I(n){return n+":"+t[n].bodyMarginV1+":"+t[n].sizeWidth+":"+t[n].log+":"+t[n].interval+":"+t[n].enablePublicMethods+":"+t[n].autoResize+":"+t[n].bodyMargin+":"+t[n].heightCalculationMethod+":"+t[n].bodyBackground+":"+t[n].bodyPadding+":"+t[n].tolerance+":"+t[n].inPageLinks+":"+t[n].resizeFrom+":"+t[n].widthCalculationMethod}function F(n,l){function C(){function T(K){t[w][K]!==1/0&&t[w][K]!==0&&(n.style[K]=t[w][K]+"px",P(w,"Set "+K+" = "+t[w][K]+"px"))}function Q(K){if(t[w]["min"+K]>t[w]["max"+K])throw new Error("Value for min"+K+" can not be greater than max"+K)}Q("Height"),Q("Width"),T("maxHeight"),T("minHeight"),T("maxWidth"),T("minWidth")}function E(){var T=l&&l.id||W.id+r++;return document.getElementById(T)!==null&&(T+=r++),T}function H(T){return T===""&&(n.id=T=E(),o=(l||{}).log,P(T,"Added missing iframe ID: "+T+" ("+n.src+")")),T}function z(){switch(P(w,"IFrame scrolling "+(t[w]&&t[w].scrolling?"enabled":"disabled")+" for "+w),n.style.overflow=(t[w]&&t[w].scrolling)===!1?"hidden":"auto",t[w]&&t[w].scrolling){case"omit":break;case!0:n.scrolling="yes";break;case!1:n.scrolling="no";break;default:n.scrolling=t[w]?t[w].scrolling:"no"}}function fe(){(typeof(t[w]&&t[w].bodyMargin)=="number"||(t[w]&&t[w].bodyMargin)==="0")&&(t[w].bodyMarginV1=t[w].bodyMargin,t[w].bodyMargin=""+t[w].bodyMargin+"px")}function Ee(){var T=t[w]&&t[w].firstRun,Q=t[w]&&t[w].heightCalculationMethod in M;!T&&Q&&Pe({iframe:n,height:0,width:0,type:"init"})}function le(){t[w]&&(t[w].iframe.iFrameResizer={close:ce.bind(null,t[w].iframe),removeListeners:Se.bind(null,t[w].iframe),resize:p.bind(null,"Window resize","resize",t[w].iframe),moveToAnchor:function(T){p("Move to anchor","moveToAnchor:"+T,t[w].iframe,w)},sendMessage:function(T){T=JSON.stringify(T),p("Send Message","message:"+T,t[w].iframe,w)}})}function ge(T){function Q(){p("iFrame.onload",T,n,i,!0),Ee()}function K(Te){if(n.parentNode){var Ue=new Te(function(Ve){Ve.forEach(function(Je){var Xe=Array.prototype.slice.call(Je.removedNodes);Xe.forEach(function(ue){ue===n&&ce(n)})})});Ue.observe(n.parentNode,{childList:!0})}}var ke=$();ke&&K(ke),O(n,"load",Q),p("init",T,n,i,!0)}function me(T){if(typeof T!="object")throw new TypeError("Options is not an object")}function qe(T){for(var Q in W)Object.prototype.hasOwnProperty.call(W,Q)&&(t[w][Q]=Object.prototype.hasOwnProperty.call(T,Q)?T[Q]:W[Q])}function Ae(T){return T===""||T.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":T}function $e(T){var Q=T.split("Callback");if(Q.length===2){var K="on"+Q[0].charAt(0).toUpperCase()+Q[0].slice(1);this[K]=this[T],delete this[T],ie(w,"Deprecated: '"+T+"' has been renamed '"+K+"'. The old method will be removed in the next major version.")}}function Ye(T){T=T||{},t[w]={firstRun:!0,iframe:n,remoteHost:n.src&&n.src.split("/").slice(0,3).join("/")},me(T),Object.keys(T).forEach($e,T),qe(T),t[w]&&(t[w].targetOrigin=t[w].checkOrigin===!0?Ae(t[w].remoteHost):"*")}function Be(){return w in t&&"iFrameResizer"in n}var w=H(n.id);Be()?ie(w,"Ignored iFrame, already setup."):(Ye(l),z(),C(),fe(),ge(I(w)),le())}function x(n,l){R===null&&(R=setTimeout(function(){R=null,n()},l))}var j={};function _(n,l,C){j[C]||(j[C]=setTimeout(function(){j[C]=null,n()},l))}function k(){function n(){function H(z){function fe(le){return(t[z]&&t[z].iframe.style[le])==="0px"}function Ee(le){return le.offsetParent!==null}t[z]&&Ee(t[z].iframe)&&(fe("height")||fe("width"))&&p("Visibility change","resize",t[z].iframe,z)}Object.keys(t).forEach(function(z){H(z)})}function l(H){P("window","Mutation observed: "+H[0].target+" "+H[0].type),x(n,16)}function C(){var H=document.querySelector("body"),z={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},fe=new E(l);fe.observe(H,z)}var E=$();E&&C()}function L(n){function l(){Y("Window "+n,"resize")}P("window","Trigger event: "+n),x(l,16)}function D(){function n(){Y("Tab Visable","resize")}document.visibilityState!=="hidden"&&(P("document","Trigger event: Visiblity change"),x(n,16))}function Y(n,l){function C(E){return t[E]&&t[E].resizeFrom==="parent"&&t[E].autoResize&&!t[E].firstRun}Object.keys(t).forEach(function(E){C(E)&&p(n,l,t[E].iframe,E)})}function se(){O(window,"message",Ce),O(window,"resize",function(){L("resize")}),O(document,"visibilitychange",D),O(document,"-webkit-visibilitychange",D)}function ne(){function n(E,H){function z(){if(H.tagName){if(H.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+H.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}H&&(z(),F(H,E),C.push(H))}function l(E){E&&E.enablePublicMethods&&ie("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var C;return ye(),se(),function(H,z){switch(C=[],l(H),typeof z){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(z||"iframe"),n.bind(i,H));break;case"object":n(H,z);break;default:throw new TypeError("Unexpected data type ("+typeof z+")")}return C}}function y(n){n.fn?n.fn.iFrameResize||(n.fn.iFrameResize=function(C){function E(H,z){F(z,C)}return this.filter("iframe").each(E).end()}):Me("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery&&y(window.jQuery),typeof i=="function"&&i.amd?i([],ne):e.exports=ne(),window.iFrameResize=window.iFrameResize||ne()})()}),Ot=process.env.NODE_ENV!=="production",at=function(){};if(Ot){var Pt=function(i,r){var o=arguments.length;r=new Array(o>1?o-1:0);for(var a=1;a<o;a++)r[a-1]=arguments[a];var s=0,f="Warning: "+i.replace(/%s/g,function(){return r[s++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};at=function(e,i,r){var o=arguments.length;r=new Array(o>2?o-2:0);for(var a=2;a<o;a++)r[a-2]=arguments[a];if(i===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||Pt.apply(null,[i].concat(r))}}var xt=at,Ct=function(e){e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onMouseEnter,e.onMouseLeave,e.onResized;var i=ot(e,["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"]);return i},Ne=function(i){var r=i.title,o=i.forwardRef,a=ot(i,["title","forwardRef"]),s=Ct(a),f=b.useRef(null),c=function(){return xt(!f.current,"[iframeSizerReact]["+(f&&f.current&&f.current.id)+"] Close event ignored, to remove the iframe update your React component"),!f.current};return b.useEffect(function(){var v=f.current;return St(Fe({},a,{onClose:c}),v),function(){return v.iFrameResizer&&v.iFrameResizer.removeListeners()}},[]),b.useImperativeHandle(o,function(){return{resize:function(){return f.current.iFrameResizer.resize()},moveToAnchor:function(m){return f.current.iFrameResizer.moveToAnchor(m)},sendMessage:function(m,h){f.current.iFrameResizer.sendMessage(m,h)}}}),b.createElement("iframe",Fe({title:r},s,{ref:f}))};Ne.defaultProps={title:"iframe"},Ne.propTypes={title:Tt.string};function st(e,i){if(!e)return;const r=new URL(e);return i.darkMode!==void 0&&r.searchParams.append("darkMode",i.darkMode.toString()),i.fontFamily!==void 0&&r.searchParams.append("fontFamily",i.fontFamily),i.icon!==void 0&&r.searchParams.append("icon",i.icon),i.primaryColor!==void 0&&r.searchParams.append("primaryColor",i.primaryColor),r.href}const Jt="";function kt(){const e=oe.useRef(!1);return oe.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),(i,r)=>{window.setTimeout(()=>{e.current&&i()},r)}}const Rt="650px";function Ft(e){const{url:i,...r}=e,[o,a]=oe.useState(!1),s=kt();function f(){s(()=>{a(!0)},1e4)}const c=o?null:oe.createElement("div",{className:`Svix__mask ${r.darkMode?"Svix__dark":"Svix__light"}`});return oe.createElement(oe.Fragment,null,oe.createElement("div",{style:{borderRadius:"8px",overflow:"hidden",display:"flex",flexGrow:1,position:"relative",width:"100%",minHeight:Rt,...e.style}},c,e.fullSize?oe.createElement(Ne,{allow:"clipboard-write",src:st(i,r),checkOrigin:!1,heightCalculationMethod:"max",onLoad:f,style:{width:"1px",minWidth:"100%",display:"block",zIndex:2,border:"none"}}):oe.createElement("iframe",{allow:"clipboard-write",onLoad:f,style:{bottom:0,height:"100%",left:0,position:"absolute",right:0,top:0,width:"100%",zIndex:2,border:"none"},src:st(i,r)})))}function _t(e){if(!e.token)throw new Error("Missing SvixProvider token property");if(!e.appId)throw new Error("Missing SvixProvider appId property");const i=oe.useMemo(()=>e.appId,[e.appId]),r=oe.useMemo(()=>new ft.Svix(e.token,e.options),[e.token,e.options]);return oe.createElement(ut.Provider,{value:{svix:r,appId:i}},e.children)}const ut=oe.createContext(null);function At(e){const{svix:i,appId:r}=te(),{iterator:o,limit:a}=e||{},s=b.useCallback(c=>i.endpoint.list(r,{iterator:o||c,limit:a}),[i,r,o,a]);return ve(s)}function It(e){const{svix:i,appId:r}=te(),o=b.useCallback(()=>i.endpoint.get(r,e),[i,r,e]);return xe(o)}function zt(e){const{svix:i,appId:r}=te(),o=b.useCallback(()=>i.endpoint.getSecret(r,e),[i,r,e]),a=xe(o),s=b.useCallback(async f=>{await i.endpoint.rotateSecret(r,e,f),a.reload()},[i,r,e,a]);return{...a,rotateSecret:s}}function jt(e){const{svix:i,appId:r}=te(),o=b.useCallback(f=>i.endpoint.recover(r,e,f),[i,r,e]),a=b.useCallback(f=>i.endpoint.update(r,e,f),[i,r,e]),s=b.useCallback(()=>i.endpoint.delete(r,e),[i,r,e]);return{recoverEndpointMessages:o,updateEndpoint:a,deleteEndpoint:s}}function Lt(e){const{svix:i,appId:r}=te(),o=b.useCallback(()=>i.endpoint.getStats(r,e),[i,r,e]);return xe(o)}function Wt(e){const{svix:i,appId:r}=te(),o=b.useCallback(()=>i.endpoint.getHeaders(r,e),[i,r,e]),a=xe(o),s=b.useCallback(async c=>{await i.endpoint.updateHeaders(r,e,c),a.reload()},[i,r,e,a]),f=b.useCallback(async c=>{await i.endpoint.patchHeaders(r,e,c),a.reload()},[i,r,e,a]);return{...a,updateEndpointHeaders:s,patchEndpointHeaders:f}}function Ht(e,i){const{svix:r,appId:o}=te(),{iterator:a,limit:s,status:f,eventTypes:c,before:v,after:m,statusCodeClass:h,channel:M,withContent:t,withMsg:R}=i||{},W=b.useMemo(()=>c==null?void 0:c.map(Z=>Z.name),[c]),$=b.useCallback(Z=>r.messageAttempt.listByEndpoint(o,e,{iterator:a||Z,limit:s,status:f,eventTypes:W,before:v,after:m,statusCodeClass:h,channel:M,withContent:t,withMsg:R}),[r,o,e,a,s,f,W,v,m,h,M,t,R]);return ve($)}function Dt(e,i){const{svix:r,appId:o}=te(),{iterator:a,limit:s,status:f,eventTypes:c,before:v,after:m,statusCodeClass:h,channel:M,withContent:t}=i||{},R=b.useMemo(()=>c==null?void 0:c.map(O=>O.name),[c]),W=b.useCallback(O=>r.messageAttempt.listAttemptedMessages(o,e,{iterator:a||O,limit:s,status:f,eventTypes:R,before:v,after:m,statusCodeClass:h,channel:M,withContent:t}),[r,o,e,a,s,f,R,v,m,h,M,t]);return ve(W)}function Nt(e){const{svix:i}=te(),{iterator:r,limit:o}=e||{},a=b.useCallback(f=>i.eventType.list({iterator:r||f,limit:o,withContent:!0}),[i,o,r]);return ve(a)}function qt(e){const{svix:i,appId:r}=te(),{iterator:o,limit:a,before:s,after:f,channel:c,eventTypes:v,withContent:m,tag:h}=e||{},M=b.useMemo(()=>v==null?void 0:v.map(W=>W.name),[v]),t=b.useCallback(W=>i.message.list(r,{iterator:o||W,limit:a,before:s,after:f,channel:c,eventTypes:M,withContent:m,tag:h}),[i,r,o,a,s,f,c,M,m,h]);return ve(t)}function $t(e){const{svix:i,appId:r}=te(),o=b.useCallback(()=>i.message.get(r,e),[i,r,e]);return xe(o)}function Yt(e,i){const{svix:r,appId:o}=te(),{iterator:a,limit:s,after:f,before:c,channel:v,status:m,statusCodeClass:h,withContent:M}=i||{},t=b.useCallback(W=>r.messageAttempt.listAttemptedDestinations(o,e,{iterator:a||W,limit:s,after:f,before:c,channel:v,status:m,statusCodeClass:h,withContent:M}),[r,o,e,a,s,f,c,v,m,h,M]);return ve(t)}function Bt(e,i){const{svix:r,appId:o}=te(),{iterator:a,limit:s,status:f,eventTypes:c,before:v,after:m,statusCodeClass:h,channel:M,withContent:t}=i||{},R=b.useMemo(()=>c==null?void 0:c.map(O=>O.name),[c]),W=b.useCallback(O=>r.messageAttempt.listByMsg(o,e,{iterator:a||O,limit:s,status:f,eventTypes:R,before:v,after:m,statusCodeClass:h,channel:M,withContent:t}),[r,o,e,a,s,f,R,v,m,h,M,t]);return ve(W)}function Ut(e){const{svix:i,appId:r}=te();return{resendAttempt:b.useCallback(async()=>{await i.messageAttempt.resend(r,e.msgId,e.endpointId)},[i,r,e])}}function Vt(){const{svix:e,appId:i}=te(),r=_e(""),o=_e(""),a=_e([]),s=_e(void 0),f=b.useCallback(async()=>{if(r.value==="")return{error:new Error('Field "url" cannot be empty.')};const c=a.value;try{return{endpoint:await e.endpoint.create(i,{url:r.value,description:o.value,rateLimit:s.value,filterTypes:c,version:1})}}catch(v){return{error:v}}},[e,i,r.value,o.value,a.value,s.value]);return{url:r,description:o,eventTypes:a,rateLimitPerSecond:s,createEndpoint:f}}function te(){return b.useContext(ut)}function _e(e){const[i,r]=b.useState(e);return{value:i,setValue:o=>r(o)}}function xe(e){const[i,r]=b.useState(),[o,a]=b.useState(!1),[s,f]=b.useState(),c=b.useCallback(async()=>{a(!0);try{const v=await e();r(v)}catch(v){f(v)}a(!1)},[e]);return b.useEffect(()=>{c()},[c]),{data:i,reload:c,loading:o,error:s}}function ve(e){const[i,r]=b.useState(),[o,a]=b.useState([]),[s,f]=b.useState(),[c,v]=b.useState(!1),[m,h]=b.useState(),M=b.useMemo(()=>o.length>0,[o]),t=b.useMemo(()=>!!s,[s]),R=b.useCallback(async()=>{v(!0);try{const O=await e(o[0]);r(O.data),f(O.done===!1?O.iterator:void 0)}catch(O){h(O)}v(!1)},[e,o]);b.useEffect(()=>{R()},[R]);const W=b.useCallback(()=>{M&&a(O=>O.slice(1))},[M]),$=b.useCallback(()=>{t&&a(O=>[s,...O])},[t,s]);return{data:i,reload:R,hasPrevPage:M,hasNextPage:t,prevPage:W,nextPage:$,loading:c,error:m,iterator:s}}U.AppPortal=Ft,U.SvixProvider=_t,U.useAttemptFunctions=Ut,U.useAttemptedMessages=Dt,U.useEndpoint=It,U.useEndpointFunctions=jt,U.useEndpointHeaders=Wt,U.useEndpointMessageAttempts=Ht,U.useEndpointSecret=zt,U.useEndpointStats=Lt,U.useEndpoints=At,U.useEventTypes=Nt,U.useMessage=$t,U.useMessageAttempts=Bt,U.useMessageEndpoints=Yt,U.useMessages=qt,U.useNewEndpoint=Vt,U.useSvix=te,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})});