@xcelsior/ui-chat 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/index.d.mts +69 -69
  3. package/dist/index.d.ts +69 -69
  4. package/dist/index.js +2458 -627
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +2457 -628
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +6 -5
  9. package/src/components/BrandIcons.stories.tsx +95 -0
  10. package/src/components/BrandIcons.tsx +84 -0
  11. package/src/components/Chat.stories.tsx +149 -16
  12. package/src/components/Chat.tsx +116 -96
  13. package/src/components/ChatHeader.tsx +124 -69
  14. package/src/components/ChatInput.tsx +253 -104
  15. package/src/components/ChatWidget.tsx +209 -63
  16. package/src/components/ConversationRating.stories.tsx +33 -0
  17. package/src/components/ConversationRating.tsx +156 -0
  18. package/src/components/MarkdownMessage.tsx +202 -0
  19. package/src/components/MessageItem.stories.tsx +253 -55
  20. package/src/components/MessageItem.tsx +222 -59
  21. package/src/components/MessageList.tsx +164 -35
  22. package/src/components/PreChatForm.tsx +236 -96
  23. package/src/components/ThinkingIndicator.tsx +370 -0
  24. package/src/components/TypingIndicator.tsx +27 -11
  25. package/src/hooks/useDraggablePosition.ts +91 -0
  26. package/src/hooks/useMessages.ts +12 -13
  27. package/src/hooks/useResizableWidget.ts +324 -0
  28. package/src/index.tsx +5 -0
  29. package/src/types.ts +51 -5
  30. package/src/utils/markdown-styles.ts +140 -0
  31. package/storybook-static/assets/BrandIcons-Cjy5INAp.js +4 -0
  32. package/storybook-static/assets/BrandIcons.stories-BeVC6svr.js +64 -0
  33. package/storybook-static/assets/Chat.stories-J_Yp51wU.js +803 -0
  34. package/storybook-static/assets/Color-YHDXOIA2-BMnd3YrF.js +1 -0
  35. package/storybook-static/assets/ConversationRating.stories-B5_QddHN.js +12 -0
  36. package/storybook-static/assets/DocsRenderer-CFRXHY34-i_W8iCu9.js +575 -0
  37. package/storybook-static/assets/MessageItem-DAaKZ9s9.js +14 -0
  38. package/storybook-static/assets/MessageItem.stories-Ckr1_scc.js +255 -0
  39. package/storybook-static/assets/ToastContext-Bty1K7ya.js +1 -0
  40. package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
  41. package/storybook-static/assets/en-US-BukEqXxE.js +1 -0
  42. package/storybook-static/assets/entry-preview-docs-DHohToDm.js +46 -0
  43. package/storybook-static/assets/entry-preview-oDnntGcx.js +2 -0
  44. package/storybook-static/assets/iframe-CGBtu2Se.js +211 -0
  45. package/storybook-static/assets/index--qcDGAq6.js +1 -0
  46. package/storybook-static/assets/index-BLHw34Di.js +24 -0
  47. package/storybook-static/assets/index-B_4m48Mv.js +1 -0
  48. package/storybook-static/assets/index-DgH-xKnr.js +11 -0
  49. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  50. package/storybook-static/assets/index-DrdPSA1J.js +240 -0
  51. package/storybook-static/assets/index-jvNEZhzf.js +1 -0
  52. package/storybook-static/assets/index-yBjzXJbu.js +9 -0
  53. package/storybook-static/assets/jsx-runtime-Cf8x2fCZ.js +9 -0
  54. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  55. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  56. package/storybook-static/assets/preview-BRpahs9B.js +2 -0
  57. package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
  58. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  59. package/storybook-static/assets/preview-DD_OYowb.js +1 -0
  60. package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
  61. package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
  62. package/storybook-static/assets/preview-DUOvJmsz.js +1 -0
  63. package/storybook-static/assets/preview-DcGwT3kv.css +1 -0
  64. package/storybook-static/assets/preview-DwI0w3cI.js +1 -0
  65. package/storybook-static/assets/react-18-CALspjOX.js +1 -0
  66. package/storybook-static/assets/test-utils-BE0XkMtV.js +9 -0
  67. package/storybook-static/favicon.svg +1 -0
  68. package/storybook-static/iframe.html +666 -0
  69. package/storybook-static/index.html +177 -0
  70. package/storybook-static/index.json +1 -0
  71. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  72. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  73. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  74. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  75. package/storybook-static/project.json +1 -0
  76. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  77. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  78. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
  79. package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
  80. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  81. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  82. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  83. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  84. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +222 -0
  85. package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
  86. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  87. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  88. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  89. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  90. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  91. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  92. package/storybook-static/sb-manager/globals-module-info.js +1052 -0
  93. package/storybook-static/sb-manager/globals-runtime.js +42127 -0
  94. package/storybook-static/sb-manager/globals.js +48 -0
  95. package/storybook-static/sb-manager/runtime.js +12048 -0
  96. package/.turbo/turbo-lint.log +0 -5
