"use strict";

function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// GHS CRM — Instellingen › Statussen & termijnen.
// Per module: welke statussen bestaan (rechtstreeks uit de modules gelezen, dus
// altijd in sync) en welke termijnen haar opvolging bepalen (instelbaar).
// Zie status-registry.jsx voor de regel achter dit scherm.

/* Per reden voor opvolging: hoe lang ze mag wachten, vanaf wanneer ze dringend
   wordt en in welke bak ze standaard valt. Leeg = precies zoals de code het doet. */
var GhsRedenRegels = function GhsRedenRegels(_ref) {
  var mod = _ref.mod,
    items = _ref.items,
    d = _ref.d,
    krap = _ref.krap;
  var RG = 'minmax(130px,1.5fr) 86px 104px 154px 34px';
  var veld = function veld(it, sleutel, plaats, titel) {
    return /*#__PURE__*/React.createElement("input", {
      type: "number",
      min: "0",
      max: "365",
      title: titel,
      placeholder: plaats,
      value: d.regel(mod, it.id)[sleutel] != null ? d.regel(mod, it.id)[sleutel] : '',
      onChange: function onChange(e) {
        return d.zetRegel(mod, it.id, sleutel, e.target.value);
      },
      style: {
        width: '100%',
        minWidth: 0,
        textAlign: 'center',
        background: T.bg0,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(5),
        padding: '6px 4px',
        color: T.fg1,
        fontFamily: T.fontDisplay,
        fontSize: 13,
        fontWeight: 600,
        fontVariantNumeric: 'tabular-nums'
      }
    });
  };
  var bak = function bak(it) {
    return /*#__PURE__*/React.createElement("select", {
      value: d.regel(mod, it.id).prio != null ? d.regel(mod, it.id).prio : '',
      title: "In welke bak deze reden standaard valt",
      onChange: function onChange(e) {
        return d.zetRegel(mod, it.id, 'prio', e.target.value);
      },
      style: {
        width: '100%',
        minWidth: 0,
        background: T.bg0,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(5),
        padding: '6px 8px',
        color: T.fg1,
        fontFamily: T.fontBody,
        fontSize: 11.5,
        fontWeight: 600,
        cursor: 'pointer'
      }
    }, /*#__PURE__*/React.createElement("option", {
      value: ""
    }, "zoals de code"), Object.keys(window.GHS_PRIO_LBL || {}).map(function (p) {
      return /*#__PURE__*/React.createElement("option", {
        key: p,
        value: p
      }, window.GHS_PRIO_LBL[p]);
    }));
  };
  var eigenN = items.filter(function (it) {
    return window.ghsSoortEigen && window.ghsSoortEigen(mod, it.id);
  }).length;
  var kop = function kop(tekst, titel) {
    return /*#__PURE__*/React.createElement("span", {
      title: titel,
      style: {
        fontFamily: T.fontBody,
        fontSize: 9,
        fontWeight: 700,
        letterSpacing: '0.12em',
        textTransform: 'uppercase',
        color: T.fg4,
        textAlign: 'center'
      }
    }, tekst);
  };
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      flexDirection: 'column',
      gap: 6
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 11,
      color: T.fg3,
      lineHeight: 1.5,
      marginBottom: 2
    }
  }, "Per reden: ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.fg2
    }
  }, "wacht"), " = zoveel dagen zwijgen voor ze een taak wordt \xB7 ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.fg2
    }
  }, "dringend na"), " = vanaf zoveel dagen \u201Cnu doen\u201D \xB7 ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.fg2
    }
  }, "bak"), " = waar ze standaard in valt. Leeg laten = zoals de module het nu doet."), !krap && /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: RG,
      gap: 10,
      padding: '0 11px'
    }
  }, /*#__PURE__*/React.createElement("span", null), kop('Wacht', 'Aantal dagen voor deze reden een taak wordt'), kop('Dringend na', 'Vanaf zoveel dagen wordt ze “nu doen”'), kop('Bak'), /*#__PURE__*/React.createElement("span", null)), items.map(function (it, ri) {
    var eigen = window.ghsSoortEigen ? window.ghsSoortEigen(mod, it.id) : false;
    var naam = /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 7,
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 8,
        height: 8,
        flex: 'none',
        background: it.kleur || T.fg3,
        clipPath: cutPath(2)
      }
    }), /*#__PURE__*/React.createElement("span", {
      title: it.id,
      style: {
        fontFamily: T.fontBody,
        fontSize: 12,
        fontWeight: 600,
        color: T.fg1,
        minWidth: 0,
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        whiteSpace: 'nowrap'
      }
    }, it.label));
    var terug = eigen ? /*#__PURE__*/React.createElement("button", {
      type: "button",
      title: "Terug naar standaard",
      onClick: function onClick() {
        return d.herstelRegel(mod, it.id);
      },
      style: {
        width: 28,
        height: 28,
        flex: 'none',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        background: T.bg2,
        border: "1px solid ".concat(T.stroke1),
        clipPath: cutPath(5),
        cursor: 'pointer'
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: "refresh",
      size: 11,
      color: T.fg2
    })) : /*#__PURE__*/React.createElement("span", null);
    var omhulsel = {
      padding: '8px 11px',
      background: eigen ? 'rgba(0,217,0,0.06)' : T.bg1,
      border: "1px solid ".concat(eigen ? T.strokeAccent : T.stroke1),
      clipPath: cutPath(7)
    };
    return krap ? /*#__PURE__*/React.createElement("div", {
      key: it.id + ':' + ri,
      style: _objectSpread(_objectSpread({}, omhulsel), {}, {
        display: 'flex',
        flexDirection: 'column',
        gap: 7
      })
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        alignItems: 'center',
        gap: 8
      }
    }, naam, /*#__PURE__*/React.createElement("span", {
      style: {
        marginLeft: 'auto',
        display: 'flex'
      }
    }, terug)), /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'grid',
        gridTemplateColumns: 'repeat(auto-fit,minmax(88px,1fr))',
        gap: 8
      }
    }, /*#__PURE__*/React.createElement("label", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 3,
        minWidth: 0
      }
    }, kop('Wacht'), veld(it, 'na', '0', 'Aantal dagen voor deze reden een taak wordt')), /*#__PURE__*/React.createElement("label", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 3,
        minWidth: 0
      }
    }, kop('Dringend na'), veld(it, 'dringendNa', '—', 'Vanaf zoveel dagen wordt ze “nu doen”')), /*#__PURE__*/React.createElement("label", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 3,
        minWidth: 0,
        gridColumn: '1 / -1'
      }
    }, kop('Bak'), bak(it)))) : /*#__PURE__*/React.createElement("div", {
      key: it.id + ':' + ri,
      style: _objectSpread(_objectSpread({}, omhulsel), {}, {
        display: 'grid',
        gridTemplateColumns: RG,
        gap: 10,
        alignItems: 'center'
      })
    }, naam, veld(it, 'na', '0', 'Aantal dagen voor deze reden een taak wordt'), veld(it, 'dringendNa', '—', 'Vanaf zoveel dagen wordt ze “nu doen”'), bak(it), terug);
  }), eigenN > 0 && /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      justifyContent: 'flex-end'
    }
  }, /*#__PURE__*/React.createElement(Button, {
    variant: "ghost",
    size: "sm",
    icon: "refresh",
    onClick: function onClick() {
      return d.regelsHerstel(mod);
    }
  }, "Alle redenen terugzetten")));
};

