@matterbridge/frontend 3.4.10 → 3.4.11-dev-20260409-47ebca7
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/README.md +3 -3
- package/build/assets/index.js +3 -3
- package/build/assets/vendor_emotion.js +1 -1
- package/build/assets/vendor_lodash.js +1 -1
- package/build/assets/vendor_mui.js +27 -27
- package/build/assets/vendor_node_modules.js +19 -19
- package/build/assets/vendor_notistack.js +4 -4
- package/build/assets/vendor_qrcode.js +1 -1
- package/build/assets/vendor_rjsf.js +5 -5
- package/npm-shrinkwrap.json +53 -53
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime.js";import{c as t}from"./vendor_emotion.js";import{a as n}from"./vendor_node_modules.js";import{Kt as r}from"./vendor_mui.js";
|
|
2
|
-
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},null),warning:
|
|
1
|
+
import{a as e}from"./rolldown-runtime.js";import{c as t}from"./vendor_emotion.js";import{a as n}from"./vendor_node_modules.js";import{Kt as r}from"./vendor_mui.js";var i=e(t()),a=e(r());function o(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=o(e[t]))&&(r&&(r+=` `),r+=n);else for(t in e)e[t]&&(r&&(r+=` `),r+=t);return r}function s(){for(var e,t,n=0,r=``;n<arguments.length;)(e=arguments[n++])&&(t=o(e))&&(r&&(r+=` `),r+=t);return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function f(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function p(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var m=function(){return``},h=i.createContext({enqueueSnackbar:m,closeSnackbar:m}),g={downXs:`@media (max-width:599.95px)`,upSm:`@media (min-width:600px)`},_=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},v=function(e){return``+_(e.vertical)+_(e.horizontal)},y=function(e){return!!e||e===0},b=`unmounted`,x=`exited`,S=`entering`,C=`entered`,w=`exiting`,T=function(e){d(t,e);function t(t){var n=e.call(this,t)||this,r=t.appear,i;return n.appearStatus=null,t.in?r?(i=x,n.appearStatus=S):i=C:i=t.unmountOnExit||t.mountOnEnter?b:x,n.state={status:i},n.nextCallback=null,n}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===b?{status:x}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==S&&n!==C&&(t=S):(n===S||n===C)&&(t=w)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=e,n=e;return e!=null&&typeof e!=`number`&&typeof e!=`string`&&(n=e.exit,t=e.enter),{exit:n,enter:t}},n.updateStatus=function(e,t){e===void 0&&(e=!1),t===null?this.props.unmountOnExit&&this.state.status===x&&this.setState({status:b}):(this.cancelNextCallback(),t===S?this.performEnter(e):this.performExit())},n.performEnter=function(e){var t=this,n=this.props.enter,r=e,i=this.getTimeouts();if(!e&&!n){this.safeSetState({status:C},function(){t.props.onEntered&&t.props.onEntered(t.node,r)});return}this.props.onEnter&&this.props.onEnter(this.node,r),this.safeSetState({status:S},function(){t.props.onEntering&&t.props.onEntering(t.node,r),t.onTransitionEnd(i.enter,function(){t.safeSetState({status:C},function(){t.props.onEntered&&t.props.onEntered(t.node,r)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts();if(!t){this.safeSetState({status:x},function(){e.props.onExited&&e.props.onExited(e.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:w},function(){e.props.onExiting&&e.props.onExiting(e.node),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:x},function(){e.props.onExited&&e.props.onExited(e.node)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(){n&&(n=!1,t.nextCallback=null,e())},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=e==null&&!this.props.addEndListener;if(!this.node||n){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===b)return null;var t=this.props,n=t.children;return n(e,f(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]))},l(t,[{key:`node`,get:function(){var e=this.props.nodeRef?.current;if(!e)throw Error(`notistack - Custom snackbar is not refForwarding`);return e}}]),t}(i.Component);function E(){}T.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:E,onEntering:E,onEntered:E,onExit:E,onExiting:E,onExited:E};function D(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function O(e,t){return(0,i.useMemo)(function(){return e==null&&t==null?null:function(n){D(e,n),D(t,n)}},[e,t])}function k(e){var t=e.timeout,n=e.style,r=n===void 0?{}:n,i=e.mode;return{duration:typeof t==`object`?t[i]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}var A={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},j=function(e){e.scrollTop=e.scrollTop},ee=function(e){return Math.round(e)+`ms`};function M(e,t){e===void 0&&(e=[`all`]);var n=t||{},r=n.duration,i=r===void 0?300:r,a=n.easing,o=a===void 0?A.easeInOut:a,s=n.delay,c=s===void 0?0:s;return(Array.isArray(e)?e:[e]).map(function(e){var t=typeof i==`string`?i:ee(i),n=typeof c==`string`?c:ee(c);return e+` `+t+` `+o+` `+n}).join(`,`)}function te(e){return e&&e.ownerDocument||document}function ne(e){return te(e).defaultView||window}function re(e,t){t===void 0&&(t=166);var n;function r(){var r=this,i=[...arguments];clearTimeout(n),n=setTimeout(function(){e.apply(r,i)},t)}return r.clear=function(){clearTimeout(n)},r}function ie(e,t){var n=t.getBoundingClientRect(),r=ne(t),i;if(t.fakeTransform)i=t.fakeTransform;else{var a=r.getComputedStyle(t);i=a.getPropertyValue(`-webkit-transform`)||a.getPropertyValue(`transform`)}var o=0,s=0;if(i&&i!==`none`&&typeof i==`string`){var c=i.split(`(`)[1].split(`)`)[0].split(`,`);o=parseInt(c[4],10),s=parseInt(c[5],10)}switch(e){case`left`:return`translateX(`+(r.innerWidth+o-n.left)+`px)`;case`right`:return`translateX(-`+(n.left+n.width-o)+`px)`;case`up`:return`translateY(`+(r.innerHeight+s-n.top)+`px)`;default:return`translateY(-`+(n.top+n.height-s)+`px)`}}function N(e,t){if(t){var n=ie(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}}var P=(0,i.forwardRef)(function(e,t){var n=e.children,r=e.direction,a=r===void 0?`down`:r,o=e.in,s=e.style,c=e.timeout,l=c===void 0?0:c,d=e.onEnter,p=e.onEntered,m=e.onExit,h=e.onExited,g=f(e,[`children`,`direction`,`in`,`style`,`timeout`,`onEnter`,`onEntered`,`onExit`,`onExited`]),_=(0,i.useRef)(null),v=O(O(n.ref,_),t),y=function(e,t){N(a,e),j(e),d&&d(e,t)},b=function(e){var t=s?.transitionTimingFunction||A.easeOut,n=k({timeout:l,mode:`enter`,style:u({},s,{transitionTimingFunction:t})});e.style.webkitTransition=M(`-webkit-transform`,n),e.style.transition=M(`transform`,n),e.style.webkitTransform=`none`,e.style.transform=`none`},x=function(e){var t=s?.transitionTimingFunction||A.sharp,n=k({timeout:l,mode:`exit`,style:u({},s,{transitionTimingFunction:t})});e.style.webkitTransition=M(`-webkit-transform`,n),e.style.transition=M(`transform`,n),N(a,e),m&&m(e)},S=function(e){e.style.webkitTransition=``,e.style.transition=``,h&&h(e)},C=(0,i.useCallback)(function(){_.current&&N(a,_.current)},[a]);return(0,i.useEffect)(function(){if(!(o||a===`down`||a===`right`)){var e=re(function(){_.current&&N(a,_.current)}),t=ne(_.current);return t.addEventListener(`resize`,e),function(){e.clear(),t.removeEventListener(`resize`,e)}}},[a,o]),(0,i.useEffect)(function(){o||C()},[o,C]),(0,i.createElement)(T,Object.assign({appear:!0,nodeRef:_,onEnter:y,onEntered:p,onEntering:b,onExit:x,onExited:S,in:o,timeout:l},g),function(e,t){return(0,i.cloneElement)(n,u({ref:v,style:u({visibility:e===`exited`&&!o?`hidden`:void 0},s,{},n.props.style)},t))})});P.displayName=`Slide`;var F=function(e){return i.createElement(`svg`,Object.assign({viewBox:`0 0 24 24`,focusable:`false`,style:{fontSize:20,marginInlineEnd:8,userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,fill:`currentColor`,flexShrink:0}},e))},I={maxSnack:3,persist:!1,hideIconVariant:!1,disableWindowBlurListener:!1,variant:`default`,autoHideDuration:5e3,iconVariant:{default:void 0,success:i.createElement(function(){return i.createElement(F,null,i.createElement(`path`,{d:`M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41
|
|
2
|
+
10.59L10 14.17L17.59 6.58L19 8L10 17Z`}))},null),warning:i.createElement(function(){return i.createElement(F,null,i.createElement(`path`,{d:`M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z`}))},null),error:i.createElement(function(){return i.createElement(F,null,i.createElement(`path`,{d:`M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,
|
|
3
3
|
6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,
|
|
4
|
-
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},null),info:
|
|
5
|
-
0 22,12A10,10 0 0,0 12,2Z`}))},null)},anchorOrigin:{vertical:`bottom`,horizontal:`left`},TransitionComponent:P,transitionDuration:{enter:225,exit:195}},ae=function(e,t){var n=function(e){return typeof e==`number`||e===null};return n(e)?e:n(t)?t:I.autoHideDuration},oe=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,[`string`,`number`])?e:n(e,[`object`])?u({},I.transitionDuration,{},n(t,[`object`])&&t,{},e):n(t,[`string`,`number`])?t:n(t,[`object`])?u({},I.transitionDuration,{},t):I.transitionDuration},se=function(e,t){return function(n,r){return r===void 0&&(r=!1),r?u({},I[n],{},t[n],{},e[n]):n===`autoHideDuration`?ae(e.autoHideDuration,t.autoHideDuration):n===`transitionDuration`?oe(e.transitionDuration,t.transitionDuration):e[n]||t[n]||I[n]}};function L(e){return Object.entries(e).reduce(function(e,t){var r,i=t[0],a=t[1];return u({},e,(r={},r[i]=n(a),r))},{})}var R={SnackbarContainer:`notistack-SnackbarContainer`,Snackbar:`notistack-Snackbar`,CollapseWrapper:`notistack-CollapseWrapper`,MuiContent:`notistack-MuiContent`,MuiContentVariant:function(e){return`notistack-MuiContent-`+e}},ce=L({root:{height:0},entered:{height:`auto`}}),z=`0px`,B=175,le=(0,o.forwardRef)(function(e,t){var n=e.children,r=e.in,i=e.onExited,s=(0,o.useRef)(null),c=(0,o.useRef)(null),l=O(t,c),d=function(){return s.current?s.current.clientHeight:0};return(0,o.createElement)(T,{in:r,unmountOnExit:!0,onEnter:function(e){e.style.height=z},onEntered:function(e){e.style.height=`auto`},onEntering:function(e){var t=d(),n=k({timeout:B,mode:`enter`}),r=n.duration,i=n.easing;e.style.transitionDuration=typeof r==`string`?r:r+`ms`,e.style.height=t+`px`,e.style.transitionTimingFunction=i||``},onExit:function(e){e.style.height=d()+`px`},onExited:i,onExiting:function(e){j(e);var t=k({timeout:B,mode:`exit`}),n=t.duration,r=t.easing;e.style.transitionDuration=typeof n==`string`?n:n+`ms`,e.style.height=z,e.style.transitionTimingFunction=r||``},nodeRef:c,timeout:B},function(e,t){return(0,o.createElement)(`div`,Object.assign({ref:l,className:a(ce.root,e===`entered`&&ce.entered),style:u({pointerEvents:`all`,overflow:`hidden`,minHeight:z,transition:M(`height`)},e===`entered`&&{overflow:`visible`},{},e===`exited`&&!r&&{visibility:`hidden`})},t),(0,o.createElement)(`div`,{ref:s,className:R.CollapseWrapper,style:{display:`flex`,width:`100%`}},n))})});le.displayName=`Collapse`;var ue={right:`left`,left:`right`,bottom:`up`,top:`down`},de=function(e){return e.horizontal===`center`?ue[e.vertical]:ue[e.horizontal]},fe=function(e){return`anchorOrigin`+v(e)},pe=function(e){e===void 0&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var r;return u({},t,(r={},r[n]=e[n],r))},{})},me=function(){};function V(e,t){return e.reduce(function(e,n){return n==null?e:function(){var r=[...arguments],i=[].concat(r);t&&i.indexOf(t)===-1&&i.push(t),e.apply(this,i),n.apply(this,i)}},me)}var he=typeof window<`u`?o.useLayoutEffect:o.useEffect;function H(e){var t=(0,o.useRef)(e);return he(function(){t.current=e}),(0,o.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var U=(0,o.forwardRef)(function(e,t){var n=e.children,r=e.className,i=e.autoHideDuration,s=e.disableWindowBlurListener,c=s===void 0?!1:s,l=e.onClose,u=e.id,d=e.open,f=e.SnackbarProps,p=f===void 0?{}:f,m=(0,o.useRef)(),h=H(function(){l&&l.apply(void 0,arguments)}),g=H(function(e){!l||e==null||(m.current&&clearTimeout(m.current),m.current=setTimeout(function(){h(null,`timeout`,u)},e))});(0,o.useEffect)(function(){return d&&g(i),function(){m.current&&clearTimeout(m.current)}},[d,i,g]);var _=function(){m.current&&clearTimeout(m.current)},v=(0,o.useCallback)(function(){i!=null&&g(i*.5)},[i,g]);return(0,o.useEffect)(function(){if(!c&&d)return window.addEventListener(`focus`,v),window.addEventListener(`blur`,_),function(){window.removeEventListener(`focus`,v),window.removeEventListener(`blur`,_)}},[c,v,d]),(0,o.createElement)(`div`,Object.assign({ref:t},p,{className:a(R.Snackbar,r),onMouseEnter:function(e){p.onMouseEnter&&p.onMouseEnter(e),_()},onMouseLeave:function(e){p.onMouseLeave&&p.onMouseLeave(e),v()}}),n)});U.displayName=`Snackbar`;var W,ge=L({root:(W={display:`flex`,flexWrap:`wrap`,flexGrow:1},W[g.upSm]={flexGrow:`initial`,minWidth:`288px`},W)}),_e=(0,o.forwardRef)(function(e,t){var n=e.className,r=f(e,[`className`]);return o.createElement(`div`,Object.assign({ref:t,className:a(ge.root,n)},r))});_e.displayName=`SnackbarContent`;var G=L({root:{backgroundColor:`#313131`,fontSize:`0.875rem`,lineHeight:1.43,letterSpacing:`0.01071em`,color:`#fff`,alignItems:`center`,padding:`6px 16px`,borderRadius:`4px`,boxShadow:`0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)`},lessPadding:{paddingLeft:`20px`},default:{backgroundColor:`#313131`},success:{backgroundColor:`#43a047`},error:{backgroundColor:`#d32f2f`},warning:{backgroundColor:`#ff9800`},info:{backgroundColor:`#2196f3`},message:{display:`flex`,alignItems:`center`,padding:`8px 0`},action:{display:`flex`,alignItems:`center`,marginLeft:`auto`,paddingLeft:`16px`,marginRight:`-8px`}}),ve=`notistack-snackbar`,ye=(0,o.forwardRef)(function(e,t){var n=e.id,r=e.message,i=e.action,s=e.iconVariant,c=e.variant,l=e.hideIconVariant,u=e.style,d=e.className,f=s[c],p=i;return typeof p==`function`&&(p=p(n)),o.createElement(_e,{ref:t,role:`alert`,"aria-describedby":ve,style:u,className:a(R.MuiContent,R.MuiContentVariant(c),G.root,G[c],d,!l&&f&&G.lessPadding)},o.createElement(`div`,{id:ve,className:G.message},l?null:f,r),p&&o.createElement(`div`,{className:G.action},p))});ye.displayName=`MaterialDesignContent`;var be=(0,o.memo)(ye),xe=L({wrappedRoot:{width:`100%`,position:`relative`,transform:`translateX(0)`,top:0,right:0,bottom:0,left:0,minWidth:`288px`}}),Se=function(e){var t=(0,o.useRef)(),n=(0,o.useState)(!0),r=n[0],i=n[1],s=V([e.snack.onClose,e.onClose]),c=function(){e.snack.requestClose&&s(null,`instructed`,e.snack.id)},l=(0,o.useCallback)(function(){t.current=setTimeout(function(){i(function(e){return!e})},125)},[]);(0,o.useEffect)(function(){return function(){t.current&&clearTimeout(t.current)}},[]);var d=e.snack,p=e.classes,m=e.Component,h=m===void 0?be:m,g=(0,o.useMemo)(function(){return pe(p)},[p]),_=d.open,v=d.SnackbarProps,y=d.TransitionComponent,b=d.TransitionProps,x=d.transitionDuration,S=d.disableWindowBlurListener,C=d.content,w=f(d,[`open`,`SnackbarProps`,`TransitionComponent`,`TransitionProps`,`transitionDuration`,`disableWindowBlurListener`,`content`,`entered`,`requestClose`,`onEnter`,`onEntered`,`onExit`,`onExited`]),T=u({direction:de(w.anchorOrigin),timeout:x},b),E=C;typeof E==`function`&&(E=E(w.id,w.message));var D=[`onEnter`,`onEntered`,`onExit`,`onExited`].reduce(function(t,n){var r;return u({},t,(r={},r[n]=V([e.snack[n],e[n]],w.id),r))},{});return o.createElement(le,{in:r,onExited:D.onExited},o.createElement(U,{open:_,id:w.id,disableWindowBlurListener:S,autoHideDuration:w.autoHideDuration,className:a(xe.wrappedRoot,g.root,g[fe(w.anchorOrigin)]),SnackbarProps:v,onClose:s},o.createElement(y,Object.assign({},T,{appear:!0,in:_,onExit:D.onExit,onExited:l,onEnter:D.onEnter,onEntered:V([D.onEntered,c],w.id)}),E||o.createElement(h,Object.assign({},w)))))},K,q,J,Y,X,Z={view:{default:20,dense:4},snackbar:{default:6,dense:2}},Ce=`.`+R.CollapseWrapper,Q=16,$=L({root:(K={boxSizing:`border-box`,display:`flex`,maxHeight:`100%`,position:`fixed`,zIndex:1400,height:`auto`,width:`auto`,transition:M([`top`,`right`,`bottom`,`left`,`max-width`],{duration:300,easing:`ease`}),pointerEvents:`none`},K[Ce]={padding:Z.snackbar.default+`px 0px`,transition:`padding 300ms ease 0ms`},K.maxWidth=`calc(100% - `+Z.view.default*2+`px)`,K[g.downXs]={width:`100%`,maxWidth:`calc(100% - `+Q*2+`px)`},K),rootDense:(q={},q[Ce]={padding:Z.snackbar.dense+`px 0px`},q),top:{top:Z.view.default-Z.snackbar.default+`px`,flexDirection:`column`},bottom:{bottom:Z.view.default-Z.snackbar.default+`px`,flexDirection:`column-reverse`},left:(J={left:Z.view.default+`px`},J[g.upSm]={alignItems:`flex-start`},J[g.downXs]={left:Q+`px`},J),right:(Y={right:Z.view.default+`px`},Y[g.upSm]={alignItems:`flex-end`},Y[g.downXs]={right:Q+`px`},Y),center:(X={left:`50%`,transform:`translateX(-50%)`},X[g.upSm]={alignItems:`center`},X)}),we=(0,o.memo)(function(e){var t=e.classes,n=t===void 0?{}:t,r=e.anchorOrigin,i=e.dense,s=e.children,c=a(R.SnackbarContainer,$[r.vertical],$[r.horizontal],$.root,n.containerRoot,n[`containerAnchorOrigin`+v(r)],i&&$.rootDense);return o.createElement(`div`,{className:c},s)}),Te=function(e){return!(typeof e==`string`||(0,o.isValidElement)(e))},Ee=function(e){d(t,e);function t(t){var n=e.call(this,t)||this;return n.enqueueSnackbar=function(e,t){if(t===void 0&&(t={}),e==null)throw Error(`enqueueSnackbar called with invalid argument`);var r=Te(e)?e:t,i=Te(e)?e.message:e,o=r.key,s=r.preventDuplicate,c=f(r,[`key`,`preventDuplicate`]),l=y(o),d=l?o:new Date().getTime()+Math.random(),p=se(c,n.props),m=u({id:d},c,{message:i,open:!0,entered:!1,requestClose:!1,persist:p(`persist`),action:p(`action`),content:p(`content`),variant:p(`variant`),anchorOrigin:p(`anchorOrigin`),disableWindowBlurListener:p(`disableWindowBlurListener`),autoHideDuration:p(`autoHideDuration`),hideIconVariant:p(`hideIconVariant`),TransitionComponent:p(`TransitionComponent`),transitionDuration:p(`transitionDuration`),TransitionProps:p(`TransitionProps`,!0),iconVariant:p(`iconVariant`,!0),style:p(`style`,!0),SnackbarProps:p(`SnackbarProps`,!0),className:a(n.props.className,c.className)});return m.persist&&(m.autoHideDuration=void 0),n.setState(function(e){if(s===void 0&&n.props.preventDuplicate||s){var t=function(e){return l?e.id===d:e.message===i},r=e.queue.findIndex(t)>-1,a=e.snacks.findIndex(t)>-1;if(r||a)return e}return n.handleDisplaySnack(u({},e,{queue:[].concat(e.queue,[m])}))}),d},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?u({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,r=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(r=!0);var i=e.snacks.map(function(e){return!t&&(!e.persist||r)?(t=!0,e.entered?(e.onClose&&e.onClose(null,`maxsnack`,e.id),n.props.onClose&&n.props.onClose(null,`maxsnack`,e.id),u({},e,{open:!1})):u({},e,{requestClose:!0})):u({},e)});return u({},e,{snacks:i})},n.handleEnteredSnack=function(e,t,r){if(!y(r))throw Error(`handleEnteredSnack Cannot be called with undefined key`);n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===r?u({},e,{entered:!0}):u({},e)})}})},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var i=r===void 0;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return!i&&e.id!==r?u({},e):e.entered?u({},e,{open:!1}):u({},e,{requestClose:!0})}),queue:n.filter(function(e){return e.id!==r})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});y(e)&&t&&t.onClose&&t.onClose(null,`instructed`,e),n.handleCloseSnack(null,`instructed`,e)},n.handleExitedSnack=function(e,t){if(!y(t))throw Error(`handleExitedSnack Cannot be called with undefined key`);n.setState(function(e){var r=n.processQueue(u({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return r.queue.length===0?r:n.handleDismissOldest(r)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(p(n)),closeSnackbar:n.closeSnackbar.bind(p(n))}},n}var n=t.prototype;return n.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,i=n.children,a=n.dense,c=a===void 0?!1:a,l=n.Components,d=l===void 0?{}:l,f=n.classes,p=this.state.snacks.reduce(function(e,t){var n,r=v(t.anchorOrigin),i=e[r]||[];return u({},e,(n={},n[r]=[].concat(i,[t]),n))},{}),m=Object.keys(p).map(function(t){var n=p[t],r=n[0];return o.createElement(we,{key:t,dense:c,anchorOrigin:r.anchorOrigin,classes:f},n.map(function(t){return o.createElement(Se,{key:t.id,snack:t,classes:f,Component:d[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:V([e.handleExitedSnack,e.props.onExited],t.id),onEntered:V([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return o.createElement(h.Provider,{value:t},i,r?(0,s.createPortal)(m,r):m)},l(t,[{key:`maxSnack`,get:function(){return this.props.maxSnack||I.maxSnack}}]),t}(o.Component),De=(function(){return(0,o.useContext)(h)});export{De as n,Ee as t};
|
|
4
|
+
13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z`}))},null),info:i.createElement(function(){return i.createElement(F,null,i.createElement(`path`,{d:`M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,
|
|
5
|
+
0 22,12A10,10 0 0,0 12,2Z`}))},null)},anchorOrigin:{vertical:`bottom`,horizontal:`left`},TransitionComponent:P,transitionDuration:{enter:225,exit:195}},ae=function(e,t){var n=function(e){return typeof e==`number`||e===null};return n(e)?e:n(t)?t:I.autoHideDuration},oe=function(e,t){var n=function(e,t){return t.some(function(t){return typeof e===t})};return n(e,[`string`,`number`])?e:n(e,[`object`])?u({},I.transitionDuration,{},n(t,[`object`])&&t,{},e):n(t,[`string`,`number`])?t:n(t,[`object`])?u({},I.transitionDuration,{},t):I.transitionDuration},se=function(e,t){return function(n,r){return r===void 0&&(r=!1),r?u({},I[n],{},t[n],{},e[n]):n===`autoHideDuration`?ae(e.autoHideDuration,t.autoHideDuration):n===`transitionDuration`?oe(e.transitionDuration,t.transitionDuration):e[n]||t[n]||I[n]}};function L(e){return Object.entries(e).reduce(function(e,t){var r,i=t[0],a=t[1];return u({},e,(r={},r[i]=n(a),r))},{})}var R={SnackbarContainer:`notistack-SnackbarContainer`,Snackbar:`notistack-Snackbar`,CollapseWrapper:`notistack-CollapseWrapper`,MuiContent:`notistack-MuiContent`,MuiContentVariant:function(e){return`notistack-MuiContent-`+e}},ce=L({root:{height:0},entered:{height:`auto`}}),z=`0px`,B=175,le=(0,i.forwardRef)(function(e,t){var n=e.children,r=e.in,a=e.onExited,o=(0,i.useRef)(null),c=(0,i.useRef)(null),l=O(t,c),d=function(){return o.current?o.current.clientHeight:0};return(0,i.createElement)(T,{in:r,unmountOnExit:!0,onEnter:function(e){e.style.height=z},onEntered:function(e){e.style.height=`auto`},onEntering:function(e){var t=d(),n=k({timeout:B,mode:`enter`}),r=n.duration,i=n.easing;e.style.transitionDuration=typeof r==`string`?r:r+`ms`,e.style.height=t+`px`,e.style.transitionTimingFunction=i||``},onExit:function(e){e.style.height=d()+`px`},onExited:a,onExiting:function(e){j(e);var t=k({timeout:B,mode:`exit`}),n=t.duration,r=t.easing;e.style.transitionDuration=typeof n==`string`?n:n+`ms`,e.style.height=z,e.style.transitionTimingFunction=r||``},nodeRef:c,timeout:B},function(e,t){return(0,i.createElement)(`div`,Object.assign({ref:l,className:s(ce.root,e===`entered`&&ce.entered),style:u({pointerEvents:`all`,overflow:`hidden`,minHeight:z,transition:M(`height`)},e===`entered`&&{overflow:`visible`},{},e===`exited`&&!r&&{visibility:`hidden`})},t),(0,i.createElement)(`div`,{ref:o,className:R.CollapseWrapper,style:{display:`flex`,width:`100%`}},n))})});le.displayName=`Collapse`;var ue={right:`left`,left:`right`,bottom:`up`,top:`down`},de=function(e){return e.horizontal===`center`?ue[e.vertical]:ue[e.horizontal]},fe=function(e){return`anchorOrigin`+v(e)},pe=function(e){e===void 0&&(e={});var t={containerRoot:!0,containerAnchorOriginTopCenter:!0,containerAnchorOriginBottomCenter:!0,containerAnchorOriginTopRight:!0,containerAnchorOriginBottomRight:!0,containerAnchorOriginTopLeft:!0,containerAnchorOriginBottomLeft:!0};return Object.keys(e).filter(function(e){return!t[e]}).reduce(function(t,n){var r;return u({},t,(r={},r[n]=e[n],r))},{})},me=function(){};function V(e,t){return e.reduce(function(e,n){return n==null?e:function(){var r=[...arguments],i=[].concat(r);t&&i.indexOf(t)===-1&&i.push(t),e.apply(this,i),n.apply(this,i)}},me)}var he=typeof window<`u`?i.useLayoutEffect:i.useEffect;function H(e){var t=(0,i.useRef)(e);return he(function(){t.current=e}),(0,i.useCallback)(function(){return t.current.apply(void 0,arguments)},[])}var U=(0,i.forwardRef)(function(e,t){var n=e.children,r=e.className,a=e.autoHideDuration,o=e.disableWindowBlurListener,c=o===void 0?!1:o,l=e.onClose,u=e.id,d=e.open,f=e.SnackbarProps,p=f===void 0?{}:f,m=(0,i.useRef)(),h=H(function(){l&&l.apply(void 0,arguments)}),g=H(function(e){!l||e==null||(m.current&&clearTimeout(m.current),m.current=setTimeout(function(){h(null,`timeout`,u)},e))});(0,i.useEffect)(function(){return d&&g(a),function(){m.current&&clearTimeout(m.current)}},[d,a,g]);var _=function(){m.current&&clearTimeout(m.current)},v=(0,i.useCallback)(function(){a!=null&&g(a*.5)},[a,g]);return(0,i.useEffect)(function(){if(!c&&d)return window.addEventListener(`focus`,v),window.addEventListener(`blur`,_),function(){window.removeEventListener(`focus`,v),window.removeEventListener(`blur`,_)}},[c,v,d]),(0,i.createElement)(`div`,Object.assign({ref:t},p,{className:s(R.Snackbar,r),onMouseEnter:function(e){p.onMouseEnter&&p.onMouseEnter(e),_()},onMouseLeave:function(e){p.onMouseLeave&&p.onMouseLeave(e),v()}}),n)});U.displayName=`Snackbar`;var W,ge=L({root:(W={display:`flex`,flexWrap:`wrap`,flexGrow:1},W[g.upSm]={flexGrow:`initial`,minWidth:`288px`},W)}),_e=(0,i.forwardRef)(function(e,t){var n=e.className,r=f(e,[`className`]);return i.createElement(`div`,Object.assign({ref:t,className:s(ge.root,n)},r))});_e.displayName=`SnackbarContent`;var G=L({root:{backgroundColor:`#313131`,fontSize:`0.875rem`,lineHeight:1.43,letterSpacing:`0.01071em`,color:`#fff`,alignItems:`center`,padding:`6px 16px`,borderRadius:`4px`,boxShadow:`0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)`},lessPadding:{paddingLeft:`20px`},default:{backgroundColor:`#313131`},success:{backgroundColor:`#43a047`},error:{backgroundColor:`#d32f2f`},warning:{backgroundColor:`#ff9800`},info:{backgroundColor:`#2196f3`},message:{display:`flex`,alignItems:`center`,padding:`8px 0`},action:{display:`flex`,alignItems:`center`,marginLeft:`auto`,paddingLeft:`16px`,marginRight:`-8px`}}),ve=`notistack-snackbar`,ye=(0,i.forwardRef)(function(e,t){var n=e.id,r=e.message,a=e.action,o=e.iconVariant,c=e.variant,l=e.hideIconVariant,u=e.style,d=e.className,f=o[c],p=a;return typeof p==`function`&&(p=p(n)),i.createElement(_e,{ref:t,role:`alert`,"aria-describedby":ve,style:u,className:s(R.MuiContent,R.MuiContentVariant(c),G.root,G[c],d,!l&&f&&G.lessPadding)},i.createElement(`div`,{id:ve,className:G.message},l?null:f,r),p&&i.createElement(`div`,{className:G.action},p))});ye.displayName=`MaterialDesignContent`;var be=(0,i.memo)(ye),xe=L({wrappedRoot:{width:`100%`,position:`relative`,transform:`translateX(0)`,top:0,right:0,bottom:0,left:0,minWidth:`288px`}}),Se=function(e){var t=(0,i.useRef)(),n=(0,i.useState)(!0),r=n[0],a=n[1],o=V([e.snack.onClose,e.onClose]),c=function(){e.snack.requestClose&&o(null,`instructed`,e.snack.id)},l=(0,i.useCallback)(function(){t.current=setTimeout(function(){a(function(e){return!e})},125)},[]);(0,i.useEffect)(function(){return function(){t.current&&clearTimeout(t.current)}},[]);var d=e.snack,p=e.classes,m=e.Component,h=m===void 0?be:m,g=(0,i.useMemo)(function(){return pe(p)},[p]),_=d.open,v=d.SnackbarProps,y=d.TransitionComponent,b=d.TransitionProps,x=d.transitionDuration,S=d.disableWindowBlurListener,C=d.content,w=f(d,[`open`,`SnackbarProps`,`TransitionComponent`,`TransitionProps`,`transitionDuration`,`disableWindowBlurListener`,`content`,`entered`,`requestClose`,`onEnter`,`onEntered`,`onExit`,`onExited`]),T=u({direction:de(w.anchorOrigin),timeout:x},b),E=C;typeof E==`function`&&(E=E(w.id,w.message));var D=[`onEnter`,`onEntered`,`onExit`,`onExited`].reduce(function(t,n){var r;return u({},t,(r={},r[n]=V([e.snack[n],e[n]],w.id),r))},{});return i.createElement(le,{in:r,onExited:D.onExited},i.createElement(U,{open:_,id:w.id,disableWindowBlurListener:S,autoHideDuration:w.autoHideDuration,className:s(xe.wrappedRoot,g.root,g[fe(w.anchorOrigin)]),SnackbarProps:v,onClose:o},i.createElement(y,Object.assign({},T,{appear:!0,in:_,onExit:D.onExit,onExited:l,onEnter:D.onEnter,onEntered:V([D.onEntered,c],w.id)}),E||i.createElement(h,Object.assign({},w)))))},K,q,J,Y,X,Z={view:{default:20,dense:4},snackbar:{default:6,dense:2}},Ce=`.`+R.CollapseWrapper,Q=16,$=L({root:(K={boxSizing:`border-box`,display:`flex`,maxHeight:`100%`,position:`fixed`,zIndex:1400,height:`auto`,width:`auto`,transition:M([`top`,`right`,`bottom`,`left`,`max-width`],{duration:300,easing:`ease`}),pointerEvents:`none`},K[Ce]={padding:Z.snackbar.default+`px 0px`,transition:`padding 300ms ease 0ms`},K.maxWidth=`calc(100% - `+Z.view.default*2+`px)`,K[g.downXs]={width:`100%`,maxWidth:`calc(100% - `+Q*2+`px)`},K),rootDense:(q={},q[Ce]={padding:Z.snackbar.dense+`px 0px`},q),top:{top:Z.view.default-Z.snackbar.default+`px`,flexDirection:`column`},bottom:{bottom:Z.view.default-Z.snackbar.default+`px`,flexDirection:`column-reverse`},left:(J={left:Z.view.default+`px`},J[g.upSm]={alignItems:`flex-start`},J[g.downXs]={left:Q+`px`},J),right:(Y={right:Z.view.default+`px`},Y[g.upSm]={alignItems:`flex-end`},Y[g.downXs]={right:Q+`px`},Y),center:(X={left:`50%`,transform:`translateX(-50%)`},X[g.upSm]={alignItems:`center`},X)}),we=(0,i.memo)(function(e){var t=e.classes,n=t===void 0?{}:t,r=e.anchorOrigin,a=e.dense,o=e.children,c=s(R.SnackbarContainer,$[r.vertical],$[r.horizontal],$.root,n.containerRoot,n[`containerAnchorOrigin`+v(r)],a&&$.rootDense);return i.createElement(`div`,{className:c},o)}),Te=function(e){return!(typeof e==`string`||(0,i.isValidElement)(e))},Ee=function(e){d(t,e);function t(t){var n=e.call(this,t)||this;return n.enqueueSnackbar=function(e,t){if(t===void 0&&(t={}),e==null)throw Error(`enqueueSnackbar called with invalid argument`);var r=Te(e)?e:t,i=Te(e)?e.message:e,a=r.key,o=r.preventDuplicate,c=f(r,[`key`,`preventDuplicate`]),l=y(a),d=l?a:new Date().getTime()+Math.random(),p=se(c,n.props),m=u({id:d},c,{message:i,open:!0,entered:!1,requestClose:!1,persist:p(`persist`),action:p(`action`),content:p(`content`),variant:p(`variant`),anchorOrigin:p(`anchorOrigin`),disableWindowBlurListener:p(`disableWindowBlurListener`),autoHideDuration:p(`autoHideDuration`),hideIconVariant:p(`hideIconVariant`),TransitionComponent:p(`TransitionComponent`),transitionDuration:p(`transitionDuration`),TransitionProps:p(`TransitionProps`,!0),iconVariant:p(`iconVariant`,!0),style:p(`style`,!0),SnackbarProps:p(`SnackbarProps`,!0),className:s(n.props.className,c.className)});return m.persist&&(m.autoHideDuration=void 0),n.setState(function(e){if(o===void 0&&n.props.preventDuplicate||o){var t=function(e){return l?e.id===d:e.message===i},r=e.queue.findIndex(t)>-1,a=e.snacks.findIndex(t)>-1;if(r||a)return e}return n.handleDisplaySnack(u({},e,{queue:[].concat(e.queue,[m])}))}),d},n.handleDisplaySnack=function(e){return e.snacks.length>=n.maxSnack?n.handleDismissOldest(e):n.processQueue(e)},n.processQueue=function(e){var t=e.queue,n=e.snacks;return t.length>0?u({},e,{snacks:[].concat(n,[t[0]]),queue:t.slice(1,t.length)}):e},n.handleDismissOldest=function(e){if(e.snacks.some(function(e){return!e.open||e.requestClose}))return e;var t=!1,r=!1;e.snacks.reduce(function(e,t){return e+(t.open&&t.persist?1:0)},0)===n.maxSnack&&(r=!0);var i=e.snacks.map(function(e){return!t&&(!e.persist||r)?(t=!0,e.entered?(e.onClose&&e.onClose(null,`maxsnack`,e.id),n.props.onClose&&n.props.onClose(null,`maxsnack`,e.id),u({},e,{open:!1})):u({},e,{requestClose:!0})):u({},e)});return u({},e,{snacks:i})},n.handleEnteredSnack=function(e,t,r){if(!y(r))throw Error(`handleEnteredSnack Cannot be called with undefined key`);n.setState(function(e){return{snacks:e.snacks.map(function(e){return e.id===r?u({},e,{entered:!0}):u({},e)})}})},n.handleCloseSnack=function(e,t,r){n.props.onClose&&n.props.onClose(e,t,r);var i=r===void 0;n.setState(function(e){var t=e.snacks,n=e.queue;return{snacks:t.map(function(e){return!i&&e.id!==r?u({},e):e.entered?u({},e,{open:!1}):u({},e,{requestClose:!0})}),queue:n.filter(function(e){return e.id!==r})}})},n.closeSnackbar=function(e){var t=n.state.snacks.find(function(t){return t.id===e});y(e)&&t&&t.onClose&&t.onClose(null,`instructed`,e),n.handleCloseSnack(null,`instructed`,e)},n.handleExitedSnack=function(e,t){if(!y(t))throw Error(`handleExitedSnack Cannot be called with undefined key`);n.setState(function(e){var r=n.processQueue(u({},e,{snacks:e.snacks.filter(function(e){return e.id!==t})}));return r.queue.length===0?r:n.handleDismissOldest(r)})},n.enqueueSnackbar,n.closeSnackbar,n.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:n.enqueueSnackbar.bind(p(n)),closeSnackbar:n.closeSnackbar.bind(p(n))}},n}var n=t.prototype;return n.render=function(){var e=this,t=this.state.contextValue,n=this.props,r=n.domRoot,o=n.children,s=n.dense,c=s===void 0?!1:s,l=n.Components,d=l===void 0?{}:l,f=n.classes,p=this.state.snacks.reduce(function(e,t){var n,r=v(t.anchorOrigin),i=e[r]||[];return u({},e,(n={},n[r]=[].concat(i,[t]),n))},{}),m=Object.keys(p).map(function(t){var n=p[t],r=n[0];return i.createElement(we,{key:t,dense:c,anchorOrigin:r.anchorOrigin,classes:f},n.map(function(t){return i.createElement(Se,{key:t.id,snack:t,classes:f,Component:d[t.variant],onClose:e.handleCloseSnack,onEnter:e.props.onEnter,onExit:e.props.onExit,onExited:V([e.handleExitedSnack,e.props.onExited],t.id),onEntered:V([e.handleEnteredSnack,e.props.onEntered],t.id)})}))});return i.createElement(h.Provider,{value:t},o,r?(0,a.createPortal)(m,r):m)},l(t,[{key:`maxSnack`,get:function(){return this.props.maxSnack||I.maxSnack}}]),t}(i.Component),De=(function(){return(0,i.useContext)(h)});export{De as n,Ee as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime.js";import{c as t}from"./vendor_emotion.js";var n=e(t()),r=Object.defineProperty,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||={})a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},l=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},u;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+(t?1:0),n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(u||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(u||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(u||={});var d=u,f={L:d.QrCode.Ecc.LOW,M:d.QrCode.Ecc.MEDIUM,Q:d.QrCode.Ecc.QUARTILE,H:d.QrCode.Ecc.HIGH},p=128,m=`L`,h=`#FFFFFF`,g=`#000000`,_=!1,v=1,y=4,b=0,x=.1;function S(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function C(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function w(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*x),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function T(e,t){return t==null?e?y:b:Math.max(Math.floor(t),0)}function E({value:e,level:t,minVersion:r,includeMargin:i,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=n.useMemo(()=>{let n=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...d.QrSegment.makeSegments(t)),e),[]);return d.QrCode.encodeSegments(n,f[t],r,void 0,void 0,c)},[e,t,r,c]),{cells:u,margin:p,numCells:m,calculatedImageSettings:h}=n.useMemo(()=>{let e=l.getModules(),t=T(i,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:w(e,s,t,o)}},[l,s,o,i,a]);return{qrcode:l,margin:p,cells:u,numCells:m,calculatedImageSettings:h}}var D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),O=n.forwardRef(function(e,t){let r=e,{value:i,size:a=p,level:o=m,bgColor:s=h,fgColor:u=g,includeMargin:d=_,minVersion:f=v,boostLevel:y,marginSize:b,imageSettings:x}=r,w=l(r,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:T}=w,O=l(w,[`style`]),k=x?.src,A=n.useRef(null),j=n.useRef(null),M=n.useCallback(e=>{A.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[N,P]=n.useState(!1),{margin:F,cells:I,numCells:L,calculatedImageSettings:R}=E({value:i,level:o,minVersion:f,boostLevel:y,includeMargin:d,marginSize:b,imageSettings:x,size:a});n.useEffect(()=>{if(A.current!=null){let e=A.current,t=e.getContext(`2d`);if(!t)return;let n=I,r=j.current,i=R!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;i&&R.excavation!=null&&(n=C(I,R.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let c=a/L*o;t.scale(c,c),t.fillStyle=s,t.fillRect(0,0,L,L),t.fillStyle=u,D?t.fill(new Path2D(S(n,F))):I.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+F,n+F,1,1)})}),R&&(t.globalAlpha=R.opacity),i&&t.drawImage(r,R.x+F,R.y+F,R.w,R.h)}}),n.useEffect(()=>{P(!1)},[k]);let z=c({height:a,width:a},T),B=null;return k!=null&&(B=n.createElement(`img`,{src:k,key:k,style:{display:`none`},onLoad:()=>{P(!0)},ref:j,crossOrigin:R?.crossOrigin})),n.createElement(n.Fragment,null,n.createElement(`canvas`,c({style:z,height:a,width:a,ref:M,role:`img`},O)),B)});O.displayName=`QRCodeCanvas`;var k=n.forwardRef(function(e,t){let r=e,{value:i,size:a=p,level:o=m,bgColor:s=h,fgColor:u=g,includeMargin:d=_,minVersion:f=v,boostLevel:y,title:b,marginSize:x,imageSettings:w}=r,T=l(r,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:D,cells:O,numCells:k,calculatedImageSettings:A}=E({value:i,level:o,minVersion:f,boostLevel:y,includeMargin:d,marginSize:x,imageSettings:w,size:a}),j=O,M=null;w!=null&&A!=null&&(A.excavation!=null&&(j=C(O,A.excavation)),M=n.createElement(`image`,{href:w.src,height:A.h,width:A.w,x:A.x+D,y:A.y+D,preserveAspectRatio:`none`,opacity:A.opacity,crossOrigin:A.crossOrigin}));let N=S(j,D);return n.createElement(`svg`,c({height:a,width:a,viewBox:`0 0 ${k} ${k}`,ref:t,role:`img`},T),!!b&&n.createElement(`title`,null,b),n.createElement(`path`,{fill:s,d:`M0,0 h${k}v${k}H0z`,shapeRendering:`crispEdges`}),n.createElement(`path`,{fill:u,d:N,shapeRendering:`crispEdges`}),M)});k.displayName=`QRCodeSVG`;export{k as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime.js";import{c as t}from"./vendor_emotion.js";var n=e(t()),r=Object.defineProperty,i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||={})a.call(t,n)&&s(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&s(e,n,t[n]);return e},l=(e,t)=>{var n={};for(var r in e)a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&i)for(var r of i(e))t.indexOf(r)<0&&o.call(e,r)&&(n[r]=e[r]);return n},u;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(u||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(u||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(u||={});var d=u,f={L:d.QrCode.Ecc.LOW,M:d.QrCode.Ecc.MEDIUM,Q:d.QrCode.Ecc.QUARTILE,H:d.QrCode.Ecc.HIGH},p=128,m=`L`,h=`#FFFFFF`,g=`#000000`,_=!1,v=1,y=4,b=0,x=.1;function S(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function C(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function w(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*x),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function T(e,t){return t==null?e?y:b:Math.max(Math.floor(t),0)}function E({value:e,level:t,minVersion:r,includeMargin:i,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=n.useMemo(()=>{let n=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...d.QrSegment.makeSegments(t)),e),[]);return d.QrCode.encodeSegments(n,f[t],r,void 0,void 0,c)},[e,t,r,c]),{cells:u,margin:p,numCells:m,calculatedImageSettings:h}=n.useMemo(()=>{let e=l.getModules(),t=T(i,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:w(e,s,t,o)}},[l,s,o,i,a]);return{qrcode:l,margin:p,cells:u,numCells:m,calculatedImageSettings:h}}var D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),O=n.forwardRef(function(e,t){let r=e,{value:i,size:a=p,level:o=m,bgColor:s=h,fgColor:u=g,includeMargin:d=_,minVersion:f=v,boostLevel:y,marginSize:b,imageSettings:x}=r,w=l(r,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:T}=w,O=l(w,[`style`]),k=x?.src,A=n.useRef(null),j=n.useRef(null),M=n.useCallback(e=>{A.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[N,P]=n.useState(!1),{margin:F,cells:I,numCells:L,calculatedImageSettings:R}=E({value:i,level:o,minVersion:f,boostLevel:y,includeMargin:d,marginSize:b,imageSettings:x,size:a});n.useEffect(()=>{if(A.current!=null){let e=A.current,t=e.getContext(`2d`);if(!t)return;let n=I,r=j.current,i=R!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;i&&R.excavation!=null&&(n=C(I,R.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let c=a/L*o;t.scale(c,c),t.fillStyle=s,t.fillRect(0,0,L,L),t.fillStyle=u,D?t.fill(new Path2D(S(n,F))):I.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+F,n+F,1,1)})}),R&&(t.globalAlpha=R.opacity),i&&t.drawImage(r,R.x+F,R.y+F,R.w,R.h)}}),n.useEffect(()=>{P(!1)},[k]);let z=c({height:a,width:a},T),B=null;return k!=null&&(B=n.createElement(`img`,{src:k,key:k,style:{display:`none`},onLoad:()=>{P(!0)},ref:j,crossOrigin:R?.crossOrigin})),n.createElement(n.Fragment,null,n.createElement(`canvas`,c({style:z,height:a,width:a,ref:M,role:`img`},O)),B)});O.displayName=`QRCodeCanvas`;var k=n.forwardRef(function(e,t){let r=e,{value:i,size:a=p,level:o=m,bgColor:s=h,fgColor:u=g,includeMargin:d=_,minVersion:f=v,boostLevel:y,title:b,marginSize:x,imageSettings:w}=r,T=l(r,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:D,cells:O,numCells:k,calculatedImageSettings:A}=E({value:i,level:o,minVersion:f,boostLevel:y,includeMargin:d,marginSize:x,imageSettings:w,size:a}),j=O,M=null;w!=null&&A!=null&&(A.excavation!=null&&(j=C(O,A.excavation)),M=n.createElement(`image`,{href:w.src,height:A.h,width:A.w,x:A.x+D,y:A.y+D,preserveAspectRatio:`none`,opacity:A.opacity,crossOrigin:A.crossOrigin}));let N=S(j,D);return n.createElement(`svg`,c({height:a,width:a,viewBox:`0 0 ${k} ${k}`,ref:t,role:`img`},T),!!b&&n.createElement(`title`,null,b),n.createElement(`path`,{fill:s,d:`M0,0 h${k}v${k}H0z`,shapeRendering:`crispEdges`}),n.createElement(`path`,{fill:u,d:N,shapeRendering:`crispEdges`}),M)});k.displayName=`QRCodeSVG`;export{k as t};
|