UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

205 lines (203 loc) 13 kB
function __vite_inject_css__(css, id, forceLightDom){ if (typeof document==='undefined') return; var shadow=!forceLightDom&&typeof window!=='undefined'&&window.__efpShadowDOMStyleParent; var parent=shadow||document.head; var s=document.createElement('style'); s.setAttribute('data-chunk-style', id); s.appendChild(document.createTextNode(css)); parent.appendChild(s);} (function() { try { var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}; e.SENTRY_RELEASE = { id: "3.7.8" }; var t = new e.Error().stack; t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d4b05500-58f7-4ae0-a66b-b29e9ff549ac", e._sentryDebugIdIdentifier = "sentry-dbid-d4b05500-58f7-4ae0-a66b-b29e9ff549ac"); } catch {} })(); import { r as e } from "./rolldown-runtime-YBAZwyzS.js"; import { t } from "./react-Di3Pmpio.js"; import { t as n } from "./jsx-runtime-C8yjdFgZ.js"; import { g as r, h as i, l as a, v as o, x as s, y as c } from "./i18n-BEer1tI4.js"; import { t as l } from "./classnames-BRCgwycl.js"; //#region ../../node_modules/.pnpm/mobx-react-lite@1.5.2_mobx@5.15.7_react@19.2.7/node_modules/mobx-react-lite/dist/index.module.js var u = /* @__PURE__ */ e(t()); if (!u.useState) throw Error("mobx-react-lite requires React with Hooks support"); if (!c) throw Error("mobx-react-lite requires mobx at least version 4 to be available"); var d = !1; function f() { return d; } var p = function() { return p = Object.assign || function(e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e; }, p.apply(this, arguments); }; function m(e, t) { var n = typeof Symbol == "function" && e[Symbol.iterator]; if (!n) return e; var r = n.call(e), i, a = [], o; try { for (; (t === void 0 || t-- > 0) && !(i = r.next()).done;) a.push(i.value); } catch (e) { o = { error: e }; } finally { try { i && !i.done && (n = r.return) && n.call(r); } finally { if (o) throw o.error; } } return a; } function h(e) { return e.current ? i(e.current) : "<unknown>"; } var g = []; function _(e) { (0, u.useEffect)(function() { return e; }, g); } function v() { var e = m((0, u.useState)(0), 2)[1]; return (0, u.useCallback)(function() { e(function(e) { return e + 1; }); }, []); } function y(e) { if (!e || typeof e != "object") return !1; var t = Object.getPrototypeOf(e); return !t || t === Object.prototype; } var b = {}; function x(e, t, n) { if (t === void 0 && (t = "observed"), n === void 0 && (n = b), f()) return e(); var r = (n.useForceUpdate || v)(), i = (0, u.useRef)(null); i.current || (i.current = new a("observer(" + t + ")", function() { r(); })); var o = function() { i.current && !i.current.isDisposed && (i.current.dispose(), i.current = null); }; (0, u.useDebugValue)(i, h), _(function() { o(); }); var s, c; if (i.current.track(function() { try { s = e(); } catch (e) { c = e; } }), c) throw o(), c; return s; } function S(e, t) { if (f()) return e; var n = p({ forwardRef: !1 }, t), r = e.displayName || e.name, i = function(t, n) { return x(function() { return e(t, n); }, r); }; i.displayName = r; var a = n.forwardRef ? (0, u.memo)((0, u.forwardRef)(i)) : (0, u.memo)(i); return w(e, a), a.displayName = r, a; } var C = { $$typeof: !0, render: !0, compare: !0, type: !0 }; function w(e, t) { Object.keys(e).forEach(function(n) { e.hasOwnProperty(n) && !C[n] && Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(e, n)); }); } function T(e) { var t = e.children, n = e.render, r = t || n; return typeof r == "function" ? x(r) : null; } T.propTypes = { children: E, render: E }, T.displayName = "Observer"; function E(e, t, n, r, i) { var a = t === "children" ? "render" : "children", o = typeof e[t] == "function", s = typeof e[a] == "function"; return o && s ? /* @__PURE__ */ Error("MobX Observer: Do not use children and render in the same time in`" + n) : o || s ? null : /* @__PURE__ */ Error("Invalid prop `" + i + "` of type `" + typeof e[t] + "` supplied to `" + n + "`, expected `function`."); } function D(e, t) { if (!(t && e === void 0)) { var n = m(u.useState(function() { return r(e, {}, { deep: !1 }); }), 1)[0]; return o(function() { Object.assign(n, e); }), n; } } function O(e, t) { var n = D(t, !0); return u.useState(function() { var t = r(e(n)); return y(t) && o(function() { Object.keys(t).forEach(function(e) { var n = t[e]; typeof n == "function" && (t[e] = k(n, t)); }); }), t; })[0]; } function k(e, t) { return function() { var n = [...arguments]; return s(function() { return e.apply(t, n); }); }; } //#endregion //#region src/ui/Button/Button.tsx var A = /* @__PURE__ */ e(l(), 1), j = n(), M = (e) => { let t = e.split(/(#\d+#)/), n = e.match(/#(\d+)#/), r = n ? n[1] : null; return { content: t.map((e, t) => e.match(/#\d+#/) ? /* @__PURE__ */ (0, j.jsx)("div", { className: "efp-button-badge", children: r }, t) : /* @__PURE__ */ (0, j.jsx)("span", { children: e }, t)), hasBadge: !!r }; }, N = ({ children: e, inline: t = !1, text: n, link: r, target: i = "_self", disabled: a = !1, variant: o = "primary", size: s = "lg", ariaLabel: c, title: l, withBadge: u = !1, round: d, onClick: f }) => { let p = e == null ? n : e, { content: m, hasBadge: h } = u && typeof p == "string" ? M(p) : { content: p, hasBadge: !1 }, g = (0, A.default)("efp-button", `efp-button--${o}`, `efp-button--${s}`, { "efp-button--inline": t, "is-disabled": a, "efp-button--round": d }); return r ? /* @__PURE__ */ (0, j.jsx)("a", { href: a ? void 0 : r, className: g, target: i, rel: "noopener noreferrer", onClick: a ? void 0 : f, onKeyDown: (e) => { a || e.key !== " " || (e.preventDefault(), e.currentTarget.click()); }, "aria-label": c || void 0, title: l || c || (typeof p == "string" ? p : void 0), role: "button", "aria-disabled": a, tabIndex: a ? -1 : 0, children: m }) : /* @__PURE__ */ (0, j.jsx)("button", { type: "button", className: g, disabled: a, onClick: f, "aria-label": c || void 0, title: l || c || (typeof p == "string" ? p : void 0), children: m }); }; //#endregion export { x as i, S as n, O as r, N as t }; ;/* vite-per-chunk-css */ __vite_inject_css__(".efp-button,a.efp-button{justify-content:center;align-items:center;gap:calc(.375rem * var(--ui-scale));width:100%;max-width:calc(25rem * var(--ui-scale));border-radius:var(--border-radius-full);font-family:var(--app-font-family);font-weight:var(--font-weight-medium);cursor:pointer;border:0;outline:none;text-decoration:none;transition:background-color .1s ease-in-out;display:flex}.efp-button:hover,a.efp-button:hover{background:var(--color-primary-dark);color:var(--color-white)}.efp-button:active,a.efp-button:active{box-shadow:0 0 8px #3d91f74d}.efp-button:disabled,.efp-button--disabled,a.efp-button:disabled,a.efp-button--disabled{background:var(--color-gray-500);pointer-events:none}.efp-button:disabled:hover,.efp-button:disabled:active,.efp-button--disabled:hover,.efp-button--disabled:active,a.efp-button:disabled:hover,a.efp-button:disabled:active,a.efp-button--disabled:hover,a.efp-button--disabled:active{background:var(--color-gray-500);box-shadow:unset}.efp-button--primary,a.efp-button--primary{background:var(--color-primary);color:var(--color-white)}.efp-button--primary .efp-button-badge,a.efp-button--primary .efp-button-badge,.efp-button--primary:hover,.efp-button--primary:active,a.efp-button--primary:hover,a.efp-button--primary:active{background:var(--color-primary-dark);color:var(--color-white)}.efp-button--primary:hover .efp-button-badge,.efp-button--primary:active .efp-button-badge,a.efp-button--primary:hover .efp-button-badge,a.efp-button--primary:active .efp-button-badge{background:var(--color-primary-ultra-dark)}.efp-button--secondary,a.efp-button--secondary{background:var(--color-primary-ultra-light);color:var(--color-primary)}.efp-button--secondary .efp-button-badge,a.efp-button--secondary .efp-button-badge{background:var(--color-white);color:var(--color-primary)}.efp-button--secondary:hover,.efp-button--secondary:active,a.efp-button--secondary:hover,a.efp-button--secondary:active{background:var(--color-primary-ultra-light);color:var(--color-primary-dark)}.efp-button--secondary:hover .efp-button-badge,.efp-button--secondary:active .efp-button-badge,a.efp-button--secondary:hover .efp-button-badge,a.efp-button--secondary:active .efp-button-badge{color:var(--color-primary-dark)}.efp-button--gray,a.efp-button--gray{background:var(--color-gray-200);color:var(--color-black)}.efp-button--gray .efp-button-badge,a.efp-button--gray .efp-button-badge,.efp-button--gray:hover,.efp-button--gray:active,a.efp-button--gray:hover,a.efp-button--gray:active{background:var(--color-gray-300);color:var(--color-black)}.efp-button--gray:disabled,.efp-button--gray--disabled,a.efp-button--gray:disabled,a.efp-button--gray--disabled,.efp-button--gray:disabled:hover,.efp-button--gray:disabled:active,.efp-button--gray--disabled:hover,.efp-button--gray--disabled:active,a.efp-button--gray:disabled:hover,a.efp-button--gray:disabled:active,a.efp-button--gray--disabled:hover,a.efp-button--gray--disabled:active{background:var(--color-gray-100);color:var(--color-gray-400)}.efp-viewer-mode .efp-button--gray,.efp-viewer-mode a.efp-button--gray{background:#ebeef3}.efp-button--gray-border,a.efp-button--gray-border{background:var(--color-white);border:1px solid var(--color-gray-300);color:var(--color-black)}.efp-button--gray-border .efp-button-badge,a.efp-button--gray-border .efp-button-badge{background:var(--color-gray-200);color:var(--color-black)}.efp-button--gray-border:hover,.efp-button--gray-border:active,a.efp-button--gray-border:hover,a.efp-button--gray-border:active{background:var(--color-gray-300);color:var(--color-black)}.efp-button--gray-border:hover .efp-button-badge,.efp-button--gray-border:active .efp-button-badge,a.efp-button--gray-border:hover .efp-button-badge,a.efp-button--gray-border:active .efp-button-badge{background:var(--color-gray-400)}.efp-button--ghost,a.efp-button--ghost{color:var(--color-gray-900);background:0 0;border:0}.efp-button--ghost .efp-button-badge,a.efp-button--ghost .efp-button-badge,.efp-button--ghost:hover,.efp-button--ghost:active,a.efp-button--ghost:hover,a.efp-button--ghost:active{background:var(--color-gray-200);color:var(--color-black)}.efp-button--ghost:hover .efp-button-badge,.efp-button--ghost:active .efp-button-badge,a.efp-button--ghost:hover .efp-button-badge,a.efp-button--ghost:active .efp-button-badge{background:var(--color-gray-300)}.efp-button--lg,a.efp-button--lg{min-width:calc(10rem * var(--ui-scale));min-height:calc(2.625rem * var(--ui-scale));padding:calc(.5rem * var(--ui-scale)) calc(1.25rem * var(--ui-scale));font-size:var(--font-size-xl)}.efp-button--lg .efp-button-badge,a.efp-button--lg .efp-button-badge{min-width:calc(1.875rem * var(--ui-scale));height:calc(1.875rem * var(--ui-scale));font-size:var(--font-size-md)}.efp-viewer-mode .efp-button--lg,.efp-viewer-mode a.efp-button--lg{min-height:calc(3.5rem * var(--ui-scale));font-size:calc(1.125rem * var(--ui-scale));font-weight:var(--font-weight-bold)}.efp-button--md,a.efp-button--md{min-width:calc(8.75rem * var(--ui-scale));min-height:calc(2.375rem * var(--ui-scale));padding:calc(.375rem * var(--ui-scale)) calc(1.125rem * var(--ui-scale));font-size:var(--font-size-lg)}.efp-button--md .efp-button-badge,a.efp-button--md .efp-button-badge{min-width:calc(1.625rem * var(--ui-scale));height:calc(1.625rem * var(--ui-scale));font-size:var(--font-size-md)}.efp-button--sm,a.efp-button--sm{min-width:calc(6.25rem * var(--ui-scale));min-height:calc(1.875rem * var(--ui-scale));padding:calc(.25rem * var(--ui-scale)) calc(1rem * var(--ui-scale));font-size:var(--font-size-md)}.efp-button--sm .efp-button-badge,a.efp-button--sm .efp-button-badge{min-width:calc(1.375rem * var(--ui-scale));height:calc(1.375rem * var(--ui-scale));font-size:var(--font-size-xs)}.efp-button--inline,a.efp-button--inline{width:auto;min-width:auto;display:inline-flex}.efp-button--round,a.efp-button--round{width:auto;min-width:auto;height:auto;min-height:auto;padding:calc(.5rem * var(--ui-scale))}.efp-button--round i,a.efp-button--round i{font-size:var(--icon-size-xs)}.efp-button--danger,a.efp-button--danger{background:var(--color-red);color:var(--color-white)}.efp-button--danger:hover,.efp-button--danger:active,a.efp-button--danger:hover,a.efp-button--danger:active{background:var(--color-red-dark)}.efp-button>i,a.efp-button>i{font-size:var(--icon-size-sm)}.efp-button-badge{padding:0 calc(.3125rem * var(--ui-scale));border-radius:var(--border-radius-full);justify-content:center;align-items:center;transition:background-color .1s ease-in-out;display:flex}\n/*$vite$:1*/", "Button.css", false);