/* Eén termijn instellen: − waarde + eenheid. Hetzelfde onderdeel in Instellingen en in
   het dashboard (DshNormen): het schrijft altijd naar het register (ghsZetDrempel).
   groot = iPad-maat (40px knoppen). */
var GhsDrempelStepper = function GhsDrempelStepper(_ref2) {
  var id = _ref2.id,
    groot = _ref2.groot;
  if (window.useGhsDrempels) window.useGhsDrempels();
  var x = window.ghsDrempelDef ? window.ghsDrempelDef(id) : null;
  if (!x) return null;
  var w = window.ghsDrempel(id, x.std);
  var h = groot ? 40 : 30;
  /* Vaste standen (bv. de gewichten van de werkdruk): één rij knoppen, één gekozen. */
  if (x.keuzes) return /*#__PURE__*/React.createElement("div", {
    role: "radiogroup",
    "aria-label": x.label,
    style: {
      display: 'flex',
      gap: 2,
      padding: 3,
      background: T.bg0,
      border: "1px solid ".concat(T.stroke1),
      borderRadius: 4,
      width: groot ? '100%' : undefined,
      boxSizing: 'border-box'
    }
  }, x.keuzes.map(function (k) {
    var on = w === k.w;
    return /*#__PURE__*/React.createElement("button", {
      key: k.w,
      type: "button",
      role: "radio",
      "aria-checked": on,
      title: k.label,
      onClick: function onClick() {
        return window.ghsZetDrempel(id, k.w);
      },
      style: {
        flex: groot ? '1 1 0' : 'none',
        minWidth: 0,
        minHeight: groot ? 38 : 26,
        padding: groot ? '0 8px' : '0 9px',
        background: on ? 'rgba(0,217,0,0.14)' : 'transparent',
        border: 'none',
        borderRadius: 5,
        cursor: 'pointer',
        fontFamily: T.fontBody,
        fontSize: groot ? 12.5 : 11.5,
        fontWeight: on ? 700 : 600,
        color: on ? T.accent : T.fg3,
        whiteSpace: 'nowrap'
      }
    }, groot ? k.label : k.kort);
  }));
  var knop = function knop(uit) {
    return {
      width: h,
      height: h,
      flex: 'none',
      background: T.bg2,
      border: "1px solid ".concat(T.stroke1),
      clipPath: cutPath(5),
      cursor: uit ? 'default' : 'pointer',
      color: uit ? T.fg4 : T.fg1,
      fontFamily: T.fontDisplay,
      fontSize: groot ? 18 : 15,
      lineHeight: 1
    };
  };
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 7
    }
  }, /*#__PURE__*/React.createElement("button", {
    type: "button",
    title: "Minder",
    "aria-label": "".concat(x.label, ": minder"),
    onClick: function onClick() {
      return window.ghsZetDrempel(id, w - 1);
    },
    disabled: w <= x.min,
    style: knop(w <= x.min)
  }, "\u2212"), /*#__PURE__*/React.createElement("input", {
    type: "number",
    "aria-label": x.label,
    value: w,
    min: x.min,
    max: x.max,
    onChange: function onChange(e) {
      return window.ghsZetDrempel(id, e.target.value);
    },
    style: {
      width: groot ? 72 : 62,
      height: groot ? h : undefined,
      boxSizing: 'border-box',
      textAlign: 'center',
      background: T.bg0,
      border: "1px solid ".concat(T.stroke1),
      clipPath: cutPath(5),
      padding: '7px 4px',
      color: T.fg1,
      fontFamily: T.fontDisplay,
      fontSize: groot ? 16 : 14,
      fontWeight: 600,
      fontVariantNumeric: 'tabular-nums'
    }
  }), /*#__PURE__*/React.createElement("button", {
    type: "button",
    title: "Meer",
    "aria-label": "".concat(x.label, ": meer"),
    onClick: function onClick() {
      return window.ghsZetDrempel(id, w + 1);
    },
    disabled: w >= x.max,
    style: knop(w >= x.max)
  }, "+"), /*#__PURE__*/React.createElement("span", {
    style: {
      fontFamily: T.fontBody,
      fontSize: groot ? 12.5 : 11,
      color: T.fg3,
      whiteSpace: 'nowrap'
    }
  }, x.eenheid));
};
var GhsStatusInstellingen = function GhsStatusInstellingen() {
  var d = window.useGhsDrempels ? window.useGhsDrempels() : null;
  var overzicht = window.ghsStatusOverzicht ? window.ghsStatusOverzicht() : [];
  var scan = window.ghsStatusScan ? window.ghsStatusScan() : null;
  /* Vanuit een module (knop Instellingen) opent meteen het deel van die module. */
  var _React$useState = React.useState(function () {
      var v = null;
      try {
        v = sessionStorage.getItem('ghs_status_open');
        sessionStorage.removeItem('ghs_status_open');
      } catch (e) {}
      return v && overzicht.some(function (m) {
        return m.id === v;
      }) ? v : overzicht.length ? overzicht[0].id : null;
    }),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    open = _React$useState2[0],
    setOpen = _React$useState2[1];
  var naarOpen = React.useRef(open && overzicht.length && open !== overzicht[0].id ? open : null);
  React.useEffect(function () {
    if (!naarOpen.current) return;
    var el = document.querySelector("[data-status-module=\"".concat(naarOpen.current, "\"]"));
    if (el && el.scrollIntoView) el.scrollIntoView({
      block: 'start'
    });
  }, []);
  var tier = window.useGhsTier ? window.useGhsTier() : null;
  var krap = !!(tier && tier.krap);
  if (!d || !scan) return null;
  /* Paginakop zoals de andere instellingen (InstKop): titel en uitleg, geen sectielijn. */
  var Schil = function Schil(_ref3) {
    var title = _ref3.title,
      sub = _ref3.sub,
      children = _ref3.children;
    return /*#__PURE__*/React.createElement("div", null, window.InstKop ? /*#__PURE__*/React.createElement(window.InstKop, {
      titel: title,
      sub: sub
    }) : null, children);
  };
  var kpi = function kpi(label, waarde, kleur) {
    return /*#__PURE__*/React.createElement("div", {
      key: label,
      style: {
        background: T.bg1,
        clipPath: cutPath(10),
        padding: '12px 15px',
        minWidth: 0
      }
    }, /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontDisplay,
        fontSize: 20,
        fontWeight: 700,
        color: kleur || T.fg1,
        lineHeight: 1.1
      }
    }, waarde), /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 10.5,
        fontWeight: 600,
        color: T.fg3,
        marginTop: 3
      }
    }, label));
  };
  return /*#__PURE__*/React.createElement(Schil, {
    title: "Statussen & termijnen",
    sub: "Elke module brengt haar eigen statussen mee; de termijnen eronder bepalen wanneer iets opvolging vraagt. Statussen worden live uit de modules gelezen \u2014 nieuwe statussen staan hier automatisch bij."
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'grid',
      gridTemplateColumns: 'repeat(auto-fit,minmax(170px,1fr))',
      gap: 10,
      marginBottom: 16
    }
  }, kpi('Modules', scan.modules), kpi('Statussen in beeld', scan.statussen), kpi('Redenen voor opvolging', scan.redenen), kpi('Instelbare termijnen', scan.drempels), kpi('Zelf aangepast', scan.aangepast, scan.aangepast ? T.accent : T.fg1)), scan.ontbrekendeBronnen.length > 0 && /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'flex-start',
      gap: 9,
      padding: '11px 13px',
      background: 'rgba(255,90,77,0.09)',
      border: '1px solid rgba(255,90,77,0.4)',
      clipPath: cutPath(8),
      marginBottom: 14
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "alert",
    size: 14,
    color: "#ff5a4d"
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      minWidth: 0
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 12,
      fontWeight: 700,
      color: '#ff5a4d'
    }
  }, scan.ontbrekendeBronnen.length, " woordenboek", scan.ontbrekendeBronnen.length === 1 ? '' : 'en', " niet gevonden"), /*#__PURE__*/React.createElement("div", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 11.5,
      color: T.fg2,
      marginTop: 2
    }
  }, scan.ontbrekendeBronnen.join(' · '), " \u2014 hernoemd of verwijderd in de code. Werk het register bij (status-registry.jsx), anders blijven die statussen onbeheerd."))), overzicht.map(function (m, mi) {
    var uit = open === m.id;
    var aangepast = m.drempels.filter(function (x) {
      return d.eigen(x.id);
    }).length + (m.redenen || []).filter(function (it) {
      return window.ghsSoortEigen && window.ghsSoortEigen(m.id, it.id);
    }).length;
    return /*#__PURE__*/React.createElement("div", {
      key: m.id + ':' + mi,
      "data-status-module": m.id,
      style: {
        scrollMarginTop: 22,
        border: "1px solid ".concat(uit ? m.kleur + '59' : T.stroke1),
        clipPath: cutPath(12),
        marginBottom: 12,
        background: T.bg0,
        overflow: 'hidden',
        transition: 'border-color 140ms'
      }
    }, /*#__PURE__*/React.createElement("button", {
      onClick: function onClick() {
        return setOpen(uit ? null : m.id);
      },
      style: {
        width: '100%',
        display: 'flex',
        alignItems: 'center',
        gap: 12,
        padding: '14px 16px',
        background: uit ? "".concat(m.kleur, "12") : 'transparent',
        border: 'none',
        cursor: 'pointer',
        textAlign: 'left'
      }
    }, /*#__PURE__*/React.createElement("span", {
      style: {
        width: 30,
        height: 30,
        flex: 'none',
        clipPath: cutPath(6),
        background: "".concat(m.kleur, "1a"),
        border: "1px solid ".concat(m.kleur, "55"),
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center'
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: m.icon,
      size: 14,
      color: m.kleur
    })), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontDisplay,
        fontSize: 14.5,
        fontWeight: 600,
        color: T.fg1,
        minWidth: 0
      }
    }, m.label), /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 11,
        color: T.fg3,
        whiteSpace: 'nowrap'
      }
    }, (m.redenen || []).length, " redenen \xB7 ", m.drempels.filter(function (x) {
      return !x.groep;
    }).length, " ", m.drempels.filter(function (x) {
      return !x.groep;
    }).length === 1 ? 'termijn' : 'termijnen', m.drempels.some(function (x) {
      return x.groep;
    }) ? ' · werkdruk' : ''), aangepast > 0 && /*#__PURE__*/React.createElement("span", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 10.5,
        fontWeight: 700,
        color: T.accent,
        background: 'rgba(0,217,0,0.12)',
        border: "1px solid ".concat(T.strokeAccent),
        borderRadius: 20,
        padding: '2px 9px',
        whiteSpace: 'nowrap'
      }
    }, aangepast, " aangepast"), /*#__PURE__*/React.createElement("span", {
      style: {
        marginLeft: 'auto',
        display: 'flex',
        flex: 'none'
      }
    }, /*#__PURE__*/React.createElement(Icon, {
      name: uit ? 'chevronup' : 'chevrondown',
      size: 14,
      color: T.fg3
    }))), uit && /*#__PURE__*/React.createElement("div", {
      style: {
        padding: '4px 16px 16px'
      }
    }, m.drempels.length === 0 ? /*#__PURE__*/React.createElement("div", {
      style: {
        fontFamily: T.fontBody,
        fontSize: 12,
        color: T.fg4,
        padding: '10px 0 14px'
      }
    }, "Deze module heeft geen termijnen: haar opvolging hangt volledig aan statussen en data, niet aan een aantal dagen.") : /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        flexDirection: 'column',
        gap: 8,
        marginBottom: 18
      }
    }, m.drempels.filter(function (x) {
      return !x.groep;
    }).concat(m.drempels.filter(function (x) {
      return x.groep;
    })).map(function (x, i, lijst) {
      var eigen = d.eigen(x.id);
      var kop = x.groep && (i === 0 || lijst[i - 1].groep !== x.groep);
      var std = x.keuzes ? (x.keuzes.find(function (k) {
        return k.w === x.std;
      }) || {}).kort || x.std : x.std;
      return /*#__PURE__*/React.createElement(React.Fragment, {
        key: x.id + ':' + i
      }, kop && /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: 8,
          marginTop: i ? 10 : 0
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 9.5,
          fontWeight: 700,
          letterSpacing: '0.16em',
          textTransform: 'uppercase',
          color: T.fg3
        }
      }, x.groep), /*#__PURE__*/React.createElement("span", {
        style: {
          flex: 1,
          height: 1,
          background: T.stroke1
        }
      })), /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'grid',
          gridTemplateColumns: 'minmax(180px,1.6fr) minmax(150px,auto) 92px',
          gap: 14,
          alignItems: 'center',
          padding: '11px 13px',
          background: eigen ? 'rgba(0,217,0,0.06)' : T.bg1,
          border: "1px solid ".concat(eigen ? T.strokeAccent : T.stroke1),
          clipPath: cutPath(8)
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          minWidth: 0
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 12.5,
          fontWeight: 700,
          color: T.fg1
        }
      }, x.label), /*#__PURE__*/React.createElement("div", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 11,
          color: T.fg3,
          marginTop: 2,
          lineHeight: 1.45
        }
      }, x.uitleg)), /*#__PURE__*/React.createElement(GhsDrempelStepper, {
        id: x.id
      }), /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          justifyContent: 'flex-end'
        }
      }, eigen ? /*#__PURE__*/React.createElement(Button, {
        variant: "ghost",
        size: "sm",
        icon: "refresh",
        onClick: function onClick() {
          return d.herstel(x.id);
        }
      }, "Standaard (", std, ")") : /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 10.5,
          color: T.fg4,
          whiteSpace: 'nowrap'
        }
      }, "standaard"))));
    }), aangepast > 0 && /*#__PURE__*/React.createElement("div", {
      style: {
        display: 'flex',
        justifyContent: 'flex-end'
      }
    }, /*#__PURE__*/React.createElement(Button, {
      variant: "ghost",
      size: "sm",
      icon: "refresh",
      onClick: function onClick() {
        return d.herstelAlles(m.id);
      }
    }, "Alle termijnen van ", m.label, " terugzetten"))), m.groepen.map(function (g, gi) {
      return /*#__PURE__*/React.createElement("div", {
        key: g.bron + ':' + gi,
        style: {
          marginBottom: 14
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          alignItems: 'center',
          gap: 8,
          marginBottom: 7
        }
      }, /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 9.5,
          fontWeight: 700,
          letterSpacing: '0.16em',
          textTransform: 'uppercase',
          color: T.fg3
        }
      }, g.label), /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 10,
          color: T.fg4
        }
      }, g.bron), /*#__PURE__*/React.createElement("span", {
        style: {
          flex: 1,
          height: 1,
          background: T.stroke1
        }
      }), g.items && /*#__PURE__*/React.createElement("span", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 10.5,
          color: T.fg4
        }
      }, g.items.length)), !g.items ? /*#__PURE__*/React.createElement("div", {
        style: {
          fontFamily: T.fontBody,
          fontSize: 11.5,
          color: '#ff5a4d'
        }
      }, "Woordenboek niet gevonden \u2014 bijwerken in status-registry.jsx.") : /reden/i.test(g.label) ? /*#__PURE__*/React.createElement(GhsRedenRegels, {
        mod: m.id,
        items: g.items,
        d: d,
        krap: krap
      }) : /*#__PURE__*/React.createElement("div", {
        style: {
          display: 'flex',
          flexWrap: 'wrap',
          gap: 6
        }
      }, g.items.map(function (it, ii) {
        return /*#__PURE__*/React.createElement("span", {
          key: it.id + ':' + ii,
          title: it.hint || it.id,
          style: {
            display: 'inline-flex',
            alignItems: 'center',
            gap: 6,
            padding: '5px 10px',
            background: it.kleur ? "".concat(it.kleur, "1a") : T.bg2,
            border: "1px solid ".concat(it.kleur ? it.kleur + '4d' : T.stroke1),
            borderRadius: 4,
            fontFamily: T.fontBody,
            fontSize: 11,
            fontWeight: 600,
            color: it.kleur || T.fg2
          }
        }, it.icon && /*#__PURE__*/React.createElement(Icon, {
          name: it.icon,
          size: 11,
          color: it.kleur || T.fg3
        }), it.label);
      })));
    })));
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'flex-start',
      gap: 9,
      padding: '11px 13px',
      background: T.bg1,
      border: "1px solid ".concat(T.stroke1),
      clipPath: cutPath(8),
      marginTop: 4
    }
  }, /*#__PURE__*/React.createElement(Icon, {
    name: "info",
    size: 14,
    color: T.fg3
  }), /*#__PURE__*/React.createElement("div", {
    style: {
      fontFamily: T.fontBody,
      fontSize: 11.5,
      color: T.fg3,
      lineHeight: 1.5
    }
  }, "Statussen staan hier omdat de modules ze aanleveren: komt er later een status bij, dan verschijnt ze automatisch in deze lijst. Een nieuw ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.fg2
    }
  }, "getal"), " dat bepaalt wanneer iets opvolging vraagt, hoort in ", /*#__PURE__*/React.createElement("strong", {
    style: {
      color: T.fg2
    }
  }, "status-registry.jsx"), " \u2014 dan is het hier meteen instelbaar in plaats van hard in de code te zitten.")));
};
Object.assign(window, {
  GhsStatusInstellingen: GhsStatusInstellingen,
  GhsRedenRegels: GhsRedenRegels,
  GhsDrempelStepper: GhsDrempelStepper
});