myquizbot-react 1.0.4 → 1.0.5

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.
@@ -1,11 +1,19 @@
1
- (function(G,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(G=typeof globalThis<"u"?globalThis:G||self,P(G.MyQuizBot={},G.React))})(this,(function(G,P){"use strict";var he={exports:{}},ae={};var Ie;function Nt(){if(Ie)return ae;Ie=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var ce={};var Be;function _t(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===M?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case R:return"Profiler";case j:return"StrictMode";case N:return"Suspense";case D:return"SuspenseList";case V:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case g:return"Portal";case T:return l.displayName||"Context";case A:return(l._context.displayName||"Context")+".Consumer";case _:var x=l.render;return l=l.displayName,l||(l=x.displayName||x.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case K:return x=l.displayName||null,x!==null?x:e(l.type)||"Memo";case W:x=l._payload,l=l._init;try{return e(l(x))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var x=!1}catch{x=!0}if(x){x=console;var F=x.error,U=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return F.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",U),t(l)}}function r(l){if(l===h)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===W)return"<...>";try{var x=e(l);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var l=L.A;return l===null?null:l.getOwner()}function o(){return Error("react-stack-top-frame")}function i(l){if(B.call(l,"key")){var x=Object.getOwnPropertyDescriptor(l,"key").get;if(x&&x.isReactWarning)return!1}return l.key!==void 0}function c(l,x){function F(){y||(y=!0,console.error("%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://react.dev/link/special-props)",x))}F.isReactWarning=!0,Object.defineProperty(l,"key",{get:F,configurable:!0})}function p(){var l=e(this.type);return O[l]||(O[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function d(l,x,F,U,ne,Ue){var q=F.ref;return l={$$typeof:f,type:l,key:x,props:F,_owner:U},(q!==void 0?q:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:p}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,x,F,U,ne,Ue){var q=x.children;if(q!==void 0)if(U)if(k(q)){for(U=0;U<q.length;U++)m(q[U]);Object.freeze&&Object.freeze(q)}else console.error("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 m(q);if(B.call(x,"key")){q=e(l);var ie=Object.keys(x).filter(function(sr){return sr!=="key"});U=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",X[q+U]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(ce,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],I):(ce=typeof globalThis<"u"?globalThis:ce||self,I(ce.MyQuizBot={},ce.React))})(this,(function(ce,I){"use strict";var _e={exports:{}},xe={};var lt;function pr(){if(lt)return xe;lt=1;var e=I,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function i(l,h,f){var u,m={},R=null,D=null;f!==void 0&&(R=""+f),h.key!==void 0&&(R=""+h.key),h.ref!==void 0&&(D=h.ref);for(u in h)n.call(h,u)&&!a.hasOwnProperty(u)&&(m[u]=h[u]);if(l&&l.defaultProps)for(u in h=l.defaultProps,h)m[u]===void 0&&(m[u]=h[u]);return{$$typeof:t,type:l,key:R,ref:D,props:m,_owner:s.current}}return xe.Fragment=r,xe.jsx=i,xe.jsxs=i,xe}var Ee={};var ut;function hr(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&(function(){var e=I,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),d=Symbol.iterator,x="@@iterator";function y(o){if(o===null||typeof o!="object")return null;var p=d&&o[d]||o[x];return typeof p=="function"?p:null}var j=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(o){{for(var p=arguments.length,b=new Array(p>1?p-1:0),v=1;v<p;v++)b[v-1]=arguments[v];A("error",o,b)}}function A(o,p,b){{var v=j.ReactDebugCurrentFrame,U=v.getStackAddendum();U!==""&&(p+="%s",b=b.concat([U]));var M=b.map(function(P){return String(P)});M.unshift("Warning: "+p),Function.prototype.apply.call(console[o],console,M)}}var O=!1,k=!1,C=!1,z=!1,oe=!1,Z;Z=Symbol.for("react.module.reference");function ee(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===a||oe||o===s||o===f||o===u||z||o===D||O||k||C||typeof o=="object"&&o!==null&&(o.$$typeof===R||o.$$typeof===m||o.$$typeof===i||o.$$typeof===l||o.$$typeof===h||o.$$typeof===Z||o.getModuleId!==void 0))}function J(o,p,b){var v=o.displayName;if(v)return v;var U=p.displayName||p.name||"";return U!==""?b+"("+U+")":b}function H(o){return o.displayName||"Context"}function L(o){if(o==null)return null;if(typeof o.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case u:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case l:var p=o;return H(p)+".Consumer";case i:var b=o;return H(b._context)+".Provider";case h:return J(o,o.render,"ForwardRef");case m:var v=o.displayName||null;return v!==null?v:L(o.type)||"Memo";case R:{var U=o,M=U._payload,P=U._init;try{return L(P(M))}catch{return null}}}return null}var F=Object.assign,g=0,w,_,B,$,ie,te,ae;function ye(){}ye.__reactDisabledLog=!0;function be(){{if(g===0){w=console.log,_=console.info,B=console.warn,$=console.error,ie=console.group,te=console.groupCollapsed,ae=console.groupEnd;var o={configurable:!0,enumerable:!0,value:ye,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}g++}}function Be(){{if(g--,g===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},o,{value:w}),info:F({},o,{value:_}),warn:F({},o,{value:B}),error:F({},o,{value:$}),group:F({},o,{value:ie}),groupCollapsed:F({},o,{value:te}),groupEnd:F({},o,{value:ae})})}g<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var tt=j.ReactCurrentDispatcher,rt;function Me(o,p,b){{if(rt===void 0)try{throw Error()}catch(U){var v=U.stack.trim().match(/\n( *(at )?)/);rt=v&&v[1]||""}return`
2
+ `+rt+o}}var nt=!1,ze;{var Jn=typeof WeakMap=="function"?WeakMap:Map;ze=new Jn}function Xt(o,p){if(!o||nt)return"";{var b=ze.get(o);if(b!==void 0)return b}var v;nt=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var M;M=tt.current,tt.current=null,be();try{if(p){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(G){v=G}Reflect.construct(o,[],P)}else{try{P.call()}catch(G){v=G}o.call(P.prototype)}}else{try{throw Error()}catch(G){v=G}o()}}catch(G){if(G&&v&&typeof G.stack=="string"){for(var N=G.stack.split(`
3
+ `),Y=v.stack.split(`
4
+ `),W=N.length-1,V=Y.length-1;W>=1&&V>=0&&N[W]!==Y[V];)V--;for(;W>=1&&V>=0;W--,V--)if(N[W]!==Y[V]){if(W!==1||V!==1)do if(W--,V--,V<0||N[W]!==Y[V]){var re=`
5
+ `+N[W].replace(" at new "," at ");return o.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",o.displayName)),typeof o=="function"&&ze.set(o,re),re}while(W>=1&&V>=0);break}}}finally{nt=!1,tt.current=M,Be(),Error.prepareStackTrace=U}var we=o?o.displayName||o.name:"",de=we?Me(we):"";return typeof o=="function"&&ze.set(o,de),de}function Wn(o,p,b){return Xt(o,!1)}function Vn(o){var p=o.prototype;return!!(p&&p.isReactComponent)}function qe(o,p,b){if(o==null)return"";if(typeof o=="function")return Xt(o,Vn(o));if(typeof o=="string")return Me(o);switch(o){case f:return Me("Suspense");case u:return Me("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case h:return Wn(o.render);case m:return qe(o.type,p,b);case R:{var v=o,U=v._payload,M=v._init;try{return qe(M(U),p,b)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,Gt={},Zt=j.ReactDebugCurrentFrame;function He(o){if(o){var p=o._owner,b=qe(o.type,o._source,p?p.type:null);Zt.setExtraStackFrame(b)}else Zt.setExtraStackFrame(null)}function $n(o,p,b,v,U){{var M=Function.call.bind(Ae);for(var P in o)if(M(o,P)){var N=void 0;try{if(typeof o[P]!="function"){var Y=Error((v||"React class")+": "+b+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}N=o[P](p,P,v,b,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(W){N=W}N&&!(N instanceof Error)&&(He(U),S("%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).",v||"React class",b,P,typeof N),He(null)),N instanceof Error&&!(N.message in Gt)&&(Gt[N.message]=!0,He(U),S("Failed %s type: %s",b,N.message),He(null))}}}var Kn=Array.isArray;function st(o){return Kn(o)}function Yn(o){{var p=typeof Symbol=="function"&&Symbol.toStringTag,b=p&&o[Symbol.toStringTag]||o.constructor.name||"Object";return b}}function Qn(o){try{return er(o),!1}catch{return!0}}function er(o){return""+o}function tr(o){if(Qn(o))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Yn(o)),er(o)}var rr=j.ReactCurrentOwner,Xn={key:!0,ref:!0,__self:!0,__source:!0},nr,sr;function Gn(o){if(Ae.call(o,"ref")){var p=Object.getOwnPropertyDescriptor(o,"ref").get;if(p&&p.isReactWarning)return!1}return o.ref!==void 0}function Zn(o){if(Ae.call(o,"key")){var p=Object.getOwnPropertyDescriptor(o,"key").get;if(p&&p.isReactWarning)return!1}return o.key!==void 0}function es(o,p){typeof o.ref=="string"&&rr.current}function ts(o,p){{var b=function(){nr||(nr=!0,S("%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)",p))};b.isReactWarning=!0,Object.defineProperty(o,"key",{get:b,configurable:!0})}}function rs(o,p){{var b=function(){sr||(sr=!0,S("%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)",p))};b.isReactWarning=!0,Object.defineProperty(o,"ref",{get:b,configurable:!0})}}var ns=function(o,p,b,v,U,M,P){var N={$$typeof:t,type:o,key:p,ref:b,props:P,_owner:M};return N._store={},Object.defineProperty(N._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(N,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(N,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(N.props),Object.freeze(N)),N};function ss(o,p,b,v,U){{var M,P={},N=null,Y=null;b!==void 0&&(tr(b),N=""+b),Zn(p)&&(tr(p.key),N=""+p.key),Gn(p)&&(Y=p.ref,es(p,U));for(M in p)Ae.call(p,M)&&!Xn.hasOwnProperty(M)&&(P[M]=p[M]);if(o&&o.defaultProps){var W=o.defaultProps;for(M in W)P[M]===void 0&&(P[M]=W[M])}if(N||Y){var V=typeof o=="function"?o.displayName||o.name||"Unknown":o;N&&ts(P,V),Y&&rs(P,V)}return ns(o,N,Y,U,v,rr.current,P)}}var ot=j.ReactCurrentOwner,or=j.ReactDebugCurrentFrame;function ge(o){if(o){var p=o._owner,b=qe(o.type,o._source,p?p.type:null);or.setExtraStackFrame(b)}else or.setExtraStackFrame(null)}var it;it=!1;function at(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function ir(){{if(ot.current){var o=L(ot.current.type);if(o)return`
6
+
7
+ Check the render method of \``+o+"`."}return""}}function os(o){return""}var ar={};function is(o){{var p=ir();if(!p){var b=typeof o=="string"?o:o.displayName||o.name;b&&(p=`
8
+
9
+ Check the top-level render call using <`+b+">.")}return p}}function cr(o,p){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var b=is(p);if(ar[b])return;ar[b]=!0;var v="";o&&o._owner&&o._owner!==ot.current&&(v=" It was passed a child from "+L(o._owner.type)+"."),ge(o),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,v),ge(null)}}function lr(o,p){{if(typeof o!="object")return;if(st(o))for(var b=0;b<o.length;b++){var v=o[b];at(v)&&cr(v,p)}else if(at(o))o._store&&(o._store.validated=!0);else if(o){var U=y(o);if(typeof U=="function"&&U!==o.entries)for(var M=U.call(o),P;!(P=M.next()).done;)at(P.value)&&cr(P.value,p)}}}function as(o){{var p=o.type;if(p==null||typeof p=="string")return;var b;if(typeof p=="function")b=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===h||p.$$typeof===m))b=p.propTypes;else return;if(b){var v=L(p);$n(b,o.props,"prop",v,o)}else if(p.PropTypes!==void 0&&!it){it=!0;var U=L(p);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cs(o){{for(var p=Object.keys(o.props),b=0;b<p.length;b++){var v=p[b];if(v!=="children"&&v!=="key"){ge(o),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),ge(null);break}}o.ref!==null&&(ge(o),S("Invalid attribute `ref` supplied to `React.Fragment`."),ge(null))}}var ur={};function fr(o,p,b,v,U,M){{var P=ee(o);if(!P){var N="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(N+=" 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 Y=os();Y?N+=Y:N+=ir();var W;o===null?W="null":st(o)?W="array":o!==void 0&&o.$$typeof===t?(W="<"+(L(o.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):W=typeof o,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,N)}var V=ss(o,p,b,U,M);if(V==null)return V;if(P){var re=p.children;if(re!==void 0)if(v)if(st(re)){for(var we=0;we<re.length;we++)lr(re[we],o);Object.freeze&&Object.freeze(re)}else S("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 lr(re,o)}if(Ae.call(p,"key")){var de=L(o),G=Object.keys(p).filter(function(hs){return hs!=="key"}),ct=G.length>0?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}";if(!ur[de+ct]){var ps=G.length>0?"{"+G.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
2
10
  let props = %s;
3
11
  <%s {...props} />
4
12
  React keys must be passed directly to JSX without using spread:
5
13
  let props = %s;
6
- <%s key={someKey} {...props} />`,U,q,ie,q),X[q+U]=!0)}if(q=null,F!==void 0&&(n(F),q=""+F),i(x)&&(n(x.key),q=""+x.key),"key"in x){F={};for(var Le in x)Le!=="key"&&(F[Le]=x[Le])}else F=x;return q&&c(F,typeof l=="function"?l.displayName||l.name||"Unknown":l),d(l,q,F,s(),ne,Ue)}function m(l){S(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===W&&(l._payload.status==="fulfilled"?S(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function S(l){return typeof l=="object"&&l!==null&&l.$$typeof===f}var C=P,f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),L=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,k=Array.isArray,b=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(l){return l()}};var y,O={},v=C.react_stack_bottom_frame.bind(C,o)(),z=b(r(o)),X={};ce.Fragment=h,ce.jsx=function(l,x,F){var U=1e4>L.recentlyCreatedOwnerStacks++;return u(l,x,F,!1,U?Error("react-stack-top-frame"):v,U?b(r(l)):z)},ce.jsxs=function(l,x,F){var U=1e4>L.recentlyCreatedOwnerStacks++;return u(l,x,F,!0,U?Error("react-stack-top-frame"):v,U?b(r(l)):z)}})()),ce}var Me;function Ct(){return Me||(Me=1,process.env.NODE_ENV==="production"?he.exports=Nt():he.exports=_t()),he.exports}var w=Ct();function ze(e,t){return function(){return e.apply(t,arguments)}}const{toString:jt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:me,toStringTag:qe}=Symbol,be=(e=>t=>{const n=jt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Q=e=>(e=e.toLowerCase(),t=>be(t)===e),ye=e=>t=>typeof t===e,{isArray:re}=Array,se=ye("undefined");function le(e){return e!==null&&!se(e)&&e.constructor!==null&&!se(e.constructor)&&J(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const He=Q("ArrayBuffer");function vt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&He(e.buffer),t}const Pt=ye("string"),J=ye("function"),Je=ye("number"),ue=e=>e!==null&&typeof e=="object",kt=e=>e===!0||e===!1,ge=e=>{if(be(e)!=="object")return!1;const t=Ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(qe in e)&&!(me in e)},Ft=e=>{if(!ue(e)||le(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Dt=Q("Date"),Ut=Q("File"),Lt=Q("Blob"),It=Q("FileList"),Bt=e=>ue(e)&&J(e.pipe),Mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||J(e.append)&&((t=be(e))==="formdata"||t==="object"&&J(e.toString)&&e.toString()==="[object FormData]"))},zt=Q("URLSearchParams"),[qt,Ht,Jt,$t]=["ReadableStream","Request","Response","Headers"].map(Q),Wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function de(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),re(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(le(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function $e(e,t){if(le(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,We=e=>!se(e)&&e!==Z;function Oe(){const{caseless:e,skipUndefined:t}=We(this)&&this||{},n={},r=(s,o)=>{const i=e&&$e(n,o)||o;ge(n[i])&&ge(s)?n[i]=Oe(n[i],s):ge(s)?n[i]=Oe({},s):re(s)?n[i]=s.slice():(!t||!se(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&de(arguments[s],r);return n}const Vt=(e,t,n,{allOwnKeys:r}={})=>(de(t,(s,o)=>{n&&J(s)?e[o]=ze(s,n):e[o]=s},{allOwnKeys:r}),e),Qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Yt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Kt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Ae(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Gt=e=>{if(!e)return null;if(re(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Zt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ae(Uint8Array)),en=(e,t)=>{const r=(e&&e[me]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},tn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nn=Q("HTMLFormElement"),rn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),sn=Q("RegExp"),Qe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};de(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},on=e=>{Qe(e,(t,n)=>{if(J(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(J(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},an=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return re(e)?r(e):r(String(e).split(t)),n},cn=()=>{},ln=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function un(e){return!!(e&&J(e.append)&&e[qe]==="FormData"&&e[me])}const dn=e=>{const t=new Array(10),n=(r,s)=>{if(ue(r)){if(t.indexOf(r)>=0)return;if(le(r))return r;if(!("toJSON"in r)){t[s]=r;const o=re(r)?[]:{};return de(r,(i,c)=>{const p=n(i,s+1);!se(p)&&(o[c]=p)}),t[s]=void 0,o}}return r};return n(e,0)},fn=Q("AsyncFunction"),pn=e=>e&&(ue(e)||J(e))&&J(e.then)&&J(e.catch),Ye=((e,t)=>e?setImmediate:t?((n,r)=>(Z.addEventListener("message",({source:s,data:o})=>{s===Z&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Z.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",J(Z.postMessage)),hn=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||Ye,a={isArray:re,isArrayBuffer:He,isBuffer:le,isFormData:Mt,isArrayBufferView:vt,isString:Pt,isNumber:Je,isBoolean:kt,isObject:ue,isPlainObject:ge,isEmptyObject:Ft,isReadableStream:qt,isRequest:Ht,isResponse:Jt,isHeaders:$t,isUndefined:se,isDate:Dt,isFile:Ut,isBlob:Lt,isRegExp:sn,isFunction:J,isStream:Bt,isURLSearchParams:zt,isTypedArray:Zt,isFileList:It,forEach:de,merge:Oe,extend:Vt,trim:Wt,stripBOM:Qt,inherits:Yt,toFlatObject:Kt,kindOf:be,kindOfTest:Q,endsWith:Xt,toArray:Gt,forEachEntry:en,matchAll:tn,isHTMLForm:nn,hasOwnProperty:Ve,hasOwnProp:Ve,reduceDescriptors:Qe,freezeMethods:on,toObjectSet:an,toCamelCase:rn,noop:cn,toFiniteNumber:ln,findKey:$e,global:Z,isContextDefined:We,isSpecCompliantForm:un,toJSONObject:dn,isAsyncFn:fn,isThenable:pn,setImmediate:Ye,asap:hn,isIterable:e=>e!=null&&J(e[me])};function E(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(E,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ke=E.prototype,Xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Xe[e]={value:e}}),Object.defineProperties(E,Xe),Object.defineProperty(Ke,"isAxiosError",{value:!0}),E.from=(e,t,n,r,s,o)=>{const i=Object.create(Ke);a.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return E.call(i,c,p,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const mn=null;function Ne(e){return a.isPlainObject(e)||a.isArray(e)}function Ge(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ze(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ge(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function bn(e){return a.isArray(e)&&!e.some(Ne)}const yn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function we(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function d(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!p&&a.isBlob(f))throw new E("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,g,h){let j=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&bn(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(j=a.toArray(f)))return g=Ge(g),j.forEach(function(A,T){!(a.isUndefined(A)||A===null)&&t.append(i===!0?Ze([g],T,o):i===null?g:g+"[]",d(A))}),!1}return Ne(f)?!0:(t.append(Ze(h,g,o),d(f)),!1)}const m=[],S=Object.assign(yn,{defaultVisitor:u,convertValue:d,isVisitable:Ne});function C(f,g){if(!a.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));m.push(f),a.forEach(f,function(j,R){(!(a.isUndefined(j)||j===null)&&s.call(t,j,a.isString(R)?R.trim():R,g,S))===!0&&C(j,g?g.concat(R):[R])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return C(e),t}function et(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _e(e,t){this._pairs=[],e&&we(e,this,t)}const tt=_e.prototype;tt.append=function(t,n){this._pairs.push([t,n])},tt.toString=function(t){const n=t?function(r){return t.call(this,r,et)}:et;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function gn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,n){if(!t)return e;const r=n&&n.encode||gn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new _e(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class rt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const st={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:_e,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",je=typeof navigator=="object"&&navigator||void 0,xn=Ce&&(!je||["ReactNative","NativeScript","NS"].indexOf(je.product)<0),En=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sn=Ce&&window.location.href||"http://localhost",H={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:xn,hasStandardBrowserWebWorkerEnv:En,navigator:je,origin:Sn},Symbol.toStringTag,{value:"Module"})),...wn};function Rn(e,t){return we(e,new H.classes.URLSearchParams,{visitor:function(n,r,s,o){return H.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Tn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function An(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function ot(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),p=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,p?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=An(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Tn(r),s,n,0)}),n}return null}function On(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const fe={transitional:st,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(ot(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return we(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),On(t)):t}],transformResponse:[function(t){const n=this.transitional||fe.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?E.from(c,E.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:H.classes.FormData,Blob:H.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{fe.headers[e]={}});const Nn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_n=e=>{const t={};let n,r,s;return e&&e.split(`
7
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Nn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},it=Symbol("internals");function pe(e){return e&&String(e).trim().toLowerCase()}function xe(e){return e===!1||e==null?e:a.isArray(e)?e.map(xe):String(e)}function Cn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const jn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ve(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function vn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Pn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,p,d){const u=pe(p);if(!u)throw new Error("header name must be a non-empty string");const m=a.findKey(s,u);(!m||s[m]===void 0||d===!0||d===void 0&&s[m]!==!1)&&(s[m||p]=xe(c))}const i=(c,p)=>a.forEach(c,(d,u)=>o(d,u,p));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!jn(t))i(_n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,d;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[d=u[0]]=(p=c[d])?a.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=pe(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Cn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=pe(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ve(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=pe(i),i){const c=a.findKey(r,i);c&&(!n||ve(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ve(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=xe(s),delete n[o];return}const c=t?vn(o):String(o).trim();c!==o&&delete n[o],n[c]=xe(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
8
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[it]=this[it]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=pe(i);r[c]||(Pn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors($.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods($);function Pe(e,t){const n=this||fe,r=t||n,s=$.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function at(e){return!!(e&&e.__CANCEL__)}function oe(e,t,n){E.call(this,e??"canceled",E.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(oe,E,{__CANCEL__:!0});function ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new E("Request failed with status code "+n.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Fn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const d=Date.now(),u=r[o];i||(i=d),n[s]=p,r[s]=d;let m=o,S=0;for(;m!==s;)S+=n[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-i<t)return;const C=u&&d-u;return C?Math.round(S*1e3/C):void 0}}function Dn(e,t){let n=0,r=1e3/t,s,o;const i=(d,u=Date.now())=>{n=u,s=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const u=Date.now(),m=u-n;m>=r?i(d,u):(s=d,o||(o=setTimeout(()=>{o=null,i(s)},r-m)))},()=>s&&i(s)]}const Ee=(e,t,n=3)=>{let r=0;const s=Fn(50,250);return Dn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,p=i-r,d=s(p),u=i<=c;r=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:p,rate:d||void 0,estimated:d&&c&&u?(c-i)/d:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},lt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ut=e=>(...t)=>a.asap(()=>e(...t)),Un=H.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,H.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(H.origin),H.navigator&&/(msie|trident)/i.test(H.navigator.userAgent)):()=>!0,Ln=H.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function In(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Bn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dt(e,t,n){let r=!In(t);return e&&(r||n==!1)?Bn(e,t):t}const ft=e=>e instanceof $?{...e}:e;function ee(e,t){t=t||{};const n={};function r(d,u,m,S){return a.isPlainObject(d)&&a.isPlainObject(u)?a.merge.call({caseless:S},d,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(d,u,m,S){if(a.isUndefined(u)){if(!a.isUndefined(d))return r(void 0,d,m,S)}else return r(d,u,m,S)}function o(d,u){if(!a.isUndefined(u))return r(void 0,u)}function i(d,u){if(a.isUndefined(u)){if(!a.isUndefined(d))return r(void 0,d)}else return r(void 0,u)}function c(d,u,m){if(m in t)return r(d,u);if(m in e)return r(void 0,d)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,u,m)=>s(ft(d),ft(u),m,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const m=p[u]||s,S=m(e[u],t[u],u);a.isUndefined(S)&&m!==c||(n[u]=S)}),n}const pt=e=>{const t=ee({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=$.from(i),t.url=nt(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(H.hasStandardBrowserEnv||H.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),d=["content-type","content-length"];Object.entries(p).forEach(([u,m])=>{d.includes(u.toLowerCase())&&i.set(u,m)})}}if(H.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Un(t.url))){const p=s&&o&&Ln.read(o);p&&i.set(s,p)}return t},Mn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=pt(e);let o=s.data;const i=$.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:d}=s,u,m,S,C,f;function g(){C&&C(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function j(){if(!h)return;const A=$.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),_={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:A,config:e,request:h};ct(function(D){n(D),g()},function(D){r(D),g()},_),h=null}"onloadend"in h?h.onloadend=j:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(j)},h.onabort=function(){h&&(r(new E("Request aborted",E.ECONNABORTED,e,h)),h=null)},h.onerror=function(T){const _=T&&T.message?T.message:"Network Error",N=new E(_,E.ERR_NETWORK,e,h);N.event=T||null,r(N),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||st;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new E(T,_.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(T,_){h.setRequestHeader(_,T)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),d&&([S,f]=Ee(d,!0),h.addEventListener("progress",S)),p&&h.upload&&([m,C]=Ee(p),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(u=A=>{h&&(r(!A||A.type?new oe(null,e,h):A),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const R=kn(s.url);if(R&&H.protocols.indexOf(R)===-1){r(new E("Unsupported protocol "+R+":",E.ERR_BAD_REQUEST,e));return}h.send(o||null)})},zn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(d){if(!s){s=!0,c();const u=d instanceof Error?d:this.reason;r.abort(u instanceof E?u:new oe(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new E(`timeout ${t} of ms exceeded`,E.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},qn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Hn=async function*(e,t){for await(const n of Jn(e))yield*qn(n,t)},Jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ht=(e,t,n,r)=>{const s=Hn(e,t);let o=0,i,c=p=>{i||(i=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:d,value:u}=await s.next();if(d){c(),p.close();return}let m=u.byteLength;if(n){let S=o+=m;n(S)}p.enqueue(new Uint8Array(u))}catch(d){throw c(d),d}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},mt=64*1024,{isFunction:Se}=a,$n=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:bt,TextEncoder:yt}=a.global,gt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wn=e=>{e=a.merge.call({skipUndefined:!0},$n,e);const{fetch:t,Request:n,Response:r}=e,s=t?Se(t):typeof fetch=="function",o=Se(n),i=Se(r);if(!s)return!1;const c=s&&Se(bt),p=s&&(typeof yt=="function"?(f=>g=>f.encode(g))(new yt):async f=>new Uint8Array(await new n(f).arrayBuffer())),d=o&&c&&gt(()=>{let f=!1;const g=new n(H.origin,{body:new bt,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),u=i&&c&&gt(()=>a.isReadableStream(new r("").body)),m={stream:u&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(g,h)=>{let j=g&&g[f];if(j)return j.call(g);throw new E(`Response type '${f}' is not supported`,E.ERR_NOT_SUPPORT,h)})});const S=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(H.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await p(f)).byteLength},C=async(f,g)=>{const h=a.toFiniteNumber(f.getContentLength());return h??S(g)};return async f=>{let{url:g,method:h,data:j,signal:R,cancelToken:A,timeout:T,onDownloadProgress:_,onUploadProgress:N,responseType:D,headers:K,withCredentials:W="same-origin",fetchOptions:V}=pt(f),M=t||fetch;D=D?(D+"").toLowerCase():"text";let L=zn([R,A&&A.toAbortSignal()],T),B=null;const k=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let b;try{if(N&&d&&h!=="get"&&h!=="head"&&(b=await C(K,j))!==0){let l=new n(g,{method:"POST",body:j,duplex:"half"}),x;if(a.isFormData(j)&&(x=l.headers.get("content-type"))&&K.setContentType(x),l.body){const[F,U]=lt(b,Ee(ut(N)));j=ht(l.body,mt,F,U)}}a.isString(W)||(W=W?"include":"omit");const y=o&&"credentials"in n.prototype,O={...V,signal:L,method:h.toUpperCase(),headers:K.normalize().toJSON(),body:j,duplex:"half",credentials:y?W:void 0};B=o&&new n(g,O);let v=await(o?M(B,V):M(g,O));const z=u&&(D==="stream"||D==="response");if(u&&(_||z&&k)){const l={};["status","statusText","headers"].forEach(ne=>{l[ne]=v[ne]});const x=a.toFiniteNumber(v.headers.get("content-length")),[F,U]=_&&lt(x,Ee(ut(_),!0))||[];v=new r(ht(v.body,mt,F,()=>{U&&U(),k&&k()}),l)}D=D||"text";let X=await m[a.findKey(m,D)||"text"](v,f);return!z&&k&&k(),await new Promise((l,x)=>{ct(l,x,{data:X,headers:$.from(v.headers),status:v.status,statusText:v.statusText,config:f,request:B})})}catch(y){throw k&&k(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,f,B),{cause:y.cause||y}):E.from(y,y&&y.code,f,B)}}},Vn=new Map,wt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,p,d,u=Vn;for(;c--;)p=o[c],d=u.get(p),d===void 0&&u.set(p,d=c?new Map:Wn(t)),u=d;return d};wt();const ke={http:mn,xhr:Mn,fetch:{get:wt}};a.forEach(ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const xt=e=>`- ${e}`,Qn=e=>a.isFunction(e)||e===null||e===!1;function Yn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!Qn(r)&&(s=ke[(c=String(r)).toLowerCase()],s===void 0))throw new E(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,d])=>`adapter ${p} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
9
- `+i.map(xt).join(`
10
- `):" "+xt(i[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Et={getAdapter:Yn,adapters:ke};function Fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new oe(null,e)}function St(e){return Fe(e),e.headers=$.from(e.headers),e.data=Pe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Et.getAdapter(e.adapter||fe.adapter,e)(e).then(function(r){return Fe(e),r.data=Pe.call(e,e.transformResponse,r),r.headers=$.from(r.headers),r},function(r){return at(r)||(Fe(e),r&&r.response&&(r.response.data=Pe.call(e,e.transformResponse,r.response),r.response.headers=$.from(r.response.headers))),Promise.reject(r)})}const Rt="1.13.2",Re={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Re[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Tt={};Re.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Rt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new E(s(i," has been removed"+(n?" in "+n:"")),E.ERR_DEPRECATED);return n&&!Tt[i]&&(Tt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}},Re.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Kn(e,t,n){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],p=c===void 0||i(c,o,e);if(p!==!0)throw new E("option "+o+" must be "+p,E.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const Te={assertOptions:Kn,validators:Re},Y=Te.validators;let te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new rt,response:new rt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
11
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ee(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Te.assertOptions(r,{silentJSONParsing:Y.transitional(Y.boolean),forcedJSONParsing:Y.transitional(Y.boolean),clarifyTimeoutError:Y.transitional(Y.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Te.assertOptions(s,{encode:Y.function,serialize:Y.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Te.assertOptions(n,{baseUrl:Y.spelling("baseURL"),withXsrfToken:Y.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=$.concat(i,o);const c=[];let p=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(p=p&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let u,m=0,S;if(!p){const f=[St.bind(this),void 0];for(f.unshift(...c),f.push(...d),S=f.length,u=Promise.resolve(n);m<S;)u=u.then(f[m++],f[m++]);return u}S=c.length;let C=n;for(;m<S;){const f=c[m++],g=c[m++];try{C=f(C)}catch(h){g.call(this,h);break}}try{u=St.call(this,C)}catch(f){return Promise.reject(f)}for(m=0,S=d.length;m<S;)u=u.then(d[m++],d[m++]);return u}getUri(t){t=ee(this.defaults,t);const n=dt(t.baseURL,t.url,t.allowAbsoluteUrls);return nt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(n,r){return this.request(ee(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(ee(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}te.prototype[t]=n(),te.prototype[t+"Form"]=n(!0)});let Xn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new oe(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function Gn(e){return function(n){return e.apply(null,n)}}function Zn(e){return a.isObject(e)&&e.isAxiosError===!0}const De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(De).forEach(([e,t])=>{De[t]=e});function At(e){const t=new te(e),n=ze(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return At(ee(e,s))},n}const I=At(fe);I.Axios=te,I.CanceledError=oe,I.CancelToken=Xn,I.isCancel=at,I.VERSION=Rt,I.toFormData=we,I.AxiosError=E,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=Gn,I.isAxiosError=Zn,I.mergeConfig=ee,I.AxiosHeaders=$,I.formToJSON=e=>ot(a.isHTMLForm(e)?new FormData(e):e),I.getAdapter=Et.getAdapter,I.HttpStatusCode=De,I.default=I;const{Axios:dr,AxiosError:fr,CanceledError:pr,isCancel:hr,CancelToken:mr,VERSION:br,all:yr,Cancel:gr,isAxiosError:wr,spread:xr,toFormData:Er,AxiosHeaders:Sr,HttpStatusCode:Rr,formToJSON:Tr,getAdapter:Ar,mergeConfig:Or}=I;class er{client;constructor(t,n){this.client=I.create({baseURL:t||void 0||"http://localhost:8080",headers:{"Content-Type":"application/json"}}),n&&this.setApiKey(n)}setApiKey(t){this.client.defaults.headers.common.Authorization=`Bearer ${t}`}async getQuiz(t){try{const r=(await this.client.get("/core/quiz")).data,s=Array.isArray(r)?r.find(o=>o.id===t):null;if(!s)throw new Error(`Quiz with ID "${t}" not found`);return{id:s.id,name:s.name,renderMode:s.renderMode||"steps",nodes:s.nodes||[],edges:s.edges||[]}}catch(n){throw I.isAxiosError(n)?n.response?.status===401?new Error("Invalid API key. Please check your authentication credentials."):new Error(`Failed to fetch quiz: ${n.response?.data?.message||n.message}`):n}}async createSession(t){const n=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,r={sessionId:n,quizId:t,startedAt:Date.now(),answers:{}};return localStorage.setItem(`quiz_session_${n}`,JSON.stringify(r)),{sessionId:n}}async submitAnswer(t,n,r){try{const s=`quiz_session_${t}`,o=localStorage.getItem(s);if(!o)throw new Error("Session not found");const i=JSON.parse(o);i.answers[n]=r,localStorage.setItem(s,JSON.stringify(i))}catch(s){console.error("Failed to submit answer:",s)}}async completeSession(t){try{const n=`quiz_session_${t}`,r=localStorage.getItem(n);if(!r)throw new Error("Session not found");const s=JSON.parse(r);s.completedAt=Date.now(),s.status="completed",localStorage.setItem(n,JSON.stringify(s))}catch(n){console.error("Failed to complete session:",n)}}}const tr=({nodes:e,onAnswer:t,onProgress:n,onComplete:r})=>{const[s,o]=P.useState(0),[i,c]=P.useState({}),[p,d]=P.useState({});P.useEffect(()=>{n({currentStep:s+1,totalSteps:e.length,percentage:(s+1)/e.length*100}),d({})},[s,e.length,n]);const u=(R,A,T=!0)=>{c(_=>({..._,[A]:R})),t({questionId:A,answer:R,timestamp:Date.now()}),T&&C()},m=(R,A)=>{d(T=>({...T,[A]:R}))},S=R=>{(R.data.children||[]).forEach(T=>{const _=p[T.id];_!==void 0&&t({questionId:T.id,answer:_,timestamp:Date.now()})}),c(T=>({...T,...p})),C()},C=()=>{s<e.length-1?o(s+1):r()},f=()=>{s>0&&o(s-1)},g=(R,A=!1)=>{const T=R.data?.type||R.type,_=R.id;return w.jsxs("div",{className:`mb-6 ${A?"pl-4 border-l-2 border-gray-100":""}`,children:[w.jsxs("div",{className:"mb-4",children:[w.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2 leading-tight",children:R.data.label}),R.data.content&&w.jsx("p",{className:"text-gray-500 mb-6 leading-relaxed",children:R.data.content})]}),w.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[(T==="multiple-choice"||T==="multipleChoice")&&w.jsx("div",{className:"grid grid-cols-1 gap-3",children:R.data.options?.map((N,D)=>w.jsx("button",{className:`p-4 bg-gray-50 border-2 border-gray-200 rounded-lg text-left text-gray-800 cursor-pointer transition-all duration-200 hover:bg-gray-100 hover:border-indigo-500 hover:-translate-y-0.5 hover:shadow-md ${A&&p[_]===(N.value||N)?"border-indigo-500 bg-indigo-50":""}`,onClick:()=>A?m(N.value||N,_):u(N.value||N,_),children:N.label||N},D))}),(T==="input-text"||T==="input-email"||T==="input-phone"||T==="text")&&w.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[w.jsx("input",{className:"flex-1 p-4 border-2 border-gray-200 rounded-lg text-base transition-colors duration-200 focus:outline-none focus:border-indigo-500",type:T==="input-email"?"email":"text",placeholder:R.data.placeholder||"Type your answer...",value:A?p[_]||"":void 0,onChange:N=>A&&m(N.target.value,_),onKeyPress:N=>{!A&&N.key==="Enter"&&u(N.target.value,_)}}),!A&&w.jsx("button",{className:"px-8 py-4 bg-gradient-to-r from-indigo-500 to-purple-600 text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-lg",onClick:N=>{const D=N.currentTarget.previousElementSibling;u(D.value,_)},children:"Submit"})]})]})]},_)};if(e.length===0)return w.jsx("div",{className:"text-center py-16 px-4 text-gray-500 text-lg",children:"No questions available"});const h=e[s],j=h.type;return w.jsxs("div",{className:"max-w-[800px] mx-auto p-5 font-sans md:p-3",children:[w.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden mb-8",children:w.jsx("div",{className:"h-full bg-gradient-to-r from-indigo-500 to-purple-600 transition-[width] duration-300 ease-out",style:{width:`${(s+1)/e.length*100}%`}})}),w.jsxs("div",{className:"bg-white rounded-xl p-10 shadow-md md:p-6",children:[w.jsx("div",{className:"mb-5",children:w.jsxs("span",{className:"text-sm text-indigo-500 font-semibold uppercase tracking-wide",children:["Step ",s+1," of ",e.length]})}),j==="group"?w.jsxs("div",{className:"quiz-steps-group",children:[w.jsx("h2",{className:"text-2xl text-gray-800 mb-3 leading-tight font-semibold",children:h.data.label}),w.jsx("div",{className:"mt-6 space-y-4",children:h.data.children?.map(R=>g(R,!0))}),w.jsx("div",{className:"mt-8 flex justify-end",children:w.jsx("button",{className:"px-8 py-3 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg font-semibold hover:opacity-90 transition-opacity",onClick:()=>S(h),children:"Continue"})})]}):g(h),w.jsx("div",{className:"flex justify-start mt-6",children:s>0&&w.jsx("button",{className:"px-6 py-3 bg-transparent text-indigo-500 border-2 border-indigo-500 rounded-lg text-sm font-semibold cursor-pointer transition-all duration-200 hover:bg-indigo-500 hover:text-white",onClick:f,children:"Previous"})})]})]})},nr=({nodes:e,edges:t,onAnswer:n,onComplete:r,theme:s})=>{const[o,i]=P.useState([]),[c,p]=P.useState(null),[d,u]=P.useState([]),[m,S]=P.useState(null),[C,f]=P.useState(!1),g=P.useRef(null),h=P.useRef(!1),j=P.useRef(r);P.useEffect(()=>{j.current=r},[r]);const R=()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)};P.useEffect(()=>{R()},[o,C,m]),P.useEffect(()=>{if(h.current||e.length===0)return;const b=new Set(t.map(O=>O.target)),y=e.find(O=>!b.has(O.id))||e[0];y&&(h.current=!0,A(y.id))},[e,t]);const A=b=>{const y=e.find(O=>O.id===b);if(!y){console.error(`Node ${b} not found`);return}if(y.type==="group"){const O=y.data?.children||y.data||[],v=Array.isArray(O)?O:Array.isArray(y.data)?y.data:[];if(v.length>0){const z=[...d,{groupId:y.id,children:v,currentIndex:0}];u(z),T(v[0])}else D(y.id)}else p(y.id),_(y)},T=b=>{_(b)},_=b=>{S(b),f(!0);const y=V(b),O=Math.min(1e3,500+(y.content?.length||0)*20);setTimeout(()=>{f(!1);const v=y.content||y.label;v&&L("bot",v),M(b)&&setTimeout(()=>{N(null,b)},1500)},O)},N=(b,y,O)=>{const v=y.id||c||"unknown";if(b!==null&&n({questionId:v,answer:b,timestamp:Date.now()}),d.length>0){const z=d[d.length-1];if(z.currentIndex<z.children.length-1){const X=z.currentIndex+1,l={...z,currentIndex:X};u([...d.slice(0,-1),l]),T(z.children[X])}else{const X=z.groupId;u(d.slice(0,-1)),D(X,O)}}else{const z=y.id;D(z,O)}},D=(b,y)=>{const O=t.find(v=>v.source===b&&(!y||v.sourceHandle===y));O?A(O.target):K()},K=async()=>{f(!0),S(null),setTimeout(()=>{f(!1),L("bot","Obrigado! Suas respostas foram enviadas com sucesso."),setTimeout(()=>{j.current&&j.current()},2e3)},1e3)},W=(b,y,O)=>{if(!m)return;L("user",y||b);const v=m;S(null),N(b,v,O)},V=b=>{const y=b.data||b;return{id:b.id,label:y.label||b.label,content:y.content||b.content,type:y.type||b.type,placeholder:y.placeholder||b.placeholder,options:y.options||b.options}},M=b=>{const y=V(b),O=(y.type||"").toLowerCase();return O==="text"||O==="base"||O==="description"||O==="base"&&!y.type||O==="message"},L=(b,y)=>{i(O=>[...O,{id:Date.now().toString(),type:b,content:y,timestamp:Date.now()}])},B=m?V(m):null,k=B?.type;return w.jsxs("div",{className:"flex flex-col h-full rounded-xl overflow-hidden font-[Inter,sans-serif] relative",style:{backgroundColor:s?.backgroundColor||"#f5f7fa"},children:[w.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto p-5 flex flex-col gap-4",children:[o.map(b=>w.jsxs("div",{className:`flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] ${b.type==="bot"?"self-start":"self-end items-end"}`,children:[w.jsx("div",{className:`p-3 px-4 rounded-2xl text-[15px] leading-relaxed shadow-sm ${b.type==="bot"?"bg-white text-[#1a1a1a] rounded-tl-sm":"text-white rounded-tr-sm"}`,style:b.type==="user"?{backgroundColor:s?.primaryColor||"#007aff"}:{},children:b.content}),w.jsx("span",{className:`text-[11px] text-[#999] mt-1 ${b.type==="bot"?"ml-1":"mr-1"}`,children:new Date(b.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},b.id)),C&&w.jsx("div",{className:"flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] self-start",children:w.jsxs("div",{className:"flex gap-1 p-3 px-4 bg-white rounded-2xl rounded-tl-sm w-fit",children:[w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-1"}),w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-2"}),w.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce"})]})})]}),!C&&m&&!M(m)&&w.jsxs("div",{className:"p-4 bg-white border-t border-[#eee]",children:[(k==="multiple-choice"||k==="multipleChoice")&&w.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:B?.options?.map(b=>w.jsx("button",{onClick:()=>W(b.value||b.label,b.label,b.id),className:"px-5 py-2.5 bg-white border rounded-full cursor-pointer font-medium transition-all duration-200 hover:text-white",style:{borderColor:s?.primaryColor||"#007aff",color:s?.primaryColor||"#007aff"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor=s?.primaryColor||"#007aff",y.currentTarget.style.color="white"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="white",y.currentTarget.style.color=s?.primaryColor||"#007aff"},children:b.label||b.value||b},b.id||b.label))}),(k==="input-text"||k==="input-email"||k==="input-phone"||k==="text-input"||k==="text")&&w.jsx("div",{className:"w-full",children:w.jsxs("form",{className:"flex gap-2.5",onSubmit:b=>{b.preventDefault();const y=b.currentTarget.elements[0];y.value.trim()&&(W(y.value),y.value="")},children:[w.jsx("input",{type:k==="input-email"?"email":"text",placeholder:B?.placeholder||"Type your answer...",autoFocus:!0,className:"flex-1 p-3 border border-[#ddd] rounded-3xl outline-none text-[15px] focus:border-[var(--primary-color)]",style:{"--primary-color":s?.primaryColor||"#007aff"}}),w.jsx("button",{type:"submit",className:"px-6 text-white border-none rounded-3xl font-semibold cursor-pointer",style:{backgroundColor:s?.primaryColor||"#007aff"},children:"Enviar"})]})})]})]})},rr=({quizId:e,apiKey:t,mode:n="steps",baseUrl:r,onStart:s,onAnswer:o,onProgress:i,onComplete:c,onError:p,className:d,style:u,theme:m})=>{const[S,C]=P.useState(null),[f,g]=P.useState(!0),[h,j]=P.useState(null),[R,A]=P.useState(null),[T,_]=P.useState({}),N=P.useRef(null);P.useEffect(()=>{N.current=new er(r,t),(async()=>{try{g(!0),j(null);const L=await N.current.getQuiz(e);C(L);const B=await N.current.createSession(e);if(A(B.sessionId),s){const k={quizId:e,timestamp:Date.now()};s(k)}g(!1)}catch(L){const B=L instanceof Error?L.message:"Failed to load quiz";if(j(B),g(!1),p){const k={error:L instanceof Error?L:new Error(B),message:B,timestamp:Date.now()};p(k)}}})()},[e,t,r,s,p]);const D=async M=>{const L={...T,[M.questionId]:M.answer};if(_(L),o&&o(M),R&&N.current)try{await N.current.submitAnswer(R,M.questionId,M.answer)}catch(B){console.error("Failed to submit answer:",B)}},K=M=>{i&&i(M)},W=async()=>{if(R&&N.current)try{await N.current.completeSession(R)}catch(M){console.error("Failed to complete session:",M)}if(c){const M=(k,b)=>{for(const y of k){const O=y.data||y;if(y.id===b)return O.label||O.content||"Unknown Question";const v=O.children||(Array.isArray(O)?O:[]);if(v.length>0){const z=M(v,b);if(z!=="Unknown Question")return z}}return"Unknown Question"},L=Object.entries(T).map(([k,b])=>({question:M(S?.nodes||[],k),answer:b})),B={quizId:e,answers:T,result:L,timestamp:Date.now(),sessionId:R||void 0};c(B)}};if(f)return w.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${d||""}`,style:u,children:[w.jsx("div",{className:"w-12 h-12 border-4 border-gray-200 border-t-indigo-500 rounded-full animate-spin mb-5"}),w.jsx("p",{className:"text-gray-500",children:"Loading quiz..."})]});if(h)return w.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${d||""}`,style:u,children:[w.jsx("div",{className:"text-5xl mb-4",children:"⚠️"}),w.jsx("h3",{className:"text-red-600 text-2xl mb-3",children:"Failed to Load Quiz"}),w.jsx("p",{className:"text-gray-500 mx-auto max-w-[500px]",children:h})]});if(!S)return null;const V=n||S.renderMode||"steps";return w.jsxs("div",{className:`w-full min-h-[400px] ${d||""}`,style:u,children:[V==="steps"&&w.jsx(tr,{nodes:S.nodes,onAnswer:D,onProgress:K,onComplete:W}),V==="chat"&&w.jsx(nr,{nodes:S.nodes,edges:S.edges,onAnswer:D,onProgress:K,onComplete:W,theme:m}),V==="single"&&w.jsx("div",{className:"p-10 text-center text-gray-500",children:w.jsx("p",{children:"Single mode not yet implemented"})}),V==="flow"&&w.jsx("div",{className:"p-10 text-center text-gray-500",children:w.jsx("p",{children:"Flow mode not yet implemented"})})]})};G.Quiz=rr,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
14
+ <%s key={someKey} {...props} />`,ct,de,ps,de),ur[de+ct]=!0}}return o===n?cs(V):as(V),V}}function ls(o,p,b){return fr(o,p,b,!0)}function us(o,p,b){return fr(o,p,b,!1)}var fs=us,ds=ls;Ee.Fragment=n,Ee.jsx=fs,Ee.jsxs=ds})()),Ee}var ft;function mr(){return ft||(ft=1,process.env.NODE_ENV==="production"?_e.exports=pr():_e.exports=hr()),_e.exports}var E=mr();function dt(e,t){return function(){return e.apply(t,arguments)}}const{toString:yr}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:Ce,toStringTag:pt}=Symbol,Ne=(e=>t=>{const r=yr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ne=e=>(e=e.toLowerCase(),t=>Ne(t)===e),je=e=>t=>typeof t===e,{isArray:pe}=Array,he=je("undefined");function Se(e){return e!==null&&!he(e)&&e.constructor!==null&&!he(e.constructor)&&Q(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=ne("ArrayBuffer");function br(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const gr=je("string"),Q=je("function"),mt=je("number"),Re=e=>e!==null&&typeof e=="object",wr=e=>e===!0||e===!1,Pe=e=>{if(Ne(e)!=="object")return!1;const t=Je(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pt in e)&&!(Ce in e)},xr=e=>{if(!Re(e)||Se(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Er=ne("Date"),Sr=ne("File"),Rr=ne("Blob"),vr=ne("FileList"),Tr=e=>Re(e)&&Q(e.pipe),Or=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Q(e.append)&&((t=Ne(e))==="formdata"||t==="object"&&Q(e.toString)&&e.toString()==="[object FormData]"))},Ar=ne("URLSearchParams"),[_r,Cr,Nr,jr]=["ReadableStream","Request","Response","Headers"].map(ne),Pr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ve(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),pe(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Se(e))return;const a=r?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let l;for(n=0;n<i;n++)l=a[n],t.call(null,e[l],l,e)}}function yt(e,t){if(Se(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bt=e=>!he(e)&&e!==le;function We(){const{caseless:e,skipUndefined:t}=bt(this)&&this||{},r={},n=(s,a)=>{const i=e&&yt(r,a)||a;Pe(r[i])&&Pe(s)?r[i]=We(r[i],s):Pe(s)?r[i]=We({},s):pe(s)?r[i]=s.slice():(!t||!he(s))&&(r[i]=s)};for(let s=0,a=arguments.length;s<a;s++)arguments[s]&&ve(arguments[s],n);return r}const kr=(e,t,r,{allOwnKeys:n}={})=>(ve(t,(s,a)=>{r&&Q(s)?e[a]=dt(s,r):e[a]=s},{allOwnKeys:n}),e),Fr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Dr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Ur=(e,t,r,n)=>{let s,a,i;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)i=s[a],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Je(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Ir=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Lr=e=>{if(!e)return null;if(pe(e))return e;let t=e.length;if(!mt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Br=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Je(Uint8Array)),Mr=(e,t)=>{const n=(e&&e[Ce]).call(e);let s;for(;(s=n.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},zr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},qr=ne("HTMLFormElement"),Hr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),gt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Jr=ne("RegExp"),wt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ve(r,(s,a)=>{let i;(i=t(s,a,e))!==!1&&(n[a]=i||s)}),Object.defineProperties(e,n)},Wr=e=>{wt(e,(t,r)=>{if(Q(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Q(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Vr=(e,t)=>{const r={},n=s=>{s.forEach(a=>{r[a]=!0})};return pe(e)?n(e):n(String(e).split(t)),r},$r=()=>{},Kr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Yr(e){return!!(e&&Q(e.append)&&e[pt]==="FormData"&&e[Ce])}const Qr=e=>{const t=new Array(10),r=(n,s)=>{if(Re(n)){if(t.indexOf(n)>=0)return;if(Se(n))return n;if(!("toJSON"in n)){t[s]=n;const a=pe(n)?[]:{};return ve(n,(i,l)=>{const h=r(i,s+1);!he(h)&&(a[l]=h)}),t[s]=void 0,a}}return n};return r(e,0)},Xr=ne("AsyncFunction"),Gr=e=>e&&(Re(e)||Q(e))&&Q(e.then)&&Q(e.catch),xt=((e,t)=>e?setImmediate:t?((r,n)=>(le.addEventListener("message",({source:s,data:a})=>{s===le&&a===r&&n.length&&n.shift()()},!1),s=>{n.push(s),le.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Q(le.postMessage)),Zr=typeof queueMicrotask<"u"?queueMicrotask.bind(le):typeof process<"u"&&process.nextTick||xt,c={isArray:pe,isArrayBuffer:ht,isBuffer:Se,isFormData:Or,isArrayBufferView:br,isString:gr,isNumber:mt,isBoolean:wr,isObject:Re,isPlainObject:Pe,isEmptyObject:xr,isReadableStream:_r,isRequest:Cr,isResponse:Nr,isHeaders:jr,isUndefined:he,isDate:Er,isFile:Sr,isBlob:Rr,isRegExp:Jr,isFunction:Q,isStream:Tr,isURLSearchParams:Ar,isTypedArray:Br,isFileList:vr,forEach:ve,merge:We,extend:kr,trim:Pr,stripBOM:Fr,inherits:Dr,toFlatObject:Ur,kindOf:Ne,kindOfTest:ne,endsWith:Ir,toArray:Lr,forEachEntry:Mr,matchAll:zr,isHTMLForm:qr,hasOwnProperty:gt,hasOwnProp:gt,reduceDescriptors:wt,freezeMethods:Wr,toObjectSet:Vr,toCamelCase:Hr,noop:$r,toFiniteNumber:Kr,findKey:yt,global:le,isContextDefined:bt,isSpecCompliantForm:Yr,toJSONObject:Qr,isAsyncFn:Xr,isThenable:Gr,setImmediate:xt,asap:Zr,isIterable:e=>e!=null&&Q(e[Ce])};function T(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}c.inherits(T,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const Et=T.prototype,St={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{St[e]={value:e}}),Object.defineProperties(T,St),Object.defineProperty(Et,"isAxiosError",{value:!0}),T.from=(e,t,r,n,s,a)=>{const i=Object.create(Et);c.toFlatObject(e,i,function(u){return u!==Error.prototype},f=>f!=="isAxiosError");const l=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return T.call(i,l,h,r,n,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",a&&Object.assign(i,a),i};const en=null;function Ve(e){return c.isPlainObject(e)||c.isArray(e)}function Rt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function vt(e,t,r){return e?e.concat(t).map(function(s,a){return s=Rt(s),!r&&a?"["+s+"]":s}).join(r?".":""):t}function tn(e){return c.isArray(e)&&!e.some(Ve)}const rn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function ke(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,y){return!c.isUndefined(y[x])});const n=r.metaTokens,s=r.visitor||u,a=r.dots,i=r.indexes,h=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!h&&c.isBlob(d))throw new T("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?h&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,x,y){let j=d;if(d&&!y&&typeof d=="object"){if(c.endsWith(x,"{}"))x=n?x:x.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&tn(d)||(c.isFileList(d)||c.endsWith(x,"[]"))&&(j=c.toArray(d)))return x=Rt(x),j.forEach(function(A,O){!(c.isUndefined(A)||A===null)&&t.append(i===!0?vt([x],O,a):i===null?x:x+"[]",f(A))}),!1}return Ve(d)?!0:(t.append(vt(y,x,a),f(d)),!1)}const m=[],R=Object.assign(rn,{defaultVisitor:u,convertValue:f,isVisitable:Ve});function D(d,x){if(!c.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(d),c.forEach(d,function(j,S){(!(c.isUndefined(j)||j===null)&&s.call(t,j,c.isString(S)?S.trim():S,x,R))===!0&&D(j,x?x.concat(S):[S])}),m.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return D(e),t}function Tt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function $e(e,t){this._pairs=[],e&&ke(e,this,t)}const Ot=$e.prototype;Ot.append=function(t,r){this._pairs.push([t,r])},Ot.toString=function(t){const r=t?function(n){return t.call(this,n,Tt)}:Tt;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function nn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function At(e,t,r){if(!t)return e;const n=r&&r.encode||nn;c.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let a;if(s?a=s(t,r):a=c.isURLSearchParams(t)?t.toString():new $e(t,r).toString(n),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class _t{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ct={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:$e,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ke=typeof window<"u"&&typeof document<"u",Ye=typeof navigator=="object"&&navigator||void 0,on=Ke&&(!Ye||["ReactNative","NativeScript","NS"].indexOf(Ye.product)<0),an=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cn=Ke&&window.location.href||"http://localhost",K={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ke,hasStandardBrowserEnv:on,hasStandardBrowserWebWorkerEnv:an,navigator:Ye,origin:cn},Symbol.toStringTag,{value:"Module"})),...sn};function ln(e,t){return ke(e,new K.classes.URLSearchParams,{visitor:function(r,n,s,a){return K.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function un(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fn(e){const t={},r=Object.keys(e);let n;const s=r.length;let a;for(n=0;n<s;n++)a=r[n],t[a]=e[a];return t}function Nt(e){function t(r,n,s,a){let i=r[a++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),h=a>=r.length;return i=!i&&c.isArray(s)?s.length:i,h?(c.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!l):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],a)&&c.isArray(s[i])&&(s[i]=fn(s[i])),!l)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,s)=>{t(un(n),s,r,0)}),r}return null}function dn(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Te={transitional:Ct,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,a=c.isObject(t);if(a&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(Nt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ln(t,this.formSerializer).toString();if((l=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ke(l?{"files[]":t}:t,h&&new h,this.formSerializer)}}return a||s?(r.setContentType("application/json",!1),dn(t)):t}],transformResponse:[function(t){const r=this.transitional||Te.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?T.from(l,T.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:K.classes.FormData,Blob:K.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{Te.headers[e]={}});const pn=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hn=e=>{const t={};let r,n,s;return e&&e.split(`
15
+ `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&pn[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},jt=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Fe(e){return e===!1||e==null?e:c.isArray(e)?e.map(Fe):String(e)}function mn(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const yn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Qe(e,t,r,n,s){if(c.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function bn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function gn(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,a,i){return this[n].call(this,t,s,a,i)},configurable:!0})})}let X=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function a(l,h,f){const u=Oe(h);if(!u)throw new Error("header name must be a non-empty string");const m=c.findKey(s,u);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||h]=Fe(l))}const i=(l,h)=>c.forEach(l,(f,u)=>a(f,u,h));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(c.isString(t)&&(t=t.trim())&&!yn(t))i(hn(t),r);else if(c.isObject(t)&&c.isIterable(t)){let l={},h,f;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[f=u[0]]=(h=l[f])?c.isArray(h)?[...h,u[1]]:[h,u[1]]:u[1]}i(l,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=Oe(t),t){const n=c.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return mn(s);if(c.isFunction(r))return r.call(this,s,n);if(c.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Oe(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Qe(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function a(i){if(i=Oe(i),i){const l=c.findKey(n,i);l&&(!r||Qe(n,n[l],l,r))&&(delete n[l],s=!0)}}return c.isArray(t)?t.forEach(a):a(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const a=r[n];(!t||Qe(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const r=this,n={};return c.forEach(this,(s,a)=>{const i=c.findKey(n,a);if(i){r[i]=Fe(s),delete r[a];return}const l=t?bn(a):String(a).trim();l!==a&&delete r[a],r[l]=Fe(s),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
16
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[jt]=this[jt]={accessors:{}}).accessors,s=this.prototype;function a(i){const l=Oe(i);n[l]||(gn(s,i),n[l]=!0)}return c.isArray(t)?t.forEach(a):a(t),this}};X.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(X.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(X);function Xe(e,t){const r=this||Te,n=t||r,s=X.from(n.headers);let a=n.data;return c.forEach(e,function(l){a=l.call(r,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function Pt(e){return!!(e&&e.__CANCEL__)}function me(e,t,r){T.call(this,e??"canceled",T.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(me,T,{__CANCEL__:!0});function kt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new T("Request failed with status code "+r.status,[T.ERR_BAD_REQUEST,T.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xn(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,a=0,i;return t=t!==void 0?t:1e3,function(h){const f=Date.now(),u=n[a];i||(i=f),r[s]=h,n[s]=f;let m=a,R=0;for(;m!==s;)R+=r[m++],m=m%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),f-i<t)return;const D=u&&f-u;return D?Math.round(R*1e3/D):void 0}}function En(e,t){let r=0,n=1e3/t,s,a;const i=(f,u=Date.now())=>{r=u,s=null,a&&(clearTimeout(a),a=null),e(...f)};return[(...f)=>{const u=Date.now(),m=u-r;m>=n?i(f,u):(s=f,a||(a=setTimeout(()=>{a=null,i(s)},n-m)))},()=>s&&i(s)]}const De=(e,t,r=3)=>{let n=0;const s=xn(50,250);return En(a=>{const i=a.loaded,l=a.lengthComputable?a.total:void 0,h=i-n,f=s(h),u=i<=l;n=i;const m={loaded:i,total:l,progress:l?i/l:void 0,bytes:h,rate:f||void 0,estimated:f&&l&&u?(l-i)/f:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(m)},r)},Ft=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Dt=e=>(...t)=>c.asap(()=>e(...t)),Sn=K.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,K.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(K.origin),K.navigator&&/(msie|trident)/i.test(K.navigator.userAgent)):()=>!0,Rn=K.hasStandardBrowserEnv?{write(e,t,r,n,s,a,i){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&l.push(`path=${n}`),c.isString(s)&&l.push(`domain=${s}`),a===!0&&l.push("secure"),c.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ut(e,t,r){let n=!vn(t);return e&&(n||r==!1)?Tn(e,t):t}const It=e=>e instanceof X?{...e}:e;function ue(e,t){t=t||{};const r={};function n(f,u,m,R){return c.isPlainObject(f)&&c.isPlainObject(u)?c.merge.call({caseless:R},f,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function s(f,u,m,R){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f,m,R)}else return n(f,u,m,R)}function a(f,u){if(!c.isUndefined(u))return n(void 0,u)}function i(f,u){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f)}else return n(void 0,u)}function l(f,u,m){if(m in t)return n(f,u);if(m in e)return n(void 0,f)}const h={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(f,u,m)=>s(It(f),It(u),m,!0)};return c.forEach(Object.keys({...e,...t}),function(u){const m=h[u]||s,R=m(e[u],t[u],u);c.isUndefined(R)&&m!==l||(r[u]=R)}),r}const Lt=e=>{const t=ue({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:a,headers:i,auth:l}=t;if(t.headers=i=X.from(i),t.url=At(Ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),c.isFormData(r)){if(K.hasStandardBrowserEnv||K.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const h=r.getHeaders(),f=["content-type","content-length"];Object.entries(h).forEach(([u,m])=>{f.includes(u.toLowerCase())&&i.set(u,m)})}}if(K.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Sn(t.url))){const h=s&&a&&Rn.read(a);h&&i.set(s,h)}return t},On=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=Lt(e);let a=s.data;const i=X.from(s.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:f}=s,u,m,R,D,d;function x(){D&&D(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function j(){if(!y)return;const A=X.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:A,config:e,request:y};kt(function(z){r(z),x()},function(z){n(z),x()},k),y=null}"onloadend"in y?y.onloadend=j:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(j)},y.onabort=function(){y&&(n(new T("Request aborted",T.ECONNABORTED,e,y)),y=null)},y.onerror=function(O){const k=O&&O.message?O.message:"Network Error",C=new T(k,T.ERR_NETWORK,e,y);C.event=O||null,n(C),y=null},y.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const k=s.transitional||Ct;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),n(new T(O,k.clarifyTimeoutError?T.ETIMEDOUT:T.ECONNABORTED,e,y)),y=null},a===void 0&&i.setContentType(null),"setRequestHeader"in y&&c.forEach(i.toJSON(),function(O,k){y.setRequestHeader(k,O)}),c.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),l&&l!=="json"&&(y.responseType=s.responseType),f&&([R,d]=De(f,!0),y.addEventListener("progress",R)),h&&y.upload&&([m,D]=De(h),y.upload.addEventListener("progress",m),y.upload.addEventListener("loadend",D)),(s.cancelToken||s.signal)&&(u=A=>{y&&(n(!A||A.type?new me(null,e,y):A),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const S=wn(s.url);if(S&&K.protocols.indexOf(S)===-1){n(new T("Unsupported protocol "+S+":",T.ERR_BAD_REQUEST,e));return}y.send(a||null)})},An=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const a=function(f){if(!s){s=!0,l();const u=f instanceof Error?f:this.reason;n.abort(u instanceof T?u:new me(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,a(new T(`timeout ${t} of ms exceeded`,T.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(a):f.removeEventListener("abort",a)}),e=null)};e.forEach(f=>f.addEventListener("abort",a));const{signal:h}=n;return h.unsubscribe=()=>c.asap(l),h}},_n=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},Cn=async function*(e,t){for await(const r of Nn(e))yield*_n(r,t)},Nn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Bt=(e,t,r,n)=>{const s=Cn(e,t);let a=0,i,l=h=>{i||(i=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:f,value:u}=await s.next();if(f){l(),h.close();return}let m=u.byteLength;if(r){let R=a+=m;r(R)}h.enqueue(new Uint8Array(u))}catch(f){throw l(f),f}},cancel(h){return l(h),s.return()}},{highWaterMark:2})},Mt=64*1024,{isFunction:Ue}=c,jn=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:zt,TextEncoder:qt}=c.global,Ht=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Pn=e=>{e=c.merge.call({skipUndefined:!0},jn,e);const{fetch:t,Request:r,Response:n}=e,s=t?Ue(t):typeof fetch=="function",a=Ue(r),i=Ue(n);if(!s)return!1;const l=s&&Ue(zt),h=s&&(typeof qt=="function"?(d=>x=>d.encode(x))(new qt):async d=>new Uint8Array(await new r(d).arrayBuffer())),f=a&&l&&Ht(()=>{let d=!1;const x=new r(K.origin,{body:new zt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!x}),u=i&&l&&Ht(()=>c.isReadableStream(new n("").body)),m={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(x,y)=>{let j=x&&x[d];if(j)return j.call(x);throw new T(`Response type '${d}' is not supported`,T.ERR_NOT_SUPPORT,y)})});const R=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(K.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await h(d)).byteLength},D=async(d,x)=>{const y=c.toFiniteNumber(d.getContentLength());return y??R(x)};return async d=>{let{url:x,method:y,data:j,signal:S,cancelToken:A,timeout:O,onDownloadProgress:k,onUploadProgress:C,responseType:z,headers:oe,withCredentials:Z="same-origin",fetchOptions:ee}=Lt(d),J=t||fetch;z=z?(z+"").toLowerCase():"text";let H=An([S,A&&A.toAbortSignal()],O),L=null;const F=H&&H.unsubscribe&&(()=>{H.unsubscribe()});let g;try{if(C&&f&&y!=="get"&&y!=="head"&&(g=await D(oe,j))!==0){let te=new r(x,{method:"POST",body:j,duplex:"half"}),ae;if(c.isFormData(j)&&(ae=te.headers.get("content-type"))&&oe.setContentType(ae),te.body){const[ye,be]=Ft(g,De(Dt(C)));j=Bt(te.body,Mt,ye,be)}}c.isString(Z)||(Z=Z?"include":"omit");const w=a&&"credentials"in r.prototype,_={...ee,signal:H,method:y.toUpperCase(),headers:oe.normalize().toJSON(),body:j,duplex:"half",credentials:w?Z:void 0};L=a&&new r(x,_);let B=await(a?J(L,ee):J(x,_));const $=u&&(z==="stream"||z==="response");if(u&&(k||$&&F)){const te={};["status","statusText","headers"].forEach(Be=>{te[Be]=B[Be]});const ae=c.toFiniteNumber(B.headers.get("content-length")),[ye,be]=k&&Ft(ae,De(Dt(k),!0))||[];B=new n(Bt(B.body,Mt,ye,()=>{be&&be(),F&&F()}),te)}z=z||"text";let ie=await m[c.findKey(m,z)||"text"](B,d);return!$&&F&&F(),await new Promise((te,ae)=>{kt(te,ae,{data:ie,headers:X.from(B.headers),status:B.status,statusText:B.statusText,config:d,request:L})})}catch(w){throw F&&F(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new T("Network Error",T.ERR_NETWORK,d,L),{cause:w.cause||w}):T.from(w,w&&w.code,d,L)}}},kn=new Map,Jt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,a=[n,s,r];let i=a.length,l=i,h,f,u=kn;for(;l--;)h=a[l],f=u.get(h),f===void 0&&u.set(h,f=l?new Map:Pn(t)),u=f;return f};Jt();const Ge={http:en,xhr:On,fetch:{get:Jt}};c.forEach(Ge,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wt=e=>`- ${e}`,Fn=e=>c.isFunction(e)||e===null||e===!1;function Dn(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,s;const a={};for(let i=0;i<r;i++){n=e[i];let l;if(s=n,!Fn(n)&&(s=Ge[(l=String(n)).toLowerCase()],s===void 0))throw new T(`Unknown adapter '${l}'`);if(s&&(c.isFunction(s)||(s=s.get(t))))break;a[l||"#"+i]=s}if(!s){const i=Object.entries(a).map(([h,f])=>`adapter ${h} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since :
17
+ `+i.map(Wt).join(`
18
+ `):" "+Wt(i[0]):"as no adapter specified";throw new T("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return s}const Vt={getAdapter:Dn,adapters:Ge};function Ze(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new me(null,e)}function $t(e){return Ze(e),e.headers=X.from(e.headers),e.data=Xe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Vt.getAdapter(e.adapter||Te.adapter,e)(e).then(function(n){return Ze(e),n.data=Xe.call(e,e.transformResponse,n),n.headers=X.from(n.headers),n},function(n){return Pt(n)||(Ze(e),n&&n.response&&(n.response.data=Xe.call(e,e.transformResponse,n.response),n.response.headers=X.from(n.response.headers))),Promise.reject(n)})}const Kt="1.13.2",Ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ie[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Yt={};Ie.transitional=function(t,r,n){function s(a,i){return"[Axios v"+Kt+"] Transitional option '"+a+"'"+i+(n?". "+n:"")}return(a,i,l)=>{if(t===!1)throw new T(s(i," has been removed"+(r?" in "+r:"")),T.ERR_DEPRECATED);return r&&!Yt[i]&&(Yt[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,i,l):!0}},Ie.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Un(e,t,r){if(typeof e!="object")throw new T("options must be an object",T.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const a=n[s],i=t[a];if(i){const l=e[a],h=l===void 0||i(l,a,e);if(h!==!0)throw new T("option "+a+" must be "+h,T.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new T("Unknown option "+a,T.ERR_BAD_OPTION)}}const Le={assertOptions:Un,validators:Ie},se=Le.validators;let fe=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _t,response:new _t}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=`
19
+ `+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ue(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:a}=r;n!==void 0&&Le.assertOptions(n,{silentJSONParsing:se.transitional(se.boolean),forcedJSONParsing:se.transitional(se.boolean),clarifyTimeoutError:se.transitional(se.boolean)},!1),s!=null&&(c.isFunction(s)?r.paramsSerializer={serialize:s}:Le.assertOptions(s,{encode:se.function,serialize:se.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Le.assertOptions(r,{baseUrl:se.spelling("baseURL"),withXsrfToken:se.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=a&&c.merge(a.common,a[r.method]);a&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete a[d]}),r.headers=X.concat(i,a);const l=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(h=h&&x.synchronous,l.unshift(x.fulfilled,x.rejected))});const f=[];this.interceptors.response.forEach(function(x){f.push(x.fulfilled,x.rejected)});let u,m=0,R;if(!h){const d=[$t.bind(this),void 0];for(d.unshift(...l),d.push(...f),R=d.length,u=Promise.resolve(r);m<R;)u=u.then(d[m++],d[m++]);return u}R=l.length;let D=r;for(;m<R;){const d=l[m++],x=l[m++];try{D=d(D)}catch(y){x.call(this,y);break}}try{u=$t.call(this,D)}catch(d){return Promise.reject(d)}for(m=0,R=f.length;m<R;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=ue(this.defaults,t);const r=Ut(t.baseURL,t.url,t.allowAbsoluteUrls);return At(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){fe.prototype[t]=function(r,n){return this.request(ue(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(a,i,l){return this.request(ue(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}fe.prototype[t]=r(),fe.prototype[t+"Form"]=r(!0)});let In=class dr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const n=this;this.promise.then(s=>{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](s);n._listeners=null}),this.promise.then=s=>{let a;const i=new Promise(l=>{n.subscribe(l),a=l}).then(s);return i.cancel=function(){n.unsubscribe(a)},i},t(function(a,i,l){n.reason||(n.reason=new me(a,i,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new dr(function(s){t=s}),cancel:t}}};function Ln(e){return function(r){return e.apply(null,r)}}function Bn(e){return c.isObject(e)&&e.isAxiosError===!0}const et={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(et).forEach(([e,t])=>{et[t]=e});function Qt(e){const t=new fe(e),r=dt(fe.prototype.request,t);return c.extend(r,fe.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Qt(ue(e,s))},r}const q=Qt(Te);q.Axios=fe,q.CanceledError=me,q.CancelToken=In,q.isCancel=Pt,q.VERSION=Kt,q.toFormData=ke,q.AxiosError=T,q.Cancel=q.CanceledError,q.all=function(t){return Promise.all(t)},q.spread=Ln,q.isAxiosError=Bn,q.mergeConfig=ue,q.AxiosHeaders=X,q.formToJSON=e=>Nt(c.isHTMLForm(e)?new FormData(e):e),q.getAdapter=Vt.getAdapter,q.HttpStatusCode=et,q.default=q;const{Axios:Es,AxiosError:Ss,CanceledError:Rs,isCancel:vs,CancelToken:Ts,VERSION:Os,all:As,Cancel:_s,isAxiosError:Cs,spread:Ns,toFormData:js,AxiosHeaders:Ps,HttpStatusCode:ks,formToJSON:Fs,getAdapter:Ds,mergeConfig:Us}=q;class Mn{client;constructor(t,r){this.client=q.create({baseURL:t||void 0||"http://localhost:8080",headers:{"Content-Type":"application/json"}}),r&&this.setApiKey(r)}setApiKey(t){this.client.defaults.headers.common.Authorization=`Bearer ${t}`}async getQuiz(t){try{const n=(await this.client.get("/core/quiz")).data,s=Array.isArray(n)?n.find(a=>a.id===t):null;if(!s)throw new Error(`Quiz with ID "${t}" not found`);return{id:s.id,name:s.name,renderMode:s.renderMode||"steps",nodes:s.nodes||[],edges:s.edges||[]}}catch(r){throw q.isAxiosError(r)?r.response?.status===401?new Error("Invalid API key. Please check your authentication credentials."):new Error(`Failed to fetch quiz: ${r.response?.data?.message||r.message}`):r}}async createSession(t){const r=`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n={sessionId:r,quizId:t,startedAt:Date.now(),answers:{}};return localStorage.setItem(`quiz_session_${r}`,JSON.stringify(n)),{sessionId:r}}async submitAnswer(t,r,n){try{const s=`quiz_session_${t}`,a=localStorage.getItem(s);if(!a)throw new Error("Session not found");const i=JSON.parse(a);i.answers[r]=n,localStorage.setItem(s,JSON.stringify(i))}catch(s){console.error("Failed to submit answer:",s)}}async completeSession(t){try{const r=`quiz_session_${t}`,n=localStorage.getItem(r);if(!n)throw new Error("Session not found");const s=JSON.parse(n);s.completedAt=Date.now(),s.status="completed",localStorage.setItem(r,JSON.stringify(s))}catch(r){console.error("Failed to complete session:",r)}}}const zn=({nodes:e,onAnswer:t,onProgress:r,onComplete:n})=>{const[s,a]=I.useState(0),[i,l]=I.useState({}),[h,f]=I.useState({});I.useEffect(()=>{r({currentStep:s+1,totalSteps:e.length,percentage:(s+1)/e.length*100}),f({})},[s,e.length,r]);const u=(S,A,O=!0)=>{l(k=>({...k,[A]:S})),t({questionId:A,answer:S,timestamp:Date.now()}),O&&D()},m=(S,A)=>{f(O=>({...O,[A]:S}))},R=S=>{(S.data.children||[]).forEach(O=>{const k=h[O.id];k!==void 0&&t({questionId:O.id,answer:k,timestamp:Date.now()})}),l(O=>({...O,...h})),D()},D=()=>{s<e.length-1?a(s+1):n()},d=()=>{s>0&&a(s-1)},x=(S,A=!1)=>{const O=S.data?.type||S.type,k=S.id;return E.jsxs("div",{className:`mb-6 ${A?"pl-4 border-l-2 border-gray-100":""}`,children:[E.jsxs("div",{className:"mb-4",children:[E.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2 leading-tight",children:S.data.label}),S.data.content&&E.jsx("p",{className:"text-gray-500 mb-6 leading-relaxed",children:S.data.content})]}),E.jsxs("div",{className:"flex flex-col gap-3 mb-6",children:[(O==="multiple-choice"||O==="multipleChoice")&&E.jsx("div",{className:"grid grid-cols-1 gap-3",children:S.data.options?.map((C,z)=>E.jsx("button",{className:`p-4 bg-gray-50 border-2 border-gray-200 rounded-lg text-left text-gray-800 cursor-pointer transition-all duration-200 hover:bg-gray-100 hover:border-indigo-500 hover:-translate-y-0.5 hover:shadow-md ${A&&h[k]===(C.value||C)?"border-indigo-500 bg-indigo-50":""}`,onClick:()=>A?m(C.value||C,k):u(C.value||C,k),children:C.label||C},z))}),(O==="input-text"||O==="input-email"||O==="input-phone"||O==="text")&&E.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[E.jsx("input",{className:"flex-1 p-4 border-2 border-gray-200 rounded-lg text-base transition-colors duration-200 focus:outline-none focus:border-indigo-500",type:O==="input-email"?"email":"text",placeholder:S.data.placeholder||"Type your answer...",value:A?h[k]||"":void 0,onChange:C=>A&&m(C.target.value,k),onKeyPress:C=>{!A&&C.key==="Enter"&&u(C.target.value,k)}}),!A&&E.jsx("button",{className:"px-8 py-4 bg-gradient-to-r from-indigo-500 to-purple-600 text-white border-none rounded-lg text-base font-semibold cursor-pointer transition-transform duration-200 hover:-translate-y-0.5 hover:shadow-lg",onClick:C=>{const z=C.currentTarget.previousElementSibling;u(z.value,k)},children:"Submit"})]})]})]},k)};if(e.length===0)return E.jsx("div",{className:"text-center py-16 px-4 text-gray-500 text-lg",children:"No questions available"});const y=e[s],j=y.type;return E.jsxs("div",{className:"max-w-[800px] mx-auto p-5 font-sans md:p-3",children:[E.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden mb-8",children:E.jsx("div",{className:"h-full bg-gradient-to-r from-indigo-500 to-purple-600 transition-[width] duration-300 ease-out",style:{width:`${(s+1)/e.length*100}%`}})}),E.jsxs("div",{className:"bg-white rounded-xl p-10 shadow-md md:p-6",children:[E.jsx("div",{className:"mb-5",children:E.jsxs("span",{className:"text-sm text-indigo-500 font-semibold uppercase tracking-wide",children:["Step ",s+1," of ",e.length]})}),j==="group"?E.jsxs("div",{className:"quiz-steps-group",children:[E.jsx("h2",{className:"text-2xl text-gray-800 mb-3 leading-tight font-semibold",children:y.data.label}),E.jsx("div",{className:"mt-6 space-y-4",children:y.data.children?.map(S=>x(S,!0))}),E.jsx("div",{className:"mt-8 flex justify-end",children:E.jsx("button",{className:"px-8 py-3 bg-gradient-to-r from-indigo-500 to-purple-600 text-white rounded-lg font-semibold hover:opacity-90 transition-opacity",onClick:()=>R(y),children:"Continue"})})]}):x(y),E.jsx("div",{className:"flex justify-start mt-6",children:s>0&&E.jsx("button",{className:"px-6 py-3 bg-transparent text-indigo-500 border-2 border-indigo-500 rounded-lg text-sm font-semibold cursor-pointer transition-all duration-200 hover:bg-indigo-500 hover:text-white",onClick:d,children:"Previous"})})]})]})},qn=({nodes:e,edges:t,onAnswer:r,onComplete:n,theme:s})=>{const[a,i]=I.useState([]),[l,h]=I.useState(null),[f,u]=I.useState([]),[m,R]=I.useState(null),[D,d]=I.useState(!1),x=I.useRef(null),y=I.useRef(!1),j=I.useRef(n);I.useEffect(()=>{j.current=n},[n]);const S=()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)};I.useEffect(()=>{S()},[a,D,m]),I.useEffect(()=>{if(y.current||e.length===0)return;const g=new Set(t.map(_=>_.target)),w=e.find(_=>!g.has(_.id))||e[0];w&&(y.current=!0,A(w.id))},[e,t]);const A=g=>{const w=e.find(_=>_.id===g);if(!w){console.error(`Node ${g} not found`);return}if(w.type==="group"){const _=w.data?.children||w.data||[],B=Array.isArray(_)?_:Array.isArray(w.data)?w.data:[];if(B.length>0){const $=[...f,{groupId:w.id,children:B,currentIndex:0}];u($),O(B[0])}else z(w.id)}else h(w.id),k(w)},O=g=>{k(g)},k=g=>{R(g),d(!0);const w=ee(g),_=Math.min(1e3,500+(w.content?.length||0)*20);setTimeout(()=>{d(!1);const B=w.content||w.label;B&&H("bot",B),J(g)&&setTimeout(()=>{C(null,g)},1500)},_)},C=(g,w,_)=>{const B=w.id||l||"unknown";if(g!==null&&r({questionId:B,answer:g,timestamp:Date.now()}),f.length>0){const $=f[f.length-1];if($.currentIndex<$.children.length-1){const ie=$.currentIndex+1,te={...$,currentIndex:ie};u([...f.slice(0,-1),te]),O($.children[ie])}else{const ie=$.groupId;u(f.slice(0,-1)),z(ie,_)}}else{const $=w.id;z($,_)}},z=(g,w)=>{const _=t.find(B=>B.source===g&&(!w||B.sourceHandle===w));_?A(_.target):oe()},oe=async()=>{d(!0),R(null),setTimeout(()=>{d(!1),H("bot","Obrigado! Suas respostas foram enviadas com sucesso."),setTimeout(()=>{j.current&&j.current()},2e3)},1e3)},Z=(g,w,_)=>{if(!m)return;H("user",w||g);const B=m;R(null),C(g,B,_)},ee=g=>{const w=g.data||g;return{id:g.id,label:w.label||g.label,content:w.content||g.content,type:w.type||g.type,placeholder:w.placeholder||g.placeholder,options:w.options||g.options}},J=g=>{const w=ee(g),_=(w.type||"").toLowerCase();return _==="text"||_==="base"||_==="description"||_==="base"&&!w.type||_==="message"},H=(g,w)=>{i(_=>[..._,{id:Date.now().toString(),type:g,content:w,timestamp:Date.now()}])},L=m?ee(m):null,F=L?.type;return E.jsxs("div",{className:"flex flex-col h-full rounded-xl overflow-hidden font-[Inter,sans-serif] relative",style:{backgroundColor:s?.backgroundColor||"#f5f7fa"},children:[E.jsxs("div",{ref:x,className:"flex-1 overflow-y-auto p-5 flex flex-col gap-4",children:[a.map(g=>E.jsxs("div",{className:`flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] ${g.type==="bot"?"self-start":"self-end items-end"}`,children:[E.jsx("div",{className:`p-3 px-4 rounded-2xl text-[15px] leading-relaxed shadow-sm ${g.type==="bot"?"bg-white text-[#1a1a1a] rounded-tl-sm":"text-white rounded-tr-sm"}`,style:g.type==="user"?{backgroundColor:s?.primaryColor||"#007aff"}:{},children:g.content}),E.jsx("span",{className:`text-[11px] text-[#999] mt-1 ${g.type==="bot"?"ml-1":"mr-1"}`,children:new Date(g.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]},g.id)),D&&E.jsx("div",{className:"flex flex-col max-w-[80%] animate-[fadeIn_0.3s_ease] self-start",children:E.jsxs("div",{className:"flex gap-1 p-3 px-4 bg-white rounded-2xl rounded-tl-sm w-fit",children:[E.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-1"}),E.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce animate-bounce-delay-2"}),E.jsx("span",{className:"w-1.5 h-1.5 bg-[#ccc] rounded-full animate-bounce"})]})})]}),!D&&m&&!J(m)&&E.jsxs("div",{className:"p-4 bg-white border-t border-[#eee]",children:[(F==="multiple-choice"||F==="multipleChoice")&&E.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:L?.options?.map(g=>E.jsx("button",{onClick:()=>Z(g.value||g.label,g.label,g.id),className:"px-5 py-2.5 bg-white border rounded-full cursor-pointer font-medium transition-all duration-200 hover:text-white",style:{borderColor:s?.primaryColor||"#007aff",color:s?.primaryColor||"#007aff"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=s?.primaryColor||"#007aff",w.currentTarget.style.color="white"},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="white",w.currentTarget.style.color=s?.primaryColor||"#007aff"},children:g.label||g.value||g},g.id||g.label))}),(F==="input-text"||F==="input-email"||F==="input-phone"||F==="text-input"||F==="text")&&E.jsx("div",{className:"w-full",children:E.jsxs("form",{className:"flex gap-2.5",onSubmit:g=>{g.preventDefault();const w=g.currentTarget.elements[0];w.value.trim()&&(Z(w.value),w.value="")},children:[E.jsx("input",{type:F==="input-email"?"email":"text",placeholder:L?.placeholder||"Type your answer...",autoFocus:!0,className:"flex-1 p-3 border border-[#ddd] rounded-3xl outline-none text-[15px] focus:border-[var(--primary-color)]",style:{"--primary-color":s?.primaryColor||"#007aff"}}),E.jsx("button",{type:"submit",className:"px-6 text-white border-none rounded-3xl font-semibold cursor-pointer",style:{backgroundColor:s?.primaryColor||"#007aff"},children:"Enviar"})]})})]})]})},Hn=({quizId:e,apiKey:t,mode:r="steps",baseUrl:n,onStart:s,onAnswer:a,onProgress:i,onComplete:l,onError:h,className:f,style:u,theme:m})=>{const[R,D]=I.useState(null),[d,x]=I.useState(!0),[y,j]=I.useState(null),[S,A]=I.useState(null),[O,k]=I.useState({}),C=I.useRef(null);I.useEffect(()=>{C.current=new Mn(n,t),(async()=>{try{x(!0),j(null);const H=await C.current.getQuiz(e);D(H);const L=await C.current.createSession(e);if(A(L.sessionId),s){const F={quizId:e,timestamp:Date.now()};s(F)}x(!1)}catch(H){const L=H instanceof Error?H.message:"Failed to load quiz";if(j(L),x(!1),h){const F={error:H instanceof Error?H:new Error(L),message:L,timestamp:Date.now()};h(F)}}})()},[e,t,n,s,h]);const z=async J=>{const H={...O,[J.questionId]:J.answer};if(k(H),a&&a(J),S&&C.current)try{await C.current.submitAnswer(S,J.questionId,J.answer)}catch(L){console.error("Failed to submit answer:",L)}},oe=J=>{i&&i(J)},Z=async()=>{if(S&&C.current)try{await C.current.completeSession(S)}catch(J){console.error("Failed to complete session:",J)}if(l){const J=(F,g)=>{for(const w of F){const _=w.data||w;if(w.id===g)return _.label||_.content||"Unknown Question";const B=_.children||(Array.isArray(_)?_:[]);if(B.length>0){const $=J(B,g);if($!=="Unknown Question")return $}}return"Unknown Question"},H=Object.entries(O).map(([F,g])=>({question:J(R?.nodes||[],F),answer:g})),L={quizId:e,answers:O,result:H,timestamp:Date.now(),sessionId:S||void 0};l(L)}};if(d)return E.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${f||""}`,style:u,children:[E.jsx("div",{className:"w-12 h-12 border-4 border-gray-200 border-t-indigo-500 rounded-full animate-spin mb-5"}),E.jsx("p",{className:"text-gray-500",children:"Loading quiz..."})]});if(y)return E.jsxs("div",{className:`flex flex-col items-center justify-center py-16 px-5 text-center ${f||""}`,style:u,children:[E.jsx("div",{className:"text-5xl mb-4",children:"⚠️"}),E.jsx("h3",{className:"text-red-600 text-2xl mb-3",children:"Failed to Load Quiz"}),E.jsx("p",{className:"text-gray-500 mx-auto max-w-[500px]",children:y})]});if(!R)return null;const ee=r||R.renderMode||"steps";return E.jsxs("div",{className:`w-full min-h-[400px] ${f||""}`,style:u,children:[ee==="steps"&&E.jsx(zn,{nodes:R.nodes,onAnswer:z,onProgress:oe,onComplete:Z}),ee==="chat"&&E.jsx(qn,{nodes:R.nodes,edges:R.edges,onAnswer:z,onProgress:oe,onComplete:Z,theme:m}),ee==="single"&&E.jsx("div",{className:"p-10 text-center text-gray-500",children:E.jsx("p",{children:"Single mode not yet implemented"})}),ee==="flow"&&E.jsx("div",{className:"p-10 text-center text-gray-500",children:E.jsx("p",{children:"Flow mode not yet implemented"})})]})};ce.Quiz=Hn,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,34 @@
1
+ import { QuizData } from '../components/Quiz/types';
2
+ declare class QuizApiService {
3
+ private client;
4
+ constructor(baseUrl?: string, apiKey?: string);
5
+ setApiKey(apiKey: string): void;
6
+ /**
7
+ * Fetches a specific quiz by ID
8
+ * Currently uses GET /core/quiz and filters client-side
9
+ * TODO: Backend should add GET /core/quiz/:id endpoint for better performance
10
+ */
11
+ getQuiz(quizId: string): Promise<QuizData>;
12
+ /**
13
+ * Creates a quiz session
14
+ * Note: This is a client-side session for now
15
+ * TODO: Backend should implement POST /core/quiz/session endpoint
16
+ */
17
+ createSession(quizId: string): Promise<{
18
+ sessionId: string;
19
+ }>;
20
+ /**
21
+ * Submits an answer for a question
22
+ * Note: Currently stores answers in localStorage
23
+ * TODO: Backend should implement POST /core/quiz/session/:id/answer endpoint
24
+ */
25
+ submitAnswer(sessionId: string, questionId: string, answer: any): Promise<void>;
26
+ /**
27
+ * Completes a quiz session
28
+ * Note: Currently just marks session as completed in localStorage
29
+ * TODO: Backend should implement POST /core/quiz/session/:id/complete endpoint
30
+ */
31
+ completeSession(sessionId: string): Promise<void>;
32
+ }
33
+ export default QuizApiService;
34
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/services/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,cAAM,cAAc;IAChB,OAAO,CAAC,MAAM,CAAgB;gBAElB,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAa7C,SAAS,CAAC,MAAM,EAAE,MAAM;IAIxB;;;;OAIG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiChD;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAiBnE;;;;OAIG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBrF;;;;OAIG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmB1D;AAED,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "myquizbot-react",
3
3
  "private": false,
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "type": "module",
6
6
  "description": "React component library for MyQuizBot - Interactive quiz components with API integration",
7
7
  "main": "./dist/myquizbot-react.umd.js",
@@ -35,17 +35,17 @@
35
35
  "@eslint/js": "^9.39.1",
36
36
  "@tailwindcss/postcss": "^4.1.18",
37
37
  "@types/node": "^24.10.1",
38
- "@types/react": "^19.2.5",
39
- "@types/react-dom": "^19.2.3",
40
- "@vitejs/plugin-react": "^5.1.1",
38
+ "@types/react": "^18.3.3",
39
+ "@types/react-dom": "^18.3.0",
40
+ "@vitejs/plugin-react": "^4.3.1",
41
41
  "autoprefixer": "^10.4.23",
42
42
  "eslint": "^9.39.1",
43
43
  "eslint-plugin-react-hooks": "^7.0.1",
44
44
  "eslint-plugin-react-refresh": "^0.4.24",
45
45
  "globals": "^16.5.0",
46
46
  "postcss": "^8.5.6",
47
- "react": "^19.2.0",
48
- "react-dom": "^19.2.0",
47
+ "react": "^18.3.1",
48
+ "react-dom": "^18.3.1",
49
49
  "tailwindcss": "^4.1.18",
50
50
  "typescript": "~5.9.3",
51
51
  "typescript-eslint": "^8.46.4",