cyreader 0.1.1 → 0.1.2

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 (58) hide show
  1. package/bundle/server/dist/config/paths.js +3 -0
  2. package/bundle/server/dist/library/cache.js +70 -0
  3. package/bundle/server/dist/library/scan.js +54 -8
  4. package/bundle/server/dist/library/scan.test.js +99 -18
  5. package/bundle/server/dist/library/service.js +5 -1
  6. package/bundle/server/dist/library/service.test.js +16 -1
  7. package/bundle/server/dist/reading/progress/merge.js +5 -4
  8. package/bundle/server/dist/reading/progress/schema.js +39 -3
  9. package/bundle/server/dist/reading/progress/schema.test.js +36 -3
  10. package/bundle/server/dist/reading/progress/service.js +2 -3
  11. package/bundle/server/dist/reading/progress/service.test.js +10 -9
  12. package/bundle/server/dist/routes/library.test.js +8 -1
  13. package/bundle/web/dist/assets/_shell-Bm2pxAQP.js +5 -0
  14. package/bundle/web/dist/assets/_shell-Cij8gMSv.js +1 -0
  15. package/bundle/web/dist/assets/comic._id-Djtr8diE.js +1 -0
  16. package/bundle/web/dist/assets/dist-DzLEGVNH.js +1 -0
  17. package/bundle/web/dist/assets/dist-QfKKfHSL.js +1 -0
  18. package/bundle/web/dist/assets/index-BHhqsr5H.js +10 -0
  19. package/bundle/web/dist/assets/index-D9hL3zrL.css +2 -0
  20. package/bundle/web/dist/assets/library-D_1sil_O.js +1 -0
  21. package/bundle/web/dist/assets/library-utils-BRrejTkM.js +1 -0
  22. package/bundle/web/dist/assets/mutation-ChAIwNv3.js +1 -0
  23. package/bundle/web/dist/assets/novel._id-C62VYvcl.js +4 -0
  24. package/bundle/web/dist/assets/query-keys-CbbgiZx4.js +1 -0
  25. package/bundle/web/dist/assets/reading-BozmJNi1.js +1 -0
  26. package/bundle/web/dist/assets/reading-progress-C5bkK-vF.js +1 -0
  27. package/bundle/web/dist/assets/save-reading-progress-D231ROaQ.js +1 -0
  28. package/bundle/web/dist/assets/scroll-area-CyEO8R_G.js +1 -0
  29. package/bundle/web/dist/assets/{settings-2-CCv0KiQI.js → settings-2-8mnAuSax.js} +1 -1
  30. package/bundle/web/dist/assets/settings-BRi0XyRg.js +1 -0
  31. package/bundle/web/dist/assets/shell-context-Buw4m44t.js +41 -0
  32. package/bundle/web/dist/assets/use-library-Bh7Bunn1.js +1 -0
  33. package/bundle/web/dist/assets/{useNavigate-BMyovDLu.js → useNavigate-B29ssGbr.js} +1 -1
  34. package/bundle/web/dist/assets/useRouterState-4dM5FKiy.js +1 -0
  35. package/bundle/web/dist/assets/utils-ChkMmPzE.js +1 -0
  36. package/bundle/web/dist/index.html +5 -5
  37. package/package.json +2 -2
  38. package/bundle/server/dist/app.test.js +0 -9
  39. package/bundle/web/dist/assets/_shell-Co1KI-wo.js +0 -5
  40. package/bundle/web/dist/assets/_shell-bNqNRnHj.js +0 -1
  41. package/bundle/web/dist/assets/comic._id-CC6qdNbU.js +0 -1
  42. package/bundle/web/dist/assets/dist-CqonX7c8.js +0 -1
  43. package/bundle/web/dist/assets/image-BZKAkGUy.js +0 -1
  44. package/bundle/web/dist/assets/index-BQZoypuf.css +0 -2
  45. package/bundle/web/dist/assets/index-Pdit8x1d.js +0 -10
  46. package/bundle/web/dist/assets/input-tgPw9P7N.js +0 -41
  47. package/bundle/web/dist/assets/library-g-QZ29Jj.js +0 -1
  48. package/bundle/web/dist/assets/mutation-CwzbY9ri.js +0 -1
  49. package/bundle/web/dist/assets/novel._id-ByrQLxAT.js +0 -4
  50. package/bundle/web/dist/assets/query-keys-CDsPIOEO.js +0 -1
  51. package/bundle/web/dist/assets/reading-BseNE7P3.js +0 -1
  52. package/bundle/web/dist/assets/reading-progress-BcmbUd_d.js +0 -1
  53. package/bundle/web/dist/assets/save-reading-progress-yvAw7ZNh.js +0 -1
  54. package/bundle/web/dist/assets/scroll-area-awhNOWo3.js +0 -1
  55. package/bundle/web/dist/assets/settings-DmjzIwkt.js +0 -1
  56. package/bundle/web/dist/assets/shell-context-BT0BT8PF.js +0 -1
  57. package/bundle/web/dist/assets/toggle-group-CLpSuWfq.js +0 -1
  58. package/bundle/web/dist/assets/utils-BmM72imW.js +0 -1
