import {
  __classPrivateFieldGet
} from "/node_modules/.vite/deps/chunk-F6B56SAQ.js?v=bff2a436";

// node_modules/@rhds/elements/lib/DirController.js
var _DirController_instances;
var _DirController_getDirContext;
var DirController = class {
  constructor(host) {
    _DirController_instances.add(this);
    this.host = host;
    this.dir = "auto";
    this.update();
  }
  hostConnected() {
    this.update();
  }
  async update() {
    const initial = this.dir;
    await this.host.updateComplete;
    this.dir = __classPrivateFieldGet(this, _DirController_instances, "m", _DirController_getDirContext).call(this);
    if (this.dir !== initial) {
      this.host.requestUpdate();
    }
  }
};
_DirController_instances = /* @__PURE__ */ new WeakSet(), _DirController_getDirContext = function _DirController_getDirContext2() {
  let host = this.host;
  while (host) {
    const dirContext = host.closest("[dir]");
    if (dirContext) {
      return dirContext.getAttribute("dir") ?? "ltr";
    } else {
      ({ host } = host?.getRootNode() ?? {});
    }
  }
  return "ltr";
};

export {
  DirController
};
//# sourceMappingURL=chunk-UJWDK7JX.js.map
