@metricshift/react 1.1.0 → 1.3.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/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(O,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],g):(O=typeof globalThis<"u"?globalThis:O||self,g(O.MetricShiftReact={},O.React))})(this,function(O,g){"use strict";var pe={exports:{}},ee={};/**
1
+ (function(P,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(P=typeof globalThis<"u"?globalThis:P||self,x(P.MetricShiftReact={},P.React))})(this,function(P,x){"use strict";var ke={exports:{}},re={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ke;function Ve(){if(ke)return ee;ke=1;var d=g,E=Symbol.for("react.element"),w=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,p=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function F(h,b,C){var m,R={},T=null,L=null;C!==void 0&&(T=""+C),b.key!==void 0&&(T=""+b.key),b.ref!==void 0&&(L=b.ref);for(m in b)c.call(b,m)&&!a.hasOwnProperty(m)&&(R[m]=b[m]);if(h&&h.defaultProps)for(m in b=h.defaultProps,b)R[m]===void 0&&(R[m]=b[m]);return{$$typeof:E,type:h,key:T,ref:L,props:R,_owner:p.current}}return ee.Fragment=w,ee.jsx=F,ee.jsxs=F,ee}var te={};/**
9
+ */var Fe;function Xe(){if(Fe)return re;Fe=1;var p=x,S=Symbol.for("react.element"),T=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,b=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function j(y,h,_){var g,k={},O=null,M=null;_!==void 0&&(O=""+_),h.key!==void 0&&(O=""+h.key),h.ref!==void 0&&(M=h.ref);for(g in h)c.call(h,g)&&!o.hasOwnProperty(g)&&(k[g]=h[g]);if(y&&y.defaultProps)for(g in h=y.defaultProps,h)k[g]===void 0&&(k[g]=h[g]);return{$$typeof:S,type:y,key:O,ref:M,props:k,_owner:b.current}}return re.Fragment=T,re.jsx=j,re.jsxs=j,re}var ne={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,20 +14,20 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Re;function He(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){var d=g,E=Symbol.for("react.element"),w=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),h=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),k=Symbol.iterator,A="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var t=k&&e[k]||e[A];return typeof t=="function"?t:null}var M=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];K("error",e,r)}}function K(e,t,r){{var o=M.ReactDebugCurrentFrame,u=o.getStackAddendum();u!==""&&(t+="%s",r=r.concat([u]));var f=r.map(function(l){return String(l)});f.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,f)}}var i=!1,P=!1,oe=!1,ie=!1,ve=!1,re;re=Symbol.for("react.module.reference");function se(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===a||ve||e===p||e===C||e===m||ie||e===L||i||P||oe||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===R||e.$$typeof===F||e.$$typeof===h||e.$$typeof===b||e.$$typeof===re||e.getModuleId!==void 0))}function ge(e,t,r){var o=e.displayName;if(o)return o;var u=t.displayName||t.name||"";return u!==""?r+"("+u+")":r}function le(e){return e.displayName||"Context"}function D(e){if(e==null)return null;if(typeof e.tag=="number"&&y("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 c:return"Fragment";case w:return"Portal";case a:return"Profiler";case p:return"StrictMode";case C:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var t=e;return le(t)+".Consumer";case F:var r=e;return le(r._context)+".Provider";case b:return ge(e,e.render,"ForwardRef");case R:var o=e.displayName||null;return o!==null?o:D(e.type)||"Memo";case T:{var u=e,f=u._payload,l=u._init;try{return D(l(f))}catch{return null}}}return null}var z=Object.assign,W=0,ce,G,$,N,X,V,H;function Q(){}Q.__reactDisabledLog=!0;function Ce(){{if(W===0){ce=console.log,G=console.info,$=console.warn,N=console.error,X=console.group,V=console.groupCollapsed,H=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function he(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:ce}),info:z({},e,{value:G}),warn:z({},e,{value:$}),error:z({},e,{value:N}),group:z({},e,{value:X}),groupCollapsed:z({},e,{value:V}),groupEnd:z({},e,{value:H})})}W<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=M.ReactCurrentDispatcher,ue;function x(e,t,r){{if(ue===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);ue=o&&o[1]||""}return`
18
- `+ue+e}}var Y=!1,B;{var Qe=typeof WeakMap=="function"?WeakMap:Map;B=new Qe}function Te(e,t){if(!e||Y)return"";{var r=B.get(e);if(r!==void 0)return r}var o;Y=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=ne.current,ne.current=null,Ce();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(j){o=j}Reflect.construct(e,[],l)}else{try{l.call()}catch(j){o=j}e.call(l.prototype)}}else{try{throw Error()}catch(j){o=j}e()}}catch(j){if(j&&o&&typeof j.stack=="string"){for(var s=j.stack.split(`
19
- `),_=o.stack.split(`
20
- `),v=s.length-1,S=_.length-1;v>=1&&S>=0&&s[v]!==_[S];)S--;for(;v>=1&&S>=0;v--,S--)if(s[v]!==_[S]){if(v!==1||S!==1)do if(v--,S--,S<0||s[v]!==_[S]){var I=`
21
- `+s[v].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,I),I}while(v>=1&&S>=0);break}}}finally{Y=!1,ne.current=f,he(),Error.prepareStackTrace=u}var q=e?e.displayName||e.name:"",J=q?x(q):"";return typeof e=="function"&&B.set(e,J),J}function Ze(e,t,r){return Te(e,!1)}function qe(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function fe(e,t,r){if(e==null)return"";if(typeof e=="function")return Te(e,qe(e));if(typeof e=="string")return x(e);switch(e){case C:return x("Suspense");case m:return x("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case b:return Ze(e.render);case R:return fe(e.type,t,r);case T:{var o=e,u=o._payload,f=o._init;try{return fe(f(u),t,r)}catch{}}}return""}var ae=Object.prototype.hasOwnProperty,Pe={},Oe=M.ReactDebugCurrentFrame;function de(e){if(e){var t=e._owner,r=fe(e.type,e._source,t?t.type:null);Oe.setExtraStackFrame(r)}else Oe.setExtraStackFrame(null)}function et(e,t,r,o,u){{var f=Function.call.bind(ae);for(var l in e)if(f(e,l)){var s=void 0;try{if(typeof e[l]!="function"){var _=Error((o||"React class")+": "+r+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}s=e[l](t,l,o,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){s=v}s&&!(s instanceof Error)&&(de(u),y("%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).",o||"React class",r,l,typeof s),de(null)),s instanceof Error&&!(s.message in Pe)&&(Pe[s.message]=!0,de(u),y("Failed %s type: %s",r,s.message),de(null))}}}var tt=Array.isArray;function me(e){return tt(e)}function rt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function nt(e){try{return Fe(e),!1}catch{return!0}}function Fe(e){return""+e}function Me(e){if(nt(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rt(e)),Fe(e)}var Ie=M.ReactCurrentOwner,at={key:!0,ref:!0,__self:!0,__source:!0},De,Ae;function ot(e){if(ae.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function it(e){if(ae.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function st(e,t){typeof e.ref=="string"&&Ie.current}function lt(e,t){{var r=function(){De||(De=!0,y("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function ct(e,t){{var r=function(){Ae||(Ae=!0,y("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var ut=function(e,t,r,o,u,f,l){var s={$$typeof:E,type:e,key:t,ref:r,props:l,_owner:f};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ft(e,t,r,o,u){{var f,l={},s=null,_=null;r!==void 0&&(Me(r),s=""+r),it(t)&&(Me(t.key),s=""+t.key),ot(t)&&(_=t.ref,st(t,u));for(f in t)ae.call(t,f)&&!at.hasOwnProperty(f)&&(l[f]=t[f]);if(e&&e.defaultProps){var v=e.defaultProps;for(f in v)l[f]===void 0&&(l[f]=v[f])}if(s||_){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&lt(l,S),_&&ct(l,S)}return ut(e,s,_,u,o,Ie.current,l)}}var ye=M.ReactCurrentOwner,ze=M.ReactDebugCurrentFrame;function Z(e){if(e){var t=e._owner,r=fe(e.type,e._source,t?t.type:null);ze.setExtraStackFrame(r)}else ze.setExtraStackFrame(null)}var xe;xe=!1;function Se(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function We(){{if(ye.current){var e=D(ye.current.type);if(e)return`
17
+ */var Ie;function Qe(){return Ie||(Ie=1,process.env.NODE_ENV!=="production"&&function(){var p=x,S=Symbol.for("react.element"),T=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),y=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),N=Symbol.iterator,W="@@iterator";function K(e){if(e===null||typeof e!="object")return null;var t=N&&e[N]||e[W];return typeof t=="function"?t:null}var A=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];ae("error",e,r)}}function ae(e,t,r){{var a=A.ReactDebugCurrentFrame,u=a.getStackAddendum();u!==""&&(t+="%s",r=r.concat([u]));var d=r.map(function(l){return String(l)});d.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,d)}}var i=!1,w=!1,ue=!1,fe=!1,de=!1,oe;oe=Symbol.for("react.module.reference");function pe(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===o||de||e===b||e===_||e===g||fe||e===M||i||w||ue||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===k||e.$$typeof===j||e.$$typeof===y||e.$$typeof===h||e.$$typeof===oe||e.getModuleId!==void 0))}function be(e,t,r){var a=e.displayName;if(a)return a;var u=t.displayName||t.name||"";return u!==""?r+"("+u+")":r}function he(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&f("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 c:return"Fragment";case T:return"Portal";case o:return"Profiler";case b:return"StrictMode";case _:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var t=e;return he(t)+".Consumer";case j:var r=e;return he(r._context)+".Provider";case h:return be(e,e.render,"ForwardRef");case k:var a=e.displayName||null;return a!==null?a:I(e.type)||"Memo";case O:{var u=e,d=u._payload,l=u._init;try{return I(l(d))}catch{return null}}}return null}var D=Object.assign,U=0,ge,ve,ie,xe,G,ye,$;function X(){}X.__reactDisabledLog=!0;function V(){{if(U===0){ge=console.log,ve=console.info,ie=console.warn,xe=console.error,G=console.group,ye=console.groupCollapsed,$=console.groupEnd;var e={configurable:!0,enumerable:!0,value:X,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function se(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ge}),info:D({},e,{value:ve}),warn:D({},e,{value:ie}),error:D({},e,{value:xe}),group:D({},e,{value:G}),groupCollapsed:D({},e,{value:ye}),groupEnd:D({},e,{value:$})})}U<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=A.ReactCurrentDispatcher,B;function L(e,t,r){{if(B===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);B=a&&a[1]||""}return`
18
+ `+B+e}}var le=!1,ce;{var je=typeof WeakMap=="function"?WeakMap:Map;ce=new je}function me(e,t){if(!e||le)return"";{var r=ce.get(e);if(r!==void 0)return r}var a;le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=Y.current,Y.current=null,V();try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(C){a=C}Reflect.construct(e,[],l)}else{try{l.call()}catch(C){a=C}e.call(l.prototype)}}else{try{throw Error()}catch(C){a=C}e()}}catch(C){if(C&&a&&typeof C.stack=="string"){for(var s=C.stack.split(`
19
+ `),R=a.stack.split(`
20
+ `),v=s.length-1,m=R.length-1;v>=1&&m>=0&&s[v]!==R[m];)m--;for(;v>=1&&m>=0;v--,m--)if(s[v]!==R[m]){if(v!==1||m!==1)do if(v--,m--,m<0||s[v]!==R[m]){var F=`
21
+ `+s[v].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&ce.set(e,F),F}while(v>=1&&m>=0);break}}}finally{le=!1,Y.current=d,se(),Error.prepareStackTrace=u}var te=e?e.displayName||e.name:"",J=te?L(te):"";return typeof e=="function"&&ce.set(e,J),J}function _e(e,t,r){return me(e,!1)}function we(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Q(e,t,r){if(e==null)return"";if(typeof e=="function")return me(e,we(e));if(typeof e=="string")return L(e);switch(e){case _:return L("Suspense");case g:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return _e(e.render);case k:return Q(e.type,t,r);case O:{var a=e,u=a._payload,d=a._init;try{return Q(d(u),t,r)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Se={},Ee=A.ReactDebugCurrentFrame;function Z(e){if(e){var t=e._owner,r=Q(e.type,e._source,t?t.type:null);Ee.setExtraStackFrame(r)}else Ee.setExtraStackFrame(null)}function We(e,t,r,a,u){{var d=Function.call.bind(H);for(var l in e)if(d(e,l)){var s=void 0;try{if(typeof e[l]!="function"){var R=Error((a||"React class")+": "+r+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}s=e[l](t,l,a,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){s=v}s&&!(s instanceof Error)&&(Z(u),f("%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",r,l,typeof s),Z(null)),s instanceof Error&&!(s.message in Se)&&(Se[s.message]=!0,Z(u),f("Failed %s type: %s",r,s.message),Z(null))}}}var E=Array.isArray;function z(e){return E(e)}function q(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function nt(e){try{return ze(e),!1}catch{return!0}}function ze(e){return""+e}function Ye(e){if(nt(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q(e)),ze(e)}var Be=A.ReactCurrentOwner,at={key:!0,ref:!0,__self:!0,__source:!0},Le,Ne;function ot(e){if(H.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function it(e){if(H.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function st(e,t){typeof e.ref=="string"&&Be.current}function lt(e,t){{var r=function(){Le||(Le=!0,f("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function ct(e,t){{var r=function(){Ne||(Ne=!0,f("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var ut=function(e,t,r,a,u,d,l){var s={$$typeof:S,type:e,key:t,ref:r,props:l,_owner:d};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function ft(e,t,r,a,u){{var d,l={},s=null,R=null;r!==void 0&&(Ye(r),s=""+r),it(t)&&(Ye(t.key),s=""+t.key),ot(t)&&(R=t.ref,st(t,u));for(d in t)H.call(t,d)&&!at.hasOwnProperty(d)&&(l[d]=t[d]);if(e&&e.defaultProps){var v=e.defaultProps;for(d in v)l[d]===void 0&&(l[d]=v[d])}if(s||R){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&lt(l,m),R&&ct(l,m)}return ut(e,s,R,u,a,Be.current,l)}}var Ce=A.ReactCurrentOwner,Ue=A.ReactDebugCurrentFrame;function ee(e){if(e){var t=e._owner,r=Q(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(r)}else Ue.setExtraStackFrame(null)}var Te;Te=!1;function Pe(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}function Ve(){{if(Ce.current){var e=I(Ce.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function dt(e){return""}var Ye={};function pt(e){{var t=We();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
23
+ Check the render method of \``+e+"`."}return""}}function dt(e){return""}var He={};function pt(e){{var t=Ve();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
24
24
 
25
- Check the top-level render call using <`+r+">.")}return t}}function Be(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=pt(t);if(Ye[r])return;Ye[r]=!0;var o="";e&&e._owner&&e._owner!==ye.current&&(o=" It was passed a child from "+D(e._owner.type)+"."),Z(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,o),Z(null)}}function Le(e,t){{if(typeof e!="object")return;if(me(e))for(var r=0;r<e.length;r++){var o=e[r];Se(o)&&Be(o,t)}else if(Se(e))e._store&&(e._store.validated=!0);else if(e){var u=U(e);if(typeof u=="function"&&u!==e.entries)for(var f=u.call(e),l;!(l=f.next()).done;)Se(l.value)&&Be(l.value,t)}}}function bt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===b||t.$$typeof===R))r=t.propTypes;else return;if(r){var o=D(t);et(r,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!xe){xe=!0;var u=D(t);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var o=t[r];if(o!=="children"&&o!=="key"){Z(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),Z(null);break}}e.ref!==null&&(Z(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),Z(null))}}var Ne={};function Ue(e,t,r,o,u,f){{var l=se(e);if(!l){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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 _=dt();_?s+=_:s+=We();var v;e===null?v="null":me(e)?v="array":e!==void 0&&e.$$typeof===E?(v="<"+(D(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,s)}var S=ft(e,t,r,u,f);if(S==null)return S;if(l){var I=t.children;if(I!==void 0)if(o)if(me(I)){for(var q=0;q<I.length;q++)Le(I[q],e);Object.freeze&&Object.freeze(I)}else y("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 Le(I,e)}if(ae.call(t,"key")){var J=D(e),j=Object.keys(t).filter(function(St){return St!=="key"}),Ee=j.length>0?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}";if(!Ne[J+Ee]){var xt=j.length>0?"{"+j.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+r+">.")}return t}}function Je(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=pt(t);if(He[r])return;He[r]=!0;var a="";e&&e._owner&&e._owner!==Ce.current&&(a=" It was passed a child from "+I(e._owner.type)+"."),ee(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,a),ee(null)}}function Ke(e,t){{if(typeof e!="object")return;if(z(e))for(var r=0;r<e.length;r++){var a=e[r];Pe(a)&&Je(a,t)}else if(Pe(e))e._store&&(e._store.validated=!0);else if(e){var u=K(e);if(typeof u=="function"&&u!==e.entries)for(var d=u.call(e),l;!(l=d.next()).done;)Pe(l.value)&&Je(l.value,t)}}}function bt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===h||t.$$typeof===k))r=t.propTypes;else return;if(r){var a=I(t);We(r,e.props,"prop",a,e)}else if(t.PropTypes!==void 0&&!Te){Te=!0;var u=I(t);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ht(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var a=t[r];if(a!=="children"&&a!=="key"){ee(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),ee(null);break}}e.ref!==null&&(ee(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null))}}var Ge={};function $e(e,t,r,a,u,d){{var l=pe(e);if(!l){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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 R=dt();R?s+=R:s+=Ve();var v;e===null?v="null":z(e)?v="array":e!==void 0&&e.$$typeof===S?(v="<"+(I(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,s)}var m=ft(e,t,r,u,d);if(m==null)return m;if(l){var F=t.children;if(F!==void 0)if(a)if(z(F)){for(var te=0;te<F.length;te++)Ke(F[te],e);Object.freeze&&Object.freeze(F)}else f("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 Ke(F,e)}if(H.call(t,"key")){var J=I(e),C=Object.keys(t).filter(function(St){return St!=="key"}),Oe=C.length>0?"{key: someKey, "+C.join(": ..., ")+": ...}":"{key: someKey}";if(!Ge[J+Oe]){var mt=C.length>0?"{"+C.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Ee,J,xt,J),Ne[J+Ee]=!0}}return e===c?vt(S):bt(S),S}}function gt(e,t,r){return Ue(e,t,r,!0)}function ht(e,t,r){return Ue(e,t,r,!1)}var mt=ht,yt=gt;te.Fragment=c,te.jsx=mt,te.jsxs=yt}()),te}process.env.NODE_ENV==="production"?pe.exports=Ve():pe.exports=He();var n=pe.exports;const _e=({isOpen:d,onClose:E,onSubmit:w})=>{const[c,p]=g.useState({text:"",rating:void 0,feedbackType:"general",userEmail:"",userName:""}),[a,F]=g.useState(!1),[h,b]=g.useState("idle"),[C,m]=g.useState(""),[R,T]=g.useState(!1),L=g.useRef(null),k=g.useRef(null);g.useEffect(()=>(d?(T(!0),document.body.style.overflow="hidden",setTimeout(()=>{var i;(i=k.current)==null||i.focus()},150)):document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[d]),g.useEffect(()=>{const i=P=>{P.key==="Escape"&&d&&!a&&A()};return d&&document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[d,a]);const A=()=>{T(!1),setTimeout(()=>{E(),setTimeout(()=>{p({text:"",rating:void 0,feedbackType:"general",userEmail:"",userName:""}),b("idle"),m("")},100)},200)},U=async i=>{if(i.preventDefault(),!c.text.trim()){m("Please enter your feedback");return}F(!0),m("");try{await w(c),b("success"),setTimeout(()=>{A()},2e3)}catch(P){b("error"),m(P instanceof Error?P.message:"Failed to submit feedback")}finally{F(!1)}};if(!d)return null;const M=i=>{i.target===i.currentTarget&&!a&&A()},y={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,padding:"16px",opacity:R?1:0,transition:"opacity 0.2s ease-in-out"},K={backgroundColor:"white",borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"100%",maxHeight:"90vh",overflowY:"auto",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",transform:R?"scale(1)":"scale(0.95)",opacity:R?1:0,transition:"all 0.2s ease-in-out"};return n.jsx("div",{onClick:M,style:y,role:"dialog","aria-modal":"true","aria-labelledby":"feedback-modal-title",children:n.jsxs("div",{ref:L,style:K,onClick:i=>i.stopPropagation(),children:[n.jsxs("div",{style:{marginBottom:"24px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsx("h2",{id:"feedback-modal-title",style:{fontSize:"20px",fontWeight:"600",margin:0,color:"#111827"},children:"Send Feedback"}),n.jsx("button",{onClick:A,disabled:a,"aria-label":"Close feedback form",style:{background:"none",border:"none",fontSize:"24px",cursor:a?"not-allowed":"pointer",color:"#6b7280",padding:"0",lineHeight:"1",opacity:a?.5:1,transition:"color 0.2s"},onMouseEnter:i=>!a&&(i.currentTarget.style.color="#111827"),onMouseLeave:i=>!a&&(i.currentTarget.style.color="#6b7280"),children:"×"})]}),h==="success"&&n.jsxs("div",{style:{backgroundColor:"#d1fae5",border:"1px solid #6ee7b7",borderRadius:"8px",padding:"12px",marginBottom:"16px",color:"#065f46",display:"flex",alignItems:"center",gap:"8px",animation:"slideIn 0.3s ease-out"},role:"status","aria-live":"polite",children:[n.jsx("span",{style:{fontSize:"18px"},children:"✓"}),n.jsx("span",{children:"Thank you! Your feedback has been submitted."})]}),C&&n.jsxs("div",{style:{backgroundColor:"#fee2e2",border:"1px solid #fca5a5",borderRadius:"8px",padding:"12px",marginBottom:"16px",color:"#991b1b",display:"flex",alignItems:"center",gap:"8px"},role:"alert","aria-live":"assertive",children:[n.jsx("span",{style:{fontSize:"18px"},children:"⚠"}),n.jsx("span",{children:C})]}),n.jsxs("form",{onSubmit:U,children:[n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{htmlFor:"feedback-type",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Type"}),n.jsxs("select",{id:"feedback-type",value:c.feedbackType,onChange:i=>p({...c,feedbackType:i.target.value}),disabled:a,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",backgroundColor:"white",cursor:a?"not-allowed":"pointer",opacity:a?.6:1},children:[n.jsx("option",{value:"general",children:"General Feedback"}),n.jsx("option",{value:"bug",children:"Bug Report"}),n.jsx("option",{value:"feature_request",children:"Feature Request"}),n.jsx("option",{value:"question",children:"Question"}),n.jsx("option",{value:"praise",children:"Praise"})]})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Rating (optional)"}),n.jsx("div",{style:{display:"flex",gap:"8px"},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(i=>n.jsx("button",{type:"button",onClick:()=>p({...c,rating:i}),disabled:a,"aria-label":`Rate ${i} stars`,"aria-pressed":c.rating===i,style:{background:"none",border:"none",fontSize:"28px",cursor:a?"not-allowed":"pointer",padding:"0",color:c.rating&&c.rating>=i?"#fbbf24":"#d1d5db",transition:"all 0.2s",opacity:a?.6:1,transform:"scale(1)"},onMouseEnter:P=>!a&&(P.currentTarget.style.transform="scale(1.2)"),onMouseLeave:P=>!a&&(P.currentTarget.style.transform="scale(1)"),children:"★"},i))})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsxs("label",{htmlFor:"feedback-text",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:["Your Feedback ",n.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),n.jsx("textarea",{id:"feedback-text",ref:k,value:c.text,onChange:i=>p({...c,text:i.target.value}),placeholder:"Tell us what you think...",required:!0,disabled:a,rows:4,"aria-required":"true",style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",resize:"vertical",fontFamily:"inherit",opacity:a?.6:1,cursor:a?"not-allowed":"text"}})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{htmlFor:"feedback-name",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Name (optional)"}),n.jsx("input",{id:"feedback-name",type:"text",value:c.userName,onChange:i=>p({...c,userName:i.target.value}),placeholder:"Your name",disabled:a,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",opacity:a?.6:1}})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsx("label",{htmlFor:"feedback-email",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Email (optional)"}),n.jsx("input",{id:"feedback-email",type:"email",value:c.userEmail,onChange:i=>p({...c,userEmail:i.target.value}),placeholder:"your@email.com",disabled:a,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",opacity:a?.6:1}})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[n.jsx("button",{type:"button",onClick:A,disabled:a,style:{padding:"10px 20px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",fontSize:"14px",fontWeight:"500",cursor:a?"not-allowed":"pointer",opacity:a?.5:1,transition:"all 0.2s"},onMouseEnter:i=>!a&&(i.currentTarget.style.backgroundColor="#f9fafb"),onMouseLeave:i=>!a&&(i.currentTarget.style.backgroundColor="white"),children:"Cancel"}),n.jsxs("button",{type:"submit",disabled:a||h==="success",style:{padding:"10px 20px",border:"none",borderRadius:"6px",backgroundColor:h==="success"?"#10b981":"#3b82f6",color:"white",fontSize:"14px",fontWeight:"500",cursor:a||h==="success"?"not-allowed":"pointer",opacity:a?.7:1,transition:"all 0.2s",display:"flex",alignItems:"center",gap:"8px"},children:[a&&n.jsx("span",{style:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #ffffff",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 0.6s linear infinite"}}),n.jsx("span",{children:a?"Sending...":h==="success"?"✓ Sent!":"Send Feedback"})]})]})]}),n.jsx("style",{children:`
30
+ <%s key={someKey} {...props} />`,Oe,J,mt,J),Ge[J+Oe]=!0}}return e===c?ht(m):bt(m),m}}function gt(e,t,r){return $e(e,t,r,!0)}function vt(e,t,r){return $e(e,t,r,!1)}var xt=vt,yt=gt;ne.Fragment=c,ne.jsx=xt,ne.jsxs=yt}()),ne}process.env.NODE_ENV==="production"?ke.exports=Xe():ke.exports=Qe();var n=ke.exports;const Me=({isOpen:p,onClose:S,onSubmit:T})=>{const[c,b]=x.useState({text:"",rating:void 0,feedbackType:"general",userEmail:"",userName:""}),[o,j]=x.useState(!1),[y,h]=x.useState("idle"),[_,g]=x.useState(""),[k,O]=x.useState(!1),M=x.useRef(null),N=x.useRef(null);x.useEffect(()=>(p?(O(!0),document.body.style.overflow="hidden",setTimeout(()=>{var i;(i=N.current)==null||i.focus()},150)):document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[p]),x.useEffect(()=>{const i=w=>{w.key==="Escape"&&p&&!o&&W()};return p&&document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[p,o]);const W=()=>{O(!1),setTimeout(()=>{S(),setTimeout(()=>{b({text:"",rating:void 0,feedbackType:"general",userEmail:"",userName:""}),h("idle"),g("")},100)},200)},K=async i=>{if(i.preventDefault(),!c.text.trim()){g("Please enter your feedback");return}j(!0),g("");try{await T(c),h("success"),setTimeout(()=>{W()},2e3)}catch(w){h("error"),g(w instanceof Error?w.message:"Failed to submit feedback")}finally{j(!1)}};if(!p)return null;const A=i=>{i.target===i.currentTarget&&!o&&W()},f={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,padding:"16px",opacity:k?1:0,transition:"opacity 0.2s ease-in-out"},ae={backgroundColor:"white",borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"100%",maxHeight:"90vh",overflowY:"auto",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",transform:k?"scale(1)":"scale(0.95)",opacity:k?1:0,transition:"all 0.2s ease-in-out"};return n.jsx("div",{onClick:A,style:f,role:"dialog","aria-modal":"true","aria-labelledby":"feedback-modal-title",children:n.jsxs("div",{ref:M,style:ae,onClick:i=>i.stopPropagation(),children:[n.jsxs("div",{style:{marginBottom:"24px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsx("h2",{id:"feedback-modal-title",style:{fontSize:"20px",fontWeight:"600",margin:0,color:"#111827"},children:"Send Feedback"}),n.jsx("button",{onClick:W,disabled:o,"aria-label":"Close feedback form",style:{background:"none",border:"none",fontSize:"24px",cursor:o?"not-allowed":"pointer",color:"#6b7280",padding:"0",lineHeight:"1",opacity:o?.5:1,transition:"color 0.2s"},onMouseEnter:i=>!o&&(i.currentTarget.style.color="#111827"),onMouseLeave:i=>!o&&(i.currentTarget.style.color="#6b7280"),children:"×"})]}),y==="success"&&n.jsxs("div",{style:{backgroundColor:"#d1fae5",border:"1px solid #6ee7b7",borderRadius:"8px",padding:"12px",marginBottom:"16px",color:"#065f46",display:"flex",alignItems:"center",gap:"8px",animation:"slideIn 0.3s ease-out"},role:"status","aria-live":"polite",children:[n.jsx("span",{style:{fontSize:"18px"},children:"✓"}),n.jsx("span",{children:"Thank you! Your feedback has been submitted."})]}),_&&n.jsxs("div",{style:{backgroundColor:"#fee2e2",border:"1px solid #fca5a5",borderRadius:"8px",padding:"12px",marginBottom:"16px",color:"#991b1b",display:"flex",alignItems:"center",gap:"8px"},role:"alert","aria-live":"assertive",children:[n.jsx("span",{style:{fontSize:"18px"},children:"⚠"}),n.jsx("span",{children:_})]}),n.jsxs("form",{onSubmit:K,children:[n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{htmlFor:"feedback-type",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Type"}),n.jsxs("select",{id:"feedback-type",value:c.feedbackType,onChange:i=>b({...c,feedbackType:i.target.value}),disabled:o,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",backgroundColor:"white",cursor:o?"not-allowed":"pointer",opacity:o?.6:1},children:[n.jsx("option",{value:"general",children:"General Feedback"}),n.jsx("option",{value:"bug",children:"Bug Report"}),n.jsx("option",{value:"feature_request",children:"Feature Request"}),n.jsx("option",{value:"question",children:"Question"}),n.jsx("option",{value:"praise",children:"Praise"})]})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Rating (optional)"}),n.jsx("div",{style:{display:"flex",gap:"8px"},role:"group","aria-label":"Rating",children:[1,2,3,4,5].map(i=>n.jsx("button",{type:"button",onClick:()=>b({...c,rating:i}),disabled:o,"aria-label":`Rate ${i} stars`,"aria-pressed":c.rating===i,style:{background:"none",border:"none",fontSize:"28px",cursor:o?"not-allowed":"pointer",padding:"0",color:c.rating&&c.rating>=i?"#fbbf24":"#d1d5db",transition:"all 0.2s",opacity:o?.6:1,transform:"scale(1)"},onMouseEnter:w=>!o&&(w.currentTarget.style.transform="scale(1.2)"),onMouseLeave:w=>!o&&(w.currentTarget.style.transform="scale(1)"),children:"★"},i))})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsxs("label",{htmlFor:"feedback-text",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:["Your Feedback ",n.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),n.jsx("textarea",{id:"feedback-text",ref:N,value:c.text,onChange:i=>b({...c,text:i.target.value}),placeholder:"Tell us what you think...",required:!0,disabled:o,rows:4,"aria-required":"true",style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",resize:"vertical",fontFamily:"inherit",opacity:o?.6:1,cursor:o?"not-allowed":"text"}})]}),n.jsxs("div",{style:{marginBottom:"16px"},children:[n.jsx("label",{htmlFor:"feedback-name",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Name (optional)"}),n.jsx("input",{id:"feedback-name",type:"text",value:c.userName,onChange:i=>b({...c,userName:i.target.value}),placeholder:"Your name",disabled:o,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",opacity:o?.6:1}})]}),n.jsxs("div",{style:{marginBottom:"24px"},children:[n.jsx("label",{htmlFor:"feedback-email",style:{display:"block",marginBottom:"8px",fontSize:"14px",fontWeight:"500",color:"#374151"},children:"Email (optional)"}),n.jsx("input",{id:"feedback-email",type:"email",value:c.userEmail,onChange:i=>b({...c,userEmail:i.target.value}),placeholder:"your@email.com",disabled:o,style:{width:"100%",padding:"8px 12px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",opacity:o?.6:1}})]}),n.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[n.jsx("button",{type:"button",onClick:W,disabled:o,style:{padding:"10px 20px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"white",color:"#374151",fontSize:"14px",fontWeight:"500",cursor:o?"not-allowed":"pointer",opacity:o?.5:1,transition:"all 0.2s"},onMouseEnter:i=>!o&&(i.currentTarget.style.backgroundColor="#f9fafb"),onMouseLeave:i=>!o&&(i.currentTarget.style.backgroundColor="white"),children:"Cancel"}),n.jsxs("button",{type:"submit",disabled:o||y==="success",style:{padding:"10px 20px",border:"none",borderRadius:"6px",backgroundColor:y==="success"?"#10b981":"#3b82f6",color:"white",fontSize:"14px",fontWeight:"500",cursor:o||y==="success"?"not-allowed":"pointer",opacity:o?.7:1,transition:"all 0.2s",display:"flex",alignItems:"center",gap:"8px"},children:[o&&n.jsx("span",{style:{display:"inline-block",width:"14px",height:"14px",border:"2px solid #ffffff",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 0.6s linear infinite"}}),n.jsx("span",{children:o?"Sending...":y==="success"?"✓ Sent!":"Send Feedback"})]})]})]}),n.jsx("style",{children:`
31
31
  @keyframes spin {
32
32
  to { transform: rotate(360deg); }
33
33
  }
@@ -41,5 +41,5 @@ React keys must be passed directly to JSX without using spread:
41
41
  transform: translateY(0);
42
42
  }
43
43
  }
44
- `})]})})};async function je(d,E,w){const c={"Content-Type":"application/json"};w&&(c.Authorization=`Bearer ${w}`);try{const p=await fetch(`${d}/api/feedback`,{method:"POST",headers:c,body:JSON.stringify(E)});if(!p.ok){const a=await p.json().catch(()=>({}));throw new Error(a.message||`HTTP ${p.status}: ${p.statusText}`)}return await p.json()}catch(p){throw p instanceof Error?p:new Error("Failed to submit feedback")}}const Je=(d,E=.12)=>{const w=/^#([0-9a-fA-F]{6})$/.exec(d);if(!w)return d;const c=parseInt(w[1],16),p=Math.max(0,Math.min(255,Math.round((c>>16&255)*(1-E)))),a=Math.max(0,Math.min(255,Math.round((c>>8&255)*(1-E)))),F=Math.max(0,Math.min(255,Math.round((c&255)*(1-E)))),h=b=>b.toString(16).padStart(2,"0");return`#${h(p)}${h(a)}${h(F)}`},Ke=({projectId:d,apiKey:E,apiUrl:w="https://metricshift-sdk-be-production.up.railway.app",buttonText:c="Feedback",showIcon:p=!1,position:a="bottom-right",size:F="medium",buttonColor:h,buttonHoverColor:b,buttonTextColor:C,customStyles:m,customClassName:R="",variant:T="outline",accentColor:L,disabled:k=!1,autoOpen:A=!1,onOpen:U,onClose:M,onSuccess:y,onError:K})=>{const[i,P]=g.useState(A),[oe,ie]=g.useState(!1),[ve,re]=g.useState(!1),se=()=>{k||(P(!0),U==null||U())},ge=()=>{P(!1),M==null||M()},le=async x=>{try{const Y={...x,project_id:d,page_url:window.location.href,page_title:document.title,user_agent:navigator.userAgent,user_identifier:x.userEmail||"anonymous",user_email:x.userEmail,user_name:x.userName,feedback_type:x.feedbackType},B=await je(w,Y,E);y&&(B!=null&&B.id)&&y(B.id)}catch(Y){throw K&&Y instanceof Error&&K(Y),Y}},D={small:{padding:"6px 14px",fontSize:"13px",iconSize:"14px"},medium:{padding:"10px 18px",fontSize:"15px",iconSize:"18px"},large:{padding:"14px 24px",fontSize:"17px",iconSize:"22px"}},z=()=>{if(a==="inline")return{display:"inline-flex",position:"relative"};const x={position:"fixed",zIndex:9999};return a.includes("bottom")?x.bottom="20px":x.top="20px",a.includes("right")?x.right="20px":x.left="20px",x},W=D[F],ce=z(),G=L??h??"#111827",$=a!=="inline"?"0 12px 30px rgba(15, 23, 42, 0.12)":"none";let N="#ffffff",X="#f3f4f6",V=C||G,H="rgba(15, 23, 42, 0.08)",Q=1;T==="solid"?(N=h||G,X=b||Je(N,.12),V=C||"#ffffff",H="transparent",Q=0):T==="ghost"&&(N="transparent",X="#f3f4f6",V=C||G,H="transparent",Q=0);const he={...ce,...{"--ms-feedback-bg":N,"--ms-feedback-color":V,"--ms-feedback-border":H,"--ms-feedback-radius":"9999px","--ms-feedback-shadow":$},padding:W.padding,backgroundColor:oe&&!k?X:N,color:V,border:Q?`1px solid ${H}`:"1px solid transparent",borderRadius:"9999px",fontSize:W.fontSize,fontWeight:600,cursor:k?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:ve?`${$}, 0 0 0 3px rgba(59,130,246,0.45)`:$,transition:"all 0.2s ease",opacity:k?.6:1,transform:oe&&!k?"translateY(-2px)":"translateY(0)",outline:"none",...m},ne={fontSize:W.iconSize,lineHeight:1,display:"flex",alignItems:"center"};return n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:se,onMouseEnter:()=>!k&&ie(!0),onMouseLeave:()=>!k&&ie(!1),onFocus:()=>re(!0),onBlur:()=>re(!1),disabled:k,className:`ms-feedback-button ${R}`.trim(),style:he,"aria-label":"Open feedback form","aria-pressed":i,"aria-disabled":k,role:"button",tabIndex:k?-1:0,onKeyDown:x=>{!k&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),se())},children:[p&&n.jsx("span",{style:ne,"aria-hidden":"true",children:"💬"}),n.jsx("span",{children:c})]}),n.jsx(_e,{isOpen:i,onClose:ge,onSubmit:le})]})},we=g.createContext(null),Ge=()=>{const d=g.useContext(we);if(!d)throw new Error("useMetricShift must be used within MetricShiftProvider");return d},$e=({config:d,children:E})=>n.jsx(we.Provider,{value:d,children:E});let be=null;const Xe={init:d=>{be={apiUrl:"http://localhost:3000",...d},console.log("✅ MetricShift SDK initialized",{projectId:d.projectId,apiUrl:be.apiUrl})},getConfig:()=>be};O.FeedbackButton=Ke,O.FeedbackModal=_e,O.MetricShift=Xe,O.MetricShiftProvider=$e,O.submitFeedback=je,O.useMetricShift=Ge,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
44
+ `})]})})};async function Ae(p,S,T){const c={"Content-Type":"application/json"};T&&(c.Authorization=`Bearer ${T}`);try{const b=await fetch(`${p}/api/feedback`,{method:"POST",headers:c,body:JSON.stringify(S)});if(!b.ok){const o=await b.json().catch(()=>({}));throw new Error(o.message||`HTTP ${b.status}: ${b.statusText}`)}return await b.json()}catch(b){throw b instanceof Error?b:new Error("Failed to submit feedback")}}const Ze=(p,S=.12)=>{const T=/^#([0-9a-fA-F]{6})$/.exec(p);if(!T)return p;const c=parseInt(T[1],16),b=Math.max(0,Math.min(255,Math.round((c>>16&255)*(1-S)))),o=Math.max(0,Math.min(255,Math.round((c>>8&255)*(1-S)))),j=Math.max(0,Math.min(255,Math.round((c&255)*(1-S)))),y=h=>h.toString(16).padStart(2,"0");return`#${y(b)}${y(o)}${y(j)}`},qe=({projectId:p,apiKey:S,apiUrl:T="https://metricshift-sdk-be-production.up.railway.app",buttonText:c="Feedback",subtitleText:b,showIcon:o=!1,avatarSrc:j,avatarAlt:y,avatarSize:h=40,position:_="bottom-right",size:g="medium",buttonColor:k,buttonHoverColor:O,buttonTextColor:M,customStyles:N,customClassName:W="",variant:K="outline",accentColor:A,disabled:f=!1,autoOpen:ae=!1,onOpen:i,onClose:w,onSuccess:ue,onError:fe})=>{const[de,oe]=x.useState(ae),[pe,be]=x.useState(!1),[he,I]=x.useState(!1),D=()=>{f||(oe(!0),i==null||i())},U=()=>{oe(!1),w==null||w()},ge=async E=>{try{const z={...E,project_id:p,page_url:window.location.href,page_title:document.title,user_agent:navigator.userAgent,user_identifier:E.userEmail||"anonymous",user_email:E.userEmail,user_name:E.userName,feedback_type:E.feedbackType},q=await Ae(T,z,S);ue&&(q!=null&&q.id)&&ue(q.id)}catch(z){throw fe&&z instanceof Error&&fe(z),z}},ve={small:{padding:"6px 14px",fontSize:"13px",iconSize:"14px"},medium:{padding:"10px 18px",fontSize:"15px",iconSize:"18px"},large:{padding:"14px 24px",fontSize:"17px",iconSize:"22px"}},ie=!!j,xe=()=>{if(_==="inline")return{position:"relative"};const E={position:"fixed",zIndex:9999};return _.includes("bottom")?E.bottom="20px":E.top="20px",_.includes("right")?E.right="20px":E.left="20px",E},G=ve[g],ye=xe(),$=A??k??"#111827",X=_!=="inline"?"0 12px 30px rgba(15, 23, 42, 0.12)":"none";let V="#ffffff",se="#f3f4f6",Y=M||$,B="rgba(15, 23, 42, 0.08)",L=1;K==="solid"?(V=k||$,se=O||Ze(V,.12),Y=M||"#ffffff",B="transparent",L=0):K==="ghost"&&(V="transparent",se="#f3f4f6",Y=M||$,B="transparent",L=0);const le={"--ms-feedback-bg":V,"--ms-feedback-color":Y,"--ms-feedback-border":B,"--ms-feedback-radius":"9999px","--ms-feedback-shadow":X},je=ie?{small:"8px 14px",medium:"12px 18px",large:"16px 24px"}[g]:G.padding,me={...le,padding:je,backgroundColor:pe&&!f?se:V,color:Y,border:L?`1px solid ${B}`:"1px solid transparent",borderRadius:"9999px",fontSize:G.fontSize,fontWeight:600,cursor:f?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",boxShadow:he?`${X}, 0 0 0 3px rgba(59,130,246,0.45)`:X,transition:"all 0.2s ease",opacity:f?.6:1,transform:pe&&!f?"translateY(-2px)":"translateY(0)",outline:"none",position:"relative",...N},_e={fontSize:G.iconSize,lineHeight:1,display:"flex",alignItems:"center"},we={display:"flex",flexDirection:"column",alignItems:"flex-start",lineHeight:1.2},Q={fontWeight:600,fontSize:"inherit"},H={marginTop:"2px",fontWeight:400,fontSize:"12px",opacity:.9},Se={...ye,display:"inline-flex",alignItems:"center",justifyContent:"center"},Ee={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -75%)",width:h,height:h,borderRadius:"9999px",overflow:"hidden",boxShadow:"0 8px 22px rgba(15,23,42,0.22)",border:"2px solid #ffffff",backgroundColor:"#e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,pointerEvents:"none"},Z={width:"100%",height:"100%",objectFit:"cover"};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:Se,children:[ie&&n.jsx("div",{style:Ee,"aria-hidden":y?void 0:!0,children:j&&n.jsx("img",{src:j,alt:y||"",style:Z})}),n.jsxs("button",{onClick:D,onMouseEnter:()=>!f&&be(!0),onMouseLeave:()=>!f&&be(!1),onFocus:()=>I(!0),onBlur:()=>I(!1),disabled:f,className:`ms-feedback-button ${W}`.trim(),style:me,"aria-label":"Open feedback form","aria-pressed":de,"aria-disabled":f,role:"button",tabIndex:f?-1:0,onKeyDown:E=>{!f&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),D())},children:[o&&n.jsx("span",{style:_e,"aria-hidden":"true",children:"💬"}),n.jsxs("div",{style:we,children:[n.jsx("span",{style:Q,children:c}),b&&n.jsx("span",{style:H,children:b})]})]})]}),n.jsx(Me,{isOpen:de,onClose:U,onSubmit:ge})]})},De=x.createContext(null),et=()=>{const p=x.useContext(De);if(!p)throw new Error("useMetricShift must be used within MetricShiftProvider");return p},tt=({config:p,children:S})=>n.jsx(De.Provider,{value:p,children:S});let Re=null;const rt={init:p=>{Re={apiUrl:"http://localhost:3000",...p},console.log("✅ MetricShift SDK initialized",{projectId:p.projectId,apiUrl:Re.apiUrl})},getConfig:()=>Re};P.FeedbackButton=qe,P.FeedbackModal=Me,P.MetricShift=rt,P.MetricShiftProvider=tt,P.submitFeedback=Ae,P.useMetricShift=et,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
45
45
  //# sourceMappingURL=index.umd.js.map