@@ -1,41 +0,0 @@
1
- import{B as e,d as t,f as n,o as r,t as i}from"./utils-BmM72imW.js";import{C as a,m as o}from"./index-Pdit8x1d.js";var s=e(n(),1),c=t(),l=`focusScope.autoFocusOnMount`,u=`focusScope.autoFocusOnUnmount`,d={bubbles:!1,cancelable:!0},f=`FocusScope`,p=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:i=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,..._}=e,[v,y]=s.useState(null),S=o(f),C=o(p),T=s.useRef(null),E=r(t,e=>y(e)),D=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(i){let e=function(e){if(D.paused||!v)return;let t=e.target;v.contains(t)?T.current=t:b(T.current,{select:!0})},t=function(e){if(D.paused||!v)return;let t=e.relatedTarget;t!==null&&(v.contains(t)||b(T.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&b(v)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return v&&r.observe(v,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,v,D.paused]),s.useEffect(()=>{if(v){x.add(D);let e=document.activeElement;if(!v.contains(e)){let t=new CustomEvent(l,d);v.addEventListener(l,S),v.dispatchEvent(t),t.defaultPrevented||(m(w(g(v)),{select:!0}),document.activeElement===e&&b(v))}return()=>{v.removeEventListener(l,S),setTimeout(()=>{let t=new CustomEvent(u,d);v.addEventListener(u,C),v.dispatchEvent(t),t.defaultPrevented||b(e??document.body,{select:!0}),v.removeEventListener(u,C),x.remove(D)},0)}}},[v,S,C,D]);let O=s.useCallback(e=>{if(!n&&!i||D.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){let t=e.currentTarget,[i,a]=h(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n&&b(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n&&b(a,{select:!0})):r===t&&e.preventDefault()}},[n,i,D.paused]);return(0,c.jsx)(a.div,{tabIndex:-1,..._,ref:E,onKeyDown:O})});p.displayName=f;function m(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(b(r,{select:t}),document.activeElement!==n)return}function h(e){let t=g(e);return[_(t,e),_(t.reverse(),e)]}function g(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _(e,t){for(let n of e)if(!v(n,{upTo:t}))return n}function v(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function y(e){return e instanceof HTMLInputElement&&`select`in e}function b(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y(e)&&t&&e.select()}}var x=S();function S(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=C(e,t),e.unshift(t)},remove(t){e=C(e,t),e[0]?.resume()}}}function C(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function w(e){return e.filter(e=>e.tagName!==`A`)}var T=0,E=null;function D(){s.useEffect(()=>{E||={start:O(),end:O()};let{start:e,end:t}=E;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),T++,()=>{T===1&&(E?.start.remove(),E?.end.remove(),E=null),T=Math.max(0,T-1)}},[])}function O(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var k=function(){return k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},k.apply(this,arguments)};function ee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function te(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var A=`right-scroll-bar-position`,j=`width-before-scroll-bar`,ne=`with-scroll-bars-hidden`,re=`--removed-body-scroll-bar-size`;function M(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ie(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ae=typeof window<`u`?s.useLayoutEffect:s.useEffect,N=new WeakMap;function oe(e,t){var n=ie(t||null,function(t){return e.forEach(function(e){return M(e,t)})});return ae(function(){var t=N.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||M(e,null)}),i.forEach(function(e){r.has(e)||M(e,a)})}N.set(n,e)},[e]),n}function se(e){return e}function ce(e,t){t===void 0&&(t=se);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function le(e){e===void 0&&(e={});var t=ce(null);return t.options=k({async:!0,ssr:!1},e),t}var P=function(e){var t=e.sideCar,n=ee(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,k({},n))};P.isSideCarExport=!0;function ue(e,t){return e.useMedium(t),P}var F=le(),I=function(){},L=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:I,onWheelCapture:I,onTouchMoveCapture:I}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ee(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=oe([n,t]),w=k(k({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:F,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),k(k({},w),{ref:C})):s.createElement(y,k({},w,{className:l,ref:C}),c))});L.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},L.classNames={fullWidth:j,zeroRight:A};var R,de=function(){if(R)return R;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function fe(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=de();return t&&e.setAttribute(`nonce`,t),e}function pe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function me(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var he=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fe())&&(pe(t,n),me(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ge=function(){var e=he();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z=function(){var e=ge();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},_e={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||``,10)||0},ve=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[B(n),B(r),B(i)]},ye=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return _e;var t=ve(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},be=z(),V=`data-scroll-locked`,xe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${ne} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${V}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${A} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${j} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${A} .${A} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${j} .${j} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${V}] {
36
- ${re}: ${s}px;
37
- }
38
- `},H=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Se=function(){s.useEffect(function(){return document.body.setAttribute(V,(H()+1).toString()),function(){var e=H()-1;e<=0?document.body.removeAttribute(V):document.body.setAttribute(V,e.toString())}},[])},Ce=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Se();var a=s.useMemo(function(){return ye(i)},[i]);return s.createElement(be,{styles:xe(a,!t,i,n?``:`!important`)})},U=!1;if(typeof window<`u`)try{var W=Object.defineProperty({},"passive",{get:function(){return U=!0,!0}});window.addEventListener(`test`,W,W),window.removeEventListener(`test`,W,W)}catch{U=!1}var G=U?{passive:!1}:!1,we=function(e){return e.tagName===`TEXTAREA`},K=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!we(e)&&n[t]===`visible`)},Te=function(e){return K(e,`overflowY`)},Ee=function(e){return K(e,`overflowX`)},q=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ke(e,r)){var i=Ae(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},De=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Oe=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ke=function(e,t){return e===`v`?Te(t):Ee(t)},Ae=function(e,t){return e===`v`?De(t):Oe(t)},je=function(e,t){return e===`h`&&t===`rtl`?-1:1},Me=function(e,t,n,r,i){var a=je(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ae(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ke(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ne=function(e){return[e.deltaX,e.deltaY]},Pe=function(e){return e&&`current`in e?e.current:e},Fe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ie=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},Le=0,Y=[];function Re(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(Le++)[0],a=s.useState(z)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=te([e.lockRef.current],(e.shards||[]).map(Pe),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=J(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=q(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=q(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Me(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?Ne(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fe(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Pe).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ze(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Ne(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,J(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,G),document.addEventListener(`touchmove`,l,G),document.addEventListener(`touchstart`,d,G),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,G),document.removeEventListener(`touchmove`,l,G),document.removeEventListener(`touchstart`,d,G)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:Ie(i)}):null,m?s.createElement(Ce,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ze(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Be=ue(F,Re),Ve=s.forwardRef(function(e,t){return s.createElement(L,k({},e,{ref:t,sideCar:Be}))});Ve.classNames=L.classNames;var He=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,Ue=function(e){return e&&(e.host||Ue(e.parentNode))},We=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ue(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ge=function(e,t,n,r){var i=We(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},Ke=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||He(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ge(r,i,n,`aria-hidden`)):function(){return null}};function qe({className:e,type:t,...n}){return(0,c.jsx)(`input`,{type:t,"data-slot":`input`,className:i(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}export{p as a,D as i,Ke as n,Ve as r,qe as t};
@@ -1 +0,0 @@
1
- import{B as e,f as t}from"./utils-BmM72imW.js";import{n}from"./query-keys-CDsPIOEO.js";import{n as r}from"./useNavigate-BMyovDLu.js";import{O as i,k as a}from"./index-Pdit8x1d.js";var o=e(t(),1);function s(e){let t=r({warn:e?.router===void 0}),n=e?.router||t,s=(0,o.useRef)(void 0);return i(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=a(s.current,e.select(t));return s.current=n,n}return e.select(t)}return t})}function c(){return n(`/api/library`)}function l(e){return n(`/api/library/${e}`)}export{l as n,s as r,c as t};
@@ -1 +0,0 @@
1
- import{g as e,h as t,v as n}from"./utils-BmM72imW.js";var r=class extends t{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i=this.state.status===`pending`,a=!this.#r.canStart();try{if(i)n();else{this.#i({type:`pending`,variables:t,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:a})}let e=await this.#r.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),n.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}export{i as n,r as t};
@@ -1,4 +0,0 @@
1
- import{B as e,c as t,d as n,f as r,o as i,t as a}from"./utils-BmM72imW.js";import{i as o,o as s,r as c,t as l}from"./query-keys-CDsPIOEO.js";import{r as u}from"./library-g-QZ29Jj.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./save-reading-progress-yvAw7ZNh.js";import{t as _}from"./settings-2-CCv0KiQI.js";import{i as v,n as y,r as b,t as x}from"./dist-CqonX7c8.js";import{n as S,t as C}from"./toggle-group-CLpSuWfq.js";import{C as w,D as ee,_ as T,d as E,n as D,x as O,y as k}from"./index-Pdit8x1d.js";import{r as te,s as ne,t as re}from"./reading-progress-BcmbUd_d.js";var A=e(r(),1),j=n(),M=[`PageUp`,`PageDown`],N=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],P={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},F=`Slider`,[I,L,R]=v(F),[z,ie]=O(F,[R]),[B,V]=z(F),H=A.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=A.useRef(new Set),_=A.useRef(0),v=A.useRef(!1),y=o===`horizontal`?se:ce,[b=[],S]=T({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus({preventScroll:!0,focusVisible:v.current}),v.current=!1,d(e)}}),C=A.useRef(b);function w(e){D(e,Te(b,e))}function ee(e){D(e,_.current)}function E(){let e=C.current[_.current];b[_.current]!==e&&f(b)}function D(e,t,{commit:n}={commit:!1}){let o=ke(a),s=x(Ae(Math.round((e-r)/a)*a+r,o),[r,i]);S((e=[])=>{let r=Se(e,s,t);if(Oe(r,c*a)){_.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}else return e})}return(0,j.jsx)(B,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:b,orientation:o,form:m,children:(0,j.jsx)(I.Provider,{scope:e.__scopeSlider,children:(0,j.jsx)(I.Slot,{scope:e.__scopeSlider,children:(0,j.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:k(h.onPointerDown,()=>{s||(C.current=b,v.current=!1)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:w,onSlideMove:s?void 0:ee,onSlideEnd:s?void 0:E,onHomeKeyDown:()=>{s||(v.current=!0,D(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(v.current=!0,D(i,b.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){v.current=!0;let n=M.includes(e.key)||e.shiftKey&&N.includes(e.key)?10:1,r=_.current,i=b[r];D(i+a*n*t,r,{commit:!0})}}})})})})});H.displayName=F;var[ae,oe]=z(F,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),se=A.forwardRef((e,t)=>{let{min:n,max:r,dir:a,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,[f,p]=A.useState(null),m=i(t,e=>p(e)),h=A.useRef(void 0),g=b(a),_=g===`ltr`,v=_&&!o||!_&&o;function y(e){let t=h.current||f.getBoundingClientRect(),i=G([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return(0,j.jsx)(ae,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,j.jsx)(le,{dir:g,"data-orientation":`horizontal`,...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);s?.(t)},onSlideMove:e=>{let t=y(e.clientX);c?.(t)},onSlideEnd:()=>{h.current=void 0,l?.()},onStepKeyDown:e=>{let t=P[v?`from-left`:`from-right`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),ce=A.forwardRef((e,t)=>{let{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,d=A.useRef(null),f=i(t,d),p=A.useRef(void 0),m=!a;function h(e){let t=p.current||d.current.getBoundingClientRect(),i=G([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return(0,j.jsx)(ae,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:(0,j.jsx)(le,{"data-orientation":`vertical`,...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=h(e.clientY);o?.(t)},onSlideMove:e=>{let t=h(e.clientY);s?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{let t=P[m?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),le=A.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=V(F,n);return(0,j.jsx)(w.span,{...l,ref:t,onKeyDown:k(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):M.concat(N).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:k(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:k(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:k(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),ue=`SliderTrack`,de=A.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=V(ue,n);return(0,j.jsx)(w.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});de.displayName=ue;var U=`SliderRange`,fe=A.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,a=V(U,n),o=oe(U,n),s=i(t,A.useRef(null)),c=a.values.length,l=a.values.map(e=>Ce(e,a.min,a.max)),u=c>1?Math.min(...l):0,d=100-Math.max(...l);return(0,j.jsx)(w.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,...r,ref:s,style:{...e.style,[o.startEdge]:u+`%`,[o.endEdge]:d+`%`}})});fe.displayName=U;var pe=`SliderThumb`,[me,he]=z(pe),ge=`SliderThumbProvider`;function _e(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=V(ge,t),o=L(t),[s,c]=A.useState(null),l=A.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=E(s),d=s?!!a.form||!!s.closest(`form`):!0,f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:Ce(f,a.min,a.max);A.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return(0,j.jsx)(me,{scope:t,...h,children:je(i)?i(h):r})}_e.displayName=ge;var W=`SliderThumbTrigger`,ve=A.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,a=V(W,n),o=oe(W,n),{index:s,value:c,percent:l,size:u,onThumbChange:d}=he(W,n),f=i(t,e=>d(e)),p=we(s,a.values.length),m=u?.[o.size],h=m?Ee(m,l,o.direction):0;return(0,j.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:(0,j.jsx)(I.ItemSlot,{scope:n,children:(0,j.jsx)(w.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...r,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:k(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})});ve.displayName=W;var ye=A.forwardRef((e,t)=>{let{__scopeSlider:n,name:r,...i}=e;return(0,j.jsx)(_e,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ve,{...i,ref:t,__scopeSlider:n}),r?(0,j.jsx)(xe,{__scopeSlider:n},e):null]})})});ye.displayName=pe;var be=`SliderBubbleInput`,xe=A.forwardRef(({__scopeSlider:e,...t},n)=>{let{value:r,name:a,form:o}=he(be,e),s=A.useRef(null),c=i(s,n),l=y(r);return A.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(l!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),(0,j.jsx)(w.input,{style:{display:`none`},name:a,form:o,...t,ref:c,defaultValue:r})});xe.displayName=be;function Se(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function Ce(e,t,n){return x(100/(n-t)*(e-t),[0,100])}function we(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Te(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Ee(e,t,n){let r=e/2;return(r-G([0,50],[0,r])(t)*n)*n}function De(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Oe(e,t){if(t>0){let n=De(e);return Math.min(...n)>=t}return!0}function G(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ke(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}function Ae(e,t){let n=10**t;return Math.round(e*n)/n}function je(e){return typeof e==`function`}function Me(e,t){return`/static/${e}/${encodeURIComponent(t)}`}async function Ne(e,t){let n=await fetch(Me(e,t));if(!n.ok)throw Error(n.statusText);return n.text()}function Pe(e,t){return s({queryKey:l.novelContent(e??``,t??``),queryFn:()=>Ne(e,t),enabled:!!(e&&t)})}var K={default:{label:`默认`},heiti:{label:`黑体`,family:`"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif`},serif:{label:`宋体`,family:`"Noto Serif SC", "Source Han Serif SC", serif`}},q={dark:{bg:`#1a1a1e`,text:`#d8d0c0`,textMuted:`#9a9488`,border:`#2e2e34`,controlBg:`#25252c`,controlBorder:`#3a3a42`,controlHover:`#2e2e36`,accent:`#8b7e6a`,accentFg:`#f5f0e8`,error:`#e07070`,skeleton:`#2a2a30`,label:`深色`},paper:{bg:`#f3ead3`,text:`#4a3f35`,textMuted:`#7a6e62`,border:`#e0d4bc`,controlBg:`#ebe2cc`,controlBorder:`#d4c8b0`,controlHover:`#e5dbc4`,accent:`#8b6914`,accentFg:`#faf6ee`,error:`#c04040`,skeleton:`#e5dbc4`,label:`羊皮纸`},light:{bg:`#fafafa`,text:`#1f1f1f`,textMuted:`#6b6b6b`,border:`#e5e5e5`,controlBg:`#f0f0f0`,controlBorder:`#d8d8d8`,controlHover:`#eaeaea`,accent:`#404040`,accentFg:`#ffffff`,error:`#d04040`,skeleton:`#ececec`,label:`浅色`},green:{bg:`#cfecd8`,text:`#2e4a35`,textMuted:`#5a7a62`,border:`#b5dbbb`,controlBg:`#c0e4ca`,controlBorder:`#a8d4b2`,controlHover:`#b8dfc2`,accent:`#3d6b4a`,accentFg:`#f0faf2`,error:`#c04040`,skeleton:`#b8dfc2`,label:`护眼绿`}};function Fe(e,t,n){let r=q[e];return{"--reader-bg":r.bg,"--reader-text":r.text,"--reader-text-muted":r.textMuted,"--reader-border":r.border,"--reader-control-bg":r.controlBg,"--reader-control-border":r.controlBorder,"--reader-control-hover":r.controlHover,"--reader-accent":r.accent,"--reader-accent-fg":r.accentFg,"--reader-error":r.error,"--reader-skeleton":r.skeleton,"--reader-font-size":`${t}px`,"--reader-line-height":String(n),background:r.bg,color:r.text}}var Ie=[1.6,1.8,2.2],J={fontSize:18,lineHeight:1.8,theme:`dark`,contentFont:`default`},Y={},Le=`cyreader:reader-settings`,Re=Object.keys(q),ze=Object.keys(K);function Be(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ve(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.min(26,Math.max(14,Math.round(e)))}function He(e,t){return typeof e==`number`&&Ie.includes(e)?e:t}function Ue(e,t){return typeof e==`string`&&Re.includes(e)?e:t}function We(e,t){return typeof e==`string`&&ze.includes(e)?e:t}function Ge(e){let t=J;return Be(e)?{fontSize:Ve(e.fontSize,t.fontSize),lineHeight:He(e.lineHeight,t.lineHeight),theme:Ue(e.theme,t.theme),contentFont:We(e.contentFont,t.contentFont)}:{...t}}function Ke(e){return{...Y}}function qe(e){return!(`novel`in e)&&(`fontSize`in e||`lineHeight`in e||`theme`in e||`contentFont`in e)}function Je(e){return Be(e)?qe(e)?{version:1,novel:Ge(e),comic:{...Y}}:{version:1,novel:Ge(e.novel),comic:Ke(e.comic)}:{version:1,novel:{...J},comic:{...Y}}}function Ye(){if(typeof window>`u`)return{version:1,novel:{...J},comic:{...Y}};try{let e=window.localStorage.getItem(Le);return e?Je(JSON.parse(e)):{version:1,novel:{...J},comic:{...Y}}}catch{return{version:1,novel:{...J},comic:{...Y}}}}function Xe(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Le,JSON.stringify(e))}catch{}}function Ze(e,t){let n=Ye(),r={version:1,novel:e===`novel`?t:n.novel,comic:e===`comic`?t:n.comic};return Xe(r),r}function Qe(e){let[t,n]=(0,A.useState)(()=>Ye()[e]);return{settings:t,patchSettings:(0,A.useCallback)(t=>{n(n=>{let r={...n,...t};return Ze(e===`novel`?`novel`:`comic`,r),r})},[e])}}function $e(e){let t=e.replace(/\r\n?/g,`
2
- `).trim();if(!t)return[];let n=t.split(/\n{2,}/);return n.length>1?n.flatMap(e=>e.split(`
3
- `).map(e=>e.trim()).filter(Boolean)):t.split(`
4
- `).map(e=>e.trim()).filter(Boolean)}function et({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){let s=A.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,j.jsxs)(H,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:a(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,e),...o,children:[(0,j.jsx)(de,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1`,children:(0,j.jsx)(fe,{"data-slot":`slider-range`,className:`absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:s.length},(e,t)=>(0,j.jsx)(ye,{"data-slot":`slider-thumb`,className:`relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50`},t))]})}function tt({open:e,fontSize:t,lineHeight:n,theme:r,contentFont:i,onFontSizeChange:s,onLineHeightChange:c,onThemeChange:l,onContentFontChange:u,readerStyle:d}){return e?(0,j.jsxs)(`div`,{className:`absolute top-14 right-0 z-20 flex w-80 flex-col gap-4 border-l border-b p-4`,style:{...d,borderColor:`var(--reader-border)`},children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-sm`,style:{color:`var(--reader-text)`},children:`字体大小`}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>s(t-1),children:`A-`}),(0,j.jsx)(et,{value:[t],min:14,max:26,step:1,onValueChange:e=>s(e[0]??t),className:`w-24`}),(0,j.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>s(t+1),children:`A+`})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-sm`,style:{color:`var(--reader-text)`},children:`行间距`}),(0,j.jsxs)(C,{type:`single`,value:String(n),onValueChange:e=>{e&&c(Number(e))},variant:`outline`,size:`sm`,children:[(0,j.jsx)(S,{value:`1.6`,children:`紧凑`}),(0,j.jsx)(S,{value:`1.8`,children:`适中`}),(0,j.jsx)(S,{value:`2.2`,children:`宽松`})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsx)(`span`,{className:`text-sm`,style:{color:`var(--reader-text)`},children:`字体`}),(0,j.jsx)(C,{type:`single`,value:i,onValueChange:e=>{e&&u(e)},variant:`outline`,size:`sm`,children:Object.keys(K).map(e=>(0,j.jsx)(S,{value:e,children:K[e].label},e))})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsx)(`span`,{className:`text-sm`,style:{color:`var(--reader-text)`},children:`阅读主题`}),(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Object.keys(q).map(e=>(0,j.jsx)(`button`,{type:`button`,"aria-label":q[e].label,onClick:()=>l(e),className:a(`size-8 rounded-full border-2 transition-transform hover:scale-105`,r===e?`border-[var(--reader-accent)]`:`border-transparent`),style:{background:q[e].bg,boxShadow:r===e?void 0:`inset 0 0 0 1px ${q[e].controlBorder}`}},e))})]})]}):null}var nt=e(t(),1);function rt(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function X(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function it(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var at=(e,t)=>Math.abs(e-t)<1.01,ot=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Z,Q=()=>{if(Z!==void 0)return Z;if(typeof navigator>`u`)return Z=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Z=!0;let e=navigator.maxTouchPoints;return Z=navigator.platform===`MacIntel`&&e!==void 0&&e>0},st=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ct=e=>e,lt=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},ut=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(st(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(st(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},$={passive:!0},dt=typeof window>`u`?!0:`onscrollend`in window,ft=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&dt,o=0,s=a?null:ot(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,$),a&&r.addEventListener(`scrollend`,u,$),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},pt=(e,t)=>ft(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),mt=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},ht=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},gt=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ct,rangeExtractor:lt,onChange:()=>{},measureElement:mt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=X(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!Q()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,$),e.addEventListener(`touchend`,n,$),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Q()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=X(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=X(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=rt(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=X(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?vt({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=X(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=X(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return it(t[_t(0,t.length-1,r?e=>n[e*2]:e=>it(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(Q()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&at(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},_t=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function vt({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=_t(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var yt=typeof document<`u`?A.useLayoutEffect:A.useEffect;function bt({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=A.useReducer(e=>e+1,0)[1],a=A.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled)return;let n=e.getTotalSize();if(t.container&&n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,nt.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=A.useState(()=>{let e=new gt(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),yt(()=>c._didMount(),[]),yt(()=>c._willUpdate()),yt(()=>{o(c)}),c}function xt(e){return bt({observeElementRect:ut,observeElementOffset:pt,scrollToFn:ht,...e})}function St(e,t){return e*t*2+e*1.2}function Ct({title:e,paragraphs:t,fontSize:n,lineHeight:r,contentFont:i,initialParagraphIndex:o=0,onParagraphChange:s,onReachEnd:c}){let l=(0,A.useRef)(null),u=(0,A.useRef)(null),[d,f]=(0,A.useState)(0),p=(0,A.useRef)(!1),m=(0,A.useRef)(e),h=(0,A.useRef)(s),g=(0,A.useRef)(c);h.current=s,g.current=c;let _=(0,A.useCallback)(()=>{u.current&&f(u.current.offsetTop)},[]),v=xt({count:t.length,getScrollElement:()=>l.current,estimateSize:()=>St(n,r),overscan:10,scrollMargin:d,getItemKey:e=>e}),y=(0,A.useRef)(v.measure);y.current=v.measure;let b=(0,A.useRef)(v.scrollToIndex);return b.current=v.scrollToIndex,(0,A.useLayoutEffect)(()=>{_()},[e,n,r,_]),(0,A.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=new ResizeObserver(()=>{_()});return t.observe(e),e.previousElementSibling instanceof HTMLElement&&t.observe(e.previousElementSibling),()=>{t.disconnect()}},[e,_]),(0,A.useLayoutEffect)(()=>{y.current()},[n,r,i]),(0,A.useLayoutEffect)(()=>{if(t.length===0||p.current)return;let e=u.current;if(!e)return;let n=e.offsetTop;if(d!==n){f(n);return}p.current=!0;let r=Math.min(Math.max(o,0),t.length-1);y.current(),b.current(r,{align:`start`})},[o,t.length,d]),(0,A.useEffect)(()=>{m.current!==e&&(m.current=e,p.current=!1)},[e]),(0,A.useEffect)(()=>{let e=l.current;if(!e)return;let t,n=()=>{t&&clearTimeout(t),t=setTimeout(()=>{let t=v.range;if(t){let n=e.scrollTop,r=v.getVirtualItems(),i=t.startIndex;for(let e of r)if(e.start+e.size>n){i=e.size>0&&Math.max(0,n-e.start)>e.size/2?e.index+1:e.index;break}h.current?.(i)}e.scrollTop+e.clientHeight>=e.scrollHeight-32&&g.current?.()},100)};return e.addEventListener(`scroll`,n,{passive:!0}),()=>{e.removeEventListener(`scroll`,n),t&&clearTimeout(t)}},[v]),(0,j.jsx)(`div`,{ref:l,className:`reader-scrollbar h-full overflow-y-auto`,children:(0,j.jsxs)(`article`,{className:`mx-auto max-w-[720px] px-6 py-8`,style:{fontSize:`var(--reader-font-size)`,lineHeight:`var(--reader-line-height)`,color:`var(--reader-text)`,...i!=="default"&&{fontFamily:K[i].family}},children:[(0,j.jsx)(`h1`,{className:`mb-2 text-[1.4em] font-bold`,children:e}),(0,j.jsx)(`div`,{className:`mb-6 border-b pb-4 text-[0.85em]`,style:{borderColor:`var(--reader-border)`,color:`var(--reader-text-muted)`},children:`—`}),(0,j.jsx)(`div`,{ref:u,style:{height:v.getTotalSize(),width:`100%`,position:`relative`},children:v.getVirtualItems().map(e=>(0,j.jsx)(`div`,{"data-index":e.index,ref:v.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start-v.options.scrollMargin}px)`},children:(0,j.jsx)(`p`,{className:a(`mb-[1.2em] text-justify`,e.index===0?``:`indent-[2em]`),children:t[e.index]})},e.key))})]})})}function wt({id:e}){let t=u({select:e=>e.location.state?.readerTitle}),{data:n,isPending:r,error:i}=d(e),s=n&&n.type===`novel`?n:null,{data:l,isPending:v,error:y}=Pe(s?.directoryId,s?.filename),[b,x]=(0,A.useState)(!1),{settings:S,patchSettings:C}=Qe(`novel`),{fontSize:w,lineHeight:T,theme:E,contentFont:D}=S,[O,k]=(0,A.useState)(0),[M,N]=(0,A.useState)(null),P=(0,A.useMemo)(()=>Fe(E,w,T),[w,T,E]),F=t??n?.title??`加载中...`,I=r||s!==null&&v,L=i??y,R=L?L instanceof Error?L.message:`加载失败`:null,z=(0,A.useMemo)(()=>l?$e(l):[],[l]),ie=(0,A.useMemo)(()=>te(O,z.length),[O,z.length]),B=(0,A.useCallback)((t,n=null)=>{if(z.length===0)return;let r=Math.min(Math.max(t,0),z.length-1);p(e,{type:`novel`,paragraphIndex:r,anchor:re(z[r]??``),layout:{paragraphCount:z.length,charCount:z.reduce((e,t)=>e+t.length,0)},completedAt:n})},[e,z]),V=(0,A.useCallback)(e=>{k(e),B(e,null)},[B]),H=(0,A.useCallback)(()=>{if(z.length===0)return;let e=z.length-1;k(e),B(e,new Date().toISOString())},[z.length,B]);return(0,A.useEffect)(()=>{N(null),k(0)},[e]),(0,A.useEffect)(()=>{if(z.length===0||M!==null)return;let e=ne(s?.progress,z);N(e),k(e)},[s?.progress,z,M]),(0,A.useEffect)(()=>(f(e),()=>{h(e),g(e)}),[e]),(0,A.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.preventDefault(),b&&x(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]),(0,j.jsxs)(`div`,{className:`reader-scope relative flex h-screen flex-col overflow-hidden`,style:P,children:[(0,j.jsxs)(`header`,{className:`relative z-10 flex h-14 shrink-0 items-center gap-3 border-b px-4`,style:{borderColor:`var(--reader-border)`},children:[(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`sm`,asChild:!0,children:(0,j.jsxs)(ee,{to:`/`,children:[(0,j.jsx)(m,{"data-icon":`inline-start`}),`返回`]})}),(0,j.jsx)(`div`,{className:`flex-1 truncate text-center text-sm font-medium`,children:F}),(0,j.jsx)(o,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>x(e=>!e),className:a(b&&`reader-settings-active`),children:(0,j.jsx)(_,{})})]}),(0,j.jsx)(tt,{open:b,fontSize:w,lineHeight:T,theme:E,contentFont:D,onFontSizeChange:e=>C({fontSize:Math.min(26,Math.max(14,e))}),onLineHeightChange:e=>C({lineHeight:e}),onThemeChange:e=>C({theme:e}),onContentFontChange:e=>C({contentFont:e}),readerStyle:P}),(0,j.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[I&&!l?(0,j.jsxs)(`div`,{className:`flex flex-col gap-3 p-8`,children:[(0,j.jsx)(c,{className:`h-8 w-1/2`}),(0,j.jsx)(c,{className:`h-4 w-full`}),(0,j.jsx)(c,{className:`h-4 w-full`}),(0,j.jsx)(c,{className:`h-4 w-3/4`})]}):null,R?(0,j.jsx)(`div`,{className:`p-8 text-sm`,style:{color:`var(--reader-error)`},children:R}):null,!r&&!R&&n&&n.type!==`novel`?(0,j.jsx)(`div`,{className:`p-8 text-sm`,style:{color:`var(--reader-error)`},children:`作品类型不匹配`}):null,s&&l&&M!==null?(0,j.jsx)(Ct,{title:s.title,paragraphs:z,fontSize:w,lineHeight:T,contentFont:D,initialParagraphIndex:M,onParagraphChange:V,onReachEnd:H},e):null]}),(0,j.jsxs)(`footer`,{className:`flex h-11 shrink-0 items-center justify-center border-t text-xs`,style:{borderColor:`var(--reader-border)`,color:`var(--reader-text-muted)`},children:[`已读 `,ie,`%`]})]})}function Tt(){let{id:e}=D.useParams();return(0,j.jsx)(wt,{id:e})}export{Tt as component};
@@ -1 +0,0 @@
1
- import{A as e,B as t,D as n,F as r,I as i,L as a,M as o,N as s,R as c,b as l,d as u,f as d,j as f,k as p,m,n as h,r as g,t as _,u as v,v as y,w as b,y as x}from"./utils-BmM72imW.js";var S=class extends c{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=x(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),w(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return T(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return T(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(t){let n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof e(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),n._defaulted&&!o(this.options,n)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&E(this.#t,r,this.options,n)&&this.#h(),this.updateResult(),i&&(this.#t!==r||e(this.options.enabled,this.#t)!==e(n.enabled,this.#t)||f(this.options.staleTime,this.#t)!==f(n.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==r||e(this.options.enabled,this.#t)!==e(n.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return O(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(n)),t}#g(){this.#b();let e=f(this.options.staleTime,this.#t);if(l.isServer()||this.#r.isStale||!b(e))return;let t=r(this.#r.dataUpdatedAt,e)+1;this.#d=i.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#x(),this.#p=t,!(l.isServer()||e(this.options.enabled,this.#t)===!1||!b(this.#p)||this.#p===0)&&(this.#f=i.setInterval(()=>{(this.options.refetchIntervalInBackground||a.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(i.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(i.clearInterval(this.#f),this.#f=void 0)}createResult(t,n){let r=this.#t,i=this.options,a=this.#r,o=this.#i,s=this.#a,c=t===r?this.#n:t.state,{state:l}=t,u={...l},d=!1,f;if(n._optimisticResults){let e=this.hasListeners(),a=!e&&w(t,n),o=e&&E(t,r,n,i);(a||o)&&(u={...u,...m(l.data,t.options)}),n._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:h,errorUpdatedAt:g,status:_}=u;f=u.data;let v=!1;if(n.placeholderData!==void 0&&f===void 0&&_===`pending`){let e;a?.isPlaceholderData&&n.placeholderData===s?.placeholderData?(e=a.data,v=!0):e=typeof n.placeholderData==`function`?n.placeholderData(this.#u?.state.data,this.#u):n.placeholderData,e!==void 0&&(_=`success`,f=p(a?.data,e,n),d=!0)}if(n.select&&f!==void 0&&!v)if(a&&f===o?.data&&n.select===this.#c)f=this.#l;else try{this.#c=n.select,f=n.select(f),f=p(a?.data,f,n),this.#l=f,this.#s=null}catch(e){this.#s=e}this.#s&&(h=this.#s,f=this.#l,g=Date.now(),_=`error`);let y=u.fetchStatus===`fetching`,b=_===`pending`,S=_===`error`,C=b&&y,T=f!==void 0,O={status:_,fetchStatus:u.fetchStatus,isPending:b,isSuccess:_===`success`,isError:S,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:S&&!T,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:S&&T,isStale:D(t,n),refetch:this.refetch,promise:this.#o,isEnabled:e(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){let e=O.data!==void 0,n=O.status===`error`&&!e,i=t=>{n?t.reject(O.error):e&&t.resolve(O.data)},a=()=>{i(this.#o=O.promise=x())},o=this.#o;switch(o.status){case`pending`:t.queryHash===r.queryHash&&i(o);break;case`fulfilled`:(n||O.data!==o.value)&&a();break;case`rejected`:(!n||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!o(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){y.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function C(t,n){return e(n.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status===`error`&&e(n.retryOnMount,t)===!1)}function w(e,t){return C(e,t)||e.state.data!==void 0&&T(e,t,t.refetchOnMount)}function T(t,n,r){if(e(n.enabled,t)!==!1&&f(n.staleTime,t)!==`static`){let e=typeof r==`function`?r(t):r;return e===`always`||e!==!1&&D(t,n)}return!1}function E(t,n,r,i){return(t!==n||e(i.enabled,t)===!1)&&(!r.suspense||t.state.status!==`error`)&&D(t,r)}function D(t,n){return e(n.enabled,t)!==!1&&t.isStaleByTime(f(n.staleTime,t))}function O(e,t){return!o(e.getCurrentResult(),t)}var k=u(),A=t(d(),1),j=A.createContext(!1),M=()=>A.useContext(j);j.Provider;function N(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P=A.createContext(N()),F=()=>A.useContext(P),I=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?s(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},L=e=>{A.useEffect(()=>{e.clearReset()},[e])},R=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||s(n,[e.error,r])),z=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},B=(e,t)=>e.isLoading&&e.isFetching&&!t,V=(e,t)=>e?.suspense&&t.isPending,H=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function U(e,t,r){let i=M(),a=F(),o=v(r),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);let c=o.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,z(s),I(s,a,c),L(a);let d=!o.getQueryCache().get(s.queryHash),[f]=A.useState(()=>new t(o,s)),p=f.getOptimisticResult(s),m=!i&&u;if(A.useSyncExternalStore(A.useCallback(e=>{let t=m?f.subscribe(y.batchCalls(e)):n;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),A.useEffect(()=>{f.setOptions(s)},[s,f]),V(s,p))throw H(s,f,a);if(R({result:p,errorResetBoundary:a,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw p.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,p),s.experimental_prefetchInRender&&!l.isServer()&&B(p,i)&&(d?H(s,f,a):c?.promise)?.catch(n).finally(()=>{f.updateResult()}),s.notifyOnChangeProps?p:f.trackResult(p)}function W(e,t){return U(e,S,t)}var G=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,K=h,q=(e,t)=>n=>{if(t?.variants==null)return K(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=G(t)||G(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return K(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},J=q(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,k.jsx)(r?g:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:_(J({variant:t,size:n,className:e})),...i})}function X({className:e,...t}){return(0,k.jsx)(`div`,{"data-slot":`skeleton`,className:_(`animate-pulse rounded-md bg-muted`,e),...t})}var Z=class extends Error{status;constructor(e,t){super(e),this.name=`ApiRequestError`,this.status=t}};async function Q(e){try{return(await e.json()).error??e.statusText}catch{return e.statusText}}async function $(e,t){let n=await fetch(e,t);if(!n.ok)throw new Z(await Q(n),n.status);if(n.status!==204)return n.json()}var ee={library:[`library`],config:[`config`],recent:[`reading`,`recent`],libraryItem:e=>[`library`,e],novelContent:(e,t)=>[`novel-content`,e,t]};export{q as a,Y as i,$ as n,W as o,X as r,ee as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./query-keys-CDsPIOEO.js";function t(){return e(`/api/reading/recent`)}function n(t){return e(`/api/reading/recent`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({itemId:t})})}function r(t,n){return e(`/api/reading/progress/${t}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)})}export{n,r,t};
@@ -1 +0,0 @@
1
- var e=60,t=20;function n(e){return e?e.completedAt?`completed`:`reading`:`unread`}function r(e,t){return t<=0?0:Math.round((e+1)/t*100)}function i(e,t){return t<=0?0:t===1?e>0?100:0:Math.round(e/(t-1)*100)}function a(t){return t.trim().slice(0,e)}function o(e,n){if(n.length===0||!e)return 0;let r=Math.min(Math.max(e.paragraphIndex,0),n.length-1);if(!e.anchor)return r;let i=e.anchor;if(a(n[r]??``)===i)return r;let o=Math.max(0,r-t),s=Math.min(n.length-1,r+t);for(let e=o;e<=s;e+=1)if(a(n[e]??``)===i)return e;return r}function s(e,t){return t<=0?`—`:e?`${e.pageIndex+1} / ${t} 页`:`— / ${t} 页`}function c(e){if(!e.progress)return 0;if(e.type===`comic`&&e.progress.type===`comic`)return r(e.progress.pageIndex,e.pageCount);if(e.type===`novel`&&e.progress.type===`novel`){let t=e.progress.layout?.paragraphCount??0;return i(e.progress.paragraphIndex,t)}return 0}export{s as a,n as i,r as n,c as o,i as r,o as s,a as t};
@@ -1 +0,0 @@
1
- import{s as e}from"./utils-BmM72imW.js";import{o as t,t as n}from"./query-keys-CDsPIOEO.js";import{n as r}from"./library-g-QZ29Jj.js";import{T as i}from"./index-Pdit8x1d.js";import{n as a,r as o}from"./reading-BseNE7P3.js";var s=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);function c(e){return t({queryKey:n.libraryItem(e),queryFn:()=>r(e)})}var l=300,u=new Map;function d(e){let t=u.get(e);t&&clearTimeout(t),u.set(e,setTimeout(()=>{u.delete(e),a(e).then(()=>i.invalidateQueries({queryKey:n.recent})).catch(()=>{})},l))}function f(e){let t=u.get(e);t&&(clearTimeout(t),u.delete(e))}function p(e,t){i.setQueryData(n.libraryItem(e),e=>{if(!e||e.type!==t.type)return e;let n=new Date().toISOString();return t.type===`comic`&&e.type===`comic`?{...e,progress:{type:`comic`,pageIndex:t.pageIndex,updatedAt:n,completedAt:t.completedAt??null}}:t.type===`novel`&&e.type===`novel`?{...e,progress:{type:`novel`,paragraphIndex:t.paragraphIndex,updatedAt:n,anchor:t.anchor,layout:t.layout,completedAt:t.completedAt??null}}:e})}var m=800,h=new Map,g=new Map;function _(e,t){g.set(e,t);let n=h.get(e);n&&clearTimeout(n),h.set(e,setTimeout(()=>{h.delete(e),v(e)},m))}async function v(e){let t=h.get(e);t&&(clearTimeout(t),h.delete(e));let r=g.get(e);if(r){g.delete(e);try{await o(e,r),p(e,r),await Promise.all([i.invalidateQueries({queryKey:n.library}),i.invalidateQueries({queryKey:n.recent})])}catch{}}}function y(e){let t=h.get(e);t&&(clearTimeout(t),h.delete(e));let r=g.get(e);g.delete(e),r&&o(e,r).then(()=>(p(e,r),Promise.all([i.invalidateQueries({queryKey:n.library}),i.invalidateQueries({queryKey:n.recent})]))).catch(()=>{})}typeof window<`u`&&window.addEventListener(`beforeunload`,()=>{for(let e of g.keys())v(e)});export{c as a,d as i,_ as n,s as o,f as r,y as t};
@@ -1 +0,0 @@
1
- import{B as e,c as t,d as n,f as r,i,o as a,s as o,t as s}from"./utils-BmM72imW.js";import{i as c,n as l,r as u,t as d}from"./dist-CqonX7c8.js";import{a as f,i as p,n as m,r as h}from"./input-tgPw9P7N.js";import{C as g,S as _,_ as v,c as y,f as b,g as x,h as S,l as C,m as w,o as T,p as E,s as D,u as O,v as k,x as A,y as j}from"./index-Pdit8x1d.js";var ee=o(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),te=o(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ne=o(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=e(r(),1),N=n();function P(e,t){return M.useReducer((e,n)=>t[e][n]??e,e)}var F=`ScrollArea`,[I,L]=A(F),[R,z]=I(F),B=M.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:o=600,...s}=e,[c,l]=M.useState(null),[d,f]=M.useState(null),[p,m]=M.useState(null),[h,_]=M.useState(null),[v,y]=M.useState(null),[b,x]=M.useState(0),[S,C]=M.useState(0),[w,T]=M.useState(!1),[E,D]=M.useState(!1),O=a(t,e=>l(e)),k=u(i);return(0,N.jsx)(R,{scope:n,type:r,dir:k,scrollHideDelay:o,scrollArea:c,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:h,onScrollbarXChange:_,scrollbarXEnabled:w,onScrollbarXEnabledChange:T,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:D,onCornerWidthChange:x,onCornerHeightChange:C,children:(0,N.jsx)(g.div,{dir:k,...s,ref:O,style:{position:`relative`,"--radix-scroll-area-corner-width":b+`px`,"--radix-scroll-area-corner-height":S+`px`,...e.style}})})});B.displayName=F;var V=`ScrollAreaViewport`,re=M.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=z(V,n),c=a(t,M.useRef(null),s.onViewportChange);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,N.jsx)(g.div,{"data-radix-scroll-area-viewport":``,...o,ref:c,style:{overflowX:s.scrollbarXEnabled?`scroll`:`hidden`,overflowY:s.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,N.jsx)(`div`,{ref:s.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});re.displayName=V;var H=`ScrollAreaScrollbar`,ie=M.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=z(H,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return M.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,N.jsx)(ae,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,N.jsx)(oe,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,N.jsx)(se,{...r,ref:t,forceMount:n}):i.type===`always`?(0,N.jsx)(ce,{...r,ref:t,"data-state":`visible`}):null});ie.displayName=H;var ae=M.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=z(H,e.__scopeScrollArea),[a,o]=M.useState(!1);return M.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,N.jsx)(x,{present:n||a,children:(0,N.jsx)(se,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),oe=M.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=z(H,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=G(()=>c(`SCROLL_END`),100),[s,c]=P(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return M.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),M.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,N.jsx)(x,{present:n||s!==`hidden`,children:(0,N.jsx)(ce,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:j(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:j(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),se=M.forwardRef((e,t)=>{let n=z(H,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=M.useState(!1),s=e.orientation===`horizontal`,c=G(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return K(n.viewport,c),K(n.content,c),(0,N.jsx)(x,{present:r||a,children:(0,N.jsx)(ce,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),ce=M.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=z(H,e.__scopeScrollArea),a=M.useRef(null),o=M.useRef(0),[s,c]=M.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=be(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return xe(e,o.current,s,t)}return n===`horizontal`?(0,N.jsx)(le,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Se(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,N.jsx)(ue,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Se(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),le=M.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=z(H,e.__scopeScrollArea),[s,c]=M.useState(),l=M.useRef(null),u=a(t,l,o.onScrollbarXChange);return M.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,N.jsx)(pe,{"data-orientation":`horizontal`,...i,ref:u,sizes:n,style:{bottom:0,left:o.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:o.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":W(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),we(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:U(s.paddingLeft),paddingEnd:U(s.paddingRight)}})}})}),ue=M.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=z(H,e.__scopeScrollArea),[s,c]=M.useState(),l=M.useRef(null),u=a(t,l,o.onScrollbarYChange);return M.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,N.jsx)(pe,{"data-orientation":`vertical`,...i,ref:u,sizes:n,style:{top:0,right:o.dir===`ltr`?0:void 0,left:o.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":W(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),we(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:U(s.paddingTop),paddingEnd:U(s.paddingBottom)}})}})}),[de,fe]=I(H),pe=M.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,m=z(H,n),[h,_]=M.useState(null),v=a(t,e=>_(e)),y=M.useRef(null),b=M.useRef(``),x=m.viewport,S=r.content-r.viewport,C=w(d),T=w(l),E=G(f,10);function D(e){y.current&&u({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return M.useEffect(()=>{let e=e=>{let t=e.target;h?.contains(t)&&C(e,S)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[x,h,S,C]),M.useEffect(T,[r,T]),K(h,E),K(m.content,E),(0,N.jsx)(de,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:w(o),onThumbPointerUp:w(s),onThumbPositionChange:T,onThumbPointerDown:w(c),children:(0,N.jsx)(g.div,{...p,ref:v,style:{position:`absolute`,...p.style},onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),y.current=h.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,m.viewport&&(m.viewport.style.scrollBehavior=`auto`),D(e))}),onPointerMove:j(e.onPointerMove,D),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=``),y.current=null})})})}),me=`ScrollAreaThumb`,he=M.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=fe(me,e.__scopeScrollArea);return(0,N.jsx)(x,{present:n||i.hasThumb,children:(0,N.jsx)(ge,{ref:t,...r})})}),ge=M.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,o=z(me,n),s=fe(me,n),{onThumbPositionChange:c}=s,l=a(t,e=>s.onThumbChange(e)),u=M.useRef(void 0),d=G(()=>{u.current&&=(u.current(),void 0)},100);return M.useEffect(()=>{let e=o.viewport;if(e){let t=()=>{d(),u.current||(u.current=Te(e,c),c())};return c(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[o.viewport,d,c]),(0,N.jsx)(g.div,{"data-state":s.hasThumb?`visible`:`hidden`,...i,ref:l,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:j(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;s.onThumbPointerDown({x:n,y:r})}),onPointerUp:j(e.onPointerUp,s.onThumbPointerUp)})});he.displayName=me;var _e=`ScrollAreaCorner`,ve=M.forwardRef((e,t)=>{let n=z(_e,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,N.jsx)(ye,{...e,ref:t}):null});ve.displayName=_e;var ye=M.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=z(_e,n),[a,o]=M.useState(0),[s,c]=M.useState(0),l=!!(a&&s);return K(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),K(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,N.jsx)(g.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function U(e){return e?parseInt(e,10):0}function be(e,t){let n=e/t;return isNaN(n)?0:n}function W(e){let t=be(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xe(e,t,n,r=`ltr`){let i=W(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ce([c,l],d)(e)}function Se(e,t,n=`ltr`){let r=W(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=d(e,n===`ltr`?[0,o]:[o*-1,0]);return Ce([0,o],[0,s])(c)}function Ce(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function we(e,t){return e>0&&e<t}var Te=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function G(e,t){let n=w(e),r=M.useRef(0);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),M.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function K(e,t){let n=w(t);k(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Ee=B,De=re,Oe=ve,ke=e(t(),1),Ae=[` `,`Enter`,`ArrowUp`,`ArrowDown`],je=[` `,`Enter`],q=`Select`,[Me,Ne,Pe]=c(q),[J,Fe]=A(q,[Pe,O]),Ie=O(),[Le,Y]=J(q),[Re,ze]=J(q),Be=`SelectProvider`;function Ve(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=Ie(t),[y,b]=M.useState(null),[x,w]=M.useState(null),[T,E]=M.useState(!1),D=u(l),[O,k]=v({prop:r,defaultProp:i??!1,onChange:a,caller:q}),[A,j]=v({prop:o,defaultProp:s,onChange:c,caller:q}),ee=M.useRef(null),te=y?!!h||!!y.closest(`form`):!0,[ne,P]=M.useState(new Set),F=S(),I=Array.from(ne).map(e=>e.props.value).join(`;`),L=M.useCallback(e=>{P(t=>new Set(t).add(e))},[]),R=M.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:m,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:T,onValueNodeHasChildrenChange:E,contentId:F,value:A,onValueChange:j,open:O,onOpenChange:k,dir:D,triggerPointerDownPosRef:ee,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:ne,nativeSelectKey:I,isFormControl:te};return(0,N.jsx)(C,{..._,children:(0,N.jsx)(Le,{scope:t,...z,children:(0,N.jsx)(Me.Provider,{scope:t,children:(0,N.jsx)(Re,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:R,children:Lt(g)?g(z):n})})})})}Ve.displayName=Be;var He=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,N.jsx)(Ve,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,N.jsxs)(N.Fragment,{children:[n,e?(0,N.jsx)(It,{__scopeSelect:t}):null]})})};He.displayName=q;var Ue=`SelectTrigger`,We=M.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,o=Ie(n),s=Y(Ue,n),c=s.disabled||r,l=a(t,s.onTriggerChange),u=Ne(n),d=M.useRef(`touch`),[f,p,m]=zt(e=>{let t=u().filter(e=>!e.disabled),n=Bt(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),h=e=>{c||(s.onOpenChange(!0),m()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,N.jsx)(T,{asChild:!0,...o,children:(0,N.jsx)(g.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":Rt(s.value)?``:void 0,...i,ref:l,onClick:j(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&h(e)}),onPointerDown:j(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:j(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&Ae.includes(e.key)&&(h(),e.preventDefault())})})})});We.displayName=Ue;var Ge=`SelectValue`,Ke=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:o,placeholder:s=``,...c}=e,l=Y(Ge,n),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=a(t,l.onValueNodeChange);k(()=>{u(d)},[u,d]);let p=Rt(l.value);return(0,N.jsx)(g.span,{...c,asChild:p?!1:c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,N.jsx)(M.Fragment,{children:p?s:o},p?`placeholder`:`value`)})});Ke.displayName=Ge;var qe=`SelectIcon`,Je=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,N.jsx)(g.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Je.displayName=qe;var Ye=`SelectPortal`,[Xe,Ze]=J(Ye,{forceMount:void 0}),Qe=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,N.jsx)(Xe,{scope:e.__scopeSelect,forceMount:n,children:(0,N.jsx)(b,{asChild:!0,...r})})};Qe.displayName=Ye;var X=`SelectContent`,$e=M.forwardRef((e,t)=>{let n=Ze(X,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Y(X,e.__scopeSelect),[o,s]=M.useState();return k(()=>{s(new DocumentFragment)},[]),(0,N.jsx)(x,{present:r||a.open,children:({present:e})=>e?(0,N.jsx)(it,{...i,ref:t}):(0,N.jsx)(et,{...i,fragment:o})})});$e.displayName=X;var et=M.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?ke.createPortal((0,N.jsx)(tt,{scope:n,children:(0,N.jsx)(Me.Slot,{scope:n,children:(0,N.jsx)(`div`,{ref:t,children:r})})}),i):null});et.displayName=`SelectContentFragment`;var Z=10,[tt,Q]=J(X),nt=`SelectContentImpl`,rt=i(`SelectContent.RemoveScroll`),it=M.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:_,collisionPadding:v,sticky:y,hideWhenDetached:b,avoidCollisions:x,...S}=e,C=Y(X,n),[w,T]=M.useState(null),[D,O]=M.useState(null),k=a(t,e=>T(e)),[A,ee]=M.useState(null),[te,ne]=M.useState(null),P=Ne(n),[F,I]=M.useState(!1),L=M.useRef(!1);M.useEffect(()=>{if(w)return m(w)},[w]),p();let R=M.useCallback(e=>{let[t,...n]=P().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[P,D]),z=M.useCallback(()=>R([A,w]),[R,A,w]);M.useEffect(()=>{F&&z()},[F,z]);let{onOpenChange:B,triggerPointerDownPosRef:V}=C;M.useEffect(()=>{if(w){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(V.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||B(!1),document.removeEventListener(`pointermove`,t),V.current=null};return V.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,B,V]),M.useEffect(()=>{let e=()=>B(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[re,H]=zt(e=>{let t=P().filter(e=>!e.disabled),n=Bt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=M.useCallback((e,t,n)=>{let r=!L.current&&!n;(C.value!==void 0&&C.value===t||r)&&(ee(e),r&&(L.current=!0))},[C.value]),ae=M.useCallback(()=>w?.focus(),[w]),oe=M.useCallback((e,t,n)=>{let r=!L.current&&!n;(C.value!==void 0&&C.value===t||r)&&ne(e)},[C.value]),se=r===`popper`?ct:ot,ce=se===ct?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:_,collisionPadding:v,sticky:y,hideWhenDetached:b,avoidCollisions:x}:{};return(0,N.jsx)(tt,{scope:n,content:w,viewport:D,onViewportChange:O,itemRefCallback:ie,selectedItem:A,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:z,selectedItemText:te,position:r,isPositioned:F,searchRef:re,children:(0,N.jsx)(h,{as:rt,allowPinchZoom:!0,children:(0,N.jsx)(f,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:j(i,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,N.jsx)(E,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,N.jsx)(se,{role:`listbox`,id:C.contentId,"data-state":C.open?`open`:`closed`,dir:C.dir,onContextMenu:e=>e.preventDefault(),...S,...ce,onPlaced:()=>I(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...S.style},onKeyDown:j(S.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&H(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})});it.displayName=nt;var at=`SelectItemAlignedPosition`,ot=M.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,o=Y(X,n),s=Q(X,n),[c,l]=M.useState(null),[u,f]=M.useState(null),p=a(t,e=>f(e)),m=Ne(n),h=M.useRef(!1),_=M.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=M.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,f=d(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.left=f+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,f=d(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.right=f+`px`}let a=m(),s=window.innerHeight-Z*2,l=v.scrollHeight,f=window.getComputedStyle(u),p=parseInt(f.borderTopWidth,10),g=parseInt(f.paddingTop,10),_=parseInt(f.borderBottomWidth,10),x=parseInt(f.paddingBottom,10),S=p+g+l+x+_,C=Math.min(y.offsetHeight*5,S),w=window.getComputedStyle(v),T=parseInt(w.paddingTop,10),E=parseInt(w.paddingBottom,10),D=e.top+e.height/2-Z,O=s-D,k=y.offsetHeight/2,A=y.offsetTop+k,j=p+g+A,ee=S-j;if(j<=D){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-v.offsetTop-v.offsetHeight,n=j+Math.max(O,k+(e?E:0)+t+_);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(D,p+v.offsetTop+(e?T:0)+k)+ee;c.style.height=t+`px`,v.scrollTop=j-D+v.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=C+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,u,v,y,b,o.dir,r]);k(()=>S(),[S]);let[C,w]=M.useState();return k(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]),(0,N.jsx)(lt,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:M.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,N.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,N.jsx)(g.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});ot.displayName=at;var st=`SelectPopperPosition`,ct=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Z,...a}=e,o=Ie(n);return(0,N.jsx)(y,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ct.displayName=st;var[lt,ut]=J(X,{}),dt=`SelectViewport`,ft=M.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,o=Q(dt,n),s=ut(dt,n),c=a(t,o.onViewportChange),l=M.useRef(0);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,N.jsx)(Me.Slot,{scope:n,children:(0,N.jsx)(g.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:j(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Z*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})});ft.displayName=dt;var pt=`SelectGroup`,[mt,ht]=J(pt),gt=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=S();return(0,N.jsx)(mt,{scope:n,id:i,children:(0,N.jsx)(g.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});gt.displayName=pt;var _t=`SelectLabel`,vt=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ht(_t,n);return(0,N.jsx)(g.div,{id:i.id,...r,ref:t})});vt.displayName=_t;var yt=`SelectItem`,[bt,xt]=J(yt),St=M.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,c=Y(yt,n),l=Q(yt,n),u=c.value===r,[d,f]=M.useState(o??``),[p,m]=M.useState(!1),h=a(t,e=>l.itemRefCallback?.(e,r,i)),_=S(),v=M.useRef(`touch`),y=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,N.jsx)(bt,{scope:n,value:r,disabled:i,textId:_,isSelected:u,onItemTextChange:M.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,N.jsx)(Me.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,N.jsx)(g.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...s,ref:h,onFocus:j(s.onFocus,()=>m(!0)),onBlur:j(s.onBlur,()=>m(!1)),onClick:j(s.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:j(s.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:j(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:j(s.onPointerMove,e=>{v.current=e.pointerType,i?l.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:j(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:j(s.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(je.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})});St.displayName=yt;var $=`SelectItemText`,Ct=M.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...o}=e,s=Y($,n),c=Q($,n),l=xt($,n),u=ze($,n),[d,f]=M.useState(null),p=a(t,e=>f(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),m=d?.textContent,h=M.useMemo(()=>(0,N.jsx)(`option`,{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=u;return k(()=>(_(h),()=>v(h)),[_,v,h]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(g.span,{id:l.textId,...o,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ke.createPortal(o.children,s.valueNode):null]})});Ct.displayName=$;var wt=`SelectItemIndicator`,Tt=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return xt(wt,n).isSelected?(0,N.jsx)(g.span,{"aria-hidden":!0,...r,ref:t}):null});Tt.displayName=wt;var Et=`SelectScrollUpButton`,Dt=M.forwardRef((e,t)=>{let n=Q(Et,e.__scopeSelect),r=ut(Et,e.__scopeSelect),[i,o]=M.useState(!1),s=a(t,r.onScrollButtonChange);return k(()=>{if(n.viewport&&n.isPositioned){let e=function(){o(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(At,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Dt.displayName=Et;var Ot=`SelectScrollDownButton`,kt=M.forwardRef((e,t)=>{let n=Q(Ot,e.__scopeSelect),r=ut(Ot,e.__scopeSelect),[i,o]=M.useState(!1),s=a(t,r.onScrollButtonChange);return k(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;o(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(At,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});kt.displayName=Ot;var At=M.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Q(`SelectScrollButton`,n),o=M.useRef(null),s=Ne(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),k(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,N.jsx)(g.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:j(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:j(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:j(i.onPointerLeave,()=>{c()})})}),jt=`SelectSeparator`,Mt=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,N.jsx)(g.div,{"aria-hidden":!0,...r,ref:t})});Mt.displayName=jt;var Nt=`SelectArrow`,Pt=M.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ie(n);return Q(Nt,n).position===`popper`?(0,N.jsx)(D,{...i,...r,ref:t}):null});Pt.displayName=Nt;var Ft=`SelectBubbleInput`,It=M.forwardRef(({__scopeSelect:e,...t},n)=>{let r=Y(Ft,e),{value:i,onValueChange:o,required:s,disabled:c,name:u,autoComplete:d,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,h=M.useRef(null),v=a(n,h),y=i??``,b=l(y);return M.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(b!==y&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,y),e.dispatchEvent(t)}},[b,y]),(0,N.jsxs)(g.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:u,autoComplete:d,disabled:c,form:f,onChange:e=>o(e.target.value),...t,style:{..._,...t.style},ref:v,defaultValue:y,children:[Rt(i)?(0,N.jsx)(`option`,{value:``}):null,Array.from(p)]},m)});It.displayName=Ft;function Lt(e){return typeof e==`function`}function Rt(e){return e===``||e===void 0}function zt(e){let t=w(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Bt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Vt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ht({...e}){return(0,N.jsx)(He,{"data-slot":`select`,...e})}function Ut({className:e,...t}){return(0,N.jsx)(gt,{"data-slot":`select-group`,className:s(`scroll-my-1 p-1`,e),...t})}function Wt({...e}){return(0,N.jsx)(Ke,{"data-slot":`select-value`,...e})}function Gt({className:e,size:t=`default`,children:n,...r}){return(0,N.jsxs)(We,{"data-slot":`select-trigger`,"data-size":t,className:s(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,N.jsx)(Je,{asChild:!0,children:(0,N.jsx)(te,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Kt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,N.jsx)(Qe,{children:(0,N.jsxs)($e,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:s(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,N.jsx)(Jt,{}),(0,N.jsx)(ft,{"data-position":n,className:s(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,N.jsx)(Yt,{})]})})}function qt({className:e,children:t,...n}){return(0,N.jsxs)(St,{"data-slot":`select-item`,className:s(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,N.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,N.jsx)(Tt,{children:(0,N.jsx)(ee,{className:`pointer-events-none`})})}),(0,N.jsx)(Ct,{children:t})]})}function Jt({className:e,...t}){return(0,N.jsx)(Dt,{"data-slot":`select-scroll-up-button`,className:s(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,N.jsx)(ne,{})})}function Yt({className:e,...t}){return(0,N.jsx)(kt,{"data-slot":`select-scroll-down-button`,className:s(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,N.jsx)(te,{})})}function Xt({className:e,children:t,...n}){return(0,N.jsxs)(Ee,{"data-slot":`scroll-area`,className:s(`relative`,e),...n,children:[(0,N.jsx)(De,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,N.jsx)(Zt,{}),(0,N.jsx)(Oe,{})]})}function Zt({className:e,orientation:t=`vertical`,...n}){return(0,N.jsx)(ie,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:s(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,N.jsx)(he,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}export{qt as a,Ut as i,Ht as n,Gt as o,Kt as r,Wt as s,Xt as t};
@@ -1 +0,0 @@
1
- import{B as e,D as t,M as n,N as r,R as i,S as a,d as o,f as s,s as c,t as l,u,v as d}from"./utils-BmM72imW.js";import{i as f,n as p,o as m,r as h,t as g}from"./query-keys-CDsPIOEO.js";import{n as _}from"./mutation-CwzbY9ri.js";import{n as v,t as y}from"./image-BZKAkGUy.js";import{a as b,i as x,n as S,o as C,r as w,s as T,t as E}from"./scroll-area-awhNOWo3.js";import{t as D}from"./settings-2-CCv0KiQI.js";import{t as O}from"./input-tgPw9P7N.js";import{w as k}from"./index-Pdit8x1d.js";var A=class extends i{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),n(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&a(t.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??_();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){d.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},j=e(s(),1);function M(e,n){let i=u(n),[a]=j.useState(()=>new A(i,e));j.useEffect(()=>{a.setOptions(e)},[a,e]);let o=j.useSyncExternalStore(j.useCallback(e=>a.subscribe(d.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),s=j.useCallback((e,n)=>{a.mutate(e,n).catch(t)},[a]);if(o.error&&r(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var N=c(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),P=c(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),F=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,I=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=F[n[e]&63];return t};function L(){return p(`/api/config`)}function R(e){return p(`/api/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}function z(){return m({queryKey:g.config,queryFn:L})}function B(){let e=u();return M({mutationFn:e=>R(e),onSuccess:t=>{e.setQueryData(g.config,t),e.invalidateQueries({queryKey:g.library})}})}var V=o();function H(e=``){return{id:I(),path:e}}function U(e){return e.length>0?e.map(e=>({...e})):[H()]}function W(e){return e.map(e=>({id:e.id,path:e.path.trim()})).filter(e=>e.path)}function G(e){let t=new Set;for(let n of e){let e=n.path.trim();if(e){if(t.has(e))return e;t.add(e)}}return null}function K(){let{data:e,isPending:t,isError:n}=z(),r=B(),[i,a]=(0,j.useState)([H()]),[o,s]=(0,j.useState)([H()]),[c,u]=(0,j.useState)(`ignore`);(0,j.useEffect)(()=>{e&&(a(U(e.novelDirectories)),s(U(e.comicDirectories)),u(e.gbkNovelHandling??`ignore`))},[e]),(0,j.useEffect)(()=>{n&&k.error(`加载设置失败`)},[n]);let d=(e,t,n)=>{(e===`novel`?a:s)(e=>e.map(e=>e.id===t?{...e,path:n}:e))},p=e=>{(e===`novel`?a:s)(e=>[...e,H()])},m=(e,t)=>{(e===`novel`?a:s)(e=>e.length===1?[H()]:e.filter(e=>e.id!==t))},g=()=>{let e=G(i);if(e){k.error(`小说目录存在重复路径:${e}`);return}let t=G(o);if(t){k.error(`漫画目录存在重复路径:${t}`);return}r.mutate({novelDirectories:W(i),comicDirectories:W(o),gbkNovelHandling:c},{onSuccess:()=>k.success(`设置已保存`),onError:()=>k.error(`保存设置失败`)})},_=(e,t,n)=>(0,V.jsxs)(`section`,{className:`mb-4 rounded-[10px] border border-border bg-card px-5 py-4`,children:[(0,V.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-[#c2c2ca]`,children:[e===`novel`?(0,V.jsx)(v,{className:`size-4 text-indigo-500`}):(0,V.jsx)(y,{className:`size-4 text-indigo-500`}),t]}),(0,V.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(t=>(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(O,{value:t.path,onChange:n=>d(e,t.id,n.target.value),placeholder:`输入目录路径,如 D:/Books/Novels/`,className:`h-9 border-[#2a2a32] bg-[#141418] text-[13px] text-[#e2e2e8] placeholder:text-[#4a4a56] focus-visible:border-indigo-500`}),(0,V.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>m(e,t.id),"aria-label":`删除目录`,className:`shrink-0 text-[#6b6b78] hover:bg-[#2a2a32] hover:text-[#e2e2e8]`,children:(0,V.jsx)(P,{})})]},t.id))}),(0,V.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,className:`mt-1 h-8 border border-dashed border-[#2a2a32] bg-transparent px-3 text-xs text-[#9f9fad] hover:border-indigo-500 hover:bg-transparent hover:text-[#d5d5dd]`,onClick:()=>p(e),children:[(0,V.jsx)(N,{"data-icon":`inline-start`}),`添加目录`]})]});return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,V.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b px-5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[15px] font-semibold text-[#e2e2e8]`,children:[(0,V.jsx)(D,{className:`size-4 text-indigo-500`}),`设置`]}),(0,V.jsx)(f,{type:`button`,onClick:g,disabled:r.isPending||t,className:`ml-auto h-9 bg-indigo-500 px-[18px] text-[13px] font-medium text-white hover:bg-[#5558e0]`,children:r.isPending?`保存中...`:`保存设置`})]}),(0,V.jsx)(E,{className:`min-h-0 flex-1`,children:t?(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 p-5`,children:[(0,V.jsx)(h,{className:`h-24 w-full`}),(0,V.jsx)(h,{className:`h-24 w-full`})]}):(0,V.jsxs)(`div`,{className:`px-5 pt-2 pb-5`,children:[_(`novel`,`小说目录`,i),(0,V.jsxs)(`section`,{className:`mb-4 rounded-[10px] border border-border bg-card px-5 py-4`,children:[(0,V.jsx)(`div`,{className:`mb-3 text-sm font-semibold text-[#c2c2ca]`,children:`GBK 编码小说`}),(0,V.jsxs)(S,{value:c,onValueChange:e=>u(e),children:[(0,V.jsx)(C,{size:`sm`,className:l(`h-9 min-w-[220px] border-[#2a2a32] bg-[#141418] text-[13px] text-[#e2e2e8]`),children:(0,V.jsx)(T,{})}),(0,V.jsx)(w,{children:(0,V.jsxs)(x,{children:[(0,V.jsx)(b,{value:`ignore`,children:`忽略(扫描时跳过 GBK 小说)`}),(0,V.jsx)(b,{value:`convert-to-utf-8`,children:`转为 UTF-8(扫描时转换并覆盖原文件)`})]})})]}),c===`convert-to-utf-8`?(0,V.jsx)(`p`,{className:`mt-2 text-xs text-[#6b6b78]`,children:`扫描时会将 GBK 小说转为 UTF-8 并覆盖磁盘上的原文件。`}):null]}),_(`comic`,`漫画目录`,o)]})})]})}function q(){return(0,V.jsx)(K,{})}export{q as component};
@@ -1 +0,0 @@
1
- import{B as e,d as t,f as n,s as r}from"./utils-BmM72imW.js";import{i}from"./reading-progress-BcmbUd_d.js";var a=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),o={all:`全部`,novel:`小说`,comic:`漫画`,reading:`阅读中`,unread:`未开始`,completed:`已完成`};function s(e){return o[e]}function c(e,t,n){let r=[...e];t===`novel`||t===`comic`?r=r.filter(e=>e.type===t):(t===`reading`||t===`unread`||t===`completed`)&&(r=r.filter(e=>i(e.progress)===t));let a=n.trim().toLowerCase();return a&&(r=r.filter(e=>e.title.toLowerCase().includes(a))),r}function l(e,t){let n=[...e];return(t===`name`||t===`recent`||t===`added`)&&n.sort((e,t)=>e.title.localeCompare(t.title,`zh-CN`)),n}function u(e){return e.reduce((e,t)=>{let n=i(t.progress);return e[n]+=1,e},{reading:0,unread:0,completed:0})}var d=e(n(),1),f=t(),p=(0,d.createContext)(null);function m({value:e,children:t}){return(0,f.jsx)(p.Provider,{value:e,children:t})}function h(){let e=(0,d.useContext)(p);if(!e)throw Error(`useShellContext must be used within ShellProvider`);return e}export{s as a,c as i,h as n,l as o,u as r,a as s,m as t};
@@ -1 +0,0 @@
1
- import{B as e,d as t,f as n,o as r,t as i}from"./utils-BmM72imW.js";import{a}from"./query-keys-CDsPIOEO.js";import{i as o,r as s}from"./dist-CqonX7c8.js";import{C as c,_ as l,h as u,m as d,x as f,y as p}from"./index-Pdit8x1d.js";var m=e(n(),1),h=t(),g=`rovingFocusGroup.onEntryFocus`,_={bubbles:!1,cancelable:!0},v=`RovingFocusGroup`,[y,b,x]=o(v),[S,C]=f(v,[x]),[w,T]=S(v),E=m.forwardRef((e,t)=>(0,h.jsx)(y.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(y.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,h.jsx)(D,{...e,ref:t})})}));E.displayName=v;var D=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:y,onEntryFocus:x,preventScrollOnEntryFocus:S=!1,...C}=e,T=m.useRef(null),E=r(t,T),D=s(o),[O,k]=l({prop:u,defaultProp:f??null,onChange:y,caller:v}),[A,j]=m.useState(!1),M=d(x),P=b(n),F=m.useRef(!1),[I,L]=m.useState(0);return m.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(g,M),()=>e.removeEventListener(g,M)},[M]),(0,h.jsx)(w,{scope:n,orientation:i,dir:D,loop:a,currentTabStopId:O,onItemFocus:m.useCallback(e=>k(e),[k]),onItemShiftTab:m.useCallback(()=>j(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>L(e=>e-1),[]),children:(0,h.jsx)(c.div,{tabIndex:A||I===0?-1:0,"data-orientation":i,...C,ref:E,style:{outline:`none`,...e.style},onMouseDown:p(e.onMouseDown,()=>{F.current=!0}),onFocus:p(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(g,_);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);N([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),S)}}F.current=!1}),onBlur:p(e.onBlur,()=>j(!1))})})}),O=`RovingFocusGroupItem`,k=m.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,l=u(),d=a||l,f=T(O,n),g=f.currentTabStopId===d,_=b(n),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:S}=f;return m.useEffect(()=>{if(r)return v(),()=>x()},[r,v,x]),(0,h.jsx)(y.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:(0,h.jsx)(c.span,{tabIndex:g?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:p(e.onMouseDown,e=>{r?f.onItemFocus(d):e.preventDefault()}),onFocus:p(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:p(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=M(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=_().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?P(n,r+1):n.slice(r+1)}setTimeout(()=>N(n))}}),children:typeof o==`function`?o({isCurrentTabStop:g,hasTabStop:S!=null}):o})})});k.displayName=O;var A={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function j(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function M(e,t,n){let r=j(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return A[r]}function N(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function P(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var F=E,I=k,L=`Toggle`,R=m.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=l({prop:n,onChange:i,defaultProp:r??!1,caller:L});return(0,h.jsx)(c.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:p(e.onClick,()=>{e.disabled||s(!o)})})});R.displayName=L;var z=`ToggleGroup`,[B,ee]=f(z,[C]),V=C(),H=m.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,h.jsx)(G,{...r,ref:t});if(n===`multiple`)return(0,h.jsx)(K,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${z}\``)});H.displayName=z;var[U,W]=B(z),G=m.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=l({prop:n,defaultProp:r??``,onChange:i,caller:z});return(0,h.jsx)(U,{scope:e.__scopeToggleGroup,type:`single`,value:m.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:m.useCallback(()=>s(``),[s]),children:(0,h.jsx)(Y,{...a,ref:t})})}),K=m.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=l({prop:n,defaultProp:r??[],onChange:i,caller:z}),c=m.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=m.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,h.jsx)(U,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:u,children:(0,h.jsx)(Y,{...a,ref:t})})});H.displayName=z;var[q,J]=B(z),Y=m.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:l=!0,...u}=e,d=V(n),f=s(o),p={role:`group`,dir:f,...u};return(0,h.jsx)(q,{scope:n,rovingFocus:i,disabled:r,children:i?(0,h.jsx)(F,{asChild:!0,...d,orientation:a,dir:f,loop:l,children:(0,h.jsx)(c.div,{...p,ref:t})}):(0,h.jsx)(c.div,{...p,ref:t})})}),X=`ToggleGroupItem`,Z=m.forwardRef((e,t)=>{let n=W(X,e.__scopeToggleGroup),r=J(X,e.__scopeToggleGroup),i=V(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=m.useRef(null);return r.rovingFocus?(0,h.jsx)(I,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,h.jsx)(Q,{...s,ref:t})}):(0,h.jsx)(Q,{...s,ref:t})});Z.displayName=X;var Q=m.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=W(X,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,h.jsx)(R,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),te=H,ne=Z,re=a(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),$=m.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function ie({className:e,variant:t,size:n,spacing:r=2,orientation:a=`horizontal`,children:o,...s}){return(0,h.jsx)(te,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":a,style:{"--gap":r},className:i(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...s,children:(0,h.jsx)($.Provider,{value:{variant:t,size:n,spacing:r,orientation:a},children:o})})}function ae({className:e,children:t,variant:n=`default`,size:r=`default`,...a}){let o=m.useContext($);return(0,h.jsx)(ne,{"data-slot":`toggle-group-item`,"data-variant":o.variant||n,"data-size":o.size||r,"data-spacing":o.spacing,className:i(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,re({variant:o.variant||n,size:o.size||r}),e),...a,children:t})}export{ae as n,ie as t};
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u=new class extends l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>O(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var E=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(O(e)&&O(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:E.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function O(e){if(!k(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!k(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function k(e){return Object.prototype.toString.call(e)===`[object Object]`}function A(e){return new Promise(t=>{f.setTimeout(t,e)})}function j(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function M(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function N(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var P=Symbol();function ne(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===P?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function re(e,t){return typeof e==`function`?e(...t):!!e}function ie(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var F=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function I(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var L=p;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=L,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var oe=ae(),R=new class extends l{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function se(e){return Math.min(1e3*2**e,3e4)}function z(e){return(e??`online`)===`online`?R.isOnline():!0}var B=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ce(e){let t=!1,n=0,r,i=I(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new B(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||R.isOnline())&&e.canRun(),d=()=>z(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(F.isServer()?0:3),o=e.retryDelay??se,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),A(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var V=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(F.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}};function le(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ie(e,()=>t.signal,()=>n=!0)},u=ne(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?N:M;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?de:ue,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ue(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function ue(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function de(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var fe=class extends V{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=he(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=he(this.options);e.data!==void 0&&(this.setState(me(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=j(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>y(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:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ne(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?le(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ce({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof B&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof B){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...pe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...me(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),oe.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function pe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:z(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function he(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ge=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ne={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),_e=o(((e,t)=>{t.exports=ge()})),ve=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ye=o(((e,t)=>{t.exports=ve()})),H=c(_e(),1),be=ye(),xe=H.createContext(void 0),Se=e=>{let t=H.useContext(xe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ce=({client:e,children:t})=>(H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,be.jsx)(xe.Provider,{value:e,children:t})),we=o((e=>{var t=_e();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),Te=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=we()})),Ee=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),De=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Oe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ke=e=>{let t=Oe(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ae={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},je=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Me=(0,H.createContext)({}),Ne=()=>(0,H.useContext)(Me),Pe=(0,H.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Ne()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,H.createElement)(`svg`,{ref:c,...Ae,width:t??l??Ae.width,height:t??l??Ae.height,stroke:e??f,strokeWidth:m,className:Ee(`lucide`,p,i),...!a&&!je(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,H.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Fe=(e,t)=>{let n=(0,H.forwardRef)(({className:n,...r},i)=>(0,H.createElement)(Pe,{ref:i,iconNode:t,className:Ee(`lucide-${De(ke(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ke(e),n};function Ie(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Le(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ie(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ie(e[t],null)}}}}function Re(...e){return H.useCallback(Le(...e),e)}function ze(e){let t=H.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Je(r)&&typeof Qe==`function`&&(r=Qe(r._payload)),H.Children.forEach(r,e=>{if(Ke(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Je(n)&&typeof Qe==`function`&&(n=Qe(n._payload)),a=Ue(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=H.cloneElement(a,void 0,s):!o&&H.Children.count(r)===1&&H.isValidElement(r)&&(a=r);let c=a?Ge(a):void 0,l=Re(n,c);if(!a){if(r||r===0)throw Error(o?Ze(e):Xe(e));return r}let u=We(i,a.props??{});return a.type!==H.Fragment&&(u.ref=n?l:c),H.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Be=ze(`Slot`),Ve=Symbol.for(`radix.slottable`);function He(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Ve,t}var Ue=(e,t)=>{if(`child`in e.props){let t=e.props.child;return H.isValidElement(t)?H.cloneElement(t,void 0,e.props.children(t.props.children)):null}return H.isValidElement(t)?t:null};function We(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ge(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ke(e){return H.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ve}var qe=Symbol.for(`react.lazy`);function Je(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===qe&&`_payload`in e&&Ye(e._payload)}function Ye(e){return typeof e==`object`&&!!e&&`then`in e}var Xe=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Ze=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Qe=H.use;function $e(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=$e(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function et(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=$e(e))&&(r&&(r+=` `),r+=t);return r}var tt=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},nt=(e,t)=>({classGroupId:e,validator:t}),rt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),it=`-`,at=[],ot=`arbitrary..`,st=e=>{let t=ut(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return lt(e);let n=e.split(it);return ct(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?tt(i,t):t:i||at}return n[e]||at}}},ct=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ct(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(it):e.slice(t).join(it),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},lt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ot+r:void 0})(),ut=e=>{let{theme:t,classGroups:n}=e;return dt(n,t)},dt=(e,t)=>{let n=rt();for(let r in e){let i=e[r];ft(i,n,r,t)}return n},ft=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];pt(i,t,n,r)}},pt=(e,t,n,r)=>{if(typeof e==`string`){mt(e,t,n);return}if(typeof e==`function`){ht(e,t,n,r);return}gt(e,t,n,r)},mt=(e,t,n)=>{let r=e===``?t:_t(t,e);r.classGroupId=n},ht=(e,t,n,r)=>{if(vt(e)){ft(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(nt(n,e))},gt=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ft(o,_t(t,a),n,r)}},_t=(e,t)=>{let n=e,r=t.split(it),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=rt(),n.nextPart.set(t,i)),n=i}return n},vt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,yt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},bt=`!`,xt=`:`,St=[],Ct=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),wt=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===xt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(bt)?(c=s.slice(0,-1),l=!0):s.startsWith(bt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ct(t,l,c,u)};if(t){let e=t+xt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ct(St,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Tt=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Et=e=>({cache:yt(e.cacheSize),parseClassName:wt(e),sortModifiers:Tt(e),postfixLookupClassGroupIds:Dt(e),...st(e)}),Dt=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ot=/\s+/,kt=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ot),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+bt:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},At=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=jt(n))&&(i&&(i+=` `),i+=r);return i},jt=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=jt(e[r]))&&(n&&(n+=` `),n+=t);return n},Mt=(e,...t)=>{let n,r,i,a,o=o=>(n=Et(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=kt(e,n);return i(e,a),a};return a=o,(...e)=>a(At(...e))},Nt=[],U=e=>{let t=t=>t[e]||Nt;return t.isThemeGetter=!0,t},Pt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ft=/^\((?:(\w[\w-]*):)?(.+)\)$/i,It=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Rt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>It.test(e),G=e=>!!e&&!Number.isNaN(Number(e)),K=e=>!!e&&Number.isInteger(Number(e)),Ht=e=>e.endsWith(`%`)&&G(e.slice(0,-1)),q=e=>Lt.test(e),Ut=()=>!0,Wt=e=>Rt.test(e)&&!zt.test(e),Gt=()=>!1,Kt=e=>Bt.test(e),qt=e=>Vt.test(e),Jt=e=>!J(e)&&!X(e),Yt=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Xt=e=>Q(e,fn,Gt),J=e=>Pt.test(e),Y=e=>Q(e,pn,Wt),Zt=e=>Q(e,mn,G),Qt=e=>Q(e,gn,Ut),$t=e=>Q(e,hn,Gt),en=e=>Q(e,un,Gt),tn=e=>Q(e,dn,qt),nn=e=>Q(e,_n,Kt),X=e=>Ft.test(e),Z=e=>$(e,pn),rn=e=>$(e,hn),an=e=>$(e,un),on=e=>$(e,fn),sn=e=>$(e,dn),cn=e=>$(e,_n,!0),ln=e=>$(e,gn,!0),Q=(e,t,n)=>{let r=Pt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$=(e,t,n=!1)=>{let r=Ft.exec(e);return r?r[1]?t(r[1]):n:!1},un=e=>e===`position`||e===`percentage`,dn=e=>e===`image`||e===`url`,fn=e=>e===`length`||e===`size`||e===`bg-size`,pn=e=>e===`length`,mn=e=>e===`number`,hn=e=>e===`family-name`,gn=e=>e===`number`||e===`weight`,_n=e=>e===`shadow`,vn=Mt(()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),f=U(`text-shadow`),p=U(`drop-shadow`),m=U(`blur`),h=U(`perspective`),g=U(`aspect`),_=U(`ease`),v=U(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,J,c],T=()=>[W,`full`,`auto`,...w()],E=()=>[K,`none`,`subgrid`,X,J],ee=()=>[`auto`,{span:[`full`,K,X,J]},K,X,J],D=()=>[K,`auto`,X,J],te=()=>[`auto`,`min`,`max`,`fr`,X,J],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[W,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[W,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],N=()=>[W,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,X,J],ne=()=>[...b(),an,en,{position:[X,J]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,on,Xt,{size:[X,J]}],F=()=>[Ht,Z,Y],I=()=>[``,`none`,`full`,l,X,J],L=()=>[``,G,Z,Y],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[G,Ht,an,en],se=()=>[``,`none`,m,X,J],z=()=>[`none`,G,X,J],B=()=>[`none`,G,X,J],ce=()=>[G,X,J],V=()=>[W,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[q],breakpoint:[q],color:[Ut],container:[q],"drop-shadow":[q],ease:[`in`,`out`,`in-out`],font:[Jt],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[q],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[q],shadow:[q],spacing:[`px`,G],text:[q],"text-shadow":[q],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,W,J,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,J]}],"container-named":[Yt],columns:[{columns:[G,J,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[K,`auto`,X,J]}],basis:[{basis:[W,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[G,W,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,G,X,J]}],shrink:[{shrink:[``,G,X,J]}],order:[{order:[K,`first`,`last`,`none`,X,J]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,Z,Y]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ln,Qt]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ht,J]}],"font-family":[{font:[rn,$t,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,J]}],"line-clamp":[{"line-clamp":[G,`none`,X,Zt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[G,`from-font`,`auto`,X,Y]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[G,`auto`,X,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[K,X,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},K,X,J],radial:[``,X,J],conic:[K,X,J]},sn,tn]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[G,X,J]}],"outline-w":[{outline:[``,G,Z,Y]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,cn,nn]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,cn,nn]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[G,Y]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,cn,nn]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[G,X,J]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[G]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[X,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[G]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,J]}],filter:[{filter:[``,`none`,X,J]}],blur:[{blur:se()}],brightness:[{brightness:[G,X,J]}],contrast:[{contrast:[G,X,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cn,nn]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,G,X,J]}],"hue-rotate":[{"hue-rotate":[G,X,J]}],invert:[{invert:[``,G,X,J]}],saturate:[{saturate:[G,X,J]}],sepia:[{sepia:[``,G,X,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,J]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[G,X,J]}],"backdrop-contrast":[{"backdrop-contrast":[G,X,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,G,X,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[G,X,J]}],"backdrop-invert":[{"backdrop-invert":[``,G,X,J]}],"backdrop-opacity":[{"backdrop-opacity":[G,X,J]}],"backdrop-saturate":[{"backdrop-saturate":[G,X,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,G,X,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[G,`initial`,X,J]}],ease:[{ease:[`linear`,`initial`,_,X,J]}],delay:[{delay:[G,X,J]}],animate:[{animate:[`none`,v,X,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[X,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":[`translate-none`],zoom:[{zoom:[K,X,J]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,J]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[G,Z,Y,Zt]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function yn(...e){return vn(et(e))}export{b as A,c as B,C,h as D,x as E,v as F,f as I,u as L,D as M,re as N,T as O,P,l as R,w as S,S as T,R as _,He as a,F as b,Te as c,ye as d,_e as f,ce as g,V as h,ze as i,y as j,j as k,Ce as l,pe as m,et as n,Re as o,fe as p,Be as r,Fe as s,yn as t,Se as u,oe as v,_ as w,g as x,I as y,o as z};