@inertiaui/modal-react 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-modal.js +1706 -3205
- package/dist/inertiaui-modal.umd.cjs +13 -17
- package/package.json +11 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(j,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("axios"),require("@inertiajs/react"),require("@inertiajs/core"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","axios","@inertiajs/react","@inertiajs/core","react-dom"],i):(j=typeof globalThis<"u"?globalThis:j||self,i(j.InertiaUIModal={},j.React,j.Axios,j.react,j.core,j.ReactDOM))})(this,function(j,i,le,Oe,qr,Xr){"use strict";var Eo=Object.defineProperty;var xo=(j,i,le)=>i in j?Eo(j,i,{enumerable:!0,configurable:!0,writable:!0,value:le}):j[i]=le;var te=(j,i,le)=>xo(j,typeof i!="symbol"?i+"":i,le);function zr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const je=zr(i),_e={type:"modal",navigate:!1,modal:{closeButton:!0,closeExplicitly:!1,maxWidth:"2xl",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white rounded",position:"center"},slideover:{closeButton:!0,closeExplicitly:!1,maxWidth:"md",paddingClasses:"p-4 sm:p-6",panelClasses:"bg-white min-h-screen",position:"right"}};class Kr{constructor(){this.config={},this.reset()}reset(){this.config=JSON.parse(JSON.stringify(_e))}put(t,r){if(typeof t=="object"){this.config={type:t.type??_e.type,navigate:t.navigate??_e.navigate,modal:{..._e.modal,...t.modal??{}},slideover:{..._e.slideover,...t.slideover??{}}};return}const n=t.split(".");let l=this.config;for(let s=0;s<n.length-1;s++)l=l[n[s]]=l[n[s]]||{};l[n[n.length-1]]=r}get(t){if(typeof t>"u")return this.config;const r=t.split(".");let n=this.config;for(const l of r){if(n[l]===void 0)return null;n=n[l]}return n}}const Ke=new Kr,Gr=()=>Ke.reset(),Rr=(e,t)=>Ke.put(e,t),Ge=e=>Ke.get(e),Pe=(e,t)=>Ke.get(e?`slideover.${t}`:`modal.${t}`);var pt={exports:{}},Le={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ut;function Jr(){if(Ut)return Le;Ut=1;var e=i,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(d,a,f){var c,b={},x=null,y=null;f!==void 0&&(x=""+f),a.key!==void 0&&(x=""+a.key),a.ref!==void 0&&(y=a.ref);for(c in a)n.call(a,c)&&!s.hasOwnProperty(c)&&(b[c]=a[c]);if(d&&d.defaultProps)for(c in a=d.defaultProps,a)b[c]===void 0&&(b[c]=a[c]);return{$$typeof:t,type:d,key:x,ref:y,props:b,_owner:l.current}}return Le.Fragment=r,Le.jsx=u,Le.jsxs=u,Le}var Ae={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,25 +14,21 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var Ht;function Zr(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&function(){var e=i,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),d=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,g="@@iterator";function p(o){if(o===null||typeof o!="object")return null;var v=w&&o[w]||o[g];return typeof v=="function"?v:null}var m=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(o){{for(var v=arguments.length,E=new Array(v>1?v-1:0),C=1;C<v;C++)E[C-1]=arguments[C];T("error",o,E)}}function T(o,v,E){{var C=m.ReactDebugCurrentFrame,F=C.getStackAddendum();F!==""&&(v+="%s",E=E.concat([F]));var L=E.map(function($){return String($)});L.unshift("Warning: "+v),Function.prototype.apply.call(console[o],console,L)}}var S=!1,k=!1,Y=!1,U=!1,R=!1,J;J=Symbol.for("react.module.reference");function H(o){return!!(typeof o=="string"||typeof o=="function"||o===n||o===s||R||o===l||o===f||o===c||U||o===y||S||k||Y||typeof o=="object"&&o!==null&&(o.$$typeof===x||o.$$typeof===b||o.$$typeof===u||o.$$typeof===d||o.$$typeof===a||o.$$typeof===J||o.getModuleId!==void 0))}function q(o,v,E){var C=o.displayName;if(C)return C;var F=v.displayName||v.name||"";return F!==""?E+"("+F+")":E}function K(o){return o.displayName||"Context"}function _(o){if(o==null)return null;if(typeof o.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case l:return"StrictMode";case f:return"Suspense";case c:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case d:var v=o;return K(v)+".Consumer";case u:var E=o;return K(E._context)+".Provider";case a:return q(o,o.render,"ForwardRef");case b:var C=o.displayName||null;return C!==null?C:_(o.type)||"Memo";case x:{var F=o,L=F._payload,$=F._init;try{return _($(L))}catch{return null}}}return null}var M=Object.assign,I=0,ye,we,pe,Z,Ee,N,xe;function B(){}B.__reactDisabledLog=!0;function _t(){{if(I===0){ye=console.log,we=console.info,pe=console.warn,Z=console.error,Ee=console.group,N=console.groupCollapsed,xe=console.groupEnd;var o={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:o,log:o,warn:o,error:o,group:o,groupCollapsed:o,groupEnd:o})}I++}}function Te(){{if(I--,I===0){var o={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},o,{value:ye}),info:M({},o,{value:we}),warn:M({},o,{value:pe}),error:M({},o,{value:Z}),group:M({},o,{value:Ee}),groupCollapsed:M({},o,{value:N}),groupEnd:M({},o,{value:xe})})}I<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var qe=m.ReactCurrentDispatcher,Se;function ae(o,v,E){{if(Se===void 0)try{throw Error()}catch(F){var C=F.stack.trim().match(/\n( *(at )?)/);Se=C&&C[1]||""}return`
|
|
18
|
+
`+Se+o}}var se=!1,ct;{var Gl=typeof WeakMap=="function"?WeakMap:Map;ct=new Gl}function Fr(o,v){if(!o||se)return"";{var E=ct.get(o);if(E!==void 0)return E}var C;se=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=qe.current,qe.current=null,_t();try{if(v){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(G){C=G}Reflect.construct(o,[],$)}else{try{$.call()}catch(G){C=G}o.call($.prototype)}}else{try{throw Error()}catch(G){C=G}o()}}catch(G){if(G&&C&&typeof G.stack=="string"){for(var P=G.stack.split(`
|
|
19
|
+
`),X=C.stack.split(`
|
|
20
|
+
`),D=P.length-1,W=X.length-1;D>=1&&W>=0&&P[D]!==X[W];)W--;for(;D>=1&&W>=0;D--,W--)if(P[D]!==X[W]){if(D!==1||W!==1)do if(D--,W--,W<0||P[D]!==X[W]){var ee=`
|
|
21
|
+
`+P[D].replace(" at new "," at ");return o.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",o.displayName)),typeof o=="function"&&ct.set(o,ee),ee}while(D>=1&&W>=0);break}}}finally{se=!1,qe.current=L,Te(),Error.prepareStackTrace=F}var Fe=o?o.displayName||o.name:"",Ce=Fe?ae(Fe):"";return typeof o=="function"&&ct.set(o,Ce),Ce}function Rl(o,v,E){return Fr(o,!1)}function Jl(o){var v=o.prototype;return!!(v&&v.isReactComponent)}function dt(o,v,E){if(o==null)return"";if(typeof o=="function")return Fr(o,Jl(o));if(typeof o=="string")return ae(o);switch(o){case f:return ae("Suspense");case c:return ae("SuspenseList")}if(typeof o=="object")switch(o.$$typeof){case a:return Rl(o.render);case b:return dt(o.type,v,E);case x:{var C=o,F=C._payload,L=C._init;try{return dt(L(F),v,E)}catch{}}}return""}var Xe=Object.prototype.hasOwnProperty,jr={},_r=m.ReactDebugCurrentFrame;function ft(o){if(o){var v=o._owner,E=dt(o.type,o._source,v?v.type:null);_r.setExtraStackFrame(E)}else _r.setExtraStackFrame(null)}function Zl(o,v,E,C,F){{var L=Function.call.bind(Xe);for(var $ in o)if(L(o,$)){var P=void 0;try{if(typeof o[$]!="function"){var X=Error((C||"React class")+": "+E+" type `"+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[$]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw X.name="Invariant Violation",X}P=o[$](v,$,C,E,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(D){P=D}P&&!(P instanceof Error)&&(ft(F),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",E,$,typeof P),ft(null)),P instanceof Error&&!(P.message in jr)&&(jr[P.message]=!0,ft(F),h("Failed %s type: %s",E,P.message),ft(null))}}}var Ql=Array.isArray;function Lt(o){return Ql(o)}function eo(o){{var v=typeof Symbol=="function"&&Symbol.toStringTag,E=v&&o[Symbol.toStringTag]||o.constructor.name||"Object";return E}}function to(o){try{return Lr(o),!1}catch{return!0}}function Lr(o){return""+o}function Ar(o){if(to(o))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",eo(o)),Lr(o)}var ze=m.ReactCurrentOwner,ro={key:!0,ref:!0,__self:!0,__source:!0},Ir,Nr,At;At={};function no(o){if(Xe.call(o,"ref")){var v=Object.getOwnPropertyDescriptor(o,"ref").get;if(v&&v.isReactWarning)return!1}return o.ref!==void 0}function lo(o){if(Xe.call(o,"key")){var v=Object.getOwnPropertyDescriptor(o,"key").get;if(v&&v.isReactWarning)return!1}return o.key!==void 0}function oo(o,v){if(typeof o.ref=="string"&&ze.current&&v&&ze.current.stateNode!==v){var E=_(ze.current.type);At[E]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(ze.current.type),o.ref),At[E]=!0)}}function io(o,v){{var E=function(){Ir||(Ir=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};E.isReactWarning=!0,Object.defineProperty(o,"key",{get:E,configurable:!0})}}function ao(o,v){{var E=function(){Nr||(Nr=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};E.isReactWarning=!0,Object.defineProperty(o,"ref",{get:E,configurable:!0})}}var so=function(o,v,E,C,F,L,$){var P={$$typeof:t,type:o,key:v,ref:E,props:$,_owner:L};return P._store={},Object.defineProperty(P._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(P,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(P,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(P.props),Object.freeze(P)),P};function uo(o,v,E,C,F){{var L,$={},P=null,X=null;E!==void 0&&(Ar(E),P=""+E),lo(v)&&(Ar(v.key),P=""+v.key),no(v)&&(X=v.ref,oo(v,F));for(L in v)Xe.call(v,L)&&!ro.hasOwnProperty(L)&&($[L]=v[L]);if(o&&o.defaultProps){var D=o.defaultProps;for(L in D)$[L]===void 0&&($[L]=D[L])}if(P||X){var W=typeof o=="function"?o.displayName||o.name||"Unknown":o;P&&io($,W),X&&ao($,W)}return so(o,P,X,F,C,ze.current,$)}}var It=m.ReactCurrentOwner,Dr=m.ReactDebugCurrentFrame;function ke(o){if(o){var v=o._owner,E=dt(o.type,o._source,v?v.type:null);Dr.setExtraStackFrame(E)}else Dr.setExtraStackFrame(null)}var Nt;Nt=!1;function Dt(o){return typeof o=="object"&&o!==null&&o.$$typeof===t}function Wr(){{if(It.current){var o=_(It.current.type);if(o)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+o+"`."}return""}}function co(o){return""}var Ur={};function fo(o){{var v=Wr();if(!v){var E=typeof o=="string"?o:o.displayName||o.name;E&&(v=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+E+">.")}return v}}function Hr(o,v){{if(!o._store||o._store.validated||o.key!=null)return;o._store.validated=!0;var E=fo(v);if(Ur[E])return;Ur[E]=!0;var C="";o&&o._owner&&o._owner!==It.current&&(C=" It was passed a child from "+_(o._owner.type)+"."),ke(o),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',E,C),ke(null)}}function Br(o,v){{if(typeof o!="object")return;if(Lt(o))for(var E=0;E<o.length;E++){var C=o[E];Dt(C)&&Hr(C,v)}else if(Dt(o))o._store&&(o._store.validated=!0);else if(o){var F=p(o);if(typeof F=="function"&&F!==o.entries)for(var L=F.call(o),$;!($=L.next()).done;)Dt($.value)&&Hr($.value,v)}}}function po(o){{var v=o.type;if(v==null||typeof v=="string")return;var E;if(typeof v=="function")E=v.propTypes;else if(typeof v=="object"&&(v.$$typeof===a||v.$$typeof===b))E=v.propTypes;else return;if(E){var C=_(v);Zl(E,o.props,"prop",C,o)}else if(v.PropTypes!==void 0&&!Nt){Nt=!0;var F=_(v);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof v.getDefaultProps=="function"&&!v.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mo(o){{for(var v=Object.keys(o.props),E=0;E<v.length;E++){var C=v[E];if(C!=="children"&&C!=="key"){ke(o),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),ke(null);break}}o.ref!==null&&(ke(o),h("Invalid attribute `ref` supplied to `React.Fragment`."),ke(null))}}var Vr={};function Yr(o,v,E,C,F,L){{var $=H(o);if(!$){var P="";(o===void 0||typeof o=="object"&&o!==null&&Object.keys(o).length===0)&&(P+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var X=co();X?P+=X:P+=Wr();var D;o===null?D="null":Lt(o)?D="array":o!==void 0&&o.$$typeof===t?(D="<"+(_(o.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):D=typeof o,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,P)}var W=uo(o,v,E,F,L);if(W==null)return W;if($){var ee=v.children;if(ee!==void 0)if(C)if(Lt(ee)){for(var Fe=0;Fe<ee.length;Fe++)Br(ee[Fe],o);Object.freeze&&Object.freeze(ee)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Br(ee,o)}if(Xe.call(v,"key")){var Ce=_(o),G=Object.keys(v).filter(function(wo){return wo!=="key"}),Wt=G.length>0?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}";if(!Vr[Ce+Wt]){var yo=G.length>0?"{"+G.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Qt,We,tc,We),Xo[We+Qt]=!0}}return c===n?Js(Y):Xs(Y),Y}}function Qs(c,S,O){return Jo(c,S,O,!0)}function Zs(c,S,O){return Jo(c,S,O,!1)}var ec=Zs,rc=Qs;ar.Fragment=n,ar.jsx=ec,ar.jsxs=rc}()),ar}process.env.NODE_ENV==="production"?et.exports=aa():et.exports=ia();var $=et.exports;function la(r,e){return Array.isArray(r)?r.filter(t=>!e.includes(t)):Object.keys(r).reduce((t,n)=>(e.includes(n)||(t[n]=r[n]),t),{})}function rn(r,e){return Array.isArray(r)?r.filter(t=>e.includes(t)):e.reduce((t,n)=>(n in r&&(t[n]=r[n]),t),{})}function ua(r){return Array.isArray(r)?r.filter(e=>e!==null):Object.keys(r).reduce((e,t)=>(t in r&&r[t]!==null&&(e[t]=r[t]),e),{})}function sa(r,e=3,t=10){return new Promise((n,o)=>{const a=r();if(a){n(a);return}let l=e*1e3/t;const u=setInterval(()=>{const i=r();i&&(clearInterval(u),n(i)),--l<=0&&(clearInterval(u),o(new Error("Condition not met in time")))},t)})}function ir(r){return r?(r=r.replace(/_/g,"-"),r=r.replace(/-+/g,"-"),/[A-Z]/.test(r)?(r=r.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(e,t)=>t.toUpperCase()),r=r.replace(/(.)(?=[A-Z])/g,"$1-"),r.toLowerCase()):r):""}var ca=function(e){return fa(e)&&!da(e)};function fa(r){return!!r&&typeof r=="object"}function da(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||ma(r)}var pa=typeof Symbol=="function"&&Symbol.for,ya=pa?Symbol.for("react.element"):60103;function ma(r){return r.$$typeof===ya}function va(r){return Array.isArray(r)?[]:{}}function lr(r,e){return e.clone!==!1&&e.isMergeableObject(r)?Re(va(r),r,e):r}function ha(r,e,t){return r.concat(e).map(function(n){return lr(n,t)})}function ga(r,e){if(!e.customMerge)return Re;var t=e.customMerge(r);return typeof t=="function"?t:Re}function ba(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function tn(r){return Object.keys(r).concat(ba(r))}function nn(r,e){try{return e in r}catch{return!1}}function wa(r,e){return nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function Ea(r,e,t){var n={};return t.isMergeableObject(r)&&tn(r).forEach(function(o){n[o]=lr(r[o],t)}),tn(e).forEach(function(o){wa(r,o)||(nn(r,o)&&t.isMergeableObject(e[o])?n[o]=ga(o,t)(r[o],e[o],t):n[o]=lr(e[o],t))}),n}function Re(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||ha,t.isMergeableObject=t.isMergeableObject||ca,t.cloneUnlessOtherwiseSpecified=lr;var n=Array.isArray(e),o=Array.isArray(r),a=n===o;return a?n?t.arrayMerge(r,e,t):Ea(r,e,t):lr(e,t)}Re.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return Re(n,o,t)},{})};var Sa=Re,xa=Sa;const Oa=na(xa);var Pa=Error,Aa=EvalError,Ta=RangeError,$a=ReferenceError,on=SyntaxError,ur=TypeError,Ca=URIError,Fa=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[t]=o;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==o||l.enumerable!==!0)return!1}return!0},an=typeof Symbol<"u"&&Symbol,Ma=Fa,Ia=function(){return typeof an!="function"||typeof Symbol!="function"||typeof an("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ma()},rt={__proto__:null,foo:{}},_a=Object,Da=function(){return{__proto__:rt}.foo===rt.foo&&!(rt instanceof _a)},ka="Function.prototype.bind called on incompatible ",Na=Object.prototype.toString,ja=Math.max,La="[object Function]",ln=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var a=0;a<t.length;a+=1)n[a+e.length]=t[a];return n},Wa=function(e,t){for(var n=[],o=t,a=0;o<e.length;o+=1,a+=1)n[a]=e[o];return n},Ua=function(r,e){for(var t="",n=0;n<r.length;n+=1)t+=r[n],n+1<r.length&&(t+=e);return t},Ba=function(e){var t=this;if(typeof t!="function"||Na.apply(t)!==La)throw new TypeError(ka+t);for(var n=Wa(arguments,1),o,a=function(){if(this instanceof o){var s=t.apply(this,ln(n,arguments));return Object(s)===s?s:this}return t.apply(e,ln(n,arguments))},l=ja(0,t.length-n.length),u=[],i=0;i<l;i++)u[i]="$"+i;if(o=Function("binder","return function ("+Ua(u,",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var d=function(){};d.prototype=t.prototype,o.prototype=new d,d.prototype=null}return o},Ra=Ba,tt=Function.prototype.bind||Ra,Ha=Function.prototype.call,Va=Object.prototype.hasOwnProperty,qa=tt,Ga=qa.call(Ha,Va),F,za=Pa,Ya=Aa,Ka=Ta,Xa=$a,He=on,Ve=ur,Ja=Ca,un=Function,nt=function(r){try{return un('"use strict"; return ('+r+").constructor;")()}catch{}},$e=Object.getOwnPropertyDescriptor;if($e)try{$e({},"")}catch{$e=null}var ot=function(){throw new Ve},Qa=$e?function(){try{return arguments.callee,ot}catch{try{return $e(arguments,"callee").get}catch{return ot}}}():ot,qe=Ia(),Za=Da(),X=Object.getPrototypeOf||(Za?function(r){return r.__proto__}:null),Ge={},ei=typeof Uint8Array>"u"||!X?F:X(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&X?X([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":za,"%eval%":eval,"%EvalError%":Ya,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":un,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&X?X(X([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!X?F:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":Ka,"%ReferenceError%":Xa,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!X?F:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&X?X(""[Symbol.iterator]()):F,"%Symbol%":qe?Symbol:F,"%SyntaxError%":He,"%ThrowTypeError%":Qa,"%TypedArray%":ei,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":Ja,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet};if(X)try{null.error}catch(r){var ri=X(X(r));Ce["%Error.prototype%"]=ri}var ti=function r(e){var t;if(e==="%AsyncFunction%")t=nt("async function () {}");else if(e==="%GeneratorFunction%")t=nt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=nt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");o&&X&&(t=X(o.prototype))}return Ce[e]=t,t},sn={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},sr=tt,Tr=Ga,ni=sr.call(Function.call,Array.prototype.concat),oi=sr.call(Function.apply,Array.prototype.splice),cn=sr.call(Function.call,String.prototype.replace),$r=sr.call(Function.call,String.prototype.slice),ai=sr.call(Function.call,RegExp.prototype.exec),ii=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,li=/\\(\\)?/g,ui=function(e){var t=$r(e,0,1),n=$r(e,-1);if(t==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var o=[];return cn(e,ii,function(a,l,u,i){o[o.length]=u?cn(i,li,"$1"):l||a}),o},si=function(e,t){var n=e,o;if(Tr(sn,n)&&(o=sn[n],n="%"+o[0]+"%"),Tr(Ce,n)){var a=Ce[n];if(a===Ge&&(a=ti(n)),typeof a>"u"&&!t)throw new Ve("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new He("intrinsic "+e+" does not exist!")},ze=function(e,t){if(typeof e!="string"||e.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ai(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ui(e),o=n.length>0?n[0]:"",a=si("%"+o+"%",t),l=a.name,u=a.value,i=!1,d=a.alias;d&&(o=d[0],oi(n,ni([0,1],d)));for(var s=1,b=!0;s<n.length;s+=1){var v=n[s],E=$r(v,0,1),p=$r(v,-1);if((E==='"'||E==="'"||E==="`"||p==='"'||p==="'"||p==="`")&&E!==p)throw new He("property names with quotes must have matching quotes");if((v==="constructor"||!b)&&(i=!0),o+="."+v,l="%"+o+"%",Tr(Ce,l))u=Ce[l];else if(u!=null){if(!(v in u)){if(!t)throw new Ve("base intrinsic for "+e+" exists, but the property is not available.");return}if($e&&s+1>=n.length){var m=$e(u,v);b=!!m,b&&"get"in m&&!("originalValue"in m.get)?u=m.get:u=u[v]}else b=Tr(u,v),u=u[v];b&&!i&&(Ce[l]=u)}}return u},fn={exports:{}},at,dn;function it(){if(dn)return at;dn=1;var r=ze,e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return at=e,at}var ci=ze,Cr=ci("%Object.getOwnPropertyDescriptor%",!0);if(Cr)try{Cr([],"length")}catch{Cr=null}var pn=Cr,yn=it(),fi=on,Ye=ur,mn=pn,di=function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ye("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new Ye("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ye("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ye("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ye("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ye("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,i=!!mn&&mn(e,t);if(yn)yn(e,t,{configurable:l===null&&i?i.configurable:!l,enumerable:o===null&&i?i.enumerable:!o,value:n,writable:a===null&&i?i.writable:!a});else if(u||!o&&!a&&!l)e[t]=n;else throw new fi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},lt=it(),vn=function(){return!!lt};vn.hasArrayLengthDefineBug=function(){if(!lt)return null;try{return lt([],"length",{value:1}).length!==1}catch{return!0}};var pi=vn,yi=ze,hn=di,mi=pi(),gn=pn,bn=ur,vi=yi("%Math.floor%"),hi=function(e,t){if(typeof e!="function")throw new bn("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||vi(t)!==t)throw new bn("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,a=!0;if("length"in e&&gn){var l=gn(e,"length");l&&!l.configurable&&(o=!1),l&&!l.writable&&(a=!1)}return(o||a||!n)&&(mi?hn(e,"length",t,!0,!0):hn(e,"length",t)),e};(function(r){var e=tt,t=ze,n=hi,o=ur,a=t("%Function.prototype.apply%"),l=t("%Function.prototype.call%"),u=t("%Reflect.apply%",!0)||e.call(l,a),i=it(),d=t("%Math.max%");r.exports=function(v){if(typeof v!="function")throw new o("a function is required");var E=u(e,l,arguments);return n(E,1+d(0,v.length-(arguments.length-1)),!0)};var s=function(){return u(e,a,arguments)};i?i(r.exports,"apply",{value:s}):r.exports.apply=s})(fn);var gi=fn.exports,wn=ze,En=gi,bi=En(wn("String.prototype.indexOf")),wi=function(e,t){var n=wn(e,!!t);return typeof n=="function"&&bi(e,".prototype.")>-1?En(n):n};const Ei=oa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ut=typeof Map=="function"&&Map.prototype,st=Object.getOwnPropertyDescriptor&&ut?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Fr=ut&&st&&typeof st.get=="function"?st.get:null,Sn=ut&&Map.prototype.forEach,ct=typeof Set=="function"&&Set.prototype,ft=Object.getOwnPropertyDescriptor&&ct?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Mr=ct&&ft&&typeof ft.get=="function"?ft.get:null,xn=ct&&Set.prototype.forEach,Si=typeof WeakMap=="function"&&WeakMap.prototype,cr=Si?WeakMap.prototype.has:null,xi=typeof WeakSet=="function"&&WeakSet.prototype,fr=xi?WeakSet.prototype.has:null,Oi=typeof WeakRef=="function"&&WeakRef.prototype,On=Oi?WeakRef.prototype.deref:null,Pi=Boolean.prototype.valueOf,Ai=Object.prototype.toString,Ti=Function.prototype.toString,$i=String.prototype.match,dt=String.prototype.slice,Ee=String.prototype.replace,Ci=String.prototype.toUpperCase,Pn=String.prototype.toLowerCase,An=RegExp.prototype.test,Tn=Array.prototype.concat,fe=Array.prototype.join,Fi=Array.prototype.slice,$n=Math.floor,pt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,yt=Object.getOwnPropertySymbols,mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ke||!0)?Symbol.toStringTag:null,Cn=Object.prototype.propertyIsEnumerable,Fn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Mn(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||An.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-$n(-r):$n(r);if(n!==r){var o=String(n),a=dt.call(e,o.length+1);return Ee.call(o,t,"$&_")+"."+Ee.call(Ee.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(e,t,"$&_")}var vt=Ei,In=vt.custom,_n=Nn(In)?In:null,Mi=function r(e,t,n,o){var a=t||{};if(Se(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Se(a,"customInspect")?a.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ln(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var i=String(e);return u?Mn(e,i):i}if(typeof e=="bigint"){var d=String(e)+"n";return u?Mn(e,d):d}var s=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return ht(e)?"[Array]":"[Object]";var b=Ki(a,n);if(typeof o>"u")o=[];else if(jn(o,e)>=0)return"[Circular]";function v(C,T,k){if(T&&(o=Fi.call(o),o.push(T)),k){var oe={depth:a.depth};return Se(a,"quoteStyle")&&(oe.quoteStyle=a.quoteStyle),r(C,oe,n+1,o)}return r(C,a,n+1,o)}if(typeof e=="function"&&!kn(e)){var E=Ui(e),p=Ir(e,v);return"[Function"+(E?": "+E:" (anonymous)")+"]"+(p.length>0?" { "+fe.call(p,", ")+" }":"")}if(Nn(e)){var m=Ke?Ee.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):mt.call(e);return typeof e=="object"&&!Ke?dr(m):m}if(Gi(e)){for(var y="<"+Pn.call(String(e.nodeName)),h=e.attributes||[],g=0;g<h.length;g++)y+=" "+h[g].name+"="+Dn(Ii(h[g].value),"double",a);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+Pn.call(String(e.nodeName))+">",y}if(ht(e)){if(e.length===0)return"[]";var w=Ir(e,v);return b&&!Yi(w)?"["+bt(w,b)+"]":"[ "+fe.call(w,", ")+" ]"}if(Di(e)){var x=Ir(e,v);return!("cause"in Error.prototype)&&"cause"in e&&!Cn.call(e,"cause")?"{ ["+String(e)+"] "+fe.call(Tn.call("[cause]: "+v(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fe.call(x,", ")+" }"}if(typeof e=="object"&&l){if(_n&&typeof e[_n]=="function"&&vt)return vt(e,{depth:s-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Bi(e)){var P=[];return Sn&&Sn.call(e,function(C,T){P.push(v(T,e,!0)+" => "+v(C,e))}),Wn("Map",Fr.call(e),P,b)}if(Vi(e)){var D=[];return xn&&xn.call(e,function(C){D.push(v(C,e))}),Wn("Set",Mr.call(e),D,b)}if(Ri(e))return gt("WeakMap");if(qi(e))return gt("WeakSet");if(Hi(e))return gt("WeakRef");if(Ni(e))return dr(v(Number(e)));if(Li(e))return dr(v(pt.call(e)));if(ji(e))return dr(Pi.call(e));if(ki(e))return dr(v(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof Zr<"u"&&e===Zr)return"{ [object globalThis] }";if(!_i(e)&&!kn(e)){var _=Ir(e,v),U=Fn?Fn(e)===Object.prototype:e instanceof Object||e.constructor===Object,H=e instanceof Object?"":"null prototype",j=!U&&Q&&Object(e)===e&&Q in e?dt.call(xe(e),8,-1):H?"Object":"",z=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=z+(j||H?"["+fe.call(Tn.call([],j||[],H||[]),": ")+"] ":"");return _.length===0?V+"{}":b?V+"{"+bt(_,b)+"}":V+"{ "+fe.call(_,", ")+" }"}return String(e)};function Dn(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Ii(r){return Ee.call(String(r),/"/g,""")}function ht(r){return xe(r)==="[object Array]"&&(!Q||!(typeof r=="object"&&Q in r))}function _i(r){return xe(r)==="[object Date]"&&(!Q||!(typeof r=="object"&&Q in r))}function kn(r){return xe(r)==="[object RegExp]"&&(!Q||!(typeof r=="object"&&Q in r))}function Di(r){return xe(r)==="[object Error]"&&(!Q||!(typeof r=="object"&&Q in r))}function ki(r){return xe(r)==="[object String]"&&(!Q||!(typeof r=="object"&&Q in r))}function Ni(r){return xe(r)==="[object Number]"&&(!Q||!(typeof r=="object"&&Q in r))}function ji(r){return xe(r)==="[object Boolean]"&&(!Q||!(typeof r=="object"&&Q in r))}function Nn(r){if(Ke)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!mt)return!1;try{return mt.call(r),!0}catch{}return!1}function Li(r){if(!r||typeof r!="object"||!pt)return!1;try{return pt.call(r),!0}catch{}return!1}var Wi=Object.prototype.hasOwnProperty||function(r){return r in this};function Se(r,e){return Wi.call(r,e)}function xe(r){return Ai.call(r)}function Ui(r){if(r.name)return r.name;var e=$i.call(Ti.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function jn(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Bi(r){if(!Fr||!r||typeof r!="object")return!1;try{Fr.call(r);try{Mr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Ri(r){if(!cr||!r||typeof r!="object")return!1;try{cr.call(r,cr);try{fr.call(r,fr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Hi(r){if(!On||!r||typeof r!="object")return!1;try{return On.call(r),!0}catch{}return!1}function Vi(r){if(!Mr||!r||typeof r!="object")return!1;try{Mr.call(r);try{Fr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function qi(r){if(!fr||!r||typeof r!="object")return!1;try{fr.call(r,fr);try{cr.call(r,cr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Gi(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Ln(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ln(dt.call(r,0,e.maxStringLength),e)+n}var o=Ee.call(Ee.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,zi);return Dn(o,"single",e)}function zi(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Ci.call(e.toString(16))}function dr(r){return"Object("+r+")"}function gt(r){return r+" { ? }"}function Wn(r,e,t,n){var o=n?bt(t,n):fe.call(t,", ");return r+" ("+e+") {"+o+"}"}function Yi(r){for(var e=0;e<r.length;e++)if(jn(r[e],`
|
|
31
|
-
`)
|
|
32
|
-
`+e.prev+e.base;return t+fe.call(r,","+t)+`
|
|
33
|
-
`+e.prev}function Ir(r,e){var t=ht(r),n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++)n[o]=Se(r,o)?e(r[o],r):""}var a=typeof yt=="function"?yt(r):[],l;if(Ke){l={};for(var u=0;u<a.length;u++)l["$"+a[u]]=a[u]}for(var i in r)Se(r,i)&&(t&&String(Number(i))===i&&i<r.length||Ke&&l["$"+i]instanceof Symbol||(An.call(/[^\w$]/,i)?n.push(e(i,r)+": "+e(r[i],r)):n.push(i+": "+e(r[i],r))));if(typeof yt=="function")for(var d=0;d<a.length;d++)Cn.call(r,a[d])&&n.push("["+e(a[d])+"]: "+e(r[a[d]],r));return n}var Un=ze,Xe=wi,Xi=Mi,Ji=ur,_r=Un("%WeakMap%",!0),Dr=Un("%Map%",!0),Qi=Xe("WeakMap.prototype.get",!0),Zi=Xe("WeakMap.prototype.set",!0),el=Xe("WeakMap.prototype.has",!0),rl=Xe("Map.prototype.get",!0),tl=Xe("Map.prototype.set",!0),nl=Xe("Map.prototype.has",!0),wt=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},ol=function(r,e){var t=wt(r,e);return t&&t.value},al=function(r,e,t){var n=wt(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},il=function(r,e){return!!wt(r,e)},ll=function(){var e,t,n,o={assert:function(a){if(!o.has(a))throw new Ji("Side channel does not contain "+Xi(a))},get:function(a){if(_r&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Qi(e,a)}else if(Dr){if(t)return rl(t,a)}else if(n)return ol(n,a)},has:function(a){if(_r&&a&&(typeof a=="object"||typeof a=="function")){if(e)return el(e,a)}else if(Dr){if(t)return nl(t,a)}else if(n)return il(n,a);return!1},set:function(a,l){_r&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new _r),Zi(e,a,l)):Dr?(t||(t=new Dr),tl(t,a,l)):(n||(n={key:{},next:null}),al(n,a,l))}};return o},ul=String.prototype.replace,sl=/%20/g,Et={RFC1738:"RFC1738",RFC3986:"RFC3986"},St={default:Et.RFC3986,formatters:{RFC1738:function(r){return ul.call(r,sl,"+")},RFC3986:function(r){return String(r)}},RFC1738:Et.RFC1738,RFC3986:Et.RFC3986},cl=St,xt=Object.prototype.hasOwnProperty,Fe=Array.isArray,de=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),fl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Fe(n)){for(var o=[],a=0;a<n.length;++a)typeof n[a]<"u"&&o.push(n[a]);t.obj[t.prop]=o}}},Bn=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},dl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Fe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!xt.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var o=e;return Fe(e)&&!Fe(t)&&(o=Bn(e,n)),Fe(e)&&Fe(t)?(t.forEach(function(a,l){if(xt.call(e,l)){var u=e[l];u&&typeof u=="object"&&a&&typeof a=="object"?e[l]=r(u,a,n):e.push(a)}else e[l]=a}),e):Object.keys(t).reduce(function(a,l){var u=t[l];return xt.call(a,l)?a[l]=r(a[l],u,n):a[l]=u,a},o)},pl=function(e,t){return Object.keys(t).reduce(function(n,o){return n[o]=t[o],n},e)},yl=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ot=1024,ml=function(e,t,n,o,a){if(e.length===0)return e;var l=e;if(typeof e=="symbol"?l=Symbol.prototype.toString.call(e):typeof e!="string"&&(l=String(e)),n==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(E){return"%26%23"+parseInt(E.slice(2),16)+"%3B"});for(var u="",i=0;i<l.length;i+=Ot){for(var d=l.length>=Ot?l.slice(i,i+Ot):l,s=[],b=0;b<d.length;++b){var v=d.charCodeAt(b);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||a===cl.RFC1738&&(v===40||v===41)){s[s.length]=d.charAt(b);continue}if(v<128){s[s.length]=de[v];continue}if(v<2048){s[s.length]=de[192|v>>6]+de[128|v&63];continue}if(v<55296||v>=57344){s[s.length]=de[224|v>>12]+de[128|v>>6&63]+de[128|v&63];continue}b+=1,v=65536+((v&1023)<<10|d.charCodeAt(b)&1023),s[s.length]=de[240|v>>18]+de[128|v>>12&63]+de[128|v>>6&63]+de[128|v&63]}u+=s.join("")}return u},vl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],o=0;o<t.length;++o)for(var a=t[o],l=a.obj[a.prop],u=Object.keys(l),i=0;i<u.length;++i){var d=u[i],s=l[d];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t.push({obj:l,prop:d}),n.push(s))}return fl(t),e},hl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},gl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},bl=function(e,t){return[].concat(e,t)},wl=function(e,t){if(Fe(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(t(e[o]));return n}return t(e)},Rn={arrayToObject:Bn,assign:pl,combine:bl,compact:vl,decode:yl,encode:ml,isBuffer:gl,isRegExp:hl,maybeMap:wl,merge:dl},Hn=ll,kr=Rn,pr=St,El=Object.prototype.hasOwnProperty,Vn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},pe=Array.isArray,Sl=Array.prototype.push,qn=function(r,e){Sl.apply(r,pe(e)?e:[e])},xl=Date.prototype.toISOString,Gn=pr.default,K={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:kr.encode,encodeValuesOnly:!1,format:Gn,formatter:pr.formatters[Gn],indices:!1,serializeDate:function(e){return xl.call(e)},skipNulls:!1,strictNullHandling:!1},Ol=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pt={},Pl=function r(e,t,n,o,a,l,u,i,d,s,b,v,E,p,m,y,h,g){for(var w=e,x=g,P=0,D=!1;(x=x.get(Pt))!==void 0&&!D;){var _=x.get(e);if(P+=1,typeof _<"u"){if(_===P)throw new RangeError("Cyclic object value");D=!0}typeof x.get(Pt)>"u"&&(P=0)}if(typeof s=="function"?w=s(t,w):w instanceof Date?w=E(w):n==="comma"&&pe(w)&&(w=kr.maybeMap(w,function(ce){return ce instanceof Date?E(ce):ce})),w===null){if(l)return d&&!y?d(t,K.encoder,h,"key",p):t;w=""}if(Ol(w)||kr.isBuffer(w)){if(d){var U=y?t:d(t,K.encoder,h,"key",p);return[m(U)+"="+m(d(w,K.encoder,h,"value",p))]}return[m(t)+"="+m(String(w))]}var H=[];if(typeof w>"u")return H;var j;if(n==="comma"&&pe(w))y&&d&&(w=kr.maybeMap(w,d)),j=[{value:w.length>0?w.join(",")||null:void 0}];else if(pe(s))j=s;else{var z=Object.keys(w);j=b?z.sort(b):z}var V=i?t.replace(/\./g,"%2E"):t,C=o&&pe(w)&&w.length===1?V+"[]":V;if(a&&pe(w)&&w.length===0)return C+"[]";for(var T=0;T<j.length;++T){var k=j[T],oe=typeof k=="object"&&typeof k.value<"u"?k.value:w[k];if(!(u&&oe===null)){var se=v&&i?k.replace(/\./g,"%2E"):k,me=pe(w)?typeof n=="function"?n(C,se):C:C+(v?"."+se:"["+se+"]");g.set(e,P);var Z=Hn();Z.set(Pt,g),qn(H,r(oe,me,n,o,a,l,u,i,n==="comma"&&y&&pe(w)?null:d,s,b,v,E,p,m,y,h,Z))}}return H},Al=function(e){if(!e)return K;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||K.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=pr.default;if(typeof e.format<"u"){if(!El.call(pr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=pr.formatters[n],a=K.filter;(typeof e.filter=="function"||pe(e.filter))&&(a=e.filter);var l;if(e.arrayFormat in Vn?l=e.arrayFormat:"indices"in e?l=e.indices?"indices":"repeat":l=K.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:K.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:K.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:K.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:K.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?K.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:K.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:K.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:K.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:K.encodeValuesOnly,filter:a,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:K.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:K.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:K.strictNullHandling}},Tl=function(r,e){var t=r,n=Al(e),o,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):pe(n.filter)&&(a=n.filter,o=a);var l=[];if(typeof t!="object"||t===null)return"";var u=Vn[n.arrayFormat],i=u==="comma"&&n.commaRoundTrip;o||(o=Object.keys(t)),n.sort&&o.sort(n.sort);for(var d=Hn(),s=0;s<o.length;++s){var b=o[s];n.skipNulls&&t[b]===null||qn(l,Pl(t[b],b,u,i,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,d))}var v=l.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),v.length>0?E+v:""},Je=Rn,At=Object.prototype.hasOwnProperty,$l=Array.isArray,R={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Je.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Cl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},zn=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Fl="utf8=%26%2310003%3B",Ml="utf8=%E2%9C%93",Il=function(e,t){var n={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,l=o.split(t.delimiter,a),u=-1,i,d=t.charset;if(t.charsetSentinel)for(i=0;i<l.length;++i)l[i].indexOf("utf8=")===0&&(l[i]===Ml?d="utf-8":l[i]===Fl&&(d="iso-8859-1"),u=i,i=l.length);for(i=0;i<l.length;++i)if(i!==u){var s=l[i],b=s.indexOf("]="),v=b===-1?s.indexOf("="):b+1,E,p;v===-1?(E=t.decoder(s,R.decoder,d,"key"),p=t.strictNullHandling?null:""):(E=t.decoder(s.slice(0,v),R.decoder,d,"key"),p=Je.maybeMap(zn(s.slice(v+1),t),function(y){return t.decoder(y,R.decoder,d,"value")})),p&&t.interpretNumericEntities&&d==="iso-8859-1"&&(p=Cl(p)),s.indexOf("[]=")>-1&&(p=$l(p)?[p]:p);var m=At.call(n,E);m&&t.duplicates==="combine"?n[E]=Je.combine(n[E],p):(!m||t.duplicates==="last")&&(n[E]=p)}return n},_l=function(r,e,t,n){for(var o=n?e:zn(e,t),a=r.length-1;a>=0;--a){var l,u=r[a];if(u==="[]"&&t.parseArrays)l=t.allowEmptyArrays&&(o===""||t.strictNullHandling&&o===null)?[]:[].concat(o);else{l=t.plainObjects?Object.create(null):{};var i=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=t.decodeDotInKeys?i.replace(/%2E/g,"."):i,s=parseInt(d,10);!t.parseArrays&&d===""?l={0:o}:!isNaN(s)&&u!==d&&String(s)===d&&s>=0&&t.parseArrays&&s<=t.arrayLimit?(l=[],l[s]=o):d!=="__proto__"&&(l[d]=o)}o=l}return o},Dl=function(e,t,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,u=/(\[[^[\]]*])/g,i=n.depth>0&&l.exec(a),d=i?a.slice(0,i.index):a,s=[];if(d){if(!n.plainObjects&&At.call(Object.prototype,d)&&!n.allowPrototypes)return;s.push(d)}for(var b=0;n.depth>0&&(i=u.exec(a))!==null&&b<n.depth;){if(b+=1,!n.plainObjects&&At.call(Object.prototype,i[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(i[1])}if(i){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s.push("["+a.slice(i.index)+"]")}return _l(s,t,n,o)}},kl=function(e){if(!e)return R;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?R.charset:e.charset,n=typeof e.duplicates>"u"?R.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:R.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:R.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:R.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:R.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:R.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:R.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:R.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:R.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:R.decoder,delimiter:typeof e.delimiter=="string"||Je.isRegExp(e.delimiter)?e.delimiter:R.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:R.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:R.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:R.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:R.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:R.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:R.strictNullHandling}},Nl=function(r,e){var t=kl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Il(r,t):r,o=t.plainObjects?Object.create(null):{},a=Object.keys(n),l=0;l<a.length;++l){var u=a[l],i=Dl(u,n[u],t,typeof r=="string");o=Je.merge(o,i,t)}return t.allowSparse===!0?o:Je.compact(o)},jl=Tl,Ll=Nl,Wl=St,Yn={formats:Wl,parse:Ll,stringify:jl},Ul={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
34
|
-
* @license MIT */(function(r,e){(function(t,n){r.exports=n()})(Zr,function(){var t={};t.version="0.2.0";var n=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(p){var m,y;for(m in p)y=p[m],y!==void 0&&p.hasOwnProperty(m)&&(n[m]=y);return this},t.status=null,t.set=function(p){var m=t.isStarted();p=o(p,n.minimum,1),t.status=p===1?null:p;var y=t.render(!m),h=y.querySelector(n.barSelector),g=n.speed,w=n.easing;return y.offsetWidth,u(function(x){n.positionUsing===""&&(n.positionUsing=t.getPositioningCSS()),i(h,l(p,g,w)),p===1?(i(y,{transition:"none",opacity:1}),y.offsetWidth,setTimeout(function(){i(y,{transition:"all "+g+"ms linear",opacity:0}),setTimeout(function(){t.remove(),x()},g)},g)):setTimeout(x,g)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},n.trickleSpeed)};return n.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var m=t.status;return m?(typeof p!="number"&&(p=(1-m)*o(Math.random()*m,.1,.95)),m=o(m+p,0,.994),t.set(m)):t.start()},t.trickle=function(){return t.inc(Math.random()*n.trickleRate)},function(){var p=0,m=0;t.promise=function(y){return!y||y.state()==="resolved"?this:(m===0&&t.start(),p++,m++,y.always(function(){m--,m===0?(p=0,t.done()):t.set((p-m)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");s(document.documentElement,"nprogress-busy");var m=document.createElement("div");m.id="nprogress",m.innerHTML=n.template;var y=m.querySelector(n.barSelector),h=p?"-100":a(t.status||0),g=document.querySelector(n.parent),w;return i(y,{transition:"all 0 linear",transform:"translate3d("+h+"%,0,0)"}),n.showSpinner||(w=m.querySelector(n.spinnerSelector),w&&E(w)),g!=document.body&&s(g,"nprogress-custom-parent"),g.appendChild(m),m},t.remove=function(){b(document.documentElement,"nprogress-busy"),b(document.querySelector(n.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&E(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,m="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return m+"Perspective"in p?"translate3d":m+"Transform"in p?"translate":"margin"};function o(p,m,y){return p<m?m:p>y?y:p}function a(p){return(-1+p)*100}function l(p,m,y){var h;return n.positionUsing==="translate3d"?h={transform:"translate3d("+a(p)+"%,0,0)"}:n.positionUsing==="translate"?h={transform:"translate("+a(p)+"%,0)"}:h={"margin-left":a(p)+"%"},h.transition="all "+m+"ms "+y,h}var u=function(){var p=[];function m(){var y=p.shift();y&&y(m)}return function(y){p.push(y),p.length==1&&m()}}(),i=function(){var p=["Webkit","O","Moz","ms"],m={};function y(x){return x.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(P,D){return D.toUpperCase()})}function h(x){var P=document.body.style;if(x in P)return x;for(var D=p.length,_=x.charAt(0).toUpperCase()+x.slice(1),U;D--;)if(U=p[D]+_,U in P)return U;return x}function g(x){return x=y(x),m[x]||(m[x]=h(x))}function w(x,P,D){P=g(P),x.style[P]=D}return function(x,P){var D=arguments,_,U;if(D.length==2)for(_ in P)U=P[_],U!==void 0&&P.hasOwnProperty(_)&&w(x,_,U);else w(x,D[1],D[2])}}();function d(p,m){var y=typeof p=="string"?p:v(p);return y.indexOf(" "+m+" ")>=0}function s(p,m){var y=v(p),h=y+m;d(y,m)||(p.className=h.substring(1))}function b(p,m){var y=v(p),h;d(p,m)&&(h=y.replace(" "+m+" "," "),p.className=h.substring(1,h.length-1))}function v(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function E(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})})(Ul);function Bl(r,e,t,n="brackets"){let o=/^https?:\/\//.test(e.toString()),a=o||e.toString().startsWith("/"),l=!a&&!e.toString().startsWith("#")&&!e.toString().startsWith("?"),u=e.toString().includes("?")||r==="get"&&Object.keys(t).length,i=e.toString().includes("#"),d=new URL(e.toString(),"http://localhost");return r==="get"&&Object.keys(t).length&&(d.search=Yn.stringify(Oa(Yn.parse(d.search,{ignoreQueryPrefix:!0}),t),{encodeValuesOnly:!0,arrayFormat:n}),t={}),[[o?`${d.protocol}//${d.host}`:"",a?d.pathname:"",l?d.pathname.substring(1):"",u?d.search:"",i?d.hash:""].join(""),t]}const Nr=f.createContext(null);Nr.displayName="ModalStackContext";let Kn=null,Xn=null,yr=null,Tt=null,$t=[];const Jn=({children:r})=>{const[e,t]=f.useState([]),[n,o]=f.useState({}),a=m=>{t(y=>{const h=m([...y]),g=w=>{var x;return h.length<2?!0:((x=h.map(P=>({id:P.id,shouldRender:P.shouldRender})).reverse().find(P=>P.shouldRender))==null?void 0:x.id)===w};return h.forEach((w,x)=>{h[x].onTopOfStack=g(w.id),h[x].getParentModal=()=>x<1?null:h.slice(0,x).reverse().find(P=>P.isOpen),h[x].getChildModal=()=>x===h.length-1?null:h.slice(x+1).find(P=>P.isOpen)}),h})};f.useEffect(()=>{$t=e},[e]);class l{constructor(y,h,g,w,x){le(this,"update",(y,h,g)=>{a(w=>w.map(x=>(x.id===this.id&&(x.config=y,x.onCloseCallback=h,x.afterLeaveCallback=g),x)))});le(this,"show",()=>{a(y=>y.map(h=>(h.id===this.id&&!h.isOpen&&(h.isOpen=!0,h.shouldRender=!0),h)))});le(this,"setOpen",y=>{y?this.show():this.close()});le(this,"close",()=>{a(y=>y.map(h=>{var g;return h.id===this.id&&h.isOpen&&(Object.keys(h.listeners).forEach(w=>{h.off(w)}),h.isOpen=!1,(g=h.onCloseCallback)==null||g.call(h)),h}))});le(this,"afterLeave",()=>{this.isOpen||a(y=>{const h=y.map(g=>{var w;return g.id===this.id&&!g.isOpen&&(g.shouldRender=!1,(w=g.afterLeaveCallback)==null||w.call(g),g.afterLeaveCallback=null),g});return this.index===0?[]:h})});le(this,"on",(y,h)=>{y=ir(y),this.listeners[y]=this.listeners[y]??[],this.listeners[y].push(h)});le(this,"off",(y,h)=>{var g;y=ir(y),h?this.listeners[y]=((g=this.listeners[y])==null?void 0:g.filter(w=>w!==h))??[]:delete this.listeners[y]});le(this,"emit",(y,...h)=>{var g;(g=this.listeners[ir(y)])==null||g.forEach(w=>w(...h))});le(this,"registerEventListenersFromProps",y=>{const h=[];return Object.keys(y).filter(g=>g.startsWith("on")).forEach(g=>{const w=ir(g).replace(/^on-/,"");this.on(w,y[g]),h.push(()=>this.off(w,y[g]))}),()=>h.forEach(g=>g())});le(this,"reload",(y={})=>{var g;let h=Object.keys(this.response.props);y.only&&(h=rn(h,y.only)),y.except&&(h=la(h,y.except)),(g=this.response)!=null&&g.url&&ve.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":h.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":yr}}).then(w=>{this.updateProps(w.data.props)})});le(this,"updateProps",y=>{Object.assign(this.props,y),a(h=>h)});this.id=l.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=y,this.props=h.props,this.response=h,this.config=g,this.onCloseCallback=w,this.afterLeaveCallback=x,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const u=(m,y={},h=null,g=null)=>Xn(m.component).then(w=>i(w,m,y,h,g)),i=(m,y,h,g,w)=>{const x=new l(m,y,h,g,w);return x.index=e.length,a(P=>[...P,x]),x.show(),x};function d(m,y,h,g){if(!n[m])throw new Error(`The local modal "${m}" has not been registered.`);const w=i(null,{},y,h,g);return w.name=m,n[m].callback(w),w}const s=(m,y={})=>b(m,y.method??"get",y.data??{},y.headers??{},y.config??{},y.onClose,y.onAfterLeave,y.queryStringArrayFormat??"brackets",y.navigate??Ar("navigate")).then(h=>{const g=y.listeners??{};return Object.keys(g).forEach(w=>{const x=ir(w);h.on(x,g[w])}),h}),b=(m,y,h={},g={},w={},x=null,P=null,D="brackets",_=!1)=>new Promise((U,H)=>{if(m.startsWith("#")){U(d(m.substring(1),w,x,P));return}const[j,z]=Bl(y,m||"",h,D);let V=_&&e.length===0;if(e.length===0&&(yr=typeof window<"u"?window.location.href:""),g={...g,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Kn,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":V?1:0,"X-InertiaUI-Modal-Base-Url":yr},V)return Tt=null,Ue.router.visit(j,{method:y,data:z,headers:g,preserveScroll:!0,preserveState:!0,onError:H,onFinish:()=>{sa(()=>Tt).then(C=>{const T=C.onCloseCallback,k=C.afterLeaveCallback;C.update(w,()=>{x==null||x(),T==null||T()},()=>{P==null||P(),k==null||k()}),U(C)})}});ve({url:j,method:y,data:z,headers:g}).then(C=>U(u(C.data,w,x,P))).catch(C=>{H(C)})}),p={stack:e,localModals:n,push:i,pushFromResponseData:u,closeAll:()=>{$t.reverse().forEach(m=>m.close())},reset:()=>a(()=>[]),visit:b,visitModal:s,registerLocalModal:(m,y)=>{o(h=>({...h,[m]:{name:m,callback:y}}))},removeLocalModal:m=>{o(y=>{const h={...y};return delete h[m],h})}};return $.jsx(Nr.Provider,{value:p,children:r})},mr=()=>{const r=f.useContext(Nr);if(r===null)throw new Error("useModalStack must be used within a ModalStackProvider");return r},Qn=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],Rl=(r,e)=>{e.initialPage&&(Kn=e.initialPage.version),e.resolveComponent&&(Xn=e.resolveComponent);const t=({Component:n,props:o,key:a})=>{const l=()=>{const u=f.createElement(n,{key:a,...o});return typeof n.layout=="function"?n.layout(u):Array.isArray(n.layout)?n.layout.concat(u).reverse().reduce((d,s)=>f.createElement(s,o,d)):u};return $.jsxs($.Fragment,{children:[l(),$.jsx(Zn,{})]})};return $.jsx(Jn,{children:$.jsx(r,{...e,children:t})})},Zn=({children:r})=>{var u;const e=f.useContext(Nr);let t=!1,n=!1;f.useEffect(()=>Ue.router.on("start",()=>t=!0),[]),f.useEffect(()=>Ue.router.on("finish",()=>t=!1),[]),f.useEffect(()=>Ue.router.on("navigate",function(i){const d=i.detail.page.props._inertiaui_modal;if(!d){n&&e.closeAll();return}n=d,yr=d.baseUrl,e.pushFromResponseData(d,{},()=>{if(!d.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!t&&window.location.href!==d.baseUrl&&Ue.router.visit(d.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(s=>{Tt=s})}),[]);const o=i=>($t.length&&(i.headers["X-InertiaUI-Modal-Base-Url"]=yr),i);f.useEffect(()=>(ve.interceptors.request.use(o),()=>ve.interceptors.request.eject(o)),[]);const a=Ue.usePage(),l=f.useRef();return f.useEffect(()=>{var s,b;const i=(s=a.props)==null?void 0:s._inertiaui_modal,d=l.current;l.current=i,i&&d&&i.component===d.component&&i.url===d.url&&((b=e.stack[0])==null||b.updateProps(i.props??{}))},[(u=a.props)==null?void 0:u._inertiaui_modal]),$.jsxs($.Fragment,{children:[r,e.stack.length>0&&$.jsx(eo,{index:0})]})},Ct=f.createContext(null);Ct.displayName="ModalIndexContext";const Ft=()=>{const r=f.useContext(Ct);if(r===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return r},eo=({index:r})=>{const{stack:e}=mr(),t=f.useMemo(()=>e[r],[e,r]);return(t==null?void 0:t.component)&&$.jsx(Ct.Provider,{value:r,children:$.jsx(t.component,{...t.props,onModalEvent:(...n)=>t.emit(...n)})})},Mt=f.forwardRef(({name:r,children:e,...t},n)=>{const o=Ft(),{stack:a,registerLocalModal:l,removeLocalModal:u}=mr(),[i,d]=f.useState(null),s=f.useMemo(()=>r?i:a[o],[r,i,o,a]),b=f.useMemo(()=>{var p;return(p=a.find(m=>m.shouldRender&&m.index>(s==null?void 0:s.index)))==null?void 0:p.index},[o,a]),v=f.useMemo(()=>(s==null?void 0:s.config.slideover)??t.slideover??Ar("type")==="slideover",[t.slideover]),E=f.useMemo(()=>({slideover:v,closeButton:t.closeButton??Be(v,"closeButton"),closeExplicitly:t.closeExplicitly??Be(v,"closeExplicitly"),maxWidth:t.maxWidth??Be(v,"maxWidth"),paddingClasses:t.paddingClasses??Be(v,"paddingClasses"),panelClasses:t.panelClasses??Be(v,"panelClasses"),position:t.position??Be(v,"position"),...s==null?void 0:s.config}),[t,s==null?void 0:s.config]);return f.useEffect(()=>{if(r){let p=null;return l(r,m=>{p=m.registerEventListenersFromProps(t),d(m)}),()=>{p==null||p(),p=null,u(r)}}return s.registerEventListenersFromProps(t)},[r]),f.useImperativeHandle(n,()=>({afterLeave:()=>s.afterLeave(),close:()=>s.close(),config:E,emit:(...p)=>s.emit(...p),getChildModal:()=>s.getChildModal(),getParentModal:()=>s.getParentModal(),id:s==null?void 0:s.id,index:s==null?void 0:s.index,isOpen:s==null?void 0:s.isOpen,modalContext:s,onTopOfStack:s==null?void 0:s.onTopOfStack,reload:()=>s.reload(),setOpen:()=>s.setOpen(),shouldRender:s==null?void 0:s.shouldRender}),[s]),(s==null?void 0:s.shouldRender)&&$.jsxs($.Fragment,{children:[typeof e=="function"?e({afterLeave:s.afterLeave,close:s.close,config:E,emit:s.emit,getChildModal:s.getChildModal,getParentModal:s.getParentModal,id:s.id,index:s.index,isOpen:s.isOpen,modalContext:s,onTopOfStack:s.onTopOfStack,reload:s.reload,setOpen:s.setOpen,shouldRender:s.shouldRender}):e,b&&$.jsx(eo,{index:b})]})});Mt.displayName="HeadlessModal";function ro(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(t=ro(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function jr(){for(var r,e,t=0,n="",o=arguments.length;t<o;t++)(r=arguments[t])&&(e=ro(r))&&(n&&(n+=" "),n+=e);return n}var Hl=Object.defineProperty,Vl=(r,e,t)=>e in r?Hl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,It=(r,e,t)=>(Vl(r,typeof e!="symbol"?e+"":e,t),t);let ql=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Me=new ql;function Lr(r){return Me.isServer?null:r instanceof Node?r.ownerDocument:r!=null&&r.hasOwnProperty("current")&&r.current instanceof Node?r.current.ownerDocument:document}function Wr(r){typeof queueMicrotask=="function"?queueMicrotask(r):Promise.resolve().then(r).catch(e=>setTimeout(()=>{throw e}))}function Oe(){let r=[],e={addEventListener(t,n,o,a){return t.addEventListener(n,o,a),e.add(()=>t.removeEventListener(n,o,a))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let n=setTimeout(...t);return e.add(()=>clearTimeout(n))},microTask(...t){let n={current:!0};return Wr(()=>{n.current&&t[0]()}),e.add(()=>{n.current=!1})},style(t,n,o){let a=t.style.getPropertyValue(n);return Object.assign(t.style,{[n]:o}),this.add(()=>{Object.assign(t.style,{[n]:a})})},group(t){let n=Oe();return t(n),this.add(()=>n.dispose())},add(t){return r.includes(t)||r.push(t),()=>{let n=r.indexOf(t);if(n>=0)for(let o of r.splice(n,1))o()}},dispose(){for(let t of r.splice(0))t()}};return e}function _t(){let[r]=f.useState(Oe);return f.useEffect(()=>()=>r.dispose(),[r]),r}let ee=(r,e)=>{Me.isServer?f.useEffect(r,e):f.useLayoutEffect(r,e)};function Ie(r){let e=f.useRef(r);return ee(()=>{e.current=r},[r]),e}let B=function(r){let e=Ie(r);return f.useCallback((...t)=>e.current(...t),[e])},Gl=f.createContext(void 0);function zl(){return f.useContext(Gl)}function Dt(...r){return Array.from(new Set(r.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Pe(r,e,...t){if(r in e){let o=e[r];return typeof o=="function"?o(...t):o}let n=new Error(`Tried to handle "${r}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pe),n}var Ur=(r=>(r[r.None=0]="None",r[r.RenderStrategy=1]="RenderStrategy",r[r.Static=2]="Static",r))(Ur||{}),Ae=(r=>(r[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r))(Ae||{});function ae(){let r=Kl();return f.useCallback(e=>Yl({mergeRefs:r,...e}),[r])}function Yl({ourProps:r,theirProps:e,slot:t,defaultTag:n,features:o,visible:a=!0,name:l,mergeRefs:u}){u=u??Xl;let i=to(e,r);if(a)return Br(i,t,n,l,u);let d=o??0;if(d&2){let{static:s=!1,...b}=i;if(s)return Br(b,t,n,l,u)}if(d&1){let{unmount:s=!0,...b}=i;return Pe(s?0:1,{0(){return null},1(){return Br({...b,hidden:!0,style:{display:"none"}},t,n,l,u)}})}return Br(i,t,n,l,u)}function Br(r,e={},t,n,o){let{as:a=t,children:l,refName:u="ref",...i}=kt(r,["unmount","static"]),d=r.ref!==void 0?{[u]:r.ref}:{},s=typeof l=="function"?l(e):l;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(e)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let b={};if(e){let v=!1,E=[];for(let[p,m]of Object.entries(e))typeof m=="boolean"&&(v=!0),m===!0&&E.push(p.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(v){b["data-headlessui-state"]=E.join(" ");for(let p of E)b[`data-${p}`]=""}}if(a===f.Fragment&&(Object.keys(_e(i)).length>0||Object.keys(_e(b)).length>0))if(!f.isValidElement(s)||Array.isArray(s)&&s.length>1){if(Object.keys(_e(i)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(_e(i)).concat(Object.keys(_e(b))).map(v=>` - ${v}`).join(`
|
|
35
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(v=>` - ${v}`).join(`
|
|
30
|
+
<%s key={someKey} {...props} />`,Wt,Ce,yo,Ce),Vr[Ce+Wt]=!0}}return o===n?mo(W):po(W),W}}function vo(o,v,E){return Yr(o,v,E,!0)}function ho(o,v,E){return Yr(o,v,E,!1)}var go=ho,bo=vo;Ae.Fragment=n,Ae.jsx=go,Ae.jsxs=bo}()),Ae}process.env.NODE_ENV==="production"?pt.exports=Jr():pt.exports=Zr();var O=pt.exports;function Qr(e,t){return Array.isArray(e)?e.filter(r=>!t.includes(r)):Object.keys(e).reduce((r,n)=>(t.includes(n)||(r[n]=e[n]),r),{})}function Bt(e,t){return Array.isArray(e)?e.filter(r=>t.includes(r)):t.reduce((r,n)=>(n in e&&(r[n]=e[n]),r),{})}function en(e){return Array.isArray(e)?e.filter(t=>t!==null):Object.keys(e).reduce((t,r)=>(r in e&&e[r]!==null&&(t[r]=e[r]),t),{})}function tn(e,t=3,r=10){return new Promise((n,l)=>{const s=e();if(s){n(s);return}let u=t*1e3/r;const d=setInterval(()=>{const a=e();a&&(clearInterval(d),n(a)),--u<=0&&(clearInterval(d),l(new Error("Condition not met in time")))},r)})}function Ie(e){return e?(e=e.replace(/_/g,"-"),e=e.replace(/-+/g,"-"),/[A-Z]/.test(e)?(e=e.replace(/\s+/g,"").replace(/_/g,"").replace(/(?:^|\s|-)+([A-Za-z])/g,(t,r)=>r.toUpperCase()),e=e.replace(/(.)(?=[A-Z])/g,"$1-"),e.toLowerCase()):e):""}const Re=i.createContext(null);Re.displayName="ModalStackContext";let Vt=null,Yt=null,Ne=null,mt=null,vt=[];const qt=({children:e})=>{const[t,r]=i.useState([]),[n,l]=i.useState({}),s=g=>{r(p=>{const m=g([...p]),h=T=>{var S;return m.length<2?!0:((S=m.map(k=>({id:k.id,shouldRender:k.shouldRender})).reverse().find(k=>k.shouldRender))==null?void 0:S.id)===T};return m.forEach((T,S)=>{m[S].onTopOfStack=h(T.id),m[S].getParentModal=()=>S<1?null:m.slice(0,S).reverse().find(k=>k.isOpen),m[S].getChildModal=()=>S===m.length-1?null:m.slice(S+1).find(k=>k.isOpen)}),m})};i.useEffect(()=>{vt=t},[t]);class u{constructor(p,m,h,T,S){te(this,"update",(p,m,h)=>{s(T=>T.map(S=>(S.id===this.id&&(S.config=p,S.onCloseCallback=m,S.afterLeaveCallback=h),S)))});te(this,"show",()=>{s(p=>p.map(m=>(m.id===this.id&&!m.isOpen&&(m.isOpen=!0,m.shouldRender=!0),m)))});te(this,"setOpen",p=>{p?this.show():this.close()});te(this,"close",()=>{s(p=>p.map(m=>{var h;return m.id===this.id&&m.isOpen&&(Object.keys(m.listeners).forEach(T=>{m.off(T)}),m.isOpen=!1,(h=m.onCloseCallback)==null||h.call(m)),m}))});te(this,"afterLeave",()=>{this.isOpen||s(p=>{const m=p.map(h=>{var T;return h.id===this.id&&!h.isOpen&&(h.shouldRender=!1,(T=h.afterLeaveCallback)==null||T.call(h),h.afterLeaveCallback=null),h});return this.index===0?[]:m})});te(this,"on",(p,m)=>{p=Ie(p),this.listeners[p]=this.listeners[p]??[],this.listeners[p].push(m)});te(this,"off",(p,m)=>{var h;p=Ie(p),m?this.listeners[p]=((h=this.listeners[p])==null?void 0:h.filter(T=>T!==m))??[]:delete this.listeners[p]});te(this,"emit",(p,...m)=>{var h;(h=this.listeners[Ie(p)])==null||h.forEach(T=>T(...m))});te(this,"registerEventListenersFromProps",p=>{const m=[];return Object.keys(p).filter(h=>h.startsWith("on")).forEach(h=>{const T=Ie(h).replace(/^on-/,"");this.on(T,p[h]),m.push(()=>this.off(T,p[h]))}),()=>m.forEach(h=>h())});te(this,"reload",(p={})=>{var h;let m=Object.keys(this.response.props);p.only&&(m=Bt(m,p.only)),p.except&&(m=Qr(m,p.except)),(h=this.response)!=null&&h.url&&le.get(this.response.url,{headers:{Accept:"text/html, application/xhtml+xml","X-Inertia":!0,"X-Inertia-Partial-Component":this.response.component,"X-Inertia-Version":this.response.version,"X-Inertia-Partial-Data":m.join(","),"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":0,"X-InertiaUI-Modal-Base-Url":Ne}}).then(T=>{this.updateProps(T.data.props)})});te(this,"updateProps",p=>{Object.assign(this.props,p),s(m=>m)});this.id=u.generateId(),this.isOpen=!1,this.shouldRender=!1,this.listeners={},this.component=p,this.props=m.props,this.response=m,this.config=h,this.onCloseCallback=T,this.afterLeaveCallback=S,this.index=-1,this.getParentModal=()=>null,this.getChildModal=()=>null,this.onTopOfStack=!0}static generateId(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`inertiaui_modal_${crypto.randomUUID()}`:`inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2,9)}`}}const d=(g,p={},m=null,h=null)=>Yt(g.component).then(T=>a(T,g,p,m,h)),a=(g,p,m,h,T)=>{const S=new u(g,p,m,h,T);return S.index=t.length,s(k=>[...k,S]),S.show(),S};function f(g,p,m,h){if(!n[g])throw new Error(`The local modal "${g}" has not been registered.`);const T=a(null,{},p,m,h);return T.name=g,n[g].callback(T),T}const c=(g,p={})=>b(g,p.method??"get",p.data??{},p.headers??{},p.config??{},p.onClose,p.onAfterLeave,p.queryStringArrayFormat??"brackets",p.navigate??Ge("navigate")).then(m=>{const h=p.listeners??{};return Object.keys(h).forEach(T=>{const S=Ie(T);m.on(S,h[T])}),m}),b=(g,p,m={},h={},T={},S=null,k=null,Y="brackets",U=!1)=>new Promise((R,J)=>{if(g.startsWith("#")){R(f(g.substring(1),T,S,k));return}const[H,q]=qr.mergeDataIntoQueryString(p,g||"",m,Y);let K=U&&t.length===0;if(t.length===0&&(Ne=typeof window<"u"?window.location.href:""),h={...h,Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0,"X-Inertia-Version":Vt,"X-InertiaUI-Modal":!0,"X-InertiaUI-Modal-Use-Router":K?1:0,"X-InertiaUI-Modal-Base-Url":Ne},K)return mt=null,Oe.router.visit(H,{method:p,data:q,headers:h,preserveScroll:!0,preserveState:!0,onError:J,onFinish:()=>{tn(()=>mt).then(_=>{const M=_.onCloseCallback,I=_.afterLeaveCallback;_.update(T,()=>{S==null||S(),M==null||M()},()=>{k==null||k(),I==null||I()}),R(_)})}});le({url:H,method:p,data:q,headers:h}).then(_=>R(d(_.data,T,S,k))).catch(_=>{J(_)})}),w={stack:t,localModals:n,push:a,pushFromResponseData:d,closeAll:()=>{vt.reverse().forEach(g=>g.close())},reset:()=>s(()=>[]),visit:b,visitModal:c,registerLocalModal:(g,p)=>{l(m=>({...m,[g]:{name:g,callback:p}}))},removeLocalModal:g=>{l(p=>{const m={...p};return delete m[g],m})}};return O.jsx(Re.Provider,{value:w,children:e})},De=()=>{const e=i.useContext(Re);if(e===null)throw new Error("useModalStack must be used within a ModalStackProvider");return e},Xt=["closeButton","closeExplicitly","maxWidth","paddingClasses","panelClasses","position","slideover"],rn=(e,t)=>{t.initialPage&&(Vt=t.initialPage.version),t.resolveComponent&&(Yt=t.resolveComponent);const r=({Component:n,props:l,key:s})=>{const u=()=>{const d=i.createElement(n,{key:s,...l});return typeof n.layout=="function"?n.layout(d):Array.isArray(n.layout)?n.layout.concat(d).reverse().reduce((f,c)=>i.createElement(c,l,f)):d};return O.jsxs(O.Fragment,{children:[u(),O.jsx(zt,{})]})};return O.jsx(qt,{children:O.jsx(e,{...t,children:r})})},zt=({children:e})=>{var d;const t=i.useContext(Re);let r=!1,n=!1;i.useEffect(()=>Oe.router.on("start",()=>r=!0),[]),i.useEffect(()=>Oe.router.on("finish",()=>r=!1),[]),i.useEffect(()=>Oe.router.on("navigate",function(a){const f=a.detail.page.props._inertiaui_modal;if(!f){n&&t.closeAll();return}n=f,Ne=f.baseUrl,t.pushFromResponseData(f,{},()=>{if(!f.baseUrl){console.error("No base url in modal response data so cannot navigate back");return}!r&&window.location.href!==f.baseUrl&&Oe.router.visit(f.baseUrl,{preserveScroll:!0,preserveState:!0})}).then(c=>{mt=c})}),[]);const l=a=>(vt.length&&(a.headers["X-InertiaUI-Modal-Base-Url"]=Ne),a);i.useEffect(()=>(le.interceptors.request.use(l),()=>le.interceptors.request.eject(l)),[]);const s=Oe.usePage(),u=i.useRef();return i.useEffect(()=>{var c,b;const a=(c=s.props)==null?void 0:c._inertiaui_modal,f=u.current;u.current=a,a&&f&&a.component===f.component&&a.url===f.url&&((b=t.stack[0])==null||b.updateProps(a.props??{}))},[(d=s.props)==null?void 0:d._inertiaui_modal]),O.jsxs(O.Fragment,{children:[e,t.stack.length>0&&O.jsx(Kt,{index:0})]})},ht=i.createContext(null);ht.displayName="ModalIndexContext";const gt=()=>{const e=i.useContext(ht);if(e===void 0)throw new Error("useModalIndex must be used within a ModalIndexProvider");return e},Kt=({index:e})=>{const{stack:t}=De(),r=i.useMemo(()=>t[e],[t,e]);return(r==null?void 0:r.component)&&O.jsx(ht.Provider,{value:e,children:O.jsx(r.component,{...r.props,onModalEvent:(...n)=>r.emit(...n)})})},bt=i.forwardRef(({name:e,children:t,...r},n)=>{const l=gt(),{stack:s,registerLocalModal:u,removeLocalModal:d}=De(),[a,f]=i.useState(null),c=i.useMemo(()=>e?a:s[l],[e,a,l,s]),b=i.useMemo(()=>{var w;return(w=s.find(g=>g.shouldRender&&g.index>(c==null?void 0:c.index)))==null?void 0:w.index},[l,s]),x=i.useMemo(()=>(c==null?void 0:c.config.slideover)??r.slideover??Ge("type")==="slideover",[r.slideover]),y=i.useMemo(()=>({slideover:x,closeButton:r.closeButton??Pe(x,"closeButton"),closeExplicitly:r.closeExplicitly??Pe(x,"closeExplicitly"),maxWidth:r.maxWidth??Pe(x,"maxWidth"),paddingClasses:r.paddingClasses??Pe(x,"paddingClasses"),panelClasses:r.panelClasses??Pe(x,"panelClasses"),position:r.position??Pe(x,"position"),...c==null?void 0:c.config}),[r,c==null?void 0:c.config]);return i.useEffect(()=>{if(e){let w=null;return u(e,g=>{w=g.registerEventListenersFromProps(r),f(g)}),()=>{w==null||w(),w=null,d(e)}}return c.registerEventListenersFromProps(r)},[e]),i.useImperativeHandle(n,()=>({afterLeave:()=>c.afterLeave(),close:()=>c.close(),config:y,emit:(...w)=>c.emit(...w),getChildModal:()=>c.getChildModal(),getParentModal:()=>c.getParentModal(),id:c==null?void 0:c.id,index:c==null?void 0:c.index,isOpen:c==null?void 0:c.isOpen,modalContext:c,onTopOfStack:c==null?void 0:c.onTopOfStack,reload:()=>c.reload(),setOpen:()=>c.setOpen(),shouldRender:c==null?void 0:c.shouldRender}),[c]),(c==null?void 0:c.shouldRender)&&O.jsxs(O.Fragment,{children:[typeof t=="function"?t({afterLeave:c.afterLeave,close:c.close,config:y,emit:c.emit,getChildModal:c.getChildModal,getParentModal:c.getParentModal,id:c.id,index:c.index,isOpen:c.isOpen,modalContext:c,onTopOfStack:c.onTopOfStack,reload:c.reload,setOpen:c.setOpen,shouldRender:c.shouldRender}):t,b&&O.jsx(Kt,{index:b})]})});bt.displayName="HeadlessModal";function Gt(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=Gt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Je(){for(var e,t,r=0,n="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=Gt(e))&&(n&&(n+=" "),n+=t);return n}var nn=Object.defineProperty,ln=(e,t,r)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yt=(e,t,r)=>(ln(e,typeof t!="symbol"?t+"":t,r),r);let on=class{constructor(){yt(this,"current",this.detect()),yt(this,"handoffState","pending"),yt(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},me=new on;function Ze(e){return me.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function Qe(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ue(){let e=[],t={addEventListener(r,n,l,s){return r.addEventListener(n,l,s),t.add(()=>r.removeEventListener(n,l,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Qe(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,l){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:l}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=ue();return r(n),this.add(()=>n.dispose())},add(r){return e.includes(r)||e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let l of e.splice(n,1))l()}},dispose(){for(let r of e.splice(0))r()}};return t}function wt(){let[e]=i.useState(ue);return i.useEffect(()=>()=>e.dispose(),[e]),e}let V=(e,t)=>{me.isServer?i.useEffect(e,t):i.useLayoutEffect(e,t)};function ve(e){let t=i.useRef(e);return V(()=>{t.current=e},[e]),t}let A=function(e){let t=ve(e);return i.useCallback((...r)=>t.current(...r),[t])},an=i.createContext(void 0);function sn(){return i.useContext(an)}function Et(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ce(e,t,...r){if(e in t){let l=t[e];return typeof l=="function"?l(...r):l}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(l=>`"${l}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ce),n}var et=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(et||{}),de=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(de||{});function Q(){let e=cn();return i.useCallback(t=>un({mergeRefs:e,...t}),[e])}function un({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:l,visible:s=!0,name:u,mergeRefs:d}){d=d??dn;let a=Rt(t,e);if(s)return tt(a,r,n,u,d);let f=l??0;if(f&2){let{static:c=!1,...b}=a;if(c)return tt(b,r,n,u,d)}if(f&1){let{unmount:c=!0,...b}=a;return ce(c?0:1,{0(){return null},1(){return tt({...b,hidden:!0,style:{display:"none"}},r,n,u,d)}})}return tt(a,r,n,u,d)}function tt(e,t={},r,n,l){let{as:s=r,children:u,refName:d="ref",...a}=xt(e,["unmount","static"]),f=e.ref!==void 0?{[d]:e.ref}:{},c=typeof u=="function"?u(t):u;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let b={};if(t){let x=!1,y=[];for(let[w,g]of Object.entries(t))typeof g=="boolean"&&(x=!0),g===!0&&y.push(w.replace(/([A-Z])/g,p=>`-${p.toLowerCase()}`));if(x){b["data-headlessui-state"]=y.join(" ");for(let w of y)b[`data-${w}`]=""}}if(s===i.Fragment&&(Object.keys(he(a)).length>0||Object.keys(he(b)).length>0))if(!i.isValidElement(c)||Array.isArray(c)&&c.length>1){if(Object.keys(he(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(he(a)).concat(Object.keys(he(b))).map(x=>` - ${x}`).join(`
|
|
31
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(x=>` - ${x}`).join(`
|
|
36
32
|
`)].join(`
|
|
37
|
-
`))}else{let v=s.props,E=v==null?void 0:v.className,p=typeof E=="function"?(...h)=>Dt(E(...h),i.className):Dt(E,i.className),m=p?{className:p}:{},y=to(s.props,_e(kt(i,["ref"])));for(let h in b)h in y&&delete b[h];return f.cloneElement(s,Object.assign({},y,b,d,{ref:o(s.ref,d.ref)},m))}return f.createElement(a,Object.assign({},kt(i,["ref"]),a!==f.Fragment&&d,a!==f.Fragment&&b),s)}function Kl(){let r=f.useRef([]),e=f.useCallback(t=>{for(let n of r.current)n!=null&&(typeof n=="function"?n(t):n.current=t)},[]);return(...t)=>{if(!t.every(n=>n==null))return r.current=t,e}}function Xl(...r){return r.every(e=>e==null)?void 0:e=>{for(let t of r)t!=null&&(typeof t=="function"?t(e):t.current=e)}}function to(...r){if(r.length===0)return{};if(r.length===1)return r[0];let e={},t={};for(let n of r)for(let o in n)o.startsWith("on")&&typeof n[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(n[o])):e[o]=n[o];if(e.disabled||e["aria-disabled"])for(let n in t)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(t[n]=[o=>{var a;return(a=o==null?void 0:o.preventDefault)==null?void 0:a.call(o)}]);for(let n in t)Object.assign(e,{[n](o,...a){let l=t[n];for(let u of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...a)}}});return e}function te(r){var e;return Object.assign(f.forwardRef(r),{displayName:(e=r.displayName)!=null?e:r.name})}function _e(r){let e=Object.assign({},r);for(let t in e)e[t]===void 0&&delete e[t];return e}function kt(r,e=[]){let t=Object.assign({},r);for(let n of e)n in t&&delete t[n];return t}let Jl="span";var Rr=(r=>(r[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r))(Rr||{});function Ql(r,e){var t;let{features:n=1,...o}=r,a={ref:e,"aria-hidden":(n&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ae()({ourProps:a,theirProps:o,slot:{},defaultTag:Jl,name:"Hidden"})}let Nt=te(Ql),no=Symbol();function Zl(r,e=!0){return Object.assign(r,{[no]:e})}function ye(...r){let e=f.useRef(r);f.useEffect(()=>{e.current=r},[r]);let t=B(n=>{for(let o of e.current)o!=null&&(typeof o=="function"?o(n):o.current=n)});return r.every(n=>n==null||(n==null?void 0:n[no]))?void 0:t}let jt=f.createContext(null);jt.displayName="DescriptionContext";function oo(){let r=f.useContext(jt);if(r===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,oo),e}return r}function eu(){let[r,e]=f.useState([]);return[r.length>0?r.join(" "):void 0,f.useMemo(()=>function(t){let n=B(a=>(e(l=>[...l,a]),()=>e(l=>{let u=l.slice(),i=u.indexOf(a);return i!==-1&&u.splice(i,1),u}))),o=f.useMemo(()=>({register:n,slot:t.slot,name:t.name,props:t.props,value:t.value}),[n,t.slot,t.name,t.props,t.value]);return f.createElement(jt.Provider,{value:o},t.children)},[e])]}let ru="p";function tu(r,e){let t=f.useId(),n=zl(),{id:o=`headlessui-description-${t}`,...a}=r,l=oo(),u=ye(e);ee(()=>l.register(o),[o,l.register]);let i=n||!1,d=f.useMemo(()=>({...l.slot,disabled:i}),[l.slot,i]),s={ref:u,...l.props,id:o};return ae()({ourProps:s,theirProps:a,slot:d,defaultTag:ru,name:l.name||"Description"})}let nu=te(tu),ou=Object.assign(nu,{});var ao=(r=>(r.Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r))(ao||{});let au=f.createContext(()=>{});function iu({value:r,children:e}){return f.createElement(au.Provider,{value:r},e)}let lu=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}};function io(r,e){let t=r(),n=new Set;return{getSnapshot(){return t},subscribe(o){return n.add(o),()=>n.delete(o)},dispatch(o,...a){let l=e[o].call(t,...a);l&&(t=l,n.forEach(u=>u()))}}}function lo(r){return f.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot)}let uu=new lu(()=>io(()=>[],{ADD(r){return this.includes(r)?this:[...this,r]},REMOVE(r){let e=this.indexOf(r);if(e===-1)return this;let t=this.slice();return t.splice(e,1),t}}));function Qe(r,e){let t=uu.get(e),n=f.useId(),o=lo(t);if(ee(()=>{if(r)return t.dispatch("ADD",n),()=>t.dispatch("REMOVE",n)},[t,r]),!r)return!1;let a=o.indexOf(n),l=o.length;return a===-1&&(a=l,l+=1),a===l-1}let Lt=new Map,vr=new Map;function uo(r){var e;let t=(e=vr.get(r))!=null?e:0;return vr.set(r,t+1),t!==0?()=>so(r):(Lt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0,()=>so(r))}function so(r){var e;let t=(e=vr.get(r))!=null?e:1;if(t===1?vr.delete(r):vr.set(r,t-1),t!==1)return;let n=Lt.get(r);n&&(n["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,Lt.delete(r))}function su(r,{allowed:e,disallowed:t}={}){let n=Qe(r,"inert-others");ee(()=>{var o,a;if(!n)return;let l=Oe();for(let i of(o=t==null?void 0:t())!=null?o:[])i&&l.add(uo(i));let u=(a=e==null?void 0:e())!=null?a:[];for(let i of u){if(!i)continue;let d=Lr(i);if(!d)continue;let s=i.parentElement;for(;s&&s!==d.body;){for(let b of s.children)u.some(v=>b.contains(v))||l.add(uo(b));s=s.parentElement}}return l.dispose},[n,e,t])}function cu(r,e,t){let n=Ie(o=>{let a=o.getBoundingClientRect();a.x===0&&a.y===0&&a.width===0&&a.height===0&&t()});f.useEffect(()=>{if(!r)return;let o=e===null?null:e instanceof HTMLElement?e:e.current;if(!o)return;let a=Oe();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>n.current(o));l.observe(o),a.add(()=>l.disconnect())}return()=>a.dispose()},[e,n,r])}let Hr=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(r=>`${r}:not([tabindex='-1'])`).join(","),fu=["[data-autofocus]"].map(r=>`${r}:not([tabindex='-1'])`).join(",");var he=(r=>(r[r.First=1]="First",r[r.Previous=2]="Previous",r[r.Next=4]="Next",r[r.Last=8]="Last",r[r.WrapAround=16]="WrapAround",r[r.NoScroll=32]="NoScroll",r[r.AutoFocus=64]="AutoFocus",r))(he||{}),Wt=(r=>(r[r.Error=0]="Error",r[r.Overflow=1]="Overflow",r[r.Success=2]="Success",r[r.Underflow=3]="Underflow",r))(Wt||{}),du=(r=>(r[r.Previous=-1]="Previous",r[r.Next=1]="Next",r))(du||{});function pu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(Hr)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}function yu(r=document.body){return r==null?[]:Array.from(r.querySelectorAll(fu)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var co=(r=>(r[r.Strict=0]="Strict",r[r.Loose=1]="Loose",r))(co||{});function mu(r,e=0){var t;return r===((t=Lr(r))==null?void 0:t.body)?!1:Pe(e,{0(){return r.matches(Hr)},1(){let n=r;for(;n!==null;){if(n.matches(Hr))return!0;n=n.parentElement}return!1}})}var vu=(r=>(r[r.Keyboard=0]="Keyboard",r[r.Mouse=1]="Mouse",r))(vu||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",r=>{r.metaKey||r.altKey||r.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",r=>{r.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:r.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ge(r){r==null||r.focus({preventScroll:!0})}let hu=["textarea","input"].join(",");function gu(r){var e,t;return(t=(e=r==null?void 0:r.matches)==null?void 0:e.call(r,hu))!=null?t:!1}function bu(r,e=t=>t){return r.slice().sort((t,n)=>{let o=e(t),a=e(n);if(o===null||a===null)return 0;let l=o.compareDocumentPosition(a);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(r,e,{sorted:t=!0,relativeTo:n=null,skipElements:o=[]}={}){let a=Array.isArray(r)?r.length>0?r[0].ownerDocument:document:r.ownerDocument,l=Array.isArray(r)?t?bu(r):r:e&64?yu(r):pu(r);o.length>0&&l.length>1&&(l=l.filter(E=>!o.some(p=>p!=null&&"current"in p?(p==null?void 0:p.current)===E:p===E))),n=n??a.activeElement;let u=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,l.indexOf(n))-1;if(e&4)return Math.max(0,l.indexOf(n))+1;if(e&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=e&32?{preventScroll:!0}:{},s=0,b=l.length,v;do{if(s>=b||s+b<=0)return 0;let E=i+s;if(e&16)E=(E+b)%b;else{if(E<0)return 3;if(E>=b)return 1}v=l[E],v==null||v.focus(d),s+=u}while(v!==a.activeElement);return e&6&&gu(v)&&v.select(),2}function fo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function wu(){return/Android/gi.test(window.navigator.userAgent)}function Eu(){return fo()||wu()}function gr(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return document.addEventListener(e,a,n),()=>document.removeEventListener(e,a,n)},[r,e,n])}function po(r,e,t,n){let o=Ie(t);f.useEffect(()=>{if(!r)return;function a(l){o.current(l)}return window.addEventListener(e,a,n),()=>window.removeEventListener(e,a,n)},[r,e,n])}const yo=30;function Su(r,e,t){let n=Qe(r,"outside-click"),o=Ie(t),a=f.useCallback(function(i,d){if(i.defaultPrevented)return;let s=d(i);if(s===null||!s.getRootNode().contains(s)||!s.isConnected)return;let b=function v(E){return typeof E=="function"?v(E()):Array.isArray(E)||E instanceof Set?E:[E]}(e);for(let v of b)if(v!==null&&(v.contains(s)||i.composed&&i.composedPath().includes(v)))return;return!mu(s,co.Loose)&&s.tabIndex!==-1&&i.preventDefault(),o.current(i,s)},[o,e]),l=f.useRef(null);gr(n,"pointerdown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"mousedown",i=>{var d,s;l.current=((s=(d=i.composedPath)==null?void 0:d.call(i))==null?void 0:s[0])||i.target},!0),gr(n,"click",i=>{Eu()||l.current&&(a(i,()=>l.current),l.current=null)},!0);let u=f.useRef({x:0,y:0});gr(n,"touchstart",i=>{u.current.x=i.touches[0].clientX,u.current.y=i.touches[0].clientY},!0),gr(n,"touchend",i=>{let d={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(d.x-u.current.x)>=yo||Math.abs(d.y-u.current.y)>=yo))return a(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),po(n,"blur",i=>a(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function br(...r){return f.useMemo(()=>Lr(...r),[...r])}function mo(r,e,t,n){let o=Ie(t);f.useEffect(()=>{r=r??window;function a(l){o.current(l)}return r.addEventListener(e,a,n),()=>r.removeEventListener(e,a,n)},[r,e,n])}function xu(){let r;return{before({doc:e}){var t;let n=e.documentElement,o=(t=e.defaultView)!=null?t:window;r=Math.max(0,o.innerWidth-n.clientWidth)},after({doc:e,d:t}){let n=e.documentElement,o=Math.max(0,n.clientWidth-n.offsetWidth),a=Math.max(0,r-o);t.style(n,"paddingRight",`${a}px`)}}}function Ou(){return fo()?{before({doc:r,d:e,meta:t}){function n(o){return t.containers.flatMap(a=>a()).some(a=>a.contains(o))}e.microTask(()=>{var o;if(window.getComputedStyle(r.documentElement).scrollBehavior!=="auto"){let u=Oe();u.style(r.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>u.dispose()))}let a=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;e.addEventListener(r,"click",u=>{if(u.target instanceof HTMLElement)try{let i=u.target.closest("a");if(!i)return;let{hash:d}=new URL(i.href),s=r.querySelector(d);s&&!n(s)&&(l=s)}catch{}},!0),e.addEventListener(r,"touchstart",u=>{if(u.target instanceof HTMLElement)if(n(u.target)){let i=u.target;for(;i.parentElement&&n(i.parentElement);)i=i.parentElement;e.style(i,"overscrollBehavior","contain")}else e.style(u.target,"touchAction","none")}),e.addEventListener(r,"touchmove",u=>{if(u.target instanceof HTMLElement){if(u.target.tagName==="INPUT")return;if(n(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),e.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;a!==i&&window.scrollTo(0,a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Pu(){return{before({doc:r,d:e}){e.style(r.documentElement,"overflow","hidden")}}}function Au(r){let e={};for(let t of r)Object.assign(e,t(e));return e}let De=io(()=>new Map,{PUSH(r,e){var t;let n=(t=this.get(r))!=null?t:{doc:r,count:0,d:Oe(),meta:new Set};return n.count++,n.meta.add(e),this.set(r,n),this},POP(r,e){let t=this.get(r);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:r,d:e,meta:t}){let n={doc:r,d:e,meta:Au(t)},o=[Ou(),xu(),Pu()];o.forEach(({before:a})=>a==null?void 0:a(n)),o.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:r}){r.dispose()},TEARDOWN({doc:r}){this.delete(r)}});De.subscribe(()=>{let r=De.getSnapshot(),e=new Map;for(let[t]of r)e.set(t,t.documentElement.style.overflow);for(let t of r.values()){let n=e.get(t.doc)==="hidden",o=t.count!==0;(o&&!n||!o&&n)&&De.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&De.dispatch("TEARDOWN",t)}});function Tu(r,e,t=()=>({containers:[]})){let n=lo(De),o=e?n.get(e):void 0,a=o?o.count>0:!1;return ee(()=>{if(!(!e||!r))return De.dispatch("PUSH",e,t),()=>De.dispatch("POP",e,t)},[r,e]),a}function $u(r,e,t=()=>[document.body]){let n=Qe(r,"scroll-lock");Tu(n,e,o=>{var a;return{containers:[...(a=o.containers)!=null?a:[],t]}})}function Cu(r=0){let[e,t]=f.useState(r),n=f.useCallback(i=>t(i),[e]),o=f.useCallback(i=>t(d=>d|i),[e]),a=f.useCallback(i=>(e&i)===i,[e]),l=f.useCallback(i=>t(d=>d&~i),[t]),u=f.useCallback(i=>t(d=>d^i),[t]);return{flags:e,setFlag:n,addFlag:o,hasFlag:a,removeFlag:l,toggleFlag:u}}var vo,ho;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((vo=process==null?void 0:process.env)==null?void 0:vo.NODE_ENV)==="test"&&typeof((ho=Element==null?void 0:Element.prototype)==null?void 0:ho.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
38
|
-
`)),[]});var Fu=(r=>(r[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r))(Fu||{});function Mu(r){let e={};for(let t in r)r[t]===!0&&(e[`data-${t}`]="");return e}function Iu(r,e,t,n){let[o,a]=f.useState(t),{hasFlag:l,addFlag:u,removeFlag:i}=Cu(r&&o?3:0),d=f.useRef(!1),s=f.useRef(!1),b=_t();return ee(()=>{var v;if(r){if(t&&a(!0),!e){t&&u(3);return}return(v=n==null?void 0:n.start)==null||v.call(n,t),_u(e,{inFlight:d,prepare(){s.current?s.current=!1:s.current=d.current,d.current=!0,!s.current&&(t?(u(3),i(4)):(u(4),i(2)))},run(){s.current?t?(i(3),u(4)):(i(4),u(3)):t?i(1):u(1)},done(){var E;s.current&&typeof e.getAnimations=="function"&&e.getAnimations().length>0||(d.current=!1,i(7),t||a(!1),(E=n==null?void 0:n.end)==null||E.call(n,t))}})}},[r,t,e,b]),r?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[t,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function _u(r,{prepare:e,run:t,done:n,inFlight:o}){let a=Oe();return ku(r,{prepare:e,inFlight:o}),a.nextFrame(()=>{t(),a.requestAnimationFrame(()=>{a.add(Du(r,n))})}),a.dispose}function Du(r,e){var t,n;let o=Oe();if(!r)return o.dispose;let a=!1;o.add(()=>{a=!0});let l=(n=(t=r.getAnimations)==null?void 0:t.call(r).filter(u=>u instanceof CSSTransition))!=null?n:[];return l.length===0?(e(),o.dispose):(Promise.allSettled(l.map(u=>u.finished)).then(()=>{a||e()}),o.dispose)}function ku(r,{inFlight:e,prepare:t}){if(e!=null&&e.current){t();return}let n=r.style.transition;r.style.transition="none",t(),r.offsetHeight,r.style.transition=n}function Ut(r,e){let t=f.useRef([]),n=B(r);f.useEffect(()=>{let o=[...t.current];for(let[a,l]of e.entries())if(t.current[a]!==l){let u=n(e,o);return t.current=e,u}},[n,...e])}let Vr=f.createContext(null);Vr.displayName="OpenClosedContext";var ue=(r=>(r[r.Open=1]="Open",r[r.Closed=2]="Closed",r[r.Closing=4]="Closing",r[r.Opening=8]="Opening",r))(ue||{});function qr(){return f.useContext(Vr)}function Nu({value:r,children:e}){return f.createElement(Vr.Provider,{value:r},e)}function ju({children:r}){return f.createElement(Vr.Provider,{value:null},r)}function Lu(r){function e(){document.readyState!=="loading"&&(r(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let Te=[];Lu(()=>{function r(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||Te[0]===e.target)return;let t=e.target;t=t.closest(Hr),Te.unshift(t??e.target),Te=Te.filter(n=>n!=null&&n.isConnected),Te.splice(10)}window.addEventListener("click",r,{capture:!0}),window.addEventListener("mousedown",r,{capture:!0}),window.addEventListener("focus",r,{capture:!0}),document.body.addEventListener("click",r,{capture:!0}),document.body.addEventListener("mousedown",r,{capture:!0}),document.body.addEventListener("focus",r,{capture:!0})});function go(r){let e=B(r),t=f.useRef(!1);f.useEffect(()=>(t.current=!1,()=>{t.current=!0,Wr(()=>{t.current&&e()})}),[e])}function Wu(){let r=typeof document>"u";return"useSyncExternalStore"in tr?(e=>e.useSyncExternalStore)(tr)(()=>()=>{},()=>!1,()=>!r):!1}function wr(){let r=Wu(),[e,t]=tr.useState(Me.isHandoffComplete);return e&&Me.isHandoffComplete===!1&&t(!1),tr.useEffect(()=>{e!==!0&&t(!0)},[e]),tr.useEffect(()=>Me.handoff(),[]),r?!1:e}let bo=f.createContext(!1);function Uu(){return f.useContext(bo)}function wo(r){return f.createElement(bo.Provider,{value:r.force},r.children)}function Bu(r){let e=Uu(),t=f.useContext(So),n=br(r),[o,a]=f.useState(()=>{var l;if(!e&&t!==null)return(l=t.current)!=null?l:null;if(Me.isServer)return null;let u=n==null?void 0:n.getElementById("headlessui-portal-root");if(u)return u;if(n===null)return null;let i=n.createElement("div");return i.setAttribute("id","headlessui-portal-root"),n.body.appendChild(i)});return f.useEffect(()=>{o!==null&&(n!=null&&n.body.contains(o)||n==null||n.body.appendChild(o))},[o,n]),f.useEffect(()=>{e||t!==null&&a(t.current)},[t,a,e]),o}let Eo=f.Fragment,Ru=te(function(r,e){let t=r,n=f.useRef(null),o=ye(Zl(b=>{n.current=b}),e),a=br(n),l=Bu(n),[u]=f.useState(()=>{var b;return Me.isServer?null:(b=a==null?void 0:a.createElement("div"))!=null?b:null}),i=f.useContext(Bt),d=wr();ee(()=>{!l||!u||l.contains(u)||(u.setAttribute("data-headlessui-portal",""),l.appendChild(u))},[l,u]),ee(()=>{if(u&&i)return i.register(u)},[i,u]),go(()=>{var b;!l||!u||(u instanceof Node&&l.contains(u)&&l.removeChild(u),l.childNodes.length<=0&&((b=l.parentElement)==null||b.removeChild(l)))});let s=ae();return d?!l||!u?null:Qo.createPortal(s({ourProps:{ref:o},theirProps:t,slot:{},defaultTag:Eo,name:"Portal"}),u):null});function Hu(r,e){let t=ye(e),{enabled:n=!0,...o}=r,a=ae();return n?f.createElement(Ru,{...o,ref:t}):a({ourProps:{ref:t},theirProps:o,slot:{},defaultTag:Eo,name:"Portal"})}let Vu=f.Fragment,So=f.createContext(null);function qu(r,e){let{target:t,...n}=r,o={ref:ye(e)},a=ae();return f.createElement(So.Provider,{value:t},a({ourProps:o,theirProps:n,defaultTag:Vu,name:"Popover.Group"}))}let Bt=f.createContext(null);function Gu(){let r=f.useContext(Bt),e=f.useRef([]),t=B(a=>(e.current.push(a),r&&r.register(a),()=>n(a))),n=B(a=>{let l=e.current.indexOf(a);l!==-1&&e.current.splice(l,1),r&&r.unregister(a)}),o=f.useMemo(()=>({register:t,unregister:n,portals:e}),[t,n,e]);return[e,f.useMemo(()=>function({children:a}){return f.createElement(Bt.Provider,{value:o},a)},[o])]}let zu=te(Hu),xo=te(qu),Yu=Object.assign(zu,{Group:xo});function Ku(r,e=typeof document<"u"?document.defaultView:null,t){let n=Qe(r,"escape");mo(e,"keydown",o=>{n&&(o.defaultPrevented||o.key===ao.Escape&&t(o))})}function Xu(){var r;let[e]=f.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[t,n]=f.useState((r=e==null?void 0:e.matches)!=null?r:!1);return ee(()=>{if(!e)return;function o(a){n(a.matches)}return e.addEventListener("change",o),()=>e.removeEventListener("change",o)},[e]),t}function Ju({defaultContainers:r=[],portals:e,mainTreeNode:t}={}){let n=br(t),o=B(()=>{var a,l;let u=[];for(let i of r)i!==null&&(i instanceof HTMLElement?u.push(i):"current"in i&&i.current instanceof HTMLElement&&u.push(i.current));if(e!=null&&e.current)for(let i of e.current)u.push(i);for(let i of(a=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?a:[])i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i.id!=="headlessui-portal-root"&&(t&&(i.contains(t)||i.contains((l=t==null?void 0:t.getRootNode())==null?void 0:l.host))||u.some(d=>i.contains(d))||u.push(i));return u});return{resolveContainers:o,contains:B(a=>o().some(l=>l.contains(a)))}}let Oo=f.createContext(null);function Po({children:r,node:e}){let[t,n]=f.useState(null),o=Ao(e??t);return f.createElement(Oo.Provider,{value:o},r,o===null&&f.createElement(Nt,{features:Rr.Hidden,ref:a=>{var l,u;if(a){for(let i of(u=(l=Lr(a))==null?void 0:l.querySelectorAll("html > *, body > *"))!=null?u:[])if(i!==document.body&&i!==document.head&&i instanceof HTMLElement&&i!=null&&i.contains(a)){n(i);break}}}}))}function Ao(r=null){var e;return(e=f.useContext(Oo))!=null?e:r}function Rt(){let r=f.useRef(!1);return ee(()=>(r.current=!0,()=>{r.current=!1}),[]),r}var Er=(r=>(r[r.Forwards=0]="Forwards",r[r.Backwards=1]="Backwards",r))(Er||{});function Qu(){let r=f.useRef(0);return po(!0,"keydown",e=>{e.key==="Tab"&&(r.current=e.shiftKey?1:0)},!0),r}function To(r){if(!r)return new Set;if(typeof r=="function")return new Set(r());let e=new Set;for(let t of r.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let Zu="div";var ke=(r=>(r[r.None=0]="None",r[r.InitialFocus=1]="InitialFocus",r[r.TabLock=2]="TabLock",r[r.FocusLock=4]="FocusLock",r[r.RestoreFocus=8]="RestoreFocus",r[r.AutoFocus=16]="AutoFocus",r))(ke||{});function es(r,e){let t=f.useRef(null),n=ye(t,e),{initialFocus:o,initialFocusFallback:a,containers:l,features:u=15,...i}=r;wr()||(u=0);let d=br(t);os(u,{ownerDocument:d});let s=as(u,{ownerDocument:d,container:t,initialFocus:o,initialFocusFallback:a});is(u,{ownerDocument:d,container:t,containers:l,previousActiveElement:s});let b=Qu(),v=B(g=>{let w=t.current;w&&(x=>x())(()=>{Pe(b.current,{[Er.Forwards]:()=>{hr(w,he.First,{skipElements:[g.relatedTarget,a]})},[Er.Backwards]:()=>{hr(w,he.Last,{skipElements:[g.relatedTarget,a]})}})})}),E=Qe(!!(u&2),"focus-trap#tab-lock"),p=_t(),m=f.useRef(!1),y={ref:n,onKeyDown(g){g.key=="Tab"&&(m.current=!0,p.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){if(!(u&4))return;let w=To(l);t.current instanceof HTMLElement&&w.add(t.current);let x=g.relatedTarget;x instanceof HTMLElement&&x.dataset.headlessuiFocusGuard!=="true"&&($o(w,x)||(m.current?hr(t.current,Pe(b.current,{[Er.Forwards]:()=>he.Next,[Er.Backwards]:()=>he.Previous})|he.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&ge(g.target)))}},h=ae();return f.createElement(f.Fragment,null,E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}),h({ourProps:y,theirProps:i,defaultTag:Zu,name:"FocusTrap"}),E&&f.createElement(Nt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:Rr.Focusable}))}let rs=te(es),ts=Object.assign(rs,{features:ke});function ns(r=!0){let e=f.useRef(Te.slice());return Ut(([t],[n])=>{n===!0&&t===!1&&Wr(()=>{e.current.splice(0)}),n===!1&&t===!0&&(e.current=Te.slice())},[r,Te,e]),B(()=>{var t;return(t=e.current.find(n=>n!=null&&n.isConnected))!=null?t:null})}function os(r,{ownerDocument:e}){let t=!!(r&8),n=ns(t);Ut(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&ge(n())},[t]),go(()=>{t&&ge(n())})}function as(r,{ownerDocument:e,container:t,initialFocus:n,initialFocusFallback:o}){let a=f.useRef(null),l=Qe(!!(r&1),"focus-trap#initial-focus"),u=Rt();return Ut(()=>{if(r===0)return;if(!l){o!=null&&o.current&&ge(o.current);return}let i=t.current;i&&Wr(()=>{if(!u.current)return;let d=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===d){a.current=d;return}}else if(i.contains(d)){a.current=d;return}if(n!=null&&n.current)ge(n.current);else{if(r&16){if(hr(i,he.First|he.AutoFocus)!==Wt.Error)return}else if(hr(i,he.First)!==Wt.Error)return;if(o!=null&&o.current&&(ge(o.current),(e==null?void 0:e.activeElement)===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}a.current=e==null?void 0:e.activeElement})},[o,l,r]),a}function is(r,{ownerDocument:e,container:t,containers:n,previousActiveElement:o}){let a=Rt(),l=!!(r&4);mo(e==null?void 0:e.defaultView,"focus",u=>{if(!l||!a.current)return;let i=To(n);t.current instanceof HTMLElement&&i.add(t.current);let d=o.current;if(!d)return;let s=u.target;s&&s instanceof HTMLElement?$o(i,s)?(o.current=s,ge(s)):(u.preventDefault(),u.stopPropagation(),ge(d)):ge(o.current)},!0)}function $o(r,e){for(let t of r)if(t.contains(e))return!0;return!1}function Co(r){var e;return!!(r.enter||r.enterFrom||r.enterTo||r.leave||r.leaveFrom||r.leaveTo)||((e=r.as)!=null?e:Mo)!==f.Fragment||f.Children.count(r.children)===1}let Gr=f.createContext(null);Gr.displayName="TransitionContext";var ls=(r=>(r.Visible="visible",r.Hidden="hidden",r))(ls||{});function us(){let r=f.useContext(Gr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}function ss(){let r=f.useContext(zr);if(r===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return r}let zr=f.createContext(null);zr.displayName="NestingContext";function Yr(r){return"children"in r?Yr(r.children):r.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Fo(r,e){let t=Ie(r),n=f.useRef([]),o=Rt(),a=_t(),l=B((E,p=Ae.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===E);m!==-1&&(Pe(p,{[Ae.Unmount](){n.current.splice(m,1)},[Ae.Hidden](){n.current[m].state="hidden"}}),a.microTask(()=>{var y;!Yr(n)&&o.current&&((y=t.current)==null||y.call(t))}))}),u=B(E=>{let p=n.current.find(({el:m})=>m===E);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:E,state:"visible"}),()=>l(E,Ae.Unmount)}),i=f.useRef([]),d=f.useRef(Promise.resolve()),s=f.useRef({enter:[],leave:[]}),b=B((E,p,m)=>{i.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([y])=>y!==E)),e==null||e.chains.current[p].push([E,new Promise(y=>{i.current.push(y)})]),e==null||e.chains.current[p].push([E,new Promise(y=>{Promise.all(s.current[p].map(([h,g])=>g)).then(()=>y())})]),p==="enter"?d.current=d.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(p)):m(p)}),v=B((E,p,m)=>{Promise.all(s.current[p].splice(0).map(([y,h])=>h)).then(()=>{var y;(y=i.current.shift())==null||y()}).then(()=>m(p))});return f.useMemo(()=>({children:n,register:u,unregister:l,onStart:b,onStop:v,wait:d,chains:s}),[u,l,n,b,v,s,d])}let Mo=f.Fragment,Io=Ur.RenderStrategy;function cs(r,e){var t,n;let{transition:o=!0,beforeEnter:a,afterEnter:l,beforeLeave:u,afterLeave:i,enter:d,enterFrom:s,enterTo:b,entered:v,leave:E,leaveFrom:p,leaveTo:m,...y}=r,[h,g]=f.useState(null),w=f.useRef(null),x=Co(r),P=ye(...x?[w,e,g]:e===null?[]:[e]),D=(t=y.unmount)==null||t?Ae.Unmount:Ae.Hidden,{show:_,appear:U,initial:H}=us(),[j,z]=f.useState(_?"visible":"hidden"),V=ss(),{register:C,unregister:T}=V;ee(()=>C(w),[C,w]),ee(()=>{if(D===Ae.Hidden&&w.current){if(_&&j!=="visible"){z("visible");return}return Pe(j,{hidden:()=>T(w),visible:()=>C(w)})}},[j,w,C,T,_,D]);let k=wr();ee(()=>{if(x&&k&&j==="visible"&&w.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[w,j,k,x]);let oe=H&&!U,se=U&&_&&H,me=f.useRef(!1),Z=Fo(()=>{me.current||(z("hidden"),T(w))},V),ce=B(Le=>{me.current=!0;let be=Le?"enter":"leave";Z.onStart(w,be,we=>{we==="enter"?a==null||a():we==="leave"&&(u==null||u())})}),q=B(Le=>{let be=Le?"enter":"leave";me.current=!1,Z.onStop(w,be,we=>{we==="enter"?l==null||l():we==="leave"&&(i==null||i())}),be==="leave"&&!Yr(Z)&&(z("hidden"),T(w))});f.useEffect(()=>{x&&o||(ce(_),q(_))},[_,x,o]);let Ne=!(!o||!x||!k||oe),[,J]=Iu(Ne,h,_,{start:ce,end:q}),Gt=_e({ref:P,className:((n=Dt(y.className,se&&d,se&&s,J.enter&&d,J.enter&&J.closed&&s,J.enter&&!J.closed&&b,J.leave&&E,J.leave&&!J.closed&&p,J.leave&&J.closed&&m,!J.transition&&_&&v))==null?void 0:n.trim())||void 0,...Mu(J)}),je=0;j==="visible"&&(je|=ue.Open),j==="hidden"&&(je|=ue.Closed),J.enter&&(je|=ue.Opening),J.leave&&(je|=ue.Closing);let Sr=ae();return f.createElement(zr.Provider,{value:Z},f.createElement(Nu,{value:je},Sr({ourProps:Gt,theirProps:y,defaultTag:Mo,features:Io,visible:j==="visible",name:"Transition.Child"})))}function fs(r,e){let{show:t,appear:n=!1,unmount:o=!0,...a}=r,l=f.useRef(null),u=Co(r),i=ye(...u?[l,e]:e===null?[]:[e]);wr();let d=qr();if(t===void 0&&d!==null&&(t=(d&ue.Open)===ue.Open),t===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[s,b]=f.useState(t?"visible":"hidden"),v=Fo(()=>{t||b("hidden")}),[E,p]=f.useState(!0),m=f.useRef([t]);ee(()=>{E!==!1&&m.current[m.current.length-1]!==t&&(m.current.push(t),p(!1))},[m,t]);let y=f.useMemo(()=>({show:t,appear:n,initial:E}),[t,n,E]);ee(()=>{t?b("visible"):!Yr(v)&&l.current!==null&&b("hidden")},[t,v]);let h={unmount:o},g=B(()=>{var P;E&&p(!1),(P=r.beforeEnter)==null||P.call(r)}),w=B(()=>{var P;E&&p(!1),(P=r.beforeLeave)==null||P.call(r)}),x=ae();return f.createElement(zr.Provider,{value:v},f.createElement(Gr.Provider,{value:y},x({ourProps:{...h,as:f.Fragment,children:f.createElement(_o,{ref:i,...h,...a,beforeEnter:g,beforeLeave:w})},theirProps:{},defaultTag:f.Fragment,features:Io,visible:s==="visible",name:"Transition"})))}function ds(r,e){let t=f.useContext(Gr)!==null,n=qr()!==null;return f.createElement(f.Fragment,null,!t&&n?f.createElement(Ht,{ref:e,...r}):f.createElement(_o,{ref:e,...r}))}let Ht=te(fs),_o=te(cs),Ze=te(ds),Do=Object.assign(Ht,{Child:Ze,Root:Ht});var ps=(r=>(r[r.Open=0]="Open",r[r.Closed=1]="Closed",r))(ps||{}),ys=(r=>(r[r.SetTitleId=0]="SetTitleId",r))(ys||{});let ms={0(r,e){return r.titleId===e.id?r:{...r,titleId:e.id}}},Vt=f.createContext(null);Vt.displayName="DialogContext";function Kr(r){let e=f.useContext(Vt);if(e===null){let t=new Error(`<${r} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Kr),t}return e}function vs(r,e){return Pe(e.type,ms,r,e)}let ko=te(function(r,e){let t=f.useId(),{id:n=`headlessui-dialog-${t}`,open:o,onClose:a,initialFocus:l,role:u="dialog",autoFocus:i=!0,__demoMode:d=!1,unmount:s=!1,...b}=r,v=f.useRef(!1);u=function(){return u==="dialog"||u==="alertdialog"?u:(v.current||(v.current=!0,console.warn(`Invalid role [${u}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let E=qr();o===void 0&&E!==null&&(o=(E&ue.Open)===ue.Open);let p=f.useRef(null),m=ye(p,e),y=br(p),h=o?0:1,[g,w]=f.useReducer(vs,{titleId:null,descriptionId:null,panelRef:f.createRef()}),x=B(()=>a(!1)),P=B(q=>w({type:0,id:q})),D=wr()?h===0:!1,[_,U]=Gu(),H={get current(){var q;return(q=g.panelRef.current)!=null?q:p.current}},j=Ao(),{resolveContainers:z}=Ju({mainTreeNode:j,portals:_,defaultContainers:[H]}),V=E!==null?(E&ue.Closing)===ue.Closing:!1;su(d||V?!1:D,{allowed:B(()=>{var q,Ne;return[(Ne=(q=p.current)==null?void 0:q.closest("[data-headlessui-portal]"))!=null?Ne:null]}),disallowed:B(()=>{var q;return[(q=j==null?void 0:j.closest("body > *:not(#headlessui-portal-root)"))!=null?q:null]})}),Su(D,z,q=>{q.preventDefault(),x()}),Ku(D,y==null?void 0:y.defaultView,q=>{q.preventDefault(),q.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),x()}),$u(d||V?!1:D,y,z),cu(D,p,x);let[C,T]=eu(),k=f.useMemo(()=>[{dialogState:h,close:x,setTitleId:P,unmount:s},g],[h,g,x,P,s]),oe=f.useMemo(()=>({open:h===0}),[h]),se={ref:m,id:n,role:u,tabIndex:-1,"aria-modal":d?void 0:h===0?!0:void 0,"aria-labelledby":g.titleId,"aria-describedby":C,unmount:s},me=!Xu(),Z=ke.None;D&&!d&&(Z|=ke.RestoreFocus,Z|=ke.TabLock,i&&(Z|=ke.AutoFocus),me&&(Z|=ke.InitialFocus));let ce=ae();return f.createElement(ju,null,f.createElement(wo,{force:!0},f.createElement(Yu,null,f.createElement(Vt.Provider,{value:k},f.createElement(xo,{target:p},f.createElement(wo,{force:!1},f.createElement(T,{slot:oe},f.createElement(U,null,f.createElement(ts,{initialFocus:l,initialFocusFallback:p,containers:z,features:Z},f.createElement(iu,{value:x},ce({ourProps:se,theirProps:b,slot:oe,defaultTag:hs,features:gs,visible:h===0,name:"Dialog"})))))))))))}),hs="div",gs=Ur.RenderStrategy|Ur.Static;function bs(r,e){let{transition:t=!1,open:n,...o}=r,a=qr(),l=r.hasOwnProperty("open")||a!==null,u=r.hasOwnProperty("onClose");if(!l&&!u)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!l)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!u)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!a&&typeof r.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r.open}`);if(typeof r.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${r.onClose}`);return(n!==void 0||t)&&!o.static?f.createElement(Po,null,f.createElement(Do,{show:n,transition:t,unmount:o.unmount},f.createElement(ko,{ref:e,...o}))):f.createElement(Po,null,f.createElement(ko,{ref:e,open:n,...o}))}let ws="div";function Es(r,e){let t=f.useId(),{id:n=`headlessui-dialog-panel-${t}`,transition:o=!1,...a}=r,[{dialogState:l,unmount:u},i]=Kr("Dialog.Panel"),d=ye(e,i.panelRef),s=f.useMemo(()=>({open:l===0}),[l]),b=B(y=>{y.stopPropagation()}),v={ref:d,id:n,onClick:b},E=o?Ze:f.Fragment,p=o?{unmount:u}:{},m=ae();return f.createElement(E,{...p},m({ourProps:v,theirProps:a,slot:s,defaultTag:ws,name:"Dialog.Panel"}))}let Ss="div";function xs(r,e){let{transition:t=!1,...n}=r,[{dialogState:o,unmount:a}]=Kr("Dialog.Backdrop"),l=f.useMemo(()=>({open:o===0}),[o]),u={ref:e,"aria-hidden":!0},i=t?Ze:f.Fragment,d=t?{unmount:a}:{},s=ae();return f.createElement(i,{...d},s({ourProps:u,theirProps:n,slot:l,defaultTag:Ss,name:"Dialog.Backdrop"}))}let Os="h2";function Ps(r,e){let t=f.useId(),{id:n=`headlessui-dialog-title-${t}`,...o}=r,[{dialogState:a,setTitleId:l}]=Kr("Dialog.Title"),u=ye(e);f.useEffect(()=>(l(n),()=>l(null)),[n,l]);let i=f.useMemo(()=>({open:a===0}),[a]),d={ref:u,id:n};return ae()({ourProps:d,theirProps:o,slot:i,defaultTag:Os,name:"Dialog.Title"})}let As=te(bs),qt=te(Es);te(xs);let Ts=te(Ps),$s=Object.assign(As,{Panel:qt,Title:Ts,Description:ou});function No({onClick:r}){return $.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:r,children:[$.jsx("span",{className:"sr-only",children:"Close"}),$.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:$.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const Cs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:$.jsx("div",{className:jr("im-modal-positioner flex min-h-full justify-center",{"items-start":e.position==="top","items-center":e.position==="center","items-end":e.position==="bottom"}),children:$.jsx(Ze,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:r.afterLeave,className:jr("im-modal-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),Fs=({modalContext:r,config:e,children:t})=>$.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:$.jsx("div",{className:jr("im-slideover-positioner flex min-h-full items-center",{"justify-start":e.position==="left","justify-end":e.position==="right"}),children:$.jsx(Ze,{enterFrom:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${e.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:r.afterLeave,className:jr("im-slideover-wrapper w-full transition duration-300 ease-in-out",r.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":e.maxWidth==="sm","sm:max-w-md":e.maxWidth==="md","sm:max-w-md md:max-w-lg":e.maxWidth==="lg","sm:max-w-md md:max-w-xl":e.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":e.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":e.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":e.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":e.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":e.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":e.maxWidth==="7xl"}),children:$.jsxs(qt,{className:`im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`,children:[e.closeButton&&$.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:$.jsx(No,{onClick:r.close})}),typeof t=="function"?t({modalContext:r,config:e}):t]})})})}),jo=f.forwardRef(({name:r,children:e,...t},n)=>{const o=l=>typeof e=="function"?e(l):e,a=f.useRef(null);return f.useImperativeHandle(n,()=>a.current,[a]),$.jsx(Mt,{ref:a,name:r,...t,children:({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})=>$.jsx(Do,{appear:!0,show:p??!1,children:$.jsxs($s,{as:"div",className:"im-dialog relative z-20",onClose:()=>i.closeExplicitly?null:u(),"data-inertiaui-modal-id":v,"data-inertiaui-modal-index":E,children:[E===0?$.jsx(Ze,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):$.jsx("div",{})}):null,E>0&&y?$.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,i.slideover?$.jsx(Fs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})}):$.jsx(Cs,{modalContext:m,config:i,children:o({afterLeave:l,close:u,config:i,emit:d,getChildModal:s,getParentModal:b,id:v,index:E,isOpen:p,modalContext:m,onTopOfStack:y,reload:h,setOpen:g,shouldRender:w})})]})})})});jo.displayName="Modal";const Ms=({href:r,method:e="get",data:t={},as:n="a",headers:o={},queryStringArrayFormat:a="brackets",onAfterLeave:l=null,onBlur:u=null,onClose:i=null,onError:d=null,onFocus:s=null,onStart:b=null,onSuccess:v=null,navigate:E=null,children:p,...m})=>{const[y,h]=f.useState(!1),[g,w]=f.useState(null),{stack:x,visit:P}=mr(),D=f.useMemo(()=>E??Ar("navigate"),[E]),_={},U={};Object.keys(m).forEach(T=>{Qn.includes(T)||(T.startsWith("on")&&typeof m[T]=="function"?T.toLowerCase()in window?_[T]=m[T]:U[T]=m[T]:_[T]=m[T])});const[H,j]=f.useState(!1);f.useEffect(()=>{g&&(g.onTopOfStack&&H?s==null||s():!g.onTopOfStack&&!H&&(u==null||u()),j(!g.onTopOfStack))},[x]);const z=f.useCallback(()=>{i==null||i()},[i]),V=f.useCallback(()=>{w(null),l==null||l()},[l]),C=f.useCallback(T=>{T==null||T.preventDefault(),!y&&(r.startsWith("#")||(h(!0),b==null||b()),P(r,e,t,o,ua(rn(m,Qn)),()=>z(x.length),V,a,D).then(k=>{w(k),k.registerEventListenersFromProps(U),v==null||v()}).catch(k=>{console.error(k),d==null||d(k)}).finally(()=>h(!1)))},[r,e,t,o,a,m,z,V]);return $.jsx(n,{..._,href:r,onClick:C,children:typeof p=="function"?p({loading:y}):p})};function Is(){return mr().stack[Ft()]??null}L.HeadlessModal=Mt,L.Modal=jo,L.ModalLink=Ms,L.ModalRoot=Zn,L.ModalStackProvider=Jn,L.getConfig=Ar,L.putConfig=ta,L.renderApp=Rl,L.resetConfig=ra,L.useModal=Is,L.useModalIndex=Ft,L.useModalStack=mr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
|
33
|
+
`))}else{let x=c.props,y=x==null?void 0:x.className,w=typeof y=="function"?(...m)=>Et(y(...m),a.className):Et(y,a.className),g=w?{className:w}:{},p=Rt(c.props,he(xt(a,["ref"])));for(let m in b)m in p&&delete b[m];return i.cloneElement(c,Object.assign({},p,b,f,{ref:l(fn(c),f.ref)},g))}return i.createElement(s,Object.assign({},xt(a,["ref"]),s!==i.Fragment&&f,s!==i.Fragment&&b),c)}function cn(){let e=i.useRef([]),t=i.useCallback(r=>{for(let n of e.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return e.current=r,t}}function dn(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Rt(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let l in n)l.startsWith("on")&&typeof n[l]=="function"?(r[l]!=null||(r[l]=[]),r[l].push(n[l])):t[l]=n[l];if(t.disabled||t["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[l=>{var s;return(s=l==null?void 0:l.preventDefault)==null?void 0:s.call(l)}]);for(let n in r)Object.assign(t,{[n](l,...s){let u=r[n];for(let d of u){if((l instanceof Event||(l==null?void 0:l.nativeEvent)instanceof Event)&&l.defaultPrevented)return;d(l,...s)}}});return t}function z(e){var t;return Object.assign(i.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function he(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function xt(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function fn(e){return i.version.split(".")[0]>="19"?e.props.ref:e.ref}let pn="span";var rt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rt||{});function mn(e,t){var r;let{features:n=1,...l}=e,s={ref:t,"aria-hidden":(n&2)===2?!0:(r=l["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Q()({ourProps:s,theirProps:l,slot:{},defaultTag:pn,name:"Hidden"})}let Tt=z(mn),Jt=Symbol();function vn(e,t=!0){return Object.assign(e,{[Jt]:t})}function ne(...e){let t=i.useRef(e);i.useEffect(()=>{t.current=e},[e]);let r=A(n=>{for(let l of t.current)l!=null&&(typeof l=="function"?l(n):l.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Jt]))?void 0:r}let St=i.createContext(null);St.displayName="DescriptionContext";function Zt(){let e=i.useContext(St);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Zt),t}return e}function hn(){let[e,t]=i.useState([]);return[e.length>0?e.join(" "):void 0,i.useMemo(()=>function(r){let n=A(s=>(t(u=>[...u,s]),()=>t(u=>{let d=u.slice(),a=d.indexOf(s);return a!==-1&&d.splice(a,1),d}))),l=i.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return i.createElement(St.Provider,{value:l},r.children)},[t])]}let gn="p";function bn(e,t){let r=i.useId(),n=sn(),{id:l=`headlessui-description-${r}`,...s}=e,u=Zt(),d=ne(t);V(()=>u.register(l),[l,u.register]);let a=n||!1,f=i.useMemo(()=>({...u.slot,disabled:a}),[u.slot,a]),c={ref:d,...u.props,id:l};return Q()({ourProps:c,theirProps:s,slot:f,defaultTag:gn,name:u.name||"Description"})}let yn=z(bn),wn=Object.assign(yn,{});var Qt=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Qt||{});let En=i.createContext(()=>{});function xn({value:e,children:t}){return i.createElement(En.Provider,{value:e},t)}let Tn=class extends Map{constructor(t){super(),this.factory=t}get(t){let r=super.get(t);return r===void 0&&(r=this.factory(t),this.set(t,r)),r}};function er(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(l){return n.add(l),()=>n.delete(l)},dispatch(l,...s){let u=t[l].call(r,...s);u&&(r=u,n.forEach(d=>d()))}}}function tr(e){return i.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Sn=new Tn(()=>er(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let r=this.slice();return r.splice(t,1),r}}));function $e(e,t){let r=Sn.get(t),n=i.useId(),l=tr(r);if(V(()=>{if(e)return r.dispatch("ADD",n),()=>r.dispatch("REMOVE",n)},[r,e]),!e)return!1;let s=l.indexOf(n),u=l.length;return s===-1&&(s=u,u+=1),s===u-1}let Ct=new Map,We=new Map;function rr(e){var t;let r=(t=We.get(e))!=null?t:0;return We.set(e,r+1),r!==0?()=>nr(e):(Ct.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>nr(e))}function nr(e){var t;let r=(t=We.get(e))!=null?t:1;if(r===1?We.delete(e):We.set(e,r-1),r!==1)return;let n=Ct.get(e);n&&(n["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n["aria-hidden"]),e.inert=n.inert,Ct.delete(e))}function Cn(e,{allowed:t,disallowed:r}={}){let n=$e(e,"inert-others");V(()=>{var l,s;if(!n)return;let u=ue();for(let a of(l=r==null?void 0:r())!=null?l:[])a&&u.add(rr(a));let d=(s=t==null?void 0:t())!=null?s:[];for(let a of d){if(!a)continue;let f=Ze(a);if(!f)continue;let c=a.parentElement;for(;c&&c!==f.body;){for(let b of c.children)d.some(x=>b.contains(x))||u.add(rr(b));c=c.parentElement}}return u.dispose},[n,t,r])}function On(e,t,r){let n=ve(l=>{let s=l.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});i.useEffect(()=>{if(!e)return;let l=t===null?null:t instanceof HTMLElement?t:t.current;if(!l)return;let s=ue();if(typeof ResizeObserver<"u"){let u=new ResizeObserver(()=>n.current(l));u.observe(l),s.add(()=>u.disconnect())}if(typeof IntersectionObserver<"u"){let u=new IntersectionObserver(()=>n.current(l));u.observe(l),s.add(()=>u.disconnect())}return()=>s.dispose()},[t,n,e])}let nt=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Pn=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var oe=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(oe||{}),Ot=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ot||{}),$n=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))($n||{});function Mn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(nt)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function kn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Pn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var lr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(lr||{});function Fn(e,t=0){var r;return e===((r=Ze(e))==null?void 0:r.body)?!1:ce(t,{0(){return e.matches(nt)},1(){let n=e;for(;n!==null;){if(n.matches(nt))return!0;n=n.parentElement}return!1}})}var jn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(jn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function ie(e){e==null||e.focus({preventScroll:!0})}let _n=["textarea","input"].join(",");function Ln(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,_n))!=null?r:!1}function An(e,t=r=>r){return e.slice().sort((r,n)=>{let l=t(r),s=t(n);if(l===null||s===null)return 0;let u=l.compareDocumentPosition(s);return u&Node.DOCUMENT_POSITION_FOLLOWING?-1:u&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ue(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:l=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?r?An(e):e:t&64?kn(e):Mn(e);l.length>0&&u.length>1&&(u=u.filter(y=>!l.some(w=>w!=null&&"current"in w?(w==null?void 0:w.current)===y:w===y))),n=n??s.activeElement;let d=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,u.indexOf(n))-1;if(t&4)return Math.max(0,u.indexOf(n))+1;if(t&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,b=u.length,x;do{if(c>=b||c+b<=0)return 0;let y=a+c;if(t&16)y=(y+b)%b;else{if(y<0)return 3;if(y>=b)return 1}x=u[y],x==null||x.focus(f),c+=d}while(x!==s.activeElement);return t&6&&Ln(x)&&x.select(),2}function or(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function In(){return/Android/gi.test(window.navigator.userAgent)}function Nn(){return or()||In()}function He(e,t,r,n){let l=ve(r);i.useEffect(()=>{if(!e)return;function s(u){l.current(u)}return document.addEventListener(t,s,n),()=>document.removeEventListener(t,s,n)},[e,t,n])}function ir(e,t,r,n){let l=ve(r);i.useEffect(()=>{if(!e)return;function s(u){l.current(u)}return window.addEventListener(t,s,n),()=>window.removeEventListener(t,s,n)},[e,t,n])}const ar=30;function Dn(e,t,r){let n=$e(e,"outside-click"),l=ve(r),s=i.useCallback(function(a,f){if(a.defaultPrevented)return;let c=f(a);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let b=function x(y){return typeof y=="function"?x(y()):Array.isArray(y)||y instanceof Set?y:[y]}(t);for(let x of b)if(x!==null&&(x.contains(c)||a.composed&&a.composedPath().includes(x)))return;return!Fn(c,lr.Loose)&&c.tabIndex!==-1&&a.preventDefault(),l.current(a,c)},[l,t]),u=i.useRef(null);He(n,"pointerdown",a=>{var f,c;u.current=((c=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:c[0])||a.target},!0),He(n,"mousedown",a=>{var f,c;u.current=((c=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:c[0])||a.target},!0),He(n,"click",a=>{Nn()||u.current&&(s(a,()=>u.current),u.current=null)},!0);let d=i.useRef({x:0,y:0});He(n,"touchstart",a=>{d.current.x=a.touches[0].clientX,d.current.y=a.touches[0].clientY},!0),He(n,"touchend",a=>{let f={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(f.x-d.current.x)>=ar||Math.abs(f.y-d.current.y)>=ar))return s(a,()=>a.target instanceof HTMLElement?a.target:null)},!0),ir(n,"blur",a=>s(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Be(...e){return i.useMemo(()=>Ze(...e),[...e])}function sr(e,t,r,n){let l=ve(r);i.useEffect(()=>{e=e??window;function s(u){l.current(u)}return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s,n)},[e,t,n])}function Wn(){let e;return{before({doc:t}){var r;let n=t.documentElement,l=(r=t.defaultView)!=null?r:window;e=Math.max(0,l.innerWidth-n.clientWidth)},after({doc:t,d:r}){let n=t.documentElement,l=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,e-l);r.style(n,"paddingRight",`${s}px`)}}}function Un(){return or()?{before({doc:e,d:t,meta:r}){function n(l){return r.containers.flatMap(s=>s()).some(s=>s.contains(l))}t.microTask(()=>{var l;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let d=ue();d.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>d.dispose()))}let s=(l=window.scrollY)!=null?l:window.pageYOffset,u=null;t.addEventListener(e,"click",d=>{if(d.target instanceof HTMLElement)try{let a=d.target.closest("a");if(!a)return;let{hash:f}=new URL(a.href),c=e.querySelector(f);c&&!n(c)&&(u=c)}catch{}},!0),t.addEventListener(e,"touchstart",d=>{if(d.target instanceof HTMLElement)if(n(d.target)){let a=d.target;for(;a.parentElement&&n(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(d.target,"touchAction","none")}),t.addEventListener(e,"touchmove",d=>{if(d.target instanceof HTMLElement){if(d.target.tagName==="INPUT")return;if(n(d.target)){let a=d.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&d.preventDefault()}else d.preventDefault()}},{passive:!1}),t.add(()=>{var d;let a=(d=window.scrollY)!=null?d:window.pageYOffset;s!==a&&window.scrollTo(0,s),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function Hn(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Bn(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let ge=er(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:ue(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Bn(r)},l=[Un(),Wn(),Hn()];l.forEach(({before:s})=>s==null?void 0:s(n)),l.forEach(({after:s})=>s==null?void 0:s(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ge.subscribe(()=>{let e=ge.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",l=r.count!==0;(l&&!n||!l&&n)&&ge.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&ge.dispatch("TEARDOWN",r)}});function Vn(e,t,r=()=>({containers:[]})){let n=tr(ge),l=t?n.get(t):void 0,s=l?l.count>0:!1;return V(()=>{if(!(!t||!e))return ge.dispatch("PUSH",t,r),()=>ge.dispatch("POP",t,r)},[e,t]),s}function Yn(e,t,r=()=>[document.body]){let n=$e(e,"scroll-lock");Vn(n,t,l=>{var s;return{containers:[...(s=l.containers)!=null?s:[],r]}})}function qn(e=0){let[t,r]=i.useState(e),n=i.useCallback(a=>r(a),[t]),l=i.useCallback(a=>r(f=>f|a),[t]),s=i.useCallback(a=>(t&a)===a,[t]),u=i.useCallback(a=>r(f=>f&~a),[r]),d=i.useCallback(a=>r(f=>f^a),[r]);return{flags:t,setFlag:n,addFlag:l,hasFlag:s,removeFlag:u,toggleFlag:d}}var ur,cr;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((ur=process==null?void 0:process.env)==null?void 0:ur.NODE_ENV)==="test"&&typeof((cr=Element==null?void 0:Element.prototype)==null?void 0:cr.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
34
|
+
`)),[]});var Xn=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Xn||{});function zn(e){let t={};for(let r in e)e[r]===!0&&(t[`data-${r}`]="");return t}function Kn(e,t,r,n){let[l,s]=i.useState(r),{hasFlag:u,addFlag:d,removeFlag:a}=qn(e&&l?3:0),f=i.useRef(!1),c=i.useRef(!1),b=wt();return V(()=>{var x;if(e){if(r&&s(!0),!t){r&&d(3);return}return(x=n==null?void 0:n.start)==null||x.call(n,r),Gn(t,{inFlight:f,prepare(){c.current?c.current=!1:c.current=f.current,f.current=!0,!c.current&&(r?(d(3),a(4)):(d(4),a(2)))},run(){c.current?r?(a(3),d(4)):(a(4),d(3)):r?a(1):d(1)},done(){var y;c.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,a(7),r||s(!1),(y=n==null?void 0:n.end)==null||y.call(n,r))}})}},[e,r,t,b]),e?[l,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Gn(e,{prepare:t,run:r,done:n,inFlight:l}){let s=ue();return Jn(e,{prepare:t,inFlight:l}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(Rn(e,n))})}),s.dispose}function Rn(e,t){var r,n;let l=ue();if(!e)return l.dispose;let s=!1;l.add(()=>{s=!0});let u=(n=(r=e.getAnimations)==null?void 0:r.call(e).filter(d=>d instanceof CSSTransition))!=null?n:[];return u.length===0?(t(),l.dispose):(Promise.allSettled(u.map(d=>d.finished)).then(()=>{s||t()}),l.dispose)}function Jn(e,{inFlight:t,prepare:r}){if(t!=null&&t.current){r();return}let n=e.style.transition;e.style.transition="none",r(),e.offsetHeight,e.style.transition=n}function Pt(e,t){let r=i.useRef([]),n=A(e);i.useEffect(()=>{let l=[...r.current];for(let[s,u]of t.entries())if(r.current[s]!==u){let d=n(t,l);return r.current=t,d}},[n,...t])}let lt=i.createContext(null);lt.displayName="OpenClosedContext";var re=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(re||{});function ot(){return i.useContext(lt)}function Zn({value:e,children:t}){return i.createElement(lt.Provider,{value:e},t)}function Qn({children:e}){return i.createElement(lt.Provider,{value:null},e)}function el(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let fe=[];el(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||fe[0]===t.target)return;let r=t.target;r=r.closest(nt),fe.unshift(r??t.target),fe=fe.filter(n=>n!=null&&n.isConnected),fe.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function dr(e){let t=A(e),r=i.useRef(!1);i.useEffect(()=>(r.current=!1,()=>{r.current=!0,Qe(()=>{r.current&&t()})}),[t])}function tl(){let e=typeof document>"u";return"useSyncExternalStore"in je?(t=>t.useSyncExternalStore)(je)(()=>()=>{},()=>!1,()=>!e):!1}function Ve(){let e=tl(),[t,r]=je.useState(me.isHandoffComplete);return t&&me.isHandoffComplete===!1&&r(!1),je.useEffect(()=>{t!==!0&&r(!0)},[t]),je.useEffect(()=>me.handoff(),[]),e?!1:t}let fr=i.createContext(!1);function rl(){return i.useContext(fr)}function pr(e){return i.createElement(fr.Provider,{value:e.force},e.children)}function nl(e){let t=rl(),r=i.useContext(vr),n=Be(e),[l,s]=i.useState(()=>{var u;if(!t&&r!==null)return(u=r.current)!=null?u:null;if(me.isServer)return null;let d=n==null?void 0:n.getElementById("headlessui-portal-root");if(d)return d;if(n===null)return null;let a=n.createElement("div");return a.setAttribute("id","headlessui-portal-root"),n.body.appendChild(a)});return i.useEffect(()=>{l!==null&&(n!=null&&n.body.contains(l)||n==null||n.body.appendChild(l))},[l,n]),i.useEffect(()=>{t||r!==null&&s(r.current)},[r,s,t]),l}let mr=i.Fragment,ll=z(function(e,t){let r=e,n=i.useRef(null),l=ne(vn(b=>{n.current=b}),t),s=Be(n),u=nl(n),[d]=i.useState(()=>{var b;return me.isServer?null:(b=s==null?void 0:s.createElement("div"))!=null?b:null}),a=i.useContext($t),f=Ve();V(()=>{!u||!d||u.contains(d)||(d.setAttribute("data-headlessui-portal",""),u.appendChild(d))},[u,d]),V(()=>{if(d&&a)return a.register(d)},[a,d]),dr(()=>{var b;!u||!d||(d instanceof Node&&u.contains(d)&&u.removeChild(d),u.childNodes.length<=0&&((b=u.parentElement)==null||b.removeChild(u)))});let c=Q();return f?!u||!d?null:Xr.createPortal(c({ourProps:{ref:l},theirProps:r,slot:{},defaultTag:mr,name:"Portal"}),d):null});function ol(e,t){let r=ne(t),{enabled:n=!0,...l}=e,s=Q();return n?i.createElement(ll,{...l,ref:r}):s({ourProps:{ref:r},theirProps:l,slot:{},defaultTag:mr,name:"Portal"})}let il=i.Fragment,vr=i.createContext(null);function al(e,t){let{target:r,...n}=e,l={ref:ne(t)},s=Q();return i.createElement(vr.Provider,{value:r},s({ourProps:l,theirProps:n,defaultTag:il,name:"Popover.Group"}))}let $t=i.createContext(null);function sl(){let e=i.useContext($t),t=i.useRef([]),r=A(s=>(t.current.push(s),e&&e.register(s),()=>n(s))),n=A(s=>{let u=t.current.indexOf(s);u!==-1&&t.current.splice(u,1),e&&e.unregister(s)}),l=i.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,i.useMemo(()=>function({children:s}){return i.createElement($t.Provider,{value:l},s)},[l])]}let ul=z(ol),hr=z(al),cl=Object.assign(ul,{Group:hr});function dl(e,t=typeof document<"u"?document.defaultView:null,r){let n=$e(e,"escape");sr(t,"keydown",l=>{n&&(l.defaultPrevented||l.key===Qt.Escape&&r(l))})}function fl(){var e;let[t]=i.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=i.useState((e=t==null?void 0:t.matches)!=null?e:!1);return V(()=>{if(!t)return;function l(s){n(s.matches)}return t.addEventListener("change",l),()=>t.removeEventListener("change",l)},[t]),r}function pl({defaultContainers:e=[],portals:t,mainTreeNode:r}={}){let n=Be(r),l=A(()=>{var s,u;let d=[];for(let a of e)a!==null&&(a instanceof HTMLElement?d.push(a):"current"in a&&a.current instanceof HTMLElement&&d.push(a.current));if(t!=null&&t.current)for(let a of t.current)d.push(a);for(let a of(s=n==null?void 0:n.querySelectorAll("html > *, body > *"))!=null?s:[])a!==document.body&&a!==document.head&&a instanceof HTMLElement&&a.id!=="headlessui-portal-root"&&(r&&(a.contains(r)||a.contains((u=r==null?void 0:r.getRootNode())==null?void 0:u.host))||d.some(f=>a.contains(f))||d.push(a));return d});return{resolveContainers:l,contains:A(s=>l().some(u=>u.contains(s)))}}let gr=i.createContext(null);function br({children:e,node:t}){let[r,n]=i.useState(null),l=yr(t??r);return i.createElement(gr.Provider,{value:l},e,l===null&&i.createElement(Tt,{features:rt.Hidden,ref:s=>{var u,d;if(s){for(let a of(d=(u=Ze(s))==null?void 0:u.querySelectorAll("html > *, body > *"))!=null?d:[])if(a!==document.body&&a!==document.head&&a instanceof HTMLElement&&a!=null&&a.contains(s)){n(a);break}}}}))}function yr(e=null){var t;return(t=i.useContext(gr))!=null?t:e}function Mt(){let e=i.useRef(!1);return V(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var Ye=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ye||{});function ml(){let e=i.useRef(0);return ir(!0,"keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function wr(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let vl="div";var be=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(be||{});function hl(e,t){let r=i.useRef(null),n=ne(r,t),{initialFocus:l,initialFocusFallback:s,containers:u,features:d=15,...a}=e;Ve()||(d=0);let f=Be(r);wl(d,{ownerDocument:f});let c=El(d,{ownerDocument:f,container:r,initialFocus:l,initialFocusFallback:s});xl(d,{ownerDocument:f,container:r,containers:u,previousActiveElement:c});let b=ml(),x=A(h=>{let T=r.current;T&&(S=>S())(()=>{ce(b.current,{[Ye.Forwards]:()=>{Ue(T,oe.First,{skipElements:[h.relatedTarget,s]})},[Ye.Backwards]:()=>{Ue(T,oe.Last,{skipElements:[h.relatedTarget,s]})}})})}),y=$e(!!(d&2),"focus-trap#tab-lock"),w=wt(),g=i.useRef(!1),p={ref:n,onKeyDown(h){h.key=="Tab"&&(g.current=!0,w.requestAnimationFrame(()=>{g.current=!1}))},onBlur(h){if(!(d&4))return;let T=wr(u);r.current instanceof HTMLElement&&T.add(r.current);let S=h.relatedTarget;S instanceof HTMLElement&&S.dataset.headlessuiFocusGuard!=="true"&&(Er(T,S)||(g.current?Ue(r.current,ce(b.current,{[Ye.Forwards]:()=>oe.Next,[Ye.Backwards]:()=>oe.Previous})|oe.WrapAround,{relativeTo:h.target}):h.target instanceof HTMLElement&&ie(h.target)))}},m=Q();return i.createElement(i.Fragment,null,y&&i.createElement(Tt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:rt.Focusable}),m({ourProps:p,theirProps:a,defaultTag:vl,name:"FocusTrap"}),y&&i.createElement(Tt,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:x,features:rt.Focusable}))}let gl=z(hl),bl=Object.assign(gl,{features:be});function yl(e=!0){let t=i.useRef(fe.slice());return Pt(([r],[n])=>{n===!0&&r===!1&&Qe(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=fe.slice())},[e,fe,t]),A(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function wl(e,{ownerDocument:t}){let r=!!(e&8),n=yl(r);Pt(()=>{r||(t==null?void 0:t.activeElement)===(t==null?void 0:t.body)&&ie(n())},[r]),dr(()=>{r&&ie(n())})}function El(e,{ownerDocument:t,container:r,initialFocus:n,initialFocusFallback:l}){let s=i.useRef(null),u=$e(!!(e&1),"focus-trap#initial-focus"),d=Mt();return Pt(()=>{if(e===0)return;if(!u){l!=null&&l.current&&ie(l.current);return}let a=r.current;a&&Qe(()=>{if(!d.current)return;let f=t==null?void 0:t.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===f){s.current=f;return}}else if(a.contains(f)){s.current=f;return}if(n!=null&&n.current)ie(n.current);else{if(e&16){if(Ue(a,oe.First|oe.AutoFocus)!==Ot.Error)return}else if(Ue(a,oe.First)!==Ot.Error)return;if(l!=null&&l.current&&(ie(l.current),(t==null?void 0:t.activeElement)===l.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}s.current=t==null?void 0:t.activeElement})},[l,u,e]),s}function xl(e,{ownerDocument:t,container:r,containers:n,previousActiveElement:l}){let s=Mt(),u=!!(e&4);sr(t==null?void 0:t.defaultView,"focus",d=>{if(!u||!s.current)return;let a=wr(n);r.current instanceof HTMLElement&&a.add(r.current);let f=l.current;if(!f)return;let c=d.target;c&&c instanceof HTMLElement?Er(a,c)?(l.current=c,ie(c)):(d.preventDefault(),d.stopPropagation(),ie(f)):ie(l.current)},!0)}function Er(e,t){for(let r of e)if(r.contains(t))return!0;return!1}function xr(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:Sr)!==i.Fragment||i.Children.count(e.children)===1}let it=i.createContext(null);it.displayName="TransitionContext";var Tl=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Tl||{});function Sl(){let e=i.useContext(it);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Cl(){let e=i.useContext(at);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let at=i.createContext(null);at.displayName="NestingContext";function st(e){return"children"in e?st(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Tr(e,t){let r=ve(e),n=i.useRef([]),l=Mt(),s=wt(),u=A((y,w=de.Hidden)=>{let g=n.current.findIndex(({el:p})=>p===y);g!==-1&&(ce(w,{[de.Unmount](){n.current.splice(g,1)},[de.Hidden](){n.current[g].state="hidden"}}),s.microTask(()=>{var p;!st(n)&&l.current&&((p=r.current)==null||p.call(r))}))}),d=A(y=>{let w=n.current.find(({el:g})=>g===y);return w?w.state!=="visible"&&(w.state="visible"):n.current.push({el:y,state:"visible"}),()=>u(y,de.Unmount)}),a=i.useRef([]),f=i.useRef(Promise.resolve()),c=i.useRef({enter:[],leave:[]}),b=A((y,w,g)=>{a.current.splice(0),t&&(t.chains.current[w]=t.chains.current[w].filter(([p])=>p!==y)),t==null||t.chains.current[w].push([y,new Promise(p=>{a.current.push(p)})]),t==null||t.chains.current[w].push([y,new Promise(p=>{Promise.all(c.current[w].map(([m,h])=>h)).then(()=>p())})]),w==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>g(w)):g(w)}),x=A((y,w,g)=>{Promise.all(c.current[w].splice(0).map(([p,m])=>m)).then(()=>{var p;(p=a.current.shift())==null||p()}).then(()=>g(w))});return i.useMemo(()=>({children:n,register:d,unregister:u,onStart:b,onStop:x,wait:f,chains:c}),[d,u,n,b,x,c,f])}let Sr=i.Fragment,Cr=et.RenderStrategy;function Ol(e,t){var r,n;let{transition:l=!0,beforeEnter:s,afterEnter:u,beforeLeave:d,afterLeave:a,enter:f,enterFrom:c,enterTo:b,entered:x,leave:y,leaveFrom:w,leaveTo:g,...p}=e,[m,h]=i.useState(null),T=i.useRef(null),S=xr(e),k=ne(...S?[T,t,h]:t===null?[]:[t]),Y=(r=p.unmount)==null||r?de.Unmount:de.Hidden,{show:U,appear:R,initial:J}=Sl(),[H,q]=i.useState(U?"visible":"hidden"),K=Cl(),{register:_,unregister:M}=K;V(()=>_(T),[_,T]),V(()=>{if(Y===de.Hidden&&T.current){if(U&&H!=="visible"){q("visible");return}return ce(H,{hidden:()=>M(T),visible:()=>_(T)})}},[H,T,_,M,U,Y]);let I=Ve();V(()=>{if(S&&I&&H==="visible"&&T.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[T,H,I,S]);let ye=J&&!R,we=R&&U&&J,pe=i.useRef(!1),Z=Tr(()=>{pe.current||(q("hidden"),M(T))},K),Ee=A(Se=>{pe.current=!0;let ae=Se?"enter":"leave";Z.onStart(T,ae,se=>{se==="enter"?s==null||s():se==="leave"&&(d==null||d())})}),N=A(Se=>{let ae=Se?"enter":"leave";pe.current=!1,Z.onStop(T,ae,se=>{se==="enter"?u==null||u():se==="leave"&&(a==null||a())}),ae==="leave"&&!st(Z)&&(q("hidden"),M(T))});i.useEffect(()=>{S&&l||(Ee(U),N(U))},[U,S,l]);let xe=!(!l||!S||!I||ye),[,B]=Kn(xe,m,U,{start:Ee,end:N}),_t=he({ref:k,className:((n=Et(p.className,we&&f,we&&c,B.enter&&f,B.enter&&B.closed&&c,B.enter&&!B.closed&&b,B.leave&&y,B.leave&&!B.closed&&w,B.leave&&B.closed&&g,!B.transition&&U&&x))==null?void 0:n.trim())||void 0,...zn(B)}),Te=0;H==="visible"&&(Te|=re.Open),H==="hidden"&&(Te|=re.Closed),B.enter&&(Te|=re.Opening),B.leave&&(Te|=re.Closing);let qe=Q();return i.createElement(at.Provider,{value:Z},i.createElement(Zn,{value:Te},qe({ourProps:_t,theirProps:p,defaultTag:Sr,features:Cr,visible:H==="visible",name:"Transition.Child"})))}function Pl(e,t){let{show:r,appear:n=!1,unmount:l=!0,...s}=e,u=i.useRef(null),d=xr(e),a=ne(...d?[u,t]:t===null?[]:[t]);Ve();let f=ot();if(r===void 0&&f!==null&&(r=(f&re.Open)===re.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,b]=i.useState(r?"visible":"hidden"),x=Tr(()=>{r||b("hidden")}),[y,w]=i.useState(!0),g=i.useRef([r]);V(()=>{y!==!1&&g.current[g.current.length-1]!==r&&(g.current.push(r),w(!1))},[g,r]);let p=i.useMemo(()=>({show:r,appear:n,initial:y}),[r,n,y]);V(()=>{r?b("visible"):!st(x)&&u.current!==null&&b("hidden")},[r,x]);let m={unmount:l},h=A(()=>{var k;y&&w(!1),(k=e.beforeEnter)==null||k.call(e)}),T=A(()=>{var k;y&&w(!1),(k=e.beforeLeave)==null||k.call(e)}),S=Q();return i.createElement(at.Provider,{value:x},i.createElement(it.Provider,{value:p},S({ourProps:{...m,as:i.Fragment,children:i.createElement(Or,{ref:a,...m,...s,beforeEnter:h,beforeLeave:T})},theirProps:{},defaultTag:i.Fragment,features:Cr,visible:c==="visible",name:"Transition"})))}function $l(e,t){let r=i.useContext(it)!==null,n=ot()!==null;return i.createElement(i.Fragment,null,!r&&n?i.createElement(kt,{ref:t,...e}):i.createElement(Or,{ref:t,...e}))}let kt=z(Pl),Or=z(Ol),Me=z($l),Pr=Object.assign(kt,{Child:Me,Root:kt});var Ml=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ml||{}),kl=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(kl||{});let Fl={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Ft=i.createContext(null);Ft.displayName="DialogContext";function ut(e){let t=i.useContext(Ft);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ut),r}return t}function jl(e,t){return ce(t.type,Fl,e,t)}let $r=z(function(e,t){let r=i.useId(),{id:n=`headlessui-dialog-${r}`,open:l,onClose:s,initialFocus:u,role:d="dialog",autoFocus:a=!0,__demoMode:f=!1,unmount:c=!1,...b}=e,x=i.useRef(!1);d=function(){return d==="dialog"||d==="alertdialog"?d:(x.current||(x.current=!0,console.warn(`Invalid role [${d}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let y=ot();l===void 0&&y!==null&&(l=(y&re.Open)===re.Open);let w=i.useRef(null),g=ne(w,t),p=Be(w),m=l?0:1,[h,T]=i.useReducer(jl,{titleId:null,descriptionId:null,panelRef:i.createRef()}),S=A(()=>s(!1)),k=A(N=>T({type:0,id:N})),Y=Ve()?m===0:!1,[U,R]=sl(),J={get current(){var N;return(N=h.panelRef.current)!=null?N:w.current}},H=yr(),{resolveContainers:q}=pl({mainTreeNode:H,portals:U,defaultContainers:[J]}),K=y!==null?(y&re.Closing)===re.Closing:!1;Cn(f||K?!1:Y,{allowed:A(()=>{var N,xe;return[(xe=(N=w.current)==null?void 0:N.closest("[data-headlessui-portal]"))!=null?xe:null]}),disallowed:A(()=>{var N;return[(N=H==null?void 0:H.closest("body > *:not(#headlessui-portal-root)"))!=null?N:null]})}),Dn(Y,q,N=>{N.preventDefault(),S()}),dl(Y,p==null?void 0:p.defaultView,N=>{N.preventDefault(),N.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),S()}),Yn(f||K?!1:Y,p,q),On(Y,w,S);let[_,M]=hn(),I=i.useMemo(()=>[{dialogState:m,close:S,setTitleId:k,unmount:c},h],[m,h,S,k,c]),ye=i.useMemo(()=>({open:m===0}),[m]),we={ref:g,id:n,role:d,tabIndex:-1,"aria-modal":f?void 0:m===0?!0:void 0,"aria-labelledby":h.titleId,"aria-describedby":_,unmount:c},pe=!fl(),Z=be.None;Y&&!f&&(Z|=be.RestoreFocus,Z|=be.TabLock,a&&(Z|=be.AutoFocus),pe&&(Z|=be.InitialFocus));let Ee=Q();return i.createElement(Qn,null,i.createElement(pr,{force:!0},i.createElement(cl,null,i.createElement(Ft.Provider,{value:I},i.createElement(hr,{target:w},i.createElement(pr,{force:!1},i.createElement(M,{slot:ye},i.createElement(R,null,i.createElement(bl,{initialFocus:u,initialFocusFallback:w,containers:q,features:Z},i.createElement(xn,{value:S},Ee({ourProps:we,theirProps:b,slot:ye,defaultTag:_l,features:Ll,visible:m===0,name:"Dialog"})))))))))))}),_l="div",Ll=et.RenderStrategy|et.Static;function Al(e,t){let{transition:r=!1,open:n,...l}=e,s=ot(),u=e.hasOwnProperty("open")||s!==null,d=e.hasOwnProperty("onClose");if(!u&&!d)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!u)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!d)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof e.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if(typeof e.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return(n!==void 0||r)&&!l.static?i.createElement(br,null,i.createElement(Pr,{show:n,transition:r,unmount:l.unmount},i.createElement($r,{ref:t,...l}))):i.createElement(br,null,i.createElement($r,{ref:t,open:n,...l}))}let Il="div";function Nl(e,t){let r=i.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:l=!1,...s}=e,[{dialogState:u,unmount:d},a]=ut("Dialog.Panel"),f=ne(t,a.panelRef),c=i.useMemo(()=>({open:u===0}),[u]),b=A(p=>{p.stopPropagation()}),x={ref:f,id:n,onClick:b},y=l?Me:i.Fragment,w=l?{unmount:d}:{},g=Q();return i.createElement(y,{...w},g({ourProps:x,theirProps:s,slot:c,defaultTag:Il,name:"Dialog.Panel"}))}let Dl="div";function Wl(e,t){let{transition:r=!1,...n}=e,[{dialogState:l,unmount:s}]=ut("Dialog.Backdrop"),u=i.useMemo(()=>({open:l===0}),[l]),d={ref:t,"aria-hidden":!0},a=r?Me:i.Fragment,f=r?{unmount:s}:{},c=Q();return i.createElement(a,{...f},c({ourProps:d,theirProps:n,slot:u,defaultTag:Dl,name:"Dialog.Backdrop"}))}let Ul="h2";function Hl(e,t){let r=i.useId(),{id:n=`headlessui-dialog-title-${r}`,...l}=e,[{dialogState:s,setTitleId:u}]=ut("Dialog.Title"),d=ne(t);i.useEffect(()=>(u(n),()=>u(null)),[n,u]);let a=i.useMemo(()=>({open:s===0}),[s]),f={ref:d,id:n};return Q()({ourProps:f,theirProps:l,slot:a,defaultTag:Ul,name:"Dialog.Title"})}let Bl=z(Al),jt=z(Nl);z(Wl);let Vl=z(Hl),Yl=Object.assign(Bl,{Panel:jt,Title:Vl,Description:wn});function Mr({onClick:e}){return O.jsxs("button",{type:"button",className:"im-close-button text-gray-400 hover:text-gray-500",onClick:e,children:[O.jsx("span",{className:"sr-only",children:"Close"}),O.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true",children:O.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})]})}const ql=({modalContext:e,config:t,children:r})=>O.jsx("div",{className:"im-modal-container fixed inset-0 z-40 overflow-y-auto p-4",children:O.jsx("div",{className:Je("im-modal-positioner flex min-h-full justify-center",{"items-start":t.position==="top","items-center":t.position==="center","items-end":t.position==="bottom"}),children:O.jsx(Me,{enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",afterLeave:e.afterLeave,className:Je("im-modal-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:O.jsxs(jt,{className:`im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&O.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:O.jsx(Mr,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,config:t}):r]})})})}),Xl=({modalContext:e,config:t,children:r})=>O.jsx("div",{className:"im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden",children:O.jsx("div",{className:Je("im-slideover-positioner flex min-h-full items-center",{"justify-start":t.position==="left","justify-end":t.position==="right"}),children:O.jsx(Me,{enterFrom:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,enterTo:"opacity-100 translate-x-0",leaveFrom:"opacity-100 translate-x-0",leaveTo:`opacity-0 ${t.position==="left"?"-translate-x-full":"translate-x-full"}`,afterLeave:e.afterLeave,className:Je("im-slideover-wrapper w-full transition duration-300 ease-in-out",e.onTopOfStack?"":"blur-sm",{"sm:max-w-sm":t.maxWidth==="sm","sm:max-w-md":t.maxWidth==="md","sm:max-w-md md:max-w-lg":t.maxWidth==="lg","sm:max-w-md md:max-w-xl":t.maxWidth==="xl","sm:max-w-md md:max-w-xl lg:max-w-2xl":t.maxWidth==="2xl","sm:max-w-md md:max-w-xl lg:max-w-3xl":t.maxWidth==="3xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl":t.maxWidth==="4xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl":t.maxWidth==="5xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl":t.maxWidth==="6xl","sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl":t.maxWidth==="7xl"}),children:O.jsxs(jt,{className:`im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,children:[t.closeButton&&O.jsx("div",{className:"absolute right-0 top-0 pr-3 pt-3",children:O.jsx(Mr,{onClick:e.close})}),typeof r=="function"?r({modalContext:e,config:t}):r]})})})}),kr=i.forwardRef(({name:e,children:t,...r},n)=>{const l=u=>typeof t=="function"?t(u):t,s=i.useRef(null);return i.useImperativeHandle(n,()=>s.current,[s]),O.jsx(bt,{ref:s,name:e,...r,children:({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})=>O.jsx(Pr,{appear:!0,show:w??!1,children:O.jsxs(Yl,{as:"div",className:"im-dialog relative z-20",onClose:()=>a.closeExplicitly?null:d(),"data-inertiaui-modal-id":x,"data-inertiaui-modal-index":y,children:[y===0?O.jsx(Me,{enter:"transition transform ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition transform ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p?O.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75","aria-hidden":"true"}):O.jsx("div",{})}):null,y>0&&p?O.jsx("div",{className:"im-backdrop fixed inset-0 z-30 bg-black/75"}):null,a.slideover?O.jsx(Xl,{modalContext:g,config:a,children:l({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})}):O.jsx(ql,{modalContext:g,config:a,children:l({afterLeave:u,close:d,config:a,emit:f,getChildModal:c,getParentModal:b,id:x,index:y,isOpen:w,modalContext:g,onTopOfStack:p,reload:m,setOpen:h,shouldRender:T})})]})})})});kr.displayName="Modal";const zl=({href:e,method:t="get",data:r={},as:n="a",headers:l={},queryStringArrayFormat:s="brackets",onAfterLeave:u=null,onBlur:d=null,onClose:a=null,onError:f=null,onFocus:c=null,onStart:b=null,onSuccess:x=null,navigate:y=null,children:w,...g})=>{const[p,m]=i.useState(!1),[h,T]=i.useState(null),{stack:S,visit:k}=De(),Y=i.useMemo(()=>y??Ge("navigate"),[y]),U={},R={};Object.keys(g).forEach(M=>{Xt.includes(M)||(M.startsWith("on")&&typeof g[M]=="function"?M.toLowerCase()in window?U[M]=g[M]:R[M]=g[M]:U[M]=g[M])});const[J,H]=i.useState(!1);i.useEffect(()=>{h&&(h.onTopOfStack&&J?c==null||c():!h.onTopOfStack&&!J&&(d==null||d()),H(!h.onTopOfStack))},[S]);const q=i.useCallback(()=>{a==null||a()},[a]),K=i.useCallback(()=>{T(null),u==null||u()},[u]),_=i.useCallback(M=>{M==null||M.preventDefault(),!p&&(e.startsWith("#")||(m(!0),b==null||b()),k(e,t,r,l,en(Bt(g,Xt)),()=>q(S.length),K,s,Y).then(I=>{T(I),I.registerEventListenersFromProps(R),x==null||x()}).catch(I=>{console.error(I),f==null||f(I)}).finally(()=>m(!1)))},[e,t,r,l,s,g,q,K]);return O.jsx(n,{...U,href:e,onClick:_,children:typeof w=="function"?w({loading:p}):w})};function Kl(){return De().stack[gt()]??null}j.HeadlessModal=bt,j.Modal=kr,j.ModalLink=zl,j.ModalRoot=zt,j.ModalStackProvider=qt,j.getConfig=Ge,j.putConfig=Rr,j.renderApp=rn,j.resetConfig=Gr,j.useModal=Kl,j.useModalIndex=gt,j.useModalStack=De,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|