@@ -0,0 +1 @@
1
+ import{R as e}from"./index--qcDGAq6.js";import"./index-yBjzXJbu.js";const o={},c=e.createContext(o);function u(n){const t=e.useContext(c);return e.useMemo(function(){return typeof n=="function"?n(t):{...t,...n}},[t,n])}function r(n){let t;return n.disableParentContext?t=typeof n.components=="function"?n.components(o):n.components||o:t=u(n.components),e.createElement(c.Provider,{value:t},n.children)}export{r as MDXProvider,u as useMDXComponents};
@@ -0,0 +1,9 @@
1
+ var k={exports:{}},r={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var T;function X(){if(T)return r;T=1;var y=Symbol.for("react.element"),A=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),M=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),B=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),w=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=w&&e[w]||e["@@iterator"],typeof e=="function"?e:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,C={};function p(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||$}p.prototype.isReactComponent={},p.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},p.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function x(){}x.prototype=p.prototype;function v(e,t,n){this.props=e,this.context=t,this.refs=C,this.updater=n||$}var m=v.prototype=new x;m.constructor=v,b(m,p.prototype),m.isPureReactComponent=!0;var j=Array.isArray,O=Object.prototype.hasOwnProperty,S={current:null},g={key:!0,ref:!0,__self:!0,__source:!0};function P(e,t,n){var o,u={},c=null,s=null;if(t!=null)for(o in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(c=""+t.key),t)O.call(t,o)&&!g.hasOwnProperty(o)&&(u[o]=t[o]);var f=arguments.length-2;if(f===1)u.children=n;else if(1<f){for(var i=Array(f),a=0;a<f;a++)i[a]=arguments[a+2];u.children=i}if(e&&e.defaultProps)for(o in f=e.defaultProps,f)u[o]===void 0&&(u[o]=f[o]);return{$$typeof:y,type:e,key:c,ref:s,props:u,_owner:S.current}}function G(e,t){return{$$typeof:y,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function R(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function J(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var I=/\/+/g;function E(e,t){return typeof e=="object"&&e!==null&&e.key!=null?J(""+e.key):t.toString(36)}function d(e,t,n,o,u){var c=typeof e;(c==="undefined"||c==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(c){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case y:case A:s=!0}}if(s)return s=e,u=u(s),e=o===""?"."+E(s,0):o,j(u)?(n="",e!=null&&(n=e.replace(I,"$&/")+"/"),d(u,t,n,"",function(a){return a})):u!=null&&(R(u)&&(u=G(u,n+(!u.key||s&&s.key===u.key?"":(""+u.key).replace(I,"$&/")+"/")+e)),t.push(u)),1;if(s=0,o=o===""?".":o+":",j(e))for(var f=0;f<e.length;f++){c=e[f];var i=o+E(c,f);s+=d(c,t,n,i,u)}else if(i=W(e),typeof i=="function")for(e=i.call(e),f=0;!(c=e.next()).done;)c=c.value,i=o+E(c,f++),s+=d(c,t,n,i,u);else if(c==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function _(e,t,n){if(e==null)return e;var o=[],u=0;return d(e,o,"","",function(c){return t.call(n,c,u++)}),o}function K(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var l={current:null},h={transition:null},Q={ReactCurrentDispatcher:l,ReactCurrentBatchConfig:h,ReactCurrentOwner:S};function q(){throw Error("act(...) is not supported in production builds of React.")}return r.Children={map:_,forEach:function(e,t,n){_(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _(e,function(){t++}),t},toArray:function(e){return _(e,function(t){return t})||[]},only:function(e){if(!R(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},r.Component=p,r.Fragment=D,r.Profiler=F,r.PureComponent=v,r.StrictMode=U,r.Suspense=z,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,r.act=q,r.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=b({},e.props),u=e.key,c=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(c=t.ref,s=S.current),t.key!==void 0&&(u=""+t.key),e.type&&e.type.defaultProps)var f=e.type.defaultProps;for(i in t)O.call(t,i)&&!g.hasOwnProperty(i)&&(o[i]=t[i]===void 0&&f!==void 0?f[i]:t[i])}var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){f=Array(i);for(var a=0;a<i;a++)f[a]=arguments[a+2];o.children=f}return{$$typeof:y,type:e.type,key:u,ref:c,props:o,_owner:s}},r.createContext=function(e){return e={$$typeof:M,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:L,_context:e},e.Consumer=e},r.createElement=P,r.createFactory=function(e){var t=P.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:N,render:e}},r.isValidElement=R,r.lazy=function(e){return{$$typeof:H,_payload:{_status:-1,_result:e},_init:K}},r.memo=function(e,t){return{$$typeof:B,type:e,compare:t===void 0?null:t}},r.startTransition=function(e){var t=h.transition;h.transition={};try{e()}finally{h.transition=t}},r.unstable_act=q,r.useCallback=function(e,t){return l.current.useCallback(e,t)},r.useContext=function(e){return l.current.useContext(e)},r.useDebugValue=function(){},r.useDeferredValue=function(e){return l.current.useDeferredValue(e)},r.useEffect=function(e,t){return l.current.useEffect(e,t)},r.useId=function(){return l.current.useId()},r.useImperativeHandle=function(e,t,n){return l.current.useImperativeHandle(e,t,n)},r.useInsertionEffect=function(e,t){return l.current.useInsertionEffect(e,t)},r.useLayoutEffect=function(e,t){return l.current.useLayoutEffect(e,t)},r.useMemo=function(e,t){return l.current.useMemo(e,t)},r.useReducer=function(e,t,n){return l.current.useReducer(e,t,n)},r.useRef=function(e){return l.current.useRef(e)},r.useState=function(e){return l.current.useState(e)},r.useSyncExternalStore=function(e,t,n){return l.current.useSyncExternalStore(e,t,n)},r.useTransition=function(){return l.current.useTransition()},r.version="18.3.1",r}var V;function Y(){return V||(V=1,k.exports=X()),k.exports}export{Y as r};
@@ -0,0 +1,9 @@
1
+ import{r as v}from"./index-yBjzXJbu.js";var i={exports:{}},t={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var p;function y(){if(p)return t;p=1;var R=v(),a=Symbol.for("react.element"),x=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,l=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function s(n,r,_){var e,o={},u=null,f=null;_!==void 0&&(u=""+_),r.key!==void 0&&(u=""+r.key),r.ref!==void 0&&(f=r.ref);for(e in r)c.call(r,e)&&!d.hasOwnProperty(e)&&(o[e]=r[e]);if(n&&n.defaultProps)for(e in r=n.defaultProps,r)o[e]===void 0&&(o[e]=r[e]);return{$$typeof:a,type:n,key:u,ref:f,props:o,_owner:l.current}}return t.Fragment=x,t.jsx=s,t.jsxs=s,t}var m;function O(){return m||(m=1,i.exports=y()),i.exports}var j=O();export{j};
@@ -0,0 +1,34 @@
1
+ import{d as P}from"./index-DrFu-skq.js";const{useEffect:_,useMemo:h}=__STORYBOOK_MODULE_PREVIEW_API__,{global:j}=__STORYBOOK_MODULE_GLOBAL__,{logger:X}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var p="backgrounds",U={light:{name:"light",value:"#F8F8F8"},dark:{name:"dark",value:"#333"}},{document:b,window:O}=j,D=()=>{var r;return!!((r=O==null?void 0:O.matchMedia("(prefers-reduced-motion: reduce)"))!=null&&r.matches)},A=r=>{(Array.isArray(r)?r:[r]).forEach(N)},N=r=>{var t;let e=b.getElementById(r);e&&((t=e.parentElement)==null||t.removeChild(e))},F=(r,e)=>{let t=b.getElementById(r);if(t)t.innerHTML!==e&&(t.innerHTML=e);else{let o=b.createElement("style");o.setAttribute("id",r),o.innerHTML=e,b.head.appendChild(o)}},Y=(r,e,t)=>{var a;let o=b.getElementById(r);if(o)o.innerHTML!==e&&(o.innerHTML=e);else{let d=b.createElement("style");d.setAttribute("id",r),d.innerHTML=e;let i=`addon-backgrounds-grid${t?`-docs-${t}`:""}`,n=b.getElementById(i);n?(a=n.parentElement)==null||a.insertBefore(d,n):b.head.appendChild(d)}},W={cellSize:100,cellAmount:10,opacity:.8},w="addon-backgrounds",R="addon-backgrounds-grid",q=D()?"":"transition: background-color 0.3s;",J=(r,e)=>{let{globals:t,parameters:o,viewMode:a,id:d}=e,{options:i=U,disable:n,grid:s=W}=o[p]||{},c=t[p]||{},u=c.value,l=u?i[u]:void 0,$=(l==null?void 0:l.value)||"transparent",f=c.grid||!1,y=!!l&&!n,m=a==="docs"?`#anchor--${d} .docs-story`:".sb-show-main",E=a==="docs"?`#anchor--${d} .docs-story`:".sb-show-main",H=o.layout===void 0||o.layout==="padded",L=a==="docs"?20:H?16:0,{cellAmount:k,cellSize:g,opacity:x,offsetX:v=L,offsetY:S=L}=s,B=a==="docs"?`${w}-docs-${d}`:`${w}-color`,G=a==="docs"?d:null;_(()=>{let M=`
2
+ ${m} {
3
+ background: ${$} !important;
4
+ ${q}
5
+ }`;if(!y){A(B);return}Y(B,M,G)},[m,B,G,y,$]);let T=a==="docs"?`${R}-docs-${d}`:`${R}`;return _(()=>{if(!f){A(T);return}let M=[`${g*k}px ${g*k}px`,`${g*k}px ${g*k}px`,`${g}px ${g}px`,`${g}px ${g}px`].join(", "),K=`
6
+ ${E} {
7
+ background-size: ${M} !important;
8
+ background-position: ${v}px ${S}px, ${v}px ${S}px, ${v}px ${S}px, ${v}px ${S}px !important;
9
+ background-blend-mode: difference !important;
10
+ background-image: linear-gradient(rgba(130, 130, 130, ${x}) 1px, transparent 1px),
11
+ linear-gradient(90deg, rgba(130, 130, 130, ${x}) 1px, transparent 1px),
12
+ linear-gradient(rgba(130, 130, 130, ${x/2}) 1px, transparent 1px),
13
+ linear-gradient(90deg, rgba(130, 130, 130, ${x/2}) 1px, transparent 1px) !important;
14
+ }
15
+ `;F(T,K)},[k,g,E,T,f,v,S,x]),r()},Q=(r,e=[],t)=>{if(r==="transparent")return"transparent";if(e.find(a=>a.value===r)||r)return r;let o=e.find(a=>a.name===t);if(o)return o.value;if(t){let a=e.map(d=>d.name).join(", ");X.warn(P`
16
+ Backgrounds Addon: could not find the default color "${t}".
17
+ These are the available colors for your story based on your configuration:
18
+ ${a}.
19
+ `)}return"transparent"},Z=(r,e)=>{var u;let{globals:t,parameters:o}=e,a=(u=t[p])==null?void 0:u.value,d=o[p],i=h(()=>d.disable?"transparent":Q(a,d.values,d.default),[d,a]),n=h(()=>i&&i!=="transparent",[i]),s=e.viewMode==="docs"?`#anchor--${e.id} .docs-story`:".sb-show-main",c=h(()=>`
20
+ ${s} {
21
+ background: ${i} !important;
22
+ ${D()?"":"transition: background-color 0.3s;"}
23
+ }
24
+ `,[i,s]);return _(()=>{let l=e.viewMode==="docs"?`addon-backgrounds-docs-${e.id}`:"addon-backgrounds-color";if(!n){A(l);return}Y(l,c,e.viewMode==="docs"?e.id:null)},[n,c,e]),r()},V=(r,e)=>{var y;let{globals:t,parameters:o}=e,a=o[p].grid,d=((y=t[p])==null?void 0:y.grid)===!0&&a.disable!==!0,{cellAmount:i,cellSize:n,opacity:s}=a,c=e.viewMode==="docs",u=o.layout===void 0||o.layout==="padded"?16:0,l=a.offsetX??(c?20:u),$=a.offsetY??(c?20:u),f=h(()=>{let m=e.viewMode==="docs"?`#anchor--${e.id} .docs-story`:".sb-show-main",E=[`${n*i}px ${n*i}px`,`${n*i}px ${n*i}px`,`${n}px ${n}px`,`${n}px ${n}px`].join(", ");return`
25
+ ${m} {
26
+ background-size: ${E} !important;
27
+ background-position: ${l}px ${$}px, ${l}px ${$}px, ${l}px ${$}px, ${l}px ${$}px !important;
28
+ background-blend-mode: difference !important;
29
+ background-image: linear-gradient(rgba(130, 130, 130, ${s}) 1px, transparent 1px),
30
+ linear-gradient(90deg, rgba(130, 130, 130, ${s}) 1px, transparent 1px),
31
+ linear-gradient(rgba(130, 130, 130, ${s/2}) 1px, transparent 1px),
32
+ linear-gradient(90deg, rgba(130, 130, 130, ${s/2}) 1px, transparent 1px) !important;
33
+ }
34
+ `},[n]);return _(()=>{let m=e.viewMode==="docs"?`addon-backgrounds-grid-docs-${e.id}`:"addon-backgrounds-grid";if(!d){A(m);return}F(m,f)},[d,f,e]),r()},C,ae=(C=globalThis.FEATURES)!=null&&C.backgroundsStoryGlobals?[J]:[V,Z],I,oe={[p]:{grid:{cellSize:20,opacity:.5,cellAmount:5},disable:!1,...!((I=globalThis.FEATURES)!=null&&I.backgroundsStoryGlobals)&&{values:Object.values(U)}}},ee={[p]:{value:void 0,grid:!1}},z,de=(z=globalThis.FEATURES)!=null&&z.backgroundsStoryGlobals?ee:{[p]:null};export{ae as decorators,de as initialGlobals,oe as parameters};
@@ -0,0 +1 @@
1
+ var j="Invariant failed";function S(e,t){if(!e)throw new Error(j)}const{useEffect:T}=__STORYBOOK_MODULE_PREVIEW_API__,{global:d}=__STORYBOOK_MODULE_GLOBAL__;var K="measureEnabled";function Y(){let e=d.document.documentElement,t=Math.max(e.scrollHeight,e.offsetHeight);return{width:Math.max(e.scrollWidth,e.offsetWidth),height:t}}function G(){let e=d.document.createElement("canvas");e.id="storybook-addon-measure";let t=e.getContext("2d");S(t!=null);let{width:o,height:l}=Y();return A(e,t,{width:o,height:l}),e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.zIndex="2147483647",e.style.pointerEvents="none",d.document.body.appendChild(e),{canvas:e,context:t,width:o,height:l}}function A(e,t,{width:o,height:l}){e.style.width=`${o}px`,e.style.height=`${l}px`;let i=d.window.devicePixelRatio;e.width=Math.floor(o*i),e.height=Math.floor(l*i),t.scale(i,i)}var h={};function U(){h.canvas||(h=G())}function H(){h.context&&h.context.clearRect(0,0,h.width??0,h.height??0)}function V(e){H(),e(h.context)}function Z(){S(h.canvas),S(h.context),A(h.canvas,h.context,{width:0,height:0});let{width:e,height:t}=Y();A(h.canvas,h.context,{width:e,height:t}),h.width=e,h.height=t}function J(){var e;h.canvas&&(H(),(e=h.canvas.parentNode)==null||e.removeChild(h.canvas),h={})}var w={margin:"#f6b26b",border:"#ffe599",padding:"#93c47d",content:"#6fa8dc",text:"#232020"},c=6;function W(e,{x:t,y:o,w:l,h:i,r:n}){t=t-l/2,o=o-i/2,l<2*n&&(n=l/2),i<2*n&&(n=i/2),e.beginPath(),e.moveTo(t+n,o),e.arcTo(t+l,o,t+l,o+i,n),e.arcTo(t+l,o+i,t,o+i,n),e.arcTo(t,o+i,t,o,n),e.arcTo(t,o,t+l,o,n),e.closePath()}function Q(e,{padding:t,border:o,width:l,height:i,top:n,left:r}){let f=l-o.left-o.right-t.left-t.right,a=i-t.top-t.bottom-o.top-o.bottom,s=r+o.left+t.left,u=n+o.top+t.top;return e==="top"?s+=f/2:e==="right"?(s+=f,u+=a/2):e==="bottom"?(s+=f/2,u+=a):e==="left"?u+=a/2:e==="center"&&(s+=f/2,u+=a/2),{x:s,y:u}}function x(e,t,{margin:o,border:l,padding:i},n,r){let f=m=>0,a=0,s=0,u=r?1:.5,g=r?n*2:0;return e==="padding"?f=m=>i[m]*u+g:e==="border"?f=m=>i[m]+l[m]*u+g:e==="margin"&&(f=m=>i[m]+l[m]+o[m]*u+g),t==="top"?s=-f("top"):t==="right"?a=f("right"):t==="bottom"?s=f("bottom"):t==="left"&&(a=-f("left")),{offsetX:a,offsetY:s}}function tt(e,t){return Math.abs(e.x-t.x)<Math.abs(e.w+t.w)/2&&Math.abs(e.y-t.y)<Math.abs(e.h+t.h)/2}function et(e,t,o){return e==="top"?t.y=o.y-o.h-c:e==="right"?t.x=o.x+o.w/2+c+t.w/2:e==="bottom"?t.y=o.y+o.h+c:e==="left"&&(t.x=o.x-o.w/2-c-t.w/2),{x:t.x,y:t.y}}function X(e,t,{x:o,y:l,w:i,h:n},r){return W(e,{x:o,y:l,w:i,h:n,r:3}),e.fillStyle=`${w[t]}dd`,e.fill(),e.strokeStyle=w[t],e.stroke(),e.fillStyle=w.text,e.fillText(r,o,l),W(e,{x:o,y:l,w:i,h:n,r:3}),e.fillStyle=`${w[t]}dd`,e.fill(),e.strokeStyle=w[t],e.stroke(),e.fillStyle=w.text,e.fillText(r,o,l),{x:o,y:l,w:i,h:n}}function C(e,t){e.font="600 12px monospace",e.textBaseline="middle",e.textAlign="center";let o=e.measureText(t),l=o.actualBoundingBoxAscent+o.actualBoundingBoxDescent,i=o.width+c*2,n=l+c*2;return{w:i,h:n}}function ot(e,t,{type:o,position:l="center",text:i},n,r=!1){let{x:f,y:a}=Q(l,t),{offsetX:s,offsetY:u}=x(o,l,t,c+1,r);f+=s,a+=u;let{w:g,h:m}=C(e,i);if(n&&tt({x:f,y:a,w:g,h:m},n)){let v=et(l,{x:f,y:a,w:g},n);f=v.x,a=v.y}return X(e,o,{x:f,y:a,w:g,h:m},i)}function it(e,{w:t,h:o}){let l=t*.5+c,i=o*.5+c;return{offsetX:(e.x==="left"?-1:1)*l,offsetY:(e.y==="top"?-1:1)*i}}function lt(e,t,{type:o,text:l}){let{floatingAlignment:i,extremities:n}=t,r=n[i.x],f=n[i.y],{w:a,h:s}=C(e,l),{offsetX:u,offsetY:g}=it(i,{w:a,h:s});return r+=u,f+=g,X(e,o,{x:r,y:f,w:a,h:s},l)}function E(e,t,o,l){let i=[];o.forEach((n,r)=>{let f=l&&n.position==="center"?lt(e,t,n):ot(e,t,n,i[r-1],l);i[r]=f})}function nt(e,t,o,l){let i=o.reduce((n,r)=>{var f;return Object.prototype.hasOwnProperty.call(n,r.position)||(n[r.position]=[]),(f=n[r.position])==null||f.push(r),n},{});i.top&&E(e,t,i.top,l),i.right&&E(e,t,i.right,l),i.bottom&&E(e,t,i.bottom,l),i.left&&E(e,t,i.left,l),i.center&&E(e,t,i.center,l)}var L={margin:"#f6b26ba8",border:"#ffe599a8",padding:"#93c47d8c",content:"#6fa8dca8"},B=30;function p(e){return parseInt(e.replace("px",""),10)}function b(e){return Number.isInteger(e)?e:e.toFixed(2)}function P(e){return e.filter(t=>t.text!==0&&t.text!=="0")}function ft(e){let t={top:d.window.scrollY,bottom:d.window.scrollY+d.window.innerHeight,left:d.window.scrollX,right:d.window.scrollX+d.window.innerWidth},o={top:Math.abs(t.top-e.top),bottom:Math.abs(t.bottom-e.bottom),left:Math.abs(t.left-e.left),right:Math.abs(t.right-e.right)};return{x:o.left>o.right?"left":"right",y:o.top>o.bottom?"top":"bottom"}}function rt(e){let t=d.getComputedStyle(e),{top:o,left:l,right:i,bottom:n,width:r,height:f}=e.getBoundingClientRect(),{marginTop:a,marginBottom:s,marginLeft:u,marginRight:g,paddingTop:m,paddingBottom:v,paddingLeft:k,paddingRight:F,borderBottomWidth:I,borderTopWidth:D,borderLeftWidth:$,borderRightWidth:N}=t;o=o+d.window.scrollY,l=l+d.window.scrollX,n=n+d.window.scrollY,i=i+d.window.scrollX;let y={top:p(a),bottom:p(s),left:p(u),right:p(g)},q={top:p(m),bottom:p(v),left:p(k),right:p(F)},z={top:p(D),bottom:p(I),left:p($),right:p(N)},_={top:o-y.top,bottom:n+y.bottom,left:l-y.left,right:i+y.right};return{margin:y,padding:q,border:z,top:o,left:l,bottom:n,right:i,width:r,height:f,extremities:_,floatingAlignment:ft(_)}}function at(e,{margin:t,width:o,height:l,top:i,left:n,bottom:r,right:f}){let a=l+t.bottom+t.top;e.fillStyle=L.margin,e.fillRect(n,i-t.top,o,t.top),e.fillRect(f,i-t.top,t.right,a),e.fillRect(n,r,o,t.bottom),e.fillRect(n-t.left,i-t.top,t.left,a);let s=[{type:"margin",text:b(t.top),position:"top"},{type:"margin",text:b(t.right),position:"right"},{type:"margin",text:b(t.bottom),position:"bottom"},{type:"margin",text:b(t.left),position:"left"}];return P(s)}function st(e,{padding:t,border:o,width:l,height:i,top:n,left:r,bottom:f,right:a}){let s=l-o.left-o.right,u=i-t.top-t.bottom-o.top-o.bottom;e.fillStyle=L.padding,e.fillRect(r+o.left,n+o.top,s,t.top),e.fillRect(a-t.right-o.right,n+t.top+o.top,t.right,u),e.fillRect(r+o.left,f-t.bottom-o.bottom,s,t.bottom),e.fillRect(r+o.left,n+t.top+o.top,t.left,u);let g=[{type:"padding",text:t.top,position:"top"},{type:"padding",text:t.right,position:"right"},{type:"padding",text:t.bottom,position:"bottom"},{type:"padding",text:t.left,position:"left"}];return P(g)}function ht(e,{border:t,width:o,height:l,top:i,left:n,bottom:r,right:f}){let a=l-t.top-t.bottom;e.fillStyle=L.border,e.fillRect(n,i,o,t.top),e.fillRect(n,r-t.bottom,o,t.bottom),e.fillRect(n,i+t.top,t.left,a),e.fillRect(f-t.right,i+t.top,t.right,a);let s=[{type:"border",text:t.top,position:"top"},{type:"border",text:t.right,position:"right"},{type:"border",text:t.bottom,position:"bottom"},{type:"border",text:t.left,position:"left"}];return P(s)}function ut(e,{padding:t,border:o,width:l,height:i,top:n,left:r}){let f=l-o.left-o.right-t.left-t.right,a=i-t.top-t.bottom-o.top-o.bottom;return e.fillStyle=L.content,e.fillRect(r+o.left+t.left,n+o.top+t.top,f,a),[{type:"content",position:"center",text:`${b(f)} x ${b(a)}`}]}function dt(e){return t=>{if(e&&t){let o=rt(e),l=at(t,o),i=st(t,o),n=ht(t,o),r=ut(t,o),f=o.width<=B*3||o.height<=B;nt(t,o,[...r,...i,...n,...l],f)}}}function mt(e){V(dt(e))}var gt=(e,t)=>{let o=d.document.elementFromPoint(e,t),l=i=>{if(i&&i.shadowRoot){let n=i.shadowRoot.elementFromPoint(e,t);return i.isEqualNode(n)?i:n.shadowRoot?l(n):n}return i};return l(o)||o},O,M={x:0,y:0};function R(e,t){O=gt(e,t),mt(O)}var pt=(e,t)=>{let{measureEnabled:o}=t.globals;return T(()=>{let l=i=>{window.requestAnimationFrame(()=>{i.stopPropagation(),M.x=i.clientX,M.y=i.clientY})};return document.addEventListener("pointermove",l),()=>{document.removeEventListener("pointermove",l)}},[]),T(()=>{let l=n=>{window.requestAnimationFrame(()=>{n.stopPropagation(),R(n.clientX,n.clientY)})},i=()=>{window.requestAnimationFrame(()=>{Z()})};return t.viewMode==="story"&&o&&(document.addEventListener("pointerover",l),U(),window.addEventListener("resize",i),R(M.x,M.y)),()=>{window.removeEventListener("resize",i),J()}},[o,t.viewMode]),e()},ct=[pt],wt={[K]:!1};export{ct as decorators,wt as initialGlobals};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DocsRenderer-CFRXHY34-i_W8iCu9.js","./iframe-CGBtu2Se.js","./index--qcDGAq6.js","./index-yBjzXJbu.js","./jsx-runtime-Cf8x2fCZ.js","./index-B_4m48Mv.js","./index-BLHw34Di.js","./index-DgH-xKnr.js","./index-DrFu-skq.js","./react-18-CALspjOX.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a}from"./iframe-CGBtu2Se.js";var i=Object.defineProperty,s=(e,r)=>{for(var t in r)i(e,t,{get:r[t],enumerable:!0})},_={};s(_,{parameters:()=>d});var p=Object.entries(globalThis.TAGS_OPTIONS??{}).reduce((e,r)=>{let[t,o]=r;return o.excludeFromDocsStories&&(e[t]=!0),e},{}),d={docs:{renderer:async()=>{let{DocsRenderer:e}=await a(()=>import("./DocsRenderer-CFRXHY34-i_W8iCu9.js").then(r=>r.D),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url);return new e},stories:{filter:e=>{var r;return(e.tags||[]).filter(t=>p[t]).length===0&&!((r=e.parameters.docs)!=null&&r.disable)}}}};export{d as parameters};
@@ -0,0 +1,396 @@
1
+ import{d as $}from"./index-DrFu-skq.js";const{useMemo:x,useEffect:f}=__STORYBOOK_MODULE_PREVIEW_API__,{global:p}=__STORYBOOK_MODULE_GLOBAL__;var m="outline",u=i=>{(Array.isArray(i)?i:[i]).forEach(r)},r=i=>{let t=typeof i=="string"?i:i.join(""),o=p.document.getElementById(t);o&&o.parentElement&&o.parentElement.removeChild(o)},b=(i,t)=>{let o=p.document.getElementById(i);if(o)o.innerHTML!==t&&(o.innerHTML=t);else{let n=p.document.createElement("style");n.setAttribute("id",i),n.innerHTML=t,p.document.head.appendChild(n)}};function s(i){return $`
2
+ ${i} body {
3
+ outline: 1px solid #2980b9 !important;
4
+ }
5
+
6
+ ${i} article {
7
+ outline: 1px solid #3498db !important;
8
+ }
9
+
10
+ ${i} nav {
11
+ outline: 1px solid #0088c3 !important;
12
+ }
13
+
14
+ ${i} aside {
15
+ outline: 1px solid #33a0ce !important;
16
+ }
17
+
18
+ ${i} section {
19
+ outline: 1px solid #66b8da !important;
20
+ }
21
+
22
+ ${i} header {
23
+ outline: 1px solid #99cfe7 !important;
24
+ }
25
+
26
+ ${i} footer {
27
+ outline: 1px solid #cce7f3 !important;
28
+ }
29
+
30
+ ${i} h1 {
31
+ outline: 1px solid #162544 !important;
32
+ }
33
+
34
+ ${i} h2 {
35
+ outline: 1px solid #314e6e !important;
36
+ }
37
+
38
+ ${i} h3 {
39
+ outline: 1px solid #3e5e85 !important;
40
+ }
41
+
42
+ ${i} h4 {
43
+ outline: 1px solid #449baf !important;
44
+ }
45
+
46
+ ${i} h5 {
47
+ outline: 1px solid #c7d1cb !important;
48
+ }
49
+
50
+ ${i} h6 {
51
+ outline: 1px solid #4371d0 !important;
52
+ }
53
+
54
+ ${i} main {
55
+ outline: 1px solid #2f4f90 !important;
56
+ }
57
+
58
+ ${i} address {
59
+ outline: 1px solid #1a2c51 !important;
60
+ }
61
+
62
+ ${i} div {
63
+ outline: 1px solid #036cdb !important;
64
+ }
65
+
66
+ ${i} p {
67
+ outline: 1px solid #ac050b !important;
68
+ }
69
+
70
+ ${i} hr {
71
+ outline: 1px solid #ff063f !important;
72
+ }
73
+
74
+ ${i} pre {
75
+ outline: 1px solid #850440 !important;
76
+ }
77
+
78
+ ${i} blockquote {
79
+ outline: 1px solid #f1b8e7 !important;
80
+ }
81
+
82
+ ${i} ol {
83
+ outline: 1px solid #ff050c !important;
84
+ }
85
+
86
+ ${i} ul {
87
+ outline: 1px solid #d90416 !important;
88
+ }
89
+
90
+ ${i} li {
91
+ outline: 1px solid #d90416 !important;
92
+ }
93
+
94
+ ${i} dl {
95
+ outline: 1px solid #fd3427 !important;
96
+ }
97
+
98
+ ${i} dt {
99
+ outline: 1px solid #ff0043 !important;
100
+ }
101
+
102
+ ${i} dd {
103
+ outline: 1px solid #e80174 !important;
104
+ }
105
+
106
+ ${i} figure {
107
+ outline: 1px solid #ff00bb !important;
108
+ }
109
+
110
+ ${i} figcaption {
111
+ outline: 1px solid #bf0032 !important;
112
+ }
113
+
114
+ ${i} table {
115
+ outline: 1px solid #00cc99 !important;
116
+ }
117
+
118
+ ${i} caption {
119
+ outline: 1px solid #37ffc4 !important;
120
+ }
121
+
122
+ ${i} thead {
123
+ outline: 1px solid #98daca !important;
124
+ }
125
+
126
+ ${i} tbody {
127
+ outline: 1px solid #64a7a0 !important;
128
+ }
129
+
130
+ ${i} tfoot {
131
+ outline: 1px solid #22746b !important;
132
+ }
133
+
134
+ ${i} tr {
135
+ outline: 1px solid #86c0b2 !important;
136
+ }
137
+
138
+ ${i} th {
139
+ outline: 1px solid #a1e7d6 !important;
140
+ }
141
+
142
+ ${i} td {
143
+ outline: 1px solid #3f5a54 !important;
144
+ }
145
+
146
+ ${i} col {
147
+ outline: 1px solid #6c9a8f !important;
148
+ }
149
+
150
+ ${i} colgroup {
151
+ outline: 1px solid #6c9a9d !important;
152
+ }
153
+
154
+ ${i} button {
155
+ outline: 1px solid #da8301 !important;
156
+ }
157
+
158
+ ${i} datalist {
159
+ outline: 1px solid #c06000 !important;
160
+ }
161
+
162
+ ${i} fieldset {
163
+ outline: 1px solid #d95100 !important;
164
+ }
165
+
166
+ ${i} form {
167
+ outline: 1px solid #d23600 !important;
168
+ }
169
+
170
+ ${i} input {
171
+ outline: 1px solid #fca600 !important;
172
+ }
173
+
174
+ ${i} keygen {
175
+ outline: 1px solid #b31e00 !important;
176
+ }
177
+
178
+ ${i} label {
179
+ outline: 1px solid #ee8900 !important;
180
+ }
181
+
182
+ ${i} legend {
183
+ outline: 1px solid #de6d00 !important;
184
+ }
185
+
186
+ ${i} meter {
187
+ outline: 1px solid #e8630c !important;
188
+ }
189
+
190
+ ${i} optgroup {
191
+ outline: 1px solid #b33600 !important;
192
+ }
193
+
194
+ ${i} option {
195
+ outline: 1px solid #ff8a00 !important;
196
+ }
197
+
198
+ ${i} output {
199
+ outline: 1px solid #ff9619 !important;
200
+ }
201
+
202
+ ${i} progress {
203
+ outline: 1px solid #e57c00 !important;
204
+ }
205
+
206
+ ${i} select {
207
+ outline: 1px solid #e26e0f !important;
208
+ }
209
+
210
+ ${i} textarea {
211
+ outline: 1px solid #cc5400 !important;
212
+ }
213
+
214
+ ${i} details {
215
+ outline: 1px solid #33848f !important;
216
+ }
217
+
218
+ ${i} summary {
219
+ outline: 1px solid #60a1a6 !important;
220
+ }
221
+
222
+ ${i} command {
223
+ outline: 1px solid #438da1 !important;
224
+ }
225
+
226
+ ${i} menu {
227
+ outline: 1px solid #449da6 !important;
228
+ }
229
+
230
+ ${i} del {
231
+ outline: 1px solid #bf0000 !important;
232
+ }
233
+
234
+ ${i} ins {
235
+ outline: 1px solid #400000 !important;
236
+ }
237
+
238
+ ${i} img {
239
+ outline: 1px solid #22746b !important;
240
+ }
241
+
242
+ ${i} iframe {
243
+ outline: 1px solid #64a7a0 !important;
244
+ }
245
+
246
+ ${i} embed {
247
+ outline: 1px solid #98daca !important;
248
+ }
249
+
250
+ ${i} object {
251
+ outline: 1px solid #00cc99 !important;
252
+ }
253
+
254
+ ${i} param {
255
+ outline: 1px solid #37ffc4 !important;
256
+ }
257
+
258
+ ${i} video {
259
+ outline: 1px solid #6ee866 !important;
260
+ }
261
+
262
+ ${i} audio {
263
+ outline: 1px solid #027353 !important;
264
+ }
265
+
266
+ ${i} source {
267
+ outline: 1px solid #012426 !important;
268
+ }
269
+
270
+ ${i} canvas {
271
+ outline: 1px solid #a2f570 !important;
272
+ }
273
+
274
+ ${i} track {
275
+ outline: 1px solid #59a600 !important;
276
+ }
277
+
278
+ ${i} map {
279
+ outline: 1px solid #7be500 !important;
280
+ }
281
+
282
+ ${i} area {
283
+ outline: 1px solid #305900 !important;
284
+ }
285
+
286
+ ${i} a {
287
+ outline: 1px solid #ff62ab !important;
288
+ }
289
+
290
+ ${i} em {
291
+ outline: 1px solid #800b41 !important;
292
+ }
293
+
294
+ ${i} strong {
295
+ outline: 1px solid #ff1583 !important;
296
+ }
297
+
298
+ ${i} i {
299
+ outline: 1px solid #803156 !important;
300
+ }
301
+
302
+ ${i} b {
303
+ outline: 1px solid #cc1169 !important;
304
+ }
305
+
306
+ ${i} u {
307
+ outline: 1px solid #ff0430 !important;
308
+ }
309
+
310
+ ${i} s {
311
+ outline: 1px solid #f805e3 !important;
312
+ }
313
+
314
+ ${i} small {
315
+ outline: 1px solid #d107b2 !important;
316
+ }
317
+
318
+ ${i} abbr {
319
+ outline: 1px solid #4a0263 !important;
320
+ }
321
+
322
+ ${i} q {
323
+ outline: 1px solid #240018 !important;
324
+ }
325
+
326
+ ${i} cite {
327
+ outline: 1px solid #64003c !important;
328
+ }
329
+
330
+ ${i} dfn {
331
+ outline: 1px solid #b4005a !important;
332
+ }
333
+
334
+ ${i} sub {
335
+ outline: 1px solid #dba0c8 !important;
336
+ }
337
+
338
+ ${i} sup {
339
+ outline: 1px solid #cc0256 !important;
340
+ }
341
+
342
+ ${i} time {
343
+ outline: 1px solid #d6606d !important;
344
+ }
345
+
346
+ ${i} code {
347
+ outline: 1px solid #e04251 !important;
348
+ }
349
+
350
+ ${i} kbd {
351
+ outline: 1px solid #5e001f !important;
352
+ }
353
+
354
+ ${i} samp {
355
+ outline: 1px solid #9c0033 !important;
356
+ }
357
+
358
+ ${i} var {
359
+ outline: 1px solid #d90047 !important;
360
+ }
361
+
362
+ ${i} mark {
363
+ outline: 1px solid #ff0053 !important;
364
+ }
365
+
366
+ ${i} bdi {
367
+ outline: 1px solid #bf3668 !important;
368
+ }
369
+
370
+ ${i} bdo {
371
+ outline: 1px solid #6f1400 !important;
372
+ }
373
+
374
+ ${i} ruby {
375
+ outline: 1px solid #ff7b93 !important;
376
+ }
377
+
378
+ ${i} rt {
379
+ outline: 1px solid #ff2f54 !important;
380
+ }
381
+
382
+ ${i} rp {
383
+ outline: 1px solid #803e49 !important;
384
+ }
385
+
386
+ ${i} span {
387
+ outline: 1px solid #cc2643 !important;
388
+ }
389
+
390
+ ${i} br {
391
+ outline: 1px solid #db687d !important;
392
+ }
393
+
394
+ ${i} wbr {
395
+ outline: 1px solid #db175b !important;
396
+ }`}var e=(i,t)=>{let{globals:o}=t,n=[!0,"true"].includes(o[m]),d=t.viewMode==="docs",l=x(()=>s(d?'[data-story-block="true"]':".sb-show-main"),[t]);return f(()=>{let a=d?`addon-outline-docs-${t.id}`:"addon-outline";return n?b(a,l):u(a),()=>{u(a)}},[n,l,t]),i()},h=[e],g={[m]:!1};export{h as decorators,g as initialGlobals};
@@ -0,0 +1 @@
1
+ var o="viewport",a={[o]:{value:void 0,isRotated:!1}},t={viewport:"reset",viewportRotated:!1},e,l=(e=globalThis.FEATURES)!=null&&e.viewportStoryGlobals?a:t;export{l as initialGlobals};
@@ -0,0 +1 @@
1
+ let p;const S=new Uint8Array(16);function A(){if(!p&&(p=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!p))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(S)}const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function D(e,t=0){return o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}const I=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),h={randomUUID:I};function f(e,t,r){if(h.randomUUID&&!e)return h.randomUUID();e=e||{};const n=e.random||(e.rng||A)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,D(n)}const{addons:v}=__STORYBOOK_MODULE_PREVIEW_API__,{ImplicitActionsDuringRendering:U}=__STORYBOOK_MODULE_CORE_EVENTS_PREVIEW_ERRORS__,{global:d}=__STORYBOOK_MODULE_GLOBAL__;var w="storybook/actions",j=`${w}/action-event`,V={depth:10,clearOnStoryChange:!0,limit:50},E=(e,t)=>{let r=Object.getPrototypeOf(e);return!r||t(r)?r:E(r,t)},C=e=>!!(typeof e=="object"&&e&&E(e,t=>/^Synthetic(?:Base)?Event$/.test(t.constructor.name))&&typeof e.persist=="function"),K=e=>{if(C(e)){let t=Object.create(e.constructor.prototype,Object.getOwnPropertyDescriptors(e));t.persist();let r=Object.getOwnPropertyDescriptor(t,"view"),n=r==null?void 0:r.value;return typeof n=="object"&&(n==null?void 0:n.constructor.name)==="Window"&&Object.defineProperty(t,"view",{...r,value:Object.create(n.constructor.prototype)}),t}return e},L=()=>typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?f():Date.now().toString(36)+Math.random().toString(36).substring(2);function _(e,t={}){let r={...V,...t},n=function(...s){var g,O;if(t.implicit){let y=(g="__STORYBOOK_PREVIEW__"in d?d.__STORYBOOK_PREVIEW__:void 0)==null?void 0:g.storyRenders.find(l=>l.phase==="playing"||l.phase==="rendering");if(y){let l=!((O=globalThis==null?void 0:globalThis.FEATURES)!=null&&O.disallowImplicitActionsInRenderV8),R=new U({phase:y.phase,name:e,deprecated:l});if(l)console.warn(R);else throw R}}let i=v.getChannel(),c=L(),a=5,u=s.map(K),b=s.length>1?u:u[0],x={id:c,count:0,data:{name:e,args:b},options:{...r,maxDepth:a+(r.depth||3),allowFunction:r.allowFunction||!1}};i.emit(j,x)};return n.isAction=!0,n.implicit=t.implicit,n}var T=(e,t)=>typeof t[e]>"u"&&!(e in t),B=e=>{let{initialArgs:t,argTypes:r,id:n,parameters:{actions:s}}=e;if(!s||s.disable||!s.argTypesRegex||!r)return{};let i=new RegExp(s.argTypesRegex);return Object.entries(r).filter(([c])=>!!i.test(c)).reduce((c,[a,u])=>(T(a,t)&&(c[a]=_(a,{implicit:!0,id:n})),c),{})},M=e=>{let{initialArgs:t,argTypes:r,parameters:{actions:n}}=e;return n!=null&&n.disable||!r?{}:Object.entries(r).filter(([s,i])=>!!i.action).reduce((s,[i,c])=>(T(i,t)&&(s[i]=_(typeof c.action=="string"?c.action:i)),s),{})},Y=[M,B],m=!1,P=e=>{let{parameters:{actions:t}}=e;if(!(t!=null&&t.disable)&&!m&&"__STORYBOOK_TEST_ON_MOCK_CALL__"in d&&typeof d.__STORYBOOK_TEST_ON_MOCK_CALL__=="function"){let r=d.__STORYBOOK_TEST_ON_MOCK_CALL__;r((n,s)=>{let i=n.getMockName();i!=="spy"&&(!/^next\/.*::/.test(i)||["next/router::useRouter()","next/navigation::useRouter()","next/navigation::redirect","next/cache::","next/headers::cookies().set","next/headers::cookies().delete","next/headers::headers().set","next/headers::headers().delete"].some(c=>i.startsWith(c)))&&_(i)(s)}),m=!0}},N=[P];export{Y as argsEnhancers,N as loaders};
@@ -0,0 +1,7 @@
1
+ const{STORY_CHANGED:r}=__STORYBOOK_MODULE_CORE_EVENTS__,{addons:s}=__STORYBOOK_MODULE_PREVIEW_API__,{global:O}=__STORYBOOK_MODULE_GLOBAL__;var d="storybook/highlight",i="storybookHighlight",g=`${d}/add`,E=`${d}/reset`,{document:l}=O,H=(e="#FF4785",t="dashed")=>`
2
+ outline: 2px ${t} ${e};
3
+ outline-offset: 2px;
4
+ box-shadow: 0 0 0 6px rgba(255,255,255,0.6);
5
+ `,h=s.getChannel(),T=e=>{let t=i;n();let o=Array.from(new Set(e.elements)),_=l.createElement("style");_.setAttribute("id",t),_.innerHTML=o.map(a=>`${a}{
6
+ ${H(e.color,e.style)}
7
+ }`).join(" "),l.head.appendChild(_)},n=()=>{var o;let e=i,t=l.getElementById(e);t&&((o=t.parentNode)==null||o.removeChild(t))};h.on(r,n);h.on(E,n);h.on(g,T);
@@ -0,0 +1 @@
1
+ const{makeDecorator:O,addons:_}=__STORYBOOK_MODULE_PREVIEW_API__,{STORY_CHANGED:l,SELECT_STORY:E}=__STORYBOOK_MODULE_CORE_EVENTS__,{global:L}=__STORYBOOK_MODULE_GLOBAL__;var c="links",{document:s,HTMLElement:v}=L,d=e=>_.getChannel().emit(E,e),i=e=>{let{target:t}=e;if(!(t instanceof v))return;let o=t,{sbKind:a,sbStory:r}=o.dataset;(a||r)&&(e.preventDefault(),d({kind:a,story:r}))},n=!1,m=()=>{n||(n=!0,s.addEventListener("click",i))},k=()=>{n&&(n=!1,s.removeEventListener("click",i))},R=O({name:"withLinks",parameterName:c,wrapper:(e,t)=>(m(),_.getChannel().once(l,k),e(t))}),S=[R];export{S as decorators};
@@ -0,0 +1 @@
1
+ var Qe=t=>{throw TypeError(t)};var Se=(t,e,s)=>e.has(t)||Qe("Cannot "+s);var i=(t,e,s)=>(Se(t,e,"read from private field"),s?s.call(t):e.get(t)),l=(t,e,s)=>e.has(t)?Qe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),u=(t,e,s,r)=>(Se(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s),S=(t,e,s)=>(Se(t,e,"access private method"),s);var ve=(t,e,s,r)=>({set _(n){u(t,e,n,s)},get _(){return i(t,e,r)}});import{j as k}from"./jsx-runtime-Cf8x2fCZ.js";import{r as T,R as nt}from"./index--qcDGAq6.js";import{c as at,u as ot,a as ut,g as Re,r as ct,t as ht,T as lt,b as dt,H as ft,d as yt,e as Xe,f as mt}from"./ToastContext-Bty1K7ya.js";import"./index-B_4m48Mv.js";import"./index-yBjzXJbu.js";import"./en-US-BukEqXxE.js";import"./index-BLHw34Di.js";const pt=at({root:{base:"flex w-full max-w-xs items-center rounded-lg bg-white p-4 text-gray-500 shadow dark:bg-gray-800 dark:text-gray-400",closed:"opacity-0 ease-out"},toggle:{base:"-m-1.5 ml-auto inline-flex h-8 w-8 rounded-lg bg-white p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white",icon:"h-5 w-5 shrink-0"}}),gt=T.createContext(void 0),bt={75:"duration-75",100:"duration-100",150:"duration-150",200:"duration-200",300:"duration-300",500:"duration-500",700:"duration-700",1e3:"duration-1000"},We=T.forwardRef((t,e)=>{var y,b;const[s,r]=T.useState(!1),[n,o]=T.useState(!1),h=ot(),a=ut([pt,(y=h.theme)==null?void 0:y.toast,t.theme],[Re(h.clearTheme,"toast"),t.clearTheme],[Re(h.applyTheme,"toast"),t.applyTheme]),{className:d,duration:m=300,...p}=ct(t,(b=h.props)==null?void 0:b.toast);return n?null:k.jsx(gt.Provider,{value:{theme:t.theme,clearTheme:t.clearTheme,applyTheme:t.applyTheme,duration:m,isClosed:s,isRemoved:n,setIsClosed:r,setIsRemoved:o},children:k.jsx("div",{ref:e,"data-testid":"flowbite-toast",role:"alert",className:ht(a.root.base,bt[m],s&&a.root.closed,d),...p})})});We.displayName="Toast";const vt={success:mt,error:Xe,warning:yt,info:ft},wt={success:{bg:"bg-green-50 dark:bg-green-800",icon:"bg-green-100 text-green-500 dark:bg-green-700 dark:text-green-200",text:"text-green-800 dark:text-green-200",border:"border-green-200 dark:border-green-700"},error:{bg:"bg-red-50 dark:bg-red-800",icon:"bg-red-100 text-red-500 dark:bg-red-700 dark:text-red-200",text:"text-red-800 dark:text-red-200",border:"border-red-200 dark:border-red-700"},warning:{bg:"bg-amber-50 dark:bg-amber-800",icon:"bg-amber-100 text-amber-500 dark:bg-amber-700 dark:text-amber-200",text:"text-amber-800 dark:text-amber-200",border:"border-amber-200 dark:border-amber-700"},info:{bg:"bg-blue-50 dark:bg-blue-800",icon:"bg-blue-100 text-blue-500 dark:bg-blue-700 dark:text-blue-200",text:"text-blue-800 dark:text-blue-200",border:"border-blue-200 dark:border-blue-700"}},xt=({toast:t,onRemove:e})=>{const[s,r]=T.useState(!1),n=T.useRef(null),o=T.useRef(Date.now()),h=T.useRef(t.duration||2e3),a=T.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]),d=T.useCallback(()=>{a(),o.current=Date.now(),n.current=setTimeout(()=>{e(t.id)},h.current)},[a,e,t.id]),m=T.useCallback(()=>{s||(a(),h.current=h.current-(Date.now()-o.current),r(!0))},[s,a]),p=T.useCallback(()=>{s&&r(!1)},[s]);T.useEffect(()=>(d(),()=>a()),[d,a]),T.useEffect(()=>(s||d(),()=>a()),[s,d,a]);const y=wt[t.type];return k.jsxs(We,{className:`border ${y.bg} ${y.border}`,onMouseEnter:m,onMouseLeave:p,children:[k.jsx("div",{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${y.icon}`,children:nt.createElement(vt[t.type],{className:"h-5 w-5","aria-hidden":!0})}),k.jsx("div",{className:`ml-3 text-sm font-normal ${y.text}`,children:t.message}),k.jsx("button",{type:"button",onClick:()=>e(t.id),className:`ml-auto -mx-1.5 -my-1.5 rounded-lg p-1.5 inline-flex items-center justify-center h-8 w-8 hover:bg-gray-100 dark:hover:bg-gray-700 ${y.text}`,"aria-label":"Close",children:k.jsx(Xe,{className:"h-5 w-5"})})]},t.id)},Ct=()=>{const{toasts:t,removeToast:e}=dt();return k.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:t.map(s=>k.jsx(xt,{toast:s,onRemove:e},s.id))})},Pt=({children:t})=>k.jsxs(lt,{children:[k.jsx(Ct,{}),t]});var Ce=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},St={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},$,ke,Le,Tt=(Le=class{constructor(){l(this,$,St);l(this,ke,!1)}setTimeoutProvider(t){u(this,$,t)}setTimeout(t,e){return i(this,$).setTimeout(t,e)}clearTimeout(t){i(this,$).clearTimeout(t)}setInterval(t,e){return i(this,$).setInterval(t,e)}clearInterval(t){i(this,$).clearInterval(t)}},$=new WeakMap,ke=new WeakMap,Le),Te=new Tt;function Ft(t){setTimeout(t,0)}var Pe=typeof window>"u"||"Deno"in globalThis;function q(){}function Ot(t,e){return typeof t=="function"?t(e):t}function Mt(t){return typeof t=="number"&&t>=0&&t!==1/0}function kt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Fe(t,e){return typeof t=="function"?t(e):t}function jt(t,e){return typeof t=="function"?t(e):t}function Ee(t,e){const{type:s="all",exact:r,fetchStatus:n,predicate:o,queryKey:h,stale:a}=t;if(h){if(r){if(e.queryHash!==je(h,e.options))return!1}else if(!ye(e.queryKey,h))return!1}if(s!=="all"){const d=e.isActive();if(s==="active"&&!d||s==="inactive"&&d)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||n&&n!==e.state.fetchStatus||o&&!o(e))}function qe(t,e){const{exact:s,status:r,predicate:n,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(s){if(fe(e.options.mutationKey)!==fe(o))return!1}else if(!ye(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||n&&!n(e))}function je(t,e){return((e==null?void 0:e.queryKeyHashFn)||fe)(t)}function fe(t){return JSON.stringify(t,(e,s)=>Oe(s)?Object.keys(s).sort().reduce((r,n)=>(r[n]=s[n],r),{}):s)}function ye(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(s=>ye(t[s],e[s])):!1}var Dt=Object.prototype.hasOwnProperty;function Ye(t,e){if(t===e)return t;const s=Ae(t)&&Ae(e);if(!s&&!(Oe(t)&&Oe(e)))return e;const n=(s?t:Object.keys(t)).length,o=s?e:Object.keys(e),h=o.length,a=s?new Array(h):{};let d=0;for(let m=0;m<h;m++){const p=s?m:o[m],y=t[p],b=e[p];if(y===b){a[p]=y,(s?m<n:Dt.call(t,p))&&d++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){a[p]=b;continue}const j=Ye(y,b);a[p]=j,j===y&&d++}return n===h&&d===n?t:a}function Ae(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Oe(t){if(!Ie(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!Ie(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Ie(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qt(t){return new Promise(e=>{Te.setTimeout(e,t)})}function Rt(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?Ye(t,e):e}function Et(t,e,s=0){const r=[...t,e];return s&&r.length>s?r.slice(1):r}function qt(t,e,s=0){const r=[e,...t];return s&&r.length>s?r.slice(0,-1):r}var De=Symbol();function et(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===De?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var W,B,ie,Ge,At=(Ge=class extends Ce{constructor(){super();l(this,W);l(this,B);l(this,ie);u(this,ie,e=>{if(!Pe&&window.addEventListener){const s=()=>e();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){i(this,B)||this.setEventListener(i(this,ie))}onUnsubscribe(){var e;this.hasListeners()||((e=i(this,B))==null||e.call(this),u(this,B,void 0))}setEventListener(e){var s;u(this,ie,e),(s=i(this,B))==null||s.call(this),u(this,B,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){i(this,W)!==e&&(u(this,W,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(s=>{s(e)})}isFocused(){var e;return typeof i(this,W)=="boolean"?i(this,W):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},W=new WeakMap,B=new WeakMap,ie=new WeakMap,Ge),tt=new At;function It(){let t,e;const s=new Promise((n,o)=>{t=n,e=o});s.status="pending",s.catch(()=>{});function r(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{r({status:"fulfilled",value:n}),t(n)},s.reject=n=>{r({status:"rejected",reason:n}),e(n)},s}var Ut=Ft;function Kt(){let t=[],e=0,s=a=>{a()},r=a=>{a()},n=Ut;const o=a=>{e?t.push(a):n(()=>{s(a)})},h=()=>{const a=t;t=[],a.length&&n(()=>{r(()=>{a.forEach(d=>{s(d)})})})};return{batch:a=>{let d;e++;try{d=a()}finally{e--,e||h()}return d},batchCalls:a=>(...d)=>{o(()=>{a(...d)})},schedule:o,setNotifyFunction:a=>{s=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{n=a}}}var M=Kt(),ne,z,ae,$e,Ht=($e=class extends Ce{constructor(){super();l(this,ne,!0);l(this,z);l(this,ae);u(this,ae,e=>{if(!Pe&&window.addEventListener){const s=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){i(this,z)||this.setEventListener(i(this,ae))}onUnsubscribe(){var e;this.hasListeners()||((e=i(this,z))==null||e.call(this),u(this,z,void 0))}setEventListener(e){var s;u(this,ae,e),(s=i(this,z))==null||s.call(this),u(this,z,e(this.setOnline.bind(this)))}setOnline(e){i(this,ne)!==e&&(u(this,ne,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return i(this,ne)}},ne=new WeakMap,z=new WeakMap,ae=new WeakMap,$e),xe=new Ht;function Nt(t){return Math.min(1e3*2**t,3e4)}function st(t){return(t??"online")==="online"?xe.isOnline():!0}var Me=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function rt(t){let e=!1,s=0,r;const n=It(),o=()=>n.status!=="pending",h=f=>{var x;if(!o()){const w=new Me(f);b(w),(x=t.onCancel)==null||x.call(t,w)}},a=()=>{e=!0},d=()=>{e=!1},m=()=>tt.isFocused()&&(t.networkMode==="always"||xe.isOnline())&&t.canRun(),p=()=>st(t.networkMode)&&t.canRun(),y=f=>{o()||(r==null||r(),n.resolve(f))},b=f=>{o()||(r==null||r(),n.reject(f))},j=()=>new Promise(f=>{var x;r=w=>{(o()||m())&&f(w)},(x=t.onPause)==null||x.call(t)}).then(()=>{var f;r=void 0,o()||(f=t.onContinue)==null||f.call(t)}),Q=()=>{if(o())return;let f;const x=s===0?t.initialPromise:void 0;try{f=x??t.fn()}catch(w){f=Promise.reject(w)}Promise.resolve(f).then(y).catch(w=>{var E;if(o())return;const D=t.retry??(Pe?0:3),v=t.retryDelay??Nt,c=typeof v=="function"?v(s,w):v,F=D===!0||typeof D=="number"&&s<D||typeof D=="function"&&D(s,w);if(e||!F){b(w);return}s++,(E=t.onFail)==null||E.call(t,s,w),Qt(c).then(()=>m()?void 0:j()).then(()=>{e?b(w):Q()})})};return{promise:n,status:()=>n.status,cancel:h,continue:()=>(r==null||r(),n),cancelRetry:a,continueRetry:d,canStart:p,start:()=>(p()?Q():j().then(Q),n)}}var Y,Be,it=(Be=class{constructor(){l(this,Y)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mt(this.gcTime)&&u(this,Y,Te.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Pe?1/0:300*1e3))}clearGcTimeout(){i(this,Y)&&(Te.clearTimeout(i(this,Y)),u(this,Y,void 0))}},Y=new WeakMap,Be),ee,oe,R,te,P,me,se,A,N,ze,Lt=(ze=class extends it{constructor(e){super();l(this,A);l(this,ee);l(this,oe);l(this,R);l(this,te);l(this,P);l(this,me);l(this,se);u(this,se,!1),u(this,me,e.defaultOptions),this.setOptions(e.options),this.observers=[],u(this,te,e.client),u(this,R,i(this,te).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,u(this,ee,Ke(this.options)),this.state=e.state??i(this,ee),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=i(this,P))==null?void 0:e.promise}setOptions(e){if(this.options={...i(this,me),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Ke(this.options);s.data!==void 0&&(this.setState(Ue(s.data,s.dataUpdatedAt)),u(this,ee,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&i(this,R).remove(this)}setData(e,s){const r=Rt(this.state.data,e,this.options);return S(this,A,N).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(e,s){S(this,A,N).call(this,{type:"setState",state:e,setStateOptions:s})}cancel(e){var r,n;const s=(r=i(this,P))==null?void 0:r.promise;return(n=i(this,P))==null||n.cancel(e),s?s.then(q).catch(q):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(i(this,ee))}isActive(){return this.observers.some(e=>jt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===De||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Fe(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!kt(this.state.dataUpdatedAt,e)}onFocus(){var s;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(s=i(this,P))==null||s.continue()}onOnline(){var s;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(s=i(this,P))==null||s.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),i(this,R).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(s=>s!==e),this.observers.length||(i(this,P)&&(i(this,se)?i(this,P).cancel({revert:!0}):i(this,P).cancelRetry()),this.scheduleGc()),i(this,R).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||S(this,A,N).call(this,{type:"invalidate"})}async fetch(e,s){var d,m,p,y,b,j,Q,f,x,w,D,v;if(this.state.fetchStatus!=="idle"&&((d=i(this,P))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(i(this,P))return i(this,P).continueRetry(),i(this,P).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(F=>F.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,n=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(u(this,se,!0),r.signal)})},o=()=>{const c=et(this.options,s),E=(()=>{const J={client:i(this,te),queryKey:this.queryKey,meta:this.meta};return n(J),J})();return u(this,se,!1),this.options.persister?this.options.persister(c,E,this):c(E)},a=(()=>{const c={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:i(this,te),state:this.state,fetchFn:o};return n(c),c})();(m=this.options.behavior)==null||m.onFetch(a,this),u(this,oe,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=a.fetchOptions)==null?void 0:p.meta))&&S(this,A,N).call(this,{type:"fetch",meta:(y=a.fetchOptions)==null?void 0:y.meta}),u(this,P,rt({initialPromise:s==null?void 0:s.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof Me&&c.revert&&this.setState({...i(this,oe),fetchStatus:"idle"}),r.abort()},onFail:(c,F)=>{S(this,A,N).call(this,{type:"failed",failureCount:c,error:F})},onPause:()=>{S(this,A,N).call(this,{type:"pause"})},onContinue:()=>{S(this,A,N).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const c=await i(this,P).start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),(j=(b=i(this,R).config).onSuccess)==null||j.call(b,c,this),(f=(Q=i(this,R).config).onSettled)==null||f.call(Q,c,this.state.error,this),c}catch(c){if(c instanceof Me){if(c.silent)return i(this,P).promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw S(this,A,N).call(this,{type:"error",error:c}),(w=(x=i(this,R).config).onError)==null||w.call(x,c,this),(v=(D=i(this,R).config).onSettled)==null||v.call(D,this.state.data,c,this),c}finally{this.scheduleGc()}}},ee=new WeakMap,oe=new WeakMap,R=new WeakMap,te=new WeakMap,P=new WeakMap,me=new WeakMap,se=new WeakMap,A=new WeakSet,N=function(e){const s=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Gt(r.data,this.options),fetchMeta:e.meta??null};case"success":const n={...r,...Ue(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return u(this,oe,e.manual?n:void 0),n;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),i(this,R).notify({query:this,type:"updated",action:e})})},ze);function Gt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:st(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Ue(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ke(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,r=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}function He(t){return{onFetch:(e,s)=>{var p,y,b,j,Q;const r=e.options,n=(b=(y=(p=e.fetchOptions)==null?void 0:p.meta)==null?void 0:y.fetchMore)==null?void 0:b.direction,o=((j=e.state.data)==null?void 0:j.pages)||[],h=((Q=e.state.data)==null?void 0:Q.pageParams)||[];let a={pages:[],pageParams:[]},d=0;const m=async()=>{let f=!1;const x=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},w=et(e.options,e.fetchOptions),D=async(v,c,F)=>{if(f)return Promise.reject();if(c==null&&v.pages.length)return Promise.resolve(v);const J=(()=>{const X={client:e.client,queryKey:e.queryKey,pageParam:c,direction:F?"backward":"forward",meta:e.options.meta};return x(X),X})(),be=await w(J),{maxPages:de}=e.options,C=F?qt:Et;return{pages:C(v.pages,be,de),pageParams:C(v.pageParams,c,de)}};if(n&&o.length){const v=n==="backward",c=v?$t:Ne,F={pages:o,pageParams:h},E=c(r,F);a=await D(F,E,v)}else{const v=t??o.length;do{const c=d===0?h[0]??r.initialPageParam:Ne(r,a);if(d>0&&c==null)break;a=await D(a,c),d++}while(d<v)}return a};e.options.persister?e.fetchFn=()=>{var f,x;return(x=(f=e.options).persister)==null?void 0:x.call(f,m,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s)}:e.fetchFn=m}}}function Ne(t,{pages:e,pageParams:s}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,s[r],s):void 0}function $t(t,{pages:e,pageParams:s}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,s[0],s):void 0}var pe,U,O,re,K,G,_e,Bt=(_e=class extends it{constructor(e){super();l(this,K);l(this,pe);l(this,U);l(this,O);l(this,re);u(this,pe,e.client),this.mutationId=e.mutationId,u(this,O,e.mutationCache),u(this,U,[]),this.state=e.state||zt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){i(this,U).includes(e)||(i(this,U).push(e),this.clearGcTimeout(),i(this,O).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){u(this,U,i(this,U).filter(s=>s!==e)),this.scheduleGc(),i(this,O).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){i(this,U).length||(this.state.status==="pending"?this.scheduleGc():i(this,O).remove(this))}continue(){var e;return((e=i(this,re))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var h,a,d,m,p,y,b,j,Q,f,x,w,D,v,c,F,E,J,be,de;const s=()=>{S(this,K,G).call(this,{type:"continue"})},r={client:i(this,pe),meta:this.options.meta,mutationKey:this.options.mutationKey};u(this,re,rt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(C,X)=>{S(this,K,G).call(this,{type:"failed",failureCount:C,error:X})},onPause:()=>{S(this,K,G).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>i(this,O).canRun(this)}));const n=this.state.status==="pending",o=!i(this,re).canStart();try{if(n)s();else{S(this,K,G).call(this,{type:"pending",variables:e,isPaused:o}),await((a=(h=i(this,O).config).onMutate)==null?void 0:a.call(h,e,this,r));const X=await((m=(d=this.options).onMutate)==null?void 0:m.call(d,e,r));X!==this.state.context&&S(this,K,G).call(this,{type:"pending",context:X,variables:e,isPaused:o})}const C=await i(this,re).start();return await((y=(p=i(this,O).config).onSuccess)==null?void 0:y.call(p,C,e,this.state.context,this,r)),await((j=(b=this.options).onSuccess)==null?void 0:j.call(b,C,e,this.state.context,r)),await((f=(Q=i(this,O).config).onSettled)==null?void 0:f.call(Q,C,null,this.state.variables,this.state.context,this,r)),await((w=(x=this.options).onSettled)==null?void 0:w.call(x,C,null,e,this.state.context,r)),S(this,K,G).call(this,{type:"success",data:C}),C}catch(C){try{throw await((v=(D=i(this,O).config).onError)==null?void 0:v.call(D,C,e,this.state.context,this,r)),await((F=(c=this.options).onError)==null?void 0:F.call(c,C,e,this.state.context,r)),await((J=(E=i(this,O).config).onSettled)==null?void 0:J.call(E,void 0,C,this.state.variables,this.state.context,this,r)),await((de=(be=this.options).onSettled)==null?void 0:de.call(be,void 0,C,e,this.state.context,r)),C}finally{S(this,K,G).call(this,{type:"error",error:C})}}finally{i(this,O).runNext(this)}}},pe=new WeakMap,U=new WeakMap,O=new WeakMap,re=new WeakMap,K=new WeakSet,G=function(e){const s=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{i(this,U).forEach(r=>{r.onMutationUpdate(e)}),i(this,O).notify({mutation:this,type:"updated",action:e})})},_e);function zt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var L,I,ge,Ve,_t=(Ve=class extends Ce{constructor(e={}){super();l(this,L);l(this,I);l(this,ge);this.config=e,u(this,L,new Set),u(this,I,new Map),u(this,ge,0)}build(e,s,r){const n=new Bt({client:e,mutationCache:this,mutationId:++ve(this,ge)._,options:e.defaultMutationOptions(s),state:r});return this.add(n),n}add(e){i(this,L).add(e);const s=we(e);if(typeof s=="string"){const r=i(this,I).get(s);r?r.push(e):i(this,I).set(s,[e])}this.notify({type:"added",mutation:e})}remove(e){if(i(this,L).delete(e)){const s=we(e);if(typeof s=="string"){const r=i(this,I).get(s);if(r)if(r.length>1){const n=r.indexOf(e);n!==-1&&r.splice(n,1)}else r[0]===e&&i(this,I).delete(s)}}this.notify({type:"removed",mutation:e})}canRun(e){const s=we(e);if(typeof s=="string"){const r=i(this,I).get(s),n=r==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===e}else return!0}runNext(e){var r;const s=we(e);if(typeof s=="string"){const n=(r=i(this,I).get(s))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){M.batch(()=>{i(this,L).forEach(e=>{this.notify({type:"removed",mutation:e})}),i(this,L).clear(),i(this,I).clear()})}getAll(){return Array.from(i(this,L))}find(e){const s={exact:!0,...e};return this.getAll().find(r=>qe(s,r))}findAll(e={}){return this.getAll().filter(s=>qe(e,s))}notify(e){M.batch(()=>{this.listeners.forEach(s=>{s(e)})})}resumePausedMutations(){const e=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(e.map(s=>s.continue().catch(q))))}},L=new WeakMap,I=new WeakMap,ge=new WeakMap,Ve);function we(t){var e;return(e=t.options.scope)==null?void 0:e.id}var H,Ze,Vt=(Ze=class extends Ce{constructor(e={}){super();l(this,H);this.config=e,u(this,H,new Map)}build(e,s,r){const n=s.queryKey,o=s.queryHash??je(n,s);let h=this.get(o);return h||(h=new Lt({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(s),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(h)),h}add(e){i(this,H).has(e.queryHash)||(i(this,H).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const s=i(this,H).get(e.queryHash);s&&(e.destroy(),s===e&&i(this,H).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){M.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return i(this,H).get(e)}getAll(){return[...i(this,H).values()]}find(e){const s={exact:!0,...e};return this.getAll().find(r=>Ee(s,r))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(r=>Ee(e,r)):s}notify(e){M.batch(()=>{this.listeners.forEach(s=>{s(e)})})}onFocus(){M.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},H=new WeakMap,Ze),g,_,V,ue,ce,Z,he,le,Je,Zt=(Je=class{constructor(t={}){l(this,g);l(this,_);l(this,V);l(this,ue);l(this,ce);l(this,Z);l(this,he);l(this,le);u(this,g,t.queryCache||new Vt),u(this,_,t.mutationCache||new _t),u(this,V,t.defaultOptions||{}),u(this,ue,new Map),u(this,ce,new Map),u(this,Z,0)}mount(){ve(this,Z)._++,i(this,Z)===1&&(u(this,he,tt.subscribe(async t=>{t&&(await this.resumePausedMutations(),i(this,g).onFocus())})),u(this,le,xe.subscribe(async t=>{t&&(await this.resumePausedMutations(),i(this,g).onOnline())})))}unmount(){var t,e;ve(this,Z)._--,i(this,Z)===0&&((t=i(this,he))==null||t.call(this),u(this,he,void 0),(e=i(this,le))==null||e.call(this),u(this,le,void 0))}isFetching(t){return i(this,g).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return i(this,_).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=i(this,g).get(e.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=i(this,g).build(this,e),r=s.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Fe(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return i(this,g).findAll(t).map(({queryKey:e,state:s})=>{const r=s.data;return[e,r]})}setQueryData(t,e,s){const r=this.defaultQueryOptions({queryKey:t}),n=i(this,g).get(r.queryHash),o=n==null?void 0:n.state.data,h=Ot(e,o);if(h!==void 0)return i(this,g).build(this,r).setData(h,{...s,manual:!0})}setQueriesData(t,e,s){return M.batch(()=>i(this,g).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,s)]))}getQueryState(t){var s;const e=this.defaultQueryOptions({queryKey:t});return(s=i(this,g).get(e.queryHash))==null?void 0:s.state}removeQueries(t){const e=i(this,g);M.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=i(this,g);return M.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},r=M.batch(()=>i(this,g).findAll(t).map(n=>n.cancel(s)));return Promise.all(r).then(q).catch(q)}invalidateQueries(t,e={}){return M.batch(()=>(i(this,g).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},r=M.batch(()=>i(this,g).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let o=n.fetch(void 0,s);return s.throwOnError||(o=o.catch(q)),n.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(q)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=i(this,g).build(this,e);return s.isStaleByTime(Fe(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(q).catch(q)}fetchInfiniteQuery(t){return t.behavior=He(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(q).catch(q)}ensureInfiniteQueryData(t){return t.behavior=He(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return xe.isOnline()?i(this,_).resumePausedMutations():Promise.resolve()}getQueryCache(){return i(this,g)}getMutationCache(){return i(this,_)}getDefaultOptions(){return i(this,V)}setDefaultOptions(t){u(this,V,t)}setQueryDefaults(t,e){i(this,ue).set(fe(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...i(this,ue).values()],s={};return e.forEach(r=>{ye(t,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(t,e){i(this,ce).set(fe(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...i(this,ce).values()],s={};return e.forEach(r=>{ye(t,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...i(this,V).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=je(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===De&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...i(this,V).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){i(this,g).clear(),i(this,_).clear()}},g=new WeakMap,_=new WeakMap,V=new WeakMap,ue=new WeakMap,ce=new WeakMap,Z=new WeakMap,he=new WeakMap,le=new WeakMap,Je),Jt=T.createContext(void 0),Xt=({client:t,children:e})=>(T.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),k.jsx(Jt.Provider,{value:t,children:e}));const Wt=new Zt({defaultOptions:{queries:{retry:!1}}}),os={parameters:{actions:{argTypesRegex:"^on[A-Z].*"},controls:{matchers:{color:/(background|color)$/i,date:/Date$/}},docs:{toc:!0}},tags:["autodocs"],decorators:[t=>k.jsx(Pt,{children:k.jsx(Xt,{client:Wt,children:k.jsx(t,{})})})]};export{os as default};