import {
  E,
  d,
  u,
  w
} from "./chunk-5EXVWLEU.js";
import {
  require_react
} from "./chunk-CN7HREE2.js";
import {
  __commonJS,
  __toESM
} from "./chunk-5WRI5ZAA.js";

// ../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
  "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
    "use strict";
    (function() {
      function is(x2, y2) {
        return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
      }
      function useSyncExternalStore$2(subscribe, getSnapshot) {
        didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
          "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
        ));
        var value = getSnapshot();
        if (!didWarnUncachedGetSnapshot) {
          var cachedValue = getSnapshot();
          objectIs(value, cachedValue) || (console.error(
            "The result of getSnapshot should be cached to avoid an infinite loop"
          ), didWarnUncachedGetSnapshot = true);
        }
        cachedValue = useState({
          inst: { value, getSnapshot }
        });
        var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
        useLayoutEffect(
          function() {
            inst.value = value;
            inst.getSnapshot = getSnapshot;
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
          },
          [subscribe, value, getSnapshot]
        );
        useEffect(
          function() {
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            return subscribe(function() {
              checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            });
          },
          [subscribe]
        );
        useDebugValue(value);
        return value;
      }
      function checkIfSnapshotChanged(inst) {
        var latestGetSnapshot = inst.getSnapshot;
        inst = inst.value;
        try {
          var nextValue = latestGetSnapshot();
          return !objectIs(inst, nextValue);
        } catch (error) {
          return true;
        }
      }
      function useSyncExternalStore$1(subscribe, getSnapshot) {
        return getSnapshot();
      }
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
      var React = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
      exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
    })();
  }
});

// ../../node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
  "../../node_modules/use-sync-external-store/shim/index.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_use_sync_external_store_shim_development();
    }
  }
});

// ../../node_modules/@preact/signals-react/runtime/dist/runtime.module.js
var import_react = __toESM(require_react());
var import_shim = __toESM(require_shim());
var s = import_react.version.split(".").map(Number)[0];
var l = [];
var v = Symbol.for(s >= 19 ? "react.transitional.element" : "react.element");
function d2(t) {
  if ("function" != typeof t) return t;
  else return function(r, i) {
    if ("string" == typeof r && i) for (var e2 in i) {
      var o2 = i[e2];
      if ("children" !== e2 && o2 instanceof u) i[e2] = o2.value;
    }
    return t.call.apply(t, [t, r, i].concat([].slice.call(arguments, 2)));
  };
}
var p;
var m = Symbol.dispose || Symbol.for("Symbol.dispose");
function b(n, t) {
  var r = t.effect.S();
  p = t;
  return y.bind(t, n, r);
}
function y(n, t) {
  t();
  p = n;
}
var g;
var h;
var _ = function() {
};
var S = ((g = { o: 0, effect: { s: void 0, c: function() {
}, S: function() {
  return _;
}, d: function() {
} }, subscribe: function() {
  return _;
}, getSnapshot: function() {
  return 0;
}, S: function() {
}, f: function() {
} })[m] = function() {
}, g);
var w2 = Promise.prototype.then.bind(Promise.resolve());
function x() {
  if (!h) h = w2(j);
}
function j() {
  var n;
  h = void 0;
  null == (n = p) || n.f();
}
var P = "undefined" != typeof window ? import_react.useLayoutEffect : import_react.useEffect;
function $(n) {
  if (void 0 === n) n = 0;
  x();
  var t = (0, import_react.useRef)();
  if (null == t.current) if ("undefined" == typeof window) t.current = S;
  else t.current = function(n2) {
    var t2, r2, e2, o2, u3 = 0, f2 = E(function() {
      r2 = this;
    });
    r2.c = function() {
      u3 = u3 + 1 | 0;
      if (o2) o2();
    };
    return (t2 = { o: n2, effect: r2, subscribe: function(n3) {
      o2 = n3;
      return function() {
        u3 = u3 + 1 | 0;
        o2 = void 0;
        f2();
      };
    }, getSnapshot: function() {
      return u3;
    }, S: function() {
      if (null != p) {
        var n3 = p.o, t3 = this.o;
        if (0 == n3 && 0 == t3 || 0 == n3 && 1 == t3) {
          p.f();
          e2 = b(void 0, this);
        } else if (1 == n3 && 0 == t3 || 2 == n3 && 0 == t3) ;
        else e2 = b(p, this);
      } else e2 = b(void 0, this);
    }, f: function() {
      var n3 = e2;
      e2 = void 0;
      null == n3 || n3();
    } })[m] = function() {
      this.f();
    }, t2;
  }(n);
  var r = t.current;
  (0, import_shim.useSyncExternalStore)(r.subscribe, r.getSnapshot, r.getSnapshot);
  r.S();
  if (0 === n) P(j);
  return r;
}
Object.defineProperties(u.prototype, { $$typeof: { configurable: true, value: v }, type: { configurable: true, value: function(n) {
  var t = n.data, r = $(1);
  try {
    return t.value;
  } finally {
    r.f();
  }
} }, props: { configurable: true, get: function() {
  return { data: this };
} }, ref: { configurable: true, value: null } });
function k(n) {
  return $(n);
}
function useSignal(n) {
  return (0, import_react.useMemo)(function() {
    return d(n);
  }, l);
}
function useComputed(n) {
  var t = (0, import_react.useRef)(n);
  t.current = n;
  return (0, import_react.useMemo)(function() {
    return w(function() {
      return t.current();
    });
  }, l);
}
function useSignalEffect(n) {
  var t = (0, import_react.useRef)(n);
  t.current = n;
  (0, import_react.useEffect)(function() {
    return E(function() {
      return t.current();
    });
  }, l);
}
export {
  $ as _useSignalsImplementation,
  x as ensureFinalCleanup,
  useComputed,
  useSignal,
  useSignalEffect,
  k as useSignals,
  d2 as wrapJsx
};
/*! Bundled license information:

use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
  (**
   * @license React
   * use-sync-external-store-shim.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)
*/
//# sourceMappingURL=@preact_signals-react_runtime.js.map
