@machinemetrics/mm-react-embeddable 1.0.0-0 → 1.0.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mm-react-embeddable.cjs.js +32 -3
- package/dist/mm-react-embeddable.es.js +751 -121
- package/dist/mm-react-embeddable.umd.js +32 -3
- package/package.json +10 -3
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),B=require("prop-types"),Fe=require("styled-components");var ue={exports:{}},q={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ae;function hr(){if(Ae)return q;Ae=1;var c=d,p=Symbol.for("react.element"),_=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,T=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function C(S,y,k){var n,u={},s=null,b=null;k!==void 0&&(s=""+k),y.key!==void 0&&(s=""+y.key),y.ref!==void 0&&(b=y.ref);for(n in y)v.call(y,n)&&!h.hasOwnProperty(n)&&(u[n]=y[n]);if(S&&S.defaultProps)for(n in y=S.defaultProps,y)u[n]===void 0&&(u[n]=y[n]);return{$$typeof:p,type:S,key:s,ref:b,props:u,_owner:T.current}}return q.Fragment=_,q.jsx=C,q.jsxs=C,q}var Z={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ie;function Rr(){return Ie||(Ie=1,process.env.NODE_ENV!=="production"&&function(){var c=d,p=Symbol.for("react.element"),_=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),S=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),R=Symbol.iterator,x="@@iterator";function $(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[x];return typeof r=="function"?r:null}var P=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];F("error",e,t)}}function F(e,r,t){{var a=P.ReactDebugCurrentFrame,l=a.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var f=t.map(function(i){return String(i)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var A=!1,Ue=!1,Ve=!1,qe=!1,Ze=!1,le;le=Symbol.for("react.module.reference");function Be(e){return!!(typeof e=="string"||typeof e=="function"||e===v||e===h||Ze||e===T||e===k||e===n||qe||e===b||A||Ue||Ve||typeof e=="object"&&e!==null&&(e.$$typeof===s||e.$$typeof===u||e.$$typeof===C||e.$$typeof===S||e.$$typeof===y||e.$$typeof===le||e.getModuleId!==void 0))}function Je(e,r,t){var a=e.displayName;if(a)return a;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function ce(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case _:return"Portal";case h:return"Profiler";case T:return"StrictMode";case k:return"Suspense";case n:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case S:var r=e;return ce(r)+".Consumer";case C:var t=e;return ce(t._context)+".Provider";case y:return Je(e,e.render,"ForwardRef");case u:var a=e.displayName||null;return a!==null?a:M(e.type)||"Memo";case s:{var l=e,f=l._payload,i=l._init;try{return M(i(f))}catch{return null}}}return null}var I=Object.assign,Y=0,fe,de,ve,pe,be,ge,Ee;function me(){}me.__reactDisabledLog=!0;function Ke(){{if(Y===0){fe=console.log,de=console.info,ve=console.warn,pe=console.error,be=console.group,ge=console.groupCollapsed,Ee=console.groupEnd;var e={configurable:!0,enumerable:!0,value:me,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Ne(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:fe}),info:I({},e,{value:de}),warn:I({},e,{value:ve}),error:I({},e,{value:pe}),group:I({},e,{value:be}),groupCollapsed:I({},e,{value:ge}),groupEnd:I({},e,{value:Ee})})}Y<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=P.ReactCurrentDispatcher,ee;function J(e,r,t){{if(ee===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);ee=a&&a[1]||""}return`
|
|
18
|
+
`+ee+e}}var re=!1,K;{var Ge=typeof WeakMap=="function"?WeakMap:Map;K=new Ge}function ye(e,r){if(!e||re)return"";{var t=K.get(e);if(t!==void 0)return t}var a;re=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=Q.current,Q.current=null,Ke();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){a=O}Reflect.construct(e,[],i)}else{try{i.call()}catch(O){a=O}e.call(i.prototype)}}else{try{throw Error()}catch(O){a=O}e()}}catch(O){if(O&&a&&typeof O.stack=="string"){for(var o=O.stack.split(`
|
|
19
|
+
`),w=a.stack.split(`
|
|
20
|
+
`),E=o.length-1,m=w.length-1;E>=1&&m>=0&&o[E]!==w[m];)m--;for(;E>=1&&m>=0;E--,m--)if(o[E]!==w[m]){if(E!==1||m!==1)do if(E--,m--,m<0||o[E]!==w[m]){var j=`
|
|
21
|
+
`+o[E].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,j),j}while(E>=1&&m>=0);break}}}finally{re=!1,Q.current=f,Ne(),Error.prepareStackTrace=l}var L=e?e.displayName||e.name:"",D=L?J(L):"";return typeof e=="function"&&K.set(e,D),D}function ze(e,r,t){return ye(e,!1)}function Xe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Xe(e));if(typeof e=="string")return J(e);switch(e){case k:return J("Suspense");case n:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return ze(e.render);case u:return N(e.type,r,t);case s:{var a=e,l=a._payload,f=a._init;try{return N(f(l),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,he={},Re=P.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}function He(e,r,t,a,l){{var f=Function.call.bind(U);for(var i in e)if(f(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var w=Error((a||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}o=e[i](r,i,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){o=E}o&&!(o instanceof Error)&&(G(l),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %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).",a||"React class",t,i,typeof o),G(null)),o instanceof Error&&!(o.message in he)&&(he[o.message]=!0,G(l),g("Failed %s type: %s",t,o.message),G(null))}}}var Qe=Array.isArray;function te(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return _e(e),!1}catch{return!0}}function _e(e){return""+e}function we(e){if(rr(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),_e(e)}var V=P.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},Te,Ce,ne;ne={};function nr(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=M(V.current.type);ne[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(V.current.type),e.ref),ne[t]=!0)}}function ir(e,r){{var t=function(){Te||(Te=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function sr(e,r){{var t=function(){Ce||(Ce=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ur=function(e,r,t,a,l,f,i){var o={$$typeof:p,type:e,key:r,ref:t,props:i,_owner:f};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function lr(e,r,t,a,l){{var f,i={},o=null,w=null;t!==void 0&&(we(t),o=""+t),ar(r)&&(we(r.key),o=""+r.key),nr(r)&&(w=r.ref,or(r,l));for(f in r)U.call(r,f)&&!tr.hasOwnProperty(f)&&(i[f]=r[f]);if(e&&e.defaultProps){var E=e.defaultProps;for(f in E)i[f]===void 0&&(i[f]=E[f])}if(o||w){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&ir(i,m),w&&sr(i,m)}return ur(e,o,w,l,a,V.current,i)}}var ae=P.ReactCurrentOwner,Se=P.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(t)}else Se.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function Oe(){{if(ae.current){var e=M(ae.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function cr(e){return""}var Pe={};function fr(e){{var r=Oe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Pe[t])return;Pe[t]=!0;var a="";e&&e._owner&&e._owner!==ae.current&&(a=" It was passed a child from "+M(e._owner.type)+"."),W(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),W(null)}}function xe(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&je(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var l=$(e);if(typeof l=="function"&&l!==e.entries)for(var f=l.call(e),i;!(i=f.next()).done;)ie(i.value)&&je(i.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===u))t=r.propTypes;else return;if(t){var a=M(r);He(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var l=M(r);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){W(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),W(null);break}}e.ref!==null&&(W(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}var ke={};function Me(e,r,t,a,l,f){{var i=Be(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=cr();w?o+=w:o+=Oe();var E;e===null?E="null":te(e)?E="array":e!==void 0&&e.$$typeof===p?(E="<"+(M(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,o)}var m=lr(e,r,t,l,f);if(m==null)return m;if(i){var j=r.children;if(j!==void 0)if(a)if(te(j)){for(var L=0;L<j.length;L++)xe(j[L],e);Object.freeze&&Object.freeze(j)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else xe(j,e)}if(U.call(r,"key")){var D=M(e),O=Object.keys(r).filter(function(yr){return yr!=="key"}),se=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!ke[D+se]){var mr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,se,D,mr,D),ke[D+se]=!0}}return e===v?vr(m):dr(m),m}}function pr(e,r,t){return Me(e,r,t,!0)}function br(e,r,t){return Me(e,r,t,!1)}var gr=br,Er=pr;Z.Fragment=v,Z.jsx=gr,Z.jsxs=Er}()),Z}process.env.NODE_ENV==="production"?ue.exports=hr():ue.exports=Rr();var X=ue.exports;const H=d.createContext(null),De=({children:c})=>{const[p,_]=d.useState({}),v=d.useRef({}),T=d.useCallback((n,u,s)=>{_(b=>({...b,[n]:{origin:u,frameRef:s}}))},[]),h=d.useCallback(n=>{_(u=>{const s={...u};return delete s[n],s})},[]);d.useEffect(()=>{const n=(s=[],b)=>{s.forEach(R=>R(b))},u=s=>{var $,P,g,F,A;if(!(($=s==null?void 0:s.data)!=null&&$.instanceId))return;const{instanceId:b,type:R}=s.data,x=v.current;n((P=x[b])==null?void 0:P[R],s.data),n((g=x["*"])==null?void 0:g[R],s.data),n((F=x[b])==null?void 0:F["*"],s.data),n((A=x["*"])==null?void 0:A["*"],s.data)};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u)}},[p]);const C=d.useCallback((n,u,s)=>{var R,x;const b=p[n];if(!b){console.warn(`Origin not set for id: ${n}. Unable to send message.`);return}(x=(R=b==null?void 0:b.frameRef)==null?void 0:R.current)!=null&&x.contentWindow&&b.frameRef.current.contentWindow.postMessage({type:u,...s,instanceId:n},b.origin)},[p]),S=d.useCallback((n,u)=>{C(n,"load-options",u)},[C]),y=d.useCallback((n,u)=>{C(n,"validate",u)},[C]),k={registerFrame:T,unregisterFrame:h,sendMessage:C,loadOptions:S,validate:y,addListener:(n,u,s)=>(v.current[n]||(v.current[n]={}),v.current[n][u]||(v.current[n][u]=[]),v.current[n][u].push(s),()=>{v.current[n][u]=v.current[n][u].filter(b=>b!==s)})};return X.jsx(H.Provider,{value:k,children:c})},z={},$e=async c=>{try{const p=new URL(c).origin;if(z[p]!==void 0)return z[p];const v=await(await fetch(`${p}/mm-app-manifest.json`)).json();if(!v.version)throw new Error("Invalid manifest");return z[p]=v,v}catch{}return z[origin]=!1,!1},We=async c=>!!await $e(c),Le=(c,p,_)=>{const v=d.useContext(H);if(v===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const T=d.useRef(_);d.useEffect(()=>{T.current=_},[_]),d.useEffect(()=>{if(!(!c||!p))return v.addListener(c,p,(...h)=>T.current(...h))},[v,c,p])};De.propTypes={children:B.node.isRequired};const _r=Fe.default||Fe,wr=_r.iframe`
|
|
2
31
|
width: 100%;
|
|
3
32
|
height: 100%;
|
|
4
33
|
border: none;
|
|
5
|
-
visibility: ${
|
|
6
|
-
`,
|
|
34
|
+
visibility: ${c=>c.$isReady?"visible":"hidden"};
|
|
35
|
+
`,Ye=({id:c,src:p,path:_,onInit:v=()=>{},context:T,params:h,...C})=>{if("isConfiguring"in C)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in T)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in T)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const S=d.useRef(),[y,k]=d.useState(),[n,u]=d.useState(0),{registerFrame:s,unregisterFrame:b,sendMessage:R}=d.useContext(H),[x,$]=d.useState(!0),[P,g]=d.useState();return d.useEffect(()=>{n&&R(c,"set-context",{context:{...T,colorMode:h.colorMode,isFullScreen:h.isFullScreen}})},[T,h.colorMode,h.isFullScreen,c,n]),d.useEffect(()=>{n&&(R(c,"set-params",{params:h}),R(c,"set-configuring",{isConfiguring:h.isConfiguring}))},[h,c,n]),d.useEffect(()=>{_!==void 0&&g(_)},[_]),d.useEffect(()=>{P===void 0||!n||R(c,"navigate",{path:P})},[P,n,c,R]),d.useEffect(()=>{if(!(!p||!c||!S))return(async()=>{const F=await We(p);if($(F),F){const A=new URL(p);s(c,A.origin,S),v(),k(`${A.origin}/mm-embedded-interop?id=${c}&origin=${window.location.origin}`);return}})(),()=>{b(c)}},[p,c,s,S]),Le(c,"ready",()=>u(F=>F+1)),x?X.jsx(wr,{$isReady:n,ref:S,src:y,...C}):X.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:X.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};Ye.propTypes={id:B.string,src:B.string.isRequired,path:B.string,onInit:B.func};exports.MMEmbeddableZone=Ye;exports.MMEmbeddableZoneContext=H;exports.MMEmbeddableZoneProvider=De;exports.getAppInfo=$e;exports.testIsEmbeddable=We;exports.useEmbeddedEffect=Le;
|
|
@@ -1,157 +1,787 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import Le, { createContext as Er, useState as K, useRef as ce, useCallback as q, useEffect as M, useContext as Ye } from "react";
|
|
2
|
+
import Z from "prop-types";
|
|
3
|
+
import De from "styled-components";
|
|
4
|
+
var le = { exports: {} }, B = {};
|
|
5
|
+
/**
|
|
6
|
+
* @license React
|
|
7
|
+
* react-jsx-runtime.production.min.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var $e;
|
|
15
|
+
function Rr() {
|
|
16
|
+
if ($e) return B;
|
|
17
|
+
$e = 1;
|
|
18
|
+
var c = Le, v = Symbol.for("react.element"), R = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, w = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function T(C, h, x) {
|
|
20
|
+
var n, u = {}, s = null, p = null;
|
|
21
|
+
x !== void 0 && (s = "" + x), h.key !== void 0 && (s = "" + h.key), h.ref !== void 0 && (p = h.ref);
|
|
22
|
+
for (n in h) d.call(h, n) && !y.hasOwnProperty(n) && (u[n] = h[n]);
|
|
23
|
+
if (C && C.defaultProps) for (n in h = C.defaultProps, h) u[n] === void 0 && (u[n] = h[n]);
|
|
24
|
+
return { $$typeof: v, type: C, key: s, ref: p, props: u, _owner: w.current };
|
|
25
|
+
}
|
|
26
|
+
return B.Fragment = R, B.jsx = T, B.jsxs = T, B;
|
|
27
|
+
}
|
|
28
|
+
var J = {};
|
|
29
|
+
/**
|
|
30
|
+
* @license React
|
|
31
|
+
* react-jsx-runtime.development.js
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/
|
|
38
|
+
var We;
|
|
39
|
+
function _r() {
|
|
40
|
+
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
|
|
41
|
+
var c = Le, v = Symbol.for("react.element"), R = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), C = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), s = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), E = Symbol.iterator, j = "@@iterator";
|
|
42
|
+
function $(e) {
|
|
43
|
+
if (e === null || typeof e != "object")
|
|
44
|
+
return null;
|
|
45
|
+
var r = E && e[E] || e[j];
|
|
46
|
+
return typeof r == "function" ? r : null;
|
|
47
|
+
}
|
|
48
|
+
var O = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
49
|
+
function g(e) {
|
|
50
|
+
{
|
|
51
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
|
|
52
|
+
t[a - 1] = arguments[a];
|
|
53
|
+
F("error", e, t);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function F(e, r, t) {
|
|
57
|
+
{
|
|
58
|
+
var a = O.ReactDebugCurrentFrame, l = a.getStackAddendum();
|
|
59
|
+
l !== "" && (r += "%s", t = t.concat([l]));
|
|
60
|
+
var f = t.map(function(i) {
|
|
61
|
+
return String(i);
|
|
62
|
+
});
|
|
63
|
+
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
var A = !1, Ue = !1, Ve = !1, qe = !1, Be = !1, de;
|
|
67
|
+
de = Symbol.for("react.module.reference");
|
|
68
|
+
function Je(e) {
|
|
69
|
+
return !!(typeof e == "string" || typeof e == "function" || e === d || e === y || Be || e === w || e === x || e === n || qe || e === p || A || Ue || Ve || typeof e == "object" && e !== null && (e.$$typeof === s || e.$$typeof === u || e.$$typeof === T || e.$$typeof === C || e.$$typeof === h || // This needs to include all possible module reference object
|
|
70
|
+
// types supported by any Flight configuration anywhere since
|
|
71
|
+
// we don't know which Flight build this will end up being used
|
|
72
|
+
// with.
|
|
73
|
+
e.$$typeof === de || e.getModuleId !== void 0));
|
|
74
|
+
}
|
|
75
|
+
function Ke(e, r, t) {
|
|
76
|
+
var a = e.displayName;
|
|
77
|
+
if (a)
|
|
78
|
+
return a;
|
|
79
|
+
var l = r.displayName || r.name || "";
|
|
80
|
+
return l !== "" ? t + "(" + l + ")" : t;
|
|
81
|
+
}
|
|
82
|
+
function ve(e) {
|
|
83
|
+
return e.displayName || "Context";
|
|
84
|
+
}
|
|
85
|
+
function k(e) {
|
|
86
|
+
if (e == null)
|
|
87
|
+
return null;
|
|
88
|
+
if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
89
|
+
return e.displayName || e.name || null;
|
|
90
|
+
if (typeof e == "string")
|
|
91
|
+
return e;
|
|
92
|
+
switch (e) {
|
|
93
|
+
case d:
|
|
94
|
+
return "Fragment";
|
|
95
|
+
case R:
|
|
96
|
+
return "Portal";
|
|
97
|
+
case y:
|
|
98
|
+
return "Profiler";
|
|
99
|
+
case w:
|
|
100
|
+
return "StrictMode";
|
|
101
|
+
case x:
|
|
102
|
+
return "Suspense";
|
|
103
|
+
case n:
|
|
104
|
+
return "SuspenseList";
|
|
105
|
+
}
|
|
106
|
+
if (typeof e == "object")
|
|
107
|
+
switch (e.$$typeof) {
|
|
108
|
+
case C:
|
|
109
|
+
var r = e;
|
|
110
|
+
return ve(r) + ".Consumer";
|
|
111
|
+
case T:
|
|
112
|
+
var t = e;
|
|
113
|
+
return ve(t._context) + ".Provider";
|
|
114
|
+
case h:
|
|
115
|
+
return Ke(e, e.render, "ForwardRef");
|
|
116
|
+
case u:
|
|
117
|
+
var a = e.displayName || null;
|
|
118
|
+
return a !== null ? a : k(e.type) || "Memo";
|
|
119
|
+
case s: {
|
|
120
|
+
var l = e, f = l._payload, i = l._init;
|
|
121
|
+
try {
|
|
122
|
+
return k(i(f));
|
|
123
|
+
} catch {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
var I = Object.assign, Y = 0, pe, ge, be, me, he, ye, Ee;
|
|
131
|
+
function Re() {
|
|
132
|
+
}
|
|
133
|
+
Re.__reactDisabledLog = !0;
|
|
134
|
+
function Ze() {
|
|
135
|
+
{
|
|
136
|
+
if (Y === 0) {
|
|
137
|
+
pe = console.log, ge = console.info, be = console.warn, me = console.error, he = console.group, ye = console.groupCollapsed, Ee = console.groupEnd;
|
|
138
|
+
var e = {
|
|
139
|
+
configurable: !0,
|
|
140
|
+
enumerable: !0,
|
|
141
|
+
value: Re,
|
|
142
|
+
writable: !0
|
|
143
|
+
};
|
|
144
|
+
Object.defineProperties(console, {
|
|
145
|
+
info: e,
|
|
146
|
+
log: e,
|
|
147
|
+
warn: e,
|
|
148
|
+
error: e,
|
|
149
|
+
group: e,
|
|
150
|
+
groupCollapsed: e,
|
|
151
|
+
groupEnd: e
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
Y++;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function Ne() {
|
|
158
|
+
{
|
|
159
|
+
if (Y--, Y === 0) {
|
|
160
|
+
var e = {
|
|
161
|
+
configurable: !0,
|
|
162
|
+
enumerable: !0,
|
|
163
|
+
writable: !0
|
|
164
|
+
};
|
|
165
|
+
Object.defineProperties(console, {
|
|
166
|
+
log: I({}, e, {
|
|
167
|
+
value: pe
|
|
168
|
+
}),
|
|
169
|
+
info: I({}, e, {
|
|
170
|
+
value: ge
|
|
171
|
+
}),
|
|
172
|
+
warn: I({}, e, {
|
|
173
|
+
value: be
|
|
174
|
+
}),
|
|
175
|
+
error: I({}, e, {
|
|
176
|
+
value: me
|
|
177
|
+
}),
|
|
178
|
+
group: I({}, e, {
|
|
179
|
+
value: he
|
|
180
|
+
}),
|
|
181
|
+
groupCollapsed: I({}, e, {
|
|
182
|
+
value: ye
|
|
183
|
+
}),
|
|
184
|
+
groupEnd: I({}, e, {
|
|
185
|
+
value: Ee
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
Y < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var ee = O.ReactCurrentDispatcher, re;
|
|
193
|
+
function N(e, r, t) {
|
|
194
|
+
{
|
|
195
|
+
if (re === void 0)
|
|
196
|
+
try {
|
|
197
|
+
throw Error();
|
|
198
|
+
} catch (l) {
|
|
199
|
+
var a = l.stack.trim().match(/\n( *(at )?)/);
|
|
200
|
+
re = a && a[1] || "";
|
|
201
|
+
}
|
|
202
|
+
return `
|
|
203
|
+
` + re + e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
var te = !1, G;
|
|
207
|
+
{
|
|
208
|
+
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
209
|
+
G = new Ge();
|
|
210
|
+
}
|
|
211
|
+
function _e(e, r) {
|
|
212
|
+
if (!e || te)
|
|
213
|
+
return "";
|
|
214
|
+
{
|
|
215
|
+
var t = G.get(e);
|
|
216
|
+
if (t !== void 0)
|
|
217
|
+
return t;
|
|
218
|
+
}
|
|
219
|
+
var a;
|
|
220
|
+
te = !0;
|
|
221
|
+
var l = Error.prepareStackTrace;
|
|
222
|
+
Error.prepareStackTrace = void 0;
|
|
223
|
+
var f;
|
|
224
|
+
f = ee.current, ee.current = null, Ze();
|
|
225
|
+
try {
|
|
226
|
+
if (r) {
|
|
227
|
+
var i = function() {
|
|
228
|
+
throw Error();
|
|
229
|
+
};
|
|
230
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
231
|
+
set: function() {
|
|
232
|
+
throw Error();
|
|
233
|
+
}
|
|
234
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
235
|
+
try {
|
|
236
|
+
Reflect.construct(i, []);
|
|
237
|
+
} catch (S) {
|
|
238
|
+
a = S;
|
|
239
|
+
}
|
|
240
|
+
Reflect.construct(e, [], i);
|
|
241
|
+
} else {
|
|
242
|
+
try {
|
|
243
|
+
i.call();
|
|
244
|
+
} catch (S) {
|
|
245
|
+
a = S;
|
|
246
|
+
}
|
|
247
|
+
e.call(i.prototype);
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
try {
|
|
251
|
+
throw Error();
|
|
252
|
+
} catch (S) {
|
|
253
|
+
a = S;
|
|
254
|
+
}
|
|
255
|
+
e();
|
|
256
|
+
}
|
|
257
|
+
} catch (S) {
|
|
258
|
+
if (S && a && typeof S.stack == "string") {
|
|
259
|
+
for (var o = S.stack.split(`
|
|
260
|
+
`), _ = a.stack.split(`
|
|
261
|
+
`), b = o.length - 1, m = _.length - 1; b >= 1 && m >= 0 && o[b] !== _[m]; )
|
|
262
|
+
m--;
|
|
263
|
+
for (; b >= 1 && m >= 0; b--, m--)
|
|
264
|
+
if (o[b] !== _[m]) {
|
|
265
|
+
if (b !== 1 || m !== 1)
|
|
266
|
+
do
|
|
267
|
+
if (b--, m--, m < 0 || o[b] !== _[m]) {
|
|
268
|
+
var P = `
|
|
269
|
+
` + o[b].replace(" at new ", " at ");
|
|
270
|
+
return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, P), P;
|
|
271
|
+
}
|
|
272
|
+
while (b >= 1 && m >= 0);
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
} finally {
|
|
277
|
+
te = !1, ee.current = f, Ne(), Error.prepareStackTrace = l;
|
|
278
|
+
}
|
|
279
|
+
var L = e ? e.displayName || e.name : "", D = L ? N(L) : "";
|
|
280
|
+
return typeof e == "function" && G.set(e, D), D;
|
|
281
|
+
}
|
|
282
|
+
function ze(e, r, t) {
|
|
283
|
+
return _e(e, !1);
|
|
284
|
+
}
|
|
285
|
+
function Xe(e) {
|
|
286
|
+
var r = e.prototype;
|
|
287
|
+
return !!(r && r.isReactComponent);
|
|
288
|
+
}
|
|
289
|
+
function z(e, r, t) {
|
|
290
|
+
if (e == null)
|
|
291
|
+
return "";
|
|
292
|
+
if (typeof e == "function")
|
|
293
|
+
return _e(e, Xe(e));
|
|
294
|
+
if (typeof e == "string")
|
|
295
|
+
return N(e);
|
|
296
|
+
switch (e) {
|
|
297
|
+
case x:
|
|
298
|
+
return N("Suspense");
|
|
299
|
+
case n:
|
|
300
|
+
return N("SuspenseList");
|
|
301
|
+
}
|
|
302
|
+
if (typeof e == "object")
|
|
303
|
+
switch (e.$$typeof) {
|
|
304
|
+
case h:
|
|
305
|
+
return ze(e.render);
|
|
306
|
+
case u:
|
|
307
|
+
return z(e.type, r, t);
|
|
308
|
+
case s: {
|
|
309
|
+
var a = e, l = a._payload, f = a._init;
|
|
310
|
+
try {
|
|
311
|
+
return z(f(l), r, t);
|
|
312
|
+
} catch {
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return "";
|
|
317
|
+
}
|
|
318
|
+
var U = Object.prototype.hasOwnProperty, we = {}, Te = O.ReactDebugCurrentFrame;
|
|
319
|
+
function X(e) {
|
|
320
|
+
if (e) {
|
|
321
|
+
var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
|
|
322
|
+
Te.setExtraStackFrame(t);
|
|
323
|
+
} else
|
|
324
|
+
Te.setExtraStackFrame(null);
|
|
325
|
+
}
|
|
326
|
+
function He(e, r, t, a, l) {
|
|
327
|
+
{
|
|
328
|
+
var f = Function.call.bind(U);
|
|
329
|
+
for (var i in e)
|
|
330
|
+
if (f(e, i)) {
|
|
331
|
+
var o = void 0;
|
|
332
|
+
try {
|
|
333
|
+
if (typeof e[i] != "function") {
|
|
334
|
+
var _ = Error((a || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
335
|
+
throw _.name = "Invariant Violation", _;
|
|
336
|
+
}
|
|
337
|
+
o = e[i](r, i, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
338
|
+
} catch (b) {
|
|
339
|
+
o = b;
|
|
340
|
+
}
|
|
341
|
+
o && !(o instanceof Error) && (X(l), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %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).", a || "React class", t, i, typeof o), X(null)), o instanceof Error && !(o.message in we) && (we[o.message] = !0, X(l), g("Failed %s type: %s", t, o.message), X(null));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
var Qe = Array.isArray;
|
|
346
|
+
function ne(e) {
|
|
347
|
+
return Qe(e);
|
|
348
|
+
}
|
|
349
|
+
function er(e) {
|
|
350
|
+
{
|
|
351
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
352
|
+
return t;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function rr(e) {
|
|
356
|
+
try {
|
|
357
|
+
return Ce(e), !1;
|
|
358
|
+
} catch {
|
|
359
|
+
return !0;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function Ce(e) {
|
|
363
|
+
return "" + e;
|
|
364
|
+
}
|
|
365
|
+
function Se(e) {
|
|
366
|
+
if (rr(e))
|
|
367
|
+
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Ce(e);
|
|
368
|
+
}
|
|
369
|
+
var V = O.ReactCurrentOwner, tr = {
|
|
370
|
+
key: !0,
|
|
371
|
+
ref: !0,
|
|
372
|
+
__self: !0,
|
|
373
|
+
__source: !0
|
|
374
|
+
}, Oe, Pe, ae;
|
|
375
|
+
ae = {};
|
|
376
|
+
function nr(e) {
|
|
377
|
+
if (U.call(e, "ref")) {
|
|
378
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
|
+
if (r && r.isReactWarning)
|
|
380
|
+
return !1;
|
|
381
|
+
}
|
|
382
|
+
return e.ref !== void 0;
|
|
383
|
+
}
|
|
384
|
+
function ar(e) {
|
|
385
|
+
if (U.call(e, "key")) {
|
|
386
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
387
|
+
if (r && r.isReactWarning)
|
|
388
|
+
return !1;
|
|
389
|
+
}
|
|
390
|
+
return e.key !== void 0;
|
|
391
|
+
}
|
|
392
|
+
function or(e, r) {
|
|
393
|
+
if (typeof e.ref == "string" && V.current && r && V.current.stateNode !== r) {
|
|
394
|
+
var t = k(V.current.type);
|
|
395
|
+
ae[t] || (g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(V.current.type), e.ref), ae[t] = !0);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function ir(e, r) {
|
|
399
|
+
{
|
|
400
|
+
var t = function() {
|
|
401
|
+
Oe || (Oe = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
402
|
+
};
|
|
403
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
404
|
+
get: t,
|
|
405
|
+
configurable: !0
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function sr(e, r) {
|
|
410
|
+
{
|
|
411
|
+
var t = function() {
|
|
412
|
+
Pe || (Pe = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
413
|
+
};
|
|
414
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
415
|
+
get: t,
|
|
416
|
+
configurable: !0
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
var ur = function(e, r, t, a, l, f, i) {
|
|
421
|
+
var o = {
|
|
422
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
423
|
+
$$typeof: v,
|
|
424
|
+
// Built-in properties that belong on the element
|
|
425
|
+
type: e,
|
|
426
|
+
key: r,
|
|
427
|
+
ref: t,
|
|
428
|
+
props: i,
|
|
429
|
+
// Record the component responsible for creating this element.
|
|
430
|
+
_owner: f
|
|
431
|
+
};
|
|
432
|
+
return o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
433
|
+
configurable: !1,
|
|
434
|
+
enumerable: !1,
|
|
435
|
+
writable: !0,
|
|
436
|
+
value: !1
|
|
437
|
+
}), Object.defineProperty(o, "_self", {
|
|
438
|
+
configurable: !1,
|
|
439
|
+
enumerable: !1,
|
|
440
|
+
writable: !1,
|
|
441
|
+
value: a
|
|
442
|
+
}), Object.defineProperty(o, "_source", {
|
|
443
|
+
configurable: !1,
|
|
444
|
+
enumerable: !1,
|
|
445
|
+
writable: !1,
|
|
446
|
+
value: l
|
|
447
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
448
|
+
};
|
|
449
|
+
function lr(e, r, t, a, l) {
|
|
450
|
+
{
|
|
451
|
+
var f, i = {}, o = null, _ = null;
|
|
452
|
+
t !== void 0 && (Se(t), o = "" + t), ar(r) && (Se(r.key), o = "" + r.key), nr(r) && (_ = r.ref, or(r, l));
|
|
453
|
+
for (f in r)
|
|
454
|
+
U.call(r, f) && !tr.hasOwnProperty(f) && (i[f] = r[f]);
|
|
455
|
+
if (e && e.defaultProps) {
|
|
456
|
+
var b = e.defaultProps;
|
|
457
|
+
for (f in b)
|
|
458
|
+
i[f] === void 0 && (i[f] = b[f]);
|
|
459
|
+
}
|
|
460
|
+
if (o || _) {
|
|
461
|
+
var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
462
|
+
o && ir(i, m), _ && sr(i, m);
|
|
463
|
+
}
|
|
464
|
+
return ur(e, o, _, l, a, V.current, i);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
var oe = O.ReactCurrentOwner, je = O.ReactDebugCurrentFrame;
|
|
468
|
+
function W(e) {
|
|
469
|
+
if (e) {
|
|
470
|
+
var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
|
|
471
|
+
je.setExtraStackFrame(t);
|
|
472
|
+
} else
|
|
473
|
+
je.setExtraStackFrame(null);
|
|
474
|
+
}
|
|
475
|
+
var ie;
|
|
476
|
+
ie = !1;
|
|
477
|
+
function se(e) {
|
|
478
|
+
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
479
|
+
}
|
|
480
|
+
function xe() {
|
|
481
|
+
{
|
|
482
|
+
if (oe.current) {
|
|
483
|
+
var e = k(oe.current.type);
|
|
484
|
+
if (e)
|
|
485
|
+
return `
|
|
486
|
+
|
|
487
|
+
Check the render method of \`` + e + "`.";
|
|
488
|
+
}
|
|
489
|
+
return "";
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function cr(e) {
|
|
493
|
+
return "";
|
|
494
|
+
}
|
|
495
|
+
var ke = {};
|
|
496
|
+
function fr(e) {
|
|
497
|
+
{
|
|
498
|
+
var r = xe();
|
|
499
|
+
if (!r) {
|
|
500
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
501
|
+
t && (r = `
|
|
502
|
+
|
|
503
|
+
Check the top-level render call using <` + t + ">.");
|
|
504
|
+
}
|
|
505
|
+
return r;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
function Fe(e, r) {
|
|
509
|
+
{
|
|
510
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
511
|
+
return;
|
|
512
|
+
e._store.validated = !0;
|
|
513
|
+
var t = fr(r);
|
|
514
|
+
if (ke[t])
|
|
515
|
+
return;
|
|
516
|
+
ke[t] = !0;
|
|
517
|
+
var a = "";
|
|
518
|
+
e && e._owner && e._owner !== oe.current && (a = " It was passed a child from " + k(e._owner.type) + "."), W(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), W(null);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
function Me(e, r) {
|
|
522
|
+
{
|
|
523
|
+
if (typeof e != "object")
|
|
524
|
+
return;
|
|
525
|
+
if (ne(e))
|
|
526
|
+
for (var t = 0; t < e.length; t++) {
|
|
527
|
+
var a = e[t];
|
|
528
|
+
se(a) && Fe(a, r);
|
|
529
|
+
}
|
|
530
|
+
else if (se(e))
|
|
531
|
+
e._store && (e._store.validated = !0);
|
|
532
|
+
else if (e) {
|
|
533
|
+
var l = $(e);
|
|
534
|
+
if (typeof l == "function" && l !== e.entries)
|
|
535
|
+
for (var f = l.call(e), i; !(i = f.next()).done; )
|
|
536
|
+
se(i.value) && Fe(i.value, r);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function dr(e) {
|
|
541
|
+
{
|
|
542
|
+
var r = e.type;
|
|
543
|
+
if (r == null || typeof r == "string")
|
|
544
|
+
return;
|
|
545
|
+
var t;
|
|
546
|
+
if (typeof r == "function")
|
|
547
|
+
t = r.propTypes;
|
|
548
|
+
else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
|
|
549
|
+
// Inner props are checked in the reconciler.
|
|
550
|
+
r.$$typeof === u))
|
|
551
|
+
t = r.propTypes;
|
|
552
|
+
else
|
|
553
|
+
return;
|
|
554
|
+
if (t) {
|
|
555
|
+
var a = k(r);
|
|
556
|
+
He(t, e.props, "prop", a, e);
|
|
557
|
+
} else if (r.PropTypes !== void 0 && !ie) {
|
|
558
|
+
ie = !0;
|
|
559
|
+
var l = k(r);
|
|
560
|
+
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
|
|
561
|
+
}
|
|
562
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function vr(e) {
|
|
566
|
+
{
|
|
567
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
568
|
+
var a = r[t];
|
|
569
|
+
if (a !== "children" && a !== "key") {
|
|
570
|
+
W(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), W(null);
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
e.ref !== null && (W(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
var Ae = {};
|
|
578
|
+
function Ie(e, r, t, a, l, f) {
|
|
579
|
+
{
|
|
580
|
+
var i = Je(e);
|
|
581
|
+
if (!i) {
|
|
582
|
+
var o = "";
|
|
583
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
584
|
+
var _ = cr();
|
|
585
|
+
_ ? o += _ : o += xe();
|
|
586
|
+
var b;
|
|
587
|
+
e === null ? b = "null" : ne(e) ? b = "array" : e !== void 0 && e.$$typeof === v ? (b = "<" + (k(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, o);
|
|
588
|
+
}
|
|
589
|
+
var m = lr(e, r, t, l, f);
|
|
590
|
+
if (m == null)
|
|
591
|
+
return m;
|
|
592
|
+
if (i) {
|
|
593
|
+
var P = r.children;
|
|
594
|
+
if (P !== void 0)
|
|
595
|
+
if (a)
|
|
596
|
+
if (ne(P)) {
|
|
597
|
+
for (var L = 0; L < P.length; L++)
|
|
598
|
+
Me(P[L], e);
|
|
599
|
+
Object.freeze && Object.freeze(P);
|
|
600
|
+
} else
|
|
601
|
+
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
602
|
+
else
|
|
603
|
+
Me(P, e);
|
|
604
|
+
}
|
|
605
|
+
if (U.call(r, "key")) {
|
|
606
|
+
var D = k(e), S = Object.keys(r).filter(function(yr) {
|
|
607
|
+
return yr !== "key";
|
|
608
|
+
}), ue = S.length > 0 ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
609
|
+
if (!Ae[D + ue]) {
|
|
610
|
+
var hr = S.length > 0 ? "{" + S.join(": ..., ") + ": ...}" : "{}";
|
|
611
|
+
g(`A props object containing a "key" prop is being spread into JSX:
|
|
612
|
+
let props = %s;
|
|
613
|
+
<%s {...props} />
|
|
614
|
+
React keys must be passed directly to JSX without using spread:
|
|
615
|
+
let props = %s;
|
|
616
|
+
<%s key={someKey} {...props} />`, ue, D, hr, D), Ae[D + ue] = !0;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
return e === d ? vr(m) : dr(m), m;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function pr(e, r, t) {
|
|
623
|
+
return Ie(e, r, t, !0);
|
|
624
|
+
}
|
|
625
|
+
function gr(e, r, t) {
|
|
626
|
+
return Ie(e, r, t, !1);
|
|
627
|
+
}
|
|
628
|
+
var br = gr, mr = pr;
|
|
629
|
+
J.Fragment = d, J.jsx = br, J.jsxs = mr;
|
|
630
|
+
}()), J;
|
|
631
|
+
}
|
|
632
|
+
process.env.NODE_ENV === "production" ? le.exports = Rr() : le.exports = _r();
|
|
633
|
+
var Q = le.exports;
|
|
634
|
+
const fe = Er(null), wr = ({ children: c }) => {
|
|
635
|
+
const [v, R] = K({}), d = ce({}), w = q((n, u, s) => {
|
|
636
|
+
R((p) => ({ ...p, [n]: { origin: u, frameRef: s } }));
|
|
637
|
+
}, []), y = q((n) => {
|
|
638
|
+
R((u) => {
|
|
639
|
+
const s = { ...u };
|
|
640
|
+
return delete s[n], s;
|
|
11
641
|
});
|
|
12
642
|
}, []);
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
var
|
|
18
|
-
if (!((
|
|
643
|
+
M(() => {
|
|
644
|
+
const n = (s = [], p) => {
|
|
645
|
+
s.forEach((E) => E(p));
|
|
646
|
+
}, u = (s) => {
|
|
647
|
+
var $, O, g, F, A;
|
|
648
|
+
if (!(($ = s == null ? void 0 : s.data) != null && $.instanceId))
|
|
19
649
|
return;
|
|
20
|
-
const { instanceId:
|
|
21
|
-
|
|
650
|
+
const { instanceId: p, type: E } = s.data, j = d.current;
|
|
651
|
+
n((O = j[p]) == null ? void 0 : O[E], s.data), n((g = j["*"]) == null ? void 0 : g[E], s.data), n((F = j[p]) == null ? void 0 : F["*"], s.data), n((A = j["*"]) == null ? void 0 : A["*"], s.data);
|
|
22
652
|
};
|
|
23
|
-
return window.addEventListener("message",
|
|
24
|
-
window.removeEventListener("message",
|
|
653
|
+
return window.addEventListener("message", u), () => {
|
|
654
|
+
window.removeEventListener("message", u);
|
|
25
655
|
};
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
28
|
-
(
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
console.warn(`Origin not set for id: ${
|
|
656
|
+
}, [v]);
|
|
657
|
+
const T = q(
|
|
658
|
+
(n, u, s) => {
|
|
659
|
+
var E, j;
|
|
660
|
+
const p = v[n];
|
|
661
|
+
if (!p) {
|
|
662
|
+
console.warn(`Origin not set for id: ${n}. Unable to send message.`);
|
|
33
663
|
return;
|
|
34
664
|
}
|
|
35
|
-
(
|
|
36
|
-
{ type:
|
|
37
|
-
|
|
665
|
+
(j = (E = p == null ? void 0 : p.frameRef) == null ? void 0 : E.current) != null && j.contentWindow && p.frameRef.current.contentWindow.postMessage(
|
|
666
|
+
{ type: u, ...s, instanceId: n },
|
|
667
|
+
p.origin
|
|
38
668
|
);
|
|
39
669
|
},
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
(
|
|
43
|
-
|
|
670
|
+
[v]
|
|
671
|
+
), C = q(
|
|
672
|
+
(n, u) => {
|
|
673
|
+
T(n, "load-options", u);
|
|
44
674
|
},
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
|
|
675
|
+
[T]
|
|
676
|
+
), h = q(
|
|
677
|
+
(n, u) => {
|
|
678
|
+
T(n, "validate", u);
|
|
49
679
|
},
|
|
50
|
-
[
|
|
51
|
-
),
|
|
52
|
-
registerFrame:
|
|
53
|
-
unregisterFrame:
|
|
54
|
-
sendMessage:
|
|
55
|
-
loadOptions:
|
|
56
|
-
validate:
|
|
57
|
-
addListener: (
|
|
58
|
-
|
|
680
|
+
[T]
|
|
681
|
+
), x = {
|
|
682
|
+
registerFrame: w,
|
|
683
|
+
unregisterFrame: y,
|
|
684
|
+
sendMessage: T,
|
|
685
|
+
loadOptions: C,
|
|
686
|
+
validate: h,
|
|
687
|
+
addListener: (n, u, s) => (d.current[n] || (d.current[n] = {}), d.current[n][u] || (d.current[n][u] = []), d.current[n][u].push(s), () => {
|
|
688
|
+
d.current[n][u] = d.current[n][u].filter((p) => p !== s);
|
|
59
689
|
})
|
|
60
690
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
},
|
|
691
|
+
return /* @__PURE__ */ Q.jsx(fe.Provider, { value: x, children: c });
|
|
692
|
+
}, H = {}, Tr = async (c) => {
|
|
63
693
|
try {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
return
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
694
|
+
const v = new URL(c).origin;
|
|
695
|
+
if (H[v] !== void 0)
|
|
696
|
+
return H[v];
|
|
697
|
+
const d = await (await fetch(`${v}/mm-app-manifest.json`)).json();
|
|
698
|
+
if (!d.version)
|
|
69
699
|
throw new Error("Invalid manifest");
|
|
70
|
-
return
|
|
700
|
+
return H[v] = d, d;
|
|
71
701
|
} catch {
|
|
72
702
|
}
|
|
73
|
-
return
|
|
74
|
-
},
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
703
|
+
return H[origin] = !1, !1;
|
|
704
|
+
}, Cr = async (c) => !!await Tr(c), Sr = (c, v, R) => {
|
|
705
|
+
const d = Ye(fe);
|
|
706
|
+
if (d === null)
|
|
77
707
|
throw new Error(
|
|
78
708
|
"useEmbeddedEffect must be used within a MMEmbeddableZoneProvider"
|
|
79
709
|
);
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
if (!(!
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
(...
|
|
710
|
+
const w = ce(R);
|
|
711
|
+
M(() => {
|
|
712
|
+
w.current = R;
|
|
713
|
+
}, [R]), M(() => {
|
|
714
|
+
if (!(!c || !v))
|
|
715
|
+
return d.addListener(
|
|
716
|
+
c,
|
|
717
|
+
v,
|
|
718
|
+
(...y) => w.current(...y)
|
|
89
719
|
);
|
|
90
|
-
}, [
|
|
720
|
+
}, [d, c, v]);
|
|
91
721
|
};
|
|
92
|
-
|
|
93
|
-
children:
|
|
722
|
+
wr.propTypes = {
|
|
723
|
+
children: Z.node.isRequired
|
|
94
724
|
};
|
|
95
|
-
const
|
|
725
|
+
const Or = De.default || De, Pr = Or.iframe`
|
|
96
726
|
width: 100%;
|
|
97
727
|
height: 100%;
|
|
98
728
|
border: none;
|
|
99
|
-
visibility: ${(
|
|
100
|
-
`,
|
|
101
|
-
id:
|
|
102
|
-
src:
|
|
103
|
-
path:
|
|
104
|
-
onInit:
|
|
729
|
+
visibility: ${(c) => c.$isReady ? "visible" : "hidden"};
|
|
730
|
+
`, jr = ({
|
|
731
|
+
id: c,
|
|
732
|
+
src: v,
|
|
733
|
+
path: R,
|
|
734
|
+
onInit: d = () => {
|
|
105
735
|
},
|
|
106
|
-
context:
|
|
107
|
-
params:
|
|
108
|
-
...
|
|
736
|
+
context: w,
|
|
737
|
+
params: y,
|
|
738
|
+
...T
|
|
109
739
|
}) => {
|
|
110
|
-
if ("isConfiguring" in
|
|
740
|
+
if ("isConfiguring" in T)
|
|
111
741
|
return console.error(
|
|
112
742
|
"isConfiguring must be passed via the params prop to MMEmbeddableZone"
|
|
113
743
|
), null;
|
|
114
|
-
if ("colorMode" in
|
|
744
|
+
if ("colorMode" in w)
|
|
115
745
|
return console.error(
|
|
116
746
|
"colorMode must be passed via the params prop to MMEmbeddableZone"
|
|
117
747
|
), null;
|
|
118
|
-
if ("isFullScreen" in
|
|
748
|
+
if ("isFullScreen" in w)
|
|
119
749
|
return console.error(
|
|
120
750
|
"isFullScreen must be passed via the params prop to MMEmbeddableZone"
|
|
121
751
|
), null;
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
), [
|
|
125
|
-
return
|
|
126
|
-
|
|
752
|
+
const C = ce(), [h, x] = K(), [n, u] = K(0), { registerFrame: s, unregisterFrame: p, sendMessage: E } = Ye(
|
|
753
|
+
fe
|
|
754
|
+
), [j, $] = K(!0), [O, g] = K();
|
|
755
|
+
return M(() => {
|
|
756
|
+
n && E(c, "set-context", {
|
|
127
757
|
context: {
|
|
128
|
-
...
|
|
758
|
+
...w,
|
|
129
759
|
// TODO: Remove this once everything is migrated to params
|
|
130
|
-
colorMode:
|
|
131
|
-
isFullScreen:
|
|
760
|
+
colorMode: y.colorMode,
|
|
761
|
+
isFullScreen: y.isFullScreen
|
|
132
762
|
}
|
|
133
763
|
});
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
if (!(!
|
|
764
|
+
}, [w, y.colorMode, y.isFullScreen, c, n]), M(() => {
|
|
765
|
+
n && (E(c, "set-params", { params: y }), E(c, "set-configuring", { isConfiguring: y.isConfiguring }));
|
|
766
|
+
}, [y, c, n]), M(() => {
|
|
767
|
+
R !== void 0 && g(R);
|
|
768
|
+
}, [R]), M(() => {
|
|
769
|
+
O === void 0 || !n || E(c, "navigate", { path: O });
|
|
770
|
+
}, [O, n, c, E]), M(() => {
|
|
771
|
+
if (!(!v || !c || !C))
|
|
142
772
|
return (async () => {
|
|
143
|
-
const
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
`${
|
|
773
|
+
const F = await Cr(v);
|
|
774
|
+
if ($(F), F) {
|
|
775
|
+
const A = new URL(v);
|
|
776
|
+
s(c, A.origin, C), d(), x(
|
|
777
|
+
`${A.origin}/mm-embedded-interop?id=${c}&origin=${window.location.origin}`
|
|
148
778
|
);
|
|
149
779
|
return;
|
|
150
780
|
}
|
|
151
781
|
})(), () => {
|
|
152
|
-
|
|
782
|
+
p(c);
|
|
153
783
|
};
|
|
154
|
-
}, [
|
|
784
|
+
}, [v, c, s, C]), Sr(c, "ready", () => u((F) => F + 1)), j ? /* @__PURE__ */ Q.jsx(Pr, { $isReady: n, ref: C, src: h, ...T }) : /* @__PURE__ */ Q.jsx(
|
|
155
785
|
"div",
|
|
156
786
|
{
|
|
157
787
|
style: {
|
|
@@ -159,22 +789,22 @@ const O = L.default || L, T = O.iframe`
|
|
|
159
789
|
display: "flex",
|
|
160
790
|
alignItems: "center",
|
|
161
791
|
justifyContent: "center"
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
792
|
+
},
|
|
793
|
+
children: /* @__PURE__ */ Q.jsx("div", { style: { textAlign: "center" }, children: "Application must adhere to the MM App Manifest specification to be embedded." })
|
|
794
|
+
}
|
|
165
795
|
);
|
|
166
796
|
};
|
|
167
|
-
|
|
168
|
-
id:
|
|
169
|
-
src:
|
|
170
|
-
path:
|
|
171
|
-
onInit:
|
|
797
|
+
jr.propTypes = {
|
|
798
|
+
id: Z.string,
|
|
799
|
+
src: Z.string.isRequired,
|
|
800
|
+
path: Z.string,
|
|
801
|
+
onInit: Z.func
|
|
172
802
|
};
|
|
173
803
|
export {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
804
|
+
jr as MMEmbeddableZone,
|
|
805
|
+
fe as MMEmbeddableZoneContext,
|
|
806
|
+
wr as MMEmbeddableZoneProvider,
|
|
807
|
+
Tr as getAppInfo,
|
|
808
|
+
Cr as testIsEmbeddable,
|
|
809
|
+
Sr as useEmbeddedEffect
|
|
180
810
|
};
|
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
(function(u
|
|
1
|
+
(function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("prop-types"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","styled-components"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C["mm-react-embeddable"]={},C.React,C.PropTypes,C.styled))})(this,function(C,u,V,fe){"use strict";var ee={exports:{}},Z={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var le;function Ze(){if(le)return Z;le=1;var l=u,p=Symbol.for("react.element"),_=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,S=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function T(O,y,M){var n,c={},s=null,b=null;M!==void 0&&(s=""+M),y.key!==void 0&&(s=""+y.key),y.ref!==void 0&&(b=y.ref);for(n in y)v.call(y,n)&&!h.hasOwnProperty(n)&&(c[n]=y[n]);if(O&&O.defaultProps)for(n in y=O.defaultProps,y)c[n]===void 0&&(c[n]=y[n]);return{$$typeof:p,type:O,key:s,ref:b,props:c,_owner:S.current}}return Z.Fragment=_,Z.jsx=T,Z.jsxs=T,Z}var B={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var de;function Be(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var l=u,p=Symbol.for("react.element"),_=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),O=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),R=Symbol.iterator,k="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[k];return typeof r=="function"?r:null}var j=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];A("error",e,t)}}function A(e,r,t){{var a=j.ReactDebugCurrentFrame,f=a.getStackAddendum();f!==""&&(r+="%s",t=t.concat([f]));var d=t.map(function(i){return String(i)});d.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,d)}}var I=!1,Ke=!1,Ne=!1,Ge=!1,ze=!1,Ee;Ee=Symbol.for("react.module.reference");function Xe(e){return!!(typeof e=="string"||typeof e=="function"||e===v||e===h||ze||e===S||e===M||e===n||Ge||e===b||I||Ke||Ne||typeof e=="object"&&e!==null&&(e.$$typeof===s||e.$$typeof===c||e.$$typeof===T||e.$$typeof===O||e.$$typeof===y||e.$$typeof===Ee||e.getModuleId!==void 0))}function He(e,r,t){var a=e.displayName;if(a)return a;var f=r.displayName||r.name||"";return f!==""?t+"("+f+")":t}function ye(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case _:return"Portal";case h:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case n:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return ye(r)+".Consumer";case T:var t=e;return ye(t._context)+".Provider";case y:return He(e,e.render,"ForwardRef");case c:var a=e.displayName||null;return a!==null?a:F(e.type)||"Memo";case s:{var f=e,d=f._payload,i=f._init;try{return F(i(d))}catch{return null}}}return null}var D=Object.assign,J=0,he,Re,_e,we,Ce,Se,Te;function Oe(){}Oe.__reactDisabledLog=!0;function Qe(){{if(J===0){he=console.log,Re=console.info,_e=console.warn,we=console.error,Ce=console.group,Se=console.groupCollapsed,Te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Oe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function qe(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:he}),info:D({},e,{value:Re}),warn:D({},e,{value:_e}),error:D({},e,{value:we}),group:D({},e,{value:Ce}),groupCollapsed:D({},e,{value:Se}),groupEnd:D({},e,{value:Te})})}J<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=j.ReactCurrentDispatcher,te;function H(e,r,t){{if(te===void 0)try{throw Error()}catch(f){var a=f.stack.trim().match(/\n( *(at )?)/);te=a&&a[1]||""}return`
|
|
18
|
+
`+te+e}}var ne=!1,Q;{var $e=typeof WeakMap=="function"?WeakMap:Map;Q=new $e}function Pe(e,r){if(!e||ne)return"";{var t=Q.get(e);if(t!==void 0)return t}var a;ne=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=re.current,re.current=null,Qe();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(P){a=P}Reflect.construct(e,[],i)}else{try{i.call()}catch(P){a=P}e.call(i.prototype)}}else{try{throw Error()}catch(P){a=P}e()}}catch(P){if(P&&a&&typeof P.stack=="string"){for(var o=P.stack.split(`
|
|
19
|
+
`),w=a.stack.split(`
|
|
20
|
+
`),m=o.length-1,E=w.length-1;m>=1&&E>=0&&o[m]!==w[E];)E--;for(;m>=1&&E>=0;m--,E--)if(o[m]!==w[E]){if(m!==1||E!==1)do if(m--,E--,E<0||o[m]!==w[E]){var x=`
|
|
21
|
+
`+o[m].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&Q.set(e,x),x}while(m>=1&&E>=0);break}}}finally{ne=!1,re.current=d,qe(),Error.prepareStackTrace=f}var U=e?e.displayName||e.name:"",W=U?H(U):"";return typeof e=="function"&&Q.set(e,W),W}function er(e,r,t){return Pe(e,!1)}function rr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,t){if(e==null)return"";if(typeof e=="function")return Pe(e,rr(e));if(typeof e=="string")return H(e);switch(e){case M:return H("Suspense");case n:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return er(e.render);case c:return q(e.type,r,t);case s:{var a=e,f=a._payload,d=a._init;try{return q(d(f),r,t)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,je={},xe=j.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function tr(e,r,t,a,f){{var d=Function.call.bind(K);for(var i in e)if(d(e,i)){var o=void 0;try{if(typeof e[i]!="function"){var w=Error((a||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}o=e[i](r,i,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){o=m}o&&!(o instanceof Error)&&($(f),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %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).",a||"React class",t,i,typeof o),$(null)),o instanceof Error&&!(o.message in je)&&(je[o.message]=!0,$(f),g("Failed %s type: %s",t,o.message),$(null))}}}var nr=Array.isArray;function ae(e){return nr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return ke(e),!1}catch{return!0}}function ke(e){return""+e}function Me(e){if(or(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),ke(e)}var N=j.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},Fe,Ae,oe;oe={};function sr(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ur(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){if(typeof e.ref=="string"&&N.current&&r&&N.current.stateNode!==r){var t=F(N.current.type);oe[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(N.current.type),e.ref),oe[t]=!0)}}function fr(e,r){{var t=function(){Fe||(Fe=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function lr(e,r){{var t=function(){Ae||(Ae=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var dr=function(e,r,t,a,f,d,i){var o={$$typeof:p,type:e,key:r,ref:t,props:i,_owner:d};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function vr(e,r,t,a,f){{var d,i={},o=null,w=null;t!==void 0&&(Me(t),o=""+t),ur(r)&&(Me(r.key),o=""+r.key),sr(r)&&(w=r.ref,cr(r,f));for(d in r)K.call(r,d)&&!ir.hasOwnProperty(d)&&(i[d]=r[d]);if(e&&e.defaultProps){var m=e.defaultProps;for(d in m)i[d]===void 0&&(i[d]=m[d])}if(o||w){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&fr(i,E),w&&lr(i,E)}return dr(e,o,w,f,a,N.current,i)}}var ie=j.ReactCurrentOwner,Ie=j.ReactDebugCurrentFrame;function Y(e){if(e){var r=e._owner,t=q(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(t)}else Ie.setExtraStackFrame(null)}var se;se=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function De(){{if(ie.current){var e=F(ie.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function pr(e){return""}var We={};function br(e){{var r=De();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Le(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=br(r);if(We[t])return;We[t]=!0;var a="";e&&e._owner&&e._owner!==ie.current&&(a=" It was passed a child from "+F(e._owner.type)+"."),Y(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),Y(null)}}function Ye(e,r){{if(typeof e!="object")return;if(ae(e))for(var t=0;t<e.length;t++){var a=e[t];ue(a)&&Le(a,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var f=L(e);if(typeof f=="function"&&f!==e.entries)for(var d=f.call(e),i;!(i=d.next()).done;)ue(i.value)&&Le(i.value,r)}}}function gr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===c))t=r.propTypes;else return;if(t){var a=F(r);tr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!se){se=!0;var f=F(r);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){Y(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),Y(null);break}}e.ref!==null&&(Y(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}var Ue={};function Ve(e,r,t,a,f,d){{var i=Xe(e);if(!i){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=pr();w?o+=w:o+=De();var m;e===null?m="null":ae(e)?m="array":e!==void 0&&e.$$typeof===p?(m="<"+(F(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,o)}var E=vr(e,r,t,f,d);if(E==null)return E;if(i){var x=r.children;if(x!==void 0)if(a)if(ae(x)){for(var U=0;U<x.length;U++)Ye(x[U],e);Object.freeze&&Object.freeze(x)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ye(x,e)}if(K.call(r,"key")){var W=F(e),P=Object.keys(r).filter(function(wr){return wr!=="key"}),ce=P.length>0?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}";if(!Ue[W+ce]){var _r=P.length>0?"{"+P.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ce,W,_r,W),Ue[W+ce]=!0}}return e===v?mr(E):gr(E),E}}function Er(e,r,t){return Ve(e,r,t,!0)}function yr(e,r,t){return Ve(e,r,t,!1)}var hr=yr,Rr=Er;B.Fragment=v,B.jsx=hr,B.jsxs=Rr}()),B}process.env.NODE_ENV==="production"?ee.exports=Ze():ee.exports=Be();var G=ee.exports;const z=u.createContext(null),ve=({children:l})=>{const[p,_]=u.useState({}),v=u.useRef({}),S=u.useCallback((n,c,s)=>{_(b=>({...b,[n]:{origin:c,frameRef:s}}))},[]),h=u.useCallback(n=>{_(c=>{const s={...c};return delete s[n],s})},[]);u.useEffect(()=>{const n=(s=[],b)=>{s.forEach(R=>R(b))},c=s=>{var L,j,g,A,I;if(!((L=s==null?void 0:s.data)!=null&&L.instanceId))return;const{instanceId:b,type:R}=s.data,k=v.current;n((j=k[b])==null?void 0:j[R],s.data),n((g=k["*"])==null?void 0:g[R],s.data),n((A=k[b])==null?void 0:A["*"],s.data),n((I=k["*"])==null?void 0:I["*"],s.data)};return window.addEventListener("message",c),()=>{window.removeEventListener("message",c)}},[p]);const T=u.useCallback((n,c,s)=>{var R,k;const b=p[n];if(!b){console.warn(`Origin not set for id: ${n}. Unable to send message.`);return}(k=(R=b==null?void 0:b.frameRef)==null?void 0:R.current)!=null&&k.contentWindow&&b.frameRef.current.contentWindow.postMessage({type:c,...s,instanceId:n},b.origin)},[p]),O=u.useCallback((n,c)=>{T(n,"load-options",c)},[T]),y=u.useCallback((n,c)=>{T(n,"validate",c)},[T]),M={registerFrame:S,unregisterFrame:h,sendMessage:T,loadOptions:O,validate:y,addListener:(n,c,s)=>(v.current[n]||(v.current[n]={}),v.current[n][c]||(v.current[n][c]=[]),v.current[n][c].push(s),()=>{v.current[n][c]=v.current[n][c].filter(b=>b!==s)})};return G.jsx(z.Provider,{value:M,children:l})},X={},pe=async l=>{try{const p=new URL(l).origin;if(X[p]!==void 0)return X[p];const v=await(await fetch(`${p}/mm-app-manifest.json`)).json();if(!v.version)throw new Error("Invalid manifest");return X[p]=v,v}catch{}return X[origin]=!1,!1},be=async l=>!!await pe(l),ge=(l,p,_)=>{const v=u.useContext(z);if(v===null)throw new Error("useEmbeddedEffect must be used within a MMEmbeddableZoneProvider");const S=u.useRef(_);u.useEffect(()=>{S.current=_},[_]),u.useEffect(()=>{if(!(!l||!p))return v.addListener(l,p,(...h)=>S.current(...h))},[v,l,p])};ve.propTypes={children:V.node.isRequired};const Je=(fe.default||fe).iframe`
|
|
2
31
|
width: 100%;
|
|
3
32
|
height: 100%;
|
|
4
33
|
border: none;
|
|
5
|
-
visibility: ${
|
|
6
|
-
`,
|
|
34
|
+
visibility: ${l=>l.$isReady?"visible":"hidden"};
|
|
35
|
+
`,me=({id:l,src:p,path:_,onInit:v=()=>{},context:S,params:h,...T})=>{if("isConfiguring"in T)return console.error("isConfiguring must be passed via the params prop to MMEmbeddableZone"),null;if("colorMode"in S)return console.error("colorMode must be passed via the params prop to MMEmbeddableZone"),null;if("isFullScreen"in S)return console.error("isFullScreen must be passed via the params prop to MMEmbeddableZone"),null;const O=u.useRef(),[y,M]=u.useState(),[n,c]=u.useState(0),{registerFrame:s,unregisterFrame:b,sendMessage:R}=u.useContext(z),[k,L]=u.useState(!0),[j,g]=u.useState();return u.useEffect(()=>{n&&R(l,"set-context",{context:{...S,colorMode:h.colorMode,isFullScreen:h.isFullScreen}})},[S,h.colorMode,h.isFullScreen,l,n]),u.useEffect(()=>{n&&(R(l,"set-params",{params:h}),R(l,"set-configuring",{isConfiguring:h.isConfiguring}))},[h,l,n]),u.useEffect(()=>{_!==void 0&&g(_)},[_]),u.useEffect(()=>{j===void 0||!n||R(l,"navigate",{path:j})},[j,n,l,R]),u.useEffect(()=>{if(!(!p||!l||!O))return(async()=>{const A=await be(p);if(L(A),A){const I=new URL(p);s(l,I.origin,O),v(),M(`${I.origin}/mm-embedded-interop?id=${l}&origin=${window.location.origin}`);return}})(),()=>{b(l)}},[p,l,s,O]),ge(l,"ready",()=>c(A=>A+1)),k?G.jsx(Je,{$isReady:n,ref:O,src:y,...T}):G.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:G.jsx("div",{style:{textAlign:"center"},children:"Application must adhere to the MM App Manifest specification to be embedded."})})};me.propTypes={id:V.string,src:V.string.isRequired,path:V.string,onInit:V.func},C.MMEmbeddableZone=me,C.MMEmbeddableZoneContext=z,C.MMEmbeddableZoneProvider=ve,C.getAppInfo=pe,C.testIsEmbeddable=be,C.useEmbeddedEffect=ge,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@machinemetrics/mm-react-embeddable",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "dist/mm-react-embeddable.es.js",
|
|
6
6
|
"main": "dist/mm-react-embeddable.cjs.js",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "vite build",
|
|
20
|
-
"start": "vite build --watch"
|
|
20
|
+
"start": "vite build --watch",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test:watch": "vitest"
|
|
21
23
|
},
|
|
22
24
|
"files": [
|
|
23
25
|
"dist"
|
|
@@ -31,7 +33,12 @@
|
|
|
31
33
|
"styled-components": ">=4.0.0"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
36
|
+
"@testing-library/react": "^14.3.1",
|
|
37
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
38
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
39
|
+
"jsdom": "^24.1.3",
|
|
34
40
|
"prettier": "^3.3.3",
|
|
35
|
-
"vite": "^5.4.8"
|
|
41
|
+
"vite": "^5.4.8",
|
|
42
|
+
"vitest": "^1.6.1"
|
|
36
43
|
}
|
|
37
44
|
}
|