svix-react
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -1509,3 +1509,3 @@ import * as ie from "react"; | ||
}, | ||
!a && { loadingElement: m }, | ||
!a && m, | ||
e.fullSize ? /* @__PURE__ */ ie.createElement( | ||
@@ -1512,0 +1512,0 @@ Ge, |
@@ -20,2 +20,2 @@ (function(B,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("svix")):typeof define=="function"&&define.amd?define(["exports","react","svix"],b):(B=typeof globalThis<"u"?globalThis:B||self,b(B.SvixReact={},B.React,B.svix))})(this,function(B,b,ft){"use strict";function lt(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>e[i]})}}return r.default=e,Object.freeze(r)}const ie=lt(b);function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={exports:{}},Re={exports:{}},q={};/** @license React v16.13.1 | ||
*/var ze,et;function mt(){if(et)return ze;et=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=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 m=Object.getOwnPropertyNames(f).map(function(h){return f[h]});if(m.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(h){v[h]=h}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ze=a()?Object.assign:function(s,f){for(var c,m=o(s),v,h=1;h<arguments.length;h++){c=Object(arguments[h]);for(var S in c)r.call(c,S)&&(m[S]=c[S]);if(e){v=e(c);for(var t=0;t<v.length;t++)i.call(c,v[t])&&(m[v[t]]=c[v[t]])}}return m},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 r=Le(),i={},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,m,v){if(process.env.NODE_ENV!=="production"){for(var h in s)if(o(s,h)){var S;try{if(typeof s[h]!="function"){var t=Error((m||"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}S=s[h](f,h,m,c,null,r)}catch(J){S=J}if(S&&!(S instanceof Error)&&e((m||"React class")+": type specification of "+c+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof S+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),S instanceof Error&&!(S.message in i)){i[S.message]=!0;var D=v?v():"";e("Failed "+c+" type: "+S.message+(D??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(i={})},We=a,We}var De,rt;function yt(){if(rt)return De;rt=1;var e=Ze(),r=mt(),i=Le(),o=vt(),a=Function.call.bind(Object.prototype.hasOwnProperty),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(c){var m="Warning: "+c;typeof console<"u"&&console.error(m);try{throw new Error(m)}catch{}});function f(){return null}return De=function(c,m){var v=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function S(u){var p=u&&(v&&u[v]||u[h]);if(typeof p=="function")return p}var t="<<anonymous>>",D={array:oe("array"),bool:oe("boolean"),func:oe("function"),number:oe("number"),object:oe("object"),string:oe("string"),symbol:oe("symbol"),any:ye(),arrayOf:Q,element:X(),elementType:d(),instanceOf:P,node:Ce(),objectOf:re,oneOf:Me,oneOfType:he,shape:be,exact:Se};function J(u,p){return u===p?u!==0||1/u===1/p:u!==u&&p!==p}function C(u){this.message=u,this.stack=""}C.prototype=Error.prototype;function L(u){if(process.env.NODE_ENV!=="production")var p={},A=0;function R(z,F,k,j,N,$,se){if(j=j||t,$=$||k,se!==i){if(m){var te=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 te.name="Invariant Violation",te}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var y=j+":"+k;!p[y]&&A<3&&(s("You are manually calling a React.PropTypes validation function for the `"+$+"` prop on `"+j+"`. 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,A++)}}return F[k]==null?z?F[k]===null?new C("The "+N+" `"+$+"` is marked as required "+("in `"+j+"`, but its value is `null`.")):new C("The "+N+" `"+$+"` is marked as required in "+("`"+j+"`, but its value is `undefined`.")):null:u(F,k,j,N,$)}var O=R.bind(null,!1);return O.isRequired=R.bind(null,!0),O}function oe(u){function p(A,R,O,z,F,k){var j=A[R],N=ae(j);if(N!==u){var $=pe(j);return new C("Invalid "+z+" `"+F+"` of type "+("`"+$+"` supplied to `"+O+"`, expected ")+("`"+u+"`."))}return null}return L(p)}function ye(){return L(f)}function Q(u){function p(A,R,O,z,F){if(typeof u!="function")return new C("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var k=A[R];if(!Array.isArray(k)){var j=ae(k);return new C("Invalid "+z+" `"+F+"` of type "+("`"+j+"` supplied to `"+O+"`, expected an array."))}for(var N=0;N<k.length;N++){var $=u(k,N,O,z,F+"["+N+"]",i);if($ instanceof Error)return $}return null}return L(p)}function X(){function u(p,A,R,O,z){var F=p[A];if(!c(F)){var k=ae(F);return new C("Invalid "+O+" `"+z+"` of type "+("`"+k+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return L(u)}function d(){function u(p,A,R,O,z){var F=p[A];if(!e.isValidElementType(F)){var k=ae(F);return new C("Invalid "+O+" `"+z+"` of type "+("`"+k+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return L(u)}function P(u){function p(A,R,O,z,F){if(!(A[R]instanceof u)){var k=u.name||t,j=we(A[R]);return new C("Invalid "+z+" `"+F+"` of type "+("`"+j+"` supplied to `"+O+"`, expected ")+("instance of `"+k+"`."))}return null}return L(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(A,R,O,z,F){for(var k=A[R],j=0;j<u.length;j++)if(J(k,u[j]))return null;var N=JSON.stringify(u,function(se,te){var y=pe(te);return y==="symbol"?String(te):te});return new C("Invalid "+z+" `"+F+"` of value `"+String(k)+"` "+("supplied to `"+O+"`, expected one of "+N+"."))}return L(p)}function re(u){function p(A,R,O,z,F){if(typeof u!="function")return new C("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var k=A[R],j=ae(k);if(j!=="object")return new C("Invalid "+z+" `"+F+"` of type "+("`"+j+"` supplied to `"+O+"`, expected an object."));for(var N in k)if(a(k,N)){var $=u(k,N,O,z,F+"."+N,i);if($ instanceof Error)return $}return null}return L(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 A=u[p];if(typeof A!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Oe(A)+" at index "+p+"."),f}function R(O,z,F,k,j){for(var N=0;N<u.length;N++){var $=u[N];if($(O,z,F,k,j,i)==null)return null}return new C("Invalid "+k+" `"+j+"` supplied to "+("`"+F+"`."))}return L(R)}function Ce(){function u(p,A,R,O,z){return ce(p[A])?null:new C("Invalid "+O+" `"+z+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return L(u)}function be(u){function p(A,R,O,z,F){var k=A[R],j=ae(k);if(j!=="object")return new C("Invalid "+z+" `"+F+"` of type `"+j+"` "+("supplied to `"+O+"`, expected `object`."));for(var N in u){var $=u[N];if($){var se=$(k,N,O,z,F+"."+N,i);if(se)return se}}return null}return L(p)}function Se(u){function p(A,R,O,z,F){var k=A[R],j=ae(k);if(j!=="object")return new C("Invalid "+z+" `"+F+"` of type `"+j+"` "+("supplied to `"+O+"`, expected `object`."));var N=r({},A[R],u);for(var $ in N){var se=u[$];if(!se)return new C("Invalid "+z+" `"+F+"` key `"+$+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(A[R],null," ")+` | ||
Valid keys: `+JSON.stringify(Object.keys(u),null," "));var te=se(k,$,O,z,F+"."+$,i);if(te)return te}return null}return L(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=S(u);if(p){var A=p.call(u),R;if(p!==u.entries){for(;!(R=A.next()).done;)if(!ce(R.value))return!1}else for(;!(R=A.next()).done;){var O=R.value;if(O&&!ce(O[1]))return!1}}else return!1;return!0;default:return!1}}function Pe(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":Pe(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 Oe(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 D.checkPropTypes=o,D.resetWarningCache=o.resetWarningCache,D.PropTypes=D,D},De}var Ne,it;function ht(){if(it)return Ne;it=1;var e=Le();function r(){}function i(){}return i.resetWarningCache=r,Ne=function(){function o(f,c,m,v,h,S){if(S!==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:i,resetWarningCache:r};return s.PropTypes=s,s},Ne}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 r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Fe.apply(this,arguments)}function ot(e,r){if(e==null)return{};var i={},o=Object.keys(e),a,s;for(s=0;s<o.length;s++)a=o[s],!(r.indexOf(a)>=0)&&(i[a]=e[a]);return i}function Mt(e,r){return r={exports:{}},e(r,r.exports),r.exports}var St=Mt(function(e){(function(r){if(typeof window>"u")return;var i=0,o=!1,a=!1,s="message",f=s.length,c="[iFrameSizer]",m=c.length,v=null,h=window.requestAnimationFrame,S={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},t={},D=null,J={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(){re("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}};function C(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function L(n,l,x){n.addEventListener(l,x,!1)}function oe(n,l,x){n.removeEventListener(l,x,!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 Q(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+"["+Q(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 re(n,l){he("warn",n,l,!0)}function he(n,l,x,E){E===!0&&typeof window.console=="object"&&console[n](X(l),x)}function Ce(n){function l(){function g(){we(Y),ae(M),Te("onResized",Y)}I("Height"),I("Width"),u(g,Y,"init")}function x(){var g=ue.substr(m).split(":"),_=g[1]?parseInt(g[1],10):0,V=t[g[0]]&&t[g[0]].iframe,U=getComputedStyle(V);return{iframe:V,id:g[0],height:_+E(U)+W(U),width:g[2],type:g[3]}}function E(g){if(g.boxSizing!=="border-box")return 0;var _=g.paddingTop?parseInt(g.paddingTop,10):0,V=g.paddingBottom?parseInt(g.paddingBottom,10):0;return _+V}function W(g){if(g.boxSizing!=="border-box")return 0;var _=g.borderTopWidth?parseInt(g.borderTopWidth,10):0,V=g.borderBottomWidth?parseInt(g.borderBottomWidth,10):0;return _+V}function I(g){var _=Number(t[M]["max"+g]),V=Number(t[M]["min"+g]),U=g.toLowerCase(),Z=Number(Y[U]);P(M,"Checking "+U+" is in range "+V+"-"+_),Z<V&&(Z=V,P(M,"Set "+U+" to min value")),Z>_&&(Z=_,P(M,"Set "+U+" to max value")),Y[U]=""+Z}function fe(){function g(){function U(){var ne=0,de=!1;for(P(M,"Checking connection is from allowed list of origins: "+V);ne<V.length;ne++)if(V[ne]===_){de=!0;break}return de}function Z(){var ne=t[M]&&t[M].remoteHost;return P(M,"Checking connection is from: "+ne),_===ne}return V.constructor===Array?U():Z()}var _=n.origin,V=t[M]&&t[M].checkOrigin;if(V&&""+_!="null"&&!g())throw new Error("Unexpected message received from: "+_+" for "+Y.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,m)&&ue.substr(m).split(":")[0]in t}function le(){var g=Y.type in{true:1,false:1,undefined:1};return g&&P(M,"Ignoring init message from meta parent page"),g}function ge(g){return ue.substr(ue.indexOf(":")+f+g)}function me(g){P(M,"onMessage passed: {iframe: "+Y.iframe.id+", message: "+g+"}"),Te("onMessage",{iframe:Y.iframe,message:JSON.parse(g)}),P(M,"--")}function He(){var g=document.body.getBoundingClientRect(),_=Y.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:_.height,iframeWidth:_.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(_.top-g.top,10),offsetLeft:parseInt(_.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,_){function V(){p("Send Page Info","pageInfo:"+He(),g,_)}F(V,32,_)}function $e(){function g(Z,ne){function de(){t[U]?Ae(t[U].iframe,U):_()}["scroll","resize"].forEach(function(ct){P(U,Z+ct+" listener for sendPageInfo"),ne(window,ct,de)})}function _(){g("Remove ",oe)}function V(){g("Add ",L)}var U=M;V(),t[U]&&(t[U].stopPageInfo=_)}function Ye(){t[M]&&t[M].stopPageInfo&&(t[M].stopPageInfo(),delete t[M].stopPageInfo)}function Be(){var g=!0;return Y.iframe===null&&(re(M,"IFrame ("+Y.id+") not found"),g=!1),g}function w(g){var _=g.getBoundingClientRect();return Pe(M),{x:Math.floor(Number(_.left)+Number(v.x)),y:Math.floor(Number(_.top)+Number(v.y))}}function T(g){function _(){v=ne,G(),P(M,"--")}function V(){return{x:Number(Y.width)+Z.x,y:Number(Y.height)+Z.y}}function U(){window.parentIFrame?window.parentIFrame["scrollTo"+(g?"Offset":"")](ne.x,ne.y):re(M,"Unable to scroll to requested position, window.parentIFrame not found")}var Z=g?w(Y.iframe):{x:0,y:0},ne=V();P(M,"Reposition requested from iFrame (offset x:"+Z.x+" y:"+Z.y+")"),window.top!==window.self?U():_()}function G(){Te("onScroll",v)!==!1?ae(M):pe()}function K(g){function _(){var de=w(ne);P(M,"Moving to in page link (#"+U+") at x: "+de.x+" y: "+de.y),v={x:de.x,y:de.y},G(),P(M,"--")}function V(){window.parentIFrame?window.parentIFrame.moveToAnchor(U):P(M,"In page link #"+U+" not found and window.parentIFrame not found")}var U=g.split("#")[1]||"",Z=decodeURIComponent(U),ne=document.getElementById(Z)||document.getElementsByName(Z)[0];ne?_():window.top!==window.self?V():P(M,"In page link #"+U+" not found")}function ke(g){Te(g,{iframe:Y.iframe,screenX:Y.width,screenY:Y.height,type:Y.type})}function Te(g,_){return be(M,g,_)}function Ue(){switch(t[M]&&t[M].firstRun&&Xe(),Y.type){case"close":ce(Y.iframe);break;case"message":me(ge(6));break;case"mouseenter":ke("onMouseEnter");break;case"mouseleave":ke("onMouseLeave");break;case"autoResize":t[M].autoResize=JSON.parse(ge(9));break;case"scrollTo":T(!1);break;case"scrollToOffset":T(!0);break;case"pageInfo":Ae(t[M]&&t[M].iframe,M),$e();break;case"pageInfoStop":Ye();break;case"inPageLink":K(ge(9));break;case"reset":Oe(Y);break;case"init":l(),Te("onInit",Y.iframe);break;default:l()}}function Ve(g){var _=!0;return t[g]||(_=!1,re(Y.type+" No settings for "+g+". Message was: "+ue)),_}function Je(){for(var g in t)p("iFrame requested init",A(g),t[g].iframe,g)}function Xe(){t[M]&&(t[M].firstRun=!1)}var ue=n.data,Y={},M=null;ue==="[iFrameResizerChild]Ready"?Je():Ee()?(Y=x(),M=Y.id,t[M]&&(t[M].loaded=!0),!le()&&Ve(M)&&(P(M,"Received: "+ue),Be()&&fe()&&Ue())):Me(M,"Ignored: "+ue)}function be(n,l,x){var E=null,W=null;if(t[n])if(E=t[n][l],typeof E=="function")W=E(x);else throw new TypeError(l+" on iFrame["+n+"] is not a function");return W}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(x){re(x)}be(l,"onClosed",l),P(l,"--"),Se(n)}function Pe(n){v===null&&(v={x:window.pageXOffset!==r?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==r?window.pageYOffset:document.documentElement.scrollTop},P(n,"Get page position: "+v.x+","+v.y))}function ae(n){v!==null&&(window.scrollTo(v.x,v.y),P(n,"Set page position: "+v.x+","+v.y),pe())}function pe(){v=null}function Oe(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")),Pe(n.id),u(l,n,"reset")}function we(n){function l(I){if(!n.id){P("undefined","messageData id not set");return}n.iframe.style[I]=n[I]+"px",P(n.id,"IFrame ("+W+") "+I+" set to "+n[I]+"px")}function x(I){!a&&n[I]==="0"&&(a=!0,P(W,"Hidden iFrame detected, creating visibility listener"),k())}function E(I){l(I),x(I)}var W=n.iframe.id;t[W]&&(t[W].sizeHeight&&E("height"),t[W].sizeWidth&&E("width"))}function u(n,l,x){x!==l.type&&h&&!window.jasmine?(P(l.id,"Requesting animation frame"),h(n)):n()}function p(n,l,x,E,W){function I(){var me=t[E]&&t[E].targetOrigin;P(E,"["+n+"] Sending msg to iframe["+E+"] ("+l+") targetOrigin: "+me),x.contentWindow.postMessage(c+l,me)}function fe(){re(E,"["+n+"] IFrame("+E+") not found")}function Ee(){x&&"contentWindow"in x&&x.contentWindow!==null?I():fe()}function le(){function me(){t[E]&&!t[E].loaded&&!ge&&(ge=!0,re(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."))}W&&t[E]&&t[E].warningTimeout&&(t[E].msgTimeout=setTimeout(me,t[E].warningTimeout))}var ge=!1;E=E||x.id,t[E]&&(Ee(),le())}function A(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 R(n,l){function x(){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 G(K){if(t[w]["min"+K]>t[w]["max"+K])throw new Error("Value for min"+K+" can not be greater than max"+K)}G("Height"),G("Width"),T("maxHeight"),T("minHeight"),T("maxWidth"),T("minWidth")}function E(){var T=l&&l.id||J.id+i++;return document.getElementById(T)!==null&&(T+=i++),T}function W(T){return T===""&&(n.id=T=E(),o=(l||{}).log,P(T,"Added missing iframe ID: "+T+" ("+n.src+")")),T}function I(){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,G=t[w]&&t[w].heightCalculationMethod in S;!T&&G&&Oe({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 G(){p("iFrame.onload",T,n,r,!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=C();ke&&K(ke),L(n,"load",G),p("init",T,n,r,!0)}function me(T){if(typeof T!="object")throw new TypeError("Options is not an object")}function He(T){for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(t[w][G]=Object.prototype.hasOwnProperty.call(T,G)?T[G]:J[G])}function Ae(T){return T===""||T.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":T}function $e(T){var G=T.split("Callback");if(G.length===2){var K="on"+G[0].charAt(0).toUpperCase()+G[0].slice(1);this[K]=this[T],delete this[T],re(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),He(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=W(n.id);Be()?re(w,"Ignored iFrame, already setup."):(Ye(l),I(),x(),fe(),ge(A(w)),le())}function O(n,l){D===null&&(D=setTimeout(function(){D=null,n()},l))}var z={};function F(n,l,x){z[x]||(z[x]=setTimeout(function(){z[x]=null,n()},l))}function k(){function n(){function W(I){function fe(le){return(t[I]&&t[I].iframe.style[le])==="0px"}function Ee(le){return le.offsetParent!==null}t[I]&&Ee(t[I].iframe)&&(fe("height")||fe("width"))&&p("Visibility change","resize",t[I].iframe,I)}Object.keys(t).forEach(function(I){W(I)})}function l(W){P("window","Mutation observed: "+W[0].target+" "+W[0].type),O(n,16)}function x(){var W=document.querySelector("body"),I={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},fe=new E(l);fe.observe(W,I)}var E=C();E&&x()}function j(n){function l(){$("Window "+n,"resize")}P("window","Trigger event: "+n),O(l,16)}function N(){function n(){$("Tab Visable","resize")}document.visibilityState!=="hidden"&&(P("document","Trigger event: Visiblity change"),O(n,16))}function $(n,l){function x(E){return t[E]&&t[E].resizeFrom==="parent"&&t[E].autoResize&&!t[E].firstRun}Object.keys(t).forEach(function(E){x(E)&&p(n,l,t[E].iframe,E)})}function se(){L(window,"message",Ce),L(window,"resize",function(){j("resize")}),L(document,"visibilitychange",N),L(document,"-webkit-visibilitychange",N)}function te(){function n(E,W){function I(){if(W.tagName){if(W.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+W.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}W&&(I(),R(W,E),x.push(W))}function l(E){E&&E.enablePublicMethods&&re("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var x;return ye(),se(),function(W,I){switch(x=[],l(W),typeof I){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(I||"iframe"),n.bind(r,W));break;case"object":n(W,I);break;default:throw new TypeError("Unexpected data type ("+typeof I+")")}return x}}function y(n){n.fn?n.fn.iFrameResize||(n.fn.iFrameResize=function(x){function E(W,I){R(I,x)}return this.filter("iframe").each(E).end()}):Me("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery&&y(window.jQuery),typeof r=="function"&&r.amd?r([],te):e.exports=te(),window.iFrameResize=window.iFrameResize||te()})()}),Pt=process.env.NODE_ENV!=="production",at=function(){};if(Pt){var Ot=function(r,i){var o=arguments.length;i=new Array(o>1?o-1:0);for(var a=1;a<o;a++)i[a-1]=arguments[a];var s=0,f="Warning: "+r.replace(/%s/g,function(){return i[s++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};at=function(e,r,i){var o=arguments.length;i=new Array(o>2?o-2:0);for(var a=2;a<o;a++)i[a-2]=arguments[a];if(r===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||Ot.apply(null,[r].concat(i))}}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 r=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 r},qe=function(r){var i=r.title,o=r.forwardRef,a=ot(r,["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 m=f.current;return St(Fe({},a,{onClose:c}),m),function(){return m.iFrameResizer&&m.iFrameResizer.removeListeners()}},[]),b.useImperativeHandle(o,function(){return{resize:function(){return f.current.iFrameResizer.resize()},moveToAnchor:function(v){return f.current.iFrameResizer.moveToAnchor(v)},sendMessage:function(v,h){f.current.iFrameResizer.sendMessage(v,h)}}}),b.createElement("iframe",Fe({title:i},s,{ref:f}))};qe.defaultProps={title:"iframe"},qe.propTypes={title:Tt.string};function st(e,r){if(!e)return;const i=new URL(e);return r.darkMode!==void 0&&i.searchParams.append("darkMode",r.darkMode.toString()),r.fontFamily!==void 0&&i.searchParams.append("fontFamily",r.fontFamily),r.icon!==void 0&&i.searchParams.append("icon",r.icon),r.primaryColor!==void 0&&i.searchParams.append("primaryColor",r.primaryColor),i.href}const Vt="";function kt(){const e=ie.useRef(!1);return ie.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),(r,i)=>{window.setTimeout(()=>{e.current&&r()},i)}}function Rt(e){const{url:r,loadingIndicator:i,...o}=e,[a,s]=ie.useState(!1),f=kt();function c(){f(()=>{s(!0)},1e4)}const m=i??ie.createElement("div",{className:`Svix__mask ${o.darkMode?"Svix__dark":"Svix__light"}`});return ie.createElement(ie.Fragment,null,ie.createElement("div",{style:{borderRadius:"8px",overflow:"hidden",display:"flex",flexGrow:1,position:"relative",width:"100%",...e.style}},!a&&{loadingElement:m},e.fullSize?ie.createElement(qe,{allow:"clipboard-write",src:st(r,o),heightCalculationMethod:"max",onLoad:c,style:{width:"1px",minWidth:"100%",display:"block",zIndex:2}}):ie.createElement("iframe",{allow:"clipboard-write",onLoad:c,style:{bottom:0,height:"100%",left:0,position:"absolute",right:0,top:0,width:"100%",zIndex:2},src:st(r,o)})))}function Ft(e){if(!e.token)throw new Error("Missing SvixProvider token property");if(!e.appId)throw new Error("Missing SvixProvider appId property");const r=ie.useMemo(()=>e.appId,[e.appId]),i=ie.useMemo(()=>new ft.Svix(e.token,e.options),[e.token,e.options]);return ie.createElement(ut.Provider,{value:{svix:i,appId:r}},e.children)}const ut=ie.createContext(null);function _t(e){const{svix:r,appId:i}=ee(),{iterator:o,limit:a}=e||{},s=b.useCallback(c=>r.endpoint.list(i,{iterator:o||c,limit:a}),[r,i,o,a]);return ve(s)}function At(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.get(i,e),[r,i,e]);return xe(o)}function It(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getSecret(i,e),[r,i,e]),a=xe(o),s=b.useCallback(async f=>{await r.endpoint.rotateSecret(i,e,f),a.reload()},[r,i,e,a]);return{...a,rotateSecret:s}}function zt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(f=>r.endpoint.recover(i,e,f),[r,i,e]),a=b.useCallback(f=>r.endpoint.update(i,e,f),[r,i,e]),s=b.useCallback(()=>r.endpoint.delete(i,e),[r,i,e]);return{recoverEndpointMessages:o,updateEndpoint:a,deleteEndpoint:s}}function jt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getStats(i,e),[r,i,e]);return xe(o)}function Lt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getHeaders(i,e),[r,i,e]),a=xe(o),s=b.useCallback(async c=>{await r.endpoint.updateHeaders(i,e,c),a.reload()},[r,i,e,a]),f=b.useCallback(async c=>{await r.endpoint.patchHeaders(i,e,c),a.reload()},[r,i,e,a]);return{...a,updateEndpointHeaders:s,patchEndpointHeaders:f}}function Wt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listByEndpoint(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Dt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listAttemptedMessages(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Nt(e){const{svix:r}=ee(),{iterator:i,limit:o}=e||{},a=b.useCallback(f=>r.eventType.list({iterator:i||f,limit:o,withContent:!0}),[r,o,i]);return ve(a)}function qt(e){const{svix:r,appId:i}=ee(),{iterator:o,limit:a,before:s,after:f,channel:c,eventTypes:m}=e||{},v=b.useMemo(()=>m==null?void 0:m.map(t=>t.name),[m]),h=b.useCallback(t=>r.message.list(i,{iterator:o||t,limit:a,before:s,after:f,channel:c,eventTypes:v}),[r,i,o,a,s,f,c,v]);return ve(h)}function Ht(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.message.get(i,e),[r,i,e]);return xe(o)}function $t(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s}=r||{},f=b.useCallback(m=>i.messageAttempt.listAttemptedDestinations(o,e,{iterator:a||m,limit:s}),[i,o,e,a,s]);return ve(f)}function Yt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listByMsg(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Bt(e){const{svix:r,appId:i}=ee();return{resendAttempt:b.useCallback(async()=>{await r.messageAttempt.resend(i,e.msgId,e.endpointId)},[r,i,e])}}function Ut(){const{svix:e,appId:r}=ee(),i=_e(""),o=_e(""),a=_e([]),s=_e(void 0),f=b.useCallback(async()=>{if(i.value==="")return{error:new Error('Field "url" cannot be empty.')};const c=a.value;try{return{endpoint:await e.endpoint.create(r,{url:i.value,description:o.value,rateLimit:s.value,filterTypes:c,version:1})}}catch(m){return{error:m}}},[e,r,i.value,o.value,a.value,s.value]);return{url:i,description:o,eventTypes:a,rateLimitPerSecond:s,createEndpoint:f}}function ee(){return b.useContext(ut)}function _e(e){const[r,i]=b.useState(e);return{value:r,setValue:o=>i(o)}}function xe(e){const[r,i]=b.useState(),[o,a]=b.useState(!1),[s,f]=b.useState(),c=b.useCallback(async()=>{a(!0);try{const m=await e();i(m)}catch(m){f(m)}a(!1)},[e]);return b.useEffect(()=>{c()},[c]),{data:r,reload:c,loading:o,error:s}}function ve(e){const[r,i]=b.useState(),[o,a]=b.useState([]),[s,f]=b.useState(),[c,m]=b.useState(!1),[v,h]=b.useState(),S=b.useMemo(()=>o.length>0,[o]),t=b.useMemo(()=>!!s,[s]),D=b.useCallback(async()=>{m(!0);try{const L=await e(o[0]);i(L.data),f(L.done===!1?L.iterator:void 0)}catch(L){h(L)}m(!1)},[e,o]);b.useEffect(()=>{D()},[D]);const J=b.useCallback(()=>{S&&a(L=>L.slice(1))},[S]),C=b.useCallback(()=>{t&&a(L=>[s,...L])},[t,s]);return{data:r,reload:D,hasPrevPage:S,hasNextPage:t,prevPage:J,nextPage:C,loading:c,error:v,iterator:s}}B.AppPortal=Rt,B.SvixProvider=Ft,B.useAttemptFunctions=Bt,B.useAttemptedMessages=Dt,B.useEndpoint=At,B.useEndpointFunctions=zt,B.useEndpointHeaders=Lt,B.useEndpointMessageAttempts=Wt,B.useEndpointSecret=It,B.useEndpointStats=jt,B.useEndpoints=_t,B.useEventTypes=Nt,B.useMessage=Ht,B.useMessageAttempts=Yt,B.useMessageEndpoints=$t,B.useMessages=qt,B.useNewEndpoint=Ut,B.useSvix=ee,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}); | ||
Valid keys: `+JSON.stringify(Object.keys(u),null," "));var te=se(k,$,O,z,F+"."+$,i);if(te)return te}return null}return L(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=S(u);if(p){var A=p.call(u),R;if(p!==u.entries){for(;!(R=A.next()).done;)if(!ce(R.value))return!1}else for(;!(R=A.next()).done;){var O=R.value;if(O&&!ce(O[1]))return!1}}else return!1;return!0;default:return!1}}function Pe(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":Pe(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 Oe(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 D.checkPropTypes=o,D.resetWarningCache=o.resetWarningCache,D.PropTypes=D,D},De}var Ne,it;function ht(){if(it)return Ne;it=1;var e=Le();function r(){}function i(){}return i.resetWarningCache=r,Ne=function(){function o(f,c,m,v,h,S){if(S!==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:i,resetWarningCache:r};return s.PropTypes=s,s},Ne}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 r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Fe.apply(this,arguments)}function ot(e,r){if(e==null)return{};var i={},o=Object.keys(e),a,s;for(s=0;s<o.length;s++)a=o[s],!(r.indexOf(a)>=0)&&(i[a]=e[a]);return i}function Mt(e,r){return r={exports:{}},e(r,r.exports),r.exports}var St=Mt(function(e){(function(r){if(typeof window>"u")return;var i=0,o=!1,a=!1,s="message",f=s.length,c="[iFrameSizer]",m=c.length,v=null,h=window.requestAnimationFrame,S={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},t={},D=null,J={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(){re("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}};function C(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function L(n,l,x){n.addEventListener(l,x,!1)}function oe(n,l,x){n.removeEventListener(l,x,!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 Q(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+"["+Q(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 re(n,l){he("warn",n,l,!0)}function he(n,l,x,E){E===!0&&typeof window.console=="object"&&console[n](X(l),x)}function Ce(n){function l(){function g(){we(Y),ae(M),Te("onResized",Y)}I("Height"),I("Width"),u(g,Y,"init")}function x(){var g=ue.substr(m).split(":"),_=g[1]?parseInt(g[1],10):0,V=t[g[0]]&&t[g[0]].iframe,U=getComputedStyle(V);return{iframe:V,id:g[0],height:_+E(U)+W(U),width:g[2],type:g[3]}}function E(g){if(g.boxSizing!=="border-box")return 0;var _=g.paddingTop?parseInt(g.paddingTop,10):0,V=g.paddingBottom?parseInt(g.paddingBottom,10):0;return _+V}function W(g){if(g.boxSizing!=="border-box")return 0;var _=g.borderTopWidth?parseInt(g.borderTopWidth,10):0,V=g.borderBottomWidth?parseInt(g.borderBottomWidth,10):0;return _+V}function I(g){var _=Number(t[M]["max"+g]),V=Number(t[M]["min"+g]),U=g.toLowerCase(),Z=Number(Y[U]);P(M,"Checking "+U+" is in range "+V+"-"+_),Z<V&&(Z=V,P(M,"Set "+U+" to min value")),Z>_&&(Z=_,P(M,"Set "+U+" to max value")),Y[U]=""+Z}function fe(){function g(){function U(){var ne=0,de=!1;for(P(M,"Checking connection is from allowed list of origins: "+V);ne<V.length;ne++)if(V[ne]===_){de=!0;break}return de}function Z(){var ne=t[M]&&t[M].remoteHost;return P(M,"Checking connection is from: "+ne),_===ne}return V.constructor===Array?U():Z()}var _=n.origin,V=t[M]&&t[M].checkOrigin;if(V&&""+_!="null"&&!g())throw new Error("Unexpected message received from: "+_+" for "+Y.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,m)&&ue.substr(m).split(":")[0]in t}function le(){var g=Y.type in{true:1,false:1,undefined:1};return g&&P(M,"Ignoring init message from meta parent page"),g}function ge(g){return ue.substr(ue.indexOf(":")+f+g)}function me(g){P(M,"onMessage passed: {iframe: "+Y.iframe.id+", message: "+g+"}"),Te("onMessage",{iframe:Y.iframe,message:JSON.parse(g)}),P(M,"--")}function He(){var g=document.body.getBoundingClientRect(),_=Y.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:_.height,iframeWidth:_.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(_.top-g.top,10),offsetLeft:parseInt(_.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,_){function V(){p("Send Page Info","pageInfo:"+He(),g,_)}F(V,32,_)}function $e(){function g(Z,ne){function de(){t[U]?Ae(t[U].iframe,U):_()}["scroll","resize"].forEach(function(ct){P(U,Z+ct+" listener for sendPageInfo"),ne(window,ct,de)})}function _(){g("Remove ",oe)}function V(){g("Add ",L)}var U=M;V(),t[U]&&(t[U].stopPageInfo=_)}function Ye(){t[M]&&t[M].stopPageInfo&&(t[M].stopPageInfo(),delete t[M].stopPageInfo)}function Be(){var g=!0;return Y.iframe===null&&(re(M,"IFrame ("+Y.id+") not found"),g=!1),g}function w(g){var _=g.getBoundingClientRect();return Pe(M),{x:Math.floor(Number(_.left)+Number(v.x)),y:Math.floor(Number(_.top)+Number(v.y))}}function T(g){function _(){v=ne,G(),P(M,"--")}function V(){return{x:Number(Y.width)+Z.x,y:Number(Y.height)+Z.y}}function U(){window.parentIFrame?window.parentIFrame["scrollTo"+(g?"Offset":"")](ne.x,ne.y):re(M,"Unable to scroll to requested position, window.parentIFrame not found")}var Z=g?w(Y.iframe):{x:0,y:0},ne=V();P(M,"Reposition requested from iFrame (offset x:"+Z.x+" y:"+Z.y+")"),window.top!==window.self?U():_()}function G(){Te("onScroll",v)!==!1?ae(M):pe()}function K(g){function _(){var de=w(ne);P(M,"Moving to in page link (#"+U+") at x: "+de.x+" y: "+de.y),v={x:de.x,y:de.y},G(),P(M,"--")}function V(){window.parentIFrame?window.parentIFrame.moveToAnchor(U):P(M,"In page link #"+U+" not found and window.parentIFrame not found")}var U=g.split("#")[1]||"",Z=decodeURIComponent(U),ne=document.getElementById(Z)||document.getElementsByName(Z)[0];ne?_():window.top!==window.self?V():P(M,"In page link #"+U+" not found")}function ke(g){Te(g,{iframe:Y.iframe,screenX:Y.width,screenY:Y.height,type:Y.type})}function Te(g,_){return be(M,g,_)}function Ue(){switch(t[M]&&t[M].firstRun&&Xe(),Y.type){case"close":ce(Y.iframe);break;case"message":me(ge(6));break;case"mouseenter":ke("onMouseEnter");break;case"mouseleave":ke("onMouseLeave");break;case"autoResize":t[M].autoResize=JSON.parse(ge(9));break;case"scrollTo":T(!1);break;case"scrollToOffset":T(!0);break;case"pageInfo":Ae(t[M]&&t[M].iframe,M),$e();break;case"pageInfoStop":Ye();break;case"inPageLink":K(ge(9));break;case"reset":Oe(Y);break;case"init":l(),Te("onInit",Y.iframe);break;default:l()}}function Ve(g){var _=!0;return t[g]||(_=!1,re(Y.type+" No settings for "+g+". Message was: "+ue)),_}function Je(){for(var g in t)p("iFrame requested init",A(g),t[g].iframe,g)}function Xe(){t[M]&&(t[M].firstRun=!1)}var ue=n.data,Y={},M=null;ue==="[iFrameResizerChild]Ready"?Je():Ee()?(Y=x(),M=Y.id,t[M]&&(t[M].loaded=!0),!le()&&Ve(M)&&(P(M,"Received: "+ue),Be()&&fe()&&Ue())):Me(M,"Ignored: "+ue)}function be(n,l,x){var E=null,W=null;if(t[n])if(E=t[n][l],typeof E=="function")W=E(x);else throw new TypeError(l+" on iFrame["+n+"] is not a function");return W}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(x){re(x)}be(l,"onClosed",l),P(l,"--"),Se(n)}function Pe(n){v===null&&(v={x:window.pageXOffset!==r?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==r?window.pageYOffset:document.documentElement.scrollTop},P(n,"Get page position: "+v.x+","+v.y))}function ae(n){v!==null&&(window.scrollTo(v.x,v.y),P(n,"Set page position: "+v.x+","+v.y),pe())}function pe(){v=null}function Oe(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")),Pe(n.id),u(l,n,"reset")}function we(n){function l(I){if(!n.id){P("undefined","messageData id not set");return}n.iframe.style[I]=n[I]+"px",P(n.id,"IFrame ("+W+") "+I+" set to "+n[I]+"px")}function x(I){!a&&n[I]==="0"&&(a=!0,P(W,"Hidden iFrame detected, creating visibility listener"),k())}function E(I){l(I),x(I)}var W=n.iframe.id;t[W]&&(t[W].sizeHeight&&E("height"),t[W].sizeWidth&&E("width"))}function u(n,l,x){x!==l.type&&h&&!window.jasmine?(P(l.id,"Requesting animation frame"),h(n)):n()}function p(n,l,x,E,W){function I(){var me=t[E]&&t[E].targetOrigin;P(E,"["+n+"] Sending msg to iframe["+E+"] ("+l+") targetOrigin: "+me),x.contentWindow.postMessage(c+l,me)}function fe(){re(E,"["+n+"] IFrame("+E+") not found")}function Ee(){x&&"contentWindow"in x&&x.contentWindow!==null?I():fe()}function le(){function me(){t[E]&&!t[E].loaded&&!ge&&(ge=!0,re(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."))}W&&t[E]&&t[E].warningTimeout&&(t[E].msgTimeout=setTimeout(me,t[E].warningTimeout))}var ge=!1;E=E||x.id,t[E]&&(Ee(),le())}function A(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 R(n,l){function x(){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 G(K){if(t[w]["min"+K]>t[w]["max"+K])throw new Error("Value for min"+K+" can not be greater than max"+K)}G("Height"),G("Width"),T("maxHeight"),T("minHeight"),T("maxWidth"),T("minWidth")}function E(){var T=l&&l.id||J.id+i++;return document.getElementById(T)!==null&&(T+=i++),T}function W(T){return T===""&&(n.id=T=E(),o=(l||{}).log,P(T,"Added missing iframe ID: "+T+" ("+n.src+")")),T}function I(){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,G=t[w]&&t[w].heightCalculationMethod in S;!T&&G&&Oe({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 G(){p("iFrame.onload",T,n,r,!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=C();ke&&K(ke),L(n,"load",G),p("init",T,n,r,!0)}function me(T){if(typeof T!="object")throw new TypeError("Options is not an object")}function He(T){for(var G in J)Object.prototype.hasOwnProperty.call(J,G)&&(t[w][G]=Object.prototype.hasOwnProperty.call(T,G)?T[G]:J[G])}function Ae(T){return T===""||T.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":T}function $e(T){var G=T.split("Callback");if(G.length===2){var K="on"+G[0].charAt(0).toUpperCase()+G[0].slice(1);this[K]=this[T],delete this[T],re(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),He(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=W(n.id);Be()?re(w,"Ignored iFrame, already setup."):(Ye(l),I(),x(),fe(),ge(A(w)),le())}function O(n,l){D===null&&(D=setTimeout(function(){D=null,n()},l))}var z={};function F(n,l,x){z[x]||(z[x]=setTimeout(function(){z[x]=null,n()},l))}function k(){function n(){function W(I){function fe(le){return(t[I]&&t[I].iframe.style[le])==="0px"}function Ee(le){return le.offsetParent!==null}t[I]&&Ee(t[I].iframe)&&(fe("height")||fe("width"))&&p("Visibility change","resize",t[I].iframe,I)}Object.keys(t).forEach(function(I){W(I)})}function l(W){P("window","Mutation observed: "+W[0].target+" "+W[0].type),O(n,16)}function x(){var W=document.querySelector("body"),I={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},fe=new E(l);fe.observe(W,I)}var E=C();E&&x()}function j(n){function l(){$("Window "+n,"resize")}P("window","Trigger event: "+n),O(l,16)}function N(){function n(){$("Tab Visable","resize")}document.visibilityState!=="hidden"&&(P("document","Trigger event: Visiblity change"),O(n,16))}function $(n,l){function x(E){return t[E]&&t[E].resizeFrom==="parent"&&t[E].autoResize&&!t[E].firstRun}Object.keys(t).forEach(function(E){x(E)&&p(n,l,t[E].iframe,E)})}function se(){L(window,"message",Ce),L(window,"resize",function(){j("resize")}),L(document,"visibilitychange",N),L(document,"-webkit-visibilitychange",N)}function te(){function n(E,W){function I(){if(W.tagName){if(W.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+W.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}W&&(I(),R(W,E),x.push(W))}function l(E){E&&E.enablePublicMethods&&re("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var x;return ye(),se(),function(W,I){switch(x=[],l(W),typeof I){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(I||"iframe"),n.bind(r,W));break;case"object":n(W,I);break;default:throw new TypeError("Unexpected data type ("+typeof I+")")}return x}}function y(n){n.fn?n.fn.iFrameResize||(n.fn.iFrameResize=function(x){function E(W,I){R(I,x)}return this.filter("iframe").each(E).end()}):Me("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery&&y(window.jQuery),typeof r=="function"&&r.amd?r([],te):e.exports=te(),window.iFrameResize=window.iFrameResize||te()})()}),Pt=process.env.NODE_ENV!=="production",at=function(){};if(Pt){var Ot=function(r,i){var o=arguments.length;i=new Array(o>1?o-1:0);for(var a=1;a<o;a++)i[a-1]=arguments[a];var s=0,f="Warning: "+r.replace(/%s/g,function(){return i[s++]});typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}};at=function(e,r,i){var o=arguments.length;i=new Array(o>2?o-2:0);for(var a=2;a<o;a++)i[a-2]=arguments[a];if(r===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");e||Ot.apply(null,[r].concat(i))}}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 r=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 r},qe=function(r){var i=r.title,o=r.forwardRef,a=ot(r,["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 m=f.current;return St(Fe({},a,{onClose:c}),m),function(){return m.iFrameResizer&&m.iFrameResizer.removeListeners()}},[]),b.useImperativeHandle(o,function(){return{resize:function(){return f.current.iFrameResizer.resize()},moveToAnchor:function(v){return f.current.iFrameResizer.moveToAnchor(v)},sendMessage:function(v,h){f.current.iFrameResizer.sendMessage(v,h)}}}),b.createElement("iframe",Fe({title:i},s,{ref:f}))};qe.defaultProps={title:"iframe"},qe.propTypes={title:Tt.string};function st(e,r){if(!e)return;const i=new URL(e);return r.darkMode!==void 0&&i.searchParams.append("darkMode",r.darkMode.toString()),r.fontFamily!==void 0&&i.searchParams.append("fontFamily",r.fontFamily),r.icon!==void 0&&i.searchParams.append("icon",r.icon),r.primaryColor!==void 0&&i.searchParams.append("primaryColor",r.primaryColor),i.href}const Vt="";function kt(){const e=ie.useRef(!1);return ie.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),(r,i)=>{window.setTimeout(()=>{e.current&&r()},i)}}function Rt(e){const{url:r,loadingIndicator:i,...o}=e,[a,s]=ie.useState(!1),f=kt();function c(){f(()=>{s(!0)},1e4)}const m=i??ie.createElement("div",{className:`Svix__mask ${o.darkMode?"Svix__dark":"Svix__light"}`});return ie.createElement(ie.Fragment,null,ie.createElement("div",{style:{borderRadius:"8px",overflow:"hidden",display:"flex",flexGrow:1,position:"relative",width:"100%",...e.style}},!a&&m,e.fullSize?ie.createElement(qe,{allow:"clipboard-write",src:st(r,o),heightCalculationMethod:"max",onLoad:c,style:{width:"1px",minWidth:"100%",display:"block",zIndex:2}}):ie.createElement("iframe",{allow:"clipboard-write",onLoad:c,style:{bottom:0,height:"100%",left:0,position:"absolute",right:0,top:0,width:"100%",zIndex:2},src:st(r,o)})))}function Ft(e){if(!e.token)throw new Error("Missing SvixProvider token property");if(!e.appId)throw new Error("Missing SvixProvider appId property");const r=ie.useMemo(()=>e.appId,[e.appId]),i=ie.useMemo(()=>new ft.Svix(e.token,e.options),[e.token,e.options]);return ie.createElement(ut.Provider,{value:{svix:i,appId:r}},e.children)}const ut=ie.createContext(null);function _t(e){const{svix:r,appId:i}=ee(),{iterator:o,limit:a}=e||{},s=b.useCallback(c=>r.endpoint.list(i,{iterator:o||c,limit:a}),[r,i,o,a]);return ve(s)}function At(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.get(i,e),[r,i,e]);return xe(o)}function It(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getSecret(i,e),[r,i,e]),a=xe(o),s=b.useCallback(async f=>{await r.endpoint.rotateSecret(i,e,f),a.reload()},[r,i,e,a]);return{...a,rotateSecret:s}}function zt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(f=>r.endpoint.recover(i,e,f),[r,i,e]),a=b.useCallback(f=>r.endpoint.update(i,e,f),[r,i,e]),s=b.useCallback(()=>r.endpoint.delete(i,e),[r,i,e]);return{recoverEndpointMessages:o,updateEndpoint:a,deleteEndpoint:s}}function jt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getStats(i,e),[r,i,e]);return xe(o)}function Lt(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.endpoint.getHeaders(i,e),[r,i,e]),a=xe(o),s=b.useCallback(async c=>{await r.endpoint.updateHeaders(i,e,c),a.reload()},[r,i,e,a]),f=b.useCallback(async c=>{await r.endpoint.patchHeaders(i,e,c),a.reload()},[r,i,e,a]);return{...a,updateEndpointHeaders:s,patchEndpointHeaders:f}}function Wt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listByEndpoint(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Dt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listAttemptedMessages(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Nt(e){const{svix:r}=ee(),{iterator:i,limit:o}=e||{},a=b.useCallback(f=>r.eventType.list({iterator:i||f,limit:o,withContent:!0}),[r,o,i]);return ve(a)}function qt(e){const{svix:r,appId:i}=ee(),{iterator:o,limit:a,before:s,after:f,channel:c,eventTypes:m}=e||{},v=b.useMemo(()=>m==null?void 0:m.map(t=>t.name),[m]),h=b.useCallback(t=>r.message.list(i,{iterator:o||t,limit:a,before:s,after:f,channel:c,eventTypes:v}),[r,i,o,a,s,f,c,v]);return ve(h)}function Ht(e){const{svix:r,appId:i}=ee(),o=b.useCallback(()=>r.message.get(i,e),[r,i,e]);return xe(o)}function $t(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s}=r||{},f=b.useCallback(m=>i.messageAttempt.listAttemptedDestinations(o,e,{iterator:a||m,limit:s}),[i,o,e,a,s]);return ve(f)}function Yt(e,r){const{svix:i,appId:o}=ee(),{iterator:a,limit:s,status:f,eventTypes:c,before:m,after:v,statusCodeClass:h,channel:S}=r||{},t=b.useMemo(()=>c==null?void 0:c.map(C=>C.name),[c]),D=b.useCallback(C=>i.messageAttempt.listByMsg(o,e,{iterator:a||C,limit:s,status:f,eventTypes:t,before:m,after:v,statusCodeClass:h,channel:S}),[i,o,e,a,s,f,t,m,v,h,S]);return ve(D)}function Bt(e){const{svix:r,appId:i}=ee();return{resendAttempt:b.useCallback(async()=>{await r.messageAttempt.resend(i,e.msgId,e.endpointId)},[r,i,e])}}function Ut(){const{svix:e,appId:r}=ee(),i=_e(""),o=_e(""),a=_e([]),s=_e(void 0),f=b.useCallback(async()=>{if(i.value==="")return{error:new Error('Field "url" cannot be empty.')};const c=a.value;try{return{endpoint:await e.endpoint.create(r,{url:i.value,description:o.value,rateLimit:s.value,filterTypes:c,version:1})}}catch(m){return{error:m}}},[e,r,i.value,o.value,a.value,s.value]);return{url:i,description:o,eventTypes:a,rateLimitPerSecond:s,createEndpoint:f}}function ee(){return b.useContext(ut)}function _e(e){const[r,i]=b.useState(e);return{value:r,setValue:o=>i(o)}}function xe(e){const[r,i]=b.useState(),[o,a]=b.useState(!1),[s,f]=b.useState(),c=b.useCallback(async()=>{a(!0);try{const m=await e();i(m)}catch(m){f(m)}a(!1)},[e]);return b.useEffect(()=>{c()},[c]),{data:r,reload:c,loading:o,error:s}}function ve(e){const[r,i]=b.useState(),[o,a]=b.useState([]),[s,f]=b.useState(),[c,m]=b.useState(!1),[v,h]=b.useState(),S=b.useMemo(()=>o.length>0,[o]),t=b.useMemo(()=>!!s,[s]),D=b.useCallback(async()=>{m(!0);try{const L=await e(o[0]);i(L.data),f(L.done===!1?L.iterator:void 0)}catch(L){h(L)}m(!1)},[e,o]);b.useEffect(()=>{D()},[D]);const J=b.useCallback(()=>{S&&a(L=>L.slice(1))},[S]),C=b.useCallback(()=>{t&&a(L=>[s,...L])},[t,s]);return{data:r,reload:D,hasPrevPage:S,hasNextPage:t,prevPage:J,nextPage:C,loading:c,error:v,iterator:s}}B.AppPortal=Rt,B.SvixProvider=Ft,B.useAttemptFunctions=Bt,B.useAttemptedMessages=Dt,B.useEndpoint=At,B.useEndpointFunctions=zt,B.useEndpointHeaders=Lt,B.useEndpointMessageAttempts=Wt,B.useEndpointSecret=It,B.useEndpointStats=jt,B.useEndpoints=_t,B.useEventTypes=Nt,B.useMessage=Ht,B.useMessageAttempts=Yt,B.useMessageEndpoints=$t,B.useMessages=qt,B.useNewEndpoint=Ut,B.useSvix=ee,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "svix-react", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "React components for using Svix in your dashboard.", | ||
@@ -5,0 +5,0 @@ "author": "svix", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112132