@reventlessdev/reventless-host-shell 3.0.0-alpha.88 → 3.0.0-alpha.89

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.
@@ -1,11 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CIZ1gHoH.js","assets/GraphMode.res-DTTNn7pT.js","assets/GraphView.res-DrjueKSk.js","assets/StateMachineDiagram.res-B5gZ8z4Z.js","assets/MapMode.res-BZ2EEQhC.js","assets/Geocoder.res-DyJpd-ZD.js"])))=>i.map(i=>d[i]);
2
- import"./virtualExposes-DN39MDG_.js";import{d as e}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-Dep87C4a.js";import{_ as t}from"./preload-helper-BhLMWRjL.js";import{_ as n}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DysgZ6xd.js";import{_ as r,a as i,b as o}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CkYd2Guw.js";import{a as s,b as a,c as l,d as c,e as u,f as d,g as f,h,i as p,j as g,k as m,l as v,m as y,n as _,o as b,p as x,q as S}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-BS-h5UZc.js";import{a as w,b as E}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-B8MMWKQv.js";import{c as k,_ as A}from"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-BBGkOHMQ.js";function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DWrxCvCs.js";function N(e,t){for(var n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r&&!Array.isArray(r))for(const t in r)if("default"!==t&&!(t in e)){const n=Object.getOwnPropertyDescriptor(r,t);n&&Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function T(e){return void 0===e?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==e&&void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function R(e){return null==e?void 0:T(e)}function D(e){if(null===e||void 0===e.BS_PRIVATE_NESTED_SOME_NONE)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;return 0===t?void 0:{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();let I="JsExn";function F(e){return function(e){return null!=e&&"string"==typeof e.RE_EXN_ID}(e)?e:{RE_EXN_ID:"JsExn",_1:e}}let O=["map","graph"];function P(e,t){if(void 0!==e&&t(D(e)))return e}function M(e,t){if(void 0!==e)return t(D(e))}function L(e,t,n){return void 0!==e?n(D(e)):t}function z(e,t){if(void 0!==e)return T(t(D(e)))}function j(e,t){if(void 0!==e)return t(D(e))}function U(e,t){return void 0!==e?D(e):t}function B(e,t){return void 0!==e?e:t}function $(e){return void 0!==e}function q(e){return void 0===e}function G(e){switch(e){case"":case"/":return 0;default:let t=e.slice(1),n="/"===t[t.length-1|0]?t.slice(0,-1):t,r=n.split("?",2),i=(2!==r.length?n:r[0]).split("/").filter(e=>0!==e.length),o=i.length-1|0,s=0;for(;;){let e=s,t=o;if(t<0)return e;s={hd:i[t],tl:e},o=t-1|0}}}function V(e,t){let n=globalThis.window;return void 0!==e?G(e):void 0!==n?G(D(n).location.pathname):0}function K(){let e=globalThis.window;if(void 0===e)return"";let t=D(e).location.hash;switch(t){case"":case"#":return"";default:return t.slice(1)}}function W(e){switch(e){case"":case"?":return"";default:let t=e.split("?",2);return 2!==t.length?"":t[1]}}function H(e,t){let n=globalThis.window;return void 0!==e?W(e):void 0!==n?W(D(n).location.search):""}function J(e){let t=globalThis.history,n=globalThis.window;if(void 0!==t&&void 0!==n)return D(t).pushState(null,"",e),void D(n).dispatchEvent(function(e){if("function"==typeof Event)return new Event(e);let t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}("popstate"))}function X(e,t){return{path:V(e),hash:K(),search:H(e)}}function Q(e,t){let n=s(()=>X(void 0)),r=n[1],i=n[0];return a(()=>{let e=function(e){let t=globalThis.window;if(void 0===t)return()=>{};let n=()=>e(X(void 0));return D(t).addEventListener("popstate",n),n}(e=>r(t=>e)),t=X(void 0);return function(e,t){if(e.hash!==t.hash||e.search!==t.search)return!0;{let n=e.path,r=t.path;for(;;){let e=r,t=n;if(0===t)return 0!==e;if(0===e)return!0;if(t.hd!==e.hd)return!0;r=e.tl,n=t.tl}}}(t,i)&&r(e=>t),()=>function(e){let t=globalThis.window;void 0===t||D(t).removeEventListener("popstate",e)}(e)},[]),i}let Y=X,Z=l({prefix:"",path:""});function ee(e,t){return""===e||t.startsWith(e)?t:e+t}let te=Z.Provider;let ne=function(e){return c(te,{value:e.value,children:e.children})},re="popstate";function ie(){let e=globalThis.window;return void 0!==e?D(e).location.pathname:""}function oe(e){let t=globalThis.window;if(void 0===t)return()=>{};let n=D(t);return n.addEventListener(re,e),()=>{n.removeEventListener(re,e)}}function se(e,t){return u(oe,ie,()=>U(e,""))}function ae(){let e=d(Z).prefix;return t=>J(ee(e,t))}function le(){let e=d(Z).path,t=se(void 0);return""===e?t:e}function ce(e,t){return e.catch(e=>t(F(e)))}function ue(e,t){return e===t?0:e<t?-1:1}function de(e,t){return e<t?-1:e===t?0:1}function fe(e,t){if(0===t)throw{RE_EXN_ID:"Division_by_zero",Error:new Error};return e%t}function he(e,t){if(e<=0)return[];let n=new Array(e);return n.fill(t),n}function pe(e,t){if(e<=0)return[];let n=new Array(e);for(let r=0;r<e;++r)n[r]=t(r);return n}function ge(e,t,n){return e.reduce(n,t)}function me(e,t){let n=e.length,r=new Array(n),i=0;for(let o=0;o<n;++o){let n=t(e[o]);void 0!==n&&(r[i]=D(n),i=i+1|0)}return r.length=i,r}function ve(e,t){let n=e.length,r=new Array(n),i=0;for(let o=0;o<n;++o){let n=t(e[o],o);void 0!==n&&(r[i]=D(n),i=i+1|0)}return r.length=i,r}function ye(e,t){let n=parseInt(e);return Number.isNaN(n)||n>2147483647||n<-2147483648?void 0:0|n}function _e(e,t){if(0===e)return t;let n={hd:e.hd,tl:0};return(function(e,t){for(;;){let n=t,r=e;if(0===r)return n;let i={hd:r.hd,tl:0};n.tl=i,t=i,e=r.tl}}(e.tl,n)).tl=t,n}function be(e){let t=e.length-1|0,n=0;for(;;){let r=n,i=t;if(i<0)return r;n={hd:e[i],tl:r},t=i-1|0}}function xe(e){let t=function(e){let t=e,n=0;for(;;){if(0===t)return n;n=n+1|0,t=t.tl}}(e),n=new Array(t);return function(e,t,n){for(;;){let r=n,i=t;if(0===r)return;e[i]=r.hd,n=r.tl,t=i+1|0}}(n,0,e),n}function Se(e){return function(e,t){for(;;){let n=t,r=e;if(0===r)return n;t={hd:r.hd,tl:n},e=r.tl}}(e,0)}function we(e,t,n){for(;;){let r=e;if(0===r)return t;t=n(t,r.hd),e=r.tl}}let Ee=function(e,t,n){let r=t;for(let i=0,o=e.length;i<o;++i)r=n(r,e[i]);return r};function ke(e){return void 0!==e?e.h:0}function Ce(e,t,n,r){let i=ke(e),o=ke(r);return{k:t,v:n,h:i>=o?i+1|0:o+1|0,l:e,r:r}}function Ae(e,t,n,r){let i=void 0!==e?e.h:0,o=void 0!==r?r.h:0;if(i>(o+2|0)){let i=e.l,o=e.r;return ke(i)>=ke(o)?Ce(i,e.k,e.v,Ce(o,t,n,r)):Ce(Ce(i,e.k,e.v,o.l),o.k,o.v,Ce(o.r,t,n,r))}if(o<=(i+2|0))return{k:t,v:n,h:i>=o?i+1|0:o+1|0,l:e,r:r};let s=r.l,a=r.r;return ke(a)>=ke(s)?Ce(Ce(e,t,n,s),r.k,r.v,a):Ce(Ce(e,t,n,s.l),s.k,s.v,Ce(s.r,r.k,r.v,a))}function Ne(e,t,n){if(void 0===e)return function(e,t){return{k:e,v:t,h:1,l:void 0,r:void 0}}(t,n);let r=e.k;if(t===r)return function(e,t){return e.v===t?e:{k:e.k,v:t,h:e.h,l:e.l,r:e.r}}(e,n);let i=e.v;return t<r?Ae(Ne(e.l,t,n),r,i,e.r):Ae(e.l,r,i,Ne(e.r,t,n))}let Te=function(e,t){for(;;){let n=e;if(void 0===n)return;let r=n.k;if(t===r)return T(n.v);e=t<r?n.l:n.r}};function Re(e){let t=e=>{switch(e){case"":case"/":return 0;default:let t=be(e.split("/"));return 0!==t&&""===t.hd?t.tl:t}},n=e.indexOf("?");return-1===n?t(e):0===n?0:t(e.slice(0,n))}let De={parsers:0,children:void 0,capture:void 0,wildcard:!1};function Ie(e,t){return{TAG:"Match",_0:e,_1:t}}function Fe(e){return"object"!=typeof e?"End"===e?0:{hd:"Wildcard",tl:0}:"Match"===e.TAG?{hd:{TAG:"Match",_0:e._0},tl:Fe(e._1)}:{hd:"Capture",tl:Fe(e._1)}}function Oe(e,t,n){let r=e,i=t,o=0,s=n;for(;;){let e=s,t=o,n=i,a=r;if("object"!=typeof a)return"End"===a?0!==e?""===e.hd&&0===e.tl?{TAG:"MatchWithTrailingSlash",_0:n}:"NoMatch":{TAG:"FullMatch",_0:n}:{TAG:"FullMatch",_0:n({prefix:Se(t),matched:e})};if("Match"===a.TAG){if(0===e)return"NoMatch";let n=e.hd;if(a._0!==n)return"NoMatch";s=e.tl,o={hd:n,tl:t},r=a._1;continue}if(0===e)return"NoMatch";let l=e.hd,c=a._0.from_(l);if(void 0===c)return"NoMatch";s=e.tl,o={hd:l,tl:t},i=n(D(c)),r=a._1}}function Pe(e){return we(Se(e),De,(e,t)=>function(e,t,n){let r=(e,n)=>{if(0===e)return{parsers:{hd:t,tl:n.parsers},children:n.children,capture:n.capture,wildcard:n.wildcard};let i=n.capture,o=n.children,s=e.tl,a=e.hd;if("object"!=typeof a){if("Capture"!==a)return{parsers:{hd:t,tl:n.parsers},children:n.children,capture:n.capture,wildcard:!0};let e=r(s,void 0!==i?i:De);return{parsers:n.parsers,children:n.children,capture:e,wildcard:n.wildcard}}{let e=a._0,t=Te(o,e),i=r(s,void 0!==t?t:De);return{parsers:n.parsers,children:Ne(o,e,i),capture:n.capture,wildcard:n.wildcard}}};return r(e,n)}(Fe(t._0),t,e))}function Me(e,t){let n=Re(t),r=function(e,t){let n=e,r=t;for(;;){let e=r,t=n,i=t.parsers,o=0;if(0!==i)o=1;else{if(0===e)return 0;o=1}if(1===o){let o=t.capture,s=0;if(0===e)return i;if(""===e.hd){if(0===e.tl)return i;s=2}else s=2;if(2===s){if(t.wildcard)return i;let s=e.tl,a=Te(t.children,e.hd);if(void 0!==a){r=s,n=a;continue}if(void 0===o)return 0;r=s,n=o;continue}}}}(e,n),i=r;for(;;){let e=i;if(0===e)return"NoMatch";let t=e.hd,r=t._2,o=Oe(t._0,t._1,n);if("object"==typeof o)return"FullMatch"===o.TAG?{TAG:"FullMatch",_0:r(o._0)}:{TAG:"MatchWithTrailingSlash",_0:r(o._0)};i=e.tl}}function Le(e){return e("End")}let ze={prefix:function(e){return xe({hd:"",tl:e.prefix}).join("/")},wildcard_match:function(e){return xe({hd:"",tl:e.matched}).join("/")},of_parts:function(e){return{prefix:0,matched:Re(e)}}},je=function(e){return function(e,t){let n=(e,t)=>{for(;;){let r=t,i=e;if("object"!=typeof r)return"End"===r?i(0):e=>i(_e(e.matched,0));if("Match"===r.TAG){let n=r._0;t=r._1,e=e=>i({hd:n,tl:e});continue}let o=r._1,s=r._0.to_;return e=>n(t=>i({hd:s(e),tl:t}),o)}};return n(t=>e("/"+xe(t).join("/")),t)}(e=>e,e)},Ue=function(e,t){return{TAG:"Route",_0:e,_1:t,_2:e=>e}};let Be=l({});function $e(e,t){return Object.assign(Object.assign({},e),t)}function qe(){return d(Be)}let Ge=Be.Provider;let Ve=function(e){return c(Ge,{value:e.registry,children:e.children})},Ke={contents:{}};function We(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;let t=function(e){let t=function(e){return e.startsWith("/")?e.slice(1):e}(e);return z(ge(Object.entries(Ke.contents),void 0,(e,n)=>{let r=n[0];if(!t.startsWith(r+"/"))return e;let i=n[1];return void 0!==e&&e[0].length>=r.length?e:[r,i]}),e=>e[1])}(e);if(void 0===t)return e;let n=e.startsWith("/")?e:"/"+e;return(t.endsWith("/")?t.slice(0,t.length-1|0):t)+n}let He={bool:function(e){if("boolean"==typeof e)return e},$$null:function(e){if(null===e)return null},string:function(e){if("string"==typeof e)return e},float:function(e){if("number"==typeof e)return e},object:function(e){if("object"==typeof e&&null!==e&&!Array.isArray(e))return e},array:function(e){if(Array.isArray(e))return e}};function Je(e,t){if(t in e)return T(e[t])}function Xe(e){let t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i<n;++i){let n=t[i];r[i]=[n,e[n]]}return r}function Qe(e){let t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function Ye(e){let t={},n=e.length;for(let r=0;r<n;++r){let n=e[r];t[n[0]]=n[1]}return t}let Ze=/[^aeiou]y$/i;function et(e){return e.endsWith("ies")?e.slice(0,e.length-3|0)+"y":e.endsWith("ses")||e.endsWith("xes")||e.endsWith("zes")||e.endsWith("ches")||e.endsWith("shes")?e.slice(0,e.length-2|0):e.endsWith("s")?e.slice(0,e.length-1|0):e}function tt(e){return function(e){return Ze.test(e)?e.slice(0,e.length-1|0)+"ies":e.endsWith("s")||e.endsWith("x")||e.endsWith("z")||e.endsWith("ch")||e.endsWith("sh")?e+"es":e+"s"}(et(e))}let nt=Ye([["id","ID"],["ids","IDs"],["url","URL"],["uri","URI"],["api","API"],["arn","ARN"],["aws","AWS"],["iam","IAM"],["sqs","SQS"],["sns","SNS"],["uuid","UUID"],["ip","IP"],["dns","DNS"],["http","HTTP"],["https","HTTPS"],["json","JSON"],["xml","XML"],["sql","SQL"],["ui","UI"],["ux","UX"]]);function rt(e){return e===e.toUpperCase()&&e!==e.toLowerCase()}function it(e){return e===e.toLowerCase()&&e!==e.toUpperCase()}function ot(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return!0;default:return!1}}function st(e){let t=e.toLowerCase(),n=Je(nt,t);return void 0!==n?n:0===e.length?"":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function at(e){let t=function(e){let t=e.length,n=[],r={contents:""},i=()=>{if(r.contents.length>0)return n.push(r.contents),void(r.contents="")};for(let o=0;o<t;++o){let n=e.charAt(o);if("_"===n||"-"===n||" "===n)i();else if(rt(n)){let s=o>0&&it(e.charAt(o-1|0)),a=(o+1|0)<t&&it(e.charAt(o+1|0)),l=o>0&&rt(e.charAt(o-1|0));(s||l&&a)&&i(),r.contents=r.contents+n}else if(ot(n)){let t=!1;if(o>0){let n=e.charAt(o-1|0);t=rt(n)||it(n)}t&&i(),r.contents=r.contents+n}else r.contents=r.contents+n}return i(),n}(e);return 0!==t.length?t.map(st).join(" "):e}let lt=et;function ct(e){let t=typeof e;return"string"===t?{TAG:"JSONString",_0:e}:"number"===t?{TAG:"JSONNumber",_0:e}:"boolean"===t?!0===e?"JSONTrue":"JSONFalse":null===e?"JSONNull":Array.isArray(e)?{TAG:"JSONArray",_0:e}:{TAG:"JSONObject",_0:e}}function ut(e){if("string"==typeof e)return e}function dt(e){if("number"==typeof e)return e}function ft(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return e}function ht(e){if(Array.isArray(e))return e}function pt(e){if("boolean"==typeof e)return e}let gt=function(e,t){for(var n in e)t(n)};function mt(e,t){if(e===t)return!0;let n=typeof e;if("string"===n||"number"===n||"bigint"===n||"boolean"===n||"undefined"===n||null===e)return!1;let r=typeof t;if("function"===n||"function"===r)throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if("number"===r||"bigint"===r||"undefined"===r||null===t)return!1;if(e.TAG!==t.TAG)return!1;let i=0|e.length;if(i!==(0|t.length))return!1;if(!Array.isArray(e)){if(e instanceof Date&&t instanceof Date)return!(e>t||e<t);{let n={contents:!0},r=e=>{Object.prototype.hasOwnProperty.call(t,e)||(n.contents=!1)},i=r=>{Object.prototype.hasOwnProperty.call(e,r)&&mt(t[r],e[r])||(n.contents=!1)};return gt(e,r),n.contents&&gt(t,i),n.contents}}{let n=0;for(;;){let r=n;if(r===i)return!0;if(!mt(e[r],t[r]))return!1;n=r+1|0}}}function vt(e,t){return"number"!=typeof e&&"bigint"!=typeof e||"number"!=typeof t&&"bigint"!=typeof t?!mt(e,t):e!==t}let yt={background:"--rv-color-background",surface:"--rv-color-surface",surfaceSubtle:"--rv-color-surface-subtle",surfaceElevated:"--rv-color-surface-elevated",brand:"--rv-color-brand",brandSubtle:"--rv-color-brand-subtle",success:"--rv-color-success",warning:"--rv-color-warning",error:"--rv-color-error",info:"--rv-color-info",textPrimary:"--rv-color-text-primary",textSecondary:"--rv-color-text-secondary",textDisabled:"--rv-color-text-disabled",textOnBrand:"--rv-color-text-on-brand",border:"--rv-color-border",borderSubtle:"--rv-color-border-subtle"},_t={xs:"--rv-spacing-xs",sm:"--rv-spacing-sm",md:"--rv-spacing-md",lg:"--rv-spacing-lg",xl:"--rv-spacing-xl",xxl:"--rv-spacing-xxl"},bt={fontFamily:"--rv-font-family",fontFamilyMono:"--rv-font-family-mono",sizeXs:"--rv-font-size-xs",sizeSm:"--rv-font-size-sm",sizeMd:"--rv-font-size-md",sizeLg:"--rv-font-size-lg",sizeXl:"--rv-font-size-xl",sizeXxl:"--rv-font-size-xxl",weightNormal:"--rv-font-weight-normal",weightMedium:"--rv-font-weight-medium",weightBold:"--rv-font-weight-bold",lineHeightTight:"--rv-line-height-tight",lineHeightNormal:"--rv-line-height-normal",lineHeightRelaxed:"--rv-line-height-relaxed"},xt={sm:"--rv-radius-sm",md:"--rv-radius-md",lg:"--rv-radius-lg",full:"--rv-radius-full"},St="--rv-shadow-sm",wt="--rv-shadow-md",Et="--rv-shadow-lg";function kt(e){switch(e){case"Wide":return 0;case"Compact":return 1;case"Narrow":return 2;case"Tight":return 3}}let Ct={compact:"(max-width: 1024px)",narrow:"(max-width: 720px)",tight:"(max-width: 520px)",bandRank:kt,atLeastAsNarrow:function(e,t){return kt(e)>=kt(t)},bandName:function(e){switch(e){case"Wide":return"wide";case"Compact":return"compact";case"Narrow":return"narrow";case"Tight":return"tight"}},bandOfName:function(e){switch(e){case"compact":return"Compact";case"narrow":return"Narrow";case"tight":return"Tight";case"wide":return"Wide";default:return}}},At="x-reventless-union",Nt="x-reventless-union-member";function Tt(e){let t,n=Je(e,At);if(void 0!==n){let e=ut(n);t=void 0!==e?e:j(j(ft(n),e=>Je(e,"name")),ut)}else t=void 0;return j(t,e=>""===e?void 0:e)}function Rt(e){return j(j(Je(e,Nt),ut),e=>""===e?void 0:e)}function Dt(e){return j(ft(e),e=>j(j(Je(e,"properties"),ft),t=>z(j(j(j(Je(t,"TAG"),ft),e=>Je(e,"const")),ut),n=>({tag:n,memberType:Rt(e),properties:Ye(Xe(t).filter(e=>"TAG"!==e[0]))}))))}function It(e){return j(ft(e),e=>ge(["oneOf","anyOf"],void 0,(t,n)=>void 0!==t?t:j(j(Je(e,n),ht),t=>{let n=t.filter(e=>!mt(j(j(ft(e),e=>Je(e,"type")),ut),"null")),r=n.length;if(1===r)return It(n[0]);if(0===r)return;let i=me(n,Dt);return i.length===n.length?{name:Tt(e),arms:i}:void 0})))}function Ft(e,t){let n=t.memberType;return void 0!==n?n:z(e.name,e=>e+t.tag)}function Ot(e,t){let n=e.arms.find(n=>n.tag===t||mt(Ft(e,n),t));if(void 0!==n)return n;let r=e.arms.filter(e=>t.endsWith(e.tag));return 1!==r.length?void 0:r[0]}function Pt(e){return Ye([["type","object"],["properties",e.properties]])}function Mt(e){let t=ft(e);if(void 0===t)return e;let n=Je(t,"type"),r=Je(t,"properties");return void 0!==n||void 0!==r||$(It(e))?e:U(z(ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(Je(t,n),ht),e=>e.find(e=>vt(j(j(ft(e),e=>Je(e,"type")),ut),"null")))),Mt),e)}function Lt(e){return j(ft(Mt(e)),e=>{if("array"===j(Je(e,"type"),ut))return z(Je(e,"items"),Mt)})}let zt={initial:"initial",inherit_:"inherit_",unset:"unset",toString:function(e){return"inherit_"===e?"inherit":"unset"===e?"unset":"initial"}};function jt(e){return t="--",e.startsWith(t)?e:"--"+e;var t}function Ut(e){if("var"===e.NAME)return"var("+jt(e.VAL)+")";let t=e.VAL;return"var("+jt(t[0])+","+t[1]+")"}let Bt={s:function(e){return{NAME:"s",VAL:e}},ms:function(e){return{NAME:"ms",VAL:e}},toString:function(e){return"ms"===e.NAME?e.VAL.toString()+"ms":e.VAL.toString()+"s"}};function $t(e){return e.VAL.toString()+"%"}function qt(e){if("object"!=typeof e)return"0";let t=e.NAME;return"inch"===t?e.VAL.toString()+"in":"vmax"===t?e.VAL.toString()+"vmax":"vmin"===t?e.VAL.toString()+"vmin":"percent"===t?e.VAL.toString()+"%":"ch"===t?e.VAL.toString()+"ch":"cm"===t?e.VAL.toString()+"cm":"em"===t?e.VAL.toString()+"em":"ex"===t?e.VAL.toString()+"ex":"mm"===t?e.VAL.toString()+"mm":"pc"===t?e.VAL.toString()+"pc":"pt"===t?e.VAL.toString()+"pt":"px"===t?e.VAL.toString()+"px":"vh"===t?e.VAL.toString()+"vh":"vw"===t?e.VAL.toString()+"vw":"rem"===t?e.VAL.toString()+"rem":e.VAL.toString()+"px"}let Gt={ch:function(e){return{NAME:"ch",VAL:e}},em:function(e){return{NAME:"em",VAL:e}},ex:function(e){return{NAME:"ex",VAL:e}},rem:function(e){return{NAME:"rem",VAL:e}},vh:function(e){return{NAME:"vh",VAL:e}},vw:function(e){return{NAME:"vw",VAL:e}},vmin:function(e){return{NAME:"vmin",VAL:e}},vmax:function(e){return{NAME:"vmax",VAL:e}},px:function(e){return{NAME:"px",VAL:e}},pxFloat:function(e){return{NAME:"pxFloat",VAL:e}},cm:function(e){return{NAME:"cm",VAL:e}},mm:function(e){return{NAME:"mm",VAL:e}},inch:function(e){return{NAME:"inch",VAL:e}},pc:function(e){return{NAME:"pc",VAL:e}},pt:function(e){return{NAME:"pt",VAL:e}},zero:"zero",toString:qt};let Vt={min:function(e,t){return{NAME:"min",VAL:[e,t]}},max:function(e,t){return{NAME:"max",VAL:[e,t]}},toString:function e(t){if("object"!=typeof t)return qt(t);let n=t.NAME;if("subtract"===n){let n=t.VAL;return"calc("+e(n[0])+" - "+e(n[1])+")"}if("percent"===n)return $t(t);if("add"===n){let n=t.VAL;return"calc("+e(n[0])+" + "+e(n[1])+")"}if("div"===n){let n=t.VAL;return"calc("+e(n[0])+" / "+n[1].toString()+")"}if("max"===n){let n=t.VAL;return"max("+e(n[0])+", "+e(n[1])+")"}if("min"===n){let n=t.VAL;return"min("+e(n[0])+", "+e(n[1])+")"}if("mul"!==n)return qt(t);let r=t.VAL;return"calc("+e(r[0])+" * "+r[1].toString()+")"}};let Kt={absolute:"absolute",relative:"relative",$$static:"static",fixed:"fixed",sticky:"sticky",toString:function(e){return"fixed"===e?"fixed":"static"===e?"static":"sticky"===e?"sticky":"relative"===e?"relative":"absolute"}};let Wt={hidden:"hidden",visible:"visible",scroll:"scroll",auto:"auto",clip:"clip",toString:function(e){return"clip"===e?"clip":"scroll"===e?"scroll":"hidden"===e?"hidden":"visible"===e?"visible":"auto"}};let Ht={auto:"auto",toString:function(e){return"auto"}};let Jt={toString:function(e){return"none"===e?"none":"circle"===e?"circle":"lowerGreek"===e?"lower-greek":"square"===e?"square":"lowerAlpha"===e?"lower-alpha":"upperAlpha"===e?"upper-alpha":"decimal"===e?"decimal":"lowerRoman"===e?"lower-roman":"lowerLatin"===e?"lower-latin":"upperRoman"===e?"upper-roman":"upperLatin"===e?"upper-latin":"disc"}};let Xt={toString:function(e){return"object"==typeof e?e.VAL.toString():"infinite"}};let Qt={auto:"auto",$$default:"default",none:"none",contextMenu:"contextMenu",help:"help",pointer:"pointer",progress:"progress",wait:"wait",cell:"cell",crosshair:"crosshair",text:"text",verticalText:"verticalText",alias:"alias",copy:"copy",move:"move",noDrop:"noDrop",notAllowed:"notAllowed",grab:"grab",grabbing:"grabbing",allScroll:"allScroll",colResize:"colResize",rowResize:"rowResize",nResize:"nResize",eResize:"eResize",sResize:"sResize",wResize:"wResize",neResize:"neResize",nwResize:"nwResize",seResize:"seResize",swResize:"swResize",ewResize:"ewResize",nsResize:"nsResize",neswResize:"neswResize",nwseResize:"nwseResize",zoomIn:"zoomIn",zoomOut:"zoomOut",toString:function(e){return"cell"===e?"cell":"copy"===e?"copy":"swResize"===e?"sw-resize":"grab"===e?"grab":"help"===e?"help":"move"===e?"move":"none"===e?"none":"text"===e?"text":"rowResize"===e?"row-resize":"wait"===e?"wait":"pointer"===e?"pointer":"seResize"===e?"se-resize":"zoomOut"===e?"zoom-out":"sResize"===e?"s-resize":"zoomIn"===e?"zoom-in":"grabbing"===e?"grabbing":"nsResize"===e?"ns-resize":"nwseResize"===e?"nwse-resize":"progress"===e?"progress":"crosshair"===e?"crosshair":"wResize"===e?"w-resize":"noDrop"===e?"no-drop":"allScroll"===e?"all-scroll":"verticalText"===e?"vertical-text":"nResize"===e?"n-resize":"default"===e?"default":"neswResize"===e?"nesw-resize":"alias"===e?"alias":"ewResize"===e?"ew-resize":"eResize"===e?"e-resize":"nwResize"===e?"nw-resize":"contextMenu"===e?"context-menu":"colResize"===e?"col-resize":"notAllowed"===e?"not-allowed":"neResize"===e?"ne-resize":"auto"}};function Yt(e){let t=e.NAME;return"var"===t||"varDefault"===t?Ut(e):function(e){let t=e.NAME;return"turn"===t?e.VAL.toString()+"turn":"deg"===t?e.VAL.toString()+"deg":"rad"===t?e.VAL.toString()+"rad":e.VAL.toString()+"grad"}(e)}function Zt(e){let t=e.NAME;return"percent"===t?$t(e):"num"===t?e.VAL.toString():Ut(e)}function en(e){return"percent"===e.NAME?$t(e):Ut(e)}function tn(e){if("object"!=typeof e)return"transparent"===e?"transparent":"currentColor";let t=e.NAME;if("rgba"===t){let t=e.VAL;return"rgba("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+", "+Zt(t[3])+")"}if("hex"===t)return"#"+e.VAL;if("hsl"===t){let t=e.VAL;return"hsl("+Yt(t[0])+", "+en(t[1])+", "+en(t[2])+")"}if("rgb"===t){let t=e.VAL;return"rgb("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+")"}let n=e.VAL;return"hsla("+Yt(n[0])+", "+en(n[1])+", "+en(n[2])+", "+Zt(n[3])+")"}let nn={toString:function(e){return"hidden"===e?"hidden":"ridge"===e?"ridge":"solid"===e?"solid":"outset"===e?"outset":"groove"===e?"groove":"dashed"===e?"dashed":"dotted"===e?"dotted":"double"===e?"double":"inset"===e?"inset":"none"}};let rn={toString:function(e){return"object"==typeof e?e.VAL.toString():"normal"}};let on={toString:function(e){return"inline"===e?"inline":"block"===e?"block":"run-in"}};let sn={toString:function(e){return"grid"===e?"grid":"table"===e?"table":"flex"}};let an={toString:function(e){return"list-item"}};let ln={toString:function(e){return"tableRow"===e?"table-row":"tableRowGroup"===e?"table-row-group":"tableColumn"===e?"table-column":"tableHeaderGroup"===e?"table-header-group":"tableCell"===e?"table-cell":"tableColumnGroup"===e?"table-column-group":"tableCaption"===e?"table-caption":"table-footer-group"}};let cn={toString:function(e){return"contents"===e?"contents":"none"}};let un={toString:function(e){return"inlineBlock"===e?"inline-block":"inlineFlex"===e?"inline-flex":"inlineGrid"===e?"inline-grid":"inline-table"}};let dn={toString:function(e){return"left"===e?"left":"right"===e?"right":"selfEnd"===e?"self-end":"start"===e?"start":"center"===e?"center":"flexStart"===e?"flex-start":"flexEnd"===e?"flex-end":"selfStart"===e?"self-start":"end"}};let fn={toString:function(e){return"firstBaseline"===e?"first baseline":"baseline"===e?"baseline":"last baseline"}};let hn={toString:function(e){return"normal"}};let pn={toString:function(e){return"spaceAround"===e?"space-around":"stretch"===e?"stretch":"spaceBetween"===e?"space-between":"space-evenly"}};let gn={toString:function(e){return"right"===e?"right":"justify"===e?"justify":"start"===e?"start":"center"===e?"center":"left"}};let mn={toString:function(e){return"normal"===e?"normal":"stretch"}};let vn={toString:function(e){return"stretch"===e?"stretch":"normal"===e?"normal":"auto"}};let yn={toString:function(e){return"wrapReverse"===e?"wrap-reverse":"nowrap"===e?"nowrap":"wrap"}};let _n={toString:function(e){return"row"===e?"row":"columnReverse"===e?"column-reverse":"rowReverse"===e?"row-reverse":"column"}};let bn={toString:function(e){return"none"===e?"none":"text"===e?"text":"all"===e?"all":"contain"===e?"contain":"auto"}};let xn={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}};let Sn={toString:function(e){return"none"}};let wn={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}},En={$$var:function(e){return{NAME:"var",VAL:e}},varDefault:function(e,t){return{NAME:"varDefault",VAL:[e,t]}},toString:Ut},kn={linear:"linear",ease:"ease",easeIn:"easeIn",easeOut:"easeOut",easeInOut:"easeInOut",stepStart:"stepStart",stepEnd:"stepEnd",steps:function(e,t){return{NAME:"steps",VAL:[e,t]}},cubicBezier:function(e,t,n,r){return{NAME:"cubicBezier",VAL:[e,t,n,r]}},jumpStart:"jumpStart",jumpEnd:"jumpEnd",jumpNone:"jumpNone",jumpBoth:"jumpBoth",toString:function(e){if("object"!=typeof e)return"easeInOut"===e?"ease-in-out":"linear"===e?"linear":"jumpBoth"===e?"jump-both":"stepStart"===e?"step-start":"jumpNone"===e?"jump-none":"stepEnd"===e?"step-end":"easeIn"===e?"ease-in":"jumpEnd"===e?"jump-end":"jumpStart"===e?"jump-start":"easeOut"===e?"ease-out":"ease";if("steps"===e.NAME){let t=e.VAL,n=t[0];return"start"===t[1]?"steps("+n.toString()+", start)":"steps("+n.toString()+", end)"}let t=e.VAL;return"cubic-bezier("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+", "+t[3].toString()+")"}},Cn={rgb:function(e,t,n){return{NAME:"rgb",VAL:[e,t,n]}},rgba:function(e,t,n,r){return{NAME:"rgba",VAL:[e,t,n,r]}},hsl:function(e,t,n){return{NAME:"hsl",VAL:[e,t,n]}},hsla:function(e,t,n,r){return{NAME:"hsla",VAL:[e,t,n,r]}},hex:function(e){return{NAME:"hex",VAL:e}},transparent:"transparent",currentColor:"currentColor",toString:function(e){if("object"!=typeof e)return tn(e);if("lightDark"!==e.NAME)return tn(e);let t=e.VAL;return"light-dark("+tn(t[0])+", "+tn(t[1])+")"}},An=Sn,Nn=Sn,Tn=Sn,Rn=Sn,Dn=Cn.transparent;function In(e,t){switch(t.TAG){case"D":let n=t._1,r=t._0;e[r]="content"===r&&""===n?'""':n;break;case"S":e[t._0]=Fn(t._1);break;case"PseudoClass":e[":"+t._0]=Fn(t._1);break;case"PseudoClassParam":e[":"+t._0+"("+t._1+")"]=Fn(t._2)}return e}function Fn(e){return Ee(e,{},In)}function On(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):"auto";let t=e.NAME;return"var"===t||"varDefault"===t?En.toString(e):Vt.toString(e)}function Pn(e){if("object"!=typeof e)return Cn.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?En.toString(e):Cn.toString(e)}function Mn(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):Ht.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?En.toString(e):Vt.toString(e)}let Ln=Gt.px;function zn(e){return"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):nn.toString(e)}var jn=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(pU){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Un="-ms-",Bn="-moz-",$n="-webkit-",qn="comm",Gn="rule",Vn="decl",Kn="@keyframes",Wn=Math.abs,Hn=String.fromCharCode,Jn=Object.assign;function Xn(e){return e.trim()}function Qn(e,t,n){return e.replace(t,n)}function Yn(e,t){return e.indexOf(t)}function Zn(e,t){return 0|e.charCodeAt(t)}function er(e,t,n){return e.slice(t,n)}function tr(e){return e.length}function nr(e){return e.length}function rr(e,t){return t.push(e),e}var ir=1,or=1,sr=0,ar=0,lr=0,cr="";function ur(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:ir,column:or,length:s,return:""}}function dr(e,t){return Jn(ur("",null,null,"",null,null,0),e,{length:-e.length},t)}function fr(){return lr=ar>0?Zn(cr,--ar):0,or--,10===lr&&(or=1,ir--),lr}function hr(){return lr=ar<sr?Zn(cr,ar++):0,or++,10===lr&&(or=1,ir++),lr}function pr(){return Zn(cr,ar)}function gr(){return ar}function mr(e,t){return er(cr,e,t)}function vr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function yr(e){return ir=or=1,sr=tr(cr=e),ar=0,[]}function _r(e){return cr="",e}function br(e){return Xn(mr(ar-1,wr(91===e?e+2:40===e?e+1:e)))}function xr(e){for(;(lr=pr())&&lr<33;)hr();return vr(e)>2||vr(lr)>3?"":" "}function Sr(e,t){for(;--t&&hr()&&!(lr<48||lr>102||lr>57&&lr<65||lr>70&&lr<97););return mr(e,gr()+(t<6&&32==pr()&&32==hr()))}function wr(e){for(;hr();)switch(lr){case e:return ar;case 34:case 39:34!==e&&39!==e&&wr(lr);break;case 40:41===e&&wr(e);break;case 92:hr()}return ar}function Er(e,t){for(;hr()&&e+lr!==57&&(e+lr!==84||47!==pr()););return"/*"+mr(t,ar-1)+"*"+Hn(47===e?e:hr())}function kr(e){for(;!vr(pr());)hr();return mr(e,ar)}function Cr(e){return _r(Ar("",null,null,null,[""],e=yr(e),0,[0],e))}function Ar(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,d=s,f=0,h=0,p=0,g=1,m=1,v=1,y=0,_="",b=i,x=o,S=r,w=_;m;)switch(p=y,y=hr()){case 40:if(108!=p&&58==Zn(w,d-1)){-1!=Yn(w+=Qn(br(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:w+=br(y);break;case 9:case 10:case 13:case 32:w+=xr(p);break;case 92:w+=Sr(gr()-1,7);continue;case 47:switch(pr()){case 42:case 47:rr(Tr(Er(hr(),gr()),t,n),l);break;default:w+="/"}break;case 123*g:a[c++]=tr(w)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(w=Qn(w,/\f/g,"")),h>0&&tr(w)-d&&rr(h>32?Rr(w+";",r,n,d-1):Rr(Qn(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(rr(S=Nr(w,t,n,c,u,i,a,_,b=[],x=[],d),o),123===y)if(0===u)Ar(w,t,S,S,b,o,d,a,x);else switch(99===f&&110===Zn(w,3)?100:f){case 100:case 108:case 109:case 115:Ar(e,S,S,r&&rr(Nr(e,S,S,0,0,i,a,_,i,b=[],d),x),i,x,d,a,r?b:x);break;default:Ar(w,S,S,S,[""],x,0,a,x)}}c=u=h=0,g=v=1,_=w="",d=s;break;case 58:d=1+tr(w),h=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==fr())continue;switch(w+=Hn(y),y*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(tr(w)-1)*v,v=1;break;case 64:45===pr()&&(w+=br(hr())),f=pr(),u=d=tr(_=w+=kr(gr())),y++;break;case 45:45===p&&2==tr(w)&&(g=0)}}return o}function Nr(e,t,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=0===i?o:[""],h=nr(f),p=0,g=0,m=0;p<r;++p)for(var v=0,y=er(e,d+1,d=Wn(g=s[p])),_=e;v<h;++v)(_=Xn(g>0?f[v]+" "+y:Qn(y,/&\f/g,f[v])))&&(l[m++]=_);return ur(e,t,n,0===i?Gn:a,l,c,u)}function Tr(e,t,n){return ur(e,t,n,qn,Hn(lr),er(e,2,-2),0)}function Rr(e,t,n,r){return ur(e,t,n,Vn,er(e,0,r),er(e,r+1,-1),r)}function Dr(e,t){for(var n="",r=nr(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Ir(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Vn:return e.return=e.return||e.value;case qn:return"";case Kn:return e.return=e.value+"{"+Dr(e.children,r)+"}";case Gn:e.value=e.props.join(",")}return tr(n=Dr(e.children,r))?e.return=e.value+"{"+n+"}":""}function Fr(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Or=function(e,t,n){for(var r=0,i=0;r=i,i=pr(),38===r&&12===i&&(t[n]=1),!vr(i);)hr();return mr(e,ar)},Pr=function(e,t){return _r(function(e,t){var n=-1,r=44;do{switch(vr(r)){case 0:38===r&&12===pr()&&(t[n]=1),e[n]+=Or(ar-1,t,n);break;case 2:e[n]+=br(r);break;case 4:if(44===r){e[++n]=58===pr()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Hn(r)}}while(r=hr());return e}(yr(e),t))},Mr=new WeakMap,Lr=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Mr.get(n))&&!r){Mr.set(e,!0);for(var i=[],o=Pr(t,i),s=n.props,a=0,l=0;a<o.length;a++)for(var c=0;c<s.length;c++,l++)e.props[l]=i[a]?o[a].replace(/&\f/g,s[c]):s[c]+" "+o[a]}}},zr=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function jr(e,t){switch(function(e,t){return 45^Zn(e,0)?(((t<<2^Zn(e,0))<<2^Zn(e,1))<<2^Zn(e,2))<<2^Zn(e,3):0}(e,t)){case 5103:return $n+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return $n+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $n+e+Bn+e+Un+e+e;case 6828:case 4268:return $n+e+Un+e+e;case 6165:return $n+e+Un+"flex-"+e+e;case 5187:return $n+e+Qn(e,/(\w+).+(:[^]+)/,$n+"box-$1$2"+Un+"flex-$1$2")+e;case 5443:return $n+e+Un+"flex-item-"+Qn(e,/flex-|-self/,"")+e;case 4675:return $n+e+Un+"flex-line-pack"+Qn(e,/align-content|flex-|-self/,"")+e;case 5548:return $n+e+Un+Qn(e,"shrink","negative")+e;case 5292:return $n+e+Un+Qn(e,"basis","preferred-size")+e;case 6060:return $n+"box-"+Qn(e,"-grow","")+$n+e+Un+Qn(e,"grow","positive")+e;case 4554:return $n+Qn(e,/([^-])(transform)/g,"$1"+$n+"$2")+e;case 6187:return Qn(Qn(Qn(e,/(zoom-|grab)/,$n+"$1"),/(image-set)/,$n+"$1"),e,"")+e;case 5495:case 3959:return Qn(e,/(image-set\([^]*)/,$n+"$1$`$1");case 4968:return Qn(Qn(e,/(.+:)(flex-)?(.*)/,$n+"box-pack:$3"+Un+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$n+e+e;case 4095:case 3583:case 4068:case 2532:return Qn(e,/(.+)-inline(.+)/,$n+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(tr(e)-1-t>6)switch(Zn(e,t+1)){case 109:if(45!==Zn(e,t+4))break;case 102:return Qn(e,/(.+:)(.+)-([^]+)/,"$1"+$n+"$2-$3$1"+Bn+(108==Zn(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Yn(e,"stretch")?jr(Qn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Zn(e,t+1))break;case 6444:switch(Zn(e,tr(e)-3-(~Yn(e,"!important")&&10))){case 107:return Qn(e,":",":"+$n)+e;case 101:return Qn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$n+(45===Zn(e,14)?"inline-":"")+"box$3$1"+$n+"$2$3$1"+Un+"$2box$3")+e}break;case 5936:switch(Zn(e,t+11)){case 114:return $n+e+Un+Qn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $n+e+Un+Qn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $n+e+Un+Qn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $n+e+Un+e+e}return e}var Ur=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Vn:e.return=jr(e.value,e.length);break;case Kn:return Dr([dr(e,{value:Qn(e.value,"@","@"+$n)})],r);case Gn:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Dr([dr(e,{props:[Qn(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Dr([dr(e,{props:[Qn(t,/:(plac\w+)/,":"+$n+"input-$1")]}),dr(e,{props:[Qn(t,/:(plac\w+)/,":-moz-$1")]}),dr(e,{props:[Qn(t,/:(plac\w+)/,Un+"input-$1")]})],r)}return""})}}],Br=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,o=e.stylisPlugins||Ur,s={},a=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;a.push(e)});var l,c,u=[Ir,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=nr(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}([Lr,zr].concat(o,u));i=function(e,t,n,r){l=n,Dr(Cr(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new jn({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return f.sheet.hydrate(a),f};var $r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},qr=/[A-Z]|^ms/g,Gr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Vr=function(e){return 45===e.charCodeAt(1)},Kr=function(e){return null!=e&&"boolean"!=typeof e},Wr=Fr(function(e){return Vr(e)?e:e.replace(qr,"-$&").toLowerCase()}),Hr=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Gr,function(e,t,n){return Xr={name:t,styles:n,next:Xr},t})}return 1===$r[e]||Vr(e)||"number"!=typeof t||0===t?t:t+"px"};function Jr(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return Xr={name:i.name,styles:i.styles,next:Xr},i.name;var o=n;if(void 0!==o.styles){var s=o.next;if(void 0!==s)for(;void 0!==s;)Xr={name:s.name,styles:s.styles,next:Xr},s=s.next;return o.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Jr(e,t,n[i])+";";else for(var o in n){var s=n[o];if("object"!=typeof s){var a=s;null!=t&&void 0!==t[a]?r+=o+"{"+t[a]+"}":Kr(a)&&(r+=Wr(o)+":"+Hr(o,a)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=Jr(e,t,s);switch(o){case"animation":case"animationName":r+=Wr(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<s.length;c++)Kr(s[c])&&(r+=Wr(o)+":"+Hr(o,s[c])+";")}return r}(e,t,n)}var a=n;if(null==t)return a;var l=t[a];return void 0!==l?l:a}var Xr,Qr=/label:\s*([^\s;{]+)\s*(;|$)/g;function Yr(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";Xr=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Jr(n,t,o)):i+=o[0];for(var s=1;s<e.length;s++){if(i+=Jr(n,t,e[s]),r)i+=o[s]}Qr.lastIndex=0;for(var a,l="";null!==(a=Qr.exec(i));)l+="-"+a[1];var c=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:Xr}}function Zr(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}function ei(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function ti(e,t,n){var r=[],i=Zr(e,r,n);return r.length<2?n:i+t(r)}var ni=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(null!=i){var o=void 0;switch(typeof i){case"boolean":break;case"object":if(Array.isArray(i))o=e(i);else for(var s in o="",i)i[s]&&s&&(o&&(o+=" "),o+=s);break;default:o=i}o&&(n&&(n+=" "),n+=o)}}return n},ri=function(e){var t=Br(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Yr(n,t.registered,void 0);return function(e,t){!function(e,t){var n=e.key+"-"+t.name;void 0===e.registered[n]&&(e.registered[n]=t.styles)}(e,t);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+n:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,i),t.key+"-"+i.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return ti(t.registered,n,ni(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Yr(n,t.registered);ei(t,i)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Yr(n,t.registered),o="animation-"+i.name;return ei(t,{name:i.name,styles:"@keyframes "+o+"{"+i.styles+"}"}),o},hydrate:function(e){e.forEach(function(e){t.inserted[e]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Zr.bind(null,t.registered),merge:ti.bind(null,t.registered,n)}}({key:"css"}),ii=ri.cx,oi=ri.injectGlobal,si=ri.keyframes,ai=ri.css;let li=function(e){let t=e=>Ee(e,{},(e,t)=>(e[t[0].toString()+"%"]=Fn(t[1]),e));return{insertRule:t=>e.injectRaw(t),renderRule:(t,n)=>e.renderRaw(t,n),global:(t,n)=>e.injectRules(t,Fn(n)),renderGlobal:(t,n,r)=>e.renderRules(t,n,Fn(r)),style:t=>e.make(Fn(t)),merge:t=>e.mergeStyles(t),merge2:(t,n)=>e.mergeStyles([t,n]),merge3:(t,n,r)=>e.mergeStyles([t,n,r]),merge4:(t,n,r,i)=>e.mergeStyles([t,n,r,i]),keyframes:n=>e.makeKeyframes(t(n)),renderKeyframes:(n,r)=>e.renderKeyframes(n,t(r))}}({injectRaw:e=>{oi(e)},renderRaw:function(e,t){oi(t)},injectRules:function(e,t){oi(Ye([[e,t]]))},renderRules:function(e,t,n){oi(Ye([[t,n]]))},make:e=>ai(e),mergeStyles:e=>ii(e),makeKeyframes:function(e){return si(e)},renderKeyframes:function(e,t){return si(t)}}),ci=function(e,t){return{TAG:"D",_0:e,_1:t}},ui=function(e){return{TAG:"D",_0:"alignItems",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?fn.toString(e):"normal"===e||"stretch"===e?mn.toString(e):dn.toString(e)}},di=function(e){return{TAG:"D",_0:"alignSelf",_1:"object"==typeof e?En.toString(e):"selfStart"===e||"flexEnd"===e||"flexStart"===e||"center"===e||"start"===e||"selfEnd"===e||"right"===e||"left"===e||"end_"===e?dn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?fn.toString(e):vn.toString(e)}},fi=function(e){return{TAG:"D",_0:"bottom",_1:On(e)}},hi=function(e){return{TAG:"D",_0:"cursor",_1:Qt.toString(e)}},pi=function(e){return{TAG:"D",_0:"display",_1:"object"==typeof e?En.toString(e):"table"===e||"grid"===e||"flex"===e?sn.toString(e):"contents"===e||"none"===e?cn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"inlineGrid"===e||"inlineFlex"===e||"inlineBlock"===e||"inlineTable"===e?un.toString(e):"block"===e||"inline"===e||"runIn"===e?on.toString(e):"listItem"===e?an.toString(e):ln.toString(e)}},gi=function(e){return{TAG:"D",_0:"flexDirection",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):_n.toString(e)}},mi=function(e){return{TAG:"D",_0:"flexGrow",_1:e.toString()}},vi=function(e){return{TAG:"D",_0:"flexShrink",_1:e.toString()}},yi=function(e){return{TAG:"D",_0:"flexWrap",_1:"object"==typeof e?En.toString(e):"nowrap"===e||"wrapReverse"===e||"wrap"===e?yn.toString(e):zt.toString(e)}},_i=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):wn.toString(e);return{TAG:"D",_0:"height",_1:t}},bi=function(e){return{TAG:"D",_0:"justifyContent",_1:"object"==typeof e?En.toString(e):"spaceBetween"===e||"stretch"===e||"spaceAround"===e||"spaceEvenly"===e?pn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"normal"===e?hn.toString(e):dn.toString(e)}},xi=function(e){return{TAG:"D",_0:"left",_1:On(e)}},Si=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):"abs"===n?rn.toString(e):Vt.toString(e)}else t="zero"===e?Vt.toString(e):"normal"===e?rn.toString(e):zt.toString(e);return{TAG:"D",_0:"lineHeight",_1:t}},wi=function(e){return{TAG:"D",_0:"listStyleType",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):Jt.toString(e)}},Ei=function(e){return{TAG:"D",_0:"margin",_1:Mn(e)}},ki=function(e,t){return{TAG:"D",_0:"margin",_1:Mn(e)+" "+Mn(t)}},Ci=function(e){return{TAG:"D",_0:"marginLeft",_1:Mn(e)}},Ai=function(e){return{TAG:"D",_0:"marginRight",_1:Mn(e)}},Ni=function(e){return{TAG:"D",_0:"marginTop",_1:Mn(e)}},Ti=function(e){return{TAG:"D",_0:"marginBottom",_1:Mn(e)}},Ri=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="none"===e?Tn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):wn.toString(e);return{TAG:"D",_0:"maxHeight",_1:t}},Di=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="none"===e?An.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):xn.toString(e);return{TAG:"D",_0:"maxWidth",_1:t}},Ii=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="none"===e?Rn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):wn.toString(e);return{TAG:"D",_0:"minHeight",_1:t}},Fi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="none"===e?Nn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):xn.toString(e);return{TAG:"D",_0:"minWidth",_1:t}},Oi=function(e){return{TAG:"D",_0:"opacity",_1:e.toString()}},Pi=function(e){return{TAG:"D",_0:"overflow",_1:Wt.toString(e)}},Mi=function(e){return{TAG:"D",_0:"overflowY",_1:Wt.toString(e)}},Li=function(e){return{TAG:"D",_0:"padding",_1:Vt.toString(e)}},zi=function(e,t){return{TAG:"D",_0:"padding",_1:Vt.toString(e)+" "+Vt.toString(t)}},ji=function(e){return{TAG:"D",_0:"position",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):Kt.toString(e)}},Ui=function(e){return{TAG:"D",_0:"right",_1:On(e)}},Bi=function(e){return{TAG:"D",_0:"textAlign",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):gn.toString(e)}},$i=function(e){return{TAG:"D",_0:"top",_1:On(e)}},qi=function(e){return{TAG:"D",_0:"userSelect",_1:"object"==typeof e?En.toString(e):"unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):bn.toString(e)}},Gi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?En.toString(e):Vt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?zt.toString(e):"zero"===e?Vt.toString(e):xn.toString(e);return{TAG:"D",_0:"width",_1:t}},Vi=function(e){return{TAG:"D",_0:"zIndex",_1:e.toString()}},Ki=function(e,t){return{TAG:"S",_0:e,_1:t}},Wi=function(e,t){return{TAG:"S",_0:"@media "+e,_1:t}},Hi=function(e){return{TAG:"PseudoClass",_0:"disabled",_1:e}},Ji=function(e){return{TAG:"PseudoClass",_0:"focus",_1:e}},Xi=function(e){return{TAG:"PseudoClass",_0:"focus-within",_1:e}},Qi=function(e){return{TAG:"PseudoClass",_0:"hover",_1:e}},Yi=function(e){return{TAG:"PseudoClass",_0:"last-child",_1:e}},Zi=function(e){return{TAG:"S",_0:"::placeholder",_1:e}},eo=Ln,to=function(e,t,n){return{TAG:"D",_0:"border",_1:Gt.toString(e)+" "+zn(t)+" "+Pn(n)}},no=function(e){return{TAG:"D",_0:"animationName",_1:e}},ro=function(e){return{TAG:"D",_0:"animationDuration",_1:Bt.toString(e)}},io=function(e){return{TAG:"D",_0:"animationIterationCount",_1:Xt.toString(e)}},oo=function(e){return{TAG:"D",_0:"animationTimingFunction",_1:kn.toString(e)}},so=Dn,ao=li.global,lo=li.style,co=li.merge,uo=li.keyframes;function fo(e){return"var("+e+")"}let ho=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",fo(_t.md)),mi(1),ci("min-height","200px"),Bi("center"),ci("padding",fo(_t.xxl))]),po=lo([ci("font-size","40px"),ci("color",fo(yt.textDisabled)),ci("line-height","1")]),go=lo([ci("color",fo(yt.textPrimary)),ci("font-size",fo(bt.sizeLg)),ci("font-weight",fo(bt.weightMedium)),Ei(eo(0))]),mo=lo([ci("color",fo(yt.textSecondary)),ci("font-size",fo(bt.sizeMd)),ci("max-width","360px"),Ei(eo(0))]),vo=lo([ci("background",fo(yt.brand)),ci("color",fo(yt.textOnBrand)),ci("border","none"),ci("border-radius",fo(xt.md)),ci("padding","var("+_t.sm+") var("+_t.lg+")"),ci("font-size",fo(bt.sizeMd)),ci("cursor","pointer"),Ni(eo(8))]);let yo=function(e){let t=e.title,n=void 0!==t?t:"Nothing here yet";return r("div",{children:[i("div",{children:"( )",className:po}),i("h3",{children:n,className:go}),L(e.description,null,e=>i("p",{children:e,className:mo})),L(e.action,null,e=>{let t=e[1];return i("button",{children:e[0],className:vo,onClick:e=>t()})})],className:ho})};function _o(e){return"var("+e+")"}let bo=lo([Gi({NAME:"percent",VAL:100}),ci("border-collapse","collapse"),ci("font-size",_o(bt.sizeMd))]),xo=lo([ci("background",_o(yt.surfaceSubtle)),ci("border-bottom","2px solid var("+yt.border+")")]),So=lo([ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("color",_o(yt.textSecondary)),ci("font-weight",_o(bt.weightMedium)),ci("font-size",_o(bt.sizeSm)),ci("text-align","left"),ci("white-space","nowrap"),ci("user-select","none")]),wo=lo([ci("padding","var("+_t.sm+") var("+_t.md+")"),ci("font-size",_o(bt.sizeMd))]),Eo=lo([hi("pointer"),Qi([ci("color",_o(yt.textPrimary))])]),ko=lo([ci("color",_o(yt.textPrimary))]),Co=lo([Ci(eo(4)),ci("font-size",_o(bt.sizeXs)),ci("color",_o(yt.brand))]),Ao=lo([ci("border-bottom","1px solid var("+yt.borderSubtle+")"),Qi([ci("background",_o(yt.surfaceSubtle))])]),No=lo([ci("min-height","44px")]),To=lo([hi("pointer")]),Ro=lo([ci("background",_o(yt.surfaceSubtle)),ci("box-shadow","inset 3px 0 0 0 var("+yt.brand+")")]),Do=lo([ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("color",_o(yt.textPrimary)),ci("vertical-align","middle")]),Io=lo([ci("padding","var("+_t.sm+") var("+_t.md+")")]),Fo=lo([Bi("center"),ci("padding",_o(_t.xxl))]);function Oo(e){let t=e.onSort,n=e.sortState,o="Comfortable"===e.density?So+" "+wo:So;return i("thead",{children:i("tr",{children:e.columns.map(e=>{let s=L(n,!1,t=>t.key===e.key),a=L(n,"Asc",e=>e.direction),l=e.sortable?o+" "+Eo+(s?" "+ko:""):o;return r("th",{children:[e.label,s?i("span",{children:"Asc"===a?"^":"v",className:Co}):null],className:l,style:L(e.width,{},e=>({width:e})),onClick:n=>{if(e.sortable)return M(t,t=>{let n=s&&"Asc"===a?"Desc":"Asc";t(e.key,n)})}},e.key)})}),className:xo})}let Po=function(e){let t=e.activeKey,n=e.density,o=e.onRowClick,s=e.keyFn,a=e.data,l=e.columns,c=void 0!==n?n:"Compact",u="Comfortable"===c?Do+" "+Io:Do,d="Comfortable"===c?Ao+" "+No:Ao;return r("table",{children:[i(Oo,{columns:l,sortState:e.sortState,onSort:e.onSort,density:c}),i("tbody",{children:0===a.length?i("tr",{children:i("td",{children:U(e.emptyView,i(yo,{title:"No data"})),className:u+" "+Fo,colSpan:l.length})}):a.map(e=>{let n=s(e),r=L(o,d,e=>d+" "+To),a=mt(t,n)?r+" "+Ro:r;return i("tr",{children:l.map(t=>i("td",{children:t.render(e),className:u},t.key)),className:a,onClick:t=>M(o,t=>t(e))},n)})})],className:bo})};function Mo(e){return e?{TAG:"Partial",_0:"FromStart"}:"Complete"}function Lo(e,t){return e.toString()+" "+t+(1===e?"":"s")}function zo(e,t,n,r){let i=void 0!==r?r:"item",o=U(n,t),s=o===t?Lo(o,i):o.toString()+" of "+Lo(t,i);if(void 0===e)return"Showing the "+s+" loaded";if("object"!=typeof e)return"Showing all "+s;switch(e._0){case"FromStart":return"Showing the first "+s+" — more available";case"Between":return"Showing "+s+" — more before and after";case"ToEnd":return"Showing the last "+s+" — more before"}}function jo(e,t){return t?e+"+":e}function Uo(e){switch(e){case"Small":return 20;case"Medium":return 28;case"Large":return 44}}let Bo=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74","#5e7c9c"];function $o(e){let t={contents:5381};return e.split("").forEach(e=>{let n=U(e.codePointAt(0),0);t.contents=(33*t.contents|0)+n&2147483647}),fe(t.contents,Bo.length)}function qo(e){let t=me(e.split(/[\s_.@-]+/),e=>e).filter(e=>""!==e),n=e=>e.slice(0,1).toUpperCase(),r=t[0],i=t[1];return void 0!==r?void 0!==i?n(r)+n(i):n(r):"?"}function Go(e){return"var("+e+")"}let Vo=lo([pi("inlineFlex"),ui("center"),bi("center"),ci("border-radius",Go(xt.full)),ci("color","#ffffff"),ci("font-family",Go(bt.fontFamily)),ci("font-weight",Go(bt.weightMedium)),ci("flex-shrink","0"),ci("user-select","none"),ci("vertical-align","middle"),ci("overflow","hidden")]),Ko=lo([ci("width","100%"),ci("height","100%"),ci("object-fit","cover")]);let Wo=function(e){let t=e.size,n=e.src,r=e.name,o=void 0!==t?t:"Medium",a=s(()=>!1),l=a[1],c=Uo(o),u=c.toString()+"px",d=void 0!==n&&(""!==n&&!a[0]),f={background:d?"transparent":Bo[$o(r)],fontSize:((c/2|0)-1|0).toString()+"px",height:u,width:u};return i("span",{children:d?i("img",{className:Ko,alt:r,src:U(n,""),onError:e=>l(e=>!0)}):qo(r),"aria-label":r,className:Vo,role:"img",style:f,title:r})};function Ho(e){return"var("+e+")"}let Jo=lo([pi("flex"),yi("wrap"),ci("gap",Ho(_t.xs)),ui("center")]),Xo=lo([pi("inlineFlex"),ui("center"),ci("padding","2px 8px"),ci("border-radius",Ho(xt.full)),ci("background",Ho(yt.surfaceElevated)),ci("color",Ho(yt.textSecondary)),ci("font-size",Ho(bt.sizeXs)),ci("font-weight",Ho(bt.weightMedium)),ci("line-height","1.5"),ci("white-space","nowrap")]),Qo=lo([ci("color",Ho(yt.textDisabled)),ci("font-size",Ho(bt.sizeSm))]);let Yo=function(e){let t=e.items;return 0===t.length?i("span",{children:"—",className:Qo}):i("div",{children:t.map((e,t)=>i("span",{children:e,className:Xo},t.toString()+":"+e)),className:Jo})};function Zo(e){return"var("+e+")"}let es=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("background","transparent"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",Zo(xt.sm)),ci("padding","1px 6px"),ci("color",Zo(yt.textSecondary)),ci("font-size",Zo(bt.sizeXs)),ci("line-height","1"),hi("pointer"),Qi([ci("background",Zo(yt.surfaceElevated)),ci("color",Zo(yt.textPrimary))])]),ts=lo([ci("color",Zo(yt.success)),ci("border-color",Zo(yt.success))]);let ns=function(e){let t=e.label,n=e.value,r=void 0!==t?t:"Copy",o=s(()=>!1),a=o[1],l=o[0];return i("button",{children:l?"Copied":r,"aria-label":"Copy to clipboard",className:l?es+" "+ts:es,type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),ce(navigator.clipboard.writeText(n).then(()=>(a(e=>!0),setTimeout(()=>a(e=>!1),1500),Promise.resolve())),e=>Promise.resolve())}})};function rs(e){return"var("+e+")"}let is=lo([pi("inlineFlex"),ui("center"),ci("gap",rs(_t.xs)),ci("min-width","0")]),os=lo([ci("color",rs(yt.brand)),ci("text-decoration","none"),ci("max-width","260px"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap"),Qi([ci("text-decoration","underline")])]),ss=lo([ci("color",rs(yt.textPrimary)),ci("font-family","var(--rv-font-mono, ui-monospace, monospace)"),ci("font-size",rs(bt.sizeSm)),ci("max-width","200px"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]);function as(e,t){return e.length>t?e.slice(0,6)+"…"+e.slice(e.length-4|0,e.length):e}let ls=function(e){let t=e.copyable,n=e.rawValue,o=e.label,s=e.href,a=void 0!==t&&t,l=ae();return r("span",{children:[void 0!==s?i("a",{children:o,className:os,title:o,href:s,onClick:e=>{if(!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button)&&void 0!==s)return e.preventDefault(),e.stopPropagation(),l(s)}}):i("span",{children:as(o,18),className:ss,title:n}),a?i(ns,{value:n}):null],className:is})};function cs(e){return"var("+e+")"}let us=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("padding","2px 8px"),ci("border-radius",cs(xt.full)),ci("background",cs(yt.surfaceElevated)),ci("color",cs(yt.textSecondary)),ci("font-size",cs(bt.sizeXs)),ci("font-weight",cs(bt.weightMedium)),ci("line-height","1.5"),ci("white-space","nowrap"),ci("border","none")]),ds=lo([hi("pointer"),Qi([ci("background",cs(yt.surface)),ci("color",cs(yt.textPrimary))])]),fs=lo([ci("font-weight",cs(bt.weightBold)),ci("color",cs(yt.textPrimary))]);let hs=function(e){let t=e.onClick,n=L(t,us,e=>us+" "+ds),s=r(o,{children:[i("span",{children:e.count.toString(),className:fs})," "+e.label,L(t,null,e=>i("span",{children:" ▸","aria-hidden":!0}))]});return void 0!==t?i("button",{children:s,className:n,type:"button",onClick:e=>t()}):i("span",{children:s,className:n})};function ps(e){let t=e.toString();return t.length<2?"0"+t:t}function gs(e){let t=new Date(e),n=t.getTime();if(Number.isNaN(n))return e;let r=0|t.getFullYear(),i=1+(0|t.getMonth())|0,o=0|t.getDate(),s=0|t.getHours(),a=0|t.getMinutes(),l=0|t.getSeconds();return r.toString()+"-"+ps(i)+"-"+ps(o)+" "+ps(s)+":"+ps(a)+":"+ps(l)}let ms=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/;function vs(e){if(ms.test(e))return gs(e)}function ys(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}function _s(e,t){return L(e,!1,ys)?void 0:vs(t)}function bs(e){return"var("+e+")"}let xs=function(e){let t=e.dot,n=e.variant,o=void 0!==t&&t,s=function(e){if("object"==typeof e)return[e.bg,e.fg];switch(e){case"Success":return[yt.success,yt.background];case"Warning":return[yt.warning,yt.background];case"Error":return[yt.error,yt.background];case"Info":return[yt.info,yt.background];case"Neutral":return[yt.surfaceElevated,yt.textSecondary]}}(void 0!==n?n:"Neutral");return r("span",{children:[o?i("span",{style:{background:"currentColor",display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",flexShrink:"0"}}):null,e.label],className:(a=s[0],l=s[1],lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("padding","2px 8px"),ci("border-radius",bs(xt.full)),ci("font-size",bs(bt.sizeXs)),ci("font-weight",bs(bt.weightMedium)),ci("line-height","1.5"),ci("white-space","nowrap"),ci("background",a.startsWith("--rv-")?"var("+a+")":a),ci("color",l.startsWith("--rv-")?"var("+l+")":l)]))});var a,l};function Ss(e){return z(e.plugin,t=>t+"."+e.store)}let ws={isId:!1,isCompositeId:!1,isSubId:!1,isCompositeSubId:!1,index:void 0,hidden:!1,summary:!1,groupBy:!1,drillTarget:void 0,collapsed:!1,scan:!1,scanSort:!1,semantic:void 0,semanticFromType:!1,storeTarget:void 0,channel:void 0,setter:void 0,retired:void 0};function Es(e,t){let n=z(Je(e,t),ct);return"JSONTrue"===n&&"object"!=typeof n}function ks(e,t){return j(Je(e,t),ut)}function Cs(e){return j(j(Je(e,"x-reventless-semantic-target"),ft),e=>z(j(Je(e,"store"),ut),t=>({plugin:j(Je(e,"plugin"),ut),store:t})))}function As(e){return j(j(Je(e,"x-reventless-setter"),ft),e=>z(j(Je(e,"command"),ut),t=>({command:t,field:j(Je(e,"field"),ut)})))}function Ns(e){return z(j(Je(e,"x-reventless-retired"),ft),e=>{let t=j(Je(e,"values"),ht);return{label:P(j(Je(e,"label"),ut),e=>""!==e.trim()),showWhenFalse:Es(e,"showWhenFalse"),values:void 0!==t?me(t,e=>P(ut(e),e=>""!==e.trim())):z(P(j(Je(e,"value"),ut),e=>""!==e.trim()),e=>[e]),namedWhenRetired:Es(e,"namedWhenRetired")}})}function Ts(e){let t=z(Je(e,"x-reventless-index"),ct);if(void 0!==t)return"object"!=typeof t?"JSONTrue"===t?"":void 0:"JSONString"===t.TAG?t._0:void 0}function Rs(e){let t=ft(e);if(void 0===t)return;let n=ft(Mt(e));if(void 0===n)return t;if(n===t)return t;let r=Ye(Xe(n));return Xe(t).forEach(e=>{r[e[0]]=e[1]}),r}function Ds(e){let t=Rs(e);return void 0!==t?{isId:Es(t,"x-reventless-id"),isCompositeId:Es(t,"x-reventless-compositeId"),isSubId:Es(t,"x-reventless-subId"),isCompositeSubId:Es(t,"x-reventless-compositeSubId"),index:Ts(t),hidden:Es(t,"x-reventless-hidden")||Es(t,"x-reventless-ui-hidden"),summary:Es(t,"x-reventless-summary"),groupBy:Es(t,"x-reventless-group-by"),drillTarget:z(ks(t,"x-reventless-drillTarget"),e=>({slice:e,keyPath:ks(t,"x-reventless-drillTargetKey")})),collapsed:Es(t,"x-reventless-collapsed"),scan:Es(t,"x-reventless-scan"),scanSort:Es(t,"x-reventless-scanSort"),semantic:ks(t,"x-reventless-semantic"),semanticFromType:mt(ks(t,"x-reventless-semantic-source"),"type"),storeTarget:Cs(t),channel:ks(t,"x-reventless-channel"),setter:As(t),retired:Ns(t)}:ws}function Is(e,t){return U(z(j(j(ft(e),e=>Je(e,"properties")),ft),e=>me(Xe(e),e=>{if(t(Ds(e[1])))return e[0]})),[])}function Fs(e){return Is(e,e=>e.summary)}function Os(e){return Is(e,e=>e.isId)[0]}function Ps(e){return j(j(j(ft(e),e=>Je(e,"properties")),ft),e=>me(Xe(e),e=>{let t=e[0];return z(Ds(e[1]).retired,e=>[t,e])})[0])}function Ms(e){return Is(e,e=>e.isCompositeId)}function Ls(e){return Is(e,e=>!!e.isSubId||e.isCompositeSubId)[0]}function zs(e){return U(function(e){return j(j(ft(e),e=>Je(e,"x-reventless-live")),e=>{let t=ct(e);if("object"!=typeof t)switch(t){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}(e),!0)}function js(e){return j(j(ft(e),e=>Je(e,"x-reventless-viewmode")),ut)}function Us(e){return j(z(j(j(ft(Mt(e)),e=>Je(e,"enum")),ht),e=>me(e,ut)),e=>{if(0!==e.length)return e})}function Bs(e,t){return U(j(j(j(j(ft(e),e=>Je(e,"properties")),ft),e=>Je(e,t)),Us),[])}function $s(e,t){return z(Ps(e),e=>{let n=e[1],r=e[0];return{field:r,label:U(B(P(t,e=>""!==e.trim()),n.label),at(r)),showWhenFalse:n.showWhenFalse,values:n.values,namedWhenRetired:n.namedWhenRetired}})}function qs(e,t){let n=e.values,r=function(e,t){return j(t,t=>{let n=e.values,r=ct(t);if(void 0!==n)return"object"!=typeof r||"JSONString"!==r.TAG?void 0:n.includes(r._0);if("object"!=typeof r)switch(r){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}(e,t);return void 0!==n?void 0!==r&&r?z(j(t,ut),e=>i(xs,{variant:"Warning",label:e,dot:!1})):void 0:void 0!==r?r?i(xs,{variant:"Warning",label:e.label,dot:!1}):e.showWhenFalse?i(xs,{variant:"Neutral",label:"Not "+e.label,dot:!1}):void 0:void 0}let Gs="archived";let Vs={param:Gs,on:"1",label:function(e){return void 0!==e.values?"Show retired":"Show "+e.label.toLowerCase()},offered:function(e,t){return!!e&&$(t)},showing:function(e,t){return!!e&&mt(t,"1")},toggleParams:function(e){return[[Gs,e?"":"1"],["after",""],["before",""]]}};function Ks(e){return"var("+e+")"}let Ws=lo([pi("inlineFlex"),ui("center"),ci("vertical-align","middle")]),Hs=lo([pi("inlineFlex"),ci("border-radius",Ks(xt.full)),ci("box-shadow","0 0 0 2px var("+yt.surface+")")]),Js=lo([pi("inlineFlex"),ui("center"),bi("center"),ci("border-radius",Ks(xt.full)),ci("background",Ks(yt.surfaceElevated)),ci("color",Ks(yt.textSecondary)),ci("font-family",Ks(bt.fontFamily)),ci("font-weight",Ks(bt.weightMedium)),ci("flex-shrink","0"),ci("user-select","none")]);let Xs=function(e){let t=e.max,n=e.size,o=e.members,s=void 0!==n?n:"Medium",a=void 0!==t?t:4,l=function(e,t){return e>t?e-t|0:0}(o.length,a),c=l>0?o.slice(0,a):o,u=l>0?o.slice(a):[],d=Uo(s),f=(0|-d)/3|0,h=e=>({marginLeft:0===e?"0":f.toString()+"px",zIndex:((c.length+1|0)-e|0).toString()});return r("span",{children:[c.map((e,t)=>i("span",{children:i(Wo,{name:e.name,src:e.imageUrl,size:s}),className:Hs,style:h(t)},t.toString())),l>0?i("span",{children:"+"+l.toString(),className:Hs+" "+Js,style:{fontSize:((d/2|0)-2|0).toString()+"px",height:d.toString()+"px",marginLeft:f.toString()+"px",width:d.toString()+"px",zIndex:(c.length+2|0).toString()},title:u.map(e=>e.name).join(", ")}):null],className:Ws})},Qs=l(void 0),Ys=Qs.Provider;let Zs=function(e){return c(Ys,{value:e.fill,children:e.children})};function ea(e){let t=parseFloat(e);return Number.isNaN(t)?void 0:t}function ta(e){switch(e){case"Email":return"email";case"Phone":return"phone";case"Url":return"url";case"DateTime":return"date-time";case"Currency":return"currency";case"Percent":return"percent";case"Bytes":return"bytes";case"Duration":return"duration";case"Color":return"color";case"Image":return"image";case"Status":return"status";case"GeoLat":return"geo-lat";case"GeoLng":return"geo-lng";case"GeoPoint":return"geo-point";case"Label":return"label";case"UserRef":return"user-ref";case"File":return"file";case"Markdown":return"markdown";case"ChannelText":return"channel-text";case"Rating":return"rating";case"Progress":return"progress";case"FileUrl":return"file-url";case"Country":return"country";case"Address":return"address";case"Qr":return"qr";case"Barcode":return"barcode";case"Signature":return"signature";case"ParentRef":return"parent-ref";case"Money":return"money";case"DateRange":return"date-range";case"Geolocation":return"geolocation"}}let na=["Email","Phone","Url","DateTime","Currency","Percent","Bytes","Duration","Color","Image","Status","GeoLat","GeoLng","GeoPoint","Label","UserRef","File","Markdown","ChannelText","Rating","Progress","FileUrl","Country","Address","Qr","Barcode","Signature","ParentRef","Money","DateRange","Geolocation"],ra="storageRef";function ia(e){return e===ra||"uploadableImage"===e||"uploadableFile"===e}function oa(e){switch(e){case"address":return"Address";case"barcode":return"Barcode";case"bytes":return"Bytes";case"channel-text":return"ChannelText";case"color":return"Color";case"country":return"Country";case"currency":return"Currency";case"date-time":return"DateTime";case"date-range":case"dateRange":return"DateRange";case"duration":return"Duration";case"email":return"Email";case"file-url":return"FileUrl";case"geo-lat":return"GeoLat";case"geo-lng":return"GeoLng";case"geo-point":case"geoPoint":return"GeoPoint";case"geolocation":return"Geolocation";case"label":return"Label";case"markdown":return"Markdown";case"money":return"Money";case"parent-ref":return"ParentRef";case"percent":return"Percent";case"phone":return"Phone";case"progress":return"Progress";case"qr":return"Qr";case"rating":return"Rating";case"signature":return"Signature";case"status":return"Status";case"file":case"fileRef":case"uploadableFile":return"File";case"image":case"imageRef":case"uploadableImage":return"Image";case"url":return"Url";case"user-ref":return"UserRef";default:return}}function sa(e){switch(e){case"Image":return["Illustrable"];case"Status":return["Stageable"];case"ParentRef":return["Hierarchical"];case"Money":return["Measure"];case"DateRange":return["Schedulable"];case"GeoPoint":case"Geolocation":return["Mappable"];default:return[]}}function aa(e,t){return j(j(Je(e,t),ut),e=>""===e?void 0:e)}function la(e,t,n){return j(j(j(j(Je(e,t),ft),e=>Je(e,n)),ut),e=>""===e?void 0:e)}function ca(e,t){return"Pair"===e.TAG?aa(t,e.startField):la(t,e._0,"start")}function ua(e,t){if("Pair"!==e.TAG)return la(t,e._0,"end");let n=e.endField;return void 0!==n?aa(t,n):void 0}function da(e){return"Pair"!==e.TAG||void 0!==e.endField}function fa(e,t){let n=Je(e,t);if(void 0===n)return;let r=dt(n);return void 0!==r?r:j(ut(n),ea)}function ha(e,t,n){return j(j(j(Je(e,t),ft),e=>Je(e,n)),dt)}function pa(e){return j(ft(e),e=>{let t=j(j(B(Je(e,"__typename"),Je(e,"TAG")),ut),e=>""===e?void 0:e);return z(t,t=>[t,Ye(Xe(e).filter(e=>{let t=e[0];return"__typename"!==t&&"TAG"!==t}))])})}function ga(e){return j(pa(e),e=>{let t=e[1],n=e[0];if(!n.endsWith("Located"))return n.endsWith("Pending")?{TAG:"Pending",requestedFor:aa(t,"requestedFor")}:n.endsWith("Unresolvable")?{TAG:"Unresolvable",reason:aa(t,"reason")}:void 0;let r=ha(t,"point","lat"),i=ha(t,"point","lng");return{TAG:"Located",point:void 0!==r&&void 0!==i?[r,i]:void 0}})}function ma(e){switch(e.TAG){case"Located":let t=e.point;return void 0!==t?t:void 0;case"Pending":case"Unresolvable":return}}function va(e){switch(e.TAG){case"Pending":case"Located":return;case"Unresolvable":let t=e.reason;return void 0!==t?t:void 0}}function ya(e,t){switch(e.TAG){case"Paired":let n=fa(t,e.latField),r=fa(t,e.lngField);return void 0!==n&&void 0!==r?[n,r]:void 0;case"Pointed":let i=e._0,o=ha(t,i,"lat"),s=ha(t,i,"lng");return void 0!==o&&void 0!==s?[o,s]:void 0;case"Geolocated":return j(function(e,t){return j(Je(e,t),ga)}(t,e._0),ma)}}function _a(e){return U(z(j(j(ft(Mt(e)),e=>Je(e,"properties")),ft),Xe),[]).map(e=>[e[0],Mt(e[1])])}function ba(e,t){return j(j(ft(Mt(e)),e=>Je(e,t)),ut)}function xa(e){let t=ba(e,"type");if(void 0===t)return!1;switch(t){case"integer":case"number":return!0;default:return!1}}function Sa(e){return mt(ba(e,"type"),"string")}function wa(e){let t=ba(e,"format");if(void 0===t)return!1;switch(t){case"date":case"date-time":return!0;default:return!1}}let Ea=["user","username","owner","assignee","assignedto","author","creator","createdby","updatedby","reporter","approver","reviewer","actor","member"];function ka(e){return Ea.includes(e.toLowerCase())}function Ca(e,t){return t.some(t=>e.endsWith(t))}function Aa(e){return L(Us(e),0,e=>e.length)}function Na(e,t){return j(j(ft(Mt(e)),e=>Je(e,t)),dt)}let Ta=[["street","streetaddress","line1","addressline1","address1","housenumber"],["city","town","locality"],["postalcode","zip","zipcode","postcode"],["state","region","province","county"],["country","countrycode"]];let Ra=["parent","parentid","manager","managerid","reportsto","reportstoid","supervisor","supervisorid"];function Da(e,t){let n=e.toLowerCase(),r=function(e,t){if(!xa(t))return;let n=Na(t,"maximum");return["rating","stars","starrating"].includes(e)?void 0!==n&&n>10?void 0:["Rating","name:rating"]:"score"===e&&void 0!==n&&n<=10?["Rating","name:score-scale"]:void 0}(n,t);return void 0!==r?r:["status","state","stage"].includes(n)&&Aa(t)>0?Aa(t)<=8?["Status","name:status-enum"]:void 0:mt(ba(t,"type"),"string")&&["imageurl","image","photo","photourl","avatar","avatarurl","thumbnail"].includes(n)?["Image","name:image"]:xa(t)&&Ca(n,["price","amount","total"])?["Currency","name:currency"]:mt(ba(t,"type"),"string")&&["email"].includes(n)?["Email","name:email"]:mt(ba(t,"type"),"string")&&["phone","phonenumber"].includes(n)?["Phone","name:phone"]:mt(ba(t,"type"),"string")&&["website","url","homepage"].includes(n)?["Url","name:url"]:mt(ba(t,"type"),"string")&&(["file","attachment","upload"].includes(n)||Ca(n,["storageref","fileref","attachmentref"]))?["File","name:file"]:xa(t)&&["progress","percentcomplete","percentdone","completion"].includes(n)?["Progress","name:progress"]:mt(ba(t,"type"),"string")&&["country","countrycode","countryname"].includes(n)?["Country","name:country"]:mt(ba(t,"type"),"string")&&["address","streetaddress","billingaddress","shippingaddress"].includes(n)?["Address","name:address"]:mt(ba(t,"type"),"string")&&function(e){return!!Ra.includes(e)||!!e.startsWith("parent")&&e.endsWith("id")}(n)?["ParentRef","name:parent-ref"]:mt(ba(t,"type"),"string")&&["name","title","label","displayname"].includes(n)?["Label","name:label"]:mt(ba(t,"type"),"string")&&Ea.includes(n)?["UserRef","name:user"]:void 0}function Ia(e){return["lat","latitude"].includes(e)}function Fa(e){return["lng","lon","long","longitude"].includes(e)}let Oa={contents:[]};function Pa(e,t,n){let r=e+"."+t+"."+n;if(Oa.contents.some(e=>e===r))return;Oa.contents.push(r);let i=na.map(ta).join(", ");console.error('[AutoUI] Unknown semantic "'+n+'" ('+e+') on field "'+t+'" — ignored. Valid ids: '+i+".")}function Ma(e,t){let n=Mt(t),r=Ds(n),i=r.semanticFromType?"Type":"Annotation",o=L(r.semantic,!1,ia),s=j(r.semantic,t=>{if(t===ra)return;let n=oa(t);return void 0!==n?{semantic:n,provenance:i}:void Pa("x-reventless-semantic",e,t)});if(void 0!==s)return s;let a,l=e.toLowerCase(),c=mt(ba(n,"type"),"object")&&function(e){let t=_a(e),n=(e,n)=>t.some(t=>t[0].toLowerCase()===e&&n(t[1]));return!!n("amount",xa)&&n("currency",Sa)}(n)?["Money","shape:money"]:mt(ba(n,"type"),"object")&&function(e){let t=_a(e),n=e=>t.some(t=>{let n=t[1];return!(t[0].toLowerCase()!==e||!mt(ba(n,"type"),"string"))&&wa(n)});return!!n("start")&&n("end")}(n)?["DateRange","shape:date-range"]:mt(ba(n,"type"),"object")&&function(e){let t=_a(e);return Ta.filter(e=>t.some(t=>e.includes(t[0].toLowerCase()))).length>=2}(n)?["Address","shape:address"]:mt(ba(n,"type"),"object")&&function(e){let t=_a(e),n=t.some(e=>!!Ia(e[0].toLowerCase())&&xa(e[1])),r=t.some(e=>!!Fa(e[0].toLowerCase())&&xa(e[1]));return!!n&&r}(n)?["GeoPoint","shape:geo-point"]:Ia(l)&&xa(n)?["GeoLat","name:geo-pair"]:Fa(l)&&xa(n)?["GeoLng","name:geo-pair"]:void 0;if(void 0!==c)a=c;else if(mt(ba(n,"type"),"string")&&function(e){return Ca(e,["fileurl","documenturl","downloadurl","attachmenturl","pdfurl"])}(l))a=["FileUrl","name:file-url"];else{let t=function(e){let t=ba(e,"format");if(void 0!==t)switch(t){case"date":case"date-time":return["DateTime","format:date-time"];case"email":return["Email","format:email"];case"uri":case"url":return["Url","format:uri"];default:return}}(n);a=void 0!==t?t:Da(e,n)}return B(z(a,e=>({semantic:e[0],provenance:{TAG:"Heuristic",_0:e[1]}})),o?{semantic:"File",provenance:i}:void 0)}function La(e,t){let n=Ma(e,t);return void 0!==n?n:j(Lt(t),t=>Ma(lt(e),t))}function za(e,t,n){let r=_a(e),i={};r.forEach(e=>{let n=e[0],r=j(j(t,e=>Je(e,n)),e=>{let t=oa(e);return void 0!==t?{semantic:t,provenance:"Hint"}:void Pa("uiHints.fields",n,e)});return void 0!==r?void(i[n]=r):M(Ma(n,e[1]),e=>{i[n]=e})});let o,s=e=>r.map(e=>e[0]).find(t=>L(Je(i,t),!1,t=>t.semantic===e)),a=e=>r.map(e=>e[0]).find(t=>L(Je(i,t),!1,t=>sa(t.semantic).includes(e))),l=j(P(n,e=>"id"!==e.field),e=>z(r.find(t=>t[0]===e.field&&mt(ba(t[1],"type"),"string")),e=>e[0])),c=L(n,!1,e=>mt(e.source,"annotation")),u=c?l:void 0,d=r.map(e=>e[0]).find(e=>L(Je(i,e),!1,e=>"Label"===e.semantic&&"Hint"===e.provenance));if(void 0!==d)o=d;else{let e=0;if(void 0!==l&&c?o=l:e=1,1===e){let e=s("Label");o=void 0!==e?e:l}}if(void 0!==o&&void 0!==l&&o===l){let e={semantic:"Label",provenance:c?"Annotation":{TAG:"Heuristic",_0:"declared:labelField"}},t=Je(i,o);if(void 0!==t){let n=0,r=t.provenance;"object"!=typeof r&&"Hint"===r||(n=1),1===n&&"Label"===t.semantic&&(i[o]=e)}else i[o]=e}let f=a("Mappable"),h=s("GeoLat"),p=s("GeoLng"),g=void 0!==h&&void 0!==p?{TAG:"Paired",latField:h,lngField:p}:void 0,m=s("Geolocation"),v=void 0!==m?{TAG:"Geolocated",_0:m}:void 0!==f?{TAG:"Pointed",_0:f}:g,y=a("Schedulable"),_=me(r,e=>{let t=e[0];if(L(Je(i,t),!1,e=>"DateTime"===e.semantic)||wa(e[1]))return t}),b=_.find(e=>e.toLowerCase().startsWith("start")),x=_.find(e=>e.toLowerCase().startsWith("end")),S=void 0!==b?void 0!==x?{TAG:"Pair",startField:b,endField:x}:{TAG:"Pair",startField:b}:z(_.find(e=>{let t=e.toLowerCase();return!function(e){return["createdat","updatedat","deletedat"].includes(e)}(t)&&(!!Ca(t,["at","date"])||"date"===t)}),e=>({TAG:"Pair",startField:e}));return{semantics:i,geo:v,dateSpan:void 0!==y?{TAG:"Ranged",_0:y}:S,statusField:a("Stageable"),labelField:o,projectedLabelField:u,imageField:a("Illustrable"),parentField:a("Hierarchical")}}let ja=l([]),Ua=l(e=>{}),Ba=ja.Provider,$a=Ua.Provider;let qa=function(e){let t=e.initial,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=f(e=>i(t=>e),[]);return c($a,{value:o,children:c(Ba,{value:r[0],children:e.children})})};function Ga(){return d(ja)}function Va(e,t){let n=function(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}(t),r=tt(n),i=e.find(e=>e.name===r);return void 0!==i?i:e.find(e=>e.name===n)}function Ka(e,t){return e.find(e=>e.name===t)}function Wa(e,t){return Le(n=>Ie(e,Ie(encodeURIComponent(t),n)))}function Ha(e,t){return Ie(e,Ie(encodeURIComponent(t),"Wildcard"))}function Ja(e,t,n,r){let i=[n].concat(r).map(e=>encodeURIComponent(e));return je(Ha(e,t))(ze.of_parts(i.join("/")))}var Xa=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Xa||{});const Qa=[1,0],Ya=[2,3],Za=[3,2],el={L:[0,1],M:Qa,Q:Ya,H:Za},tl=/^\d*$/,nl=/^[A-Z0-9 $%*+./:-]*$/,rl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",il=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],ol=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];let sl=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<1||e>40)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=4*e+17;const i=Array.from({length:this.size}).fill(!1);for(let s=0;s<this.size;s++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();const o=this.addEccAndInterleave(n);if(this.drawCodewords(o),-1===r){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2==0,Xa.Timing),this.setFunctionModule(n,6,n%2==0,Xa.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0===n&&0===r||0===n&&r===t-1||n===t-1&&0===r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.ecc[1]<<3|e;let n=t;for(let i=0;i<10;i++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);for(let i=0;i<=5;i++)this.setFunctionModule(8,i,ll(r,i));this.setFunctionModule(8,7,ll(r,6)),this.setFunctionModule(8,8,ll(r,7)),this.setFunctionModule(7,8,ll(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,ll(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,ll(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,ll(r,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;for(let n=0;n<18;n++){const e=ll(t,n),r=this.size-11+n%3,i=Math.floor(n/3);this.setFunctionModule(r,i,e),this.setFunctionModule(i,r,e)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const i=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;o>=0&&o<this.size&&s>=0&&s<this.size&&this.setFunctionModule(o,s,2!==i&&4!==i,Xa.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!==Math.max(Math.abs(r),Math.abs(n)),Xa.Alignment)}setFunctionModule(e,t,n,r=Xa.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){const t=this.version,n=this.ecc;if(e.length!==Sl(t,n))throw new RangeError("Invalid argument");const r=ol[n[0]][t],i=il[n[0]][t],o=Math.floor(xl(t)/8),s=r-o%r,a=Math.floor(o/r),l=[],c=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let r=0;r<e-1;r++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=El(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=El(n,2)}return t}(i);for(let d=0,f=0;d<r;d++){const t=e.slice(f,f+a-i+(d<s?0:1));f+=t.length;const n=wl(t,c);d<s&&t.push(0),l.push(t.concat(n))}const u=[];for(let d=0;d<l[0].length;d++)l.forEach((e,t)=>{(d!==a-i||t>=s)&&u.push(e[d])});return u}drawCodewords(e){if(e.length!==Math.floor(xl(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const o=n-i,s=!(n+1&2)?this.size-1-r:r;!this.types[s][o]&&t<8*e.length&&(this.modules[s][o]=ll(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let r=0;r<this.size;r++){let t=!1,n=0;const i=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[r][o]===t?(n++,5===n?e+=3:n>5&&e++):(this.finderPenaltyAddHistory(n,i),t||(e+=40*this.finderPenaltyCountPatterns(i)),t=this.modules[r][o],n=1);e+=40*this.finderPenaltyTerminateAndCount(t,n,i)}for(let r=0;r<this.size;r++){let t=!1,n=0;const i=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][r]===t?(n++,5===n?e+=3:n>5&&e++):(this.finderPenaltyAddHistory(n,i),t||(e+=40*this.finderPenaltyCountPatterns(i)),t=this.modules[o][r],n=1);e+=40*this.finderPenaltyTerminateAndCount(t,n,i)}for(let r=0;r<this.size-1;r++)for(let t=0;t<this.size-1;t++){const n=this.modules[r][t];n===this.modules[r][t+1]&&n===this.modules[r+1][t]&&n===this.modules[r+1][t+1]&&(e+=3)}let t=0;for(const r of this.modules)t=r.reduce((e,t)=>e+(t?1:0),t);const n=this.size*this.size;return e+=10*(Math.ceil(Math.abs(20*t-10*n)/n)-1),e}getAlignmentPatternPositions(){if(1===this.version)return[];{const e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){const t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};function al(e,t,n){if(t<0||t>31||e>>>t!==0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function ll(e,t){return!!(e>>>t&1)}class cl{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const ul=[1,10,12,14],dl=[2,9,11,13],fl=[4,8,16,16];function hl(e,t){return e[Math.floor((t+7)/17)+1]}function pl(e){const t=[];for(const n of e)al(n,8,t);return new cl(fl,e.length,t)}function gl(e){if(!vl(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let n=0;n<e.length;){const r=Math.min(e.length-n,3);al(Number.parseInt(e.substring(n,n+r),10),3*r+1,t),n+=r}return new cl(ul,e.length,t)}function ml(e){if(!yl(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let n;for(n=0;n+2<=e.length;n+=2){let r=45*rl.indexOf(e.charAt(n));r+=rl.indexOf(e.charAt(n+1)),al(r,11,t)}return n<e.length&&al(rl.indexOf(e.charAt(n)),6,t),new cl(dl,e.length,t)}function vl(e){return tl.test(e)}function yl(e){return nl.test(e)}function _l(e,t){let n=0;for(const r of e){const e=hl(r.mode,t);if(r.numChars>=1<<e)return Number.POSITIVE_INFINITY;n+=4+e+r.bitData.length}return n}function bl(e){e=encodeURI(e);const t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}function xl(e){if(e<1||e>40)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function Sl(e,t){return Math.floor(xl(e)/8)-il[t[0]][e]*ol[t[0]][e]}function wl(e,t){const n=t.map(e=>0);for(const r of e){const e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=El(t,e))}return n}function El(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return n}function kl(e,t){const{ecc:n="L",boostEcc:r=!1,minVersion:i=1,maxVersion:o=40,maskPattern:s=-1,border:a=1}=t||{},l="string"==typeof e?function(e){return""===e?[]:vl(e)?[gl(e)]:yl(e)?[ml(e)]:[pl(bl(e))]}(e):Array.isArray(e)?[pl(e)]:void 0;if(!l)throw new Error("uqr only supports encoding string and binary data, but got: "+typeof e);const c=function(e,t,n=1,r=40,i=-1,o=!0){if(!(1<=n&&n<=r&&r<=40)||i<-1||i>7)throw new RangeError("Invalid value");let s,a;for(s=n;;s++){const n=8*Sl(s,t),i=_l(e,s);if(i<=n){a=i;break}if(s>=r)throw new RangeError("Data too long")}for(const d of[Qa,Ya,Za])o&&a<=8*Sl(s,d)&&(t=d);const l=[];for(const d of e){al(d.mode[0],4,l),al(d.numChars,hl(d.mode,s),l);for(const e of d.getData())l.push(e)}const c=8*Sl(s,t);al(0,Math.min(4,c-l.length),l),al(0,(8-l.length%8)%8,l);for(let d=236;l.length<c;d^=253)al(d,8,l);const u=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>u[t>>>3]|=e<<7-(7&t)),new sl(s,t,u,i)}(l,el[n],i,o,s,r),u=function(e,t=1){if(!t)return e;const{size:n}=e,r=n+2*t;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let o=0;o<t;o++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));const i=Xa.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let o=0;o<t;o++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}({version:c.version,maskPattern:c.mask,size:c.size,data:c.modules,types:c.types},a);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}let Cl=lo([pi("inlineBlock"),ci("background","#ffffff"),ci("padding","6px"),ci("border-radius",function(e){return"var("+e+")"}(xt.md)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("line-height","0")]),Al=lo([ci("color","#000000"),ci("display","block")]);let Nl=function(e){let t=e.size,n=e.value,r=void 0!==t?t:128,o=function(e){if(""!==e.trim())try{return kl(e,{ecc:"M",border:4})}catch(t){return}}(n);if(void 0===o)return null;let s=o.size.toString();return i("span",{children:i("svg",{children:i("path",{d:(a=o.data,a.map((e,t)=>e.map((e,n)=>e?"M"+n.toString()+" "+t.toString()+"h1v1h-1z":"").join("")).join("")),fill:"currentColor"}),"aria-label":U(e.title,"QR code for "+n),className:Al,role:"img",height:r.toString(),width:r.toString(),shapeRendering:"crispEdges",viewBox:"0 0 "+s+" "+s,xmlns:"http://www.w3.org/2000/svg"}),className:Cl});var a},Tl=["11011001100","11001101100","11001100110","10010011000","10010001100","10001001100","10011001000","10011000100","10001100100","11001001000","11001000100","11000100100","10110011100","10011011100","10011001110","10111001100","10011101100","10011100110","11001110010","11001011100","11001001110","11011100100","11001110100","11101101110","11101001100","11100101100","11100100110","11101100100","11100110100","11100110010","11011011000","11011000110","11000110110","10100011000","10001011000","10001000110","10110001000","10001101000","10001100010","11010001000","11000101000","11000100010","10110111000","10110001110","10001101110","10111011000","10111000110","10001110110","11101110110","11010001110","11000101110","11011101000","11011100010","11011101110","11101011000","11101000110","11100010110","11101101000","11101100010","11100011010","11101111010","11001000010","11110001010","10100110000","10100001100","10010110000","10010000110","10000101100","10000100110","10110010000","10110000100","10011010000","10011000010","10000110100","10000110010","11000010010","11001010000","11110111010","11000010100","10001111010","10100111100","10010111100","10010011110","10111100100","10011110100","10011110010","11110100100","11110010100","11110010010","11011011110","11011110110","11110110110","10101111000","10100011110","10001011110","10111101000","10111100010","11110101000","11110100010","10111011110","10111101110","11101011110","11110101110","11010000100","11010010000","11010011100","1100011101011"];function Rl(e){return e>="0"&&e<="9"}function Dl(e){let t={};return function(e){let t=[],n=0,r=e.length;for(;n<r;)if(Rl(U(e[n],""))){let i=n;for(;n<r&&Rl(U(e[n],""));)n=n+1|0;t.push([i,n-i|0])}else n=n+1|0;return t}(e).forEach(n=>{let r=n[1],i=n[0],o=r%2,s=r-o|0;s<=0||(((o+(0===i&&0===o?0:1)|0)+(s/2|0)|0)+((i+r|0)===e.length?0:1)|0)<r&&(t[(i+o|0).toString()]=s)}),t}function Il(e){return z(function(e){let t=e.length,n=0===t||e.split("").some(e=>{let t=U(e.codePointAt(0),0);return t<32||t>126});if(n)return;let r=Dl(e),i=[],o=$(r[0]);i.push(o?105:104);let s=o?"C":"B",a=0;for(;a<t;){let t=r[a.toString()];if(void 0!==t){"C"!==s&&(i.push(99),s="C");for(let n=0,r=t/2|0;n<r;++n){let t=e.substring(a+(n<<1)|0,2+(a+(n<<1)|0)|0);i.push(U(ye(t),0))}a=a+t|0}else"C"===s&&(i.push(100),s="B"),i.push(U(e.codePointAt(a),32)-32|0),a=a+1|0}return i}(e),e=>{let t={contents:e[0]};return e.forEach((e,n)=>{n>0&&(t.contents=t.contents+(e*n|0)|0)}),e.concat([t.contents%103,106]).map(e=>Tl[e]).join("")})}function Fl(e,t,n){let r=n.toString(),i=[],o=0,s=e.length;for(;o<s;)if(mt(e[o],"1")){let n=o;for(;o<s&&mt(e[o],"1");)o=o+1|0;let a=(o-n|0).toString();i.push("M"+(n+t|0).toString()+" 0h"+a+"v"+r+"h-"+a+"z")}else o=o+1|0;return i.join("")}let Ol=lo([pi("inlineBlock"),Di({NAME:"percent",VAL:100}),ci("overflow-x","auto"),ci("background","#ffffff"),ci("padding","6px"),ci("border-radius",function(e){return"var("+e+")"}(xt.md)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("line-height","0")]),Pl=lo([ci("color","#000000"),ci("display","block")]);let Ml=function(e){let t=e.moduleWidth,n=e.height,r=e.value,o=void 0!==n?n:64,s=void 0!==t?t:2,a=Il(r);if(void 0===a)return null;let l=a.length+20|0;return i("span",{children:i("svg",{children:i("path",{d:Fl(a,10,40),fill:"currentColor"}),"aria-label":U(e.title,"Barcode for "+r),className:Pl,role:"img",height:o.toString(),width:(l*s|0).toString(),preserveAspectRatio:"none",shapeRendering:"crispEdges",viewBox:"0 0 "+l.toString()+" "+40..toString(),xmlns:"http://www.w3.org/2000/svg"}),className:Ol})};function Ll(e){return"var("+e+")"}let zl=lo([ji("fixed"),$i(eo(0)),xi(eo(0)),Ui(eo(0)),fi(eo(0)),ci("background","rgba(0,0,0,0.82)"),pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",Ll(_t.md)),ci("padding",Ll(_t.lg)),ci("z-index","1100")]),jl=lo([ci("max-width","min(92vw, 1400px)"),ci("max-height","78vh"),ci("object-fit","contain"),ci("border-radius",Ll(xt.sm)),ci("box-shadow",Ll(Et))]),Ul=lo([pi("flex"),ui("center"),ci("gap",Ll(_t.md)),ci("max-width","100%")]),Bl=lo([pi("flex"),ui("center"),ci("gap",Ll(_t.md)),ci("max-width","92vw"),ci("color","#f5f5f5"),ci("font-size",Ll(bt.sizeSm))]),$l=lo([ci("font-size",Ll(bt.sizeMd)),ci("font-weight",Ll(bt.weightMedium)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),ql=lo([ci("color","#c8c8c8")]),Gl=lo([ci("font-family",Ll(bt.fontFamilyMono)),ci("color","#c8c8c8")]),Vl=lo([pi("inlineFlex"),ui("center"),bi("center"),ci("background","rgba(255,255,255,0.12)"),ci("border","1px solid rgba(255,255,255,0.25)"),ci("border-radius",Ll(xt.md)),ci("color","#f5f5f5"),ci("padding","4px var("+_t.sm+")"),ci("font-size",Ll(bt.sizeSm)),hi("pointer"),Qi([ci("background","rgba(255,255,255,0.22)")])]),Kl=co([Vl,lo([ci("width","40px"),ci("height","40px"),ci("border-radius","50%"),ci("font-size",Ll(bt.sizeLg)),vi(0)])]),Wl=co([Vl,lo([ji("absolute"),$i(eo(16)),Ui(eo(16)),ci("width","32px")])]);function Hl(e,t,n){return 0===t?0:fe(fe(e+n|0,t)+t|0,t)}let Jl=function(e){let t=e.onClose,n=e.onIndexChange,o=e.index,s=e.slides,l=s.length,c=l>1;a(()=>{let e=e=>{switch(e.key){case"ArrowLeft":return c?n(Hl(o,l,-1)):void 0;case"ArrowRight":return c?n(Hl(o,l,1)):void 0;case"Escape":return t();default:return}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o,l]);let u=s[Hl(o,l,0)];if(void 0===u)return null;let d=u.title,f=u.caption;return r("div",{children:[i("button",{children:"✕",className:Wl,title:"Close",type:"button",onClick:e=>t()}),r("div",{children:[c?i("button",{children:"‹",className:Kl,title:"Previous",type:"button",onClick:e=>n(Hl(o,l,-1))}):null,i("img",{className:jl,alt:U(u.title,""),src:u.src}),c?i("button",{children:"›",className:Kl,title:"Next",type:"button",onClick:e=>n(Hl(o,l,1))}):null],className:Ul,onClick:e=>{e.stopPropagation()}}),r("div",{children:[void 0!==d?i("span",{children:d,className:$l,title:d}):null,void 0!==f?i("span",{children:f,className:ql}):null,c?i("span",{children:(Hl(o,l,0)+1|0).toString()+" / "+l.toString(),className:Gl}):null,U(e.action,null)],className:Bl,onClick:e=>{e.stopPropagation()}})],"aria-modal":!0,className:zl,role:"dialog",onClick:e=>t()})};function Xl(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function Ql(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function Yl(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+t,1).getTime()}function Zl(e){let t=0|new Date(e).getDay(),n=0===t?6:t-1|0;return Ql(Xl(e),0|-n)}function ec(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1).getTime()}function tc(e,t){return Xl(e)===Xl(t)}function nc(e,t){let n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function rc(e,t,n){let r=Xl(n);return e<r+864e5&&t>=r}function ic(e){let t=e.toString();return t.length<2?"0"+t:t}function oc(e){let t=new Date(e);return ic(0|t.getHours())+":"+ic(0|t.getMinutes())}function sc(e){return e===Xl(e)}let ac=["January","February","March","April","May","June","July","August","September","October","November","December"];function lc(e){let t=new Date(e),n=0|t.getMonth();return U(ac[n],"")+" "+t.getFullYear().toString()}let cc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function uc(e){return 0|new Date(e).getDate()}function dc(e){let t=0|new Date(e).getDay();return U(cc[0===t?6:t-1|0],"")+" "+(0|new Date(e).getDate()).toString()}function fc(e){let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}let hc=864e5;function pc(e){return"var("+e+")"}function gc(e){return lo([ci("width","100%"),ci("height",e),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",pc(xt.md)),ci("background",pc(yt.surfaceSubtle)),Pi("hidden")])}let mc=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",pc(_t.sm)),ci("height","100%"),ci("padding",pc(_t.lg)),ci("color",pc(yt.textSecondary)),ci("font-size",pc(bt.sizeSm)),ci("text-align","center")]),vc=lo([ci("color",pc(yt.brand)),ci("text-decoration","none"),Qi([ci("text-decoration","underline")])]);function yc(e){return U(U(e.split("?")[0],e).split("#")[0],e).toLowerCase().endsWith(".pdf")}let _c=function(e){let t=e.height,n=e.title,o=e.src,s=void 0!==n?n:"Document",a=void 0!==t?t:"70vh";return i("object",{children:r("div",{children:["This browser can't display the document inline.",i("a",{children:"Open "+s,className:vc,href:o,rel:"noopener noreferrer",target:"_blank"})],className:mc}),"aria-label":s,className:gc(a),data:o,type:"application/pdf"})};function bc(e){return"Small"===e?"13px":"18px"}function xc(e,t){let n=t<=0?1:t;return(e<0?0:e>n?n:e)/n}function Sc(e){return"var("+e+")"}let wc=lo([ci("color",Sc(yt.borderSubtle))]);let Ec=lo([pi("inlineFlex"),ci("gap","2px"),ui("center")]);function kc(e,t){return lo([ci("background","none"),ci("border","none"),ci("padding","0 1px"),ci("font-size",bc(t)),ci("line-height","1"),hi("pointer"),ci("color",Sc(e?yt.warning:yt.borderSubtle)),ci("transition","color 120ms, transform 120ms"),Qi([ci("transform","scale(1.15)")]),Ki("&:focus-visible",[ci("outline","2px solid var("+yt.brand+")"),ci("outline-offset","1px"),ci("border-radius","2px")])])}let Cc=lo([ci("color",Sc(yt.textSecondary)),ci("font-size",Sc(bt.sizeSm))]),Ac=lo([pi("inlineFlex"),ui("center"),ci("gap","6px")]),Nc=lo([ci("border","1px solid var("+yt.error+")"),ci("border-radius",Sc(xt.sm)),ci("padding","2px 4px")]);let Tc=function(e){let t=e.hasError,n=e.onBlur,o=e.onChange,s=e.showValue,a=e.size,l=e.max,c=e.value,u=void 0!==l?l:5,d=void 0!==a?a:"Small",f=void 0!==s&&s,h=void 0!==t&&t,p=u<=0?5:u,g=function(e){return he(e<=0?0:e,"★").join("")}(p),m=U(e.label,(Math.round(10*c)/10).toString()+" of "+p.toString());return r("span",void 0!==o?{children:[pe(p,e=>e+1|0).map(e=>{let t=e<=c;return i("button",{children:"★","aria-label":e.toString()+" of "+p.toString(),"aria-pressed":t?"true":"false",className:kc(t,d),title:e.toString()+" of "+p.toString(),type:"button",onBlur:e=>M(n,e=>e()),onClick:t=>{t.stopPropagation(),o(e===c?0:e)}},e.toString())}),f?i("span",{children:c<=0?"—":c.toString(),className:Cc}):null],"aria-label":m,className:h?Ec+" "+Nc:Ec,role:"group"}:{children:[r("span",{children:[i("span",{children:g,className:wc}),i("span",{children:g,className:(y=xc(c,p),lo([ji("absolute"),ci("top","0"),ci("left","0"),ci("width",(100*y).toString()+"%"),Pi("hidden"),ci("white-space","nowrap"),ci("color",Sc(yt.warning)),ci("pointer-events","none")]))})],"aria-label":m,className:(v=d,lo([pi("inlineFlex"),ji("relative"),ci("font-size",bc(v)),ci("line-height","1"),ci("letter-spacing","1px"),ci("white-space","nowrap"),ci("vertical-align","-1px")])),role:"img",title:m}),f?i("span",{children:(Math.round(10*c)/10).toString()+" / "+p.toString(),className:Cc}):null],className:Ac});var v,y};function Rc(e){return"var("+e+")"}let Dc=lo([pi("flex"),gi("column"),ci("gap","4px")]),Ic=lo([pi("flex"),bi("spaceBetween"),ci("font-size",Rc(bt.sizeSm))]),Fc=lo([ci("color",Rc(yt.textSecondary))]),Oc=lo([ci("color",Rc(yt.textPrimary)),ci("font-weight",Rc(bt.weightMedium))]),Pc=lo([ci("background",Rc(yt.surfaceSubtle)),ci("border-radius",Rc(xt.full)),ci("height","8px"),Pi("hidden")]);function Mc(e,t){return lo([ci("background",void 0!==t?t:"var("+yt.brand+")"),ci("border-radius",Rc(xt.full)),ci("height","100%"),ci("width",e.toString()+"%"),ci("transition","width 0.3s ease")])}let Lc=function(e){let t=e.showValue,n=e.label,o=e.value,s=void 0===t||t,a=o>100?100:o,l=a<0?0:a;return r("div",{children:[$(n)||s?r("div",{children:[L(n,null,e=>i("span",{children:e,className:Fc})),s?i("span",{children:Math.round(l).toString()+"%",className:Oc}):null],className:Ic}):null,i("div",{children:i("div",{className:Mc(l,e.color)}),className:Pc})],className:Dc})},zc={};function jc(e){zc[e.id]=e}function Uc(e){return Je(zc,e)}let Bc={};let $c={contents:[]};let qc="#111111";function Gc(e){return"var("+e+")"}let Vc=lo([pi("flex"),gi("column"),ci("gap",Gc(_t.xs))]);let Kc=lo([ci("fill","#9ca3af"),ci("font-size","13px"),ci("pointer-events","none"),ci("user-select","none")]),Wc=lo([ci("stroke","#e5e7eb"),ci("stroke-width","1")]),Hc=lo([pi("flex"),ui("center"),ci("gap",Gc(_t.sm)),ci("font-size",Gc(bt.sizeXs)),ci("color",Gc(yt.textSecondary))]),Jc=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Gc(xt.sm)),ci("color",Gc(yt.textSecondary)),ci("font-size",Gc(bt.sizeXs)),ci("padding","2px 8px"),hi("pointer"),Qi([ci("border-color",Gc(yt.brand)),ci("color",Gc(yt.brand))])]),Xc=lo([ci("background","#ffffff"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",Gc(xt.md)),ci("padding","4px"),ci("display","inline-block"),ci("line-height","0")]),Qc=lo([ci("display","block"),ci("max-width","100%"),ci("height","auto")]);function Yc(e){return(Math.round(10*e)/10).toString()}function Zc(e){return e.map(e=>Yc(e.x)+","+Yc(e.y)).join(" ")}function eu(e){return e.trim().startsWith("<svg")}function tu(e){return"data:image/svg+xml;utf8,"+encodeURIComponent(e)}let nu=function(e){let t=e.hasError,n=e.height,o=e.width,a=e.onBlur,l=e.onChange,c=e.value,u=void 0!==o?o:480,d=void 0!==n?n:160,f=void 0!==t&&t,p=h(null),g=s(()=>[]),m=g[1],v=g[0],y=s(()=>!1),_=y[1],b=h(!1),x=e=>z(R(p.current),t=>{let n=t.getBoundingClientRect(),r=0===n.width?1:u/n.width,i=0===n.height?1:d/n.height;return{x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i}}),S=e=>l(function(e,t,n){let r=e.filter(e=>0!==e.length);if(0===r.length)return"";let i=r.map(e=>'<polyline points="'+Zc(1===e.length?e.concat(e):e)+'"/>').join("");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+Yc(t)+" "+Yc(n)+'" width="'+Yc(t)+'" height="'+Yc(n)+'"><g fill="none" stroke="'+qc+'" stroke-width="'+2..toString()+'" stroke-linecap="round" stroke-linejoin="round">'+i+"</g></svg>"}(e,u,d)),w=e=>{e.preventDefault();let t=x(e);if(void 0!==t)return b.current=!0,M(R(p.current),t=>{t.setPointerCapture(e.pointerId)}),m(e=>e.concat([[t]]))},E=e=>{if(!b.current)return;let t=x(e);return void 0!==t?m(e=>{let n=e[e.length-1|0];if(void 0===n)return e;let r=n[n.length-1|0];return void 0===r||function(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r>=2.25}(t,r)?e.slice(0,e.length-1|0).concat([n.concat([t])]):e}):void 0},k=e=>{if(b.current)return b.current=!1,S(v),M(a,e=>e())},C=()=>{m(e=>[]),_(e=>!0),l("")},A=0!==v.length;return!c.trim().startsWith("<svg")||A||y[0]?r("div",{children:[r("svg",{children:[i("line",{className:Wc,x1:Yc(.06*u),x2:Yc(.94*u),y1:Yc(.78*d),y2:Yc(.78*d)}),A?null:i("text",{children:"Sign here",className:Kc,textAnchor:"middle",x:Yc(u/2),y:Yc(.7*d)}),i("g",{children:v.map((e,t)=>i("polyline",{points:Zc(1===e.length?e.concat(e):e)},t.toString())),fill:"none",stroke:qc,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2..toString()})],ref:T(p),"aria-label":"Signature pad",className:(N=f,lo([ci("background","#ffffff"),ci("border",N?"1px solid var("+yt.error+")":"1px dashed var("+yt.border+")"),ci("border-radius",Gc(xt.md)),ci("touch-action","none"),ci("max-width","100%"),ci("width","100%"),ci("height","auto"),hi("crosshair"),ci("display","block")])),role:"img",onPointerDown:w,onPointerMove:E,onPointerUp:k,onPointerCancel:k,viewBox:"0 0 "+Yc(u)+" "+Yc(d),xmlns:"http://www.w3.org/2000/svg"}),r("div",{children:[A?i("button",{children:"Clear",className:Jc,type:"button",onClick:e=>C()}):null,i("span",{children:"Draw your signature above"})],className:Hc})],className:Vc}):r("div",{children:[i("span",{children:i("img",{className:Qc,alt:"Signature",src:tu(c)}),className:Xc}),i("div",{children:i("button",{children:"Sign again",className:Jc,type:"button",onClick:e=>C()}),className:Hc})],className:Vc});var N};function ru(e,t,n){let r={};return r[t]=n,Object.assign({},e,r)}function iu(e){return"var("+e+")"}let ou=lo([pi("flex"),gi("column"),ci("gap",iu(_t.sm))]),su=lo([pi("flex"),ci("gap","4px")]),au=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",iu(xt.sm)),ci("color",iu(yt.textSecondary)),ci("font-size",iu(bt.sizeXs)),ci("padding","2px 8px"),hi("pointer")]),lu=lo([ci("background",iu(yt.brandSubtle)),ci("border-color",iu(yt.brand)),ci("color",iu(yt.textPrimary))]),cu=lo([Gi({NAME:"percent",VAL:100}),ci("min-height","220px"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",iu(xt.sm)),ci("background","#ffffff")]),uu=lo([ci("margin","0"),ci("font-family",iu(bt.fontFamilyMono)),ci("font-size",iu(bt.sizeXs)),ci("line-height",iu(bt.lineHeightRelaxed)),ci("color",iu(yt.textPrimary)),ci("white-space","pre-wrap"),ci("word-break","break-word")]);function du(e){let t,n=e.textAlternative,o=s(()=>!1),a=o[1],l=o[0],c=(e,t,n)=>i("button",{children:e,className:t?au+" "+lu:au,type:"button",onClick:n}),u=0;return l&&void 0!==n?t=i("pre",{children:n,className:uu}):u=1,1===u&&(t=i("iframe",{className:cu,title:"Email preview",sandbox:"",srcDoc:e.html})),r("div",{children:[void 0!==n?r("div",{children:[c("HTML",!l,e=>a(e=>!1)),c("Plain text",l,e=>a(e=>!0))],className:su}):null,t],className:ou})}function fu(e,t){return i(du,{html:e.body,textAlternative:e.textAlternative})}const hu={};function pu(e,t){"string"!=typeof t&&(t=pu.defaultChars);const n=function(e){let t=hu[e];if(t)return t;t=hu[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);t.push(e)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,i=e.length;r<i;r+=3){const o=parseInt(e.slice(r+1,r+3),16);if(o<128)t+=n[o];else{if(192==(224&o)&&r+3<i){const n=parseInt(e.slice(r+4,r+6),16);if(128==(192&n)){const e=o<<6&1984|63&n;t+=e<128?"��":String.fromCharCode(e),r+=3;continue}}if(224==(240&o)&&r+6<i){const n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if(128==(192&n)&&128==(192&i)){const e=o<<12&61440|n<<6&4032|63&i;t+=e<2048||e>=55296&&e<=57343?"���":String.fromCharCode(e),r+=6;continue}}if(240==(248&o)&&r+9<i){const n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),s=parseInt(e.slice(r+10,r+12),16);if(128==(192&n)&&128==(192&i)&&128==(192&s)){let e=o<<18&1835008|n<<12&258048|i<<6&4032|63&s;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue}}t+="�"}}return t})}pu.defaultChars=";/?:@&=+$,#",pu.componentChars="";const gu={};function mu(e,t,n){"string"!=typeof t&&(n=t,t=mu.defaultChars),void 0===n&&(n=!0);const r=function(e){let t=gu[e];if(t)return t;t=gu[e]=[];for(let n=0;n<128;n++){const e=String.fromCharCode(n);/^[0-9a-z]$/i.test(e)?t.push(e):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}(t);let i="";for(let o=0,s=e.length;o<s;o++){const t=e.charCodeAt(o);if(n&&37===t&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))i+=e.slice(o,o+3),o+=2;else if(t<128)i+=r[t];else if(t>=55296&&t<=57343){if(t>=55296&&t<=56319&&o+1<s){const t=e.charCodeAt(o+1);if(t>=56320&&t<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD"}else i+=encodeURIComponent(e[o])}return i}function vu(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function yu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}mu.defaultChars=";/?:@&=+$,-_.!~*'()#",mu.componentChars="-_.!~*'()";const _u=/^([a-z0-9.+-]+:)/i,bu=/:[0-9]*$/,xu=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Su=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),wu=["'"].concat(Su),Eu=["%","/","?",";","#"].concat(wu),ku=["/","?","#"],Cu=/^[+a-z0-9A-Z_-]{0,63}$/,Au=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Nu={javascript:!0,"javascript:":!0},Tu={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ru(e,t){if(e&&e instanceof yu)return e;const n=new yu;return n.parse(e,t),n}yu.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){const e=xu.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let s=_u.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===o.substr(0,2),!i||s&&Nu[s]||(o=o.substr(2),this.slashes=!0)),!Nu[s]&&(i||s&&!Tu[s])){let e,t,n=-1;for(let a=0;a<ku.length;a++)r=o.indexOf(ku[a]),-1!==r&&(-1===n||r<n)&&(n=r);t=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n),-1!==t&&(e=o.slice(0,t),o=o.slice(t+1),this.auth=e),n=-1;for(let a=0;a<Eu.length;a++)r=o.indexOf(Eu[a]),-1!==r&&(-1===n||r<n)&&(n=r);-1===n&&(n=o.length),":"===o[n-1]&&n--;const i=o.slice(0,n);o=o.slice(n),this.parseHost(i),this.hostname=this.hostname||"";const s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){const e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){const n=e[t];if(n&&!n.match(Cu)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(Cu)){const r=e.slice(0,t),i=e.slice(t+1),s=n.match(Au);s&&(r.push(s[1]),i.unshift(s[2])),i.length&&(o=i.join(".")+o),this.hostname=r.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");-1!==a&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),Tu[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},yu.prototype.parseHost=function(e){let t=bu.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Du=Object.freeze(Object.defineProperty({__proto__:null,decode:pu,encode:mu,format:vu,parse:Ru},Symbol.toStringTag,{value:"Module"})),Iu=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Fu=/[\0-\x1F\x7F-\x9F]/,Ou=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Pu=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Mu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Lu=Object.freeze(Object.defineProperty({__proto__:null,Any:Iu,Cc:Fu,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:Ou,S:Pu,Z:Mu},Symbol.toStringTag,{value:"Module"})),zu=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ju=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Uu;const Bu=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),$u=null!==(Uu=String.fromCodePoint)&&void 0!==Uu?Uu:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var qu;!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(qu||(qu={}));var Gu,Vu,Ku;function Wu(e){return e>=qu.ZERO&&e<=qu.NINE}function Hu(e){return e>=qu.UPPER_A&&e<=qu.UPPER_F||e>=qu.LOWER_A&&e<=qu.LOWER_F}function Ju(e){return e===qu.EQUALS||function(e){return e>=qu.UPPER_A&&e<=qu.UPPER_Z||e>=qu.LOWER_A&&e<=qu.LOWER_Z||Wu(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(Gu||(Gu={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(Vu||(Vu={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(Ku||(Ku={}));class Xu{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Vu.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ku.Strict}startEntity(e){this.decodeMode=e,this.state=Vu.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Vu.EntityStart:return e.charCodeAt(t)===qu.NUM?(this.state=Vu.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Vu.NamedEntity,this.stateNamedEntity(e,t));case Vu.NumericStart:return this.stateNumericStart(e,t);case Vu.NumericDecimal:return this.stateNumericDecimal(e,t);case Vu.NumericHex:return this.stateNumericHex(e,t);case Vu.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===qu.LOWER_X?(this.state=Vu.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Vu.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){const i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Wu(r)&&!Hu(r))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3);t+=1}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Wu(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===qu.SEMI)this.consumed+=1;else if(this.decodeMode===Ku.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=Bu.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==qu.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let r=n[this.treeIndex],i=(r&Gu.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=Yu(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===Ku.Attribute&&(0===i||Ju(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Gu.VALUE_LENGTH)>>14,0!==i){if(o===qu.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ku.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,r=(n[t]&Gu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~Gu.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Vu.NamedEntity:return 0===this.result||this.decodeMode===Ku.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Vu.NumericDecimal:return this.emitNumericEntity(0,2);case Vu.NumericHex:return this.emitNumericEntity(0,3);case Vu.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Vu.EntityStart:return 0}}}function Qu(e){let t="";const n=new Xu(e,e=>t+=$u(e));return function(e,r){let i=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);const s=n.write(e,o+1);if(s<0){i=o+n.end();break}i=o+s,o=0===s?i+1:i}const s=t+e.slice(i);return t="",s}}function Yu(e,t,n,r){const i=(t&Gu.BRANCH_LENGTH)>>7,o=t&Gu.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){const t=r-o;return t<0||t>=i?-1:e[n+t]-1}let s=n,a=s+i-1;for(;s<=a;){const t=s+a>>>1,n=e[t];if(n<r)s=t+1;else{if(!(n>r))return e[t+i];a=t-1}}return-1}const Zu=Qu(zu);function ed(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}Qu(ju);const td=Object.prototype.hasOwnProperty;function nd(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function rd(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function id(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(!!(65535&~e&&65534!=(65535&e))&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function od(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const sd=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,ad=new RegExp(sd.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),ld=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function cd(e,t){if(35===t.charCodeAt(0)&&ld.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return id(n)?od(n):e}const n=function(e,t=Ku.Legacy){return Zu(e,t)}(e);return n!==e?n:e}function ud(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(ad,function(e,t,n){return t||cd(e,n)})}const dd=/[&<>"]/,fd=/[&<>"]/g,hd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function pd(e){return hd[e]}function gd(e){return dd.test(e)?e.replace(fd,pd):e}const md=/[.?*+^$[\]\\(){}|-]/g;function vd(e){switch(e){case 9:case 32:return!0}return!1}function yd(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function _d(e){return Ou.test(e)||Pu.test(e)}function bd(e){return _d(od(e))}function xd(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Sd(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function wd(e){return 32===e||9===e||10===e||13===e}function Ed(e){let t=0;for(;t<e.length&&wd(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&wd(e.charCodeAt(n));n--);return e.slice(t,n+1)}const kd={mdurl:Du,ucmicro:Lu},Cd=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:rd,asciiTrim:Ed,assign:nd,escapeHtml:gd,escapeRE:function(e){return e.replace(md,"\\$&")},fromCodePoint:od,has:function(e,t){return td.call(e,t)},isMdAsciiPunct:xd,isPunctChar:_d,isPunctCharCode:bd,isSpace:vd,isString:ed,isValidEntityCode:id,isWhiteSpace:yd,lib:kd,normalizeReference:Sd,unescapeAll:ud,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(sd,"$1")}},Symbol.toStringTag,{value:"Module"}));const Ad=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:function(e,t,n){let r,i=t;const o={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n;){if(r=e.charCodeAt(i),10===r)return o;if(60===r)return o;if(62===r)return o.pos=i+1,o.str=ud(e.slice(t+1,i)),o.ok=!0,o;92===r&&i+1<n?i+=2:i++}return o}let s=0;for(;i<n&&(r=e.charCodeAt(i),32!==r)&&!(r<32||127===r);)if(92===r&&i+1<n){if(32===e.charCodeAt(i+1))break;i+=2}else{if(40===r&&(s++,s>32))return o;if(41===r){if(0===s)break;s--}i++}return t===i||0!==s||(o.str=ud(e.slice(t,i)),o.pos=i,o.ok=!0),o},parseLinkLabel:function(e,t,n){let r,i,o,s;const a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),93===o&&(r--,0===r)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),91===o)if(s===e.pos-1)r++;else if(n)return e.pos=l,-1}let c=-1;return i&&(c=e.pos),e.pos=l,c},parseLinkTitle:function(e,t,n,r){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let r=e.charCodeAt(o);if(34!==r&&39!==r&&40!==r)return s;t++,o++,40===r&&(r=41),s.marker=r}for(;o<n;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=ud(e.slice(t,o)),s.ok=!0,s;if(40===i&&41===s.marker)return s;92===i&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=ud(e.slice(t,o)),s}},Symbol.toStringTag,{value:"Module"})),Nd={};function Td(){this.rules=nd({},Nd)}function Rd(){this.__rules__=[],this.__cache__=null}function Dd(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function Id(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Nd.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+gd(o.content)+"</code>"},Nd.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+gd(e[t].content)+"</code></pre>\n"},Nd.fence=function(e,t,n,r,i){const o=e[t],s=o.info?ud(o.info).trim():"";let a,l="",c="";if(s){const e=s.split(/(\s+)/g);l=e[0],c=e.slice(2).join("")}if(a=n.highlight&&n.highlight(o.content,l,c)||gd(o.content),0===a.indexOf("<pre"))return a+"\n";if(s){const e=o.attrIndex("class"),t=o.attrs?o.attrs.slice():[];e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l);const r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${a}</code></pre>\n`}return`<pre><code${i.renderAttrs(o)}>${a}</code></pre>\n`},Nd.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},Nd.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},Nd.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},Nd.text=function(e,t){return gd(e[t].content)},Nd.html_block=function(e,t){return e[t].content},Nd.html_inline=function(e,t){return e[t].content},Td.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+gd(e.attrs[t][0])+'="'+gd(e.attrs[t][1])+'"';return r},Td.prototype.renderToken=function(e,t,n){const r=e[t];let i="";if(r.hidden)return"";r.block&&-1!==r.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===r.nesting?"</":"<")+r.tag,i+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(i+=" /");let o=!1;if(r.block&&(o=!0,1===r.nesting&&t+1<e.length)){const n=e[t+1];("inline"===n.type||n.hidden||-1===n.nesting&&n.tag===r.tag)&&(o=!1)}return i+=o?">\n":">",i},Td.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const s=e[o].type;void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r},Td.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":case"html_inline":case"html_block":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"softbreak":case"hardbreak":r+="\n"}return r},Td.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const s=e[o].type;"inline"===s?r+=this.renderInline(e[o].children,t,n):void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r},Rd.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Rd.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},Rd.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},Rd.prototype.before=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Rd.prototype.after=function(e,t,n,r){const i=this.__find__(e),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},Rd.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Rd.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},Rd.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Rd.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(e){const r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},Rd.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},Dd.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},Dd.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Dd.prototype.attrSet=function(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Dd.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},Dd.prototype.attrJoin=function(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},Id.prototype.Token=Dd;const Fd=/\r\n?|\n/g,Od=/\0/g;function Pd(e){return/^<a[>\s]/i.test(e)}function Md(e){return/^<\/a\s*>/i.test(e)}const Ld=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,zd=/\((c|tm|r)\)/i,jd=/\((c|tm|r)\)/gi,Ud={c:"©",r:"®",tm:"™"};function Bd(e,t){return Ud[t.toLowerCase()]}function $d(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||(r.content=r.content.replace(jd,Bd)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}function qd(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||Ld.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}const Gd=/['"]/,Vd=/['"]/g;function Kd(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Wd(e,t){let n;const r=[],i={};for(let o=0;o<e.length;o++){const s=e[o],a=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,"text"!==s.type)continue;const l=s.content;let c=0;const u=l.length;e:for(;c<u;){Vd.lastIndex=c;const s=Vd.exec(l);if(!s)break;let d=!0,f=!0;c=s.index+1;const h="'"===s[0];let p=32;if(s.index-1>=0)p=l.charCodeAt(s.index-1);else for(n=o-1;n>=0&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n--)if(e[n].content){p=e[n].content.charCodeAt(e[n].content.length-1);break}let g=32;if(c<u)g=l.charCodeAt(c);else for(n=o+1;n<e.length&&("softbreak"!==e[n].type&&"hardbreak"!==e[n].type);n++)if(e[n].content){g=e[n].content.charCodeAt(0);break}const m=xd(p)||bd(p),v=xd(g)||bd(g),y=yd(p),_=yd(g);if(_?d=!1:v&&(y||m||(d=!1)),y?f=!1:m&&(_||v||(f=!1)),34===g&&'"'===s[0]&&p>=48&&p<=57&&(f=d=!1),d&&f&&(d=m,f=v),d||f){if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<a)break;if(e.single===h&&r[n].level===a){let a,l;e=r[n],h?(a=t.md.options.quotes[2],l=t.md.options.quotes[3]):(a=t.md.options.quotes[0],l=t.md.options.quotes[1]),Kd(i,o,s.index,l),Kd(i,e.token,e.pos,a),r.length=n;continue e}}d?r.push({token:o,pos:s.index,single:h,level:a}):f&&h&&Kd(i,o,s.index,"’")}else h&&Kd(i,o,s.index,"’")}}Object.keys(i).forEach(function(t){e[t].content=function(e,t){let n="",r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){const o=t[i];n+=e.slice(r,o.pos)+o.ch,r=o.pos+1}return n+e.slice(r)}(e[t].content,i[t])})}const Hd=[["normalize",function(e){let t;t=e.src.replace(Fd,"\n"),t=t.replace(Od,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const r=t[n];"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}],["linkify",function(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if("inline"!==t[n].type||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let o=r.length-1;o>=0;o--){const s=r[o];if("link_close"!==s.type){if("html_inline"===s.type&&(Pd(s.content)&&i>0&&i--,Md(s.content)&&i++),!(i>0)&&"text"===s.type&&e.md.linkify.test(s.content)){const i=s.content;let a=e.md.linkify.match(i);const l=[];let c=s.level,u=0;a.length>0&&0===a[0].index&&o>0&&"text_special"===r[o-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){const n=a[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let o=a[t].text;o=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(o)?e.md.normalizeLinkText(o):e.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const s=a[t].index;if(s>u){const t=new e.Token("text","",0);t.content=i.slice(u,s),t.level=c,l.push(t)}const d=new e.Token("link_open","a",1);d.attrs=[["href",r]],d.level=c++,d.markup="linkify",d.info="auto",l.push(d);const f=new e.Token("text","",0);f.content=o,f.level=c,l.push(f);const h=new e.Token("link_close","a",-1);h.level=--c,h.markup="linkify",h.info="auto",l.push(h),u=a[t].lastIndex}if(u<i.length){const t=new e.Token("text","",0);t.content=i.slice(u),t.level=c,l.push(t)}t[n].children=r=rd(r,o,l)}}else for(o--;r[o].level!==s.level&&"link_open"!==r[o].type;)o--}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(zd.test(e.tokens[t].content)&&$d(e.tokens[t].children),Ld.test(e.tokens[t].content)&&qd(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&Gd.test(e.tokens[t].content)&&Wd(e.tokens[t].children,e)}],["text_join",function(e){let t,n;const r=e.tokens,i=r.length;for(let o=0;o<i;o++){if("inline"!==r[o].type)continue;const e=r[o].children,i=e.length;for(t=0;t<i;t++)"text_special"===e[t].type&&(e[t].type="text");for(t=n=0;t<i;t++)"text"===e[t].type&&t+1<i&&"text"===e[t+1].type?e[t+1].content=e[t].content+e[t+1].content:(t!==n&&(e[n]=e[t]),n++);t!==n&&(e.length=n)}}]];function Jd(){this.ruler=new Rd;for(let e=0;e<Hd.length;e++)this.ruler.push(Hd[e][0],Hd[e][1])}function Xd(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,a=0,l=0,c=i.length,u=!1;s<c;s++){const e=i.charCodeAt(s);if(!u){if(vd(e)){a++,9===e?l+=4-l%4:l++;continue}u=!0}10!==e&&s!==c-1||(10!==e&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),u=!1,a=0,l=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Jd.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},Jd.prototype.State=Id,Xd.prototype.push=function(e,t,n){const r=new Dd(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Xd.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Xd.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Xd.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!vd(this.src.charCodeAt(e)))break}return e},Xd.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!vd(this.src.charCodeAt(--e)))return e+1;return e},Xd.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Xd.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},Xd.prototype.getLines=function(e,t,n,r){if(e>=t)return"";const i=new Array(t-e);for(let o=0,s=e;s<t;s++,o++){let e=0;const a=this.bMarks[s];let l,c=a;for(l=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];c<l&&e<n;){const t=this.src.charCodeAt(c);if(vd(t))9===t?e+=4-(e+this.bsCount[s])%4:e++;else{if(!(c-a<this.tShift[s]))break;e++}c++}i[o]=e>n?new Array(e-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return i.join("")},Xd.prototype.Token=Dd;function Qd(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Yd(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)124===i&&(o?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),o=92===i,r++,i=e.charCodeAt(r);return t.push(a+e.substring(s)),t}function Zd(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(42!==i&&45!==i&&43!==i)return-1;if(r<n){if(!vd(e.src.charCodeAt(r)))return-1}return r}function ef(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),!(o>=48&&o<=57)){if(41===o||46===o)break;return-1}if(i-n>=10)return-1}return i<r&&(o=e.src.charCodeAt(i),!vd(o))?-1:i}const tf="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",nf="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",rf=new RegExp("^(?:"+tf+"|"+nf+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),of=new RegExp("^(?:"+tf+"|"+nf+")"),sf=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(of.source+"\\s*$"),/^$/,!1]];const af=[["table",function(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent)return!1;if(e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(124!==s&&45!==s&&58!==s)return!1;if(o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a&&!vd(a))return!1;if(45===s&&vd(a))return!1;for(;o<e.eMarks[i];){const t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!vd(t))return!1;o++}let l=Qd(e,t+1),c=l.split("|");const u=[];for(let v=0;v<c.length;v++){const e=c[v].trim();if(!e){if(0===v||v===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(e))return!1;58===e.charCodeAt(e.length-1)?u.push(58===e.charCodeAt(0)?"center":"right"):58===e.charCodeAt(0)?u.push("left"):u.push("")}if(l=Qd(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=Yd(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop();const d=c.length;if(0===d||d!==u.length)return!1;if(r)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=[t,0];e.push("table_open","table",1).map=p,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let v=0;v<c.length;v++){const t=e.push("th_open","th",1);u[v]&&(t.attrs=[["style","text-align:"+u[v]]]);const n=e.push("inline","",0);n.content=c[v].trim(),n.children=[],e.push("th_close","th",-1)}let g;e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,o=h.length;t<o;t++)if(h[t](e,i,n,!0)){r=!0;break}if(r)break;if(l=Qd(e,i).trim(),!l)break;if(e.sCount[i]-e.blkIndent>=4)break;if(c=Yd(l),c.length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),m+=d-c.length,m>65536)break;if(i===t+2){e.push("tbody_open","tbody",1).map=g=[t+2,0]}e.push("tr_open","tr",1).map=[i,i+1];for(let t=0;t<d;t++){const n=e.push("td_open","td",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);const r=e.push("inline","",0);r.content=c[t]?c[t].trim():"",r.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=i),e.push("table_close","table",-1),p[1]=i,e.parentType=f,e.line=i,!0},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;)if(e.isEmpty(r))r++;else{if(!(e.sCount[r]-e.blkIndent>=4))break;r++,i=r}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}],["fence",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(i+3>o)return!1;const s=e.src.charCodeAt(i);if(126!==s&&96!==s)return!1;let a=i;i=e.skipChars(i,s);let l=i-a;if(l<3)return!1;const c=e.src.slice(a,i),u=e.src.slice(i,o);if(96===s&&u.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;(d++,!(d>=n))&&(i=a=e.bMarks[d]+e.tShift[d],o=e.eMarks[d],!(i<o&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[d]-e.blkIndent>=4||(i=e.skipChars(i,s),i-a<l||(i=e.skipSpaces(i),i<o)))){f=!0;break}l=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,l,!0),h.markup=c,h.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(i))return!1;if(r)return!0;const a=[],l=[],c=[],u=[],d=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h,p=!1;for(h=t;h<n;h++){const t=e.sCount[h]<e.blkIndent;if(i=e.bMarks[h]+e.tShift[h],o=e.eMarks[h],i>=o)break;if(62===e.src.charCodeAt(i++)&&!t){let t,n,r=e.sCount[h]+1;32===e.src.charCodeAt(i)?(i++,r++,n=!1,t=!0):9===e.src.charCodeAt(i)?(t=!0,(e.bsCount[h]+r)%4==3?(i++,r++,n=!1):n=!0):t=!1;let s=r;for(a.push(e.bMarks[h]),e.bMarks[h]=i;i<o;){const t=e.src.charCodeAt(i);if(!vd(t))break;9===t?s+=4-(s+e.bsCount[h]+(n?1:0))%4:s++,i++}p=i>=o,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(t?1:0),c.push(e.sCount[h]),e.sCount[h]=s-r,u.push(e.tShift[h]),e.tShift[h]=i-e.bMarks[h];continue}if(p)break;let r=!1;for(let i=0,o=d.length;i<o;i++)if(d[i](e,h,n,!0)){r=!0;break}if(r){e.lineMax=h,0!==e.blkIndent&&(a.push(e.bMarks[h]),l.push(e.bsCount[h]),u.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]-=e.blkIndent);break}a.push(e.bMarks[h]),l.push(e.bsCount[h]),u.push(e.tShift[h]),c.push(e.sCount[h]),e.sCount[h]=-1}const g=e.blkIndent;e.blkIndent=0;const m=e.push("blockquote_open","blockquote",1);m.markup=">";const v=[t,0];m.map=v,e.md.block.tokenize(e,t,h),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=s,e.parentType=f,v[1]=e.line;for(let y=0;y<u.length;y++)e.bMarks[y+t]=a[y],e.tShift[y+t]=u[y],e.sCount[y+t]=c[y],e.bsCount[y+t]=l[y];return e.blkIndent=g,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(42!==s&&45!==s&&95!==s)return!1;let a=1;for(;o<i;){const t=e.src.charCodeAt(o++);if(t!==s&&!vd(t))return!1;t===s&&a++}if(a<3)return!1;if(r)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let i,o,s,a,l=t,c=!0;if(e.sCount[l]-e.blkIndent>=4)return!1;if(e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u,d,f,h=!1;if(r&&"paragraph"===e.parentType&&e.sCount[l]>=e.blkIndent&&(h=!0),(f=ef(e,l))>=0){if(u=!0,s=e.bMarks[l]+e.tShift[l],d=Number(e.src.slice(s,f-1)),h&&1!==d)return!1}else{if(!((f=Zd(e,l))>=0))return!1;u=!1}if(h&&e.skipSpaces(f)>=e.eMarks[l])return!1;if(r)return!0;const p=e.src.charCodeAt(f-1),g=e.tokens.length;u?(a=e.push("ordered_list_open","ol",1),1!==d&&(a.attrs=[["start",d]])):a=e.push("bullet_list_open","ul",1);const m=[l,0];a.map=m,a.markup=String.fromCharCode(p);let v=!1;const y=e.md.block.ruler.getRules("list"),_=e.parentType;for(e.parentType="list";l<n;){o=f,i=e.eMarks[l];const t=e.sCount[l]+f-(e.bMarks[l]+e.tShift[l]);let r=t;for(;o<i;){const t=e.src.charCodeAt(o);if(9===t)r+=4-(r+e.bsCount[l])%4;else{if(32!==t)break;r++}o++}const d=o;let h;h=d>=i?1:r-t,h>4&&(h=1);const g=t+h;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);const m=[l,0];a.map=m,u&&(a.info=e.src.slice(s,f-1));const _=e.tight,b=e.tShift[l],x=e.sCount[l],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=g,e.tight=!0,e.tShift[l]=d-e.bMarks[l],e.sCount[l]=r,d>=i&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),e.tight&&!v||(c=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[l]=b,e.sCount[l]=x,e.tight=_,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=e.line,m[1]=l,l>=n)break;if(e.sCount[l]<e.blkIndent)break;if(e.sCount[l]-e.blkIndent>=4)break;let w=!1;for(let i=0,o=y.length;i<o;i++)if(y[i](e,l,n,!0)){w=!0;break}if(w)break;if(u){if(f=ef(e,l),f<0)break;s=e.bMarks[l]+e.tShift[l]}else if(f=Zd(e,l),f<0)break;if(p!==e.src.charCodeAt(f-1))break}return a=u?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),m[1]=l,e.line=l,e.parentType=_,c&&function(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}(e,g),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(i))return!1;function a(t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){const r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let o=!1;for(let s=0,a=r.length;s<a;s++)if(r[s](e,t,n,!0)){o=!0;break}if(e.parentType=i,o)return null}const i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(i,o+1)}let l=e.src.slice(i,o+1);o=l.length;let c=-1;for(i=1;i<o;i++){const e=l.charCodeAt(i);if(91===e)return!1;if(93===e){c=i;break}if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(92===e&&(i++,i<o&&10===l.charCodeAt(i))){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}}if(c<0||58!==l.charCodeAt(c+1))return!1;for(i=c+2;i<o;i++){const e=l.charCodeAt(i);if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(!vd(e))break}const u=e.md.helpers.parseLinkDestination(l,i,o);if(!u.ok)return!1;const d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;const f=i,h=s,p=i;for(;i<o;i++){const e=l.charCodeAt(i);if(10===e){const e=a(s);null!==e&&(l+=e,o=l.length,s++)}else if(!vd(e))break}let g,m=e.md.helpers.parseLinkTitle(l,i,o);for(;m.can_continue;){const t=a(s);if(null===t)break;l+=t,i=o,o=l.length,s++,m=e.md.helpers.parseLinkTitle(l,i,o,m)}for(i<o&&p!==i&&m.ok?(g=m.str,i=m.pos):(g="",i=f,s=h);i<o;){if(!vd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i)&&g)for(g="",i=f,s=h;i<o;){if(!vd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i))return!1;const v=Sd(l.slice(1,c));return!!v&&(r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[v]&&(e.env.references[v]={title:g,href:d}),e.line=s),!0)}],["html_block",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(i))return!1;let s=e.src.slice(i,o),a=0;for(;a<sf.length&&!sf[a][0].test(s);a++);if(a===sf.length)return!1;if(r)return sf[a][2];let l=t+1;const c=sf[a][1].test("");if(!sf[a][1].test(s))for(;l<n&&(!(e.sCount[l]<e.blkIndent)||!c&&e.isEmpty(l));l++)if(i=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],s=e.src.slice(i,o),sf[a][1].test(s)){0!==s.length&&l++;break}e.line=l;const u=e.push("html_block","",0);return u.map=[t,l],u.content=e.getLines(t,l,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(35!==s||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);35===s&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!vd(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const l=e.skipCharsBack(o,35,i);l>i&&vd(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=Ed(e.src.slice(i,o)),u.map=[t,e.line],u.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o,s=0,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a];const n=e.eMarks[a];if(t<n&&(o=e.src.charCodeAt(t),(45===o||61===o)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){s=61===o?1:2;break}}if(e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}if(!s)return e.parentType=i,!1;const l=Ed(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const c=e.push("heading_open","h"+String(s),1);c.markup=String.fromCharCode(o),c.map=[t,e.line];const u=e.push("inline","",0);return u.content=l,u.map=[t,e.line-1],u.children=[],e.push("heading_close","h"+String(s),-1).markup=String.fromCharCode(o),e.parentType=i,!0}],["paragraph",function(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3)continue;if(e.sCount[o]<0)continue;let t=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,o,n,!0)){t=!0;break}if(t)break}const s=Ed(e.getLines(t,o,e.blkIndent,!1));e.line=o,e.push("paragraph_open","p",1).map=[t,e.line];const a=e.push("inline","",0);return a.content=s,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}]];function lf(){this.ruler=new Rd;for(let e=0;e<af.length;e++)this.ruler.push(af[e][0],af[e][1],{alt:(af[e][2]||[]).slice()})}function cf(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}function uf(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}lf.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting;let s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n))&&!(e.sCount[s]<e.blkIndent);){if(e.level>=o){e.line=n;break}const t=e.line;let l=!1;for(let o=0;o<i;o++)if(l=r[o](e,s,n,!1),l){if(t>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}},lf.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},lf.prototype.State=Xd,cf.prototype.pushPending=function(){const e=new Dd("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},cf.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Dd(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},cf.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let i;if(0===e)i=32;else if(1===e)i=this.src.charCodeAt(0),55296==(63488&i)&&(i=65533);else if(i=this.src.charCodeAt(e-1),56320==(64512&i)){const t=this.src.charCodeAt(e-2);i=55296==(64512&t)?65536+(t-55296<<10)+(i-56320):65533}else 55296==(64512&i)&&(i=65533);let o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;const s=o-e;let a=o<n?this.src.charCodeAt(o):32;if(55296==(64512&a)){const e=this.src.charCodeAt(o+1);a=56320==(64512&e)?65536+(a-55296<<10)+(e-56320):65533}else 56320==(64512&a)&&(a=65533);const l=xd(i)||bd(i),c=xd(a)||bd(a),u=yd(i),d=yd(a),f=!d&&(!c||u||l),h=!u&&(!l||d||c);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||c),length:s}},cf.prototype.Token=Dd;const df=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const ff=[];for(let Oxe=0;Oxe<256;Oxe++)ff.push(0);function hf(e,t){let n;const r=[],i=t.length;for(let o=0;o<i;o++){const i=t[o];if(126!==i.marker)continue;if(-1===i.end)continue;const s=t[i.end];n=e.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&r.push(s.token-1)}for(;r.length;){const t=r.pop();let i=t+1;for(;i<e.tokens.length&&"s_close"===e.tokens[i].type;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){ff[e.charCodeAt(0)]=1});const pf={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(126!==r)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=s,o--);for(let l=0;l<o;l+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;hf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&hf(e,t[r].delimiters)}};function gf(e,t){for(let n=t.length-1;n>=0;n--){const r=t[n];if(95!==r.marker&&42!==r.marker)continue;if(-1===r.end)continue;const i=t[r.end],o=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1,s=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?s+s:s,a.content="";const l=e.tokens[i.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?s+s:s,l.content="",o&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}const mf={tokenize:function(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t)return!1;if(95!==r&&42!==r)return!1;const i=e.scanDelims(e.pos,42===r);for(let o=0;o<i.length;o++){e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0},postProcess:function(e){const t=e.tokens_meta,n=e.tokens_meta.length;gf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&gf(e,t[r].delimiters)}};const vf=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,yf=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const _f=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,bf=/^&([a-z][a-z0-9]{1,31});/i;function xf(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;s<n;s++){const n=e[s];if(o.push(0),e[r].marker===n.marker&&i===n.token-1||(r=s),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[n.marker][(n.open?3:0)+n.length%3];let l=r-o[r]-1,c=l;for(;l>a;l-=o[l]+1){const t=e[l];if(t.marker===n.marker&&(t.open&&t.end<0)){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3==0&&n.length%3==0||(r=!0)),!r){const r=l>0&&!e[l-1].open?o[l-1]+1:0;o[s]=s-l+r,o[l]=r,n.open=!1,t.end=s,t.close=!1,c=-1,i=-2;break}}}-1!==c&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}const Sf=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!uf(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["linkify",function(e,t){if(!e.md.options.linkify)return!1;if(e.linkLevel>0)return!1;const n=e.pos;if(n+3>e.posMax)return!1;if(58!==e.src.charCodeAt(n))return!1;if(47!==e.src.charCodeAt(n+1))return!1;if(47!==e.src.charCodeAt(n+2))return!1;const r=e.pending.match(df);if(!r)return!1;const i=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-i.length));if(!o)return!1;let s=o.url;if(s.length<=i.length)return!1;let a=s.length;for(;a>0&&42===s.charCodeAt(a-1);)a--;a!==s.length&&(s=s.slice(0,a));const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);const t=e.push("link_open","a",1);t.attrs=[["href",l]],t.markup="linkify",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(s);const n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return e.pos+=s.length-i.length,!0}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&32===e.pending.charCodeAt(r))if(r>=1&&32===e.pending.charCodeAt(r-1)){let t=r-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&vd(e.src.charCodeAt(n));)n++;return e.pos=n,!0}],["escape",function(e,t){let n=e.pos;const r=e.posMax;if(92!==e.src.charCodeAt(n))return!1;if(n++,n>=r)return!1;let i=e.src.charCodeAt(n);if(10===i){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),vd(i));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const t=e.push("text_special","",0);i<256&&0!==ff[i]?t.content=o:t.content=s,t.markup=s,t.info="escape"}return e.pos=n+1,!0}],["backticks",function(e,t){let n=e.pos;if(96!==e.src.charCodeAt(n))return!1;const r=n;n++;const i=e.posMax;for(;n<i&&96===e.src.charCodeAt(n);)n++;const o=e.src.slice(r,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=r)return t||(e.pending+=o),e.pos+=s,!0;let a,l=n;for(;-1!==(a=e.src.indexOf("`",l));){for(l=a+1;l<i&&96===e.src.charCodeAt(l);)l++;const r=l-a;if(r===s){if(!t){const t=e.push("code_inline","code",0);t.markup=o,t.content=e.src.slice(n,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[r]=a}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}],["strikethrough",pf.tokenize],["emphasis",mf.tokenize],["link",function(e,t){let n,r,i,o,s="",a="",l=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&40===e.src.charCodeAt(p)){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),vd(n)||10===n);p++);if(p>=d)return!1;if(l=p,i=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?p=i.pos:s="",l=p;p<d&&(n=e.src.charCodeAt(p),vd(n)||10===n);p++);if(i=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<d&&l!==p&&i.ok)for(a=i.str,p=i.pos;p<d&&(n=e.src.charCodeAt(p),vd(n)||10===n);p++);}(p>=d||41!==e.src.charCodeAt(p))&&(c=!0),p++}if(c){if(void 0===e.env.references)return!1;if(p<d&&91===e.src.charCodeAt(p)?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?r=e.src.slice(l,p++):p=h+1):p=h+1,r||(r=e.src.slice(f,h)),o=e.env.references[Sd(r)],!o)return e.pos=u,!1;s=o.href,a=o.title}if(!t){e.pos=f,e.posMax=h;const t=[["href",s]];e.push("link_open","a",1).attrs=t,a&&t.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}],["image",function(e,t){let n,r,i,o,s,a,l,c,u="";const d=e.pos,f=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&40===e.src.charCodeAt(o)){for(o++;o<f&&(n=e.src.charCodeAt(o),vd(n)||10===n);o++);if(o>=f)return!1;for(c=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?o=a.pos:u=""),c=o;o<f&&(n=e.src.charCodeAt(o),vd(n)||10===n);o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<f&&(n=e.src.charCodeAt(o),vd(n)||10===n);o++);else l="";if(o>=f||41!==e.src.charCodeAt(o))return e.pos=d,!1;o++}else{if(void 0===e.env.references)return!1;if(o<f&&91===e.src.charCodeAt(o)?(c=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(c,o++):o=p+1):o=p+1,i||(i=e.src.slice(h,p)),s=e.env.references[Sd(i)],!s)return e.pos=d,!1;u=s.href,l=s.title}if(!t){r=e.src.slice(h,p);const t=[];e.md.inline.parse(r,e.md,e.env,t);const n=e.push("image","img",0),i=[["src",u],["alt",""]];n.attrs=i,n.children=t,n.content=r,l&&i.push(["title",l])}return e.pos=o,e.posMax=f,!0}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break}const o=e.src.slice(r+1,n);if(yf.test(o)){const n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}if(vf.test(o)){const n=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(n))return!1;if(!t){const t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto";e.push("text","",0).content=e.md.normalizeLinkText(o);const r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}return!1}],["html_inline",function(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(60!==e.src.charCodeAt(r)||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(33!==i&&63!==i&&47!==i&&!function(e){const t=32|e;return t>=97&&t<=122}(i))return!1;const o=e.src.slice(r).match(rf);if(!o)return!1;if(!t){const t=e.push("html_inline","",0);t.content=o[0],function(e){return/^<a[>\s]/i.test(e)}(t.content)&&e.linkLevel++,function(e){return/^<\/a\s*>/i.test(e)}(t.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}],["entity",function(e,t){const n=e.pos,r=e.posMax;if(38!==e.src.charCodeAt(n))return!1;if(n+1>=r)return!1;if(35===e.src.charCodeAt(n+1)){const r=e.src.slice(n).match(_f);if(r){if(!t){const t="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push("text_special","",0);n.content=id(t)?od(t):od(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(bf);if(r){const n=function(e){return Zu(e,Ku.Strict)}(r[0]);if(n!==r[0]){if(!t){const t=e.push("text_special","",0);t.content=n,t.markup=r[0],t.info="entity"}return e.pos+=r[0].length,!0}}}return!1}]],wf=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;xf(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&xf(t[r].delimiters)}],["strikethrough",pf.postProcess],["emphasis",mf.postProcess],["fragments_join",function(e){let t,n,r=0;const i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<o&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}]];function Ef(){this.ruler=new Rd;for(let e=0;e<Sf.length;e++)this.ruler.push(Sf[e][0],Sf[e][1]);this.ruler2=new Rd;for(let e=0;e<wf.length;e++)this.ruler2.push(wf[e][0],wf[e][1])}function kf(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Cf(e){return Object.prototype.toString.call(e)}function Af(e){return"[object Function]"===Cf(e)}function Nf(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}Ef.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(void 0!==o[t])return void(e.pos=o[t]);let s=!1;if(e.level<i){for(let a=0;a<r;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos},Ef.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const o=e.pos;let s=!1;if(e.level<i)for(let r=0;r<n;r++)if(s=t[r](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}if(s){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ef.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)},Ef.prototype.State=cf;const Tf={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const Rf={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Df="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function If(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=Iu.source,t.src_Cc=Fu.source,t.src_Z=Mu.source,t.src_P=Ou.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){const n=e.__schemas__[t];if(null===n)return;const r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===Cf(n))return!function(e){return"[object RegExp]"===Cf(e)}(n.validate)?Af(n.validate)?r.validate=n.validate:o(t,n):r.validate=function(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(Af(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Cf(e)}(n)?o(t,n):i.push(t)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};const s=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Nf).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function Ff(e,t,n,r){const i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Of(e,t){if(!(this instanceof Of))return new Of(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||Tf.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=kf({},Tf,t),this.__schemas__=kf({},Rf,e),this.__compiled__={},this.__tlds__=Df,this.__tlds_replaced__=!1,this.re={},If(this)}Of.prototype.add=function(e,t){return this.__schemas__[e]=t,If(this),this},Of.prototype.set=function(e){return this.__opts__=kf(this.__opts__,e),this},Of.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e))for(n=this.re.schema_search,n.lastIndex=0;null!==(t=n.exec(e));)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&null!==e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))||!!(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==e.match(this.re.email_fuzzy))},Of.prototype.pretest=function(e){return this.re.pretest.test(e)},Of.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Of.prototype.match=function(e){const t=[],n=[],r=[],i=[];let o,s,a;function l(e,t){return e?t?e.index!==t.index?e.index<t.index?e:t:e.lastIndex>=t.lastIndex?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;null!==(o=a.exec(e));)s=this.testSchemaAt(e,o[2],a.lastIndex),s&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(e));)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;null!==(o=a.exec(e));)i.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const c=[0,0,0];let u=0;for(;;){const o=[n[c[0]],i[c[1]],r[c[2]]],s=l(l(o[0],o[1]),o[2]);if(!s)break;if(s===o[0]?c[0]++:s===o[1]?c[1]++:c[2]++,s.index<u)continue;const a=new Ff(e,s.schema,s.index,s.lastIndex);this.__compiled__[a.schema].normalize(a,this),t.push(a),u=s.lastIndex}return t.length?t:null},Of.prototype.matchAtStart=function(e){if(!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new Ff(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Of.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),If(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,If(this),this)},Of.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Of.prototype.onCompile=function(){};const Pf=2147483647,Mf=36,Lf=/^xn--/,zf=/[^\0-\x7F]/,jf=/[\x2E\u3002\uFF0E\uFF61]/g,Uf={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Bf=Math.floor,$f=String.fromCharCode;function qf(e){throw new RangeError(Uf[e])}function Gf(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const i=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(jf,".")).split("."),t).join(".");return r+i}function Vf(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t}const Kf=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:Mf},Wf=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},Hf=function(e,t,n){let r=0;for(e=n?Bf(e/700):e>>1,e+=Bf(e/t);e>455;r+=Mf)e=Bf(e/35);return Bf(r+36*e/(e+38))},Jf=function(e){const t=[],n=e.length;let r=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&qf("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const s=r;for(let t=1,i=Mf;;i+=Mf){a>=n&&qf("invalid-input");const s=Kf(e.charCodeAt(a++));s>=Mf&&qf("invalid-input"),s>Bf((Pf-r)/t)&&qf("overflow"),r+=s*t;const l=i<=o?1:i>=o+26?26:i-o;if(s<l)break;const c=Mf-l;t>Bf(Pf/c)&&qf("overflow"),t*=c}const l=t.length+1;o=Hf(r-s,l,0==s),Bf(r/l)>Pf-i&&qf("overflow"),i+=Bf(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Xf=function(e){const t=[],n=(e=Vf(e)).length;let r=128,i=0,o=72;for(const l of e)l<128&&t.push($f(l));const s=t.length;let a=s;for(s&&t.push("-");a<n;){let n=Pf;for(const t of e)t>=r&&t<n&&(n=t);const l=a+1;n-r>Bf((Pf-i)/l)&&qf("overflow"),i+=(n-r)*l,r=n;for(const c of e)if(c<r&&++i>Pf&&qf("overflow"),c===r){let e=i;for(let n=Mf;;n+=Mf){const r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;const i=e-r,s=Mf-r;t.push($f(Wf(r+i%s,0))),e=Bf(i/s)}t.push($f(Wf(e,0))),o=Hf(i,l,a===s),i=0,++a}++i,++r}return t.join("")},Qf=function(e){return Gf(e,function(e){return zf.test(e)?"xn--"+Xf(e):e})},Yf=function(e){return Gf(e,function(e){return Lf.test(e)?Jf(e.slice(4).toLowerCase()):e})},Zf={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},eh=/^(vbscript|javascript|file|data):/,th=/^data:image\/(gif|png|jpeg|webp);/;function nh(e){const t=e.trim().toLowerCase();return!eh.test(t)||th.test(t)}const rh=["http:","https:","mailto:"];function ih(e){const t=Ru(e,!0);if(t.hostname&&(!t.protocol||rh.indexOf(t.protocol)>=0))try{t.hostname=Qf(t.hostname)}catch(Sy){}return mu(vu(t))}function oh(e){const t=Ru(e,!0);if(t.hostname&&(!t.protocol||rh.indexOf(t.protocol)>=0))try{t.hostname=Yf(t.hostname)}catch(Sy){}return pu(vu(t),pu.defaultChars+"%")}function sh(e,t){if(!(this instanceof sh))return new sh(e,t);t||ed(e)||(t=e||{},e="default"),this.inline=new Ef,this.block=new lf,this.core=new Jd,this.renderer=new Td,this.linkify=new Of,this.validateLink=nh,this.normalizeLink=ih,this.normalizeLinkText=oh,this.utils=Cd,this.helpers=nd({},Ad),this.options={},this.configure(e),t&&this.set(t)}function ah(e){return"var("+e+")"}sh.prototype.set=function(e){return nd(this.options,e),this},sh.prototype.configure=function(e){const t=this;if(ed(e)){const t=e;if(!(e=Zf[t]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},sh.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},sh.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},sh.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},sh.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},sh.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},sh.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},sh.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let lh=lo([ci("color",ah(yt.textPrimary)),ci("font-size",ah(bt.sizeSm)),ci("line-height",ah(bt.lineHeightRelaxed)),ci("word-break","break-word"),Ki("& > :first-child",[ci("margin-top","0")]),Ki("& > :last-child",[ci("margin-bottom","0")]),Ki("& h1, & h2, & h3, & h4, & h5, & h6",[ci("margin","var("+_t.md+") 0 var("+_t.sm+")"),ci("line-height",ah(bt.lineHeightTight)),ci("font-weight",ah(bt.weightBold))]),Ki("& h1",[ci("font-size",ah(bt.sizeXl))]),Ki("& h2",[ci("font-size",ah(bt.sizeLg))]),Ki("& h3, & h4, & h5, & h6",[ci("font-size",ah(bt.sizeMd))]),Ki("& p",[ci("margin","var("+_t.sm+") 0")]),Ki("& a",[ci("color",ah(yt.brand)),ci("text-decoration","none")]),Ki("& a:hover",[ci("text-decoration","underline")]),Ki("& ul, & ol",[ci("margin","var("+_t.sm+") 0"),ci("padding-left","1.5em")]),Ki("& li",[ci("margin","var("+_t.xs+") 0")]),Ki("& code",[ci("font-family",ah(bt.fontFamilyMono)),ci("font-size","0.9em"),ci("background",ah(yt.surfaceSubtle)),ci("padding","1px 4px"),ci("border-radius",ah(xt.sm))]),Ki("& pre",[ci("background",ah(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",ah(xt.md)),ci("padding",ah(_t.md)),ci("overflow","auto"),ci("margin","var("+_t.sm+") 0")]),Ki("& pre code",[ci("background","none"),ci("padding","0")]),Ki("& blockquote",[ci("margin","var("+_t.sm+") 0"),ci("padding-left",ah(_t.md)),ci("border-left","3px solid var("+yt.border+")"),ci("color",ah(yt.textSecondary))]),Ki("& table",[ci("border-collapse","collapse"),ci("margin","var("+_t.sm+") 0")]),Ki("& th, & td",[ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("text-align","left")]),Ki("& th",[ci("background",ah(yt.surfaceSubtle)),ci("font-weight",ah(bt.weightMedium))]),Ki("& img",[ci("max-width","100%"),ci("border-radius",ah(xt.sm))]),Ki("& hr",[ci("border","none"),ci("border-top","1px solid var("+yt.borderSubtle+")"),ci("margin","var("+_t.md+") 0")])]),ch=new sh({html:!1,linkify:!0});let uh=function(e){let t=e.source,n=p(()=>ch.render(t),[t]),r=h(null);return a(()=>{M(R(r.current),e=>{Array.from(e.querySelectorAll("a")).forEach(e=>{e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer")})})},[n]),i("div",{ref:T(r),className:lh,dangerouslySetInnerHTML:{__html:n}})};function dh(e,t){return i(uh,{source:e.body})}function fh(e){return Array.from(e).length}function hh(e,t){let n=Array.from(e),r=t<0?0:t;return n.length<=r?[e,""]:[n.slice(0,r).join(""),n.slice(r).join("")]}function ph(e,t){return j(t,t=>{let n=hh(e,t)[1];return""===n?void 0:n})}function gh(e){return"var("+e+")"}let mh=lo([pi("flex"),gi("column"),ci("gap","4px")]),vh=lo([ci("background",gh(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",gh(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("font-family","inherit"),ci("font-size",gh(bt.sizeMd)),ci("line-height",gh(bt.lineHeightNormal)),ci("color",gh(yt.textPrimary)),ci("outline","none"),ci("resize","vertical"),Gi({NAME:"percent",VAL:100}),ci("box-sizing","border-box"),ci("transition","border-color 120ms"),Ji([ci("border-color",gh(yt.brand))])]),yh=lo([ci("border-color",gh(yt.error)),Ji([ci("border-color",gh(yt.error))])]),_h=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",gh(_t.sm)),ci("font-size",gh(bt.sizeXs)),ci("color",gh(yt.textSecondary))]),bh=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("color",gh(yt.textSecondary))]),xh=lo([ci("font-variant-numeric","tabular-nums")]),Sh=lo([ci("color",gh(yt.error)),ci("font-weight",gh(bt.weightMedium))]),wh=lo([ci("background",gh(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-left","3px solid var("+yt.error+")"),ci("border-radius",gh(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("font-size",gh(bt.sizeXs)),ci("line-height",gh(bt.lineHeightNormal)),ci("white-space","pre-wrap"),ci("word-break","break-word"),ci("max-height","8em"),ci("overflow","auto")]),Eh=lo([ci("color",gh(yt.textSecondary)),ci("font-size",gh(bt.sizeXs)),Ti(eo(2))]),kh=lo([ci("color",gh(yt.textPrimary))]),Ch=lo([ci("color",gh(yt.error)),ci("font-weight",gh(bt.weightMedium))]),Ah=lo([ci("color",gh(yt.textDisabled)),ci("text-decoration","line-through")]);function Nh(e){return e.toString()+" character"+(1===e?"":"s")}function Th(e,t){return void 0!==t?e>t?(e-t|0).toString()+" over the "+t.toString()+"-character limit":e.toString()+" / "+t.toString():e.toString()+" characters"}let Rh=function(e){let t,n=e.note,o=e.hasError,s=e.rows,a=e.channelLabel,l=e.maxLength,c=e.onBlur,u=e.onChange,d=e.value,f=void 0!==c?c:()=>{},h=void 0!==s?s:6,p=void 0!==o&&o,g=Array.from(d).length,m=ph(d,l),v=$(m),y=p||v?vh+" "+yh:vh;if(void 0!==m&&void 0!==l){let e=hh(d,l);t=r("div",{children:[i("div",{children:"Sent as:",className:Eh}),r("div",{children:[i("span",{children:e[0],className:kh}),i("span",{children:"✂",className:Ch}),i("span",{children:m,className:Ah})],className:wh})]})}else t=null;return r("div",{children:[i("textarea",{className:y,name:e.name,placeholder:e.placeholder,rows:h,value:d,onBlur:e=>f(),onChange:e=>u(e.target.value)}),r("div",{children:[r("span",{children:[void 0!==a?a:null,void 0!==n?$(a)?" · "+n:n:null],className:bh}),i("span",{children:Th(g,l),className:v?xh+" "+Sh:xh})],className:_h}),t],className:mh})};function Dh(e){return"var("+e+")"}jc({id:"email",label:"Email",constraints:{subjectMaxLength:78,note:"Subject lines are elided in inbox lists past ~78 characters"},preview:fu}),jc({id:"markdown",label:"Markdown",constraints:{},preview:dh});let Ih=lo([pi("flex"),gi("column"),ci("gap",Dh(_t.sm)),ci("background",Dh(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Dh(xt.md)),ci("padding",Dh(_t.md))]),Fh=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",Dh(_t.sm))]),Oh=lo([ci("font-size",Dh(bt.sizeSm)),ci("font-weight",Dh(bt.weightMedium)),ci("color",Dh(yt.textPrimary))]),Ph=lo([ci("font-size",Dh(bt.sizeXs)),ci("color",Dh(yt.textSecondary))]),Mh=lo([ci("font-size",Dh(bt.sizeXs)),ci("color",Dh(yt.textSecondary)),ci("font-variant-numeric","tabular-nums"),ci("white-space","nowrap")]),Lh=lo([ci("color",Dh(yt.error)),ci("font-weight",Dh(bt.weightMedium))]),zh=lo([pi("flex"),ui("baseline"),bi("spaceBetween"),ci("gap",Dh(_t.sm)),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),ci("padding-bottom",Dh(_t.xs))]),jh=lo([ci("font-size",Dh(bt.sizeMd)),ci("font-weight",Dh(bt.weightMedium)),ci("color",Dh(yt.textPrimary)),ci("word-break","break-word")]),Uh=lo([ci("color",Dh(yt.textDisabled)),ci("text-decoration","line-through")]),Bh=lo([ci("color",Dh(yt.error)),ci("font-weight",Dh(bt.weightMedium))]),$h=lo([ci("margin","0"),ci("font-family","inherit"),ci("font-size",Dh(bt.sizeSm)),ci("line-height",Dh(bt.lineHeightRelaxed)),ci("color",Dh(yt.textPrimary)),ci("white-space","pre-wrap"),ci("word-break","break-word")]),qh=lo([ci("max-width","100%"),ci("border-radius",Dh(xt.sm)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("object-fit","cover")]),Gh=lo([ci("font-size",Dh(bt.sizeXs)),ci("color",Dh(yt.error)),ci("background",Dh(yt.surfaceSubtle)),ci("border-left","3px solid var("+yt.error+")"),ci("border-radius",Dh(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")")]);function Vh(e,t){let n=hh(e,t),s=n[1];return""===s?e:r(o,{children:[n[0],i("span",{children:"✂",className:Bh}),i("span",{children:s,className:Uh})]})}let Kh=function(e){let t=e.showHeader,n=e.message,o=e.channelId,s=void 0===t||t,l=Uc(o);a(()=>{q(l)&&function(e,t){if($c.contents.some(t=>t===e))return;$c.contents.push(e);let n=Qe(zc).map(e=>e.id).join(", ");console.error('[AutoUI] Unknown channel "'+e+'" ('+t+") — falling back to a plain-text preview. Registered channels: "+(""===n?"(none — has the channel adapter's init() run?)":n))}(o,"ChannelPreview")},[o]);let c,u=L(l,o,e=>e.label),d=L(l,Bc,e=>e.constraints),f=fh(n.body),h=ph(n.body,d.maxLength),p=n.subject;if(void 0!==p){let e=d.subjectMaxLength,t=fh(p),n=L(e,!1,e=>t>e);c=r("div",{children:[i("span",{children:void 0!==e?Vh(p,e):p,className:jh}),void 0!==e?i("span",{children:t.toString()+" / "+e.toString(),className:n?Mh+" "+Lh:Mh}):null],className:zh})}else c=null;let g,m=j(l,e=>e.preview);if(void 0!==m)g=m(n,d);else{let e=d.maxLength;g=i("pre",{children:void 0!==e?Vh(n.body,e):n.body,className:$h})}let v,y=n.imageUrl;if(void 0!==y){let e=d.mediaAspect;v=i("img",{className:qh,style:void 0!==e?ru({},"aspectRatio",e):{},alt:"Message media",src:We(y)})}else v=null;let _=d.note;return r("div",{children:[s?r("div",{children:[i("span",{children:u,className:Oh}),i("span",{children:Th(f,d.maxLength),className:$(h)?Mh+" "+Lh:Mh})],className:Fh}):null,c,g,void 0!==h?i("div",{children:Nh(fh(h))+" past the limit — "+u+" will cut the tail.",className:Gh}):null,v,void 0!==_?i("span",{children:_,className:Ph}):null],className:Ih})};function Wh(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Hh(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Xh=Jh&&"documentMode"in document?document.documentMode:null,Qh=Jh&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Yh=Jh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Zh=!(!Jh||!("InputEvent"in window)||Xh)&&"getTargetRanges"in new window.InputEvent("input"),ep=Jh&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tp=Jh&&/Android/.test(navigator.userAgent),np=Jh&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!tp,rp=Jh&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ip=Jh&&tp&&rp,op=Jh&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Qh&&!rp,sp=0,ap=1,lp=2,cp=1,up=2,dp=3,fp=4,hp=5,pp=6,gp=np||ep||op?" ":"​",mp="\n\n",vp=Yh?" ":gp,yp={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},_p={directionless:1,unmergeable:2},bp={center:2,end:6,justify:4,left:1,right:3,start:5},xp={[up]:"center",[pp]:"end",[fp]:"justify",[cp]:"left",[dp]:"right",[hp]:"start"},Sp={normal:0,segmented:2,token:1},wp={[sp]:"normal",[lp]:"segmented",[ap]:"token"},Ep="$config";function kp(){return nS()._blockCursorElement}function Cp(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let Ap,Np=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){const t=this.getInsertionAnchor();return null!==t&&t.parentElement!==this.element&&Wh(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Wh(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Wh(359),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&0===n?"before":"after";const r=Tp(e,this.element);if(null===r)return"after";const i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return"after";if(t===e)return n<=i?"before":"after";const o=Tp(e,t);if(null===o)return"after";const s=Array.prototype.indexOf.call(e.childNodes,o);return s>=0&&s<=i?"before":"after"}getInsertionAnchor(){return this.before}};function Tp(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class Rp extends Np{withBefore(e){return new Rp(this.element,e,this.after)}withAfter(e){return new Rp(this.element,this.before,e)}withElement(e){return this.element===e?this:new Rp(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Cp(t);)e=t,t=t.nextSibling;const n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===kp()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(op||ep||np);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=Bx().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(i,r),e){const e=Bx().createElement("img");e.setAttribute("data-lexical-managed-linebreak","true"),e.style.setProperty("display","inline","important"),e.style.setProperty("border","0px","important"),e.style.setProperty("margin","0px","important"),e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){const e=this.getFirstChild(),t=this.getInsertionAnchor();let n=0;for(let r=this.element.firstChild;null!==r&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){const t=this.getFirstChildOffset(),n=kp(),i=this.element.childNodes,o=Math.min(r,i.length);let s=0;for(let e=t;e<o;e++)i[e]!==n&&s++;return[e,Math.min(s,e.getChildrenSize())]}const i=Dp(t,n);i.push(r);const o=Dp(t,this.element);let s=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const e=i[a],t=o[a];if(void 0===e||e<t)break;if(e>t){s+=1;break}}return[e.getParentOrThrow(),s]}}function Dp(e,t){const n=[];let r=t;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return r!==e&&Wh(225),n.reverse()}try{Ap="0.48.0+prod.esm"}catch(Wh){}const Ip=Ap??'"<unknown>+source"';let Fp=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const Op=null;function Pp(e,t=1e3){return e instanceof Mp?e.clone():e.size<t?new Map(e):(new Mp).init(new Map(e),void 0,e.size)}let Mp=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,(new e).init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return void 0!==this.get(e)}getWithTombstone(e){const t=this._nursery&&this._nursery.get(e);return void 0!==t?t:this._old&&this._old.get(e)}get(e){const t=this.getWithTombstone(e);return t===Op?void 0:t}shouldCompact(){return void 0!==this._nursery&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){const e=new Map(this._old);for(const[t,n]of this._nursery)n!==Op?e.set(t,n):e.delete(t);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){const n=this.getWithTombstone(e);if(n===t)return this;const r=this.getNursery();return n!==Op&&void 0!==n||(this._size++,n===Op&&r.delete(e)),r.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,Op),this._size--),t}getOrInsert(e,t){const n=this.get(e);return void 0!==n?n:(this.set(e,t),t)}getOrInsertComputed(e,t){const n=this.get(e);if(void 0!==n)return n;const r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const e of this.entries())yield e[0]}*values(){for(const e of this.entries())yield e[1]}*entries(){const e=this._nursery,t=this._old;if(t)for(const n of t){const t=n[0],r=e?e.get(t):void 0;r!==Op&&(void 0!==r&&(n[1]=r),yield n)}if(e)for(const n of e)n[1]===Op||t&&t.has(n[0])||(yield n)}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[n,r]of this.entries())e(r,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Lp(e,t,n,r,i,o){if(H_(e)){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&((H_(s)||ES(s)&&null!==s.__slots)&&Lp(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}for(const s of ES(e)&&null!==e.__slots?e.__slots.values():[]){const e=r.get(s);void 0!==e&&kS(e)&&e.__slotHost===t&&((H_(e)||ES(e)&&null!==e.__slots)&&Lp(e,s,n,r,i,o),n.has(s)||o.delete(s),i.push(s))}}let zp=!1,jp=0;function Up(e){jp=e.timeStamp}function Bp(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Jb(e,n)}function $p(e,t,n){const r=Px(Cx(n)),i=r&&qx(r,n._rootElement);let o=null,s=null;null!==i&&i.anchorNode===e&&(o=i.anchorOffset,s=i.focusOffset);const a=e.nodeValue;null!==a&&lx(t,a,o,s,!1)}function qp(e,t,n){if(Ty(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Lb(t)&&n.isAttached()}function Gp(e,t,n){for(let r=e;r&&!hS(r);r=xx(r)){const e=Jb(r,t);if(void 0!==e){const t=Kb(e,n);if(t)return Q_(t)||!Hx(r)?void 0:[r,t]}}}function Vp(e,t,n){zp=!0;const r=performance.now()-jp>100;try{V_(e,()=>{const i=t_()||function(e){return e.read("latest",()=>{const e=t_();return null!==e?e.clone():null})}(e),o=new Map,s=e._editorState,a=e._blockCursorElement;let l=!1,c="";for(let n=0;n<t.length;n++){const u=t[n],d=u.type,f=u.target,h=Gp(f,e,s);if(!h)continue;const[p,g]=h;if("characterData"===d)r&&yy(g)&&Lb(f)&&qp(i,f,g)&&$p(f,g,e);else if("childList"===d){l=!0;const t=u.addedNodes;for(let i=0;i<t.length;i++){const n=t[i],r=Wb(n),o=n.parentNode;if(!(null==o||n===a||null!==r||Bp(n,o,e)||e._slotsUsed&&Hx(n)&&n.hasAttribute("data-lexical-slot")||hS(n))){if(Yh){const e=(Hx(n)?n.innerText:null)||n.nodeValue;e&&(c+=e)}o.removeChild(n)}}const n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];(Bp(r,f,e)||a===r)&&(f.appendChild(r),t++)}r!==t&&o.set(p,g)}}}if(o.size>0)for(const[t,n]of o)n.reconcileObservedMutation(t,e);const u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){const n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],o=n.parentNode;null==o||"BR"!==n.nodeName||Bp(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(l&&ex(i),Yh&&yx(e)&&i.insertRawText(c))})}finally{zp=!1}}function Kp(e){const t=e._observer;null!==t&&Vp(e,t.takeRecords(),t)}function Wp(e){!function(e){0===jp&&Cx(e).addEventListener("textInput",Up,!0)}(e),e._observer=new MutationObserver((t,n)=>{Vp(e,t,n)})}const Hp="latest";let Jp=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||og).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Xp(e,t){return new Jp(e,t)}function Qp(e,t,n=Hp){const r=(n===Hp?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Yp(e,t,n){let r;if(A_(),"function"==typeof n){const i=e.getLatest(),o=Qp(i,t);if(r=n(o),t.isEqual(o,r))return i}else r=n;const i=e.getWritable();return ng(i).updateFromKnown(t,r),i}function Zp(e){const t=new Map,n=new Set;for(const{ownNodeConfig:r}of yS("function"==typeof e?e:e.replace))if(r&&r.stateConfigs)for(const e of r.stateConfigs){let r;"stateConfig"in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}const eg=new Set(["__proto__","constructor","prototype"]);let tg=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:o}=this.sharedNodeState,s=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(const i in t){const t=e.get(i);t&&n.has(t)||r++}return r}(o,n,r);this.size=s}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[n,r]of this.knownState)n.isEqual(r,n.defaultValue)?delete e[n.key]:e[n.key]=n.unparse(r);for(const n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return ig(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(const[i,o]of Object.entries(n)){if(eg.has(i))continue;const n=e.get(i);n?t.has(n)||t.set(n,n.parse(o)):(r=r||{},r[i]=o)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=ig(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(eg.has(e))return;const n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const n of t.keys())t.set(n,n.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[n,r]of Object.entries(e))this.updateFromUnknown(n,r)}};function ng(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new tg(t,rg(t));return t.__state=n,n}function rg(e){return e.__state?e.__state.sharedNodeState:Ab(nS(),e.getType()).sharedNodeState}function ig(e){if(e)for(const t in e)return e}function og(e){return e}function sg(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ag(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r)for(const[o,s]of Object.entries(r))if(!e.has(o)&&(e.add(o),s!==(i?i[o]:void 0)))return!0;return!1}function lg(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function cg(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(null===n||n===o)&&(null===r||r===s)&&(null===i||i===a)&&(null===e.__state||l===c||function(e,t){if(e===t)return!0;const n=new Set;return!(e&&sg(n,e,t)||t&&sg(n,t,e)||e&&ag(n,e,t)||t&&ag(n,t,e))}(l,c))}function ug(e,t){const n=e.mergeWithSibling(t),r=R_()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function dg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&yy(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(cg(t,r)){r=ug(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&yy(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(cg(r,n)){r=ug(r,n);break}break}n.remove()}}else r.remove()}function fg(e){return hg(e.anchor),hg(e.focus),e}function hg(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),yy(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!H_(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const pg=Symbol.for("@lexical/CachedTextSize");function gg(e,t){return Ig.read(()=>{let n=0,r=e;for(let e=0;e<t&&null!==r;e++){const i=Dg.get(r);if(void 0===i&&Wh(345,r),H_(i)){const o=Fg.get(r);if(void 0!==o&&H_(o)&&o.__parent!==i.__parent)n+=i.getTextContentSize();else{const e=Og.get(r),t=e&&e.__lexicalTextContent;"string"!=typeof t&&Wh(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{const e=i[pg];void 0===e&&Wh(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:_g})}function mg(e){H_(e)||void 0===e[pg]&&(e[pg]=yy(e)?e.__text.length:e.getTextContentSize())}const vg=4;let yg,_g,bg,xg="",Sg=null,wg=null,Eg=null;function kg(){return{firstTextKey:Eg,format:Sg,style:wg}}function Cg(e){null!==e.firstTextKey&&(Sg=e.format,wg=e.style,Eg=e.firstTextKey)}function Ag(e){if(null!==Eg)return;const t=e.__lexicalFirstTextKey;if(void 0===t&&Wh(348),null===t)return;const n=Fg.get(t);yy(n)&&(Sg=n.getFormat(),wg=n.getStyle(),Eg=t)}let Ng,Tg,Rg,Dg,Ig,Fg,Og,Pg,Mg,Lg,zg=!1,jg=!1;function Ug(e,t){const n=Dg.get(e),r=Fg.has(e);if(null!==t){const n=cm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(_g._keyToDOMMap.delete(e),H_(n)){const e=xS(n,Dg);Bg(e,0,e.length-1,null)}if(void 0!==n){for(const e of Xg(n).values()){const t=Yg(e);Ug(e,null),null!==t&&t.remove()}mx(Mg,bg,Ng,n,"destroyed")}}}function Bg(e,t,n,r){for(let i=t;i<=n;++i){const t=e[i];void 0!==t&&Ug(t,r)}}function $g(e,t){e.setProperty("text-align",t)}const qg="40px";function Gg(e,t){const n=yg.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * var(--lexical-indent-base-value, ${qg}))`)}function Vg(e,t){const n=e.style;0===t?$g(n,""):1===t?$g(n,"left"):2===t?$g(n,"center"):3===t?$g(n,"right"):4===t?$g(n,"justify"):5===t?$g(n,"start"):6===t&&$g(n,"end")}function Kg(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(Z_(e))return null;const n=e.getParent();return null===n||Tx(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function Wg(e){const t=Bx().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function Hg(e,t,n){t||"false"===e.contentEditable?function(e,t=nS()){const n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,_g):n.removeAttribute("contenteditable")}function Jg(e,t,n){const r=xg,i=kg();xg="";let o="";const s=Q_(e);for(const[a,l]of n){const n=Wg(a);Hg(t,s,n),t.appendChild(n),xg="";const r=kg();em(l,iS(e,n,_g)),Cg(r),Qg(e,a,t,n),o+=xg}return Cg(i),xg=r,o}function Xg(e){return ES(e)&&null!==e.__slots?e.__slots:wS}function Qg(e,t,n,r){const i=Lg.$getSlotTargetElement(e,t,n,_g);null!==i&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function Yg(e){const t=Og.get(e);return void 0!==t?t.parentElement:null}function Zg(e,t,n){const r=Xg(e),i=Xg(t);for(const[u,d]of r)if(!i.has(u)){const e=Yg(d);Ug(d,null),null!==e&&e.remove()}const o=xg,s=kg();let a="",l=null;const c=Q_(t);for(const[u,d]of i){const e=r.get(u);let i=void 0!==e?Yg(e):null;xg="";const o=kg();if(null===i){i=Wg(u);let e=null;for(const t of n.children)if(!t.hasAttribute("data-lexical-slot")){e=t;break}n.insertBefore(i,e),em(d,iS(t,i,_g))}else e===d?om(d,i):(void 0!==e&&Ug(e,i),em(d,iS(t,i,_g)));if(Cg(o),Hg(n,c,i),Qg(t,u,n,i),a+=xg,i.parentElement===n){const e=null===l?n.firstChild:l.nextSibling;e!==i&&n.insertBefore(i,e),l=i}}return Cg(s),xg=o,a}function em(e,t){const n=Fg.get(e);if(void 0===n&&Wh(60),null!==t){const r=Dg.get(e);if(void 0!==r){const i=Og.get(e);if(void 0!==i){const o=kS(r)?r.__slotHost:null,s=kS(n)?n.__slotHost:null,a=r.__parent!==n.__parent||o!==s,l=null!==s&&i.parentElement!==t.element;if(a||l)return t.insertChild(i),om(e,t.element)}}}const r=Lg.$createDOM(n,_g);if(function(e,t,n){const r=n._keyToDOMMap;Hb(t,n,e),r.set(e,t)}(e,r,_g),yy(n)?r.setAttribute("data-lexical-text","true"):Q_(n)&&(r.setAttribute("data-lexical-decorator","true"),function(e,t){e.__lexicalUnmanaged=!0,t&&void 0!==t.captureSelection&&(e.__lexicalCapturedSelection=t.captureSelection)}(r,{captureSelection:!0})),H_(n)){const e=n.__indent,t=n.__size;Kg(r,n),0!==e&&Gg(r,e);const i=Xg(n),o=i.size>0?Jg(n,r,i):"";if(0===t)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,xg+=o,i.size>0&&(r.__lexicalSlotTextLength=o.length);else{const e=xg,s=t-1;if(tm(xS(n,Fg),n,0,s,iS(n,r,_g)),""!==o){const t=r.__lexicalTextContent||"";r.__lexicalTextContent=o+t,xg=e+o+t}i.size>0&&(r.__lexicalSlotTextLength=o.length)}const s=n.__format;0!==s&&Vg(r,s),n.isInline()||nm(null,n,r)}else{const t=n.getTextContent();if(Q_(n)){const t=n.decorate(_g,yg);null!==t&&sm(e,t),r.contentEditable="false";const i=Xg(n);i.size>0&&Jg(n,r,i)}xg+=t}return null!==t&&t.insertChild(r),Lg.$decorateDOM(n,null,r,_g),mg(n),mx(Mg,bg,Ng,n,"created"),r}function tm(e,t,n,r,i){const o=xg,s=kg();xg="",Sg=null,wg=null,Eg=null;let a=n;for(;a<=r;++a){const t=kg();em(e[a],i);const n=Fg.get(e[a]);null!==n&&yy(n)?null===Sg&&(Sg=n.getFormat(),wg=n.getStyle(),Eg=n.__key):H_(n)&&a<r&&!n.isInline()&&(xg+=mp),Cg(t)}const l=_g._keyToDOMMap.get(t.__key);void 0===l&&Wh(349,t.__key),l.__lexicalTextContent=xg,l.__lexicalFirstTextKey=Eg,xg=o+xg,Cg(s)}function nm(e,t,n){const r=iS(t,n,_g),i=r.element.__lexicalLastChildKind??null,o=function(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return lb(e)?"line-break":Q_(e)&&e.isInline()?"decorator":null}return Xg(e).size>0?null:"empty"}return null}(t,Fg);i!==o&&r.setManagedLineBreak(o)}function rm(e,t,n){var r;Sg=null,wg=null,Eg=null,function(e,t,n){const r=xg,i=e.__size,o=t.__size;xg="";const s=n.element,a=_g._keyToDOMMap.get(t.__key);void 0===a&&Wh(351,t.__key);const l=o-i;if(!zg&&Math.abs(l)<=1&&i>=vg&&e.__first===t.__first&&(0!==l||!_g._cloneNotNeeded.has(e.__key))){const i=a.__lexicalTextContent,c=Pg.get(e.__key);if(!zg&&"string"==typeof i&&void 0!==c){const o=function(e,t){const n=t.size;if(0===n||n>=e.__size)return null;let r=e.__last,i=null,o=0;for(;null!==r&&o<n;){if(!t.has(r))return null;i=r;const e=Fg.get(r);if(void 0===e)return null;r=e.__prev,o++}return o!==n||null!==r&&t.has(r)?null:i}(t,c);if(null!==o){const u=c.size;if(0===l){const e=gg(o,u);let n=o,l=0;for(;null!==n&&l<u;){const e=Fg.get(n);if(void 0===e)break;const t=kg();om(n,s),yy(e)&&null===Sg&&(Sg=e.getFormat(),wg=e.getStyle(),Eg=e.__key),Cg(t),n=e.__next,l++}let d="";for(n=o,l=0;null!==n&&l<u;){const e=Fg.get(n);if(void 0===e)break;let t;if(H_(e)){const r=_g._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;"string"!=typeof i&&Wh(352,e.getType()),t=i}else t=e.getTextContent();d+=t,l<u-1&&H_(e)&&!e.isInline()&&(d+=mp),n=e.__next,l++}const f=a.__lexicalSlotTextLength||0,h=f>0?i.slice(f):i,p=h.slice(0,h.length-e)+d;return a.__lexicalTextContent=p,xg=r+p,void im(t,a,c)}if(function(e,t,n,r,i,o,s,a){if(1!==a&&-1!==a)return!1;if(s!==(1===a?2:1))return!1;const l=s-a;let c=e.__last;for(let E=0;E<l-1;E++){if(null===c)return!1;const e=Dg.get(c);if(void 0===e)return!1;c=e.__prev}if(null===c)return!1;const u=Fg.get(o),d=Dg.get(c);if(void 0===u||void 0===d)return!1;if(u.__prev!==d.__prev)return!1;const f=[];let h=o;for(let E=0;E<s;E++){if(null===h)return!1;f.push(h);const e=Fg.get(h);h=e?e.__next:null}const p=[];h=c;for(let E=0;E<l;E++){if(null===h)return!1;p.push(h);const e=Dg.get(h);h=e?e.__next:null}const g=new Set(p),m=new Set(f),v=[];let y=0,_=0;for(;y<l&&_<s;)if(f[_]===p[y])v.push({key:f[_],kind:"reconcile"}),y++,_++;else if(m.has(p[y])){if(g.has(f[_]))return!1;v.push({key:f[_],kind:"create",nextIndex:_}),_++}else v.push({key:p[y],kind:"destroy"}),y++;for(;y<l;)v.push({key:p[y++],kind:"destroy"});for(;_<s;)v.push({key:f[_],kind:"create",nextIndex:_}),_++;const b=gg(c,l);for(const E of v){const e=kg();if("reconcile"===E.kind)om(E.key,n.element);else if("destroy"===E.kind)Ug(E.key,n.element);else{let e=null;for(let t=E.nextIndex+1;t<s;t++){const n=_g._keyToDOMMap.get(f[t]);if(void 0!==n){e=n;break}}em(E.key,n.withBefore(e??n.before))}if("destroy"!==E.kind){const e=Fg.get(E.key);e&&yy(e)&&null===Sg&&(Sg=e.getFormat(),wg=e.getStyle(),Eg=e.__key)}Cg(e)}let x="";for(let E=0;E<s;E++){const e=Fg.get(f[E]);if(void 0===e)return!1;let t;if(H_(e)){const n=_g._keyToDOMMap.get(f[E]),r=n&&n.__lexicalTextContent;"string"!=typeof r&&Wh(350,e.getType()),t=r}else t=e.getTextContent();x+=t,E<s-1&&H_(e)&&!e.isInline()&&(x+=mp)}const S=r.__lexicalSlotTextLength||0,w=S>0?i.slice(S):i;return r.__lexicalTextContent=w.slice(0,w.length-b)+x,!0}(e,0,n,a,i,o,u,l)){const e=a.__lexicalTextContent;return"string"!=typeof e&&Wh(353),xg=r+e,void im(t,a,c)}}}if(0===l){let t=e.__first,n=0;for(;null!==t;){const e=Fg.get(t);if(void 0===e)break;const r=zg||Rg.has(t)||Tg.has(t),i=kg();if(r)om(t,s);else{let n,r;if(H_(e)){r=Og.get(t);const i=r&&r.__lexicalTextContent;"string"!=typeof i&&Wh(354,e.getType()),n=i}else n=e.getTextContent();xg+=n,void 0!==r&&Ag(r)}yy(e)?null===Sg&&(Sg=e.getFormat(),wg=e.getStyle(),Eg=e.__key):H_(e)&&n<o-1&&!e.isInline()&&(xg+=mp),Cg(i),t=e.__next,n++}return a.__lexicalTextContent=xg,a.__lexicalFirstTextKey=Eg,void(xg=r+xg)}}if(1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)om(r,s);else{const e=cm(r),t=em(i,null);try{e.parentNode===s?s.replaceChild(t,e):n.insertChild(t)}catch(n){if("object"==typeof n&&null!=n){const o=`${n.toString()} Parent: ${s.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(o)}throw n}Ug(r,null)}const o=Fg.get(i);yy(o)&&null===Sg&&(Sg=o.getFormat(),wg=o.getStyle(),Eg=o.__key)}else{const r=xS(e,Dg),a=xS(t,Fg);if(r.length!==i&&Wh(227),a.length!==o&&Wh(228),0===i)0!==o&&tm(a,t,0,o-1,n);else if(0===o){if(0!==i){const e=null==n.after&&null==n.before&&0===Xg(t).size&&null==n.element.__lexicalLineBreak;Bg(r,0,i-1,e?null:s),e&&(s.textContent="")}}else!function(e,t,n,r,i,o){const s=r-1,a=i-1;let l,c,u=o.getFirstChild(),d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f],i=kg();if(e===r)u=am(om(r,o.element)),d++,f++;else{if(void 0===c&&(c=lm(n,f)),void 0===l)l=lm(t,d);else if(!l.has(e)){d++,Cg(i);continue}if(!c.has(e)){u=am(cm(e)),Ug(e,o.element),d++,l.delete(e),Cg(i);continue}if(l.has(r)){const e=bx(_g,r);e!==u&&o.withBefore(u??o.before).insertChild(e),u=am(om(r,o.element)),d++,f++}else em(r,o.withBefore(u??o.before)),f++}const s=Fg.get(r);null!==s&&yy(s)?null===Sg&&(Sg=s.getFormat(),wg=s.getStyle(),Eg=s.__key):H_(s)&&f<=a&&!s.isInline()&&(xg+=mp),Cg(i)}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1],r=void 0===t?null:_g.getElementByKey(t);tm(n,e,f,a,o.withBefore(r??o.before))}else p&&!h&&Bg(t,d,s,o.element)}(t,r,a,i,o,n)}a.__lexicalTextContent=xg,a.__lexicalFirstTextKey=Eg,xg=r+xg}(e,t,iS(t,n,_g)),Tx(t)||(r=t,null==Sg||Sg===r.__textFormat||jg||r.setTextFormat(Sg),function(e){null==wg||wg===e.__textStyle||jg||e.setTextStyle(wg)}(t))}function im(e,t,n){const r=t.__lexicalFirstTextKey;if(null!=r){const t=e.__key;let i=r;for(;null!==i;){const e=Fg.get(i);if(void 0===e){i=null;break}if(e.__parent===t)break;i=e.__parent}if(null!==i&&!n.has(i)){const e=Fg.get(r);if(yy(e))return Sg=e.getFormat(),void(wg=e.getStyle())}}t.__lexicalFirstTextKey=Eg}function om(e,t){const n=Dg.get(e);let r=Fg.get(e);void 0!==n&&void 0!==r||Wh(61);const i=zg||Rg.has(e)||Tg.has(e),o=bx(_g,e);if(n===r&&!i){let e;if(H_(n)){const t=o.__lexicalTextContent;"string"!=typeof t&&Wh(355,n.getType()),e=t,Ag(o)}else e=n.getTextContent();return xg+=e,o}if(n!==r&&i&&mx(Mg,bg,Ng,r,"updated"),Lg.$updateDOM(r,n,o,_g)){const n=em(e,null);return null===t&&Wh(62),t.replaceChild(n,o),Ug(e,null),n}if(H_(n)){H_(r)||Wh(334,e);const t=r.__indent;(zg||t!==n.__indent)&&Gg(o,t);const s=r.__format;(zg||s!==n.__format)&&Vg(o,s);const a=i&&(Xg(r).size>0||Xg(n).size>0)?Zg(n,r,o):"";if(i){const e=xg;if(rm(n,r,o),Z_(r)||r.isInline()||nm(0,r,o),""!==a){const t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,xg=e+a+t,o.__lexicalSlotTextLength=a.length}else(Xg(r).size>0||Xg(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const e=o.__lexicalTextContent;"string"!=typeof e&&Wh(356,n.getType()),xg+=e,Ag(o)}if((zg||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Kg(o,r),Z_(r)&&!zg))for(const e of r.getChildren())H_(e)&&Kg(bx(_g,e.getKey()),e)}else{const t=r.getTextContent();if(Q_(r)){const t=r.decorate(_g,yg);null!==t&&sm(e,t),i&&(Xg(r).size>0||Xg(n).size>0)&&Zg(n,r,o)}xg+=t}if(!jg&&Z_(r)){const e=r.getLatest();if(e.__cachedText!==xg){const t=e.getWritable();t.__cachedText=xg,r=t}}return Lg.$decorateDOM(r,n,o,_g),mg(r),o}function sm(e,t){let n=_g._pendingDecorators;const r=_g._decorators;if(null===n){if(r[e]===t)return;n=Qb(_g)}n[e]=t}function am(e){let t=e.nextSibling;return null!==t&&t===_g._blockCursorElement&&(t=t.nextSibling),t}function lm(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function cm(e){const t=Og.get(e);return void 0===t&&Wh(75,e),t}function um(e){return{type:e}}const dm=um("SELECTION_CHANGE_COMMAND"),fm=um("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),hm=um("CLICK_COMMAND"),pm=um("BEFORE_INPUT_COMMAND"),gm=um("INPUT_COMMAND"),mm=um("COMPOSITION_START_COMMAND"),vm=um("COMPOSITION_END_COMMAND"),ym=um("DELETE_CHARACTER_COMMAND"),_m=um("INSERT_LINE_BREAK_COMMAND"),bm=um("INSERT_PARAGRAPH_COMMAND"),xm=um("CONTROLLED_TEXT_INSERTION_COMMAND"),Sm=um("PASTE_COMMAND"),wm=um("REMOVE_TEXT_COMMAND"),Em=um("DELETE_WORD_COMMAND"),km=um("DELETE_LINE_COMMAND"),Cm=um("FORMAT_TEXT_COMMAND"),Am=um("SET_TEXT_FORMAT_COMMAND"),Nm=um("UNDO_COMMAND"),Tm=um("REDO_COMMAND"),Rm=um("KEYDOWN_COMMAND"),Dm=um("KEY_ARROW_RIGHT_COMMAND"),Im=um("MOVE_TO_END"),Fm=um("KEY_ARROW_LEFT_COMMAND"),Om=um("MOVE_TO_START"),Pm=um("KEY_ARROW_UP_COMMAND"),Mm=um("KEY_ARROW_DOWN_COMMAND"),Lm=um("KEY_ENTER_COMMAND"),zm=um("KEY_SPACE_COMMAND"),jm=um("KEY_BACKSPACE_COMMAND"),Um=um("KEY_ESCAPE_COMMAND"),Bm=um("KEY_DELETE_COMMAND"),$m=um("KEY_TAB_COMMAND"),qm=um("INSERT_TAB_COMMAND"),Gm=um("INDENT_CONTENT_COMMAND"),Vm=um("OUTDENT_CONTENT_COMMAND"),Km=um("DROP_COMMAND"),Wm=um("FORMAT_ELEMENT_COMMAND"),Hm=um("DRAGSTART_COMMAND"),Jm=um("DRAGOVER_COMMAND"),Xm=um("DRAGEND_COMMAND"),Qm=um("COPY_COMMAND"),Ym=um("CUT_COMMAND"),Zm=um("SELECT_ALL_COMMAND"),ev=um("CLEAR_EDITOR_COMMAND"),tv=um("CLEAR_HISTORY_COMMAND"),nv=um("CAN_REDO_COMMAND"),rv=um("CAN_UNDO_COMMAND"),iv=um("FOCUS_COMMAND"),ov=um("BLUR_COMMAND"),sv=um("KEY_MODIFIER_COMMAND");function av(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}const lv=Object.freeze({}),cv=[["keydown",function(e,t){const n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&bv(n),t.isComposing()||_x(t,Rm,e)}],["pointerdown",function(e,t){const n=Kx(e),r=e.pointerType;Jx(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&V_(t,()=>{pS(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){_x(t,mm,e)}],["compositionend",function(e,t){const n=t._inputState;Yh?n.compositionPhase="ending-firefox":ep||!np&&!op?_x(t,vm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const n=t._inputState;bv(n),V_(t,()=>{Sv(e,t)||t.dispatchCommand(gm,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){V_(t,()=>{const n=t_(),r=Px(Cx(t)),i=n_();if(r)if(Ty(n)){const e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!Z_(t)&&1===Zb().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=qx(r,t._rootElement).anchorNode;(Hx(n)||Lb(n))&&ex(e_(i,r,t,e))}_x(t,hm,e)})}],["cut",lv],["copy",lv],["dragstart",lv],["dragover",lv],["dragend",lv],["paste",lv],["focus",lv],["blur",lv],["drop",lv]];Zh&&cv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType;"deleteCompositionText"===n||Yh&&yx(t)||"insertCompositionText"!==n&&V_(t,()=>{Sv(e,t)||_x(t,pm,e)},{event:e})}(e,t)]);const uv=new WeakMap,dv=new WeakMap,fv=function(e){const t=new Map;return{dispose(){for(const e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);void 0===i&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));const o=()=>{const e=t.get(n);e&&e.holders.delete(o)&&0===e.holders.size&&(t.delete(n),e.dispose())};return i.holders.add(o),o}}}(e=>(e.addEventListener("selectionchange",Iv),()=>e.removeEventListener("selectionchange",Iv)));function hv(e,t,n,r,i,o){const s=e.anchor,a=e.focus,l=s.getNode(),c=R_();let u;if(void 0!==o)u=o;else{const e=Px(Cx(c));u=null!==e?qx(e,c._rootElement):null}const d=null!==u?u.anchorNode:null,f=s.key,h=c.getElementByKey(f),p=n.length;return f!==a.key||!yy(l)||(!i&&(!Zh||c._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&p<2||rx(n))&&s.offset!==a.offset&&!l.isComposing()||Mb(l)||l.isDirty()&&p>1||(i||!Zh)&&null!==h&&!l.isComposing()&&d!==oS(l,h,c)||null!==u&&null!==t&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=Pb(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(yy(t)||H_(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,l)}function pv(e,t){return Lb(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function gv(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=qx(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,pv(r,i)&&pv(o,s)&&!a.postDeleteSelectionToRestore)||V_(t,()=>{if(!n)return void ex(null);if(!Db(t,r,o))return;let l=t_();if(a.postDeleteSelectionToRestore&&Ty(l)&&l.isCollapsed()){const e=l.anchor,t=a.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),ex(l))}if(a.postDeleteSelectionToRestore=null,Ty(l)){const n=l.anchor,c=n.getNode();if(l.isCollapsed()){"Range"===e.type&&r===o&&(l.dirty=!0);const i=Cx(t).event,s=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:h,timeStamp:p}=a.collapsedSelectionFormat,g=Zb(),m=!1===t.isComposing()&&""===g.getTextContent();if(s<p+200&&n.offset===f&&n.key===h)mv(l,u,d);else if("text"===n.type)yy(c)||Wh(141),vv(l,c);else if("element"===n.type&&!m){H_(c)||Wh(259);const e=n.getNode();e.isEmpty()?function(e,t){mv(e,t.getTextFormat(),t.getTextStyle())}(l,e):mv(l,l.format,"")}}else{const e=n.key,t=l.focus.key,r=l.getNodes(),o=r.length,a=l.isBackward(),c=a?s:i,u=a?i:s,d=a?t:e,f=a?e:t;let h=2047,p=!1;for(let n=0;n<o;n++){const e=r[n],t=e.getTextContentSize();if(yy(e)&&0!==t&&!(0===n&&e.__key===d&&c===t||n===o-1&&e.__key===f&&0===u)&&(p=!0,h&=e.getFormat(),0===h))break}l.format=p?h:0}}_x(t,dm,void 0)})}function mv(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function vv(e,t){mv(e,t.getFormat(),t.getStyle())}function yv(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function _v(e){const{lastKeyCode:t}=R_()._inputState;if(null==e||e.length<=1||null==t)return;const n=1===t.length?t:"Enter"===t?"\n":"Tab"===t?"\t":null;if(!n)return;const r=t_();if(!Ty(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!yy(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const e=i.getNextSibling();if("\n"===n){if(lb(e))e.selectEnd();else if(!e){const e=bS(i,Xy),t=e&&e.getNextSibling();H_(t)&&t.selectStart()}}else"\t"===n?Sy(e)&&e.selectEnd():yy(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}function bv(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function xv(e){bv(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>bv(e),0)}function Sv(e,t){const n=Kx(e);if(Hx(n)&&pS(n,t))return!0;const r=t.getRootElement();if(null===r)return!1;const i=Vx(r.ownerDocument);return null!==i&&r.contains(i)&&pS(i,t)}function wv(e){const t=e.inputType,n=yv(e),r=R_(),i=r._inputState,o=t_();if("insertText"===t&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(bv(i),e.preventDefault(),Ty(o)&&!o.isCollapsed()){const e=o.isBackward()?o.anchor:o.focus;o.anchor.set(e.key,e.offset,e.type),o.focus.set(e.key,e.offset,e.type)}return!0}if("deleteContentBackward"===t){if(null===o){const e=n_();if(!Ty(e))return!0;ex(e.clone())}if(Ty(o)){const t=o.anchor.key===o.focus.key;if(function(e,t){return"MediaLast"===e.lastKeyCode&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(Gb(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{V_(r,()=>{Gb(null)})},30),Ty(o)){const e=o.anchor.getNode();e.markDirty(),yy(e)||Wh(142),vv(o,e)}}else{if(Gb(null),ep&&null!==n&&!n.collapsed&&(o.applyDOMRange(n),!o.isCollapsed()))return e.preventDefault(),o.removeText(),!0;e.preventDefault();const s=o.anchor.getNode(),a=s.getTextContent(),l=s.canInsertTextAfter(),c=0===o.anchor.offset&&o.focus.offset===a.length;let u=ip&&t&&!c&&l;if(u&&o.isCollapsed()&&(u=!Q_(function(e,t){const n=e.offset;if("element"===e.type)return vx(e.getNode(),t,n);{const r=e.getNode();if(0===n||!t){const e=r.getPreviousSibling();return null===e?vx(r.getParentOrThrow(),t,r.getIndexWithinParent()+0):e}}return null}(o.anchor,!0))),!u){_x(r,ym,!0);const e=t_();ip&&Ty(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Ty(o))return!0;const s=e.data;null!==i.unprocessedBeforeInputData&&ax(!1,r,i.unprocessedBeforeInputData),o.dirty&&null===i.unprocessedBeforeInputData||!o.isCollapsed()||Z_(o.anchor.getNode())||null===n||o.applyDOMRange(n),i.unprocessedBeforeInputData=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"===t||"insertTranspose"===t){if("\n"===s)e.preventDefault(),_x(r,_m,!1);else if(s===mp)e.preventDefault(),_x(r,bm,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&hv(o,n,s,e.timeStamp,!0)?(e.preventDefault(),_x(r,xm,s),_v(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":_x(r,xm,e),_v((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const n=r._compositionKey;Gb(null),t||_x(r,xm,e),Av(n);break}case"insertLineBreak":Gb(null),_x(r,_m,!1);break;case"insertParagraph":Gb(null),i.isInsertLineBreak&&!ep?(i.isInsertLineBreak=!1,_x(r,_m,!1)):_x(r,bm,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":_x(r,Sm,e);break;case"deleteByComposition":(function(e,t){return e!==t||H_(e)||H_(t)||!Pb(e)||!Pb(t)})(c,u)&&_x(r,wm,e);break;case"deleteByDrag":wx(Jv),_x(r,wm,e);break;case"deleteByCut":_x(r,wm,e);break;case"deleteContent":_x(r,ym,!1);break;case"deleteWordBackward":_x(r,Em,!0);break;case"deleteWordForward":_x(r,Em,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":_x(r,km,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":_x(r,km,!1);break;case"formatStrikeThrough":_x(r,Cm,"strikethrough");break;case"formatBold":_x(r,Cm,"bold");break;case"formatItalic":_x(r,Cm,"italic");break;case"formatUnderline":_x(r,Cm,"underline");break;case"historyUndo":_x(r,Nm,void 0);break;case"historyRedo":_x(r,Tm,void 0)}return!0}function Ev(e){const t=R_(),n=t._inputState,r=t_(),i=e.data,o=yv(e);let s=!1;if(null!=i&&Ty(r)){const a=Px(Cx(t)),l=null!==a?qx(a,t._rootElement):null,c="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&!t.isComposing();c&&(n.hadOrphanedCompositionEvents=!0);const u=r.anchor.getNode(),d="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&t.isComposing()&&yy(u)&&Mb(u);if(!c&&!d&&hv(r,o,i,e.timeStamp,!1,l)){if(s=!0,"ending-firefox"===n.compositionPhase){const e=Nv(t,i);if(n.compositionPhase="idle",e)return wx(Qv),tx(),!0}const o=r.anchor.getNode();if(null===a||null===l)return!0;const c=r.isBackward(),u=c?r.anchor.offset:r.focus.offset,d=c?r.focus.offset:r.anchor.offset;Zh&&!r.isCollapsed()&&yy(o)&&null!==l.anchorNode&&o.getTextContent().slice(0,u)+i+o.getTextContent().slice(u+d)===sx(l.anchorNode)||_x(t,xm,i);const f=i.length;Yh&&f>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),ip&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Gb(null))}}return s||(ax(!1,t,null!==i?i:void 0),"ending-firefox"===n.compositionPhase&&(Nv(t,i||void 0),wx(Qv),n.compositionPhase="idle")),tx(),!0}function kv(e){const t=R_(),n=t._inputState,r=t_();if(Ty(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(Gb(i.key),wx(Xv),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===i.type||!r.isCollapsed()||!ip&&(o.getFormat()!==r.format||yy(o)&&o.getStyle()!==r.style)||yy(o)&&(Mb(o)||0===i.offset&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){_x(t,xm,vp);const e=t_();Ty(e)&&Gb(e.anchor.key)}}return!0}function Cv(e){const t=R_();return t._inputState.compositionPhase="idle",Nv(t,e.data),wx(Qv),!0}function Av(e){if(null===e)return;const t=Kb(e);if(!yy(t)||"text"===t.getType()||Mb(t)||!t.isAttached())return;const n=t_(),r=Ty(n)&&n.anchor.key===e?n.anchor.offset:null,i=vy(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),null!==r){const e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function Nv(e,t){const n=e._compositionKey;if(Gb(null),null!==n&&null!=t){if(""===t){const t=Kb(n),r=e.getElementByKey(n),i=null!==r&&yy(t)?oS(t,r,e):null;if(null!==i&&null!==i.nodeValue&&yy(t)){const n=Px(Cx(e)),r=n&&qx(n,e._rootElement);let o=null,s=null;null!==r&&r.anchorNode===i&&(o=r.anchorOffset,s=r.focusOffset),lx(t,i.nodeValue,o,s,!0)}return Av(n),!1}if("\n"===t[t.length-1]){const t=t_();if(Ty(t)||Dy(t)){if(Ty(t)){const e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return _x(e,Lm,null),Av(n),!1}}const r=Kb(n);if(null!==r&&yy(r)&&Mb(r)){r.markDirty();const e=t_(),i=r.getTextContentSize(),o=Ty(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(o,o).insertText(t),!0}}return ax(!0,e,t),Av(n),!1}function Tv(e){const t=R_(),n=t._inputState;if(null==e.key)return!0;if("ending-safari"===n.compositionPhase){const r=px(e);if(r&&V_(t,()=>{Nv(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if(function(e){return dx(e,"ArrowRight",{shiftKey:"any"})}(e))_x(t,Dm,e);else if(function(e){return dx(e,"ArrowRight",{...fx,shiftKey:"any"})}(e))_x(t,Im,e);else if(function(e){return dx(e,"ArrowLeft",{shiftKey:"any"})}(e))_x(t,Fm,e);else if(function(e){return dx(e,"ArrowLeft",{...fx,shiftKey:"any"})}(e))_x(t,Om,e);else if(function(e){return dx(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))_x(t,Pm,e);else if(function(e){return dx(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))_x(t,Mm,e);else if(function(e){return dx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,_x(t,Lm,e);else if(function(e){return" "===e.key}(e))_x(t,zm,e);else if(function(e){return Qh&&dx(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,_x(t,_m,!0);else if(function(e){return dx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,_x(t,Lm,e);else if(function(e){return dx(e,"Backspace",{shiftKey:"any"})||Qh&&dx(e,"h",{ctrlKey:!0})}(e))px(e)?_x(t,jm,e)&&xv(n):(e.preventDefault(),_x(t,ym,!0));else if(function(e){return"Escape"===e.key}(e))_x(t,Um,e);else if(function(e){return dx(e,"Delete",{})||Qh&&dx(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),_x(t,ym,!1)):_x(t,Bm,e);else if(function(e){return dx(e,"Backspace",hx)}(e))e.preventDefault(),_x(t,Em,!0);else if(function(e){return dx(e,"Delete",hx)}(e))e.preventDefault(),_x(t,Em,!1);else if(function(e){return Qh&&dx(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),_x(t,km,!0);else if(function(e){return Qh&&(dx(e,"Delete",{metaKey:!0})||dx(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),_x(t,km,!1);else if(function(e){return dx(e,"b",fx)}(e))e.preventDefault(),_x(t,Cm,"bold");else if(function(e){return dx(e,"u",fx)}(e))e.preventDefault(),_x(t,Cm,"underline");else if(function(e){return dx(e,"i",fx)}(e))e.preventDefault(),_x(t,Cm,"italic");else if(function(e){return dx(e,"Tab",{shiftKey:"any"})}(e))_x(t,$m,e);else if(function(e){return dx(e,"z",fx)}(e))e.preventDefault(),_x(t,Nm,void 0);else if(function(e){return Qh?dx(e,"z",{metaKey:!0,shiftKey:!0}):dx(e,"y",{ctrlKey:!0})||dx(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),_x(t,Tm,void 0);else{const r=t._editorState._selection;!function(e){return dx(e,"a",fx)}(e)?null===r||Ty(r)||(function(e){return dx(e,"c",fx)}(e)?(e.preventDefault(),_x(t,Qm,e)):function(e){return dx(e,"x",fx)}(e)&&(e.preventDefault(),_x(t,Ym,e))):(e.preventDefault(),_x(t,Zm,e)&&xv(n))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(sv,e),!0}function Rv(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const Dv=new Map;function Iv(e){const t=function(e){const t=kx(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=Sx(e.target);let r=null,i=null;const o=null!==n?dv.get(n):void 0;if(null!==n){if(void 0!==o){const e=o.editors;let n=o.hasShadowEditor;if(void 0===n){n=!1;for(const t of e)if(null!==t._rootElement&&Mx(t._rootElement.getRootNode())){n=!0;break}o.hasShadowEditor=n}if(n){let n=null,o=null;for(const s of e){const e=s._rootElement;if(null===e)continue;const a=qx(t,e).anchorNode;if(null!==a&&Fb(a)===s){if(Mx(e.getRootNode())){r=s,i=a;break}null===n&&(n=s,o=a)}}null===r&&null!==n&&(r=n,i=o)}else{const e=t.anchorNode;null===e||Hx(e)&&null!==e.shadowRoot||(r=Fb(e),null!==r&&(i=e))}}if(null===r){const e=Vx(n);r=null!==e?Fb(e):null}}if(null===r)return;if(r._inputState.isSelectionChangeFromMouseDown){if(void 0!==o)for(const e of o.editors)e._inputState.isSelectionChangeFromMouseDown=!1;V_(r,()=>{const n=n_(),o=i??qx(t,r._rootElement).anchorNode;(Hx(o)||Lb(o))&&ex(e_(n,t,r,e))})}const s=ix(r),a=s[s.length-1],l=a._key,c=Dv.get(l),u=c||a;u!==r&&gv(t,u,!1),gv(t,r,!0),r!==a?Dv.set(l,r):c&&Dv.delete(l)}function Fv(e){e._lexicalHandled=!0}function Ov(e){return!0===e._lexicalHandled}function Pv(e){const t=uv.get(e);if(void 0===t)return;const n=dv.get(t);if(void 0===n)return;uv.delete(e);const r=Ob(e);Ib(r)?(function(e){if(null!==e._parentEditor){const t=ix(e),n=t[t.length-1]._key;Dv.get(n)===e&&Dv.delete(n)}else Dv.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Wh(198);const i=Rv(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function Mv(e,t,n){A_();const r=e.__key,i=e.getParent();if(null===i)return void(null!==CS(e)&&Wh(367,r,String(CS(e))));const o=function(e){const t=t_();if(!Ty(t)||!H_(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Ex(i,e)&&n.set(e.__key,0,"element"),Ex(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Ty(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(o_(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(o_(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Dy(o)&&t&&e.isSelected()&&e.selectPrevious();if(Ty(o)&&t&&!s){const t=e.getIndexWithinParent();$b(e),r_(o,i,t,-1)}else $b(e);n||Tx(i)||i.canBeEmpty()||!i.isEmpty()||Mv(i,t),t&&o&&Z_(i)&&i.isEmpty()&&i.selectEnd()}const Lv=Symbol.for("ephemeral");function zv(e){return e[Lv]||!1}const jv={configurable:!0,enumerable:!1,value:void 0,writable:!0};class Uv{__type;__key;__parent;__prev;__next;__state;[pg];static getType(){const{ownNodeType:e}=vS(this);return void 0===e&&Wh(64,this.name),e}static clone(e){Wh(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||SS(this.constructor);return Object.assign(t,{extends:n}),"string"==typeof e&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",jv),Object.defineProperty(this,pg,jv),Bb(this,e)}getType(){return this.__type}isInline(){Wh(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Kb(e);if(null===t)break;e=null!==t.__parent?t.__parent:CS(t)}return!1}isSelected(e){const t=e||t_();if(null==t)return!1;const n=t.getNodes().some(e=>e.__key===this.__key);if(yy(this))return n;if(Ty(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Q_(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Kb(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Wh(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Tx(t)||null!==CS(e))return H_(e)||e===this&&Q_(e)||Wh(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Wh(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Kb(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Kb(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=H_(this)?this:this.getParent(),n=H_(e)?e:e.getParent(),r=t&&n?_w(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=_w(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===mw(t):("same"!==t.type&&"ancestor"!==t.type&&Wh(279),!1)))}isParentOf(e){return Ex(e,this)}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const o=i.__key;if(r.has(o)||(r.add(o),n.push(i)),i===e)break;const s=H_(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==s){i=s;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&Wh(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=R_()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(zv(this))return this;const e=Kb(this.__key);return null===e&&Wh(113),e}getWritable(){if(zv(this))return this;A_();const e=T_(),t=R_(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,s=t_();if(null!==s&&s.setCachedNodes(null),o.has(r))return qb(i),i;const a=cS(i);return o.add(r),qb(a),n.set(r,a),a}getTextContent(){return LS(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Wh(70)}updateDOM(e,t,n){Wh(71)}getDOMSlot(e){return new Np(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){Wh(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const o of rg(n).flatKeys)o in t&&(void 0!==i&&i!==r||(i={...r}),i[o]=t[o]);return(n.__state||i)&&ng(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Mv(this,!0,e)}replace(e,t){A_();let n=t_();null!==n&&(n=n.clone()),Ix(this,e);const r=this.getLatest(),i=this.__key,o=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size,c=s.getParent(),u=null!==c?s.getIndexWithinParent():-1;$b(s),null!==c&&Ty(n)&&r_(n,c,u,-1);const d=r.getPreviousSibling(),f=r.getNextSibling(),h=r.__prev,p=r.__next,g=r.__parent;Mv(r,!1,!0),null===d?a.__first=o:d.getWritable().__next=o,s.__prev=h,null===f?a.__last=o:f.getWritable().__prev=o,s.__next=p,s.__parent=g,a.__size=l;let m=0;t&&(H_(this)&&H_(s)||Wh(139),m=s.getChildrenSize(),s.splice(m,0,this.getChildren()));const v=RS(this);if(v.length>0){ES(this)&&ES(s)||Wh(368,this.__key,s.__key);for(const e of v){const t=DS(this,e);null!==t&&(BS(this,e),US(s,e,t))}}if(Ty(n)){ex(n);const e=n.anchor,r=n.focus;e.key===i&&(t&&"element"===e.type?e.set(s.__key,m+e.offset,"element"):Cy(e,s)),r.key===i&&(t&&"element"===r.type?r.set(s.__key,m+r.offset,"element"):Cy(r,s))}return Vb()===i&&Gb(o),s}insertAfter(e,t=!0){A_(),Ix(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.getParent(),o=t_();let s=!1,a=!1;if(null!==i){const n=e.getIndexWithinParent();if(Ty(o)){const e=i.__key,t=o.anchor,r=o.focus;s="element"===t.type&&t.key===e&&t.offset===n+1,a="element"===r.type&&r.key===e&&r.offset===n+1}$b(r),t&&Ty(o)&&r_(o,i,n,-1)}else $b(r);const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Ty(o)){const e=this.getIndexWithinParent();r_(o,c,e+1);const t=c.__key;s&&o.anchor.set(t,e+2,"element"),a&&o.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){A_(),Ix(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.__key,o=t_(),s=r.getParent(),a=null!==s?r.getIndexWithinParent():-1;$b(r),null!==s&&t&&Ty(o)&&r_(o,s,a,-1);const l=this.getPreviousSibling(),c=this.getParentOrThrow().getWritable(),u=n.__prev,d=this.getIndexWithinParent();return null===l?c.__first=i:l.getWritable().__next=i,c.__size++,n.__prev=i,r.__prev=u,r.__next=n.__key,r.__parent=n.__parent,t&&Ty(o)&&r_(o,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return pb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){A_();const n=AS(this);if(null!==n)return n.selectPrevious(e,t);const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(null===r)return i.select(0,0);if(H_(r))return r.select();if(!yy(r)){const e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){A_();const n=AS(this);if(null!==n)return n.selectNext(e,t);const r=this.getNextSibling(),i=this.getParentOrThrow();if(null===r)return i.select();if(H_(r))return r.select(0,0);if(!yy(r)){const e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function Bv(e){return e instanceof Uv}const $v="historic",qv="history-push",Gv="history-merge",Vv="paste",Kv="collaboration",Wv="skip-scroll-into-view",Hv="skip-dom-selection",Jv="skip-selection-focus",Xv="composition-start",Qv="composition-end";function Yv(e){const t={};if(!e)return t;let n="",r="",i=null,o=!1,s=!1,a=!1,l=0;const c=e.length;let u=-1;for(let h=0;h<c;h++){const c=e[h];if(o)"*"===c&&"/"===e[h+1]&&(o=!1,h++);else if(s)-1===u&&(u=h),s=!1;else if(null===i)if("/"!==c||"*"!==e[h+1])if('"'!==c&&"'"!==c)if("("!==c)if(")"!==c)if(a||":"!==c||0!==l){if(";"===c&&0===l){-1!==u&&(a?r+=e.slice(u,h):n+=e.slice(u,h),u=-1);const i=n.trim(),o=r.trim();""!==i&&""!==o&&(t[i]=o),n="",r="",a=!1;continue}-1===u&&(u=h)}else-1!==u&&(n+=e.slice(u,h),u=-1),a=!0;else-1===u&&(u=h),l=Math.max(0,l-1);else-1===u&&(u=h),l++;else-1===u&&(u=h),i=c;else-1!==u&&(a?r+=e.slice(u,h):n+=e.slice(u,h),u=-1),o=!0,h++;else-1===u&&(u=h),"\\"===c?s=!0:c===i&&(i=null)}-1!==u&&(a?r+=e.slice(u,c):n+=e.slice(u,c));const d=n.trim(),f=r.trim();return""!==d&&""!==f&&(t[d]=f),t}function Zv(e,t,n){const r=n.trimEnd(),i=r.length-10;i>=0&&"!important"===r.slice(i).toLowerCase()?e.setProperty(t,r.slice(0,i).trim(),"important"):e.setProperty(t,n,"")}function ey(e,t,n=""){if(t===n)return;const r=Yv(n),i=Yv(t);for(const o in i)delete r[o],Zv(e,o,i[o]);for(const o in r)e.removeProperty(o)}function ty(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function ny(e,t){return 1&t?"strong":2&t?"em":"span"}function ry(e,t,n,r,i){const o=r.classList;let s=gx(i,"base");void 0!==s&&o.add(...s),s=gx(i,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;void 0!==s&&(8&n&&4&n?(a=!0,l||o.add(...s)):l&&o.remove(...s));for(const c in yp){const e=yp[c];if(s=gx(i,c),void 0!==s)if(n&e){if(a&&("underline"===c||"strikethrough"===c)){t&e&&o.remove(...s);continue}(0===(t&e)||l&&"underline"===c||"strikethrough"===c)&&o.add(...s)}else t&e&&o.remove(...s)}}function iy(e,t,n){const r=n.isComposing(),i=e+(r?gp:""),o=nS(),s=rS(o).$getDOMSlot(n,t,o),a=s.getFirstChild();if(null===a||a.nodeType!==Node.TEXT_NODE)return void s.insertChild(Bx().createTextNode(i));const l=a,c=l.nodeValue;if(c!==i)if(r||Yh){const[e,t,n]=function(e,t){const n=e.length,r=t.length;let i=0,o=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;o+i<n&&o+i<r&&e[n-o-1]===t[r-o-1];)o++;return[i,n-i-o,t.slice(i,r-o)]}(c,i);0!==t&&l.deleteData(e,t),l.insertData(e,n)}else l.nodeValue=i}function oy(e,t,n,r,i,o){iy(i,e,t);const s=o.theme.text;void 0!==s&&ry(0,0,r,e,s)}function sy(e,t){const n=Bx().createElement(t);return n.appendChild(e),n}function ay(e){return null!=e&&!0===e.__isInlineFormattable}class ly extends Uv{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(e){return new ly(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return wp[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Vb()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=yp[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return jb(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=ty(0,n),i=ny(0,n),o=null===r?i:r,s=Bx().createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=Bx().createElement(i),s.appendChild(a)),oy(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&ey(s.style,l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=ty(0,i),a=ty(0,o),l=ny(0,i),c=ny(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&Wh(48);const i=Bx().createElement(c);return oy(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&Wh(49)),iy(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&ry(0,i,o,u,d);const f=e.__style,h=this.__style;return f!==h&&ey(t.style,h,f),!1}static importDOM(){return{"#text":()=>({conversion:hy,priority:0}),b:()=>({conversion:uy,priority:0}),code:()=>({conversion:my,priority:0}),em:()=>({conversion:my,priority:0}),i:()=>({conversion:my,priority:0}),mark:()=>({conversion:my,priority:0}),s:()=>({conversion:my,priority:0}),span:()=>({conversion:cy,priority:0}),strong:()=>({conversion:my,priority:0}),sub:()=>({conversion:my,priority:0}),sup:()=>({conversion:my,priority:0}),u:()=>({conversion:my,priority:0})}}static importJSON(e){return vy().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Hx(t)||Wh(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=sy(t,"b")),this.hasFormat("italic")&&(t=sy(t,"i")),this.hasFormat("strikethrough")&&(t=sy(t,"s")),this.hasFormat("underline")&&(t=sy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?yp[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?_p[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=jb(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Sp[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){A_();let n=e,r=t;const i=t_(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const e=o.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Ty(i))return Qy(s,n,s,r,"text","text");{const e=Vb();e!==i.anchor.key&&e!==i.focus.key||Gb(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=t_();if(r&&Ty(l)){const t=e+s;l.setTextNodeRange(i,t,i,t)}const c=o.slice(0,a)+n+o.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){A_();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Vb(),o=n.length;e.sort((e,t)=>e-t),e.push(o);const s=[],a=e.length;for(let w=0,E=0;w<o&&E<=a;E++){const t=e[E];t>w&&(s.push(n.slice(w,t)),w=t)}const l=s.length;if(1===l)return[t];const c=s[0],u=t.getParent();let d;const f=t.getFormat(),h=t.getStyle(),p=t.__detail;let g=!1,m=null,v=null;const y=t_();if(Ty(y)){const[e,t]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===e.type&&e.key===r&&(m=e),"text"===t.type&&t.key===r&&(v=t)}t.isSegmented()?(d=vy(c),d.__format=f,d.__style=h,d.__detail=p,d.__state=lg(t,d),g=!0):d=t.setTextContent(c);const _=[d];for(let w=1;w<l;w++){const e=vy(s[w]);e.__format=f,e.__style=h,e.__detail=p,e.__state=lg(t,e);const n=e.__key;i===r&&Gb(n),_.push(e)}const b=m?m.offset:null,x=v?v.offset:null;let S=0;for(const w of _){if(!m&&!v)break;const e=S+w.getTextContentSize();if(null!==m&&null!==b&&b<=e&&b>=S&&(m.set(w.getKey(),b-S,"text"),b<e&&(m=null)),null!==v&&null!==x&&x<=e&&x>=S){v.set(w.getKey(),x-S,"text");break}S=e}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&qb(t),null!==n&&qb(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,_),this.remove()):e.splice(t,1,_),Ty(y)&&r_(y,u,t,l-1)}return _}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Wh(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;Vb()===r&&Gb(n);const s=t_();if(Ty(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&s_(i,t,n,e,o),null!==a&&a.key===r&&s_(a,t,n,e,o)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function cy(e){return{forChild:_y(e.style),node:null}}function uy(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:_y(t.style,n?void 0:"bold"),node:null}}const dy=new WeakMap;function fy(e){if(!Hx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function hy(e){const t=e;null===e.parentElement&&Wh(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=dy.get(n))&&!fy(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let o=0;o<r.length;o++)dy.set(r[o],i);return i}(t))return{node:d_(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=py(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=py(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:vy(n)}}function py(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,Hx(n)){const e=n.style.display;if(""===e&&!Yx(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(Lb(n))return n;if("BR"===n.nodeName)return null}}const gy={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function my(e){const t=gy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:_y(e.style,t),node:null}}function vy(e=""){return Dx(new ly(e))}function yy(e){return e instanceof ly}function _y(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>yy(e)||ay(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),o&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class by extends ly{static getType(){return"tab"}static clone(e){return new by(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=gx(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return xy().updateFromJSON(e)}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||Wh(286),this}setDetail(e){return 2!==e&&Wh(127),this}setMode(e){return"normal"!==e&&Wh(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function xy(){return Dx(new by)}function Sy(e){return e instanceof by}class wy{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:gw(Tw(bw(this,"next")),Tw(bw(e,"next")))<0}getNode(){const e=Kb(this.key);return null===e&&Wh(20),e}set(e,t,n,r){const i=this._selection,o=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,C_()||(Vb()===o&&Gb(e),null!==i&&(i.setCachedNodes(null),Ty(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function Ey(e,t,n){return new wy(e,t,n)}function ky(e,t){let n=t.__key,r=e.offset,i="element";if(yy(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!H_(t)){const e=t.getNextSibling();if(yy(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Cy(e,t){if(H_(t)){const n=t.getLastDescendant();H_(n)||yy(n)?ky(e,n):ky(e,t)}else ky(e,t)}class Ay{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Dy(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Ay(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes().filter(e=>null===CS(e)),n=t.length;if(0===n)return;const r=t[n-1];let i;if(yy(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let o=0;o<n;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const r of t){const e=Kb(r);null!==e&&n.push(e)}return C_()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){const e=this.getNodes().filter(e=>null===CS(e));if((t_()||n_())===this&&e[0]){const t=rw(e[0],"next");Sw(hw(t,t))}for(const t of e)t.remove();Ny()}}function Ny(){const e=Zb();if(e.isEmpty()){const t=pb();e.append(t),t.select()}}function Ty(e){return e instanceof Ry}class Ry{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Ty(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=function(e){const t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);const i=new Set,o=new Set;for(const s of e)if(ZS(s)){const{origin:e}=s;0===t.length?i.add(e):(o.add(e),t.push(e))}else{const{origin:e}=s;H_(e)&&o.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),YS(e.focus)&&H_(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let s=aw(e.focus.origin,"previous");ZS(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(t[t.length-1]);s=lw(s))i.delete(s.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!H_(e)||o.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=Tw(e.anchor),r=Tw(e.anchor.getFlipped()),i=e=>QS(e)?e.origin:e.getNodeAtCaret(),o=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(o)}return t}(Iw(Ew(this),"next"));return C_()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text"),this}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,a]=Py(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(H_(d)&&!d.isInline()){c||(l+="\n");let e="";for(const t of RS(d)){const n=DS(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(l+=e,c=!1):c=!d.isEmpty()}else if(c=!1,yy(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<a?e.slice(s,a):e.slice(a,s)):e=o?e.slice(s):e.slice(a):d===n&&(e=o?e.slice(0,a):e.slice(0,s)),l+=e}else!Q_(d)&&!lb(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=R_(),n=t.getEditorState()._selection,r=Jy(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,o,s]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),s&&(this.dirty=!0),fg(this)}clone(){const e=this.anchor,t=this.focus;return new Ry(Ey(e.key,e.offset,e.type),Ey(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=jb(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=yp[e];return 0!==(this.format&t)}insertRawText(e){this.insertNodes(d_(e))}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let o=t,s=n;!this.isCollapsed()&&n.isBefore(t)&&(o=n,s=t),"element"===o.type&&function(e,t,n,r){const i=e.getNode(),o=i.getChildAtIndex(e.offset),s=vy();if(s.setFormat(n),s.setStyle(r),gb(o))o.splice(0,0,[s]);else if(null!==o){const e=Tx(i)?pb().append(s):s;o.insertBefore(e)}else if(Tx(i)){const e=i.getLastChild();H_(e)&&!e.isInline()&&e.isEmpty()?e.append(s):i.append(pb().append(s))}else i.append(s);e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(o,s,r,i),"element"===s.type&&xw(s,Tw(bw(s,"next")));const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];yy(d)||Wh(26);const f=d.getTextContent().length,h=d.getParentOrThrow();let p=c[u-1];if(1===u&&"element"===s.type&&(l=f,s.set(o.key,l,"text")),this.isCollapsed()&&a===f&&(Mb(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&null===d.getNextSibling())){const t=d.getNextSibling();let n;if(yy(t)&&t.canInsertTextBefore()&&!Mb(t)?n=t:(n=vy(),n.setFormat(r),n.setStyle(i),h.canInsertTextAfter()?d.insertAfter(n):h.insertAfter(n)),n.select(0,0),d=n,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(Mb(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&null===d.getPreviousSibling())){const t=d.getPreviousSibling();let n;if(!yy(t)||Mb(t)?(n=vy(),n.setFormat(r),h.canInsertTextBefore()?d.insertBefore(n):h.insertBefore(n)):n=t,n.select(),d=n,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==f)if(null!==Vb())d=d.setMode("normal").setFormat(r).setStyle(i);else{const e=vy(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||H_(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Vy(this.anchor,this.focus),void this.insertText(e)}if(1===u){if(Pb(d)){const t=vy(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Sy(d)){const t=vy(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=vy(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}d.setFormat(r),d.setStyle(i)}const o=l-a;d=d.spliceText(a,o,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{const t=new Set([...d.getParentKeys(),...p.getParentKeys()]),n=H_(d)?d:d.getParentOrThrow();let r=H_(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===s.type&&(0!==l||""===p.getTextContent())||"element"===s.type&&p.getIndexWithinParent()<l)if(yy(p)&&!Pb(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=vy(p.getTextContent());p.replace(e),p=e}Z_(s.getNode())||"text"!==s.type||(yy(p)||Wh(395),p=p.spliceText(0,l,"")),t.add(p.__key)}else{const e=p.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?p.remove():e.remove()}else t.add(p.__key);const o=r.getChildren(),h=new Set(c),g=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=o.length-1;e>=0;e--){const t=o[e];if(t.is(d)||H_(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(i)?g||m.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Pb(d))if(a===f)d.select();else{const t=vy(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){const e=t_()===this;ww(this,Nw(Ew(this))),e&&t_()!==this&&ex(this)}formatText(e,t=null){Fy(this,e,t)}insertNodes(e){if(0===e.length)return;this.isCollapsed()||this.removeText();const t=this.anchor.getNode();if("element"===this.anchor.type&&H_(t)&&null!==CS(t)){let n=t.isShadowRoot()?t.getFirstChild()??t.append(pb()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&null!==n&&!H_(n)){const e=pb();n.insertBefore(e),n=e}if(null!==n){n.selectStart();const t=t_();return Ty(t)||Wh(369),t.insertNodes(e)}}if("element"===this.anchor.type&&Tx(t)){const n=m_(e),r=n.getLastDescendant();return t.splice(this.anchor.offset,0,n.getChildren()),void(null!==r&&r.selectEnd())}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=bS(n,tS);const i=e[e.length-1];if(H_(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=h_(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(H_(e)||Q_(e))&&!e.isInline())){H_(r)||Wh(211,n.constructor.name,n.getType());const t=h_(this);return r.splice(t,0,e),void i.selectEnd()}if(H_(r)&&null!==CS(r)){const t=h_(this),n=f_(e);r.splice(t,0,n);const i=n[n.length-1];return void(void 0!==i?i.selectEnd():r.select(t,t))}if(null===r){const t=m_(e),n=t.getLastDescendant();let r=bw(this.anchor,"next");for(const e of t.getChildren())r=Lw(e,r);return void(null!==n&&n.selectEnd())}if(H_(r)&&!r.isParentRequired()&&!Tx(r.getParentOrThrow())){const t=h_(this),n=f_(e);r.splice(t,0,n);const i=n[n.length-1];return void(void 0!==i?i.selectEnd():r.select(t,t))}const o=m_(e),s=o.getLastDescendant(),a=o.getChildren(),l=H_(r)&&r.isEmpty()?null:this.insertParagraph();l&&!r.isAttached()&&(n=this.anchor.getNode(),r=bS(n,tS));const c=a[a.length-1];let u=a[0];var d;H_(d=u)&&tS(d)&&!d.isEmpty()&&H_(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(H_(r)||Wh(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(null===r&&Wh(212,n.constructor.name,n.getType()),function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const i=[t];for(;r!==n;)r.getNextSibling()||Wh(140),r=r.getNextSibling(),i.push(r);let o=e;for(const s of i)o=o.insertAfter(s)}(r,u));const f=bS(s,tS);l&&H_(f)&&(l.canMergeWhenEmpty()||tS(c))&&(f.append(...l.getChildren()),l.remove()),H_(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=H_(r)?r.getLastChild():null;lb(h)&&f!==r&&h.remove()}insertParagraph(){const e=this.anchor.getNode();if("element"===this.anchor.type&&Tx(e)){const t=pb();return e.splice(this.anchor.offset,0,[t]),t.select(),t}const t=h_(this),n=bS(this.anchor.getNode(),tS);if(null!==n&&null!==CS(n))return null;H_(n)||Wh(213);const r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],o=n.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=ab();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=[...this.getNodes()],t=e.length;let n=e[0],r=e[t-1];const[i,o]=Py(this),s=this.isBackward(),[a,l]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=s?[o,i]:[i,o];if(0===t)return[];if(1===t){if(yy(n)&&!this.isCollapsed()){const e=n.splitText(c,u),t=0===c?e[0]:e[1];return t?(a.set(t.getKey(),0,"text"),l.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(yy(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),yy(r)){const t=r.getTextContent().length;0===u?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,l.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(v_(this,e,t,n))return;const r="move"===e,i=R_(),o=Px(Cx(i));if(!o)return;const s=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();null===a||null===s||!H_(l)||l.isInline()||l.canBeEmpty()||Ox(s,i,a);const c=bx(i,this.focus.key);let u=c;if("text"===this.focus.type&&(u=yy(l)?oS(l,c,i):null),this.dirty){const e=bx(i,this.anchor.key);let t=e;if("text"===this.anchor.type){const n=this.anchor.getNode();t=yy(n)?oS(n,e,i):null}t&&u&&a_(o,t,this.anchor.offset,u,this.focus.offset)}if("character"===n&&yy(l)&&l.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===l.getTextContentSize())){const e=rw(l,t?"previous":"next").getNodeAtCaret();if(yy(e)){if(!r){const n=e.getTextContentSize();return t?this.focus.set(e.__key,n-1,"text"):this.focus.set(e.__key,1,"text"),void(this.dirty=!0)}{const n=i.getElementByKey(e.getKey()),r=n?oS(e,n,i):null;if(r){const e=t?r.length:0;a_(o,r,e,r,e)}}}}if(zy(o,e,t?"backward":"forward",n),o.rangeCount>0){const e=$x(o,i._rootElement),n=e||o.getRangeAt(0),s=this.anchor.getNode(),a=Z_(s)?s:Ax(s);this.applyDOMRange(n),this.dirty=!0,r||(jy(this,t,a),(e?"backward"!==o.direction:o.anchorNode===n.startContainer&&o.anchorOffset===n.startOffset)||Ly(this))}"lineboundary"===n&&v_(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&H_(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(H_(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=dw(bw(t,e?"previous":"next"));if(r.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(const t of r.iterNodeCarets("shadowRoot"))if(ZS(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(H_(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=Tw(t);ww(this,hw(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(YS(t)){if(H_(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(Q_(t.origin)){if(t.origin.isIsolated());else if(RS(t.origin).length>0){if(H_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=Zy();e.add(t.origin.getKey()),ex(e)}}else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&H_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=Zy();e.add(t.origin.getKey()),ex(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;if(RS(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(ww(this,hw(!t.origin.isEmpty()&&n.isEmpty()?kw(rw(n,t.direction)):r.anchor,t)),this.removeText())}for(let n=t.getNode();null!==n;){if(null!==CS(n))return;if(H_(n)&&n.isShadowRoot())break;n=n.getParent()}}const i=this.focus;if(Uy(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&My(this,t.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){const t=i.offset,o=r.getTextContentSize();if(r.is(n)||e&&t!==o||!e&&0!==t)return void $y(r,e,t)}else if(null!==n&&n.isSegmented()){const i=t.offset,o=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==o)return void $y(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,a=s?e:o,l=s?o:e,c=l-1;a!==c&&function(e){return!(rx(e)||By(e))}(i.getTextContent().slice(a,l))&&(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Z_(e.getParent())&&null===e.getPreviousSibling()&&My(this,e),Ny()}}deleteLine(e){const t=Ky(this.anchor);if(null!==t&&Q_(AS(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&Uy(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):bS(this.anchor.getNode(),tS)!==bS(this.focus.getNode(),tS)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;Uy(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){const e=this._cachedIsBackward;if(null!==e)return e;const t=this.focus.isBefore(this.anchor);return C_()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function Dy(e){return e instanceof Ay}function Iy(e,t){if(Dy(e)){for(const n of e.getNodes())ay(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Gb(null);const n=[];for(const v of e.getNodes())yy(v)?n.push(v):H_(v)?v.setTextFormat(t(v.getTextFormat())):ay(v)&&v.setFormat(t(v.getFormat()));const r=n.length;if(0===r)return e.setFormat(t(e.format)),void Gb(null);const i=e.anchor,o=e.focus,s=e.isBackward(),a=s?o:i,l=s?i:o;let c=0,u=n[0],d="element"===a.type?0:a.offset;if("text"===a.type&&d===u.getTextContentSize()&&(c=1,u=n[1],d=0),null==u)return;const f=r-1;let h=n[f];const p="text"===l.type?l.offset:h.getTextContentSize();if(u.is(h)){if(d===p)return;const n=t(u.getFormat());if(Mb(u)||0===d&&p===u.getTextContentSize())u.setFormat(n);else{const e=u.splitText(d,p),t=0===d?e[0]:e[1];t.setFormat(n),"text"===a.type&&a.set(t.__key,0,"text"),"text"===l.type&&l.set(t.__key,p-d,"text")}return void(e.format=n)}0===d||Mb(u)||([,u]=u.splitText(d),d=0);const g=t(u.getFormat());u.setFormat(g);const m=t(h.getFormat());p>0&&(p===h.getTextContentSize()||Mb(h)||([h]=h.splitText(p)),h.setFormat(m));for(let v=c+1;v<f;v++){const e=n[v];e.setFormat(t(e.getFormat()))}"text"===a.type&&a.set(u.__key,d,"text"),"text"===l.type&&l.set(h.__key,p,"text"),e.format=g|m}function Fy(e,t,n=null){const r=null===n&&Ty(e)?jb(e.format,t,null):n;Iy(e,e=>jb(e,t,r))}function Oy(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Py(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Oy(n),Oy(r)]}function My(e,t){for(let n=t;n;n=n.getParent()){if(H_(n)){if(n.collapseAtStart(e))return!0;if(Tx(n))break}if(n.getPreviousSibling())break}return!1}function Ly(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,o,!0)}function zy(e,t,n,r){e.modify(t,n,r)}function jy(e,t,n){const r=e.getNodes(),i=r.filter(e=>Ex(e,n));if(0===i.length||i.length===r.length)return!1;const o=t?i[0]:i[i.length-1],s=H_(o)?o:o.getParentOrThrow();return t?s.selectStart():s.selectEnd(),!0}function Uy(e,t,n){if(v_(e,"extend",t,n))return;const r=R_(),i=Px(Cx(r));if(!i||"function"!=typeof i.modify)return;const o=r._blockCursorElement,s=r._rootElement,a=e.anchor,l=e.focus.getNode();null===s||null===o||!H_(l)||l.isInline()||l.canBeEmpty()||Ox(o,r,s);const c=e=>{const t=e.getNode(),n=r.getElementByKey(e.key);return null!==n&&"text"===e.type&&yy(t)?oS(t,n,r):n},u=a.getNode(),d=c(a);if(null===d)return;const f=a.offset,h=e.isCollapsed(),p=e.focus,g=h?d:c(p);if(null===g)return;const m=p.offset;if(a_(i,g,m,g,m),zy(i,"move",t?"backward":"forward",n),0===i.rangeCount)return;const v=$x(i,s)||i.getRangeAt(0),y=v.startContainer,_=v.startOffset;if(h&&"character"===n&&"text"===a.type&&yy(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){const n=rw(u,t?"previous":"next").getNodeAtCaret();if(yy(n)){const r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,"text"),void(e.dirty=!0)}}if(h&&"character"===n&&"text"===a.type){const n=t?0:u.getTextContentSize(),r=y===d?_:f!==n?n:-1;if(r>=0)return void(r!==f&&(e.focus.set(a.key,r,"text"),e.dirty=!0))}const[b,x,S,w]=t?[y,_,d,f]:[d,f,y,_],E=Z_(u)?u:Ax(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:w,startContainer:b,startOffset:x}),e.dirty=!0,!jy(e,t,E)&&t&&Ly(e),"lineboundary"===n&&v_(e,"extend",t,n,"decorators")}const By=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(Wh){}return()=>!1})();function $y(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let c=0;c<o;c++){const e=c===o-1;if(a=s,s+=i[c].length,t&&s===n||s>n||e){i.splice(c,1),e&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function qy(e,t,n,r){let i,o=t,s=!1;if(Hx(e)){let a=!1;const l=e.childNodes,c=l.length,u=r._blockCursorElement;o===c&&c>0&&(a=!0,o=c-1),void 0!==Jb(e,r)||pS(e,r)||(s=!0);let d=l[o],f=!1;if(d===u)d=l[o+1],f=!0;else if(null!==u){const n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&o--}if(i=nx(d),yy(i))o=ow(i,a?"next":"previous");else{let l=nx(e);if(null===l)return null;if(H_(l)){const s=r.getElementByKey(l.getKey());null===s&&Wh(214);const c=iS(l,s,r);[l,o]=c.resolveChildIndex(l,s,e,t),H_(l)||Wh(215),a&&o>=l.getChildrenSize()&&(o=Math.max(0,l.getChildrenSize()-1));let u=l.getChildAtIndex(o);if(H_(u)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){const e=a?u.getLastDescendant():u.getFirstDescendant();null===e?l=u:(u=e,l=H_(u)?u:u.getParentOrThrow()),o=0}yy(u)?(i=u,l=null,o=ow(u,a?"next":"previous")):u!==l&&a&&!f&&(H_(l)||Wh(216),o=Math.min(l.getChildrenSize(),o+1))}else{const n=AS(l),i=null!==n?n:l,s=i.getIndexWithinParent(),a=r.getElementByKey(l.getKey());let c="after";if(null!==a&&nx(e)===l){const n=iS(l,a,r);n.element!==a?c=n.resolveLeafPosition(a,e,t):0===t&&Q_(l)&&(c="before")}o="before"===c?s:s+1,l=i.getParentOrThrow()}if(H_(l))return[Ey(l.__key,o,"element"),s]}}else i=nx(e);return yy(i)?[Ey(i.__key,ow(i,o,"clamp"),"text"),s]:null}function Gy(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(t){if((n||!t)&&null===r&&H_(o)&&o.isInline()){const t=o.getPreviousSibling();yy(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else H_(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):yy(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(t&&H_(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&H_(o)&&o.isInline()&&!o.canInsertTextAfter()&&o.getTextContentSize()>1){const t=o.getNextSibling();yy(t)&&e.set(t.__key,0,"text")}}}function Vy(e,t,n){if("text"===e.type&&"text"===t.type){const n=e.isBefore(t),r=e.is(t);Gy(e,n,r),Gy(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Ky(e){const t=Kb(e.key);return null===t?null:NS(t)}function Wy(e,t,n){const r=Ky(e),i=Ky(t);if(r===i||null!==r&&null!==i&&r.is(i))return!1;const o=n(r,i);if(null!==r)return H_(r)?t.set(r.getKey(),o?r.getChildrenSize():0,"element"):t.set(r.getKey(),o?r.getTextContentSize():0,"text"),!0;const s=AS(i);if(null===s)return!1;const a=s.getParent();if(null===a)return!1;const l=s.getIndexWithinParent();return t.set(a.getKey(),o?l+1:l,"element"),!0}function Hy(e){const t=Wy(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(null!==n&&null!==r){const e=AS(n),t=AS(r);if(null!==e&&e.is(t)){for(const t of TS(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return null===e||null===t||e.isBefore(t)}if(null!==n){const e=AS(n),r=Kb(t.key);return null===e||null===r||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}const i=AS(r),o=Kb(e.key);return null!==i&&null!==o&&!i.is(o)&&!i.isParentOf(o)&&o.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function Jy(e,t,n,r,i,o){if(null===e||null===n||!Db(i,e,n))return null;const s=qy(e,t,Ty(o)?o.anchor:null,i);if(null===s)return null;const a=qy(n,r,Ty(o)?o.focus:null,i);if(null===a)return null;const[l,c]=s,[u,d]=a;if("element"===l.type&&"element"===u.type){const t=nx(e),r=nx(n);if(Q_(t)&&Q_(r))return null}const f=i._slotsUsed&&Wy(l,u,()=>0!==(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return Vy(l,u),[l,u,c||d||f]}function Xy(e){return H_(e)&&!e.isInline()}function Qy(e,t,n,r,i,o){const s=T_(),a=new Ry(Ey(e,t,i),Ey(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function Yy(){const e=Ey("root",0,"element"),t=Ey("root",0,"element");return new Ry(e,t,0,"")}function Zy(){return new Ay(new Set)}function e_(e,t,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,a="selectionchange"===s,l=!zp&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,f;if(Ty(e)&&!l)return e.clone();{if(null===t)return null;const r=qx(t,n._rootElement);if(c=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(a||void 0===s)&&Ty(e)&&!Db(n,c,u))return e.clone()}const h=Jy(c,d,u,f,n,e);if(null===h)return null;const[p,g,m]=h;let v=0,y="";if(Ty(e)){const t=e.anchor;if(p.key===t.key)v=e.format,y=e.style;else{const e=p.getNode();yy(e)?(v=e.getFormat(),y=e.getStyle()):H_(e)&&(v=e.getTextFormat(),y=e.getTextStyle())}}const _=new Ry(p,g,v,y);return m&&(_.dirty=!0),_}function t_(){return T_()._selection}function n_(){return R_()._editorState._selection}function r_(e,t,n,r=1){const i=e.anchor,o=e.focus,s=i.getNode(),a=o.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),o.set(l,n,"element"),i_(e)}}else{const s=e.isBackward(),a=s?o:i,c=a.getNode(),u=s?i:o,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}i_(e)}function i_(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!H_(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(yy(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}return}if(H_(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(yy(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(H_(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(yy(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function o_(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,yy(r)?(s=r.getTextContentSize(),a="text"):H_(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,yy(i)?a="text":H_(i)&&(a="element")),null!==o&&null!==a?e.set(o,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function s_(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function a_(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function l_(e,t,n){const r=bx(e,t.getKey());if(H_(t)){const i=iS(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function c_(e,t,n,r,i,o){const s=o.getRootNode(),a=zb(s)||Mx(s)?Vx(s):null;if(i.has(Kv)&&a!==o||null!==a&&Rb(a,a))return;const l=qx(r,o);let c;if(!Ty(t))return void(null!==e&&Db(n,l.anchorNode,l.focusNode)&&r.removeAllRanges());const u=t.anchor,d=t.focus,f=u.getNode(),h=d.getNode(),[p,g]=l_(n,f,u.offset),[m,v]=l_(n,h,d.offset),y=t.format,_=t.style,b=t.isCollapsed();let x=p,S=m,w=!1;if("text"===u.type?(x=yy(f)?oS(f,p,n):null,w=f.getFormat()!==y||f.getStyle()!==_):Ty(e)&&"text"===e.anchor.type&&(w=!0),"text"===d.type&&(S=yy(h)?oS(h,m,n):null),null!==x&&null!==S){if(b&&(null===e||w||Ty(e)&&(e.format!==y||e.style!==_))&&function(e,t,n,r,i,o){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:o}}(n,y,_,g,u.key,performance.now()),("Range"!==r.type||!b)&&l.anchorOffset===g&&l.focusOffset===v&&l.anchorNode===x&&l.focusNode===S){if(null===a||!o.contains(a)){const e=null!==a?Fb(a):null;null!==e&&e!==n||i.has(Jv)||o.focus({preventScroll:!0})}if("element"!==u.type)return}if(a_(r,x,g,S,v),Yh&&t.isCollapsed()&&null!==o&&!i.has(Jv)){const e=Gx(o);if(null===e||!o.contains(e)){const e=Vx(o.ownerDocument),t=null!==e?Fb(e):null;null!==t&&t!==n||o.focus({preventScroll:!0})}}if(!i.has(Wv)&&t.isCollapsed()&&null!==o&&o===Gx(o)){const e=Ty(t)&&"element"===t.anchor.type?x.childNodes[g]||null:(void 0===c&&(c=function(e,t){const n=$x(e,t);if(null!==n){const e=function(e){const t=e.startContainer.ownerDocument;if(null===t)return null;const n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(e){return null}}(n);if(null!==e)return e}return e.rangeCount>0?e.getRangeAt(0):null}(r,o)),c);if(null!==e){let t;if(Lb(e)){const n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=Sx(n),i=kx(r);if(null===r||null===i)return;const o=n.getBoundingClientRect();if(t.bottom<o.top)return;let{top:s,bottom:a}=t,l=0,c=0,u=n;for(;null!==u;){const t=u===r.body;if(t){const t=i.visualViewport;if(t){const e=t.offsetTop;l=e,c=e+t.height}else l=0,c=Cx(e).innerHeight;const n=i.getComputedStyle(r.documentElement),o=parseFloat(n.scrollPaddingTop),s=parseFloat(n.scrollPaddingBottom);isFinite(o)&&(l+=o),isFinite(s)&&(c-=s)}else{const e=u===n?o:u.getBoundingClientRect();l=e.top,c=e.bottom}let d=0;if(s<l?d=-(l-s):a>c&&(d=a-c),0!==d)if(t)i.scrollBy(0,d);else{const e=u.scrollTop;u.scrollTop+=d;const t=u.scrollTop-e;s-=t,a-=t}if(t)break;u=xx(u)}}(n,t,o)}}!function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0}(n)}}function u_(e,t){for(const n of e.split(/(\r?\n|\t)/))"\n"===n||"\r\n"===n?t.linebreak():"\t"===n?t.tab():""!==n&&t.text(n)}function d_(e){const t=[];return u_(e,{linebreak:()=>t.push(ab()),tab:()=>t.push(xy()),text:e=>t.push(vy(e))}),t}function f_(e){const t=[];for(const n of e)lb(n)||(!H_(n)&&!Q_(n)||n.isInline()?t.push(n):H_(n)&&t.push(...f_(n.getChildren())));return t}function h_(e){let t=e;e.isCollapsed()||t.removeText();const n=t_();Ty(n)&&(t=n),Ty(t)||Wh(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!tS(i)&&null===CS(i);){const e=i;if([i,o]=p_(i,o),e.is(i))break}return o}function p_(e,t){const n=e.getParent();if(!n){const e=pb();return Zb().append(e),e.select(),[Zb(),0]}if(yy(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!H_(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Ry(Ey(e.__key,t,"element"),Ey(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function g_(e){return lb(e)||function(e){return H_(e)&&e.isInline()||Q_(e)&&e.isInline()}(e)||yy(e)||e.isParentRequired()}function m_(e){const t=pb();let n=null;for(let r=0;r<e.length;r++){const i=e[r];if(g_(i)){if(null===n){n=i.createParentElementNode(),t.append(n);const o=e[r+1];if(lb(i)&&(void 0===o||!g_(o)))continue}n.append(i)}else t.append(i),n=null}return t}function v_(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){const[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}const o=bw(e.focus,n?"previous":"next"),s="lineboundary"===r,a="move"===t;let l=o,c="decorators-and-blocks"===i;if(!Rw(l)){for(const e of l){c=!1;const{origin:t}=e;if(!Q_(t)||t.isIsolated()||(l=e,!s||!t.isInline()))break}if(c)for(const e of dw(o).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(ZS(e))e.origin.isInline()||(l=e);else{if(H_(e.origin))continue;Q_(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===o)return!1;if(a&&!s&&Q_(l.origin)&&l.origin.isKeyboardSelectable()){const e=Zy();return e.add(l.origin.getKey()),ex(e),!0}return l=Tw(l),a&&xw(e.anchor,l),xw(e.focus,l),c||!s}let y_=null,__=null,b_=!1,x_=!1,S_=!1;const w_=new Set;let E_=0;const k_={characterData:!0,childList:!0,subtree:!0};function C_(){return b_||null!==y_&&y_._readOnly}function A_(){b_&&Wh(13)}function N_(){E_>99&&Wh(14)}function T_(){return null===y_&&Wh(195,D_()),y_}function R_(){return null===__&&Wh(337,D_()),__}function D_(){let e=0;const t=new Set,n=wb.version;if("undefined"!=typeof window)for(const i of jx(document)){const r=Ob(i);if(Ib(r))e++;else if(r){let e=String(r.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function I_(){return __}function F_(e,t,n){const r=t.__type,i=Ab(e,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let a=0;a<s&&(o[a](t),t.isAttached());a++);}function O_(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function P_(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const i of r)n.add(i)}function M_(e){return L_(e,R_()._nodes)}function L_(e,t){const n=e.type,r=t.get(n);void 0===r&&Wh(17,n);const i=r.klass;e.type!==i.getType()&&Wh(18,i.name);const o=i.importJSON(e),s=e.children;if(H_(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const e=L_(s[l],t);o.append(e)}const a=e.$slots;if(a){ES(o)||Wh(379,i.name);for(const e in a)US(o,e,L_(a[e],t))}return o}function z_(e,t,n){const r=y_,i=b_,o=__;y_=t,b_=!0,__=e;try{return n()}finally{y_=r,b_=i,__=o}}function j_(e,t){const n=S_;S_=!0;try{!function(e,t){const n=e._pendingEditorState,r=e._rootElement,i=e._headless||null===r;if(null===n)return void(!e._updating&&e._deferred.length>0&&$_(e,e._deferred));const o=e._editorState,s=o._selection,a=n._selection,l=0!==e._dirtyType,c=y_,u=b_,d=__,f=e._updating,h=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==h){__=e,y_=n,b_=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;h.disconnect(),p=function(e,t,n,r,i,o){xg="",Sg=null,wg=null,Eg=null,zg=2===r,_g=n,yg=n._config,Lg=n._config.dom||_b,bg=n._nodes,Ng=_g._listeners.mutation,Tg=i,Rg=o,Dg=e._nodeMap,Ig=e,Fg=t._nodeMap,jg=t._readOnly,Og=Pp(n._keyToDOMMap),Pg=function(){const e=new Map,t=t=>{for(const n of t){const t=Fg.get(n);if(void 0===t)continue;const r=t.__parent;if(null===r)continue;let i=e.get(r);void 0===i&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Tg.keys()),t(Rg),e}();const s=new Map;return Mg=s,om("root",null),_g=void 0,bg=void 0,Tg=void 0,Rg=void 0,Dg=void 0,Ig=void 0,Fg=void 0,yg=void 0,Og=void 0,Pg=void 0,Mg=void 0,Lg=_b,s}(o,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),x_)throw t;return vb(e,null,r,n),Wp(e),e._dirtyType=2,x_=!0,j_(e,o),void(x_=!1)}finally{h.observe(r,k_),e._updating=f,y_=c,b_=u,__=d}}n._readOnly||(n._readOnly=!0);const g=e._dirtyLeaves,m=e._dirtyElements,v=e._normalizedNodes,y=e._updateTags;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=Qb(e)),delete r[o])}(e,n);const _=i?null:Px(Cx(e));if(e._editable&&null!==_&&(l||null===a||a.dirty||!a.is(s))&&null!==r&&!y.has(Hv)){__=e,y_=n;try{if(null!==h&&h.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&Ox(t,e,r),c_(s,a,e,_,y,r)}!function(e,t,n){let r=e._blockCursorElement;if(Ty(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(Gx(t))){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())Fx(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(null!==t&&Fx(t)){const n=t.getPreviousSibling();(null===n||Fx(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=iS(o,e.getElementByKey(o.__key),e).element;return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=Bx().createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Bw(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Ox(r,e,t)}(e,r,a)}finally{null!==h&&h.observe(r,k_),__=d,y_=c}}null!==p&&function(e,t,n,r,i){const o=Array.from(e._listeners.mutation),s=o.length;for(let a=0;a<s;a++){const[e,s]=o[a];for(const o of s){const s=t.get(o);void 0!==s&&e(s,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,p,y,g,o),Ty(a)||null===a||null!==s&&s.is(a)||e.dispatchCommand(dm,void 0);const b=e._pendingDecorators;null!==b&&(e._decorators=b,e._pendingDecorators=null,U_("decorator",e,!0,b)),function(e,t,n){const r=Yb(t),i=Yb(n);r!==i&&U_("textcontent",e,!0,i)}(e,t||o,n),U_("update",e,!0,{dirtyElements:m,dirtyLeaves:g,editorState:n,mutatedNodes:p,normalizedNodes:v,prevEditorState:t||o,tags:y}),f||$_(e,e._deferred),function(e){const t=e._updates;if(0===t.length)return void(e._cascadeCount=0);if(function(e){w_.has(e)||(w_.add(e),setTimeout(()=>{w_.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));const n=t.shift();if(n){const[t,r]=n;G_(e,t,r)}}(e)}(e,t)}finally{S_=n}}function U_(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=t._listeners[e],i=Array.from(n);for(const[e,t]of i){t&&t();const i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function B_(e,t,n,r){const i=ix(e);let o;if(!S_)for(let s=0;s<i.length;s++)i[s]._updating||(i[s]._cascadeCount=0);for(let s=4;s>=0;s--)for(let e=0;e<i.length;e++){const a=i[e];if(e>0&&a._updating){o=a;break}const l=a._commands.get(t);if(void 0!==l){const e=l[s];if(e.size>0){let t=!1;if(V_(a,()=>{for(const i of e)if(i(n,r))return void(t=!0)}),t)return t}}}return o&&o.update(()=>{B_(o,t,n,r)}),!1}function $_(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function q_(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t,o=e._pendingEditorState;let s;void 0!==i&&(s=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(null===o&&Wh(191),o._flushSync=!0),s&&e._deferred.push(s),P_(e,i.tag)),null==o?G_(e,n,i):n()}}return r}function G_(e,t,n){const r=e._updateTags;let i,o=!1,s=!1;void 0!==n&&(i=n.onUpdate,P_(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let l=e._pendingEditorState,c=!1;(null===l||l._readOnly)&&(l=e._pendingEditorState=eb(l||a),c=!0),l._flushSync=s;const u=y_,d=b_,f=__,h=e._updating;y_=l,b_=!1,e._updating=!0,__=e;const p=e._headless||null===e.getRootElement();kb(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=Px(Cx(e));return Ty(n)||null==n?e_(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),o=q_(e,o),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Ty(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),0!==e._dirtyType&&(o?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const i of n){const e=r.get(i);yy(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&dg(e)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=Vb(),s=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);yy(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&dg(r),void 0!==r&&O_(r,o)&&F_(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){E_++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,c.delete("root")&&c.set("root",!0);for(const e of c){const n=e[0],a=e[1];if(r.set(n,a),!a)continue;const l=i.get(n);void 0!==l&&O_(l,o)&&F_(t,l,s)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,E_++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),q_(e),function(e,t,n,r){const i=e._nodeMap,o=t._nodeMap,s=[];for(const[c]of r){const e=o.get(c);void 0!==e&&(e.isAttached()||(H_(e)&&Lp(e,c,i,o,s,r),i.has(c)||r.delete(c),s.push(c)))}for(const c of n){const e=o.get(c);void 0===e||e.isAttached()||(ES(e)&&null!==e.__slots&&Lp(e,c,i,o,s,n),i.has(c)||n.delete(c),s.push(c))}for(const c of s)o.delete(c);const a=R_(),l=a._compositionKey;null===l||o.has(l)||(a._compositionKey=null)}(a,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);const i=l._selection;if(Ty(i)){e._slotsUsed&&Hy(i);const t=l._nodeMap,n=i.anchor.key,r=i.focus.key;void 0!==t.get(n)&&void 0!==t.get(r)||Wh(19)}else Dy(i)&&0===i._nodes.size&&(l._selection=null)}catch(Wh){return Wh instanceof Error&&e._onError(Wh),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void j_(e)}finally{y_=u,b_=d,__=f,e._updating=h,E_=0}const g=0!==e._dirtyType||e._deferred.length>0||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(l,e);g?l._flushSync?(l._flushSync=!1,j_(e)):c&&Tb(()=>{j_(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function V_(e,t,n){__===e&&void 0===n?t():G_(e,t,n)}function K_(e){if(Tx(e)){let t=null;for(const n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class W_ extends Uv{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:K_,extends:Uv})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&Wh(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return xp[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()&&0===RS(this).length}isDirty(){const e=R_()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];for(const n of RS(this)){const t=DS(this,n);H_(t)&&e.push(...t.getAllTextNodes())}let t=this.getFirstChild();for(;null!==t;){if(yy(t)&&e.push(t),H_(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;H_(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;H_(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return H_(e)&&e.getLastDescendant()||e||null}const r=t[e];return H_(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Kb(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Wh(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Kb(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Wh(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=LS(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),H_(i)&&r!==n-1&&!i.isInline()&&(e+=mp)}return e}getTextContentSize(){let e=function(e){let t=0;for(const n of RS(e)){const r=DS(e,n);null!==r&&(t+=r.getTextContentSize())}return t}(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),H_(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){const t=bp[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=yp[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return jb(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){A_();const n=t_();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(yy(e)||H_(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(yy(e)||H_(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Ty(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):Qy(s,r,s,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e&&bp[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){zv(this)&&Wh(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Wh(226,String(e),String(t),String(r));for(const f of n);const o=i.__key,s=[],a=[],l=this.getChildAtIndex(e+t);let c=null,u=r-t+n.length;if(0!==e)if(e===r)c=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(c=t.getPreviousSibling())}if(t>0){let e=null===c?this.getFirstChild():c.getNextSibling();for(let n=0;n<t;n++){null===e&&Wh(100);const t=e.getNextSibling(),n=e.__key;$b(e.getWritable()),a.push(n),e=t}}let d=c;for(const f of n){null!==d&&f.is(d)&&(c=d=d.getPreviousSibling());const e=f.getWritable();e.__parent===o&&u--,$b(e);const t=f.__key;if(null===d)i.__first=t,e.__prev=null;else{const n=d.getWritable();n.__next=t,e.__prev=n.__key}f.__key===o&&Wh(76),e.__parent=o,s.push(t),d=f}if(e+t===r)null!==d&&(d.getWritable().__next=null,i.__last=d.__key);else if(null!==l){const e=l.getWritable();if(null!==d){const t=d.getWritable();e.__prev=d.__key,t.__next=l.__key}else e.__prev=null}if(i.__size=u,a.length){const e=t_();if(Ty(e)){const t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;J_(r,t,n)&&o_(r,r.getNode(),this,c,l),J_(i,t,n)&&o_(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||Tx(this)||this.remove()}}return i}getDOMSlot(e){return new Rp(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Hx(t)){const e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px",t.setAttribute("data-lexical-indent",String(e)));const n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||Tx(this)||this.getChildren().some(yy)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=iS(this,e,t);let r=n.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const e=t.getElementByKey(i.getKey());null!==e&&(null==r?(n.insertChild(e),r=e):r!==e&&n.replaceChild(e,r),r=r.nextSibling)}}}function H_(e){return e instanceof W_}function J_(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class X_ extends Uv{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&Wh(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Q_(e){return e instanceof X_}class Y_ extends W_{__cachedText;static getType(){return"root"}static clone(){return new Y_}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Wh(51)}getTextContent(){const e=this.__cachedText;return null===e||!C_()&&0!==R_()._dirtyType?super.getTextContent():e}remove(){Wh(52)}replace(e){Wh(53)}insertBefore(e){Wh(54)}insertAfter(e){Wh(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const r of n)H_(r)||Q_(r)||Wh(282);return super.splice(e,t,n)}static importJSON(e){return Zb().updateFromJSON(e)}collapseAtStart(){return!0}}function Z_(e){return e instanceof Y_}function eb(e){return new rb(Pp(e._nodeMap),null,e._slotsUsed)}function tb(){return new rb(new Map([["root",new Y_]]),null,!1)}function nb(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Wh(130,n.name),H_(e)){const r=t.children;Array.isArray(r)||Wh(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=nb(i[e]);r.push(t)}}const r=RS(e);if(r.length>0){const i={};for(const t of r){const r=DS(e,t);null===r&&Wh(366,n.name,t),i[t]=nb(r)}t.$slots=i}return t}class rb{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return z_(t&&t.editor||null,this,e)}clone(e){const t=new rb(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return z_(null,this,()=>({root:nb(Zb())}))}}class ib extends W_{static getType(){return"artificial"}createDOM(e){return Bx().createElement("div")}}class ob extends Uv{static getType(){return"linebreak"}static clone(e){return new ob(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return Bx().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>cb(e)||ub(e)?null:{conversion:sb,priority:0}}}static importJSON(e){return ab().updateFromJSON(e)}}function sb(e){return{node:ab()}}function ab(){return Dx(new ob)}function lb(e){return e instanceof ob}function cb(e){const t=e.parentElement;if(null!==t&&eS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&db(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&db(n))return!0}}return!1}function ub(e){const t=e.parentElement;if(null!==t&&eS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&db(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&db(r))return!0}return!1}function db(e){return Lb(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class fb extends W_{static getType(){return"paragraph"}static clone(e){return new fb(e.__key)}createDOM(e){const t=Bx().createElement("p"),n=gx(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:hb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Hx(t)){this.isEmpty()&&t.append(Bx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return pb().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){const t=this.getChildren().find(yy);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const n=pb();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||yy(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function hb(e){const t=pb();if(fS(t,e),uS(e,t),""===t.getFormatType()){const n=e.getAttribute("align");n&&n&&n in bp&&t.setFormat(n)}return dS(t,e),{node:t}}function pb(){return Dx(new fb)}function gb(e){return e instanceof fb}function mb(e){console.warn(e)}function vb(e,t,n,r,i){const o=e._keyToDOMMap;o.clear(),e._editorState=tb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,null!==e._inputState.handledSelectionCommandTimeoutId&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};const s=e._observer;null!==s&&(s.disconnect(),e._observer=null),null!==t&&(t.textContent="",function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),null!==n&&(n.textContent="",o.set("root",n),Hb(n,e,"root"))}function yb(e){const t=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of yS(e)){const e=r.transform;if(!n.has(e)){n.add(e);const i=r.transform();i&&t.add(i)}if(i){const e=i.$transform;e&&t.add(e)}}return t}const _b={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{const n=Nb(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>H_(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>H_(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function bb(e){const t=e||{},n=I_(),r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=tb(),a=t.namespace||(null!==i?i._config.namespace:ox()),l=t.editorState,c=[Y_,ly,ob,by,fb,ib,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,h=void 0===t.editable||t.editable;let p;if(void 0===e&&null!==n)p=n._nodes;else{p=new Map;for(let e=0;e<c.length;e++){let n=c[e],r=null,i=null;if(n&&"object"==typeof n){const e=n;n=e.replace,r=e.with,i=e.withKlass||null}if("function"!=typeof n||!n.prototype||!(n===Uv||n.prototype instanceof Uv)){let r="<unknown>";try{r=JSON.parse(Ip)}catch(Wh){}Wh(365,String(e-c.length+(t.nodes?t.nodes.length:0)),"function"==typeof n?`${n.name}${"function"==typeof n.getType?` (type ${String(n.getType())})`:""}`:String(n),String(r))}vS(n);const o=n.getType(),s=yb(n);p.set(o,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Zp(c[e]),transforms:s})}}const g=new wb(s,i,p,{disableEvents:o,dom:{..._b,...e&&e.dom},namespace:a,theme:r},u||console.error,d||mb,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)}),t&&i(t),n}(p,f?f.import:void 0),h,e);return void 0!==l&&(g._pendingEditorState=l,g._dirtyType=2),function(e){e.registerCommand(pm,wv,0),e.registerCommand(gm,Ev,0),e.registerCommand(mm,kv,0),e.registerCommand(vm,Cv,0),e.registerCommand(Rm,Tv,0)}(g),g}function xb(e,t){const n=e.get(t);e.delete(t),n&&n()}function Sb(e,t,n){return e.set(t,n),xb.bind(null,e,t)}class wb{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,o,s,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Mp,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ox(),this._onError=i,this._onWarn=o,this._htmlConversions=s,this._editable=a,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return Sb(this._listeners.update,e)}registerEditableListener(e){return Sb(this._listeners.editable,e)}registerDecoratorListener(e){return Sb(this._listeners.decorator,e)}registerTextContentListener(e){return Sb(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return Gw(Sb(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){const r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){void 0===n&&Wh(35);const r=this._commands;r.has(e)||r.set(e,[new Fp,new Fp,new Fp,new Fp,new Fp]);const i=r.get(e);void 0===i&&Wh(36,String(e));const o=function(e){return 7&e}(n),s=i[o];return o!==n?s.addFront(t):s.addBack(t),()=>{s.delete(t),i.every(e=>0===e.size)&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let o=i.get(t);void 0===o&&(o=new Set,i.set(t,o)),o.add(r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{o.delete(r),0===o.size&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Wh(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=lS(n).get(t.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){const n=lS(e.getEditorState()),r=[];for(const i of t){const e=n.get(i);e&&r.push(e)}0!==r.length&&e.update(()=>{for(const e of r)for(const t of e.keys()){const e=Kb(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:Gv}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return _x(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=gx(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,vb(this,t,e,r,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||Pv(t),null!=n&&t.classList.remove(...n)),null!==e){const t=kx(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,Wp(this),this._updateTags.add(Gv),j_(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;uv.set(e,n);let r=dv.get(n);void 0===r&&(r={editors:new Set,hasShadowEditor:void 0},dv.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;const i=Rv(e);i.push(fv.register(n));for(let o=0;o<cv.length;o++){const[n,r]=cv[o],s="function"==typeof r?e=>{Ov(e)||(Fv(e),(t.isEditable()||"click"===n)&&r(e,t))}:e=>{if(Ov(e))return;Fv(e);const r=t.isEditable();switch(n){case"cut":return r&&_x(t,Ym,e);case"copy":return _x(t,Qm,e);case"paste":return r&&_x(t,Sm,e);case"dragstart":return r&&_x(t,Hm,e);case"dragover":return r&&_x(t,Jm,e);case"dragend":return r&&_x(t,Xm,e);case"focus":return r&&_x(t,iv,e);case"blur":return r&&_x(t,ov,e);case"drop":return r&&_x(t,Km,e)}};i.push(av(e,n,s))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Gv),j_(this);U_("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Wh(38);let n=e;n._readOnly&&(n=eb(e),n._selection=e._selection?e._selection.clone():null),Kp(this);const r=this._pendingEditorState,i=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=i&&this._updateTags.add(i),j_(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,V_(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(const[e,t]of n._nodeMap.entries())H_(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){const r=tb(),i=y_,o=b_,s=__,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,y_=r,b_=!1,__=t,kb(null);try{const i=t._nodes;L_(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,y_=i,b_=o,__=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(...e){const[t,n]=1===e.length?["force-commit",e[0]]:e;return"force-commit"===t&&j_(this),("pending"===t?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):G_(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),V_(this,()=>{const r=t_(),i=Zb();null!==r?r.dirty||ex(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),wx("focus"),function(e){A_(),R_()._deferred.push(e)}(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Px(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,U_("editable",this,!0,e),this._slotsUsed&&this.update(()=>{R_()._dirtyType=2}))}toJSON(){return{editorState:this._editorState.toJSON()}}}wb.version=Ip;let Eb=null;function kb(e){Eb=e}let Cb=1;function Ab(e,t){const n=Nb(e,t);return void 0===n&&Wh(30,t),n}function Nb(e,t){return e._nodes.get(t)}const Tb="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Rb(e,t){const n=void 0!==t?t:(()=>{const t=e.getRootNode();return zb(t)||Mx(t)?Vx(t):null})();if(!Hx(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;const r=Xb(n),i=n.nodeName;return Bv(r)&&("INPUT"===i||"TEXTAREA"===i||"true"===n.contentEditable&&null==Ob(n))}function Db(e,t,n){const r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch(e){return!1}return Fb(t)===e&&e.read("latest",()=>!Rb(t))}function Ib(e){return e instanceof wb}function Fb(e){let t=e;for(;null!=t;){const e=Ob(t);if(Ib(e))return e;t=xx(t)}return null}function Ob(e){return e?e.__lexicalEditor:null}function Pb(e){return Sy(e)||e.isToken()}function Mb(e){return Pb(e)||e.isSegmented()}function Lb(e){return Jx(e)&&3===e.nodeType}function zb(e){return Jx(e)&&9===e.nodeType}function jb(e,t,n){const r=yp[t];if(null!==n&&(e&r)===(n&r))return e;let i=e^r;return"subscript"===t?i&=-65:"superscript"===t?i&=-33:"lowercase"===t?(i&=-513,i&=-1025):"uppercase"===t?(i&=-257,i&=-1025):"capitalize"===t&&(i&=-257,i&=-513),i}function Ub(e){return yy(e)||lb(e)||Q_(e)}function Bb(e,t){const n=function(){const e=Eb;return Eb=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);A_(),N_();const r=R_(),i=T_(),o=""+Cb++;i._nodeMap.set(o,e),H_(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),0===r._dirtyType&&(r._dirtyType=1),e.__key=o}function $b(e){null!==CS(e)&&Wh(380,e.__key,String(CS(e)));const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling(),s=null!==o?o.__key:null,a=null!==i?i.__key:null,l=null!==i?i.getWritable():null,c=null!==o?o.getWritable():null;null===i&&(r.__first=s),null===o&&(r.__last=a),null!==l&&(l.__next=s),null!==c&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function qb(e){N_(),zv(e)&&Wh(323,e.__key,e.__type);const t=e.getLatest(),n=null!==t.__parent?t.__parent:kS(t)?t.__slotHost:null,r=T_(),i=R_(),o=r._nodeMap,s=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=null!==e.__parent?e.__parent:kS(e)?e.__slotHost:null}}(n,o,s);const a=t.__key;0===i._dirtyType&&(i._dirtyType=1),H_(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function Gb(e){A_();const t=R_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Kb(n);null!==e&&e.getWritable()}if(null!==e){const t=Kb(e);null!==t&&t.getWritable()}}}function Vb(){return C_()?null:R_()._compositionKey}function Kb(e,t){const n=(t||T_())._nodeMap.get(e);return void 0===n?null:n}function Wb(e,t){const n=Jb(e,R_());return void 0!==n?Kb(n,t):null}function Hb(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Jb(e,t){return e[`__lexicalKey_${t._key}`]}function Xb(e,t){let n=e;for(;null!=n;){const e=Wb(n,t);if(null!==e)return e;n=xx(n)}return null}function Qb(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Yb(e){return e.read(()=>Zb().getTextContent())}function Zb(){return T_()._nodeMap.get("root")}function ex(e){A_();const t=T_();null!==e&&(e.dirty=!0,e.setCachedNodes(null),Ty(e)&&R_()._slotsUsed&&Hy(e)),t._selection=e}function tx(){A_(),Kp(R_())}function nx(e){const t=function(e,t){let n=e;for(;null!=n;){const e=Jb(n,t);if(void 0!==e)return e;n=xx(n)}return null}(e,R_());return null===t?null:Kb(t)}function rx(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ix(e){const t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function ox(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function sx(e){return Lb(e)?e.nodeValue:null}function ax(e,t,n){const r=Px(Cx(t));if(null===r)return;const i=qx(r,t._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:a}=i;if(null!==o){let t=sx(o);const r=Xb(o);if(null!==t&&yy(r)){if((t===gp||t===vp)&&n){const e=n.length;t=n,s=e,a=e}null!==t&&lx(r,t,s,a,e)}}}function lx(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();if(o.isToken()&&s)return;let a=t;if((s||i)&&(t.endsWith(gp)&&(a=t.slice(0,-gp.length)),i)){const e=vp;let t;for(;-1!==(t=a.indexOf(e));)a=a.slice(0,t)+a.slice(t+e.length),null!==n&&n>t&&(n=Math.max(t,n-e.length)),null!==r&&r>t&&(r=Math.max(t,r-e.length))}const l=o.getTextContent();if(i||a!==l){const t=t_();if(""===a){if(Gb(null),np||ep||op)o.remove();else{const e=R_();cx(o,"",t),setTimeout(()=>{e.update(()=>{o.isAttached()&&""===o.getTextContent()&&o.remove()})},20)}return}const i=o.getParent(),l=n_(),c=o.getTextContentSize(),u=Vb(),d=o.getKey();if(o.isToken()&&!s||null!==u&&d===u&&!s||Ty(l)&&(null!==i&&!i.canInsertTextBefore()&&0===l.anchor.offset||l.anchor.key===e.__key&&0===l.anchor.offset&&!o.canInsertTextBefore()&&!s||l.focus.key===e.__key&&l.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();if(!Ty(t)||null===n||null===r)return void cx(o,a,t);if(t.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=vy(o.getTextContent());o.replace(e),o=e}cx(o,a,t)}}}function cx(e,t,n){if(e.setTextContent(t),Ty(n)){const t=e.getKey();let r=!1;for(const i of["anchor","focus"]){const o=n[i];"text"===o.type&&o.key===t&&(o.offset=ow(e,o.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function ux(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function dx(e,t,n){if(!function(e,t){return ux(e,t,"altKey")&&ux(e,t,"ctrlKey")&&ux(e,t,"shiftKey")&&ux(e,t,"metaKey")}(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1)return!1;if(1===e.key.length&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;const r="Key"+t.toUpperCase();return e.code===r}const fx={ctrlKey:!Qh,metaKey:Qh},hx={altKey:Qh,ctrlKey:!Qh};function px(e){return"Backspace"===e.key}function gx(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=Bw(i);return n[t]=e,e}return i}function mx(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&Wh(33,o);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(s,d?"updated":i)}function vx(e,t,n){const r=e.getParent();let i=n,o=e;return null!==r&&(0===n&&(i=o.getIndexWithinParent(),o=r)),o.getChildAtIndex(i-1)}function yx(e){const t=Cx(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function _x(e,t,n){return B_(e,t,n,e)}function bx(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Wh(75,t),n}function xx(e){const t=e.assignedSlot||e.parentElement;if(null!==t)return t;const n=e.parentNode;return Mx(n)?n.host:null}function Sx(e){return zb(e)?e:Hx(e)?e.ownerDocument:null}function wx(e){A_(),R_()._updateTags.add(e)}function Ex(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function kx(e){const t=Sx(e);return t?t.defaultView:null}function Cx(e){const t=e._window;return null===t&&Wh(78),t}function Ax(e){let t=e.getLatest();for(;null!==t;){if(null!==CS(t)&&H_(t))return t;const e=t.getParentOrThrow();if(Tx(e))return e;t=e}return t}function Nx(e){return H_(e)&&e.isShadowRoot()}function Tx(e){return Z_(e)||Nx(e)}function Rx(e,t=!1){const n=e.constructor.clone(e);return Bb(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Dx(e){const t=R_(),n=e.getType(),r=Nb(t,n);void 0===r&&Wh(200,e.constructor.name,n);const{replace:i,replaceWithKlass:o}=r;if(null!==i){const t=i(e),r=t.constructor;return null!==o?t instanceof o||Wh(201,o.name,o.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||Wh(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Wh(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Ix(e,t){!Z_(e.getParent())||H_(t)||Q_(t)||Wh(99)}function Fx(e){if(!e||e.isInline())return!1;if(Q_(e))return!0;if(H_(e)){if(e.isShadowRoot()){const t=e.getParent();return!(H_(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Ox(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Px(e){return Jh?(e||window).getSelection():null}function Mx(e){return Xx(e)&&"host"in e}const Lx=[];function zx(e){const t=e.getRootNode();if(t===e||!Mx(t))return Lx;const n=[t];let r=t.host;for(;;){const e=r.getRootNode();if(e===r||!Mx(e))break;n.push(e),r=e.host}return n}function*jx(e){const t=[e];let n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const e=(zb(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Ux(e){return null!==e?e.ownerDocument:document}function Bx(){const e=I_();return Ux(null!==e?e._rootElement:null)}function $x(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;const n=zx(t);if(0===n.length)return null;const r=e.getComposedRanges;try{const t=r.call(e,{shadowRoots:n})[0];if(void 0!==t)return t}catch(e){}try{const t=r.apply(e,n)[0];if(void 0!==t)return t}catch(e){}return null}function qx(e,t){const n=$x(e,t);return null===n?e:function(e,t){const{startContainer:n,startOffset:r,endContainer:i,endOffset:o}=e;return"backward"===t?{anchorNode:i,anchorOffset:o,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:o}}(n,function(e){return e.direction}(e))}function Gx(e){const t=e.getRootNode();return zb(t)||Mx(t)?t.activeElement:null}function Vx(e){let t=e.activeElement;for(;null!==t&&null!==t.shadowRoot;){const e=t.shadowRoot.activeElement;if(null===e)break;t=e}return t}function Kx(e){const t=e.target;if(null!==t&&Hx(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){const t=e.composedPath();if(t.length>0)return t[0]}return t}function Wx(e){return Hx(e)&&"A"===e.tagName}function Hx(e){return Jx(e)&&1===e.nodeType}function Jx(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Xx(e){return Jx(e)&&11===e.nodeType}const Qx=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Yx(e){return!(!Hx(e)||!e.style.display.startsWith("inline"))||Qx.test(e.nodeName)}const Zx=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function eS(e){return(!Hx(e)||!e.style.display.startsWith("inline"))&&Zx.test(e.nodeName)}function tS(e){if(Q_(e)&&!e.isInline())return!0;if(!H_(e)||Tx(e))return!1;const t=e.getFirstChild(),n=null===t||lb(t)||yy(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function nS(){return R_()}function rS(e=nS()){return e._config.dom||_b}function iS(e,t,n=nS()){const r=rS(n).$getDOMSlot(e,t,n);return H_(e)&&(function(e){return e instanceof Rp}(r)||Wh(344,e.getKey(),e.getType())),r}function oS(e,t,n=nS()){return function(e){let t=e;for(;null!=t;){if(Lb(t))return t;t=t.firstChild}return null}(iS(e,t,n).element)}const sS=new WeakMap,aS=new Map;function lS(e){if(!e._readOnly&&e.isEmpty())return aS;e._readOnly||Wh(192);let t=sS.get(e);return t||(t=function(e){const t=new Map;for(const[n,r]of e._nodeMap){const e=r.__type;let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),sS.set(e,t)),t}function cS(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function uS(e,t){const n=e.getAttribute("data-lexical-indent");if(null!==n){const e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}const r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function dS(e,t){const n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function fS(e,t){const n=t.style.textAlign;return n&&n in bp?e.setFormat(n):e}function hS(e){return!0===e.__lexicalUnmanaged}function pS(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;if(Hx(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(void 0!==Jb(n,t))return!1;n=xx(n)}return!1}function gS(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Uv[t]}const mS=new WeakMap;function vS(e){const t=mS.get(e);if(t)return t;const n=null!=e.prototype&&Ep in e.prototype?e.prototype[Ep]():void 0,r=function(e){if(!(e===Uv||e.prototype instanceof Uv)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(Wh){}try{wb.version&&(n=JSON.parse(wb.version))}catch(Wh){}Wh(290,e.name,t,n)}return e===X_||e===W_||e===Uv}(e),i=!r&&gS(e,"getType")?e.getType():void 0;let o,s=i;if(n)if(i)o=n[i];else{for(const[e,t]of Object.entries(n))s=e,o=t;if(!o)for(const e of Object.getOwnPropertySymbols(n)){const t=n[e];if(t){o=t;break}}}if(!r&&s&&(gS(e,"getType")||(e.getType=()=>s),gS(e,"clone")||(e.clone=t=>(kb(t),new e)),gS(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(t=>(new e).updateFromJSON(t))),!gS(e,"importDOM")&&o)){const{importDOM:t}=o;t&&(e.importDOM=()=>t)}const a={klass:e,ownNodeConfig:o,ownNodeType:s};return mS.set(e,a),a}function*yS(e){for(let t=e;t&&(t===Uv||Bv(t.prototype));){const e=vS(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||SS(t)}}function _S(e){const t=nS();return A_(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}const bS=(e,t)=>{let n=e;for(;null!=n&&!Z_(n);){if(t(n))return n;n=n.getParent()}return null};function xS(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=null===t?Kb(r):t.get(r);null==e&&Wh(174),n.push(r),r=e.__next}return n}function SS(e){const t=Object.getPrototypeOf(e);if("function"==typeof t&&t!==Function.prototype)return t;const n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}const wS=new Map;function ES(e){return H_(e)||Q_(e)}function kS(e){return H_(e)||Q_(e)}function CS(e){const t=e.getLatest();return kS(t)?t.__slotHost:null}function AS(e){const t=CS(e);if(null===t)return null;const n=Kb(t);return H_(n)||Q_(n)||Wh(370),n}function NS(e){let t=e.getLatest();for(;null!==t;){if(null!==CS(t))return t;t=t.getParent()}return null}function TS(e){const t=e.getLatest();return ES(t)&&null!==t.__slots?t.__slots:wS}function RS(e){return Array.from(TS(e).keys())}function DS(e,t){const n=TS(e).get(t);return void 0===n?null:Kb(n)}const IS=["__proto__","constructor","prototype"],FS=Symbol("slotMapOwner");function OS(e){let t=e.__slots;return null!==t&&t[FS]===e||(t=new Map(t),t[FS]=e,e.__slots=t),t}const PS=new WeakMap,MS=[];function LS(e){let t="";for(const n of RS(e)){const r=DS(e,n);null!==r&&(t+=r.getTextContent())}return t}function zS(e,t,n){const r=n.get(e),i=n.get(t);return void 0!==r?void 0!==i?r-i:-1:void 0!==i?1:e<t?-1:e>t?1:0}function jS(e){const t=e.__slots;if(null===t||t.size<2)return;const n=function(e){let t=PS.get(e);if(void 0===t){const n=function(e){for(const{ownNodeConfig:t}of yS(e)){const e=t&&t.slots;if(e)return e}return MS}(e),r=new Map;for(const t of n)IS.includes(t)&&Wh(371,e.name,t),r.has(t)&&Wh(372,e.name,t),r.set(t,r.size);t=r,PS.set(e,t)}return t}(e.constructor);let r=null,i=!0;for(const s of t.keys()){if(null!==r&&zS(r,s,n)>0){i=!1;break}r=s}if(i)return;const o=Array.from(t).sort(([e],[t])=>zS(e,t,n));t.clear();for(const[s,a]of o)t.set(s,a)}function US(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||Wh(373,t);const r=e.getLatest();if(null!==r.__slots&&r.__slots.get(t)===n.getLatest().__key)return r;(!H_(n)&&!Q_(n)||n.isInline())&&Wh(374,n.__key);const i=e.getWritable(),o=OS(i),s=o.get(t);void 0!==s&&$S(s);const a=n.getWritable(),l=AS(a);if(null!==l){const e=function(e){const t=AS(e);if(null===t)return null;const n=e.getLatest().__key;for(const[r,i]of TS(t))if(i===n)return r;return null}(a);null!==e&&OS(l.getWritable()).delete(e),a.__slotHost=null}return $b(a),a.__slotHost=i.__key,o.set(t,a.__key),jS(i),function(){const e=nS();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function BS(e,t){const n=e.getWritable();if(null===n.__slots)return n;const r=n.__slots.get(t);return void 0!==r&&($S(r),OS(n).delete(t)),n}function $S(e){const t=Kb(e);if(null===t)return;const n=t.getWritable();kS(n)||Wh(377,e),n.__slotHost=null,n.remove()}const qS={next:"previous",previous:"next"};class GS{origin;constructor(e){this.origin=e}[Symbol.iterator](){return pw({hasNext:YS,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return rw(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return rw(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const o=this.getParentAtCaret(),s=new Map;for(let a=i.getAdjacentCaret();null!==a&&s.size<e;a=a.getAdjacentCaret()){const e=a.origin.getWritable();s.set(e.getKey(),e)}for(const a of r){if(s.size>0){const e=i.getNodeAtCaret();if(e)if(s.delete(e.getKey()),s.delete(a.getKey()),e.is(a)||i.origin.is(a));else{const t=a.getParent();t&&t.is(o)&&a.remove(),e.replace(a)}else null===e&&Wh(263,Array.from(s).join(" "))}else i.insert(a);i=rw(a,this.direction)}for(const a of s.values())a.remove();return this}}class VS extends GS{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:aw(e,this.direction)}getParentCaret(e="root"){return rw(HS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=WS(this.direction);return rw(this.getNodeAtCaret(),e)||aw(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof VS&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const KS={root:Z_,shadowRoot:Tx};function WS(e){return qS[e]}function HS(e,t="root"){return null===e||KS[t](e)?null:null===CS(e)?e:null}class JS extends GS{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:rw(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return H_(this.origin)?aw(this.origin,this.direction):null}getParentCaret(e="root"){return rw(HS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=WS(this.direction);return rw(this.getNodeAtCaret(),e)||aw(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof JS&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof JS||e instanceof XS)&&this.direction===e.direction&&this.origin.is(e.origin)}}class XS extends GS{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:iw(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return rw(HS(this.getParentAtCaret(),e),this.direction)}getFlipped(){return iw(this.origin,WS(this.direction),this.offset)}isSamePointCaret(e){return e instanceof XS&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof JS||e instanceof XS)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return rw(this.origin,this.direction)}}function QS(e){return e instanceof XS}function YS(e){return e instanceof JS}function ZS(e){return e instanceof VS}const ew={next:class extends XS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends XS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},tw={next:class extends JS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends JS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},nw={next:class extends VS{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends VS{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function rw(e,t){return e?new tw[t](e):null}function iw(e,t,n){return e?new ew[t](e,ow(e,n)):null}function ow(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&Hh(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function sw(e,t){return new uw(e,t)}function aw(e,t){return H_(e)?new nw[t](e):null}function lw(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class cw{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new cw(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return QS(t)?function(e,t){const{direction:n,origin:r}=e;return sw(e,ow(r,"focus"===t?WS(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){const{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[sw(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=QS(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=QS(n),i=t=>t.isSameNodeCaret(n)?null:lw(t)||t.getParentCaret(e);return pw({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class uw{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return iw(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function dw(e){return hw(e,rw(Zb(),e.direction))}function fw(e){return hw(e,e)}function hw(e,t){return e.direction!==t.direction&&Wh(265),new cw(e,t,e.direction)}function pw(e){const{initial:t,hasNext:n,step:r,map:i}=e;let o=t;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const e={done:!1,value:i(o)};return o=r(o),e}}}function gw(e,t){const n=_w(e.origin,t.origin);switch(null===n&&Wh(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const n="text"===e.type,r="text"===t.type;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return mw(n)}}function mw(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let o=t,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return null===o?1:-1}function vw(e,t){return t.is(e)}function yw(e){return H_(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function _w(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,i]=yw(e);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=yw(t);r;i=r,r=r.getParent()){const o=n.get(r);if(void 0!==o)return null===o?(vw(e,r)||Wh(276),{commonAncestor:r,type:"ancestor"}):null===i?(vw(t,r)||Wh(277),{commonAncestor:r,type:"descendant"}):((H_(o)||vw(e,o))&&(H_(i)||vw(t,i))&&r.is(o.getParent())&&r.is(i.getParent())||Wh(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function bw(e,t){const{type:n,key:r,offset:i}=e,o=function(e){const t=Kb(e);return null===t&&Wh(63,e),t}(e.key);return"text"===n?(yy(o)||Wh(266,o.getType(),r),iw(o,t,i)):(H_(o)||Wh(267,o.getType(),r),Fw(o,e.offset,t))}function xw(e,t){const{origin:n,direction:r}=t,i="next"===r;QS(t)?e.set(n.getKey(),t.offset,"text"):YS(t)?yy(n)?e.set(n.getKey(),ow(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(ZS(t)&&H_(n)||Wh(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Sw(e){const t=t_(),n=Ty(t)?t:Yy();return ww(n,e),ex(n),n}function ww(e,t){xw(e.anchor,t.anchor),xw(e.focus,t.focus)}function Ew(e){const{anchor:t,focus:n}=e,r=bw(t,"next"),i=bw(n,"next"),o=gw(r,i)<=0?"next":"previous";return hw(Dw(r,o),Dw(i,o))}function kw(e){const{direction:t,origin:n}=e,r=rw(n,WS(t)).getNodeAtCaret();return r?rw(r,t):aw(n.getParentOrThrow(),t)}function Cw(e,t="root"){const n=[e];for(let r=ZS(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(kw(r));return n}function Aw(e){return!!e&&e.origin.isAttached()}function Nw(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const o=Iw(e,r),s=Cw(o.anchor,n),a=Cw(o.focus.getFlipped(),n),l=new Set,c=[];for(const p of o.iterNodeCarets(n))if(ZS(p))l.add(p.origin.getKey());else if(YS(p)){const{origin:e}=p;H_(e)&&!l.has(e.getKey())||c.push(e)}for(const p of c)p.remove();for(const p of o.getTextSlices()){if(!p)continue;const{origin:e}=p.caret,t=e.getTextContentSize(),n=kw(rw(e,r)),o=e.getMode();if(Math.abs(p.distance)===t&&"removeEmptySlices"===i||"token"===o&&0!==p.distance)n.remove();else if(0!==p.distance){i="removeEmptySlices";let e=p.removeTextSlice();const t=p.caret.origin;if("segmented"===o){const t=e.origin,i=vy(t.getTextContent()).setStyle(t.getStyle()).setFormat(t.getFormat());n.replaceOrInsert(i),e=iw(i,r,e.offset)}t.is(s[0].origin)&&(s[0]=e),t.is(a[0].origin)&&(a[0]=e.getFlipped())}}let u,d;for(const p of s)if(Aw(p)){u=Tw(p);break}for(const p of a)if(Aw(p)){d=Tw(p);break}const f=function(e,t,n){if(!e||!t)return null;const r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;const o=r.getParents().reverse();o.push(r);const s=i.getParents().reverse();s.push(i);const a=Math.min(o.length,s.length);let l;for(l=0;l<a&&o[l]===s[l];l++);const c=(e,t)=>{let n;for(let r=l;r<e.length;r++){const i=e[r];if(Tx(i))return;!n&&t(i)&&(n=i)}return n},u=c(o,tS),d=u&&c(s,e=>n.has(e.getKey())&&tS(e));return d&&RS(d).length>0?null:u&&d?[u,d]:null}(u,d,l);if(f){const[e,t]=f;aw(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){const e=n;n=n.getParent(),e.remove(!0)}}else if(d){const e=function(e){if(ZS(e)){const t=e.origin;if(tS(t))return t}else{const t=e.getParentAtCaret();if(t&&tS(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(Nx);if(e&&t&&!Z_(t)&&e.isEmpty()&&l.has(e.getKey())&&0===RS(e).length&&(!n||l.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!Z_(n)&&n.isEmpty();){const e=n.getParent();if(e&&Z_(e)&&e.getChildrenSize()<=1)break;const t=n;n=e,t.remove(!0)}}}const h=[u,d,...s,...a].find(Aw);if(h)return fw(Dw(Tw(h),e.direction));Wh(269,JSON.stringify(s.map(e=>e.origin.__key)))}function Tw(e){const t=function(e){let t=e;for(;ZS(t);){const e=lw(t);if(!ZS(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(yy(t.origin))return QS(t)?t:iw(t.origin,n,n);const r=t.getAdjacentCaret();return YS(r)&&yy(r.origin)?iw(r.origin,n,WS(n)):t}function Rw(e){return QS(e)&&e.offset!==ow(e.origin,e.direction)}function Dw(e,t){return e.direction===t?e:e.getFlipped()}function Iw(e,t){return e.direction===t?e:hw(Dw(e.focus,t),Dw(e.anchor,t))}function Fw(e,t,n){let r=aw(e,"next");for(let i=0;i<t;i++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return Dw(r,n)}function Ow(e){const{origin:t,offset:n,direction:r}=e;if(n===ow(t,r))return e.getSiblingCaret();if(n===ow(t,WS(r)))return kw(e.getSiblingCaret());const[i]=t.splitText(n);return yy(i)||Wh(281),Dw(rw(i,"next"),r)}function Pw(e,t){return!0}function Mw(e,{$copyElementNode:t=Rx,$splitTextPointCaretNext:n=Ow,rootMode:r="shadowRoot",$shouldSplit:i=Pw,removeEmptyDestination:o=!1}={}){if(QS(e))return n(e);const s=e.getParentCaret(r);if(s){const{origin:n}=s;if(ZS(e)){const e=kw(s);if(o&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,"first"))return e}const r=function(e){const t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!o&&n.canBeEmpty()&&i(n,"last"))&&s.insert(t(n).splice(0,0,r))}return s}function Lw(e,t,n){let r=Dw(t,"next");QS(r)&&(0===r.offset?r=rw(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=rw(r.origin,"next"))),r.origin.is(e)&&(YS(r)||Wh(342,e.getKey(),e.getType()),r=kw(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=r;i;i=Mw(i,n))r=i;return QS(r)&&Wh(283),r.insert(e.isInline()?pb().append(e):e),Dw(rw(e.getLatest(),"next"),t.direction)}function zw(e){return e}function jw(e){return e}function Uw(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function Bw(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function $w(e,...t){const n=Bw(...t);n.length>0&&e.classList.add(...n)}function qw(e,...t){const n=Bw(...t);n.length>0&&e.classList.remove(...n)}function Gw(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Vw(e){const t=nS().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function Kw(e){return Vw(Z_(e)?e:e.getParentOrThrow())}function Ww(e){const t=Kw(e);return null!==t&&"rtl"===t.direction}function Hw(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!Mb(t)&&null!==r){const[i,o]=r,s=e.isBackward(),a=i.getNode(),l=o.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[r,i]=Py(e),o=a.is(l),c=t.is(s?l:a),u=t.is(s?a:l);let d,f=0;o?(f=r>i?i:r,d=r>i?r:i):c?(f=s?i:r,d=void 0):u&&(f=0,d=s?r:i);const h=t.__text.slice(f,d);h!==t.__text&&("clone"===n&&(t=function(e){return(t=cS(e))[Lv]=!0,t;var t}(t)),t.__text=h)}}return t}function Jw(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Xw(e,t,n=Jw){if(!e)return;const r=e.getStartEndPoints();let i=!1,o=null;const s=new Map;if(r){const[t,n]=r,a=bS(t.getNode(),tS);o=bS(n.getNode(),tS);const l=e.isBackward()?"previous":"next";i=H_(o)&&!o.is(a)&&function(e,t,n){const r=e.getNode();return(!H_(r)||!r.isEmpty())&&function(e,t,n){let r=bw(e,n);if(Rw(r))return!1;for(;r;r=r.getParentCaret()){const e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}(e,t,n)}(n,o,WS(l)),H_(a)&&s.set(a.getKey(),a),H_(o)&&!i&&s.set(o.getKey(),o)}for(const a of e.getNodes())if(H_(a)&&tS(a)){if(i&&a.is(o))continue;s.set(a.getKey(),a)}else if(!r){const e=bS(a,tS);H_(e)&&s.set(e.getKey(),e)}for(const a of s.values()){const e=t();n(a,e),a.replace(e,!0)}}function Qw(e){const t=Yw(e);return null!==t&&"vertical-rl"===t.writingMode}function Yw(e){const t=e.anchor.getNode();return H_(t)?Vw(t):Kw(t)}function Zw(e,t){let n=Qw(e)?!t:t;eE(e)&&(n=!n);const r=bw(e.focus,n?"previous":"next");if(Rw(r))return!1;if(QS(r)&&!Sy(r.origin)&&r.origin.isUnmergeable()){const e=r.getNodeAtCaret();if(yy(e)&&!Sy(e))return!0}for(const i of dw(r)){if(ZS(i))return!i.origin.isInline();if(!H_(i.origin)){if(Q_(i.origin))return!0;break}}return!1}function eE(e){const t=Yw(e);return null!==t&&"rtl"===t.direction}function tE(e,t,n){const r=eE(e);let i;i=Qw(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}function nE(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function rE(e){const t=bS(e,e=>H_(e)&&!e.isInline());return H_(t)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t}function iE(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function oE(e){let t=null;if(iE(e,DragEvent)?t=e.dataTransfer:iE(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function sE(e){const t=t_();if(!Ty(t))return!1;const n=new Set,r=t.getNodes();for(let i=0;i<r.length;i++){const t=r[i],o=t.getKey();if(n.has(o))continue;const s=bS(t,e=>H_(e)&&!e.isInline());if(null===s)continue;const a=s.getKey();s.canIndent()&&!n.has(a)&&(n.add(a),e(s))}return n.size>0}const aE=Symbol.for("preact-signals");function lE(){if(pE>1)return void pE--;let e,t=!1;for(function(){let e=fE;for(fE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==uE;){let n=uE;for(uE=void 0,gE++;void 0!==n;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&_E(n))try{n.c()}catch(Jh){t||(e=Jh,t=!0)}n=r}}if(gE=0,pE--,t)throw e}let cE,uE;function dE(e){const t=cE;cE=void 0;try{return e()}finally{cE=t}}let fE,hE,pE=0,gE=0,mE=0;function vE(e){if(void 0===cE)return;let t=e.n;return void 0===t||t.t!==cE?(t={i:0,S:e,p:cE.s,n:void 0,t:cE,e:void 0,x:void 0,r:t},void 0!==cE.s&&(cE.s.n=t),cE.s=t,e.n=t,32&cE.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=cE.s,t.n=void 0,cE.s.n=t,cE.s=t),t):void 0}function yE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function _E(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function bE(e){for(let t=e.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function xE(e){let t,n=e.s;for(;void 0!==n;){const e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function SE(e,t){yE.call(this,void 0),this.x=e,this.s=void 0,this.g=mE-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function wE(e){const t=e.m;if(e.m=void 0,"function"==typeof t){pE++;const n=cE;cE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,EE(e),t}finally{cE=n,lE()}}}function EE(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,wE(e)}function kE(e){if(cE!==this)throw new Error("Out-of-order effect");xE(this),cE=e,this.f&=-2,8&this.f&&EE(this),lE()}function CE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function AE(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}function NE(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}yE.prototype.brand=aE,yE.prototype.h=function(){return!0},yE.prototype.S=function(e){const t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:dE(()=>{var e;null==(e=this.W)||e.call(this)}))},yE.prototype.U=function(e){if(void 0!==this.t){const t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&dE(()=>{var e;null==(e=this.Z)||e.call(this)}))}},yE.prototype.subscribe=function(e){return function(e,t){const n=new CE(e,t);try{n.c()}catch(e){throw n.d(),e}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}(()=>{const t=this.value,n=cE;cE=void 0;try{e(t)}finally{cE=n}},{name:"sub"})},yE.prototype.valueOf=function(){return this.value},yE.prototype.toString=function(){return this.value+""},yE.prototype.toJSON=function(){return this.value},yE.prototype.peek=function(){const e=cE;cE=void 0;try{return this.value}finally{cE=e}},Object.defineProperty(yE.prototype,"value",{get(){const e=vE(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(gE>100)throw new Error("Cycle detected");!function(e){0!==pE&&0===gE&&0!==e.l&&(e.l=0,fE={S:e,v:e.v,i:e.i,o:fE})}(this),this.v=e,this.i++,mE++,pE++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{lE()}}}}),SE.prototype=new yE,SE.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===mE)return!0;if(this.g=mE,this.f|=1,this.i>0&&!_E(this))return this.f&=-2,!0;const e=cE;try{bE(this),cE=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return cE=e,xE(this),this.f&=-2,!0},SE.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}yE.prototype.S.call(this,e)},SE.prototype.U=function(e){if(void 0!==this.t&&(yE.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},SE.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(SE.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=vE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),CE.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.m=e)}finally{e()}},CE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,wE(this),bE(this),pE++;const e=cE;return cE=this,kE.bind(this,e)},CE.prototype.N=function(){2&this.f||(this.f|=2,this.u=uE,uE=this)},CE.prototype.d=function(){this.f|=8,1&this.f||EE(this)},CE.prototype.dispose=function(){this.d()};try{hE="0.48.0+prod.esm"}catch(Wh){}const TE=hE??'"<unknown>+source"',RE=new Set(["__proto__","constructor","prototype"]);function DE(e,t){if(e&&t&&!Array.isArray(t)&&"object"==typeof e&&"object"==typeof t){const n=e,r=t;for(const e in r)!RE.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=DE(n[e],r[e]));return e}return t}function IE(e){return 0===e.id}function FE(e){return 2===e.id}const OE=new Set;let PE=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Uw;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;FE(t)||NE(306,String(t.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n);let o;this.state=i,this.extension.init&&(o=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,o,r)}build(e){const t=this.state;let n;4!==t.id&&NE(307,String(t.id),String(5)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));const r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;const n=this.state;5!==n.id&&NE(308,String(n.id),String(5));const r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{const e=this.state;7!==e.id&&NE(309,String(n.id),String(7)),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){const t=this.state;let n;return 6!==t.id&&NE(310,String(t.id),String(6)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return void 0===this._signal&&NE(311),this._signal}getInitResult(){void 0===this.extension.init&&NE(312,this.extension.name);const e=this.state;return function(e){return e.id>=4}(e)||NE(313,String(e.id),String(4)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return function(e){return e.id>=3}(e)||NE(314,String(e.id),String(3)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&NE(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&NE(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return function(e){return e.id>=7}(e)||NE(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||OE}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(e){return e.id>=5})(e)||NE(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const ME={tag:Gv};function LE(){const e=Zb();e.isEmpty()&&e.append(pb())}const zE=zw({config:jw({setOptions:ME,updateOptions:ME}),init:({$initialEditorState:e=LE})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:r}=i;if(function(e){return e instanceof rb}(r))e.setEditorState(r,n);else if("function"==typeof r)e.update(()=>{r(e)},t);else if(r&&("string"==typeof r||"object"==typeof r)){const t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Y_,ly,ob,by,fb]}),jE=Symbol.for("@lexical/extension/LexicalBuilder");function UE(){}function BE(e){throw e}function $E(e){return Array.isArray(e)?e:[e]}const qE=TE;class GE{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=qE,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[$E(zE)];for(const n of e)t.push($E(n));return new GE(t)}static maybeFromEditor(e){const t=e[jE];return t&&(t.PACKAGE_VERSION!==qE&&NE(292,t.PACKAGE_VERSION,qE),t instanceof GE||NE(293)),t}static fromEditor(e){const t=GE.maybeFromEditor(e);return void 0===t&&NE(294),t}constructEditor(){const{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(bb({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[jE]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=UE;function t(){try{e()}finally{e=UE}}const n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Gw(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&NE(295,e.name),t}addEdge(e,t,n){const r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));const i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&NE(296);const t=$E(e),[n]=t;"string"!=typeof n.name&&NE(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&NE(298,n.name),!r){r=new PE(this,n),this.extensionNameMap.set(n.name,r);const e=this.conflicts.get(n.name);"string"==typeof e&&NE(299,n.name,e);for(const t of n.conflictsWith||[])this.extensionNameMap.has(t)&&NE(299,n.name,t),this.conflicts.set(t,n.name);for(const t of n.dependencies||[]){const e=$E(t);this.addEdge(n.name,e[0].name,e.slice(1)),this.addExtension(e)}for(const[t,r]of n.peerDependencies||[])this.addEdge(n.name,t,r?[r]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(n,r)=>{let i=n.state;if(FE(i))return;const o=n.extension.name;var s;IE(i)||NE(300,o,r||"[unknown]"),IE(s=i)||NE(304,String(s.id),String(0)),i=Object.assign(s,{id:1}),n.state=i;const a=this.outgoingConfigEdges.get(o);if(a)for(const e of a.keys()){const n=this.extensionNameMap.get(e);n&&t(n,o)}i=function(e){return function(e){return 1===e.id}(e)||NE(305,String(e.id),String(1)),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(const n of this.extensionNameMap.values())IE(n.state)&&t(n);for(const n of e)for(const[e,t]of this.outgoingConfigEdges.get(n.extension.name)||[])if(t.length>0){const n=this.extensionNameMap.get(e);if(n)for(const e of t)n.configs.add(e)}for(const[n,...r]of this.roots)if(r.length>0){const e=this.extensionNameMap.get(n.name);void 0===e&&NE(301,n.name);for(const t of r)e.configs.add(t)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(const o of t){const t=o.register(e,i);t&&r.push(t)}for(const o of t){const t=o.afterRegistration(e);t&&r.push(t)}return Gw(...r)}buildCreateEditorArgs(){const e={},t=new Set,n=new Map,r=new Map,i={},o={},s=this.sortedExtensionReps();for(const c of s){const{extension:s}=c;if(void 0!==s.onError&&(e.onError=s.onError),void 0!==s.onWarn&&(e.onWarn=s.onWarn),void 0!==s.disableEvents&&(e.disableEvents=s.disableEvents),void 0!==s.parentEditor&&(e.parentEditor=s.parentEditor),void 0!==s.editable&&(e.editable=s.editable),void 0!==s.namespace&&(e.namespace=s.namespace),void 0!==s.$initialEditorState&&(e.$initialEditorState=s.$initialEditorState),s.nodes)for(const e of AE(s)){if("function"!=typeof e){const t=n.get(e.replace);t&&NE(302,s.name,e.replace.name,t.extension.name),n.set(e.replace,c)}t.add(e)}if(s.html){if(s.html.export)for(const[e,t]of s.html.export.entries())r.set(e,t);s.html.import&&Object.assign(i,s.html.import)}s.theme&&DE(o,s.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(i).length>0,l=r.size>0;(a||l)&&(e.html={},a&&(e.html.import=i),l&&(e.html.export=r));for(const c of s)c.init(e);return e.onError||(e.onError=BE),e}}function VE(e,t){const n=GE.maybeFromEditor(e);if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}class KE extends X_{static getType(){return"horizontalrule"}static clone(e){return new KE(e.__key)}static importJSON(e){return HE().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:WE,priority:0})}}exportDOM(){return{element:Bx().createElement("hr")}}createDOM(e){const t=Bx().createElement("hr");return $w(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function WE(){return{node:HE()}}function HE(){return _S(KE)}function JE(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let XE;function QE(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function YE(e){return XE&&XE.editor===e?XE:void 0}function ZE(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;return[n,r(QE(e,n))]}return t}function ek(e){return Object.create(e||null)}function tk(e,t){return[e,t]}function nk(e,t,n,r){return Object.assign(Xp(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}const rk="@lexical/html/DOM",ik=Symbol.for("@lexical/html/DOMExportContext"),ok=Symbol.for("@lexical/html/DOMImportContext");function sk(e,t,n){return nk(ik,e,t,n)}const ak=sk("isExport",Boolean);function lk(e=nS()){const t=function(e){const t=VE(e,rk);return t?t.output.runtime:void 0}(e);return t?t.getSessionConfig():rS(e)}const ck=function(e,t=()=>{}){return(n,r=nS())=>i=>{const o=YE(r),s=o&&o[e],a=function(e,t){let n=t;for(const r of e){const[e,i]=ZE(n,r),o=e.key;if(n===t&&QE(n,e)===i)continue;const s=n===t||void 0===n?ek(t):n;s[o]=i,n=s}return n}(n,s||t(r));return a&&a!==s?function(e,t,n,r=nS()){const i=XE,o=YE(r);try{return XE={...o,editor:r,[e]:t},n()}finally{XE=i}}(e,a,i,r):i()}}(ik,function(e){const t=VE(e,rk);return t?t.output.defaults:void 0}),uk=Symbol.for("@lexical/html/SelectorImpl");function dk(e,t){const n={kind:"element",predicate:(r=t,0===r.length?Hx:1===r.length?r[0]:(e,t)=>{for(const n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;const i=n=>dk(e,[...t,n]);return{[uk]:n,attr:(e,t,n)=>i(pk(e,t,n)),classAll:(...e)=>i(hk(e)),classAny:(...e)=>i(function(e){const t=fk(e);return 0===t.length?()=>!1:e=>{if(!Hx(e))return!1;const n=e.classList;for(const r of t)if(n.contains(r))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if("string"==typeof t)return n=>Hx(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Hx(t))return!1;const o=t.style.getPropertyValue(e);if(!o)return!1;const s=o.match(i);return null!==s&&(void 0!==r&&(n[r]=s),!0)}}JE(362,JSON.stringify(e))}(e,t,n))}}function fk(e){const t=[];for(const n of e)n&&t.push(n);return t}function hk(e){const t=fk(e);return 0===t.length?()=>!0:e=>{if(!Hx(e))return!1;const n=e.classList;for(const r of t)if(!n.contains(r))return!1;return!0}}function pk(e,t,n){if(!0===t)return t=>Hx(t)&&t.hasAttribute(e);if("string"==typeof t)return n=>Hx(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Hx(t))return!1;const o=t.getAttribute(e);if(null==o)return!1;const s=o.match(i);return null!==s&&(void 0!==r&&(n[r]=s),!0)}}JE(361,JSON.stringify(e))}const gk={kind:"text",predicate:Lb,tags:new Set},mk={[uk]:gk},vk={kind:"comment",predicate:e=>8===e.nodeType,tags:new Set},yk={[uk]:vk},_k={any:()=>dk(new Set,[]),comment:()=>yk,tag(...e){e.length>0||JE(363);const t=new Set;for(const n of e)t.add(n.toUpperCase());return dk(t,[])},text:()=>mk};function bk(e,t){return Hx(e)&&e.nodeName===t.toUpperCase()}const xk=/[A-Za-z0-9_-]/;let Sk=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){const e=this.pos;for(;!this.eof()&&xk.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){const e=this.consume();this.assert('"'===e||"'"===e,"expected quote");const t=this.pos;for(;!this.eof()&&this.peek()!==e;)"\\"===this.peek()?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");const n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(e,t){e||JE(364,String(this.pos+1),t,this.source)}};function wk(e){const t=new Set,n=[],r=[];if(e.skipWhitespace(),"*"===e.peek())e.consume();else if(xk.test(e.peek())){const n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){const t=e.peek();if("."===t){e.consume();const t=e.readIdent();e.assert(""!==t,'expected class name after "."'),r.push(t)}else if("#"===t){e.consume();const t=e.readIdent();e.assert(""!==t,'expected id after "#"'),n.push(pk("id",t))}else{if("["!==t)break;{e.consume(),e.skipWhitespace();const t=e.readIdent();e.assert(""!==t,'expected attribute name after "["'),e.skipWhitespace();let r=!0;if("="===e.peek()){e.consume(),e.skipWhitespace();const t=e.peek();'"'===t||"'"===t?r=e.readQuoted():(r=e.readIdent(),e.assert(""!==r,"expected attribute value")),e.skipWhitespace()}e.assert("]"===e.peek(),'expected "]"'),e.consume(),n.push(pk(t,r))}}}return r.length>0&&n.push(hk(r)),{predicates:n,tags:t}}function Ek(e){return e}function kk(e,t,n){return nk(ok,e,t,n)}const Ck=kk("textFormat",()=>0),Ak=kk("textStyle",()=>({}));function Nk(e){if(!Hx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Tk(e){if(Lb(e))return!0;if(!Hx(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!eS(e)&&Yx(e)}const Rk=kk("whitespaceConfig",()=>({isInline:Tk,preservesWhitespace:Nk}));function Dk(e){return Xy(e)||Q_(e)&&!e.isInline()}function Ik(e,t){if(!Hx(t))return e;const n=t.style.textAlign;if(!Pk(n))return e;for(const r of e)Xy(r)&&""===r.getFormatType()&&r.setFormat(n);return e}const Fk=_k,Ok=new Set(["center","end","justify","left","right","start"]);function Pk(e){return Ok.has(e)}const Mk={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},Lk={CODE:16,MARK:128},zk=new Set(["font-weight","font-style","text-decoration","vertical-align"]);Fk.tag("b","strong","em","i","code","mark","s","sub","sup","u","span");function jk(e,t,n){let r=e;for(;;){let e=null;for(;null===(e=t?r.nextSibling:r.previousSibling);){const e=r.parentNode;if(null===e)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;null!==(i=t?r.firstChild:r.lastChild);)r=i;if(Lb(r))return r;if("BR"===r.nodeName)return null}}function Uk(e,t){return 0!==t&&yy(e)?e.setFormat(t):e}function Bk(e,t){if(yy(e)){const n=function(e){let t="";for(const n in e)zk.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);""!==n&&e.setStyle(n)}return e}Fk.text(),Fk.tag("script","style"),Fk.tag("br"),Fk.tag("p"),Fk.tag("hr");function $k(e,t){const n=[];let r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function qk(e){const t=[],n=new Map,r=[],i=[],o=[],s=new Set;e.forEach((e,a)=>{const l=function(e){const t=e[uk];return void 0===t&&JE(360),t}(e.match),c=e.name||function(e,t){if("text"===e.kind)return`#text@${t}`;if("comment"===e.kind)return`#comment@${t}`;if(0===e.tags.size)return`*@${t}`;return`${Array.from(e.tags).join(",").toLowerCase()}@${t}`}(l,a);if(e.name&&s.add(e.name),t.push({$import:e.$import,name:c,predicate:l.predicate}),"text"===l.kind)i.push(a);else if("comment"===l.kind)o.push(a);else if(0===l.tags.size)r.push(a);else for(const t of l.tags){let e=n.get(t);e||(e=[],n.set(t,e)),e.push(a)}});const a=new Map;if(0===r.length)for(const[l,c]of n)a.set(l,c);else for(const[l,c]of n)a.set(l,$k(c,r));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:r}}function Gk(e){return"object"==typeof e&&null!==e&&"__type"in e&&"CompiledOverlayRules"===e.__type}function Vk(e){const t=function(e){const t=[];for(const n of e)if(Gk(n))for(const e of n.rules)t.push(e);else t.push(n);return t}(e);return{__type:"CompiledOverlayRules",dispatch:qk(t),rules:t}}Fk.any(),_k.any();const Kk={any:_k.any,comment:_k.comment,css:function(e){const t=new Sk(e,0),n=[];for(;;){const e=wk(t);if(n.push(e),t.skipWhitespace(),t.eof())break;t.assert(","===t.peek(),'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(1===n.length)return dk(n[0].tags,n[0].predicates);const r=new Set;for(const i of n)for(const e of i.tags)r.add(e);return dk(r,[(e,t)=>{for(const r of n){const n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(const o of r.predicates)if(!o(e,t)){i=!1;break}if(i)return!0}return!1}])},tag:_k.tag,text:_k.text},Wk=new Set(["STYLE","SCRIPT"]);function Hk(e,t){!function(e){if(!zb(e))return;const t=e;if(null===t.querySelector("style"))return;const n=new Map;function r(e){let t=n.get(e);if(void 0===t){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(const n of Array.from(t.styleSheets)){let i;try{i=n.cssRules}catch(e){continue}for(const n of Array.from(i)){if(!iE(n,CSSStyleRule))continue;let i;try{i=t.querySelectorAll(n.selectorText)}catch(e){continue}for(const e of Array.from(i)){if(!Hx(e))continue;const t=r(e);for(let r=0;r<n.style.length;r++){const i=n.style[r];t.has(i)||e.style.setProperty(i,n.style.getPropertyValue(i),n.style.getPropertyPriority(i))}}}}}catch(e){}}(t);const n=zb(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const o of n)if(!Wk.has(o.nodeName)){const t=Qk(o,e,i,!1);if(null!==t)for(const e of t)r.push(e)}return function(e){for(const t of e)t.getParent()&&t.getNextSibling()instanceof ib&&t.insertAfter(ab());for(const t of e){const e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Jk(e,t=null){return("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)&&JE(338),function(e){null!==T_()&&null===__&&(__=e),__!==e&&Hh(378)}(e),function(e,t=null,n=nS()){return ck([tk(ak,!0)],n)(()=>{const r=Zb(),i=lk(n),o=Ty(t)?NS(t.anchor.getNode()):null,s=e.append.bind(e);for(const e of(H_(o)?o:r).getChildren())Xk(n,e,s,t,i);return e})}(Bx().createElement("div"),t,e).innerHTML}function Xk(e,t,n,r=null,i=rS(e)){let o=i.$shouldInclude(t,r,e);const s=i.$shouldExclude(t,r,e);let a=t;null!==r&&yy(t)&&(a=Hw(r,t,"clone"));const l=i.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;const h=Bx().createDocumentFragment(),p=f?f():H_(a)?a.getChildren():[],g=o&&Dy(r)&&H_(t)?null:r,m=h.append.bind(h);for(const v of p){const n=Xk(e,v,m,g,i);!o&&n&&i.$extractWithChild(t,v,r,"html",e)&&(o=!0)}if(o&&!s){if((Hx(c)||Xx(c))&&(d?d(h):c.append(h)),n(c),u){const e=u.call(a,c);e&&(Xx(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(h);return o}function Qk(e,t,n,r,i=new Map,o){const s=[];if(Wk.has(e.nodeName))return s;let a=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const o of r){const t=o(e);null!==t&&(null===i||(i.priority||0)<=(t.priority||0))&&(i=t)}return null!==i?i.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(a=Array.isArray(t)?t[t.length-1]:t,null!==a){for(const[,e]of i)if(a=e(a,o),!a)break;a&&s.push(...Array.isArray(t)?t:[a])}null!=c.forChild&&i.set(e.nodeName,c.forChild)}const d=e.childNodes;let f=[];const h=(null==a||!Tx(a))&&(null!=a&&Xy(a)||r);for(let p=0;p<d.length;p++)f.push(...Qk(d[p],t,n,h,new Map(i),a));if(null!=u&&(f=u(f)),eS(e)&&(f=function(e,t,n){const r=e.style.textAlign,i=[];let o=[];for(let s=0;s<t.length;s++){const e=t[s];if(Xy(e))r&&!e.getFormat()&&e.setFormat(r),i.push(e);else if(o.push(e),s===t.length-1||s<t.length-1&&Xy(t[s+1])){const e=n();e.setFormat(r),e.append(...o),i.push(e),o=[]}}return i}(e,f,h?()=>{const e=new ib;return n.push(e),e}:pb)),null==a)if(f.length>0)for(const p of f)s.push(p);else eS(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(Yx(e.nextSibling)&&Yx(e.previousSibling))}(e)&&s.push(ab());else H_(a)&&a.append(...f);return s}function Yk(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Zk(e){const t=e.getParent();xC(t)||Yk(40);let n=t,r=t;for(;null!==r;)r=r.getParent(),xC(r)&&(n=r);return n}function eC(e){let t=[];const n=e.getChildren().filter(gC);for(let r=0;r<n.length;r++){const e=n[r],i=e.getFirstChild();xC(i)?t=t.concat(eC(i)):t.push(e)}return t}function tC(e){return gC(e)&&xC(e.getFirstChild())}function nC(e,t){return gC(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function rC(e){const t=t_();if(null!==t){let n=t.getNodes();if(Ty(t)){const[r]=t.getStartEndPoints(),i=r.getNode(),o=i.getParent();if(Tx(i)){const e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=pb();i.append(e),n=e.select().getNodes()}}else if(nC(i,n)){const t=bC(e);if(Tx(o)){i.replace(t);const e=pC();H_(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(gC(i)){const e=i.getParentOrThrow();iC(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(H_(i)&&i.isEmpty()&&!gC(i)&&!r.has(i.getKey())){oC(i,e);continue}let o=Ub(i)?i.getParent():gC(i)&&i.isEmpty()?i:null;for(;null!=o;){const t=o.getKey();if(xC(o)){if(!r.has(t)){const n=bC(e);iC(n,o.getChildren()),o.replace(n),r.add(t)}break}{const n=o.getParent();if(Tx(n)&&!r.has(t)){r.add(t),oC(o,e);break}o=n}}}}}function iC(e,t){e.splice(e.getChildrenSize(),0,t)}function oC(e,t){if(xC(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=pC();let o;if(iC(i,e.getChildren()),xC(n)&&t===n.getListType())n.append(i),xC(r)&&t===r.getListType()&&(iC(n,r.getChildren()),r.remove()),o=n;else if(xC(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=bC(t);n.append(i),e.replace(n),o=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=t_();return Ty(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),e.remove(),o}function sC(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&tC(n)&&tC(r)&&(sC(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function aC(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())gC(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),xC(r.getFirstChild())||n++)}function lC(e){const t=new Set;if(tC(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(tC(r)&&tC(i)){const n=i.getFirstChild();if(xC(n)){n.append(e);const i=r.getFirstChild();xC(i)&&(iC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(tC(r)){const t=r.getFirstChild();if(xC(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(tC(i)){const t=i.getFirstChild();xC(t)&&t.append(e)}else if(xC(n)){const t=Rx(e),o=Rx(n);t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function cC(e){if(tC(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(xC(n?n.getParent():void 0)&&gC(n)&&xC(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=Rx(e),i=Rx(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));const o=Rx(e),s=Rx(t);o.append(s),iC(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(o),n.replace(e)}}}let uC=class extends W_{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(xC(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();xC(n)||Yk(340);const r=[e];for(const t of["previous","next"]){r.reverse();for(const{origin:n}of rw(e,t)){if(!gC(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Tx(t)||(Lw(n,kw(rw(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:W_,importDOM:{li:()=>({conversion:dC,priority:0})}})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=Bx().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t){const n=t.getParent();!xC(n)||"check"!==n.getListType()||xC(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this),t.value=this.__value,function(e,t,n){const r=t.list;if(!r)return;const i=r.listitem,o=r.nested&&r.nested.listitem,s=n.getParent(),a=xC(s)&&"check"===s.getListType(),l=n.getChecked(),c=n.getChildren().some(e=>xC(e)),u=[];void 0!==r.listitemChecked&&u.push(r.listitemChecked),void 0!==r.listitemUnchecked&&u.push(r.listitemUnchecked),void 0!==o&&u.push(...Bw(o)),u.length>0&&qw(e,...u);const d=[];if(void 0!==i&&d.push(...Bw(i)),a){const e=l?r.listitemChecked:r.listitemUnchecked;void 0!==e&&d.push(e)}void 0!==o&&c&&d.push(...Bw(o)),d.length>0&&$w(e,...d)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&ey(t.style,i,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const o=Yv(r);for(const s in o)e.style.setProperty(`--listitem-marker-${s}`,o[s]);if(""!==i)for(const s in Yv(i))s in o||e.style.removeProperty(`--listitem-marker-${s}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),tC(this)?{after(e){if(Hx(e)){const t=e.previousElementSibling;if(Hx(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(H_(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(gC(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!xC(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=Rx(n);let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}const r=this.__key;let i=0;if(t&&(H_(e)||Yk(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&H_(e)){const t=t_();if(Ty(t))for(const n of t.getStartEndPoints())n.key===r&&"element"===n.type&&n.set(e.getKey(),i+n.offset,"element")}return this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(xC(n)||Yk(39),gC(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=Rx(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&tC(t)&&tC(n)&&(sC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=Rx(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(tC(this))return!1;const t=this.getParentOrThrow();if(gC(t.getParentOrThrow()))return cC(this),!0;const n=pb().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){const e=Rx(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),0===t.getChildrenSize()&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return xC(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;gC(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&Yk(117),(e=Math.floor(e))>=0||Yk(199);let t=this.getIndent();for(;t!==e;)t<e?(lC(this),t++):(cC(this),t--);return this}canInsertAfter(e){return gC(e)}canReplaceWith(e){return gC(e)}canMergeWith(e){return gC(e)||gb(e)}extractWithChild(e,t){if(!Ty(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return bC("bullet")}canMergeWhenEmpty(){return!0}};function dC(e){if(e.classList.contains("task-list-item"))for(const r of e.children)if("INPUT"===r.tagName)return fC(r);if(e.classList.contains("joplin-checkbox"))for(const r of e.children)if(r.classList.contains("checkbox-wrapper")&&r.children.length>0&&"INPUT"===r.children[0].tagName)return fC(r.children[0]);const t=e.getAttribute("aria-checked"),n=pC("true"===t||"false"!==t&&void 0);return fS(n,e),{after:hC.bind(null,n),node:dS(n,e)}}function fC(e){if("checkbox"!==e.getAttribute("type"))return{node:null};const t=pC(e.hasAttribute("checked"));return{after:hC.bind(null,t),node:t}}function hC(e,t){const n=t[0];return 1===t.length&&gb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function pC(e){return Dx(new uC(void 0,e))}function gC(e){return e instanceof uC}let mC=class extends W_{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();xC(t)&&e.getListType()===t.getListType()&&sC(e,t)}(e),aC(e)},extends:W_,importDOM:{ol:()=>({conversion:yC,priority:0}),ul:()=>({conversion:yC,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=_C[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=Bx().createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,vC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(vC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Hx(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let i=0;i<n.length;i++){const e=n[i];gC(e)||(r===n&&(r=[...n]),r[i]=this.createListItemNode().append(!H_(e)||xC(e)||e.isInline()?e:vy(e.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return gC(e)}createListItemNode(){return pC()}};function vC(e,t,n){const r=[],i=[],o=t.list;if(void 0!==o){const e=o[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(gC(n)){const e=n.getParent();if(xC(e)){t++,n=e.getParent();continue}Yk(40)}return t}return t}(n)-1,s=t%e.length,a=e[s],l=o[n.__tag];let c;const u=o.nested,d=o.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==a){r.push(...Bw(a));for(let t=0;t<e.length;t++)t!==s&&i.push(n.__tag+t)}if(void 0!==c){const e=Bw(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&qw(e,...i),r.length>0&&$w(e,...r)}function yC(e){let t;if(function(e){return Hx(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const n=e.start;t=bC("number",n)}else t=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(Hx(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?bC("check"):bC("bullet");return dS(t,e),{after:e=>function(e,t){const n=t.createListItemNode.bind(t),r=[];for(let i=0;i<e.length;i++){const t=e[i];if(gC(t)){r.push(t);const e=t.getChildren();e.length>1&&e.forEach(e=>{xC(e)&&r.push(n().append(e))})}else r.push(n().append(t))}return r}(e,t),node:t}}const _C={ol:"number",ul:"bullet"};function bC(e="number",t=1){return Dx(new mC(e,t))}function xC(e){return e instanceof mC}function SC(e){const t=[];for(const n of e)if(gC(n)){t.push(n);const e=n.getChildren();if(e.length>1)for(const n of e)xC(n)&&t.push(pC().append(n))}else t.push(pC().append(n));return t}Kk.tag("ol","ul");function wC(e,t){if(1!==t.length)return t;const n=t[0];return gb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function EC(e){const t=e=>Dk(e)&&!xC(e);if(!e.some(t))return e;const n=[];let r=[];const i=()=>{r.length>0&&(n.push(r),r=[])};for(const s of e)t(s)?(i(),n.push(H_(s)?s.getChildren():[s])):r.push(s);i();const o=[];for(const s of n)o.length>0&&o.push(ab()),o.push(...s);return o}Kk.tag("li");Kk.tag("li").classAll("task-list-item"),Kk.tag("li").classAll("joplin-checkbox");const kC=um("UPDATE_LIST_START_COMMAND"),CC=um("INSERT_UNORDERED_LIST_COMMAND"),AC=um("INSERT_ORDERED_LIST_COMMAND"),NC=um("REMOVE_LIST_COMMAND");function TC(e,t){return Gw(e.registerCommand(AC,()=>(rC("number"),!0),1),e.registerCommand(kC,e=>{const{listNodeKey:t,newStart:n}=e,r=Kb(t);return!!xC(r)&&("number"===r.getListType()&&(r.setStart(n),aC(r)),!0)},1),e.registerCommand(CC,()=>(rC("bullet"),!0),1),e.registerCommand(NC,()=>(function(){const e=t_();if(Ty(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(nC(r,n))t.add(Zk(r));else for(let e=0;e<n.length;e++){const r=n[e];if(Ub(r)){const e=nE(r,uC);null!=e&&t.add(Zk(e))}}for(const i of t){let t=i;const n=eC(i);for(const r of n){const n=pb().setTextStyle(e.style).setTextFormat(e.format);iC(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&xw(e.anchor,Tw(aw(n,"next"))),r.__key===e.focus.key&&xw(e.focus,Tw(aw(n,"next"))),r.remove()}i.remove()}}}(),!0),1),e.registerCommand(bm,()=>function(e=!1){const t=t_();if(!Ty(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(gC(n)&&0===n.getChildrenSize())r=n;else if(yy(n)){const e=n.getParent();gC(e)&&e.getChildren().every(e=>yy(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;const i=Zk(r),o=r.getParent();xC(o)||Yk(40);const s=o.getParent();let a;if(Tx(s))a=pb(),i.insertAfter(a);else{if(!gC(s))return!1;a=Rx(s),s.insertAfter(a)}a.setTextStyle(t.style).setTextFormat(t.format).select();const l=r.getNextSiblings();if(l.length>0){const t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(o,r):1,n=Rx(o).setStart(t);if(gC(a)){const e=Rx(a);e.append(n),a.insertAfter(e)}else a.insertAfter(n);n.append(...l)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!gC(e)&&!xC(e))break;t=e}t.remove()}(r),!0}(!1),1),e.registerCommand(jm,e=>{if(function(){const e=t_();if(!Ty(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode(),n=bS(t,gC);if(!gC(n))return!1;const r=n.getFirstDescendant();if(null===r)return!1;if(!n.is(t)&&!r.is(t))return!1;const i=n.getParent();if(!xC(i)||!n.is(i.getFirstChild()))return!1;const o=i.getPreviousSibling();if(!Q_(o)||o.isIsolated()||!o.isKeyboardSelectable()&&o.isInline())return!1;const s=pb().append(...n.getChildren());return i.insertBefore(s),n.remove(),i.isEmpty()&&i.remove(),s.selectStart(),!0}())return e.preventDefault(),!0;const t=t_();if(!Ty(t)||!t.isCollapsed())return!1;const{anchor:n}=t;if(0!==n.offset)return!1;let r=n.getNode();for(;!gC(r);){if(null!==r.getPreviousSibling())return!1;const e=r.getParent();if(null===e)return!1;r=e}return!(!gC(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(uC,e=>{const t=e.getFirstChild();if(t){if(yy(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=t_();Ty(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(ly,e=>{const t=e.getParent();if(gC(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function RC(e,t,n){let r=n(),i=0,o=r,s=0,a=null;return(l,c,u,d,f,h)=>{const p=n();if(h.has(Xv)&&(o=r,s=i,a=l),h.has($v))return i=0,r=p,2;h.has(Qv)&&a&&(r=o,i=s,l=a);const g=h.has(Vv)||h.has("cut")?0:function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const o=t._selection,s=e._selection;if(i)return 1;if(!(Ty(o)&&Ty(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const o of t){const e=r.get(o);void 0!==e&&i.push(e)}for(const[o,s]of n){if(!s)continue;const e=r.get(o);void 0===e||Z_(e)||i.push(e)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(o.anchor.key),i=n.get(s.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&yy(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!yy(c)||!yy(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const f=o.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return 0;const p=f.offset,g=h.offset,m=d.length-u.length;return 1===m&&g===p-1?2:-1===m&&g===p+1?3:-1===m&&g===p?4:0}(l,c,d,f,e.isComposing()),m=(()=>{const n=null===u||u.editor===e,o=h.has(qv);if(!o&&n&&h.has(Gv))return 0;if(1===g)return 2;if(null===l)return 1;const s=c._selection;if(!(d.size>0||f.size>0))return null!==s?0:2;return!1===o&&0!==g&&g===i&&p<r+t&&n||1===d.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),o=t._selection,s=n._selection;return!(Ty(o)&&Ty(s)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!yy(r)||!yy(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],l,c)?0:1})();return r=p,i=g,m}}function DC(e,t){e.undoStack=[],e.redoStack=[],e.current=null}function IC(e){return function(e,t){let n=e;for(let r=rw(e,t);r&&(JC(r.origin)||Sy(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}(e,"previous")}function FC(e,t){for(const n of e.childNodes){if(Hx(n)&&n.tagName===t)return!0;if(FC(n,t))return!0}return!1}const OC="data-language",PC="data-highlight-language",MC="data-theme";class LC extends W_{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new LC(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=Bx().createElement("code");$w(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(OC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(PC,n));const r=this.getTheme();r&&t.setAttribute(MC,r);const i=this.getStyle();return i&&ey(t.style,i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(OC,r):i&&t.removeAttribute(OC);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&t.setAttribute(PC,r):t.removeAttribute(PC):o&&r&&t.setAttribute(PC,r);const s=this.__theme,a=e.__theme;s?s!==a&&t.setAttribute(MC,s):a&&t.removeAttribute(MC);const l=this.__style,c=e.__style;return l!==c&&ey(t.style,l,c),!1}exportDOM(e){const t=Bx().createElement("pre");$w(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(OC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(PC,n));const r=this.getTheme();r&&t.setAttribute(MC,r);const i=this.getStyle();return i&&ey(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||FC(e,"BR"))?{conversion:UC,priority:1}:null,div:()=>({conversion:BC,priority:1}),pre:()=>({conversion:UC,priority:0}),table:e=>VC(e)?{conversion:$C,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&VC(n)?{conversion:qC,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&VC(t)?{conversion:qC,priority:3}:null}}}static importJSON(e){return zC().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!VE(nS(),"@lexical/code")){const t=function(e){const{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){const e=t.getNode();if(jC(e)){const n=e.getChildrenSize();if(n>=2&&t.offset===n){const t=e.getLastChild();if(lb(t)&&lb(t.getPreviousSibling())){const t=pb();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}(e);if(t)return t}const{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(yy(i)){let e=IC(i);const t=[];for(;;)if(Sy(e))t.push(xy()),e=e.getNextSibling();else{if(!JC(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(HC(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const r=i.splitText(n.offset)[0],o=0===n.offset?0:1,s=r.getIndexWithinParent()+o,a=i.getParentOrThrow(),l=[ab(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===n.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(jC(i)){const{offset:t}=e.anchor;i.splice(t,0,[ab()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=pb();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function zC(e,t){return _S(LC).setLanguage(e).setTheme(t)}function jC(e){return e instanceof LC}function UC(e){return{node:zC(e.getAttribute(OC))}}function BC(e){const t=e,n=GC(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(GC(t))return!0;t=t.parentElement}return!1}(t)?{node:n?zC():null}:{node:null}}function $C(){return{node:zC()}}function qC(){return{node:null}}function GC(e){return null!==e.style.fontFamily.match("monospace")}function VC(e){return e.classList.contains("js-file-line-container")}class KC extends ly{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new KC(e.__text,e.__highlightType||void 0,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return $w(t,WC(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=WC(n.theme,e.__highlightType),o=WC(n.theme,this.__highlightType);return i!==o&&(i&&qw(t,i),o&&$w(t,o)),r}static importJSON(e){return HC().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return zC()}}function WC(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function HC(e="",t){return Dx(new KC(e,t))}function JC(e){return e instanceof KC}const XC="data-language";function QC(e){return null!==e.style.fontFamily.match("monospace")}function YC(e){let t=e.parentElement;for(;null!==t;){if(QC(t))return!0;t=t.parentElement}return!1}Kk.tag("tr","td"),Kk.tag("pre"),Kk.tag("code");Kk.tag("div"),Kk.tag("div","br");Kk.tag("div");Kk.tag("table").classAll("js-file-line-container"),Kk.tag("td").classAll("js-file-line");const ZC=new Set(["http:","https:","mailto:","sms:","tel:"]);let eA=class e extends W_{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){const t=Bx().createElement("a");return this.updateLinkDOM(null,t,e),$w(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Wx(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:tA,priority:1})}}static importJSON(e){return nA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){const t=e;e=cA(e);try{const t=new URL(cA(e));if(!ZC.has(t.protocol))return"about:blank"}catch(e){const n=t.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(null!=n&&!ZC.has(`${n[1].toLowerCase()}:`))return"about:blank"}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Rx(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Ty(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}};function tA(e){let t=null;if(Wx(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=nA(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function nA(e="",t){return Dx(new eA(e,t))}function rA(e){return e instanceof eA}let iA=class e extends eA{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return"autolink"}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Bx().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return oA().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=oA(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function oA(e="",t){return Dx(new iA(e,t))}function sA(e){return e instanceof iA}function aA(e,t){if("element"===e.type){const n=e.getNode();return H_(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}const lA=/^\+?[0-9\s()-]{5,}$/;function cA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:lA.test(e)?`tel:${e}`:`https://${e}`}function uA(e,t,n=null){const r=Ux(n),i=n?zx(n):[],o=null!==n&&i.length>0;if(o&&"function"==typeof r.caretPositionFromPoint){const o=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(null!==o&&function(e,t){for(let n=e;null!==n;){if(n===t)return!0;n=xx(n)}return!1}(o.offsetNode,n))return{node:o.offsetNode,offset:o.offset}}if(o){const i=n.getRootNode();if(Mx(i)){const o=i.elementFromPoint(e,t);if(null!==o&&n.contains(o)){const n=function(e,t,n,r){const i=r.createRange(),o=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,s=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,a=r.createTreeWalker(n,NodeFilter.SHOW_TEXT);let l=null,c=1/0,u=1/0;for(let p=a.nextNode();p;p=a.nextNode()){i.selectNodeContents(p);for(const e of i.getClientRects()){const t=o(e),n=s(e);(t<c||t===c&&n<u)&&(c=t,u=n,l=p)}}if(null===l)return null;let d=0,f=1/0,h=1/0;for(let p=0;p<=l.length;p++){i.setStart(l,p),i.collapse(!0);const t=i.getBoundingClientRect(),n=o(t),r=Math.abs(e-t.left);(n<f||n===f&&r<h)&&(f=n,h=r,d=p)}return{node:l,offset:d}}(e,t,o,r);if(null!==n)return n}}}if("function"==typeof r.caretRangeFromPoint){const n=r.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("function"==typeof r.caretPositionFromPoint){const n=r.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}function dA(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}Kk.tag("a");const fA={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};const hA=(e,t)=>{if(!Ty(t))return t.insertRawText(e),!0;const n=e=>{const t=t_();Ty(t)&&e(t)};return u_(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([xy()])),text:e=>n(t=>t.insertText(e))}),!0},pA={"application/x-lexical-editor":[(e,t,n)=>{try{const n=nS(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return EA(n,function(e){const t=[];for(const n of e)t.push(M_(n));return t}(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{const n=nS(),r=(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(e),"text/html");return EA(n,Hk(n,r),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[hA],"text/uri-list":[hA]};function gA(e,t,n,r){if(!e)return!1;const i=o=>!!e[o]&&e[o](t,n,i.bind(null,o-1),r);return i(e.length-1)}function mA(e,t,n){const r=t.getData("text/plain");for(const i of function(e){return Object.keys(e.$importMimeType).filter(t=>void 0!==e.$importMimeType[t]).sort((t,n)=>{const r=e.priority[t],i=e.priority[n];return void 0===r&&void 0===i?t<n?-1:t>n?1:0:void 0===r?1:void 0===i?-1:r-i})}(e)){const o=t.getData(i);if(o&&("text/html"!==i||o!==r)&&gA(e.$importMimeType[i],o,n,t))return!0}return!1}const vA={$importMimeType:pA,$insertDataTransfer:(e,t)=>mA({$importMimeType:pA,priority:fA},e,t),priority:fA},yA=zw({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>mA(t,e,n),priority:t.priority}),config:jw({$importMimeType:pA,priority:fA}),mergeConfig(e,t){const n=Uw(e,t);if(t.$importMimeType){const r={...e.$importMimeType};for(const[e,n]of Object.entries(t.$importMimeType))if(n){const t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"});function _A(e,t=t_()){return null==t&&dA(166),Ty(t)&&t.isCollapsed()||0===t.getNodes().length?"":Jk(e,t)}function bA(e,t=t_()){return null==t&&dA(166),Ty(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=Zb(),i=Ty(t)?t.anchor.getNode():Dy(t)?t.getNodes()[0]??null:null,o=null!==i?NS(i):null,s=(H_(o)?o:r).getChildren();for(let a=0;a<s.length;a++)kA(e,t,s[a],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}function xA(e,t,n){(function(){const e=function(e){return VE(nS(),e)}(yA.name);return e?e.output:vA})().$insertDataTransfer(e,t)}const SA="application/x-lexical-drag";function wA(e,t){return function(e,t,n){const r=e.dataTransfer;if(null===r)return!1;const i=function(e){const t=e.getData(SA);if(!t)return null;let n;try{n=JSON.parse(t)}catch(e){return null}return null!==(r=n)&&"object"==typeof r&&"editorKey"in r&&"string"==typeof r.editorKey?n:null;var r}(r);if(null===i)return!1;const o=function(e,t){const n=uA(e.clientX,e.clientY,t.getRootElement());if(null===n)return null;const r=Xb(n.node);if(null===r)return null;if(yy(r))return iw(r,"next",n.offset);if(H_(r))return Fw(r,n.offset,"next");const i=r.getParent();return null===i?null:Fw(i,r.getIndexWithinParent()+1,"next")}(e,t);if(null===o)return!1;const s=Mw(o);if(null===s)return!1;const a=i.editorKey===t.getKey(),l=t_();if(a){if(!Ty(l)||l.isCollapsed())return!1;if(function(e,t){const{anchor:n,focus:r}=Iw(Ew(t),"next");return gw(n,e)<0&&gw(e,r)<0}(o,l))return e.preventDefault(),!0;l.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(n(r,Sw(fw(s)),t),!a){const e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(const n of jx(t)){const t=Ob(n);if(Ib(t)&&t.getKey()===e&&Hx(n))return n}return null}(i.editorKey,n):null;null!==r&&r.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}(e,t,xA)}function EA(e,t,n){e.dispatchCommand(fm,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Ty(e)&&e.isCollapsed()){let t=null;const n=bw(e.anchor,"previous");if(n)if(QS(n))t=n.origin;else{const e=hw(n,aw(Zb(),"next").getFlipped());for(const n of e){if(yy(n.origin)){t=n.origin;break}if(H_(n.origin)&&!n.origin.isInline())break}}if(t&&yy(t)){const n=t.getFormat(),r=t.getStyle();e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}}}(n))}function kA(e,t,n,r=[]){let i=null===t||n.isSelected(t);const o=H_(n)&&n.excludeFromCopy("html");let s=n;null!==t&&yy(s)&&(s=Hw(t,s,"clone"));const a=H_(s)?s.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&dA(58,n.name),H_(e)){const e=t.children;Array.isArray(e)||dA(59,n.name)}return t}(s);yy(s)&&0===s.getTextContentSize()&&(i=!1);const c=i&&Dy(t)&&H_(n)?null:t;for(let u=0;u<a.length;u++){const r=a[u],o=kA(e,c,r,l.children);!i&&H_(n)&&o&&n.extractWithChild(r,t,"clone")&&(i=!0)}if(i&&!o){const t=RS(s);if(t.length>0){const n={};for(const r of t){const t=DS(s,r);null===t&&dA(366,s.constructor.name,r);const i=[];kA(e,null,t,i),1===i.length&&i[0].type===t.getType()||dA(385,r,s.constructor.name,String(i.length),String(i.length>0?i[0].type:"none")),n[r]=i[0]}l.$slots=n}}if(i&&!o)r.push(l);else if(Array.isArray(l.children))for(let u=0;u<l.children.length;u++){const e=l.children[u];r.push(e)}return i}let CA=null;async function AA(e,t,n){if(null!==CA)return!1;if(null!==t)return new Promise((r,i)=>{e.update(()=>{r(NA(e,t,n))})});const r=e.getRootElement(),i=e._window||window,o=i.document,s=Px(i);if(null===r||null===s)return!1;const a=o.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(o.createTextNode("#")),r.append(a);const l=o.createRange();return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((t,r)=>{const s=e.registerCommand(Qm,r=>(iE(r,ClipboardEvent)&&(s(),null!==CA&&(i.clearTimeout(CA),CA=null),t(NA(e,r,n))),!0),4);CA=i.setTimeout(()=>{s(),CA=null,t(!1)},50),o.execCommand("copy"),a.remove()})}function NA(e,t,n){if(void 0===n){const t=Px(e._window),r=t_();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=qx(t,e.getRootElement()),o=i.anchorNode,s=i.focusNode;if(null!==o&&null!==s&&!Db(e,o,s))return!1;n=RA(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(DA(r,n),!0)}const TA=[["text/html",_A],["application/x-lexical-editor",bA]];function RA(e=t_()){return function(e,t){const n={"text/plain":""};for(const[r,i]of Object.entries(e))if(i){const e=FA(i,t);null!==e&&(n[r]=e)}return n}(function(e=nS()){const t=VE(e,OA.name);return t?t.output:IA}(),e)}function DA(e,t){for(const[n]of TA)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}const IA={"application/x-lexical-editor":[(e,t)=>e?bA(nS(),e):t()],"text/html":[(e,t)=>e?_A(nS(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function FA(e,t){const n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}const OA=zw({build:(e,t,n)=>t.$exportMimeType,config:jw({$exportMimeType:IA}),mergeConfig(e,t){const n=Uw(e,t);if(t.$exportMimeType){const r={...e.$exportMimeType};for(const[e,n]of Object.entries(t.$exportMimeType))if(n){const t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"});Kk.tag("h1","h2","h3","h4","h5","h6"),Kk.tag("blockquote");Kk.tag("blockquote"),Kk.tag("p"),Kk.tag("span");const PA=um("DRAG_DROP_PASTE_FILE"),MA=Xp("shadowRoot",{parse:Boolean});class LA extends W_{static getType(){return"quote"}static clone(e){return new LA(e.__key)}$config(){return this.config("quote",{extends:W_,stateConfigs:[{flat:!0,stateConfig:MA}]})}isShadowRoot(){return Qp(this,MA)}setIsShadowRoot(e){return Yp(this,MA,e)}createDOM(e){const t=Bx().createElement("blockquote");return $w(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:qA,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Hx(t)){this.isEmpty()&&t.append(Bx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return zA().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){const n=pb(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(const e of this.getChildren())this.insertBefore(e);return this.remove(),!0}const e=pb();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function zA(e){const t=Dx(new LA);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function jA(e){return e instanceof LA}let UA=class e extends W_{__tag;static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){const t=this.getWritable();return t.__tag=e,t}createDOM(e){const t=this.__tag,n=Bx().createElement(t),r=e.theme.heading;if(void 0!==r){$w(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:$A,priority:0}),h2:e=>({conversion:$A,priority:0}),h3:e=>({conversion:$A,priority:0}),h4:e=>({conversion:$A,priority:0}),h5:e=>({conversion:$A,priority:0}),h6:e=>({conversion:$A,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&BA(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>BA(e)?{conversion:e=>({node:GA("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Hx(t)){this.isEmpty()&&t.append(Bx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return GA(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?pb():GA(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=pb();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){const e=pb();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function BA(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function $A(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=GA(t),uS(e,n),fS(n,e),dS(n,e)),{node:n}}function qA(e){const t=zA();return fS(t,e),uS(e,t),dS(t,e),{node:t}}function GA(e="h1"){return Dx(new UA(e))}function VA(e){return Q_(Xb(e))}function KA(e,t,n,r){let i=!1,o=null;if(e.isCollapsed()&&"text"===e.anchor.type){const t=e.anchor.getNode();if(yy(t)){o=t;const r=e.anchor.offset,s=r===t.getTextContentSize()&&null===t.getNextSibling(),a=0===r&&null===t.getPreviousSibling();i="end"===n&&s||"start"===n&&a||"both"===n&&(s||a)}}let s=!1;for(const[a,l]of Object.entries(r)){if(null==l||!l[t])continue;const n=a;if(l.onlyAtBoundary){if(!(i&&o&&yy(o)&&o.hasFormat(n)))continue;s=!0}e.hasFormat(n)&&e.toggleFormat(n)}s&&e.setStyle("")}const WA={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function HA(e,t){return function(e,t){if(!e.isCollapsed())return!1;const n=bw(e.focus,t),r=bS(n.origin,Nx);if(!r)return!1;const i=e.focus.getNode();if(!r.is(i)&&!Ex(i,r))return!1;const o=hw(n,rw(r,t));if(o.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;const s=hw(o.anchor.getSiblingCaret(),o.focus);let a=s.anchor.origin;for(const c of s){if(!YS(c)||!c.origin.is(a.getParent()))return!1;a=c.origin}let l=r;for(const c of dw(rw(r,t))){if(!c.origin.is(l.getParent())){if(Fx(c.origin)){const e=rw(l,t);return Sw(hw(e,e)),!0}break}if(!Nx(c.origin))break;l=c.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||"element"!==e.anchor.type)return!1;const n=bw(e.anchor,t).getNodeAtCaret();return!(!Nx(n)||n.isInline()||(Sw(fw(Tw(aw(n,t)))),0))}(e,t)}function JA(e){return Q_(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function XA(e){const t=Zy();t.add(e),ex(t)}function QA(e,t){if(!e.isCollapsed())return!1;const n=e.focus,r=n.getNode(),i=t?"previous":"next",o=bw(n,i);if("element"===n.type&&H_(r)&&(Z_(r)||Nx(r))){const e=o.getNodeAtCaret();return!(null===e||!JA(e)||(XA(e.__key),0))}const s=bS(H_(r)?r:r.getParentOrThrow(),e=>H_(e)&&!e.isInline()&&Tx(e.getParent()));if(null===s)return!1;const a=rw(s,i).getNodeAtCaret();if(null===a||!JA(a))return!1;if(0===s.getTextContentSize())return XA(a.__key),!0;const l=nS().getRootElement();if(null===l)return!1;const c=Px(l.ownerDocument.defaultView);if(null===c||0===c.rangeCount)return!1;const u=c.anchorNode,d=c.anchorOffset,f=c.focusNode,h=c.focusOffset;c.modify("move",t?"backward":"forward","line");const p=c.anchorNode,g=c.anchorOffset;if(null===p)return YA(c,u,d,f,h),!1;const m=Xb(p);return YA(c,u,d,f,h),null!==m&&((p===u&&g===d||!m.is(s)&&!Ex(m,s))&&(XA(a.__key),!0))}function YA(e,t,n,r,i){null!==t&&null!==r&&e.setBaseAndExtent(t,n,r,i)}function ZA(e,t){if(!e.isCollapsed())return!1;const n=e.focus.getNode(),r=bS(H_(n)?n:n.getParentOrThrow(),e=>H_(e)&&!e.isInline());if(null===r)return!1;const i=nS(),o=i.getRootElement();if(null===o)return!1;const s=o.ownerDocument.defaultView;if(null===s)return!1;let a=!1;for(const m of r.getChildren())if(H_(m)&&m.isInline()){const e=i.getElementByKey(m.getKey());if(null!==e){const t=s.getComputedStyle(e).display;if("inline-grid"===t||"inline-flex"===t){a=!0;break}}}if(!a)return!1;const l=rw(r,t?"previous":"next").getNodeAtCaret();if(null===l||!H_(l)){if(t){const e=r.getFirstDescendant();yy(e)?e.select(0,0):r.select(0,0)}else{const e=r.getLastDescendant();if(yy(e)){const t=e.getTextContentSize();e.select(t,t)}else{const e=r.getChildrenSize();r.select(e,e)}}return!0}const c=i.getElementByKey(l.getKey());if(null===c)return!1;const u=Px(s);if(null===u||0===u.rangeCount)return!1;const d=u.getRangeAt(0).cloneRange();d.collapse(!0);const f=d.getBoundingClientRect(),h=c.getBoundingClientRect(),p=h.top+h.height/2;if(f.height>0){const t=uA(f.left,p,o);if(null!==t&&c.contains(t.node)){const n=o.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}const g=t?l.getLastDescendant():l.getFirstDescendant();if(yy(g)){const e=t?g.getTextContentSize():0;g.select(e,e)}else{const e=l.getChildrenSize();l.select(t?e:0,t?e:0)}return!0}function eN(e,t){const n=rw(e,t),r=n.getAdjacentCaret();null!==r&&H_(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Sw(fw(n)):"next"===t?e.selectNext(0,0):e.selectPrevious()}function tN(e,t,n){n.preventDefault(),n.stopPropagation();const r=e.getNodes();if(0===r.length)return!0;const i=r.map(e=>rw(e,"next")).sort(gw),o=(t?i[0]:i[i.length-1]).origin,s=bS(o,e=>e!==o&&H_(e)&&!e.isInline())??Zb(),a=t?0:s.getChildrenSize();return s.select(a,a),!0}function nN(e,t=function(e,t){return new yE(e,t)}(WA)){return Gw(e.registerCommand(hm,()=>{const e=t_();return Dy(e)?(e.clear(),!0):(Ty(e)&&KA(e,"click","both",t.peek()),!1)},0),e.registerCommand(ym,e=>{const t=t_();return Ty(t)?(t.deleteCharacter(e),!0):!!Dy(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(Em,e=>{const t=t_();return!!Ty(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(km,e=>{const t=t_();return!!Ty(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(xm,e=>{const t=t_();if("string"==typeof e)null!==t&&t.insertText(e);else{if(null===t)return!1;const n=e.dataTransfer;if(null!=n)xA(n,t);else if(Ty(t)){const n=e.data;return n&&t.insertText(n),!0}}return!0},0),e.registerCommand(wm,()=>{const e=t_();return!!Ty(e)&&(e.removeText(),!0)},0),e.registerCommand(Cm,e=>{const t=t_();return!(!Ty(t)&&!Dy(t)||(Fy(t,e),0))},0),e.registerCommand(Am,e=>{const t=t_();return!(!Ty(t)&&!Dy(t)||(function(e,t){const n=[];for(const[r,i]of Object.entries(t))"boolean"==typeof i&&n.push([r,i]);0!==n.length&&Iy(e,e=>{for(const[t,r]of n)e=jb(e,t,r?yp[t]:0);return e})}(t,e),0))},0),e.registerCommand(Wm,e=>{const t=t_();if(!Ty(t)&&!Dy(t))return!1;const n=t.getNodes();for(const r of n){const t=bS(r,e=>H_(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},0),e.registerCommand(_m,e=>{const t=t_();return!!Ty(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(bm,()=>{const e=t_();return!!Ty(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(qm,()=>{const e=xy(),t=t_();return Ty(t)&&(e.setFormat(t.format),e.setStyle(t.style)),function(e){let t=t_()||n_();null===t&&(t=Zb().selectEnd()),t.insertNodes(e)}([e]),!0},0),e.registerCommand(Gm,()=>sE(e=>{const t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Vm,()=>sE(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(Pm,e=>{const t=t_();if(Dy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),eN(n[0],"previous"),!0}else if(Ty(t)){if(!e.shiftKey&&HA(t,"previous"))return e.preventDefault(),!0;if(!e.shiftKey&&QA(t,!0))return e.preventDefault(),!0;if(!e.shiftKey&&ZA(t,!0))return e.preventDefault(),!0}return!1},0),e.registerCommand(Mm,e=>{const t=t_();if(Dy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),eN(n[0],"next"),!0}else if(Ty(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===Zb().getChildrenSize()}(t))return e.preventDefault(),!0;if(!e.shiftKey&&HA(t,"next"))return e.preventDefault(),!0;if(!e.shiftKey&&QA(t,!1))return e.preventDefault(),!0;if(!e.shiftKey&&ZA(t,!1))return e.preventDefault(),!0}return!1},0),e.registerCommand(Fm,e=>{const n=t_();if(Dy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),eN(t[0],Ww(t[0])?"next":"previous"),!0}if(!Ty(n))return!1;if(!e.shiftKey&&HA(n,Ww(n.anchor.getNode())?"next":"previous"))return e.preventDefault(),!0;if(e.shiftKey||KA(n,"arrow","start",t.peek()),Zw(n,!0)){const t=e.shiftKey;return e.preventDefault(),tE(n,t,!0),!0}return!1},0),e.registerCommand(Dm,e=>{const n=t_();if(Dy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),eN(t[0],Ww(t[0])?"previous":"next"),!0}if(!Ty(n))return!1;if(!e.shiftKey&&HA(n,Ww(n.anchor.getNode())?"previous":"next"))return e.preventDefault(),!0;if(e.shiftKey||KA(n,"arrow","end",t.peek()),Zw(n,!1)){const t=e.shiftKey;return e.preventDefault(),tE(n,t,!1),!0}return!1},0),e.registerCommand(jm,t=>{const n=t_();if(!Dy(n)&&VA(t.target))return!1;if(Ty(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(Z_(n))return!1;const r=rE(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Vm,void 0);if(ep&&Zh)return!1}else if(!Dy(n))return!1;return t.preventDefault(),e.dispatchCommand(ym,!0)},0),e.registerCommand(Bm,t=>{const n=t_();return!(!Dy(n)&&VA(t.target))&&!(!Ty(n)&&!Dy(n))&&(t.preventDefault(),e.dispatchCommand(ym,!1))},0),e.registerCommand(Lm,n=>{let r=t_();if(Dy(r)){const e=r.getNodes();1===e.length&&Q_(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Ty(r))return!1;if(KA(r,"enter","both",t.peek()),null!==n){if((ep||np||op)&&Zh)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(_m,!1)}return e.dispatchCommand(bm,void 0)},0),e.registerCommand(Um,()=>!!Ty(t_())&&(e.blur(),!0),0),e.registerCommand(Km,t=>{const[,n]=oE(t);if(n.length>0){const r=uA(t.clientX,t.clientY,e.getRootElement());if(null!==r){const{offset:t,node:i}=r,o=Xb(i);if(null!==o){const e=Yy();if(yy(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{const t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}ex(fg(e))}e.dispatchCommand(PA,n)}return t.preventDefault(),!0}return wA(t,e)},0),e.registerCommand(Hm,t=>{const[n]=oE(t),r=t_();return!(n&&!Ty(r)||(Ty(r)&&!r.isCollapsed()&&null!==t.dataTransfer&&(DA(t.dataTransfer,RA(r)),function(e,t){const n={editorKey:t.getKey()};e.setData(SA,JSON.stringify(n))}(t.dataTransfer,e)),0))},0),e.registerCommand(Jm,t=>{const[n]=oE(t),r=t_();if(n&&!Ty(r))return!1;const i=uA(t.clientX,t.clientY,e.getRootElement());if(null!==i){Q_(Xb(i.node))&&t.preventDefault()}return!0},0),e.registerCommand(Zm,()=>{const e=t_();return function(e){const t=Zb();if(Ty(e)){const t=e.anchor,n=e.focus,r=t.getNode();if(Z_(r))return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),fg(e),e;const i=r.getTopLevelElementOrThrow(),o=i.getParent();if(null===o)return H_(i)&&(t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),fg(e)),e;const s=o;return t.set(s.getKey(),0,"element"),n.set(s.getKey(),s.getChildrenSize(),"element"),fg(e),e}{const e=t.select(0,t.getChildrenSize());ex(fg(e))}}(Ty(e)&&null!==NS(e.anchor.getNode())?e:null),!0},0),e.registerCommand(Qm,t=>(AA(e,iE(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Ym,t=>(async function(e,t){await AA(t,iE(e,ClipboardEvent)?e:null),t.update(()=>{const e=t_();Ty(e)?e.removeText():Dy(e)&&e.getNodes().forEach(e=>e.remove())},{tag:"cut"})}(t,e),!0),0),e.registerCommand(Sm,t=>{const[,n,r]=oE(t);return n.length>0&&!r?(e.dispatchCommand(PA,n),!0):(!Jx(t.target)||!Rb(t.target))&&(null!==t_()&&(function(e,t){e.preventDefault(),t.update(()=>{const t=t_(),n=iE(e,InputEvent)||iE(e,KeyboardEvent)?null:e.clipboardData;null!=n&&null!==t&&xA(n,t)},{tag:Vv})}(t,e),!0))},0),e.registerCommand(zm,()=>{const e=t_();return Ty(e)&&KA(e,"space","both",t.peek()),!1},0),e.registerCommand($m,()=>{const e=t_();return Ty(e)&&KA(e,"tab","both",t.peek()),!1},0),e.registerCommand(Im,e=>{const t=t_();if(Dy(t))return tN(t,!1,e);if(!Ty(t))return!1;const{anchor:n}=t;if("element"!==n.type||0!==n.offset)return!1;const r=n.getNode();if(!H_(r))return!1;const i=r.getFirstChild();if(!Q_(i)||!i.isInline())return!1;const o=r.getKey(),s=r.selectEnd();return e.shiftKey&&s.anchor.set(o,0,"element"),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Om,e=>{const t=t_();if(Dy(t))return tN(t,!0,e);if(!Ty(t))return!1;const{anchor:n,focus:r}=t,i=bS(r.getNode(),e=>H_(e)&&!e.isInline());if(null===i)return!1;const o=i.getFirstChild();if(!Q_(o)||!o.isInline())return!1;if(bS(n.getNode(),e=>H_(e)&&!e.isInline())!==i)return!1;const s=i.getKey();return("element"!==r.type||r.key!==s||0!==r.offset)&&(t.focus.set(s,0,"element"),e.shiftKey||t.anchor.set(s,0,"element"),e.preventDefault(),e.stopPropagation(),!0)},0))}function rN(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function iN(e){const t=rN(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const oN=/[!-/:-@[-`{-~\s]/,sN=/\s/,aN=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,lN=/^\s{0,3}$/;function cN(e){if(!gb(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&yy(t)&&lN.test(t.getTextContent())}function uN(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}const dN=/^(\s*)(\d{1,})\.\s/,fN=/^(\s*)[-*+]\s/,hN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,pN=/^(#{1,6})\s/,gN=/^>\s/,mN=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,vN=/^[ \t]*`{3,}$/,yN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,_N=/^(?:\|)(.+)(?:\|)\s?$/;function bN(e){if("|"!==e[0])return!1;const{length:t}=e;let n=1,r=0;for(;n<t;){let t=n;for(" "===e[t]&&t++,":"===e[t]&&t++;"-"===e[t];)t++;if(":"===e[t]&&t++," "===e[t]&&t++,"|"!==e[t])break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}const xN=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,SN=/^<\/[a-z_][\w-]*\s*>/i,wN=e=>new RegExp(`(?:${e.source})$`,e.flags),EN=Xp("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),kN=Xp("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),CN=Xp("mdHardLineBreak",{parse:e=>"string"==typeof e&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function AN(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function NN(e){const t=ab(),n=function(e){const t=e.getChildren(),n=t.length-1,r=t[n];if(!yy(r))return null;const i=r.getTextContent(),o=AN(i);if(null!==o){const[e,t]=o;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(lb(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(""),i):null}(e);return null!==n&&Yp(t,CN,n),t}const TN=e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},RN=e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),a=pC("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==EN.parse(l)?void 0:l;if(xC(s)&&s.getListType()===e){c&&Yp(s,EN,c);const n=s.getFirstChild();null!==n?n.insertBefore(a):s.append(a),"number"===e&&s.setStart(Number(r[2])),t.remove()}else if(xC(o)&&o.getListType()===e)c&&Yp(o,EN,c),o.append(a),t.remove();else{const n=bC(e,"number"===e?Number(r[2]):void 0);c&&Yp(n,EN,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},DN=(e,t,n,r)=>{const i=[],o=e.getChildren();let s=0;for(const a of o)if(gC(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if(xC(e)){const o=DN(e,t,n+1,r);o&&i.push(o);continue}}if(r&&!a.getChildren().some(e=>e.isSelected(r)))continue;const o=" ".repeat(4*n),l=e.getListType(),c=Qp(e,EN),u="number"===l?`${e.getStart()+s}. `:"check"===l?`${c} [${a.getChecked()?"x":" "}] `:c+" ";let d=t(a);"number"!==l&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(o+u+d),s++}return i.join("\n")},IN={dependencies:[UA],export:(e,t)=>{if(!function(e){return e instanceof UA}(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:pN,replace:TN(e=>GA("h"+e[1].length)),triggerOnEnter:!0,type:"element"},FN={dependencies:[LA],export:(e,t)=>{if(!jA(e))return null;const n=t(e).split("\n"),r=[];for(const i of n)r.push("> "+i);return r.join("\n")},regExp:gN,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(jA(n))return n.splice(n.getChildrenSize(),0,[NN(n),...t]),void e.remove()}const i=zA();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:"element"},ON={dependencies:[LC],export:e=>{if(!jC(e))return null;const t=e.getTextContent();let n=Qp(e,kN);if(t.indexOf(n)>-1){const e=t.match(/`{3,}/g);if(e){const t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n"+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{const i=r[1],o=i.trim().length,s=e[n],a=r.index+i.length,l=s.slice(a),c=new RegExp(`\`{${o},}$`);if(c.test(l)){const e=l.match(c),i=l.slice(0,l.lastIndexOf(e[0])),o=[...r];return o[2]="",ON.replace(t,null,o,e,[i],!0),[!0,n]}const u=new RegExp(`^[ \\t]*\`{${o},}$`);for(let h=n+1;h<e.length;h++){const i=e[h];if(u.test(i)){const o=i.match(u),a=e.slice(n+1,h),l=s.slice(r[0].length);return l.length>0&&a.unshift(l),ON.replace(t,null,r,o,a,!0),[!0,h]}}const d=e.slice(n+1),f=s.slice(r[0].length);return f.length>0&&d.unshift(f),ON.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:vN},regExpStart:mN,replace:(e,t,n,r,i,o)=>{let s,a;const l=n[1]?n[1].trim():"```",c=n[2]||void 0;if(!t&&i){if(1===i.length)r?(s=zC(c),a=i[0]):(s=zC(c),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=zC(c),i.length>0&&(0===i[0].trim().length?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}Yp(s,kN,l);const t=vy(a);s.append(t),e.append(s)}else t&&TN(e=>zC(e?e[2]:void 0))(e,t,n,o)},type:"multiline-element"},PN={dependencies:[mC,uC],export:(e,t,n)=>xC(e)?DN(e,t,0,n):null,regExp:fN,replace:RN("bullet"),triggerOnEnter:!0,type:"element"},MN={dependencies:[mC,uC],export:(e,t,n)=>xC(e)?DN(e,t,0,n):null,regExp:dN,replace:RN("number"),triggerOnEnter:!0,type:"element"},LN={dependencies:[eA],export:(e,t,n)=>{if(!rA(e)||sA(e))return null;const r=t(e);let i=e.getTitle();return null!=i&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(bS(e,rA))return;const[,n,r,i]=t,o=nA(null!=r?uN(r):void 0,{title:null!=i?uN(i):void 0}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=vy(l);return u.setFormat(e.getFormat()),o.append(u),e.replace(o),c&&o.insertBefore(vy(c)),u},trigger:")",type:"text-match"},zN=[...[IN,FN,PN,MN],...[ON],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[LN]];function jN(e,t,n,r,i){for(const o of t){if(!o.export)continue;const t=o.export(e,e=>UN(e,n,r,void 0,void 0,i));if(null!=t)return t}return H_(e)?UN(e,n,r,void 0,void 0,i):Q_(e)?e.getTextContent():null}function UN(e,t,n,r,i,o=!1){const s=[],a=e.getChildren();r||(r=[]),i||(i=[]);e:for(const l of a){for(const e of n){if(!e.export)continue;const a=e.export(l,e=>UN(e,t,n,r,[...i,...r],o),(e,n)=>$N(e,n,t,r,i,o));if(null!=a){s.push(a);continue e}}lb(l)?s.push(BN(l)):yy(l)?s.push($N(l,l.getTextContent(),t,r,i,o)):H_(l)?s.push(UN(l,t,n,r,i,o)):Q_(l)&&s.push(l.getTextContent())}return s.join("")}function BN(e){return Qp(e,CN)+"\n"}function $N(e,t,n,r,i,o=!1){const s=e.hasFormat("code");let a,l,c,u,d=t;if(s||(d=o?d.replace(/([*_`~])/g,"\\$1"):d.replace(/([*_`~\\])/g,"\\$1")),s){const{fence:e,padded:n}=function(e){const t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:0===e.length||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);a="",c="",l=e+n+e,u=!1}else{const e=d.match(/^(\s*)(.*?)(\s*)$/s)||["","",d,""];a=e[1],l=e[2],c=e[3],u=""===l}let f="",h="",p="";const g=qN(e,!0),m=qN(e,!1),v=new Set;for(const y of n){const t=y.format[0],n=y.tag;"code"!==t&&VN(e,t)&&!v.has(t)&&(v.add(t),VN(g,t)&&r.find(e=>e.tag===n)||(r.push({format:t,tag:n}),f+=n))}for(let y=0;y<r.length;y++){const t=GN(e,r[y].format),n=GN(m,r[y].format);if(t&&n)continue;const o=[...r];for(;o.length>y;){const e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&"string"==typeof e.tag&&(t?n||(p+=e.tag):h+=e.tag),r.pop())}break}return u&&!e.hasFormat("code")?h+d:h+a+f+l+p+c}function qN(e,t){const n=t?e.getPreviousSibling():e.getNextSibling();return yy(n)?n:null}function GN(e,t){return yy(e)&&e.hasFormat(t)}function VN(e,t){return!(!GN(e,t)||"code"!==t&&e&&/^\s*$/.test(e.getTextContent()))}function KN(e,t,n,r,i){if(!WN(t,n,r,i))return!1;if("*"===e)return!0;if("_"===e){if(!WN(t,n,r,!i))return!0;const e=i?t[n-1]:t[n+r];return void 0!==e&&aN.test(e)}return!0}function WN(e,t,n,r){const i=e[t-1],o=e[t+n],[s,a]=r?[o,i]:[i,o];return void 0!==s&&!sN.test(s)&&(!aN.test(s)||void 0===a||sN.test(a)||aN.test(a))}function HN(e){return yy(e)&&!e.hasFormat("code")}function JN(e,t,n){let r=function(e,t){const n=e.getTextContent(),r=t.transformersByTag["`"],i=[];let o=null;if(r){const e=function(e){const t=t=>{let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2==1},n=[];let r=0;for(;r<e.length;)if("`"===e[r]){let t=1;for(;r+t<e.length&&"`"===e[r+t];)t++;n.push({index:r,length:t}),r+=t}else r++;const i=[];let o=0;for(;o<n.length;){const r=n[o];if(t(r.index)){o++;continue}let s=-1;for(let e=o+1;e<n.length;e++)if(n[e].length===r.length){s=e;break}if(-1===s){o++;continue}const a=n[s];let l=e.slice(r.index+r.length,a.index);l.length>=2&&l.startsWith(" ")&&l.endsWith(" ")&&/[^ ]/.test(l)&&(l=l.slice(1,-1)),i.push({content:l,endIndex:a.index+a.length,startIndex:r.index}),o=s+1}return i}(n);for(const t of e)o||(o={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"}),i.push({end:t.endIndex,start:t.startIndex})}const s=function(e,t,n=[]){const r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>"`"!==e[0]).map(e=>e[0])),o=t=>{let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2==1},s=e=>n.some(t=>e>=t.start&&e<t.end);let a=0;for(;a<e.length;){const t=e[a];if(!i.has(t)||o(a)||s(a)){a++;continue}let n=1;for(;a+n<e.length&&e[a+n]===t;)n++;const l=KN(t,e,a,n,!0),c=KN(t,e,a,n,!1);(l||c)&&r.push({active:!0,canClose:c,canOpen:l,char:t,index:a,length:n}),a+=n}return r}(n,t,i),a=s.length>0?function(e,t,n){const r={};let i=0,o=null;for(;i<t.length;){const s=t[i];if(!s.active||!s.canClose||0===s.length){i++;continue}const a=`${s.char}${s.canOpen}${s.length%3}`,l=r[a]??-1;let c=!1;for(let r=i-1;r>l;r--){const a=t[r];if(!a.active||!a.canOpen||0===a.length||a.char!==s.char)continue;if((a.canClose||s.canOpen)&&(a.length+s.length)%3==0&&a.length%3!=0&&s.length%3!=0)continue;const l=Math.min(a.length,s.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===a.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0];if(!u)continue;c=!0;const d=u.length,f={content:e.slice(a.index+a.length,s.index),endIndex:s.index+d,startIndex:a.index+(a.length-d),tag:u};(!o||f.startIndex<o.startIndex||f.startIndex===o.startIndex&&f.endIndex>o.endIndex)&&(o=f);for(let e=r+1;e<i;e++)t[e].active=!1;a.length-=d,s.length-=d,a.active=a.length>0,s.length>0?s.index+=d:(s.active=!1,i++);break}c||(r[a]=i-1,s.canOpen||(s.active=!1),i++)}return o}(n,s,t):null;let l=null,c=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(l=a,c=t.transformersByTag[a.tag]):(l=o,c=r):o?(l=o,c=r):a&&(l=a,c=t.transformersByTag[a.tag]),!l||!c)return null;const u=[n.slice(l.startIndex,l.endIndex),l.tag,l.content];return u.index=l.startIndex,u.input=n,{endIndex:l.endIndex,isCodeSpan:c===r,match:u,startIndex:l.startIndex,transformer:c}}(e,t),i=function(e,t){const n=e;let r,i,o,s;for(const a of t){if(!a.replace||!a.importRegExp)continue;const e=n.getTextContent().match(a.importRegExp);if(!e)continue;const t=e.index||0,l=a.getEndIndex?a.getEndIndex(n,e):t+e[0].length;!1!==l&&(void 0===r||void 0===i||t<r&&(l>i||l<=r))&&(r=t,i=l,o=a,s=e)}return void 0===r||void 0===i||void 0===o||void 0===s?null:{endIndex:i,match:s,startIndex:r,transformer:o}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const i=function(e,t,n,r,i){const o=e.getTextContent();let s,a,l;if(i[0]===o?s=e:0===t?[s,a]=e.splitText(n):[l,s,a]=e.splitText(t,n),s.setTextContent(i[2]),r)for(const c of r.format)s.hasFormat(c)||s.toggleFormat(c);return{nodeAfter:a,nodeBefore:l,transformedNode:s}}(e,r.startIndex,r.endIndex,r.transformer,r.match);HN(i.nodeAfter)&&JN(i.nodeAfter,t,n),HN(i.nodeBefore)&&JN(i.nodeBefore,t,n),HN(i.transformedNode)&&JN(i.transformedNode,t,n)}else if(i){const r=function(e,t,n,r,i){let o,s,a;return 0===t?[o,s]=e.splitText(n):[a,o,s]=e.splitText(t,n),r.replace?{nodeAfter:s,nodeBefore:a,transformedNode:r.replace(o,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;HN(r.nodeAfter)&&JN(r.nodeAfter,t,n),HN(r.nodeBefore)&&JN(r.nodeBefore,t,n),HN(r.transformedNode)&&JN(r.transformedNode,t,n)}const o=uN(e.getTextContent());e.setTextContent(o)}function XN(e,t,n,r){for(const i of n){const{handleImportAfterStartMatch:n,regExpEnd:o,regExpStart:s,replace:a}=i,l=e[t].match(s);if(!l)continue;if(n){const o=n({lines:e,rootNode:r,startLineIndex:t,startMatch:l,transformer:i});if(null===o)continue;if(o)return o}const c="object"==typeof o&&"regExp"in o?o.regExp:o,u=o&&"object"==typeof o&&"optional"in o?o.optional:!o;let d=t;const f=e.length;for(;d<f;){const n=c?e[d].match(c):null;if(!n&&(!u||u&&d<f-1)){d++;continue}if(n&&t===d&&n.index===l.index){d++;continue}const i=[];if(n&&t===d)i.push(e[t].slice(l[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){const t=e[r].slice(l[0].length);i.push(t)}else if(r===d&&n){const t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==a(r,null,l,n,i,!0))return[!0,d];break}}return[!1,t]}function QN(e,t,n,r,i,o){const s=vy(e),a=pb();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const t=e.match(l);if(t&&(s.setTextContent(e.slice(t[0].length)),!1!==c(a,[s],t,!0)))break}if(JN(s,r,i),null!==a.getParent()&&e.length>0){const e=a.getPreviousSibling();if(!o&&(gb(e)||jA(e)||xC(e))){let t=e;if(xC(e)){const n=e.getLastDescendant();t=null==n?null:bS(n,gC)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[NN(t),...a.getChildren()]),a.remove())}}}function YN(e){const t=new Set,n=e.getTextContent();let r=n.indexOf("\t");for(;-1!==r;)t.add(r),t.add(r+1),r=n.indexOf("\t",r+1);e.splitText(...t).forEach(e=>{"\t"===e.getTextContent()&&e.replace(xy())})}function ZN(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function eT(e,t,n,r,i){if(!Tx(e.getParent())||e.getFirstChild()!==t)return!1;const o=t.getTextContent();if(!i&&" "!==o[n-1])return!1;for(const{regExp:s,replace:a}of r){const r=o.match(s),l=i||r&&r[0].endsWith(" ")?n:n-1;if(r&&r[0].length===l){const i=t.getNextSiblings(),[o,s]=t.splitText(n);if(!1!==a(e,s?[s,...i]:i,r,!1))return o.remove(),!0}}return!1}function tT(e,t,n,r,i){if(!Tx(e.getParent())||e.getFirstChild()!==t)return!1;const o=t.getTextContent();if(!i&&" "!==o[n-1])return!1;for(const{regExpStart:s,replace:a,regExpEnd:l}of r){if(l&&!("optional"in l)||l&&"optional"in l&&!l.optional)continue;const r=o.match(s);if(r){const o=i||r[0].endsWith(" ")?n:n-1;if(r[0].length!==o)continue;const s=t.getNextSiblings(),[l,c]=t.splitText(n);if(!1!==a(e,c?[c,...s]:s,r,null,null,!1))return l.remove(),!0}}return!1}function nT(e,t){let n=0;const r=e.getTextContent();for(let i=0;i<t;i++)"`"===r[i]&&n++;return n%2!=0}function rT(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(iT(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function iT(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function oT(e,t=zN,n,r=!1,i=!1){const o=r?e:function(e,t=!1){const n=e.split("\n");let r=0;const i=[];for(let o=0;o<n.length;o++){const e=n[o],s=e.trimEnd(),a=i[i.length-1],l=o<n.length-1?AN(e):null,c=void 0!==a&&null!==AN(a);if(yN.test(s))i.push(s);else if(0===r){{const e=s.match(mN);if(e){r=e[1].trim().length,i.push(s);continue}}""===s||""===a||!a||pN.test(a)||pN.test(s)||gN.test(s)||dN.test(s)||fN.test(s)||hN.test(s)||_N.test(s)||bN(s)||c||!t||xN.test(s)||SN.test(s)||wN(SN).test(a)||wN(xN).test(a)||vN.test(a)?i.push(!t&&""!==s||null!==l?e:s):i[i.length-1]=a+" "+(null===l?s:e).trimStart()}else{if(vN.test(s)&&s.trim().length>=r){r=0,i.push(s);continue}i.push(e)}}return i.join("\n")}(e,i),s=Zb();s.clear(),function(e,t,n,r=!1){const i=iN(n),o=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const o=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(o),1===e.length?n[e]="`"===e?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${o}])(${o})((\\\\${o})?.*?[^${o}\\s](\\\\${o})?)(${o})(?![\\\\${o}])`):n[e]=new RegExp(`(^|[^\\\\])(${o})((\\\\${o})?.*?[^\\s](\\\\${o})?)(${o})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp(`(${r.join("|")})`,"g"),transformersByTag:t}}(i.textFormat),s=e.split("\n"),a=s.length;for(let c=0;c<a;c++){const e=s[c],[n,a]=XN(s,c,i.multilineElement,t);n?c=a:QN(e,t,i.element,o,i.textMatch,r)}const l=t.getChildren();for(const c of l)if(!r&&cN(c)&&t.getChildrenSize()>1)c.remove();else if(H_(c))for(const e of c.getAllTextNodes())YN(e)}(o,s,t,r),null!==t_()&&s.selectStart()}function sT(e=zN,t,n=!1){const r=function(e,t=!1){const n=iN(e),r=[...n.multilineElement,...n.element],i=!t,o=n.textFormat.filter(e=>1===e.format.length).sort((e,t)=>Number(e.format.includes("code"))-Number(t.format.includes("code")));return e=>{const s=[],a=(e||Zb()).getChildren();for(let l=0;l<a.length;l++){const e=a[l],c=jN(e,r,o,n.textMatch,t);null!=c&&s.push(i&&l>0&&!cN(e)&&!cN(a[l-1])?"\n".concat(c):c)}return s.join("\n")}}(e,n);return r(t)}let aT=[UA,LA,mC,uC,eA,LC];function lT(e){return"var("+e+")"}let cT=lo([pi("flex"),yi("wrap"),ui("center"),ci("gap","2px"),ci("padding","var("+_t.xs+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]),uT=lo([ci("background","none"),ci("border","1px solid transparent"),ci("border-radius",lT(xt.sm)),ci("color",lT(yt.textSecondary)),ci("font-family","inherit"),ci("font-size",lT(bt.sizeSm)),ci("line-height","1"),ci("min-width","26px"),ci("padding","5px 6px"),hi("pointer"),Qi([ci("background",lT(yt.surfaceSubtle))])]),dT=lo([ci("background",lT(yt.surfaceSubtle)),ci("border-color",lT(yt.border)),ci("color",lT(yt.textPrimary))]),fT=lo([Oi(.4),hi("notAllowed")]),hT=lo([ci("width","1px"),ci("align-self","stretch"),ci("background",lT(yt.borderSubtle)),ci("margin","2px 4px")]),pT=lo([pi("flex"),ui("center"),ci("gap",lT(_t.xs)),ci("padding","var("+_t.xs+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]),gT=lo([mi(1),ci("background",lT(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",lT(xt.sm)),ci("color",lT(yt.textPrimary)),ci("font-family","inherit"),ci("font-size",lT(bt.sizeSm)),ci("padding","3px 6px"),ci("outline","none"),Ji([ci("border-color",lT(yt.brand))])]);let mT={bold:!1,italic:!1,code:!1},vT=function(e){let t=e.disabled,n=e.formats,a=e.editor,l=void 0!==t&&t,c=s(()=>{}),u=c[1],d=c[0],f=(e,t)=>{a.dispatchCommand(e,t)},h=e=>{a.update(()=>{let t=t_();null!=t&&Ty(t)&&Xw(t,e)})},p=(e,t,n,r)=>{let o=void 0!==n&&n;return i("button",{children:e,"aria-label":t,"aria-pressed":o?"true":"false",className:l?uT+" "+fT:o?uT+" "+dT:uT,title:t,disabled:l,type:"button",onClick:e=>r(),onMouseDown:e=>{e.preventDefault()}})},g=e=>{let t=e.trim();a.update(()=>{!function(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,o=void 0===t.rel?"noreferrer":t.rel,s=t_();if(null===s||!Ty(s)&&!Dy(s))return;if(Dy(s)){const e=s.getNodes();if(0===e.length)return;return void e.forEach(e=>{if(null===n){const t=bS(e,e=>!sA(e)&&rA(e));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=bS(e,e=>!sA(e)&&rA(e));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==o&&t.setRel(o);else{const t=nA(n,{rel:o,target:r});e.insertBefore(t),t.append(e)}}})}if(s.isCollapsed()&&null===n)for(const u of s.getNodes()){const e=bS(u,e=>!sA(e)&&rA(e));return void(null!==e&&(e.getParentOrThrow().splice(e.getIndexWithinParent(),0,e.getChildren()),e.remove()))}const a=s.extract();if(null===n){const e=new Set;return void a.forEach(t=>{const n=bS(t,e=>!sA(e)&&rA(e));if(null!==n){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||H_(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),o=r.filter(i);if(o.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();const s=r.findIndex(i),a=r.findLastIndex(i),l=0===s,c=a===r.length-1;if(l)o.forEach(t=>e.insertBefore(t));else if(c)for(let u=o.length-1;u>=0;u--)e.insertAfter(o[u]);else{for(let n=o.length-1;n>=0;n--)e.insertAfter(o[n]);const t=r.slice(a+1);if(t.length>0){const n=Rx(e);o[o.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}}(n,a),e.add(t)}})}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==o&&e.setRel(o),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=bS(e,rA);if(null!==t)return c(t)}!function(e){const t=t_();if(!Ty(t))return e();const n=fg(t),r=n.isBackward(),i=aA(n.anchor,r?-1:0),o=aA(n.focus,r?0:-1);if(e(),i||o){const e=t_();if(Ty(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(o){const e=o.getParent();e&&t.focus.set(e.getKey(),o.getIndexWithinParent()+(r?0:1),"element")}ex(fg(t))}}}(()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const s=bS(t,rA);if(s){c(s);continue}if(H_(t)){if(!t.isInline())continue;if(rA(t)){if(!(sA(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();rA(a)&&a.is(e)?a.append(t):(e=nA(n,{rel:o,target:r,title:i}),t.insertAfter(e),e.append(t))}})}(""===t?null:t)}),u(e=>{})};return r(o,{children:[r("div",{children:[p("B","Bold",n.bold,()=>f(Cm,"bold")),p("I","Italic",n.italic,()=>f(Cm,"italic")),p("</>","Inline code",n.code,()=>f(Cm,"code")),i("span",{className:hT}),p("H1","Heading 1",void 0,()=>h(()=>GA("h1"))),p("H2","Heading 2",void 0,()=>h(()=>GA("h2"))),p("¶","Paragraph",void 0,()=>h(()=>pb())),i("span",{className:hT}),p("•","Bulleted list",void 0,()=>f(CC,void 0)),p("1.","Numbered list",void 0,()=>f(AC,void 0)),p("“","Quote",void 0,()=>h(()=>zA())),p("🔗","Link",void 0,()=>u(e=>$(e)?void 0:"")),i("span",{className:hT}),p("↩","Undo",void 0,()=>f(Nm,void 0)),p("↪","Redo",void 0,()=>f(Tm,void 0))],"aria-label":"Formatting",className:cT,role:"toolbar"}),void 0!==d?r("div",{children:[i("input",{"aria-label":"Link URL",className:gT,autoFocus:!0,placeholder:"https://…",type:"url",value:d,onKeyDown:e=>{switch(e.key){case"Enter":return e.preventDefault(),g(d);case"Escape":return u(e=>{});default:return}},onChange:e=>{let t=e.target.value;u(e=>t)}}),p("Apply","Apply link",void 0,()=>g(d)),p("Remove","Remove link",void 0,()=>g(""))],className:pT}):null]})};let yT={contents:void 0};function _T(e){let t=function(){let e=yT.contents;if(void 0!==e)return D(e);let t=bb({namespace:"reventless-rich-text-probe",nodes:aT,onError:e=>{}});return yT.contents=T(t),t}(),n={contents:""};return t.update(()=>{oT(e,zN)},{discrete:!0}),t.read(()=>{n.contents=sT(zN)}),n.contents}function bT(e){return"var("+e+")"}let xT=lo([pi("flex"),gi("column"),ci("background",bT(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",bT(xt.sm)),ci("box-sizing","border-box"),ci("transition","border-color 120ms"),Gi({NAME:"percent",VAL:100}),Pi("hidden"),Xi([ci("border-color",bT(yt.brand))])]),ST=lo([ci("border-color",bT(yt.error)),Xi([ci("border-color",bT(yt.error))])]),wT=lo([pi("flex"),ui("center"),ci("gap","2px"),ci("justify-content","flex-end"),ci("padding","var("+_t.xs+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]);let ET=lo([ci("background",bT(yt.surfaceSubtle)),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),ci("color",bT(yt.textSecondary)),ci("font-size",bT(bt.sizeXs)),ci("line-height",bT(bt.lineHeightNormal)),ci("padding","var("+_t.xs+") var("+_t.sm+")")]),kT=lo([ji("relative"),pi("flex"),gi("column")]),CT=lo([ji("absolute"),ci("top","var("+_t.sm+")"),ci("left","var("+_t.sm+")"),ci("color",bT(yt.textDisabled)),ci("font-size",bT(bt.sizeSm)),ci("pointer-events","none"),ci("user-select","none")]);function AT(e){return lo([ci("color",bT(yt.textPrimary)),ci("font-size",bT(bt.sizeSm)),ci("line-height",bT(bt.lineHeightRelaxed)),ci("min-height",e),ci("outline","none"),ci("padding",bT(_t.sm)),ci("word-break","break-word"),ci("overflow-y","auto"),ci("tab-size","4")])}let NT=lo([ci("margin","0 0 var("+_t.sm+")")]),TT=lo([ci("font-size",bT(bt.sizeXl)),ci("font-weight",bT(bt.weightBold)),ci("line-height",bT(bt.lineHeightTight)),ci("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),RT=lo([ci("font-size",bT(bt.sizeLg)),ci("font-weight",bT(bt.weightBold)),ci("line-height",bT(bt.lineHeightTight)),ci("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),DT=lo([ci("font-size",bT(bt.sizeMd)),ci("font-weight",bT(bt.weightBold)),ci("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),IT=lo([ci("border-left","3px solid var("+yt.border+")"),ci("color",bT(yt.textSecondary)),ci("margin","var("+_t.xs+") 0"),ci("padding-left",bT(_t.md))]),FT=lo([ci("margin","var("+_t.xs+") 0"),ci("padding-left","1.5em")]),OT=lo([ci("margin","2px 0")]),PT=lo([ci("color",bT(yt.brand)),ci("text-decoration","underline")]),MT=lo([ci("font-weight",bT(bt.weightBold))]),LT=lo([ci("font-style","italic")]),zT=lo([ci("text-decoration","line-through")]),jT=lo([ci("background",bT(yt.surfaceSubtle)),ci("border-radius",bT(xt.sm)),ci("font-family",bT(bt.fontFamilyMono)),ci("font-size","0.9em"),ci("padding","1px 4px")]),UT=lo([ci("background",bT(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",bT(xt.md)),ci("display","block"),ci("font-family",bT(bt.fontFamilyMono)),ci("font-size","0.9em"),ci("margin","var("+_t.xs+") 0"),ci("padding",bT(_t.sm)),ci("white-space","pre-wrap")]);function BT(e){return lo([ci("background","transparent"),ci("border","none"),ci("color",bT(yt.textPrimary)),ci("font-family",bT(bt.fontFamilyMono)),ci("font-size",bT(bt.sizeSm)),ci("line-height",bT(bt.lineHeightNormal)),ci("min-height",e),ci("outline","none"),ci("padding",bT(_t.sm)),ci("resize","vertical"),ci("box-sizing","border-box"),Gi({NAME:"percent",VAL:100})])}let $T=Object.fromEntries([["paragraph",NT],["quote",IT],["link",PT],["code",UT],["heading",Object.fromEntries([["h1",TT],["h2",RT],["h3",DT]])],["list",Object.fromEntries([["ul",FT],["ol",FT],["listitem",OT]])],["text",Object.fromEntries([["bold",MT],["italic",LT],["strikethrough",zT],["code",jT]])]]);let qT=function(e){let t=e.readOnly,n=e.hasError,o=e.minHeight,l=e.placeholder,c=e.onBlur,u=e.onChange,d=e.value,f=void 0!==c?c:()=>{},g=void 0!==l?l:"Write markdown…",m=void 0!==o?o:"180px",v=void 0!==n&&n,y=void 0!==t&&t,_=s(()=>"Rich"),b=_[1],x=_[0],S=s(()=>mT),w=S[1],E=s(()=>""===d.trim()),k=E[1],C=s(()=>!1),A=C[1],N=h(null),R=h(d),D=h(d),I=h(!1),F=h(u);F.current=u;let O=p(()=>bb({namespace:"reventless-rich-text",nodes:aT,onError:e=>{console.error("[RichTextEditor] Lexical error — the document may be incomplete:",e)},theme:$T}),[]),P=e=>{D.current=e,R.current=e,I.current=!0,A(t=>function(e){return""!==e.trim()&&e.trimEnd()!==_T(e).trimEnd()}(e)),O.update(()=>{oT(e,zN)})},M=()=>{let e=(()=>{let e={contents:""};return O.read(()=>{e.contents=sT(zN)}),e.contents})();return k(t=>""===e.trim()),w(e=>{let t={contents:mT};return O.read(()=>{let e=t_();null!=e&&Ty(e)&&(t.contents={bold:e.hasFormat("bold"),italic:e.hasFormat("italic"),code:e.hasFormat("code")})}),t.contents}),I.current?(I.current=!1,void(R.current=e)):e!==R.current?(R.current=e,F.current(e)):void 0},L="Rich"===x;a(()=>{if(!L)return;O.setRootElement(N.current);let e=Gw(nN(O),TC(O),function(e,t,n,r=Date.now,i,o=null){const s=RC(e,n,r);return Gw(e.registerCommand(Nm,()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,o=r.pop();null!==i&&(n.push(i),e.dispatchCommand(nv,!0)),0===r.length&&e.dispatchCommand(rv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:$v})}}(e,t),!0),0),e.registerCommand(Tm,()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(rv,!0));const o=n.pop();0===n.length&&e.dispatchCommand(nv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:$v})}}(e,t),!0),0),e.registerCommand(ev,()=>(DC(t),!1),0),e.registerCommand(tv,()=>(DC(t),e.dispatchCommand(nv,!1),e.dispatchCommand(rv,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:a,tags:l})=>{const c=t.current,u=t.redoStack,d=t.undoStack,f=null===c?null:c.editorState;if(null!==c&&n===f)return;const h=s(r,n,c,i,a,l);if(1===h){if(0!==u.length&&(t.redoStack=[],e.dispatchCommand(nv,!1)),null!==c){d.push({...c});const t="number"==typeof o||null===o?o:o.peek();null!==t&&d.length>t&&d.splice(0,d.length-t),e.dispatchCommand(rv,!0)}}else if(2===h)return;t.current={editor:e,editorState:n}}))}(O,{current:null,redoStack:[],undoStack:[]},300),function(e,t=zN){const n=iN(t),r=n.element.filter(e=>e.triggerOnEnter),i=rN(n.textFormat,({tag:e})=>e[e.length-1]),o=rN(n.textMatch,({trigger:e})=>e),s=new Set([" "]);for(const l of n.textFormat)s.add(l.tag.slice(-1));for(const l of n.textMatch)void 0!==l.trigger&&s.add(l.trigger);for(const l of t){const t=l.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=l.dependencies;for(const n of t)e.hasNode(n)||ZN(173,n.getType())}}const a=(e,t,r)=>!!(eT(e,t,r,n.element)||tT(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const o of i){if(!o.replace||!o.regExp)continue;const t=r.match(o.regExp);if(null===t)continue;const n=t.index||0,i=n+t[0].length;let s;return 0===n?[s]=e.splitText(i):[,s]=e.splitText(n,i),s.selectNext(0,0),o.replace(s,t),!0}return!1}(t,r,o)||function(e,t,n){const r=e.getTextContent(),i=t-1,o=r[i],s=n[o];if(!s)return!1;for(const a of s){const{tag:t}=a,n=t.length,s=i-n+1;if(n>1&&!iT(r,s,t,0,n))continue;if(" "===r[s-1])continue;const l=r[i+1];if(!1===a.intraword&&l&&!oN.test(l))continue;const c=e;let u=c,d=rT(r,s,t),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!lb(f);)if(yy(f)){if(f.hasFormat("code"))continue;const e=f.getTextContent();u=f,d=rT(e,e.length,t)}if(d<0)continue;if(u===c&&d+n===s)continue;const h=u.getTextContent();if(d>0&&h[d-1]===o)continue;const p=h[d-1];if(!1===a.intraword&&p&&!oN.test(p))continue;if(!a.format.includes("code")&&nT(u,d))continue;const g=c.getTextContent(),m=g.slice(0,s)+g.slice(i+1);c.setTextContent(m);const v=u===c?m:h;u.setTextContent(v.slice(0,d)+v.slice(d+n));const y=t_(),_=Yy();ex(_);const b=i-n*(u===c?2:1)+1;_.anchor.set(u.__key,d,"text"),_.focus.set(c.__key,b,"text");for(const e of a.format)_.formatText(e,yp[e]);_.anchor.set(_.focus.key,_.focus.offset,_.focus.type);for(const e of a.format)_.hasFormat(e)&&_.toggleFormat(e);return Ty(y)&&(_.format=y.format),!0}return!1}(t,r,i));return Gw(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Kv)||t.has($v))return;if(e.isComposing())return;const o=t.has(Qv),l=r.read(t_),c=i.read(t_);if(!Ty(c)||!Ty(l)||!l.isCollapsed()||l.is(c)&&!o)return;const u=l.anchor.key,d=l.anchor.offset,f=r._nodeMap.get(u);if(yy(f)&&n.has(u)&&(o||1===d||!(d>c.anchor.offset+1))){if(o){const e=r.read(()=>f.getTextContent())[d-1];if(!s.has(e))return}e.update(()=>{if(!HN(f))return;const e=f.getParent();null===e||jC(e)||a(e,f,l.anchor.offset)&&wx(qv)})}}),e.registerCommand(Lm,e=>{if(null!==e&&e.shiftKey)return!1;const t=t_();if(!Ty(t)||!t.isCollapsed())return!1;const i=t.anchor.offset,o=t.anchor.getNode();if(!yy(o)||!HN(o))return!1;const s=o.getParent();return null!==s&&!jC(s)&&!(i!==o.getTextContent().length||!tT(s,o,i,n.multilineElement,!0)&&!eT(s,o,i,r,!0)||(null!==e&&e.preventDefault(),0))},1))}(O,zN),O.registerUpdateListener(e=>M()));return P(d),()=>{e(),O.setRootElement(null)}},[L]),a(()=>{L&&d!==R.current&&d!==D.current&&P(d)},[d]),a(()=>{O.setEditable(!y)},[y]);let z,j=(e,t)=>{return i("button",{children:t,"aria-pressed":x===e?"true":"false",className:(n=x===e,lo([ci("background",n?bT(yt.surfaceSubtle):"transparent"),ci("border","1px solid "+(n?bT(yt.border):"transparent")),ci("border-radius",bT(xt.sm)),ci("color",bT(n?yt.textPrimary:yt.textSecondary)),ci("font-family","inherit"),ci("font-size",bT(bt.sizeXs)),ci("padding","2px var("+_t.sm+")"),hi("pointer")])),type:"button",onClick:t=>{if(b(t=>e),"Source"===e)return A(e=>!1)}});var n};return z="Rich"===x?r("div",{children:[i("div",{ref:T(N),"aria-label":"Rich text editor","aria-multiline":!0,className:AT(m),contentEditable:!y,role:"textbox",spellCheck:!0,onBlur:e=>f(),suppressContentEditableWarning:!0}),E[0]&&!y?i("div",{children:g,className:CT}):null],className:kT}):i("textarea",{"aria-label":"Markdown source",className:BT(m),spellCheck:!1,placeholder:g,readOnly:y,value:d,onBlur:e=>f(),onChange:e=>{let t=e.target.value;R.current=t,D.current=t,u(t)}}),r("div",{children:[r("div",{children:[j("Rich","Rich text"),j("Source","Markdown")],className:wT}),!y&&L?i(vT,{editor:O,formats:S[0]}):null,C[0]&&L?i("div",{children:"Editing as rich text will reformat this document — switch to Markdown to keep it as written.",className:ET}):null,z],className:v?xT+" "+ST:xT})};function GT(e){return"var("+e+")"}let VT=lo([pi("inlineFlex"),ui("center"),bi("center"),ci("background",GT(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("color",GT(yt.textDisabled))]),KT=co([VT,lo([ci("width","24px"),ci("height","24px"),ci("border-radius",GT(xt.sm)),ci("font-size",GT(bt.sizeSm)),ci("vertical-align","middle")])]),WT=co([VT,lo([ci("border-radius",GT(xt.md)),ci("font-size",GT(bt.sizeSm))])]),HT=co([WT,lo([gi("column"),ci("gap",GT(_t.xs)),ci("aspect-ratio","4 / 3")])]),JT=co([WT,lo([gi("row"),ci("gap",GT(_t.sm)),ci("padding","var("+_t.sm+") var("+_t.md+")")])]),XT=lo([ci("width","240px"),ci("max-width","100%")]),QT=lo([ci("width","100%")]),YT=lo([ci("width","100%"),ci("height","100%"),ci("aspect-ratio","auto")]),ZT=lo([ci("font-size","20px"),ci("line-height","1")]),eR=lo([ci("position","absolute"),ci("width","1px"),ci("height","1px"),ci("padding","0"),ci("margin","-1px"),Pi("hidden"),ci("clip","rect(0, 0, 0, 0)"),ci("white-space","nowrap"),ci("border","0")]);function tR(e){return"Media"===e?"⬚":"▤"}function nR(e){switch(e){case"Thumb":case"Detail":return XT;case"Tile":return QT;case"Fill":return YT}}let rR=function(e){let t,n=e.size,o=e.kind,s=void 0!==o?o:"Media",a=void 0!==n?n:"Detail",l=U(e.label,"Media"===s?"No image":"No file");return t="Media"===s?HT:JT,"Media"===s?"Thumb"===a?i("span",{children:tR(s),"aria-label":l,className:KT,role:"img",title:l}):r("span",{children:[i("span",{children:tR(s),"aria-hidden":!0,className:ZT}),l],"aria-label":l,className:co([t,nR(a)]),role:"img"}):r("span","Thumb"===a?{children:[i("span",{children:tR(s),"aria-hidden":!0}),i("span",{children:l,className:eR})],className:KT,title:l}:{children:[i("span",{children:tR(s),"aria-hidden":!0,className:ZT}),l],className:co([t,nR(a)])})};function iR(e){return"var("+e+")"}let oR=lo([ci("color",iR(yt.brand)),ci("text-decoration","none"),Qi([ci("text-decoration","underline")])]),sR=lo([pi("inlineBlock"),ci("width","12px"),ci("height","12px"),ci("border-radius","3px"),ci("border","1px solid var("+yt.border+")"),ci("vertical-align","-1px")]),aR=lo([pi("inlineFlex"),ui("center"),ci("gap","6px")]),lR=lo([ci("height","24px"),ci("width","24px"),ci("object-fit","cover"),ci("border-radius",iR(xt.sm)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("vertical-align","middle")]),cR=lo([ci("max-height","160px"),ci("max-width","240px"),ci("object-fit","cover"),ci("border-radius",iR(xt.md)),ci("border","1px solid var("+yt.borderSubtle+")"),hi("zoomIn")]),uR=lo([ci("color",iR(yt.error)),ci("font-size",iR(bt.sizeXs)),ci("font-weight",iR(bt.weightMedium)),ci("white-space","nowrap"),Ci(eo(6))]),dR=lo([pi("inlineBlock"),ci("background",iR(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius","3px"),ci("color",iR(yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("font-weight",iR(bt.weightMedium)),ci("letter-spacing","0.03em"),ci("padding","1px 4px"),ci("line-height","1.2")]),fR=lo([ci("color",iR(yt.textSecondary))]),hR=lo([ci("color",iR(yt.warning)),ci("font-weight",iR(bt.weightMedium))]),pR=lo([ci("color",iR(yt.textSecondary)),ci("font-weight",iR(bt.weightNormal))]),gR=lo([pi("inlineBlock"),ci("background",iR(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius","3px"),ci("color",iR(yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("padding","1px 4px"),ci("line-height","1.2")]),mR=lo([pi("inlineBlock"),ci("background",iR(yt.surfaceSubtle)),ci("border-radius",iR(xt.full)),ci("width","64px"),ci("height","6px"),Pi("hidden")]);function vR(e){return lo([ci("background",iR(yt.brand)),ci("border-radius",iR(xt.full)),ci("height","100%"),ci("width",e.toString()+"%")])}let yR=lo([ci("color",iR(yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("font-variant-numeric","tabular-nums")]),_R=lo([ci("width","220px"),ci("max-width","100%")]),bR=lo([pi("flex"),gi("column"),ci("gap","1px"),ci("line-height","1.35")]),xR=lo([ci("background","none"),ci("border","none"),ci("padding","0"),hi("zoomIn")]),SR=lo([pi("inlineFlex"),ci("background","none"),ci("border","none"),ci("padding","0"),ci("line-height","0"),ci("max-width","100%"),hi("pointer"),Qi([ci("opacity","0.75")])]),wR=lo([pi("flex"),gi("column"),ci("gap",iR(_t.xs)),ci("width","100%")]),ER=lo([ci("background","none"),ci("border","none"),ci("padding","0"),ci("color",iR(yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("text-decoration","underline"),hi("pointer"),Qi([ci("color",iR(yt.brand))])]),kR=lo([pi("flex"),gi("column"),ui("flexStart"),ci("gap","6px")]),CR=lo([ci("color",iR(yt.textSecondary)),ci("font-family",iR(bt.fontFamilyMono)),ci("font-size",iR(bt.sizeXs))]),AR=lo([pi("inlineBlock"),ci("background","#ffffff"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",iR(xt.md)),ci("padding","4px"),ci("line-height","0")]),NR=lo([ci("display","block"),ci("max-width","260px"),ci("height","auto")]),TR=lo([pi("flex"),ui("center"),ci("gap",iR(_t.xs))]);function RR(e){return lo([ci("background",iR(yt.surface)),ci("border","1px solid var("+(e?yt.error:yt.border)+")"),ci("border-radius",iR(xt.sm)),ci("color",iR(yt.textPrimary)),ci("font-family","inherit"),ci("font-size",iR(bt.sizeSm)),ci("padding","6px 8px")])}let DR=lo([ci("flex","1 1 auto"),ci("min-width","0")]),IR=lo([ci("flex","0 0 auto")]),FR=lo([ci("color",iR(yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("font-variant-numeric","tabular-nums")]),OR=lo([pi("inlineFlex"),ui("center"),ci("gap","6px")]);function PR(e){return lo([ci("color",iR(e?yt.error:yt.textSecondary)),ci("font-size",iR(bt.sizeXs)),ci("font-variant-numeric","tabular-nums")])}let MR=lo([pi("flex"),gi("column"),ci("gap","4px")]),LR=lo([pi("flex"),ui("center"),ci("gap",iR(_t.xs))]);function zR(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function jR(e){let t=e<0,n=(t?-e:e).toFixed(2).split("."),r=U(n[0],"0"),i=U(n[1],"00"),o=e=>{let t=e.length;return t<=3?e:o(e.slice(0,t-3|0))+","+e.slice(t-3|0)};return(t?"-":"")+o(r)+"."+i}function UR(e){if(function(e){return/^[A-Z]{3}$/.test(e)}(e))try{return T(new Intl.NumberFormat("en-US",{style:"currency",currency:e}))}catch(t){return}}function BR(e,t){let n=UR(t);if(void 0===n)return jR(e)+" "+t;let r=D(n),i=r.resolvedOptions().maximumFractionDigits;return r.format(e/Math.pow(10,i))}function $R(e){return j(ft(e),e=>{let t=j(Je(e,"amount"),dt),n=j(Je(e,"currency"),ut);if(void 0!==t&&void 0!==n)return[t,n]})}function qR(e){let t=e.toFixed(2).replace(/\.?0+$/,"");return(""===t||"-"===t?"0":t)+"%"}function GR(e){let t=["B","KB","MB","GB","TB","PB"],n=((e,n)=>{for(;;){if(!(e>=1024&&n<(t.length-1|0)))return[e,n];n=n+1|0,e=e/1024}})(e<0?0:e,0),r=n[1],i=n[0];return(0===r?Math.round(i).toString():(Math.round(10*i)/10).toString())+" "+t[r]}function VR(e){let t=e<0?0:0|Math.floor(e),n=t/86400|0,r=t%86400/3600|0,i=t%3600/60|0,o=t%60;return n>0?n.toString()+"d "+r.toString()+"h":r>0?r.toString()+"h "+i.toString()+"m":i>0?i.toString()+"m "+o.toString()+"s":o.toString()+"s"}function KR(e){return j(ft(e),e=>{let t=t=>j(j(Je(e,t),ut),e=>""===e?void 0:e),n=t("start"),r=t("end");if(void 0!==n&&void 0!==r)return[n,r]})}function WR(e,t){let n=fc(e),r=fc(t);return void 0!==n&&void 0!==r?r<n?"Ends before it starts":void 0:"Not a date-time"}function HR(e,t){let n=fc(e),r=fc(t);if(void 0!==n&&void 0!==r&&r>=n)return VR((r-n)/1e3)}function JR(e){let t,n=function(e,t){return ge(t,e,(e,t)=>U(e.split(t)[0],e))}(e,["?","#"]),r=n.split("/").filter(e=>""!==e),i=U(r[r.length-1|0],"");try{t=decodeURIComponent(i)}catch(o){t=i}return""===t?"file":t}function XR(e){return/^[A-Za-z]{2}$/.test(e)}function QR(e){if(XR(e))return e.toUpperCase().split("").map(e=>U(e.codePointAt(0),65)+127397|0).map(e=>String.fromCodePoint(e)).join("")}let YR={contents:void 0};function ZR(e){if(!XR(e))return e;let t=function(){let e,t=YR.contents;if(void 0!==t)return D(t);try{e=T(new Intl.DisplayNames(["en"],{type:"region"}))}catch(n){e=void 0}return YR.contents=T(e),e}();if(void 0===t)return e;try{let n=D(t).of(e.toUpperCase());return""===n?e:n}catch(n){return e}}let eD=["street","streetaddress","line1","addressline1","address1"],tD=["line2","addressline2","address2","apartment","unit","suite"],nD=["postalcode","zip","zipcode","postcode"],rD=["city","town","locality"],iD=["state","region","province","county"],oD=["country","countrycode"];function sD(e){let t=ct(e);if("object"==typeof t)switch(t.TAG){case"JSONString":let e=t._0.split("\n").map(e=>e.trim()).filter(e=>""!==e);return 0===e.length?void 0:e;case"JSONObject":let n=Xe(t._0),r=e=>j(n.find(t=>e.includes(t[0].toLowerCase())),e=>function(e){let t=ct(e);if("object"==typeof t)switch(t.TAG){case"JSONString":let e=t._0;return""===e?void 0:e;case"JSONNumber":return t._0.toString();default:return}}(e[1])),i=r(nD),o=r(rD),s=void 0!==i?void 0!==o?i+" "+o:i:void 0!==o?o:void 0,a=me([r(eD),r(tD),s,r(iD),r(oD)],e=>e).map(e=>e.trim()).filter(e=>""!==e);return 0===a.length?void 0:a;default:return}}function aD(e){let t=QR(e);return void 0!==t?t+" "+ZR(e):e}function lD(e){let t=e.toFixed(5).replace(/\.?0+$/,"");return""===t||"-"===t?"0":t}function cD(e){return L(z(Na(e,"maximum"),e=>0|e),5,e=>e<=0?5:e)}function uD(e,t){let n=Na(e,"maximum");return void 0!==n&&n>0&&n<=1?t/n*100:t}let dD={};function fD(e,t){dD[ta(e)]=t}function hD(e,t){return j(Ma(e,t),e=>Je(dD,ta(e.semantic)))}function pD(e,t,n){return j(hD(e,t),r=>r.cell(e,t,n))}function gD(e,t,n){return j(hD(e,t),r=>r.detail(e,t,n))}function mD(e,t){return j(La(e,t),e=>Je(dD,ta(e.semantic)))}function vD(e){e.stopPropagation()}function yD(e,t,n){return i("a",n?{children:t,className:oR,href:e,rel:"noopener noreferrer",target:"_blank",onClick:vD}:{children:t,className:oR,href:e,onClick:vD})}function _D(e){return j(ut(e),e=>""===e?void 0:e)}function bD(e){let t=(t,n,r)=>z(_D(r),e);return{cell:t,detail:t}}function xD(e){let t=(t,n,r)=>z(dt(r),t=>e(t));return{cell:t,detail:t}}function SD(e){let t=e.size,n=e.kind,r=function(e){return j(d(Qs),t=>t(e))}(e.field);if(void 0===r)return i(rR,{kind:n,size:t});let o=function(e){return"Media"===e?["Add an image","Add image"]:["Add a file","Add file"]}(n);return i("button",{children:i(rR,{kind:n,size:t,label:o[1]}),className:SR,title:o[0],type:"button",onClick:e=>{e.stopPropagation(),r()}})}function wD(e){let t=e.alt,n=e.src,a=s(()=>!1);if(void 0===n)return i(SD,{field:e.field,kind:"Media",size:"Detail"});let l=a[1];return r(o,{children:[i("button",{children:i("img",{className:cR,alt:t,src:n}),className:xR,title:"Click to enlarge",onClick:e=>{e.stopPropagation(),l(e=>!0)}}),a[0]?i(Jl,{slides:[{key:n,src:n,title:t}],index:0,onIndexChange:e=>{},onClose:()=>l(e=>!1)}):null]})}function ED(e){let t=ct(e);if("object"!=typeof t)return"JSONNull"===t?T(void 0):void 0;if("JSONString"!==t.TAG)return;let n=t._0;return T(""===n?void 0:n)}function kD(e,t,n){return j(_D(n),e=>{return function(e){return!!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)||/^[0-9A-Za-z_-]{16,}$/.test(e)}(e)?void 0:r("span",{children:[i(Wo,{name:t=e,size:"Small"}),t],className:aR});var t})}function CD(e,t){let n=We(e),o=function(e){let t=e.split("."),n=t.length;if(0===n||1===n)return;let r=U(t[n-1|0],"");return/^[A-Za-z0-9]{1,5}$/.test(r)?r.toUpperCase():void 0}(t);return r("span",{children:[void 0!==o?i("span",{children:o,className:dR}):null,i("a",{children:t,className:oR,download:"",href:n,rel:"noopener noreferrer",target:"_blank",onClick:vD})],className:aR})}function AD(e){let t=e.name,n=e.href,o=s(()=>!1),a=o[1],l=o[0];return r("span",{children:[r("span",{children:[CD(n,t),yc(n)?i("button",{children:l?"Hide preview":"Preview","aria-expanded":l,className:ER,type:"button",onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null],className:aR}),l?i(_c,{src:We(n),title:t,height:"60vh"}):null],className:wR})}function ND(e,t,n){return z($R(n),e=>{return t=e[0],n=e[1],i("span",{children:BR(t,n),className:yR});var t,n})}function TD(e){let t=e.hasError,n=e.onBlur,o=e.onChange,s=e.value,a=U(j(_a(e.propSchema).find(e=>"currency"===e[0].toLowerCase()),e=>Us(e[1])),[]);let l;if(""===s)l=void 0;else try{l=$R(JSON.parse(s))}catch(p){l=void 0}let c=void 0!==l?[l[0].toString(),l[1]]:["",U(a[0],"")],u=c[1],d=c[0],f=(e,t)=>{let n=ea(e);o(void 0!==n&&""!==t?JSON.stringify(Ye([["amount",n],["currency",t]])):"")},h=ea(d);return r("span",{children:[r("span",{children:[i("input",{"aria-label":"Amount in minor units",className:RR(t)+" "+DR,step:1,type:"number",value:d,onBlur:e=>n(),onChange:e=>f(e.target.value,u)}),i("span",{children:void 0!==h&&""!==u?"= "+BR(h,u):"minor units",className:FR})],className:DR}),0===a.length?i("input",{"aria-label":"Currency",className:RR(t)+" "+IR,placeholder:"EUR",value:u,onBlur:e=>n(),onChange:e=>f(d,e.target.value)}):i("select",{children:a.map(e=>i("option",{children:e,value:e},e)),"aria-label":"Currency",className:RR(t)+" "+IR,value:u,onBlur:e=>n(),onChange:e=>f(d,e.target.value)})],className:TR})}function RD(e,t,n){return z(KR(n),e=>function(e,t){let n=WR(e,t),o=HR(e,t),s=void 0!==n?n:void 0!==o?o:"";return r("span",{children:[U(vs(e),e)+" → "+U(vs(t),t),""===s?null:i("span",{children:s,className:PR($(n))})],className:OR})}(e[0],e[1]))}function DD(e){if(""===e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t.toISOString()}function ID(e){let t=gs(e);return t===e?"":t.slice(0,10)+"T"+t.slice(11,16)}function FD(e){let t,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value;if(""===a)t=void 0;else try{t=KR(JSON.parse(a))}catch(g){t=void 0}let l,c=void 0!==t?[ID(t[0]),ID(t[1])]:["",""],u=c[1],d=c[0],f=(e,t)=>{let n=DD(e),r=DD(t);s(void 0!==n&&void 0!==r?JSON.stringify(Ye([["start",n],["end",r]])):"")},h=DD(d),p=DD(u);if(void 0!==h&&void 0!==p){let e=WR(h,p);l=void 0!==e?[e,!0]:[U(HR(h,p),""),!1]}else l=["start and end",!1];return r("span",{children:[r("span",{children:[i("input",{"aria-label":"Start",className:RR(n),type:"datetime-local",value:d,onBlur:e=>o(),onChange:e=>f(e.target.value,u)}),i("span",{children:"→","aria-hidden":!0}),i("input",{"aria-label":"End",className:RR(n),type:"datetime-local",value:u,onBlur:e=>o(),onChange:e=>f(d,e.target.value)})],className:LR}),i("span",{children:l[0],className:PR(l[1])})],className:MR})}function OD(e){let t=QR(e);return void 0!==t?r("span",{children:[i("span",{children:t,"aria-hidden":!0}),ZR(e)],className:aR}):e}function PD(e,t,n){return z(_D(n),OD)}function MD(e,t,n){return z(function(e){return j(ft(e),e=>{let t=t=>j(Xe(e).find(e=>t(e[0].toLowerCase())),e=>dt(e[1])),n=t(Ia),r=t(Fa);if(void 0!==n&&void 0!==r)return[n,r]})}(n),e=>lD(e[0])+", "+lD(e[1]))}fD("Email",bD(e=>yD("mailto:"+e,e,!1))),fD("Phone",bD(e=>yD("tel:"+e,e,!1))),fD("Url",{cell:(e,t,n)=>z(_D(n),e=>yD(e,zR(e,40),!0)),detail:(e,t,n)=>z(_D(n),e=>yD(e,e,!0))}),fD("Currency",xD(jR)),fD("Percent",xD(qR)),fD("Bytes",xD(GR)),fD("Duration",xD(VR)),fD("Color",bD(e=>r("span",{children:[i("span",{className:sR,style:{background:e}}),e],className:aR}))),fD("Image",{cell:(e,t,n)=>z(ED(n),t=>void 0!==t?i("img",{className:lR,alt:e,src:We(t),onClick:vD}):i(SD,{field:e,kind:"Media",size:"Thumb"})),detail:(e,t,n)=>z(ED(n),t=>i(wD,{src:z(t,We),alt:e,field:e}))}),fD("UserRef",{cell:kD,detail:kD}),fD("Markdown",{cell:(e,t,n)=>z(_D(n),e=>zR(function(e){return e.replace(/```[^\n]*\n?/g,"").replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/^>\s?/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/\s+/g," ").trim()}(e),80)),detail:(e,t,n)=>z(_D(n),e=>i(uh,{source:e})),input:(e,t,n,r,o,s,a)=>i(qT,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&function(e){return""===e.trim()}(n))return"Required"}}),fD("Rating",{cell:(e,t,n)=>z(dt(n),e=>i(Tc,{value:e,max:cD(t)})),detail:(e,t,n)=>z(dt(n),e=>i(Tc,{value:e,max:cD(t),size:"Medium",showValue:!0})),input:(e,t,n,r,o,s,a)=>i(Tc,{value:U(ea(n),0),max:cD(t),size:"Medium",showValue:!0,onChange:e=>r(e<=0?"":e.toString()),onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i=ea(n);if(void 0===i)return"Invalid rating";let o=cD(t);return i<0||i>o?"Must be between 0 and "+o.toString():void 0}}),fD("Progress",{cell:(e,t,n)=>z(dt(n),e=>{let n=function(e){return e<0?0:e>100?100:e}(uD(t,e));return r("span",{children:[i("span",{children:i("span",{className:vR(n)}),className:mR}),i("span",{children:Math.round(n).toString()+"%",className:yR})],className:aR})}),detail:(e,t,n)=>z(dt(n),e=>i("div",{children:i(Lc,{value:uD(t,e)}),className:_R}))}),fD("FileUrl",{cell:(e,t,n)=>z(_D(n),e=>CD(e,zR(JR(e),40))),detail:(e,t,n)=>z(_D(n),e=>i(AD,{href:e,name:JR(e)}))}),fD("File",{cell:(e,t,n)=>z(ED(n),t=>void 0!==t?CD(t,zR(JR(t),40)):i(SD,{field:e,kind:"Document",size:"Thumb"})),detail:(e,t,n)=>z(ED(n),t=>void 0!==t?i(AD,{href:t,name:JR(t)}):i(SD,{field:e,kind:"Document",size:"Detail"}))}),fD("Money",{cell:ND,detail:ND,input:(e,t,n,r,o,s,a)=>i(TD,{propSchema:t,value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i;try{i=JSON.parse(n)}catch(a){i=null}let o=$R(i);if(void 0===o)return"Invalid amount";let s=o[0];return s!==Math.trunc(s)?"An amount is a whole number of minor units":void 0}}),fD("DateRange",{cell:RD,detail:RD,input:(e,t,n,r,o,s,a)=>i(FD,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(""===n)return r?"Required":void 0;let i;try{i=JSON.parse(n)}catch(s){i=null}let o=KR(i);return void 0!==o?WR(o[0],o[1]):"Invalid range"}}),fD("Country",{cell:PD,detail:PD}),fD("Address",{cell:(e,t,n)=>z(function(e){return z(sD(e),e=>e.map(e=>XR(e)?ZR(e):e).join(", "))}(n),e=>zR(e,60)),detail:(e,t,n)=>z(sD(n),e=>i("span",{children:e.map((e,t)=>i("span",{children:aD(e)},t.toString())),className:bR}))});let LD={cell:MD,detail:MD};fD("GeoPoint",LD);let zD="Located — this query selected only which arm the value is in, not the coordinates";function jD(e){let t=j(Ds(e).channel,e=>function(e){return L(Je(zc,e),Bc,e=>e.constraints)}(e).maxLength),n=function(e){return z(j(j(ft(e),e=>Je(e,"maxLength")),dt),e=>0|e)}(e);return void 0!==t?void 0!==n?t<n?t:n:t:n}function UD(e){return"var("+e+")"}fD("Geolocation",{cell:function(e,t,n){return z(ga(n),e=>{switch(e.TAG){case"Pending":return i("span",{children:"Locating…",className:fR});case"Located":let t=ma(e);return void 0!==t?lD(t[0])+", "+lD(t[1]):i("span",{children:"Located",className:gR,title:zD});case"Unresolvable":return i("span",{children:"Not located",className:hR,title:U(va(e),"No reason given")})}})},detail:function(e,t,n){return z(ga(n),e=>{switch(e.TAG){case"Pending":let t=function(e){switch(e.TAG){case"Pending":let t=e.requestedFor;return void 0!==t?t:void 0;case"Located":case"Unresolvable":return}}(e);return r("span",{children:["Locating…",void 0!==t?i("span",{children:" "+t,className:pR}):null],className:fR});case"Located":let n=ma(e);return void 0!==n?lD(n[0])+", "+lD(n[1]):i("span",{children:"Located",className:gR,title:zD});case"Unresolvable":let o=va(e);return r("span",{children:["Not located",void 0!==o?i("span",{children:" "+o,className:pR}):null],className:hR})}})}}),fD("ChannelText",{cell:(e,t,n)=>z(_D(n),e=>{let n=j(jD(t),t=>{if(fh(e)>t)return fh(e)-t|0});return r("span",{children:[zR(e,80),void 0!==n?i("span",{children:n.toString()+" over",className:uR}):null]})}),detail:(e,t,n)=>{let r=_D(n),o=Ds(t).channel;if(void 0!==r&&void 0!==o)return i(Kh,{channelId:o,message:{body:r}})},input:(e,t,n,r,o,s,a)=>{let l=j(Ds(t).channel,Uc);return i(Rh,{value:n,onChange:r,onBlur:o,maxLength:jD(t),channelLabel:z(l,e=>e.label),hasError:a,note:j(l,e=>e.constraints.note),name:e})},validateInput:(e,t,n,r)=>r&&""===n?"Required":j(jD(t),e=>{let t=fh(n);if(t>e)return Nh(t-e|0)+" over the "+e.toString()+"-character limit"})}),fD("Qr",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(_D(n),e=>r("span",{children:[i(Nl,{value:e}),i("span",{children:e,className:CR})],className:kR}))}),fD("Barcode",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(_D(n),e=>r("span",{children:[i(Ml,{value:e}),i("span",{children:e,className:CR})],className:kR}))}),fD("Signature",{cell:(e,t,n)=>j(_D(n),e=>{if(eu(e))return i("span",{children:"✓ Signed",className:yR})}),detail:(e,t,n)=>j(_D(n),e=>{if(eu(e))return i("span",{children:i("img",{className:NR,alt:"Signature",src:tu(e)}),className:AR})}),input:(e,t,n,r,o,s,a)=>i(nu,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&""===n)return"Required"}});let BD=lo([pi("inlineFlex"),ui("center"),yi("wrap"),ci("gap","4px"),ci("font-size",UD(bt.sizeSm)),ci("min-width","0")]),$D=lo([ci("color",UD(yt.textDisabled)),ci("font-size",UD(bt.sizeXs))]),qD=lo([ci("color",UD(yt.brand)),ci("text-decoration","none"),Qi([ci("text-decoration","underline")])]),GD=lo([ci("color",UD(yt.textPrimary))]);let VD=function(e){let t=e.segments,n=ae();return i("span",{children:t.map((e,o)=>{let s=o===(t.length-1|0),a=e.href;return r(g,{children:[void 0!==a?i("a",{children:e.label,className:qD,href:a,onClick:e=>{if(!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button))return e.preventDefault(),e.stopPropagation(),n(a)}}):i("span",{children:e.label,className:GD}),s?null:i("span",{children:" › ",className:$D})]},o.toString()+":"+e.label)}),className:BD})};function KD(e){return j(j(ft(e),e=>Je(e,"type")),ut)}function WD(e){return j(j(ft(e),e=>Je(e,"format")),ut)}function HD(e){return $(j(j(ft(e),e=>Je(e,"properties")),ft))}function JD(e){let t=e.toLowerCase(),n=e.length,r=r=>{let i=r.length;if(n>i&&t.endsWith(r))return e.slice(0,n-i|0)},i=r("ids");return void 0!==i?i:r("id")}function XD(e,t,n){let r=Mt(t);if("compositeId"===e)return"KCompositeId";let i=It(r);if(void 0!==i)return{TAG:"KUnion",_0:i};let o=Us(r);if(void 0!==o)return{TAG:"KEnum",_0:o};let s=KD(r),a=0;if(void 0!==s)switch(s){case"array":let t=function(e){return j(ft(e),e=>Je(e,"items"))}(r);if(void 0===t)return"KArrayOfStrings";if(HD(t)||mt(KD(t),"object"))return{TAG:"KArrayOfObjects",_0:t};let n=JD(e);return void 0!==n?{TAG:"KArrayOfEntityIds",_0:n}:"KArrayOfStrings";case"boolean":return"KBoolean";case"integer":case"number":return"KNumber";case"object":return HD(r)?{TAG:"KNestedObject",_0:r}:"KString";default:a=1}else a=1;if(1===a){let t=WD(r),i=0;if(void 0!==t)switch(t){case"date":case"date-time":return"KDate";default:i=2}else i=2;if(2===i){if(n.isId)return"KString";let t=JD(e);return void 0!==t?{TAG:"KEntityId",_0:t}:"KString"}}}function QD(e,t,n){let r=Va(t,e);return void 0!==n&&void 0!==r&&n.pluginId===r.pluginId&&n.viewName===r.name}function YD(e,t,n){if("compositeId"===e||n.isId)return 0;if("id"===e)return 1;if(n.summary)return 2;if("object"!=typeof t)switch(t){case"KBoolean":return 7;case"KCompositeId":return 0;case"KDate":return 4;case"KNumber":return 8;case"KString":return 5;case"KArrayOfStrings":return 11}else switch(t.TAG){case"KEnum":return 6;case"KEntityId":return 9;case"KArrayOfEntityIds":return 10;case"KArrayOfObjects":return 12;case"KNestedObject":return 13;case"KUnion":return 14}}function ZD(e,t){if("object"!=typeof e)switch(e){case"KBoolean":return"80px";case"KCompositeId":return"260px";case"KNumber":return"100px";case"KString":return"id"===t?"220px":void 0;case"KDate":case"KArrayOfStrings":return"180px"}else switch(e.TAG){case"KEnum":return"140px";case"KEntityId":return"220px";case"KArrayOfEntityIds":return"260px";default:return"240px"}}function eI(e,t){let n=Ds(t),r=XD(e,t,n),i=U(j(j(ft(t),e=>Je(e,"title")),ut),at(e));return{key:e,label:i,kind:r,ann:n,propSchema:t,priority:YD(e,r,n),width:ZD(r,e)}}function tI(e,t,n,r,i,o){let s,a=void 0!==t?t:"List",l=void 0!==n?n:[],c=U(z(j(j(ft(e),e=>Je(e,"properties")),ft),Xe),[]),u=Fs(e),d="List"===a&&0!==u.length,f=P(B(i,za(e,void 0,void 0).labelField),e=>"id"!==e),h=me(c,e=>{let t,n=e[0],i=eI(n,e[1]),s=i.kind;if("object"!=typeof s)t=!1;else switch(s.TAG){case"KEntityId":case"KArrayOfEntityIds":t=QD(s._0,l,r);break;default:t=!1}let a=mt(n,o);if(function(e,t,n,r){return!t.hidden&&!function(e){switch(e){case"sortKey":case"subId":return!0;default:return!1}}(e)&&(function(e,t){return"id"===e||"compositeId"===e||t.isId}(e,t)?mt(r,e):!n||t.summary)}(n,i.ann,d,f)&&!t&&!a)return i});if(0===h.length){let t=e=>c.find(t=>t[0]===e);s=L(B(B(j(Os(e),t),t("compositeId")),t("id")),[],e=>[eI(e[0],e[1])])}else s=h;return s.toSorted((e,t)=>e.priority-t.priority|0)}function nI(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function rI(e){return i(xs,{variant:"Neutral",label:e,dot:!1})}function iI(e,t,n,r,i){let o=Va(n,e);return void 0===o||void 0!==i&&(i.pluginId===o.pluginId&&i.viewName===o.name)?[void 0,t]:[Ja(o.pluginId,o.name,t,[]),t]}function oI(e,t,n,r){let i=Va(n,e);return void 0!==i?t?tt(i.name):et(i.name):r}function sI(e,t,n){let r=e.kind;if("object"!=typeof r)return e.label;switch(r.TAG){case"KEntityId":let i=r._0;return QD(i,t,n)?e.label:oI(i,!1,t,e.label);case"KArrayOfEntityIds":let o=r._0;return QD(o,t,n)?e.label:oI(o,!0,t,e.label);default:return e.label}}function aI(e,t,n){if(void 0===n)return[t,!1];let r=n.lookupLabel(e,t);return void 0!==r?[r,!1]:[t,n.isMissing(e,t)]}function lI(e,t,n,o,s,a,l,c,u){let d=void 0!==u&&u,f=QD(t,o,l),h=U(c,ka(t)),p=e=>{let n,s,c=iI(t,e,o,0,l),u=c[1],d=f?[u,!1]:aI(t,u,a),p=d[0];if(void 0!==a){let e=a.retiredBadge;n=void 0===e||f?void 0:e(t,u)}else n=void 0;if(void 0!==a){let e=a.linkable;s=!(void 0!==e&&!f)||e(t,u)}else s=!0;let g=s?i(ls,{href:c[0],label:p,rawValue:u}):i("span",{children:p,title:p+" is not available to open"}),m=void 0!==n?r("span",{children:[g,n],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):g,v=h&&p!==u?r("span",{children:[i(Wo,{name:p,size:"Small"}),m],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):m;return d[1]?i("span",{children:v,style:{fontStyle:"italic",opacity:"0.55"},title:"Referenced "+t+" not found (id: "+u+")"}):v},g=ct(n);if("object"!=typeof g)return JSON.stringify(n);switch(g.TAG){case"JSONString":return p(g._0);case"JSONArray":let e=g._0,s=me(e,ut),c=s.length===e.length?(e=>{let n=me(e,e=>{let n=iI(t,e,o,0,l)[1],r=aI(t,n,a)[0];if(r!==n)return{name:r}});if(d&&h&&!f&&e.length>=2&&n.length===e.length)return i(Xs,{members:n,size:"Small"})})(s):void 0;return void 0!==c?c:i("span",{children:e.map((t,n)=>{let i=ct(t);return"object"!=typeof i||"JSONString"!==i.TAG?null:r("span",{children:[p(i._0),n<(e.length-1|0)?", ":null]},n.toString())})});default:return JSON.stringify(n)}}function cI(e,t,n){let r=ct(n);if("object"!=typeof r)switch(r){case"JSONFalse":return i(xs,{variant:"Neutral",label:"No",dot:!1});case"JSONTrue":return i(xs,{variant:"Success",label:"Yes",dot:!1});case"JSONNull":return"—"}else switch(r.TAG){case"JSONString":let i=r._0,o=_s(e,i);if(void 0===t)return void 0!==o?o:i;switch(t){case"date":case"date-time":return gs(i);default:return void 0!==o?o:i}case"JSONNumber":return r._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(n)}}function uI(e,t,n,o,s,a){let l=ft(t);if(void 0===l)return;let c=Je(l,"name");if(void 0!==c&&"JSONNull"!==ct(c))return cI("name",void 0,c);let u=tI(e,"Drill",n,a,void 0,void 0),d=me(u,e=>{let t,n=e.kind;if("object"!=typeof n)t="KArrayOfStrings"!==n;else switch(n.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":case"KUnion":t=!1;break;default:t=!0}let r=Je(l,e.key);if(!t)return;if(void 0===r)return;let i=ct(r);return"object"!=typeof i&&"JSONNull"===i?void 0:[e,r]});if(0===d.length)return;let f=d.slice(0,2),h=u.length-f.length|0,p=f.map((e,t)=>{let i,o=e[1],l=e[0],c=l.kind;if("object"!=typeof c)i=cI(l.key,"KDate"===c?WD(l.propSchema):void 0,o);else switch(c.TAG){case"KEnum":let e=ct(o);i="object"!=typeof e||"JSONString"!==e.TAG?cI(l.key,void 0,o):rI(e._0);break;case"KEntityId":i=lI(l.key,c._0,o,n,0,s,a,void 0,void 0);break;default:i=cI(l.key,void 0,o)}return r("span",{children:[t>0?" · ":null,i]},t.toString())}),g=h>0?i("span",{children:"+"+h.toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null;return r("span",{children:[p,g],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}})}function dI(e,t,n,o,s,a,l,c,u){let d=void 0!==s?s:ws,f=P(o,e=>"JSONNull"!==ct(e));if(void 0===f)return U(function(e,t){return pD(e,t,null)}(e,n),"—");let h=pD(e,n,f);if(void 0!==h)return h;if("object"!=typeof t)switch(t){case"KCompositeId":return function(e){let t=ct(e);if("object"!=typeof t)return JSON.stringify(e);if("JSONString"!==t.TAG)return JSON.stringify(e);let n=t._0.split("/").map(e=>({label:e,href:void 0}));return i(VD,{segments:n})}(f);case"KDate":return cI(e,WD(n),f);case"KBoolean":case"KNumber":return cI(e,void 0,f);case"KString":let t=ct(f);if("object"!=typeof t)return cI(e,void 0,f);if("JSONString"!==t.TAG)return cI(e,void 0,f);let r=t._0;return r.length>60?i("span",{children:nI(r,60),title:r}):cI(e,void 0,f);case"KArrayOfStrings":let o=U(z(ht(f),e=>me(e,ut)),[]);return i(Yo,{items:o})}else switch(t.TAG){case"KEnum":let n=ct(f);return"object"!=typeof n||"JSONString"!==n.TAG?cI(e,void 0,f):rI(n._0);case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":let o=t._0,s=U(ht(f),[]),h=s.length;if(d.collapsed){let e=s[0];return void 0!==e?fI(o,e,a,l,c,u):i(hs,{count:h,label:"items"})}let p=j(s[0],e=>uI(o,e,a,0,c,u));return void 0!==p?r("span",{children:[p,h>1?i("span",{children:"+"+(h-1|0).toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}}):i(hs,{count:h,label:"items"});case"KNestedObject":let g=t._0;if(d.collapsed)return fI(g,f,a,l,c,u);let m=uI(g,f,a,0,c,u);if(void 0!==m)return m;let v=U(z(ft(f),e=>Object.keys(e).length),0);return i(hs,{count:v,label:"fields"});case"KUnion":return function(e,t,n,i,o,s){let a=pa(t);if(void 0===a)return JSON.stringify(t);let l=a[1],c=a[0],u=Ot(e,c),d=L(u,c,e=>e.tag),f=U(j(u,e=>uI(Pt(e),l,n,0,o,s)),null);return r("span",{children:[rI(d),f],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}})}(t._0,f,a,0,c,u)}let p=L(Ma(e,n),!1,e=>"UserRef"===e.semantic);return lI(0,t._0,f,a,0,c,u,!!p||void 0,!0)}function fI(e,t,n,o,s,a){let l=U(ft(t),{}),c=tI(e,"Drill",n,a,void 0,void 0).filter(e=>{let t=e.kind;if("object"!=typeof t)return!0;switch(t.TAG){case"KArrayOfObjects":case"KNestedObject":return!1;default:return!0}});return i("div",{children:c.map(e=>r("div",{children:[i("span",{children:sI(e,n,a),style:{fontSize:"0.85em",minWidth:"80px",opacity:"0.55"}}),i("span",{children:dI(e.key,e.kind,e.propSchema,Je(l,e.key),e.ann,n,o,s,a)})],style:{display:"flex",alignItems:"baseline",gap:"6px"}},e.key)),style:{display:"flex",maxHeight:"120px",overflow:"auto",flexDirection:"column",gap:"2px"}})}function hI(e){if("object"!=typeof e)return"KArrayOfStrings"!==e;switch(e.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":case"KUnion":return!1;default:return!0}}function pI(e,t,n,o,s,a,l,c,u,d){let f=void 0!==s&&s,h=B(P(d,t=>e.some(e=>e.key===t)),z(e[0],e=>e.key));return e.map(e=>{let s=sI(e,t,l),d=L(Ma(e.key,e.propSchema),!1,e=>"Image"===e.semantic||"File"===e.semantic);return{key:e.key,label:s,render:s=>{let f=dI(e.key,e.kind,e.propSchema,o(s,e.key),e.ann,t,n,a,l),p=void 0!==c&&d?i(Zs,{fill:e=>c(s,e),children:f}):f;if(void 0===u)return p;if($(u.values)&&e.key===u.field){let e=qs(u,o(s,u.field));return void 0!==e?e:p}if(void 0!==u.values)return p;if(!mt(h,e.key))return p;let g=qs(u,o(s,u.field));return void 0!==g?r("span",{children:[p,g],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):p},sortable:f&&hI(e.kind),width:e.width}})}function gI(e){return(t,n)=>e(t,n).then(e=>e.data)}let mI=l(void 0),vI=l(void 0),yI={contents:void 0},_I=mI.Provider,bI=vI.Provider;let xI=function(e){let t=e.executeResult,n=e.execute,r=p(()=>void 0!==n?n:void 0!==t?gI(t):void console.error('AutoGraphQL.Provider: neither `execute` nor `executeResult` was supplied — every query below this provider will report "Not connected".'),[n,t]);return c(_I,{value:r,children:c(bI,{value:t,children:e.children})})};function SI(){return d(mI)}function wI(){return d(vI)}let EI={hasNextPage:!1,hasPreviousPage:!1,startCursor:void 0,endCursor:void 0};function kI(e,t){let n=ft(e),r=j(j(j(n,e=>Je(e,"data")),ft),e=>Je(e,t));return void 0!==r?r:j(n,e=>Je(e,t))}function CI(e,t){let n=kI(e,t),r=j(n,ht);return void 0!==r?r:me(U(j(j(j(n,ft),e=>Je(e,"edges")),ht),[]),e=>j(ft(e),e=>Je(e,"node")))}function AI(e,t){return me(CI(e,t),ft)}function NI(e,t){let n=(e,t)=>U(j(Je(e,t),pt),!1),r=(e,t)=>j(Je(e,t),ut);return L(j(j(j(kI(e,t),ft),e=>Je(e,"pageInfo")),ft),EI,e=>({hasNextPage:n(e,"hasNextPage"),hasPreviousPage:n(e,"hasPreviousPage"),startCursor:r(e,"startCursor"),endCursor:r(e,"endCursor")}))}let TI=[];let RI={};function DI(e,t,n,r){return j(Va(n,t),t=>j(Je(e,t.queryField),e=>Je(e.labels,r)))}function II(e,t,n,r){return j(Va(n,t),t=>j(t.namedRetirement,n=>j(j(Je(e,t.queryField),e=>Je(e.states,r)),e=>{let t=n.values;return qs(n,void 0===t||e)})))}function FI(e,t,n,r,i){if(i)return!0;let o=Va(n,t);if(void 0===o)return!0;let s=Je(e,o.queryField);return void 0===s||q(Je(s.states,r))}function OI(e,t,n,r){let i=Va(n,t);if(void 0===i)return!1;let o=Je(e,i.queryField);return!(void 0===o||!o.loaded||!L(o.asked,!0,e=>$(Je(e,r))))&&q(Je(o.labels,r))}function PI(e,t,n,r){let i={},o=(e,t,s)=>{t.forEach(t=>{let a=t.kind;if("object"!=typeof a)return;switch(a.TAG){case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":return s>0?o(((e,t)=>e.map(e=>me(U(j(Je(e,t),ht),[]),ft)).flat())(e,t.key),tI(a._0,"Drill",n,r,void 0,void 0),s-1|0):void 0;case"KNestedObject":return s>0?o(((e,t)=>me(e,e=>j(Je(e,t),ft)))(e,t.key),tI(a._0,"Drill",n,r,void 0,void 0),s-1|0):void 0;default:return}let l=a._0;if(QD(l,n,r))return;let c=Va(n,l);void 0===c||e.forEach(e=>M(Je(e,t.key),e=>{(function(e){let t=ct(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,ut).filter(e=>""!==e);default:return[]}})(e).forEach(e=>{let t=c.queryField,n=U(Je(i,t),[]);n.some(t=>t===e)||n.push(e),i[t]=n})}))})};return o(e,t,3),i}function MI(e){try{let t=atob(e),n=t.indexOf(":");return n>0&&n<(t.length-1|0)?t.slice(n+1|0):void 0}catch(t){return}}function LI(e,t,n){let r={};return AI(e,t).forEach(e=>{let t=j(Je(e,"id"),ut),i=U(j(Je(e,n),ut),"");if(void 0===t)return;let o=MI(t),s="id"===n?void 0!==o?o:t:""===i?t:i;r[t]=s,void 0===o||(r[o]=s)}),r}function zI(e,t,n){let r=t.queryField,i=t.labelField,o="id"===i?"id":"id "+i,s="query($ids: [ID!]!) { "+r+"Refs(ids: $ids) { id label retired retiredState } }",a="query($ids: [ID!]) { "+r+"(first: "+n.length.toString()+", filter: {ids: $ids}) { edges { node { "+o+" } } } }",l={};return l.ids=n.map(e=>e),e(s,l).then(t=>function(e,t){return $(j(j(ft(U(j(ft(e),e=>Je(e,"data")),e)),e=>Je(e,t+"Refs")),ht))}(t,r)?Promise.resolve(function(e,t){let n={},r={};return U(j(j(ft(U(j(ft(e),e=>Je(e,"data")),e)),e=>Je(e,t+"Refs")),ht),[]).forEach(e=>{let t=ft(e);if(void 0===t)return;let i=j(Je(t,"id"),ut);if(void 0===i)return;let o=U(j(Je(t,"label"),ut),i),s=U(j(Je(t,"retired"),pt),!1),a=U(j(Je(t,"retiredState"),ut),""),l=e=>{n[e]=o,s&&(r[e]=a)};l(i),M(MI(i),l)}),[n,r]}(t,r)):e(a,l).then(e=>[LI(e,r,i),{}]))}let jI=l(void 0);let UI=jI.Provider;let BI={provider:UI,make:function(e){let t=SI(),n=s(()=>RI),r=n[1],i=n[0],o=h({}),a=(e,t)=>r(n=>{let r=Ye(Xe(n)),i=Ye(L(Je(o.current,e),[],e=>e.ids).map(e=>[e,!0])),s={...t(Je(n,e))};return s.asked=i,r[e]=s,r}),l=(e,t)=>{let n=Ye(Xe(e));return Xe(t).forEach(e=>{n[e[0]]=e[1]}),n},u=h(e=>{}),d=(e,n,r)=>{let i=e.queryField;if(void 0===t)return;let s=(e,t)=>{((e,t,n,r)=>{a(e,e=>{let i=r?void 0:e;return{loaded:!0,labels:l(L(i,{},e=>e.labels),t),states:l(L(i,{},e=>e.states),n)}})})(i,e,t,r);let n=Je(o.current,i);if(void 0!==n)return o.current[i]={entity:n.entity,ids:n.ids,refetching:!1,stale:!1},n.stale?u.current(i):void 0};ce(zI(t,e,n).then(e=>s(e[0],e[1])),e=>(console.warn("[AutoUI] RefLabel batch "+i+" failed; cells fall back to raw ids",e),s({},{}),Promise.resolve()))},g=e=>{let t=Je(o.current,e);if(void 0!==t&&0!==t.ids.length)return t.refetching?void(o.current[e]={entity:t.entity,ids:t.ids,refetching:t.refetching,stale:!0}):(o.current[e]={entity:t.entity,ids:t.ids,refetching:!0,stale:!1},a(e,e=>{if(void 0===e)return{loaded:!1,labels:{},states:{}};let t={...e};return t.loaded=!1,t}),d(t.entity,t.ids,!0))};u.current=g;let m=f((e,t)=>{Xe(e).forEach(e=>{let n=e[0],r=Je(o.current,n),i=L(r,[],e=>e.ids),s=e[1].filter(e=>!i.includes(e));if(0===s.length)return;let l=t.find(e=>e.queryField===n);return void 0!==l?(o.current[n]={entity:l,ids:i.concat(s),refetching:L(r,!1,e=>e.refetching),stale:L(r,!1,e=>e.stale)},a(n,e=>{if(void 0===e)return{loaded:!1,labels:{},states:{}};let t={...e};return t.loaded=!1,t}),d(l,s,!1)):void 0})},[t]),v=f(g,[t]),y=p(()=>({entries:i,request:m,invalidate:v}),[i,m,v]);return c(UI,{value:y,children:e.children})}},$I={context:jI,use:function(){return d(jI)},useInvalidate:function(){let e=d(jI);return void 0!==e?e.invalidate:e=>{}},Provider:BI};function qI(e,t,n,r,i){let o=void 0===i||i,l=SI(),c=d(jI),u=s(()=>RI),f=u[1],h=o?PI(e,t,n,r):{},p=function(e){return Xe(e).toSorted((e,t)=>ue(e[0],t[0])).map(e=>e[0]+":"+e[1].toSorted(ue).join(",")).join("|")}(h);return a(()=>{let e={contents:!1};return""!==p&&(void 0!==c?c.request(h,n):void 0!==l&&Xe(h).forEach(t=>{let r=t[1];if(0===r.length)return;let i=t[0],o=n.find(e=>e.queryField===i);void 0===o||ce(zI(l,o,r).then(t=>{if(e.contents)return;let n=t[1],r=t[0];f(e=>{let t=Ye(Xe(e));return t[i]={loaded:!0,labels:r,states:n},t})}),t=>(e.contents||(console.warn("[AutoUI] RefLabel batch "+i+" failed; cells fall back to raw ids",t),f(e=>{let t=Ye(Xe(e));return t[i]={loaded:!0,labels:{},states:{}},t})),Promise.resolve()))})),()=>{e.contents=!0}},[p,l]),void 0!==c?c.entries:u[0]}let GI={registry:[]},VI="table",KI={contents:[]};function WI(e){KI.contents.some(t=>t.id===e.id)?KI.contents=KI.contents.map(t=>t.id===e.id?e:t):KI.contents=KI.contents.concat([e])}function HI(e){return KI.contents.find(t=>t.id===e)}function JI(){return KI.contents}function XI(e,t){let n=void 0!==t?t:GI,r=za(e,void 0,void 0),i=KI.contents.filter(t=>{let i=t.arity;return("object"!=typeof i||"Multi"===i.TAG)&&t.isCapable(e,r,n)});return i.filter(e=>e.id===VI).concat(i.filter(e=>e.id!==VI))}function QI(e){return function(e){let t=me(e,e=>{if("object"==typeof e)return e._0});if(0===t.length)return 0===e.length||e.some(e=>void 0===e)?void 0:"Complete";let n=t.some(e=>"FromStart"!==e),r=t.some(e=>"ToEnd"!==e);return{TAG:"Partial",_0:n?r?"Between":"ToEnd":"FromStart"}}(e.map(e=>e.window))}function YI(e,t,n){let r=void 0!==n?n:"item";return zo(QI(e),function(e){return ge(e,0,(e,t)=>e+t.rows.length|0)}(e),t,r)}function ZI(e){try{return R(localStorage.getItem(e))}catch(t){return}}function eF(e,t,n){return"autoui.viewmode."+U(e,"default")+"."+t+L(n,"",e=>"."+e)}function tF(e){return z(ZI(e),e=>{let t=function(e){try{return ft(JSON.parse(e))}catch(t){return}}(e);if(void 0===t)return{mode:e};let n=j(Je(t,"mode"),ut);return void 0!==n?{mode:n,band:j(j(Je(t,"band"),ut),Ct.bandOfName)}:{mode:e}})}function nF(e,t,n){let r={};r.mode=t,r.band=Ct.bandName(n),function(e,t){try{return localStorage.setItem(e,t)}catch(n){return}}(e,JSON.stringify(r))}function rF(e){return"var("+e+")"}let iF=lo([pi("inlineFlex"),ui("center"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",rF(xt.md)),ci("overflow","hidden")]),oF=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("background","none"),ci("border","none"),ci("padding","2px var("+_t.sm+")"),ci("color",rF(yt.textSecondary)),ci("font-size",rF(bt.sizeSm)),hi("pointer"),Qi([ci("background",rF(yt.surfaceSubtle)),ci("color",rF(yt.textPrimary))])]),sF=co([oF,lo([ci("background",rF(yt.surfaceSubtle)),ci("color",rF(yt.textPrimary)),ci("font-weight",rF(bt.weightMedium))])]),aF=lo([Wi(Ct.compact,[ci("display","none")])]);let lF={Style:{group:iF,btn:oF,btnActive:sF,btnLabel:aF},make:function(e){let t=e.onSelect,n=e.activeId;return i("div",{children:e.modes.map(e=>r("button",{children:[e.icon,i("span",{children:e.label,className:aF})],"aria-label":e.label,"aria-pressed":e.id===n?"true":"false",className:e.id===n?sF:oF,title:e.label,onClick:n=>t(e.id)},e.id)),"aria-label":"View mode",className:iF,role:"group"})}};function cF(e){let t=e.source,n=Ga(),r=qe(),o=tI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=t.rows.map((e,t)=>{let n=U(ft(e),{});return{rowKey:U(j(Je(n,"id"),ut),"#"+t.toString()),json:e,dict:n}}),a=qI(s.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),l=t.refLabels,c=void 0!==l?l:{lookupLabel:(e,t)=>DI(a,e,n,t),isMissing:(e,t)=>OI(a,e,n,t),retiredBadge:(e,t)=>II(a,e,n,t),linkable:(e,t)=>FI(a,e,n,t,!1)},u=o.map(e=>({key:e.key,label:sI(e,n,t.ownEntity),render:i=>dI(e.key,e.kind,e.propSchema,Je(i.dict,e.key),e.ann,n,r,c,t.ownEntity),sortable:!1,width:e.width}));return i(Po,{columns:u,data:s,keyFn:e=>e.rowKey,onRowClick:e=>t.onOpenRow(e.rowKey,e.json)})}let uF=i("span",{children:"▦","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});WI({id:VI,label:"Table",icon:uF,arity:"Single",isCapable:(e,t,n)=>!0,render:e=>{let t=e[0];return void 0!==t?i(cF,{source:t}):null},capability:"always — the universal default"});let dF=["resources","events"],fF=["split","full"],hF=["funnel","scatter"],pF={};function gF(e,t){return j(e.views,e=>Je(e,t))}function mF(e,t){return j(e.fields,e=>Je(e,t))}function vF(e,t){console.error("[AutoUI] ui-hints "+e+": "+t)}function yF(e,t,n){let r=e[t];if(void 0===r)return;let i=He.string(r);return void 0!==i?i:void vF(n+"."+t,"expected a string — dropped")}function _F(e,t,n){let r=e[t];if(void 0===r)return;let i=He.bool(r);return void 0!==i?i:void vF(n+"."+t,"expected a boolean — dropped")}function bF(e,t,n){let r=e[t];if(void 0===r)return;let i=He.float(r);return void 0!==i?i===Math.trunc(i)?0|i:void vF(n+"."+t,"expected a whole number — dropped"):void vF(n+"."+t,"expected a number — dropped")}function xF(e,t,n){let r=e[t];if(void 0===r)return;let i=He.array(r);return void 0!==i?me(i,He.string):void vF(n+"."+t,"expected an array of strings — dropped")}function SF(e,t,n,r){let i=e[t];if(void 0===i)return;let o=He.object(i);if(void 0!==o){let e={};return Object.entries(o).forEach(i=>{let o=i[0];M(r(i[1],n+"."+t+'["'+o+'"]'),t=>{e[o]=t})}),e}vF(n+"."+t,"expected an object — dropped")}function wF(e,t){let n=He.object(e);if(void 0!==n){let e={};return Object.entries(n).forEach(n=>{let r=n[0],i=He.string(n[1]);return void 0!==i?void(e[r]=i):vF(t+"."+r,"expected a string — dropped")}),e}vF(t,"expected an object of string values — dropped")}function EF(e,t){let n=He.object(e);return void 0!==n?{label:yF(n,"label",t),scopedLabel:yF(n,"scopedLabel",t),group:yF(n,"group",t),order:bF(n,"order",t),hidden:_F(n,"hidden",t)}:void vF(t,"expected an object — dropped")}function kF(e,t){let n=He.object(e);if(void 0!==n){let e,r=n.nav,i=n.rowActions;if(void 0!==i){let n=He.array(i);void 0!==n?e=ve(n,(e,n)=>function(e,t){let n=He.object(e);if(void 0!==n){let e=yF(n,"pluginId",t),r=yF(n,"slice",t),i=yF(n,"command",t),o=yF(n,"field",t);return void 0!==e&&void 0!==r&&void 0!==i&&void 0!==o?{label:yF(n,"label",t),pluginId:e,slice:r,command:i,field:o,then:yF(n,"then",t)}:void vF(t,"a row action needs pluginId, slice, command and field — dropped")}vF(t,"expected an object — dropped")}(e,t+".rowActions["+n.toString()+"]")):(vF(t+".rowActions","expected an array of row actions — dropped"),e=void 0)}else e=void 0;let o=n.transitions;return{mode:yF(n,"mode",t),layout:yF(n,"layout",t),canvas:yF(n,"canvas",t),role:yF(n,"role",t),resourceRef:yF(n,"resourceRef",t),accent:yF(n,"accent",t),audit:_F(n,"audit",t),presence:_F(n,"presence",t),related:xF(n,"related",t),nav:void 0!==r?EF(r,t+".nav"):void 0,rowActions:e,suppressRowActions:xF(n,"suppressRowActions",t),retiredLabel:yF(n,"retiredLabel",t),suppress:xF(n,"suppress",t),transitions:void 0!==o?wF(o,t+".transitions"):void 0}}vF(t,"expected an object — dropped")}function CF(e,t){let n=void 0!==e?e:"ui-hints",r=He.object(t);if(void 0!==r){let e,t=r.dashboard;if(void 0!==t){let r=He.array(t);void 0!==r?e=ve(r,(e,t)=>function(e,t){let n=He.object(e);if(void 0!==n){let e=yF(n,"view",t);return void 0!==e?{view:e,label:yF(n,"label",t),field:yF(n,"field",t),aggregate:yF(n,"aggregate",t),viz:yF(n,"viz",t),xField:yF(n,"xField",t)}:void vF(t,"metric without a `view` — dropped")}vF(t,"expected an object — dropped")}(e,n+".dashboard["+t.toString()+"]")):(vF(n+".dashboard","expected an array of metrics — dropped"),e=void 0)}else e=void 0;return{views:SF(r,"views",n,kF),fields:SF(r,"fields",n,wF),dashboard:e}}return vF(n,"expected an object — no hints applied"),pF}function AF(e){let t=He.object(e);if(void 0!==t){let e={};return Object.entries(t).forEach(t=>{let n=t[0];e[n]=CF('ui-hints["'+n+'"]',t[1])}),e}return vF("ui-hints.json","top-level value is not a {pluginId: hints} object — ignored"),{}}function NF(e){return U(z(j(j(ft(Mt(e)),e=>Je(e,"properties")),ft),e=>Object.keys(e)),[])}function TF(e,t){let n=t.split("."),r=U(n[0],t),i=e.readModels.find(e=>e.name===r),o=void 0!==i?i.schema:z(e.stateViewSlices.find(e=>e.name===r),e=>e.schema);return void 0!==o?ge(n.slice(1),{TAG:"Ok",_0:{schema:o}},(e,n)=>{if("Ok"!==e.TAG)return e;let r=e._0.schema,i=function(e,t){return j(j(z(j(j(j(ft(Mt(e)),e=>Je(e,"properties")),ft),e=>Je(e,t)),Mt),ft),e=>Je(e,"items"))}(r,n);return void 0!==i?{TAG:"Ok",_0:{schema:i}}:NF(r).includes(n)?L(j(j(j(ft(Mt(r)),e=>Je(e,"properties")),ft),e=>Je(e,n)),{TAG:"Error",_0:'unresolvable path segment "'+n+'" in "'+t+'"'},e=>({TAG:"Ok",_0:{schema:e}})):{TAG:"Error",_0:'unknown field "'+n+'" in path "'+t+'"'}}):{TAG:"Error",_0:'unknown view "'+r+'" — known views: '+e.readModels.map(e=>e.name).concat(e.stateViewSlices.map(e=>e.name)).join(", ")}}function RF(e,t){let n=e.readModels.find(e=>e.name===t);return void 0!==n?n.lifecycleField:j(e.stateViewSlices.find(e=>e.name===t),e=>e.lifecycleField)}function DF(e,t){if(void 0!==HI(e))return;let n=JI().map(e=>e.id).join(", ");return t+': unknown view-mode id "'+e+'" — registered modes: '+n}function IF(e,t,n,r){let i=void 0!==n?n:[],o=void 0!==r?r:{},s=0===i.length?[t]:i,a=[],l=e=>{a.push("[AutoUI] uiHints ("+t.id+"): "+e)};return M(e.views,e=>{Xe(e).forEach(e=>{let n=e[1],r=e[0],i=TF(t,r);"Ok"!==i.TAG&&l('views["'+r+'"]: '+i._0),M(n.role,e=>{if(!dF.includes(e))return l('views["'+r+'"].role: unknown role "'+e+'" — expected '+dF.join(" or "));if("events"!==e)return;let t=n.resourceRef;return void 0!==t?"Ok"!==i.TAG||NF(i._0.schema).includes(t)?void 0:l('views["'+r+'"].resourceRef: unknown field "'+t+'"'):l('views["'+r+'"]: role "events" requires a resourceRef field')}),M(n.resourceRef,e=>{if(vt(n.role,"events"))return l('views["'+r+'"].resourceRef: only meaningful with role "events"')}),M(n.transitions,e=>{let n,o=function(e){return e.aggregates.flatMap(e=>e.commands).concat(e.stateChangeSlices.flatMap(e=>e.commands).concat(e.readModels.flatMap(e=>e.commands))).map(e=>e.name)}(t),s=RF(t,r);n="Ok"===i.TAG&&void 0!==s?Bs(i._0.schema,s):[],0===n.length&&l('views["'+r+'"].transitions: the view declares no status enum, so no transition can apply'),Xe(e).forEach(e=>{let t=e[1],i=e[0];if(o.includes(t)||l('views["'+r+'"].transitions["'+i+'"]: unknown command "'+t+'" — known commands: '+o.join(", ")),0!==n.length&&!n.includes(i))return l('views["'+r+'"].transitions: unknown target state "'+i+'" — known states: '+n.join(", "))})}),M(n.nav,e=>{r.includes(".")&&l('views["'+r+'"].nav: a nested path has no menu entry of its own — nav belongs on the top-level view'),[["label",e.label],["scopedLabel",e.scopedLabel],["group",e.group]].forEach(e=>{let t=e[0];M(e[1],e=>{if(""===e.trim())return l('views["'+r+'"].nav.'+t+": blank — an empty "+t+" renders nothing, so it is ignored")})}),M(e.scopedLabel,e=>{if(!r.includes(".")&&q(function(e,t){let n=e.readModels.find(e=>e.name===t);return void 0!==n?n.ownerField:j(e.stateViewSlices.find(e=>e.name===t),e=>e.ownerField)}(t,r)))return l('views["'+r+'"].nav.scopedLabel: the view declares no @owner field, so no caller is narrowed to their own rows and this label never renders')})}),M(n.rowActions,e=>{r.includes(".")&&0!==e.length&&l('views["'+r+'"].rowActions: a nested path names a collection drilled into inside a detail, not a view whose rows an action can be declared about — they belong on the top-level view'),e.forEach((e,t)=>{let n='views["'+r+'"].rowActions['+t.toString()+"]",i=s.find(t=>t.id===e.pluginId);if(void 0!==i){let t=function(e,t){let n=e.aggregates.find(e=>e.name===t);if(void 0!==n)return{TAG:"Ok",_0:n.commands};let r=e.stateChangeSlices.find(e=>e.name===t);return void 0!==r?{TAG:"Ok",_0:r.commands}:{TAG:"Error",_0:e.aggregates.map(e=>e.name).concat(e.stateChangeSlices.map(e=>e.name))}}(i,e.slice);if("Ok"===t.TAG){let r=t._0,i=r.find(t=>t.name===e.command);if(void 0!==i){let t=NF(i.schema);t.includes(e.field)||l(n+': unknown field "'+e.field+'" on command "'+e.command+'" — known fields: '+t.join(", "))}else l(n+': unknown command "'+e.command+'" in "'+e.slice+'" — known commands: '+r.map(e=>e.name).join(", "))}else l(n+': unknown slice "'+e.slice+'" in plugin "'+e.pluginId+'" — known aggregates and slices: '+t._0.join(", "))}else l(n+': unknown plugin "'+e.pluginId+'" — known plugins: '+s.map(e=>e.id).join(", "));M(e.then,e=>{if(""===e.trim())return l(n+".then: blank — an empty route navigates nowhere, so it is ignored")})})}),M(n.suppressRowActions,e=>{r.includes(".")&&0!==e.length&&l('views["'+r+'"].suppressRowActions: a nested path names a collection drilled into inside a detail, not a view whose rows an action can be offered on — they belong on the top-level view');let t=U(n.rowActions,[]).map(e=>e.pluginId+"."+e.slice+"."+e.command),i=U(Je(o,r),[]),s=t.concat(i);e.forEach((e,t)=>{let n='views["'+r+'"].suppressRowActions['+t.toString()+"]";return""===e.trim()?l(n+": blank — an empty pointer names no action, so it is ignored"):s.some(t=>t===e)?void 0:l(n+': "'+e+'" matches no declared or inferred action on this view — '+(0!==s.length?"it offers "+s.join(", "):"it offers none"))})}),M(n.retiredLabel,e=>{if(""===e.trim())return l('views["'+r+'"].retiredLabel: blank — an empty label renders an empty badge, so it is ignored');if("Ok"!==i.TAG)return;let t=Ps(i._0.schema);return void 0!==t?void 0!==t[1].values?l('views["'+r+'"].retiredLabel: "'+t[0]+'" retires the row by its lifecycle state, so each row badges by the state it is in — rename the states themselves to change the word'):void 0:l('views["'+r+'"].retiredLabel: the view declares no @retired field, so there is no retirement state to label')}),M(n.mode,e=>M(DF(e,'views["'+r+'"].mode'),l)),M(n.layout,e=>{if(!fF.includes(e))return l('views["'+r+'"].layout: unknown layout "'+e+'" — expected '+fF.join(" or "))}),M(n.suppress,e=>{e.forEach(e=>{if(M(DF(e,'views["'+r+'"].suppress'),l),e===VI)return l('views["'+r+'"].suppress: the "table" mode is the universal fallback and cannot be suppressed')})})})}),M(e.fields,e=>{Xe(e).forEach(e=>{let n=e[0],r=TF(t,n);if("Ok"!==r.TAG)return l('fields["'+n+'"]: '+r._0);let i=NF(r._0.schema);Xe(e[1]).forEach(e=>{let t=e[1],r=e[0];if(i.includes(r)||l('fields["'+n+'"]: unknown field "'+r+'"'),q(oa(t)))return l('fields["'+n+'"].'+r+': unknown semantic "'+t+'"')})})}),M(e.dashboard,e=>{e.forEach(e=>{let n=U(e.aggregate,"count");["count","sum","avg"].includes(n)?"count"!==n&&q(e.field)&&l('dashboard metric on "'+e.view+'": aggregate "'+n+'" requires a field'):l('dashboard metric on "'+e.view+'": unknown aggregate "'+n+'" — expected count, sum, or avg');let r=TF(t,e.view);if("Ok"!==r.TAG)return l("dashboard metric: "+r._0);let i=r._0.schema;M(e.field,t=>{if(!NF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown field "'+t+'"')}),M(e.xField,t=>{if(!NF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown xField "'+t+'"')}),M(e.viz,n=>{if(!hF.includes(n))return l('dashboard metric on "'+e.view+'": unknown viz "'+n+'" — expected '+hF.join(", "));if("funnel"===n&&0===function(e,t,n){let r=B(RF(e,t),za(n,void 0,void 0).statusField);return void 0!==r?Bs(n,r):[]}(t,e.view,i).length)return l('dashboard metric on "'+e.view+'": viz "funnel" needs a status enum to order the stages, and this view declares none');if("scatter"!==n)return;let r=e.field,o=e.xField;if(void 0!==r&&void 0!==o){let t=NF(i),n=function(e){return _a(e).filter(e=>xa(e[1])).map(e=>e[0])}(i);return void[["field",r],["xField",o]].forEach(r=>{let i=r[1];if(t.includes(i)&&!n.includes(i))return l('dashboard metric on "'+e.view+'": viz "scatter" '+r[0]+' "'+i+'" is not a numeric field')})}l('dashboard metric on "'+e.view+'": viz "scatter" needs both a field (the y measure) and an xField (the x measure)')})})}),a.forEach(e=>{console.error(e)}),a}function FF(e,t,n){let r=XI(e,void 0!==n?n:GI),i=j(t,e=>e.suppress);return void 0!==i?r.filter(e=>e.id===VI||!i.includes(e.id)):r}function OF(e,t,n,r,i){let o=e=>j(e,e=>i.find(t=>t.id===e)),s=mt(r,"Tight"),a=z(e,e=>e.mode),l=o(j(e,e=>{if((e=>{if(!s)return!0;let t=e.band;return void 0!==t&&Ct.atLeastAsNarrow(t,"Tight")})(e))return e.mode}));if(void 0!==l)return l;let c=o(j(t,e=>e.mode));if(void 0!==c)return c;let u=o(n);if(void 0!==u)return u;let d=s?o("cards"):void 0;if(void 0!==d)return d;let f=o(a);return void 0!==f?f:i[0]}function PF(e){switch(e){case"full":return"Full";case"split":return"Split";default:return}}function MF(e){return"hide"===e.toLowerCase()?"Hide":"Lock"}function LF(e,t){return void 0===t||0===t.length||t.some(t=>e.includes(t))}function zF(e){return j(e,e=>e[0])}function jF(e,t){let n=t=>t.filter(t=>LF(e,t.requiredAccess));return t.map(t=>{let r={...t};return r.internalQueryables=z(t.internalQueryables,t=>t.filter(t=>LF(e,t.requiredAccess))),r.stateChangeSlices=t.stateChangeSlices.map(e=>{let t={...e};return t.commands=n(e.commands),t}),r.stateViewSlices=t.stateViewSlices.filter(t=>LF(e,t.requiredAccess)),r.aggregates=t.aggregates.map(e=>{let t={...e};return t.commands=n(e.commands),t}),r.readModels=t.readModels.filter(t=>LF(e,t.requiredAccess)).map(e=>{let t={...e};return t.commands=n(e.commands),t}),r})}function UF(e,t){let n={},r=(t,r)=>{let i=!LF(e,r),o=zF(r);i&&void 0!==o&&(n[t]=o)};return t.forEach(e=>{e.readModels.forEach(e=>r(e.name,e.requiredAccess)),e.stateViewSlices.forEach(e=>r(e.name,e.requiredAccess))}),n}function BF(e,t){let n={},r=(t,r)=>{if(0!==r.length&&r.every(t=>!LF(e,t.requiredAccess)))return M(j(r[0],e=>zF(e.requiredAccess)),e=>{n[t]=e})};return t.forEach(e=>{e.aggregates.forEach(e=>r(e.name,e.commands)),e.stateChangeSlices.forEach(e=>r(e.name,e.commands))}),n}let $F=[ci(yt.background,"#0d1117"),ci(yt.surface,"#161b22"),ci(yt.surfaceSubtle,"#1c2128"),ci(yt.surfaceElevated,"#21262d"),ci(yt.brand,"#2f81f7"),ci(yt.brandSubtle,"#1f4b8e"),ci(yt.success,"#3fb950"),ci(yt.warning,"#d29922"),ci(yt.error,"#f85149"),ci(yt.info,"#58a6ff"),ci(yt.textPrimary,"#e6edf3"),ci(yt.textSecondary,"#8b949e"),ci(yt.textDisabled,"#484f58"),ci(yt.textOnBrand,"#ffffff"),ci(yt.border,"#30363d"),ci(yt.borderSubtle,"#21262d"),ci(_t.xs,"4px"),ci(_t.sm,"8px"),ci(_t.md,"16px"),ci(_t.lg,"24px"),ci(_t.xl,"32px"),ci(_t.xxl,"48px"),ci(bt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ci(bt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ci(bt.sizeXs,"11px"),ci(bt.sizeSm,"12px"),ci(bt.sizeMd,"14px"),ci(bt.sizeLg,"16px"),ci(bt.sizeXl,"20px"),ci(bt.sizeXxl,"24px"),ci(bt.weightNormal,"400"),ci(bt.weightMedium,"500"),ci(bt.weightBold,"600"),ci(bt.lineHeightTight,"1.25"),ci(bt.lineHeightNormal,"1.5"),ci(bt.lineHeightRelaxed,"1.75"),ci(xt.sm,"4px"),ci(xt.md,"6px"),ci(xt.lg,"12px"),ci(xt.full,"9999px"),ci(St,"0 1px 3px rgba(0,0,0,0.4)"),ci(wt,"0 4px 12px rgba(0,0,0,0.5)"),ci(Et,"0 8px 24px rgba(0,0,0,0.6)")],qF=[ci(yt.background,"#ffffff"),ci(yt.surface,"#f6f8fa"),ci(yt.surfaceSubtle,"#eaeef2"),ci(yt.surfaceElevated,"#ffffff"),ci(yt.brand,"#0969da"),ci(yt.brandSubtle,"#ddf4ff"),ci(yt.success,"#1a7f37"),ci(yt.warning,"#9a6700"),ci(yt.error,"#cf222e"),ci(yt.info,"#0550ae"),ci(yt.textPrimary,"#1f2328"),ci(yt.textSecondary,"#636c76"),ci(yt.textDisabled,"#bec1c5"),ci(yt.textOnBrand,"#ffffff"),ci(yt.border,"#d0d7de"),ci(yt.borderSubtle,"#eaeef2"),ci(_t.xs,"4px"),ci(_t.sm,"8px"),ci(_t.md,"16px"),ci(_t.lg,"24px"),ci(_t.xl,"32px"),ci(_t.xxl,"48px"),ci(bt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ci(bt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ci(bt.sizeXs,"11px"),ci(bt.sizeSm,"12px"),ci(bt.sizeMd,"14px"),ci(bt.sizeLg,"16px"),ci(bt.sizeXl,"20px"),ci(bt.sizeXxl,"24px"),ci(bt.weightNormal,"400"),ci(bt.weightMedium,"500"),ci(bt.weightBold,"600"),ci(bt.lineHeightTight,"1.25"),ci(bt.lineHeightNormal,"1.5"),ci(bt.lineHeightRelaxed,"1.75"),ci(xt.sm,"4px"),ci(xt.md,"6px"),ci(xt.lg,"12px"),ci(xt.full,"9999px"),ci(St,"0 1px 3px rgba(0,0,0,0.08)"),ci(wt,"0 4px 12px rgba(0,0,0,0.12)"),ci(Et,"0 8px 24px rgba(0,0,0,0.16)")],GF=[ci(yt.background,"#f5f5f5"),ci(yt.surface,"#ffffff"),ci(yt.surfaceSubtle,"#eeeeee"),ci(yt.surfaceElevated,"#ffffff"),ci(yt.brand,"#424242"),ci(yt.brandSubtle,"#e0e0e0"),ci(yt.success,"#388e3c"),ci(yt.warning,"#f57c00"),ci(yt.error,"#d32f2f"),ci(yt.info,"#1976d2"),ci(yt.textPrimary,"#212121"),ci(yt.textSecondary,"#757575"),ci(yt.textDisabled,"#bdbdbd"),ci(yt.textOnBrand,"#ffffff"),ci(yt.border,"#bdbdbd"),ci(yt.borderSubtle,"#e0e0e0"),ci(_t.xs,"4px"),ci(_t.sm,"8px"),ci(_t.md,"16px"),ci(_t.lg,"24px"),ci(_t.xl,"32px"),ci(_t.xxl,"48px"),ci(bt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ci(bt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ci(bt.sizeXs,"11px"),ci(bt.sizeSm,"12px"),ci(bt.sizeMd,"14px"),ci(bt.sizeLg,"16px"),ci(bt.sizeXl,"20px"),ci(bt.sizeXxl,"24px"),ci(bt.weightNormal,"400"),ci(bt.weightMedium,"500"),ci(bt.weightBold,"600"),ci(bt.lineHeightTight,"1.25"),ci(bt.lineHeightNormal,"1.5"),ci(bt.lineHeightRelaxed,"1.75"),ci(xt.sm,"4px"),ci(xt.md,"6px"),ci(xt.lg,"12px"),ci(xt.full,"9999px"),ci(St,"0 1px 3px rgba(0,0,0,0.12)"),ci(wt,"0 4px 12px rgba(0,0,0,0.14)"),ci(Et,"0 8px 24px rgba(0,0,0,0.18)")],VF=[ci(yt.background,"#000000"),ci(yt.surface,"#0a0a0a"),ci(yt.surfaceSubtle,"#111111"),ci(yt.surfaceElevated,"#1a1a1a"),ci(yt.brand,"#ffdd00"),ci(yt.brandSubtle,"#332b00"),ci(yt.success,"#00ff00"),ci(yt.warning,"#ffaa00"),ci(yt.error,"#ff4444"),ci(yt.info,"#44aaff"),ci(yt.textPrimary,"#ffffff"),ci(yt.textSecondary,"#cccccc"),ci(yt.textDisabled,"#555555"),ci(yt.textOnBrand,"#000000"),ci(yt.border,"#ffffff"),ci(yt.borderSubtle,"#888888"),ci(_t.xs,"4px"),ci(_t.sm,"8px"),ci(_t.md,"16px"),ci(_t.lg,"24px"),ci(_t.xl,"32px"),ci(_t.xxl,"48px"),ci(bt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ci(bt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ci(bt.sizeXs,"11px"),ci(bt.sizeSm,"12px"),ci(bt.sizeMd,"14px"),ci(bt.sizeLg,"16px"),ci(bt.sizeXl,"20px"),ci(bt.sizeXxl,"24px"),ci(bt.weightNormal,"400"),ci(bt.weightMedium,"500"),ci(bt.weightBold,"600"),ci(bt.lineHeightTight,"1.25"),ci(bt.lineHeightNormal,"1.5"),ci(bt.lineHeightRelaxed,"1.75"),ci(xt.sm,"4px"),ci(xt.md,"6px"),ci(xt.lg,"12px"),ci(xt.full,"9999px"),ci(St,"0 1px 3px rgba(255,255,255,0.1)"),ci(wt,"0 4px 12px rgba(255,255,255,0.15)"),ci(Et,"0 8px 24px rgba(255,255,255,0.2)")];function KF(e,t){let n=void 0!==t?[ci(yt.brand,t.primaryColor)]:[];return lo(e.concat(n))}let WF=function(e){let t,n=e.theme;switch(n.preset){case"Dark":t=KF($F,n.brand);break;case"Light":t=KF(qF,n.brand);break;case"Neutral":t=KF(GF,n.brand);break;case"HighContrast":t=KF(VF,n.brand)}return i("div",{children:e.children,className:t})};let HF=l({preset:"Light",setPreset:function(e){}}),JF=HF.Provider;function XF(){return d(HF)}let QF="reventless-ui:theme",YF=["Light","Dark","Neutral","HighContrast"];function ZF(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"HighContrast"}}let eO=function(e){let t=e.initialPreset,n=void 0!==t?t:"Light",r=s(()=>function(e){let t=localStorage.getItem(QF);return null==t?e:function(e){switch(e){case"Dark":return"Dark";case"HighContrast":return"HighContrast";case"Neutral":return"Neutral";default:return"Light"}}(t)}(n)),o=r[1],a=r[0],l=f(e=>{localStorage.setItem(QF,ZF(e)),o(t=>e)},[]),c=p(()=>({preset:a,setPreset:l}),[a,l]);return i(JF,{value:c,children:i(WF,{theme:{preset:a,brand:e.brand},children:e.children})})};function tO(e){return!!e.startsWith("/")&&!e.startsWith("//")}function nO(e,t){return"header-"+function(e){return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}(JSON.stringify(Object.fromEntries([["host",e],["Authorization",t]])))}function rO(e,t){if(e.state===t)return;let n=e.state;e.state=t;let r=0;switch(t){case"Closed":case"Connecting":r=1;break;case"Open":let t=e.disconnectedSince;if(void 0!==t){let n=Date.now()-t;e.disconnectedSince=void 0,M(e.onReconnect,e=>e(n))}}1===r&&"Open"===n&&(e.disconnectedSince=Date.now()),M(e.onStateChange,e=>e(t))}function iO(e,t){let n=e.ws,r=e.getToken();if(void 0===n)return;if(void 0===r)return;let i=Object.fromEntries([["host",e.host],["Authorization",r]]),o=JSON.stringify(Object.fromEntries([["type","subscribe"],["id",t.id],["channel",t.channel],["authorization",i]]));try{return void D(n).send(o)}catch(s){return}}function oO(e){let t=j(e.errors,He.array);return void 0!==t&&0!==t.length?t.map(e=>{let t=He.object(e);if(void 0===t)return JSON.stringify(e);let n=e=>j(t[e],He.string),r=n("errorType"),i=n("message");return void 0!==r?void 0!==i?r+": "+i:r:void 0!==i?i:JSON.stringify(e)}).join("; "):JSON.stringify(e)}function sO(e,t){let n;try{n=JSON.parse(t)}catch(o){n=void 0}let r=j(n,He.object);if(void 0===r)return;let i=j(r.type,He.string);if(void 0!==i)switch(i){case"connection_ack":return rO(e,"Open"),e.reconnectAttempts=0,function(e){e.subscriptions.forEach(t=>iO(e,t))}(e);case"connection_error":return void console.error("Events connection refused: "+oO(r));case"data":let t=j(r.id,He.string),n=U(r.event,null),i=e=>{let t=He.string(e);if(void 0===t)return e;try{return JSON.parse(t)}catch(o){return e}},s=He.array(n),a=void 0!==s?s.map(i):[i(n)],l=j(t,t=>e.subscriptions.get(t));return void 0!==l?void a.forEach(e=>l.onMessage(e)):void 0;case"subscribe_error":let c=j(r.id,He.string),u=U(z(j(c,t=>e.subscriptions.get(t)),e=>e.channel),"<unknown channel>");return void console.error("Events subscribe refused for "+u+": "+oO(r));default:return}}function aO(e){if(e.disposed)return;let t=["aws-appsync-event-ws"],n=e.getToken(),r=void 0!==n?t.concat([nO(e.host,n)]):t,i=new WebSocket(e.url,r);e.ws=T(i),rO(e,"Connecting"),i.onopen=()=>{try{return void i.send('{"type":"connection_init"}')}catch(e){return}},i.onmessage=t=>sO(e,t.data),i.onclose=t=>{if(e.ws=void 0,function(e){return 4401===e||4403===e}(t.code))return rO(e,"Unauthorized"),M(e.onAuthFailure,e=>{try{return e()}catch(t){return}});if(rO(e,"Closed"),e.disposed)return;let n=e.reconnectAttempts+1|0;e.reconnectAttempts=n,e.reconnectTimer=setTimeout(()=>aO(e),function(e){switch(e){case 1:return 1e3;case 2:return 2e3;case 3:return 4e3;case 4:return 8e3;case 5:return 16e3;default:return 3e4}}(n))},i.onerror=e=>{}}function lO(e,t,n,r,i,o){let s={ws:void 0,state:"Closed",url:e,host:t,getToken:n,subscriptions:new Map,reconnectAttempts:0,reconnectTimer:void 0,disposed:!1,onStateChange:r,disconnectedSince:void 0,onReconnect:i,onAuthFailure:o};return aO(s),s}function cO(e,t,n){let r=crypto.randomUUID(),i={id:r,channel:t,onMessage:n};return e.subscriptions.set(r,i),"Open"===e.state&&iO(e,i),()=>{if(e.subscriptions.has(r))return e.subscriptions.delete(r),function(e,t){let n=e.ws;if(void 0===n)return;let r=JSON.stringify(Object.fromEntries([["type","unsubscribe"],["id",t]]));try{return void D(n).send(r)}catch(i){return}}(e,r)}}function uO(e){e.disposed=!0;let t=e.reconnectTimer;void 0!==t&&clearTimeout(t),e.reconnectTimer=void 0;let n=e.ws;if(void 0!==n)try{D(n).close()}catch(r){}e.ws=void 0,e.subscriptions.clear()}function dO(){return L(R(globalThis.document),!1,e=>e.hidden)}let fO=["Platform_"];function hO(e,t){let n=t.toLowerCase();return e.some(e=>n.startsWith(e.toLowerCase()))?"Platform":"Domain"}let pO=l(void 0);function gO(){return d(pO)}function mO(){return{client:void 0,registry:new Map,refcount:0,idleTimer:void 0,reconnectListeners:[],torndown:!1}}let vO=pO.Provider;let yO=function(e){let t=e.getToken,n=e.platformReadModelPrefixes,r=e.onAuthFailure,i=e.clientEventsNamespace,o=e.liveReconnectRefetch,l=e.liveUpdates,u=e.platformEventsEndpoint,d=e.domainEventsEndpoint,f=void 0===o||o,g=void 0!==n?n:fO,m=h(t);a(()=>{m.current=t},[t]);let v=()=>m.current(),y=h(mO()),_=h(mO()),b=h(dO()),x=s(()=>"Closed"),S=x[1],w=x[0],E=s(()=>"Closed"),k=E[1],C=E[0],A=e=>"Domain"===e?y:_,N=e=>"Domain"===e?d:u,T=e=>{let t=A(e).current;f&&t.reconnectListeners.slice().forEach(e=>{try{return e()}catch(t){return}})},O=e=>{let t=A(e).current,n=t.client;if(void 0!==n)return n;let i=N(e);if(void 0===i)return;let o=function(e){let t;t=e.startsWith("https://")?"wss://"+e.slice(8):e.startsWith("http://")?"ws://"+e.slice(7):tO(e)?("https:"===location.protocol?"wss":"ws")+"://"+location.host+e:e;let n=t.replace("appsync-api.","appsync-realtime-api.");return n.endsWith("/realtime")?n:n+"/realtime"}(i),s=function(e){let t=e.startsWith("https://")?e.slice(8):e.startsWith("http://")?e.slice(7):tO(e)?location.host:e,n=t.indexOf("/");return-1!==n?t.slice(0,n):t}(i),a=lO(o,s,v,t=>"Domain"===e?S(e=>t):k(e=>t),t=>{if(t>=2e3)return T(e)},r);return t.client=a,a},P=(e,t,n)=>{if(!q(n.underlyingUnsub))return;let r=O(e);if(void 0===r)return;let i=cO(r,t,e=>{n.callbacks.forEach(t=>t(e))});n.underlyingUnsub=i},M=(e,t,n)=>{let r=A(e).current;if(!l||q(N(e)))return()=>{};(e=>{let t=A(e).current,n=t.idleTimer;if(void 0!==n)clearTimeout(n),t.idleTimer=void 0})(e),r.refcount=r.refcount+1|0;let i,o=r.registry.get(t);if(void 0!==o){let e=o.drainTimer;void 0!==e&&(clearTimeout(e),o.drainTimer=void 0),i=o}else{let e={refcount:0,callbacks:[],underlyingUnsub:void 0,drainTimer:void 0};r.registry.set(t,e),i=e}return i.callbacks.push(n),i.refcount=i.refcount+1|0,1!==i.refcount||b.current||P(e,t,i),()=>{if(i.callbacks=i.callbacks.filter(e=>e!==n),i.refcount=i.refcount-1|0,r.torndown?(i.underlyingUnsub=void 0,r.registry.delete(t)):0===i.refcount&&(i.drainTimer=setTimeout(()=>{let e=i.underlyingUnsub;void 0!==e&&e(),i.underlyingUnsub=void 0,i.drainTimer=void 0,r.registry.delete(t)},5e3)),r.refcount=r.refcount-1|0,0===r.refcount&&!r.torndown){let t=A(e).current,n=t.idleTimer;return void 0!==n&&clearTimeout(n),void(t.idleTimer=setTimeout(()=>{let e=t.client;void 0!==e&&(uO(e),t.client=void 0),t.idleTimer=void 0},3e4))}}},L=e=>!!l&&$(N(hO(g,e)));a(()=>function(e){let t=R(globalThis.document);if(void 0===t)return()=>{};let n=D(t);return n.addEventListener("visibilitychange",e),()=>{n.removeEventListener("visibilitychange",e)}}(()=>{let e=dO();if(e!==b.current)return b.current=e,e?void["Domain","Platform"].forEach(e=>{A(e).current.registry.forEach(e=>{let t=e.underlyingUnsub;if(void 0!==t)return t(),void(e.underlyingUnsub=void 0)})}):void["Domain","Platform"].forEach(e=>{let t=A(e).current,n={contents:!1};if(t.registry.forEach((t,r)=>{if(t.refcount>0&&q(t.underlyingUnsub))return P(e,r,t),$(t.underlyingUnsub)?void(n.contents=!0):void 0}),n.contents)return T(e)})}),[]),a(()=>()=>{["Domain","Platform"].forEach(e=>{let t=A(e).current,n=t.idleTimer;void 0!==n&&clearTimeout(n),t.idleTimer=void 0,t.registry.forEach(e=>{let t=e.drainTimer;if(void 0!==t)return clearTimeout(t),void(e.drainTimer=void 0)});let r=t.client;void 0!==r&&uO(r),t.client=void 0,t.torndown=!0})},[]);let z=e=>"Domain"===e?w:C,j=(e,t)=>{let n=A(e).current;return n.reconnectListeners.push(t),()=>{n.reconnectListeners=n.reconnectListeners.filter(e=>e!==t)}},B=()=>!(!l||!$(i))&&$(d),G=async(e,t,n)=>{let r=N(e);return void 0!==r?await async function(e,t,n,r){let i=JSON.stringify(Object.fromEntries([["channel",n],["events",r.map(e=>JSON.stringify(e))]])),o=Object.fromEntries([["Content-Type","application/json"]]);void 0!==t&&(o.Authorization=t);try{let t=await fetch(e,{method:"POST",headers:o,body:i});return t.ok?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:"publish failed with status "+t.status.toString()}}catch(s){let e=F(s);return e.RE_EXN_ID===I?{TAG:"Error",_0:U(e._1.message,"publish failed")}:{TAG:"Error",_0:"publish failed"}}}(r,m.current(),t,n):{TAG:"Error",_0:"no events endpoint configured"}},V=p(()=>({subscribe:M,isLive:L,apiForReadModel:e=>hO(g,e),statusFor:z,registerReconnect:j,publish:G,clientChannelsAvailable:B,clientNamespace:()=>i,liveUpdatesEnabled:()=>l}),[l,d,u,w,C,i,g]);return c(vO,{value:V,children:e.children})};function _O(e,t){if(0===e.length)return"Unknown";let n=t.filter(t=>e.includes(t));return 0!==n.length?{TAG:"Elevated",_0:n}:"Scoped"}function bO(e,t){let n=ft(e);if(void 0===n)return e;let r=j(Je(n,"properties"),ft);if(void 0===r)return e;let i=j(Je(r,t),ft);if(void 0===i)return e;let o=Ye(Xe(i));o["x-reventless-ui-hidden"]=!0;let s=Ye(Xe(r));s[t]=o;let a=Ye(Xe(n));return a.properties=s,a}function xO(e,t,n){if("object"!=typeof e){if("Unknown"===e)return n;if(""===t)return n;let r=e=>e.map(e=>{if(void 0===e.ownerField)return e;let n={...e};return n.ownerValue=t,n}),i=(e,t)=>void 0!==t?bO(e,t):e;return n.map(e=>{let t={...e};return t.internalQueryables=z(e.internalQueryables,e=>e.map(e=>{let t={...e};return t.schema=i(e.schema,e.ownerField),t})),t.stateChangeSlices=e.stateChangeSlices.map(e=>{let t={...e};return t.commands=r(e.commands),t}),t.stateViewSlices=e.stateViewSlices.map(e=>{let t={...e};return t.schema=i(e.schema,e.ownerField),t}),t.aggregates=e.aggregates.map(e=>{let t={...e};return t.commands=r(e.commands),t}),t.readModels=e.readModels.map(e=>{let t={...e};return t.commands=r(e.commands),t.schema=i(e.schema,e.ownerField),t}),t})}{let t=e._0,r=(e,n)=>void 0!==n?function(e,t,n){let r=ft(e);if(void 0===r)return e;let i={};i.field=t,i.as=n.map(e=>e);let o=Ye(Xe(r));return o["x-reventless-owner-unscoped"]=i,o}(e,n,t):e;return n.map(e=>{let t={...e};return t.stateViewSlices=e.stateViewSlices.map(e=>{let t={...e};return t.schema=r(e.schema,e.ownerField),t}),t.readModels=e.readModels.map(e=>{let t={...e};return t.schema=r(e.schema,e.ownerField),t}),t})}}function SO(e,t){let n=ut(t);return function(e){let t=Ps(e);return void 0!==t&&void 0===t[1].values?bO(e,t[0]):e}(function(e,t){return M(j(j(ft(t),e=>Je(e,"properties")),ft),t=>{Qe(t).forEach(t=>M(j(j(ft(t),e=>Je(e,"x-reventless-semantic-target")),ft),t=>{let n=Je(t,"store"),r=Je(t,"plugin");void 0===n||void 0!==r||(t.plugin=e)}))}),t}(e,void 0!==n?JSON.parse(n):t))}function wO(e){switch(e){case"boolean":return"Boolean";case"integer":return"Int";case"number":return"Float";default:return"String"}}function EO(e){let t=e.toLowerCase();return t.length>=2&&t.endsWith("id")}function kO(e){if(mt(j(Je(e,"type"),ut),"object"))return j(Je(e,"x-reventless-graphql-input"),ut)}function CO(e){return j(Je(e,"x-reventless-graphql-type"),ut)}function AO(e){return z(j(j(ft(e),e=>Je(e,"required")),ht),e=>me(e,ut))}function NO(e,t,n){let r=AO(t),i=U(z(j(j(ft(t),e=>Je(e,"properties")),ft),e=>Object.keys(e).filter(e=>"TAG"!==e).map(t=>{let n,i=j(Je(e,t),ft),o=j(i,CO);if(void 0!==o)n=o;else{let e=L(i,"String",e=>function(e,t){let n=U(j(Je(t,"type"),ut),"string");if("array"===n){let n=j(Je(t,"items"),ft),r=j(n,kO),i=void 0!==r?r:U(z(j(j(n,e=>Je(e,"type")),ut),t=>"string"===t&&(function(e){let t=e.toLowerCase();return t.length>3&&t.endsWith("ids")}(e)||EO(e))?"ID":wO(t)),"String");return"["+i+"!]"}let r=kO(t);return void 0!==r?r:EO(e)&&"string"===n?"ID":wO(n)}(t,e));n=void 0!==r?r.includes(t)?e+"!":e:e+"!"}return[t,n]})),[]),o=(void 0!==n?[]:[["id","ID!"]]).concat(i),s="__typename ... on CommandAccepted { msgId entityId eventCount } ... on CommandRejected { msgId errorCode errorDetail } ... on CommandPending { msgId }";if(0===o.length)return"mutation { "+e+" { "+s+" } }";let a=o.map(e=>"$"+e[0]+": "+e[1]).join(", "),l=o.map(e=>{let t=e[0];return t+": $"+t}).join(", ");return"mutation "+e+"("+a+") { "+e+"("+l+") { "+s+" } }"}function TO(e){let t=e.split(".");return U(t[t.length-1|0],e)}function RO(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function DO(e){return me(U(ht(e),[]),e=>z(ft(e),e=>{let t=t=>U(j(Je(e,t),ut),"");return{fieldName:t("fieldName"),entity:t("entity"),plugin:j(Je(e,"plugin"),ut)}}))}function IO(e){return vt(j(Je(e,"apiExposed"),pt),!1)}function FO(e,t,n){return me(U(ht(n),[]),n=>z(j(ft(n),e=>{if(t(e))return e}),t=>{let n=e=>U(j(Je(t,e),ut),""),r=n("name"),i="Instance"===n("level")?"Instance":"Collection",o=U(z(Je(t,"schema"),t=>SO(e,t)),null),s=n("mutationField"),a=j(Je(t,"aggregateIdField"),ut),l=U(z(Je(t,"references"),DO),[]),c=z(j(Je(t,"allowedStates"),ht),e=>me(e,ut)),u=j(Je(t,"targetState"),ut),d=j(z(j(Je(t,"requiredAccess"),ht),e=>me(e,ut)),e=>0===e.length?void 0:e);return{name:r,label:RO(TO(r)),schema:o,mutationDocument:""===s?"":NO(s,o,a),requiredRole:void 0,level:i,aggregateIdField:a,refFields:[],references:l,allowedStates:c,targetState:u,requiredAccess:d,ownerField:j(Je(t,"ownerField"),ut)}}))}function OO(e,t){return FO(e,e=>!IO(e),t)}function PO(e){return me(U(ht(e),[]),e=>z(ft(e),e=>{let t=t=>U(j(Je(e,t),ht),[]),n=(e,t)=>me(U(j(Je(e,t),ht),[]),ut),r=(t=>U(j(Je(e,t),ut),""))("pluginId"),i=e=>j(z(j(Je(e,"requiredAccess"),ht),e=>me(e,ut)),e=>0===e.length?void 0:e),o=me(t("readModels"),e=>z(ft(e),e=>{let t=t=>U(j(Je(e,t),ut),"");return{name:t("name"),schema:U(z(Je(e,"schema"),e=>SO(r,e)),null),queryDocument:"",queryField:t("queryField"),sortIndex:0,commands:[],linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Je(e,"labelFieldSource"),ut),searchableFields:n(e,"searchableFields"),lifecycleField:j(Je(e,"lifecycleField"),ut),requiredAccess:i(e),ownerField:j(Je(e,"ownerField"),ut)}})),s=me(t("aggregates"),e=>z(ft(e),e=>({name:(t=>U(j(Je(e,t),ut),""))("name"),schema:null,commands:FO(r,IO,U(Je(e,"commands"),[])),systemCommands:OO(r,U(Je(e,"commands"),[])),linkedViews:n(e,"linkedViews")}))),a=e=>me(t(e),e=>z(ft(e),e=>{let t=t=>U(j(Je(e,t),ut),"");return{name:t("name"),schema:U(z(Je(e,"schema"),e=>SO(r,e)),null),queryField:t("queryField"),sortIndex:0,linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Je(e,"labelFieldSource"),ut),searchableFields:n(e,"searchableFields"),lifecycleField:j(Je(e,"lifecycleField"),ut),requiredAccess:i(e),ownerField:j(Je(e,"ownerField"),ut)}})),l=a("stateViewSlices"),c=a("internalQueryables"),u=me(t("stateChangeSlices"),e=>z(ft(e),e=>({name:(t=>U(j(Je(e,t),ut),""))("name"),commands:FO(r,IO,U(Je(e,"commands"),[])),systemCommands:OO(r,U(Je(e,"commands"),[])),linkedViews:n(e,"linkedViews"),consistencyRead:j(Je(e,"consistencyRead"),ut)}))),d=z(j(Je(e,"derivedPages"),ht),e=>me(e,ut));return{id:r,name:r,readModels:o,aggregates:s,stateViewSlices:l,stateChangeSlices:u,internalQueryables:c,derivedPages:d}}))}function MO(e){if(e.startsWith("https://"))return"wss://"+e.slice(8);if(e.startsWith("http://"))return"ws://"+e.slice(7);if(!e.startsWith("/"))return e;return("https:"===location.protocol?"wss":"ws")+"://"+location.host+e}function LO(e){return"fleet"===e.toLowerCase()?"Fleet":"Single"}function zO(e){switch(e.toLowerCase()){case"cognito":return"Cognito";case"inmemory":case"local":return"Local";default:return"Anonymous"}}function jO(e){let t=He.object(e);if(void 0===t)return{TAG:"Error",_0:"config.json: top-level value is not an object"};let n=e=>j(t[e],He.string),r=n("apiEndpoint");if(void 0===r)return{TAG:"Error",_0:"config.json: missing required field `apiEndpoint`"};let i=U(n("platformApiEndpoint"),r),o=e=>j(t[e],He.bool);return{TAG:"Ok",_0:{apiEndpoint:r,platformApiEndpoint:i,platformApiSubscriptionEndpoint:U(n("platformApiSubscriptionEndpoint"),MO(i)),domainApiEventsEndpoint:n("domainApiEventsEndpoint"),platformApiEventsEndpoint:n("platformApiEventsEndpoint"),clientEventsNamespace:n("clientEventsNamespace"),liveUpdates:U(o("liveUpdates"),!0),liveReconnectRefetch:U(o("liveReconnectRefetch"),!0),platformReadModelPrefixes:U(z(j(t.platformReadModelPrefixes,He.array),e=>me(e,He.string)),fO),region:n("region"),authMode:U(z(n("authMode"),zO),"Anonymous"),identityProviderId:B(n("identityProviderId"),n("cognitoUserPoolId")),identityProviderClientId:B(n("identityProviderClientId"),n("cognitoClientId")),autoRedirectFirstPage:U(o("autoRedirectFirstPage"),!1),home:n("home"),mode:U(z(n("mode"),LO),"Single"),environment:n("environment"),platformName:n("platformName"),accessTiers:me(U(j(t.accessTiers,He.array),[]),He.string),viewModes:me(U(j(t.viewModes,He.array),[]),He.string),mapStyle:n("mapStyle"),graphLayout:n("graphLayout"),assetOrigins:(e=>U(z(j(t[e],He.object),e=>Object.fromEntries(me(Object.entries(e),e=>{let t=e[0];return z(He.string(e[1]),e=>[t,e])}))),{}))("assetOrigins"),uiHintsUrl:U(n("uiHintsUrl"),"/ui-hints.json"),manifestUrl:n("manifestUrl"),journeyManifestUrls:L(j(t.journeyManifestUrls,He.object),{},e=>{let t={};return((e,t)=>{for(var n in e)t(e[n],n)})(e,(e,n)=>M(He.string(e),e=>{t[n]=e})),t}),hostShellUrl:n("hostShellUrl"),deniedSurfaces:U(z(n("deniedSurfaces"),MF),"Lock"),appName:n("appName"),logoUrl:n("logoUrl"),theme:j(n("theme"),e=>{let t=function(e){switch(e){case"Dark":return"Dark";case"HighContrast":return"HighContrast";case"Light":return"Light";case"Neutral":return"Neutral";default:return}}(e);return void 0!==t?t:void console.warn('[Shell] config.json: unknown theme "'+e+'" — expected '+YF.join(", ")+". Opening on the default instead.")}),elevatedGroups:me(U(j(t.elevatedGroups,He.array),[]),He.string)}}}function UO(e){return ce(fetch(e).then(t=>t.ok?ce(t.json().then(t=>{let n=function(e){if(void 0!==He.array(e))return{TAG:"Ok",_0:PO(e)};let t=P(j(j(j(He.object(e),e=>e.data),He.object),e=>e.Platform_ComponentDefinitions),e=>$(He.array(e)));return void 0!==t?{TAG:"Ok",_0:PO(t)}:{TAG:"Error",_0:"expected a JSON array of component-definition entries (or a `{data:{Platform_ComponentDefinitions:[…]}}` envelope)"}}(t);return"Ok"===n.TAG?n:{TAG:"Error",_0:e+": "+n._0}}),t=>Promise.resolve({TAG:"Error",_0:e+": not valid JSON — "+String(t)})):Promise.resolve({TAG:"Error",_0:e+": fetch failed with status "+t.status.toString()})),t=>Promise.resolve({TAG:"Error",_0:e+": fetch threw — "+String(t)}))}function BO(e){let t=He.string(e);return void 0!==t?t:z(He.float(e),e=>e.toString())}function $O(e){return z(He.object(e),e=>({message:U(j(e.message,He.string),""),path:me(U(j(e.path,He.array),[]),BO),code:j(j(j(e.extensions,He.object),e=>e.code),He.string),errorType:j(e.errorType,He.string)}))}function qO(e){let t=He.object(e);return{data:U(j(t,e=>e.data),null),errors:me(U(j(j(t,e=>e.errors),He.array),[]),$O)}}function GO(e,t){let n=j(He.object(e.data),e=>e[t]);return void 0!==n&&"JSONNull"!==ct(n)?void 0:function(e,t){return e.errors.find(e=>mt(e.path[0],t))}(e,t)}function VO(e){return e.errors.some(e=>mt(e.code,"UNAUTHORIZED"))}let KO=gI;class WO extends Error{}function HO(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(n){return atob(t)}}WO.prototype.name="InvalidTokenError";let JO=function(e){return e&&e.name?String(e.name):"UnknownError"},XO=function(e){return e&&e.message?String(e.message):""};function QO(e){return{name:JO(e),message:XO(e)}}function YO(e){switch(e.name){case"PasswordResetRequiredException":return"Password reset required — contact your administrator";case"LimitExceededException":case"TooManyRequestsException":return"Too many attempts — please wait a moment and try again";case"UserNotConfirmedException":return"Account not confirmed — check your email";case"NotAuthorizedException":case"UserNotFoundException":return"Incorrect username or password";default:return"Sign-in failed. Please try again."}}var ZO,eP;!function(e){e.HTTP="http",e.HTTPS="https"}(ZO||(ZO={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(eP||(eP={}));const tP="__smithy_context";class nP{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new nP({...e,headers:{...e.headers}});return t.query&&(t.query=function(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}(t.query)),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return nP.clone(this)}}class rP{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}const iP={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},oP=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!nP.isInstance(n.request))return t(n);const{request:r}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let e=r.hostname;null!=r.port&&(e+=`:${r.port}`),r.headers.host=e}return t(n)})(e),iP)}}),sP={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},aP={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},lP=e=>e[tP]||(e[tP]={}),cP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const uP=(e,t)=>(n,r)=>async i=>{const o=((e,t)=>{if(!t||0===t.length)return e;const n=[];for(const r of t)for(const t of e)t.schemeId.split("#")[1]===r&&n.push(t);for(const r of e)n.find(({schemeId:e})=>e===r.schemeId)||n.push(r);return n})(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),s=function(e){const t=new Map;for(const n of e)t.set(n.schemeId,n);return t}(e.httpAuthSchemes),a=lP(r),l=[];for(const n of o){const i=s.get(n.schemeId);if(!i){l.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}const o=i.identityProvider(await t.identityProviderConfigProvider(e));if(!o){l.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:c={},signingProperties:u={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},c),n.signingProperties=Object.assign(n.signingProperties||{},u),a.selectedHttpAuthScheme={httpAuthOption:n,identity:await o(n.identityProperties),signer:i.signer};break}if(!a.selectedHttpAuthScheme)throw new Error(l.join("\n"));return n(i)},dP={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},fP=e=>e=>{throw e},hP=(e,t)=>{},pP={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},gP=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!nP.isInstance(n.request))return e(n);const r=lP(t).selectedHttpAuthScheme;if(!r)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:i={}},identity:o,signer:s}=r,a=await e({...n,request:await s.sign(n.request,o,i)}).catch((s.errorHandler||fP)(i));return(s.successHandler||hP)(a.response,i),a},pP)}}),mP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},vP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yP=Object.entries(vP).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),_P=vP.split(""),bP=e=>{let t=e.length/4*3;"=="===e.slice(-2)?t-=2:"="===e.slice(-1)&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let i=0;i<e.length;i+=4){let t=0,n=0;for(let r=i,a=i+3;r<=a;r++)if("="!==e[r]){if(!(e[r]in yP))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);t|=yP[e[r]]<<6*(a-r),n+=6}else t>>=6;const o=i/4*3;t>>=n%8;const s=Math.floor(n/8);for(let e=0;e<s;e++){const n=8*(s-e-1);r.setUint8(o+e,(t&255<<n)>>n)}}return new Uint8Array(n)},xP=e=>(new TextEncoder).encode(e),SP=e=>"string"==typeof e?xP(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),wP=e=>{if("string"==typeof e)return e;if("object"!=typeof e||"number"!=typeof e.byteOffset||"number"!=typeof e.byteLength)throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function EP(e){let t;t="string"==typeof e?xP(e):e;const n="object"==typeof t&&"number"==typeof t.length,r="object"==typeof t&&"number"==typeof t.byteOffset&&"number"==typeof t.byteLength;if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let o=0;o<t.length;o+=3){let e=0,n=0;for(let i=o,s=Math.min(o+3,t.length);i<s;i++)e|=t[i]<<8*(s-i-1),n+=8;const r=Math.ceil(n/6);e<<=6*r-n;for(let t=1;t<=r;t++){const n=6*(r-t);i+=_P[(e&63<<n)>>n]}i+="==".slice(0,4-r)}return i}class kP extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return"base64"===t?kP.mutate(bP(e)):kP.mutate(xP(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,kP.prototype),e}transformToString(e="utf-8"){return"base64"===e?EP(this):wP(this)}}const CP=e=>encodeURIComponent(e).replace(/[!'()*]/g,AP),AP=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function NP(e,t){return new Request(e,t)}function TP(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{const t=new Error(`Request did not complete within ${e} ms`);t.name="TimeoutError",n(t)},e)})}const RP={supported:void 0};class DP{config;configProvider;static create(e){return"function"==typeof e?.handle?e:new DP(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===RP.supported&&(RP.supported=Boolean("undefined"!=typeof Request&&"keepalive"in NP("https://[::1]")))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const r=n??this.config.requestTimeout,i=!0===this.config.keepAlive,o=this.config.credentials;if(t?.aborted){const e=IP(t);return Promise.reject(e)}let s=e.path;const a=function(e){const t=[];for(let n of Object.keys(e).sort()){const r=e[n];if(n=CP(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${CP(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${CP(r)}`),t.push(e)}}return t.join("&")}(e.query||{});a&&(s+=`?${a}`),e.fragment&&(s+=`#${e.fragment}`);let l="";if(null!=e.username||null!=e.password){l=`${e.username??""}:${e.password??""}@`}const{port:c,method:u}=e,d=`${e.protocol}//${l}${e.hostname}${c?`:${c}`:""}${s}`,f="GET"===u||"HEAD"===u?void 0:e.body,h={body:f,headers:new Headers(e.headers),method:u,credentials:o};this.config?.cache&&(h.cache=this.config.cache),f&&(h.duplex="half"),"undefined"!=typeof AbortController&&(h.signal=t),RP.supported&&(h.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(h,this.config.requestInit(e));let p=()=>{};const g=NP(d,h),m=[fetch(g).then(e=>{const t=e.headers,n={};for(const r of t.entries())n[r[0]]=r[1];return null!=e.body?{response:new rP({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new rP({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),TP(r)];return t&&m.push(new Promise((e,n)=>{const r=()=>{const e=IP(t);n(e)};if("function"==typeof t.addEventListener){const e=t;e.addEventListener("abort",r,{once:!0}),p=()=>e.removeEventListener("abort",r)}else t.onabort=r})),Promise.race(m).finally(p)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function IP(e){const t=e&&"object"==typeof e&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){const e=new Error("Request aborted");return e.name="AbortError",e.cause=t,e}const e=new Error(String(t));return e.name="AbortError",e}const n=new Error("Request aborted");return n.name="AbortError",n}const FP=async e=>"function"==typeof Blob&&e instanceof Blob||"Blob"===e.constructor?.name?void 0!==Blob.prototype.arrayBuffer?new Uint8Array(await e.arrayBuffer()):async function(e){const t=await function(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>{if(2!==r.readyState)return n(new Error("Reader aborted too early"));const e=r.result??"",i=e.indexOf(","),o=i>-1?i+1:e.length;t(e.substring(o))},r.onabort=()=>n(new Error("Read aborted")),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}(e),n=bP(t);return new Uint8Array(n)}(e):async function(e){const t=[],n=e.getReader();let r=!1,i=0;for(;!r;){const{done:e,value:o}=await n.read();o&&(t.push(o),i+=o.length),r=e}const o=new Uint8Array(i);let s=0;for(const a of t)o.set(a,s),s+=a.length;return o}(e);const OP={},PP={};for(let Oxe=0;Oxe<256;Oxe++){let e=Oxe.toString(16).toLowerCase();1===e.length&&(e=`0${e}`),OP[Oxe]=e,PP[e]=Oxe}function MP(e){let t="";for(let n=0;n<e.byteLength;n++)t+=OP[e[n]];return t}const LP=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return kP.mutate(e);if(!e)return kP.mutate(new Uint8Array);const n=t.streamCollector(e);return kP.mutate(await n)},zP=e=>"function"==typeof e?e():e,jP=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),UP=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1];const BP=e=>{if("string"==typeof e)return BP(new URL(e));const{hostname:t,pathname:n,port:r,protocol:i,search:o}=e;let s;return o&&(s=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(o)),{hostname:t,port:r?parseInt(r):void 0,protocol:i,path:n,query:s}},$P=e=>(t,n)=>async r=>{const{operationSchema:i}=lP(n),[,o,s,a,l,c]=i??[],u=n.endpointV2?async()=>(e=>{if("object"==typeof e){if("url"in e){const t=BP(e.url);if(e.headers){t.headers={};for(const n in e.headers)t.headers[n.toLowerCase()]=e.headers[n].join(", ")}return t}return e}return BP(e)})(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(jP(o,s,a,l,c),r.input,{...e,...n,endpoint:u});return t({...r,request:d})},qP={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},GP={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function VP(e){return{applyToStack:t=>{t.add($P(e),GP),t.add((e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:o}=lP(n),[,s,a,l,c,u]=o??[];try{return{response:i,output:await e.protocol.deserializeResponse(jP(s,a,l,c,u),{...e,...n},i)}}catch(Ene){if(Object.defineProperty(Ene,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in Ene)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{Ene.message+="\n "+t}catch(pU){n.logger&&"NoOpLogger"!==n.logger?.constructor?.name?n.logger?.warn?.(t):console.warn(t)}void 0!==Ene.$responseBodyText&&Ene.$response&&(Ene.$response.body=Ene.$responseBodyText);try{if(rP.isInstance(i)){const{headers:t={}}=i,n=Object.entries(t);Ene.$metadata={httpStatusCode:i.statusCode,requestId:UP(/^x-[\w-]+-request-?id$/,n),extendedRequestId:UP(/^x-[\w-]+-id-2$/,n),cfId:UP(/^x-[\w-]+-cf-id$/,n)}}}catch(pU){}}throw Ene}})(e),qP),e.protocol.setSerdeContext(e)}}}const KP=[];function WP(e){if("object"==typeof e)return e;if(KP[e|=0])return KP[e];const t={};let n=0;for(const r of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])1==(e>>n++&1)&&(t[r]=1);return KP[e]=t}const HP=Symbol.for("@smithy/nor-struct-it"),JP=Symbol.for("@smithy/ns"),XP=[],QP={};class YP{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=YP.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let r=e,i=e;for(this._isMemberSchema=!1;eM(r);)n.push(r[1]),r=r[0],i=zP(r),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let e=n.length-1;e>=0;--e){const t=n[e];Object.assign(this.memberTraits,WP(t))}}else this.memberTraits=0;if(i instanceof YP){const e=this.memberTraits;return Object.assign(this,i),this.memberTraits=Object.assign({},e,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,void(this.memberName=t??i.memberName)}if(this.schema=zP(i),tM(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);if(!t&&"object"==typeof e&&null!==e){return e.symbol===this.symbol}return t}static of(e){const t="function"==typeof e||"object"==typeof e&&null!==e;if("number"==typeof e){if(XP[e])return XP[e]}else if("string"==typeof e){if(QP[e])return QP[e]}else if(t&&e[JP])return e[JP];const n=zP(e);if(n instanceof YP)return n;if(eM(n)){const[t,r]=n;if(t instanceof YP)return Object.assign(t.getMergedTraits(),WP(r)),t;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const r=new YP(n);return t?e[JP]=r:"string"==typeof n?QP[n]=r:"number"==typeof n?XP[n]=r:r}getSchema(){const e=this.schema;return Array.isArray(e)&&0===e[0]?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return"number"==typeof e?e>=64&&e<128:1===e[0]}isMapSchema(){const e=this.getSchema();return"number"==typeof e?e>=128&&e<=255:2===e[0]}isStructSchema(){const e=this.getSchema();if("object"!=typeof e)return!1;const t=e[0];return 3===t||-3===t||4===t}isUnionSchema(){const e=this.getSchema();return"object"==typeof e&&4===e[0]}isBlobSchema(){const e=this.getSchema();return 21===e||42===e}isTimestampSchema(){const e=this.getSchema();return"number"==typeof e&&e>=4&&e<=7}isUnitSchema(){return"unit"===this.getSchema()}isDocumentSchema(){return 15===this.getSchema()}isStringSchema(){return 0===this.getSchema()}isBooleanSchema(){return 2===this.getSchema()}isNumericSchema(){return 1===this.getSchema()}isBigIntegerSchema(){return 17===this.getSchema()}isBigDecimalSchema(){return 19===this.getSchema()}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||42===this.getSchema()}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return WP(this.memberTraits)}getOwnTraits(){return WP(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema();return ZP([e?15:n[4]??0,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,r]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i="number"==typeof e?63&e:e&&"object"==typeof e&&(n||r)?e[3+e[0]]:t?15:void 0;if(null!=i)return ZP([i,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),r=t[5][n];return ZP(eM(r)?r:[r,0],e)}if(this.isDocumentSchema())return ZP([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch(t){}return e}getEventStreamMember(){if(this.isStructSchema())for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e;return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema(),t=e[4].length;let n=e[HP];if(n&&t===n.length)yield*n;else{n=Array(t);for(let r=0;r<t;++r){const t=e[4][r],i=ZP([e[5][r],0],t);yield n[r]=[t,i]}e[HP]=n}}}function ZP(e,t){if(e instanceof YP)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new YP(e,t)}const eM=e=>Array.isArray(e)&&2===e.length,tM=e=>Array.isArray(e)&&e.length>=5;class nM{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return nM.registries.has(e)||nM.registries.set(e,new nM(e)),nM.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[r,i]of e.schemas)t.has(r)||t.set(r,i);for(const[r,i]of e.exceptions)n.has(r)||n.set(r,i)}register(e,t){const n=this.normalizeShapeId(e);for(const r of[this,nM.for(n.split("#")[0])])r.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){const n=e,r=n[1];for(const i of[this,nM.for(r)])i.schemas.set(r+"#"+n[2],n),i.exceptions.set(n,t)}getErrorCtor(e){const t=e;if(this.exceptions.has(t))return this.exceptions.get(t);return nM.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,r=t+"#"+n;if(r.startsWith("smithy.ts.sdk.synthetic.")&&r.endsWith("ServiceException"))return e}}find(e){for(const t of this.schemas.values())if(e(t))return t}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const rM=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&pM.warn(hM(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},iM=Math.ceil(2**127*(2-2**-23)),oM=e=>{const t=rM(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>iM)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},sM=e=>lM(e,16),aM=e=>lM(e,8),lM=(e,t)=>{const n=(e=>{if(null!=e){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}})(e);if(void 0!==n&&cM(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},cM=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},uM=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,dM=e=>{const t=e.match(uM);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},fM=e=>sM("string"==typeof e?dM(e):e),hM=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),pM={warn:console.warn},gM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mM=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const vM=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),yM=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),_M=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),bM=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),xM=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=yM.exec(e);if(t){const[e,n,r,i,o,s,a,l]=t;return wM(fM(FM(i)),CM(r),RM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l})}if(t=_M.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return kM(wM(EM(i),CM(r),RM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l}))}if(t=bM.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return wM(fM(FM(l)),CM(n),RM(r.trimLeft(),"day",1,31),{hours:i,minutes:o,seconds:s,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},SM=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(e=>rM("string"==typeof e?dM(e):e))(e);else{if("object"!=typeof e||1!==e.tag)throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");t=e.value}if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(1e3*t))},wM=(e,t,n,r)=>{const i=t-1;return NM(e,i,n),new Date(Date.UTC(e,i,n,RM(r.hours,"hour",0,23),RM(r.minutes,"minute",0,59),RM(r.seconds,"seconds",0,60),DM(r.fractionalMilliseconds)))},EM=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+fM(FM(e));return n<t?n+100:n},kM=e=>e.getTime()-(new Date).getTime()>15768e8?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,CM=e=>{const t=mM.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},AM=[31,28,31,30,31,30,31,31,30,31,30,31],NM=(e,t,n)=>{let r=AM[t];if(1===t&&TM(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${mM[t]} in ${e}: ${n}`)},TM=e=>e%4==0&&(e%100!=0||e%400==0),RM=(e,t,n,r)=>{const i=(e=>aM("string"==typeof e?dM(e):e))(FM(e));if(i<n||i>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},DM=e=>null==e?0:1e3*(e=>oM("string"==typeof e?dM(e):e))("0."+e),IM=e=>{const t=e[0];let n=1;if("+"==t)n=1;else{if("-"!=t)throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);n=-1}return n*(60*Number(e.substring(1,3))+Number(e.substring(4,6)))*60*1e3},FM=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},OM="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),PM=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),MM=()=>{if(OM)return OM();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,PM[e[0]]+PM[e[1]]+PM[e[2]]+PM[e[3]]+"-"+PM[e[4]]+PM[e[5]]+"-"+PM[e[6]]+PM[e[7]]+"-"+PM[e[8]]+PM[e[9]]+"-"+PM[e[10]]+PM[e[11]]+PM[e[12]]+PM[e[13]]+PM[e[14]]+PM[e[15]]},LM=function(e){return Object.assign(new String(e),{deserializeJSON:()=>JSON.parse(String(e)),toString:()=>String(e),toJSON:()=>String(e)})};LM.from=e=>e&&"object"==typeof e&&(e instanceof LM||"deserializeJSON"in e)?e:"string"==typeof e||Object.getPrototypeOf(e)===String.prototype?LM(String(e)):LM(JSON.stringify(e)),LM.fromObject=LM.from;const zM=/^-?\d*(\.\d+)?$/;class jM{string;type;constructor(e,t){if(this.string=e,this.type=t,!zM.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||"object"!=typeof e)return!1;const t=e;return jM.prototype.isPrototypeOf(e)||"bigDecimal"===t.type&&zM.test(t.string)}}class UM{serdeContext;setSerdeContext(e){this.serdeContext=e}}class BM extends UM{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=nM.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return nP}getResponseType(){return rP}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,r]of t.url.searchParams.entries())e.query[n]=r;if(t.headers)for(const n in t.headers)e.headers[n]=t.headers[n].join(", ");return e}if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const n in t.headers)e.headers[n]=t.headers[n];return e}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const r=YP.of(t.input),i=WP(t.traits??{});if(i.endpoint){let t=i.endpoint?.[0];if("string"==typeof t){for(const[e,i]of r.structIterator()){if(!i.getMergedTraits().hostLabel)continue;const r=n[e];if("string"!=typeof r)throw new Error(`@smithy/core/schema - ${e} in input must be a string as hostLabel.`);t=t.replace(`{${e}}`,r)}e.hostname=t+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await t(async()=>{const{EventStreamSerde:e}=await import("./index-CIZ1gHoH.js");return{EventStreamSerde:e}},__vite__mapDeps([0]));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,r,i){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class $M extends BM{async serializeRequest(e,t,n){const r=this.serializer,i={},o={},s=await n.endpoint(),a=YP.of(e?.input),l=a.getSchema();let c;const u=t&&"object"==typeof t?t:{},d=new nP({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:o,body:void 0});if(s&&(this.updateServiceEndpoint(d,s),this.setHostPrefix(d,e,u)),u){const e=a.getEventStreamMember();if(e){if(u[e]){const t={};for(const[n,i]of a.structIterator())n!==e&&u[n]&&(r.write(i,u[n]),t[n]=r.flush());c=await this.serializeEventStream({eventStream:u[e],requestSchema:a,initialRequest:t})}}else r.write(l,u),c=r.flush()}return d.headers=Object.assign(d.headers,o),d.query=i,d.body=c,d.method="POST",d}async deserializeResponse(e,t,n){const r=this.deserializer,i=YP.of(e.output),o={};if(n.statusCode>=300){const i=await LP(n.body,t);throw i.byteLength>0&&Object.assign(o,await r.read(15,i)),await this.handleError(e,t,n,o,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const a in n.headers){const e=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=e}const s=i.getEventStreamMember();if(s)o[s]=await this.deserializeEventStream({response:n,responseSchema:i,initialResponseContainer:o});else{const e=await LP(n.body,t);e.byteLength>0&&Object.assign(o,await r.read(i,e))}return o.$metadata=this.deserializeMetadata(n),o}}function qM(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(5===e.getSchema()||6===e.getSchema()||7===e.getSchema()))return e.getSchema();const{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?"string"==typeof r||Boolean(i)?6:Boolean(o)||Boolean(n)?5:void 0:void 0)??t.timestampFormat.default}class GM{authSchemes=new Map;constructor(e){for(const t in e){const n=e[t];void 0!==n&&this.authSchemes.set(t,n)}}getIdentityProvider(e){return this.authSchemes.get(e)}}class VM{async sign(e,t,n){return e}}const KM=(WM=3e5,function(e){return HM(e)&&e.expiration.getTime()-Date.now()<WM});var WM;const HM=e=>void 0!==e.expiration;class JM{nodes;root;conditions;results;constructor(e,t,n,r){this.nodes=e,this.root=t,this.conditions=n,this.results=r}static from(e,t,n,r){return new JM(e,t,n,r)}}class XM extends Error{constructor(e){super(e),this.name="EndpointError"}}function QM(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${QM(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(QM).join(", ")})`:JSON.stringify(e,null,2)}const YM={};const ZM=(e,t)=>(e=>{const t=e.split("."),n=[];for(const r of t){const t=r.indexOf("[");if(-1!==t){if(r.indexOf("]")!==r.length-1)throw new XM(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new XM(`Invalid array index: '${i}' in path: '${e}'`);0!==t&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n})(t).reduce((n,r)=>{if("object"!=typeof n)throw new XM(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);if(Array.isArray(n)){const e=parseInt(r);return n[e<0?n.length+e:e]}return n[r]},e),eL=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),tL=(e,t=!1)=>{if(!t)return eL.test(e);const n=e.split(".");for(const r of n)if(!tL(r))return!1;return!0};const nL=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),rL=e=>nL.test(e)||e.startsWith("[")&&e.endsWith("]"),iL={[ZO.HTTP]:80,[ZO.HTTPS]:443};const oL={booleanEquals:(e,t)=>e===t,coalesce:function(...e){for(const t of e)if(null!=t)return t},getAttr:ZM,isSet:e=>null!=e,isValidHostLabel:tL,ite:function(e,t,n){return e?t:n},not:e=>!e,parseURL:e=>{const t=(()=>{try{if(e instanceof URL)return e;if("object"==typeof e&&"hostname"in e){const{hostname:t,port:n,protocol:r="",path:i="",query:o={}}=e,s=new URL(`${r}//${t}${n?`:${n}`:""}${i}`);return s.search=Object.entries(o).map(([e,t])=>`${e}=${t}`).join("&"),s}return new URL(e)}catch(Ene){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const n=t.href,{host:r,hostname:i,pathname:o,protocol:s,search:a}=t;if(a)return null;const l=s.slice(0,-1);if(!Object.values(ZO).includes(l))return null;const c=rL(i);return{scheme:l,authority:`${r}${n.includes(`${r}:${iL[l]}`)||"string"==typeof e&&e.includes(`${r}:${iL[l]}`)?`:${iL[l]}`:""}`,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:c}},split:function(e,t,n){if(1===n)return[e];if(""===e)return[""];const r=e.split(t);return 0===n?r:r.slice(0,n-1).concat(r.slice(1).join(t))},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>null==e||t>=n||e.length<n||/[^\u0000-\u007f]/.test(e)?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},sL=(e,t)=>{const n=[],{referenceRecord:r,endpointParams:i}=t;let o=0;for(;o<e.length;){const t=e.indexOf("{",o);if(-1===t){n.push(e.slice(o));break}n.push(e.slice(o,t));const s=e.indexOf("}",t);if(-1===s){n.push(e.slice(t));break}"{"===e[t+1]&&"}"===e[s+1]&&(n.push(e.slice(t+1,s)),o=s+2);const a=e.substring(t+1,s);if(a.includes("#")){const[e,t]=a.split("#");n.push(ZM(r[e]??i[e],t))}else n.push(r[a]??i[a]);o=s+1}return n.join("")},aL=(e,t,n)=>{if("string"==typeof e)return sL(e,n);if(e.fn)return cL.callFunction(e,n);if(e.ref)return(({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e])(e,n);throw new XM(`'${t}': ${String(e)} is not a string, function or reference.`)},lL=({fn:e,argv:t},n)=>{const r=Array(t.length);for(let s=0;s<r.length;++s){const e=t[s];r[s]="boolean"==typeof e||"number"==typeof e?e:cL.evaluateExpression(e,"arg",n)}const i=e.indexOf(".");if(-1!==i){const t=YM[e.slice(0,i)],n=t?.[e.slice(i+1)];if("function"==typeof n)return n(...r)}const o=oL[e];if("function"==typeof o)return o(...r);throw new Error(`function ${e} not loaded in endpointFunctions.`)},cL={evaluateExpression:aL,callFunction:lL},uL=(e,t)=>{const{assign:n}=e;if(n&&n in t.referenceRecord)throw new XM(`'${n}' is already defined in Reference Record.`);const r=lL(e,t);t.logger?.debug?.(`endpoints evaluateCondition: ${QM(e)} = ${QM(r)}`);const i=""===r||!!r;return null!=n?{result:i,toAssign:{name:n,value:r}}:{result:i}},dL=(e,t)=>Object.entries(e??{}).reduce((e,[n,r])=>(e[n]=r.map(e=>{const r=aL(e,"Header value entry",t);if("string"!=typeof r)throw new XM(`Header '${n}' value '${r}' is not a string`);return r}),e),{}),fL=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=pL.getEndpointProperty(r,t),e),{}),hL=(e,t)=>{if(Array.isArray(e))return e.map(e=>hL(e,t));switch(typeof e){case"string":return sL(e,t);case"object":if(null===e)throw new XM(`Unexpected endpoint property: ${e}`);return pL.getEndpointProperties(e,t);case"boolean":return e;default:throw new XM("Unexpected endpoint property type: "+typeof e)}},pL={getEndpointProperty:hL,getEndpointProperties:fL},gL=(e,t)=>{const n=aL(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(Ene){throw console.error(`Failed to construct URL with ${n}`,Ene),Ene}throw new XM("Endpoint URL must be a string, got "+typeof n)},mL=1e8,vL=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!vL(t))return!1;return!0}return!!tL(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!rL(e)))};let yL={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}]};const _L={isVirtualHostableS3Bucket:vL,parseArn:e=>{const t=e.split(":");if(t.length<6)return null;const[n,r,i,o,s,...a]=t;if("arn"!==n||""===r||""===i||""===a.join(":"))return null;return{partition:r,service:i,region:o,accountId:s,resourceId:a.map(e=>e.split("/")).flat()}},partition:e=>{const{partitions:t}=yL;for(const r of t){const{regions:t,outputs:n}=r;for(const[r,i]of Object.entries(t))if(r===e)return{...n,...i}}for(const r of t){const{regionRegex:t,outputs:n}=r;if(new RegExp(t).test(e))return{...n}}const n=t.find(e=>"aws"===e.id);if(!n)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}}};function bL(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}var xL;YM.aws=_L,function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(xL||(xL={}));const SL=xL.STANDARD,wL=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],EL=["TimeoutError","RequestTimeout","RequestTimeoutException"],kL=[500,502,503,504],CL=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],AL=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],NL=e=>429===e.$metadata?.httpStatusCode||wL.includes(e.name)||1==e.$retryable?.throttling,TL=(e,t=0)=>(e=>void 0!==e?.$retryable)(e)||(e=>e.$metadata?.clockSkewCorrected)(e)||EL.includes(e.name)||CL.includes(e?.code||"")||AL.includes(e?.code||"")||kL.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||function(e){return"ERR_HTTP2_STREAM_ERROR"===e.code&&e.message.includes("NGHTTP2_REFUSED_STREAM")}(e)||void 0!==e.cause&&t<=10&&TL(e.cause,t+1);class RL{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if("THROTTLING"===n?.errorType||NL(n?.error??e)){const e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const r=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(r)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.availableTokens){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(e=>RL.setTimeoutFn(e,t))}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp)return void(this.lastTimestamp=e);const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(2*e)/2;if(this.requestCount++,t>this.lastTxRateBucket){const e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}var DL={};class IL{static v2026="undefined"!=typeof process&&"true"===DL?.SMITHY_NEW_RETRIES_2026;static delay(){return IL.v2026?50:100}static throttlingDelay(){return IL.v2026?1e3:500}static cost(){return IL.v2026?14:5}static throttlingCost(){return IL.v2026?5:10}static modifiedCostType(){return IL.v2026?"THROTTLING":"TRANSIENT"}}class FL{x=IL.delay();computeNextBackoffDelay(e){const t=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(t)}setDelayBase(e){this.x=e}}class OL{delay;count;cost;longPoll;constructor(e,t,n,r){this.delay=e,this.count=t,this.cost=n,this.longPoll=r}getRetryCount(){return this.count}getRetryDelay(){return Math.min(2e4,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class PL{mode=xL.STANDARD;capacity=500;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(e){"number"==typeof e?this.maxAttemptsProvider=async()=>e:"function"==typeof e?this.maxAttemptsProvider=e:e&&"object"==typeof e&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>3,this.baseDelay??=IL.delay(),this.retryBackoffStrategy??=new FL}async acquireInitialRetryToken(e){return new OL(IL.delay(),0,void 0,IL.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),r=this.shouldRetry(e,t,n);if(r||e.isLongPoll?.()){const n=t.errorType;this.retryBackoffStrategy.setDelayBase("THROTTLING"===n?IL.throttlingDelay():this.baseDelay);const i=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let o=i;if(t.retryAfterHint instanceof Date&&(o=Math.max(i,Math.min(t.retryAfterHint.getTime()-Date.now(),i+5e3))),r){const t=this.getCapacityCost(n);return this.capacity-=t,new OL(o,e.getRetryCount()+1,t,e.isLongPoll?.()??!1)}throw Object.assign(new Error("No retry token available"),{$backoff:IL.v2026?o:0})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(Ene){return console.warn("Max attempts provider could not resolve. Using default of 3"),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===IL.modifiedCostType()?IL.throttlingCost():IL.cost()}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}async maxAttempts(){return this.maxAttemptsProvider()}}class ML{mode=xL.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new RL,this.standardRetryStrategy=new PL(t?{maxAttempts:"number"==typeof e?e:3,...t}:e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const LL=/\d{12}\.ddb/;const zL="user-agent",jL="x-amz-user-agent",UL=/[^!$%&'*+\-.^_`|~\w]/g,BL=/[^!$%&'*+\-.^_`|~\w#]/g;const $L=e=>(t,n)=>async r=>{const{request:i}=r;if(!nP.isInstance(i))return t(r);const{headers:o}=i,s=n?.userAgent?.map(qL)||[],a=(await e.defaultUserAgentProvider()).map(qL);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&bL(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();if("string"==typeof n.mode)switch(n.mode){case xL.ADAPTIVE:bL(e,"RETRY_MODE_ADAPTIVE","F");break;case xL.STANDARD:bL(e,"RETRY_MODE_STANDARD","E")}}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(LL)&&bL(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":bL(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":bL(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":bL(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&bL(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))bL(e,n,r)}}(n,e,r);const l=n;a.push(`m/${function(e){let t="";for(const n in e){const r=e[n];if(!(t.length+r.length+1<=1024))break;t.length?t+=","+r:t+=r}return t}(Object.assign({},n.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const c=e?.customUserAgent?.map(qL)||[],u=await e.userAgentAppId();u&&a.push(qL(["app",`${u}`]));const d=[].concat([...a,...s,...c]).join(" "),f=[...a.filter(e=>e.startsWith("aws-sdk-")),...c].join(" ");return"browser"!==e.runtime?(f&&(o[jL]=o[jL]?`${o[zL]} ${f}`:f),o[zL]=d):o[jL]=d,t({...r,request:i})},qL=e=>{const t=e[0].split("/").map(e=>e.replace(UL,"-")).join("/"),n=e[1]?.replace(BL,"-"),r=t.indexOf("/"),i=t.substring(0,r);let o=t.substring(r+1);return"api"===i&&(o=o.toLowerCase()),[i,o,n].filter(e=>e&&e.length>0).reduce((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}},"")},GL={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},VL=new Set,KL=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),WL=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const e=(e=>KL(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e)("function"==typeof t?await t():t);return((e,t=tL)=>{if(VL.has(e)||t(e))VL.add(e);else{if("*"!==e)throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.')}})(e),e},useFipsEndpoint:async()=>{const e="string"==typeof t?t:await t();return!!KL(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})},HL="content-length";const JL={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},XL=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(nP.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(HL))try{const t=n(e);r.headers={...r.headers,[HL]:String(t)}}catch(Ene){}}return e({...t,request:r})}),JL)}}),QL=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,YL=/(\d+\.){3}\d+/,ZL=/\.\./,ez=e=>QL.test(e)&&!YL.test(e)&&!ZL.test(e),tz=e=>{const[t,n,r,,,i]=e.split(":"),o="arn"===t&&e.split(":").length>=6,s=Boolean(o&&n&&r&&i);if(o&&!s)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return s},nz=(e,t,n,r=!1)=>{const i=async()=>{let i;if(r){const r=n.clientContextParams,o=r?.[e];i=o??n[e]??n[t]}else i=n[e]??n[t];return"function"==typeof i?i():i};return"credentialScope"===e||"CredentialScope"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:"accountId"===e||"AccountId"===t?async()=>{const e="function"==typeof n.credentials?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:"endpoint"===e||"endpoint"===t?async()=>{if(!1===n.isCustomEndpoint)return;const e=await i();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){const{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?":"+r:""}${i}`}}return e}:i},rz=async e=>{},iz=e=>{if("object"==typeof e){if("url"in e){const t=BP(e.url);if(e.headers){t.headers={};for(const[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(", ")}return t}return e}return BP(e)},oz=async(e,t,n)=>{const r={},i=t?.getEndpointParameterInstructions?.()||{};for(const[o,s]of Object.entries(i))switch(s.type){case"staticContextParams":r[o]=s.value;break;case"contextParams":r[o]=e[s.name];break;case"clientContextParams":case"builtInParams":r[o]=await nz(s.name,o,n,"builtInParams"!==s.type)();break;case"operationContextParams":r[o]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(i).length&&Object.assign(r,n),"s3"===String(n.serviceId).toLowerCase()&&await(async e=>{const t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),tz(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!ez(t)||-1!==t.indexOf(".")&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e})(r),r},sz=({config:e,instructions:t})=>(n,r)=>async i=>{e.isCustomEndpoint&&function(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}(r,"ENDPOINT_OVERRIDE","N");const o=await(async(e,t,n,r)=>{if(!n.isCustomEndpoint){let e;e=n.serviceConfiguredEndpoint?await n.serviceConfiguredEndpoint():await rz(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(iz(e)),n.isCustomEndpoint=!0)}const i=await oz(e,t,n);if("function"!=typeof n.endpointProvider)throw new Error("config.endpointProvider is not set.");const o=n.endpointProvider(i,r);if(n.isCustomEndpoint&&n.endpoint){const e=await n.endpoint();if(e?.headers){o.headers??={};for(const[t,n]of Object.entries(e.headers))o.headers[t]=Array.isArray(n)?n:[n]}}return o})(i.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=o,r.authSchemes=o.properties?.authSchemes;const s=r.authSchemes?.[0];if(s){r.signing_region=s.signingRegion,r.signing_service=s.signingName;const e=lP(r),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:s.signingRegion,signingRegion:s.signingRegion,signing_service:s.signingName,signingName:s.signingName,signingRegionSet:s.signingRegionSet},s.properties))}return n({...i})},az={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},lz=(e,t)=>({applyToStack:n=>{n.addRelativeTo(sz({config:e,instructions:t}),az)}}),cz=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):"string"==typeof e?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),uz=e=>{const{retryStrategy:t,retryMode:n}=e,r=cP(e.maxAttempts??3);let i=t?Promise.resolve(t):void 0;return Object.assign(e,{maxAttempts:r,retryStrategy:()=>i??=(async()=>await cP(n)()===xL.ADAPTIVE?new ML(r):new PL(r))()})},dz=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},fz=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,hz=()=>{let e=[],t=[],n=!1;const r=new Set,i=n=>(e.forEach(e=>{n.add(e.middleware,{...e})}),t.forEach(e=>{n.addRelativeTo(e.middleware,{...e})}),n.identifyOnResolve?.(a.identifyOnResolve()),n),o=e=>{const t=[];return e.before.forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))}),t.push(e),e.after.reverse().forEach(e=>{0===e.before.length&&0===e.after.length?t.push(e):t.push(...o(e))}),t},s=(n=!1)=>{const r=[],i=[],s={};e.forEach(e=>{const t={...e,before:[],after:[]};for(const n of dz(t.name,t.aliases))s[n]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const n of dz(t.name,t.aliases))s[n]=t;i.push(t)}),i.forEach(e=>{if(e.toMiddleware){const t=s[e.toMiddleware];if(void 0===t){if(n)return;throw new Error(`${e.toMiddleware} is not found when adding ${fz(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}});const a=(e=>e.sort((e,t)=>pz[t.step]-pz[e.step]||gz[t.priority||"normal"]-gz[e.priority||"normal"]))(r).map(o).reduce((e,t)=>(e.push(...t),e),[]);return a},a={add:(t,n={})=>{const{name:i,override:o,aliases:s}=n,a={step:"initialize",priority:"normal",middleware:t,...n},l=dz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${fz(i,s)}'`);for(const t of l){const n=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(-1===n)continue;const r=e[n];if(r.step!==a.step||a.priority!==r.priority)throw new Error(`"${fz(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${fz(i,s)}" middleware with ${a.priority} priority in ${a.step} step.`);e.splice(n,1)}}for(const e of l)r.add(e)}e.push(a)},addRelativeTo:(e,n)=>{const{name:i,override:o,aliases:s}=n,a={middleware:e,...n},l=dz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${fz(i,s)}'`);for(const e of l){const n=t.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(-1===n)continue;const r=t[n];if(r.toMiddleware!==a.toMiddleware||r.relation!==a.relation)throw new Error(`"${fz(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${fz(i,s)}" middleware ${a.relation} "${a.toMiddleware}" middleware.`);t.splice(n,1)}}for(const e of l)r.add(e)}t.push(a)},clone:()=>i(hz()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const o=e=>{const t=dz(e.name,e.aliases);if(t.includes(n)){i=!0;for(const e of t)r.delete(e);return!1}return!0};return e=e.filter(o),t=t.filter(o),i})(n):(n=>{let i=!1;const o=e=>{if(e.middleware===n){i=!0;for(const t of dz(e.name,e.aliases))r.delete(t);return!1}return!0};return e=e.filter(o),t=t.filter(o),i})(n),removeByTag:n=>{let i=!1;const o=e=>{const{tags:t,name:o,aliases:s}=e;if(t&&t.includes(n)){const e=dz(o,s);for(const t of e)r.delete(t);return i=!0,!1}return!0};return e=e.filter(o),t=t.filter(o),i},concat:e=>{const t=i(hz());return t.use(e),t.identifyOnResolve(n||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:i,identify:()=>s(!0).map(e=>{const t=e.step??e.relation+" "+e.toMiddleware;return fz(e.name,e.aliases)+" - "+t}),identifyOnResolve:e=>("boolean"==typeof e&&(n=e),n),resolve:(e,t)=>{for(const n of s().map(e=>e.middleware).reverse())e=n(e,t);return n&&console.log(a.identify()),e}};return a},pz={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gz={high:3,normal:2,low:1};class mz{config;middlewareStack=hz();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&"function"==typeof t&&(e.protocol=new t(n))}send(e,t,n){const r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n;let o;if(void 0===r&&!0===this.config.cacheMiddleware){this.handlers||(this.handlers=new WeakMap);const t=this.handlers;t.has(e.constructor)?o=t.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then(e=>e.output);o(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{})}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const vz="***SensitiveInformation***";function yz(e,t){if(null==t)return t;const n=YP.of(e);if(n.getMergedTraits().sensitive)return vz;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return vz}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return vz}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=yz(i,e[t]));return r}return t}let _z=class{middlewareStack=hz();schema;static classBuilder(){return new bz}resolveMiddlewareWithContext(e,t,n,{middlewareFn:r,clientName:i,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:a,smithyContext:l,additionalContext:c,CommandCtor:u}){for(const m of r.bind(this)(u,e,t,n))this.middlewareStack.use(m);const d=e.concat(this.middlewareStack),{logger:f}=t,h={logger:f,clientName:i,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:a,[tP]:{commandInstance:this,...l},...c},{requestHandler:p}=t;let g=n??{};return l.eventStream&&(g={isEventStream:!0,...g}),d.resolve(e=>p.handle(e.request,g),h)}};class bz{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let t;return t=class extends _z{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){const o=e._operationSchema,s=o?.[4]??o?.input,a=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?yz.bind(null,s):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?yz.bind(null,a):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class xz extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const t=e;return xz.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&("client"===t.$fault||"server"===t.$fault)}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===xz?xz.isInstance(e):!!xz.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const Sz=(e,t={})=>{Object.entries(t).filter(([,e])=>void 0!==e).forEach(([t,n])=>{null!=e[t]&&""!==e[t]||(e[t]=n)});const n=e.message||e.Message||"UnknownError";return e.message=n,delete e.Message,e},wz=e=>{switch(e){case"standard":case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},Ez=Object.values(eP),kz=e=>Object.assign((e=>{const t=[];for(const n in eP){const r=eP[n];void 0!==e[r]&&t.push({algorithmId:()=>r,checksumConstructor:()=>e[r]})}for(const[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};const r=n.algorithmId(),i=n.checksumConstructor();Ez.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms:()=>t}})(e),(e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy:()=>e.retryStrategy}))(e)),Cz=e=>Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{const n=e.algorithmId();Ez.includes(n)&&(t[n]=e.checksumConstructor())}),t})(e),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(e));class Az{trace(){}debug(){}info(){}warn(){}error(){}}const Nz=e=>e?.body instanceof ReadableStream;const Tz=e=>new Promise(t=>setTimeout(t,e)),Rz=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,Dz=(e,t)=>{const n={error:e,errorType:Iz(e)},r=function(e,t){if(rP.isInstance(e))for(const n of Object.keys(e.headers)){const r=n.toLowerCase();if("retry-after"===r){const r=e.headers[n];let i=NaN;if(r.endsWith("GMT"))try{i=(xM(r).getTime()-Date.now())/1e3}catch(pU){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(pU)}else r.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?i=Number(r.match(/ GMT, ([\d.]+)$/)?.[1]):r.match(/^((\d+)|(\d+\.\d+))$/)?i=Number(r):Date.parse(r)>=Date.now()&&(i=(Date.parse(r)-Date.now())/1e3);if(isNaN(i))return;return new Date(Date.now()+1e3*i)}if("x-amz-retry-after"===r){const r=e.headers[n],i=Number(r);return isNaN(i)?void t?.trace?.(`Failed to parse x-amz-retry-after=${r}`):new Date(Date.now()+i)}}}(e.$response,t);return r&&(n.retryAfterHint=r),n},Iz=e=>NL(e)?"THROTTLING":TL(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!TL(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",Fz={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Oz=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const o=await e.maxAttempts();if(!Rz(i))return i?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,r);{let a=await i.acquireInitialRetryToken((n.partition_id??"")+(n.__retryLongPoll?":longpoll":"")),l=new Error,c=0,u=0;const{request:d}=r,f=nP.isInstance(d);for(f&&(d.headers["amz-sdk-invocation-id"]=MM());;)try{f&&(d.headers["amz-sdk-request"]=`attempt=${c+1}; max=${o}`);const{response:e,output:n}=await t(r);return i.recordSuccess(a),n.$metadata.attempts=c+1,n.$metadata.totalRetryDelay=u,{response:e,output:n}}catch(pU){const r=Dz(pU,e.logger);if(l=cz(pU),f&&Nz(d))throw(n.logger instanceof Az?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),l;try{a=await i.refreshRetryTokenForRetry(a,r)}catch(s){throw"number"==typeof s.$backoff&&await Tz(s.$backoff),l.$metadata||(l.$metadata={}),l.$metadata.attempts=c+1,l.$metadata.totalRetryDelay=u,l}c=a.getRetryCount();const o=a.getRetryDelay();u+=o,await Tz(o)}}})(e),Fz)}}),Pz=e=>rP.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Mz=e=>new Date(Date.now()+e),Lz=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(Mz(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},zz=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class jz{async sign(e,t,n){if(!nP.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=zz("context",e.context),n=zz("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=zz("signer",n.signer),o=await i(r),s=e?.signingRegion,a=e?.signingRegionSet,l=e?.signingName;return{config:n,signer:o,signingRegion:s,signingRegionSet:a,signingName:l}})(n),{config:i,signer:o}=r;let{signingRegion:s,signingName:a}=r;const l=n.context;if(l?.authSchemes?.length){const[e,t]=l.authSchemes;"sigv4a"===e?.name&&"sigv4"===t?.name&&(s=t?.signingRegion??s,a=t?.signingName??a)}return await o.sign(e,{signingDate:Mz(i.systemClockOffset),signingRegion:s,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??Pz(t.$response);if(n){const r=zz("config",e.config),i=r.systemClockOffset;r.systemClockOffset=Lz(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=Pz(e);if(n){const e=zz("config",t.config);e.systemClockOffset=Lz(n,e.systemClockOffset)}}}const Uz=(e,t,n)=>{let r,i,o,s=!1;return async t=>(o&&!t?.forceRefresh||(r=await(async()=>{i||(i=e());try{r=await i,o=!0,s=!1}finally{i=void 0}return r})()),r)},Bz="X-Amz-Date",$z="X-Amz-Signature",qz="X-Amz-Security-Token",Gz="authorization",Vz=Bz.toLowerCase(),Kz=[Gz,Vz,"date"],Wz=$z.toLowerCase(),Hz="x-amz-content-sha256",Jz=qz.toLowerCase(),Xz={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Qz=/^proxy-/,Yz=/^sec-/,Zz="AWS4-HMAC-SHA256",ej="AWS4-HMAC-SHA256-PAYLOAD",tj="aws4_request",nj={},rj=[],ij=(e,t,n)=>`${e}/${t}/${n}/${tj}`,oj=(e,t,n)=>{const r=new e(t);return r.update(SP(n)),r.digest()},sj=({headers:e},t,n)=>{const r={};for(const i of Object.keys(e).sort()){if(null==e[i])continue;const o=i.toLowerCase();(o in Xz||t?.has(o)||Qz.test(o)||Yz.test(o))&&(!n||n&&!n.has(o))||(r[o]=e[i].trim().replace(/\s+/g," "))}return r},aj=async({headers:e,body:t},n)=>{for(const i of Object.keys(e))if(i.toLowerCase()===Hz)return e[i];if(null==t)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if("string"==typeof t||ArrayBuffer.isView(t)||(r=t,"function"==typeof ArrayBuffer&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(r))){const e=new n;return e.update(SP(t)),MP(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class lj{format(e){const t=[];for(const i of Object.keys(e)){const n=xP(i);t.push(Uint8Array.from([n.byteLength]),n,this.formatHeaderValue(e[i]))}const n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0));let r=0;for(const i of t)n.set(i,r),r+=i.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":const i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":const s=xP(e.value),a=new DataView(new ArrayBuffer(3+s.byteLength));a.setUint8(0,7),a.setUint16(1,s.byteLength,!1);const l=new Uint8Array(a.buffer);return l.set(s,3),l;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(dj.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!uj.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const u=new Uint8Array(17);return u[0]=9,u.set(function(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in PP))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=PP[r]}return t}(e.value.replace(/\-/g,"")),1),u}}}var cj;!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}(cj||(cj={}));const uj=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class dj{bytes;constructor(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const t=new Uint8Array(8);for(let n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&fj(t),new dj(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&fj(e),parseInt(MP(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function fj(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const hj=e=>{e=nP.clone(e);for(const t of Object.keys(e.headers))Kz.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},pj=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class gj{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){this.service=r,this.sha256=i,this.uriEscapePath=o,this.applyChecksum="boolean"!=typeof e||e,this.regionProvider=cP(n),this.credentialProvider=cP(t)}createCanonicalRequest(e,t,n){const r=Object.keys(t).sort();return`${e.method}\n${this.getCanonicalPath(e)}\n${(({query:e={}})=>{const t=[],n={};for(const r of Object.keys(e)){if(r.toLowerCase()===Wz)continue;const i=CP(r);t.push(i);const o=e[r];"string"==typeof o?n[i]=`${i}=${CP(o)}`:Array.isArray(o)&&(n[i]=o.slice(0).reduce((e,t)=>e.concat([`${i}=${CP(t)}`]),[]).sort().join("&"))}return t.sort().map(e=>n[e]).filter(e=>e).join("&")})(e)}\n${r.map(e=>`${e}:${t[e]}`).join("\n")}\n\n${r.join(";")}\n${n}`}async createStringToSign(e,t,n,r){const i=new this.sha256;i.update(SP(n));return`${r}\n${e}\n${t}\n${MP(await i.digest())}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const r of e.split("/"))0!==r?.length&&"."!==r&&(".."===r?t.pop():t.push(r));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return CP(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if("object"!=typeof e||"string"!=typeof e.accessKeyId||"string"!=typeof e.secretAccessKey)throw new Error("Resolved credential object is not valid")}formatDate(e){const t=(e=>pj(e).toISOString().replace(/\.\d{3}Z$/,"Z"))(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class mj extends gj{headerFormatter=new lj;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:o,signableHeaders:s,hoistableHeaders:a,signingRegion:l,signingService:c}=t,u=await this.credentialProvider();this.validateResolvedCredentials(u);const d=l??await this.regionProvider(),{longDate:f,shortDate:h}=this.formatDate(n);if(r>604800)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const p=ij(h,d,c??this.service),g=((e,t={})=>{const{headers:n,query:r={}}=nP.clone(e);for(const i of Object.keys(n)){const e=i.toLowerCase();("x-amz-"===e.slice(0,6)&&!t.unhoistableHeaders?.has(e)||t.hoistableHeaders?.has(e))&&(r[i]=n[i],delete n[i])}return{...e,headers:n,query:r}})(hj(e),{unhoistableHeaders:o,hoistableHeaders:a});u.sessionToken&&(g.query[qz]=u.sessionToken),g.query["X-Amz-Algorithm"]=Zz,g.query["X-Amz-Credential"]=`${u.accessKeyId}/${p}`,g.query[Bz]=f,g.query["X-Amz-Expires"]=r.toString(10);const m=sj(g,i,s);return g.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(m),g.query[$z]=await this.getSignature(f,p,this.getSigningKey(u,d,h,c),this.createCanonicalRequest(g,m,await aj(e,this.sha256))),g}async sign(e,t){return"string"==typeof e?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:r,signingRegion:i,signingService:o,eventStreamCredentials:s}){const a=i??await this.regionProvider(),{shortDate:l,longDate:c}=this.formatDate(n),u=ij(l,a,o??this.service),d=await aj({headers:{},body:t},this.sha256),f=new this.sha256;f.update(e);const h=MP(await f.digest()),p=[ej,c,u,r,h,d].join("\n");return this.signString(p,{signingDate:n,signingRegion:a,signingService:o,eventStreamCredentials:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r,eventStreamCredentials:i}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature,eventStreamCredentials:i}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:r,eventStreamCredentials:i}={}){const o=i??await this.credentialProvider();this.validateResolvedCredentials(o);const s=n??await this.regionProvider(),{shortDate:a}=this.formatDate(t),l=new this.sha256(await this.getSigningKey(o,s,a,r));return l.update(SP(e)),MP(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:o}={}){const s=await this.credentialProvider();this.validateResolvedCredentials(s);const a=i??await this.regionProvider(),l=hj(e),{longDate:c,shortDate:u}=this.formatDate(t),d=ij(u,a,o??this.service);l.headers[Vz]=c,s.sessionToken&&(l.headers[Jz]=s.sessionToken);const f=await aj(l,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(Hz,l.headers)&&this.applyChecksum&&(l.headers[Hz]=f);const h=sj(l,r,n),p=await this.getSignature(c,d,this.getSigningKey(s,a,u,o),this.createCanonicalRequest(l,h,f));return l.headers[Gz]=`${Zz} Credential=${s.accessKeyId}/${d}, SignedHeaders=${this.getCanonicalHeaderList(h)}, Signature=${p}`,l}async getSignature(e,t,n,r){const i=await this.createStringToSign(e,t,r,Zz),o=new this.sha256(await n);return o.update(SP(i)),MP(await o.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const o=`${n}:${r}:${i}:${MP(await oj(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(o in nj)return nj[o];for(rj.push(o);rj.length>50;)delete nj[rj.shift()];let s=`AWS4${t.secretAccessKey}`;for(const a of[n,r,i,tj])s=await oj(e,s,a);return nj[o]=s})(this.sha256,e,n,t,r||this.service)}}const vj=e=>{let t,n=e.credentials,r=!!e.credentials;Object.defineProperty(e,"credentials",{set(i){i&&i!==n&&i!==t&&(r=!0),n=i;const o=function(e,{credentials:t,credentialDefaultProvider:n}){let r;r=t?t?.memoized?t:((e,t,n)=>{if(void 0===e)return;const r="function"!=typeof e?async()=>Promise.resolve(e):e;let i,o,s,a=!1;const l=async e=>{o||(o=r(e));try{i=await o,s=!0,a=!1}finally{o=void 0}return i};return void 0===t?async e=>(s&&!e?.forceRefresh||(i=await l(e)),i):async e=>(s&&!e?.forceRefresh||(i=await l(e)),a?i:n(i)?t(i)?(await l(e),i):i:(a=!0,i))})(t,KM,HM):n?mP(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),s=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,o);if(r&&!s.attributed){const e="object"==typeof n&&null!==n;t=async t=>{const n=await s(t);return!e||n.$source&&0!==Object.keys(n.$source).length?n:function(e,t,n){return e.$source||(e.$source={}),e.$source[t]=n,e}(n,"CREDENTIALS_CODE","e")},t.memoized=s.memoized,t.configBound=s.configBound,t.attributed=!0}else t=s},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:i=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:s}=e;let a;a=e.signer?mP(e.signer):e.regionInfoProvider?()=>mP(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{const{signingRegion:r,signingService:o}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||o||e.serviceId;const a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i};return new(e.signerConstructor||mj)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await mP(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const o={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i};return new(e.signerConstructor||mj)(o)};return Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:a})};const yj=async(e,t,n)=>({operation:lP(t).operation,region:await cP(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const _j=e=>{const t=[];switch(e.operation){case"AssociateSoftwareToken":case"ChangePassword":case"CompleteWebAuthnRegistration":case"ConfirmDevice":case"ConfirmForgotPassword":case"ConfirmSignUp":case"DeleteUser":case"DeleteUserAttributes":case"DeleteWebAuthnCredential":case"ForgetDevice":case"ForgotPassword":case"GetDevice":case"GetTokensFromRefreshToken":case"GetUser":case"GetUserAttributeVerificationCode":case"GetUserAuthFactors":case"GlobalSignOut":case"InitiateAuth":case"ListDevices":case"ListWebAuthnCredentials":case"ResendConfirmationCode":case"RespondToAuthChallenge":case"RevokeToken":case"SetUserMFAPreference":case"SetUserSettings":case"SignUp":case"StartWebAuthnRegistration":case"UpdateAuthEventFeedback":case"UpdateDeviceStatus":case"UpdateUserAttributes":case"VerifySoftwareToken":case"VerifyUserAttribute":t.push({schemeId:"smithy.api#noAuth"});break;default:t.push(function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}(e))}return t},bj={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},xj="3.1033.0";var Sj="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function wj(e){return e instanceof Uint8Array?e:"string"==typeof e?Sj(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Ej(e){return"string"==typeof e?0===e.length:0===e.byteLength}var kj={name:"SHA-256"},Cj={name:"HMAC",hash:kj},Aj=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const Nj={};function Tj(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:Nj}var Rj=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!Ej(e)){var t=wj(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return Tj().crypto.subtle.sign(Cj,t,e.toHash).then(function(e){return new Uint8Array(e)})}):Ej(this.toHash)?Promise.resolve(Aj):Promise.resolve().then(function(){return Tj().crypto.subtle.digest(kj,e.toHash)}).then(function(e){return Promise.resolve(new Uint8Array(e))})},e.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&void 0!==this.secret&&(this.key=new Promise(function(t,n){Tj().crypto.subtle.importKey("raw",wj(e.secret),Cj,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function Dj(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(pU){o(pU)}}function a(e){try{l(r.throw(e))}catch(pU){o(pU)}}function l(e){e.done?i(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())})}function Ij(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(pU){a=[6,pU],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError;var Fj=64,Oj=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pj=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Mj=Math.pow(2,53)-1,Lj=function(){function e(){this.state=Int32Array.from(Pj),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>Mj)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===Fj&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%Fj>=56){for(var r=this.bufferLength;r<Fj;r++)t.setUint8(r,0);this.hashBuffer(),this.bufferLength=0}for(r=this.bufferLength;r<56;r++)t.setUint8(r,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(32);for(r=0;r<8;r++)i[4*r]=this.state[r]>>>24&255,i[4*r+1]=this.state[r]>>>16&255,i[4*r+2]=this.state[r]>>>8&255,i[4*r+3]=this.state[r]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=0;u<Fj;u++){if(u<16)this.temp[u]=(255&e[4*u])<<24|(255&e[4*u+1])<<16|(255&e[4*u+2])<<8|255&e[4*u+3];else{var d=this.temp[u-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[u-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[u]=(f+this.temp[u-7]|0)+(h+this.temp[u-16]|0)}var p=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&a^~s&l)|0)+(c+(Oj[u]+this.temp[u]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;c=l,l=a,a=s,s=o+p|0,o=i,i=r,r=n,n=p+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=s,t[5]+=a,t[6]+=l,t[7]+=c},e}(),zj=function(){function e(e){this.secret=e,this.hash=new Lj,this.reset()}return e.prototype.update=function(e){if(!Ej(e)&&!this.error)try{this.hash.update(wj(e))}catch(pU){this.error=pU}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return Dj(this,void 0,void 0,function(){return Ij(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new Lj,this.secret){this.outer=new Lj;var e=function(e){var t=wj(e);if(t.byteLength>Fj){var n=new Lj;n.update(t),t=n.digest()}var r=new Uint8Array(Fj);return r.set(t),r}(this.secret),t=new Uint8Array(Fj);t.set(e);for(var n=0;n<Fj;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(n=0;n<e.byteLength;n++)e[n]=0}},e}();var jj=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Uj(e){return!(!function(e){if("object"==typeof e&&"object"==typeof e.crypto){return"function"==typeof e.crypto.getRandomValues}return!1}(e)||"object"!=typeof e.crypto.subtle)&&function(e){return e&&jj.every(function(t){return"function"==typeof e[t]})}(e.crypto.subtle)}var Bj=function(){function e(e){Uj(Tj())?this.hash=new Rj(e):this.hash=new zj(e)}return e.prototype.update=function(e,t){this.hash.update(wj(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();const $j=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window?window.navigator:void 0,i=r?.userAgent??"",o=r?.userAgentData?.platform??qj.os(i)??"other",s=r?.userAgentData?.brands??[],a=s[s.length-1],l=a?.brand??qj.browser(i)??"unknown",c=[["aws-sdk-js",t],["ua","2.1"],[`os/${o}`,void 0],["lang/js"],["md/browser",`${l}_${a?.version??"unknown"}`]];e&&c.push([`api/${e}`,t]);const u=await(n?.userAgentAppId?.());return u&&c.push([`app/${u}`]),c},qj={os:e=>/iPhone|iPad|iPod/.test(e)?"iOS":/Macintosh|Mac OS X/.test(e)?"macOS":/Windows NT/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":void 0,browser:e=>/EdgiOS|EdgA|Edg\//.test(e)?"Microsoft Edge":/Firefox\//.test(e)?"Firefox":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)?"Safari":void 0},Gj=e=>()=>Promise.reject(e),Vj="function"==typeof TextEncoder?new TextEncoder:null,Kj=e=>{if("string"==typeof e){if(Vj)return Vj.encode(e).byteLength;let t=e.length;for(let n=t-1;n>=0;n--){const r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.size)return e.size;throw new Error(`Body Length computation failed for ${e}`)},Wj=["in-region","cross-region","mobile","standard","legacy"],Hj=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:n,downlink:r}=e?.connection;if("string"==typeof t&&"4g"!==t||Number(n)>100||Number(r)<10)return!0}return e?.userAgentData?.mobile||"number"==typeof e?.maxTouchPoints&&e?.maxTouchPoints>1};class Jj{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),r=Object.values(n).find(e=>!!e.getMergedTraits().httpPayload);if(r){const t=r.getMergedTraits().mediaType;return t||(r.isStringSchema()?"text/plain":r.isBlobSchema()?"application/octet-stream":e)}if(!t.isUnitSchema()){const t=Object.values(n).find(e=>{const{httpQuery:t,httpQueryParams:n,httpHeader:r,httpLabel:i,httpPrefixHeaders:o}=e.getMergedTraits();return!t&&!n&&!r&&!i&&void 0===o});if(t)return e}}async getErrorSchemaOrThrowBaseException(e,t,n,r,i,o){let s=e;e.includes("#")&&([,s]=e.split("#"));const a={$metadata:i,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:o?.(this.errorRegistry,s)??this.errorRegistry.getSchema(e),errorMetadata:a}}catch(pU){r.message=r.message??r.Message??"UnknownError";const t=this.errorRegistry,n=t.getBaseException();if(n){const e=t.getErrorCtor(n)??Error;throw this.decorateServiceException(Object.assign(new e({name:s}),a),r)}const i=r,o=i?.message??i?.Message??i?.Error?.Message??i?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(o),{name:s},a),r)}}compose(e,t,n){let r=n;t.includes("#")&&([r]=t.split("#"));const i=nM.for(r),o=nM.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(i),e.copyFrom(o),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,r=Sz(e,t);n&&(r.message=n);const i=r.Error??{};i.Type=r.Error?.Type,i.Code=r.Error?.Code,i.Message=r.Error?.message??r.Error?.Message??n,r.Error=i;const o=r.$metadata.requestId;return o&&(r.RequestId=o),r}return Sz(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(void 0!==e&&null!=n){const[t,r]=n.split(";"),i=Object.keys(e),o={Code:t,Type:r};e.Code=t,e.Type=r;for(let n=0;n<i.length;n++){const t=i[n];o["message"===t?"Message":t]=e[t]}delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch(pU){return e.find(e=>YP.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}class Xj{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Qj{from;to;keys;constructor(e,t){this.from=e,this.to=t;const n=Object.keys(this.from),r=new Set(n);r.delete("__type"),this.keys=r}mark(e){this.keys.delete(e)}hasUnknown(){return 1===this.keys.size&&0===Object.keys(this.to).length}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function Yj(e,t,n){if(n?.source){const e=n.source;if("number"==typeof t&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||e!==String(t))){return e.includes(".")?new jM(e,"bigDecimal"):BigInt(e)}}return t}const Zj=(e,t)=>((e,t)=>LP(e,t).then(e=>(t?.utf8Encoder??wP)(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(pU){throw"SyntaxError"===pU?.name&&Object.defineProperty(pU,"$responseBodyText",{value:e}),pU}return{}}),eU=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),tU=e=>{let t=e;return"number"==typeof t&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t};class nU extends Xj{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,"string"==typeof t?JSON.parse(t,Yj):await Zj(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=null!==t&&"object"==typeof t,r=YP.of(e);if(n){if(r.isStructSchema()){const e=t,n=r.isUnionSchema(),i={};let o;const{jsonName:s}=this.settings;let a;s&&(o={}),n&&(a=new Qj(e,i));for(const[t,l]of r.structIterator()){let r=t;s&&(r=l.getMergedTraits().jsonName??r,o[r]=t),n&&a.mark(r),null!=e[r]&&(i[t]=this._read(l,e[r]))}if(n)a.writeUnknown();else if("string"==typeof e.__type)for(const t in e){const n=e[t],r=s?o[t]??t:t;r in i||(i[r]=n)}return i}if(Array.isArray(t)&&r.isListSchema()){const e=r.getValueSchema(),n=[];for(const r of t)n.push(this._read(e,r));return n}if(r.isMapSchema()){const e=r.getValueSchema(),n={};for(const r in t)n[r]=this._read(e,t[r]);return n}}if(r.isBlobSchema()&&"string"==typeof t)return bP(t);const i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&"string"==typeof t&&i){return"application/json"===i||i.endsWith("+json")?LM.from(t):t}if(r.isTimestampSchema()&&null!=t){switch(qM(r,this.settings)){case 5:return(e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=vM.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[n,r,i,o,s,a,l,c,u]=t,d=fM(FM(r)),f=RM(i,"month",1,12),h=RM(o,"day",1,31),p=wM(d,f,h,{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c});return"Z"!=u.toUpperCase()&&p.setTime(p.getTime()-IM(u)),p})(t);case 6:return xM(t);case 7:return SM(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}}if(r.isBigIntegerSchema()&&("number"==typeof t||"string"==typeof t))return BigInt(t);if(r.isBigDecimalSchema()&&null!=t){if(t instanceof jM)return t;const e=t;return"bigDecimal"===e.type&&"string"in e?new jM(e.string,e.type):new jM(String(t),"bigDecimal")}if(r.isNumericSchema()&&"string"==typeof t){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(r.isDocumentSchema()){if(n){const e=Array.isArray(t)?[]:{};for(const n in t){const i=t[n];e[n]=i instanceof jM?i:this._read(r,i)}return e}return structuredClone(t)}return t}}const rU=String.fromCharCode(925);class iU{values=new Map;counter=0;stage=0;createReplacer(){if(1===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(2===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(e,t)=>{if(t instanceof jM){const e=rU+"nv"+this.counter+++"_"+t.string;return this.values.set(`"${e}"`,t.string),e}if("bigint"==typeof t){const e=t.toString(),n=rU+"b"+this.counter+++"_"+e;return this.values.set(`"${n}"`,e),n}return t}}replaceInJson(e){if(0===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(2===this.stage)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,0===this.counter)return e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class oU extends Xj{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=YP.of(e),this.buffer=this._write(this.rootSchema,t)}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const e=new iU;return e.replaceInJson(JSON.stringify(this.buffer,e.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(e,t){this.write(e,t),"object"==typeof this.buffer&&(this.buffer.__type=YP.of(e).getName(!0))}_write(e,t,n){const r=null!==t&&"object"==typeof t,i=YP.of(e);if(r){if(i.isStructSchema()){const e=t,n={},{jsonName:r}=this.settings;let o;r&&(o={});let s=0;for(const[t,a]of i.structIterator()){const l=this._write(a,e[t],i);if(void 0!==l){let e=t;r&&(e=a.getMergedTraits().jsonName??t,o[t]=e),n[e]=l,s++}}if(i.isUnionSchema()&&0===s){const{$unknown:t}=e;if(Array.isArray(t)){const[e,r]=t;n[e]=this._write(15,r)}}else if("string"==typeof e.__type)for(const t in e){const i=e[t],s=r?o[t]??t:t;s in n||(n[s]=this._write(15,i))}return n}if(Array.isArray(t)&&i.isListSchema()){const e=i.getValueSchema(),n=[],r=!!i.getMergedTraits().sparse;for(const i of t)(r||null!=i)&&n.push(this._write(e,i));return n}if(i.isMapSchema()){const e=i.getValueSchema(),n={},r=!!i.getMergedTraits().sparse;for(const i in t){const o=t[i];(r||null!=o)&&(n[i]=this._write(e,o))}return n}if(t instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??EP)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema())){switch(qM(i,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return function(e){const t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),a=e.getUTCSeconds(),l=o<10?`0${o}`:`${o}`,c=s<10?`0${s}`:`${s}`,u=a<10?`0${a}`:`${a}`;return`${gM[r]}, ${i<10?`0${i}`:`${i}`} ${mM[n]} ${t} ${l}:${c}:${u} GMT`}(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}}t instanceof jM&&(this.useReplacer=!0)}if(null!==t||!n?.isStructSchema()){if(i.isStringSchema()){if(void 0===t&&i.isIdempotencyToken())return MM();const e=i.getMergedTraits().mediaType;if(null!=t&&e){if("application/json"===e||e.endsWith("+json"))return LM.from(t)}return t}if("number"==typeof t&&i.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if("string"==typeof t&&i.isBlobSchema())return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??EP)(t);if("bigint"==typeof t&&(this.useReplacer=!0),i.isDocumentSchema()){if(r){const e=Array.isArray(t)?[]:{};for(const n in t){const r=t[n];r instanceof jM?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r)}return e}return structuredClone(t)}return t}}}class sU extends Xj{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new oU(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new nU(this.settings);return e.setSerdeContext(this.serdeContext),e}}class aU extends $M{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=i??new sU({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new Jj(this.awsQueryCompatible)}async serializeRequest(e,t,n){const r=await super.serializeRequest(e,t,n);return r.path.endsWith("/")||(r.path+="/"),r.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,r.headers["x-amz-target"]=`${this.serviceTarget}.${e.name}`,this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),"unit"!==zP(e.input)&&r.body||(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);const o=((e,t)=>{const n=eU(e.headers,"x-amzn-errortype");if(void 0!==n)return tU(e.headers[n]);if(t&&"object"==typeof t){const e=eU(t,"code");if(e&&void 0!==t[e])return tU(t[e]);if(void 0!==t.__type)return tU(t.__type)}})(n,r)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,o,this.options.defaultNamespace);const{errorSchema:s,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),l=YP.of(s),c=r.message??r.Message??"UnknownError",u=new(this.compositeErrorRegistry.getErrorCtor(s)??Error)(c),d={},f=this.codec.createDeserializer();for(const[h,p]of l.structIterator())null!=r[h]&&(d[h]=f.readObject(p,r[h]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,a,{$fault:l.getMergedTraits().error,message:c},d),r)}}class lU extends aU{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const cU="ref",uU=-1,dU=!0,fU="isSet",hU="PartitionResult",pU="booleanEquals",gU="getAttr",mU="stringEquals",vU={[cU]:"Endpoint"},yU={[cU]:hU},_U={[cU]:"Region"},bU={},xU=[_U],SU={conditions:[[fU,[vU]],[fU,xU],["aws.partition",xU,hU],[pU,[{[cU]:"UseFIPS"},dU]],[pU,[{fn:gU,argv:[yU,"supportsFIPS"]},dU]],[pU,[{[cU]:"UseDualStack"},dU]],[pU,[{fn:gU,argv:[yU,"supportsDualStack"]},dU]],[mU,[{fn:gU,argv:[yU,"name"]},"aws"]],[mU,[_U,"us-east-1"]],[mU,[_U,"us-east-2"]],[mU,[_U,"us-west-1"]],[mU,[_U,"us-west-2"]]],results:[[uU],[uU,"Invalid Configuration: FIPS and custom endpoint are not supported"],[uU,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[vU,bU],["https://cognito-idp-fips.us-east-1.amazonaws.com",bU],["https://cognito-idp-fips.us-east-2.amazonaws.com",bU],["https://cognito-idp-fips.us-west-1.amazonaws.com",bU],["https://cognito-idp-fips.us-west-2.amazonaws.com",bU],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",bU],[uU,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",bU],[uU,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",bU],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",bU],[uU,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",bU],[uU,"Invalid Configuration: Missing Region"]]},wU=1e8,EU=new Int32Array([-1,1,-1,0,17,3,1,4,wU+16,2,5,wU+16,3,9,6,5,7,wU+15,6,8,wU+14,7,wU+12,wU+13,4,11,10,5,wU+9,wU+11,5,12,wU+10,6,13,wU+9,8,wU+4,14,9,wU+5,15,10,wU+6,16,11,wU+7,wU+8,3,wU+1,18,5,wU+2,wU+3]),kU=JM.from(EU,2,SU.conditions,SU.results),CU=new class{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(!1===n)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const e=this.data.keys();let t=0;for(;;){const{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(0===n.length)return!1;for(const r of n){const n=String(e[r]??"");if(n.includes("|;"))return!1;t+=n+"|;"}return t}}({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),AU=(e,t={})=>CU.get(e,()=>((e,t)=>{const{nodes:n,root:r,results:i,conditions:o}=e;let s=r;const a={},l={referenceRecord:a,endpointParams:t.endpointParams,logger:t.logger};for(;1!==s&&-1!==s&&s<mL;){const e=3*(Math.abs(s)-1),[t,r,i]=[n[e],n[e+1],n[e+2]],[c,u,d]=o[t],f=uL({fn:c,assign:d,argv:u},l);if(f.toAssign){const{name:e,value:t}=f.toAssign;a[e]=t}s=s>=0===f.result?r:i}if(s>=mL){const e=i[s-mL];if(-1===e[0]){const[,t]=e;throw new XM(aL(t,"Error",l))}const[t,n,r]=e;return{url:gL(t,l),properties:fL(n,l),headers:dL(r??{},l)}}throw new XM("No matching endpoint.")})(kU,{endpointParams:e,logger:t.logger}));YM.aws=_L;class NU extends xz{constructor(e){super(e),Object.setPrototypeOf(this,NU.prototype)}}class TU extends NU{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,TU.prototype)}}class RU extends NU{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,RU.prototype)}}class DU extends NU{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,DU.prototype),this.reasonCode=e.reasonCode}}class IU extends NU{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,IU.prototype)}}class FU extends NU{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,FU.prototype)}}class OU extends NU{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,OU.prototype)}}class PU extends NU{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,PU.prototype)}}class MU extends NU{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,MU.prototype)}}class LU extends NU{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,LU.prototype)}}class zU extends NU{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,zU.prototype)}}class jU extends NU{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,jU.prototype)}}class UU extends NU{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,UU.prototype)}}class BU extends NU{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,BU.prototype)}}class $U extends NU{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,$U.prototype)}}class qU extends NU{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,qU.prototype)}}class GU extends NU{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,GU.prototype)}}class VU extends NU{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,VU.prototype)}}class KU extends NU{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,KU.prototype)}}class WU extends NU{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,WU.prototype)}}class HU extends NU{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,HU.prototype)}}class JU extends NU{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,JU.prototype)}}class XU extends NU{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,XU.prototype)}}class QU extends NU{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,QU.prototype)}}class YU extends NU{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,YU.prototype)}}class ZU extends NU{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,ZU.prototype)}}class eB extends NU{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,eB.prototype)}}class tB extends NU{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,tB.prototype)}}class nB extends NU{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,nB.prototype)}}class rB extends NU{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,rB.prototype)}}class iB extends NU{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,iB.prototype)}}class oB extends NU{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,oB.prototype)}}class sB extends NU{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,sB.prototype)}}class aB extends NU{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,aB.prototype)}}class lB extends NU{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,lB.prototype)}}class cB extends NU{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,cB.prototype)}}class uB extends NU{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,uB.prototype)}}class dB extends NU{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,dB.prototype)}}class fB extends NU{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,fB.prototype)}}class hB extends NU{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,hB.prototype)}}class pB extends NU{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,pB.prototype)}}class gB extends NU{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,gB.prototype)}}class mB extends NU{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,mB.prototype)}}class vB extends NU{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,vB.prototype)}}class yB extends NU{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,yB.prototype)}}class _B extends NU{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,_B.prototype)}}class bB extends NU{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,bB.prototype)}}class xB extends NU{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,xB.prototype)}}class SB extends NU{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,SB.prototype)}}class wB extends NU{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,wB.prototype)}}class EB extends NU{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,EB.prototype)}}class kB extends NU{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,kB.prototype)}}class CB extends NU{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,CB.prototype)}}class AB extends NU{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,AB.prototype)}}class NB extends NU{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,NB.prototype)}}class TB extends NU{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,TB.prototype)}}class RB extends NU{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,RB.prototype)}}class DB extends NU{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,DB.prototype)}}const IB="Session",FB="client",OB="error",PB="httpError",MB="message",LB="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",zB="server",jB="com.amazonaws.cognitoidentityprovider",UB=nM.for(LB);var BB=[-3,LB,"CognitoIdentityProviderServiceException",0,[],[]];UB.registerError(BB,NU);const $B=nM.for(jB);var qB=[-3,jB,"AccessDeniedException",{[OB]:FB,[PB]:403},[MB],[0]];$B.registerError(qB,TU);var GB=[-3,jB,"AliasExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(GB,XU);var VB=[-3,jB,"CodeDeliveryFailureException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(VB,qU);var KB=[-3,jB,"CodeMismatchException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(KB,iB);var WB=[-3,jB,"ConcurrentModificationException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(WB,lB);var HB=[-3,jB,"DeviceKeyExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(HB,mB);var JB=[-3,jB,"DuplicateProviderException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(JB,yB);var XB=[-3,jB,"EnableSoftwareTokenMFAException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(XB,DB);var QB=[-3,jB,"ExpiredCodeException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(QB,oB);var YB=[-3,jB,"FeatureUnavailableInTierException",{[OB]:FB,[PB]:403},[MB],[0]];$B.registerError(YB,xB);var ZB=[-3,jB,"ForbiddenException",{[OB]:FB,[PB]:403},[MB],[0]];$B.registerError(ZB,cB);var e$=[-3,jB,"GroupExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(e$,vB);var t$=[-3,jB,"InternalErrorException",{[OB]:zB},[MB],[0]];$B.registerError(t$,RU);var n$=[-3,jB,"InternalServerException",{[OB]:zB},[MB],[0]];$B.registerError(n$,MU);var r$=[-3,jB,"InvalidEmailRoleAccessPolicyException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(r$,YU);var i$=[-3,jB,"InvalidLambdaResponseException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(i$,jU);var o$=[-3,jB,"InvalidOAuthFlowException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(o$,EB);var s$=[-3,jB,"InvalidParameterException",{[OB]:FB,[PB]:400},[MB,"reasonCode"],[0,0]];$B.registerError(s$,DU);var a$=[-3,jB,"InvalidPasswordException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(a$,GU);var l$=[-3,jB,"InvalidSmsRoleAccessPolicyException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(l$,VU);var c$=[-3,jB,"InvalidSmsRoleTrustRelationshipException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(c$,KU);var u$=[-3,jB,"InvalidUserPoolConfigurationException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(u$,QU);var d$=[-3,jB,"LimitExceededException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(d$,LU);var f$=[-3,jB,"ManagedLoginBrandingExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(f$,_B);var h$=[-3,jB,"MFAMethodNotFoundException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(h$,ZU);var p$=[-3,jB,"NotAuthorizedException",{[OB]:FB,[PB]:403},[MB],[0]];$B.registerError(p$,IU);var g$=[-3,jB,"PasswordHistoryPolicyViolationException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(g$,sB);var m$=[-3,jB,"PasswordResetRequiredException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(m$,eB);var v$=[-3,jB,"PreconditionNotMetException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(v$,WU);var y$=[-3,jB,"RefreshTokenReuseException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(y$,AB);var _$=[-3,jB,"ResourceNotFoundException",{[OB]:FB,[PB]:404},[MB],[0]];$B.registerError(_$,FU);var b$=[-3,jB,"ScopeDoesNotExistException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(b$,kB);var x$=[-3,jB,"SoftwareTokenMFANotFoundException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(x$,aB);var S$=[-3,jB,"TermsExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(S$,bB);var w$=[-3,jB,"TierChangeNotAllowedException",{[OB]:FB,[PB]:403},[MB],[0]];$B.registerError(w$,SB);var E$=[-3,jB,"TooManyFailedAttemptsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(E$,UU);var k$=[-3,jB,"TooManyRequestsException",{[OB]:FB,[PB]:429},[MB],[0]];$B.registerError(k$,OU);var C$=[-3,jB,"UnauthorizedException",{[OB]:FB,[PB]:401},[MB],[0]];$B.registerError(C$,NB);var A$=[-3,jB,"UnexpectedLambdaException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(A$,BU);var N$=[-3,jB,"UnsupportedIdentityProviderException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(N$,CB);var T$=[-3,jB,"UnsupportedOperationException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(T$,tB);var R$=[-3,jB,"UnsupportedTokenTypeException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(R$,TB);var D$=[-3,jB,"UnsupportedUserStateException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(D$,HU);var I$=[-3,jB,"UserImportInProgressException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(I$,PU);var F$=[-3,jB,"UserLambdaValidationException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(F$,$U);var O$=[-3,jB,"UsernameExistsException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(O$,JU);var P$=[-3,jB,"UserNotConfirmedException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(P$,nB);var M$=[-3,jB,"UserNotFoundException",{[OB]:FB,[PB]:404},[MB],[0]];$B.registerError(M$,zU);var L$=[-3,jB,"UserPoolAddOnNotEnabledException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(L$,rB);var z$=[-3,jB,"UserPoolTaggingException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(z$,wB);var j$=[-3,jB,"WebAuthnChallengeNotFoundException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(j$,uB);var U$=[-3,jB,"WebAuthnClientMismatchException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(U$,dB);var B$=[-3,jB,"WebAuthnConfigurationMissingException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(B$,RB);var $$=[-3,jB,"WebAuthnCredentialNotSupportedException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError($$,fB);var q$=[-3,jB,"WebAuthnNotEnabledException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(q$,hB);var G$=[-3,jB,"WebAuthnOriginNotAllowedException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(G$,pB);var V$=[-3,jB,"WebAuthnRelyingPartyMismatchException",{[OB]:FB,[PB]:400},[MB],[0]];$B.registerError(V$,gB);const K$=[UB,$B];var W$=[0,jB,"ClientIdType",8,0],H$=[0,jB,"SessionType",8,0],J$=[0,jB,"TokenModelType",8,0],X$=[3,jB,"AnalyticsMetadataType",0,["AnalyticsEndpointId"],[0]],Q$=[3,jB,"AuthenticationResultType",0,["AccessToken","ExpiresIn","TokenType","RefreshToken","IdToken","NewDeviceMetadata"],[[()=>J$,0],1,0,[()=>J$,0],[()=>J$,0],()=>eq]],Y$=[3,jB,"InitiateAuthRequest",0,["AuthFlow","ClientId","AuthParameters","ClientMetadata","AnalyticsMetadata","UserContextData",IB],[0,[()=>W$,0],[()=>nq,0],128,()=>X$,[()=>tq,0],[()=>H$,0]],2],Z$=[3,jB,"InitiateAuthResponse",0,["ChallengeName",IB,"ChallengeParameters","AuthenticationResult","AvailableChallenges"],[0,[()=>H$,0],128,[()=>Q$,0],64]],eq=[3,jB,"NewDeviceMetadataType",0,["DeviceKey","DeviceGroupKey"],[0,0]],tq=[3,jB,"UserContextDataType",8,["IpAddress","EncodedData"],[0,0]],nq=[2,jB,"AuthParametersType",8,0,0],rq=[9,jB,"InitiateAuth",0,()=>Y$,()=>Z$];const iq=e=>{const t=(({defaultsMode:e}={})=>Uz(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(Hj()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${Wj.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(wz),r=(e=>({apiVersion:"2016-04-18",base64Decoder:e?.base64Decoder??bP,base64Encoder:e?.base64Encoder??EP,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??AU,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??_j,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new jz},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new VM}],logger:e?.logger??new Az,protocol:e?.protocol??lU,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:K$,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:e?.serviceId??"Cognito Identity Provider",urlParser:e?.urlParser??BP,utf8Decoder:e?.utf8Decoder??xP,utf8Encoder:e?.utf8Encoder??wP}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Kj,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??$j({serviceId:r.serviceId,clientVersion:xj}),maxAttempts:e?.maxAttempts??3,region:e?.region??Gj("Region is missing"),requestHandler:DP.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||SL),sha256:e?.sha256??Bj,streamCollector:e?.streamCollector??FP,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))}};class oq extends mz{config;constructor(...[e]){const t=iq(e||{});super(t),this.initConfig=t;var n;const r=function(e){const t=mP(e.userAgentAppId??void 0),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:"string"==typeof n?[[n]]:n,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}((n=t,Object.assign(n,{useDualstackEndpoint:n.useDualstackEndpoint??!1,useFipsEndpoint:n.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}))),i=uz(r),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,o=null!=n?async()=>iz(await cP(n)()):void 0,s=!!n,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:s,useDualstackEndpoint:cP(r??!1),useFipsEndpoint:cP(i??!1)});let l;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!l&&(l=rz(e.serviceId)),l),a})(WL(i)),s=(e=>{const t=vj(e);return Object.assign(t,{authSchemePreference:cP(e.authSchemePreference??[])})})(o),a=((e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),kz(e),(e=>({setHttpHandler(t){e.httpHandler=t},httpHandler:()=>e.httpHandler,updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs:()=>e.httpHandler.httpHandlerConfigs()}))(e),(e=>{const t=e.httpAuthSchemes;let n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){const n=t.findIndex(t=>t.schemeId===e.schemeId);-1===n?t.push(e):t.splice(n,1,e)},httpAuthSchemes:()=>t,setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider:()=>n,setCredentials(e){r=e},credentials:()=>r}})(e));return t.forEach(e=>e.configure(n)),Object.assign(e,{region:n.region()},Cz(n),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n))})(s,e?.extensions||[]);this.config=a,this.middlewareStack.use(VP(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.add($L(e),GL)}}))(this.config)),this.middlewareStack.use(Oz(this.config)),this.middlewareStack.use(XL(this.config)),this.middlewareStack.use(oP(this.config)),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add((e,t)=>async n=>{try{const r=await e(n),{clientName:i,commandName:o,logger:s,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:c}=a,u=l??t.inputFilterSensitiveLog,d=c??t.outputFilterSensitiveLog,{$metadata:f,...h}=r.output;return s?.info?.({clientName:i,commandName:o,input:u(n.input),output:d(h),metadata:f}),r}catch(Ene){const{clientName:r,commandName:i,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:a}=s,l=a??t.inputFilterSensitiveLog;throw o?.error?.({clientName:r,commandName:i,input:l(n.input),error:Ene,metadata:Ene.$metadata}),Ene}},sP)}})),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add(e=>async t=>e(t),aP)}})),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(uP(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),dP)}}))(this.config,{httpAuthSchemeParametersProvider:yj,identityProviderConfigProvider:async e=>new GM({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(gP(this.config))}destroy(){super.destroy()}}class sq extends(_z.classBuilder().ep(bj).m(function(e,t,n,r){return[lz(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(rq).build()){}let aq="reventless.role-switched",lq="activeRole",cq="availableRoles",uq="activeRoleStale";function dq(e){return e.split(",").map(e=>e.trim()).filter(e=>""!==e)}function fq(e){let t=t=>U(j(e[t],He.string),""),n=me(U(j(e.groups,He.array),[]),He.string),r=t=>j(j(j(e.claims,He.object),e=>e[t]),He.string);return{userId:t("userId"),username:t("username"),groups:n,provider:t("provider"),activeRole:r(lq),availableRoles:L(r(cq),[],dq),staleRole:r(uq)}}function hq(e){let t,n=[["userId",e.userId],["username",e.username],["groups",e.groups.map(e=>e)],["provider",e.provider]],r=e.activeRole,i=e.availableRoles,o=e.staleRole,s=0;if(void 0!==r||0!==i.length||void 0!==o?s=1:t=[],1===s){let e=[];M(r,t=>{e.push([lq,t])}),0!==i.length&&e.push([cq,i.join(",")]),M(o,t=>{e.push([uq,t])}),t=[["claims",Object.fromEntries(e)]]}return Object.fromEntries(n.concat(t))}function pq(e,t){let n=[["token",t.token],["identity",hq(t.identity)]],r=t.refreshToken,i=void 0!==r?n.concat([["refreshToken",r]]):n,o=t.expiresAt,s=void 0!==o?i.concat([["expiresAt",o]]):i,a=JSON.stringify(Object.fromEntries(s));localStorage.setItem(e,a)}function gq(e){let t=t=>j(e[t],He.string),n=me(U(j(e["cognito:groups"],He.array),[]),He.string);return{userId:U(t("sub"),""),username:U(B(t("cognito:username"),t("email")),""),groups:n,provider:"Cognito",activeRole:t(lq),availableRoles:L(t(cq),[],dq),staleRole:t(uq)}}async function mq(e){try{let t=await e.text();return JSON.parse(t)}catch(t){return}}function vq(e,t){return t+" (HTTP "+e.status.toString()+")"}function yq(e){return JSON.stringify(void 0!==e?Object.fromEntries([["activeRole",e]]):{})}async function _q(e,t,n){try{let r=JSON.stringify(Object.fromEntries([["query","mutation SetActiveRole($activeRole: String) {\n Platform_SetActiveRole(activeRole: $activeRole) {\n activeRole\n availableRoles\n }\n}"],["variables",Object.fromEntries([["activeRole",L(n,null,e=>e)]])]])),i=await fetch(e,{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+t},body:r}),o=j(j(j(j(j(j(j(await mq(i),He.object),e=>e.errors),He.array),e=>e.at(0)),He.object),e=>e.message),He.string),s=i.ok;return void 0!==o?{TAG:"Error",_0:o}:s?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:"Could not switch role"}}catch(r){return{TAG:"Error",_0:YO(QO(F(r)))}}}function bq(e){try{return function(e,t){if("string"!=typeof e)throw new WO("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new WO(`Invalid token specified: missing part #${n+1}`);let i;try{i=HO(r)}catch(pU){throw new WO(`Invalid token specified: invalid base64 for part #${n+1} (${pU.message})`)}try{return JSON.parse(i)}catch(pU){throw new WO(`Invalid token specified: invalid json for part #${n+1} (${pU.message})`)}}(e)}catch(t){return}}function xq(e){let t=e.IdToken;if(void 0===t)return;let n=bq(t);if(void 0===n)return;let r=e.ExpiresIn,i=void 0!==r?Date.now()+1e3*r:void 0;return{token:t,identity:gq(n),refreshToken:e.RefreshToken,expiresAt:i}}async function Sq(e,t,n,r){try{let i=new oq({region:t}),o=new sq({ClientId:e,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:Object.fromEntries([["REFRESH_TOKEN",n]])}),s=(await i.send(o)).AuthenticationResult;if(void 0===s)return{TAG:"Error",_0:"Cognito refresh returned no tokens"};let a=s.IdToken;if(void 0===a)return{TAG:"Error",_0:"Cognito refresh missing IdToken"};let l=U(z(bq(a),gq),r),c=s.ExpiresIn,u=void 0!==c?Date.now()+1e3*c:void 0,d=s.RefreshToken;return{TAG:"Ok",_0:{token:a,identity:l,refreshToken:void 0!==d?d:n,expiresAt:u}}}catch(i){return{TAG:"Error",_0:YO(QO(F(i)))}}}let wq=l(void 0),Eq=wq.Provider;let kq=function(e){let t=e.storageKey,n=e.region,r=e.cognitoClientId,i=e.apiEndpoint,o=e.authMode,l=void 0!==t?t:"reventless.auth.v1",u=s(()=>function(e){let t=localStorage.getItem(e);if(null!=t)try{let e=JSON.parse(t),n=He.object(e);if(void 0===n)return;let r=j(n.token,He.string),i=n.identity,o=j(n.refreshToken,He.string),s=j(n.expiresAt,He.float);return void 0!==r&&void 0!==i?z(He.object(i),e=>({token:r,identity:fq(e),refreshToken:o,expiresAt:s})):void 0}catch(n){return}}(l)),d=u[1],f=u[0];a(()=>{if(void 0===f)return;let e=f.refreshToken;if(void 0===e)return;let t=f.expiresAt;if(void 0===t)return;let i=f.identity;switch(o){case"Anonymous":case"Local":return;case"Cognito":if(void 0===r)return;if(void 0===n)return;let o=Math.max(0,t-Date.now()-3e5),s=setTimeout(()=>{Sq(r,n,e,i).then(e=>{if("Ok"===e.TAG){let t=e._0;return pq(l,t),d(e=>t)}localStorage.removeItem(l),d(e=>{})})},o);return()=>{clearTimeout(s)}}},[f,o,r,n]);let h=z(f,e=>e.identity),p=$(f),g=function(e){switch(e){case"Anonymous":return!1;case"Local":case"Cognito":return!0}}(o),m={identity:h,isAuthenticated:p,login:async(e,t)=>{try{let s=0;switch(o){case"Anonymous":case"Local":s=1;break;case"Cognito":if(void 0===r)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};if(void 0===n)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};let i=await async function(e,t,n,r){try{let i=new oq({region:t}),o=new sq({ClientId:e,AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:Object.fromEntries([["USERNAME",n],["PASSWORD",r]])}),s=j((await i.send(o)).AuthenticationResult,xq);return void 0!==s?{TAG:"Ok",_0:s}:{TAG:"Error",_0:"Cognito returned no usable tokens"}}catch(i){return{TAG:"Error",_0:YO(QO(F(i)))}}}(r,n,e,t);if("Ok"!==i.TAG)return{TAG:"LoginErr",_0:i._0};let o=i._0;return pq(l,o),d(e=>o),"LoginOk"}if(1===s){if(void 0===i)return{TAG:"LoginErr",_0:"Local auth mode requires an apiEndpoint"};let n=await fetch(function(e){return(e.endsWith("/graphql")?e.slice(0,e.length-8|0):e)+"/__inmemory/login"}(i),{method:"POST",headers:{"content-type":"application/json"},body:U(JSON.stringify({username:e,password:t}),"")}),r=await mq(n);if(n.ok){let e=j(r,He.object);if(void 0===e)return{TAG:"LoginErr",_0:"Malformed login response"};let t=j(e.token,He.string),n=j(e.identity,He.object);if(void 0===t)return{TAG:"LoginErr",_0:"Malformed login response"};if(void 0===n)return{TAG:"LoginErr",_0:"Malformed login response"};let i={token:t,identity:fq(n),refreshToken:void 0,expiresAt:void 0};return pq(l,i),d(e=>i),"LoginOk"}let o=U(j(j(j(r,He.object),e=>e.error),He.string),vq(n,"Login failed"));return{TAG:"LoginErr",_0:o}}}catch(s){return{TAG:"LoginErr",_0:YO(QO(F(s)))}}},switchRole:async e=>{try{let t=0;switch(o){case"Anonymous":case"Local":t=1;break;case"Cognito":if(void 0===f)return{TAG:"LoginErr",_0:"Not signed in"};let o=f.refreshToken;if(void 0===i)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===r)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===n)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};if(void 0===o)return{TAG:"LoginErr",_0:"Switching roles is not available on this deployment"};let s=await _q(i,f.token,e);if("Ok"!==s.TAG)return{TAG:"LoginErr",_0:s._0};let a=await Sq(r,n,o,f.identity),c=0;if("Ok"===a.TAG){let t=a._0;if(mt(t.identity.activeRole,e))return pq(l,t),sessionStorage.setItem(aq,"1"),d(e=>t),"LoginOk";c=2}else c=2;if(2===c)return await _q(i,f.token,f.identity.activeRole),"Ok"===a.TAG?{TAG:"LoginErr",_0:"The server did not narrow this session to that role"}:{TAG:"LoginErr",_0:a._0}}if(1===t){if(void 0===i)return{TAG:"LoginErr",_0:"Local auth mode requires an apiEndpoint"};if(void 0===f)return{TAG:"LoginErr",_0:"Not signed in"};let t=await fetch(function(e){return(e.endsWith("/graphql")?e.slice(0,e.length-8|0):e)+"/__inmemory/switch-role"}(i),{method:"POST",headers:{"content-type":"application/json",authorization:"Bearer "+f.token},body:yq(e)}),n=await mq(t);if(!t.ok)return{TAG:"LoginErr",_0:U(j(j(j(n,He.object),e=>e.error),He.string),vq(t,"Could not switch role"))};let r=j(n,He.object);if(void 0===r)return{TAG:"LoginErr",_0:"Malformed switch response"};let o=j(r.token,He.string),s=j(r.identity,He.object);if(void 0===o)return{TAG:"LoginErr",_0:"Malformed switch response"};if(void 0===s)return{TAG:"LoginErr",_0:"Malformed switch response"};let a={token:o,identity:fq(s),refreshToken:void 0,expiresAt:void 0};return pq(l,a),sessionStorage.setItem(aq,"1"),d(e=>a),"LoginOk"}}catch(t){let e=F(t);return console.error("[AuthProvider] switchRole threw; session left as it was",e),{TAG:"LoginErr",_0:"Could not switch role. You are still acting as the role you had."}}},canSwitchRoles:g,logout:()=>{localStorage.removeItem(l),d(e=>{})},getToken:()=>z(f,e=>e.token)};return c(Eq,{value:m,children:e.children})};function Cq(){return d(wq)}function Aq(e){let t=globalThis.window;if(null!=t)try{return R(t.matchMedia(e))}catch(n){return}}function Nq(e){let t=Aq(e);if(void 0===t)return!1;try{return D(t).matches}catch(n){return!1}}function Tq(e){let t=s(()=>Nq(e)),n=t[1];return a(()=>{n(t=>Nq(e));let t=Aq(e);if(void 0===t)return;let r=D(t),i=()=>n(t=>Nq(e));try{return r.addEventListener("change",i),()=>{try{return void r.removeEventListener("change",i)}catch(e){return}}}catch(o){return}},[e]),t[0]}function Rq(){return{compact:Tq(Ct.compact),narrow:Tq(Ct.narrow),tight:Tq(Ct.tight)}}function Dq(e){return e.tight?"Tight":e.narrow?"Narrow":e.compact?"Compact":"Wide"}function Iq(){return Dq(Rq())}let Fq={background:"var("+yt.surface+")",border:"1px solid var("+yt.border+")",color:"var("+yt.textPrimary+")",cursor:"pointer",display:"inline-flex",fontFamily:"var("+bt.fontFamily+")",fontSize:"var("+bt.sizeSm+")",fontWeight:"var("+bt.weightMedium+")",lineHeight:"1",padding:"0.375rem 0.75rem",borderRadius:"var("+xt.md+")",alignItems:"center",gap:"0.375rem"},Oq={color:"var("+yt.textSecondary+")",fontSize:"0.625rem"},Pq={background:"var("+yt.surfaceElevated+")",border:"1px solid var("+yt.borderSubtle+")",color:"var("+yt.textPrimary+")",fontFamily:"var("+bt.fontFamily+")",minWidth:"200px",padding:"0.75rem 1rem",position:"absolute",right:"0",top:"calc(100% + 0.5rem)",zIndex:"10",borderRadius:"var("+xt.md+")",boxShadow:"var("+wt+")"},Mq={background:"var("+yt.brandSubtle+")",color:"var("+yt.brand+")",display:"inline-block",fontSize:"var("+bt.sizeXs+")",marginRight:"0.25rem",marginBottom:"0.25rem",padding:"0.125rem 0.5rem",borderRadius:"var("+xt.full+")"},Lq={border:"none",borderTop:"1px solid var("+yt.borderSubtle+")",margin:"0.5rem 0"},zq={background:"transparent",border:"1px solid var("+yt.border+")",color:"var("+yt.textPrimary+")",cursor:"pointer",fontSize:"var("+bt.sizeSm+")",padding:"0.375rem 0.5rem",width:"100%",borderRadius:"var("+xt.sm+")"},jq={color:"var("+yt.textSecondary+")",fontSize:"var("+bt.sizeXs+")",letterSpacing:"0.04em",marginBottom:"0.25rem",textTransform:"uppercase"};let Uq={color:"var("+yt.textSecondary+")",fontSize:"var("+bt.sizeXs+")"},Bq={color:"var("+yt.textSecondary+")",fontWeight:"var("+bt.weightNormal+")"},$q={background:"transparent",border:"none",color:"var("+yt.textSecondary+")",cursor:"pointer",display:"block",fontFamily:"var("+bt.fontFamily+")",fontSize:"var("+bt.sizeSm+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+xt.sm+")"},qq={color:"var("+yt.textSecondary+")",fontSize:"var("+bt.sizeXs+")",marginBottom:"0.25rem"},Gq={color:"var("+yt.error+")",fontSize:"var("+bt.sizeXs+")",marginTop:"0.25rem"},Vq={color:"var("+yt.textSecondary+")",fontSize:"var("+bt.sizeXs+")",marginBottom:"0.25rem"};function Kq(e){let t=e.trim()[0];return void 0!==t&&""!==t.trim()?t.toUpperCase():"☺"}function Wq(e,t){if(!e)return[];let n=t.availableRoles;return 0!==n.length?n:t.groups}let Hq=function(e){let t=Cq(),n=s(()=>!1),a=n[1],l=n[0],c=s(()=>!1),u=c[1],d=c[0],f=s(()=>{}),h=f[1],p=f[0],g=Tq(Ct.compact);if(void 0===t)return null;let m=t.identity;if(void 0===m)return null;let v,y=Wq(t.canSwitchRoles,m),_=function(e,t){let n=e.length;if(1!==n&&0!==n)return t.activeRole}(y,m),b=e=>{u(e=>!0),h(e=>{}),t.switchRole(e).then(e=>{if(u(e=>!1),"object"!=typeof e)return a(e=>!1);let t=e._0;h(e=>t)})};if(l){let e,n=m.staleRole,s=y.length;if(1!==s&&0!==s){let t=m.activeRole,n=m.activeRole;e=r(o,{children:[r("div",{children:[i("div",{children:"Acting as",style:jq}),void 0!==t?null:i("div",{children:"All of them — choose one to narrow.",style:qq}),y.map(e=>{let t=mt(m.activeRole,e);return r("button",{children:[e,t?i("span",{children:"✓",style:Uq}):null],"aria-checked":t?"true":"false",role:"radio",style:(n=t,{background:"transparent",border:"none",color:"var("+yt.textPrimary+")",cursor:n?"default":"pointer",display:"flex",fontSize:"var("+bt.sizeSm+")",fontWeight:"var("+(n?bt.weightMedium:bt.weightNormal)+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+xt.sm+")",alignItems:"center",justifyContent:"space-between",gap:"0.75rem"}),disabled:d,onClick:n=>{if(!t)return b(e)}},e);var n})],"aria-label":"Acting as",role:"radiogroup"}),void 0!==n?r(o,{children:[i("hr",{style:Lq}),i("button",{children:"Stop acting as one role",style:$q,disabled:d,onClick:e=>b(void 0)})]}):null,void 0!==p?i("div",{children:p,style:Gq}):null]})}else e=null;v=r("div",{children:[i("div",{children:m.username,style:{fontSize:"var("+bt.sizeMd+")",fontWeight:"var("+bt.weightMedium+")",marginBottom:"0.25rem"}}),0!==m.groups.length&&y.length<=1?i("div",{children:m.groups.map(e=>i("span",{children:e,style:Mq},e)),style:{marginBottom:"0.25rem"}}):null,void 0!==n?i("div",{children:n+" is no longer one of your roles, so you are acting as all of them.",style:Vq}):null,e,i("hr",{style:Lq}),i("button",{children:"Sign out",style:zq,onClick:e=>{a(e=>!1),t.logout()}})],style:Pq})}else v=null;return r("div",{children:[r("button",{children:[g?Kq(m.username):r(o,{children:[m.username,void 0!==_?i("span",{children:"· "+_,style:Bq}):null]}),i("span",{children:l?"▴":"▾",style:Oq})],"aria-label":void 0!==_?"Signed in as "+m.username+", acting as "+_:"Signed in as "+m.username,style:Fq,onClick:e=>a(e=>!e)}),v],style:{position:"relative"}})},Jq={background:"var("+yt.surface+")",border:"1px solid var("+yt.borderSubtle+")",color:"var("+yt.textPrimary+")",fontFamily:"var("+bt.fontFamily+")",margin:"6rem auto",maxWidth:"360px",padding:"2rem",borderRadius:"var("+xt.md+")"},Xq={color:"var("+yt.textSecondary+")",display:"block",fontSize:"var("+bt.sizeSm+")",marginBottom:"0.25rem"},Qq={background:"var("+yt.surfaceElevated+")",border:"1px solid var("+yt.border+")",color:"var("+yt.textPrimary+")",fontSize:"var("+bt.sizeMd+")",marginBottom:"1rem",padding:"0.5rem 0.75rem",width:"100%",borderRadius:"var("+xt.sm+")",boxSizing:"border-box"};function Yq(e){return{background:e?"var("+yt.textDisabled+")":"var("+yt.brand+")",border:"none",color:"var("+yt.textOnBrand+")",cursor:e?"not-allowed":"pointer",fontSize:"var("+bt.sizeMd+")",fontWeight:"var("+bt.weightMedium+")",padding:"0.625rem",width:"100%",borderRadius:"var("+xt.sm+")"}}let Zq={color:"var("+yt.error+")",fontSize:"var("+bt.sizeSm+")",marginBottom:"0.75rem"};let eG=function(e){let t=Cq(),n=s(()=>""),o=n[1],a=n[0],l=s(()=>""),c=l[1],u=l[0],d=s(()=>{}),f=d[1],h=d[0],p=s(()=>!1),g=p[1],m=p[0];return r("div",{children:[i("h1",{children:"Sign in",style:{fontSize:"var("+bt.sizeXl+")",fontWeight:"var("+bt.weightBold+")",margin:"0 0 1.5rem"}}),r("form",{children:[i("label",{children:"Username",style:Xq}),i("input",{style:Qq,autoComplete:"username",autoFocus:!0,type:"text",value:a,onChange:e=>{let t=e.target.value;o(e=>t)}}),i("label",{children:"Password",style:Xq}),i("input",{style:Qq,autoComplete:"current-password",type:"password",value:u,onChange:e=>{let t=e.target.value;c(e=>t)}}),void 0!==h?i("div",{children:h,style:Zq}):null,i("button",{children:m?"Signing in…":"Sign in",style:Yq(m),disabled:m,type:"submit"})],onSubmit:e=>{e.preventDefault(),f(e=>{}),g(e=>!0),void 0!==t?ce(t.login(a,u).then(e=>{if(g(e=>!1),"object"!=typeof e)return;let t=e._0;f(e=>t)}),e=>(g(e=>!1),f(e=>"Unexpected error during sign-in"),Promise.resolve())):(f(e=>"Auth provider missing"),g(e=>!1),Promise.resolve())}})],style:Jq})};let tG=function(e){let t=e.children,n=e.url,r=void 0!==n?n:"",i=void 0!==t?t:"No route matched!";return U(function(e,t){let n=Me(e,t);return"object"!=typeof n?void 0:T(n._0)}(e.routes,r),i)};let nG=function(e){let t=ee(d(Z).prefix,e.route);return i("a",{children:e.children,href:t,onClick:e=>{if(!e.defaultPrevented&&function(e){return!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}(e))return e.preventDefault(),J(t)}})},rG=l(void 0),iG=rG.Provider;let oG=function(e){let t=e.initialPages,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=s(()=>[]),a=o[1],l=r[0].concat(o[0]),u={register:e=>i(t=>t.concat(e)),deregister:e=>i(t=>t.filter(t=>t.fragmentId!==e)),setPluginPages:e=>a(t=>e),getPages:()=>l,getPage:e=>l.find(t=>t.fragmentId===e)};return c(iG,{value:u,children:e.children})};function sG(){let e=d(rG);return void 0!==e?e.getPages():[]}function aG(e){return!U(e.menuEntry.hidden,!1)}let lG=l({activeAccess:[],hasAccess:function(e){return!1}}),cG=lG.Provider;function uG(){return d(lG).hasAccess}let dG=function(e){let t=e.access,n={activeAccess:t,hasAccess:e=>t.some(t=>t===e)};return c(cG,{value:n,children:e.children})};function fG(e){return"var("+e+")"}let hG=lo([pi("flex"),ui("center"),ci("gap",fG(_t.sm)),ci("padding","6px var("+_t.sm+") 6px 14px"),ci("border-radius",fG(xt.md)),ci("color",fG(yt.textDisabled)),ci("font-size",fG(bt.sizeSm)),hi("notAllowed"),qi("none")]),pG=lo([ci("font-size","14px"),vi(0)]),gG=lo([mi(1),ci("font-weight",fG(bt.weightMedium))]),mG=lo([ci("font-size",fG(bt.sizeXs)),ci("color",fG(yt.brand)),hi("pointer"),ci("text-decoration","none"),vi(0)]);let vG=function(e){return r("div",{children:[i("span",{children:"[locked]",className:pG}),i("span",{children:e.label,className:gG}),i("span",{children:"Upgrade",className:mG})],className:hG})};function yG(e){return"var("+e+")"}let _G=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("padding","var("+_t.sm+")"),Ki("& a",[ci("text-decoration","none"),ci("color","inherit"),ci("display","block"),ci("outline-offset","2px")])]),bG=lo([ci("color",yG(yt.textDisabled)),ci("font-size",yG(bt.sizeXs)),ci("font-weight",yG(bt.weightBold)),ci("letter-spacing","0.08em"),ci("text-transform","uppercase"),ci("padding","var("+_t.xs+") var("+_t.sm+")"),Ni(eo(12)),Ti(eo(2))]),xG=lo([ji("relative"),pi("flex"),ui("center"),ci("gap",yG(_t.sm)),ci("padding","6px var("+_t.sm+") 6px 14px"),ci("color",yG(yt.textSecondary)),ci("font-size",yG(bt.sizeMd)),ci("line-height","1.4"),hi("pointer"),ci("border-radius",yG(xt.md)),ci("text-decoration","none"),ci("transition","background-color 140ms ease, color 140ms ease, transform 140ms ease"),Ki("&::before",[ci("content","''"),ji("absolute"),ci("left","4px"),ci("top","50%"),ci("width","3px"),ci("height","0"),ci("border-radius",yG(xt.full)),ci("background",yG(yt.brand)),ci("transform","translateY(-50%)"),ci("transition","height 160ms ease")]),Qi([ci("background",yG(yt.surfaceSubtle)),ci("color",yG(yt.textPrimary)),ci("transform","translateX(2px)")]),Wi("(prefers-reduced-motion: reduce)",[ci("transition","none"),Qi([ci("transform","none")]),Ki("&::before",[ci("transition","none")])])]),SG=lo([ci("background",yG(yt.brandSubtle)),ci("color",yG(yt.textPrimary)),ci("font-weight",yG(bt.weightMedium)),Ki("&::before",[ci("height","56%")]),Qi([ci("background",yG(yt.brandSubtle)),ci("color",yG(yt.textPrimary)),ci("transform","none")])]),wG=lo([ci("font-size","14px"),ci("line-height","1"),vi(0)]),EG=lo([ci("white-space","nowrap"),ci("overflow","hidden"),ci("text-overflow","ellipsis")]),kG=lo([ci("font-size","12px"),ci("color",yG(yt.textDisabled)),Ci("auto"),vi(0)]);function CG(e,t){let n=e.url;return void 0!==n&&(n===t||t.startsWith(n+"/"))}function AG(e){let t=e.onNavigate,n=e.hasAccess,s=e.isActive,a=e.page,l=L(a.requiredAccess,!1,e=>!n(e)),c=s?xG+" "+SG:xG,u=r(o,{children:[L(a.menuEntry.icon,null,e=>i("span",{children:e,"aria-hidden":!0,className:wG})),i("span",{children:a.menuEntry.label,className:EG}),l?i("span",{children:"[locked]",className:kG}):null]}),d=a.url;return l||void 0===d?i("div",{children:u,className:c,role:"button"}):i(nG,{route:d,children:i("span",{children:u,"aria-current":s?"page":void 0,className:c,onClick:e=>t()})})}function NG(e){let t=e.onNavigate,n=e.hasAccess,s=e.currentUrl,a=e.pages.toSorted((e,t)=>de(e.menuEntry.sortOrder,t.menuEntry.sortOrder));return r(o,{children:[L(e.label,null,e=>i("div",{children:e,className:bG})),a.map(e=>i(AG,{page:e,isActive:CG(e,s),hasAccess:n,onNavigate:t},e.fragmentId))]})}let TG=function(e){let t=e.onNavigate,n=e.currentUrl,o=void 0!==t?t:()=>{},s=sG(),a=uG(),l=s.filter(aG),c={};l.forEach(e=>{let t=U(e.menuEntry.group,""),n=U(c[t],[]);c[t]=n.concat([e])});let u=U(c[""],[]),d=Object.entries(c).filter(e=>""!==e[0]).toSorted((e,t)=>{let n=ge(e[1],999,(e,t)=>e<t.menuEntry.sortOrder?e:t.menuEntry.sortOrder),r=ge(t[1],999,(e,t)=>e<t.menuEntry.sortOrder?e:t.menuEntry.sortOrder);return de(n,r)});return r("nav",{children:[0!==u.length?i(NG,{label:void 0,pages:u,currentUrl:n,hasAccess:a,onNavigate:o}):null,d.map(e=>{let t=e[1],r=e[0],s=function(e,t){return 0===e.length?"Absent":e.every(e=>{let n=e.requiredAccess;return void 0!==n&&!t(n)})?"Locked":"Active"}(t,a);switch(s){case"Active":return i(NG,{label:r,pages:t,currentUrl:n,hasAccess:a,onNavigate:o},r);case"Locked":return i(vG,{label:r},r);case"Absent":return null}})],"aria-label":"primary navigation",className:_G})},RG=l(void 0),DG=l(void 0),IG=RG.Provider,FG=DG.Provider;let OG=function(e){return c(IG,{value:e.target,children:c(FG,{value:e.controlsTarget,children:e.children})})};function PG(){return d(RG)}function MG(e,t){return void 0!==e?w(t,D(e)):t}function LG(e){return"var("+e+")"}let zG="52px",jG=lo([pi("flex"),gi("row"),_i({NAME:"vh",VAL:100}),ci("overflow","hidden"),ci("background",LG(yt.background)),ci("font-family",LG(bt.fontFamily)),ci("color",LG(yt.textPrimary))]),UG=lo([pi("flex"),gi("column"),ci("width","236px"),vi(0),ci("background",LG(yt.surface)),ci("border-right","1px solid var("+yt.borderSubtle+")"),ci("overflow","hidden"),Wi(Ct.compact,[ji("fixed"),$i(eo(0)),xi(eo(0)),fi(eo(0)),ci("width","min(268px, 82vw)"),ci("z-index","950"),ci("box-shadow",LG(Et)),ci("transform","translateX(-100%)"),ci("visibility","hidden"),ci("transition","transform 180ms ease, visibility 0s linear 180ms")]),Wi("(prefers-reduced-motion: reduce)",[ci("transition","none")])]),BG=co([UG,lo([Wi(Ct.compact,[ci("transform","translateX(0)"),ci("visibility","visible"),ci("transition","transform 180ms ease, visibility 0s linear 0s")])])]),$G=lo([ji("fixed"),$i(eo(0)),xi(eo(0)),Ui(eo(0)),fi(eo(0)),ci("background","rgba(0,0,0,0.45)"),ci("z-index","900"),ci("display","none"),Wi(Ct.compact,[ci("display","block")])]),qG=lo([ci("display","none"),Wi(Ct.compact,[ci("display","inline-flex")]),ui("center"),bi("center"),ci("vertical-align","middle"),ci("margin-right",LG(_t.sm)),ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",LG(xt.md)),ci("padding","2px var("+_t.sm+")"),ci("color",LG(yt.textSecondary)),ci("font-size",LG(bt.sizeMd)),ci("line-height","1.6"),hi("pointer"),Qi([ci("background",LG(yt.surfaceSubtle)),ci("color",LG(yt.textPrimary))])]),GG=lo([pi("flex"),ui("center"),ci("gap",LG(_t.sm)),ci("height",zG),vi(0),ci("padding","0 var("+_t.md+")"),ci("color",LG(yt.textPrimary)),ci("font-size",LG(bt.sizeLg)),ci("font-weight",LG(bt.weightBold)),ci("letter-spacing","-0.01em")]),VG=lo([ci("white-space","nowrap"),ci("overflow","hidden"),ci("text-overflow","ellipsis")]),KG=lo([mi(1),ci("overflow-y","auto"),ci("min-height","0")]),WG=lo([pi("flex"),gi("column"),mi(1),ci("min-width","0"),ci("overflow","hidden")]),HG=lo([pi("flex"),ui("center"),ci("min-height",zG),vi(0),ci("padding","var("+_t.xs+") var("+_t.lg+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),ci("background",LG(yt.surface))]),JG=lo([ci("display","flow-root"),mi(1),ci("min-width","0")]),XG=lo([ci("display","contents")]),QG=lo([ci("float","right"),pi("flex"),ui("center"),bi("flexEnd"),ci("flex-wrap","wrap"),ci("gap",LG(_t.sm)),ci("margin-left",LG(_t.md)),ci("max-width","100%"),Ki("& > *, & > ."+XG+" > *",[ci("min-width","0"),ci("max-width","100%")])]),YG=lo([ci("display","block"),ci("min-width","0")]),ZG=lo([pi("flex"),gi("column"),mi(1),ci("overflow","auto"),ci("padding","var("+_t.md+") var("+_t.lg+")"),ci("background",LG(yt.background))]),eV="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])";let tV=function(e){let t=e.loading,n=e.routesReady,o=e.fallback,l=e.appName,c=void 0!==l?l:"Reventless",u=void 0!==o?o:"404 — Page not found",d=void 0===n||n,p=void 0!==t?t:null,g=le(),m=s(()=>{}),v=m[1],y=s(()=>{}),_=y[1],b=(e,t)=>{let n=null==t?void 0:T(t);return e(e=>void 0!==e&&null!=t&&D(e)===t?e:n)},x=s(()=>!1),S=x[1],w=x[0],E=Tq(Ct.compact),k=f(()=>S(e=>!1),[]),C=h(null),A=h(null),N=h(!1);return a(()=>{if(!w||E){if(w){N.current=!0;let e=A.current;return null!=e?(function(e){let t=Array.from(e.querySelectorAll(eV))[0];void 0===t||D(t).focus()}(e),function(e,t){let n=n=>{switch(n.key){case"Escape":return t();case"Tab":let r=Array.from(e.querySelectorAll(eV)),i=r.length;if(0===i)return void n.preventDefault();let o=r[0],s=r[i-1|0],a=document.activeElement,l=L(null==a?void 0:T(a),!1,t=>e.contains(t)),c=e=>null!=a&&void 0!==e&&a===D(e),u=l?n.shiftKey&&c(o)?s:!n.shiftKey&&c(s)?o:void 0:o;return void 0!==u?(n.preventDefault(),void D(u).focus()):void 0;default:return}};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}}(e,k)):void 0}if(N.current&&(N.current=!1,E)){let e=C.current;null!=e&&e.focus()}}else S(e=>!1)},[w,E]),r("div",{children:[r("aside",{children:[r("div",{children:[L(e.logoUrl,null,e=>i("img",{style:{height:"22px"},alt:c,src:e})),i("span",{children:c,className:VG,title:c})],className:GG}),i("div",{children:i(TG,{currentUrl:g,onNavigate:k}),className:KG})],ref:T(A),className:w?BG:UG,id:"rv-shell-nav"}),w?i("div",{"aria-hidden":!0,className:$G,onClick:e=>k()}):null,r("main",{children:[i("div",{children:r("div",{children:[r("div",{children:[i("div",{ref:T(e=>b(_,e)),className:XG}),U(e.headerSlot,null)],className:QG}),i("div",{children:i("button",{children:"☰",ref:T(C),"aria-label":w?"Close navigation":"Open navigation","aria-expanded":w,"aria-controls":"rv-shell-nav",className:qG,onClick:e=>S(e=>!e)}),ref:T(e=>b(v,e)),className:YG})],className:JG}),className:HG}),i("div",{children:i(OG,{target:m[0],controlsTarget:y[0],children:d?i(tG,{url:g,routes:e.router,children:u}):p}),className:ZG})],className:WG})],className:jG})},nV=l(void 0),rV=nV.Provider;let iV=function(e){let t=e.access,n=e.initialPanels,r=void 0!==n?n:[],i=void 0!==t?t:[],o=s(()=>r),a=o[1],l=s(()=>[]),u=l[1],d=o[0].concat(l[0]),f={register:e=>a(t=>t.concat(e)),deregister:e=>a(t=>t.filter(t=>t.extensionPackage!==e)),setPluginPanels:e=>u(t=>e),getPanel:e=>d.find(t=>t.fragmentId===e),getPanelsForPosition:e=>d.filter(t=>t.positions.some(t=>t===e)),hasAccess:e=>i.some(t=>t===e)};return c(rV,{value:f,children:e.children})};function oV(e){return"/"+e.environment+"/"+e.platformName}function sV(e){let t=e.split("?")[0],n=t.split("/").filter(e=>""!==e),r=n[0],i=n[1];if(void 0===r)return;if(void 0===i)return;let o={environment:r,platformName:i},s=oV(o),a=t.startsWith(s)?t.slice(s.length):"/";return[o,""===a?"/":a]}let aV=l(void 0).Provider;let lV=function(e){return c(aV,{value:e.scope,children:e.children})};let cV=l(void 0),uV=l({routes:[],publicLinks:{}}),dV=l(!1),fV=cV.Provider;function hV(e){return c(fV,{value:e.value,children:e.children})}let pV=uV.Provider;function gV(e){return c(pV,{value:e.value,children:e.children})}let mV=dV.Provider;function vV(e){return c(mV,{value:e.value,children:e.children})}let yV=function(e){let t=s(()=>({routes:[],publicLinks:{}})),n=t[1],r=t[0],o=s(()=>({routes:[],publicLinks:{}})),a=o[1],l=o[0],c=s(()=>!1),u=c[1],d=r.routes.concat(l.routes),f=$e(r.publicLinks,l.publicLinks),h={routes:d,publicLinks:f},p={register:(e,t)=>n(n=>({routes:n.routes.concat(e),publicLinks:$e(n.publicLinks,t)})),setPluginRoutes:(e,t)=>{a(n=>({routes:e,publicLinks:t})),u(e=>!0)}};return i(hV,{value:p,children:i(vV,{value:c[0],children:i(gV,{value:h,children:i(Ve,{registry:f,children:e.children})})})})};function _V(){return d(cV)}function bV(e){return"var("+e+")"}let xV=lo([ci("position","relative"),pi("inlineFlex")]),SV=lo([pi("inlineFlex"),ui("center"),ci("gap","3px"),ci("background",bV(yt.surface)),ci("color",bV(yt.textPrimary)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",bV(xt.md)),ci("padding","2px var("+_t.xs+")"),ci("font-family",bV(bt.fontFamily)),ci("font-size",bV(bt.sizeMd)),ci("line-height","1.4"),hi("pointer"),Qi([ci("background",bV(yt.surfaceSubtle))])]),wV=lo([ci("font-size","0.625rem"),ci("color",bV(yt.textSecondary))]),EV=lo([ci("position","absolute"),ci("top","calc(100% + 0.5rem)"),ci("right","0"),ci("min-width","170px"),ci("padding",bV(_t.xs)),ci("background",bV(yt.surfaceElevated)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",bV(xt.md)),ci("box-shadow",bV(wt)),ci("z-index","10")]),kV=lo([pi("flex"),ui("center"),ci("gap",bV(_t.sm)),ci("width","100%"),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("background","transparent"),ci("border","none"),ci("border-radius",bV(xt.sm)),ci("color",bV(yt.textPrimary)),ci("font-family",bV(bt.fontFamily)),ci("font-size",bV(bt.sizeSm)),ci("text-align","left"),hi("pointer"),Qi([ci("background",bV(yt.surfaceSubtle))])]),CV=co([kV,lo([ci("font-weight",bV(bt.weightMedium))])]),AV=lo([ci("font-size",bV(bt.sizeMd)),ci("line-height","1"),ci("width","1.25em"),ci("text-align","center"),vi(0)]),NV=lo([ci("margin-left","auto"),ci("color",bV(yt.textSecondary)),ci("font-size",bV(bt.sizeXs))]);function TV(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"High contrast"}}function RV(e){switch(e){case"Dark":return"☾";case"Light":return"☀";case"Neutral":return"◯";case"HighContrast":return"◐"}}let DV=["Light","Dark","Neutral","HighContrast"];let IV=function(e){let t=XF(),n=t.setPreset,o=t.preset,l=s(()=>!1),c=l[1],u=l[0],d=h(null);return a(()=>{if(!u)return;let e=e=>{let t=e.target,n=d.current;if(null!=n&&!function(e,t){return e.contains(t)}(n,t))return c(e=>!1)},t=e=>{if("Escape"===e.key)return c(e=>!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u]),r("div",{children:[r("button",{children:[i("span",{children:RV(o),"aria-hidden":!0}),i("span",{children:u?"▴":"▾","aria-hidden":!0,className:wV})],"aria-label":"Theme: "+TV(o),"aria-expanded":u,"aria-haspopup":"menu",className:SV,title:"Theme: "+TV(o),onClick:e=>c(e=>!e)}),u?i("div",{children:DV.map(e=>{let t=e===o;return r("button",{children:[i("span",{children:RV(e),"aria-hidden":!0,className:AV}),TV(e),t?i("span",{children:"✓",className:NV}):null],"aria-checked":t?"true":"false",className:t?CV:kV,role:"radio",onClick:t=>{n(e),c(e=>!1)}},ZF(e))}),"aria-label":"Theme",className:EV,role:"radiogroup"}):null],ref:T(d),className:xV})};function FV(e){return Object.fromEntries([["eq",e]])}let OV=/\$filter\s*:\s*[A-Za-z0-9_]*Filter\b/,PV=/\$filter\s*:/,MV={};function LV(e){return t=>(n,r)=>OV.test(n)?t(n,function(e,t){let n=He.object(e),r=void 0!==n?Object.fromEntries(Object.entries(n)):{},i=j(r.filter,He.object),o=void 0!==i?Object.fromEntries(Object.entries(i)):{};return o.environment=FV(t.environment),o.platformName=FV(t.platformName),r.filter=o,r}(r,e)):(PV.test(n)&&function(e){void 0!==MV[e]||(MV[e]=!0,console.warn("PlatformFilter: this query declares a `$filter` variable that is not a fleet-scope `<Type>Filter` input object, so it is left untouched. `$filter` is reserved for platform-scope injection in fleet mode — rename the variable (e.g. `$logFilter`) to avoid ambiguity. Query: "+e))}(n),t(n,r))}let zV={background:"var("+yt.surface+")",border:"1px solid var("+yt.borderSubtle+")",color:"var("+yt.textPrimary+")",fontFamily:"var("+bt.fontFamily+")",margin:"6rem auto",maxWidth:"480px",padding:"2rem",borderRadius:"var("+xt.md+")"},jV={background:"var("+yt.surfaceElevated+")",border:"1px solid var("+yt.border+")",color:"var("+yt.textPrimary+")",cursor:"pointer",display:"flex",fontSize:"var("+bt.sizeMd+")",marginBottom:"0.5rem",padding:"0.75rem 1rem",textAlign:"left",width:"100%",borderRadius:"var("+xt.sm+")",alignItems:"center",justifyContent:"space-between"},UV={background:"var("+yt.brandSubtle+")",color:"var("+yt.brand+")",fontSize:"var("+bt.sizeXs+")",padding:"0.125rem 0.5rem",borderRadius:"var("+xt.full+")"};let BV=function(e){let t,n=e.discover,o=SI(),l=s(()=>"Loading"),c=l[1],u=l[0];if(a(()=>{void 0!==o?(c(e=>"Loading"),ce(n(o).then(e=>c(t=>({TAG:"Loaded",_0:e}))),e=>{let t=U(j(function(e){if(e.RE_EXN_ID===I)return T(e._1)}(e),e=>e.message),"Platform discovery failed");return c(e=>({TAG:"Failed",_0:t})),Promise.resolve()})):c(e=>({TAG:"Failed",_0:"PlatformPicker rendered outside AutoGraphQL.Provider"}))},[$(o)]),"object"!=typeof u)t=i("div",{children:"Discovering platforms…",style:{color:"var("+yt.textSecondary+")"}});else if("Loaded"===u.TAG){let e=u._0;t=0!==e.length?e.map(e=>r("button",{children:[e.platformName,i("span",{children:e.environment,style:UV})],style:jV,onClick:t=>J(oV(e)+"/")},e.environment+"/"+e.platformName)):i("div",{children:"No platforms discovered.",style:{color:"var("+yt.textSecondary+")"}})}else t=i("div",{children:u._0,style:{color:"var("+yt.error+")",fontSize:"var("+bt.sizeSm+")"}});return r("div",{children:[i("h1",{children:"Select a platform",style:{fontSize:"var("+bt.sizeXl+")",fontWeight:"var("+bt.weightBold+")",margin:"0 0 1.5rem"}}),t],style:zV})};function $V(e){return j(e,e=>""===e.trim()?void 0:e)}function qV(e,t,n,r,i){let o=void 0!==i&&i,s=j(r,e=>e.nav),a=o?$V(j(s,e=>e.scopedLabel)):void 0,l=void 0!==a?a:$V(j(s,e=>e.label));return{label:U(l,t),icon:void 0,group:U($V(j(s,e=>e.group)),e),sortOrder:U(j(s,e=>e.order),n),hidden:j(s,e=>e.hidden)}}function GV(e){return"query AuditTrail($entityId: ID, $eventTypes: [String!], $user: String, $timeFrom: String, $timeTo: String, $first: Int, $after: String) {\n "+e+"(\n filter: {entityId: $entityId, eventTypes: $eventTypes, user: $user, timeFrom: $timeFrom, timeTo: $timeTo}\n first: $first\n after: $after\n ) {\n edges {\n node {\n position\n eventType\n payload\n tags { key value }\n meta { user time correlationId causationId }\n recordedAt\n }\n cursor\n }\n pageInfo { hasNextPage endCursor }\n }\n}"}let VV={contents:[]};function KV(e){if(!VV.contents.includes(e))return VV.contents.push(e),void console.error('[AutoUI] View "'+e+'" opted into an audit trail but no event log could be resolved for it — the view declares no linked write side, so there is no `…EventHistory` field to query. Remove the audit hint, or check that the read model projects an aggregate or slice.')}function WV(e,t){return j(Je(e,t),ut)}function HV(e){let t=U(ft(e),{}),n=U(j(Je(t,"meta"),ft),{}),r=me(U(j(Je(t,"tags"),ht),[]),e=>{let t=U(ft(e),{}),n=WV(t,"key"),r=WV(t,"value");if(void 0!==n&&void 0!==r)return[n,r]}),i=WV(t,"position"),o=WV(t,"eventType");if(void 0===i)return;if(void 0===o)return;let s=U(WV(n,"time"),U(WV(t,"recordedAt"),""));return{position:i,eventType:o,payload:U(Je(t,"payload"),{}),tags:r,actor:WV(n,"user"),time:s,recordedAt:U(WV(t,"recordedAt"),s)}}function JV(e,t){return at(e.startsWith(t)&&e.length>t.length?e.slice(t.length):e).toLowerCase()}function XV(e){let t={};return e.map(e=>{let n=JSON.stringify(Ye(Xe(t)),null,2);var r;return(r=e.payload,U(z(ft(r),Xe),[]).filter(e=>"TAG"!==e[0])).forEach(e=>{t[e[0]]=e[1]}),[n,JSON.stringify(Ye(Xe(t)),null,2)]})}function QV(e,t){let n=XV(e);return e.map((e,r)=>{let i=U(n[r],["",""]),o=L(e.tags[0],t,e=>t+" "+e[1]);return{id:e.position,verb:JV(e.eventType,t),subject:o,actor:U(e.actor,"System"),timestamp:e.time,before:i[0],after:i[1]}}).toReversed()}function YV(e){let t=[];return e.forEach(e=>M(e.actor,e=>t.includes(e)?void 0:void t.push(e))),t.toSorted(ue)}function ZV(e){let t=[];return e.forEach(e=>t.includes(e.eventType)?void 0:void t.push(e.eventType)),t.toSorted(ue)}function eK(e){return"var("+e+")"}let tK=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",eK(_t.lg)),ci("padding",eK(_t.xxl)),Gi({NAME:"percent",VAL:100}),_i({NAME:"percent",VAL:100}),Bi("center"),ci("min-height","400px")]),nK=lo([ci("font-size","48px"),ci("line-height","1")]),rK=lo([ci("color",eK(yt.textPrimary)),ci("font-size",eK(bt.sizeXxl)),ci("font-weight",eK(bt.weightBold)),Ei(eo(0))]),iK=lo([ci("color",eK(yt.textSecondary)),ci("font-size",eK(bt.sizeLg)),ci("line-height",eK(bt.lineHeightRelaxed)),ci("max-width","480px"),Ei(eo(0))]),oK=lo([ci("background",eK(yt.brand)),ci("color",eK(yt.textOnBrand)),ci("border-radius",eK(xt.md)),ci("padding","var("+_t.sm+") var("+_t.lg+")"),ci("font-size",eK(bt.sizeMd)),ci("font-weight",eK(bt.weightMedium)),ci("border","none"),ci("cursor","pointer"),Ni(eo(8))]);let sK=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:nK}),i("h2",{children:t.title,className:rK}),i("p",{children:L(t.requiredAccess,"This feature requires an upgrade.",e=>'This feature requires the "'+e+'" access tier.'),className:iK}),i("button",{children:"Upgrade to unlock",className:oK})],className:tK})};let aK=function(e){let t=e.children,n=e.definition,r=uG(),o=n.requiredAccess;return void 0===o||r(o)?t:i(sK,{definition:n})},lK=Je;function cK(e,t){let n=j(t[0],t=>Je(e,t));if(void 0!==n&&t.every(t=>mt(Je(e,t),n)))return n}function uK(e,t,n){let r=Je(e,t);return void 0===r||n(r)}function dK(e,t,n){return me(t,t=>{let r=Je(e,t);if(void 0!==r&&!n(r))return t+': requires "'+r+'"'})}let fK=["body","text","message","comment","content"],hK=["author","createdby","user","commenter","postedby"],pK=["createdat","postedat","at","commentedat"];function gK(e){return me(_a(e),e=>{if(Sa(e[1]))return e[0]})}function mK(e,t){return gK(e).find(e=>t.includes(e.toLowerCase()))}function vK(e){let t=za(e,void 0,void 0),n=_a(e).map(e=>e[0]).find(e=>L(Je(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:mK(e,hK)}function yK(e){return gK(e).filter(e=>{let t=e.toLowerCase();return"id"!==t&&t.endsWith("id")})}function _K(e,t){let n=et(t).toLowerCase();return yK(e).find(e=>e.toLowerCase()===n+"id")}function bK(e,t){let n=e.toLowerCase(),r=t.toLowerCase(),i=et(t).toLowerCase();return!!n.endsWith("comments")&&(n===i+"comments"||n===r+"comments")}let xK=["addcomment","postcomment","comment","writecomment","leavecomment"];function SK(e,t){let n=me(e.linkedWriteSide,e=>t.aggregates.find(t=>t.name===e)).map(e=>e.commands).flat();return e.commands.concat(n).find(e=>xK.some(t=>e.name.toLowerCase().startsWith(t)))}let wK={contents:[]};function EK(e,t){return me(e.readModels.filter(e=>e.name!==t&&(!!L(j(ft(e.schema),e=>Je(e,"x-reventless-comments")),!1,e=>{let t=ct(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||bK(e.name,t))),n=>{let r=_K(n.schema,t),i=void 0!==r?r:bK(n.name,t)?function(e){let t=yK(e);return 1!==t.length?void 0:t[0]}(n.schema):void 0,o=mK(n.schema,fK);return void 0!==o?void 0!==i?{readModel:n,entityField:i,bodyField:o,authorField:vK(n.schema),timestampField:(s=n.schema,me(_a(s),e=>{if(wa(e[1]))return e[0]}).find(e=>pK.includes(e.toLowerCase()))),postCommand:SK(n,e)}:void 0:void function(e){if(!wK.contents.includes(e))wK.contents.push(e),console.error('[AutoUI] Read model "'+e+'" announces itself as comments but has no body field — no comment thread is wired. The convention expects a string field named '+fK.join(" | ")+' (plus an entity ref like "orderId"); see docs/guides/comments-read-model-convention.md.')}(n.name);var s})[0]}function kK(e,t){return j(Je(e,t),ut)}function CK(e){return{filter:e.isId||e.isCompositeId||e.isSubId||e.isCompositeSubId||$(e.index)||e.scan,sort:e.isId||e.isSubId||e.isCompositeSubId||$(e.index)||e.scanSort}}function AK(e){return CK(e.ann)}function NK(e){let t=$(Os(e)),n=0!==Fs(e).length,r=0!==Ms(e).length;return{search:t||n||r}}function TK(e){let t=U(z(j(j(ft(e),e=>Je(e,"properties")),ft),Xe),[]),n=t.map(e=>CK(Ds(e[1]))),r=n.some(e=>e.filter),i=n.some(e=>e.sort);return{hasFilter:r,hasSort:i,hasSearch:NK(e).search}}function RK(e,t){let n={},r={};return Xe(e).forEach(e=>{let i=e[1];if(""===i)return;let o=e[0],s=t.find(e=>e.key===o);if(void 0!==s){return void(CK(s.ann).filter?n[o]=i:r[o]=i)}r[o]=i}),[n,r]}function DK(e,t,n){if(void 0===e)return"NoSort";let r=n.find(t=>t.key===e);return void 0!==r?CK(r.ann).sort?{TAG:"ServerSort",_0:e,_1:t}:{TAG:"ClientSort",_0:e,_1:t}:"NoSort"}function IK(e,t,n,r){let i={};return n.search&&""!==t&&(i.search=t),Xe(e).forEach(e=>{let t,n=e[1],o=e[0],s=r.find(e=>e.key===o),a=z(s,e=>e.kind);if(void 0!==a&&"object"!=typeof a)switch(a){case"KBoolean":t="true"===n;break;case"KNumber":t=U(z(ea(n),e=>e),n);break;default:t=n}else t=n;i[o+"Eq"]=t}),0===Xe(i).length?void 0:i}let FK={contents:[]};function OK(e,t){return me(e.readModels.filter(e=>e.name!==t),e=>{let n=_K(e.schema,t);if(void 0!==n)return function(e,t){return L(_a(e).find(e=>e[0]===t),!1,e=>CK(Ds(e[1])).filter)}(e.schema,n)?{readModel:e,refField:n}:void function(e,t,n){let r=e+"."+t;if(!FK.contents.includes(r))FK.contents.push(r),console.error('[AutoUI] View "'+e+'" references "'+n+'" through "'+t+'", but the server cannot filter on that field — so "'+n+'" gets no "'+e+'" panel on its detail page. Annotate '+t+" with @index (or @scan, for a small view) on the read model's state so the connection gains a "+t+"Eq filter; see docs/guides/related-rows.md.")}(e.name,n,t)})}function PK(e){return"var("+e+")"}function MK(e){switch(e){case"Success":return yt.success;case"Warning":return yt.warning;case"Error":return yt.error;case"Info":return yt.info}}function LK(e){return lo([pi("flex"),ui("flexStart"),ci("gap",PK(_t.sm)),ci("padding","var("+_t.sm+") var("+_t.md+")"),ci("border-radius",PK(xt.md)),ci("border-left","3px solid var("+MK(e)+")"),ci("background",PK(yt.surfaceElevated)),ci("font-size",PK(bt.sizeMd)),ci("line-height",PK(bt.lineHeightNormal))])}let zK=lo([mi(1)]),jK=lo([ci("font-weight",PK(bt.weightMedium)),ci("color",PK(yt.textPrimary)),Ti(eo(2))]),UK=lo([ci("color",PK(yt.textSecondary))]),BK=lo([ci("background","none"),to(eo(0),"none",so),hi("pointer"),ci("color",PK(yt.textSecondary)),ci("font-size","16px"),ci("line-height","1"),ci("padding","0"),vi(0)]);function $K(e){switch(e){case"Success":return"OK";case"Warning":return"!";case"Error":return"X";case"Info":return"i"}}let qK=function(e){let t=e.variant,n=void 0!==t?t:"Info";return r("div",{children:[i("span",{children:$K(n),className:(o=n,lo([ci("color",PK(MK(o))),ci("font-size","16px"),vi(0),Ni(eo(1))]))}),r("div",{children:[L(e.title,null,e=>i("div",{children:e,className:jK})),i("div",{children:e.message,className:UK})],className:zK}),L(e.onDismiss,null,e=>i("button",{children:"×","aria-label":"Dismiss",className:BK,onClick:t=>e()}))],className:LK(n),role:"alert"});var o};function GK(e){return"var("+e+")"}let VK=lo([ji("fixed"),$i(eo(0)),xi(eo(0)),Ui(eo(0)),fi(eo(0)),ci("background","rgba(0,0,0,0.5)"),pi("flex"),ui("center"),bi("center"),ci("z-index","1000"),ci("backdrop-filter","blur(2px)")]),KK=lo([ci("background",GK(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",GK(xt.lg)),ci("box-shadow",GK(Et)),pi("flex"),gi("column"),ci("max-height","90vh"),ci("max-width","90vw"),ci("min-width","400px"),ci("overflow","hidden")]),WK=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("padding","var("+_t.md+") var("+_t.lg+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),vi(0)]),HK=lo([ci("color",GK(yt.textPrimary)),ci("font-size",GK(bt.sizeLg)),ci("font-weight",GK(bt.weightMedium)),Ei(eo(0))]),JK=lo([ci("background","none"),ci("border","none"),ci("cursor","pointer"),ci("color",GK(yt.textSecondary)),ci("font-size","18px"),ci("padding","0"),ci("line-height","1"),Qi([ci("color",GK(yt.textPrimary))])]),XK=lo([ci("padding",GK(_t.lg)),ci("overflow-y","auto"),mi(1)]),QK=lo([pi("flex"),ui("center"),bi("flexEnd"),ci("gap",GK(_t.sm)),ci("padding","var("+_t.md+") var("+_t.lg+")"),ci("border-top","1px solid var("+yt.borderSubtle+")"),vi(0)]);let YK=function(e){let t=e.onClose,n=e.isOpen;return a(()=>{if(!n)return;let e=e=>{if("Escape"===e.key)return t()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n]),n?i("div",{children:r("div",{children:[r("div",{children:[i("h2",{children:e.title,className:HK}),i("button",{children:"x",className:JK,onClick:e=>t()})],className:WK}),i("div",{children:e.children,className:XK}),L(e.footer,null,e=>i("div",{children:e,className:QK}))],className:KK,style:L(e.width,{},e=>({width:e})),onClick:e=>{e.stopPropagation()}}),className:VK,onClick:e=>t()}):null};function ZK(e){switch(e){case"Added":return"Added";case"BulkInvalidated":return"BulkInvalidated";case"Removed":return"Removed";case"Updated":return"Updated";default:return}}function eW(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}let tW="default";function nW(e,t,n,r,i){let o=void 0===n||n,s=gO(),l=function(e,t){let n=eW(e);return"object"!=typeof t?"/"+tW+"/"+n+"/*":"/"+tW+"/"+n+"/"+eW(t._0)}(e,t),c=h(r);a(()=>{c.current=r},[r]);let u=h(i);a(()=>{u.current=i},[i]);let d=h(void 0);a(()=>{if(o){if(void 0===s)return;let t=s.apiForReadModel(e),n={contents:void 0},r={contents:void 0},i=setTimeout(()=>{let e=s.subscribe(t,l,e=>{let t=function(e){let t=He.object(e);if(void 0===t)return;let n=e=>j(t[e],He.string),r=t.state,i=void 0!==r&&$(He.object(r))?r:void 0,o=j(n("changeKind"),ZK),s=n("id");return void 0!==o&&void 0!==s?{changeKind:o,id:s,sortKeyValue:n("sortKeyValue"),state:i,seq:n("seq")}:void 0}(e);if(void 0!==t)return c.current(t)});n.contents=e;let i=s.registerReconnect(t,()=>M(u.current,e=>e()));if(r.contents=i,mt(d.current,l))return d.current=void 0,M(u.current,e=>e())},100);return()=>{clearTimeout(i);let e=n.contents;void 0!==e&&e();let t=r.contents;if(void 0!==t)return t()}}d.current=l},[l,o,s])}function rW(e){return"var("+e+")"}let iW=lo([pi("flex"),gi("column"),ci("gap",rW(_t.sm))]),oW=lo([ci("overflow-x","auto")]),sW=lo([ci("border-collapse","collapse"),ci("font-size",rW(bt.sizeSm)),ci("min-width","min-content")]),aW=[ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("background",rW(yt.surfaceSubtle)),ci("white-space","nowrap"),ci("font-weight",rW(bt.weightMedium))],lW=lo(aW.concat([ci("text-align","left"),ci("color",rW(yt.textSecondary))])),cW=lo(aW.concat([ci("text-align","right"),ci("color",rW(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em"),ci("font-size",rW(bt.sizeXs))])),uW=lo(aW.concat([ci("text-align","left"),ci("color",rW(yt.textPrimary))]));let dW=lo([pi("flex"),ui("center"),ci("gap","6px"),ci("font-size",rW(bt.sizeXs)),ci("color",rW(yt.textSecondary))]);function fW(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<.12?.12:n>1?1:n}let hW=[.12,.35,.6,.85,1];let pW=function(e){let t=e.cells,n=e.colHeaders,o=function(e){return ge(e,0,(e,t)=>ge(t,e,(e,t)=>t.value>e?t.value:e))}(t);return r("div",{children:[i("div",{children:r("table",{children:[i("thead",{children:r("tr",{children:[i("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:lW,scope:"col"}),n.map(e=>i("th",{children:e.label,className:cW,scope:"col"},e.value))]})}),i("tbody",{children:e.rowHeaders.map((e,s)=>r("tr",{children:[i("th",{children:e.label,className:uW,scope:"row"}),n.map((n,r)=>{let a=U(j(t[s],e=>e[r]),{value:0,display:""});return i("td",{children:i("span",{children:a.display,title:e.label+" × "+n.label+": "+a.display}),className:(l=fW(a.value,o),lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("text-align","right"),ci("white-space","nowrap"),ci("background",l<=0?"transparent":"color-mix(in srgb, var("+yt.brand+") "+Math.round(100*l).toString()+"%, transparent)"),ci("color",rW(l>=.55?yt.textOnBrand:l<=0?yt.textDisabled:yt.textPrimary))]))},e.value+":"+n.value);var l})]},e.value))})],className:sW}),className:oW}),r("div",{children:["0",hW.map(e=>{return i("span",{className:(t=e,lo([ci("width","18px"),ci("height","10px"),ci("background","color-mix(in srgb, var("+yt.brand+") "+Math.round(100*t).toString()+"%, transparent)"),ci("border","1px solid var("+yt.borderSubtle+")")]))},e.toString());var t}),e.maxLabel],className:dW})],className:iW})};function gW(e){let t=e.parent;if(void 0!==t&&""!==t)return t}function mW(e){let t={};e.forEach(e=>{t[e.key]=e});let n=e.length,r={},i=[],o={contents:0},s={contents:0};e.forEach(e=>{let a=gW(e);if(void 0!==a){if(void 0!==Je(t,a)){if(function(e,t,n){let r=j(Je(e,t),gW);if(void 0===r)return!1;if(r===t)return!0;{let i=r,o=0;for(;;){let r=o;if(r>n)return!0;let s=j(Je(e,i),gW);if(void 0===s)return!1;if(s===t)return!0;o=r+1|0,i=s}}}(t,e.key,n))return s.contents=s.contents+1|0,void i.push(e.key);let o=U(Je(r,a),[]);return void(r[a]=o.concat([e.key]))}return o.contents=o.contents+1|0,void i.push(e.key)}i.push(e.key)});let a=(e,i)=>{let o=Je(t,e);if(void 0!==o)return{node:o,children:i>=n?[]:me(U(Je(r,e),[]),e=>a(e,i+1|0))}};return{roots:me(i,e=>a(e,0)),detached:o.contents,cycles:s.contents}}function vW(e){return ge(e.children,e.children.length,(e,t)=>e+vW(t)|0)}function yW(e){return"var("+e+")"}let _W=lo([pi("flex"),gi("column"),ci("gap",yW(_t.sm))]),bW=lo([ci("overflow-x","auto"),ci("padding-bottom","4px")]),xW=lo([pi("flex"),ui("flexStart"),bi("center"),ci("gap",yW(_t.lg)),ci("min-width","min-content"),ci("padding","var("+_t.xs+") 0")]),SW=lo([pi("flex"),gi("column"),ui("center"),ci("min-width","min-content")]);let wW=lo([ci("font-size",yW(bt.sizeSm)),ci("font-weight",yW(bt.weightMedium)),ci("color",yW(yt.textPrimary)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),EW=lo([ci("font-size",yW(bt.sizeXs)),ci("color",yW(yt.textSecondary)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),kW=lo([ci("margin-top","2px"),ci("padding","0 6px"),ci("border","1px solid var("+yt.border+")"),ci("border-radius","10px"),ci("background",yW(yt.surface)),ci("color",yW(yt.textSecondary)),ci("font-size",yW(bt.sizeXs)),ci("line-height","16px"),hi("pointer"),Qi([ci("color",yW(yt.textPrimary))])]),CW=lo([ci("width","1px"),ci("height","14px"),ci("background",yW(yt.border))]),AW=lo([pi("flex"),ui("flexStart"),ci("min-width","min-content")]),NW=lo([pi("flex"),gi("column"),ui("center"),ci("min-width","min-content")]),TW=lo([ci("padding","0 var("+_t.xs+")")]),RW=lo([pi("flex"),ci("width","100%"),ci("height","1px")]);function DW(e){return lo([ci("flex","1 1 50%"),ci("background",e?yW(yt.border):"transparent")])}let IW=lo([ci("font-size",yW(bt.sizeXs)),ci("color",yW(yt.textDisabled))]),FW="var("+yt.brand+")",OW=function(e,t){let n=t=>{throw{RE_EXN_ID:"Undefined_recursive_module",_1:e,Error:new Error}},r=(e,t,i)=>{if("object"==typeof e){if("Module"!==e.TAG)return void(t[i]=e._0);let n=e._0,o={};t[i]=o;let s=n.length;for(let e=0;e<s;++e){let t=n[e];r(t[0],o,t[1])}return}switch(e){case"Function":case"Lazy":return void(t[i]=n);case"Class":return void(t[i]=[n,n,n,0])}},i={},o="dummy";return r(t,i,o),i[o]}(["OrgChart.res",255,4],{TAG:"Module",_0:[["Function","make"]]});!function(e,t,n){let r=(e,t,n,i,o)=>{if("object"==typeof e){if("Module"!==e.TAG)return;let i=e._0;for(let e=0,o=i.length;e<o;++e){let o=i[e],s=o[1];r(o[0],t[s],n[s],t,s)}return}switch(e){case"Function":return void(i[o]=n);case"Lazy":case"Class":return void Object.assign(t,n)}};if("object"!=typeof e)throw{RE_EXN_ID:"Assert_failure",_1:["Primitive_module.res",68,9],Error:new Error};{let i=e._0;for(let e=0,o=i.length;e<o;++e){let o=i[e],s=o[1];r(o[0],t[s],n[s],t,s)}}}({_0:[["Function","make"]]},OW,{make:function(e){let t=e.depth,n=e.tree,a=s(()=>!1),l=a[1],c=a[0],u=vW(n),d=n.children.length,f=n.node.subtitle;return r("div",{children:[r("button",{children:[i("span",{children:n.node.title,className:wW}),void 0!==f&&""!==f?i("span",{children:f,className:EW}):null],className:(h=U(n.node.accent,FW),lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-width","132px"),ci("max-width","180px"),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-top","3px solid "+h),ci("border-radius",yW(xt.md)),ci("background",yW(yt.surface)),ci("text-align","left"),hi("pointer"),Qi([ci("background",yW(yt.surfaceSubtle))])])),title:n.node.title,onClick:e=>M(n.node.onOpen,e=>e())}),0===d?null:r(o,{children:[i("button",{children:c?"+"+u.toString():"−","aria-expanded":!c,className:kW,title:c?"Expand":"Collapse",onClick:e=>l(e=>!e)}),c?null:r(o,{children:[i("div",{className:CW}),i("div",{children:n.children.map((e,n)=>r("div",{children:[r("div",{children:[i("div",{className:DW(n>0)}),i("div",{className:DW(n<(d-1|0))})],className:RW}),i("div",{className:CW}),i("div",{children:i(OW.make,{tree:e,depth:t+1|0}),className:TW})],className:NW},e.node.key)),className:AW})]})]})],className:SW});var h}});let PW=function(e){let t=mW(e.nodes);if(0===t.roots.length)return i(yo,{title:"Nothing to chart",description:"No rows in this window."});let n=me([e.windowNote,t.detached>0?t.detached.toString()+" item(s) whose parent is outside this window":void 0,t.cycles>0?t.cycles.toString()+" item(s) in a parent loop, shown as roots":void 0],e=>e);return r("div",{children:[i("div",{children:i("div",{children:t.roots.map(e=>i(OW.make,{tree:e,depth:0},e.node.key)),className:xW}),className:bW}),0===n.length?null:i("span",{children:n.join(" · "),className:IW})],className:_W})};function MW(e){return"var("+e+")"}let LW=lo([ji("relative"),ci("padding-left","28px"),pi("flex"),gi("column"),ci("gap",MW(_t.md))]),zW=lo([ji("absolute"),xi(eo(7)),$i(eo(8)),fi(eo(0)),ci("width","2px"),ci("background",MW(yt.borderSubtle))]),jW=lo([ji("absolute"),xi(eo(-21)),$i(eo(6)),ci("width","10px"),ci("height","10px"),ci("border-radius","50%"),ci("background",MW(yt.brand)),ci("border","2px solid var("+yt.surface+")"),vi(0)]),UW=lo([ji("relative"),pi("flex"),gi("column"),ci("gap","2px")]),BW=co([UW,lo([ci("background","none"),ci("border","none"),ci("padding","0"),Bi("left"),hi("pointer"),Qi([ci("opacity","0.85")])])]),$W=lo([pi("flex"),ui("center"),ci("gap",MW(_t.sm))]),qW=lo([ci("color",MW(yt.textDisabled)),ci("font-size",MW(bt.sizeXs)),ci("font-family",MW(bt.fontFamilyMono))]),GW=lo([ci("color",MW(yt.textPrimary)),ci("font-size",MW(bt.sizeMd)),ci("font-weight",MW(bt.weightMedium))]),VW=lo([ci("color",MW(yt.textSecondary)),ci("font-size",MW(bt.sizeSm)),ci("line-height",MW(bt.lineHeightNormal)),Ci(eo(0))]);let KW=function(e){let t=e.onSelect,n=e=>r(o,{children:[i("div",{className:jW,style:z(e.accent,e=>({background:e}))}),r("div",{children:[i("span",{children:e.timestamp,className:qW}),L(e.variant,null,t=>i(xs,{variant:t,label:e.label})),L(e.variant,i("span",{children:e.label,className:GW}),e=>null)],className:$W}),L(e.detail,null,e=>i("div",{children:e,className:VW}))]});return r("div",{children:[i("div",{className:zW}),e.entries.map(e=>void 0!==t?i("button",{children:n(e),className:BW,type:"button",onClick:n=>t(e.id)},e.id):i("div",{children:n(e),className:UW},e.id))],className:LW})};function WW(e){let t=j(j(ft(e),e=>Qe(e)[0]),ft),n=j(j(t,e=>Je(e,"__typename")),ut);if(void 0===n)return{TAG:"NotExecuted",_0:"The server did not confirm this command. It may not have been applied."};switch(n){case"CommandAccepted":return"Accepted";case"CommandPending":return"Pending";case"CommandRejected":return{TAG:"Rejected",_0:{errorCode:j(j(t,e=>Je(e,"errorCode")),ut),detail:j(j(t,e=>Je(e,"errorDetail")),ut)}};default:return{TAG:"NotExecuted",_0:"The server answered with an unexpected result type ("+n+")."}}}function HW(e){let t=WW(e.data);if("object"!=typeof t)return t;if("NotExecuted"!==t.TAG)return t;let n=t._0,r=e.errors[0];return void 0!==r&&""!==r.message?{TAG:"NotExecuted",_0:r.message}:{TAG:"NotExecuted",_0:n}}function JW(e,t){let n=Je(e,t);if(void 0===n)return;let r=ut(n);return void 0!==r?r:j(j(ft(n),e=>Je(e,"TAG")),ut)}function XW(e,t,n){if(void 0===n)return e;let r=JW(t,n);return e.filter(e=>{let t=e.allowedStates;return void 0===t||void 0!==r&&t.includes(r)})}function QW(e){let t=0|new Date(e).getMonth();return U(ac[t],"").slice(0,3)}function YW(e,t){switch(t){case"Days":return dc(e);case"Weeks":return uc(e).toString()+" "+QW(e);case"Months":let t=new Date(e).getFullYear().toString();return QW(e)+" '"+t.slice(2)}}function ZW(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function eH(e){return e<0?0:e>100?100:e}function tH(e,t,n){let r=eH(ZW(e.start,t,n)),i=eH(ZW(e.end_>e.start?e.end_:e.start,t,n))-r,o=i<.6?.6:i;return[r+o>100?100-o:r,o]}function nH(e){return e.map(t=>me(t.dependsOn,n=>z(e.find(e=>e.key===n&&e.key!==t.key),e=>({from:e.key,to_:t.key,violated:t.start<e.end_})))).flat()}function rH(e){return nH(e).filter(e=>e.violated)}let iH="184px";function oH(e){return"var("+e+")"}let sH=lo([pi("flex"),gi("column"),ci("gap",oH(_t.sm))]),aH=lo([pi("flex"),ui("center"),bi("spaceBetween"),yi("wrap"),ci("gap",oH(_t.sm))]),lH=lo([pi("inlineFlex"),ui("center"),ci("gap",oH(_t.xs))]),cH=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",oH(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",oH(yt.textSecondary)),ci("font-size",oH(bt.sizeSm)),hi("pointer"),Qi([ci("background",oH(yt.surfaceSubtle)),ci("color",oH(yt.textPrimary))])]),uH=co([cH,lo([ci("background",oH(yt.surfaceSubtle)),ci("color",oH(yt.textPrimary)),ci("font-weight",oH(bt.weightMedium))])]),dH=lo([ci("font-size",oH(bt.sizeMd)),ci("font-weight",oH(bt.weightMedium)),ci("color",oH(yt.textPrimary))]),fH=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",oH(xt.md)),ci("overflow","hidden")]),hH=lo([pi("flex"),ui("stretch")]),pH=co([hH,lo([ci("background",oH(yt.surfaceSubtle)),ci("border-bottom","1px solid var("+yt.borderSubtle+")")])]),gH=lo([ci("flex","0 0 "+iH),ci("padding","4px var("+_t.sm+")"),ci("font-size",oH(bt.sizeXs)),ci("color",oH(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),mH=lo([ji("relative"),ci("flex","1 1 auto"),ci("height","22px"),ci("overflow","hidden")]),vH=lo([ji("absolute"),ci("top","4px"),ci("padding-left","3px"),ci("border-left","1px solid var("+yt.borderSubtle+")"),ci("font-size",oH(bt.sizeXs)),ci("color",oH(yt.textSecondary)),ci("white-space","nowrap"),ci("pointer-events","none")]),yH=lo([ji("relative")]),_H=co([hH,lo([ci("height",30..toString()+"px"),ci("border-top","1px solid var("+yt.borderSubtle+")")])]),bH=lo([ci("flex","0 0 "+iH),pi("flex"),ui("center"),ci("gap","4px"),ci("padding","0 var("+_t.sm+")"),ci("font-size",oH(bt.sizeSm)),ci("color",oH(yt.textPrimary)),ci("border-right","1px solid var("+yt.borderSubtle+")"),ci("overflow","hidden")]),xH=lo([ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),SH=lo([ci("color",oH(yt.warning)),ci("font-size",oH(bt.sizeXs)),ci("flex","0 0 auto")]),wH=lo([ji("relative"),ci("flex","1 1 auto")]),EH=lo([ji("absolute"),ci("top","0"),ci("bottom","0"),ci("width","1px"),ci("background",oH(yt.borderSubtle)),ci("opacity","0.6"),ci("pointer-events","none")]);let kH=lo([ci("outline","2px solid var("+yt.warning+")"),ci("outline-offset","1px")]),CH=lo([ji("absolute"),ci("top","0"),ci("left",iH),ci("right","0"),ci("bottom","0"),ci("pointer-events","none")]),AH=lo([ci("display","block"),ci("width","100%"),ci("height","100%")]),NH=lo([ci("font-size",oH(bt.sizeXs)),ci("color",oH(yt.textDisabled))]),TH="var("+yt.brand+")";function RH(e){return(Math.round(100*e)/100).toString()}function DH(e,t){let n=Ql(t,-1);return lc(e)===lc(n)?lc(e):lc(e)+" – "+lc(n)}function IH(e){let t=e.to_,n=e.from,r=e.tasks,o=e.edge,s=e=>r.findIndex(t=>t.key===e),a=s(o.from),l=s(o.to_),c=r[a],u=r[l];if(void 0===c)return null;if(void 0===u)return null;let d,f=tH(c,n,t),h=tH(u,n,t)[0],p=f[0]+f[1],g=30*a+15,m=30*l+15,v=o.violated?e.arrowBadId:e.arrowId;if(h>p){let e=eH((p+h)/2);d=[[p,g],[e,g],[e,m],[h,m]]}else{let e=eH(p+1.4),t=eH(h-1.4),n=(g+m)/2;d=[[p,g],[e,g],[e,n],[t,n],[t,m],[h,m]]}let y=o.violated?"var("+yt.warning+")":"var("+yt.border+")",_=d.length-2|0;return i("g",{children:d.map((e,t)=>{let n=d[t+1|0];return void 0!==n?i("line",{markerEnd:t===_?"url(#"+v+")":void 0,stroke:y,strokeWidth:"1.5",x1:RH(e[0])+"%",x2:RH(n[0])+"%",y1:RH(e[1]),y2:RH(n[1])},t.toString()):null})})}let FH=function(e){let t=e.initialGranularity,n=e.windowNote,o=e.tasks,a=m(),l=s(()=>t),c=l[1],u="rv-gantt-arrow-"+a,d="rv-gantt-arrow-bad-"+a,f=function(e){let t=e[0];if(void 0===t)return;let n=ge(e,t.start,(e,t)=>t.start<e?t.start:e),r=ge(e,t.end_,(e,t)=>t.end_>e?t.end_:e);return[Xl(n),Ql(Xl(r),1)]}(o);if(void 0===f)return i(yo,{title:"Nothing scheduled",description:"No row in this window carries a start and end date."});let h,p=f[1],g=f[0],v=U(l[0],function(e,t){let n=(t-e)/hc;return n<=21?"Days":n<=120?"Weeks":"Months"}(g,p)),y=function(e,t,n){let r=t=>{switch(n){case"Days":return Ql(Xl(e),t);case"Weeks":return Ql(Zl(e),7*t|0);case"Months":return Yl(ec(e),t)}},i=[],o=0;for(;r(o)<t&&o<2e3;){let t=r(o);t>=e&&i.push(t),o=o+1|0}let s=i.length,a=s<=40?1:1+(s/40|0)|0;return ve(i,(e,t)=>{if(0===fe(t,a))return[e,YW(e,n)]})}(g,p,v),_=nH(o),b=function(e){return ge(e,0,(t,n)=>t+n.dependsOn.filter(t=>!e.some(e=>e.key===t)).length|0)}(o),x=rH(o).length,S=(e,t)=>i("button",{children:t,className:v===e?uH:cH,onClick:t=>c(t=>e)}),w=0;if(void 0!==n||0!==b||0!==x?w=1:h=null,1===w){let e=me([n,b>0?b.toString()+" dependency link(s) outside this window":void 0,x>0?x.toString()+" start(s) before a dependency ends":void 0],e=>e);h=i("span",{children:e.join(" · "),className:NH})}return r("div",{children:[r("div",{children:[i("span",{children:DH(g,p),className:dH}),r("div",{children:[S("Days","Days"),S("Weeks","Weeks"),S("Months","Months")],className:lH})],className:aH}),r("div",{children:[r("div",{children:[i("div",{children:"Task",className:gH}),i("div",{children:y.map(e=>{let t=e[0];return i("span",{children:e[1],className:vH,style:{left:RH(ZW(t,g,p))+"%"}},t.toString())}),className:mH})],className:pH}),r("div",{children:[o.map(e=>{let t=tH(e,g,p),n=function(e,t){return rH(e).some(e=>e.to_===t)}(o,e.key),s=(a=U(e.accent,TH),lo([ji("absolute"),ci("top","5px"),ci("height",19..toString()+"px"),ci("border","none"),ci("border-radius",oH(xt.sm)),ci("background",a),ci("padding","0"),hi("pointer"),Qi([ci("filter","brightness(1.12)")])]));var a;let l=n?s+" "+kH:s;return r("div",{children:[r("div",{children:[n?i("span",{children:"▲",className:SH,title:"Starts before a dependency ends"}):null,i("span",{children:e.title,className:xH,title:e.title})],className:bH}),r("div",{children:[y.map(e=>{let t=e[0];return i("div",{className:EH,style:{left:RH(ZW(t,g,p))+"%"}},t.toString())}),i("button",{className:l,style:{left:RH(t[0])+"%",width:RH(t[1])+"%"},title:e.title+" · "+dc(e.start)+" → "+dc(e.end_),onClick:t=>e.onOpen()})],className:wH})],className:_H},e.key)}),i("div",{children:r("svg",{children:[r("defs",{children:[i("marker",{children:i("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+yt.border+")"}),id:u,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"}),i("marker",{children:i("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+yt.warning+")"}),id:d,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"})]}),_.map(e=>i(IH,{edge:e,tasks:o,from:g,to_:p,arrowId:u,arrowBadId:d},e.from+"->"+e.to_))],className:AH}),className:CH})],className:yH})],className:fH}),h],className:sH})};function OH(e){return"var("+e+")"}let PH=lo([ci("overflow-x","auto")]),MH=lo([ci("border-collapse","collapse"),ci("font-size",OH(bt.sizeSm)),ci("color",OH(yt.textPrimary)),ci("min-width","min-content")]),LH=[ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("text-align","right"),ci("white-space","nowrap")],zH=lo(LH),jH=lo(LH.concat([ci("color",OH(yt.textDisabled))])),UH=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("text-align","left"),ci("color",OH(yt.textSecondary)),ci("font-weight",OH(bt.weightMedium)),ci("white-space","nowrap")]),BH=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("text-align","right"),ci("background",OH(yt.surfaceSubtle)),ci("color",OH(yt.textSecondary)),ci("font-weight",OH(bt.weightMedium)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em"),ci("font-size",OH(bt.sizeXs)),ci("white-space","nowrap")]),$H=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("text-align","left"),ci("background",OH(yt.surfaceSubtle)),ci("color",OH(yt.textPrimary)),ci("font-weight",OH(bt.weightMedium)),ci("white-space","nowrap")]),qH=lo(LH.concat([ci("font-weight",OH(bt.weightMedium))])),GH=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("padding","4px var("+_t.sm+")"),ci("background",OH(yt.surfaceSubtle)),ci("color",OH(yt.textSecondary)),ci("font-weight",OH(bt.weightMedium)),ci("white-space","nowrap")]),VH="Total";let KH=function(e){let t=e.colTotals,n=e.rowTotals,o=e.cells,s=e.colHeaders;return i("div",{children:r("table",{children:[i("thead",{children:r("tr",{children:[i("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:UH,scope:"col"}),s.map(e=>i("th",{children:e.label,className:BH,scope:"col"},e.value)),i("th",{children:VH,className:GH,scope:"col"})]})}),i("tbody",{children:e.rowHeaders.map((e,t)=>{let a=U(o[t],[]);return r("tr",{children:[i("th",{children:e.label,className:$H,scope:"row"}),s.map((e,t)=>{let n=U(a[t],{display:"",empty:!0});return i("td",{children:n.empty?"—":n.display,className:n.empty?jH:zH},e.value)}),i("td",{children:U(n[t],""),className:qH})]},e.value)})}),i("tfoot",{children:r("tr",{children:[i("th",{children:VH,className:GH,scope:"row"}),s.map((e,n)=>i("td",{children:U(t[n],""),className:qH},e.value)),i("td",{children:e.grandTotal,className:qH})]})})],className:MH}),className:PH})};let WH=function(e){let t=e.label,n=e.size;return i(rR,{kind:"Media",size:void 0!==n?n:"Detail",label:void 0!==t?t:"No image"})};function HH(e){return"var("+e+")"}let JH=lo([pi("grid"),ci("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ci("gap",HH(_t.md))]),XH=lo([pi("flex"),gi("column"),ui("stretch"),ci("gap",HH(_t.xs)),ci("padding","0"),ci("background","none"),ci("border","none"),ci("text-align","left"),hi("pointer"),Qi([ci("opacity","0.88")])]),QH=lo([ci("width","100%"),ci("aspect-ratio","4 / 3"),ci("object-fit","cover"),ci("background",HH(yt.surfaceSubtle)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",HH(xt.md))]),YH=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",HH(_t.sm))]),ZH=lo([ci("color",HH(yt.textPrimary)),ci("font-size",HH(bt.sizeSm)),ci("font-weight",HH(bt.weightMedium)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),eJ=lo([ci("color",HH(yt.textSecondary)),ci("font-size",HH(bt.sizeXs)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),tJ=lo([ci("background","rgba(255,255,255,0.12)"),ci("border","1px solid rgba(255,255,255,0.25)"),ci("border-radius",HH(xt.md)),ci("color","#f5f5f5"),ci("padding","4px var("+_t.sm+")"),ci("font-size",HH(bt.sizeSm)),hi("pointer"),Qi([ci("background","rgba(255,255,255,0.22)")])]),nJ=lo([ci("color",HH(yt.textDisabled)),ci("font-size",HH(bt.sizeSm))]);let rJ=function(e){let t,n=e.onOpen,a=e.items,l=s(()=>{}),c=l[1],u=l[0],d=function(e){return me(e,e=>z(e.src,t=>({key:e.key,src:t,title:e.title,caption:e.caption})))}(a);if(0===a.length)return i("span",{children:"(empty)",className:nJ});if(void 0!==u){let e=j(n,e=>z(d[u],t=>i("button",{children:"Open record →",className:tJ,type:"button",onClick:n=>{c(e=>{}),e(t.key)}})));t=i(Jl,{slides:d,index:u,onIndexChange:e=>c(t=>e),onClose:()=>c(e=>{}),action:e})}else t=null;return r(o,{children:[i("div",{children:a.map(e=>{let t=e.src,o=e.onUpload,s=e.caption;return r("button",{children:[void 0!==t?i("img",{className:QH,alt:e.title,src:t}):i(WH,void 0!==o?{size:"Tile",label:"Add image"}:{size:"Tile"}),r("div",{children:[i("span",{children:e.title,className:ZH}),U(e.badge,null)],className:YH}),void 0!==s?i("span",{children:s,className:eJ}):null],className:XH,title:q(e.src)&&$(e.onUpload)?"Add an image":e.title,type:"button",onClick:t=>{let r=e.src,i=e.onUpload;if(void 0===r)return void 0!==i?i():M(n,t=>t(e.key));let o=d.findIndex(t=>t.key===e.key);return-1!==o?c(e=>o):M(n,t=>t(e.key))}},e.key)}),className:JH}),t]})};const iJ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function oJ(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function sJ(e){return"nodeType"in e}function aJ(e){var t,n;return e?oJ(e)?e:sJ(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function lJ(e){const{Document:t}=aJ(e);return e instanceof t}function cJ(e){return!oJ(e)&&e instanceof aJ(e).HTMLElement}function uJ(e){return e instanceof aJ(e).SVGElement}function dJ(e){return e?oJ(e)?e.document:sJ(e)?lJ(e)?e:cJ(e)||uJ(e)?e.ownerDocument:document:document:document}const fJ=iJ?v:a;function hJ(e){const t=h(e);return fJ(()=>{t.current=e}),f(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function pJ(e,t){void 0===t&&(t=[e]);const n=h(e);return fJ(()=>{n.current!==e&&(n.current=e)},t),n}function gJ(e,t){const n=h();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function mJ(e){const t=hJ(e),n=h(null),r=f(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function vJ(e){const t=h();return a(()=>{t.current=e},[e]),t.current}let yJ={};function _J(e,t){return p(()=>{if(t)return t;const n=null==yJ[e]?0:yJ[e]+1;return yJ[e]=n,e+"-"+n},[e,t])}function bJ(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>{const r=Object.entries(n);for(const[i,o]of r){const n=t[i];null!=n&&(t[i]=n+e*o)}return t},{...t})}}const xJ=bJ(1),SJ=bJ(-1);function wJ(e){if(!e)return!1;const{KeyboardEvent:t}=aJ(e.target);return t&&e instanceof t}function EJ(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=aJ(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const kJ="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function CJ(e){return e.matches(kJ)?e:e.querySelector(kJ)}const AJ={display:"none"};function NJ(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:AJ},n)}function TJ(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return y.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const RJ=l(null);const DJ={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},IJ={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function FJ(e){let{announcements:t=IJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=DJ}=e;const{announce:o,announcement:l}=function(){const[e,t]=s(""),n=f(e=>{null!=e&&t(e)},[]);return{announce:n,announcement:e}}(),c=_J("DndLiveRegion"),[u,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=d(RJ);a(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(p(()=>({onDragStart(e){let{active:n}=e;o(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&o(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;o(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;o(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;o(t.onDragCancel({active:n,over:r}))}}),[o,t])),!u)return null;const g=y.createElement(y.Fragment,null,y.createElement(NJ,{id:r,value:i.draggable}),y.createElement(TJ,{id:c,announcement:l}));return n?w(g,n):g}var OJ;function PJ(){}function MJ(e,t){return p(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(OJ||(OJ={}));const LJ=Object.freeze({x:0,y:0});function zJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jJ(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const n=t.width*t.height,r=e.width*e.height,i=s*a;return Number((i/(n+r-i)).toFixed(4))}return 0}const UJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:e}=o,r=n.get(e);if(r){const n=jJ(r,t);n>0&&i.push({id:e,data:{droppableContainer:o,value:n}})}}return i.sort(zJ)};function BJ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:LJ}function $J(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const qJ=$J(1);const GJ={ignoreTransform:!1};function VJ(e,t){void 0===t&&(t=GJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=aJ(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}(n,t,r))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function KJ(e){return VJ(e,{ignoreTransform:!0})}function WJ(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(lJ(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!cJ(i)||uJ(i))return n;if(n.includes(i))return n;const o=aJ(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=aJ(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const r=t[e];return"string"==typeof r&&n.test(r)})}(i,o)&&n.push(i),function(e,t){return void 0===t&&(t=aJ(e).getComputedStyle(e)),"fixed"===t.position}(i,o)?n:r(i.parentNode)}(e):n}function HJ(e){const[t]=WJ(e,1);return null!=t?t:null}function JJ(e){return iJ&&e?oJ(e)?e:sJ(e)?lJ(e)||e===dJ(e).scrollingElement?window:cJ(e)?e:null:null:null}function XJ(e){return oJ(e)?e.scrollX:e.scrollLeft}function QJ(e){return oJ(e)?e.scrollY:e.scrollTop}function YJ(e){return{x:XJ(e),y:QJ(e)}}var ZJ;function eX(e){return!(!iJ||!e)&&e===document.scrollingElement}function tX(e){const t={x:0,y:0},n=eX(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ZJ||(ZJ={}));const nX={x:.2,y:.2};function rX(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=nX);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=tX(e),h={x:0,y:0},p={x:0,y:0},g=t.height*i.y,m=t.width*i.x;return!c&&o<=t.top+g?(h.y=ZJ.Backward,p.y=r*Math.abs((t.top+g-o)/g)):!u&&l>=t.bottom-g&&(h.y=ZJ.Forward,p.y=r*Math.abs((t.bottom-g-l)/g)),!f&&a>=t.right-m?(h.x=ZJ.Forward,p.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=ZJ.Backward,p.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:p}}function iX(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function oX(e){return e.reduce((e,t)=>xJ(e,YJ(t)),LJ)}const sX=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+XJ(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+QJ(t),0)}]];class aX{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=WJ(t),r=oX(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of sX)for(const e of o)Object.defineProperty(this,e,{get:()=>{const t=s(n),o=r[i]-t;return this.rect[e]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lX{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function cX(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var uX,dX;function fX(e){e.preventDefault()}function hX(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(uX||(uX={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(dX||(dX={}));const pX={start:[dX.Space,dX.Enter],cancel:[dX.Esc],end:[dX.Space,dX.Enter,dX.Tab]},gX=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case dX.Right:return{...n,x:n.x+25};case dX.Left:return{...n,x:n.x-25};case dX.Down:return{...n,y:n.y+25};case dX.Up:return{...n,y:n.y-25}}};class mX{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new lX(dJ(t)),this.windowListeners=new lX(aJ(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(uX.Resize,this.handleCancel),this.windowListeners.add(uX.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(uX.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=VJ),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);HJ(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(LJ)}handleKeyDown(e){if(wJ(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=pX,coordinateGetter:o=gX,scrollBehavior:s="smooth"}=r,{code:a}=e;if(i.end.includes(a))return void this.handleEnd(e);if(i.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:LJ;this.referenceCoordinates||(this.referenceCoordinates=c);const u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=SJ(u,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(const n of i){const i=e.code,{isTop:o,isRight:a,isLeft:l,isBottom:c,maxScroll:d,minScroll:f}=tX(n),h=iX(n),p={x:Math.min(i===dX.Right?h.right-h.width/2:h.right,Math.max(i===dX.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(i===dX.Down?h.bottom-h.height/2:h.bottom,Math.max(i===dX.Down?h.top:h.top+h.height/2,u.y))},g=i===dX.Right&&!a||i===dX.Left&&!l,m=i===dX.Down&&!c||i===dX.Up&&!o;if(g&&p.x!==u.x){const e=n.scrollLeft+t.x,o=i===dX.Right&&e<=d.x||i===dX.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=o?n.scrollLeft-e:i===dX.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&p.y!==u.y){const e=n.scrollTop+t.y,o=i===dX.Down&&e<=d.y||i===dX.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=o?n.scrollTop-e:i===dX.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,xJ(SJ(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function vX(e){return Boolean(e&&"distance"in e)}function yX(e){return Boolean(e&&"delay"in e)}mX.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pX,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class _X{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=aJ(e);return e instanceof t?e:dJ(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:o}=i;this.props=e,this.events=t,this.document=dJ(o),this.documentListeners=new lX(this.document),this.listeners=new lX(n),this.windowListeners=new lX(aJ(o)),this.initialCoordinates=null!=(r=EJ(i))?r:LJ,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(uX.Resize,this.handleCancel),this.windowListeners.add(uX.DragStart,fX),this.windowListeners.add(uX.VisibilityChange,this.handleCancel),this.windowListeners.add(uX.ContextMenu,fX),this.documentListeners.add(uX.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(yX(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(vX(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(uX.Click,hX,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(uX.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;const a=null!=(t=EJ(e))?t:LJ,l=SJ(r,a);if(!n&&s){if(vX(s)){if(null!=s.tolerance&&cX(l,s.tolerance))return this.handleCancel();if(cX(l,s.distance))return this.handleStart()}return yX(s)&&cX(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===dX.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const bX={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class xX extends _X{constructor(e){const{event:t}=e,n=dJ(t.target);super(e,bX,n)}}xX.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button)&&(null==r||r({event:n}),!0)}}];const SX={move:{name:"mousemove"},end:{name:"mouseup"}};var wX;!function(e){e[e.RightClick=2]="RightClick"}(wX||(wX={}));(class extends _X{constructor(e){super(e,SX,dJ(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==wX.RightClick&&(null==r||r({event:n}),!0)}}];const EX={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var kX,CX;function AX(e){let{acceleration:t,activator:n=kX.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:l=CX.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:g,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=vJ(t);return gJ(e=>{if(n||!r||!e)return NX;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ZJ.Backward]:e.x[ZJ.Backward]||-1===i.x,[ZJ.Forward]:e.x[ZJ.Forward]||1===i.x},y:{[ZJ.Backward]:e.y[ZJ.Backward]||-1===i.y,[ZJ.Forward]:e.y[ZJ.Forward]||1===i.y}}},[n,t,r])}({delta:g,disabled:!o}),[y,_]=function(){const e=h(null);return[f((t,n)=>{e.current=setInterval(t,n)},[]),f(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),b=h({x:0,y:0}),x=h({x:0,y:0}),S=p(()=>{switch(n){case kX.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case kX.DraggableRect:return i}},[n,i,c]),w=h(null),E=f(()=>{const e=w.current;if(!e)return;const t=b.current.x*x.current.x,n=b.current.y*x.current.y;e.scrollBy(t,n)},[]),k=p(()=>l===CX.TreeOrder?[...u].reverse():u,[l,u]);a(()=>{if(o&&u.length&&S){for(const e of k){if(!1===(null==r?void 0:r(e)))continue;const n=u.indexOf(e),i=d[n];if(!i)continue;const{direction:o,speed:a}=rX(e,i,S,t,m);for(const e of["x","y"])v[e][o[e]]||(a[e]=0,o[e]=0);if(a.x>0||a.y>0)return _(),w.current=e,y(E,s),b.current=a,void(x.current=o)}b.current={x:0,y:0},x.current={x:0,y:0},_()}else _()},[t,E,r,_,o,s,JSON.stringify(S),JSON.stringify(v),y,u,k,d,JSON.stringify(m)])}(class extends _X{constructor(e){super(e,EX)}static setup(){return window.addEventListener(EX.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(EX.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return!(i.length>1)&&(null==r||r({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(kX||(kX={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(CX||(CX={}));const NX={x:{[ZJ.Backward]:!1,[ZJ.Forward]:!1},y:{[ZJ.Backward]:!1,[ZJ.Forward]:!1}};var TX,RX;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(TX||(TX={})),function(e){e.Optimized="optimized"}(RX||(RX={}));const DX=new Map;function IX(e,t){return gJ(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function FX(e){let{callback:t,disabled:n}=e;const r=hJ(t),i=p(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function OX(e){return new aX(VJ(e),e)}function PX(e,t,n){void 0===t&&(t=OX);const[r,i]=s(null);function o(){i(r=>{if(!e)return null;var i;if(!1===e.isConnected)return null!=(i=null!=r?r:n)?i:null;const o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o})}const l=function(e){let{callback:t,disabled:n}=e;const r=hJ(t),i=p(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return a(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),c=FX({callback:o});return fJ(()=>{o(),e?(null==c||c.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==c||c.disconnect(),null==l||l.disconnect())},[e]),r}const MX=[];function LX(e,t){void 0===t&&(t=[]);const n=h(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==LJ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?SJ(e,n.current):LJ}function zX(e){return p(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const jX=[];function UX(e){let{measure:t}=e;const[n,r]=s(null),i=f(e=>{for(const{target:n}of e)if(cJ(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),o=FX({callback:i}),a=f(e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return cJ(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,c]=mJ(a);return p(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const BX=[{sensor:xX,options:{}},{sensor:mX,options:{}}],$X={current:{}},qX={draggable:{measure:KJ},droppable:{measure:KJ,strategy:TX.WhileDragging,frequency:RX.Optimized},dragOverlay:{measure:VJ}};class GX extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const VX={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new GX,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:PJ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:qX,measureDroppableContainers:PJ,windowRect:null,measuringScheduled:!1},KX=l({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:PJ,draggableNodes:new Map,over:null,measureDroppableContainers:PJ}),WX=l(VX);function HX(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new GX}}}function JX(e,t){switch(t.type){case OJ.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case OJ.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case OJ.DragEnd:case OJ.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case OJ.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new GX(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case OJ.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new GX(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case OJ.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new GX(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function XX(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=d(KX),o=vJ(r),s=vJ(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&o&&null!=s){if(!wJ(o))return;if(document.activeElement===o.target)return;const e=i.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=CJ(e);if(t){t.focus();break}}})}},[r,t,i,s,o]),null}const QX=l({...LJ,scaleX:1,scaleY:1});var YX;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(YX||(YX={}));const ZX=_(function(e){var t,n,r,i;let{id:o,accessibility:l,autoScroll:c=!0,children:u,sensors:d=BX,collisionDetection:g=UJ,measuring:m,modifiers:v,..._}=e;const x=b(JX,void 0,HX),[S,w]=x,[k,C]=function(){const[e]=s(()=>new Set),t=f(t=>(e.add(t),()=>e.delete(t)),[e]);return[f(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[A,N]=s(YX.Uninitialized),T=A===YX.Initialized,{draggable:{active:R,nodes:D,translate:I},droppable:{containers:F}}=S,O=null!=R?D.get(R):null,P=h({initial:null,translated:null}),M=p(()=>{var e;return null!=R?{id:R,data:null!=(e=null==O?void 0:O.data)?e:$X,rect:P}:null},[R,O]),L=h(null),[z,j]=s(null),[U,B]=s(null),$=pJ(_,Object.values(_)),q=_J("DndDescribedBy",o),G=p(()=>F.getEnabled(),[F]),V=function(e){return p(()=>({draggable:{...qX.draggable,...null==e?void 0:e.draggable},droppable:{...qX.droppable,...null==e?void 0:e.droppable},dragOverlay:{...qX.dragOverlay,...null==e?void 0:e.dragOverlay}}),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(m),{droppableRects:K,measureDroppableContainers:W,measuringScheduled:H}=function(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,l]=s(null),{frequency:c,measure:u,strategy:d}=i,p=h(e),g=function(){switch(d){case TX.Always:return!1;case TX.BeforeDragging:return n;default:return!n}}(),m=pJ(g),v=f(function(e){void 0===e&&(e=[]),m.current||l(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[m]),y=h(null),_=gJ(t=>{if(g&&!n)return DX;if(!t||t===DX||p.current!==e||null!=o){const t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new aX(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,n,g,u]);return a(()=>{p.current=e},[e]),a(()=>{g||v()},[n,g]),a(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),a(()=>{g||"number"!=typeof c||null!==y.current||(y.current=setTimeout(()=>{v(),y.current=null},c))},[c,g,v,...r]),{droppableRects:_,measureDroppableContainers:v,measuringScheduled:null!=o}}(G,{dragging:T,dependencies:[I.x,I.y],config:V.droppable}),J=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return gJ(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(D,R),X=p(()=>U?EJ(U):null,[U]),Q=function(){const e=!1===(null==z?void 0:z.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=T&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),Y=function(e,t){return IX(e,t)}(J,V.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=h(!1),{x:s,y:a}="boolean"==typeof i?{x:i,y:i}:i;fJ(()=>{if(!s&&!a||!t)return void(o.current=!1);if(o.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const i=BJ(n(e),r);if(s||(i.x=0),a||(i.y=0),o.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const t=HJ(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,s,a,r,n])}({activeNode:null!=R?D.get(R):null,config:Q.layoutShiftCompensation,initialRect:Y,measure:V.draggable.measure});const Z=PX(J,V.draggable.measure,Y),ee=PX(J?J.parentElement:null),te=h({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=F.getNodeFor(null==(t=te.current.over)?void 0:t.id),re=UX({measure:V.dragOverlay.measure}),ie=null!=(n=re.nodeRef.current)?n:J,oe=T?null!=(r=re.rect)?r:Z:null,se=Boolean(re.nodeRef.current&&re.rect),ae=BJ(le=se?null:Z,IX(le));var le;const ce=zX(ie?aJ(ie):null),ue=function(e){const t=h(e),n=gJ(n=>e?n&&n!==MX&&e&&t.current&&e.parentNode===t.current.parentNode?n:WJ(e):MX,[e]);return a(()=>{t.current=e},[e]),n}(T?null!=ne?ne:J:null),de=function(e,t){void 0===t&&(t=VJ);const[n]=e,r=zX(n?aJ(n):null),[i,o]=s(jX);function a(){o(()=>e.length?e.map(e=>eX(e)?r:new aX(t(e),e)):jX)}const l=FX({callback:a});return fJ(()=>{null==l||l.disconnect(),a(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),i}(ue),fe=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(v,{transform:{x:I.x-ae.x,y:I.y-ae.y,scaleX:1,scaleY:1},activatorEvent:U,active:M,activeNodeRect:Z,containerNodeRect:ee,draggingNodeRect:oe,over:te.current.over,overlayNodeRect:re.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:ce}),he=X?xJ(X,I):null,pe=function(e){const[t,n]=s(null),r=h(e),i=f(e=>{const t=JJ(e.target);t&&n(e=>e?(e.set(t,YJ(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const s=e.map(e=>{const t=JJ(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,YJ(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{const t=JJ(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>xJ(e,t),LJ):oX(e):LJ,[e,t])}(ue),ge=LX(pe),me=LX(pe,[Z]),ve=xJ(fe,ge),ye=oe?qJ(oe,fe):null,_e=M&&ye?g({active:M,collisionRect:ye,droppableRects:K,droppableContainers:G,pointerCoordinates:he}):null,be=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(_e,"id"),[xe,Se]=s(null),we=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(se?fe:xJ(fe,me),null!=(i=null==xe?void 0:xe.rect)?i:null,Z),Ee=h(null),ke=f((e,t)=>{let{sensor:n,options:r}=t;if(null==L.current)return;const i=D.get(L.current);if(!i)return;const o=e.nativeEvent,s=new n({active:L.current,activeNode:i,event:o,options:r,context:te,onAbort(e){if(!D.get(e))return;const{onDragAbort:t}=$.current,n={id:e};null==t||t(n),k({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!D.get(e))return;const{onDragPending:i}=$.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==i||i(o),k({type:"onDragPending",event:o})},onStart(e){const t=L.current;if(null==t)return;const n=D.get(t);if(!n)return;const{onDragStart:r}=$.current,i={activatorEvent:o,active:{id:t,data:n.data,rect:P}};E(()=>{null==r||r(i),N(YX.Initializing),w({type:OJ.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:i}),j(Ee.current),B(o)})},onMove(e){w({type:OJ.DragMove,coordinates:e})},onEnd:a(OJ.DragEnd),onCancel:a(OJ.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=te.current;let s=null;if(t&&i){const{cancelDrop:a}=$.current;if(s={activatorEvent:o,active:t,collisions:n,delta:i,over:r},e===OJ.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=OJ.DragCancel)}}L.current=null,E(()=>{w({type:e}),N(YX.Uninitialized),Se(null),j(null),B(null),Ee.current=null;const t=e===OJ.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=$.current[t];null==e||e(s),k({type:t,event:s})}})}}Ee.current=s},[D]),Ce=f((e,t)=>(n,r)=>{const i=n.nativeEvent,o=D.get(r);if(null!==L.current||!o||i.dndKit||i.defaultPrevented)return;const s={active:o};!0===e(n,t.options,s)&&(i.dndKit={capturedBy:t.sensor},L.current=r,ke(n,t))},[D,ke]),Ae=function(e,t){return p(()=>e.reduce((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(d,Ce);!function(e){a(()=>{if(!iJ)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(d),fJ(()=>{Z&&A===YX.Initializing&&N(YX.Initialized)},[Z,A]),a(()=>{const{onDragMove:e}=$.current,{active:t,activatorEvent:n,collisions:r,over:i}=te.current;if(!t||!n)return;const o={active:t,activatorEvent:n,collisions:r,delta:{x:ve.x,y:ve.y},over:i};E(()=>{null==e||e(o),k({type:"onDragMove",event:o})})},[ve.x,ve.y]),a(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=te.current;if(!e||null==L.current||!t||!i)return;const{onDragOver:o}=$.current,s=r.get(be),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:a};E(()=>{Se(a),null==o||o(l),k({type:"onDragOver",event:l})})},[be]),fJ(()=>{te.current={activatorEvent:U,active:M,activeNode:J,collisionRect:ye,collisions:_e,droppableRects:K,draggableNodes:D,draggingNode:ie,draggingNodeRect:oe,droppableContainers:F,over:xe,scrollableAncestors:ue,scrollAdjustedTranslate:ve},P.current={initial:oe,translated:ye}},[M,J,_e,ye,D,ie,oe,K,F,xe,ue,ve]),AX({...Q,delta:I,draggingRect:ye,pointerCoordinates:he,scrollableAncestors:ue,scrollableAncestorRects:de});const Ne=p(()=>({active:M,activeNode:J,activeNodeRect:Z,activatorEvent:U,collisions:_e,containerNodeRect:ee,dragOverlay:re,draggableNodes:D,droppableContainers:F,droppableRects:K,over:xe,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:V,measuringScheduled:H,windowRect:ce}),[M,J,Z,U,_e,ee,re,D,F,K,xe,W,ue,de,V,H,ce]),Te=p(()=>({activatorEvent:U,activators:Ae,active:M,activeNodeRect:Z,ariaDescribedById:{draggable:q},dispatch:w,draggableNodes:D,over:xe,measureDroppableContainers:W}),[U,Ae,M,Z,w,q,D,xe,W]);return y.createElement(RJ.Provider,{value:C},y.createElement(KX.Provider,{value:Te},y.createElement(WX.Provider,{value:Ne},y.createElement(QX.Provider,{value:we},u)),y.createElement(XX,{disabled:!1===(null==l?void 0:l.restoreFocus)})),y.createElement(FJ,{...l,hiddenTextDescribedById:q}))}),eQ=l(null),tQ="button";function nQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=_J("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=d(KX),{role:g=tQ,roleDescription:m="draggable",tabIndex:v=0}=null!=i?i:{},y=(null==l?void 0:l.id)===t,_=d(y?QX:eQ),[b,x]=mJ(),[S,w]=mJ(),E=function(e,t){return p(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(s,t),k=pJ(n);fJ(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:S,data:k}),()=>{const e=f.get(t);e&&e.key===o&&f.delete(t)}),[f,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:p(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!y||g!==tQ)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,g,v,y,m,u.draggable]),isDragging:y,listeners:r?void 0:E,node:b,over:h,setNodeRef:x,setActivatorNodeRef:w,transform:_}}const rQ={timeout:25};function iQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=_J("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=d(KX),p=h({disabled:n}),g=h(!1),m=h(null),v=h(null),{disabled:y,updateMeasurementsFor:_,timeout:b}={...rQ,...i},x=pJ(null!=_?_:r),S=FX({callback:f(()=>{g.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{u(Array.isArray(x.current)?x.current:[x.current]),v.current=null},b)):g.current=!0},[b]),disabled:y||!s}),w=f((e,t)=>{S&&(t&&(S.unobserve(t),g.current=!1),e&&S.observe(e))},[S]),[E,k]=mJ(w),C=pJ(t);return a(()=>{S&&E.current&&(S.disconnect(),g.current=!1,S.observe(E.current))},[E,S]),a(()=>(l({type:OJ.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:m,data:C}}),()=>l({type:OJ.UnregisterDroppable,key:o,id:r})),[r]),a(()=>{n!==p.current.disabled&&(l({type:OJ.SetDroppableDisabled,id:r,key:o,disabled:n}),p.current.disabled=n)},[r,o,n,l]),{active:s,rect:m,isOver:(null==c?void 0:c.id)===r,node:E,over:c,setNodeRef:k}}function oQ(e,t){M(R(e.onPointerDown),e=>e(t))}function sQ(e,t){M(R(e.onKeyDown),e=>e(t))}function aQ(e){return z(null==e?void 0:T(e),e=>"translate3d("+e.x.toString()+"px, "+e.y.toString()+"px, 0)")}let lQ=[{bg:"#d1fae5",border:"#059669",fg:"#065f46"},{bg:"#fef3c7",border:"#d97706",fg:"#78350f"},{bg:"#ede9fe",border:"#7c3aed",fg:"#4c1d95"},{bg:"#ccfbf1",border:"#0d9488",fg:"#134e4a"},{bg:"#fce7f3",border:"#db2777",fg:"#831843"},{bg:"#ffedd5",border:"#ea580c",fg:"#7c2d12"},{bg:"#ecfccb",border:"#65a30d",fg:"#365314"}],cQ={bg:"#e2e8f0",border:"#64748b",fg:"#1e293b"};function uQ(e,t){let n=e.indexOf(t);return-1!==n?function(e){return e<0?cQ:lQ[fe(e,lQ.length)]}(n):cQ}let dQ={bg:"#dbeafe",border:"#2563eb",fg:"#1e3a8a"};function fQ(e){return"var("+e+")"}let hQ=[pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("font-size",fQ(bt.sizeXs)),ci("font-weight",fQ(bt.weightMedium)),ci("line-height","1.5"),ci("white-space","nowrap")];function pQ(e,t){return lo(hQ.concat([ci("background",e.bg),ci("border","1px solid "+e.border),ci("color",e.fg)]).concat(t))}function gQ(e){return pQ(e,[ci("padding","2px 8px"),ci("border-radius",fQ(xt.full))])}let mQ=pQ(dQ,[ci("padding","2px 8px"),ci("border-radius",fQ(xt.sm))]),vQ=lo(hQ.concat([ci("padding","2px 0"),ci("color",fQ(yt.textSecondary)),ci("font-weight",fQ(bt.weightNormal)),ci("font-style","italic"),ci("border-bottom","1px dashed var("+yt.border+")")]));let yQ={make:function(e){let t=e.dot,n=e.swatch;return r("span",{children:[void 0===t||t?i("span",{style:(o=n,{background:o.border,display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",flexShrink:"0"})}):null,e.label],className:gQ(n)});var o}};let _Q={make:function(e){return i("span",{children:e.label,className:mQ})}};let bQ={make:function(e){let t=e.label;return i("span",{children:t,className:vQ,title:t+" — run by the platform, not callable"})}};function xQ(e){return"var("+e+")"}let SQ=lo([pi("flex"),ui("stretch"),ci("gap",xQ(_t.md)),ci("overflow-x","auto"),ci("padding-bottom",xQ(_t.sm))]),wQ=[pi("flex"),gi("column"),ci("gap",xQ(_t.sm)),ci("flex","0 0 240px"),ci("padding",xQ(_t.sm)),ci("background",xQ(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",xQ(xt.md)),ci("min-height","120px")],EQ=lo(wQ);let kQ=lo([ci("border-color",xQ(yt.brand))]),CQ=lo([Oi(.45)]),AQ=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",xQ(_t.sm)),ci("font-size",xQ(bt.sizeSm)),ci("font-weight",xQ(bt.weightMedium)),ci("color",xQ(yt.textSecondary))]),NQ=lo([ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),TQ=lo([pi("flex"),gi("column"),ui("stretch"),ci("gap","4px"),ci("padding",xQ(_t.sm)),ci("background",xQ(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",xQ(xt.sm)),ci("text-align","left"),hi("pointer"),Qi([ci("border-color",xQ(yt.brand))])]),RQ=lo([hi("grab")]),DQ=lo([Oi(.85),ci("z-index","10"),hi("grabbing")]),IQ=lo([ci("font-size",xQ(bt.sizeSm)),ci("font-weight",xQ(bt.weightMedium)),ci("color",xQ(yt.textPrimary))]),FQ=lo([ci("font-size",xQ(bt.sizeXs)),ci("color",xQ(yt.textSecondary)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),OQ=lo([ci("color",xQ(yt.textDisabled)),ci("font-size",xQ(bt.sizeSm))]);function PQ(e){let t=e.onClick,n=e.draggable,o=e.card,s=nQ({id:o.key,disabled:!n}),a=n?TQ+" "+RQ:TQ,l=s.isDragging?a+" "+DQ:a,c=aQ(s.transform),u=void 0!==c?{transform:c}:void 0,d=s.listeners,f=null==d?void 0:T(d),h=o.meta;return r("div",{children:[i("span",{children:o.title,className:IQ}),void 0!==h?i("span",{children:h,className:FQ,title:h}):null],ref:T(s.setNodeRef),className:l,role:"button",style:u,tabIndex:0,onKeyDown:e=>M(f,t=>sQ(t,e)),onClick:e=>M(t,e=>e(o.key)),onPointerDown:e=>M(f,t=>oQ(t,e))})}function MQ(e){let t=e.accepts,n=e.onCardClick,o=e.draggable,s=e.column,a=void 0===t||t,l=iQ({id:s.value,disabled:!a}),c=s.swatch,u=void 0!==c?function(e){return lo(wQ.concat([ci("border-top","3px solid "+e.border)]))}(c):EQ,d=l.isOver,f=a?d?u+" "+kQ:u:u+" "+CQ,h=s.swatch;return r("div",{children:[r("div",{children:[void 0!==h?i(yQ.make,{swatch:h,label:s.label}):i("span",{children:s.label,className:NQ}),i(hs,{count:s.cards.length,label:""})],className:AQ}),0===s.cards.length?i("span",{children:"—",className:OQ}):s.cards.map(e=>i(PQ,{card:e,draggable:o,onClick:n},e.key))],ref:T(l.setNodeRef),className:f})}let LQ=function(e){let t=e.canDrop,n=e.onMove,r=e.onCardClick,o=e.columns,a=$(n),l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(()=>[...t].filter(e=>null!=e),[...t])}(MJ(xX,{activationConstraint:{distance:5}}),MJ(mX,{})),c=s(()=>{}),u=c[1],d=c[0],f=e=>void 0===t||void 0===d||t(d,e.value);return i(ZX,{sensors:T(l),onDragStart:e=>u(t=>e.active.id),onDragEnd:e=>{u(e=>{});let r=e.over;if(void 0===n)return;if(null==r)return;let i=o.find(t=>t.cards.some(t=>t.key===e.active.id));return L(t,!0,t=>t(e.active.id,r.id))&&L(i,!0,e=>e.value!==r.id)?n(e.active.id,r.id):void 0},onDragCancel:()=>u(e=>{}),children:i("div",{children:o.map(e=>i(MQ,{column:e,draggable:a,onCardClick:r,accepts:f(e)},e.value)),className:SQ})})};function zQ(e){return"var("+e+")"}let jQ=lo([pi("flex"),gi("column"),ci("gap",zQ(_t.sm))]),UQ=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",zQ(_t.sm))]),BQ=lo([pi("inlineFlex"),ui("center"),ci("gap",zQ(_t.xs))]),$Q=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",zQ(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",zQ(yt.textSecondary)),ci("font-size",zQ(bt.sizeSm)),hi("pointer"),Qi([ci("background",zQ(yt.surfaceSubtle)),ci("color",zQ(yt.textPrimary))])]),qQ=co([$Q,lo([ci("background",zQ(yt.surfaceSubtle)),ci("color",zQ(yt.textPrimary)),ci("font-weight",zQ(bt.weightMedium))])]),GQ=lo([ci("font-size",zQ(bt.sizeMd)),ci("font-weight",zQ(bt.weightMedium)),ci("color",zQ(yt.textPrimary))]),VQ=lo([pi("grid"),ci("grid-template-columns","repeat(7, 1fr)"),ci("gap","1px")]),KQ=lo([ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em"),ci("padding","2px var("+_t.xs+")")]),WQ=lo([pi("grid"),ci("grid-template-columns","repeat(7, 1fr)"),ci("gap","1px"),ci("background",zQ(yt.borderSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",zQ(xt.md)),ci("overflow","hidden")]),HQ=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-height","96px"),ci("padding","4px"),ci("background",zQ(yt.surface))]),JQ=co([HQ,lo([ci("opacity","0.55")])]),XQ=lo([ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.textSecondary))]),QQ=co([XQ,lo([ci("color",zQ(yt.brand)),ci("font-weight",zQ(bt.weightMedium))])]);let YQ=lo([ci("background","none"),ci("border","none"),ci("padding","0"),ci("text-align","left"),ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.brand)),hi("pointer"),Qi([ci("text-decoration","underline")])]);let ZQ=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-height","200px"),ci("padding","4px"),ci("background",zQ(yt.surface))]),eY=lo([ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.textSecondary)),ci("padding-bottom","2px"),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]),tY=lo([pi("flex"),yi("wrap"),ui("center"),ci("gap",zQ(_t.md)),ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.textSecondary))]);let nY=lo([ci("font-size",zQ(bt.sizeXs)),ci("color",zQ(yt.textDisabled))]),rY="var("+yt.brand+")";function iY(e,t){return e.filter(e=>rc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function oY(e,t){return sc(e.start)||!tc(e.start,t)?e.title:oc(e.start)+" "+e.title}let sY=function(e){let t,n,a=e.initialDate,l=e.windowNote,c=e.legend,u=e.events,d=void 0!==c?c:[],f=s(()=>"Month"),h=f[1],p=f[0],g=s(()=>Xl(U(a,Date.now()))),m=g[1],v=g[0],y=Xl(Date.now()),_=e=>m(t=>{switch(p){case"Month":return Yl(t,e);case"Week":return Ql(t,7*e|0);case"Day":return Ql(t,e)}}),b=(e,t)=>{return i("button",{children:oY(e,t),className:(n=U(e.accent,rY),lo([pi("block"),ci("width","100%"),ci("text-align","left"),ci("border","none"),ci("border-left","3px solid "+n),ci("border-radius",zQ(xt.sm)),ci("background",zQ(yt.surfaceSubtle)),ci("color",zQ(yt.textPrimary)),ci("font-size",zQ(bt.sizeXs)),ci("padding","1px var("+_t.xs+")"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap"),hi("pointer"),Qi([ci("background",zQ(yt.surfaceElevated))])])),title:e.title,onClick:t=>e.onOpen()},e.key);var n},x=()=>{let e=function(e){let t=Zl(ec(e));return pe(42,e=>Ql(t,e))}(v);return r(o,{children:[i("div",{children:cc.map(e=>i("div",{children:e,className:KQ},e)),className:VQ}),i("div",{children:e.map(e=>{let t=iY(u,e),n=t.slice(0,3),o=t.length-n.length|0;return r("div",{children:[i("span",{children:uc(e).toString(),className:e===y?QQ:XQ}),n.map(t=>b(t,e)),o>0?i("button",{children:"+"+o.toString()+" more",className:YQ,onClick:t=>{m(t=>e),h(e=>"Day")}}):null],className:nc(e,v)?HQ:JQ},e.toString())}),className:WQ})]})},S=e=>{return i("div",{children:e.map(e=>r("div",{children:[i("div",{children:dc(e),className:eY}),iY(u,e).map(t=>b(t,e))],className:ZQ},e.toString())),className:(t=e.length,lo([pi("grid"),ci("grid-template-columns","repeat("+t.toString()+", 1fr)"),ci("gap","1px"),ci("background",zQ(yt.borderSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",zQ(xt.md)),ci("overflow","hidden")]))});var t};switch(p){case"Month":t=x();break;case"Week":t=S(pe(7,e=>Ql(Zl(v),e)));break;case"Day":t=S([Xl(v)])}switch(p){case"Month":case"Week":n=lc(v);break;case"Day":n=dc(v)+" — "+lc(v)}let w=(e,t)=>i("button",{children:t,className:p===e?qQ:$Q,onClick:t=>h(t=>e)});return r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:$Q,onClick:e=>_(-1)}),i("button",{children:"Today",className:$Q,onClick:e=>m(e=>y)}),i("button",{children:"›",className:$Q,onClick:e=>_(1)}),i("span",{children:n,className:GQ})],className:BQ}),r("div",{children:[w("Month","Month"),w("Week","Week"),w("Day","Day")],className:BQ})],className:UQ}),0!==d.length?i("div",{children:d.map(e=>{return r("span",{children:[i("span",{className:(t=e.accent,lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",t),ci("margin-right","4px")]))}),e.label]},e.label);var t}),className:tY}):null,t,void 0!==l?i("span",{children:l,className:nY}):null],className:jQ})};function aY(e){return"var("+e+")"}let lY=lo([pi("grid"),ci("grid-template-columns","repeat(auto-fill, minmax(220px, 1fr))"),ci("gap",aY(_t.md))]),cY=lo([pi("flex"),gi("column"),ui("stretch"),ci("gap",aY(_t.sm)),ci("padding",aY(_t.md)),ci("background",aY(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",aY(xt.md)),ci("text-align","left"),Qi([ci("border-color",aY(yt.brand)),ci("background",aY(yt.surfaceSubtle))])]),uY=lo([pi("flex"),gi("column"),ui("stretch"),ci("gap",aY(_t.sm)),ci("background","none"),ci("border","none"),ci("padding","0"),ci("font","inherit"),ci("color","inherit"),ci("text-align","left"),hi("pointer")]),dY=lo([pi("flex"),yi("wrap"),ci("gap","4px")]),fY=lo([ci("background",aY(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",aY(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",aY(yt.textPrimary)),ci("font-size",aY(bt.sizeSm)),hi("pointer"),Qi([ci("border-color",aY(yt.brand)),ci("color",aY(yt.brand))])]),hY=lo([ci("width","100%"),ci("height","96px"),ci("object-fit","cover"),ci("border-radius",aY(xt.sm))]),pY=lo([ci("width","100%"),ci("height","96px")]),gY=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",aY(_t.sm))]),mY=lo([ci("font-size",aY(bt.sizeMd)),ci("font-weight",aY(bt.weightMedium)),ci("color",aY(yt.textPrimary)),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),vY=lo([pi("flex"),ui("baseline"),ci("gap",aY(_t.sm)),ci("font-size",aY(bt.sizeSm))]),yY=lo([ci("color",aY(yt.textSecondary)),ci("white-space","nowrap"),vi(0)]),_Y=lo([ci("color",aY(yt.textPrimary)),ci("min-width","0"),ci("overflow","hidden"),ci("text-overflow","ellipsis")]),bY=lo([ci("color",aY(yt.textDisabled)),ci("font-size",aY(bt.sizeSm))]);let xY=function(e){let t=e.cards;if(0===t.length)return i("span",{children:"(empty)",className:bY});let n=e.onCardClick;return i("div",{children:t.map(e=>{let t,o=e.media;t=void 0!==o?"object"!=typeof o?i("span",{children:i(WH,{size:"Fill"}),className:pY}):i("img",{className:hY,alt:e.title,src:o._0}):null;let s=e.actions;return r("div",{children:[r("button",{children:[t,r("div",{children:[i("span",{children:e.title,className:mY,title:e.title}),U(e.badge,null)],className:gY}),e.fields.map(e=>r("div",{children:[i("span",{children:e.label,className:yY}),i("span",{children:e.value,className:_Y})],className:vY},e.label))],className:uY,onClick:t=>M(n,t=>t(e.key))}),void 0!==s&&0!==s.length?i("div",{children:s.map(e=>i("button",{children:e.label,className:fY,onClick:t=>e.onClick()},e.label)),className:dY}):null],className:cY},e.key)}),className:lY})};function SY(e){return"var("+e+")"}let wY=lo([ci("font-family",SY(bt.fontFamilyMono)),ci("font-size",SY(bt.sizeSm)),ci("line-height",SY(bt.lineHeightNormal)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",SY(xt.md)),Pi("auto")]),EY=lo([pi("flex"),ci("padding","1px var("+_t.md+")")]),kY=lo([ci("background","rgba(248,81,73,0.12)"),ci("color",SY(yt.error))]),CY=lo([ci("background","rgba(63,185,80,0.12)"),ci("color",SY(yt.success))]),AY=lo([ci("color",SY(yt.textSecondary))]),NY=lo([ci("width","16px"),vi(0),ci("user-select","none"),Ai(eo(8))]);let TY=function(e){let t=function(e,t){let n=e.length,r=t.length,i=he((n+1|0)*(r+1|0)|0,0),o=(e,t)=>i[(e*(r+1|0)|0)+t|0];for(let c=0;c<n;++c)for(let n=0;n<r;++n)i[((c+1|0)*(r+1|0)|0)+(n+1|0)|0]=e[c]===t[n]?o(c,n)+1|0:o(c,n+1|0)>o(c+1|0,n)?o(c,n+1|0):o(c+1|0,n);let s=[],a=n,l=r;for(;a>0||l>0;){let n=e[a-1|0],r=t[l-1|0];a>0&&l>0&&n===r?(s=[{kind:"Unchanged",text:n}].concat(s),a=a-1|0,l=l-1|0):l>0&&(0===a||o(a,l-1|0)>=o(a-1|0,l))?(s=[{kind:"Added",text:r}].concat(s),l=l-1|0):(s=[{kind:"Removed",text:n}].concat(s),a=a-1|0)}return s}(e.before.split("\n"),e.after.split("\n"));return i("div",{children:t.map((e,t)=>{let n;switch(e.kind){case"Removed":n=[EY+" "+kY,"-"];break;case"Added":n=[EY+" "+CY,"+"];break;case"Unchanged":n=[EY+" "+AY," "]}return r("div",{children:[i("span",{children:n[1],className:NY}),i("span",{children:e.text})],className:n[0]},t.toString())}),className:wY})};function RY(e,t){let n=new Date(t).getTime();if(Number.isNaN(n))return t;let r=(e-n)/1e3;return r<45?"just now":r<3600?Math.floor(r/60).toString()+"m ago":r<86400?Math.floor(r/3600).toString()+"h ago":r<1209600?Math.floor(r/86400).toString()+"d ago":t.slice(0,10)}function DY(e){return"var("+e+")"}let IY=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("font-family",DY(bt.fontFamily)),ci("font-size",DY(bt.sizeSm))]),FY=lo([pi("flex"),ui("flexStart"),ci("gap","10px"),ci("padding",DY(_t.xs)+" "+DY(_t.sm)),ci("border-radius",DY(xt.sm))]),OY=lo([hi("pointer"),Qi([ci("background",DY(yt.surfaceSubtle))])]),PY=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-width","0"),ci("flex","1")]),MY=lo([ci("color",DY(yt.textPrimary))]),LY=lo([ci("font-weight",DY(bt.weightMedium))]),zY=lo([ci("color",DY(yt.textSecondary))]),jY=lo([pi("inlineFlex"),ui("center"),ci("gap","6px"),ci("color",DY(yt.textSecondary)),ci("font-size",DY(bt.sizeXs)),ci("white-space","nowrap")]),UY=lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("flex-shrink","0")]),BY=lo([ci("background","none"),ci("border","none"),ci("padding","0"),ci("color",DY(yt.brand)),ci("font-size",DY(bt.sizeXs)),hi("pointer"),ci("text-align","left"),Qi([ci("text-decoration","underline")])]),$Y=lo([ci("margin-top","4px"),ci("max-width","560px")]),qY=lo([ci("color",DY(yt.textSecondary)),ci("padding",DY(_t.md)),Bi("center")]);function GY(e){let t=e.onClick,n=e.entry,o=s(()=>!1),a=o[1],l=o[0],c=$(n.before)&&$(n.after),u=U(n.actor,n.subject),d=void 0!==t?FY+" "+OY:FY,f=n.actor,h=n.accent,p=n.timestamp;return r("div",{children:[i(Wo,{name:u,src:n.actorImageUrl,size:"Medium"}),r("div",{children:[r("span",{children:[void 0!==f?i("span",{children:f+" ",className:LY}):null,i("span",{children:n.verb+" ",className:zY}),n.subject],className:MY}),r("span",{children:[void 0!==h?i("span",{className:UY,style:{background:h}}):null,void 0!==p?RY(e.nowMs,p):null],className:jY}),c?i("button",{children:l?"Hide changes":"Show changes",className:BY,onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null,l&&c?i("div",{children:i(TY,{before:U(n.before,""),after:U(n.after,"")}),className:$Y}):null],className:PY})],className:d,onClick:e=>M(t,e=>e(n))})}let VY=function(e){let t=e.nowMs,n=e.onEntryClick,r=e.emptyLabel,o=e.entries,s=void 0!==r?r:"No activity yet",a=void 0!==t?t:Date.now();return 0===o.length?i("div",{children:s,className:qY}):i("div",{children:o.map(e=>i(GY,{entry:e,nowMs:a,onClick:n},e.id)),className:IY})};function KY(e){return"var("+e+")"}let WY=lo([pi("flex"),ui("flexStart"),ci("gap","0"),ci("width","100%")]),HY=lo([pi("flex"),gi("column"),ui("center"),ci("gap","4px"),ci("flex","0 0 auto")]);let JY=[pi("inlineFlex"),ui("center"),bi("center"),ci("width","24px"),ci("height","24px"),ci("border-radius","50%"),ci("font-size",KY(bt.sizeXs)),ci("font-weight",KY(bt.weightMedium)),ci("box-sizing","border-box")],XY=lo(JY.concat([ci("background",KY(yt.brand)),ci("color","#fff")])),QY=lo(JY.concat([ci("background",KY(yt.surface)),ci("color",KY(yt.brand)),ci("border","2px solid var("+yt.brand+")")])),YY=lo(JY.concat([ci("background",KY(yt.surface)),ci("color",KY(yt.textDisabled)),ci("border","1px solid var("+yt.border+")")])),ZY=[ci("font-size",KY(bt.sizeXs)),ci("text-align","center"),ci("max-width","96px")],eZ=lo(ZY.concat([ci("color",KY(yt.textPrimary))])),tZ=lo(ZY.concat([ci("color",KY(yt.textDisabled))])),nZ=lo([ci("display","none")]);function rZ(e){switch(e){case"Done":return XY;case"Current":return QY;case"Upcoming":return YY}}function iZ(e,t){switch(e){case"Done":return"✓";case"Current":case"Upcoming":return(t+1|0).toString()}}let oZ=function(e){let t=e.compact,n=void 0!==t&&t;return i("div",{children:e.steps.map((e,t)=>{let o=0===t?null:i("div",{className:(s="Done"===e.state||"Current"===e.state,lo([ci("flex","1 1 auto"),ci("height","2px"),ci("margin","0 6px"),ci("margin-top","11px"),ci("min-width","16px"),ci("background",KY(s?yt.brand:yt.borderSubtle))]))},e.key+":c");var s;let a=n?nZ:function(e){switch(e){case"Done":case"Current":return eZ;case"Upcoming":return tZ}}(e.state);return r(g,{children:[o,r("div",{children:[i("span",{children:iZ(e.state,t),className:rZ(e.state)}),i("span",{children:e.label,className:a})],className:HY,role:"listitem"})]},e.key)}),"aria-label":"Progress",className:WY,role:"list"})};function sZ(e){switch(e.toLowerCase().replaceAll("_","").replaceAll("-","")){case"accepted":case"approve":case"approved":case"confirmed":case"granted":case"signed":return"Approved";case"awaiting":case"escalated":case"inreview":case"pending":case"submitted":case"underreview":return"Pending";case"na":case"notrequired":case"skipped":case"waived":return"Skipped";case"declined":case"denied":case"refused":case"reject":case"rejected":case"withdrawn":return"Rejected";default:return{TAG:"Other",_0:e}}}function aZ(e){if("object"==typeof e)return at(e._0);switch(e){case"Approved":return"Approved";case"Rejected":return"Rejected";case"Pending":return"Pending";case"Skipped":return"Skipped"}}function lZ(e){if("object"==typeof e)return"Neutral";switch(e){case"Approved":return"Success";case"Rejected":return"Error";case"Pending":return"Info";case"Skipped":return"Neutral"}}function cZ(e){if("object"==typeof e)return"•";switch(e){case"Approved":return"✓";case"Rejected":return"✕";case"Pending":return"•";case"Skipped":return"–"}}function uZ(e){if("object"==typeof e)return"var("+yt.border+")";switch(e){case"Approved":return"var("+yt.success+")";case"Rejected":return"var("+yt.error+")";case"Pending":return"var("+yt.info+")";case"Skipped":return"var("+yt.border+")"}}function dZ(e){return"var("+e+")"}let fZ=lo([pi("flex"),gi("column"),ci("gap",dZ(_t.md)),ci("font-family",dZ(bt.fontFamily))]),hZ=lo([pi("flex"),gi("column")]),pZ=lo([pi("flex"),ui("stretch"),ci("gap",dZ(_t.sm))]),gZ=lo([pi("flex"),gi("column"),ui("center"),ci("flex","0 0 22px")]);let mZ=lo([ci("flex","1 1 auto"),ci("width","1px"),ci("min-height","12px"),ci("background",dZ(yt.borderSubtle))]),vZ=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("flex","1 1 auto"),ci("min-width","0"),ci("padding-bottom",dZ(_t.sm))]),yZ=lo([hi("pointer"),Qi([ci("background",dZ(yt.surfaceSubtle))]),ci("border-radius",dZ(xt.sm)),ci("padding-left","4px"),ci("margin-left","-4px")]),_Z=lo([pi("flex"),ui("center"),yi("wrap"),ci("gap",dZ(_t.xs))]),bZ=lo([ci("font-size",dZ(bt.sizeSm)),ci("font-weight",dZ(bt.weightMedium)),ci("color",dZ(yt.textPrimary))]),xZ=lo([pi("flex"),ui("center"),ci("gap","6px"),ci("font-size",dZ(bt.sizeXs)),ci("color",dZ(yt.textSecondary))]),SZ=lo([ci("font-size",dZ(bt.sizeSm)),ci("color",dZ(yt.textSecondary)),ci("white-space","pre-wrap")]),wZ=lo([ci("font-size",dZ(bt.sizeXs)),ci("color",dZ(yt.textDisabled))]);let EZ=function(e){let t=e.entries;if(0===t.length)return i(yo,{title:"No approvals",description:"Nothing in this window carries a decision."});let n=e.windowNote,s=e.nowMs,a=e.steps,l=t.length-1|0;return r("div",{children:[void 0!==a&&a.length>1?i(oZ,{steps:a}):null,i("div",{children:t.map((e,t)=>{let n,a=$(e.onOpen),c=e.actor,u=e.at,d=0;void 0!==c||void 0!==u?d=1:n=null,1===d&&(n=r("div",{children:[void 0!==c?r(o,{children:[i(Wo,{name:c,src:e.actorImageUrl,size:"Small"}),i("span",{children:c})]}):null,void 0!==u?i("span",{children:RY(U(s,Date.now()),u),title:U(vs(u),u)}):null],className:xZ}));let f=e.note;return r("div",{children:[r("div",{children:[i("span",{children:cZ(e.decision),className:(h=uZ(e.decision),lo([pi("inlineFlex"),ui("center"),bi("center"),ci("width","20px"),ci("height","20px"),ci("border-radius","50%"),ci("box-sizing","border-box"),ci("border","2px solid "+h),ci("color",h),ci("background",dZ(yt.surface)),ci("font-size","11px"),ci("line-height","1"),ci("flex","0 0 auto")]))}),t===l?null:i("div",{className:mZ})],className:gZ}),r("div",{children:[r("div",{children:[i("span",{children:e.step,className:bZ}),i(xs,{variant:lZ(e.decision),label:aZ(e.decision)})],className:_Z}),n,void 0!==f&&""!==f?i("div",{children:f,className:SZ}):null],className:a?vZ+" "+yZ:vZ,onClick:t=>M(e.onOpen,e=>e())})],className:pZ},e.key);var h}),className:hZ}),void 0!==n?i("span",{children:n,className:wZ}):null],className:fZ})};function kZ(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let CZ=["approved","approve","accepted","granted","signed","confirmed","rejected","reject","declined","denied","refused","withdrawn","pending","awaiting","submitted","inreview","underreview","escalated","skipped","waived","notrequired"],AZ=["decision","outcome","verdict","approval","approvalstatus","result"],NZ=["step","stage","level","tier","approvalstep","approvallevel","phase"],TZ=["note","notes","comment","comments","reason","remarks","justification","rationale"];function RZ(e){return me(_a(e),e=>{let t=e[1],n=e[0];if(Sa(t))return z(function(e){let t=Us(e);if(void 0!==t&&t.length>=2&&t.length<=12)return t}(t),e=>[n,e])})}function DZ(e){let t=RZ(e),n=t.find(e=>AZ.includes(kZ(e[0])));return void 0!==n?n:t.find(e=>function(e){return e.filter(e=>CZ.includes(kZ(e))).length>=2}(e[1]))}function IZ(e,t){let n=_a(e).map(e=>e[0]).find(e=>L(Je(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:_a(e).map(e=>e[0]).find(e=>L(JD(e),!1,ka))}function FZ(e,t){let n=U(t,za(e,void 0,void 0)),r=DZ(e),i=n.dateSpan;if(void 0===r)return;if(void 0===i)return;let o=r[0],s=RZ(e).find(e=>{let t=e[0];return t!==o&&NZ.includes(kZ(t))});return{decisionField:o,dateSpan:i,stepField:z(s,e=>e[0]),stepValues:L(s,[],e=>e[1]),actorField:IZ(e,n),noteField:me(_a(e),e=>{let t=e[0];if(Sa(e[1])&&TZ.includes(kZ(t)))return t})[0]}}function OZ(e){return e.rows.map((e,t)=>{let n=U(ft(e),{});return{key:U(j(Je(n,"id"),ut),"#"+t.toString()),json:e,dict:n}})}function PZ(e,t){return j(Je(e,t),ut)}function MZ(e,t){return j(ca(t,e),fc)}function LZ(e,t){if(void 0===t)return e.length;let n=e.findIndex(e=>kZ(e)===kZ(t));return-1!==n?n:e.length}function zZ(e){return e.rows.map((e,t)=>{let n=U(ft(e),{});return{key:U(j(Je(n,"id"),ut),"#"+t.toString()),json:e,dict:n}})}function jZ(e,t){return j(Je(e,t),ut)}function UZ(e,t,n){return z(jZ(t,n),t=>{let r=JD(n);return void 0!==r?U(j(e.refLabels,e=>e.lookupLabel(r,t)),t):t})}function BZ(e,t){return U(j(e.semantics.labelField,e=>jZ(t.dict,e)),t.key)}function $Z(e,t,n){M(t.find(e=>e.key===n),t=>e.onOpenRow(t.key,t.json))}function qZ(e,t,n){return i("span",{children:YI(e,t,void 0!==n?n:"item"),style:{color:"var("+yt.textDisabled+")",fontSize:"var("+bt.sizeXs+")"}})}function GZ(e,t,n,i){return r("div",{children:[e,qZ(t,n,void 0!==i?i:"item")],style:{display:"flex",flexDirection:"column",gap:"var("+_t.sm+")"}})}function VZ(e){let t=e.source,n=Ga(),s=qe(),a=zZ(t),l=tI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),c=qI(a.map(e=>e.dict),l,n,t.ownEntity,q(t.refLabels)),u=t.refLabels,d=void 0!==u?u:{lookupLabel:(e,t)=>DI(c,e,n,t),isMissing:(e,t)=>OI(c,e,n,t),retiredBadge:(e,t)=>II(c,e,n,t),linkable:(e,t)=>FI(c,e,n,t,!1)},f=me([t.semantics.labelField,t.semantics.imageField,t.semantics.statusField],e=>e),h=l.filter(e=>!f.includes(e.key)).slice(0,4),p=a.map(e=>{let a=z(j(t.semantics.statusField,t=>JW(e.dict,t)),e=>i(xs,{variant:"Neutral",label:at(e),dot:!1})),l=j(t.retired,t=>qs(t,Je(e.dict,t.field))),c=void 0!==a?void 0!==l?r(o,{children:[a,l]}):a:void 0!==l?l:void 0,u=function(e,t){return z(e.semantics.imageField,e=>{let n=j(jZ(t.dict,e),e=>""===e?void 0:e);return void 0!==n?{TAG:"Picture",_0:We(n)}:"EmptySlot"})}(t,e),f=z(t.rowActionsFor,t=>t(e.key,e.json).map(e=>({label:e.label,onClick:e.run})));return{key:e.key,title:BZ(t,e),media:u,badge:c,fields:h.map(r=>({label:sI(r,n,t.ownEntity),value:dI(r.key,r.kind,r.propSchema,Je(e.dict,r.key),r.ann,n,s,d,t.ownEntity)})),actions:f}});return GZ(i(xY,{cards:p,onCardClick:e=>$Z(t,a,e)}),[t],void 0,void 0)}function KZ(e){let t=e.source,n=zZ(t),r=U(t.semantics.statusField,""),o=function(e){let t=zZ(e),n=U(e.semantics.statusField,""),r=Bs(e.schema,n),i=e=>U(JW(e.dict,n),""),o=o=>o.map(o=>({value:o,label:""===o?"(no status)":at(o),cards:t.filter(e=>i(e)===o).map(t=>{let r=me(Fs(e.schema),r=>r===n?void 0:UZ(e,t.dict,r))[0];return{key:t.key,title:BZ(e,t),meta:r}}),swatch:uQ(r,o)})),s=ge(t.map(i).filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return o(r).concat(o(s))}(t),s=(e,i)=>j(t.statusCommandFor,t=>t((e=>U(j(n.find(t=>t.key===e),e=>JW(e.dict,r)),""))(e),i)),a=t.onCommand,l=void 0!==a&&$(t.statusCommandFor)?(e,t)=>M(s(e,t),t=>a(t.command,e,t.patch)):void 0,c=t.statusCommandFor;return GZ(i(LQ,{columns:o,onCardClick:e=>$Z(t,n,e),onMove:l,canDrop:void 0!==c?(e,t)=>$(s(e,t)):void 0}),[t],void 0,"card")}let WZ=["var("+yt.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function HZ(e,t){return U(e.accent,WZ[fe(t,WZ.length)])}function JZ(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=HZ(e,t),r=e.semantics.dateSpan;return void 0!==r?me(zZ(e),i=>z(j(ca(r,i.dict),fc),o=>{let s=j(ua(r,i.dict),fc);return{key:t.toString()+":"+i.key,title:BZ(e,i),start:o,end_:s,accent:n,onOpen:()=>e.onOpenRow(i.key,i.json)}})):[]}).flat()}(t),r=t.length>1?t.map((e,t)=>({label:e.readModelName,accent:HZ(e,t)})):[];return i(sY,{events:n,legend:r,windowNote:YI(t,void 0,void 0)})}function XZ(e){let t=e.sources,n=function(e){let t=e.map((e,t)=>{let n=e.semantics.dateSpan,r=HZ(e,t);return zZ(e).map(i=>{let o=j(n,e=>ca(e,i.dict)),s=j(o,fc),a=void 0!==o?U(vs(o),o):"",l=z(j(e.semantics.statusField,e=>JW(i.dict,e)),at);return{entry:{id:t.toString()+":"+i.key,timestamp:a,label:BZ(e,i),detail:l,variant:void 0,accent:r},sort:s,open_:()=>e.onOpenRow(i.key,i.json)}})}).flat();return t.toSorted((e,t)=>{let n=e.sort,r=t.sort;return void 0!==n?void 0!==r?r-n:-1:void 0!==r?1:0})}(t);return GZ(i(KW,{entries:n.map(e=>e.entry),onSelect:e=>M(n.find(t=>t.entry.id===e),e=>e.open_())}),t,void 0,void 0)}function QZ(e,t){let n=Je(e,t);if(void 0===n)return[];let r=ut(n);return void 0!==r?[r]:me(U(ht(n),[]),ut)}function YZ(e){let t=zZ(e),n=function(e,t){let n=t.map(e=>e.key);return me(_a(e.schema),e=>{let t=e[0];return z(JD(t),e=>t)}).filter(e=>t.some(t=>QZ(t.dict,e).some(e=>e!==t.key&&n.includes(e))))}(e,t),r=P(e.semantics.dateSpan,da);return void 0!==r?me(t,t=>z(j(ca(r,t.dict),fc),i=>{let o=U(j(ua(r,t.dict),fc),i);return{key:t.key,title:BZ(e,t),start:i,end_:o<i?i:o,accent:e.accent,dependsOn:n.map(e=>QZ(t.dict,e)).flat(),onOpen:()=>e.onOpenRow(t.key,t.json)}})):[]}function ZZ(e){let t=e.source,n=YZ(t),r=t.rows.length,o=n.length,s=YI([t],o,void 0);return i(FH,{tasks:n,windowNote:o===r?s:s+" (the rest carry no start date)"})}function e0(e,t){let n=e.semantics.labelField,r=j(e.semantics.statusField,e=>jZ(t.dict,e));return void 0!==r?r:j(Fs(e.schema).find(t=>!!vt(t,n)&&vt(t,e.semantics.parentField)),n=>UZ(e,t.dict,n))}function t0(e){let t=e.source,n=function(e){let t=zZ(e),n=e.semantics.parentField;return t.map(t=>({key:t.key,title:BZ(e,t),subtitle:e0(e,t),parent:j(n,e=>jZ(t.dict,e)),accent:e.accent,onOpen:()=>e.onOpenRow(t.key,t.json)}))}(t);return i(PW,{nodes:n,windowNote:YI([t],void 0,void 0)})}function n0(e){let t=e.source,n=Ga(),r=OZ(t),o=tI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=qI(r.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),a=t.refLabels,l=void 0!==a?a.lookupLabel:(e,t)=>DI(s,e,n,t),c=FZ(t.schema,t.semantics);if(void 0===c)return null;let u=function(e,t,n){let r=void 0!==n?n:e=>e,i=OZ(e).map(e=>{let n=j(t.stepField,t=>PZ(e.dict,t)),r=PZ(e.dict,t.decisionField);return[e,n,r]}),o=i.slice();void 0!==t.stepField?o.sort((e,n)=>LZ(t.stepValues,e[1])-LZ(t.stepValues,n[1])|0):o.sort((e,n)=>{let r=MZ(e[0].dict,t.dateSpan),i=MZ(n[0].dict,t.dateSpan);return void 0!==r?void 0!==i?r-i:-1:void 0!==i?1:0});let s=o.map(n=>{let i=n[0];return{key:i.key,step:U(z(n[1],at),U(j(e.semantics.labelField,e=>PZ(i.dict,e)),"Decision")),decision:L(n[2],"Pending",sZ),actor:z(j(t.actorField,e=>PZ(i.dict,e)),r),at:ca(t.dateSpan,i.dict),note:j(t.noteField,e=>PZ(i.dict,e)),onOpen:()=>e.onOpenRow(i.key,i.json)}}),a=me(o,e=>z(e[1],kZ)),l=t.stepValues.filter(e=>!a.includes(kZ(e))).map(e=>({key:"pending:"+e,step:at(e),decision:"Pending"}));return s.concat(l)}(t,c,e=>{let t=j(c.actorField,JD);return void 0!==t?U(l(t,e),e):e}),d=function(e,t){let n=t.stepField;if(void 0===n)return[];let r=me(OZ(e),e=>{let r=PZ(e.dict,n),i=PZ(e.dict,t.decisionField);if(void 0===r)return;if(void 0===i)return;let o=sZ(i);return"object"!=typeof o&&"Pending"===o?void 0:kZ(r)}),i=t.stepValues.find(e=>!r.includes(kZ(e)));return t.stepValues.map(e=>({key:e,label:at(e),state:r.includes(kZ(e))?"Done":mt(i,e)?"Current":"Upcoming"}))}(t,c);return i(EZ,{entries:u,steps:d,windowNote:YI([t],void 0,"decision")})}function r0(e){let t=function(e){return me(_a(e),e=>{let t=Us(e[1]);if(void 0!==t&&t.length>=2&&t.length<=12)return[e[0],t]})}(e),n=za(e,void 0,void 0).statusField,r=void 0!==n&&t.some(e=>e[0]===n)?t.filter(e=>e[0]===n).concat(t.filter(e=>e[0]!==n)):t,i=r[0],o=r[1];if(void 0!==i&&void 0!==o)return[i,o]}function i0(e){let t=e.source,n=s(()=>"Numbers"),o=n[1],a=n[0],l=function(e){return z(r0(e.schema),t=>{let n=t[1],r=n[1],i=n[0],o=t[0],s=o[1],a=o[0],l=zZ(e),c=(e,t)=>U(JW(e.dict,t),""),u=(e,t)=>ge(l.map(t=>c(t,e)).filter(e=>!t.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t])),d=s.concat(u(a,s)),f=r.concat(u(i,r)),h=d.map(e=>f.map(t=>ge(l,0,(n,r)=>c(r,a)===e&&c(r,i)===t?n+1|0:n))),p=h.map(e=>ge(e,0,(e,t)=>e+t|0)),g=f.map((e,t)=>ge(h,0,(e,n)=>e+n[t]|0)),m=ge(p,0,(e,t)=>e+t|0);return{rowField:a,colField:i,rowValues:d,colValues:f,counts:h,rowTotals:p,colTotals:g,grandTotal:m}})}(t);if(void 0===l)return null;let c,u=e=>""===e?"(none)":at(e),d=at(l.rowField),f=at(l.colField),h=l.rowValues.map(e=>[e,u(e)]),p=l.colValues.map(e=>[e,u(e)]),g=ge(l.counts,0,(e,t)=>ge(t,e,(e,t)=>t>e?t:e)),m=e=>function(e,t){return jo(e.toString(),function(e){return"object"==typeof e}(t))}(e,QI([t])),v=(e,t)=>i("button",{children:t,style:{background:"none",backgroundColor:a===e?"var("+yt.surfaceSubtle+")":"transparent",border:"1px solid var("+yt.border+")",color:a===e?"var("+yt.textPrimary+")":"var("+yt.textSecondary+")",cursor:"pointer",fontSize:"var("+bt.sizeSm+")",padding:"2px var("+_t.sm+")",borderRadius:"var("+xt.sm+")"},type:"button",onClick:t=>o(t=>e)});return c="Numbers"===a?i(KH,{rowDimLabel:d,colDimLabel:f,rowHeaders:h.map(e=>({value:e[0],label:e[1]})),colHeaders:p.map(e=>({value:e[0],label:e[1]})),cells:l.counts.map(e=>e.map(e=>({display:e.toString(),empty:0===e}))),rowTotals:l.rowTotals.map(m),colTotals:l.colTotals.map(m),grandTotal:m(l.grandTotal)}):i(pW,{rowDimLabel:d,colDimLabel:f,rowHeaders:h.map(e=>({value:e[0],label:e[1]})),colHeaders:p.map(e=>({value:e[0],label:e[1]})),cells:l.counts.map(e=>e.map(e=>({value:e,display:e.toString()}))),maxLabel:g.toString()}),r("div",{children:[r("div",{children:[v("Numbers","Numbers"),v("Heat","Heat")],style:{display:"inline-flex",alignSelf:"flex-end",gap:"var("+_t.xs+")"}}),c,qZ([t],void 0,"row")],style:{display:"flex",flexDirection:"column",gap:"var("+_t.sm+")"}})}function o0(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=e.semantics.imageField;return zZ(e).map(r=>{let i=j(j(n,e=>jZ(r.dict,e)),e=>""===e?void 0:We(e)),o=z(j(e.semantics.statusField,e=>JW(r.dict,e)),at),s=e.fillSlot,a=void 0!==i||void 0===s||void 0===n?void 0:s(r.key,n);return{item:{key:t.toString()+":"+r.key,src:i,title:BZ(e,r),caption:o,onUpload:a},open_:()=>e.onOpenRow(r.key,r.json)}})}).flat()}(t);return GZ(i(rJ,{items:n.map(e=>e.item),onOpen:e=>M(n.find(t=>t.item.key===e),e=>e.open_())}),t,void 0,void 0)}function s0(e){return i("span",{children:e,"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}})}function a0(e,t){let n=e[0];return void 0!==n?t(n):null}function l0(e,t){return e===t?0:e<t?-1:1}function c0(e,t){if(void 0===t)return"";let n=ct(t),r=0;if("object"!=typeof n){if("JSONNull"===n)return"";r=2}else switch(n.TAG){case"JSONString":return n._0;case"JSONNumber":return n._0.toString();default:r=2}if(2===r)if("object"!=typeof e)switch(e){case"KBoolean":return"object"!=typeof n?"JSONFalse"===n?"No":"Yes":JSON.stringify(t);case"KArrayOfStrings":if("object"==typeof n)return"JSONObject"===n.TAG?JSON.stringify(t):me(n._0,ut).join(", ")}else if("KUnion"===e.TAG&&"object"==typeof n){if("JSONObject"!==n.TAG)return JSON.stringify(t);let r=pa(t);if(void 0===r)return"";let i=r[0];return L(Ot(e._0,i),i,e=>e.tag)}return"object"!=typeof n?"JSONFalse"===n?"false":"true":JSON.stringify(t)}function u0(e,t,n){let r=Xe(n).filter(e=>""!==e[1]);return 0===r.length?e:e.filter(e=>r.every(n=>{let r=n[0],i=t.find(e=>e.key===r);return void 0===i||function(e,t,n){if(""===n)return!0;if("object"==typeof e)return"KEnum"!==e.TAG||L(j(t,ut),!1,e=>e===n);if("KBoolean"!==e)return!0;let r=z(t,ct);if(void 0===r)return!1;if("object"==typeof r)return!1;switch(r){case"JSONFalse":return"false"===n;case"JSONTrue":return"true"===n;default:return!1}}(i.kind,Je(e,r),n[1])}))}function d0(e,t,n){return""===n?e:e.filter(e=>function(e,t,n){if(""===n)return!0;let r=n.toLowerCase();return t.some(t=>c0(t.kind,Je(e,t.key)).toLowerCase().includes(r))}(e,t,n))}function f0(e,t,n,r){if(void 0===n)return e;let i=t.find(e=>e.key===n);if(void 0===i)return e;let o="Asc"===r?1:-1;return e.toSorted((e,t)=>function(e,t,n){let r=e=>void 0===e||"JSONNull"===ct(e),i=r(t),o=r(n);if(i)return o?0:1;if(o)return-1;if("object"!=typeof e)switch(e){case"KBoolean":let r=e=>{if(void 0===e)return 0;let t=ct(e);return"object"==typeof t?0:"JSONTrue"===t?1:0};return r(t)-r(n);case"KDate":return l0(c0(e,t),c0(e,n));case"KNumber":return U(j(t,dt),0)-U(j(n,dt),0)}return l0(c0(e,t),c0(e,n))}(i.kind,Je(e,n),Je(t,n))*o)}function h0(e){return"var("+e+")"}WI({id:"cards",label:"Cards",icon:s0("▤"),arity:"Single",isCapable:(e,t,n)=>!0,render:e=>a0(e,e=>i(VZ,{source:e})),capability:"always — richer with label/image semantics and summary fields"}),WI({id:"board",label:"Board",icon:s0("▥"),arity:"Single",isCapable:(e,t,n)=>L(t.statusField,!1,t=>0!==Bs(e,t).length),render:e=>a0(e,e=>i(KZ,{source:e})),capability:"statusField — status/state/stage string enum (≤ 8 values) supplying the columns"}),WI({id:"calendar",label:"Calendar",icon:s0("▣"),arity:{TAG:"Multi",min:1},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(JZ,{sources:e}),capability:"dateSpan — a `date-range` field, a start*/end* date-time pair, or a lone non-infrastructure date field"}),WI({id:"timeline",label:"Timeline",icon:s0("▚"),arity:{TAG:"Multi",min:2},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(XZ,{sources:e}),capability:"dateSpan — a date field to place rows on a most-recent-first chronological stream; several sources merge into one stream, accent-coded per source"}),WI({id:"gantt",label:"Gantt",icon:s0("▬"),arity:"Single",isCapable:(e,t,n)=>L(t.dateSpan,!1,da),render:e=>a0(e,e=>i(ZZ,{source:e})),capability:"dateSpan stating an end — a `date-range` field or a start*/end* date-time pair; dependency connectors come from entity-ref fields whose ids point at other loaded rows"}),WI({id:"hierarchy",label:"Hierarchy",icon:s0("⑂"),arity:"Single",isCapable:(e,t,n)=>$(t.parentField),render:e=>a0(e,e=>i(t0,{source:e})),capability:"parentField — a parent*/manager/reportsTo/supervisor string field (or one annotated `parent-ref`) whose values point at other rows of the same collection"}),WI({id:"approvals",label:"Approvals",icon:s0("✓"),arity:"Single",isCapable:(e,t,n)=>function(e){return $(FZ(e,void 0))}(e),render:e=>a0(e,e=>i(n0,{source:e})),capability:"a decision enum — a small string enum named decision/outcome/verdict/approval/result, or any small enum declaring two or more approval values (approved/rejected/pending/…) — plus a date field to sequence the chain"}),WI({id:"pivot",label:"Pivot",icon:s0("⊞"),arity:"Single",isCapable:(e,t,n)=>$(r0(e)),render:e=>a0(e,e=>i(i0,{source:e})),capability:"two small string enums (2–12 values) as the row and column dimensions"}),WI({id:"gallery",label:"Gallery",icon:s0("▨"),arity:"Single",isCapable:(e,t,n)=>$(t.imageField),render:e=>i(o0,{sources:e}),capability:"imageField — a string field named image/imageUrl/photo/avatar/thumbnail (or annotated `image`) supplying each row's picture"});let p0=lo([ji("relative"),pi("inlineFlex"),ui("center")]),g0=lo([ci("background",h0(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",h0(xt.md)),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("padding-left","32px"),ci("font-size",h0(bt.sizeMd)),ci("color",h0(yt.textPrimary)),ci("outline","none"),ci("width","240px"),Ji([ci("border-color",h0(yt.brand))]),Zi([ci("color",h0(yt.textDisabled))])]),m0=lo([ji("absolute"),xi(eo(10)),ci("color",h0(yt.textDisabled)),ci("font-size",h0(bt.sizeSm)),ci("pointer-events","none")]),v0=lo([ji("absolute"),Ui(eo(8)),ci("background","none"),ci("border","none"),ci("cursor","pointer"),ci("color",h0(yt.textDisabled)),ci("font-size",h0(bt.sizeSm)),ci("padding","0"),ci("line-height","1"),Qi([ci("color",h0(yt.textSecondary))])]);let y0=function(e){let t=e.placeholder,n=e.onChange,o=e.value,s=void 0!==t?t:"Search...";return r("div",{children:[i("span",{children:"/",className:m0}),i("input",{className:g0,placeholder:s,type:"text",value:o,onChange:e=>n(e.target.value)}),""!==o?i("button",{children:"x",className:v0,onClick:e=>n("")}):null],className:p0})};function _0(e){return"var("+e+")"}let b0=lo([pi("flex"),ui("center"),ci("gap",_0(_t.sm)),yi("wrap")]),x0=lo([pi("flex"),ui("center"),ci("gap","4px")]),S0=lo([ci("color",_0(yt.textSecondary)),ci("font-size",_0(bt.sizeSm)),ci("white-space","nowrap")]),w0=lo([ci("background",_0(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",_0(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("font-size",_0(bt.sizeSm)),ci("color",_0(yt.textPrimary)),ci("cursor","pointer"),ci("outline","none"),Ji([ci("border-color",_0(yt.brand))])]);function E0(e){let t=e.onChange,n=e.filter;return r("div",{children:[i("span",{children:n.label+":",className:S0}),r("select",{children:[i("option",{children:"All",value:""}),n.options.map(e=>i("option",{children:e.label,value:e.value},e.value))],className:w0,value:n.value,onChange:e=>t(n.key,e.target.value)})],className:x0})}let k0=E0;let C0=function(e){let t=e.onSearchChange,n=e.searchValue,o=e.onFilterChange;return r("div",{children:[void 0!==n&&void 0!==t?i(y0,{value:n,onChange:t}):null,e.filters.map(e=>i(E0,{filter:e,onChange:o},e.key))],className:b0})};function A0(){let e=s(()=>{}),t=e[1],n=e[0];return{element:void 0!==n?i(qK,{variant:"Error",title:n.command,message:n.reason,onDismiss:()=>t(e=>{})}):null,onNotice:e=>{if("object"!=typeof e)return t(e=>{});let n=e._0;t(e=>n)}}}function N0(e){try{return decodeURIComponent(e)}catch(t){return e}}function T0(e){let t=e.split("/");if(2!==t.length)return[e,void 0];let n=t[0],r=t[1];return[N0(n),N0(r)]}function R0(e){return"var("+e+")"}let D0=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",R0(_t.md)),mi(1),ci("min-height","160px"),Bi("center"),ci("padding",R0(_t.lg))]),I0=lo([ci("font-size","32px"),ci("color",R0(yt.error)),ci("line-height","1")]),F0=lo([ci("color",R0(yt.textPrimary)),ci("font-size",R0(bt.sizeLg)),ci("font-weight",R0(bt.weightMedium)),Ei(eo(0))]),O0=lo([ci("color",R0(yt.textSecondary)),ci("font-size",R0(bt.sizeSm)),ci("line-height",R0(bt.lineHeightNormal)),Ei(eo(0))]),P0=lo([ci("background",R0(yt.brand)),ci("color",R0(yt.textOnBrand)),ci("border","none"),ci("border-radius",R0(xt.md)),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("font-size",R0(bt.sizeSm)),ci("cursor","pointer"),Ni(eo(4))]);let M0=function(e){let t=e.title,n=void 0!==t?t:"Something went wrong";return r("div",{children:[i("div",{children:"X",className:I0}),i("h3",{children:n,className:F0}),L(e.detail,null,e=>i("p",{children:e,className:O0})),L(e.onRetry,null,e=>i("button",{children:"Try again",className:P0,onClick:t=>e()}))],className:D0})};function L0(e){return"var("+e+")"}let z0=lo([pi("flex"),ui("center"),ci("gap",L0(_t.xs)),ci("font-size",L0(bt.sizeSm)),ci("color",L0(yt.textSecondary)),ci("min-width","0")]),j0=lo([ci("color",L0(yt.brand)),ci("text-decoration","none"),ci("white-space","nowrap"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("max-width","18ch"),Qi([ci("text-decoration","underline")])]),U0=lo([ci("color",L0(yt.textPrimary)),ci("font-weight",L0(bt.weightMedium))]),B0=lo([ci("color",L0(yt.textDisabled)),ci("font-size",L0(bt.sizeLg)),ci("line-height","1"),vi(0),qi("none")]),$0=i("span",{children:"›","aria-hidden":!0,className:B0});let q0=function(e){let t=e.allLinks,n=e.crumbs,o=void 0!==t&&t;return i("nav",{children:n.map((e,t)=>{let s=!o&&t===(n.length-1|0);return r(g,{children:[t>0?$0:null,s||q(e.href)&&q(e.onClick)?i("span",{children:e.label,className:U0}):i("a",{children:e.label,className:j0,title:e.label,href:U(e.href,"#"),onClick:z(e.onClick,e=>t=>{if(!function(e){return!!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)||0!==e.button}(t))return t.preventDefault(),e()})})]},e.label)}),"aria-label":"breadcrumbs",className:z0})};function G0(e){return"var("+e+")"}let V0=lo([ji("relative"),pi("inlineBlock")]),K0=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",G0(xt.sm)),ci("cursor","pointer"),ci("color",G0(yt.textSecondary)),ci("padding","2px var("+_t.sm+")"),ci("font-size",G0(bt.sizeSm)),Qi([ci("background",G0(yt.surfaceSubtle)),ci("color",G0(yt.textPrimary))])]),W0=lo([ji("absolute"),Ui(eo(0)),$i({NAME:"percent",VAL:100}),Ni(eo(4)),ci("background",G0(yt.surfaceElevated)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",G0(xt.md)),ci("box-shadow",G0(wt)),ci("min-width","160px"),ci("z-index","200"),ci("overflow","hidden"),zi(eo(4),eo(0))]);let H0=lo([ci("border","none"),ci("border-top","1px solid var("+yt.borderSubtle+")"),ki(eo(4),eo(0))]);let J0=function(e){let t=e.triggerLabel,n=void 0!==t?t:"...",o=s(()=>!1),l=o[1],c=o[0];return a(()=>{if(!c)return;let e=e=>l(e=>!1);return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[c]),r("div",{children:[i("button",{children:n,className:K0,onClick:e=>{e.stopPropagation(),l(e=>!e)}}),c?i("div",{children:e.items.map((e,t)=>{if("object"!=typeof e)return i("hr",{className:H0},t.toString());let n=e.onClick,r=e.label;return i("button",{children:r,className:(o=e.danger,lo([pi("block"),Gi({NAME:"percent",VAL:100}),ci("background","none"),ci("border","none"),ci("text-align","left"),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("font-size",G0(bt.sizeMd)),ci("color",G0(o?yt.error:yt.textPrimary)),hi("pointer"),Qi([ci("background",G0(yt.surfaceSubtle))])])),onClick:e=>{l(e=>!1),n()}},r);var o}),className:W0,onClick:e=>{e.stopPropagation()}}):null],className:V0})};function X0(e){return"var("+e+")"}let Q0=lo([pi("flex"),ui("center"),ci("gap",X0(_t.md)),ci("flex-wrap","wrap"),ci("padding-bottom",X0(_t.sm)),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]),Y0=lo([ci("display","inline-flex"),ui("center"),ci("vertical-align","middle"),ci("gap",X0(_t.xs)),ci("min-width","0"),ci("max-width","100%"),ci("margin-right",X0(_t.md)),ci("flex","0 1 auto")]),Z0=lo([ci("font-size",X0(bt.sizeLg)),ci("font-weight",X0(bt.weightMedium)),ci("color",X0(yt.textPrimary)),ci("line-height",X0(bt.lineHeightTight)),Ei(eo(0)),ci("min-width","8ch"),ci("white-space","nowrap"),ci("overflow","hidden"),ci("text-overflow","ellipsis")]),e1=lo([ci("display","inline-flex"),ui("center"),ci("vertical-align","middle"),ci("flex-wrap","wrap"),ci("gap",X0(_t.sm)),ci("flex","0 1 auto"),ci("min-width","0"),ci("max-width","100%")]),t1=lo([pi("flex"),ui("center"),ci("flex-wrap","wrap"),bi("flexEnd"),ci("gap",X0(_t.sm)),vi(0),ci("margin-left","auto")]),n1={titleGroup:Y0};function r1(e){return"var("+e+")"}let i1=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),ci("border-radius",r1(xt.md)),ci("padding","2px var("+_t.sm+")"),ci("font-size",r1(bt.sizeSm)),ci("line-height","1.6"),ci("white-space","nowrap"),hi("pointer"),Hi([ci("opacity","0.4"),hi("notAllowed")])]),o1=co([i1,lo([ci("background",r1(yt.brand)),ci("color",r1(yt.textOnBrand)),ci("border","1px solid transparent"),Qi([ci("filter","brightness(1.08)")])])]),s1=co([i1,lo([ci("background",r1(yt.surface)),ci("color",r1(yt.textPrimary)),ci("border","1px solid var("+yt.border+")"),Qi([ci("background",r1(yt.surfaceSubtle))])])]);let a1=s1,l1=function(e){let t,n=e.inBar,s=e.actions,a=e.commands,l=e.titleAccessory,c=e.title,u=e.crumbs,f=void 0!==u?u:[],h=void 0!==l?l:null,p=void 0!==a?a:[],g=void 0!==s?s:null,m=void 0!==n&&n,v=d(DG),y=Tq(Ct.narrow),_=0!==f.length,b=e=>i("button",{children:e.label,className:U(e.primary,!1)?o1:s1,onClick:t=>e.run()},e.key);if(y&&p.length>2){let e=p.slice(1);t=r(o,{children:[L(p[0],null,b),i(J0,{items:e.map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1})),triggerLabel:"⋯ "+e.length.toString()})]})}else t=p.map(b);let x=L(e.controls,null,e=>MG(m?v:void 0,i("div",{children:e,className:t1}))),S=r(o,{children:[r("div",{children:[_?i(q0,{crumbs:f,allLinks:!0}):null,_?$0:null,i("h1",{children:c,className:Z0,title:c}),h],className:Y0}),r("div",{children:[t,g],className:e1}),x]});return m?S:i("div",{children:S,className:Q0})};function c1(e,t){return void 0!==t?(e,n)=>t(e,n).then(HW):void 0!==e?(t,n)=>e(t,n).then(WW):void 0}function u1(){return c1(SI(),wI())}let d1=Ye([["ProductsNotAvailable",{template:"These products aren't available yet: {{missing}}.",idFields:[{field:"missing",entityStem:"product"}]}],["OrderAlreadyPlaced",{template:"This order has already been placed.",idFields:[]}],["CategoryAlreadyArchived",{template:"This category is already archived.",idFields:[]}]]);function f1(e,t){return L(j(ft(e),e=>Je(e,t)),[],e=>{let t=ct(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,ut).filter(e=>""!==e);default:return[]}})}function h1(e,t){return ge(Xe(t),e,(e,t)=>e.replaceAll("{{"+t[0]+"}}",t[1]))}function p1(e,t,n,r){let i=function(e,t){return void 0!==e?void 0!==t?t+" ("+e+")":"Command rejected: "+e:void 0!==t?t:"Command rejected"}(n,r);if(void 0===n)return Promise.resolve(i);let o=Je(d1,n);if(void 0===o)return Promise.resolve(i);if(0===o.idFields.length)return Promise.resolve(o.template);let s=function(e){return j(e,e=>{try{return JSON.parse(e)}catch(t){return}})}(r);if(void 0===s)return Promise.resolve(o.template);if(void 0!==e){let n=o.idFields.map(n=>{let r=n.field,i=f1(s,r);return 0===i.length?Promise.resolve([r,""]):function(e,t,n,r){let i=Va(t,n);return void 0!==i?ce(zI(e,i,r).then(e=>{let t=e[0];return r.map(e=>{let n=Je(t,e);return void 0!==n?n:e})}),e=>Promise.resolve(r)):Promise.resolve(r)}(e,t,n.entityStem,i).then(e=>Promise.resolve([r,e.join(", ")]))});return Promise.all(n).then(e=>{let t={};return e.forEach(e=>{t[e[0]]=e[1]}),Promise.resolve(h1(o.template,t))})}let a={};return o.idFields.forEach(e=>{let t=e.field,n=f1(s,t);a[t]=n.join(", ")}),Promise.resolve(h1(o.template,a))}let g1="This command could not be sent. See the console for details.";function m1(e,t,n,r,i,o,s,a,l){let c=void 0!==s?s:[],u=void 0!==a?a:e=>{},d=void 0!==l?l:e=>{},f=n.filter(e=>"Instance"===e.level),h=c1(e,t);return(t,n,s)=>{let a=f.find(e=>e.name===t);return void 0!==h?void 0!==a?(d(n),void ce(h(a.mutationDocument,function(e,t,n){let r={};return Xe(U(ft(n),{})).forEach(e=>{r[e[0]]=e[1]}),r[U(e.aggregateIdField,"id")]=t,r}(a,n,s)).then(n=>{if("object"!=typeof n)return"Accepted"===n?(i||o(),u("Cleared"),Promise.resolve()):(i||setTimeout(()=>o(),500),u("Cleared"),Promise.resolve());{if("Rejected"===n.TAG){let i=n._0;return console.warn("[AutoUI] "+r+": command "+t+" rejected"+L(i.errorCode,"",e=>" ("+e+")")),o(),p1(e,c,i.errorCode,i.detail).then(e=>(u({TAG:"Failed",_0:{command:a.label,reason:e}}),Promise.resolve()))}let i=n._0;return console.error("[AutoUI] "+r+": command "+t+" not executed — "+i),o(),u({TAG:"Failed",_0:{command:a.label,reason:i}}),Promise.resolve()}}),e=>(console.error("[AutoUI] "+r+": command "+t+" failed to reach the server"),u({TAG:"Failed",_0:{command:a.label,reason:"The request failed — the change was not sent."}}),o(),Promise.resolve()))):(console.error("[AutoUI] "+r+': command "'+t+'" is not an instance command of this view'),u({TAG:"Failed",_0:{command:t,reason:g1}})):(console.error("[AutoUI] "+r+': command "'+t+'" not sent — no GraphQL executor in context'),u({TAG:"Failed",_0:{command:t,reason:g1}}))}}function v1(e){return"var("+e+")"}let y1=lo([ji("relative"),pi("inlineBlock")]),_1=lo([pi("inlineFlex"),ui("center"),ci("gap","6px"),ci("background",v1(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",v1(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",v1(yt.textSecondary)),ci("font-size",v1(bt.sizeSm)),ci("white-space","nowrap"),hi("pointer"),Qi([ci("background",v1(yt.surfaceSubtle)),ci("color",v1(yt.textPrimary))])]),b1=lo([pi("inlineFlex"),ui("center"),bi("center"),ci("min-width","16px"),ci("height","16px"),ci("padding","0 4px"),ci("border-radius",v1(xt.full)),ci("background",v1(yt.brand)),ci("color",v1(yt.textOnBrand)),ci("font-size",v1(bt.sizeXs)),ci("line-height","1")]),x1=lo([ji("absolute"),xi(eo(0)),$i({NAME:"percent",VAL:100}),Ni(eo(4)),pi("flex"),gi("column"),ci("gap",v1(_t.sm)),ci("align-items","stretch"),ci("background",v1(yt.surfaceElevated)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",v1(xt.md)),ci("box-shadow",v1(wt)),ci("padding",v1(_t.md)),ci("min-width","220px"),ci("max-width","min(320px, calc(100vw - 32px))"),ci("max-height","min(60vh, 420px)"),ci("overflow-y","auto"),ci("z-index","200")]);let S1=function(e){let t=e.label,n=e.activeCount,o=void 0!==t?t:"Filters",l=s(()=>!1),c=l[1],u=l[0];return a(()=>{if(!u)return;let e=e=>c(e=>!1);return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[u]),r("div",{children:[r("button",{children:[o,n>0?i("span",{children:n.toString(),className:b1}):null,i("span",{children:"▾","aria-hidden":!0})],"aria-expanded":u,className:_1,onClick:e=>{e.stopPropagation(),c(e=>!e)}}),u?i("div",{children:e.children,className:x1,onKeyDown:e=>{if("Escape"===e.key)return c(e=>!1)},onClick:e=>{e.stopPropagation()}}):null],className:y1})};function w1(e){return"var("+e+")"}let E1=lo([pi("grid"),ci("grid-template-columns","minmax(0, 1fr) minmax(0, 1.4fr)"),ci("gap",w1(_t.lg)),ci("align-items","start"),Wi(Ct.narrow,[ci("grid-template-columns","minmax(0, 1fr)")])]),k1=lo([ci("min-width","0"),ci("overflow","auto")]),C1=co([k1,lo([ci("border-left","1px solid var("+yt.border+")"),ci("padding-left",w1(_t.lg)),Wi(Ct.narrow,[ci("border-left","none"),ci("padding-left","0"),ci("border-top","1px solid var("+yt.border+")"),ci("padding-top",w1(_t.lg))])])]);let A1=function(e){return r("div",{children:[i("div",{children:e.master,className:k1}),i("div",{children:e.detail,className:C1})],className:E1})};function N1(e){return"var("+e+")"}let T1=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",N1(_t.md)),mi(1),ci("min-height","160px"),ci("color",N1(yt.textSecondary))]),R1=lo([ci("width","32px"),ci("height","32px"),ci("border","3px solid var("+yt.borderSubtle+")"),ci("border-top-color",N1(yt.brand)),ci("border-radius","50%"),ci("animation","rv-spin 0.7s linear infinite")]),D1=lo([ci("font-size",N1(bt.sizeSm)),ci("color",N1(yt.textSecondary))]);ao("@keyframes rv-spin",[Ki("from",[ci("transform","rotate(0deg)")]),Ki("to",[ci("transform","rotate(360deg)")])]);let I1=function(e){return r("div",{children:[i("div",{className:R1}),L(e.label,null,e=>i("span",{children:e,className:D1}))],className:T1})};function F1(e,t,n){let r={},i=[];e.forEach(e=>{let n=function(e,t){return U(j(Je(e,t),ut),"")}(e,t),o=Je(r,n);void 0!==o?o.push(e):(r[n]=[e],i.push(n))});let o=e=>{if(""===e)return n.length+1|0;let t=n.indexOf(e);return-1!==t?t:n.length};return i.toSorted((e,t)=>{let n=o(e),r=o(t);return n!==r?n-r|0:e<t?-1:e>t?1:0}).map(e=>[e,U(Je(r,e),[])])}function O1(e){return j(j(ft(e),e=>Je(e,"id")),ut)}function P1(e){return U(z(j(j(ft(e),e=>Je(e,"properties")),ft),e=>Object.keys(e)),[])}function M1(e,t){return j(ft(e),e=>Je(e,t))}function L1(e){return!!e.startsWith("__")||e.startsWith("$")}let z1="$offload";function j1(e){let t=ct(e);if("object"!=typeof t)return!1;switch(t.TAG){case"JSONObject":let e=t._0;return!!$(Je(e,z1))||Qe(e).some(j1);case"JSONArray":return t._0.some(j1);default:return!1}}function U1(e){let t=ct(e);if("object"==typeof t)switch(t.TAG){case"JSONObject":let e=t._0,n=j(Je(e,z1),ft);if(void 0===n)return ge(Qe(e),void 0,(e,t)=>B(e,U1(t)));let r=j(Je(n,"hash"),ut);return void 0!==r?r:j(Je(n,"key"),ut);case"JSONArray":return ge(t._0,void 0,(e,t)=>B(e,U1(t)));default:return}}function B1(e,t){return me(t,t=>z(j(M1(e,t),U1),e=>[t,e]))}let $1=new Map;function q1(e,t,n,r){let i=void 0!==r?r:[],o=t.state;if(void 0===o)return;let s=P1(n);if(0===s.length)return;!function(e,t){let n=L(ft(e),[],e=>Object.keys(e).filter(e=>!L1(e)&&!t.includes(e)));if(0===n.length)return;let r=n.join(",");q($1.get(r))&&($1.set(r,!0),console.warn("AutoLiveApply: the live-update payload carries fields the state schema does not declare ("+r+") — they will not be merged. The persisted manifest is likely behind the deployed projection."))}(o,s);let a=function(e,t,n,r){return me(B1(t,n),t=>{let n=t[1],i=t[0],o=r.some(e=>e[0]===i&&e[1]===n),s=L(M1(e,i),!1,e=>"JSONNull"!==ct(e));if(o&&s)return i})}(e,o,s,i),l=function(e,t,n,r){let i=void 0!==r?r:[],o=ft(e),s=ft(t);if(void 0===o)return e;if(void 0===s)return e;let a=Ye(Xe(o));return n.filter(e=>!i.includes(e)).forEach(e=>{let t=Je(s,e),n=Je(o,e);return void 0!==t?void(a[e]=t):void 0!==n?void(a[e]=null):void 0}),a}(e,o,s,a);return function(e,t,n,r){let i=void 0!==r?r:[],o=n.some(e=>!i.includes(e)&&L(M1(t,e),!1,j1)),s=L(ft(e),!1,e=>Object.keys(e).some(e=>!L1(e)&&!n.includes(e))),a=s&&n.some(n=>!!function(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id"))||n>3&&t.endsWith("ids")}(n)&&vt(M1(e,n),M1(t,n)));return!o&&!a}(e,l,s,a)?l:void 0}let G1={fromBatch:function(e,t,n){return z(j(j(ft(t),e=>Je(e,n)),ht),t=>{let n=me(t,O1);return{rows:t,gone:e.filter(e=>!n.includes(e))}})},fromSingle:function(e,t){let n=j(ft(e),e=>Je(e,t));if(void 0!==n)return"JSONNull"===ct(n)?"Absent":{TAG:"Present",_0:n}},drop:function(e,t){return 0===t.length?e:e.filter(e=>{let n=O1(e);return void 0===n||!t.includes(n)})}},V1=/^[0-9]+$/;function K1(e){if(!V1.test(e))return;let t=e.length;return e.slice((n=>{for(;;){let r=n;if(!(r<(t-1|0)&&mt(e[r],"0")))return r;n=r+1|0}})(0))}function W1(e,t,n){if(void 0===n)return!0;let r=e.get(t);return void 0===r||function(e,t){let n=K1(e),r=K1(t);if(void 0===n)return!0;if(void 0===r)return!0;let i=n.length,o=r.length;return i===o?n>r:i>o}(n,r)}let H1={make:function(){return new Map},shouldApply:W1,record:function(e,t,n){void 0!==n&&W1(e,t,n)&&e.set(t,n)}};function J1(e,t){return U(e.get(t),[])}function X1(e,t,n){0===n.length||e.set(t,n)}let Q1={make:function(){return new Map},known:J1,record:X1,apply:function(e,t,n,r){let i=q1(t,n,r,J1(e,n.id)),o=n.state;return void 0!==o&&X1(e,n.id,B1(o,P1(r))),i}};function Y1(e,t,n){return me(AI(e,t),e=>{let t=j(Je(e,"id"),ut),r=U(j(Je(e,n),ut),U(t,""));return z(t,e=>({id:e,label:r}))})}function Z1(e){return"var("+e+")"}function e2(e){if(""===e)return[];let t=ht(JSON.parse(e));return void 0!==t?me(t,ut):[e]}function t2(e){return JSON.stringify(e.map(e=>e))}let n2=lo([ji("relative"),Gi({NAME:"percent",VAL:100})]),r2=lo([ci("background",Z1(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Z1(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("font-size",Z1(bt.sizeMd)),ci("color",Z1(yt.textPrimary)),ci("outline","none"),Gi({NAME:"percent",VAL:100}),Ii(eo(34)),pi("flex"),ui("center"),yi("wrap"),ci("gap","4px"),hi("pointer"),Bi("left"),Ji([ci("border-color",Z1(yt.brand))])]),i2=lo([ci("border-color",Z1(yt.brand))]),o2=lo([ci("border-color",Z1(yt.error))]),s2=lo([ci("color",Z1(yt.textSecondary))]),a2=lo([pi("inlineFlex"),ui("center"),ci("background",Z1(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",Z1(xt.sm)),ci("padding","2px 6px"),ci("font-size",Z1(bt.sizeSm)),ci("gap","4px")]),l2=lo([hi("pointer"),ci("color",Z1(yt.textSecondary)),ci("font-weight",Z1(bt.weightBold))]),c2=lo([ci("border","none"),ci("background","transparent"),ci("outline","none"),ci("color",Z1(yt.textPrimary)),ci("font-size",Z1(bt.sizeMd)),mi(1),Fi(eo(40))]),u2=lo([ji("absolute"),$i({NAME:"percent",VAL:100}),xi("zero"),Ui("zero"),Ni(eo(2)),ci("background",Z1(yt.surfaceElevated)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Z1(xt.sm)),ci("box-shadow",Z1(wt)),wi("none"),Ei("zero"),Li("zero"),Ri(eo(240)),Mi("auto"),Vi(20)]),d2=lo([ci("padding","var("+_t.xs+") var("+_t.sm+")"),hi("pointer"),ci("color",Z1(yt.textPrimary)),ci("font-size",Z1(bt.sizeMd))]),f2=lo([ci("background",Z1(yt.surfaceSubtle))]),h2=lo([ci("background",Z1(yt.brandSubtle))]),p2=lo([ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("color",Z1(yt.textSecondary)),ci("font-size",Z1(bt.sizeSm))]);let g2=function(e){let t,n=e.autoFocus,o=e.hasError,l=e.onBlur,c=e.onChange,u=e.value,d=e.required,f=e.multi,p=e.labelField,g=e.queryField,m=e.fieldKey,y=void 0!==l?l:()=>{},_=void 0!==o&&o,b=void 0!==n&&n,x=function(e,t){let n=SI(),r=s(()=>({loading:!0,options:[],hasMore:!1})),i=r[1];return a(()=>{let r={contents:!1};if(i(e=>({loading:!0,options:[],hasMore:!1})),void 0!==n){let o="id"===t?"id":"id "+t,s="query { "+e+"(first: "+21..toString()+") { edges { node { "+o+" } } } }";ce(n(s,{}).then(n=>{if(!r.contents){let r=Y1(n,e,t),o=r.length>=21,s=o?r.slice(0,20):r;i(e=>({loading:!1,options:s,hasMore:o}))}return Promise.resolve()}),t=>(r.contents||(console.warn("[AutoUI] RefField "+e+" fetch failed",t),i(e=>({loading:!1,options:[],hasMore:!1}))),Promise.resolve()))}else r.contents||i(e=>({loading:!1,options:[],hasMore:!1}));return()=>{r.contents=!0}},[n,e,t]),r[0]}(g,p),S=x.options,w=x.loading,E=h(void 0);if(f)t="Search";else{let e=E.current;if(void 0!==e)t=e;else if(w)t="Inline";else{let e=x.hasMore?"Search":"Inline";E.current=e,t=e}}let k=s(()=>!1),C=k[1],A=k[0],N=s(()=>0),R=N[1],D=N[0],I=s(()=>""),F=I[1],O=I[0],P=s(()=>[!1,240]),M=P[1],L=P[0],B=h(null),$=h(null),q=!f&&""!==u&&!S.some(e=>e.id===u),G=function(e,t,n){let r=SI(),i=s(()=>{}),o=i[1];return a(()=>{let i={contents:!1},s=0;if(void 0!==r&&void 0!==t&&""!==t){let s="query($id: ID!) { "+e+"(id: $id) { "+("id"===n?"id":"id "+n)+" } }",a={};a.id=t,ce(r(s,a).then(r=>{if(!i.contents){let i=ft(r),s=U(j(j(i,e=>Je(e,"data")),ft),{}),a=Je(s,e),l=void 0!==a?a:j(i,t=>Je(t,e)),c=j(l,ft);if(void 0!==c){let e=U(j(Je(c,"id"),ut),t),r=U(j(Je(c,n),ut),e);o(t=>({id:e,label:r}))}else o(e=>{})}return Promise.resolve()}),e=>Promise.resolve())}else s=1;return 1===s&&o(e=>{}),()=>{i.contents=!0}},[r,t,n]),i[0]}(e.singleQueryField,q?u:void 0,p),V=e=>{let t=z(S.find(t=>t.id===e),e=>e.label),n=j(G,t=>{if(t.id===e)return t.label});return void 0!==t?t:void 0!==n?n:e};a(()=>{if(!A)return;let e=e=>{let t=e.target,n=B.current;if(null!=n&&!function(e,t){return e.contains(t)}(n,t))return C(e=>!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[A]),v(()=>{if(A){let e=B.current;null!=e&&M(t=>function(e){let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom-12,r=t.top-12,i=n<240&&r>n,o=i?r:n;return[i,Math.max(120,Math.min(240,o))]}(e))}},[A]);let K,W="Search"===t&&""!==O,H=function(e,t,n){let r=SI(),i=s(()=>({loading:!1,options:[],error:!1})),o=i[1];return a(()=>{if(""===n)return void o(e=>({loading:!1,options:[],error:!1}));let i={contents:!1};o(e=>({loading:!0,options:e.options,error:e.error}));let s=setTimeout(()=>{if(i.contents)return;if(void 0===r)return o(e=>({loading:!1,options:[],error:!1}));let s="id"===t?"id":"id "+t,a="query($q: String!) { "+e+"(first: "+20..toString()+", filter: {search: $q}) { edges { node { "+s+" } } } }",l={};l.q=n,ce(r(a,l).then(n=>{if(!i.contents){let r=Y1(n,e,t);o(e=>({loading:!1,options:r,error:!1}))}return Promise.resolve()}),t=>(i.contents||(console.warn("[AutoUI] RefField "+e+" search failed; falling back to client-side filter",t),o(e=>({loading:!1,options:[],error:!0}))),Promise.resolve()))},250);return()=>{i.contents=!0,clearTimeout(s)}},[r,n,e]),i[0]}(g,p,W?O:""),J=function(e,t){if(""===t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n))}(S,O),X=W&&!H.error?H.options:J,Q=X.length,Y=w||W&&H.loading,Z=e=>{let t=e2(u),n=t.some(t=>t===e)?t.filter(t=>t!==e):t.concat([e]);c(m,JSON.stringify(n.map(e=>e))),F(e=>""),R(e=>0);let r=$.current;null==r||r.focus()},ee=e=>{let t=X[e];if(void 0!==t){if(f)return Z(t.id);{let e=t.id;return c(m,e),C(e=>!1),F(e=>"")}}},te=e=>{switch(e.key){case"ArrowDown":return e.preventDefault(),A?R(e=>0===Q?0:fe(e+1|0,Q)):C(e=>!0);case"ArrowUp":return e.preventDefault(),R(e=>0===Q?0:fe((e-1|0)+Q|0,Q));case"Backspace":if(!f||""!==O)return;let t=e2(u);if(0===t.length)return;let n=t.slice(0,t.length-1|0);return c(m,JSON.stringify(n.map(e=>e)));case"Enter":return A?(e.preventDefault(),ee(D)):void 0;case"Escape":return A?C(e=>!1):void 0;default:return}},ne=A?r2+" "+i2:r2,re=_?ne+" "+o2:ne,ie=(0|L[1]).toString()+"px",oe=L[0]?{bottom:"100%",marginTop:"0",marginBottom:"2px",maxHeight:ie,top:"auto"}:{maxHeight:ie};if(Y)K=i("li",{children:"Loading…",className:p2});else if(0===Q)K=i("li",{children:""===O?"No options":"No matches",className:p2});else{let e=f?e2(u):""===u?[]:[u];K=X.map((t,n)=>{let r=e.some(e=>e===t.id),o=function(e){let t=e.length,n=0;for(let i=0;i<t;++i)n=n+e[i].length|0;let r=new Array(n);n=0;for(let i=0;i<t;++i){let t=e[i];for(let e=0,i=t.length;e<i;++e)r[n]=t[e],n=n+1|0}return r}([[d2],n===D?[f2]:[],r?[h2]:[]]).join(" ");return i("li",{children:t.label,"aria-selected":r,className:o,role:"option",onMouseDown:e=>{e.preventDefault(),ee(n)},onMouseEnter:e=>R(e=>n)},t.id)})}let se,ae=i("ul",{children:K,className:u2,role:"listbox",style:oe});return se="Inline"===t?i("button",{children:""===u?i("span",{children:d?"Select…":"—",className:s2}):V(u),className:re,autoFocus:b,type:"button",onKeyDown:te,onBlur:e=>y(),onClick:e=>C(e=>!e)}):r("div",{children:[f?e2(u).map(e=>r("span",{children:[V(e),i("span",{children:"×",className:l2,onClick:t=>{t.stopPropagation(),Z(e)}})],className:a2},e)):null,i("input",{ref:T($),className:c2,autoFocus:b,placeholder:d?"Search…":"—",type:"text",value:f||A?O:""===u?"":V(u),onKeyDown:te,onFocus:e=>C(e=>!0),onBlur:e=>y(),onChange:e=>{let t=e.target.value;F(e=>t)}})],className:re,onClick:e=>C(e=>!0)}),r("div",{children:[se,A?ae:null],ref:T(B),className:n2})};function m2(e){return e.pluginId+"."+e.slice+"."+e.command.name}function v2(e,t,n){return e}function y2(e,t,n){let r=void 0!==n?n:v2;return z(function(e,t,n,r){return j(e.find(e=>e.id===t),e=>{let t=e.aggregates.find(e=>e.name===n);return void 0!==t?z(t.commands.find(e=>e.name===r),n=>({plugin:e,enclosingAggregate:t,command:n})):j(e.stateChangeSlices.find(e=>e.name===n),t=>z(t.commands.find(e=>e.name===r),t=>({plugin:e,enclosingAggregate:void 0,command:t})))})}(t,e.pluginId,e.slice,e.command),t=>{let n=t.plugin,i=r(t.command,t.enclosingAggregate,n.id);return{label:U(e.label,i.label),pluginId:n.id,slice:e.slice,command:i,field:e.field,navigateTo:j(e.then,e=>""===e.trim()?void 0:e)}})}function _2(e,t){let n=e.refFields.find(e=>e.propertyKey===t);return void 0!==n?n.multi:"array"===U(j(j(j(z(j(j(j(ft(e.schema),e=>Je(e,"properties")),ft),e=>Je(e,t)),Mt),ft),e=>Je(e,"type")),ut),"")}function b2(e,t){return Ye([[e.field,_2(e.command,e.field)?t2([t]):t]])}function x2(e,t){return{command:e.command,initialValues:b2(e,t),navigateTo:e.navigateTo,formKey:e.command.name+":"+t}}function S2(e){return"var("+e+")"}let w2="168px",E2=lo([pi("flex"),gi("column"),ci("gap",S2(_t.sm))]),k2=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",S2(_t.sm))]),C2=lo([pi("inlineFlex"),ui("center"),ci("gap",S2(_t.xs))]),A2=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",S2(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",S2(yt.textSecondary)),ci("font-size",S2(bt.sizeSm)),hi("pointer"),Qi([ci("background",S2(yt.surfaceSubtle)),ci("color",S2(yt.textPrimary))])]),N2=co([A2,lo([ci("background",S2(yt.surfaceSubtle)),ci("color",S2(yt.textPrimary)),ci("font-weight",S2(bt.weightMedium))])]),T2=lo([ci("font-size",S2(bt.sizeMd)),ci("font-weight",S2(bt.weightMedium)),ci("color",S2(yt.textPrimary))]),R2=lo([ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",S2(xt.md)),ci("overflow","hidden")]),D2=lo([pi("flex"),ui("stretch")]),I2=co([D2,lo([ci("background",S2(yt.surfaceSubtle)),ci("border-bottom","1px solid var("+yt.borderSubtle+")")])]),F2=co([D2,lo([ci("border-top","1px solid var("+yt.borderSubtle+")")])]),O2=lo([ci("flex","0 0 "+w2),ci("padding","4px var("+_t.sm+")"),ci("font-size",S2(bt.sizeXs)),ci("color",S2(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),P2=lo([ci("flex","0 0 "+w2),ci("padding","6px var("+_t.sm+")"),ci("font-size",S2(bt.sizeSm)),ci("font-weight",S2(bt.weightMedium)),ci("color",S2(yt.textPrimary)),ci("border-right","1px solid var("+yt.borderSubtle+")"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),M2=co([P2,lo([ci("color",S2(yt.textDisabled)),ci("font-style","italic")])]);function L2(e){return lo([pi("grid"),ci("flex","1 1 auto"),ci("grid-template-columns","repeat("+e.toString()+", minmax(0, 1fr))")])}let z2=lo([ci("background",S2(yt.surfaceSubtle))]),j2=lo([ci("padding","4px var("+_t.xs+")"),ci("font-size",S2(bt.sizeXs)),ci("color",S2(yt.textSecondary)),ci("border-left","1px solid var("+yt.borderSubtle+")")]),U2=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-height","48px"),ci("padding","3px"),ci("border-left","1px solid var("+yt.borderSubtle+")")]),B2=co([U2,lo([ci("background",S2(yt.surfaceSubtle))])]);function $2(e){return lo([pi("block"),ci("width","100%"),ci("text-align","left"),ci("border","none"),ci("border-left","3px solid "+e),ci("border-radius",S2(xt.sm)),ci("background",S2(yt.surfaceSubtle)),ci("color",S2(yt.textPrimary)),ci("font-size",S2(bt.sizeXs)),ci("padding","1px var("+_t.xs+")"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap"),hi("pointer"),Qi([ci("background",S2(yt.surfaceElevated))])])}let q2=lo([hi("grab")]),G2=lo([Oi(.85),ci("z-index","10"),hi("grabbing")]),V2=lo([ci("font-size",S2(bt.sizeXs)),ci("color",S2(yt.textDisabled))]),K2="var("+yt.brand+")";function W2(e,t){return e.filter(e=>rc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function H2(e,t){return sc(e.start)||!tc(e.start,t)?e.title:oc(e.start)+" "+e.title}function J2(e){let t=e.draggable,n=e.event,r=nQ({id:n.key,disabled:!t}),o=t?$2(U(n.accent,K2))+" "+q2:$2(U(n.accent,K2)),s=r.isDragging?o+" "+G2:o,a=z(aQ(r.transform),e=>({transform:e})),l=r.listeners,c=null==l?void 0:T(l);return i("button",{children:H2(n,e.day),ref:T(r.setNodeRef),className:s,style:a,title:n.title,onKeyDown:e=>M(c,t=>sQ(t,e)),onClick:e=>n.onOpen(),onPointerDown:e=>M(c,t=>oQ(t,e))})}function X2(e){let t=e.draggable,n=e.today,o=e.days,s=e.lane,a=iQ({id:s.unassigned?"":s.resourceId}),l=!s.unassigned&&a.isOver?L2(o.length)+" "+z2:L2(o.length);return r("div",{children:[i("div",{children:s.label,className:s.unassigned?M2:P2}),i("div",{children:o.map(e=>i("div",{children:W2(s.events,e).map(n=>i(J2,{event:n,day:e,draggable:t},n.key)),className:e===n?B2:U2},e.toString())),ref:T(a.setNodeRef),className:l})],className:F2})}let Q2=function(e){let t,n=e.onReassign,o=e.initialDate,a=e.windowNote,l=e.lanes,c=s(()=>"Week"),u=c[1],d=c[0],f=s(()=>Xl(U(o,Date.now()))),h=f[1],p=f[0],g=Xl(Date.now()),m=$(n);t="Week"===d?pe(7,e=>Ql(Zl(p),e)):[Xl(p)];let v,y=e=>h(t=>Ql(t,"Week"===d?7*e|0:e)),_=(e,t)=>i("button",{children:t,className:d===e?N2:A2,onClick:t=>u(t=>e)});return v="Week"===d?lc(p):dc(p)+" — "+lc(p),r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:A2,onClick:e=>y(-1)}),i("button",{children:"Today",className:A2,onClick:e=>h(e=>g)}),i("button",{children:"›",className:A2,onClick:e=>y(1)}),i("span",{children:v,className:T2})],className:C2}),r("div",{children:[_("Week","Week"),_("Day","Day")],className:C2})],className:k2}),i(ZX,{onDragEnd:e=>{let t=e.over;if(void 0===n)return;if(null==t)return;if(""===t.id)return;let r=l.find(t=>t.events.some(t=>t.key===e.active.id));return L(r,!0,e=>e.resourceId!==t.id)?n(e.active.id,t.id):void 0},children:r("div",{children:[r("div",{children:[i("div",{children:"Resource",className:O2}),i("div",{children:t.map(e=>i("div",{children:dc(e),className:j2},e.toString())),className:L2(t.length)})],className:I2}),l.map(e=>i(X2,{lane:e,days:t,today:g,draggable:m},e.unassigned?"\0unassigned":e.resourceId))],className:R2})}),void 0!==a?i("span",{children:a,className:V2}):null],className:E2})};function Y2(e){switch(e){case"Hints":return"hints";case"DeclaredTarget":return"declared-target";case"SchemaTarget":return"schema-target";case"Setter":return"setter"}}function Z2(e,t){return e+"→"+t}function e3(e){return U(z(j(j(ft(e),e=>Je(e,"properties")),ft),e=>Object.keys(e)),[])}function t3(e){return me(U(j(j(ft(e),e=>Je(e,"required")),ht),[]),ut).filter(e=>"TAG"!==e)}function n3(e){return e.filter(e=>"Instance"===e.level)}function r3(e,t){let n=e.allowedStates;return void 0===n||0===n.length||n.includes(t)}function i3(e){let t=e.allowedStates,n=e.targetState;return void 0!==t&&void 0===n}function o3(e,t,n){return e3(e.schema).includes(t)?Ye([[t,n]]):{}}function s3(e){return 1!==e.length?void 0:e[0]}function a3(e,t,n){let r=n3(t),i=function(e,t){let n=e.filter(e=>!(i3(e)||!e3(e.schema).includes(t))&&t3(e.schema).every(n=>n===t||"id"===n||mt(n,e.aggregateIdField)));return 1!==n.length?void 0:n[0]}(r,e);return(t,o)=>{let s=(n,r)=>{if(r3(n,t))return{command:n.name,patch:o3(n,e,o),tier:r}},a=j(j(j(n,e=>e[o]),e=>r.find(t=>t.name===e)),e=>s(e,"Hints"));if(void 0!==a)return a;let l=j(s3(r.filter(e=>!!r3(e,t)&&mt(e.targetState,o))),e=>s(e,"DeclaredTarget"));if(void 0!==l)return l;let c=j(s3(r.filter(n=>!(i3(n)||!r3(n,t))&&mt(function(e,t){let n=j(j(j(ft(e),e=>Je(e,"properties")),ft),e=>Je(e,t));if(void 0===n)return;let r=j(j(ft(n),e=>Je(e,"const")),ut);if(void 0!==r)return r;let i=Us(n);return void 0!==i&&1===i.length?i[0]:void 0}(n.schema,e),o))),e=>s(e,"SchemaTarget"));return void 0!==c?c:j(i,e=>s(e,"Setter"))}}function l3(e,t,n,r){let i=a3(t,n,r),o=Bs(e,t),s={};return o.forEach(e=>{o.forEach(t=>M(i(e,t),n=>{s[Z2(e,t)]=n}))}),s}function c3(e,t,n){let r=t+"→",i=me(Object.entries(e),e=>{let t=e[0];if(e[1].command===n&&t.startsWith(r))return t.slice(r.length)});return 1!==i.length?void 0:i[0]}let u3="resources",d3="events";function f3(e){return e.filter(e=>mt(e.role,d3))}function h3(e,t){return j(Je(e,t),ut)}function p3(e){let t=function(e){return e.find(e=>mt(e.role,u3))}(e),n=f3(e),r=void 0!==t?t.rows.map(e=>{let n=U(ft(e),{}),r=U(h3(n,"id"),""),i=U(j(t.semantics.labelField,e=>h3(n,e)),r);return[r,i]}):[],i=r.map(e=>e[0]),o=n.map((e,t)=>me(e.rows,n=>{let r=U(ft(n),{}),i=U(h3(r,"id"),""),o=e.semantics.dateSpan;if(void 0!==o)return z(j(ca(o,r),fc),s=>{let a=j(ua(o,r),fc),l=U(j(e.semantics.labelField,e=>h3(r,e)),i),c=U(j(e.resourceRef,e=>h3(r,e)),""),u=function(e,t){return e.toString()+"::"+t}(t,i);return[c,{key:u,title:l,start:s,end_:a,accent:e.accent,onOpen:()=>e.onOpenRow(i,n)}]})})).flat(),s=e=>me(o,t=>{if(e(t[0]))return t[1]}),a=r.map(e=>{let t=e[0];return{resourceId:t,label:e[1],unassigned:!1,events:s(e=>e===t)}}),l=s(e=>!i.includes(e)),c=0!==l.length?[{resourceId:"",label:"Unassigned",unassigned:!0,events:l}]:[];return a.concat(c)}function g3(e){let t=e.sources,n=p3(t),r=f3(t),o=r.some(e=>!(!$(e.onCommand)||!$(e.assignCommand))&&$(e.resourceRef)),s=o?(e,t)=>M(function(e){let t=e.indexOf("::");if(-1!==t)return z(ye(e.slice(0,t)),n=>[n,e.slice(t+2|0)])}(e),e=>{let n=e[1];M(r[e[0]],e=>{let r=e.onCommand,i=e.assignCommand,o=e.resourceRef;if(void 0!==r&&void 0!==i&&void 0!==o)return r(i,n,Ye([[o,t]]))})}):void 0,a=ge(r,0,(e,t)=>e+t.rows.length|0),l=zo(QI(t),a,void 0,"scheduled item");return i(Q2,{lanes:n,windowNote:l,onReassign:s})}let m3=i("span",{children:"☰","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),v3="scheduler";function y3(e){return!!$(za(e,void 0,void 0).dateSpan)&&_a(e).some(e=>$(JD(e[0])))}function _3(e,t){let n=e.filter(e=>"Instance"===e.level).filter(e=>!!e3(e.schema).includes(t)&&t3(e.schema).every(n=>n===t||"id"===n||mt(n,e.aggregateIdField)));if(1===n.length)return n[0].name}function b3(e){return"var("+e+")"}WI({id:v3,label:"Scheduler",icon:m3,arity:{TAG:"Slots",_0:[{role:u3,min:1,max:1},{role:d3,min:1}]},isCapable:(e,t,n)=>y3(e),render:e=>i(g3,{sources:e}),capability:"role join: a resources source (lanes) + an events source with a date span and an entity-ref to the resource"});let x3=lo([pi("inlineFlex"),ui("center"),ci("gap","6px"),ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",b3(xt.full)),ci("padding","2px var("+_t.sm+")"),ci("color",b3(yt.textSecondary)),ci("font-size",b3(bt.sizeXs)),ci("line-height","1.5")]),S3=lo([hi("pointer"),Qi([ci("background",b3(yt.surfaceSubtle)),ci("color",b3(yt.textPrimary))])]),w3=lo([Oi(.6),hi("notAllowed")]),E3=lo([Wi(Ct.compact,[ci("display","none")])]);function k3(e){return lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",e)])}let C3=k3(b3(yt.success)),A3=k3(b3(yt.border)),N3=k3(b3(yt.border)),T3=uo([[0,[Oi(.4)]],[50,[Oi(1)]],[100,[Oi(.4)]]]),R3=lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",b3(yt.warning)),no(T3),ro({NAME:"ms",VAL:1200}),io("infinite"),oo("easeInOut")]);let D3=function(e){let t=e.onToggle,n=e.reconnecting,o=e.canBeLive,s=e.live,a=void 0!==n&&n,l=o?s&&a?[x3+" "+S3,R3,"Reconnecting…"]:s?[x3+" "+S3,C3,"Live"]:[x3+" "+S3,A3,"Snapshot"]:[x3+" "+w3,N3,"Off"],c=l[2],u=o?e=>t():void 0,d=o?s&&a?"Live updates on — reconnecting to the server":s?"Live updates on — click for snapshot mode":"Snapshot mode — click for live updates":"Live updates disabled globally";return r("button",{children:[i("span",{className:l[1]}),i("span",{children:c,className:E3})],"aria-label":"Live updates: "+c,className:l[0],title:d,disabled:!o,type:"button",onClick:u})};function I3(e){return"var("+e+")"}let F3=lo([pi("inlineFlex"),ui("center"),ci("gap","6px"),ci("background",I3(yt.brand)),ci("color",I3(yt.textOnBrand)),ci("border","none"),ci("border-radius",I3(xt.full)),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("font-size",I3(bt.sizeSm)),ci("font-weight",I3(bt.weightMedium)),hi("pointer"),Qi([ci("opacity","0.85")])]),O3=lo([pi("flex"),ui("center"),bi("center"),ci("padding","var("+_t.xs+") 0")]);let P3=function(e){let t=e.onClick,n=e.count,r=1===n?"1 new item — click to refresh":n.toString()+" new items — click to refresh";return i("div",{children:i("button",{children:r,className:F3,type:"button",onClick:e=>t()}),className:O3})};function M3(e,t,n,r,i,o){let l=void 0!==t?t:{},c=void 0!==n?n:"",u=void 0===r||r,d=void 0!==i?i:()=>{},f=SI(),h=wI(),p=s(()=>[]),g=p[1],m=s(()=>EI),v=m[1],y=m[0],_=s(()=>"Loading"),b=_[1],x=s(()=>0),S=x[1],w=s(()=>1),E=w[1],k=w[0],C=void 0!==h?(t,n)=>h(t,n).then(t=>[t.data,GO(t,e.queryField)]):void 0!==f?(e,t)=>f(e,t).then(e=>[e,void 0]):void 0;return a(()=>{if(u)if(void 0!==C){let t;if(b(e=>"Loading"),d(),void 0!==o){let e=Ye(L(ft(l),[],Xe));e.first=o*k|0,t=e}else t=l;ce(C(e.queryDocument,t).then(t=>{let n=t[1],r=t[0];return void 0!==n?b(e=>({TAG:"Refused",_0:n.message})):(g(t=>CI(r,e.queryField)),v(t=>NI(r,e.queryField)),b(e=>"Loaded")),Promise.resolve()}),e=>(b(e=>({TAG:"Error",_0:"Failed to load data"})),Promise.resolve()))}else b(e=>({TAG:"Error",_0:"Not connected"}));else b(e=>"Loaded")},[x[0],c,u,k]),{rows:p[0],setRows:g,pageInfo:y,fetchState:_[0],refetch:()=>S(e=>e+1|0),loadMore:()=>E(e=>e+1|0),canLoadMore:y.hasNextPage}}function L3(e,t,n){let r=void 0===t||t,i=M3(e,void 0,void 0,r,void 0,50),o=h(void 0),s=h(H1.make()),a=h(Q1.make()),l=gO(),c=r&&L(l,!1,t=>t.isLive(e.queryField));return nW(e.queryField,"All",c,t=>{if(!H1.shouldApply(s.current,t.id,t.seq))return;H1.record(s.current,t.id,t.seq);let n,r=t.changeKind;return n="Updated"===r?j(i.rows.find(e=>mt(O1(e),t.id)),n=>Q1.apply(a.current,n,t,e.schema)):void 0,void 0!==n?i.setRows(e=>e.map(e=>mt(O1(e),t.id)?n:e)):(()=>{let e=o.current;void 0!==e&&clearTimeout(e),o.current=setTimeout(()=>{o.current=void 0,i.refetch()},250)})()},i.refetch),{rows:i.rows,fetchState:i.fetchState,refetch:i.refetch,isLive:c,loadMore:i.loadMore,canLoadMore:i.canLoadMore}}function z3(){try{return R(globalThis.localStorage)}catch(e){return}}let j3="reventless.live.";function U3(e){let t=z3();if(void 0===t)return!1;try{let n=D(t).getItem(j3+e);return null!=n&&"true"===n}catch(n){return!1}}function B3(e){let t=s(()=>U3(e)),n=t[1],r=t[0];a(()=>{n(t=>U3(e))},[e]);let i=f(()=>{let t=!r;!function(e,t){let n=z3();if(void 0!==n)try{return void D(n).setItem(j3+e,t?"true":"false")}catch(r){return}}(e,t),n(e=>t)},[r,e]);return[r,i]}function $3(e){switch(e.TAG){case"Invalid":return e._1;case"Valid":case"Pending":return 0}}function q3(e){return[e._0,$3(e)]}function G3(e,t){return we(t,e,(e,t)=>t(e))}function V3(e){switch(e.TAG){case"Invalid":return e;case"Valid":case"Pending":return{TAG:"Valid",_0:e._0}}}function K3(e){if(!e.includes("."))return e;let t=e.replace(/0+$/,"");return t.endsWith(".")?t.slice(0,t.length-1|0):t}function W3(e){let t=q3(e),n=t[0];return isFinite(n)&&(0|n)===n?V3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a whole number",tl:t[1]}}}function H3(e,t){let n=z(Je(e,t),ct);if("object"==typeof n&&"JSONNumber"===n.TAG)return 0|n._0}function J3(e,t){let n=z(Je(e,t),ct);if("object"==typeof n&&"JSONNumber"===n.TAG)return n._0}function X3(e,t){let n=z(Je(e,t),ct);if("object"==typeof n&&"JSONString"===n.TAG)return n._0}function Q3(e){let t=H3(e,"minLength"),n=H3(e,"maxLength"),r=z(X3(e,"pattern"),e=>new RegExp(e)),i=function(e){let t=X3(e,"format");if("cuid"===X3(e,"x-reventless-format"))return"Cuid";if(void 0!==t)switch(t){case"date-time":return"DateTime";case"email":return"Email";case"uri":return"Url";case"uuid":return"Uuid";default:return}}(e);return{minLength:t,maxLength:n,pattern:r,format:i,patternHint:X3(e,"description")}}function Y3(e,t){return{min:J3(e,"minimum"),max:J3(e,"maximum"),integer:t}}function Z3(e){return{minItems:H3(e,"minItems"),maxItems:H3(e,"maxItems")}}function e4(e){if("object"!=typeof e)return!1;switch(e.TAG){case"TextField":case"NumberField":case"EnumField":case"RefField":case"ItemsField":return e.required}}function t4(e){let t=e.indexOf("[]");if(-1===t)return;let n=e.slice(0,t),r=e.slice(t+2|0),i=r.startsWith(".")?r.slice(1):r;return""===n||""===i||i.includes("[]")?void 0:[n,i]}function n4(e){return j(Je(e,"items"),e=>{let t=j(ft(e),e=>Je(e,"type"));if(void 0!==t&&mt(ut(t),"object"))return e})}function r4(e,t){let n={},r={};(void 0!==t?t:[]).forEach(e=>{let t=t4(e.propertyKey);if(void 0!==t){let n=t[0],i=U(Je(r,n),[]);return i.push({propertyKey:t[1],queryField:e.queryField,singleQueryField:e.singleQueryField,labelField:e.labelField,multi:e.multi,required:e.required,entityName:e.entityName,entityNamePlural:e.entityNamePlural}),void(r[n]=i)}n[e.propertyKey]=e});let i=ct(e);if("object"!=typeof i)return[];if("JSONObject"!==i.TAG)return[];let o,s=i._0,a=Je(s,"required");if(void 0!==a){let e=ct(a);o="object"!=typeof e?[]:"JSONArray"===e.TAG?me(e._0,e=>{let t=ct(e);return"object"!=typeof t||"JSONString"!==t.TAG?void 0:t._0}):[]}else o=[];let l=Je(s,"properties");if(void 0===l)return[];let c=ct(l);return"object"!=typeof c?[]:"JSONObject"===c.TAG?me(Xe(c._0),e=>{let t=e[1],i=e[0],s=ct(t);if("object"!=typeof s)return;if("JSONObject"!==s.TAG)return;let a=s._0;if($(Je(a,"const")))return;let l,c=Je(a,"type");if(void 0!==c){let e=ct(c);l="object"!=typeof e||"JSONString"!==e.TAG?"string":e._0}else l="string";let u,d=o.some(e=>e===i),f=Je(n,i);if(void 0!==f)u=f.multi?f.entityNamePlural:f.entityName;else{let e=Je(a,"title");if(void 0!==e){let t=ct(e);u="object"!=typeof t||"JSONString"!==t.TAG?at(i):t._0}else u=at(i)}let h,p,g=Je(a,"enum");if(void 0!==g){let e=ct(g);h="object"!=typeof e||"JSONArray"!==e.TAG?void 0:me(e._0,e=>{let t=ct(e);return"object"!=typeof t||"JSONString"!==t.TAG?void 0:t._0})}else h=void 0;if(void 0!==f)p={TAG:"RefField",queryField:f.queryField,singleQueryField:f.singleQueryField,labelField:f.labelField,multi:f.multi,required:d,constraints:f.multi?Z3(a):{}};else if("boolean"===l)p="BoolField";else if(void 0!==h)p={TAG:"EnumField",options:h,required:d};else switch(l){case"array":let e=n4(a);p=void 0!==e?{TAG:"ItemsField",itemSchema:e,itemRefFields:U(Je(r,i),[]),required:d}:{TAG:"TextField",required:d,constraints:Q3(a)};break;case"integer":p={TAG:"NumberField",required:d,constraints:Y3(a,!0)};break;case"number":p={TAG:"NumberField",required:d,constraints:Y3(a,!1)};break;default:p={TAG:"TextField",required:d,constraints:Q3(a)}}return z(p,e=>({key:i,label:u,fieldType:e,propSchema:t}))}):[]}function i4(e){let t={};return e.forEach(e=>{let n,r=e.fieldType;if("object"!=typeof r)n="false";else switch(r.TAG){case"EnumField":n=U(r.options[0],"");break;case"ItemsField":n="[]";break;default:n=""}t[e.key]=n}),t}function o4(e,t){return j(z(Je(e,t),Mt),ft)}function s4(e,t){let n=function(e){return U(j(j(ft(e),e=>Je(e,"properties")),ft),{})}(e),r=AO(e),i={};return Xe(t).forEach(e=>{let t=e[1],o=e[0],s=function(e,t){return U(j(j(o4(e,t),e=>Je(e,"type")),ut),"string")}(n,o),a=function(e,t){return $(j(j(o4(e,t),e=>Je(e,"enum")),ht))}(n,o),l=""===t&&(e=>void 0!==r&&!r.includes(e))(o)&&(a||"string"!==s);l||(i[o]=function(e,t,n){let r=0,i=0,o=0;if(""===n){if(void 0!==t&&t)return null;o=3}else o=3;if(3===o)switch(e){case"array":if(""===n)return[];try{return JSON.parse(n)}catch(s){return[n]}case"boolean":case"integer":case"number":case"object":i=2;break;default:r=1}if(2===i){if(""===n)return null;r=1}if(1===r){let t=0;switch(e){case"boolean":return"true"===n;case"integer":case"number":t=2;break;case"object":try{return JSON.parse(n)}catch(a){return null}default:return n}if(2===t)return U(z(ea(n),e=>e),n)}}(s,a,t))}),i}function a4(e){let t={};return M(ft(e),e=>{Xe(e).forEach(e=>{t[e[0]]=function(e){let t=ct(e);if("object"!=typeof t)switch(t){case"JSONFalse":return"false";case"JSONTrue":return"true";case"JSONNull":return""}else switch(t.TAG){case"JSONString":return t._0;case"JSONNumber":return t._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}(e[1])})}),t}let l4=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function c4(e){let t=q3(e),n=t[0];return null!==l4.exec(n)?V3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid email address",tl:t[1]}}}function u4(e){let t,n=q3(e),r=n[0];try{new URL(r),t=!0}catch(i){t=!1}return t?V3(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid URL",tl:n[1]}}}let d4=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function f4(e){let t=q3(e),n=t[0];return null!==d4.exec(n)?V3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid UUID",tl:t[1]}}}let h4=/^c[a-z0-9]{23,24}$/;function p4(e){let t=q3(e),n=t[0];return null!==h4.exec(n)?V3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid CUID",tl:t[1]}}}function g4(e){let t=q3(e),n=t[0],r=Date.parse(n);return Number.isNaN(r)?{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid ISO 8601 date-time",tl:t[1]}}:V3(e)}function m4(e){let t=$3(e);if(0!==t)return t.hd}function v4(e,t,n){if(""===e)return t?function(e){let t=q3(e),n=t[0];return n.length>0?V3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must not be empty",tl:t[1]}}}({TAG:"Pending",_0:e}):{TAG:"Valid",_0:e};let r=[];return M(n.minLength,e=>{r.push(function(e){return t=>{let n=q3(t),r=n[0];return r.length>=e?V3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+e.toString()+" characters",tl:n[1]}}}}(e))}),M(n.maxLength,e=>{r.push(function(e){return t=>{let n=q3(t),r=n[0];return r.length<=e?V3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+e.toString()+" characters",tl:n[1]}}}}(e))}),M(n.format,e=>{r.push(function(e){switch(e){case"Email":return c4;case"Url":return u4;case"Uuid":return f4;case"Cuid":return p4;case"DateTime":return g4}}(e))}),M(n.pattern,e=>{r.push(function(e,t){return n=>{let r=q3(n),i=r[0];return null!==e.exec(i)?V3(n):{TAG:"Invalid",_0:i,_1:{hd:U(t,"Does not match the required pattern"),tl:r[1]}}}}(e,n.patternHint))}),0===r.length?{TAG:"Valid",_0:e}:G3({TAG:"Pending",_0:e},be(r))}function y4(e,t,n){if(""===e)return t?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e};let r=ea(e);if(void 0===r)return{TAG:"Invalid",_0:e,_1:{hd:"Must be a number",tl:0}};let i=[];U(n.integer,!1)&&i.push(W3),M(n.min,e=>{i.push(function(e){return t=>{let n=q3(t),r=n[0];return r>=e?V3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+K3(e.toString()),tl:n[1]}}}}(e))}),M(n.max,e=>{i.push(function(e){return t=>{let n=q3(t),r=n[0];return r<=e?V3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+K3(e.toString()),tl:n[1]}}}}(e))});let o=$3(G3({TAG:"Pending",_0:r},be(i)));return 0!==o?{TAG:"Invalid",_0:e,_1:o}:{TAG:"Valid",_0:e}}function _4(e,t){return t&&""===e?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e}}function b4(e,t){let n=e.propSchema;if(void 0!==n&&function(e,t){return L(mD(e,t),!1,e=>$(e.input))}(e.key,n)){let r=e4(e.fieldType),i=function(e,t,n,r){return j(j(mD(e,t),e=>e.validateInput),i=>i(e,t,n,r))}(e.key,n,t,r);return void 0!==i?{TAG:"Invalid",_0:t,_1:{hd:i,tl:0}}:{TAG:"Valid",_0:t}}let r=e.fieldType;if("object"!=typeof r)return{TAG:"Valid",_0:t};switch(r.TAG){case"TextField":return v4(t,r.required,r.constraints);case"NumberField":return y4(t,r.required,r.constraints);case"EnumField":return _4(t,r.required);case"RefField":return r.multi?function(e,t,n){let r=e2(e).length;if(0===r&&t)return{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}};let i={contents:0};return M(n.maxItems,e=>{r>e&&(i.contents={hd:"Select at most "+e.toString()+" items",tl:i.contents})}),M(n.minItems,e=>{r<e&&(t||r>0)&&(i.contents={hd:"Select at least "+e.toString()+" items",tl:i.contents})}),0!==i.contents?{TAG:"Invalid",_0:e,_1:i.contents}:{TAG:"Valid",_0:e}}(t,r.required,r.constraints):_4(t,r.required);case"ItemsField":return function(e,t,n,r){let i;if(""===e)i=[];else try{i=ht(JSON.parse(e))}catch(a){i=void 0}if(void 0===i)return{TAG:"Invalid",_0:e,_1:{hd:"Not a valid list",tl:0}};if(0===i.length)return t?{TAG:"Invalid",_0:e,_1:{hd:"Add at least one row",tl:0}}:{TAG:"Valid",_0:e};let o=r4(n,r),s=me(i.map((e,t)=>{let n=a4(e);return me(o,e=>z(m4(b4(e,U(Je(n,e.key),""))),e=>"Row "+(t+1|0).toString()+": "+e))[0]}),e=>e);return 0!==s.length?{TAG:"Invalid",_0:e,_1:be(s)}:{TAG:"Valid",_0:e}}(t,r.required,r.itemSchema,r.itemRefFields)}}function x4(e){return"var("+e+")"}let S4=lo([pi("flex"),gi("column"),ci("gap",x4(_t.md))]),w4=lo([pi("flex"),gi("column"),ci("gap","4px")]),E4=lo([ci("color",x4(yt.textSecondary)),ci("font-size",x4(bt.sizeSm)),ci("font-weight",x4(bt.weightMedium))]),k4=lo([ci("color",x4(yt.error)),Ci(eo(2))]),C4=lo([ci("background",x4(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",x4(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("font-size",x4(bt.sizeMd)),ci("color",x4(yt.textPrimary)),ci("outline","none"),Gi({NAME:"percent",VAL:100}),ci("transition","border-color 120ms, box-shadow 120ms"),Ji([ci("border-color",x4(yt.brand))])]),A4=lo([ci("border-color",x4(yt.error)),Ji([ci("border-color",x4(yt.error)),ci("box-shadow","0 0 0 2px color-mix(in srgb, var("+yt.error+") 25%, transparent)")])]),N4=lo([ci("color",x4(yt.error)),ci("font-size",x4(bt.sizeXs)),ci("min-height","1.1em"),ci("line-height","1.1"),Ni(eo(2))]),T4=lo([hi("pointer"),Ai(eo(6))]),R4=lo([ci("background",x4(yt.brand)),ci("color",x4(yt.textOnBrand)),ci("border","none"),ci("border-radius",x4(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("font-size",x4(bt.sizeMd)),hi("pointer"),di("flexStart"),ci("transition","opacity 120ms")]),D4=lo([Oi(.5),hi("notAllowed")]),I4=lo([pi("flex"),gi("column"),ci("gap",x4(_t.sm)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",x4(xt.sm)),ci("padding",x4(_t.sm))]),F4=lo([ci("color",x4(yt.textSecondary)),ci("font-size",x4(bt.sizeSm))]),O4=lo([pi("flex"),ui("flexStart"),ci("gap",x4(_t.sm)),ci("padding-bottom",x4(_t.sm)),ci("border-bottom","1px solid var("+yt.border+")")]),P4=lo([pi("flex"),yi("wrap"),ci("gap",x4(_t.sm)),mi(1),Fi(eo(0))]),M4=lo([ci("background",x4(yt.surface)),ci("color",x4(yt.textPrimary)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",x4(xt.sm)),ci("padding","var("+_t.xs+") var("+_t.sm+")"),ci("font-size",x4(bt.sizeSm)),hi("pointer")]),L4=lo([ci("margin-top","1.4em")]),z4=lo([di("flexStart")]);function j4(e){let t=e.error;return r("div",{children:[r("label",{children:[e.label,e.required?i("span",{children:"*",className:k4}):null],className:E4}),e.children,i("div",{children:void 0!==t?t:null,className:N4})],className:w4})}function U4(e){let t=e.autoFocus,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value,l=e.field,c=void 0!==n&&n,u=void 0!==t&&t,d=e4(l.fieldType),f=c?C4+" "+A4:C4,h=e=>o(l.key),p=l.propSchema,g=void 0!==p?function(e,t,n,r,i,o,s){return z(j(mD(e,t),e=>e.input),a=>a(e,t,n,r,i,o,s))}(l.key,p,a,e=>s(l.key,e),()=>o(l.key),d,c):void 0;if(void 0!==g)return g;let m=l.fieldType;if("object"!=typeof m)return r("label",{children:[i("input",{className:T4,checked:"true"===a,type:"checkbox",onBlur:h,onChange:e=>s(l.key,e.target.checked?"true":"false")}),"Enabled"],className:E4});switch(m.TAG){case"TextField":let e,t=m.constraints.format;if(void 0!==t)switch(t){case"Email":e="email";break;case"Url":e="url";break;default:e="text"}else e="text";return i("input",{className:f,autoFocus:u,type:e,value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"NumberField":return i("input",{className:f,autoFocus:u,type:"number",value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"EnumField":return i("select",{children:m.options.map(e=>i("option",{children:e,value:e},e)),className:f,value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)});case"RefField":return i(g2,{fieldKey:l.key,queryField:m.queryField,singleQueryField:m.singleQueryField,labelField:m.labelField,multi:m.multi,required:m.required,value:a,onChange:s,onBlur:()=>o(l.key),hasError:c,autoFocus:u});case"ItemsField":return i("input",{className:f,autoFocus:u,type:"text",value:a,onBlur:h,onChange:e=>s(l.key,e.target.value)})}}function B4(e){let t=e.showError,n=e.onBlur,o=e.onChange,s=e.itemRefFields,a=e.itemSchema,l=e.fieldKey,c=p(()=>r4(a,s),[a,s]),u=function(e,t){let n,r=i4(t);if(""===e)n=[];else{let t;try{t=ht(JSON.parse(e))}catch(i){t=void 0}n=void 0!==t?t:[]}return n.map(e=>{let t=Ye(Xe(r));return Xe(a4(e)).forEach(e=>{t[e[0]]=e[1]}),t})}(e.value,c),d=e=>o(l,function(e,t){return JSON.stringify(e.map(e=>s4(t,e)))}(e,a));return r("div",{children:[0===u.length?i("div",{children:"No rows yet.",className:F4}):null,u.map((e,o)=>r("div",{children:[i("div",{children:c.map(r=>{let s=U(Je(e,r.key),""),a=t?m4(b4(r,s)):void 0;return i(j4,{label:r.label,required:e4(r.fieldType),error:a,children:i(U4,{field:r,value:s,onChange:(e,t)=>d(u.map((n,r)=>{if(r!==o)return n;let i=Ye(Xe(n));return i[e]=t,i})),onBlur:e=>n(l),hasError:$(a)})},r.key)}),className:P4}),i("button",{children:"Remove","aria-label":"Remove row "+(o+1|0).toString(),className:M4+" "+L4,type:"button",onClick:e=>d(u.filter((e,t)=>t!==o))})],className:O4},o.toString())),i("button",{children:"Add row",className:M4+" "+z4,type:"button",onClick:e=>d(u.concat([i4(c)]))})],className:I4})}function $4(e){let t,n=e.autoFocus,r=e.showError,o=e.errorMessage,s=e.onBlur,a=e.onChange,l=e.value,c=e.field,u=void 0!==r&&r,d=void 0!==n&&n,f=e4(c.fieldType),h=u&&$(o),p=c.fieldType,g=0;return"object"!=typeof p||"ItemsField"!==p.TAG?g=1:t=i(B4,{fieldKey:c.key,itemSchema:p.itemSchema,itemRefFields:p.itemRefFields,value:l,onChange:a,onBlur:s,showError:u}),1===g&&(t=i(U4,{field:c,value:l,onChange:a,onBlur:s,hasError:h,autoFocus:d})),i(j4,{label:c.label,required:f,error:h?o:void 0,children:t})}let q4=function(e){let t=e.refFields,n=e.initialValues,o=e.submitLabel,a=e.onSubmit,l=e.schema,c=void 0!==o?o:"Submit",u=void 0!==t?t:[],d=p(()=>r4(l,u),[l,u]),f=s(()=>{let e=i4(d);return M(n,t=>{Xe(t).forEach(t=>{e[t[0]]=t[1]})}),e}),h=f[1],g=f[0],m=s(()=>({})),v=m[1],y=m[0],_=s(()=>!1),b=_[1],x=_[0],S=p(()=>d.map(e=>{let t=U(Je(g,e.key),"");return[e.key,b4(e,t)]}),[d,g]),w=S.every(e=>function(e){return function(e){switch(e.TAG){case"Valid":return!0;case"Invalid":case"Pending":return!1}}(e)}(e[1])),E={};S.forEach(e=>{let t=m4(e[1]);void 0===t||(E[e[0]]=t)});let k=(e,t)=>h(n=>{let r=Ye(Xe(n));return r[e]=t,r}),C=e=>v(t=>{let n=Ye(Xe(t));return n[e]=!0,n}),A=x&&!w,N=A?R4+" "+D4:R4;return r("form",{children:[d.map((e,t)=>{let n=U(Je(y,e.key),!1);return i($4,{field:e,value:U(Je(g,e.key),""),onChange:k,onBlur:C,errorMessage:Je(E,e.key),showError:n||x,autoFocus:0===t},e.key)}),i("button",{children:c,className:N,disabled:A,type:"submit"})],className:S4,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),b(e=>!0),w)return a(g)}})};function G4(e){switch(e){case"SubmitStarted":return!1;case"FormOpened":case"SubmitFailed":return!0}}let V4=l(void 0),K4=V4.Provider;let W4=function(e){return c(K4,{value:e.session,children:e.children})};let H4=lo([pi("flex"),gi("column"),ci("gap",function(e){return"var("+e+")"}(_t.md))]);let J4=function(e){let t=e.submitLabel,n=e.onSubmit,o=e.refFields,a=e.ownerValue,l=e.ownerField,c=e.injectNewId,u=e.aggregateIdField,d=e.aggregateId,f=e.schema,g=void 0!==c&&c,m=void 0!==o?o:[],v=void 0!==t?t:"Submit",y=s(()=>{}),_=y[1],b=s(()=>!1),x=b[1],S=s(()=>crypto.randomUUID())[0],w=h(G4("FormOpened")),E=p(()=>({armed:w}),[]),k=void 0!==l&&void 0!==a?[l,a]:void 0,C=me([void 0!==d?void 0!==u||g?u:void 0:g?u:void 0,z(k,e=>e[0])],e=>e),A=0===C.length?f:U(z(ft(f),e=>{let t=Ye(Xe(e));return M(j(Je(t,"properties"),ft),e=>{let n=Ye(Xe(e).filter(e=>!C.includes(e[0])));t.properties=n}),t}),f);return i(W4,{session:E,children:r("div",{children:[L(y[0],null,e=>i(qK,{variant:"Error",message:e})),b[0]?i(I1,{label:"Submitting..."}):null,i(q4,{schema:A,onSubmit:e=>{let t=Ye(Xe(e));M(k,e=>{t[e[0]]=e[1]}),M(d,e=>{t[U(u,"id")]=e}),g&&(t[U(u,"id")]=S),x(e=>!0),_(e=>{}),w.current=G4("SubmitStarted"),n(t).then(e=>{if(x(e=>!1),"object"==typeof e){let t=e._0;w.current=G4("SubmitFailed"),_(e=>t)}return Promise.resolve()})},submitLabel:v,initialValues:e.initialValues,refFields:m})],className:H4})})};function X4(e){let t=Xe(e).filter(e=>""!==e[1]).toSorted((e,t)=>function(e,t){return e===t?0:e<t?-1:1}(e[0],t[0]));return 0===t.length?"":"?"+t.map(e=>encodeURIComponent(e[0])+"="+encodeURIComponent(e[1])).join("&")}function Q4(e,t){let n=t.filter(e=>""===e[1]).map(e=>e[0]),r=t.filter(e=>""!==e[1]),i=Xe(e).filter(e=>{let t=e[0];return!n.includes(t)&&!r.some(e=>e[0]===t)});return Ye(i.concat(r))}function Y4(){let e=Q(),t=function(e){let t={},n=e.startsWith("?")?e.slice(1):e;return""===n||n.split("&").forEach(e=>{let n=e.split("="),r=n.length;if(!(r>=3))switch(r){case 0:return;case 1:let e=n[0];return""!==e?void(t[decodeURIComponent(e)]=""):void 0;case 2:let r=n[0],i=n[1];return""!==r?void(t[decodeURIComponent(r)]=decodeURIComponent(i)):void 0}}),t}(e.search),n=function(e){if(0===e.path)return"/";let t=[];return function(e,t){for(;;){let n=e;if(0===n)return;t(n.hd),e=n.tl}}(e.path,e=>{t.push(e)}),"/"+t.join("/")}(e),r=""===e.hash?"":"#"+e.hash,i=e=>{let t=X4(e);J(n+t+r)};return{params:t,get:e=>Je(t,e),set:(e,n)=>i(Q4(t,[[e,n]])),setMany:e=>i(Q4(t,e))}}let Z4=l(void 0),e5=Z4.Provider;let t5=function(e){return c(e5,{value:e.chrome,children:e.children})};function n5(e){return"var("+e+")"}let r5=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",n5(_t.md)),mi(1),ci("min-height","160px"),Bi("center"),ci("padding",n5(_t.lg))]),i5=lo([ci("font-size","32px"),ci("color",n5(yt.warning)),ci("line-height","1")]),o5=lo([ci("color",n5(yt.textPrimary)),ci("font-size",n5(bt.sizeLg)),ci("font-weight",n5(bt.weightMedium)),Ei(eo(0))]),s5=lo([ci("color",n5(yt.textSecondary)),ci("font-size",n5(bt.sizeSm)),ci("line-height",n5(bt.lineHeightNormal)),ci("max-width","440px"),Ei(eo(0))]),a5=lo([ci("background","transparent"),ci("color",n5(yt.textSecondary)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",n5(xt.md)),ci("padding","var("+_t.xs+") var("+_t.md+")"),ci("font-size",n5(bt.sizeSm)),ci("cursor","pointer"),Ni(eo(4))]);let l5=function(e){let t=e.title,n=void 0!==t?t:"Unavailable";return r("div",{children:[i("div",{children:"( ! )",className:i5}),i("h3",{children:n,className:o5}),i("p",{children:e.detail,className:s5}),L(e.onRetry,null,e=>i("button",{children:"Try again",className:a5,onClick:t=>e()}))],className:r5})};function c5(e){return L(j(j(ft(e),e=>Je(e,"properties")),ft),[],Xe)}function u5(e){return 1!==e.length?void 0:T(e[0])}function d5(e,t){return z(u5(c5(e.schema).filter(e=>t(e[0],e[1]))),e=>e[0])}function f5(e,t,n){return u5(me(e,e=>j(d5(e,n),n=>{if(function(e,t){return t3(e.schema).every(n=>n===t||"id"===n||mt(n,e.aggregateIdField))}(e,n))return{command:e,argument:n,tier:t}})))}function h5(e,t){return mt(Ds(e).storeTarget,t)}let p5={contents:[]};function g5(e,t,n){let r=e+"."+t.command+"."+U(t.field,"")+"."+n;if(!p5.contents.some(e=>e===r))return p5.contents.push(r),void console.error('[AutoUI] x-reventless-setter on field "'+e+'": '+n)}function m5(e,t,n,r){let i=u5(e.filter(e=>e.name===t.command));if(void 0!==i){let e=function(e,t,n,r){let i=t.field;return void 0!==i?c5(e.schema).some(e=>e[0]===i)?i:void 0:B(j(r,t=>d5(e,(e,n)=>h5(n,t))),d5(e,(e,t)=>e===n))}(i,t,n,r);return void 0!==e?{command:i,argument:e,tier:"Declared"}:void g5(n,t,'"'+t.command+'" takes no argument this field could fill — the slot stays static.')}g5(n,t,'no exposed instance command named "'+t.command+'" — the slot stays static.')}function v5(e,t,n){return j(function(e,t){return z(c5(e).find(e=>e[0]===t),e=>e[1])}(e,t),e=>{let r=Ds(e),i=r.storeTarget,o=n.filter(e=>"Instance"===e.level),s=r.setter;if(void 0!==s)return m5(o,s,t,i);let a=j(i,e=>f5(o,"StoreMatch",(t,n)=>h5(n,e)));return void 0!==a?a:f5(o,"NameMatch",(e,n)=>e===t)})}function y5(e,t){let n=e.requiredRole;return void 0===n||t.includes(n)}let _5=function(e){let t=e.resource,n=L3(t,void 0),r={readModelName:t.name,rows:n.rows,schema:t.schema,semantics:e.resourceSemantics,window:Mo(n.canLoadMore),onOpenRow:(e,t)=>{},role:u3},o={readModelName:e.eventReadModelName,rows:e.eventRows,schema:e.eventSchema,semantics:e.eventSemantics,accent:e.eventAccent,window:e.eventWindow,onOpenRow:e.onOpenEvent,onCommand:e.onCommand,role:d3,resourceRef:e.resourceRef,assignCommand:e.assignCommand},s=n.fetchState;return"object"!=typeof s?"Loading"===s?i(I1,{}):e.mode.render([r,o]):"Error"===s.TAG?i(M0,{detail:s._0,onRetry:()=>n.refetch()}):i(l5,{detail:s._0,onRetry:()=>n.refetch()})},b5=l(void 0),x5=b5.Provider;let S5=function(e){return c(x5,{value:e.refresh,children:e.children})};function w5(e){return"var("+e+")"}let E5=lo([pi("flex"),gi("column"),ci("gap",w5(_t.lg))]),k5=lo([pi("flex"),gi("column"),ci("gap",w5(_t.lg))]),C5=lo([pi("flex"),gi("column"),ci("gap",w5(_t.sm))]),A5=lo([ci("font-size",w5(bt.sizeSm)),ci("font-weight",w5(bt.weightMedium)),ci("color",w5(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em"),Ei(eo(0))]),N5=lo([pi("flex"),ui("center"),ci("gap",w5(_t.sm)),ci("flex-wrap","wrap")]),T5=lo([pi("inlineFlex"),ui("center"),ci("gap","6px"),ci("margin-left","auto"),ci("font-size",w5(bt.sizeSm)),ci("color",w5(yt.textSecondary)),ci("cursor","pointer"),ci("white-space","nowrap")]),R5=lo([pi("flex"),gi("column"),ci("gap",w5(_t.sm)),ci("align-items","stretch"),Ki("& ."+T5,[ci("margin-left","0")])]),D5=lo([pi("flex"),ui("center"),bi("flexEnd"),ci("gap",w5(_t.xs)),ci("padding-top",w5(_t.sm))]),I5=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",w5(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",w5(yt.textSecondary)),ci("font-size",w5(bt.sizeSm)),hi("pointer"),Qi([ci("background",w5(yt.surfaceSubtle)),ci("color",w5(yt.textPrimary))]),Hi([ci("opacity","0.4"),hi("notAllowed")])]);let F5={contents:[]},O5={contents:[]};let P5={contents:[]};let M5=function(e){let t,n=e.archiveOffered,l=e.rowActions,c=e.schedulerJoin,u=e.uiHints,d=e.liveOffered,f=e.sortKeyField,p=e.byIdsQueryDocument,g=e.byIdsQueryField,m=e.detailQueryDocument,v=e.singleQueryField,y=e.drillPath,_=e.openRowId,b=e.pluginId,x=e.detailView,S=e.rows,w=e.readModel,E=void 0!==y?y:[],k=void 0===d||d,C=void 0!==l?l:[],A=void 0!==n&&n,N=SI(),T=wI(),I=u1(),F=s(()=>{}),O=F[1],B=s(()=>{}),G=B[1],V=B[0],K=s(()=>({})),W=K[1],H=K[0],X=s(()=>"Loaded"),Q=X[1],Y=X[0],Z=s(()=>{}),ee=Z[1],te=Z[0],ne=gO(),re=L(ne,!1,e=>e.isLive(w.queryField)),ie=B3(U(b,"default")+"."+w.name),oe=ie[0],se=re&&k&&oe,le=Ga(),ue=z(b,e=>({pluginId:e,viewName:w.name})),de=j(u,e=>gF(e,w.name)),fe=FF(w.schema,de,{registry:le,ownEntity:ue}),he=L(j(de,e=>e.suppress),!1,e=>e.includes(v3));if(void 0!==c&&(pe=w.schema,!he&&y3(pe))){let e=HI(v3);t=void 0===e||fe.some(t=>t.id===e.id)?fe:fe.concat([e])}else t=fe;var pe;let ve=eF(b,w.name,void 0),ye=s(()=>tF(ve)),_e=ye[1],be=Rq(),xe=be.narrow,Se=Dq(be),we=OF(ye[0],de,js(w.schema),Se,t),Ee=void 0!==c&&void 0!==we&&we.id===v3,ke=$(x)&&!Ee,Ce="reventless.layout."+U(b,"default")+"."+w.name,Ae=s(()=>function(e){try{return R(localStorage.getItem(e))}catch(t){return}}(Ce)),Ne=Ae[1],Te=function(e,t,n,r){if(!r)return"Full";let i=j(e,PF);if(void 0!==i)return i;let o=j(j(t,e=>e.layout),PF);return void 0!==o?o:U(j(n,PF),"Full")}(Ae[0],de,function(e){return j(j(ft(e),e=>Je(e,"x-reventless-layout")),ut)}(w.schema),ke),Re=!(void 0===ne||!se)&&"Open"!==ne.statusFor(ne.apiForReadModel(w.queryField)),De=se&&!Re,Ie=s(()=>0),Fe=Ie[1],Oe=Ie[0],Pe=h({}),Me=h(void 0),Le=h(H1.make()),ze=h(H1.make()),Ue=h(Q1.make()),Be=h(Q1.make()),$e=h(new Map),Ge=e=>{$e.current.set(e,Date.now())},Ve=Y4(),Ke=X4(Ve.params),We=h(TI),He=ae(),Qe=z(b,e=>je(Wa(e,w.name))+Ke),Ze=Ls(w.schema),et=e=>z(j(Je(e,"id"),ut),t=>{let n=j(Ze,t=>j(Je(e,t),ut));return void 0!==n?function(e,t){return encodeURIComponent(e)+"/"+encodeURIComponent(t)}(t,n):t}),tt=e=>void 0!==Ze?T0(e)[0]:e,nt=e=>{if(void 0===Ze)return Ye([["id",e]]);let t=T0(e),n=t[1],r=t[0];return Ye(void 0!==n?[["id",r],["subId",n]]:[["id",r]])},rt=void 0!==_?_:V,it=e=>void 0!==b?He(Ja(b,w.name,e,[])+Ke):G(t=>e),ot=()=>void 0!==Qe?He(Qe):G(e=>{}),st=TK(w.schema),lt=NK(w.schema),dt=st.hasFilter||st.hasSort||st.hasSearch,pt=za(w.schema,j(u,e=>mF(e,w.name)),{field:w.labelField,source:w.labelFieldSource}),gt=tI(w.schema,void 0,le,ue,pt.labelField,pt.projectedLabelField),yt=$s(w.schema,j(de,e=>e.retiredLabel)),_t=Vs.offered(A,yt),bt=Vs.showing(_t,Ve.get(Vs.param)),xt=[];Xe(Ve.params).forEach(e=>{let t=e[1];if(""===t)return;let n=e[0];if("after"===n||"before"===n)return void xt.push(n+"="+t);if(n===Vs.param&&_t)return void xt.push(n+"="+t);if(!dt)return;if("sort"===n||"dir"===n)return void xt.push(n+"="+t);if("q"===n&&lt.search)return void xt.push(n+"="+t);if(!n.startsWith("f."))return;let r=n.slice(2),i=L(gt.find(e=>e.key===r),!1,e=>AK(e).filter);i&&xt.push(n+"="+t)});let St=xt.toSorted((e,t)=>e===t?0:e<t?-1:1).join("|"),wt={};if(dt){let e={};Xe(Ve.params).forEach(t=>{let n=t[0];n.startsWith("f.")&&(e[n.slice(2)]=t[1])});let t=RK(e,gt),n=U(Ve.get("q"),""),r=IK(t[0],n,lt,gt),i="desc"===Ve.get("dir")?"Desc":"Asc",o=function(e){if("object"!=typeof e)return;if("ServerSort"!==e.TAG)return;let t="Asc"===e._1?"ASC":"DESC";return Ye([["field",e._0],["direction",t]])}(DK(Ve.get("sort"),i,gt));M(r,e=>{wt.filter=e}),M(o,e=>{wt.orderBy=e})}var Et,kt,Ct;(Et=Ve.get("after"),kt=Ve.get("before"),Ct=50,void 0!==kt&&""!==kt?[["before",kt],["first",Ct]]:void 0!==Et&&""!==Et?[["first",Ct],["after",Et]]:[["first",Ct]]).forEach(e=>{wt[e[0]]=e[1]}),_t&&(wt.includeRetired=bt);let At=M3(w,wt,St,void 0,()=>W(e=>({})),void 0),Nt=At.refetch,Tt=At.fetchState,Rt=At.pageInfo,Dt=At.setRows,It=At.rows,Ft=e=>{if(void 0===m)return;if(void 0===v)return;let t=((e,t,n)=>void 0!==T?()=>T(e,nt(n)).then(e=>[e.data,GO(e,t)]):void 0!==N?()=>N(e,nt(n)).then(e=>[e,void 0]):void 0)(m,v,e);return void 0!==t?(Q(e=>"Loading"),void ce(t().then(t=>{let n=t[1],r=j(ft(t[0]),e=>Je(e,v)),i=0;return void 0!==n||void 0===r||"JSONNull"===ct(r)?i=1:(W(t=>{let n=Ye(Xe(t));return n[e]=r,n}),Q(e=>"Loaded")),1===i&&(W(t=>Ye(Xe(t).filter(t=>t[0]!==e))),Q(e=>void 0!==n?{TAG:"Refused",_0:n.message}:{TAG:"Error",_0:"Detail not found"})),Promise.resolve()}),e=>(Q(e=>({TAG:"Error",_0:"Failed to load detail"})),Promise.resolve()))):void 0},Ot=()=>{if(M(rt,Ft),!De)return Nt()};a(()=>{let e=void 0!==_?_:V;void 0!==e&&(q(Je(H,e))?Ft(e):Q(e=>"Loaded"))},[_,V]);let Pt=qe(),Mt=A0(),Lt=L(j(Cq(),e=>e.identity),[],e=>e.groups),zt=(e,t)=>z(P(v5(w.schema,t,w.commands),e=>y5(e.command,Lt)),t=>()=>O(n=>({command:t.command,rowId:e,formKey:t.command.name+":"+e}))),jt=e=>{let t=j(Je(e,"id"),ut);return void 0!==t?C.map(e=>{let n=x2(e,t);return{label:e.label,run:()=>O(e=>({command:n.command,rowId:void 0,initialValues:n.initialValues,navigateTo:n.navigateTo,formKey:n.formKey}))}}):[]},Ut=(e,t)=>jt(U(ft(t),{})),Bt=(void 0!==S?S:It).map(e=>U(ft(e),{})),$t=qI(Bt,gt,le,ue,void 0),qt={lookupLabel:(e,t)=>DI($t,e,le,t),isMissing:(e,t)=>OI($t,e,le,t),retiredBadge:(e,t)=>II($t,e,le,t),linkable:(e,t)=>FI($t,e,le,t,A)},Gt=function(e,t){return void 0!==t&&""!==t?"Backward":void 0!==e&&""!==e?"Forward":"FirstPage"}(Ve.get("after"),Ve.get("before")),Vt=function(e,t){return!!e.hasNextPage||"Backward"===t}(Rt,Gt),Kt=function(e,t){return!!e.hasPreviousPage||"Forward"===t}(Rt,Gt),Wt=Vt||Kt,Ht=pI(gt,le,Pt,Je,!0,qt,ue,(e,t)=>j(j(Je(e,"id"),ut),e=>zt(e,t)),yt,pt.labelField).map(e=>{if(!e.sortable)return e;if(!Wt)return e;let t=L(gt.find(t=>t.key===e.key),!1,e=>AK(e).sort);return{key:e.key,label:e.label,render:e.render,sortable:t,width:e.width}}),Jt=Ve.get("sort"),Xt="desc"===Ve.get("dir")?"Desc":"Asc",Qt=e=>Dt(t=>t.map(t=>{let n=O1(t);if(void 0===n)return t;let r=e.find(e=>mt(O1(e),n));return void 0!==r?r:t})),Yt=void 0!==f?me(It,e=>j(j(ft(e),e=>Je(e,f)),ut)):[],Zt=e=>{let t=Rt.hasNextPage,n=Yt.length;if(void 0===e)return!1;if(void 0===f)return!1;if(!t)return!1;if(n<=0)return!1;let r=Yt[0];if("Asc"===Xt){let t=ge(Yt,r,(e,t)=>e>t?e:t);return e>t}let i=ge(Yt,r,(e,t)=>e<t?e:t);return e<i},en=e=>{if(0!==e.length)return Dt(t=>G1.drop(t,e))},tn=()=>{let e=Object.keys(Pe.current);if(Pe.current={},Me.current=void 0,0!==e.length){if(e.length>10)return Nt();if(void 0!==g&&void 0!==p&&void 0!==N){let t=Ye([["ids",e.map(e=>e)]]);return void ce(N(p,t).then(t=>{let n=G1.fromBatch(e,t,g);return void 0!==n&&(Qt(n.rows),q(Ze)&&en(n.gone)),Promise.resolve()}),e=>Promise.resolve())}return void 0!==Ze||void 0===v||void 0===m||void 0===N?Nt():void e.forEach(e=>{let t=Ye([["id",e]]);ce(N(m,t).then(t=>{let n=G1.fromSingle(t,v);return void 0!==n&&("object"!=typeof n?en([e]):Qt([n._0])),Promise.resolve()}),e=>Promise.resolve())})}},nn=e=>{Pe.current[e]=!0;let t=Me.current;void 0!==t&&clearTimeout(t),Me.current=setTimeout(tn,150)},rn=e=>Dt(t=>{let n=t.map(t=>{let n=O1(t);if(void 0===n)return t;let r=e.find(e=>mt(O1(e),n));return void 0!==r?r:t}),r=me(n,O1),i=e.filter(e=>{let t=O1(e);return void 0!==t&&!r.includes(t)});return n.concat(i)}),on=$I.useInvalidate();nW(w.queryField,"All",se,e=>{if(!H1.shouldApply(Le.current,e.id,e.seq))return;H1.record(Le.current,e.id,e.seq),on(w.queryField);let t=(e=>It.find(t=>mt(O1(t),e)))(e.id),n=$(t);switch(e.changeKind){case"Added":if(!(e=>{let t=$e.current.get(e);return void 0!==t&&Date.now()-t<6e4})(e.id))return Zt(e.sortKeyValue)?void 0:Fe(e=>e+1|0);if($e.current.delete(e.id),n)return;let r=function(e,t){return q1({},e,t,void 0)}(e,w.schema);if(void 0!==Ze||void 0===r){let t=e.id;if(void 0!==Ze)return Nt();if(void 0!==g&&void 0!==p&&void 0!==N){let e=Ye([["ids",[t]]]);return void ce(N(p,e).then(e=>{let t=U(j(j(ft(e),e=>Je(e,g)),ht),[]);return rn(t),Promise.resolve()}),e=>Promise.resolve())}if(void 0===v)return Nt();if(void 0===m)return Nt();if(void 0===N)return Nt();let n=Ye([["id",t]]);return void ce(N(m,n).then(e=>{let t=j(ft(e),e=>Je(e,v));return void 0!==t&&"JSONNull"!==ct(t)&&rn([t]),Promise.resolve()}),e=>Promise.resolve())}return rn([r]);case"Updated":if(void 0!==Ze)return n?nn(e.id):void 0;if(void 0===t)return;let i=Zt(e.sortKeyValue),o=Q1.apply(Ue.current,t,e,w.schema);return i||void 0===o?nn(e.id):Qt([o]);case"Removed":return n?void 0!==Ze?nn(e.id):Dt(t=>t.filter(t=>vt(O1(t),e.id))):void 0;case"BulkInvalidated":return Fe(e=>0),Nt()}},()=>Nt()),nW(w.queryField,{_0:U(z(rt,tt),"")},se&&$(rt),e=>{if(void 0===rt)return;if(e.id!==tt(rt))return;if(!H1.shouldApply(ze.current,e.id,e.seq))return;H1.record(ze.current,e.id,e.seq),on(w.queryField);let t=e.changeKind;if(void 0!==Ze)switch(t){case"Updated":case"Removed":return Ft(rt);case"Added":case"BulkInvalidated":return}else switch(t){case"Updated":let t=j(Je(H,rt),t=>Q1.apply(Be.current,t,e,w.schema));return void 0!==t?(W(e=>{let n=Ye(Xe(e));return n[rt]=t,n}),Q(e=>"Loaded")):Ft(rt);case"Removed":return ee(e=>rt);case"Added":case"BulkInvalidated":return}},()=>{void 0===rt||void 0===m||void 0===v||void 0===N||ce(N(m,nt(rt)).then(e=>{let t=j(ft(e),e=>Je(e,v)),n=0;return void 0!==t&&"JSONNull"!==ct(t)?(W(e=>{let n=Ye(Xe(e));return n[rt]=t,n}),Q(e=>"Loaded")):n=1,1===n&&ee(e=>rt),Promise.resolve()}),e=>Promise.resolve())}),a(()=>{ee(e=>{})},[U(rt,"")]);let sn=U(Ve.get("q"),""),an={};Xe(Ve.params).forEach(e=>{let t=e[0];t.startsWith("f.")&&(an[t.slice(2)]=e[1])});let ln,cn=function(e,t){return me(e,e=>{if(!("object"!=typeof(n=e.kind)?"KBoolean"===n:"KEnum"===n.TAG))return;var n;let r=function(e){return"object"!=typeof e?"KBoolean"===e?[["true","Yes"],["false","No"]]:void 0:"KEnum"===e.TAG?e._0.map(e=>[e,e]):void 0}(e.kind);if(void 0===r)return;let i=r.map(e=>({label:e[1],value:e[0]}));return{key:e.key,label:e.label,options:i,value:U(Je(t,e.key),"")}})}(gt,an),un=0!==cn.length,dn=z(Jt,e=>({key:e,direction:"Asc"===Xt?"Asc":"Desc"})),fn=(e,t)=>{let n="Asc"===t?"asc":"desc";We.current=TI,Ve.setMany([["sort",e],["dir",n],["after",""],["before",""]])},hn=(e,t)=>{We.current=TI,Ve.setMany([["f."+e,t],["after",""],["before",""]])},pn=()=>M(Rt.endCursor,e=>{We.current=function(e,t){return e.concat([U(t,"")])}(We.current,Ve.get("after")),Ve.setMany([["after",e],["before",""]])}),gn=w.commands.filter(e=>"Instance"===e.level);if(0!==gn.length||0!==C.length){let e=e=>{let t=j(Je(e,"id"),ut),n=w.lifecycleField;if(void 0!==n){void 0!==Je(e,n)?void 0===JW(e,n)&&function(e,t,n){let r=U(e,"<no-plugin>")+"."+t;if(!O5.contents.some(e=>e===r))O5.contents.push(r),console.warn("[AutoUI] Read model "+t+' lifecycleField="'+n+'" value is neither a string nor a TAG-shaped object; per-row command filter cannot match against allowedStates.')}(b,w.name,n):function(e,t,n){let r=U(e,"<no-plugin>")+"."+t+"."+n;if(!F5.contents.some(e=>e===r))F5.contents.push(r),console.warn("[AutoUI] Read model "+t+' declared lifecycleField="'+n+"\" but the list-view rows don't include that field; per-row command filtering is disabled.")}(b,w.name,n)}let r=XW(gn,e,w.lifecycleField).map(e=>({TAG:"Action",label:e.label,onClick:()=>O(n=>({command:e,rowId:t,formKey:e.name+":"+U(t,"")})),danger:!1})),o=jt(e).map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1}));return i(J0,{items:r.concat(o),triggerLabel:"..."})},t={key:"__actions",label:"",render:e,sortable:!1,width:"56px"};ln=Ht.concat([t])}else ln=Ht;let mn,vn=w.commands.filter(e=>"Collection"===e.level),yn=e=>{let t,n=e.map(e=>U(ft(e),{})),r=RK(an,gt),i=dt&&lt.search?"":sn,o=DK(Jt,Xt,gt);return t="object"!=typeof o||"ServerSort"===o.TAG?[void 0,Xt]:[o._0,o._1],f0(d0(u0(n,gt,r[1]),gt,i),gt,t[0],t[1])},_n=e=>{if(void 0!==we&&we.id!==VI){let n=z(pt.statusField,e=>a3(e,gn,j(de,e=>e.transitions))),r=m1(N,T,gn,w.name,se,()=>Nt(),le,Mt.onNotice,Ge),o=yn(e).map(e=>e),s=(t=Vt,Kt?t?{TAG:"Partial",_0:"Between"}:{TAG:"Partial",_0:"ToEnd"}:t?{TAG:"Partial",_0:"FromStart"}:"Complete");if(void 0!==c&&we.id===v3){let e=za(c.resource.schema,j(u,e=>mF(e,c.resource.name)),{field:c.resource.labelField,source:c.resource.labelFieldSource});return i(_5,{mode:we,resource:c.resource,resourceSemantics:e,resourceRef:c.resourceRef,assignCommand:_3(gn,c.resourceRef),eventReadModelName:w.name,eventSchema:w.schema,eventRows:o,eventWindow:s,eventSemantics:pt,eventAccent:j(de,e=>e.accent),onOpenEvent:(e,t)=>M(j(ft(t),et),it),onCommand:r})}let a=w.name,l=w.schema,d=j(de,e=>e.accent),f=s,h=(e,t)=>M(j(ft(t),et),it),p=z(n,e=>r),g=zt,m=0===C.length?void 0:Ut,v={readModelName:a,rows:o,schema:l,semantics:pt,accent:d,window:f,onOpenRow:h,onCommand:p,statusCommandFor:n,fillSlot:g,rowActionsFor:m,ownEntity:ue,retired:yt,refLabels:qt};return we.render([v])}{let t=yn(e),n=z(x,e=>e=>M(et(e),it)),o=e=>U(et(e),JSON.stringify(e)),s=(e,t)=>{let r=t.map(o),s={};return r.forEach(e=>{s[e]=!0}),Object.keys(s).length!==r.length&&function(e,t){let n=U(e,"<no-plugin>")+"."+t;if(!P5.contents.some(e=>e===n))P5.contents.push(n),console.warn("[AutoUI] Read model "+t+" produced duplicate row keys — row identity is ambiguous and row clicks may open the wrong row. Give each row a unique id, or annotate the distinguishing field with @subId.")}(b,w.name),i(Po,{columns:e,data:t,keyFn:o,sortState:dn,onSort:fn,onRowClick:n,activeKey:rt})},a=function(e){return Is(e,e=>e.groupBy)[0]}(w.schema);if(void 0===a)return s(ln,t);let l=F1(t,a,Bs(w.schema,a)),c=l.length;if(1===c)return s(ln,t);if(0===c)return s(ln,t);let u=ln.filter(e=>e.key!==a);return i("div",{children:l.map(e=>{let t=e[0];return r("div",{children:[i("div",{children:at(t),className:A5}),s(u,e[1])],className:C5},t)}),className:k5})}var t},bn=void 0!==S?_n(S):"object"!=typeof Tt?"Loading"===Tt?i(I1,{}):_n(It):"Error"===Tt.TAG?i(M0,{detail:Tt._0,onRetry:()=>Nt()}):i(l5,{detail:Tt._0,onRetry:()=>Nt()});if(void 0!==rt&&void 0!==x){let e=(void 0!==S?S:It).find(e=>mt(j(ft(e),et),rt)),t=Je(H,rt);mn=[rt,x,void 0!==t?t:e]}else mn=void 0;let xn,Sn=e=>{let t=e[2],n=e[0];if(mt(te,n))return i(M0,{title:"Entity removed",detail:"This entity no longer exists. Return to the list to continue.",onRetry:()=>ot()});if(void 0!==t)return e[1](tt(n),E,D(t));let r=0,o=0,s=0;if("object"!=typeof Tt){if("Loading"===Tt)return i(I1,{});if("object"!=typeof Y){if("Loading"!==Y)return i(M0,{title:"Row not found",detail:"The row data is no longer in the current page."});s=4}else{if("Error"!==Y.TAG)return i(l5,{detail:Y._0,onRetry:()=>Nt()});r=2}}else s=4;if(4===s)if("object"!=typeof Y){if("Loading"===Y)return i(I1,{});o=3}else o=3;if(3===o&&"object"==typeof Tt){if("Error"===Tt.TAG)return i(M0,{detail:Tt._0,onRetry:()=>Nt()});r=2}return 2===r&&"object"==typeof Y&&"Error"===Y.TAG?i(M0,{detail:Y._0,onRetry:()=>Nt()}):i(l5,{detail:Tt._0,onRetry:()=>Nt()})},wn=ke?i("div",{children:[["full","Full","▭"],["split","Split","▤"]].map(e=>{let t,n=e[1],o=e[0];return t="Full"===Te?"full"===o:"split"===o,r("button",{children:[i("span",{children:e[2],"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),i("span",{children:n,className:lF.Style.btnLabel})],"aria-label":n,"aria-pressed":t?"true":"false",className:t?lF.Style.btnActive:lF.Style.btn,title:n,onClick:e=>{!function(e,t){try{return localStorage.setItem(e,t)}catch(n){return}}(Ce,o),Ne(e=>o)}},o)}),"aria-label":"Layout",className:lF.Style.group,role:"group"}):null,En=PG(),kn=k?i(D3,{live:oe,canBeLive:re,reconnecting:Re,onToggle:ie[1]}):null,Cn=i(l1,{title:w.name,commands:vn.map(e=>({key:e.name,label:"+ "+e.label,run:()=>O(t=>({command:e,rowId:void 0,formKey:e.name})),primary:!0})),controls:r(o,{children:[t.length>1?i(lF.make,{modes:t,activeId:L(we,VI,e=>e.id),onSelect:e=>{nF(ve,e,Se),_e(t=>({mode:e,band:Se}))}}):null,wn,kn]}),inBar:$(En)}),An=MG(En,Cn),Nn=void 0!==yt&&_t?r("label",{children:[i("input",{checked:bt,type:"checkbox",onChange:e=>Ve.setMany(Vs.toggleParams(bt))}),Vs.label(yt)],className:T5}):null,Tn=un?i(C0,{filters:cn,onFilterChange:hn}):null,Rn=ge(cn,0,(e,t)=>""===t.value?e:e+1|0)+(bt&&_t?1:0)|0,Dn=r(o,{children:[r("div",{children:[i(y0,{value:sn,onChange:e=>{We.current=TI,Ve.setMany([["q",e],["after",""],["before",""]])}}),xe&&(un||_t)?i(S1,{activeCount:Rn,children:r("div",{children:[cn.map(e=>i(k0,{filter:e,onChange:hn},e.key)),Nn],className:R5})}):r(o,{children:[Tn,Nn]})],className:N5}),Oe>0?i(P3,{count:Oe,onClick:()=>{Fe(e=>0),We.current=TI,Ve.setMany([["after",""],["before",""]]),Nt()}}):null]}),In=Wt?r("div",{children:[i("button",{children:"‹ Prev",className:I5,disabled:!Kt,onClick:e=>(()=>{let e=function(e){let t=e.length;return 0!==t?[e.slice(0,t-1|0),e[t-1|0]]:[e,void 0]}(We.current),t=e[1];return void 0!==t?(We.current=e[0],Ve.setMany([["after",t],["before",""]])):M(Rt.startCursor,e=>Ve.setMany([["before",e],["after",""]]))})()}),i("button",{children:"Next ›",className:I5,disabled:!Vt,onClick:e=>pn()})],className:D5}):null,Fn=function(e){let t=ft(e),n=e=>U(j(j(j(j(j(j(t,e=>Je(e,"properties")),ft),t=>Je(t,e)),ft),e=>Je(e,"title")),ut),at(e));return j(j(j(t,e=>Je(e,"x-reventless-owner-unscoped")),ft),e=>z(j(Je(e,"field"),ut),t=>({ownerLabel:n(t),matchedGroups:L(j(Je(e,"as"),ht),[],e=>me(e,ut))})))}(w.schema);if(void 0!==Fn){let e=Fn.matchedGroups,t=e.length,n=1!==t?0!==t?e.join(" / "):"an elevated role":e[0];xn=i(qK,{variant:"Info",title:"Viewing as "+n,message:"This list is not filtered to you — it shows rows for every "+Fn.ownerLabel+"."})}else xn=null;let On,Pn=r(o,{children:[Dn,xn,Mt.element,bn,In]});if("Full"===Te)if(void 0!==mn){let e=mn[2],t=mn[1],n=mn[0],o={label:w.name,href:Qe,onClick:ot},s=(e=>!!vt(te,e[0])&&$(e[2]))([n,t,e]),a={placement:$(En)?"Bar":"Pane",ancestors:[o],controls:kn};On=i(S5,{refresh:Ot,children:r("div",{children:[s?null:MG(En,i("div",{children:i(q0,{crumbs:[o],allLinks:!0}),className:n1.titleGroup})),i(t5,{chrome:a,children:Sn([n,t,e])})],className:E5})})}else On=r("div",{children:[An,Pn],className:E5});else{let e=void 0!==mn?Sn(mn):i(yo,{title:"Select an item",description:"Choose a row on the left to see its details here."});On=i(S5,{refresh:Ot,children:r("div",{children:[An,i(t5,{chrome:{placement:"Pane",ancestors:[]},children:i(A1,{master:Pn,detail:e})})],className:E5})})}return r(o,{children:[On,L(F[0],null,e=>i(YK,{isOpen:!0,onClose:()=>O(e=>{}),title:e.command.label,children:i(J4,{schema:e.command.schema,aggregateId:e.rowId,aggregateIdField:e.command.aggregateIdField,injectNewId:"Collection"===e.command.level,ownerField:e.command.ownerField,ownerValue:e.command.ownerValue,initialValues:e.initialValues,refFields:e.command.refFields,onSubmit:t=>{if(void 0!==I){let n=e.rowId;return void 0!==n?Ge(n):M(Je(t,U(e.command.aggregateIdField,"id")),Ge),ce(I(e.command.mutationDocument,s4(e.command.schema,t)).then(t=>{if("object"!=typeof t)return"Accepted"===t?(O(e=>{}),De||Nt(),M(e.navigateTo,J),Promise.resolve("Ok")):(O(e=>{}),!De&&q(e.navigateTo)&&setTimeout(()=>Nt(),500),M(e.navigateTo,J),Promise.resolve("Ok"));{if("Rejected"===t.TAG){let e=t._0;return p1(N,le,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let n=t._0;return console.error("[AutoUI] "+w.name+": command "+e.command.name+" not executed — "+n),Promise.resolve({TAG:"Err",_0:n})}}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"}))}return O(e=>{}),Promise.resolve("Ok")},submitLabel:"Execute"},e.formKey)}))]})};function L5(e){return e.map(e=>e.x.toString()+","+e.y.toString()).join(" ")}let z5=function(e){let t=e.color,n=e.height,r=e.width,o=void 0!==r?r:80,s=void 0!==n?n:24,a=void 0!==t?t:"",l=function(e,t,n){if(e.length<2)return[];let r=ge(e,Number.MAX_VALUE,(e,t)=>e<t?e:t),i=ge(e,Number.MIN_VALUE,(e,t)=>e>t?e:t),o=i-r,s=t/(e.length-1|0);return e.map((e,t)=>({x:t*s,y:0===o?n/2:n-(e-r)/o*n}))}(e.values,o,s),c=""===a?"var("+yt.brand+")":a;return l.length<2?null:i("svg",{children:i("polyline",{fill:"none",points:L5(l),stroke:c,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),style:{display:"block",overflow:"visible"},height:s.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+s.toString()})};function j5(e){return"var("+e+")"}let U5=lo([pi("flex"),gi("column"),ci("gap",j5(_t.xs)),ci("padding",j5(_t.lg)),ci("background",j5(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",j5(xt.md))]),B5=lo([ci("color",j5(yt.textSecondary)),ci("font-size",j5(bt.sizeSm)),ci("font-weight",j5(bt.weightMedium))]),$5=lo([pi("flex"),ui("baseline"),ci("gap",j5(_t.sm))]),q5=lo([ci("color",j5(yt.textPrimary)),ci("font-size",j5(bt.sizeXxl)),ci("font-weight",j5(bt.weightBold)),ci("line-height",j5(bt.lineHeightTight))]);function G5(e){switch(e){case"Up":return yt.success;case"Down":return yt.error;case"Neutral":return yt.textDisabled}}function V5(e){return lo([ci("color",j5(G5(e))),ci("font-size",j5(bt.sizeSm)),ci("font-weight",j5(bt.weightMedium))])}let K5=function(e){let t,n=e.trendLabel,o=e.trend;if(void 0!==o&&void 0!==n){let e;switch(o){case"Up":e="^";break;case"Down":e="v";break;case"Neutral":e="-"}t=i("span",{children:e+" "+n,className:V5(o)})}else t=null;return r("div",{children:[i("div",{children:e.label,className:B5}),r("div",{children:[i("span",{children:e.value,className:q5}),t],className:$5}),L(e.sublabel,null,e=>i("div",{children:e,style:{color:"var("+yt.textDisabled+")",fontSize:"var("+bt.sizeXs+")"}})),U(e.footer,null)],className:U5})};function W5(e){return"var("+e+")"}let H5=lo([pi("grid"),ci("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ci("gap",W5(_t.md))]),J5=lo([hi("pointer"),ci("border-radius",W5(xt.md)),Qi([ci("filter","brightness(0.98)")])]);let X5=function(e){let t=e.kpis;return 0===t.length?null:i("div",{children:t.map(e=>{let t=z(e.spark,e=>i(z5,{values:e,width:120,height:24})),n=i(K5,{label:e.label,value:e.value,trend:e.trend,trendLabel:e.trendLabel,sublabel:e.sublabel,footer:t}),r=e.onOpen;return i("div",void 0!==r?{children:n,className:J5,role:"button",tabIndex:0,onKeyDown:e=>{if("Enter"===e.key)return r()},onClick:e=>r()}:{children:n},e.key)}),className:H5})},Q5=["var("+yt.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Y5(e,t){return U(e.color,Q5[fe(t,Q5.length)])}function Z5(e,t,n,r){let i=2*(r-.25)*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function e6(e){return(Math.round(1e3*e)/1e3).toString()}function t6(e,t,n,r,i,o){let s=Z5(e,t,n,i),a=s[1],l=s[0],c=Z5(e,t,n,o),u=c[1],d=c[0],f=o-i>.5?"1":"0";if(r<=0)return"M "+e6(e)+" "+e6(t)+" L "+e6(l)+" "+e6(a)+" A "+e6(n)+" "+e6(n)+" 0 "+f+" 1 "+e6(d)+" "+e6(u)+" Z";let h=Z5(e,t,r,i),p=Z5(e,t,r,o);return"M "+e6(l)+" "+e6(a)+" A "+e6(n)+" "+e6(n)+" 0 "+f+" 1 "+e6(d)+" "+e6(u)+" L "+e6(p[0])+" "+e6(p[1])+" A "+e6(r)+" "+e6(r)+" 0 "+f+" 0 "+e6(h[0])+" "+e6(h[1])+" Z"}let n6=function(e){let t=e.innerRatio,n=e.size,r=e.slices,o=void 0!==n?n:120,s=void 0!==t?t:0,a=function(e){let t=ge(e,0,(e,t)=>e+(t.value>0?t.value:0));if(t<=0)return[];let n={contents:0};return e.map(e=>{let r=n.contents,i=(e.value>0?e.value:0)/t;return n.contents=r+i,[r,r+i]})}(r);if(0===a.length)return null;let l=o/2,c=o/2-1,u=s>0?c*s:0;return i("svg",{children:a.map((e,t)=>{let n=e[1],o=e[0],s=r[t],a=Y5(s,t),d=n-o>=.999?t6(l,l,c,u,o,o+.5)+" "+t6(l,l,c,u,o+.5,n):t6(l,l,c,u,o,n);return i("path",{children:i("title",{children:s.label}),d:d,fill:a},s.label+t.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:o.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+o.toString()})},r6=["var("+yt.brand+")","var("+yt.success+")"];let i6=function(e){let t=e.height,n=e.width,o=e.series,s=void 0!==n?n:320,a=void 0!==t?t:120;if(0===o.length||o.every(e=>e.values.length<2))return null;let l=function(e){let t=e.flatMap(e=>e.values),n=ge(t,Number.MAX_VALUE,(e,t)=>e<t?e:t),r=ge(t,Number.MIN_VALUE,(e,t)=>e>t?e:t);return[n,r]}(o),c=l[0],u=l[1]-c,d=0===u?1:u,f=a-16,h=ge(o,0,(e,t)=>e>t.values.length?e:t.values.length),p=s/(h-1|0),g=8+f;return i("svg",{children:o.map((e,t)=>{let n=U(e.color,U(r6[t],"var("+yt.brand+")")),o=e.values.map((e,t)=>[t*p,8+f-(e-c)/d*f]),s=o.map(e=>e[0].toString()+","+e[1].toString()).join(" "),a=(e.values.length-1|0)*p,l="0,"+g.toString()+" "+s+" "+a.toString()+","+g.toString();return r("g",{children:[i("polygon",{fill:n,fillOpacity:"0.15",points:l,stroke:"none"}),i("polyline",{fill:"none",points:s,stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]},e.label)}),style:{display:"block",height:"auto",maxWidth:"100%"},height:a.toString(),width:s.toString(),viewBox:"0 0 "+s.toString()+" "+a.toString()})};let o6=function(e){let t=e.size,n=void 0!==t?t:120;return i(n6,{slices:e.slices,size:n,innerRatio:.6})};function s6(e){return"var("+e+")"}let a6=lo([ji("relative"),ci("width","100%"),ci("line-height","0")]),l6=lo([ji("absolute"),ci("left","0"),ci("right","0"),ci("bottom","0"),ci("text-align","center"),ci("line-height","1.1"),ci("font-size",s6(bt.sizeXl)),ci("font-weight",s6(bt.weightMedium)),ci("color",s6(yt.textPrimary))]),c6=lo([pi("flex"),bi("spaceBetween"),ci("width","100%"),ci("font-size",s6(bt.sizeXs)),ci("color",s6(yt.textDisabled))]),u6=lo([ci("font-size",s6(bt.sizeSm)),ci("color",s6(yt.textSecondary))]);function d6(e){return(Math.round(100*e)/100).toString()}function f6(e,t,n,r){let i=Math.PI+r*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function h6(e,t,n,r,i){let o=f6(e,t,n,r),s=f6(e,t,n,i);return"M "+d6(o[0])+" "+d6(o[1])+" A "+d6(n)+" "+d6(n)+" 0 0 1 "+d6(s[0])+" "+d6(s[1])}let p6=function(e){let t=e.size,n=e.caption,o=e.max,s=e.min,a=e.value,l=void 0!==s?s:0,c=void 0!==t?t:160;if(o<=l)return null;let u=function(e,t,n){if(n<=t)return 0;let r=(e-t)/(n-t);return r<0?0:r>1?1:r}(a,l,o),d=.09*c,f=c/2,h=c/2-d/2,p=h+d/2,g=p+d/2;return r("div",{children:[r("div",{children:[r("svg",{children:[i("path",{d:h6(f,p,h,0,1),fill:"none",stroke:"var("+yt.surfaceSubtle+")",strokeLinecap:"round",strokeWidth:d6(d)}),u<=0?null:i("path",{d:h6(f,p,h,0,u),fill:"none",stroke:"var("+yt.brand+")",strokeLinecap:"round",strokeWidth:d6(d)})],"aria-label":d6(a)+" of "+d6(o),role:"img",style:{display:"block",height:"auto",maxWidth:"100%"},height:d6(g),width:d6(c),viewBox:"0 0 "+d6(c)+" "+d6(g)}),i("div",{children:U(e.display,d6(a)),className:l6})],className:a6}),r("div",{children:[i("span",{children:d6(l)}),i("span",{children:d6(o)})],className:c6}),void 0!==n?i("div",{children:n,className:u6}):null],className:(m=c,lo([pi("flex"),gi("column"),ui("center"),ci("gap","2px"),ci("width","100%"),ci("max-width",m.toString()+"px")]))});var m};function g6(e){return"var("+e+")"}let m6=lo([pi("flex"),gi("column"),ci("gap","6px")]),v6=lo([ci("overflow-x","auto")]),y6=lo([pi("flex"),ci("gap","4px"),ui("flexStart")]);function _6(e){return lo([pi("grid"),ci("grid-template-rows","repeat(7, "+e.toString()+"px)"),ci("gap","2px"),ui("center"),ci("font-size",g6(bt.sizeXs)),ci("color",g6(yt.textDisabled)),ci("line-height","1")])}function b6(e){return lo([pi("grid"),ci("grid-auto-flow","column"),ci("grid-auto-columns",e.toString()+"px"),ci("grid-template-rows","repeat(7, "+e.toString()+"px)"),ci("gap","2px")])}let x6=lo([ci("visibility","hidden")]),S6=lo([pi("flex"),ui("center"),yi("wrap"),ci("gap",g6(_t.md)),ci("font-size",g6(bt.sizeXs)),ci("color",g6(yt.textSecondary))]),w6=lo([pi("flex"),ui("center"),ci("gap","4px")]);function E6(e){let t=e[0];if(void 0===t)return[];let n=pe(function(e){let t=0|new Date(e).getDay();return 0===t?6:t-1|0}(t.time),e=>{});for(e.forEach(e=>{n.push(e)});n.length%7!=0;)n.push(void 0);return pe(n.length/7|0,e=>n.slice(7*e|0,7+(7*e|0)|0))}function k6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let C6=function(e){let t=e.cellSize,n=e.days,o=void 0!==t?t:11,s=E6(n);if(0===s.length)return null;let a=function(e){return ge(e,0,(e,t)=>t.value>e?t.value:e)}(n),l=n[0],c=n[n.length-1|0],u=void 0!==l&&void 0!==c?lc(l.time)+" – "+lc(c.time):"";return r("div",{children:[i("div",{children:r("div",{children:[i("div",{children:pe(7,e=>{return i("span",{children:(t=e,t%2==0?U(cc[t],""):"")},e.toString());var t}),className:_6(o)}),i("div",{children:s.map((e,t)=>e.map((e,n)=>{return void 0!==e?i("div",{className:(r=fW(e.value,a),lo([ci("border-radius","2px"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("background",r<=0?"transparent":"color-mix(in srgb, var("+yt.brand+") "+Math.round(100*r).toString()+"%, transparent)")])),title:dc(e.time)+" "+lc(e.time)+": "+k6(e.value)},e.time.toString()):i("div",{className:x6},"b:"+t.toString()+":"+n.toString());var r})),className:b6(o)})],className:y6}),className:v6}),r("div",{children:[i("span",{children:u}),r("span",{children:["less",hW.map(e=>{return i("span",{className:(t=e,lo([ci("width","10px"),ci("height","10px"),ci("border-radius","2px"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("background","color-mix(in srgb, var("+yt.brand+") "+Math.round(100*t).toString()+"%, transparent)")]))},e.toString());var t}),"more (max "+k6(a)+")"],className:w6})],className:S6})],className:m6})};function A6(e){return"var("+e+")"}let N6=lo([pi("flex"),gi("column"),ci("gap","2px")]),T6=lo([pi("flex"),gi("column"),ci("gap","3px")]),R6=lo([pi("flex"),bi("spaceBetween"),ui("baseline"),ci("gap",A6(_t.sm)),ci("font-size",A6(bt.sizeSm))]),D6=lo([ci("color",A6(yt.textPrimary))]),I6=lo([ci("color",A6(yt.textPrimary)),ci("font-weight",A6(bt.weightMedium)),ci("white-space","nowrap")]),F6=lo([ci("color",A6(yt.textSecondary)),ci("font-weight",A6(bt.weightNormal))]),O6=lo([ci("background",A6(yt.surfaceSubtle)),ci("border-radius",A6(xt.sm)),ci("height","14px"),Pi("hidden")]);function P6(e,t){return lo([ci("background",t),ci("border-radius",A6(xt.sm)),ci("height","100%"),ci("width",e.toString()+"%"),ci("min-width",e>0?"2px":"0")])}let M6=lo([ci("padding","2px 0 4px"),ci("font-size",A6(bt.sizeXs)),ci("color",A6(yt.textDisabled))]),L6=lo([ci("padding-top","4px"),ci("font-size",A6(bt.sizeXs)),ci("color",A6(yt.textDisabled))]);function z6(e,t){return t<=0?0:Math.round(e/t*1e3)/10}function j6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let U6=function(e){let t=e.stages;if(0===t.length)return null;let n=e.note,o=function(e){let t=L(e[0],0,e=>e.value);return e.map((n,r)=>{let i=e[r-1|0];return{conversion:z6(n.value,t),dropOff:void 0!==i&&i.value>0&&n.value<i.value?z6(i.value-n.value,i.value):void 0}})}(t),s=L(t[0],0,e=>e.value);return r("div",{children:[t.map((e,t)=>{let n=o[t],a=s<=0?0:e.value/s*100,l=j(n,e=>e.dropOff);return r("div",{children:[void 0!==l?i("div",{children:"↓ "+l.toString()+"% drop-off",className:M6}):null,r("div",{children:[r("div",{children:[i("span",{children:e.label,className:D6}),r("span",{children:[j6(e.value),0===t?null:i("span",{children:" · "+L(n,0,e=>e.conversion).toString()+"%",className:F6})],className:I6})],className:R6}),i("div",{children:i("div",{className:P6(a,U(e.color,"var("+yt.brand+")"))}),className:O6})],className:T6})]},e.label+":"+t.toString())}),void 0!==n?i("div",{children:n,className:L6}):null],className:N6})};function B6(e){return"var("+e+")"}let $6=lo([pi("flex"),gi("column"),ci("gap","2px")]),q6=lo([pi("flex"),ci("gap","4px")]),G6=[ci("font-size",B6(bt.sizeXs)),ci("color",B6(yt.textDisabled)),ci("white-space","nowrap")],V6=lo(G6.concat([pi("flex"),gi("column"),bi("spaceBetween"),ci("text-align","right")]));let K6=lo([pi("flex"),bi("spaceBetween"),ci("gap",B6(_t.sm)),ci("font-size",B6(bt.sizeXs)),ci("color",B6(yt.textSecondary))]);function W6(e){return(Math.round(100*e)/100).toString()}function H6(e,t,n){return n<=t?.5:(e-t)/(n-t)}let J6=function(e){let t=e.height,n=e.width,o=e.yLabel,s=e.xLabel,a=e.points,l=void 0!==n?n:320,c=void 0!==t?t:200,u=function(e){let t=e[0];if(void 0!==t)return ge(e,{xMin:t.x,xMax:t.x,yMin:t.y,yMax:t.y},(e,t)=>({xMin:t.x<e.xMin?t.x:e.xMin,xMax:t.x>e.xMax?t.x:e.xMax,yMin:t.y<e.yMin?t.y:e.yMin,yMax:t.y>e.yMax?t.y:e.yMax}))}(a);if(void 0===u)return null;let d,f=4.5,h=l-9,p=c-9,g=0;return void 0!==s||void 0!==o?g=1:d=null,1===g&&(d=r("div",{children:[i("span",{children:"↑ "+U(o,"y")}),i("span",{children:U(s,"x")+" →"})],className:K6})),r("div",{children:[r("div",{children:[r("div",{children:[i("span",{children:W6(u.yMax)}),i("span",{children:W6(u.yMin)})],className:V6,style:{width:34..toString()+"px"}}),r("svg",{children:[i("line",{stroke:"var("+yt.borderSubtle+")",strokeWidth:"1",x1:W6(f),x2:W6(l-f),y1:W6(c-f),y2:W6(c-f)}),i("line",{stroke:"var("+yt.borderSubtle+")",strokeWidth:"1",x1:W6(f),x2:W6(f),y1:W6(f),y2:W6(c-f)}),a.map((e,t)=>{let n=f+H6(e.x,u.xMin,u.xMax)*h,r=f+(1-H6(e.y,u.yMin,u.yMax))*p;return i("circle",{children:i("title",{children:e.label+" — "+U(s,"x")+": "+W6(e.x)+", "+U(o,"y")+": "+W6(e.y)}),cx:W6(n),cy:W6(r),fill:U(e.color,"var("+yt.brand+")"),fillOpacity:"0.75",r:W6(3.5)},e.label+":"+t.toString())})],style:{display:"block",height:"auto",maxWidth:"100%",minWidth:"0"},height:W6(c),width:W6(l),viewBox:"0 0 "+W6(l)+" "+W6(c)})],className:q6}),r("div",{children:[i("span",{children:W6(u.xMin)}),i("span",{children:W6(u.xMax)})],className:(m=38,lo(G6.concat([pi("flex"),bi("spaceBetween"),ci("margin-left",m.toString()+"px")])))}),d],className:$6});var m};function X6(e){return"var("+e+")"}let Q6=lo([pi("flex"),gi("column"),ci("gap","6px"),Ei(eo(0)),ci("padding","0"),ci("list-style","none")]),Y6=[pi("grid"),ci("grid-template-columns","1.5rem 1fr auto"),ui("center"),ci("gap",X6(_t.sm)),ci("font-size",X6(bt.sizeSm)),ci("color",X6(yt.textPrimary))],Z6=lo(Y6),e8=lo(Y6.concat([hi("pointer"),ci("background","transparent"),ci("border","none"),ci("padding","2px 0"),ci("text-align","left"),ci("width","100%"),ci("font","inherit"),Qi([ci("color",X6(yt.brand))])])),t8=lo([ci("align-self","start"),ci("font-size",X6(bt.sizeXs)),ci("color",X6(yt.textDisabled)),ci("text-align","right"),ci("font-variant-numeric","tabular-nums")]),n8=lo([pi("flex"),gi("column"),ci("gap","3px"),Fi(eo(0))]),r8=lo([ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),i8=lo([ci("background",X6(yt.surfaceSubtle)),ci("border-radius",X6(xt.sm)),ci("height","6px"),Pi("hidden")]);function o8(e){return lo([ci("background",X6(yt.brand)),ci("border-radius",X6(xt.sm)),ci("height","100%"),ci("width",e.toString()+"%"),ci("min-width",e>0?"2px":"0")])}let s8=lo([ci("align-self","start"),ci("font-weight",X6(bt.weightMedium)),ci("white-space","nowrap"),ci("font-variant-numeric","tabular-nums")]);function a8(e,t){return t<=0||e<=0?0:e/t*100}let l8=function(e){let t=e.limit,n=void 0!==t?t:10,s=e.entries.slice(0,n);if(0===s.length)return null;let a=ge(s,0,(e,t)=>t.value>e?t.value:e);return i("ol",{children:s.map((e,t)=>{let n=r(o,{children:[i("span",{children:(t+1|0).toString(),className:t8}),r("span",{children:[i("span",{children:e.label,className:r8,title:e.label}),i("span",{children:i("span",{className:o8(a8(e.value,a))}),className:i8})],className:n8}),i("span",{children:e.display,className:s8})]}),s=e.onOpen;return i("li",{children:void 0!==s?i("button",{children:n,className:e8,type:"button",onClick:e=>s()}):i("div",{children:n,className:Z6})},e.key)}),className:Q6})};let c8=function(e){let t=e.height,n=e.width,r=e.bars,o=void 0!==n?n:320,s=void 0!==t?t:120;if(0===r.length)return null;let a=ge(r,0,(e,t)=>{let n=function(e){return ge(e.segments,0,(e,t)=>e+(t.value>0?t.value:0))}(t);return e>n?e:n}),l=0===a?1:a,c=r.length,u=(o-2*(c+1|0))/c,d=s-4;return i("svg",{children:r.map((e,t)=>{let n=2+t*(u+2),r={contents:s};return i("g",{children:e.segments.map((t,o)=>{let s=t.value>0?t.value:0,a=s/l*d,c=r.contents-a;return r.contents=c,0===s?null:i("rect",{children:i("title",{children:e.label+" — "+t.key+": "+s.toString()}),height:a.toString(),width:u.toString(),fill:U(t.color,"var("+yt.brand+")"),x:n.toString(),y:c.toString()},t.key+":"+o.toString())})},e.label+":"+t.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:s.toString(),width:o.toString(),viewBox:"0 0 "+o.toString()+" "+s.toString()})};function u8(e){return"var("+e+")"}let d8=lo([pi("flex"),gi("column"),ci("gap",u8(_t.lg))]),f8=lo([ci("font-size",u8(bt.sizeXl)),ci("font-weight",u8(bt.weightMedium)),ci("color",u8(yt.textPrimary)),Ei(eo(0))]),h8=lo([pi("grid"),ci("grid-template-columns","repeat(auto-fill, minmax(300px, 1fr))"),ci("gap",u8(_t.md))]),p8=lo([pi("flex"),gi("column"),ci("gap",u8(_t.sm)),ci("padding",u8(_t.lg)),ci("background",u8(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",u8(xt.md))]),g8=lo([ci("font-size",u8(bt.sizeSm)),ci("font-weight",u8(bt.weightMedium)),ci("color",u8(yt.textSecondary))]),m8=lo([pi("flex"),ui("center"),ci("gap",u8(_t.lg))]),v8=lo([pi("flex"),gi("column"),ci("gap","4px"),ci("font-size",u8(bt.sizeSm)),ci("color",u8(yt.textSecondary))]),y8=lo([pi("flex"),ui("center"),ci("gap","6px")]);function _8(e){return lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",e)])}let b8=lo([ci("font-size",u8(bt.sizeXs)),ci("color",u8(yt.textDisabled))]),x8=lo([pi("flex"),bi("spaceBetween"),ui("center"),ci("gap",u8(_t.sm))]),S8=lo([pi("inlineFlex"),ci("gap",u8(_t.xs))]);function w8(e,t){return j(Je(e,t),e=>{let t=dt(e);return void 0!==t?t:z($R(e),e=>function(e,t){let n=UR(t);return void 0!==n?e/Math.pow(10,D(n).resolvedOptions().maximumFractionDigits):e}(e[0],e[1]))})}function E8(e){return e.map(e=>U(ft(e),{}))}function k8(e,t,n){switch(t){case"avg":case"sum":break;default:return e.length}if(void 0===n)return e.length;let r=me(E8(e),e=>w8(e,n)),i=ge(r,0,(e,t)=>e+t);return"sum"===t?i:0===r.length?0:i/r.length}function C8(e){let t=Math.round(100*e)/100;return t===Math.trunc(t)?Math.trunc(t).toString():t.toString()}function A8(e,t,n){return jo(e,n&&("count"===t||"sum"===t))}function N8(e,t,n,r){return n?"avg"===t?e+" · avg of the first "+r.toString()+" loaded":e+" · over the first "+r.toString()+" loaded":e}function T8(e){let t=U(e.aggregate,"count"),n=e.label;if(void 0!==n)return n;let r=e.field;switch(t){case"avg":return void 0!==r?e.view+" — avg "+at(r):e.view;case"sum":return void 0!==r?e.view+" — total "+at(r):e.view;default:return e.view}}function R8(e,t,n,r){let i=pe(n,e=>[]);return E8(e).forEach(e=>M(j(ca(t,e),fc),t=>{let o=0|Math.floor((r-t)/864e5);if(o>=0&&o<n)return M(i[(n-1|0)-o|0],t=>{t.push(e)})})),i}function D8(e,t,n,r,i,o){return R8(e,t,n,r).map(e=>k8(e.map(e=>e),i,o))}function I8(e,t){return me(E8(e),e=>JW(e,t))}function F8(e,t,n){let r=Bs(t,n),i=ge(e.filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r.concat(i)}function O8(e){return Q5[fe(e,Q5.length)]}function P8(e,t){return z(Je(e.semantics,t),e=>e.semantic)}function M8(e,t,n){let r=function(e,t){return z(_a(e).find(e=>e[0]===t),e=>e[1])}(e,t);if(void 0===r)return;let i=Na(r,"maximum");if(void 0===i)return mt(P8(n,t),"Percent")?{min:0,max:100}:void 0;let o=U(Na(r,"minimum"),0);return i>o?{min:o,max:i}:void 0}function L8(e,t,n){let r=P8(e,t);if(void 0===r)return C8(n);switch(r){case"Percent":return qR(n);case"Bytes":return GR(n);case"Duration":return VR(n);case"Currency":case"Money":return jR(n);default:return C8(n)}}function z8(e,t,n,r,i,o){return D8(e,t,n,r,i,o).map((e,t)=>({time:Xl(r-((n-1|0)-t|0)*hc),value:e}))}function j8(e){let t,n=s(()=>"Days30"),o=n[1],a=n[0],l=(e,t)=>{return i("button",{children:t,className:(n=a===e,lo([ci("background",n?u8(yt.surfaceSubtle):"transparent"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",u8(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("font-size",u8(bt.sizeXs)),ci("color",u8(n?yt.textPrimary:yt.textSecondary)),hi("pointer")])),type:"button",onClick:t=>o(t=>e)});var n};return t="Days30"===a?e.body:i(C6,{days:e.yearDays}),r("div",{children:[r("div",{children:[i("span",{children:e.title,className:g8}),r("div",{children:[l("Days30","30 days"),l("Year","Year")],className:S8})],className:x8}),t],className:p8})}let U8=function(e){let t=e.viewAccess,n=e.mockRows,s=e.uiHints,a=e.readModels,l=e.metrics,c=e.pluginId,u=void 0!==t?t:{},d=ae(),f=uG(),h=me(ge(l.map(e=>e.view),[],(e,t)=>e.includes(t)?e:e.concat([t])),e=>a.find(t=>t.name===e)),p=h.map(e=>{let t=uK(u,e.name,f);return[e,t,L3(e,t&&q(n))]}),g=e=>void 0===n&&L(p.find(t=>t[0].name===e),!1,e=>e[2].canLoadMore),m=Date.now(),v=me(l,e=>z(h.find(t=>t.name===e.view&&uK(u,t.name,f)),t=>{return{metric:e,readModel:t,rows:(r=t.name,void 0!==n?U(Je(n,r),[]):L(p.find(e=>e[0].name===r),[],e=>e[2].rows)),partial:g(t.name),semantics:za(t.schema,j(s,e=>mF(e,t.name)),{field:t.labelField,source:t.labelFieldSource})};var r})),y=v.map((e,t)=>{let n=U(e.metric.aggregate,"count"),r=z(e.semantics.dateSpan,t=>D8(e.rows,t,14,m,n,e.metric.field));return{key:t.toString()+":"+e.readModel.name,label:T8(e.metric),value:A8(C8(k8(e.rows,n,e.metric.field)),n,e.partial),sublabel:N8(e.readModel.name,n,e.partial,e.rows.length),spark:r,onOpen:()=>d(je(Wa(c,e.readModel.name)))}}),_=e=>{let t=e.readModel.lifecycleField;return void 0!==t?t:e.semantics.statusField},b=me(v,e=>z(e.semantics.dateSpan,t=>{let n,s,a=U(e.metric.aggregate,"count"),l=T8(e.metric)+" — trend",c=_(e);if("count"===a&&void 0!==c){let s=function(e,t,n,r,i,o){let s=R8(e,t,n,r),a=e=>me(e,e=>JW(e,o)),l=s.flatMap(a),c=F8(l,i,o).filter(e=>l.some(t=>t===e)),u=s.map((e,t)=>{let i=a(e);return{label:dc(r-864e5*((n-1|0)-t|0)),segments:c.map((e,t)=>({key:at(e),value:i.filter(t=>t===e).length,color:O8(t)}))}});return{statuses:c,bars:u}}(e.rows,t,30,m,e.readModel.schema,c),a=s.statuses;n=0===a.length?void 0:r(o,{children:[i(c8,{bars:s.bars}),i("div",{children:a.map((e,t)=>r("span",{children:[i("span",{className:_8(O8(t))}),at(e)],className:y8},e)),className:v8})]})}else n=void 0;if(void 0!==n)s=n;else{let n=D8(e.rows,t,30,m,a,e.metric.field);s=i(i6,{series:[{label:T8(e.metric),values:n}]})}return i(j8,{title:l,body:s,yearDays:z8(e.rows,t,365,m,a,e.metric.field)},"trend:"+T8(e.metric))})),x=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if("avg"===t&&void 0!==n)return z(M8(e.readModel.schema,n,e.semantics),t=>{let o=k8(e.rows,"avg",n);return r("div",{children:[i("span",{children:T8(e.metric),className:g8}),i(p6,{value:o,min:t.min,max:t.max,display:L8(e.semantics,n,o),caption:e.readModel.name+" · "+at(n)})],className:p8},"gauge:"+T8(e.metric))})}),S=[],w=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if(void 0===t)return;switch(t){case"avg":case"sum":break;default:return}if(void 0===n)return;if(S.includes(e.readModel.name+":"+n))return;S.push(e.readModel.name+":"+n);let o=function(e,t,n,r){return me(E8(e),e=>z(w8(e,t),t=>{let r=U(j(Je(e,"id"),ut),"");return{id:r,label:U(j(Je(e,n),ut),""===r?"—":r),value:t}})).toSorted((e,t)=>t.value-e.value).slice(0,r)}(e.rows,n,e.readModel.labelField,10).map(t=>({key:""===t.id?t.label:t.id,label:t.label,display:L8(e.semantics,n,t.value),value:t.value,onOpen:""===t.id?void 0:()=>d(Ja(c,e.readModel.name,t.id,[]))}));return 0===o.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — top by "+at(n),className:g8}),i(l8,{entries:o})],className:p8},"top:"+e.readModel.name+":"+n)}),E=me(v,e=>{let t=e.metric.viz,n=e.metric.field,o=e.metric.xField;if(void 0===t)return;if("scatter"!==t)return;if(void 0===n)return;if(void 0===o)return;let s=(a=e.rows,l=o,c=n,u=e.readModel.labelField,me(E8(a),e=>{let t=w8(e,l),n=w8(e,c);if(void 0!==t&&void 0!==n)return{label:U(j(Je(e,u),ut),U(j(Je(e,"id"),ut),"—")),x:t,y:n}}));var a,l,c,u;return 0===s.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — "+at(n)+" by "+at(o),className:g8}),i(J6,{points:s,xLabel:at(o),yLabel:at(n)})],className:p8},"scatter:"+T8(e.metric))}),k=me(v,e=>{let t=e.metric.viz,n=_(e);if(void 0===t)return;if("funnel"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=Bs(t,n),i=I8(e,n),o=me(i,e=>{let t=r.indexOf(e);return t<0?void 0:t});return{stages:r.map((e,t)=>({label:at(e),value:o.filter(e=>e>=t).length})),excluded:i.length-o.length|0}}(e.rows,e.readModel.schema,n),s=o.stages;if(0===s.length)return;let a=o.excluded;return r("div",{children:[i("span",{children:T8(e.metric)+" — "+at(n)+" funnel",className:g8}),i(U6,{stages:s,note:0===a?void 0:a.toString()+" row(s) with an unlisted "+at(n)+" excluded"})],className:p8},"funnel:"+T8(e.metric))}),C=me(v,e=>{let t=U(e.metric.aggregate,"count"),n=mt(e.metric.viz,"funnel")?void 0:_(e);if("count"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=I8(e,n);return me(F8(r,t,n),e=>{let t=r.filter(t=>t===e).length;return 0===t?void 0:{label:at(e),value:t}})}(e.rows,e.readModel.schema,n);return 0===o.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — by "+at(n),className:g8}),r("div",{children:[i(o6,{slices:o}),i("div",{children:o.map((e,t)=>r("span",{children:[i("span",{className:_8(Y5(e,t))}),e.label+" ("+C8(e.value)+")"],className:y8},e.label)),className:v8})],className:m8})],className:p8},"status:"+e.readModel.name)}),A=($(n)?[]:me(p,e=>{let t=e[0],n=e[2].fetchState;if(e[1])return"object"!=typeof n?"Loading"===n?t.name+": loading…":void 0:(n.TAG,t.name+": "+n._0)})).concat(dK(u,h.map(e=>e.name),f)),N=[k,E,x,b,w,C].flatMap(e=>e),T=ge(me(v,e=>{if(e.partial)return e.readModel.name}),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r("div",{children:[i("h2",{children:"Dashboard",className:f8}),i(X5,{kpis:y}),0!==N.length?i("div",{children:N,className:h8}):null,0!==T.length?i("span",{children:"Figures cover the rows loaded for: "+T.join(", "),className:b8}):null,0!==A.length?i("span",{children:A.join(" · "),className:b8}):null],className:d8})};function B8(e){switch(e){case"PlatformSuppliedField":return"platform-supplied-field";case"NewEntityIdentity":return"new-entity-identity";case"SelfReference":return"self-reference";case"AlreadyPlaced":return"already-placed";case"NarrowerRefTarget":return"narrower-ref-target";case"OptionalField":return"optional-field";case"SystemCommand":return"system-command"}}function $8(e){switch(e){case"PlatformSuppliedField":return"the field is @owner — the resolver overwrites it with the caller's id";case"NewEntityIdentity":return"the field is the new entity's own id, minted at submit";case"SelfReference":return"the command's own aggregate is this view — it is already an Instance command";case"AlreadyPlaced":return"this view already offers the command";case"NarrowerRefTarget":return"an explicit @ref names a different view, so this one is wider than the command accepts";case"OptionalField":return"the field is optional, so the command is not about the row";case"SystemCommand":return"the command is platform-run, never clicked"}}function q8(e){return!!$(e.tier)&&0===e.vetoes.length}function G8(e){return 0!==e.vetoes.length}function V8(e){return!!q(e.tier)&&0===e.vetoes.length}function K8(e,t,n,r,i,o){let s=[];mt(e.command.ownerField,n)&&s.push("PlatformSuppliedField");let a=e.enclosingAggregate,l=JD(n),c=void 0!==a&&void 0!==l&&l.toLowerCase()===a.name.toLowerCase();return"Collection"===e.command.level&&(mt(e.command.aggregateIdField,n)||c)&&s.push("NewEntityIdentity"),QD(function(e){let t=e.command.aggregateIdField;if(void 0!==t)return U(JD(t),t);let n=e.enclosingAggregate;return void 0!==n?n.name:e.slice}(e),o,{pluginId:t.pluginId,viewName:t.name})&&s.push("SelfReference"),t.placed.some(t=>t===e.command.name)&&s.push("AlreadyPlaced"),i&&s.push("NarrowerRefTarget"),r.some(e=>e===n)||s.push("OptionalField"),e.system&&s.push("SystemCommand"),s}function W8(e,t,n,r,i){let o=function(e){return e.flatMap(e=>{let t=(t,n,r,i)=>r.map(r=>({pluginId:e.id,slice:t,command:r,enclosingAggregate:n,system:i})),n=e.aggregates.flatMap(e=>t(e.name,e,e.commands,!1).concat(t(e.name,e,U(e.systemCommands,[]),!0))),r=e.stateChangeSlices.flatMap(e=>t(e.name,void 0,e.commands,!1).concat(t(e.name,void 0,U(e.systemCommands,[]),!0)));return n.concat(r)})}(t),s=void 0!==i?i:v2,a=[];return o.forEach(t=>{let n=t3(t.command.schema);var i;(i=t.command.schema,L(j(j(ft(i),e=>Je(e,"properties")),ft),[],e=>me(Xe(e),e=>{let t=e[0],n=ft(e[1]),r=$(j(n,e=>Je(e,"const"))),i=j(j(n,e=>Je(e,"type")),ut),o=j(j(j(j(n,e=>Je(e,"items")),ft),e=>Je(e,"type")),ut);if(!r&&void 0!==i)switch(i){case"array":return"string"===o?t:void 0;case"string":return t;default:return}}))).forEach(i=>{let o,l=function(e,t,n){return z(e.references.find(e=>e.fieldName===t),e=>{let t=e.plugin,r=void 0!==t?n.filter(e=>e.pluginId===t):n,i=Ka(r,e.entity);return void 0!==i?i:Va(r,e.entity)})}(t.command,i,r),c=function(e,t){return j(JD(e),e=>Va(t,e))}(i,r);if(void 0!==l){let e=D(l),t=0;void 0!==e&&void 0!==c&&e.pluginId===c.pluginId&&e.name===c.name?o=[[e,!0]]:t=1,1===t&&(o=[[e,!0],[c,!1]])}else o=[[c,!1]];o.forEach(o=>{let c=o[1];M(o[0],o=>{e.filter(e=>e.pluginId===o.pluginId&&e.name===o.name).forEach(e=>{let o=K8(t,e,i,n,!c&&$(l),r),u=c&&t.pluginId===e.pluginId?"ExplicitRefSamePlugin":void 0,d=$(u)&&0===o.length?s(t.command,t.enclosingAggregate,t.pluginId):t.command;a.push({viewName:e.name,action:{label:d.label,pluginId:t.pluginId,slice:t.slice,command:d,field:i},tier:u,vetoes:o})})})})})}),a}function H8(e,t){return e.filter(e=>e.viewName===t)}let J8={actor:"",eventType:"",timeFrom:"",timeTo:""};function X8(e){return""!==e.actor||""!==e.eventType||""!==e.timeFrom||""!==e.timeTo}function Q8(e){return"var("+e+")"}let Y8=lo([pi("flex"),gi("column"),ci("gap",Q8(_t.sm))]),Z8=lo([pi("flex"),ui("center"),ci("gap",Q8(_t.md)),yi("wrap"),ci("padding-bottom",Q8(_t.xs)),ci("border-bottom","1px solid var("+yt.border+")")]),e9=lo([pi("flex"),ui("center"),ci("gap","4px")]),t9=lo([ci("color",Q8(yt.textSecondary)),ci("font-size",Q8(bt.sizeSm)),ci("white-space","nowrap")]),n9=lo([ci("background",Q8(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Q8(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("font-size",Q8(bt.sizeSm)),ci("color",Q8(yt.textPrimary)),ci("outline","none"),Ji([ci("border-color",Q8(yt.brand))])]),r9=lo([ci("background","none"),ci("border","none"),ci("padding","0"),ci("color",Q8(yt.brand)),ci("font-size",Q8(bt.sizeSm)),hi("pointer"),Qi([ci("text-decoration","underline")])]),i9=lo([pi("flex"),bi("center"),ci("padding-top",Q8(_t.xs))]),o9=lo([ci("background",Q8(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Q8(xt.sm)),ci("padding","4px var("+_t.md+")"),ci("font-size",Q8(bt.sizeSm)),ci("color",Q8(yt.textPrimary)),hi("pointer"),Qi([ci("border-color",Q8(yt.brand))])]);let s9=function(e){let t=e.emptyLabel,n=e.onLoadMore,o=e.loading,s=e.hasMore,a=e.onFilterChange,l=e.filter,c=void 0!==s&&s,u=void 0!==o&&o,d=void 0!==t?t:"No recorded history for this record",f=me([["actor","Actor",e.actors.map(e=>({label:e,value:e})),l.actor],["eventType","Event",e.eventTypes.map(e=>({label:at(e),value:e})),l.eventType]],e=>{let t=e[2];return 0===t.length?void 0:{key:e[0],label:e[1],options:t,value:e[3]}});return r("div",{children:[r("div",{children:[i(C0,{filters:f,onFilterChange:(e,t)=>{switch(e){case"actor":return a({actor:t,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:l.timeTo});case"eventType":return a({actor:l.actor,eventType:t,timeFrom:l.timeFrom,timeTo:l.timeTo});default:return}}}),r("div",{children:[i("span",{children:"From:",className:t9}),i("input",{className:n9,type:"date",value:l.timeFrom,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:e.target.value,timeTo:l.timeTo})}),i("span",{children:"To:",className:t9}),i("input",{className:n9,type:"date",value:l.timeTo,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:e.target.value})})],className:e9}),X8(l)?i("button",{children:"Clear filters",className:r9,onClick:e=>a(J8)}):null],className:Z8}),i(VY,{entries:e.entries,emptyLabel:X8(l)?"No events match these filters":d,onEntryClick:e.onEntryClick,nowMs:e.nowMs}),c?i("div",{children:i("button",{children:u?"Loading…":"Load earlier events",className:o9,disabled:u,onClick:e=>M(n,e=>e())}),className:i9}):null],className:Y8})};let a9=function(e){let t=e.entityId,n=e.binding,r=SI(),o=uG(),l=L(e.requiredAccess,!1,e=>!o(e)),c=s(()=>[]),u=c[1],d=c[0],f=s(()=>J8),p=f[1],g=f[0],m=s(()=>!0),v=m[1],y=s(()=>{}),_=y[1],b=y[0],x=s(()=>!1),S=x[1],w=s(()=>{})[1],E=s(()=>0),k=E[1],C=E[0],A=h(void 0),N=g.actor+"|"+g.eventType+"|"+g.timeFrom+"|"+g.timeTo;a(()=>{if(!l)if(void 0!==r){let e=0===C,i=e?void 0:A.current;v(e=>!0),_(e=>{}),ce(r(n.queryDocument,function(e,t,n){let r={};return r.entityId=e,r.first=50,M(n,e=>{r.after=e}),""!==t.actor&&(r.user=t.actor),""!==t.eventType&&(r.eventTypes=[t.eventType]),M(function(e){return""===e?void 0:e+"T00:00:00.000Z"}(t.timeFrom),e=>{r.timeFrom=e}),M(function(e){return""===e?void 0:e+"T23:59:59.999Z"}(t.timeTo),e=>{r.timeTo=e}),r}(t,g,i)).then(t=>{let r=function(e,t){return me(CI(e,t),HV)}(t,n.queryField),i=function(e,t){let n=NI(e,t);return[n.hasNextPage,n.endCursor]}(t,n.queryField),o=i[1],s=i[0];return u(t=>e?r:r.concat(t)),S(e=>s),w(e=>o),A.current=o,v(e=>!1),Promise.resolve()}),e=>(v(e=>!1),_(e=>"Could not load the history for this record."),Promise.resolve()))}else _(e=>"Not connected")},[N,C,l]);let T=e=>{A.current=void 0,k(e=>0),u(e=>[]),p(t=>e)},R=()=>k(e=>e+1|0);return l?null:void 0!==b?i(M0,{title:"History unavailable",detail:b,onRetry:()=>k(e=>e+1|0)}):i(s9,{entries:QV(d,n.displayName),actors:YV(d),eventTypes:ZV(d),filter:g,onFilterChange:T,hasMore:x[0],loading:m[0],onLoadMore:R})};function l9(e){return"var("+e+")"}let c9=lo([pi("flex"),gi("column"),ci("gap",l9(_t.lg))]),u9=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",l9(_t.md))]),d9=lo([ci("font-size",l9(bt.sizeXl)),ci("font-weight",l9(bt.weightMedium)),ci("color",l9(yt.textPrimary)),Ei(eo(0))]),f9=lo([pi("flex"),yi("wrap"),ui("center"),ci("gap",l9(_t.md)),ci("font-size",l9(bt.sizeSm)),ci("color",l9(yt.textSecondary))]),h9=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),hi("pointer")]);let p9=lo([ci("font-size",l9(bt.sizeXs)),ci("color",l9(yt.textDisabled))]),g9=lo([pi("flex"),ui("center"),ci("gap",l9(_t.sm))]),m9=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",l9(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",l9(yt.textSecondary)),ci("font-size",l9(bt.sizeSm)),hi("pointer"),Qi([ci("background",l9(yt.surfaceSubtle)),ci("color",l9(yt.textPrimary))])]);let v9=function(e){let t=e.viewAccess,n=e.uiHints,o=e.readModels,a=e.pluginId,l=void 0!==t?t:{},c=ae(),u=uG(),d=SI(),f=wI(),h=Ga(),p=A0(),g=s(()=>[]),m=g[1],v=g[0],y=o.map((e,t)=>{let n=uK(l,e.name,u),r=n&&!v.includes(e.name);return[e,t,r,n,L3(e,r)]}),_=(e,t)=>U(j(j(n,t=>gF(t,e.name)),e=>e.accent),WZ[fe(t,WZ.length)]),b=me(y,e=>{let t=e[4],r=e[0],i=j(n,e=>gF(e,r.name)),o=za(r.schema,j(n,e=>mF(e,r.name)),{field:r.labelField,source:r.labelFieldSource}),s=z(o.statusField,e=>a3(e,r.commands,j(i,e=>e.transitions))),l=m1(d,f,r.commands,r.name,t.isLive,t.refetch,h,p.onNotice,void 0);if(e[2])return{readModelName:r.name,rows:t.rows,schema:r.schema,semantics:o,accent:_(r,e[1]),window:Mo(t.canLoadMore),onOpenRow:(e,t)=>c(Ja(a,r.name,e,[])),onCommand:z(s,e=>l),statusCommandFor:s,ownEntity:{pluginId:a,viewName:r.name}}}),x=me(y,e=>{if(e[2]&&e[4].canLoadMore)return e[0].name}),S=me(y,e=>{let t=e[0],n=e[4].fetchState;if(e[2])return"object"!=typeof n?"Loading"===n?t.name+": loading…":void 0:(n.TAG,t.name+": "+n._0)}).concat(dK(l,o.map(e=>e.name),u));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:d9}),className:u9}),i("div",{children:y.filter(e=>e[3]).map(e=>{let t=e[0];return r("label",{children:[i("input",{checked:e[2],type:"checkbox",onChange:e=>{let n=t.name;m(e=>e.includes(n)?e.filter(e=>e!==n):e.concat([n]))}}),i("span",{className:(n=_(t,e[1]),lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",n)]))}),t.name],className:h9},t.name);var n}),className:f9}),p.element,e.mode.render(b),0!==x.length?r("div",{children:[i("button",{children:"Load more",className:m9,onClick:e=>{y.forEach(e=>{let t=e[4];if(e[2]&&t.canLoadMore)return t.loadMore()})}}),i("span",{children:"More rows available: "+x.join(", "),className:p9})],className:g9}):null,0!==S.length?i("span",{children:S.join(" · "),className:p9}):null],className:c9})};function y9(e){return"var("+e+")"}let _9=lo([pi("flex"),gi("column"),ci("gap",y9(_t.lg)),ci("padding","0 var("+_t.md+")"),ci("min-width","0")]),b9=lo([pi("flex"),ui("center"),ci("gap",y9(_t.sm)),vi(0)]),x9=lo([pi("flex"),gi("column"),ci("gap",y9(_t.sm)),ci("min-width","0")]),S9=lo([pi("flex"),ui("start"),ci("gap",y9(_t.md)),ci("padding","var("+_t.xs+") 0"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),Yi([ci("border-bottom","none")])]),w9=lo([ci("color",y9(yt.textSecondary)),ci("font-size",y9(bt.sizeMd)),ci("font-weight",y9(bt.weightMedium)),ci("white-space","nowrap"),ci("padding-top","2px"),vi(0),ci("min-width","200px")]),E9=lo([ci("color",y9(yt.textPrimary)),ci("font-size",y9(bt.sizeMd)),ci("word-break","break-word"),ci("min-width","0")]),k9=lo([pi("flex"),ui("start"),ci("gap",y9(_t.md)),ci("padding","var("+_t.xs+") 0"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),Yi([ci("border-bottom","none")])]),C9=lo([ci("color",y9(yt.textSecondary)),ci("font-size",y9(bt.sizeMd)),ci("font-weight",y9(bt.weightMedium)),ci("padding-top","2px"),vi(0),ci("min-width","200px")]),A9=lo([pi("flex"),gi("column"),ci("gap",y9(_t.sm)),mi(1),ci("padding",y9(_t.md)),ci("background",y9(yt.surfaceSubtle)),ci("border-radius",y9(xt.md)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("min-width","0")]),N9=lo([pi("flex"),gi("column"),ci("gap",y9(_t.sm)),ci("min-width","0")]),T9=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",y9(_t.md)),ci("padding-bottom",y9(_t.xs)),ci("border-bottom","1px solid var("+yt.borderSubtle+")")]),R9=lo([ci("color",y9(yt.textPrimary)),ci("font-size",y9(bt.sizeMd)),ci("font-weight",y9(bt.weightMedium))]),D9=lo([ci("overflow-x","auto"),ci("max-width","100%"),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",y9(xt.md))]),I9=lo([ci("color",y9(yt.textDisabled)),ci("font-size",y9(bt.sizeSm))]);function F9(e,t){return U(j(j(ft(e),e=>Je(e,"title")),ut),at(t))}function O9(e){return j(j(ft(e),e=>Je(e,"type")),ut)}function P9(e){return j(j(ft(e),e=>Je(e,"format")),ut)}function M9(e){return $(j(j(ft(e),e=>Je(e,"properties")),ft))}function L9(e){let t=e.toLowerCase(),n=e.length,r=r=>{let i=r.length;if(n>i&&t.endsWith(r))return e.slice(0,n-i|0)},i=r("ids");if(void 0!==i)return i;let o=r("id");return void 0!==o?o:void 0}function z9(e,t){let n=Mt(t),r=O9(n),i=It(n);if(void 0!==i)return{TAG:"TaggedUnion",_0:i};if(void 0!==r)switch(r){case"array":let t=function(e){return j(ft(e),e=>Je(e,"items"))}(n);if(void 0===t)return"ArrayOfScalars";let r=O9(t);if(M9(t)||mt(r,"object"))return{TAG:"ArrayOfObjects",_0:t};if(!mt(r,"string"))return"ArrayOfScalars";let i=L9(e);return void 0!==i?{TAG:"EntityRefArray",_0:i}:"ArrayOfStrings";case"boolean":return"Bool";case"object":return M9(n)?{TAG:"NestedObject",_0:n}:{TAG:"Scalar",_0:"object",_1:void 0}}if(!function(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}(e))return{TAG:"Scalar",_0:U(r,"string"),_1:P9(n)};let o=L9(e);return void 0!==o?{TAG:"EntityRef",_0:o}:{TAG:"Scalar",_0:U(r,"string"),_1:P9(n)}}function j9(e,t,n,r){let o=ct(e);if("object"!=typeof o)switch(o){case"JSONFalse":return i(xs,{variant:"Neutral",label:"false",dot:!1});case"JSONTrue":return i(xs,{variant:"Success",label:"true",dot:!1});case"JSONNull":return i("span",{children:"—",className:I9})}else switch(o.TAG){case"JSONString":let r=o._0;return"date-time"===t?gs(r):U(_s(n,r),r);case"JSONNumber":return o._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}function U9(e){return U(z(ht(e),e=>e.map(e=>{let t=ct(e);if("object"!=typeof t)switch(t){case"JSONFalse":return"false";case"JSONTrue":return"true";case"JSONNull":return"—"}else switch(t.TAG){case"JSONString":return t._0;case"JSONNumber":return t._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}})),[])}function B9(e){return U(z(ht(e),e=>me(e,ft)),[])}function $9(e,t){let n=j(Je(e,"id"),ut);if(void 0!==n)return n;let r=j(Je(e,"compositeId"),ut);return void 0!==r?r:"#"+t.toString()}function q9(e){return e.map((e,t)=>({key:$9(e,t),row:e}))}let G9=function(e){let t,n,o=e.headerAccessory,a=e.entityPanel,l=e.uiHints,c=e.viewName,u=e.pluginId,f=e.drillPath,h=e.labelField,p=e.aggregateId,g=e.lifecycleField,m=e.rowActions,v=e.commands,y=e.rootLabel,_=e.schema,b=e.data,x=void 0!==v?v:[],S=void 0!==m?m:[],w=void 0!==f?f:[],E=SI(),k=u1(),C=Ga(),A=qe(),N=d(b5),T=PG(),R=d(Z4),D=L(R,!1,e=>"Bar"===e.placement)&&$(T),I=void 0!==u&&void 0!==c?{pluginId:u,viewName:c}:void 0,F=ae(),O=s(()=>[]),B=O[1],G=s(()=>{}),V=G[1],K=s(()=>({})),W=K[1],H=K[0],X=Iq(),Q=$(u)&&$(c)?w:O[0],Y=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return F(Ja(u,c,p,e));B(t=>e)},Z=function(e,t,n){for(;;){let r=t,i=r[0];if(void 0===i)return e;let o=e[e.length-1|0];if(void 0===o)return;let s,a=$(ft(o.data)),l=ht(o.data);if(a){let e=U(ft(o.data),{}),t=j(j(ft(o.schema),e=>Je(e,"properties")),ft),n=j(t,e=>Je(e,i)),r=Je(e,i);s=void 0!==r&&void 0!==n?{data:r,schema:n,label:F9(n,i)}:void 0}else if($(l)){let e=U(l,[]),t=U(j(ft(o.schema),e=>Je(e,"items")),o.schema),n=e.find((e,t)=>$9(U(ft(e),{}),t)===i);s=void 0!==n?{data:n,schema:t,label:i}:void 0}else s=void 0;if(void 0===s)return;e.push(s),n.push(i),t=r.slice(1)}}([{data:b,schema:_,label:y}],Q,[]),ee=U(ft(b),{}),te=tI(_,"Drill",C,I,h,void 0),ne=qI([ee],te,C,I,void 0),re={lookupLabel:(e,t)=>DI(ne,e,C,t),isMissing:(e,t)=>OI(ne,e,C,t),retiredBadge:(e,t)=>II(ne,e,C,t),linkable:(e,t)=>FI(ne,e,C,t,!1)},ie=L(j(Cq(),e=>e.identity),[],e=>e.groups),oe=(e,t,n)=>r("div",{children:[i("div",{children:t,className:w9}),i("div",{children:n,className:E9})],className:S9},e),se=(e,t,n)=>QD(e,C,I)?n:oI(e,t,C,n),le=function(e,t){if(void 0!==t&&"id"!==t)return j(j(j(ft(e),e=>Je(e,t)),ut),e=>""===e?void 0:e)}(b,h),ue=e=>{let t=ct(e.data);if("object"!=typeof t){if("JSONNull"===t)return i("span",{children:"—",className:I9})}else switch(t.TAG){case"JSONObject":let t=U(ft(e.data),{}),n=0===Q.length,o=tI(e.schema,"Drill",C,I,n?h:void 0,void 0),s=n&&$(le)?function(e,t){let n=e.filter(e=>vt(e.key,t));return 0===n.length?e:n}(o,h):o;return 0===s.length?i("span",{children:"(no fields)",className:I9}):i("div",{children:s.map(e=>{let n=e.key,o=e.propSchema,s=P(Je(t,n),e=>"JSONNull"!==ct(e)),a=F9(o,n),d=z9(n,o);if(void 0===s)return oe(n,a,U(function(e,t){return gD(e,t,null)}(n,o),i("span",{children:"—",className:I9})));if("object"!=typeof d){if("Bool"===d)return oe(n,a,j9(s,void 0,n))}else switch(d.TAG){case"Scalar":let e=gD(n,o,s);return oe(n,a,void 0!==e?e:j9(s,d._1,n));case"EntityRef":let f=d._0;return oe(n,se(f,!1,a),lI(0,f,s,C,0,re,I,void 0,void 0));case"EntityRefArray":let h=d._0;return oe(n,se(h,!0,a),lI(0,h,s,C,0,re,I,void 0,void 0));case"NestedObject":let p=gD(n,o,s);if(void 0!==p)return oe(n,a,p);let g=tI(d._0,"Drill",C,I,void 0,void 0),m=U(j(Je(t,n),ft),{});return r("div",{children:[i("div",{children:a,className:C9}),i("div",{children:g.map(e=>{let t=Je(m,e.key);return r("div",{children:[i("div",{children:sI(e,C,I),className:w9}),i("div",{children:dI(e.key,e.kind,e.propSchema,t,void 0,C,A,re,I),className:E9})],className:S9},e.key)}),className:A9})],className:k9},n);case"ArrayOfObjects":let v=d._0,_=q9(B9(s)),b=_.length,x=U(c,y),S=x+"."+n,w=j(l,e=>gF(e,S)),E=FF(v,w,{registry:C,ownEntity:I}),k=eF(u,x,n),N=Je(H,n),T=OF(void 0!==N?N:tF(k),w,js(v),void 0,E),R=e=>{nF(k,e,X),W(t=>{let r=Ye(Xe(t));return r[n]={mode:e,band:X},r})},D=U(ht(s),[]),F=e=>{let t=za(v,j(l,e=>mF(e,S)),void 0),r=j(w,e=>e.accent),i={readModelName:S,rows:D,schema:v,semantics:t,accent:r,window:"Complete",onOpenRow:(e,t)=>{let r=function(e,t){let n=e.findIndex(t);if(-1!==n)return n}(D,e=>e===t),i=void 0!==r?L(_[r],e,e=>e.key):e;Y(Q.concat([n,i]))}};return e.render([i])},O=tI(v,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:e.label,render:t=>dI(e.key,e.kind,e.propSchema,Je(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width})),P=0===b?i("span",{children:"(empty)",className:I9}):i("div",{children:i(Po,{columns:O,data:_,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([n,e.key])),density:"Comfortable"}),className:D9}),M=void 0!==T&&T.id!==VI?F(T):P;return r("div",{children:[r("div",{children:[i("span",{children:a,className:R9}),r("span",{children:[E.length>1?i(lF.make,{modes:E,activeId:L(T,VI,e=>e.id),onSelect:R}):null,i(hs,{count:b,label:"items",onClick:()=>Y(Q.concat([n]))})],style:{display:"inline-flex",alignItems:"center",gap:"8px"}})],className:T9}),M],className:N9},n);case"TaggedUnion":let z=gD(n,o,s);if(void 0!==z)return oe(n,a,z);let B=pa(s);if(void 0===B)return oe(n,a,j9(s,void 0,n));let $=B[1],q=B[0],G=Ot(d._0,q),V=L(G,q,e=>e.tag),K=L(G,[],e=>tI(Pt(e),"Drill",C,I,void 0,void 0)),J=r("span",{children:[a,rI(V)],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}});return 0!==K.length?r("div",{children:[i("div",{children:J,className:C9}),i("div",{children:K.map(e=>r("div",{children:[i("div",{children:sI(e,C,I),className:w9}),i("div",{children:dI(e.key,e.kind,e.propSchema,Je($,e.key),void 0,C,A,re,I),className:E9})],className:S9},e.key)),className:A9})],className:k9},n):oe(n,a,rI(V))}return oe(n,a,i(Yo,{items:U9(s)}))}),className:x9});case"JSONArray":let a=q9(B9(e.data)),d=U(j(ft(e.schema),e=>Je(e,"items")),e.schema),f=tI(d,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:sI(e,C,I),render:t=>dI(e.key,e.kind,e.propSchema,Je(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width}));return 0===a.length?i("span",{children:"(empty)",className:I9}):i("div",{children:i(Po,{columns:f,data:a,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([e.key])),density:"Comfortable"}),className:D9})}return i("div",{children:j9(e.data,void 0,void 0),className:E9})},de=U(le,U(p,y)),fe=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return Ja(u,c,p,Q.slice(0,e))},he=void 0!==Z?Z.slice(0,Z.length-1|0).map((e,t)=>({label:0===t?de:e.label,href:fe(t),onClick:()=>Y(Q.slice(0,t))})):[],pe=L(R,[],e=>e.ancestors).concat(he);if(void 0!==Z){let e=Z.length,n=Z[Z.length-1|0];t=1!==e&&void 0!==n?n.label:de}else t=de;if(void 0!==Z){let e=Z[Z.length-1|0];n=void 0!==e?ue(e):null}else n=i(M0,{title:"Drill path no longer valid",detail:"The data shape has changed since this view was opened.",onRetry:()=>Y([])});let ge,me=0===Q.length,ve=me?XW(x.filter(e=>"Instance"===e.level),ee,g):[];if(me&&void 0!==g){let e=Bs(_,g),t=a3(g,x,j(j(l,e=>j(c,t=>gF(e,t))),e=>e.transitions));if(e.map((n,r)=>e.slice(0,r).some(e=>$(t(n,e)))).some(e=>e))ge=void 0;else{let e=function(e,t,n){return function(e,t){let n=e.indexOf(t);return e.map((e,t)=>[e,n<0?"Upcoming":t<n?"Done":t===n?"Current":"Upcoming"])}(Bs(e,t),n).map(e=>{let t=e[0];return{key:t,label:at(t),state:e[1]}})}(_,g,U(JW(ee,g),""));ge=0!==e.length?i(oZ,{steps:e}):void 0}}else ge=void 0;let ye=me?U(j($s(_,j(j(l,e=>j(c,t=>gF(e,t))),e=>e.retiredLabel)),e=>qs(e,Je(ee,e.field))),null):null,_e=me&&void 0!==p?S.map(e=>{let t=x2(e,p);return{key:"rowAction:"+e.command.name,label:e.label,run:()=>V(e=>({command:t.command,rowId:void 0,initialValues:t.initialValues,navigateTo:t.navigateTo,formKey:t.formKey}))}}):[],be=i(l1,{crumbs:pe,title:t,titleAccessory:r("div",{children:[ye,me&&void 0!==o&&void 0!==p?o(p):null],className:b9}),commands:ve.map(e=>({key:e.name,label:e.label,run:()=>V(t=>({command:e,rowId:p,formKey:e.name+":"+U(p,"")}))})).concat(_e),controls:j(R,e=>e.controls),inBar:D});return r("div",{children:[MG(D?T:void 0,be),U(ge,null),me?i(Zs,{fill:e=>{if(void 0!==p)return z(P(v5(_,e,x),e=>y5(e.command,ie)),e=>()=>V(t=>({command:e.command,rowId:p,formKey:e.command.name+":"+U(p,"")})))},children:n}):n,me&&void 0!==a&&void 0!==p?a(p):null,L(G[0],null,e=>{let t=e.command;return i(YK,{isOpen:!0,onClose:()=>V(e=>{}),title:t.label,children:i(J4,{schema:t.schema,aggregateId:e.rowId,aggregateIdField:t.aggregateIdField,injectNewId:"Collection"===t.level,ownerField:t.ownerField,ownerValue:t.ownerValue,initialValues:e.initialValues,refFields:t.refFields,onSubmit:n=>void 0!==k?ce(k(t.mutationDocument,s4(t.schema,n)).then(n=>{if("object"!=typeof n)return"Accepted"===n?(V(e=>{}),M(N,e=>e()),M(e.navigateTo,J),Promise.resolve("Ok")):(V(e=>{}),q(e.navigateTo)&&M(N,e=>{setTimeout(e,500)}),M(e.navigateTo,J),Promise.resolve("Ok"));{if("Rejected"===n.TAG){let e=n._0;return p1(E,C,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let e=n._0;return console.error("[AutoUI] "+t.name+": command not executed — "+e),Promise.resolve({TAG:"Err",_0:e})}}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(V(e=>{}),Promise.resolve("Ok")),submitLabel:"Execute"},e.formKey)})})],className:_9})};function V9(e){return"var("+e+")"}let K9=lo([pi("flex"),gi("column"),ci("gap",V9(_t.md))]),W9=lo([pi("flex"),ui("center"),ci("gap",V9(_t.md)),ci("flex-wrap","wrap"),ci("padding-bottom",V9(_t.sm)),ci("border-bottom","1px solid var("+yt.border+")")]),H9=lo([ci("font-size",V9(bt.sizeLg)),ci("font-weight",V9(bt.weightMedium)),ci("color",V9(yt.textPrimary)),Ei(eo(0))]),J9=lo([pi("flex"),ui("center"),yi("wrap"),ci("gap",V9(_t.sm)),ci("margin-left","auto")]);let X9=function(e){let t=e.contextId,n=e.slice,o=SI(),a=u1(),l=Ga(),c=s(()=>{}),u=c[1];return r("div",{children:[r("div",{children:[i("h2",{children:n.name,className:H9}),i("div",{children:n.commands.map(e=>i("button",{children:e.label,className:a1,onClick:t=>u(t=>e)},e.name)),className:J9})],className:W9}),L(c[0],null,e=>i(YK,{isOpen:!0,onClose:()=>u(e=>{}),title:e.label,children:i(J4,{schema:e.schema,aggregateId:t,aggregateIdField:e.aggregateIdField,injectNewId:"Collection"===e.level,ownerField:e.ownerField,ownerValue:e.ownerValue,refFields:e.refFields,onSubmit:t=>void 0!==a?ce(a(e.mutationDocument,s4(e.schema,t)).then(t=>{if("object"==typeof t){if("Rejected"===t.TAG){let e=t._0;return p1(o,l,e.errorCode,e.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let n=t._0;return console.error("[AutoUI] "+e.name+": command not executed — "+n),Promise.resolve({TAG:"Err",_0:n})}return u(e=>{}),Promise.resolve("Ok")}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(u(e=>{}),Promise.resolve("Ok")),submitLabel:"Execute"},e.name+":"+U(t,""))}))],className:K9})};let Q9=function(e){let t=e.uiHints,n=e.hostViewName,a=e.entityId,l=e.binding,c=Ga(),u=qe(),d=ae(),f=uG(),h=L(e.requiredAccess,!1,e=>!f(e)),p=M3(l.readModel,function(e,t){let n={};return M(IK(Ye([[e.refField,t]]),"",{search:!1},[]),e=>{n.filter=e}),n}(l,a),a,!h,void 0,25),g=p.rows.map(e=>U(ft(e),{})),m=function(e,t){let n=ft(e);if(void 0===n)return e;let r=Ye(Xe(n)),i=j(Je(r,"properties"),ft);if(void 0===i)return e;let o=Ye(Xe(i).filter(e=>e[0]!==t));r.properties=o;let s=j(Je(r,"required"),ht);return void 0!==s&&(r.required=s.filter(e=>vt(ut(e),t))),r}(l.readModel.schema,l.refField),v=Ka(c,l.readModel.name),y=z(v,e=>({pluginId:e.pluginId,viewName:l.readModel.name})),_=function(e,t){return e+"."+t.readModel.name}(n,l),b=za(m,j(t,e=>mF(e,_)),{field:l.readModel.labelField,source:l.readModel.labelFieldSource}),x=tI(m,"List",c,y,b.labelField,b.projectedLabelField),S=j(t,e=>gF(e,_)),w=FF(l.readModel.schema,S,{registry:c,ownEntity:y}),E=eF(e.pluginId,n,l.readModel.name),k=s(()=>tF(E)),C=k[1],A=Iq(),N=OF(k[0],S,js(l.readModel.schema),void 0,w),T=qI(g,x,c,y,void 0),R={lookupLabel:(e,t)=>DI(T,e,c,t),isMissing:(e,t)=>OI(T,e,c,t),retiredBadge:(e,t)=>II(T,e,c,t),linkable:(e,t)=>FI(T,e,c,t,!1)},D=pI(x,c,u,Je,void 0,R,y,void 0,void 0,void 0),I=e=>j(Je(e,"id"),ut),F=e=>U(I(e),JSON.stringify(e)),O=e=>M(v,t=>d(Ja(t.pluginId,t.name,e,[]))),P=z(v,e=>e=>M(I(e),O));if(h)return null;let B,$=p.fetchState;if("object"!=typeof $)if("Loading"===$)B=i(I1,{});else{let e,t=0;void 0!==N&&N.id!==VI?e=(e=>{let t=l.readModel.name,n=p.rows,r=j(S,e=>e.accent),i=Mo(p.canLoadMore),o={readModelName:t,rows:n,schema:m,semantics:b,accent:r,window:i,onOpenRow:(e,t)=>{let n=j(ft(t),I);return O(void 0!==n?n:e)},ownEntity:y,refLabels:R};return e.render([o])})(N):t=1,1===t&&(e=i(Po,{columns:D,data:g,keyFn:F,onRowClick:P})),B=r(o,{children:[e,p.canLoadMore?i("button",{children:"Load more",onClick:e=>p.loadMore()}):null]})}else B="Error"===$.TAG?i(M0,{title:"Could not load related rows",detail:$._0,onRetry:p.refetch}):i(M0,{title:"Not available",detail:$._0});return r("section",{children:[r("div",{children:[i("h3",{children:at(l.readModel.name)}),w.length>1?i(lF.make,{modes:w,activeId:L(N,VI,e=>e.id),onSelect:e=>{nF(E,e,A),C(t=>({mode:e,band:A}))}}):null],style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}}),B]})},Y9={contents:void 0};function Z9(e){Y9.contents=e}function e7(e){return e.filter(e=>"Instance"===e.level)}function t7(e,t,n,r,i){let o=void 0!==r?r:[],s=e7(n),a=e7(o),l=Bs(e,t),c=l3(e,t,n,i),u=function(e,t,n){let r=n3(n),i=Bs(e,t),o={};return r.forEach(e=>{let t=e.targetState;void 0===t||U(e.allowedStates,[]).forEach(n=>{i.includes(n)&&i.includes(t)&&(o[Z2(n,t)]={command:e.name,patch:{},tier:"DeclaredTarget"})})}),o}(e,t,o),d=(e,t,n)=>({commandName:n.name,label:n.label,toState:void 0!==e?c3(t?u:c,e,n.name):n.targetState,system:t}),f=(e,t,n)=>me(n,n=>{let r=n.allowedStates;if(void 0!==r&&r.includes(e))return d(e,t,n)}),h=l.map(e=>{let t=f(e,!1,s).concat(f(e,!0,a));return{value:e,label:at(e),terminal:0===t.length,outgoing:t}}),p=(e,t)=>t.filter(e=>q(e.allowedStates)).map(t=>d(void 0,e,t));return{lifecycleField:t,states:h,anyState:p(!1,s).concat(p(!0,a))}}function n7(e,t){let n=void 0!==t?t:[],r=e.states.flatMap(e=>me(e.outgoing,t=>z(t.toState,n=>({fromState:e.value,toState:n,command:t.label,selfLoop:n===e.value,system:t.system})))),i=me(r,e=>e.selfLoop?void 0:e.toState).concat(function(e){return me(e7(e),e=>e.targetState)}(n)),o=z(e.states[0],e=>e.value),s=e.states.map(e=>({value:e.value,label:e.label,terminal:e.terminal,unreachable:!i.includes(e.value)&&vt(e.value,o),unresolved:e.outgoing.filter(e=>q(e.toState)).map(e=>e.label)}));return{nodes:s,edges:r,anyState:e.anyState.map(e=>({label:e.label,system:e.system,toState:e.toState}))}}function r7(e){return"var("+e+")"}let i7=lo([pi("flex"),gi("column"),ci("gap",r7(_t.md))]),o7=lo([ci("font-size",r7(bt.sizeLg)),ci("font-weight",r7(bt.weightMedium)),ci("color",r7(yt.textPrimary)),Ei(eo(0))]),s7=lo([ci("font-size",r7(bt.sizeXs)),ci("color",r7(yt.textDisabled))]),a7=lo([pi("flex"),ci("flex-wrap","wrap"),ui("flexStart"),ci("gap",r7(_t.md))]);let l7=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",r7(_t.sm))]),c7=lo([ci("font-size",r7(bt.sizeXs)),ci("color",r7(yt.textDisabled)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),u7=lo([pi("flex"),gi("column"),ci("gap","6px")]),d7=lo([pi("flex"),ui("center"),ci("flex-wrap","wrap"),ci("gap","4px")]),f7=lo([ci("color",r7(yt.textSecondary)),ci("font-size",r7(bt.sizeSm))]),h7=lo([ci("font-size",r7(bt.sizeXs)),ci("color",r7(yt.textDisabled))]),p7=lo([pi("flex"),gi("column"),ci("gap",r7(_t.sm)),ci("padding-top",r7(_t.sm))]),g7=lo([ci("font-size",r7(bt.sizeXs)),ci("font-weight",r7(bt.weightMedium)),ci("color",r7(yt.textSecondary)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),m7=lo([pi("flex"),ci("flex-wrap","wrap"),ci("gap","6px")]);function v7(e,t){let n=t.toState;return r("div",{children:[t.system?i(bQ.make,{label:t.label}):i(_Q.make,{label:t.label}),void 0!==n?r(o,{children:[i("span",{children:"→",className:f7}),i(yQ.make,{swatch:uQ(e,n),label:at(n),dot:!1})]}):null],className:d7},t.commandName)}let y7=function(e){let t,n=e.display,s=e.title,a=e.systemCommands,l=e.lifecycleField,c=void 0!==a?a:[],u=void 0!==n?n:"Lane",d=t7(e.schema,l,e.commands,c,e.transitions),f=d.states.map(e=>e.value);return t="Lane"===u?void 0:function(e,t){return z(Y9.contents,n=>n(e,t))}(n7(d,c),U(s,at(l))),r("div",{children:[void 0!==s?i("h3",{children:s,className:o7}):null,i("div",{children:"Lifecycle on “"+at(l)+"”",className:s7}),void 0!==t?t:r(o,{children:[i("div",{children:d.states.map(e=>{let t=uQ(f,e.value);return r("div",{children:[r("div",{children:[i(yQ.make,{swatch:t,label:e.label}),e.terminal?i("span",{children:"end",className:c7}):null],className:l7}),e.terminal?i("span",{children:"No commands available",className:h7}):i("div",{children:e.outgoing.map(e=>v7(f,e)),className:u7})],className:(n=t,lo([pi("flex"),gi("column"),ci("gap",r7(_t.sm)),ci("flex","0 1 240px"),ci("padding",r7(_t.md)),ci("background",r7(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-left","3px solid "+n.border),ci("border-radius",r7(xt.md))]))},e.value);var n}),className:a7}),0!==d.anyState.length?r("div",{children:[i("span",{children:"Any state",className:g7}),i("div",{children:d.anyState.map(e=>v7(f,e)),className:m7})],className:p7}):null]})],className:i7})};function _7(e){return"var("+e+")"}let b7=lo([pi("flex"),gi("column"),ci("gap",_7(_t.xl))]),x7=lo([ci("font-size",_7(bt.sizeXl)),ci("font-weight",_7(bt.weightMedium)),ci("color",_7(yt.textPrimary)),Ei(eo(0))]),S7=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",_7(_t.md))]),w7=lo([pi("flex"),gi("column"),ci("gap",_7(_t.md)),ci("padding",_7(_t.lg)),ci("background",_7(yt.surfaceSubtle)),ci("border","1px solid var("+yt.borderSubtle+")"),ci("border-radius",_7(xt.md))]);function E7(e){return e.filter(e=>function(e,t,n,r){let i=void 0!==r?r:[];return void 0!==t&&0!==Bs(e,t).length&&e7(n.concat(i)).some(e=>{let t=e.allowedStates;return void 0!==t&&0!==t.length})}(e.schema,e.lifecycleField,e.commands,U(e.systemCommands,[])))}let k7="lifecycle",C7="diagram";let A7=function(e){let t=e.uiHints,n=Y4(),o=E7(e.views),s=mt(n.get(k7),C7)?"Diagram":"Lane",a=(e,t,r)=>i("button",{children:e,"aria-pressed":r?"true":"false",className:r?lF.Style.btnActive:lF.Style.btn,onClick:e=>n.set(k7,t)},t),l=$(Y9.contents)?r("div",{children:[a("Lane","","Lane"===s),a("Diagram",C7,"Diagram"===s)],"aria-label":"Lifecycle rendering",className:lF.Style.group,role:"group"}):null;return r("div",{children:[r("div",{children:[i("h2",{children:"Lifecycles",className:x7}),l],className:S7}),0!==o.length?o.map(e=>i("div",{children:i(y7,{schema:e.schema,lifecycleField:U(e.lifecycleField,""),commands:e.commands,systemCommands:U(e.systemCommands,[]),title:e.name,transitions:j(j(t,t=>gF(t,e.name)),e=>e.transitions),display:s}),className:w7},e.name)):i(yo,{title:"No lifecycles",description:"No view in this plugin declares a lifecycle enum with state-scoped commands."})],className:b7})};function N7(e){return"var("+e+")"}let T7=lo([pi("flex"),gi("column"),ci("gap",N7(_t.md)),ci("font-family",N7(bt.fontFamily))]),R7=lo([pi("flex"),ui("center"),ci("gap",N7(_t.sm)),ci("color",N7(yt.textSecondary)),ci("font-size",N7(bt.sizeSm)),ci("font-weight",N7(bt.weightMedium)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),D7=lo([pi("inlineFlex"),ui("center"),ci("padding","0 6px"),ci("border-radius",N7(xt.full)),ci("background",N7(yt.surfaceElevated)),ci("color",N7(yt.textPrimary)),ci("font-size",N7(bt.sizeXs)),ci("letter-spacing","0")]),I7=lo([pi("flex"),gi("column"),ci("gap",N7(_t.md))]),F7=lo([pi("flex"),ui("flexStart"),ci("gap",N7(_t.sm))]),O7=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-width","0"),mi(1)]),P7=lo([pi("flex"),ui("baseline"),ci("gap",N7(_t.sm))]),M7=lo([ci("color",N7(yt.textPrimary)),ci("font-size",N7(bt.sizeSm)),ci("font-weight",N7(bt.weightMedium))]),L7=lo([ci("color",N7(yt.textDisabled)),ci("font-size",N7(bt.sizeXs))]),z7=lo([ci("color",N7(yt.textPrimary)),ci("font-size",N7(bt.sizeSm)),ci("line-height",N7(bt.lineHeightNormal)),ci("white-space","pre-wrap"),ci("word-break","break-word")]),j7=lo([ci("color",N7(yt.textDisabled)),ci("font-size",N7(bt.sizeSm)),ci("padding","var("+_t.sm+") 0")]),U7=lo([pi("flex"),gi("column"),ui("flexEnd"),ci("gap",N7(_t.sm))]),B7=lo([ci("width","100%"),ci("min-height","64px"),ci("padding",N7(_t.sm)),ci("background",N7(yt.surface)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",N7(xt.md)),ci("color",N7(yt.textPrimary)),ci("font-family",N7(bt.fontFamily)),ci("font-size",N7(bt.sizeSm)),ci("resize","vertical")]),$7=lo([ci("background",N7(yt.brand)),ci("border","none"),ci("border-radius",N7(xt.md)),ci("color",N7(yt.textOnBrand)),ci("padding","4px var("+_t.md+")"),ci("font-size",N7(bt.sizeSm)),ci("font-weight",N7(bt.weightMedium)),hi("pointer"),Hi([ci("opacity","0.5"),hi("default")])]),q7=lo([ci("color",N7(yt.error)),ci("font-size",N7(bt.sizeXs)),ci("align-self","flex-start")]);function G7(e){let t=e.comment,n=t.timestamp;return r("div",{children:[i(Wo,{name:U(t.author,"?"),src:t.authorImageUrl,size:"Medium"}),r("div",{children:[r("div",{children:[i("span",{children:U(t.author,"Unknown"),className:M7}),void 0!==n?i("span",{children:RY(e.nowMs,n),className:L7}):null],className:P7}),i("span",{children:t.body,className:z7})],className:O7})],className:F7})}let V7=function(e){let t=e.nowMs,n=e.error,o=e.posting,a=e.onPost,l=e.emptyLabel,c=e.title,u=e.comments,d=void 0!==c?c:"Comments",f=void 0!==l?l:"No comments yet",h=void 0!==o&&o,p=void 0!==t?t:Date.now(),g=s(()=>""),m=g[1],v=g[0],y=v.trim(),_=""!==y&&!h,b=()=>{if(_)return M(a,e=>e(y)),m(e=>"")};return r("div",{children:[r("div",{children:[d,i("span",{children:u.length.toString(),className:D7})],className:R7}),0===u.length?i("div",{children:f,className:j7}):i("div",{children:u.map(e=>i(G7,{comment:e,nowMs:p},e.id)),className:I7}),void 0!==a?r("div",{children:[i("textarea",{className:B7,disabled:h,placeholder:"Write a comment…",value:v,onKeyDown:e=>{if("Enter"===e.key&&(e.metaKey||e.ctrlKey))return e.preventDefault(),b()},onChange:e=>{let t=e.target.value;m(e=>t)}}),void 0!==n?i("span",{children:n,className:q7}):null,i("button",{children:h?"Posting…":"Comment",className:$7,disabled:!_,onClick:e=>b()})],className:U7}):null],className:T7})};let K7=function(e){let t=e.entityId,n=e.binding,r=SI(),o=u1(),a=Ga(),l=uG(),c=L(e.requiredAccess,!1,e=>!l(e)),u=L3(n.readModel,!c),d=s(()=>!1),f=d[1],h=s(()=>{}),p=h[1];if(c)return null;let g=function(e,t,n){let r=me(t,t=>{let r=U(ft(t),{});if(mt(kK(r,e.entityField),n))return r}),i=t=>j(j(e.timestampField,e=>kK(t,e)),fc);return r.toSorted((e,t)=>{let n=i(e),r=i(t);return void 0!==n?void 0!==r?n-r:-1:void 0!==r?1:0}).map((t,n)=>({id:U(kK(t,"id"),"#"+n.toString()),body:U(kK(t,e.bodyField),""),author:j(e.authorField,e=>kK(t,e)),timestamp:j(e.timestampField,e=>kK(t,e))}))}(n,u.rows,t),m=n.postCommand,v=void 0!==r&&void 0!==m?e=>{let i=n.postCommand;if(void 0!==o&&void 0!==i)return f(e=>!0),p(e=>{}),void ce(o(i.mutationDocument,function(e,t,n){let r=e.postCommand,i=U(j(r,e=>e.aggregateIdField),e.entityField),o=U(j(r,e=>mK(e.schema,fK)),e.bodyField);return Ye([[i,t],[o,n]])}(n,t,e)).then(e=>{if(f(e=>!1),"object"!=typeof e)return u.refetch(),Promise.resolve();{if("Rejected"===e.TAG){let t=e._0;return p1(r,a,t.errorCode,t.detail).then(e=>(p(t=>e),Promise.resolve()))}let t=e._0;return console.error("[AutoUI] comment not posted — "+t),p(e=>t),Promise.resolve()}}),e=>(f(e=>!1),p(e=>"Could not post the comment."),Promise.resolve()))}:void 0;return i(V7,{comments:g,onPost:v,posting:d[0],error:h[0]})};function W7(e){return"var("+e+")"}let H7=lo([pi("flex"),gi("column"),ci("gap",W7(_t.lg))]),J7=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("gap",W7(_t.md))]),X7=lo([ci("font-size",W7(bt.sizeXl)),ci("font-weight",W7(bt.weightMedium)),ci("color",W7(yt.textPrimary)),Ei(eo(0))]),Q7=lo([pi("flex"),yi("wrap"),ui("center"),ci("gap",W7(_t.md)),ci("font-size",W7(bt.sizeSm)),ci("color",W7(yt.textSecondary))]),Y7=lo([pi("inlineFlex"),ui("center"),ci("gap","4px"),hi("pointer")]);let Z7=lo([ci("font-size",W7(bt.sizeXs)),ci("color",W7(yt.textDisabled))]),eee=lo([pi("flex"),ui("center"),ci("gap",W7(_t.sm))]),tee=lo([ci("background","none"),ci("border","1px solid var("+yt.border+")"),ci("border-radius",W7(xt.sm)),ci("padding","2px var("+_t.sm+")"),ci("color",W7(yt.textSecondary)),ci("font-size",W7(bt.sizeSm)),hi("pointer"),Qi([ci("background",W7(yt.surfaceSubtle)),ci("color",W7(yt.textPrimary))])]);let nee=function(e){let t,n=e.viewAccess,o=e.uiHints,a=e.events,l=e.resource,c=e.pluginId,u=void 0!==n?n:{},d=ae(),f=uG(),h=SI(),p=wI(),g=Ga(),m=A0(),v=s(()=>[]),y=v[1],_=v[0],b=e=>za(e.schema,j(o,t=>mF(t,e.name)),{field:e.labelField,source:e.labelFieldSource}),x=L3(l,!0),S={readModelName:l.name,rows:x.rows,schema:l.schema,semantics:b(l),window:Mo(x.canLoadMore),onOpenRow:(e,t)=>d(Ja(c,l.name,e,[])),role:u3,ownEntity:{pluginId:c,viewName:l.name}},w=a.map((e,t)=>{let n=uK(u,e.readModel.name,f),r=n&&!_.includes(e.readModel.name);return[e,t,r,n,L3(e.readModel,r)]}),E=(e,t)=>U(j(j(o,t=>gF(t,e.name)),e=>e.accent),WZ[fe(t,WZ.length)]),k=me(w,e=>{let t=e[4],n=e[0],r=_3(n.readModel.commands,n.resourceRef),i=m1(h,p,n.readModel.commands,n.readModel.name,t.isLive,t.refetch,g,m.onNotice,void 0);if(e[2])return{readModelName:n.readModel.name,rows:t.rows,schema:n.readModel.schema,semantics:b(n.readModel),accent:E(n.readModel,e[1]),window:Mo(t.canLoadMore),onOpenRow:(e,t)=>d(Ja(c,n.readModel.name,e,[])),onCommand:z(r,e=>i),role:d3,resourceRef:n.resourceRef,assignCommand:r,ownEntity:{pluginId:c,viewName:n.readModel.name}}}),C=[S].concat(k),A=(x.canLoadMore?[l.name]:[]).concat(me(w,e=>{if(e[2]&&e[4].canLoadMore)return e[0].readModel.name})),N=x.fetchState,T=0;"object"!=typeof N?t="Loading"===N?[l.name+": loading…"]:[]:T=1,1===T&&(t=[l.name+": "+N._0]);let R=t.concat(me(w,e=>{let t=e[0],n=e[4].fetchState;if(e[2])return"object"!=typeof n?"Loading"===n?t.readModel.name+": loading…":void 0:(n.TAG,t.readModel.name+": "+n._0)}).concat(dK(u,a.map(e=>e.readModel.name),f)));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:X7}),className:J7}),i("div",{children:w.filter(e=>e[3]).map(e=>{let t=e[0];return r("label",{children:[i("input",{checked:e[2],type:"checkbox",onChange:e=>{let n=t.readModel.name;y(e=>e.includes(n)?e.filter(e=>e!==n):e.concat([n]))}}),i("span",{className:(n=E(t.readModel,e[1]),lo([pi("inlineBlock"),ci("width","8px"),ci("height","8px"),ci("border-radius","50%"),ci("background",n)]))}),t.readModel.name],className:Y7},t.readModel.name);var n}),className:Q7}),m.element,e.mode.render(C),0!==A.length?r("div",{children:[i("button",{children:"Load more",className:tee,onClick:e=>(x.canLoadMore&&x.loadMore(),void w.forEach(e=>{let t=e[4];if(e[2]&&t.canLoadMore)return t.loadMore()}))}),i("span",{children:"More rows available: "+A.join(", "),className:Z7})],className:eee}):null,0!==R.length?i("span",{children:R.join(" · "),className:Z7}):null],className:H7})};function ree(e){return e}function iee(e,t){let n=void 0!==t?t:[];return e.map(e=>({name:e.name,schema:e.schema,commands:e.commands,rowActionCandidates:H8(n,e.name),declaredLabelField:e.labelField,declaredLabelSource:e.labelFieldSource}))}function oee(e){if("object"==typeof e)return"heuristic:"+e._0;switch(e){case"Annotation":return"annotation";case"Type":return"type";case"Hint":return"hint"}}function see(e,t,n){return void 0!==t?Object.entries(l3(e.schema,t,e.commands,j(n,e=>e.transitions))):[]}function aee(e){let t=[["command",m2(e.action)],["field",e.action.field]],n=L(e.tier,[],e=>[["tier","explicit-ref-same-plugin"]]),r=e.vetoes,i=0!==r.length?[["vetoes",r.map(B8)]]:[];return Ye(t.concat(n).concat(i))}function lee(e){let t=t=>e.filter(t).map(aee);return Ye([["attached",t(q8)],["vetoed",t(G8)],["deferred",t(V8)]])}function cee(e){return z(e.declaredLabelField,t=>({field:t,source:e.declaredLabelSource}))}function uee(e,t){return L(P(e.declaredLabelSource,n=>mt(e.declaredLabelField,t)),t,e=>t+" ("+e+")")}function dee(e,t){if("Pair"===t.TAG){let e=t.endField,n=t.startField;return void 0!==e?n+".."+e:n}let n=t._0;return L(Je(e.semantics,n),n,e=>n+" ("+oee(e.provenance)+")")}function fee(e,t){switch(t.TAG){case"Paired":return t.latField+"/"+t.lngField;case"Pointed":let n=t._0;return L(Je(e.semantics,n),n,e=>n+" ("+oee(e.provenance)+")");case"Geolocated":let r=t._0;return L(Je(e.semantics,r),r+" (point on Located)",e=>r+" ("+oee(e.provenance)+", point on Located)")}}function hee(e,t,n,r){return Ye([["plugin",e],["hintErrors",(void 0!==r?r:[]).map(ree)],["views",t.map(e=>function(e,t,n){let r=e.name,i=e.schema,o=za(i,t,cee(e)),s=Xe(o.semantics).map(e=>{let t=e[1];return Ye([["field",e[0]],["semantic",ta(t.semantic)],["provenance",oee(t.provenance)]])}),a=[];M(o.geo,e=>{a.push(["geo",fee(o,e)])}),M(o.dateSpan,e=>{a.push(["dateSpan",dee(o,e)])}),M(o.statusField,e=>{a.push(["status",e])}),M(o.labelField,t=>{a.push(["label",uee(e,t)])}),M(o.imageField,e=>{a.push(["image",e])}),M(o.parentField,e=>{a.push(["parent",e])});let l=XI(i,void 0).map(e=>e.id),c=see(e,o.statusField,n).map(e=>{let t=e[1];return[e[0],t.command+" ("+Y2(t.tier)+")"]});return Ye([["view",r],["capableModes",l],["roles",Ye(a)],["transitions",Ye(c)],["rowActions",lee(U(e.rowActionCandidates,[]))],["fields",s]])}(e,j(n,t=>mF(t,e.name)),j(n,t=>gF(t,e.name))))]])}function pee(e,t,n,r){let i=void 0!==r?r:[];console.log('[AutoUI] Inference report — plugin "'+e+'"'),function(e,t){return e.map(e=>{let n=e.name,r=e.schema,i=za(r,j(t,e=>mF(e,n)),cee(e)),o=XI(r,void 0).map(e=>e.id).join(", "),s=[];M(i.geo,e=>{s.push("geo="+fee(i,e))}),M(i.dateSpan,e=>{s.push("dateSpan="+dee(i,e))}),M(i.statusField,e=>{s.push("status="+e)}),M(i.labelField,t=>{s.push("label="+uee(e,t))}),M(i.imageField,e=>{s.push("image="+e)}),M(i.parentField,e=>{s.push("parent="+e)});let a=0===s.length?"":"; "+s.join("; "),l=Object.keys(i.semantics).length,c=see(e,i.statusField,j(t,e=>gF(e,n))),u=i.statusField,d=c.length,f=void 0!==u?"; "+d.toString()+" transition(s)":"",h=U(e.rowActionCandidates,[]),p=e=>h.filter(e).length.toString(),g=0!==h.length?"; row actions "+p(q8)+" attached, "+p(G8)+" vetoed, "+p(V8)+" deferred":"";return n+": modes "+o+a+f+g+"; "+l.toString()+" field semantic(s)"})}(t,n).forEach(e=>{console.log(" "+e)}),t.forEach(e=>{U(e.rowActionCandidates,[]).forEach(t=>{let n,r=t.tier,i=t.vetoes,o=0;void 0!==r&&0===i.length?n="attached (explicit-ref-same-plugin)":o=1,1===o&&(n=0!==i.length?"not offered — "+i.map($8).join("; "):"deferred — no tier admits it yet"),console.log(" "+e.name+" · "+m2(t.action)+"("+t.action.field+"): "+n)})}),console.log(JSON.stringify(hee(e,t,n,i),null,2))}function gee(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}function mee(e){return Object.fromEntries([["kind",e.kind],["senderId",e.senderId],["sentAt",e.sentAt],["body",e.body]])}function vee(e,t,n,r,i){let o=void 0===r||r,s=gO(),l=j(s,e=>e.clientNamespace()),c=o&&$(l)&&L(s,!1,e=>e.clientChannelsAvailable()),u=void 0!==l?function(e,t,n){return"/"+gee(e)+"/"+gee(t)+"/"+gee(n)}(l,e,t):void 0,d=h(i);d.current=i,a(()=>{let e=c?s:void 0;if(void 0!==e&&void 0!==u)return e.subscribe("Domain",u,e=>{let t=function(e){let t=He.object(e);if(void 0===t)return;let n=e=>j(t[e],He.string),r=n("kind"),i=n("senderId");return void 0!==r&&void 0!==i?{kind:r,senderId:i,sentAt:U(j(t.sentAt,He.float),0),body:U(t.body,null)}:void 0}(e);if(void 0!==t&&t.senderId!==n)return d.current(t)})},[c,U(u,""),n]);return{available:c,publish:(e,t)=>{let r=c?s:void 0;if(void 0===r)return;if(void 0===u)return;let i=Date.now(),o={kind:e,senderId:n,sentAt:i,body:t};r.publish("Domain",u,[mee(o)]).then(e=>{"Ok"!==e.TAG&&console.warn("[AutoClientChannel] publish to "+u+" failed: "+e._0)})}}}let yee="heartbeat",_ee="hello",bee="leave";function xee(e){let t=He.object(e);if(void 0===t)return;let n=e=>j(t[e],He.string),r=n("userId");return void 0!==r&&""!==r?[r,U(n("username"),r)]:void 0}function See(e,t,n,r,i){let o=void 0===i||i,l=s(()=>[]),c=l[1],u=h(void 0),d=vee("presence",t,n,o&&""!==n,e=>{if(c(t=>function(e,t,n){let r=t.kind;if(r===bee){let n=xee(t.body);if(void 0===n)return e;let r=n[0];return e.filter(e=>e.userId!==r)}if(r!==yee&&r!==_ee)return e;let i=xee(t.body);if(void 0===i)return e;let o=i[0],s=e.filter(e=>e.userId!==o);return s.concat([{userId:o,username:i[1],lastSeen:n}])}(t,e,Date.now())),e.kind!==_ee)return;let t=u.current;void 0===t||setTimeout(()=>t(),1e3*Math.random())}),f=d.available,p=d.publish;return a(()=>{if(!f)return;let e=function(e,t){return Object.fromEntries([["userId",e],["username",t]])}(n,r),t=()=>p(yee,e);u.current=t,p(_ee,e),p(yee,e);let i=setInterval(t,1e4);return()=>{clearInterval(i),u.current=void 0,p(bee,e)}},[f,n,r,t]),a(()=>{if(!f)return;let e=setInterval(()=>c(e=>{return t=e,n=Date.now(),t.filter(e=>n-e.lastSeen<25e3);var t,n}),1e4);return()=>{clearInterval(e)}},[f]),f?l[0]:[]}function wee(e){return"var("+e+")"}let Eee=lo([pi("inlineFlex"),ui("center"),ci("gap",wee(_t.xs))]),kee=lo([ci("font-family",wee(bt.fontFamily)),ci("font-size",wee(bt.sizeSm)),ci("color",wee(yt.textSecondary)),ci("white-space","nowrap")]);function Cee(e){return 1===e?"1 other here":e.toString()+" others here"}let Aee=function(e){let t=e.showLabel,n=e.max,o=e.size,s=e.people,a=void 0!==o?o:"Small",l=void 0!==n?n:4,c=void 0===t||t;if(0===s.length)return null;let u=s.map(e=>({name:e.username,imageUrl:e.imageUrl}));return r("span",{children:[i(Xs,{members:u,size:a,max:l}),c?i("span",{children:Cee(s.length),className:kee}):null],className:Eee,title:s.map(e=>e.username).join(", ")})};let Nee=function(e){let t=j(Cq(),e=>e.identity),n=L(t,"",e=>e.userId),r=L(t,"",e=>e.username),o=See(0,e.readModel+"-"+e.entityId,n,""===r?n:r,""!==n).map(e=>({userId:e.userId,username:e.username}));return i(Aee,{people:o})};function Tee(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}let Ree={contents:[]},Dee={contents:[]};function Iee(e,t,n){if("id"!==n)return;let r=e+"."+t;return Ree.contents.some(e=>e===r)?void 0:(Ree.contents.push(r),void console.warn("[AutoUI] Entity "+r+' has labelField="id" — dropdown labels will render as raw UUIDs. Add a @displayName annotation on the source state to fix.'))}function Fee(e,t,n,r){if("id"===n||0!==r.length&&r.some(e=>e===n))return;let i=e+"."+t;return Dee.contents.some(e=>e===i)?void 0:(Dee.contents.push(i),void console.warn("[AutoUI] Entity "+i+' labelField="'+n+"\" is not @searchable; the reference dropdown's search will scan the table — OK at small scale, worth designing around before production volumes."))}function Oee(e){let t=[];return e.forEach(e=>{let n=(n,r,i,o,s)=>{Iee(e.id,n,i),Fee(e.id,n,i,o);let a=$s(s,void 0),l=void 0!==a&&a.namedWhenRetired?a:void 0;t.push({pluginId:e.id,name:n,queryField:r,singleQueryField:et(r),labelField:i,namedRetirement:l})};e.readModels.forEach(e=>n(e.name,e.queryField,e.labelField,e.searchableFields,e.schema)),e.stateViewSlices.concat(U(e.internalQueryables,[])).forEach(e=>n(e.name,e.queryField,e.labelField,e.searchableFields,e.schema))}),t}function Pee(e,t){let n=e.toLowerCase(),r=t=>{let r=t.length,i=e.length;if(i>r&&n.endsWith(t))return e.slice(0,i-r|0)};if(!t)return r("id");let i=r("ids");return void 0!==i?i:r("id")}function Mee(e){return[et(e),tt(e)]}function Lee(e,t){return e.find(e=>e.name===t)}function zee(e,t){let n=Tee(t),r=Lee(e,tt(n));return void 0!==r?r:Lee(e,n)}function jee(e){return me(U(j(j(ft(e),e=>Je(e,"required")),ht),[]),ut)}function Uee(e,t,n,r){return me(e.references,i=>{let o,s=i.fieldName.includes("[]"),a=t4(i.fieldName);if(void 0!==a){let e=a[1],t=j(j(Je(r,a[0]),ft),n4),n=j(j(j(j(t,ft),e=>Je(e,"properties")),ft),t=>Je(t,e));o=void 0!==n?[n,!0,U(z(t,jee),[]).some(t=>t===e)]:[void 0,!1,!1]}else o=s?[void 0,!1,!1]:[Je(r,i.fieldName),!0,n.some(e=>e===i.fieldName)];let l=j(o[0],ft),c=j(j(l,e=>Je(e,"type")),ut),u=mt(c,"array"),d=i.plugin,f=void 0!==d?t.filter(e=>e.pluginId===d):t,h=Lee(f,i.entity),p=void 0!==h?h:zee(f,i.entity);if(o[1]){if(void 0!==p){let e=Mee(p.name);return{propertyKey:i.fieldName,queryField:p.queryField,singleQueryField:p.singleQueryField,labelField:p.labelField,multi:u,required:o[2],entityName:e[0],entityNamePlural:e[1]}}console.warn("[AutoUI] Command "+e.name+" field "+i.fieldName+': explicit @ref to "'+i.entity+'" did not resolve to a registered entity. Falling back to text input.')}else console.warn("[AutoUI] Command "+e.name+" field "+i.fieldName+": explicit @ref path does not name a property of a record array on this command. Falling back to text input.")})}function Bee(e,t,n,r,i,o){let s=[];return void 0!==i&&Xe(i).forEach(i=>{let a=i[0],l=ft(i[1]),c=$(j(l,e=>Je(e,"const")));if(c)return;let u,d=j(j(l,e=>Je(e,"type")),ut),f=j(j(j(j(l,e=>Je(e,"items")),ft),e=>Je(e,"type")),ut);if(void 0!==d)switch(d){case"array":u="string"===f||void 0;break;case"string":u=!1;break;default:u=void 0}else u=void 0;if(void 0===u)return;let h=!1;if("Collection"===e.level&&!u){let n;if(void 0!==t)if(mt(e.aggregateIdField,a))n=!0;else{let e=Pee(a,!1);n=void 0!==e&&e.toLowerCase()===t.name.toLowerCase()}else n=mt(e.aggregateIdField,a);h=n}if(h)return;let p,g,m=e.aggregateIdField;if(void 0===m||void 0===t||m!==a||u)p=void 0;else{let e=Lee(n,tt(t.name));p=void 0!==e?e:Lee(n,t.name)}if(void 0!==p)g=p;else{let e=Pee(a,u);g=void 0!==e?zee(n,e):void 0}if(void 0!==g){g.pluginId!==o&&console.warn("[AutoUI] Command "+e.name+" field "+a+' resolved cross-plugin to "'+g.name+'" in plugin "'+g.pluginId+'" via naming heuristic. Add @ref("'+g.pluginId+"."+g.name+'") to make the cross-plugin reference explicit, or @ref("<LocalEntity>") to target a same-plugin entity.');let t=Mee(g.name),n=g.queryField,i=g.singleQueryField,l=g.labelField,c=r.some(e=>e===a),d=t[0],f=t[1],h={propertyKey:a,queryField:n,singleQueryField:i,labelField:l,multi:u,required:c,entityName:d,entityNamePlural:f};return void s.push(h)}void 0===Pee(a,u)||console.warn("[AutoUI] Command "+e.name+" field "+a+" looks like a reference but no matching entity was registered. Falling back to text input.")}),s}function $ee(e,t,n,r){let i=jee(e.schema),o=j(j(ft(e.schema),e=>Je(e,"properties")),ft);return 0===e.references.length?Bee(e,t,n,i,o,r):Uee(e,n,i,U(o,{}))}function qee(e,t){let n=(n,r)=>{let i={...n};return i.refFields=$ee(n,r,t,e.id),i},r={...e};return r.stateChangeSlices=e.stateChangeSlices.map(e=>{let t={...e};return t.commands=e.commands.map(e=>n(e,void 0)),t}),r.aggregates=e.aggregates.map(e=>{let t={...e};return t.commands=e.commands.map(t=>n(t,e)),t}),r.readModels=e.readModels.map(e=>{let t={...e};return t.commands=e.commands.map(e=>n(e,void 0)),t}),r}let Gee={capitalize:Tee,singularize:et,warnedIdLabel:Ree,warnedUnsearchable:Dee,warnIfIdLabel:Iee,warnIfUnsearchable:Fee,buildRegistry:Oee,stemFromKey:Pee,entityDisplayNames:Mee,findByName:Lee,findByStem:zee,requiredSet:jee,resolveExplicitRefs:Uee,resolveByHeuristic:Bee,resolveForCommand:$ee,enrichPlugin:qee};function Vee(e){let t=He.object(e);if(void 0===t)return;if($(It(e)))return;let n=j(t.properties,He.object);if(void 0!==n)return n;let r=j(j(j(t.items,He.object),e=>e.properties),He.object);return void 0!==r?r:ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(t[n],He.array),e=>ge(e,void 0,(e,t)=>void 0!==e?e:Vee(t))))}function Kee(e,t){let n=me(Object.entries(e),e=>L(Rs(e[1]),!1,e=>Es(e,"x-reventless-hidden"))?void 0:e[0]);return t&&!n.includes("id")?["id"].concat(n):n}let Wee=new Map;function Hee(e,t,n){let r=me(t.arms,e=>{let r=Ft(t,e);if(void 0===r)return;let i=n(e);return""===i?void 0:"... on "+r+" { "+i+" }"});return t.arms.some(e=>q(Ft(t,e)))&&function(e){if(q(Wee.get(e)))Wee.set(e,!0),console.error('AutoUI: the union field "'+e+'" carries neither '+At+" on the field nor "+Nt+" on its arms, so its member types cannot be named. It will be selected as `"+e+" { __typename }` — the arm is readable, its fields are not. The platform emitting this schema is behind the union contract.")}(e),0!==r.length?e+" { __typename "+r.join(" ")+" }":e+" { __typename }"}function Jee(e,t,n){let r=void 0!==t?t:3;return Kee(e,void 0===n||n).map(t=>{let n=j(e[t],It);if(void 0!==n)return Hee(t,n,e=>r<=0?"":Jee(e.properties,r-1|0,!1));if(r<=0)return t;let i=j(e[t],Vee);return void 0!==i?t+" { "+Jee(i,r-1|0,!1)+" }":t}).join(" ")}function Xee(e,t,n){return me(Kee(e,!0),t=>{let n=e[t];if(void 0===n)return t;let r=It(n);if(void 0!==r)return Hee(t,r,e=>Jee(e.properties,1,!1));let i=Vee(n);if(void 0===i)return t;let o=function(e,t){return me(Kee(e,t),t=>{let n=e[t];if(void 0===n)return t;let r=It(n);return void 0!==r?Hee(t,r,e=>Jee(e.properties,1,!1)):q(Vee(n))?t:void 0}).join(" ")}(i,!1);return""===o?void 0:t+" { "+o+" }"}).join(" ")}function Qee(e){return U(j(j(He.object(e),e=>e.properties),He.object),{})}function Yee(e,t,n,r,i,o){let s,a=void 0!==r&&r,l=void 0!==i&&i,c=void 0!==o&&o,u=Xee(Qee(t)),d=a||c,f=["$first: Int","$after: String","$last: Int","$before: String"],h=["first: $first","after: $after","last: $last","before: $before"],p=$(function(e){return z(Ps(e),e=>e[0])}(t)),g=p?f.concat(["$includeRetired: Boolean"]):f,m=p?h.concat(["includeRetired: $includeRetired"]):h;if(void 0!==n){let e=d?["$filter: "+n+"Filter"].concat(g):g,t=d?["filter: $filter"].concat(m):m;s=[l?e.concat(["$orderBy: "+n+"OrderBy"]):e,l?t.concat(["orderBy: $orderBy"]):t]}else s=[g,m];return"query("+s[0].join(", ")+") { "+e+"("+s[1].join(", ")+") { pageInfo { hasNextPage hasPreviousPage startCursor endCursor } edges { cursor node { "+u+" } } } }"}function Zee(e,t){let n=Jee(Qee(t),void 0,void 0),r=L(Ps(t),!1,e=>e[1].namedWhenRetired),i=r?", includeRetired: true":"",o=Ls(t);return void 0!==o?"query($id: ID!, $subId: String!) { "+e+"(id: $id, "+o+": $subId"+i+") { "+n+" } }":"query($id: ID!) { "+e+"(id: $id"+i+") { "+n+" } }"}function ete(e,t,n){return"Operator"===e?t:U(n,[])}function tte(e,t){let n={},r=(e,t)=>{let r=Je(n,e);if(void 0!==r){let i=t.filter(e=>!r.some(t=>t.name===e.name));return void(n[e]=r.concat(i))}n[e]=t};return e.aggregates.forEach(e=>{e.linkedViews.forEach(n=>r(n,ete(t,e.commands,e.systemCommands)))}),e.stateChangeSlices.forEach(e=>{let n=ete(t,e.commands,e.systemCommands),i=n.filter(e=>"Collection"===e.level),o=n.filter(e=>"Instance"===e.level);e.linkedViews.forEach(e=>r(e,i));let s=e.consistencyRead;return void 0!==s?r(s,o):void e.linkedViews.forEach(e=>r(e,o))}),n}function nte(e,t,n,r,i){let o=void 0!==i?i:v2,s=e.readModels.map(e=>e.name).concat(e.stateViewSlices.map(e=>e.name)).map(t=>({pluginId:e.id,name:t,placed:U(Je(r,t),[]).map(e=>e.name)}));return W8(s,t,0,n,o)}function rte(e,t,n,r,s,a,l,c,u,d,f,h,p,m){let v,y=[],_=void 0!==s?s:[],b=void 0!==a?a:[],x=void 0!==l?l:[],S=void 0!==c?c:[],w={},E=void 0!==d?d:{},k=void 0!==f?f:{},C=void 0!==h&&h,A=0===_.length?[e]:_,N=Oee(A),T=qee(e,N),R=tte(T,"Operator"),D=tte(T,"System"),I=(e,t,n)=>{let r={...e};return r.refFields=$ee(e,t,N,n),r},F=nte(T,A,N,R,I),O=b.find(e=>e.id===T.id);if(void 0!==O){let e=Oee(b);v=nte(O,b,e,tte(O,"Operator"),void 0)}else v=F;let P={};v.filter(q8).forEach(e=>{P[e.viewName]=U(Je(P,e.viewName),[]).concat([m2(e.action)])});let B=L(p,[],e=>IF(e,T,b,P)),G=[],V={},K=T.id,W=e=>{let t=T.derivedPages;return void 0===t||t.includes(e)},H=e=>{let t=j(p,t=>gF(t,e));return function(e,t,n){let r=void 0!==t?t:[],i=void 0!==n?n:[],o=e.slice();return r.forEach(e=>{o.some(t=>t.command.name===e.command.name)||o.push(e)}),0===i.length?o:o.filter(e=>!i.some(t=>t===m2(e)))}(function(e,t,n){let r=void 0!==n?n:v2;return me(U(j(e,e=>e.rowActions),[]),e=>y2(e,t,r))}(t,A,I),function(e,t){return H8(e,t).filter(q8).map(e=>e.action)}(F,e),U(j(t,e=>e.suppressRowActions),[]))},J=(e,t,n,r,o,s)=>{let a=0===Ms(l=e.schema).length&&q(Ls(l));var l;let c=a?e.queryField+"ByIds":void 0,u=a?function(e,t){return"query($ids: [String!]!) { "+e+"ByIds(ids: $ids) { "+Xee(Qee(t))+" } }"}(e.queryField,e.schema):void 0,d=function(e){let t=Object.keys(Qee(e));return t.includes("updatedAt")?"updatedAt":t.includes("createdAt")?"createdAt":void 0}(e.schema),f=zs(e.schema),h=e.name,g=je(Wa(K,h)),m=Je(E,h),v=n+h,y=qV(T.name,h,e.sortIndex,j(p,e=>gF(e,h)),C&&$(e.ownerField)),_={fragmentId:v,title:h,menuEntry:y,requiredAccess:m,url:g},b=H(h),x=K+"."+h;return G.push(Ue(Ha(K,h),n=>{let a=function(e){let t=ze.wildcard_match(e).split("/").filter(e=>""!==e);return 0===t.length?[void 0,[]]:[z(t[0],e=>decodeURIComponent(e)),t.slice(1).map(e=>decodeURIComponent(e))]}(n);return i(aK,{definition:_,children:(l=a[0],h=a[1],i(M5,{readModel:e,detailView:t,pluginId:K,openRowId:l,drillPath:h,singleQueryField:r,detailQueryDocument:o,byIdsQueryField:c,byIdsQueryDocument:u,sortKeyField:d,liveOffered:f,uiHints:p,schedulerJoin:s,rowActions:b,archiveOffered:!C},x))});var l,h})),function(e,t,n,r){e[function(e,t){return e+"."+t}(t,n)]=je(r)}(V,K,h,Wa(K,h)),_},X=T.readModels.filter(e=>!x.includes(e.name)).map(e=>{let t=U(Je(R,e.name),e.commands),n=U(Je(D,e.name),U(e.systemCommands,[])),r=et(e.queryField),i=TK(e.schema);if(""===e.queryDocument){let o={...e};return o.systemCommands=n,o.commands=t,o.queryDocument=Yee(e.queryField,e.schema,r,i.hasFilter,i.hasSort,i.hasSearch),o}let o={...e};return o.systemCommands=n,o.commands=t,o}),Q=T.stateViewSlices.filter(e=>!x.includes(e.name)).map(e=>{let t=U(Je(R,e.name),[]),n=U(Je(D,e.name),[]),r=et(e.queryField),i=TK(e.schema),o=Yee(e.queryField,e.schema,r,i.hasFilter,i.hasSort,i.hasSearch);return{name:e.name,schema:e.schema,queryDocument:o,queryField:e.queryField,sortIndex:e.sortIndex,commands:t,linkedWriteSide:e.linkedWriteSide,labelField:e.labelField,labelFieldSource:e.labelFieldSource,searchableFields:e.searchableFields,lifecycleField:e.lifecycleField,ownerField:e.ownerField,systemCommands:n}}),Y=function(e,t,n){let r=void 0!==n?n:(e,t)=>{},i={};return JI().filter(e=>{let t=e.arity;return"object"==typeof t&&"Multi"!==t.TAG}).forEach(n=>{let o={},s={},a=(e,t,n)=>{let r=Je(e,t);void 0!==r?r.push(n):e[t]=[n]};e.forEach(e=>{let r=j(t,t=>gF(t,e.name)),i=U(j(r,e=>e.canvas),n.label),l=j(r,e=>e.role);if(void 0!==l)return l===u3?a(o,i,e):l===d3?M(j(r,e=>e.resourceRef),t=>a(s,i,[e,t])):void 0}),Xe(s).forEach(e=>{let t=e[0],n=U(Je(o,t),[]),s=n.length;if(1!==s)return 0!==s?r(t,n.length):void 0;let a=n[0];e[1].forEach(e=>{i[e[0].name]={resource:a,resourceRef:e[1]}})})}),i}(X.concat(Q),p,(e,t)=>{console.warn("[AutoUI] "+T.id+': scheduler canvas "'+e+'" has '+t.toString()+" resource models — its events list omits the scheduler toggle (the generated page still renders)")}),Z={...T};Z.readModels=X;let ee=e=>{let t=U(p,pF),n=(r=gF(t,e.name),s=e.schema,o=L(j(ft(s),e=>Je(e,"x-reventless-audit")),!1,e=>{let t=ct(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG}),!!U(j(r,e=>e.audit),!1)||o);var r,o,s;return z(function(e,t){if(!t)return;let n=e.linkedWriteSide[0],r=function(e){let t=e.lastIndexOf("_");if(-1!==t)return e.slice(0,t)}(e.queryField);if(void 0===n)KV(e.name);else{if(void 0!==r){let e=function(e,t){return e+"_"+t+"EventHistory"}(r,n);return{queryField:e,queryDocument:GV(e),displayName:n}}KV(e.name)}}(e,n),t=>{let n=Je(E,e.name);return e=>i(a9,{binding:t,entityId:e,requiredAccess:n})})},te=e=>{let t=U(p,pF);if(U(j(gF(t,e.name),e=>e.presence),!1))return t=>i(Nee,{readModel:e.name,entityId:t})},ne={...T};ne.readModels=X.concat(Q);let re=e=>{let t=U(p,pF);return(n=OK(ne,e.name),s=gF(t,e.name),r=j(s,e=>e.related),o=e.name,void 0!==r?me(r,e=>{let t=n.find(t=>t.readModel.name===e);return void 0!==t?t:void console.error("[AutoUI] uiHints.views."+o+'.related names "'+e+'", which does not reference '+o+" through a filterable field — no panel for it. Detected: "+n.map(e=>e.readModel.name).join(", ")+".")}):n).map(t=>{let n=Je(E,t.readModel.name);return r=>i(Q9,{binding:t,entityId:r,hostViewName:e.name,pluginId:K,uiHints:p,requiredAccess:n})});var n,r,o,s},ie=e=>{let t=me([(n=e.name,z(EK(Z,n),e=>{let t=Je(E,e.readModel.name);return n=>i(K7,{binding:e,entityId:n,requiredAccess:t})}))].concat(re(e).map(e=>e)).concat([ee(e)]),e=>e);var n;if(0!==t.length)return e=>i(o,{children:t.map((t,n)=>i(g,{children:t(e)},n.toString()))})},oe=X.map(e=>{let t=et(e.queryField),n=Zee(t,e.schema),r=H(e.name),o=Je(w,e.name),s=void 0!==o?o:(t,n,o)=>i(G9,{data:o,schema:e.schema,rootLabel:e.name,commands:e.commands,rowActions:r,lifecycleField:e.lifecycleField,aggregateId:t,labelField:e.labelField,drillPath:n,pluginId:T.id,viewName:e.name,uiHints:p,entityPanel:ie(e),headerAccessory:te(e)});return J(e,s,T.id+".",t,n,Je(Y,e.name))}),se=Q.map(e=>{let t=et(e.queryField),n=Zee(t,e.schema),r=H(e.name),o=Je(w,e.name),s=void 0!==o?o:(t,n,o)=>i(G9,{data:o,schema:e.schema,rootLabel:e.name,commands:e.commands,rowActions:r,lifecycleField:e.lifecycleField,aggregateId:t,labelField:e.labelField,drillPath:n,pluginId:T.id,viewName:e.name,uiHints:p,entityPanel:ie(e),headerAccessory:te(e)});return J(e,s,T.id+".slice.",t,n,Je(Y,e.name))}),ae=T.stateChangeSlices.filter(e=>!S.includes(e.name)).map(e=>({fragmentId:T.id+".commands."+e.name,title:e.name,description:"Auto-generated command panel for "+e.name,extensionPackage:T.id,positions:y,component:t=>i(X9,{slice:e,contextId:t.contextId}),requiredAccess:Je(k,e.name),minWidth:void 0})),le=X.concat(Q).toSorted((e,t)=>e.sortIndex===t.sortIndex?ue(e.name,t.name):de(e.sortIndex,t.sortIndex));$(ZI("autoui.inferenceReport"))&&pee(T.id,iee(le,F),p,B),M(m,e=>e(hee(T.id,iee(le,F),p,B)));let ce,fe=le.map(e=>[e,za(e.schema,void 0,void 0)]),he=me(JI(),e=>{let t=e.arity;return"object"!=typeof t||"Multi"!==t.TAG?void 0:[e,t.min]}).flatMap(e=>{let t=e[1],n=e[0],r={};return fe.forEach(e=>{let t=e[0],i=j(p,e=>gF(e,t.name)),o=L(j(i,e=>e.suppress),!1,e=>e.includes(n.id)),s={registry:N};if(!n.isCapable(t.schema,e[1],s)||o)return;let a=U(j(i,e=>e.canvas),n.label),l=Je(r,a);void 0!==l?l.push(t):r[a]=[t]}),me(Xe(r),e=>{let r=e[1];if(r.length>=t)return[n,e[0],r]})}),pe=W("canvas")?he.map(e=>{let t=e[2],n=e[0],r=((e,t)=>he.some(n=>n[1]===t&&n[0].id!==e.id)?t+" — "+e.label:t)(n,e[1]),o=T.id+".canvas."+r,s=qV(T.name,r,900,void 0,void 0),a=cK(E,t.map(e=>e.name)),l=je(Wa(K,r)),c={fragmentId:o,title:r,menuEntry:s,requiredAccess:a,url:l};return G.push(Ue(Ha(K,r),e=>i(aK,{definition:c,children:i(v9,{pluginId:K,mode:n,canvasName:r,readModels:t,uiHints:p,viewAccess:E})}))),c}):[],ve=W("scheduler")?me(JI(),e=>{let t=e.arity;return"object"!=typeof t||"Multi"===t.TAG?void 0:[e,t._0]}).flatMap(e=>{let t=e[1],n=e[0],r={},o={},s=(e,t,n)=>{let r=Je(e,t);void 0!==r?r.push(n):e[t]=[n]};le.forEach(e=>{let t=j(p,t=>gF(t,e.name)),i=U(j(t,e=>e.canvas),n.label),a=j(t,e=>e.role);if(void 0!==a)return a===u3?s(r,i,e):a===d3?M(j(t,e=>e.resourceRef),t=>s(o,i,[e,t])):void 0});let a=(e,n)=>L(t.find(t=>t.role===e),n,e=>e.min),l=a(u3,1),c=a(d3,1);return me(Xe(r),e=>{let t=e[1],r=e[0],s=U(Je(o,r),[]),a=t[0];if(void 0===a)return;if(!(t.length>=l&&s.length>=c))return;let u=s.map(e=>({readModel:e[0],resourceRef:e[1]})),d=T.id+".scheduler."+r,f=qV(T.name,r,910,void 0,void 0),h=lK(E,a.name),g=je(Wa(K,r)),m={fragmentId:d,title:r,menuEntry:f,requiredAccess:h,url:g};return G.push(Ue(Ha(K,r),e=>i(aK,{definition:m,children:i(nee,{pluginId:K,canvasName:r,mode:n,resource:a,events:u,uiHints:p,viewAccess:E})}))),m})}):[],ye=X.concat(Q).flatMap(e=>{return(t=e.schema,U(z(j(j(ft(t),e=>Je(e,"properties")),ft),e=>me(Xe(e),e=>{let t=e[0];return j(j(j(ft(e[1]),e=>Je(e,"x-reventless-metric")),ft),e=>{let n=j(Je(e,"aggregate"),ut),r=j(Je(e,"label"),ut);return z(n,e=>[t,e,r])})})),[])).map(t=>({view:e.name,label:t[2],field:t[0],aggregate:t[1]}));var t}),_e=X.concat(Q).flatMap(e=>function(e,t){let n=za(e,t,void 0).semantics;return me(_a(e),e=>{let t=e[0];return j(Je(n,t),e=>{if(sa(e.semantic).includes("Measure"))return t})})}(e.schema,j(p,t=>mF(t,e.name))).map(t=>({view:e.name,field:t,aggregate:"sum"}))),be=U(j(p,e=>e.dashboard),[]),xe=be.map(e=>[e.view,U(e.field,"")]),Se=(e,t)=>!e.some(e=>e[0]===t.view&&e[1]===U(t.field,"")),we=ye.filter(e=>Se(xe,e)),Ee=xe.concat(we.map(e=>[e.view,U(e.field,"")])),ke=be.concat(we).concat(_e.filter(e=>Se(Ee,e)));if(0!==ke.length&&W("dashboard")){let e="Dashboard",t=X.concat(Q),n=T.id+".dashboard",r=qV(T.name,e,-100,void 0,void 0),o=cK(E,ge(ke.map(e=>e.view),[],(e,t)=>e.includes(t)?e:e.concat([t])).filter(e=>t.some(t=>t.name===e))),s={fragmentId:n,title:e,menuEntry:r,requiredAccess:o,url:je(Wa(K,e))};G.push(Ue(Ha(K,e),e=>i(aK,{definition:s,children:i(U8,{pluginId:K,metrics:ke,readModels:t,uiHints:p,viewAccess:E})}))),ce=[s]}else ce=[];let Ce,Ae=E7(X.concat(Q));if(0!==Ae.length&&W("lifecycles")){let e="Lifecycles",t={fragmentId:T.id+".lifecycles",title:e,menuEntry:qV(T.name,e,-50,void 0,void 0),requiredAccess:void 0,url:je(Wa(K,e))};G.push(Ue(Ha(K,e),e=>i(A7,{views:Ae,uiHints:p}))),Ce=[t]}else Ce=[];return{pages:ce.concat(Ce.concat(oe.concat(se.concat(pe.concat(ve))))),panels:ae,routes:G,publicLinks:V}}function ite(e){return VO(qO(e))}function ote(e){return qO(e).errors.some(e=>!!mt(e.code,"FORBIDDEN")||mt(e.errorType,"Unauthorized"))}let ste=new Map;async function ate(t,n,r){!function(t,n){let r=ste.get(t);if(void 0===r||r!==n)e.registerRemotes([{name:t,entry:n,type:"module"}]),ste.set(t,n)}(t,r);try{let r=await e.loadRemote(t+"/"+n);return null==r?{TAG:"Error",_0:"Module Federation returned null for "+t+"/"+n+" — the plugin's vite federation config probably doesn't expose this fragment."}:{TAG:"Ok",_0:r.default}}catch(i){let e=F(i);return e.RE_EXN_ID!==I?{TAG:"Error",_0:"Failed to load "+t+"/"+n+" from "+r}:{TAG:"Error",_0:"Failed to load "+t+"/"+n+" from "+r+": "+U(e._1.message,"unknown error")}}}const lte=l(null),cte={didCatch:!1,error:null};class ute extends x{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=cte}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(cte)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:r}=this.props;var i,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(e.resetKeys,r)&&(null===(i=(o=this.props).onReset)||void 0===i||i.call(o,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(cte))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:o}=this.state;let s=e;if(i){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(e);else if(n)s=c(n,e);else{if(void 0===r)throw o;s=r}}return c(lte.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function dte(e){let t=U(e.error.message,"unknown error");return i("div",{children:"Plugin fragment crashed: "+t,style:{color:"#a00",fontFamily:"system-ui",padding:"1rem"}})}function fte(e,t){console.error("Fragment crashed:",e)}let hte=function(e){let t=e.fallbackComponent;return c(ute,{FallbackComponent:void 0!==t?t:dte,onError:fte,children:e.children})};let pte=function(e){let t=e.remoteEntryUrl,n=e.fragmentId,r=e.pluginId,o=s(()=>"Loading"),l=o[1],u=o[0];return a(()=>{l(e=>"Loading");let e={contents:!1};return ate(r,n,t).then(t=>{if(e.contents)return;if("Ok"===t.TAG){let e=t._0;return l(t=>({TAG:"Loaded",_0:e}))}let n=t._0;l(e=>({TAG:"Failed",_0:n}))}),()=>{e.contents=!0}},[r,n,t]),"object"!=typeof u?i("div",{children:"Loading panel…",style:{fontFamily:"system-ui",padding:"0.75rem"}}):"Loaded"===u.TAG?i(hte,{children:c(u._0,e.panelProps)}):i("div",{children:"Panel error: "+u._0,style:{color:"#a00",padding:"0.75rem"}})};function gte(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function mte(e){return"object"===gte(e)}function vte(e,t){return e.length<124?e:t}var yte,_te;function bte(e){if(!mte(e))throw new Error(`Message is expected to be an object, but got ${gte(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if("string"!=typeof e.type)throw new Error(`Message is expects the 'type' property to be a string, but got ${gte(e.type)}`);switch(e.type){case _te.ConnectionInit:case _te.ConnectionAck:case _te.Ping:case _te.Pong:if(null!=e.payload&&!mte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case _te.Subscribe:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${gte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!mte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${gte(e.payload)}`);if("string"!=typeof e.payload.query)throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${gte(e.payload.query)}`);if(null!=e.payload.variables&&!mte(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${gte(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==gte(e.payload.operationName))throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${gte(e.payload.operationName)}`);if(null!=e.payload.extensions&&!mte(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${gte(e.payload.extensions)}`);break;case _te.Next:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${gte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!mte(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${gte(e.payload)}`);break;case _te.Error:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${gte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(t=e.payload,!(Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case _te.Complete:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${gte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw new Error(`Invalid message 'type' property "${e.type}"`)}var t;return e}function xte(e,t){return bte(e),JSON.stringify(e,t)}!function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"}(yte||(yte={})),function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"}(_te||(_te={}));var Ste=function(e){return this instanceof Ste?(this.v=e,this):new Ste(e)},wte=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function s(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})},t&&(r[e]=t(r[e])))}function a(e,t){try{!function(e){e.value instanceof Ste?Promise.resolve(e.value.v).then(l,c):u(o[0][2],e)}(i[e](t))}catch(pU){u(o[0][3],pU)}}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}};function Ete(e){const{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:o=0,keepAlive:s=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:c=5,retryWait:u=async function(e){let t=1e3;for(let n=0;n<e;n++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(2700*Math.random()+300)))},shouldRetry:d=Cte,isFatalConnectionProblem:f,on:h,webSocketImpl:p,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},jsonMessageReplacer:m,jsonMessageReviver:v}=e;let y;if(p){if(!("function"==typeof(_=p)&&"constructor"in _&&"CLOSED"in _&&"CLOSING"in _&&"CONNECTING"in _&&"OPEN"in _))throw new Error("Invalid WebSocket implementation provided");y=p}else"undefined"!=typeof WebSocket?y=WebSocket:"undefined"!=typeof global?y=global.WebSocket||global.MozWebSocket:"undefined"!=typeof window&&(y=window.WebSocket||window.MozWebSocket);var _;if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const b=y,x=(()=>{const e=(()=>{const e={};return{on:(t,n)=>(e[t]=n,()=>{delete e[t]}),emit(t){var n;"id"in t&&(null===(n=e[t.id])||void 0===n||n.call(e,t))}}})(),t={connecting:(null==h?void 0:h.connecting)?[h.connecting]:[],opened:(null==h?void 0:h.opened)?[h.opened]:[],connected:(null==h?void 0:h.connected)?[h.connected]:[],ping:(null==h?void 0:h.ping)?[h.ping]:[],pong:(null==h?void 0:h.pong)?[h.pong]:[],message:(null==h?void 0:h.message)?[e.emit,h.message]:[e.emit],closed:(null==h?void 0:h.closed)?[h.closed]:[],error:(null==h?void 0:h.error)?[h.error]:[]};return{onMessage:e.on,on(e,n){const r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(const r of[...t[e]])r(...n)}}})();function S(e){const t=[x.on("error",n=>{t.forEach(e=>e()),e(n)}),x.on("closed",n=>{t.forEach(e=>e()),e(n)})]}let w,E,k=0,C=!1,A=0,N=!1;async function T(){clearTimeout(E);const[e,r]=await(null!=w?w:w=new Promise((e,r)=>(async()=>{if(C){if(await u(A),!k)return w=void 0,r({code:1e3,reason:"All Subscriptions Gone"});A++}x.emit("connecting",C);const i=new b("function"==typeof t?await t():t,"graphql-transport-ws");let o,c;function d(){isFinite(s)&&s>0&&(clearTimeout(c),c=setTimeout(()=>{i.readyState===b.OPEN&&(i.send(xte({type:_te.Ping})),x.emit("ping",!1,void 0))},s))}S(e=>{w=void 0,clearTimeout(o),clearTimeout(c),r(e),e instanceof kte&&(i.close(4499,"Terminated"),i.onerror=null,i.onclose=null)}),i.onerror=e=>x.emit("error",e),i.onclose=e=>x.emit("closed",e),i.onopen=async()=>{try{x.emit("opened",i);const e="function"==typeof n?await n():n;if(i.readyState!==b.OPEN)return;i.send(xte(e?{type:_te.ConnectionInit,payload:e}:{type:_te.ConnectionInit},m)),isFinite(l)&&l>0&&(o=setTimeout(()=>{i.close(yte.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),d()}catch(e){x.emit("error",e),i.close(yte.InternalClientError,vte(e instanceof Error?e.message:new Error(e).message,"Internal client error"))}};let f=!1;i.onmessage=({data:t})=>{try{const n=function(e,t){return bte("string"==typeof e?JSON.parse(e,t):e)}(t,v);if(x.emit("message",n),"ping"===n.type||"pong"===n.type)return x.emit(n.type,!0,n.payload),void("pong"===n.type?d():a||(i.send(xte(n.payload?{type:_te.Pong,payload:n.payload}:{type:_te.Pong})),x.emit("pong",!1,n.payload)));if(f)return;if(n.type!==_te.ConnectionAck)throw new Error(`First message cannot be of type ${n.type}`);clearTimeout(o),f=!0,x.emit("connected",i,n.payload,C),C=!1,A=0,e([i,new Promise((e,t)=>S(t))])}catch(n){i.onmessage=null,x.emit("error",n),i.close(yte.BadResponse,vte(n instanceof Error?n.message:new Error(n).message,"Bad response"))}}})()));e.readyState===b.CLOSING&&await r;let i=()=>{};const c=new Promise(e=>i=e);return[e,i,Promise.race([c.then(()=>{if(!k){const t=()=>e.close(1e3,"Normal Closure");isFinite(o)&&o>0?E=setTimeout(()=>{e.readyState===b.OPEN&&t()},o):t()}}),r])]}function R(e){if(Cte(e)&&(function(e){return![1e3,1001,1006,1005,1012,1013,1014].includes(e)&&(e>=1e3&&e<=1999)}(e.code)||[yte.InternalServerError,yte.InternalClientError,yte.BadRequest,yte.BadResponse,yte.Unauthorized,yte.SubprotocolNotAcceptable,yte.SubscriberAlreadyExists,yte.TooManyInitialisationRequests].includes(e.code)))throw e;if(N)return!1;if(Cte(e)&&1e3===e.code)return k>0;if(!c||A>=c)throw e;if(!d(e))throw e;if(null==f?void 0:f(e))throw e;return C=!0}function D(e,t){const n=g(e);let r=!1,i=!1,o=()=>{k--,r=!0};return(async()=>{for(k++;;)try{const[s,a,l]=await T();if(r)return a();const c=x.onMessage(n,e=>{switch(e.type){case _te.Next:return void t.next(e.payload);case _te.Error:return i=!0,r=!0,t.error(e.payload),void o();case _te.Complete:return r=!0,void o()}});return s.send(xte({id:n,type:_te.Subscribe,payload:e},m)),o=()=>{r||s.readyState!==b.OPEN||s.send(xte({id:n,type:_te.Complete},m)),k--,r=!0,a()},void(await l.finally(c))}catch(s){if(!R(s))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||o()}}return r||(async()=>{for(k++;;)try{const[,,e]=await T();await e}catch(e){try{if(!R(e))return}catch(e){return null==i?void 0:i(e)}}})(),{on:x.on,subscribe:D,iterate(e){const t=[],n={done:!1,error:null,resolve:()=>{}},r=D(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=function(){return wte(this,arguments,function*(){for(;;){for(t.length||(yield Ste(new Promise(e=>n.resolve=e)));t.length;)yield yield Ste(t.shift());if(n.error)throw n.error;if(n.done)return yield Ste(void 0)}})}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(N=!0,w){const[e]=await w;e.close(1e3,"Normal Closure")}},terminate(){w&&x.emit("closed",new kte)}}}class kte extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Cte(e){return mte(e)&&"code"in e&&"reason"in e}function Ate(e,t){return j(e[t],He.string)}function Nte(e,t){return U(Ate(e,t),"")}function Tte(e,t){return z(j(e[t],He.float),e=>0|e)}function Rte(e,t){return me(U(j(e[t],He.array),[]),He.string)}function Dte(e){let t=He.object(e);return void 0!==t?{label:Nte(t,"label"),icon:Ate(t,"icon"),group:Ate(t,"group"),sortOrder:U(Tte(t,"sortOrder"),0)}:{label:"",icon:void 0,group:void 0,sortOrder:0}}function Ite(e){return z(He.object(e),e=>({fragmentId:Nte(e,"fragmentId"),title:Nte(e,"title"),description:Nte(e,"description"),positions:Rte(e,"positions"),requiredAccess:Ate(e,"requiredAccess")}))}function Fte(e){return z(He.object(e),e=>({fragmentId:Nte(e,"fragmentId"),title:Nte(e,"title"),menuEntry:U(z(e.menuEntry,Dte),{label:Nte(e,"title"),icon:void 0,group:void 0,sortOrder:0}),requiredAccess:Ate(e,"requiredAccess")}))}function Ote(e){return z(He.object(e),e=>({pluginId:Nte(e,"pluginId"),remoteEntryUrl:Nte(e,"remoteEntryUrl"),panels:me(U(j(e.panels,He.array),[]),Ite),pages:me(U(j(e.pages,He.array),[]),Fte),registeredAt:Nte(e,"registeredAt"),updatedAt:Nte(e,"updatedAt")}))}let Pte=["message","body","text","title","content"],Mte=["userId","recipientId","recipient","user","targetUserId"],Lte=["createdAt","sentAt","notifiedAt","at","timestamp"],zte=["read","isRead","seen","acknowledged"];function jte(e,t){return t.some(t=>t.toLowerCase()===e.toLowerCase())}function Ute(e){return me(_a(e),e=>{if(Sa(e[1]))return e[0]})}function Bte(e,t){return Ute(e).find(e=>jte(e,t))}function $te(e){return me(_a(e),e=>{if(mt(ba(e[1],"type"),"boolean"))return e[0]}).find(e=>jte(e,zte))}function qte(e,t){return me(Ute(e),e=>{let n=e.toLowerCase();return e!==t&&"id"!==n&&n.endsWith("id")?{field:e,stem:e.slice(0,e.length-2|0)}:void 0})}let Gte=["markread","marknotificationread","readnotification","acknowledge","dismiss","markseen"];function Vte(e,t){let n=me(e.linkedWriteSide,e=>t.aggregates.find(t=>t.name===e)).map(e=>e.commands).flat();return e.commands.concat(n).find(e=>Gte.some(t=>e.name.toLowerCase().startsWith(t)))}let Kte={contents:[]};function Wte(e,t,n){if(!Kte.contents.includes(e))return Kte.contents.push(e),void console.error('[AutoUI] Read model "'+e+'" announces itself as notifications but has no '+t+" field — no notification bell is wired. The convention expects a string field named "+n.join(" | ")+"; see docs/guides/notifications-read-model-convention.md.")}function Hte(e){return me(e.readModels.filter(e=>!!L(j(ft(e.schema),e=>Je(e,"x-reventless-notifications")),!1,e=>{let t=ct(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||e.name.toLowerCase().endsWith("notifications")),t=>{let n=Bte(t.schema,Pte),r=function(e){let t=Bte(e,Mte);if(void 0!==t)return t;let n=za(e,void 0,void 0);return _a(e).map(e=>e[0]).find(e=>L(Je(n.semantics,e),!1,e=>"UserRef"===e.semantic))}(t.schema);return void 0!==n?void 0!==r?{readModel:t,messageField:n,recipientField:r,timestampField:(i=t.schema,me(_a(i),e=>{if(wa(e[1]))return e[0]}).find(e=>jte(e,Lte))),readField:$te(t.schema),refFields:qte(t.schema,r),markReadCommand:Vte(t,e)}:void Wte(t.name,"recipient",Mte):void Wte(t.name,"message",Pte);var i})[0]}function Jte(e,t){return j(Je(e,t),ut)}function Xte(e,t){return j(j(t.timestampField,t=>Jte(e,t)),fc)}function Qte(e,t,n){let r=t.readField;if(void 0!==r){let t=z(Je(e,r),ct);return"JSONTrue"===t&&"object"!=typeof t}let i=Xte(e,t);return void 0===i||void 0!==n&&i<=n}function Yte(e,t,n,r){return me(t,t=>{let r=U(ft(t),{});if(function(e,t,n){let r=Jte(e,t.recipientField);return void 0===r||void 0===n||r===n.userId||r===n.username}(r,e,n))return r}).toSorted((t,n)=>{let r=Xte(t,e),i=Xte(n,e);return void 0!==r?void 0!==i?i-r:-1:void 0!==i?1:0}).map((t,n)=>({id:U(Jte(t,"id"),"#"+n.toString()),message:U(Jte(t,e.messageField),""),timestamp:j(e.timestampField,e=>Jte(t,e)),read:Qte(t,e,r),refs:me(e.refFields,e=>z(Jte(t,e.field),t=>[e.stem,t]))}))}let Zte=l([]),ene=l(e=>{}),tne=Zte.Provider,nne=ene.Provider;let rne=function(e){let t=e.initial,n=void 0!==t?t:[],r=s(()=>n),i=r[1],o=f(e=>i(t=>e),[]);return c(nne,{value:o,children:c(tne,{value:r[0],children:e.children})})};function ine(e,t){return e+"/"+t}function one(e,t,n){return e.map(e=>{let r=function(e,t,n){return e.get(ine(t,n))}(n,t,e.fragmentId);return void 0!==r?{fragmentId:e.fragmentId,title:e.title,description:e.description,extensionPackage:e.extensionPackage,positions:e.positions,component:n=>i(pte,{pluginId:t,fragmentId:e.fragmentId,remoteEntryUrl:r,panelProps:n}),requiredAccess:e.requiredAccess,minWidth:e.minWidth}:e})}function sne(e,t){let n=t+".",r=e.startsWith(n)?e.slice(n.length):e;return U(z([".list",".detail"].find(e=>r.endsWith(e)),e=>r.slice(0,r.length-e.length|0)),r)}let ane={contents:[]};function lne(e,t,n){let r=Object.fromEntries([["content-type","application/json"]]);return void 0!==n&&(r.Authorization="Bearer "+n),ce(fetch(e,{method:"POST",headers:r,body:U(JSON.stringify({query:t}),"")}).then(e=>e.json()),e=>Promise.resolve(null))}function cne(e,t,n,r,i,o,s){let a,l=function(e){let t=new Map;return e.forEach(e=>{let n=e.remoteEntryUrl;if(n.length>0)return e.pages.forEach(r=>{t.set(ine(e.pluginId,r.fragmentId),n)}),void e.panels.forEach(r=>{t.set(ine(e.pluginId,r.fragmentId),n)})}),t}(t),c=function(e,t,n){return"Lock"===e?[n,UF(t,n),BF(t,n)]:[jF(t,n),{},{}]}(i,r,e),u=c[2],d=c[1],f=xO(o,s,c[0]);a="object"!=typeof o&&"Unknown"!==o;let h=Gee.buildRegistry(f),p=me(f,e=>z(Hte(e),t=>({pluginId:e.id,binding:t}))),g=[],m=[],v=[],y={contents:{}};return f.forEach(r=>{let i=function(e,t){let n=t.find(t=>t.pluginId===e&&t.remoteEntryUrl.length>0);return void 0!==n?[n.pages.map(t=>sne(t.fragmentId,e)),n.panels.map(t=>sne(t.fragmentId,e))]:[[],[]]}(r.id,t),o=rte(r,0,0,0,f,e,i[0],i[1],0,d,u,a,n[r.id],void 0),s=one(o.panels,r.id,l);o.pages.forEach(e=>{g.push(e)}),s.forEach(e=>{m.push(e)}),o.routes.forEach(e=>{v.push(e)}),y.contents=$e(y.contents,o.publicLinks)}),t.forEach(e=>{}),{pages:g,panels:m,routes:v,publicLinks:y.contents,entities:h,notificationBindings:p}}let une="Admin";function dne(e,t){let n=void 0!==e?"You are acting as "+e+", and this deployment has no surfaces configured for that role. Its pages are discovered from an admin-only query, which only the "+une+" group can reach.":"This deployment has no surfaces configured for your roles. Its pages are discovered from an admin-only query, which only the Admin group can reach.";return void 0!==t?n+" The shell this platform serves does have surfaces for it: "+t:n}function fne(e,t,n,r){if(void 0!==e.manifestUrl&&("object"!=typeof t||!n.includes(une)))return function(e,t){return B(j(t,t=>e.journeyManifestUrls[t]),e.manifestUrl)}(e,r)}function hne(e,t){return"/"===t||e.some(e=>t===e||t.startsWith(e+"/"))}function pne(e){if(null==sessionStorage.getItem(aq)||(sessionStorage.removeItem(aq),0))return;let t=ane.contents;if(hne(t,"/"+xe(Y(void 0).path).join("/")))return;let n=P(j(z(e.home,e=>e.trim()),e=>""===e?void 0:e),e=>hne(t,e));J(U(B(n,t[0]),"/"))}function gne(e){return"ManifestUnreadable"===e.TAG?"Component manifest could not be loaded":"Nothing here for the role you are acting as"}function mne(e,t,n,r,i,o,s,a,l,c,u,d,f,h){let p=(t,n)=>function(e,t,n,r,i,o,s,a,l,c,u,d){let f=cne(o,s,a,l,c,u,d);r(f.entities),i(f.notificationBindings),M(e,e=>e.setPluginPages(f.pages)),ane.contents=me(f.pages,e=>e.url),M(t,e=>e.setPluginPanels(f.panels)),M(n,e=>e.setPluginRoutes(f.routes,f.publicLinks))}(r,i,o,s,a,t,n,l,c,e.deniedSurfaces,u,d),g=fne(e,u,f,h);if(void 0!==g)return UO(g).then(e=>{if("Ok"!==e.TAG)return{TAG:"ManifestUnreadable",_0:e._0};p(e._0,[])});let m=lne(e.platformApiEndpoint,"{\n Platform_ComponentDefinitions {\n pluginId\n readModels { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n aggregates { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed requiredAccess ownerField } linkedViews }\n stateViewSlices { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n internalQueryables { name queryField schema linkedWriteSide labelField labelFieldSource searchableFields lifecycleField requiredAccess ownerField }\n stateChangeSlices { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed requiredAccess ownerField } linkedViews consistencyRead }\n }\n}",t),v=lne(e.platformApiEndpoint,"{\n Platform_UIFragments {\n pluginId\n remoteEntryUrl\n panels { fragmentId title description positions requiredAccess }\n pages {\n fragmentId\n title\n menuEntry { label icon group sortOrder }\n requiredAccess\n }\n registeredAt\n updatedAt\n }\n}",t);return Promise.all([m,v]).then(t=>{let r=t[1],i=t[0],o=ote(i)||ote(r),s=o||ite(i)||ite(r);var a;if(p((a=i,U(z(j(j(j(He.object(a),e=>e.data),He.object),e=>e.Platform_ComponentDefinitions),PO),[])),function(e){return me(U(j(j(j(j(He.object(e),e=>e.data),He.object),e=>e.Platform_UIFragments),He.array),[]),Ote)}(r)),s)return function(e,t){return!e&&t.includes(une)}(o,f)?void n():{TAG:"NoSurfacesForCaller",_0:dne(h,e.hostShellUrl)}})}function vne(e){return r("div",{children:[i("strong",{children:e.title}),i("p",{children:e.message,style:{margin:"0.5rem 0 0",whiteSpace:"pre-wrap"}})],role:"alert",style:{background:"var("+yt.surfaceSubtle+")",border:"1px solid var("+yt.borderSubtle+")",color:"var("+yt.error+")",margin:"1rem",padding:"1rem 1.25rem",borderRadius:"0.375rem"}})}let yne=function(e){let t=e.uiHints,n=e.config,r=void 0!==t?t:{},o=d(rG),l=d(nV),c=_V(),u=d(Ua),f=d(ene),h=Cq(),p=j(h,e=>e.getToken()),g=L(j(h,e=>e.identity),[],e=>e.groups),m=j(j(h,e=>e.identity),e=>e.activeRole),v=g.concat(n.accessTiers),y=_O(n.elevatedGroups,g),_=L(j(h,e=>e.identity),"",e=>e.userId),b=s(()=>{}),x=b[1],S=b[0];return a(()=>{mne(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,_,g,m).then(e=>{M(e,e=>{console.error("[Shell] "+e._0)}),x(t=>e),pne(n)})},[p,r]),a(()=>{if(function(e,t,n,r){return q(fne(e,t,n,r))}(n,y,g,m))try{let e=function(e,t){return Ete({url:e,connectionParams:void 0!==t?{Authorization:"Bearer "+t}:void 0,lazy:!0,retryAttempts:5})}(n.platformApiSubscriptionEndpoint,p),t=()=>{mne(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,_,g,m)},i=e.subscribe({query:"subscription OnPluginStatusChange {\n onPluginStatusChange { pluginId status }\n}",variables:void 0},{next:e=>t(),error:e=>{},complete:()=>{}}),s=e.subscribe({query:"subscription OnUIFragmentChange {\n onUIFragmentChange { pluginId changeKind }\n}",variables:void 0},{next:e=>t(),error:e=>{},complete:()=>{}});return()=>{i(),s(),e.dispose()}}catch(e){return}},[p]),void 0!==S?i(vne,{message:S._0,title:gne(S)}):null};async function _ne(e,t,n,r,i,o){let s=[],a=function(e,t,n){return me(t,t=>mt(t,n)?void 0:z(e[t],e=>[t,e]))}(e.journeyManifestUrls,t,n),l=await Promise.all(a.map(e=>{let t=e[0];return UO(e[1]).then(e=>[t,e])}));return l.forEach(t=>{let n=t[1],a=t[0];if("Ok"!==n.TAG)return;let l=me(cne(n._0,[],i,[a].concat(e.accessTiers),e.deniedSurfaces,_O(e.elevatedGroups,[a]),o).pages,e=>e.url);hne(l,r)&&s.push(a)}),s}let bne={display:"flex",padding:"2rem",alignItems:"flex-start",flexDirection:"column",gap:"var("+_t.sm+")"},xne={fontSize:"var("+bt.sizeLg+")",fontWeight:"var("+bt.weightMedium+")",margin:"0"},Sne={color:"var("+yt.textSecondary+")",margin:"0"},wne={background:"var("+yt.surface+")",border:"1px solid var("+yt.borderSubtle+")",color:"var("+yt.textPrimary+")",cursor:"pointer",padding:"0.4rem 0.9rem",borderRadius:"0.375rem"},Ene={color:"var("+yt.error+")",margin:"0"};let kne=function(e){let t,n=e.uiHints,l=e.config,c=Cq(),u=le(),d=j(c,e=>e.identity),f=L(c,!1,e=>e.canSwitchRoles),h=L(d,[],e=>Wq(f,e)),p=j(d,e=>e.activeRole),g=L(d,"",e=>e.userId),m=s(()=>[]),v=m[1],y=m[0],_=s(()=>!1),b=_[1],x=_[0],S=s(()=>{}),w=S[1],E=S[0];if(a(()=>{let e={contents:!0};return _ne(l,h,p,u,n,g).then(t=>{if(e.contents)return v(e=>t)}),()=>{e.contents=!1}},[u,h.join(",")]),0!==y.length){let e;if(1!==y.length)e="This page is part of another role you hold: "+y.join(", ")+".";else{e="This page is part of your "+y[0]+" role."}t=r(o,{children:[i("p",{children:e,style:Sne}),y.map(e=>i("button",{children:"Act as "+e,style:wne,disabled:x,onClick:t=>M(c,t=>{b(e=>!0),w(e=>{}),t.switchRole(e).then(e=>{if(b(e=>!1),"object"!=typeof e)return;let t=e._0;w(e=>t)})})},e)),void 0!==E?i("p",{children:E,style:Ene}):null]})}else t=null;return r("div",{children:[i("h1",{children:"404 — Page not found",style:xne}),t],style:bne})};function Cne(e){return"var("+e+")"}let Ane=lo([ji("relative"),pi("inlineBlock")]),Nne=lo([ji("relative"),pi("inlineFlex"),ui("center"),bi("center"),ci("background","none"),ci("border","none"),ci("border-radius",Cne(xt.md)),ci("cursor","pointer"),ci("color",Cne(yt.textSecondary)),ci("padding","6px"),Qi([ci("background",Cne(yt.surfaceSubtle)),ci("color",Cne(yt.textPrimary))])]),Tne=lo([ji("absolute"),$i(eo(0)),Ui(eo(0)),pi("inlineFlex"),ui("center"),bi("center"),ci("min-width","16px"),ci("height","16px"),ci("padding","0 4px"),ci("border-radius",Cne(xt.full)),ci("background",Cne(yt.brand)),ci("color",Cne(yt.textOnBrand)),ci("font-family",Cne(bt.fontFamily)),ci("font-size","10px"),ci("font-weight",Cne(bt.weightBold)),ci("line-height","1")]),Rne=lo([ji("absolute"),Ui(eo(0)),$i({NAME:"percent",VAL:100}),Ni(eo(4)),ci("width","320px"),ci("background",Cne(yt.surfaceElevated)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",Cne(xt.md)),ci("box-shadow",Cne(wt)),ci("z-index","200"),ci("overflow","hidden"),ci("font-family",Cne(bt.fontFamily))]),Dne=lo([pi("flex"),ui("center"),bi("spaceBetween"),ci("padding","var("+_t.sm+") var("+_t.md+")"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),ci("color",Cne(yt.textSecondary)),ci("font-size",Cne(bt.sizeSm)),ci("font-weight",Cne(bt.weightMedium)),ci("text-transform","uppercase"),ci("letter-spacing","0.04em")]),Ine=lo([ci("background","none"),ci("border","none"),ci("color",Cne(yt.brand)),ci("font-size",Cne(bt.sizeXs)),ci("text-transform","none"),ci("letter-spacing","0"),hi("pointer"),Qi([ci("text-decoration","underline")])]),Fne=lo([ci("max-height","360px"),ci("overflow-y","auto")]);function One(e){return lo([pi("flex"),ui("flexStart"),ci("gap",Cne(_t.sm)),ci("width","100%"),ci("background","none"),ci("border","none"),ci("border-bottom","1px solid var("+yt.borderSubtle+")"),ci("text-align","left"),ci("padding","var("+_t.sm+") var("+_t.md+")"),hi(e?"pointer":"default"),Qi(e?[ci("background",Cne(yt.surfaceSubtle))]:[])])}function Pne(e){return lo([ci("width","8px"),ci("height","8px"),ci("border-radius",Cne(xt.full)),ci("margin-top","5px"),ci("flex-shrink","0"),ci("background",e?"transparent":Cne(yt.brand))])}let Mne=lo([pi("flex"),gi("column"),ci("gap","2px"),ci("min-width","0")]);function Lne(e){return lo([ci("color",Cne(yt.textPrimary)),ci("font-size",Cne(bt.sizeSm)),ci("font-weight",Cne(e?bt.weightNormal:bt.weightMedium)),ci("line-height",Cne(bt.lineHeightNormal)),ci("word-break","break-word")])}let zne=lo([ci("color",Cne(yt.textDisabled)),ci("font-size",Cne(bt.sizeXs))]),jne=lo([ci("color",Cne(yt.textDisabled)),ci("font-size",Cne(bt.sizeSm)),ci("padding",Cne(_t.md)),ci("text-align","center")]);function Une(e){return r("svg",{children:[i("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),i("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})],"aria-hidden":!0,height:"18",width:"18",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24"})}let Bne=function(e){let t=e.defaultOpen,n=e.nowMs,o=e.emptyLabel,l=e.onPanelOpen,c=e.onMarkAllRead,u=e.onOpen,d=e.notifications,f=void 0!==o?o:"No notifications",h=void 0!==t&&t,p=void 0!==n?n:Date.now(),g=s(()=>h),m=g[1],v=g[0],y=d.filter(e=>!e.read).length;return a(()=>{if(!v)return;let e=e=>m(e=>!1),t=e=>{if("Escape"===e.key)return m(e=>!1)};return document.addEventListener("click",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[v]),r("div",{children:[r("button",{children:[i(Une,{}),y>0?i("span",{children:y>99?"99+":y.toString(),className:Tne}):null],"aria-label":y>0?"Notifications ("+y.toString()+" unread)":"Notifications",className:Nne,title:"Notifications",type:"button",onClick:e=>{e.stopPropagation(),(()=>{let e=!v;e&&M(l,e=>e()),m(t=>e)})()}}),v?r("div",{children:[r("div",{children:["Notifications",void 0!==c&&y>0?i("button",{children:"Mark all read",className:Ine,type:"button",onClick:e=>c()}):null],className:Dne}),0===d.length?i("div",{children:f,className:jne}):i("div",{children:d.map(e=>{let t=e.timestamp;return r("button",{children:[i("span",{className:Pne(e.read)}),r("span",{children:[i("span",{children:e.message,className:Lne(e.read)}),void 0!==t?i("span",{children:RY(p,t),className:zne}):null],className:Mne})],className:One($(u)),type:"button",onClick:t=>{M(u,t=>t(e)),m(e=>!1)}},e.id)}),className:Fne})],className:Rne,onClick:e=>{e.stopPropagation()}}):null],className:Ane})};function $ne(e){return"autoui.notifications.seen."+e}function qne(e){let t=e.onData,n=L3(e.binding.readModel,void 0);return a(()=>{t({rows:n.rows,refetch:n.refetch})},[n.rows]),null}let Gne=function(e){let t=d(Zte),n=Cq(),a=SI(),l=u1(),c=Ga(),u=ae(),f=s(()=>({})),h=f[1],p=f[0],g=s(()=>0)[1],m=z(j(n,e=>e.identity),e=>({userId:e.userId,username:e.username})),v=t.flatMap(e=>{let t=L(Je(p,e.pluginId),[],e=>e.rows);return Yte(e.binding,t,m,function(e){let t=localStorage.getItem($ne(e));if(null!=t)return ea(t)}(e.pluginId)).map(t=>({key:e.pluginId+":"+t.id,appBinding:e,entry:t}))}).toSorted((e,t)=>{let n=j(e.entry.timestamp,fc),r=j(t.entry.timestamp,fc);return void 0!==n?void 0!==r?r-n:-1:void 0!==r?1:0}),y=(e,t)=>{let n=e.binding.markReadCommand;void 0===n||void 0===l||ce(l(n.mutationDocument,function(e,t){let n=U(j(e.markReadCommand,e=>e.aggregateIdField),"id");return Ye([[n,t]])}(e.binding,t)).then(t=>{if("object"!=typeof t){let t=e.pluginId;return M(Je(p,t),e=>e.refetch())}"Rejected"!==t.TAG&&console.error("[AutoUI] notification markRead not executed — "+t._0)}),e=>Promise.resolve())},_=e=>M(v.find(t=>t.key===e.id),e=>{e.entry.read||y(e.appBinding,e.entry.id),M(function(e,t){let n=0;for(;;){let r=n;if(r===e.length)return;let i=t(e[r]);if(void 0!==i)return i;n=r+1|0}}(e.entry.refs,e=>{let t=e[1];return z(Va(c,e[0]),e=>[e,t])}),e=>{let t=e[0];u(Ja(t.pluginId,t.name,e[1],[]))})}),b=$(a)&&t.some(e=>$(e.binding.markReadCommand)),x=()=>{v.forEach(e=>e.entry.read?void 0:y(e.appBinding,e.entry.id))},S=()=>{t.forEach(e=>{let t=L(Je(p,e.pluginId),[],e=>e.rows);M(function(e,t){return ge(t,void 0,(t,n)=>{let r=Xte(U(ft(n),{}),e);return void 0!==t?void 0!==r?Math.max(t,r):t:r})}(e.binding,t),t=>function(e,t){localStorage.setItem($ne(e),t.toString())}(e.pluginId,t))}),g(e=>e+1|0)},w=v.map(e=>({id:e.key,message:e.entry.message,timestamp:e.entry.timestamp,read:e.entry.read}));return 0===t.length?null:r(o,{children:[t.map(e=>{return i(qne,{binding:e.binding,onData:(t=e.pluginId,e=>h(n=>{let r=Ye(Xe(n));return r[t]=e,r}))},e.pluginId);var t}),i(Bne,{notifications:w,onOpen:_,onMarkAllRead:b?x:void 0,onPanelOpen:S})]})};let Vne=function(e){let t,n=e.onChange,r=gO();switch(e.config.authMode){case"Local":t=!0;break;case"Anonymous":case"Cognito":t=!1}let i=h(n);return i.current=n,a(()=>{let e=t?r:void 0;if(void 0===e)return;let n=e.subscribe("Domain","/default/dev/uiHints",e=>i.current()),o=e.registerReconnect("Domain",()=>i.current());return()=>{n(),o()}},[!!t&&$(r)]),null};function Kne(e){let t=["B","KB","MB","GB"],n=((e,n)=>{for(;;){if(!(e>=1024&&n<(t.length-1|0)))return[e,n];n=n+1|0,e=e/1024}})(e<0?0:e,0),r=n[1],i=n[0];return(0===r?Math.round(i).toString():(Math.round(10*i)/10).toString())+" "+t[r]}function Wne(e){return"var("+e+")"}let Hne=lo([pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap","6px"),ci("padding",Wne(_t.lg)),ci("border","2px dashed var("+yt.border+")"),ci("border-radius",Wne(xt.md)),ci("color",Wne(yt.textSecondary)),ci("font-family",Wne(bt.fontFamily)),ci("font-size",Wne(bt.sizeSm)),hi("pointer"),ci("transition","border-color 120ms, background 120ms"),Bi("center")]),Jne=lo([ci("border-color",Wne(yt.brand)),ci("background",Wne(yt.brandSubtle))]),Xne=lo([ci("font-size",Wne(bt.sizeXs))]),Qne=lo([pi("flex"),ui("center"),ci("gap","8px"),ci("padding",Wne(_t.xs)+" 0"),ci("font-family",Wne(bt.fontFamily)),ci("font-size",Wne(bt.sizeSm)),ci("color",Wne(yt.textPrimary))]),Yne=lo([ci("flex","1"),ci("min-width","0"),ci("overflow","hidden"),ci("text-overflow","ellipsis"),ci("white-space","nowrap")]),Zne=lo([ci("color",Wne(yt.textSecondary)),ci("font-size",Wne(bt.sizeXs)),ci("white-space","nowrap")]),ere=lo([ci("color",Wne(yt.success))]),tre=lo([ci("color",Wne(yt.error))]),nre=lo([ci("width","120px")]),rre=lo([ci("flex","0 0 auto"),ci("border","none"),ci("background","transparent"),ci("padding","0 4px"),ci("color",Wne(yt.textSecondary)),ci("font-size",Wne(bt.sizeMd)),Si({NAME:"abs",VAL:1}),hi("pointer")]),ire=lo([ci("width","40px"),ci("height","40px"),ci("flex","0 0 auto"),ci("object-fit","cover"),ci("border-radius",Wne(xt.sm)),ci("border","1px solid var("+yt.border+")")]);let ore=function(e){let t=e.onRemoved,n=e.onUploaded,o=e.label,l=e.multiple,c=e.accept,u=e.adapter,d=void 0===l||l,f=void 0!==o?o:"Drop files here or click to browse",p=s(()=>[]),g=p[1],m=p[0],v=s(()=>!1),y=v[1],_=h(null),b=h(0),x=h([]),S=h([]);a(()=>()=>{x.current.forEach(e=>{URL.revokeObjectURL(e)})},[]);let w=(e,t)=>g(n=>n.map(n=>n.key===e?{key:n.key,name:n.name,size:n.size,status:t,preview:n.preview}:n)),E=e=>M(u.remove,t=>{ce(t(e).then(t=>{"Ok"!==t.TAG&&console.error("[FileDropzone] could not remove "+e+": "+t._0)}),t=>(console.error("[FileDropzone] could not remove "+e),Promise.resolve()))}),k=e=>{S.current=S.current.concat([e.key]),(e=>{M(e.preview,e=>{URL.revokeObjectURL(e),x.current=x.current.filter(t=>t!==e)})})(e);let n=e.status;if("Done"!==n.TAG)return;let r=n._0;M(t,e=>e(r)),E(r)},C=e=>{let t=function(e,t){if(e)return[t,!1];let n=t.slice(0,1);return[n,0!==n.length]}(d,e),r=t[1];r&&m.forEach(k),t[0].forEach((e,t)=>{let i=r&&0===t;b.current=b.current+1|0;let o,s=b.current.toString()+":"+e.name,a=function(e,t,n){if(void 0===e)return!0;let r=t.toLowerCase(),i=n.toLowerCase();return e.split(",").map(e=>e.trim().toLowerCase()).filter(e=>""!==e).some(e=>e.startsWith(".")?r.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,e.length-1|0)):i===e)}(c,e.name,e.type),l=a?{TAG:"Uploading",_0:0}:{TAG:"Rejected",_0:"File type not accepted"};if(e.type.toLowerCase().startsWith("image/")){let t=URL.createObjectURL(e);x.current=x.current.concat([t]),o=t}else o=void 0;let d=e.name,f=e.size,h={key:s,name:d,size:f,status:l,preview:o};g(e=>i?[h]:e.concat([h])),a&&ce(u.upload(e,e=>w(s,{TAG:"Uploading",_0:e})).then(t=>{if("Ok"===t.TAG){let r=t._0;S.current.includes(s)?E(r):(w(s,{TAG:"Done",_0:r}),M(n,t=>t(e.name,r)))}else w(s,{TAG:"Failed",_0:t._0});return Promise.resolve()}),e=>(w(s,{TAG:"Failed",_0:"Upload failed"}),Promise.resolve()))})},A=v[0]?Hne+" "+Jne:Hne;return r("div",{children:[r("div",{children:[i("span",{children:f}),void 0!==c?i("span",{children:"Accepted: "+c,className:Xne}):null],className:A,role:"button",onClick:e=>M(R(_.current),e=>e.click()),onDragLeave:e=>y(e=>!1),onDragOver:e=>{e.preventDefault(),y(e=>!0)},onDrop:e=>{e.preventDefault(),y(e=>!1);let t=e.dataTransfer;if(null!=t)return C(Array.from(t.files))}}),i("input",{ref:T(_),style:{display:"none"},accept:c,multiple:d,type:"file",onChange:e=>{let t=e.target.files;null!=t&&C(Array.from(t)),e.target.value=""}}),m.map(e=>{let t,n=e.preview,o=e.status;switch(o.TAG){case"Uploading":t=i("span",{children:i(Lc,{value:o._0,showValue:!1}),className:nre});break;case"Done":t=i("span",{children:"Uploaded",className:ere});break;case"Rejected":t=i("span",{children:"Rejected",className:tre,title:o._0});break;case"Failed":t=i("span",{children:"Failed",className:tre,title:o._0})}return r("div",{children:[void 0!==n?i("img",{className:ire,alt:e.name,src:n}):null,i("span",{children:e.name,className:Yne,title:e.name}),i("span",{children:Kne(e.size),className:Zne}),t,i("button",{children:"×","aria-label":"Remove "+e.name,className:rre,title:"Remove "+e.name,type:"button",onClick:t=>{t.stopPropagation();let n=e.key;M(m.find(e=>e.key===n),k),g(e=>e.filter(e=>e.key!==n))}})],className:Qne},e.key)})]})};function sre(e){if(""===e)return[];let t;try{t=ht(JSON.parse(e))}catch(n){return[e]}return void 0!==t?me(t,ut):[e]}function are(e,t){let n=La(e,t);if(void 0!==n&&"Image"===n.semantic)return"image/*"}function lre(e){return mt(j(j(ft(Mt(e)),e=>Je(e,"type")),ut),"array")}function cre(e){let t=e=>j(Ds(e).storeTarget,Ss);return B(t(e),j(Lt(e),t))}function ure(e,t,n){return U(function(e,t,n){return B(j(cre(e),n),t)}(e,t,n),(r=cre(e),{upload:(e,t)=>Promise.resolve({TAG:"Error",_0:void 0!==r?'No upload endpoint is configured for the store "'+r+'".':"No upload endpoint is configured."})}));var r}function dre(e){let t=e.onChange,n=e.value,r=e.multiple,o=e.adapter,s=h(r?sre(n):""===n?[]:[n]),l=h([]),c=d(V4),u=e=>r?JSON.stringify(e.map(e=>e)):U(e[0],""),f=e=>M(o.remove,t=>{ce(t(e).then(t=>{"Ok"!==t.TAG&&console.error("[FileDropzoneInput] could not release "+e+": "+t._0)}),t=>(console.error("[FileDropzoneInput] could not release "+e),Promise.resolve()))});return a(()=>()=>{(function(e,t){return L(e,[],e=>e.armed.current?t:[])})(c,l.current).forEach(f)},[]),i(ore,{adapter:o,accept:e.accept,multiple:r,onUploaded:(e,n)=>{let i=r?s.current.concat([n]):[n];s.current=i,l.current=function(e,t){return e.concat([t])}(l.current,n),t(u(i))},onRemoved:e=>{let n=s.current.filter(t=>t!==e);s.current=n,l.current=function(e,t){return e.filter(e=>e!==t)}(l.current,e),t(u(n))}})}function fre(e,t,n,r){if(r&&0===sre(n).length)return"Required"}function hre(e,t,n){let r=void 0!==e?e:e=>{},o=(e,o,s,a,l,c,u)=>i(dre,{adapter:ure(o,void 0,r),accept:B(t,are(e,o)),multiple:U(n,lre(o)),value:s,onChange:a}),s=e=>{let t=U(function(e){return Je(dD,ta(e))}(e),{cell:(e,t,n)=>{},detail:(e,t,n)=>{}}),n={...t};fD(e,(n.validateInput=fre,n.input=o,n))};s("File"),s("Image")}var pre={FRAGMENT:"Fragment",INLINE_DATA_FRAGMENT:"InlineDataFragment",LINKED_FIELD:"LinkedField",LITERAL:"Literal",LIST_VALUE:"ListValue",RELAY_LIVE_RESOLVER:"RelayLiveResolver",OBJECT_VALUE:"ObjectValue",REQUEST:"Request",SCALAR_FIELD:"ScalarField",SPLIT_OPERATION:"SplitOperation",UPDATABLE_QUERY:"UpdatableQuery",VARIABLE:"Variable"},gre=function(e,t,n,r,i,o,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],u=0;(l=new Error(t.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}};function mre(e){return function(){return e}}var vre=function(){};vre.thatReturns=mre,vre.thatReturnsFalse=mre(!1),vre.thatReturnsTrue=mre(!0),vre.thatReturnsNull=mre(null),vre.thatReturnsThis=function(){return this},vre.thatReturnsArgument=function(e){return e};var yre=pre,_re=gre;function bre(e){var t=e;return"function"==typeof t?t=t():t.default&&(t=t.default),t}function xre(e){var t=bre(e);return"object"==typeof t&&null!==t&&t.kind===yre.FRAGMENT}function Sre(e){var t=bre(e);return"object"==typeof t&&null!==t&&t.kind===yre.REQUEST}function wre(e){var t=bre(e);return"object"==typeof t&&null!==t&&t.kind===yre.INLINE_DATA_FRAGMENT}function Ere(e){var t=bre(e);return xre(t)||_re(!1),t}var kre,Cre={getFragment:Ere,getNode:bre,getPaginationFragment:function(e){var t,n=Ere(e),r=null===(t=n.metadata)||void 0===t?void 0:t.refetch,i=null==r?void 0:r.connection;return null===r||"object"!=typeof r||null===i||"object"!=typeof i?null:n},getRefetchableFragment:function(e){var t,n=Ere(e),r=null===(t=n.metadata)||void 0===t?void 0:t.refetch;return null===r||"object"!=typeof r?null:n},getRequest:function(e){var t=bre(e);return Sre(t)||_re(!1),t},getUpdatableQuery:function(e){var t=bre(e);return!function(e){var t=bre(e);return"object"==typeof t&&null!==t&&t.kind===yre.UPDATABLE_QUERY}(t)&&_re(!1),t},getInlineDataFragment:function(e){var t=bre(e);return wre(t)||_re(!1),t},graphql:function(e){_re(!1)},isFragment:xre,isRequest:Sre,isInlineDataFragment:wre},Are={exports:{}};(kre=Are).exports=function(e){return e&&e.__esModule?e:{default:e}},kre.exports.__esModule=!0,kre.exports.default=kre.exports;var Nre=Are.exports,Tre={exports:{}},Rre={exports:{}},Dre={exports:{}},Ire={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ire);var Fre=Ire.exports,Ore={exports:{}};!function(e){var t=Fre.default;e.exports=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Ore);var Pre=Ore.exports;!function(e){var t=Fre.default,n=Pre;e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(Dre);var Mre=Dre.exports;!function(e){var t=Mre;e.exports=function(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports}(Rre);var Lre=Rre.exports;!function(e){var t=Lre;function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}e.exports=function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){t(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Tre);var zre=Tre.exports,jre={exports:{}},Ure={exports:{}},Bre={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(Bre);var $re=Bre.exports;!function(e){var t=$re;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Ure);var qre=Ure.exports;!function(e){var t=qre;e.exports=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=t(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}},e.exports.__esModule=!0,e.exports.default=e.exports}(jre);var Gre=jre.exports,Vre=Nre.default,Kre=Vre(zre),Wre=Vre(Gre),Hre=gre;function Jre(e){switch(e.kind){case"relay_resolver.error":case"relay_field_payload.error":return e.shouldThrow&&!e.handled;case"missing_expected_data.throw":case"missing_required_field.throw":return!e.handled;case"missing_required_field.log":case"missing_expected_data.log":return!1;default:throw e.kind,new Error("Relay: Unexpected event kind")}}var Xre={handlePotentialSnapshotErrors:function(e,t,n){null!=t&&function(e,t,n){var r,i=(0,Wre.default)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.relayFieldLogger((0,Kre.default)((0,Kre.default)({},o),{},{uiContext:n}))}}catch(c){i.e(c)}finally{i.f()}var s,a=(0,Wre.default)(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(Jre(l))switch(l.kind){case"relay_resolver.error":throw new Error("Relay: Resolver error at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'. Message: ").concat(l.error.message));case"relay_field_payload.error":throw new Error("Relay: Unexpected response payload - check server logs for details.");case"missing_expected_data.throw":throw new Error("Relay: Missing expected data at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.throw":throw new Error("Relay: Missing @required value at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.log":case"missing_expected_data.log":break;default:l.kind,Hre(!1)}}}catch(c){a.e(c)}finally{a.f()}}(e,t,n)},eventShouldThrow:Jre},Qre={exports:{}},Yre={exports:{}};!function(e){var t=$re;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Yre);var Zre=Yre.exports,eie={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(eie);var tie=eie.exports,nie={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(nie);var rie=nie.exports;!function(e){var t=Zre,n=tie,r=qre,i=rie;e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(Qre);var iie=Qre.exports,oie={DEFAULT_HANDLE_KEY:""},sie=oie.DEFAULT_HANDLE_KEY,aie=gre;var lie=function(e,t,n){return t&&t!==sie?"__".concat(t,"_").concat(e):(null==n&&aie(!1),"__".concat(n,"_").concat(e))},cie={ENABLE_VARIABLE_CONNECTION_KEY:!1,ENABLE_RELAY_RESOLVERS:!1,ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION:!1,ENABLE_FRIENDLY_QUERY_NAME_GQL_URL:!1,ENABLE_DO_NOT_WRAP_LIVE_QUERY:!1,ENABLE_NOTIFY_SUBSCRIPTION:!1,BATCH_ASYNC_MODULE_UPDATES_FN:null,ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT:!1,MAX_DATA_ID_LENGTH:null,STRING_INTERN_LEVEL:0,LOG_MISSING_RECORDS_IN_PROD:!1,ENABLE_STORE_ID_COLLISION_LOGGING:!1,ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS:!1,ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION:!1,ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES:!1,ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE:!1,PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION:!1,MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD:!1,ENABLE_CYLE_DETECTION_IN_VARIABLES:!1,ENABLE_ACTIVITY_COMPATIBILITY:!1,ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX:!0,ENABLE_USE_PAGINATION_IS_LOADING_FIX:!1,DISALLOW_NESTED_UPDATES:!1,ENABLE_TYPENAME_PREFIXED_DATA_ID:!1,ENABLE_UI_CONTEXT_ON_RELAY_LOGGER:!1,CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES:!1};var uie={stableCopy:function e(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);for(var n=Object.keys(t).sort(),r={},i=0;i<n.length;i++)r[n[i]]=e(t[n[i]]);return r},hasCycle:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;if(!t||"object"!=typeof t)return!1;if(n.has(t))return!0;var r=new Set(n);return r.add(t),(Array.isArray(t)?t:Object.values(t)).some(function(t){return e(t,r)})}},die=(0,Nre.default)(iie),fie=lie,hie=cie,pie=uie.stableCopy,gie=gre,mie=pre.VARIABLE,vie=pre.LITERAL,yie=pre.OBJECT_VALUE,_ie=pre.LIST_VALUE;function bie(e,t){if(e.kind===mie)return function(e,t){return t.hasOwnProperty(e)||gie(!1),pie(t[e])}(e.variableName,t);if(e.kind===vie)return e.value;if(e.kind===yie){var n={};return e.fields.forEach(function(e){n[e.name]=bie(e,t)}),n}if(e.kind===_ie){var r=[];return e.items.forEach(function(e){null!=e&&r.push(bie(e,t))}),r}}function xie(e,t,n){var r={};return n&&(r[Eie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),e&&e.forEach(function(e){r[e.name]=bie(e,t)}),r}function Sie(e,t){if(e.storageKey)return e.storageKey;var n=function(e){if("RelayResolver"===e.kind||"RelayLiveResolver"===e.kind){var t,n;return null==e.args?null===(n=e.fragment)||void 0===n?void 0:n.args:null==(null===(t=e.fragment)||void 0===t?void 0:t.args)?e.args:e.args.concat(e.fragment.args)}var r=void 0===e.args?void 0:e.args;return r}(e),r=e.name;return n&&0!==n.length?wie(r,xie(n,t)):r}function wie(e,t){if(!t)return e;var n=[];for(var r in t)if(t.hasOwnProperty(r)){var i,o=t[r];if(null!=o)n.push(r+":"+(null!==(i=JSON.stringify(o))&&void 0!==i?i:"undefined"))}return 0===n.length?e:e+"(".concat(n.join(","),")")}var Eie={ACTOR_IDENTIFIER_KEY:"__actorIdentifier",CLIENT_EDGE_TRAVERSAL_PATH:"__clientEdgeTraversalPath",FRAGMENTS_KEY:"__fragments",FRAGMENT_OWNER_KEY:"__fragmentOwner",FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT:"$isWithinUnmatchedTypeRefinement",FRAGMENT_PROP_NAME_KEY:"__fragmentPropName",MODULE_COMPONENT_KEY:"__module_component",ERRORS_KEY:"__errors",ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",INVALIDATED_AT_KEY:"__invalidated_at",RELAY_RESOLVER_VALUE_KEY:"__resolverValue",RELAY_RESOLVER_INVALIDATION_KEY:"__resolverValueMayBeInvalid",RELAY_RESOLVER_SNAPSHOT_KEY:"__resolverSnapshot",RELAY_RESOLVER_ERROR_KEY:"__resolverError",RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS:"__resolverOutputTypeRecordIDs",getArgumentValues:xie,getHandleStorageKey:function(e,t){var n=e.dynamicKey,r=e.handle,i=e.key,o=e.name,s=e.args,a=e.filters,l=fie(r,i,o),c=null;return s&&a&&0!==s.length&&0!==a.length&&(c=s.filter(function(e){return a.indexOf(e.name)>-1})),n&&(c=null!=c?[n].concat((0,die.default)(c)):[n]),null===c?l:wie(l,xie(c,t))},getStorageKey:Sie,getReadTimeResolverStorageKey:function(e,t){var n=Sie(e,t);return hie.ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX?"$r:"+n:n},getStableStorageKey:function(e,t){return wie(e,pie(t))},getModuleComponentKey:function(e){return"".concat("__module_component_").concat(e)},getModuleOperationKey:function(e){return"".concat("__module_operation_").concat(e)}},kie=Eie,Cie=(0,Nre.default)(zre),Aie=kie.getArgumentValues,Nie=gre;var Tie={getLocalVariables:function(e,t,n){if(null==t)return e;var r=(0,Cie.default)({},e),i=n?Aie(n,e):{};return t.forEach(function(e){var t,n=null!==(t=i[e.name])&&void 0!==t?t:e.defaultValue;r[e.name]=n}),r},getFragmentVariables:function(e,t,n){return null==e.argumentDefinitions?n:(e.argumentDefinitions.forEach(function(e){if(!n.hasOwnProperty(e.name))switch(r=r||(0,Cie.default)({},n),e.kind){case"LocalArgument":r[e.name]=e.defaultValue;break;case"RootArgument":if(!t.hasOwnProperty(e.name)){r[e.name]=void 0;break}r[e.name]=t[e.name];break;default:Nie(!1)}}),r||n);var r},getOperationVariables:function(e,t,n){var r={};return e.argumentDefinitions.forEach(function(e){var t=e.defaultValue;null!=n[e.name]&&(t=n[e.name]),r[e.name]=t}),null!=t&&Object.keys(t).forEach(function(e){r[e]=t[e].get()}),r}},Rie=[],Die=[];function Iie(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var i=Object.prototype.toString,o=i.call(e);if(o!=i.call(t))return!1;switch(o){case"[object String]":return e==String(t);case"[object Number]":return!isNaN(e)&&!isNaN(t)&&e==Number(t);case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}for(var s=n.length;s--;)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var a=0;if("[object Array]"===o){if((a=e.length)!==t.length)return!1;for(;a--;)if(!Iie(e[a],t[a],n,r))return!1}else{if(e.constructor!==t.constructor)return!1;if(e.hasOwnProperty("valueOf")&&t.hasOwnProperty("valueOf"))return e.valueOf()==t.valueOf();var l=Object.keys(e);if(l.length!=Object.keys(t).length)return!1;for(var c=0;c<l.length;c++)if(!Iie(e[l[c]],t[l[c]],n,r))return!1}return n.pop(),r.pop(),!0}var Fie=
3
- /**
4
- * Checks if two values are equal. Values may be primitives, arrays, or objects.
5
- * Returns true if both arguments have the same keys and values.
6
- *
7
- * @see http://underscorejs.org
8
- * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
9
- * @license MIT
10
- */
11
- function(e,t){var n=Rie.length?Rie.pop():[],r=Die.length?Die.pop():[],i=Iie(e,t,n,r);return n.length=0,r.length=0,Rie.push(n),Die.push(r),i},Oie=Tie.getFragmentVariables,Pie=kie,Mie=Pie.CLIENT_EDGE_TRAVERSAL_PATH,Lie=Pie.FRAGMENT_OWNER_KEY,zie=Pie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT,jie=Pie.FRAGMENTS_KEY,Uie=Pie.ID_KEY,Bie=Fie,$ie=gre;function qie(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&$ie(!1);var n=t[Uie],r=t[jie],i=t[Lie],o=t[Mie];if("string"==typeof n&&"object"==typeof r&&null!==r&&"object"==typeof r[e.name]&&null!==r[e.name]&&"object"==typeof i&&null!==i&&(null==o||Array.isArray(o))){var s=i,a=o,l=r[e.name];return Yie(e,n,Oie(e,s.variables,l),s,!0===l[zie],a)}return null}function Gie(e,t){var n=null;return t.forEach(function(t,r){var i=null!=t?qie(e,t):null;null!=i&&(n=n||[]).push(i)}),null==n?null:{kind:"PluralReaderSelector",selectors:n}}function Vie(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||$ie(!1),Gie(e,t)):(Array.isArray(t)&&$ie(!1),qie(e,t))}function Kie(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||$ie(!1),function(e,t){var n=null;return t.forEach(function(t){var r=null!=t?Wie(e,t):null;null!=r&&(n=n||[]).push(r)}),n}(e,t)):(Array.isArray(t)&&$ie(!1),Wie(e,t))}function Wie(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&$ie(!1);var n=t[Uie];return"string"==typeof n?n:null}function Hie(e,t){var n;return null==t?{}:!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)?(Array.isArray(t)||$ie(!1),Xie(e,t)):(Array.isArray(t)&&$ie(!1),Jie(e,t)||{})}function Jie(e,t){var n=qie(e,t);return n?n.variables:null}function Xie(e,t){var n={};return t.forEach(function(t,r){if(null!=t){var i=Jie(e,t);null!=i&&Object.assign(n,i)}}),n}function Qie(e,t){return e.dataID===t.dataID&&e.node===t.node&&Bie(e.variables,t.variables)&&(n=e.owner,r=t.owner,n===r||n.identifier===r.identifier&&Bie(n.cacheConfig,r.cacheConfig))&&e.isWithinUnmatchedTypeRefinement===t.isWithinUnmatchedTypeRefinement&&function(e,t){if(e===t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var n=e.length;for(;n--;){var r=e[n],i=t[n];if(r!==i&&(null==r||null==i||r.clientEdgeDestinationID!==i.clientEdgeDestinationID||r.readerClientEdge!==i.readerClientEdge))return!1}return!0}(e.clientEdgeTraversalPath,t.clientEdgeTraversalPath);var n,r}function Yie(e,t,n,r){var i=arguments.length>5?arguments[5]:void 0;return{kind:"SingularReaderSelector",dataID:t,isWithinUnmatchedTypeRefinement:arguments.length>4&&void 0!==arguments[4]&&arguments[4],clientEdgeTraversalPath:null!=i?i:null,node:e,variables:n,owner:r}}var Zie={areEqualSelectors:function(e,t){return e===t||(null==e?null==t:null==t?null==e:"SingularReaderSelector"===e.kind&&"SingularReaderSelector"===t.kind?Qie(e,t):"PluralReaderSelector"===e.kind&&"PluralReaderSelector"===t.kind&&(e.selectors.length===t.selectors.length&&e.selectors.every(function(e,n){return Qie(e,t.selectors[n])})))},createReaderSelector:Yie,createNormalizationSelector:function(e,t,n){return{dataID:t,node:e,variables:n}},getDataIDsFromFragment:Kie,getDataIDsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=Kie(i,o)}return n},getSingularSelector:qie,getPluralSelector:Gie,getSelector:Vie,getSelectorsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=Vie(i,o)}return n},getVariablesFromSingularFragment:Jie,getVariablesFromPluralFragment:Xie,getVariablesFromFragment:Hie,getVariablesFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=Hie(e[r],t[r]);Object.assign(n,i)}return n}},eoe=Cre.getFragment,toe=Xre.eventShouldThrow,noe=Zie.getSelector,roe=gre,ioe=[];var ooe={},soe={readFragment:function(e,t){if(!ioe.length)throw new Error("readFragment should be called only from within a Relay Resolver function.");var n=ioe[ioe.length-1],r=eoe(e),i=noe(r,t);null==i&&roe(!1),"SingularReaderSelector"!==i.kind&&roe(!1);var o=n.getDataForResolverFragment(i,t),s=o.data,a=o.isMissingData,l=o.fieldErrors;if(a||null!=l&&l.some(toe))throw ooe;return s},withResolverContext:function(e,t){ioe.push(e);try{return t()}finally{ioe.pop()}},RESOLVER_FRAGMENT_ERRORED_SENTINEL:ooe},aoe={exports:{}};!function(e){function t(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(i,o){var s=e.apply(n,r);function a(e){t(s,i,o,a,l,"next",e)}function l(e){t(s,i,o,a,l,"throw",e)}a(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports}(aoe);var loe=aoe.exports;var coe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.then},uoe=coe,doe=function(e,t){},foe=function(){function e(e){this._source=e}e.create=function(t){return new e(t)},e.onUnhandledError=function(e){doe=e},e.from=function(e){return function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}(e)?function(e){return e instanceof foe?e:foe.create(function(t){return e.subscribe(t)})}(e):uoe(e)?(t=e,foe.create(function(e){t.then(function(t){e.next(t),e.complete()},e.error)})):function(e){return foe.create(function(t){t.next(e),t.complete()})}(e);var t};var t=e.prototype;return t.catch=function(t){var n=this;return e.create(function(e){var r;return n.subscribe({start:function(e){r=e},next:e.next,complete:e.complete,error:function(n){try{t(n).subscribe({start:function(e){r=e},next:e.next,complete:e.complete,error:e.error})}catch(i){e.error(i,!0)}}}),function(){return r.unsubscribe()}})},t.concat=function(t){var n=this;return e.create(function(e){var r;return n.subscribe({start:function(e){r=e},next:e.next,error:e.error,complete:function(){r=t.subscribe(e)}}),function(){r&&r.unsubscribe()}})},t.do=function(t){var n=this;return e.create(function(e){var r=function(n){return function(){try{t[n]&&t[n].apply(t,arguments)}catch(Ene){doe(Ene,!0)}e[n]&&e[n].apply(e,arguments)}};return n.subscribe({start:r("start"),next:r("next"),error:r("error"),complete:r("complete"),unsubscribe:r("unsubscribe")})})},t.finally=function(t){var n=this;return e.create(function(e){var r=n.subscribe(e);return function(){r.unsubscribe(),t()}})},t.ifEmpty=function(t){var n=this;return e.create(function(e){var r,i=!1;return r=n.subscribe({next:function(t){i=!0,e.next(t)},error:e.error,complete:function(){i?e.complete():r=t.subscribe(e)}}),function(){r&&r.unsubscribe()}})},t.subscribe=function(e){return function(e,t){var n,r=!1,i=function(e){return Object.defineProperty(e,"closed",{get:function(){return r}})};function o(){if(n){if(n.unsubscribe)n.unsubscribe();else try{n()}catch(Ene){doe(Ene,!0)}n=void 0}}var s=i({unsubscribe:function(){if(!r){r=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(Ene){doe(Ene,!0)}finally{o()}}}});try{t.start&&t.start(s)}catch(Ene){doe(Ene,!0)}if(r)return s;var a=i({next:function(e){if(!r&&t.next)try{t.next(e)}catch(Ene){doe(Ene,!0)}},error:function(e,n){if(r||!t.error)r=!0,doe(e,n||!1),o();else{r=!0;try{t.error(e)}catch(i){doe(i,!0)}finally{o()}}},complete:function(){if(!r){r=!0;try{t.complete&&t.complete()}catch(Ene){doe(Ene,!0)}finally{o()}}}});try{n=e(a)}catch(Ene){a.error(Ene,!0)}r&&o();return s}(this._source,e)},t.map=function(t){var n=this;return e.create(function(e){var r=n.subscribe({complete:e.complete,error:e.error,next:function(n){try{var r=t(n);e.next(r)}catch(Ene){e.error(Ene,!0)}}});return function(){r.unsubscribe()}})},t.mergeMap=function(t){var n=this;return e.create(function(r){var i=[];function o(e){this._sub=e,i.push(e)}function s(){i.splice(i.indexOf(this._sub),1),0===i.length&&r.complete()}return n.subscribe({start:o,next:function(n){try{r.closed||e.from(t(n)).subscribe({start:o,next:r.next,error:r.error,complete:s})}catch(Ene){r.error(Ene,!0)}},error:r.error,complete:s}),function(){i.forEach(function(e){return e.unsubscribe()}),i.length=0}})},t.poll=function(t){var n=this;return e.create(function(e){var r,i;return function o(){r=n.subscribe({next:e.next,error:e.error,complete:function(){i=setTimeout(o,t)}})}(),function(){clearTimeout(i),r.unsubscribe()}})},t.toPromise=function(){var e=this;return new Promise(function(t,n){var r=!1;e.subscribe({next:function(e){r||(r=!0,t(e))},error:n,complete:t})})},e}();var hoe=foe,poe=Nre.default,goe=poe(Gre),moe=poe(Lre),voe=hoe,yoe=gre,_oe=function(){function e(){var e=this;(0,moe.default)(this,"_complete",!1),(0,moe.default)(this,"_events",[]),(0,moe.default)(this,"_sinks",new Set),(0,moe.default)(this,"_subscription",[]),this._observable=voe.create(function(t){e._sinks.add(t);for(var n=e._events,r=0;r<n.length&&!t.closed;r++){var i=n[r];switch(i.kind){case"complete":t.complete();break;case"error":t.error(i.error);break;case"next":t.next(i.data);break;default:i.kind,yoe(!1)}}return function(){e._sinks.delete(t)}})}var t=e.prototype;return t.complete=function(){!0!==this._complete&&(this._complete=!0,this._events.push({kind:"complete"}),this._sinks.forEach(function(e){return e.complete()}))},t.error=function(e){!0!==this._complete&&(this._complete=!0,this._events.push({kind:"error",error:e}),this._sinks.forEach(function(t){return t.error(e)}))},t.next=function(e){!0!==this._complete&&(this._events.push({kind:"next",data:e}),this._sinks.forEach(function(t){return t.next(e)}))},t.subscribe=function(e){var t=this._observable.subscribe(e);return this._subscription.push(t),t},t.unsubscribe=function(){var e,t=(0,goe.default)(this._subscription);try{for(t.s();!(e=t.n()).done;){e.value.unsubscribe()}}catch(n){t.e(n)}finally{t.f()}this._subscription=[]},t.getObserverCount=function(){return this._sinks.size},e}(),boe=_oe,xoe=hoe,Soe=boe,woe=gre,Eoe="function"==typeof WeakMap?new WeakMap:new Map;function koe(e,t,n){return xoe.create(function(r){var i=Aoe(e),o=i.get(t);return o||n().finally(function(){return i.delete(t)}).subscribe({start:function(e){o={identifier:t,subject:new Soe,subjectForInFlightStatus:new Soe,subscription:e,promise:null},i.set(t,o)},next:function(e){var n=Noe(i,t);n.subject.next(e),n.subjectForInFlightStatus.next(e)},error:function(e){var n=Noe(i,t);n.subject.error(e),n.subjectForInFlightStatus.error(e)},complete:function(){var e=Noe(i,t);e.subject.complete(),e.subjectForInFlightStatus.complete()},unsubscribe:function(e){var n=Noe(i,t);n.subject.unsubscribe(),n.subjectForInFlightStatus.unsubscribe()}}),null==o&&woe(!1),function(e,t){return xoe.create(function(n){var r=t.subject.subscribe(n);return function(){r.unsubscribe();var n=e.get(t.identifier);if(n){var i=n.subscription;null!=i&&0===n.subject.getObserverCount()&&(i.unsubscribe(),e.delete(t.identifier))}}})}(i,o).subscribe(r)})}function Coe(e,t,n){return xoe.create(function(t){var r=n.subjectForInFlightStatus.subscribe({error:t.error,next:function(r){e.isRequestActive(n.identifier)?t.next():t.complete()},complete:t.complete,unsubscribe:t.complete});return function(){r.unsubscribe()}})}function Aoe(e){var t=Eoe.get(e);if(null!=t)return t;var n=new Map;return Eoe.set(e,n),n}function Noe(e,t){var n=e.get(t);return null==n&&woe(!1),n}var Toe={fetchQuery:function(e,t){return koe(e,t.request.identifier,function(){return e.execute({operation:t})})},fetchQueryDeduped:koe,getPromiseForActiveRequest:function(e,t){var n=Aoe(e),r=n.get(t.identifier);if(!r)return null;if(!e.isRequestActive(r.identifier))return null;var i=new Promise(function(t,n){var i=!1;Coe(e,0,r).subscribe({complete:t,error:n,next:function(e){i&&t(e)}}),i=!0});return i},getObservableForActiveRequest:function(e,t){var n=Aoe(e),r=n.get(t.identifier);return r&&e.isRequestActive(r.identifier)?Coe(e,0,r):null}},Roe=Nre.default;loe.default;Roe(Gre);var Doe=function e(t){return function(e){return null!=e&&(Array.isArray(e)||"object"==typeof e&&e.constructor===Object)}(t)?(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(n){var r=t[n];r&&"object"==typeof r&&!Object.isFrozen(r)&&e(r)}),t):t},Ioe=uie.stableCopy,Foe=gre;var Ooe=function(e,t){var n=null!=e.cacheID?e.cacheID:e.id;return null==n&&Foe(!1),n+JSON.stringify(Ioe(t))},Poe=Ooe,Moe=cie,Loe=uie.hasCycle,zoe=Tie.getOperationVariables,joe=Zie.createNormalizationSelector,Uoe=Zie.createReaderSelector,Boe=kie.ROOT_ID,$oe=gre;function qoe(e,t,n){return{identifier:Poe(e.params,t),node:e,variables:t,cacheConfig:n}}var Goe={createOperationDescriptor:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Boe,i=e.operation,o=zoe(i,e.params.providedVariables,t);Moe.ENABLE_CYLE_DETECTION_IN_VARIABLES&&Loe(o)&&$oe(!1);var s=qoe(e,o,n);return{fragment:Uoe(e.fragment,r,o,s),request:s,root:joe(i,r,o)}},createRequestDescriptor:qoe};(0,Nre.default)(Lre);loe.default;var Voe=new Map,Koe=1,Woe=function(){for(var e=new Set,t=0;t<10;++t)e.add(t.toString());return e}();var Hoe={intern:function(e,t){if(null==t||e.length<t)return function(e){return"\t"===e[0]&&Woe.has(e[1])||"\v"===e[0]?"\v"+e:e}(e);var n=Voe.get(e);return null!=n||(n="\t"+Koe++,Voe.set(e,n)),n}},Joe=cie,Xoe=Hoe.intern,Qoe="client:";var Yoe=0;var Zoe={generateClientID:function(e,t,n){var r=(Joe.STRING_INTERN_LEVEL<=0?e:Xoe(e,Joe.MAX_DATA_ID_LENGTH))+":"+t;return null!=n&&(r+=":"+n),0!==r.indexOf(Qoe)&&(r=Qoe+r),r},generateClientObjectClientID:function(e,t,n){var r="".concat(Qoe).concat(e,":").concat(t);return null!=n&&(r+=":"+n),r},generateUniqueClientID:function(){return"".concat(Qoe,"local:").concat(Yoe++)},isClientID:function(e){return 0===e.indexOf(Qoe)}},ese={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},tse={CURSOR:"cursor",EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},nse={inject:function(e){tse=e},get:function(){return tse},isConnectionCall:function(e){return ese.hasOwnProperty(e.name)}},rse=Zoe.generateClientID,ise=kie.getStableStorageKey,ose=lie,sse=nse,ase=gre,lse="connection",cse="__connection_next_edge_index";function use(e,t,n){if(null==n)return n;var r=sse.get().EDGES,i=t.getValue(cse);"number"!=typeof i&&ase(!1);var o=rse(t.getDataID(),r,i),s=e.create(o,n.getType());return s.copyFieldsFrom(n),null==s.getValue("cursor")&&s.setValue(null,"cursor"),t.setValue(i+1,cse),s}function dse(e,t,n){for(var r=sse.get().NODE,i=0;i<e.length;i++){var o=e[i];if(o){var s=o.getLinkedRecord(r),a=s&&s.getDataID();if(a){if(n.has(a))continue;n.add(a)}t.push(o)}}}var fse={buildConnectionEdge:use,createEdge:function(e,t,n,r){var i=sse.get().NODE,o=rse(t.getDataID(),n.getDataID()),s=e.get(o);return s||(s=e.create(o,r)),s.setLinkedRecord(n,i),null==s.getValue("cursor")&&s.setValue(null,"cursor"),s},deleteNode:function(e,t){var n=sse.get(),r=n.EDGES,i=n.NODE,o=e.getLinkedRecords(r);if(o){for(var s,a=0;a<o.length;a++){var l=o[a],c=l&&l.getLinkedRecord(i);null!=c&&c.getDataID()===t?void 0===s&&(s=o.slice(0,a)):void 0!==s&&s.push(l)}void 0!==s&&e.setLinkedRecords(s,r)}},getConnection:function(e,t,n){var r=ose(lse,t,null);return e.getLinkedRecord(r,n)},getConnectionID:function(e,t,n){var r=ose(lse,t,null),i=ise(r,n);return rse(e,i)},insertEdgeAfter:function(e,t,n){var r=sse.get(),i=r.CURSOR,o=r.EDGES,s=e.getLinkedRecords(o);if(s){var a;if(null==n)a=s.concat(t);else{a=[];for(var l=!1,c=0;c<s.length;c++){var u=s[c];if(a.push(u),null!=u)n===u.getValue(i)&&(a.push(t),l=!0)}l||a.push(t)}e.setLinkedRecords(a,o)}else e.setLinkedRecords([t],o)},insertEdgeBefore:function(e,t,n){var r=sse.get(),i=r.CURSOR,o=r.EDGES,s=e.getLinkedRecords(o);if(s){var a;if(null==n)a=[t].concat(s);else{a=[];for(var l=!1,c=0;c<s.length;c++){var u=s[c];if(null!=u)n===u.getValue(i)&&(a.push(t),l=!0);a.push(u)}l||a.unshift(t)}e.setLinkedRecords(a,o)}else e.setLinkedRecords([t],o)},update:function(e,t){var n=e.get(t.dataID);if(n){var r=sse.get(),i=r.EDGES,o=r.END_CURSOR,s=r.HAS_NEXT_PAGE,a=r.HAS_PREV_PAGE,l=r.PAGE_INFO,c=r.PAGE_INFO_TYPE,u=r.START_CURSOR,d=n.getLinkedRecord(t.fieldKey),f=d&&d.getLinkedRecord(l);if(d){var h=rse(n.getDataID(),t.handleKey),p=n.getLinkedRecord(t.handleKey),g=null!=p?p:e.get(h),m=g&&g.getLinkedRecord(l);if(g){null==p&&n.setLinkedRecord(g,t.handleKey);var v=g,y=d.getLinkedRecords(i);y&&(y=y.map(function(t){return use(e,v,t)}));var _=v.getLinkedRecords(i),b=v.getLinkedRecord(l);v.copyFieldsFrom(d),_&&v.setLinkedRecords(_,i),b&&v.setLinkedRecord(b,l);var x=[],S=t.args;if(_&&y)if(null!=S.after){var w,E=null===(w=m)||void 0===w?void 0:w.getValue(o),k=null==f?void 0:f.getValue(o);if(!(m&&S.after===E)&&!(m&&E===k))return;var C=new Set;dse(_,x,C),dse(y,x,C)}else if(null!=S.before){if(!m||S.before!==m.getValue(u))return;var A=new Set;dse(y,x,A),dse(_,x,A)}else x=y;else x=y||_;if(null!=x&&x!==_&&v.setLinkedRecords(x,i),m&&f)if(null==S.after&&null==S.before)m.copyFieldsFrom(f);else if(null!=S.before||null==S.after&&S.last){m.setValue(!!f.getValue(a),a);var N=f.getValue(u);"string"==typeof N&&m.setValue(N,u)}else if(null!=S.after||null==S.before&&S.first){m.setValue(!!f.getValue(s),s);var T=f.getValue(o);"string"==typeof T&&m.setValue(T,o)}}else{var R=e.create(h,d.getType());R.setValue(0,cse),R.copyFieldsFrom(d);var D=d.getLinkedRecords(i);D&&(D=D.map(function(t){return use(e,R,t)}),R.setLinkedRecords(D,i)),n.setLinkedRecord(R,t.handleKey),(m=e.create(rse(R.getDataID(),l),c)).setValue(!1,s),m.setValue(!1,a),m.setValue(null,o),m.setValue(null,u),f&&m.copyFieldsFrom(f),R.setLinkedRecord(m,l)}}else n.setValue(null,t.handleKey,void 0,n.getErrors(t.fieldKey))}}},hse=(0,Nre.default)(Gre),pse=fse,gse=nse,mse=gre,vse={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=n.getValue(t.fieldKey);"string"==typeof r?e.delete(r):Array.isArray(r)&&r.forEach(function(t){"string"==typeof t&&e.delete(t)})}}},yse={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=t.handleArgs.connections;null==r&&mse(!1);var i=n.getValue(t.fieldKey);(Array.isArray(i)?i:[i]).forEach(function(t){if("string"==typeof t){var n,i=(0,hse.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=e.get(o);null!=s&&pse.deleteNode(s,t)}}catch(a){i.e(a)}finally{i.f()}}})}}},_se={update:wse(pse.insertEdgeAfter)},bse={update:wse(pse.insertEdgeBefore)},xse={update:Ese(pse.insertEdgeAfter)},Sse={update:Ese(pse.insertEdgeBefore)};function wse(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs.connections;null==a&&mse(!1);try{o=i.getLinkedRecord(n.fieldKey)}catch(m){}if(!o)try{s=i.getLinkedRecords(n.fieldKey)}catch(v){}if(null!=o||null!=s){var l,c=gse.get(),u=c.NODE,d=c.EDGES,f=null!==(r=s)&&void 0!==r?r:[o],h=(0,hse.default)(f);try{var p=function(){var n=l.value;if(null==n)return"continue";var r=n.getLinkedRecord("node");if(!r)return"continue";var i,o=r.getDataID(),s=(0,hse.default)(a);try{for(s.s();!(i=s.n()).done;){var c=i.value,f=t.get(c);if(null!=f)if(!(null===(g=f.getLinkedRecords(d))||void 0===g?void 0:g.some(function(e){var t;return(null==e||null===(t=e.getLinkedRecord(u))||void 0===t?void 0:t.getDataID())===o}))){var h=pse.buildConnectionEdge(t,f,n);null==h&&mse(!1),e(f,h)}}}catch(p){s.e(p)}finally{s.f()}};for(h.s();!(l=h.n()).done;){var g;p()}}catch(y){h.e(y)}finally{h.f()}}}}}function Ese(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs,l=a.connections,c=a.edgeTypeName;null==l&&mse(!1),null==c&&mse(!1);try{o=i.getLinkedRecord(n.fieldKey)}catch(y){}if(!o)try{s=i.getLinkedRecords(n.fieldKey)}catch(_){}if(null!=o||null!=s){var u,d=gse.get(),f=d.NODE,h=d.EDGES,p=null!==(r=s)&&void 0!==r?r:[o],g=(0,hse.default)(p);try{var m=function(){var n=u.value;if(null==n)return"continue";var r,i=n.getDataID(),o=(0,hse.default)(l);try{for(o.s();!(r=o.n()).done;){var s=r.value,a=t.get(s);if(null!=a)if(!(null===(v=a.getLinkedRecords(h))||void 0===v?void 0:v.some(function(e){var t;return(null==e||null===(t=e.getLinkedRecord(f))||void 0===t?void 0:t.getDataID())===i}))){var d=pse.createEdge(t,a,n,c);null==d&&mse(!1),e(a,d)}}}catch(p){o.e(p)}finally{o.f()}};for(g.s();!(u=g.n()).done;){var v;m()}}catch(b){g.e(b)}finally{g.f()}}}}}var kse=fse,Cse={AppendEdgeHandler:_se,DeleteRecordHandler:vse,PrependEdgeHandler:bse,AppendNodeHandler:xse,PrependNodeHandler:Sse,DeleteEdgeHandler:yse},Ase=gre;var Nse=function(e){switch(e){case"connection":return kse;case"deleteRecord":return Cse.DeleteRecordHandler;case"deleteEdge":return Cse.DeleteEdgeHandler;case"appendEdge":return Cse.AppendEdgeHandler;case"prependEdge":return Cse.PrependEdgeHandler;case"appendNode":return Cse.AppendNodeHandler;case"prependNode":return Cse.PrependNodeHandler}Ase(!1)};var Tse=function(e){return Boolean(e&&e["@@RelayModernEnvironment"])},Rse=(0,Nre.default)(Gre),Dse=fse;function Ise(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}var Fse={MutationTypes:Object.freeze({RANGE_ADD:"RANGE_ADD",RANGE_DELETE:"RANGE_DELETE",NODE_DELETE:"NODE_DELETE"}),RangeOperations:Object.freeze({APPEND:"append",PREPEND:"prepend"}),convert:function(e,t,n,r){var i=n?[n]:[],o=r?[r]:[];return e.forEach(function(e){switch(e.type){case"NODE_DELETE":var n=function(e,t){var n=e.deletedIDFieldName,r=Ise(t);if(!r)return null;return function(e,t){var i=e.getRootField(r);if(i){var o=i.getValue(n);(Array.isArray(o)?o:[o]).forEach(function(t){t&&"string"==typeof t&&e.delete(t)})}}}(e,t);n&&(i.push(n),o.push(n));break;case"RANGE_ADD":var r=function(e,t){var n=e.parentID,r=e.connectionInfo,i=e.edgeName;if(!n)return null;var o=Ise(t);if(!r||!o)return null;return function(e,t){var s=e.get(n);if(s){var a=e.getRootField(o);if(a){var l,c=a.getLinkedRecord(i),u=(0,Rse.default)(r);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(c){var f=Dse.getConnection(s,d.key,d.filters);if(f){var h=Dse.buildConnectionEdge(e,f,c);if(h)switch(d.rangeBehavior){case"append":Dse.insertEdgeAfter(f,h);break;case"prepend":Dse.insertEdgeBefore(f,h)}}}}}catch(p){u.e(p)}finally{u.f()}}}}}(e,t);r&&(i.push(r),o.push(r));break;case"RANGE_DELETE":var s=function(e,t){var n=e.parentID,r=e.connectionKeys,i=e.pathToConnection,o=e.deletedIDFieldName;if(!n)return null;var s=Ise(t);if(!s)return null;return function(e,t){if(t){var a=[],l=t[s];if(l&&Array.isArray(o)){var c,u=(0,Rse.default)(o);try{for(u.s();!(c=u.n()).done;){var d=c.value;l&&"object"==typeof l&&(l=l[d])}}catch(f){u.e(f)}finally{u.f()}Array.isArray(l)?l.forEach(function(e){e&&e.id&&"object"==typeof e&&"string"==typeof e.id&&a.push(e.id)}):l&&l.id&&"string"==typeof l.id&&a.push(l.id)}else l&&"string"==typeof o&&"object"==typeof l&&("string"==typeof(l=l[o])?a.push(l):Array.isArray(l)&&l.forEach(function(e){"string"==typeof e&&a.push(e)}));!function(e,t,n,r,i){var o=r.get(e);if(!o)return;if(n.length<2)return;for(var s=o,a=1;a<n.length-1;a++)s&&(s=s.getLinkedRecord(n[a]));if(!t||!s)return;var l,c=(0,Rse.default)(t);try{var u=function(){var e=l.value,t=Dse.getConnection(s,e.key,e.filters);t&&i.forEach(function(e){Dse.deleteNode(t,e)})};for(c.s();!(l=c.n()).done;)u()}catch(f){c.e(f)}finally{c.f()}}(n,r,i,e,a)}}}(e,t);s&&(i.push(s),o.push(s))}}),{optimisticUpdater:function(e,t){i.forEach(function(n){n(e,t)})},updater:function(e,t){o.forEach(function(n){n(e,t)})}}}},Ose=Cre.getRequest,Pse=Tse,Mse=Goe.createOperationDescriptor,Lse=Fse,zse=gre;var jse=function(e,t){Pse(e)||zse(!1);var n=Ose(t.mutation);if("mutation"!==n.params.operationKind)throw new Error("commitMutation: Expected mutation operation");var r=t.optimisticUpdater,i=t.configs,o=t.optimisticResponse,s=t.variables,a=Mse(n,s);return i&&(r=Lse.convert(i,n,r).optimisticUpdater),e.applyMutation({operation:a,response:o,updater:r})};var Use=function(e,t){e.commitUpdate(t)};(0,Nre.default)(zre);var Bse=(0,Nre.default)(iie),$se=Cre.getRequest,qse=Zoe.generateUniqueClientID,Gse=Tse,Vse=Goe.createOperationDescriptor,Kse=Fse,Wse=gre;var Hse=function(e,t){Gse(e)||Wse(!1);var n=$se(t.mutation);if("mutation"!==n.params.operationKind)throw new Error("commitMutation: Expected mutation operation");if("Request"!==n.kind)throw new Error("commitMutation: Expected mutation to be of type request");var r=t.optimisticResponse,i=t.optimisticUpdater,o=t.updater,s=t.configs,a=t.cacheConfig,l=t.onError,c=t.onUnsubscribe,u=t.variables,d=t.uploadables,f=Vse(n,u,a,qse());if("function"==typeof r&&(r=r()),s){var h=Kse.convert(s,n,i,o);i=h.optimisticUpdater,o=h.updater}var p=[],g=e.executeMutation({operation:f,optimisticResponse:r,optimisticUpdater:i,updater:o,uploadables:d}).subscribe({next:function(e){var n;Array.isArray(e)?e.forEach(function(e){e.errors&&p.push.apply(p,(0,Bse.default)(e.errors))}):e.errors&&p.push.apply(p,(0,Bse.default)(e.errors)),null===(n=t.onNext)||void 0===n||n.call(t)},complete:function(){var n=t.onCompleted;n&&n(e.lookup(f.fragment).data,0!==p.length?p:null)},error:l,unsubscribe:c});return{dispose:g.unsubscribe}},Jse="function"==typeof WeakMap?new WeakMap:new Map;function Xse(e,t){if(null!=t){var n={};return Object.assign(n,e),Object.keys(t).forEach(function(e){var r=t[e].get,i=r();if(Jse.has(r)){var o=Jse.get(r);n[e]=o}else Jse.set(r,i),n[e]=i}),n}return e}Xse.tests_only_resetDebugCache=void 0;var Qse=hoe;var Yse={convertFetch:function(e){return function(t,n,r,i,o){var s=e(t,n,r,i,o);return s instanceof Error?Qse.create(function(e){return e.error(s)}):Qse.from(s)}}},Zse=Xse,eae=Yse.convertFetch,tae=gre;var nae={create:function(e,t){var n=eae(e);return{execute:function(e,r,i,o,s){var a=Zse(r,e.providedVariables);if("subscription"===e.operationKind)return t||tae(!1),o&&tae(!1),t(e,a,i);var l=i.poll;return null!=l?(o&&tae(!1),n(e,a,{force:!0}).poll(l)):n(e,a,i,o,s)}}}};(0,Nre.default)(zre);var rae=(0,Nre.default)(zre),iae=hoe,oae=Goe.createOperationDescriptor,sae=Xre.handlePotentialSnapshotErrors,aae=Toe,lae=Cre.getRequest,cae=gre;function uae(e,t){return aae.fetchQuery(e,t).map(function(){return e.lookup(t.fragment)})}var dae=function(e,t,n,r){var i,o=lae(t);"query"!==o.params.operationKind&&cae(!1);var s=(0,rae.default)({force:!0},null==r?void 0:r.networkCacheConfig),a=oae(o,n,s),l=null!==(i=null==r?void 0:r.fetchPolicy)&&void 0!==i?i:"network-only";function c(t){return sae(e,t.fieldErrors),t.data}switch(l){case"network-only":return uae(e,a).map(c);case"store-or-network":return"available"===e.check(a).status?iae.from(e.lookup(a.fragment)).map(c):uae(e,a).map(c);default:throw new Error("fetchQuery: Invalid fetchPolicy "+l)}},fae=Goe.createOperationDescriptor,hae=Cre.getRequest;var pae=function(e,t,n,r){var i=hae(t);if("query"!==i.params.operationKind)throw new Error("fetchQuery: Expected query operation");var o=fae(i,n,r);return e.execute({operation:o}).map(function(){return e.lookup(o.fragment).data}).toPromise()},gae=function(){function e(){this._preloadableQueries=new Map,this._callbacks=new Map}var t=e.prototype;return t.set=function(e,t){this._preloadableQueries.set(e,t);var n=this._callbacks.get(e);null!=n&&n.forEach(function(e){try{e(t)}catch(pU){setTimeout(function(){throw pU},0)}})},t.get=function(e){return this._preloadableQueries.get(e)},t.onLoad=function(e,t){var n,r=null!==(n=this._callbacks.get(e))&&void 0!==n?n:new Set;r.add(t);return this._callbacks.set(e,r),{dispose:function(){r.delete(t)}}},t.clear=function(){this._preloadableQueries.clear()},e}(),mae=new gae,vae=Toe.getPromiseForActiveRequest;var yae=function(e,t,n){var r,i,o=[],s=vae(e,n);if(null!=s)o=[n];else{var a,l,c=e.getOperationTracker().getPendingOperationsAffectingOwner(n);o=null!==(a=null==c?void 0:c.pendingOperations)&&void 0!==a?a:[],s=null!==(l=null==c?void 0:c.promise)&&void 0!==l?l:null}if(!s)return null;var u=null!==(r=null===(i=o)||void 0===i?void 0:i.map(function(e){return e.node.params.name}).join(","))&&void 0!==r?r:null;null!=u&&0!==u.length||(u="Unknown pending operation");var d=t.name,f=u===d?"Relay(".concat(u,")"):"Relay(".concat(u,":").concat(d,")");return s.displayName=f,e.__log({name:"pendingoperation.found",fragment:t,fragmentOwner:n,pendingOperations:o}),{promise:s,pendingOperations:o}};var _ae=function(e,t){return e===t&&(null===e||"object"!=typeof e)};function bae(e,t,n){if(e===t||"object"!=typeof e||!e||e.constructor!==Object&&!Array.isArray(e)||"object"!=typeof t||!t||t.constructor!==Object&&!Array.isArray(t))return t;var r=!1,i=Array.isArray(e)?e:null,o=Array.isArray(t)?t:null;if(i&&o){var s=n&&!Object.isFrozen(o);r=o.reduce(function(e,t,n){var r=bae(i[n],t,s);return r!==o[n]&&s&&(o[n]=r),e&&r===i[n]},!0)&&i.length===o.length}else if(!i&&!o){var a=e,l=t,c=Object.keys(a),u=Object.keys(l),d=n&&!Object.isFrozen(l);r=u.reduce(function(e,t){var n=bae(a[t],l[t],d);return n!==l[t]&&d&&(l[t]=n),e&&n===a[t]},!0)&&c.length===u.length}return r?e:t}var xae=function(e,t){return bae(e,t,!0)},Sae=Nre.default,wae=Sae(zre),Eae=Sae(Lre),kae=yae,Cae=Xre.handlePotentialSnapshotErrors,Aae=_ae,Nae=xae,Tae=cie,Rae=Goe.createRequestDescriptor,Dae=Zie.areEqualSelectors,Iae=Zie.createReaderSelector,Fae=Zie.getSelectorsFromObject,Oae=Fie,Pae=gre,Mae=function(){function e(e,t,n,r,i){var o=this;(0,Eae.default)(this,"_onChange",function(){o._stale=!0,"function"==typeof o._callback&&o._callback()}),this._callback=r,this._context=e,this._data={},this._fragments=t,this._props={},this._resolvers={},this._stale=!1,this._rootIsQueryRenderer=i,this.setProps(n)}var t=e.prototype;return t.dispose=function(){for(var e in this._resolvers)this._resolvers.hasOwnProperty(e)&&jae(this._resolvers[e])},t.resolve=function(){if(this._stale){var e,t=this._data;for(var n in this._resolvers)if(this._resolvers.hasOwnProperty(n)){var r=this._resolvers[n],i=t[n];if(r){var o=r.resolve();(e||o!==i)&&((e=e||(0,wae.default)({},t))[n]=o)}else{var s=this._props[n],a=void 0!==s?s:null;!e&&Aae(a,i)||((e=e||(0,wae.default)({},t))[n]=a)}}this._data=e||t,this._stale=!1}return this._data},t.setCallback=function(e,t){this._callback=t,!0===Tae.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this.setProps(e)},t.setProps=function(e){this._props={};var t=Fae(this._fragments,e);for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=this._resolvers[n];null==r?(null!=i&&i.dispose(),i=null):"PluralReaderSelector"===r.kind?null==i?i=new zae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof zae||Pae(!1),i.setSelector(r)):null==i?i=new Lae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Lae||Pae(!1),i.setSelector(r)),this._props[n]=e[n],this._resolvers[n]=i}this._stale=!0},t.setVariables=function(e,t){for(var n in this._resolvers)if(this._resolvers.hasOwnProperty(n)){var r=this._resolvers[n];r&&r.setVariables(e,t)}this._stale=!0},e}(),Lae=function(){function e(e,t,n,r,i){var o=this;(0,Eae.default)(this,"_onChange",function(e){o._data=e.data,o._isMissingData=e.isMissingData,o._fieldErrors=e.fieldErrors,o._callback()});var s=e.lookup(n);this._callback=i,this._data=s.data,this._isMissingData=s.isMissingData,this._fieldErrors=s.fieldErrors,this._environment=e,this._rootIsQueryRenderer=t,this._selector=n,!0===Tae.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?r&&(this._subscription=e.subscribe(s,this._onChange)):this._subscription=e.subscribe(s,this._onChange)}var t=e.prototype;return t.dispose=function(){this._subscription&&(this._subscription.dispose(),this._subscription=null)},t.resolve=function(){if(!0===this._isMissingData){var e=kae(this._environment,this._selector.node,this._selector.owner),t=null==e?void 0:e.promise;if(null!=t&&!this._rootIsQueryRenderer){var n,r=null!==(n=null==e?void 0:e.pendingOperations)&&void 0!==n?n:[];throw this._environment.__log({name:"suspense.fragment",data:this._data,fragment:this._selector.node,isRelayHooks:!1,isMissingData:this._isMissingData,isPromiseCached:!1,pendingOperations:r}),t}}return Cae(this._environment,this._fieldErrors),this._data},t.setSelector=function(e){if(null==this._subscription||!Dae(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=Nae(this._data,t.data),this._isMissingData=t.isMissingData,this._fieldErrors=t.fieldErrors,this._selector=e,this._subscription=this._environment.subscribe(t,this._onChange)}},t.setVariables=function(e,t){if(!Oae(e,this._selector.variables)){var n=Rae(t,e),r=Iae(this._selector.node,this._selector.dataID,e,n);this.setSelector(r)}},e}(),zae=function(){function e(e,t,n,r,i){var o=this;(0,Eae.default)(this,"_onChange",function(e){o._stale=!0,o._callback()}),this._callback=i,this._data=[],this._environment=e,this._resolvers=[],this._stale=!0,this._rootIsQueryRenderer=t,this._subscribeOnConstruction=r,this.setSelector(n)}var t=e.prototype;return t.dispose=function(){this._resolvers.forEach(jae)},t.resolve=function(){if(this._stale){for(var e,t=this._data,n=0;n<this._resolvers.length;n++){var r=t[n],i=this._resolvers[n].resolve();(e||i!==r)&&(e=e||t.slice(0,n)).push(i)}e||this._resolvers.length===t.length||(e=t.slice(0,this._resolvers.length)),this._data=e||t,this._stale=!1}return this._data},t.setSelector=function(e){for(var t=e.selectors;this._resolvers.length>t.length;){this._resolvers.pop().dispose()}for(var n=0;n<t.length;n++)n<this._resolvers.length?this._resolvers[n].setSelector(t[n]):this._resolvers[n]=new Lae(this._environment,this._rootIsQueryRenderer,t[n],this._subscribeOnConstruction,this._onChange);this._stale=!0},t.setVariables=function(e,t){this._resolvers.forEach(function(n){return n.setVariables(e,t)}),this._stale=!0},e}();function jae(e){e&&e.dispose()}var Uae=Mae;var Bae,$ae,qae=function(e,t,n,r,i,o){return new Uae(e,n,r,o,i)},Gae=gre;var Vae,Kae,Wae=function(e){return Bae||(Bae=e.createContext(null),$ae=e),e!==$ae&&Gae(!1),Bae},Hae=gre;var Jae=function(e){return Vae||(Vae=e.createContext(null),Kae=e),e!==Kae&&Hae(!1),Vae},Xae=Object.freeze({__LIVE_RESOLVER_SUSPENSE_SENTINEL:!0});var Qae={isSuspenseSentinel:function(e){return e===Xae},suspenseSentinel:function(){return Xae}},Yae={exports:{}};!function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(Yae);var Zae=Yae.exports,ele=Nre.default,tle=ele(Lre),nle=ele(Zae),rle=ele(Mre),ile=ele(zre),ole=Doe,sle=Zoe,ale=sle.generateClientObjectClientID,lle=Qae.isSuspenseSentinel,cle=kie,ule=cle.ACTOR_IDENTIFIER_KEY,dle=cle.ERRORS_KEY,fle=cle.ID_KEY,hle=cle.INVALIDATED_AT_KEY,ple=cle.REF_KEY,gle=cle.REFS_KEY,mle=cle.RELAY_RESOLVER_VALUE_KEY;cle.ROOT_ID;var vle=cle.TYPENAME_KEY,yle=Fie,_le=gre;function ble(e,t){var n=e[t];return n&&"object"==typeof n&&(n.hasOwnProperty(ple)||n.hasOwnProperty(gle))&&_le(!1),n}function xle(e,t,n){var r=e[dle];if(null!=n&&n.length>0)null==r?e[dle]=(0,tle.default)({},t,n):r[t]=n;else if(null!=r&&delete r[t]){for(var i in r)if(r.hasOwnProperty(i))return;delete e[dle]}}function Sle(e,t,n){e[t]=n}var wle={clone:function(e){return(0,ile.default)({},e)},copyFields:function(e,t){for(var n in e)e.hasOwnProperty(n)&&n!==fle&&n!==vle&&(t[n]=e[n])},create:function(e,t){var n={};return n[fle]=e,n[vle]=t,n},freeze:function(e){ole(e)},fromObject:function(e){return e},getDataID:function(e){return e[fle]},getErrors:function(e,t){var n;return null===(n=e[dle])||void 0===n?void 0:n[t]},getFields:function(e){return dle in e?Object.keys(e).filter(function(e){return e!==dle}):Object.keys(e)},getInvalidationEpoch:function(e){if(null==e)return null;var t=e[hle];return"number"!=typeof t?null:t},getLinkedRecordID:function(e,t){var n=e[t];if(null==n)return n;var r=n;return"object"==typeof r&&r&&"string"==typeof r[ple]||_le(!1),r[ple]},getLinkedRecordIDs:function(e,t){var n=e[t];return null==n?n:("object"==typeof n&&Array.isArray(n[gle])||_le(!1),n[gle])},getType:function(e){return e[vle]},getValue:ble,hasValue:function(e,t){return t in e},hasLinkedRecordID:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&n&&"string"==typeof n[ple])},hasLinkedRecordIDs:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&Array.isArray(n[gle])&&n[gle].every(function(e){return"string"==typeof e}))},merge:function(e,t){if(dle in e||dle in t){var n=e[dle],r=(0,nle.default)(e,[dle].map(rle.default)),i=t[dle],o=(0,nle.default)(t,[dle].map(rle.default)),s=(0,ile.default)((0,ile.default)({},r),o);if(null==n&&null==i)return s;var a={};for(var l in n)o.hasOwnProperty(l)||(a[l]=n[l]);for(var c in i)a[c]=i[c];for(var u in a){s[dle]=a;break}return s}return(0,ile.default)((0,ile.default)({},e),t)},setErrors:xle,setValue:Sle,setLinkedRecordID:function(e,t,n){var r={};r[ple]=n,e[t]=r},setLinkedRecordIDs:function(e,t,n){var r={};r[gle]=n,e[t]=r},update:function(e,t){var n,r=e[dle],i=t[dle],o=null;if(null==r&&null==i){var s;for(var a in t)!o&&yle(e[a],t[a])||((o=null!==o?o:(0,ile.default)({},e))[a]=t[a]);return null!==(s=o)&&void 0!==s?s:e}for(var l in t)if(l!==dle){var c=t[l],u=null==i?void 0:i[l];if(null==o){var d=e[l],f=null==r?void 0:r[l];if(yle(d,c)&&yle(f,u))continue;o=(0,ile.default)({},e),null!=r&&(o[dle]=(0,ile.default)({},r))}Sle(o,l,c),xle(o,l,u)}return null!==(n=o)&&void 0!==n?n:e},getActorLinkedRecordID:function(e,t){var n=e[t];return null==n?n:(("object"!=typeof n||"string"!=typeof n[ple]||null==n[ule])&&_le(!1),[n[ule],n[ple]])},setActorLinkedRecordID:function(e,t,n,r){var i={};i[ple]=r,i[ule]=n,e[t]=i},getResolverLinkedRecordID:function(e,t){var n=ble(e,mle);return null==n||lle(n)?null:("object"==typeof n&&(n=n.id),"string"!=typeof n&&_le(!1),ale(t,n))},getResolverLinkedRecordIDs:function(e,t){var n=ble(e,mle);return null==n||lle(n)?null:(Array.isArray(n)||_le(!1),n.map(function(e){return null==e?null:("object"==typeof e&&(e=e.id),"string"!=typeof e&&_le(!1),ale(t,e))}))},toJSON:function(e){return e}},Ele={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"},kle=(0,Nre.default)(Gre),Cle=wle,Ale=Ele.EXISTENT,Nle=Ele.NONEXISTENT,Tle=Ele.UNKNOWN,Rle=function(){function e(e){var t=this;this._records=new Map,null!=e&&Object.keys(e).forEach(function(n){var r=e[n],i=Cle.fromObject(r);t._records.set(n,i)})}e.create=function(t){return new e(t)};var t=e.prototype;return t.clear=function(){this._records=new Map},t.delete=function(e){this._records.set(e,null)},t.get=function(e){return this._records.get(e)},t.getRecordIDs=function(){return Array.from(this._records.keys())},t.getStatus=function(e){return this._records.has(e)?null==this._records.get(e)?Nle:Ale:Tle},t.has=function(e){return this._records.has(e)},t.remove=function(e){this._records.delete(e)},t.set=function(e,t){this._records.set(e,t)},t.size=function(){return this._records.size},t.toJSON=function(){var e,t={},n=(0,kle.default)(this._records);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r[0],o=r[1];t[i]=Cle.toJSON(o)}}catch(s){n.e(s)}finally{n.f()}return t},e}(),Dle=Rle,Ile=gre,Fle="INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";var Ole={assertInternalActorIdentifier:function(e){e!==Fle&&Ile(!1)},getActorIdentifier:function(e){return e},INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE:Fle},Ple="actor_key",Mle=Ole.getActorIdentifier;var Lle={ACTOR_IDENTIFIER_FIELD_NAME:Ple,getActorIdentifierFromPayload:function(e){if(null!=e&&"object"==typeof e&&"string"==typeof e[Ple])return Mle(e[Ple])}},zle=Nre.default,jle=zle(zre),Ule=zle(Zae),Ble=zle(Gre),$le=zle(iie),qle=["path","locations"],Gle=Symbol("$SELF");function Vle(e,t){var n,r=(0,Ble.default)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0],s=i[1],a=t.length;if(Array.isArray(s)?t.push.apply(t,(0,$le.default)(s)):Vle(s,t),o!==Gle)for(var l=t.length,c=a;c<l;c++){var u=t[c];null==u.path?t[c]=(0,jle.default)((0,jle.default)({},u),{},{path:[o]}):u.path.unshift(o)}}}catch(d){r.e(d)}finally{r.f()}}var Kle={buildErrorTrie:function(e){if(null==e)return null;var t,n=new Map,r=(0,Ble.default)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.path,s=(i.locations,(0,Ule.default)(i,qle));if(null!=o){var a=o.length;if(0!==a){for(var l=a-1,c=n,u=0;u<l;u++){var d=o[u],f=c.get(d);if(f instanceof Map)c=f;else{var h=new Map;Array.isArray(f)&&h.set(Gle,f),c.set(d,h),c=h}}var p=o[l],g=c.get(p);g instanceof Map&&(g=(c=g).get(p),p=Gle),Array.isArray(g)?g.push(s):c.set(p,[s])}}}}catch(m){r.e(m)}finally{r.f()}return n},getNestedErrorTrieByKey:function(e,t){var n=e.get(t);return n instanceof Map?n:null},getErrorsByKey:function(e,t){var n=e.get(t);if(null==n)return null;if(Array.isArray(n))return n;var r=[];return Vle(n,r),r}};var Wle={generateTypeID:function(e){return"client:__type:"+e},TYPE_SCHEMA_TYPE:"__TypeSchema"},Hle=Nre.default,Jle=Hle(Gre),Xle=Hle(iie),Qle=Lle,Yle=Qle.getActorIdentifierFromPayload,Zle=cie,ece=Zoe.generateClientID,tce=Zoe.isClientID,nce=Tie.getLocalVariables,rce=Kle.buildErrorTrie,ice=Kle.getErrorsByKey,oce=Kle.getNestedErrorTrieByKey,sce=wle,ace=Zie.createNormalizationSelector,lce=kie,cce=lce.ROOT_ID,uce=lce.TYPENAME_KEY,dce=lce.getArgumentValues,fce=lce.getHandleStorageKey,hce=lce.getModuleComponentKey,pce=lce.getModuleOperationKey,gce=lce.getStorageKey,mce=Wle.TYPE_SCHEMA_TYPE,vce=Wle.generateTypeID,yce=gre;var _ce=function(){function e(e,t,n,r){this._actorIdentifier=n.actorIdentifier,this._getDataId=n.getDataID,this._handleFieldPayloads=[],this._treatMissingFieldsAsNull=n.treatMissingFieldsAsNull,this._incrementalPlaceholders=[],this._isClientExtension=!1,this._isUnmatchedAbstractType=!1,this._useExecTimeResolvers=r,this._followupPayloads=[],this._path=n.path?(0,Xle.default)(n.path):[],this._recordSource=e,this._variables=t,this._shouldProcessClientComponents=n.shouldProcessClientComponents,this._log=n.log}var t=e.prototype;return t.normalizeResponse=function(e,t,n,r){var i=this._recordSource.get(t);return i||yce(!1),this._assignClientAbstractTypes(e),this._errorTrie=rce(r),this._traverseSelections(e,i,n),{errors:r,fieldPayloads:this._handleFieldPayloads,incrementalPlaceholders:this._incrementalPlaceholders,followupPayloads:this._followupPayloads,source:this._recordSource,isFinal:!1}},t._assignClientAbstractTypes=function(e){var t=e.clientAbstractTypes;if(null!=t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],s=(0,Jle.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=vce(a),c=this._recordSource.get(l);null==c&&(c=sce.create(l,mce),this._recordSource.set(l,c)),sce.setValue(c,o,!0)}}catch(u){s.e(u)}finally{s.f()}}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||yce(!1),this._variables[e]},t._getRecordType=function(e){var t=e[uce];return null==t&&yce(!1),t},t._traverseSelections=function(e,t,n){for(var r=0;r<e.selections.length;r++){var i=e.selections[r];switch(i.kind){case"ScalarField":case"LinkedField":this._normalizeField(i,t,n);break;case"Condition":Boolean(this._getVariableValue(i.condition))===i.passingValue&&this._traverseSelections(i,t,n);break;case"FragmentSpread":var o=this._variables;this._variables=nce(this._variables,i.fragment.argumentDefinitions,i.args),this._traverseSelections(i.fragment,t,n),this._variables=o;break;case"InlineFragment":var s=i.abstractKey;if(null==s){sce.getType(t)===i.type&&this._traverseSelections(i,t,n)}else{var a=Object.prototype.hasOwnProperty.call(n,s),l=sce.getType(t),c=vce(l),u=this._recordSource.get(c);null==u&&(u=sce.create(c,mce),this._recordSource.set(c,u)),sce.setValue(u,s,a),a&&this._traverseSelections(i,t,n)}break;case"TypeDiscriminator":var d=i.abstractKey,f=Object.prototype.hasOwnProperty.call(n,d),h=sce.getType(t),p=vce(h),g=this._recordSource.get(p);null==g&&(g=sce.create(p,mce),this._recordSource.set(p,g)),sce.setValue(g,d,f);break;case"LinkedHandle":case"ScalarHandle":var m=i.args?dce(i.args,this._variables):{},v=gce(i,this._variables),y=fce(i,this._variables);this._handleFieldPayloads.push({args:m,dataID:sce.getDataID(t),fieldKey:v,handle:i.handle,handleKey:y,handleArgs:i.handleArgs?dce(i.handleArgs,this._variables):{}});break;case"ModuleImport":this._normalizeModuleImport(i,t,n);break;case"Defer":this._normalizeDefer(i,t,n);break;case"Stream":this._normalizeStream(i,t,n);break;case"ClientExtension":var _=this._isClientExtension;this._isClientExtension=!0,this._traverseSelections(i,t,n),this._isClientExtension=_;break;case"ClientComponent":if(!1===this._shouldProcessClientComponents)break;this._traverseSelections(i.fragment,t,n);break;case"ActorChange":this._normalizeActorChange(i,t,n);break;case"RelayResolver":case"RelayLiveResolver":this._useExecTimeResolvers||this._normalizeResolver(i,t,n);break;case"ClientEdgeToClientObject":this._useExecTimeResolvers||this._normalizeResolver(i.backingField,t,n);break;default:yce(!1)}}},t._normalizeResolver=function(e,t,n){null!=e.fragment&&this._traverseSelections(e.fragment,t,n)},t._normalizeDefer=function(e,t,n){!1===(null===e.if||this._getVariableValue(e.if))?this._traverseSelections(e,t,n):this._incrementalPlaceholders.push({kind:"defer",data:n,label:e.label,path:(0,Xle.default)(this._path),selector:ace(e,sce.getDataID(t),this._variables),typeName:sce.getType(t),actorIdentifier:this._actorIdentifier})},t._normalizeStream=function(e,t,n){this._traverseSelections(e,t,n),!0===(null===e.if||this._getVariableValue(e.if))&&this._incrementalPlaceholders.push({kind:"stream",label:e.label,path:(0,Xle.default)(this._path),parentID:sce.getDataID(t),node:e,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeModuleImport=function(e,t,n){"object"==typeof n&&n||yce(!1);var r=sce.getType(t),i=hce(e.documentName),o=e.componentModuleProvider||n[i];sce.setValue(t,i,null!=o?o:null);var s=pce(e.documentName),a=e.operationModuleProvider||n[s];sce.setValue(t,s,null!=a?a:null),null!=a&&this._followupPayloads.push({kind:"ModuleImportPayload",args:e.args,data:n,dataID:sce.getDataID(t),operationReference:a,path:(0,Xle.default)(this._path),typeName:r,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeField=function(e,t,n){"object"==typeof n&&n||yce(!1);var r=e.alias||e.name,i=gce(e,this._variables),o=n[r],s=Zle.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(o)&&0===o.length;if(null==o||s){if(void 0===o){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}"ScalarField"===e.kind&&this._validateConflictingFieldsWithIdenticalId(t,i,null),s?"LinkedField"===e.kind?sce.setLinkedRecordIDs(t,i,[]):sce.setValue(t,i,[]):sce.setValue(t,i,null);var a=this._errorTrie;if(null!=a){var l=ice(a,r);null!=l&&sce.setErrors(t,i,l)}}else if("ScalarField"===e.kind)this._validateConflictingFieldsWithIdenticalId(t,i,o),sce.setValue(t,i,o);else if("LinkedField"===e.kind){this._path.push(r);var c=this._errorTrie;this._errorTrie=null==c?null:oce(c,r),e.plural?this._normalizePluralLink(e,t,i,o):this._normalizeLink(e,t,i,o),this._errorTrie=c,this._path.pop()}else yce(!1)},t._normalizeActorChange=function(e,t,n){var r,i=e.linkedField;"object"==typeof n&&n||yce(!1);var o=i.alias||i.name,s=gce(i,this._variables),a=n[o];if(null!=a){var l=Yle(a);if(null!=l){var c=null!==(r=i.concreteType)&&void 0!==r?r:this._getRecordType(a),u=this._getDataId(a,c)||sce.getLinkedRecordID(t,s)||ece(sce.getDataID(t),s);"string"!=typeof u&&yce(!1),sce.setActorLinkedRecordID(t,s,l,u),this._followupPayloads.push({kind:"ActorPayload",data:a,dataID:u,path:[].concat((0,Xle.default)(this._path),[o]),typeName:c,variables:this._variables,node:i,actorIdentifier:l})}else sce.setValue(t,s,null)}else{if(void 0===a){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}sce.setValue(t,s,null)}},t._normalizeLink=function(e,t,n,r){var i;"object"==typeof r&&r||yce(!1);var o=this._getDataId(r,null!==(i=e.concreteType)&&void 0!==i?i:this._getRecordType(r))||sce.getLinkedRecordID(t,n)||ece(sce.getDataID(t),n);"string"!=typeof o&&yce(!1),this._validateConflictingLinkedFieldsWithIdenticalId(sce.getLinkedRecordID(t,n),o,n),sce.setLinkedRecordID(t,n,o);var s=this._recordSource.get(o);if(s)this._validateRecordType(s,e,r);else{var a=e.concreteType||this._getRecordType(r);s=sce.create(o,a),this._recordSource.set(o,s)}this._traverseSelections(e,s,r)},t._normalizePluralLink=function(e,t,n,r){var i=this;Array.isArray(r)||yce(!1);var o=sce.getLinkedRecordIDs(t,n),s=[];r.forEach(function(r,a){var l;if(null!=r){i._path.push(String(a));var c=i._errorTrie;i._errorTrie=null==c?null:oce(c,a),"object"!=typeof r&&yce(!1);var u=i._getDataId(r,null!==(l=e.concreteType)&&void 0!==l?l:i._getRecordType(r))||o&&o[a]||ece(sce.getDataID(t),n,a);"string"!=typeof u&&yce(!1),s.push(u);var d=i._recordSource.get(u);if(d)i._validateRecordType(d,e,r);else{var f=e.concreteType||i._getRecordType(r);d=sce.create(u,f),i._recordSource.set(u,d)}o&&i._validateConflictingLinkedFieldsWithIdenticalId(o[a],u,n),i._traverseSelections(e,d,r),i._errorTrie=c,i._path.pop()}else s.push(r)}),sce.setLinkedRecordIDs(t,n,s)},t._validateRecordType=function(e,t,n){if(Zle.ENABLE_STORE_ID_COLLISION_LOGGING){var r,i=null!==(r=t.concreteType)&&void 0!==r?r:this._getRecordType(n),o=sce.getDataID(e);if(!(tce(o)&&o!==cce||sce.getType(e)===i)){var s={name:"idCollision.typename",previous_typename:sce.getType(e),new_typename:i};null!=this._log&&this._log(s)}}},t._validateConflictingFieldsWithIdenticalId=function(e,t,n){},t._validateConflictingLinkedFieldsWithIdenticalId=function(e,t,n){},e}(),bce={normalize:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;return new _ce(e,l,r,null!=o&&o).normalizeResponse(a,s,n,i)}},xce=Nre.default,Sce=xce(zre),wce=xce(wle),Ece=xce(Dle),kce=xce(bce);var Cce=function(e,t,n,r,i){var o,s=e.data,a=e.errors,l=Ece.default.create(),c=wce.default.create(t.dataID,n);l.set(t.dataID,c);var u=kce.default.normalize(l,t,s,r,a,i);return(0,Sce.default)((0,Sce.default)({},u),{},{isFinal:!0===(null===(o=e.extensions)||void 0===o?void 0:o.is_final)})},Ace=Cre.getInlineDataFragment,Nce=kie.FRAGMENTS_KEY,Tce=gre;var Rce=function(e,t){var n,r=Ace(e);if(null==t)return t;"object"!=typeof t&&Tce(!1);var i=null===(n=t[Nce])||void 0===n?void 0:n[r.name];return null==i&&Tce(!1),i},Dce=1e5;var Ice=function(){return Dce++},Fce=Ice;var Oce=function(e,t){return{execute:function(n,r,i,o,s,a,l,c){var u=Fce(),d={start:function(t){e.__log({name:"network.start",networkRequestId:u,params:n,variables:r,cacheConfig:i})},next:function(t){e.__log({name:"network.next",networkRequestId:u,response:t})},error:function(t){e.__log({name:"network.error",networkRequestId:u,error:t})},complete:function(){e.__log({name:"network.complete",networkRequestId:u})},unsubscribe:function(){e.__log({name:"network.unsubscribe",networkRequestId:u})}};return t.execute(n,r,i,o,function(t){e.__log({name:"network.info",networkRequestId:u,info:t})},a,l,c).do(d)}}},Pce=(0,Nre.default)(Gre),Mce=gre,Lce=function(){function e(){this._ownersToPendingOperations=new Map,this._pendingOperationsToOwners=new Map,this._ownersToPendingPromise=new Map}var t=e.prototype;return t.update=function(e,t){if(0!==t.size){var n,r=e.identifier,i=new Set,o=(0,Pce.default)(t);try{for(o.s();!(n=o.n()).done;){var s=n.value.identifier,a=this._ownersToPendingOperations.get(s);null!=a?a.has(r)||(a.set(r,e),i.add(s)):(this._ownersToPendingOperations.set(s,new Map([[r,e]])),i.add(s))}}catch(f){o.e(f)}finally{o.f()}if(0!==i.size){var l,c=this._pendingOperationsToOwners.get(r)||new Set,u=(0,Pce.default)(i);try{for(u.s();!(l=u.n()).done;){var d=l.value;this._resolveOwnerResolvers(d),c.add(d)}}catch(f){u.e(f)}finally{u.f()}this._pendingOperationsToOwners.set(r,c)}}},t.complete=function(e){var t=e.identifier,n=this._pendingOperationsToOwners.get(t);if(null!=n){var r,i=new Set,o=new Set,s=(0,Pce.default)(n);try{for(s.s();!(r=s.n()).done;){var a=r.value,l=this._ownersToPendingOperations.get(a);l&&(l.delete(t),l.size>0?o.add(a):i.add(a))}}catch(g){s.e(g)}finally{s.f()}var c,u=(0,Pce.default)(i);try{for(u.s();!(c=u.n()).done;){var d=c.value;this._resolveOwnerResolvers(d),this._ownersToPendingOperations.delete(d)}}catch(g){u.e(g)}finally{u.f()}var f,h=(0,Pce.default)(o);try{for(h.s();!(f=h.n()).done;){var p=f.value;this._resolveOwnerResolvers(p)}}catch(g){h.e(g)}finally{h.f()}this._pendingOperationsToOwners.delete(t)}},t._resolveOwnerResolvers=function(e){var t=this._ownersToPendingPromise.get(e);null!=t&&t.resolve(),this._ownersToPendingPromise.delete(e)},t.getPendingOperationsAffectingOwner=function(e){var t=e.identifier,n=this._ownersToPendingOperations.get(t);if(null==n||0===n.size)return null;var r,i=this._ownersToPendingPromise.get(t);if(null!=i)return{promise:i.promise,pendingOperations:i.pendingOperations};var o=new Promise(function(e){r=e});null==r&&Mce(!1);var s=Array.from(n.values());return this._ownersToPendingPromise.set(t,{promise:o,resolve:r,pendingOperations:s}),{promise:o,pendingOperations:s}},e}(),zce=Lce;var jce=function(e){var t=void 0!==k?k:"undefined"!=typeof window?window:void 0,n=t&&t.__RELAY_DEVTOOLS_HOOK__;n&&n.registerEnvironment(e)},Uce={VIEWER_ID:(0,Zoe.generateClientID)(kie.ROOT_ID,"viewer"),VIEWER_TYPE:"Viewer"},Bce=Uce.VIEWER_ID,$ce=Uce.VIEWER_TYPE;var qce=function(e,t){return t===$ce&&null==e.id?Bce:e.id},Gce=function(e){},Vce=pre.REQUEST;var Kce=function(e){return e.kind===Vce?e.operation:e};function Wce(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];var s=0,a=n.replace(/%s/g,function(){return String(i[s++])}),l=new Error(a),c=Object.assign(l,{name:t,messageFormat:n,messageParams:i,type:e,taalOpcodes:[2,2]});if(void 0===c.stack)try{throw c}catch(u){}return c}var Hce,Jce,Xce={create:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Wce.apply(void 0,["error",e,t].concat(r))},createWarning:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Wce.apply(void 0,["warn",e,t].concat(r))}},Qce="undefined"!=typeof window&&"function"==typeof(null===(Hce=window)||void 0===Hce||null===(Jce=Hce.performance)||void 0===Jce?void 0:Jce.now);function Yce(){return Qce?window.performance.now():Date.now()}var Zce=function(e){var t=Yce(),n=e();return[t,Yce()-t,n]},eue=Nre.default,tue=eue(Gre),nue=eue(iie),rue=hoe,iue=Ice,oue=Kce,sue=Xce,aue=cie,lue=uie.stableCopy,cue=Zce,uue=Zoe.generateClientID,due=Zoe.generateUniqueClientID,fue=Tie.getLocalVariables,hue=wle,pue=Zie.createNormalizationSelector,gue=Zie.createReaderSelector,mue=Dle,vue=kie,yue=vue.ROOT_TYPE,_ue=vue.TYPENAME_KEY,bue=vue.getStorageKey,xue=gre;var Sue=function(){function e(e){var t,n,r,i=this,o=e.actorIdentifier,s=e.getDataID,a=e.getPublishQueue,l=e.getStore,c=e.isClientPayload,u=e.operation,d=e.operationExecutions,f=e.operationLoader,h=e.operationTracker,p=e.optimisticConfig,g=e.scheduler,m=e.shouldProcessClientComponents,v=e.sink,y=e.source,_=e.treatMissingFieldsAsNull,b=e.updater,x=e.log,S=e.normalizeResponse;this._actorIdentifier=o,this._getDataID=s,this._treatMissingFieldsAsNull=_,this._incrementalPayloadsPending=!1,this._incrementalResults=new Map,this._log=x,this._executeId=iue(),this._nextSubscriptionId=0,this._operation=u,this._operationExecutions=d,this._operationLoader=f,this._operationTracker=h,this._operationUpdateEpochs=new Map,this._optimisticUpdates=null,this._useExecTimeResolvers=null!==(t=null!==(n=this._operation.request.node.operation.use_exec_time_resolvers)&&void 0!==n?n:!0===(null===(r=this._operation.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===r?void 0:r.get()))&&void 0!==t&&t,this._execTimeResolverResponseComplete=!1,this._pendingModulePayloadsCount=0,this._getPublishQueue=a,this._scheduler=g,this._sink=v,this._source=new Map,this._state="started",this._getStore=l,this._subscriptions=new Map,this._updater=b,this._isClientPayload=!0===c,this._isSubscriptionOperation="subscription"===this._operation.request.node.params.operationKind,this._shouldProcessClientComponents=m,this._retainDisposables=new Map,this._seenActors=new Set,this._completeFns=[],this._normalizeResponse=S;var w=this._nextSubscriptionId++;aue.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION&&null!=p&&this._processOptimisticResponse(null!=p.response?{data:p.response}:null,p.updater,!1),y.subscribe({complete:function(){return i._complete(w)},error:function(e){return i._error(e)},next:function(e){try{i._next(w,e)}catch(Ene){v.error(Ene)}},start:function(e){var t;i._start(w,e),i._log({name:"execute.start",executeId:i._executeId,params:i._operation.request.node.params,variables:i._operation.request.variables,cacheConfig:null!==(t=i._operation.request.cacheConfig)&&void 0!==t?t:{}})},unsubscribe:function(){i._log({name:"execute.unsubscribe",executeId:i._executeId})}}),aue.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION||null==p||this._processOptimisticResponse(null!=p.response?{data:p.response}:null,p.updater,!1)}var t=e.prototype;return t.cancel=function(){var e=this;if("completed"!==this._state){this._state="completed",this._operationExecutions.delete(this._operation.request.identifier),0!==this._subscriptions.size&&(this._subscriptions.forEach(function(e){return e.unsubscribe()}),this._subscriptions.clear());var t=this._optimisticUpdates;null!==t&&(this._optimisticUpdates=null,t.forEach(function(t){return e._getPublishQueueAndSaveActor().revertUpdate(t)}),this._runPublishQueue()),this._incrementalResults.clear(),null!=this._asyncStoreUpdateDisposable&&(this._asyncStoreUpdateDisposable.dispose(),this._asyncStoreUpdateDisposable=null),this._completeFns=[],this._completeOperationTracker(),this._disposeRetainedData()}},t._updateActiveState=function(){var e;switch(this._state){case"started":case"loading_incremental":e="active";break;case"completed":e="inactive";break;case"loading_final":e=this._pendingModulePayloadsCount>0||this._useExecTimeResolvers&&!this._execTimeResolverResponseComplete?"active":"inactive";break;default:this._state,xue(!1)}this._operationExecutions.set(this._operation.request.identifier,e)},t._schedule=function(e,t){var n=this,r=this._scheduler;if(null!=r){var i=this._nextSubscriptionId++;rue.create(function(n){var i=r.schedule(function(){try{e(),n.complete()}catch(Ene){n.error(Ene)}},t);return function(){return r.cancel(i)}}).subscribe({complete:function(){return n._complete(i)},error:function(e){return n._error(e)},start:function(e){return n._start(i,e)}})}else e()},t._complete=function(e){this._subscriptions.delete(e),0===this._subscriptions.size&&(this.cancel(),this._sink.complete(),this._log({name:"execute.complete",executeId:this._executeId}))},t._error=function(e){this.cancel(),this._sink.error(e),this._log({name:"execute.error",executeId:this._executeId,error:e})},t._start=function(e,t){this._subscriptions.set(e,t),this._updateActiveState()},t._next=function(e,t){var n=this,r="loading_incremental"===this._state?"low":"default";this._schedule(function(){n._log({name:"execute.next.start",executeId:n._executeId,response:t,operation:n._operation}),n._handleNext(t),n._maybeCompleteSubscriptionOperationTracking(),n._log({name:"execute.next.end",executeId:n._executeId,response:t,operation:n._operation})},r)},t._handleErrorResponse=function(e){var t=this,n=[];return e.forEach(function(e){if(null!==e.data||null==e.extensions||e.hasOwnProperty("errors")){if(null==e.data){var r=e.hasOwnProperty("errors")&&null!=e.errors?e.errors:null,i=r?r.map(function(e){return e.message}).join("\n"):"(No errors)",o=sue.create("RelayNetwork","No data returned for operation `"+t._operation.request.node.params.name+"`, got error(s):\n"+i+"\n\nSee the error `source` property for more information.");throw o.source={errors:r,operation:t._operation.request.node,variables:t._operation.request.variables},o.stack,o}var s=e;n.push(s)}}),n},t._handleOptimisticResponses=function(e){var t;if(e.length>1)return e.some(function(e){var t;return!0===(null===(t=e.extensions)||void 0===t?void 0:t.isOptimistic)})&&xue(!1),!1;var n=e[0],r=!0===(null===(t=n.extensions)||void 0===t?void 0:t.isOptimistic);return r&&"started"!==this._state&&xue(!1),!!r&&(this._processOptimisticResponse(n,null,this._treatMissingFieldsAsNull),this._sink.next(n),!0)},t._handleNext=function(e){if("completed"!==this._state){this._seenActors.clear();var t=Array.isArray(e)?e:[e],n=this._handleErrorResponse(t);if(0===n.length){var r=t.some(function(e){var t;return!0===(null===(t=e.extensions)||void 0===t?void 0:t.is_final)});return r&&(this._state="loading_final",this._updateActiveState(),this._incrementalPayloadsPending=!1),void this._sink.next(e)}if(!this._handleOptimisticResponses(n)){var i=function(e){var t=[],n=[],r=[];return e.forEach(function(e){var i;if(null!=e.path||null!=e.label){var o=e.label,s=e.path;null!=o&&null!=s||xue(!1),n.push({label:o,path:s,response:e})}else!0===(null===(i=e.extensions)||void 0===i?void 0:i.is_normalized)?r.push(e):t.push(e)}),[t,n,r]}(n),o=i[0],s=i[1],a=i[2],l=o.length>0,c=a.length>0;if(l){if(this._isSubscriptionOperation){var u=due();this._operation={request:this._operation.request,fragment:gue(this._operation.fragment.node,u,this._operation.fragment.variables,this._operation.fragment.owner),root:pue(this._operation.root.node,u,this._operation.root.variables)}}var d=this._processResponses(o);this._processPayloadFollowups(d)}if(c)for(var f=[],h=0;h<a.length;h++){var p,g=a[h],m=new mue(g.data),v={errors:[],fieldPayloads:[],followupPayloads:[],incrementalPlaceholders:[],isFinal:r=!0===(null===(p=g.extensions)||void 0===p?void 0:p.is_final),source:m};this._getPublishQueueAndSaveActor().commitPayload(this._operation,v,this._updater),f.push(v),this._execTimeResolverResponseComplete=r,r&&this._updateActiveState()}if(s.length>0){var y=this._processIncrementalResponses(s);this._processPayloadFollowups(y)}this._isSubscriptionOperation&&(null==n[0].extensions?n[0].extensions={__relay_subscription_root_id:this._operation.fragment.dataID}:n[0].extensions.__relay_subscription_root_id=this._operation.fragment.dataID);var _=this._runPublishQueue(l||c?this._operation:void 0);l&&this._incrementalPayloadsPending&&this._retainData(),this._updateOperationTracker(_),this._sink.next(e)}}},t._processOptimisticResponse=function(e,t,n){var r=this;if(null!==this._optimisticUpdates&&xue(!1),null!=e||null!=t){var i=[];if(e){var o=this._normalizeResponse(e,this._operation.root,yue,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[],shouldProcessClientComponents:this._shouldProcessClientComponents,treatMissingFieldsAsNull:n},this._useExecTimeResolvers);wue(o),i.push({operation:this._operation,payload:o,updater:t}),this._processOptimisticFollowups(o,i)}else t&&i.push({operation:this._operation,payload:{errors:null,fieldPayloads:null,incrementalPlaceholders:null,followupPayloads:null,source:mue.create(),isFinal:!1},updater:t});this._optimisticUpdates=i,i.forEach(function(e){return r._getPublishQueueAndSaveActor().applyUpdate(e)});var s=this._runPublishQueue();aue.ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES&&this._updateOperationTracker(s)}},t._processOptimisticFollowups=function(e,t){if(e.followupPayloads&&e.followupPayloads.length){var n,r=e.followupPayloads,i=(0,tue.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value;switch(o.kind){case"ModuleImportPayload":var s=this._expectOperationLoader().get(o.operationReference);if(null==s)this._processAsyncOptimisticModuleImport(o);else{var a=this._processOptimisticModuleImport(s,o);t.push.apply(t,(0,nue.default)(a))}break;case"ActorPayload":break;default:xue(!1)}}}catch(l){i.e(l)}finally{i.f()}}},t._normalizeFollowupPayload=function(e,t){var n;n="SplitOperation"===t.kind&&"ModuleImportPayload"===e.kind?fue(e.variables,t.argumentDefinitions,e.args):e.variables;var r=pue(t,e.dataID,n),i={data:e.data,extensions:"loading_final"===this._state?{is_final:!0}:void 0};return this._normalizeResponse(i,r,e.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:e.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers)},t._processOptimisticModuleImport=function(e,t){var n=oue(e),r=[],i=this._normalizeFollowupPayload(t,n);return wue(i),r.push({operation:this._operation,payload:i,updater:null}),this._processOptimisticFollowups(i,r),r},t._processAsyncOptimisticModuleImport=function(e){var t=this;this._expectOperationLoader().load(e.operationReference).then(function(n){if(null!=n&&"started"===t._state){var r,i=t._processOptimisticModuleImport(n,e);if(i.forEach(function(e){return t._getPublishQueueAndSaveActor().applyUpdate(e)}),null==t._optimisticUpdates);else(r=t._optimisticUpdates).push.apply(r,(0,nue.default)(i)),t._runPublishQueue()}})},t._processResponses=function(e){var t=this;return this._log({name:"execute.normalize.start",operation:this._operation}),null!==this._optimisticUpdates&&(this._optimisticUpdates.forEach(function(e){t._getPublishQueueAndSaveActor().revertUpdate(e)}),this._optimisticUpdates=null),this._incrementalPayloadsPending=!1,this._incrementalResults.clear(),this._source.clear(),e.map(function(e){var n=t._normalizeResponse(e,t._operation.root,yue,{actorIdentifier:t._actorIdentifier,getDataID:t._getDataID,log:t._log,path:[],treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,shouldProcessClientComponents:t._shouldProcessClientComponents},t._useExecTimeResolvers);return t._getPublishQueueAndSaveActor().commitPayload(t._operation,n,t._updater),t._log({name:"execute.normalize.end",operation:t._operation}),n})},t._processPayloadFollowups=function(e){var t=this;"completed"!==this._state&&e.forEach(function(e){var n=e.incrementalPlaceholders,r=e.followupPayloads,i=e.isFinal;if(t._state=i?"loading_final":"loading_incremental",t._updateActiveState(),i&&(t._incrementalPayloadsPending=!1),r&&0!==r.length&&r.forEach(function(e){var n,r=t._actorIdentifier;t._actorIdentifier=null!==(n=e.actorIdentifier)&&void 0!==n?n:t._actorIdentifier,t._processFollowupPayload(e),t._actorIdentifier=r}),n&&0!==n.length&&(t._incrementalPayloadsPending="loading_final"!==t._state,n.forEach(function(n){var r,i=t._actorIdentifier;t._actorIdentifier=null!==(r=n.actorIdentifier)&&void 0!==r?r:t._actorIdentifier,t._processIncrementalPlaceholder(e,n),t._actorIdentifier=i}),t._isClientPayload||"loading_final"===t._state)){var o=[];n.forEach(function(e){"defer"===e.kind&&o.push(t._processDeferResponse(e.label,e.path,e,{data:e.data,extensions:{is_final:!0}}))}),o.length>0&&t._processPayloadFollowups(o)}})},t._maybeCompleteSubscriptionOperationTracking=function(){(this._isSubscriptionOperation||this._useExecTimeResolvers&&this._execTimeResolverResponseComplete&&"loading_final"===this._state)&&0===this._pendingModulePayloadsCount&&!1===this._incrementalPayloadsPending&&this._completeOperationTracker()},t._processFollowupPayload=function(e){var t=this;switch(e.kind){case"ModuleImportPayload":var n=this._expectOperationLoader(),r=n.get(e.operationReference);if(null!=r)this._processFollowupPayloadWithNormalizationNode(e,oue(r));else{var i=this._nextSubscriptionId++;this._pendingModulePayloadsCount++;var o=function(){t._pendingModulePayloadsCount--,t._maybeCompleteSubscriptionOperationTracking()},s=rue.from(new Promise(function(t,r){n.load(e.operationReference).then(t,r)}));rue.create(function(n){var r,i=s.subscribe({next:function(i){if(null!=i){var o=function(){try{var r=oue(i),o=aue.BATCH_ASYNC_MODULE_UPDATES_FN,s=null!=o&&t._pendingModulePayloadsCount>1,a=cue(function(){if(t._handleFollowupPayload(e,r),s)t._scheduleAsyncStoreUpdate(o,n.complete);else{var i=t._runPublishQueue();t._updateOperationTracker(i)}}),l=(a[0],a[1]);t._log({name:"execute.async.module",executeId:t._executeId,operationName:r.name,duration:l}),s||n.complete()}catch(Ene){n.error(Ene)}},s=t._scheduler;null==s?o():r=s.schedule(o)}else n.complete()},error:n.error});return function(){i.unsubscribe(),null!=t._scheduler&&null!=r&&t._scheduler.cancel(r)}}).subscribe({complete:function(){t._complete(i),o()},error:function(e){t._error(e),o()},start:function(e){return t._start(i,e)}})}break;case"ActorPayload":this._processFollowupPayloadWithNormalizationNode(e,e.node);break;default:xue(!1)}},t._processFollowupPayloadWithNormalizationNode=function(e,t){this._handleFollowupPayload(e,t),this._maybeCompleteSubscriptionOperationTracking()},t._handleFollowupPayload=function(e,t){var n=this._normalizeFollowupPayload(e,t);this._getPublishQueueAndSaveActor().commitPayload(this._operation,n),this._processPayloadFollowups([n])},t._processIncrementalPlaceholder=function(e,t){var n,r=t.label,i=t.path.map(String).join("."),o=this._incrementalResults.get(r);null==o&&(o=new Map,this._incrementalResults.set(r,o));var s,a=o.get(i),l=null!=a&&"response"===a.kind?a.responses:null;o.set(i,{kind:"placeholder",placeholder:t}),"stream"===t.kind?s=t.parentID:"defer"===t.kind?s=t.selector.dataID:xue(!1);var c,u,d=e.source.get(s),f=(null!==(n=e.fieldPayloads)&&void 0!==n?n:[]).filter(function(e){var t=uue(e.dataID,e.fieldKey);return e.dataID===s||t===s});null==d&&xue(!1);var h=this._source.get(s);if(null!=h){c=hue.update(h.record,d);var p=new Map,g=function(e){var t=function(e){var t;return null!==(t=JSON.stringify(lue(e)))&&void 0!==t?t:""}(e);p.set(t,e)};h.fieldPayloads.forEach(g),f.forEach(g),u=Array.from(p.values())}else c=d,u=f;if(this._source.set(s,{record:c,fieldPayloads:u}),null!=l){var m=this._processIncrementalResponses(l);this._processPayloadFollowups(m)}},t._processIncrementalResponses=function(e){var t=this,n=[];return e.forEach(function(e){var r=e.label,i=e.path,o=e.response,s=t._incrementalResults.get(r);if(null==s&&(s=new Map,t._incrementalResults.set(r,s)),-1!==r.indexOf("$defer$")){var a=i.map(String).join("."),l=s.get(a);if(null==l)return l={kind:"response",responses:[e]},void s.set(a,l);if("response"===l.kind)return void l.responses.push(e);var c=l.placeholder;"defer"!==c.kind&&xue(!1),n.push(t._processDeferResponse(r,i,c,o))}else{var u=i.slice(0,-2).map(String).join("."),d=s.get(u);if(null==d)return d={kind:"response",responses:[e]},void s.set(u,d);if("response"===d.kind)return void d.responses.push(e);var f=d.placeholder;"stream"!==f.kind&&xue(!1),n.push(t._processStreamResponse(r,i,f,o))}}),n},t._processDeferResponse=function(e,t,n,r){var i,o=n.selector.dataID,s=this._actorIdentifier;this._actorIdentifier=null!==(i=n.actorIdentifier)&&void 0!==i?i:this._actorIdentifier;var a=this._normalizeResponse(r,n.selector,n.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:n.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers);this._getPublishQueueAndSaveActor().commitPayload(this._operation,a);var l=this._source.get(o);null==l&&xue(!1);var c=l.fieldPayloads;if(0!==c.length){var u,d={errors:null,fieldPayloads:c,incrementalPlaceholders:null,followupPayloads:null,source:mue.create(),isFinal:!0===(null===(u=r.extensions)||void 0===u?void 0:u.is_final)};this._getPublishQueueAndSaveActor().commitPayload(this._operation,d)}return this._actorIdentifier=s,a},t._processStreamResponse=function(e,t,n,r){var i=n.parentID,o=n.node,s=n.variables,a=n.actorIdentifier,l=this._actorIdentifier;this._actorIdentifier=null!=a?a:this._actorIdentifier;var c=o.selections[0];(null==c||"LinkedField"!==c.kind||!0!==c.plural)&&xue(!1);var u=this._normalizeStreamItem(r,i,c,s,t,n.path),d=u.fieldPayloads,f=u.itemID,h=u.itemIndex,p=u.prevIDs,g=u.relayPayload,m=u.storageKey;if(this._getPublishQueueAndSaveActor().commitPayload(this._operation,g,function(e){var t=e.get(i);if(null!=t){var n=t.getLinkedRecords(m);if(null!=n&&n.length===p.length&&!n.some(function(e,t){return p[t]!==(e&&e.getDataID())})){var r=(0,nue.default)(n);r[h]=e.get(f),t.setLinkedRecords(r,m)}}}),0!==d.length){var v={errors:null,fieldPayloads:d,incrementalPlaceholders:null,followupPayloads:null,source:mue.create(),isFinal:!1};this._getPublishQueueAndSaveActor().commitPayload(this._operation,v)}return this._actorIdentifier=l,g},t._normalizeStreamItem=function(e,t,n,r,i,o){var s,a,l,c,u=e.data;"object"!=typeof u&&xue(!1);var d=null!==(s=n.alias)&&void 0!==s?s:n.name,f=bue(n,r),h=this._source.get(t);null==h&&xue(!1);var p=h.record,g=h.fieldPayloads,m=hue.getLinkedRecordIDs(p,f);null==m&&xue(!1);var v=i[i.length-1],y=parseInt(v,10);y===v&&y>=0||xue(!1);var _=null!==(a=n.concreteType)&&void 0!==a?a:u[_ue];"string"!=typeof _&&xue(!1);var b=null!==(l=null!==(c=this._getDataID(u,_))&&void 0!==c?c:null==m?void 0:m[y])&&void 0!==l?l:uue(t,f,y);"string"!=typeof b&&xue(!1);var x=pue(n,b,r),S=hue.clone(p),w=(0,nue.default)(m);return w[y]=b,hue.setLinkedRecordIDs(S,f,w),this._source.set(t,{record:S,fieldPayloads:g}),{fieldPayloads:g,itemID:b,itemIndex:y,prevIDs:m,relayPayload:this._normalizeResponse(e,x,_,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[].concat((0,nue.default)(o),[d,String(y)]),treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers),storageKey:f}},t._scheduleAsyncStoreUpdate=function(e,t){var n=this;this._completeFns.push(t),null==this._asyncStoreUpdateDisposable&&(this._asyncStoreUpdateDisposable=e(function(){n._asyncStoreUpdateDisposable=null;var e=n._runPublishQueue();n._updateOperationTracker(e);var t,r=(0,tue.default)(n._completeFns);try{for(r.s();!(t=r.n()).done;){(0,t.value)()}}catch(i){r.e(i)}finally{r.f()}n._completeFns=[]}))},t._updateOperationTracker=function(e){null!=e&&e.length>0&&this._operationTracker.update(this._operation.request,new Set(e))},t._completeOperationTracker=function(){this._operationTracker.complete(this._operation.request)},t._getPublishQueueAndSaveActor=function(){return this._seenActors.add(this._actorIdentifier),this._getPublishQueue(this._actorIdentifier)},t._getActorsToVisit=function(){return 0===this._seenActors.size?new Set([this._actorIdentifier]):this._seenActors},t._runPublishQueue=function(e){var t,n=new Set,r=(0,tue.default)(this._getActorsToVisit());try{for(r.s();!(t=r.n()).done;){var i=t.value;this._getPublishQueue(i).run(e).forEach(function(e){return n.add(e)})}}catch(o){r.e(o)}finally{r.f()}return Array.from(n)},t._retainData=function(){var e,t=(0,tue.default)(this._getActorsToVisit());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._retainDisposables.has(n)||this._retainDisposables.set(n,this._getStore(n).retain(this._operation))}}catch(r){t.e(r)}finally{t.f()}},t._disposeRetainedData=function(){var e,t=(0,tue.default)(this._retainDisposables.values());try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}this._retainDisposables.clear()},t._expectOperationLoader=function(){var e=this._operationLoader;return e||xue(!1),e},e}();function wue(e){var t=e.incrementalPlaceholders;null!=t&&0!==t.length&&xue(!1)}var Eue={execute:function(e){return new Sue(e)}},kue=Promise.resolve();function Cue(e){setTimeout(function(){throw e},0)}var Aue=function(e){kue.then(e).catch(Cue)},Nue=wle,Tue=Ele.EXISTENT,Rue=gre,Due=function(){function e(e,t){this.__sources=[t,e],this._base=e,this._sink=t}var t=e.prototype;return t.unstable_getRawRecordWithChanges=function(e){var t=this._base.get(e),n=this._sink.get(e);return void 0===n?null==t?t:Nue.clone(t):null===n?null:null!=t?Nue.update(t,n):Nue.clone(n)},t._getSinkRecord=function(e){var t=this._sink.get(e);if(!t){var n=this._base.get(e);n||Rue(!1),t=Nue.create(e,Nue.getType(n)),this._sink.set(e,t)}return t},t.copyFields=function(e,t){var n=this._sink.get(e),r=this._base.get(e);n||r||Rue(!1);var i=this._getSinkRecord(t);r&&Nue.copyFields(r,i),n&&Nue.copyFields(n,i)},t.copyFieldsFromRecord=function(e,t){var n=this._getSinkRecord(t);Nue.copyFields(e,n)},t.create=function(e,t){(this._base.getStatus(e)===Tue||this._sink.getStatus(e)===Tue)&&Rue(!1);var n=Nue.create(e,t);this._sink.set(e,n)},t.delete=function(e){this._sink.delete(e)},t.getStatus=function(e){return this._sink.has(e)?this._sink.getStatus(e):this._base.getStatus(e)},t.getType=function(e){for(var t=0;t<this.__sources.length;t++){var n=this.__sources[t].get(e);if(n)return Nue.getType(n);if(null===n)return null}},t.getValue=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=Nue.getValue(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setValue=function(e,t,n){var r=this._getSinkRecord(e);Nue.setValue(r,t,n)},t.getErrors=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=Nue.getErrors(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setErrors=function(e,t,n){var r=this._getSinkRecord(e);Nue.setErrors(r,t,n)},t.getLinkedRecordID=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=Nue.getLinkedRecordID(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setLinkedRecordID=function(e,t,n){var r=this._getSinkRecord(e);Nue.setLinkedRecordID(r,t,n)},t.getLinkedRecordIDs=function(e,t){for(var n=0;n<this.__sources.length;n++){var r=this.__sources[n].get(e);if(r){var i=Nue.getLinkedRecordIDs(r,t);if(void 0!==i)return i}else if(null===r)return null}},t.setLinkedRecordIDs=function(e,t,n){var r=this._getSinkRecord(e);Nue.setLinkedRecordIDs(r,t,n)},e}(),Iue=Due,Fue=(0,Nre.default)(Gre),Oue=kie.getArgumentValues,Pue=["id","__id","__typename","js"];function Mue(e,t,n,r,i,o){var s,a,l=(0,Fue.default)(r);try{var c=function(){var r=a.value;switch(r.kind){case"LinkedField":r.plural?Object.defineProperty(e,null!==(u=r.alias)&&void 0!==u?u:r.name,{get:jue(r,n,t,i,o),set:Lue(r,n,t,i)}):Object.defineProperty(e,null!==(d=r.alias)&&void 0!==d?d:r.name,{get:Uue(r,n,t,i,o),set:zue(r,n,t,i)});break;case"ScalarField":var l=null!==(s=r.alias)&&void 0!==s?s:r.name;Object.defineProperty(e,l,{get:function(){var e,s=Oue(null!==(e=r.args)&&void 0!==e?e:[],n),a=t.getValue(r.name,s);return null==a&&(a=function(e,t,n,r,i){var o,s=(0,Fue.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("scalar"===a.kind){var l=a.handle(e,n,t,r);if(void 0!==l)return l}}}catch(c){s.e(c)}finally{s.f()}}(r,s,t,i,o)),a},set:Pue.includes(r.name)?void 0:function(e){var i,o=Oue(null!==(i=r.args)&&void 0!==i?i:[],n);t.setValue__UNSAFE(e,r.name,o)}});break;case"InlineFragment":t.getType()===r.type&&Mue(e,t,n,r.selections,i,o);break;case"ClientExtension":Mue(e,t,n,r.selections,i,o);break;case"FragmentSpread":break;case"Condition":case"ActorChange":case"InlineDataFragmentSpread":case"AliasedInlineFragmentSpread":case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":case"Defer":case"ModuleImport":case"RequiredField":case"CatchField":case"Stream":case"RelayResolver":case"RelayLiveResolver":throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");default:throw r.kind,new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.")}};for(l.s();!(a=l.n()).done;){var u,d;c()}}catch(f){l.e(f)}finally{l.f()}}function Lue(e,t,n,r){return function(i){var o,s=Oue(null!==(o=e.args)&&void 0!==o?o:[],t);if(null==i)throw new Error("Do not assign null to plural linked fields; assign an empty array instead.");var a=i.map(function(e){if(null==e)throw new Error("When assigning an array of items, none of the items should be null or undefined.");var t=e.__id;if(null==t)throw new Error("The __id field must be present on each item passed to the setter. This indicates a bug in Relay.");var n=r.get(t);if(null==n)throw new Error("Did not find item with data id ".concat(t," in the store."));return n});n.setLinkedRecords(a,e.name,s)}}function zue(e,t,n,r){return function(i){var o,s=Oue(null!==(o=e.args)&&void 0!==o?o:[],t);if(null==i)n.setValue(i,e.name,s);else{var a=i.__id;if(null==a)throw new Error("The __id field must be present on the argument. This indicates a bug in Relay.");var l=r.get(a);if(null==l)throw new Error("Did not find item with data id ".concat(a," in the store."));n.setLinkedRecord(l,e.name,s)}}}function jue(e,t,n,r,i){return function(){var o,s=Oue(null!==(o=e.args)&&void 0!==o?o:[],t),a=n.getLinkedRecords(e.name,s);return void 0===a&&(a=function(e,t,n,r,i){var o,s=(0,Fue.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("pluralLinked"===a.kind){var l=a.handle(e,n,t,r);if(null!=l)return l.map(function(e){if(null!=e)return r.get(e)})}}}catch(c){s.e(c)}finally{s.f()}}(e,s,n,r,i)),null!=a?a.map(function(n){if(null!=n){var o={};return Mue(o,n,t,e.selections,r,i),o}return n}):a}}function Uue(e,t,n,r,i){return function(){var o,s=Oue(null!==(o=e.args)&&void 0!==o?o:[],t),a=n.getLinkedRecord(e.name,s);if(void 0===a&&(a=function(e,t,n,r,i){var o,s=(0,Fue.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;if("linked"===a.kind){var l=a.handle(e,n,t,r);if(null!=l)return r.get(l)}}}catch(c){s.e(c)}finally{s.f()}}(e,s,n,r,i)),null!=a){var l={};return Mue(l,a,t,e.selections,r,i),l}return a}}var Bue={createUpdatableProxy:function(e,t,n,r,i){var o={};return Mue(o,e,t,n,r,i),o}},$ue=Cre.getFragment,que=Zie.getVariablesFromFragment,Gue=kie.ID_KEY,Vue=Bue.createUpdatableProxy,Kue=gre;var Wue={readUpdatableFragment:function(e,t,n,r){var i=$ue(e),o=que(i,t),s=t[Gue],a=n.get(s);return null==a&&Kue(!1),{updatableData:Vue(a,o,i.selections,n,r)}}},Hue=Cre.getUpdatableQuery,Jue=Bue.createUpdatableProxy;var Xue={readUpdatableQuery:function(e,t,n,r){var i=Hue(e);return{updatableData:Jue(n.getRoot(),t,i.fragment.selections,n,r)}}},Que=Zoe.generateClientID,Yue=kie.getStableStorageKey,Zue=gre,ede=function(){function e(e,t,n){this._dataID=n,this._mutator=t,this._source=e}var t=e.prototype;return t.copyFieldsFrom=function(e){this._mutator.copyFields(e.getDataID(),this._dataID)},t.getDataID=function(){return this._dataID},t.getType=function(){var e=this._mutator.getType(this._dataID);return null==e&&Zue(!1),e},t.getValue=function(e,t){var n=Yue(e,t);return this._mutator.getValue(this._dataID,n)},t.setValue=function(e,t,n,r){return tde(e)||Zue(!1),this.setValue__UNSAFE(e,t,n,r)},t.getErrors=function(e,t){var n=Yue(e,t);return this._mutator.getErrors(this._dataID,n)},t.setValue__UNSAFE=function(e,t,n,r){var i=Yue(t,n);return this._mutator.setValue(this._dataID,i,e),null!=r&&(0===r.length?this._mutator.setErrors(this._dataID,i):this._mutator.setErrors(this._dataID,i,r)),this},t.getLinkedRecord=function(e,t){var n=Yue(e,t),r=this._mutator.getLinkedRecordID(this._dataID,n);return null!=r?this._source.get(r):r},t.setLinkedRecord=function(t,n,r){t instanceof e||Zue(!1);var i=Yue(n,r),o=t.getDataID();return this._mutator.setLinkedRecordID(this._dataID,i,o),this},t.getOrCreateLinkedRecord=function(e,t,n){var r=this.getLinkedRecord(e,n);if(!r){var i,o=Yue(e,n),s=Que(this.getDataID(),o);r=null!==(i=this._source.get(s))&&void 0!==i?i:this._source.create(s,t),this.setLinkedRecord(r,e,n)}return r},t.getLinkedRecords=function(e,t){var n=this,r=Yue(e,t),i=this._mutator.getLinkedRecordIDs(this._dataID,r);return null==i?i:i.map(function(e){return null!=e?n._source.get(e):e})},t.setLinkedRecords=function(e,t,n){Array.isArray(e)||Zue(!1);var r=Yue(t,n),i=e.map(function(e){return e&&e.getDataID()});return this._mutator.setLinkedRecordIDs(this._dataID,r,i),this},t.invalidateRecord=function(){this._source.markIDForInvalidation(this._dataID)},e}();function tde(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every(tde)}var nde=ede,rde=wle,ide=Ele.EXISTENT,ode=Ele.NONEXISTENT,sde=kie,ade=sde.ROOT_ID,lde=sde.ROOT_TYPE,cde=Wue.readUpdatableFragment,ude=Xue.readUpdatableQuery,dde=nde,fde=gre,hde=function(){function e(e,t,n,r,i){this.__mutator=e,this._handlerProvider=n||null,this._proxies={},this._getDataID=t,this._invalidatedStore=!1,this._idsMarkedForInvalidation=new Set,this._missingFieldHandlers=r,this._log=null!=i?i:function(e){}}var t=e.prototype;return t.publishSource=function(e,t){var n=this;e.getRecordIDs().forEach(function(t){var r=e.getStatus(t);if(r===ide){var i=e.get(t);i&&(n.__mutator.getStatus(t)!==ide&&n.create(t,rde.getType(i)),n.__mutator.copyFieldsFromRecord(i,t))}else r===ode&&n.delete(t)}),t&&t.length&&t.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);t||fde(!1),t.update(n,e)})},t.create=function(e,t){this.__mutator.create(e,t),delete this._proxies[e];var n=this.get(e);return n||fde(!1),n},t.delete=function(e){e===ade&&fde(!1),delete this._proxies[e],this.__mutator.delete(e)},t.get=function(e){if(!this._proxies.hasOwnProperty(e)){var t=this.__mutator.getStatus(e);this._proxies[e]=t===ide?new dde(this,this.__mutator,e):t===ode?null:void 0}return this._proxies[e]},t.getRoot=function(){var e=this.get(ade);return e||(e=this.create(ade,lde)),e&&e.getType()===lde||fde(!1),e},t.invalidateStore=function(){this._invalidatedStore=!0},t.isStoreMarkedForInvalidation=function(){return this._invalidatedStore},t.markIDForInvalidation=function(e){this._idsMarkedForInvalidation.add(e)},t.getIDsMarkedForInvalidation=function(){return this._idsMarkedForInvalidation},t.readUpdatableQuery=function(e,t){return ude(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return cde(e,t,this,this._missingFieldHandlers)},e}(),pde=hde,gde=pre.LINKED_FIELD,mde=kie.getHandleStorageKey,vde=Fie,yde=gre;var _de=function(e,t,n){var r=t.find(function(t){return t.kind===gde&&t.name===e.name&&t.alias===e.alias&&vde(t.args,e.args)});r&&r.kind===gde||yde(!1);var i=mde(e,n);return{kind:"LinkedField",alias:r.alias,name:i,storageKey:i,args:null,concreteType:r.concreteType,plural:r.plural,selections:r.selections}},bde=pre.SCALAR_FIELD,xde=kie.getHandleStorageKey,Sde=Fie,wde=gre;var Ede=function(e,t,n){var r=t.find(function(t){return t.kind===bde&&t.name===e.name&&t.alias===e.alias&&Sde(t.args,e.args)});r&&r.kind===bde||wde(!1);var i=xde(e,n);return{kind:"ScalarField",alias:r.alias,name:i,storageKey:i,args:null}},kde=(0,Nre.default)(Gre),Cde=Iue,Ade=pde,Nde=Kce,Tde=Zoe.isClientID,Rde=_de,Dde=Ede,Ide=Tie.getLocalVariables,Fde=wle,Ode=Ele.EXISTENT,Pde=Ele.UNKNOWN,Mde=kie,Lde=Wle.TYPE_SCHEMA_TYPE,zde=Wle.generateTypeID,jde=gre,Ude=Mde.getModuleOperationKey,Bde=Mde.getStorageKey,$de=Mde.getArgumentValues;var qde=function(){function e(e,t,n,r,i,o,s,a,l,c){this._getSourceForActor=e,this._getTargetForActor=t,this._getDataID=s,this._source=e(n),this._mutatorRecordSourceProxyCache=new Map;var u=this._getMutatorAndRecordProxyForActor(n),d=u[0],f=u[1];this._useExecTimeResolvers=null!=c&&c,this._mostRecentlyInvalidatedAt=null,this._handlers=i,this._mutator=d,this._operationLoader=null!=o?o:null,this._recordSourceProxy=f,this._recordWasMissing=!1,this._variables=r,this._shouldProcessClientComponents=a,this._log=l}var t=e.prototype;return t._getMutatorAndRecordProxyForActor=function(e){var t=this._mutatorRecordSourceProxyCache.get(e);if(null==t){var n=this._getTargetForActor(e),r=new Cde(this._getSourceForActor(e),n);t=[r,new Ade(r,this._getDataID,void 0,this._handlers,this._log)],this._mutatorRecordSourceProxyCache.set(e,t)}return t},t.check=function(e,t){return this._assignClientAbstractTypes(e),this._traverse(e,t),!0===this._recordWasMissing?{status:"missing",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}:{status:"available",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||jde(!1),this._variables[e]},t._handleMissing=function(){this._recordWasMissing=!0},t._handleMissingScalarField=function(e,t){if("id"!==e.name||null!=e.alias||!Tde(t)){var n,r=null!=e.args?$de(e.args,this._variables):{},i=(0,kde.default)(this._handlers);try{for(i.s();!(n=i.n()).done;){var o=n.value;if("scalar"===o.kind){var s=o.handle(e,this._recordSourceProxy.get(t),r,this._recordSourceProxy);if(void 0!==s)return s}}}catch(a){i.e(a)}finally{i.f()}this._handleMissing()}},t._handleMissingLinkField=function(e,t){var n,r=null!=e.args?$de(e.args,this._variables):{},i=(0,kde.default)(this._handlers);try{for(i.s();!(n=i.n()).done;){var o=n.value;if("linked"===o.kind){var s=o.handle(e,this._recordSourceProxy.get(t),r,this._recordSourceProxy);if(void 0!==s&&(null===s||this._mutator.getStatus(s)===Ode))return s}}}catch(a){i.e(a)}finally{i.f()}this._handleMissing()},t._handleMissingPluralLinkField=function(e,t){var n,r=this,i=null!=e.args?$de(e.args,this._variables):{},o=(0,kde.default)(this._handlers);try{for(o.s();!(n=o.n()).done;){var s=n.value;if("pluralLinked"===s.kind){var a=s.handle(e,this._recordSourceProxy.get(t),i,this._recordSourceProxy);if(null!=a){if(a.every(function(e){return null!=e&&r._mutator.getStatus(e)===Ode}))return a}else if(null===a)return null}}}catch(l){o.e(l)}finally{o.f()}this._handleMissing()},t._traverse=function(e,t){var n=this._mutator.getStatus(t);if(n===Pde&&this._handleMissing(),n===Ode){var r=this._source.get(t),i=Fde.getInvalidationEpoch(r);null!=i&&(this._mostRecentlyInvalidatedAt=null!=this._mostRecentlyInvalidatedAt?Math.max(this._mostRecentlyInvalidatedAt,i):i),this._traverseSelections(e.selections,t)}},t._traverseSelections=function(e,t){var n=this;e.forEach(function(r){switch(r.kind){case"ScalarField":n._checkScalar(r,t);break;case"LinkedField":r.plural?n._checkPluralLink(r,t):n._checkLink(r,t);break;case"ActorChange":n._checkActorChange(r.linkedField,t);break;case"Condition":Boolean(n._getVariableValue(r.condition))===r.passingValue&&n._traverseSelections(r.selections,t);break;case"InlineFragment":var i=r.abstractKey;if(null==i){n._mutator.getType(t)===r.type&&n._traverseSelections(r.selections,t)}else{var o=n._mutator.getType(t);null==o&&jde(!1);var s=zde(o),a=n._mutator.getValue(s,i);!0===a?n._traverseSelections(r.selections,t):null==a&&n._handleMissing()}break;case"LinkedHandle":var l=Rde(r,e,n._variables);l.plural?n._checkPluralLink(l,t):n._checkLink(l,t);break;case"ScalarHandle":var c=Dde(r,e,n._variables);n._checkScalar(c,t);break;case"ModuleImport":n._checkModuleImport(r,t);break;case"Defer":case"Stream":n._traverseSelections(r.selections,t);break;case"FragmentSpread":var u=n._variables;n._variables=Ide(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=u;break;case"ClientExtension":var d=n._recordWasMissing;n._traverseSelections(r.selections,t),n._recordWasMissing=d;break;case"TypeDiscriminator":var f=r.abstractKey,h=n._mutator.getType(t);null==h&&jde(!1);var p=zde(h);null==n._mutator.getValue(p,f)&&n._handleMissing();break;case"ClientComponent":if(!1===n._shouldProcessClientComponents)break;n._traverseSelections(r.fragment.selections,t);break;case"RelayResolver":case"RelayLiveResolver":n._useExecTimeResolvers||n._checkResolver(r,t);break;case"ClientEdgeToClientObject":n._useExecTimeResolvers||n._checkResolver(r.backingField,t);break;default:jde(!1)}})},t._checkResolver=function(e,t){e.fragment&&this._traverseSelections([e.fragment],t)},t._checkModuleImport=function(e,t){var n=this._operationLoader;null===n&&jde(!1);var r=Ude(e.documentName),i=this._mutator.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=Nde(o),a=this._variables;this._variables=Ide(this._variables,s.argumentDefinitions,e.args),this._traverse(s,t),this._variables=a}else this._handleMissing()}else void 0===i&&this._handleMissing()},t._checkScalar=function(e,t){var n=Bde(e,this._variables),r=this._mutator.getValue(t,n);void 0===r&&void 0!==(r=this._handleMissingScalarField(e,t))&&this._mutator.setValue(t,n,r)},t._checkLink=function(e,t){var n=Bde(e,this._variables),r=this._mutator.getLinkedRecordID(t,n);void 0===r&&(null!=(r=this._handleMissingLinkField(e,t))?this._mutator.setLinkedRecordID(t,n,r):null===r&&this._mutator.setValue(t,n,null)),null!=r&&this._traverse(e,r)},t._checkPluralLink=function(e,t){var n=this,r=Bde(e,this._variables),i=this._mutator.getLinkedRecordIDs(t,r);void 0===i&&(null!=(i=this._handleMissingPluralLinkField(e,t))?this._mutator.setLinkedRecordIDs(t,r,i):null===i&&this._mutator.setValue(t,r,null)),i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},t._checkActorChange=function(e,t){var n=Bde(e,this._variables),r=this._source.get(t),i=null!=r?Fde.getActorLinkedRecordID(r,n):r;if(null==i)void 0===i&&this._handleMissing();else{var o=i[0],s=i[1],a=this._source,l=this._mutator,c=this._recordSourceProxy,u=this._getMutatorAndRecordProxyForActor(o),d=u[0],f=u[1];this._source=this._getSourceForActor(o),this._mutator=d,this._recordSourceProxy=f,this._assignClientAbstractTypes(e),this._traverse(e,s),this._source=a,this._mutator=l,this._recordSourceProxy=c}},t._assignClientAbstractTypes=function(e){var t=e.clientAbstractTypes;if(null!=t)for(var n=0,r=Object.keys(t);n<r.length;n++){var i,o=r[n],s=(0,kde.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=zde(a);null==this._source.get(l)&&this._mutator.create(l,Lde),null==this._mutator.getValue(l,o)&&this._mutator.setValue(l,o,!0)}}catch(c){s.e(c)}finally{s.f()}}},e}(),Gde={check:function(e,t,n,r,i,o,s,a,l,c){null!=l&&l({name:"store.datachecker.start",selector:r});var u=r.dataID,d=r.node,f=r.variables,h=new qde(e,t,n,f,i,o,s,a,l,c).check(d,u);return null!=l&&l({name:"store.datachecker.end",selector:r}),h}},Vde=wle,Kde=kie.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,Wde=gre;var Hde=function(e){var t=Vde.getValue(e,Kde);return null==t?null:(t instanceof Set||Wde(!1),t)};var Jde=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.read&&"function"==typeof e.subscribe},Xde=(0,Nre.default)(Gre),Qde=xae,Yde=pre.RELAY_LIVE_RESOLVER,Zde=cie,efe=function(e){"object"!=typeof e||null==e||!Array.isArray(e)&&e.constructor!==Object||Object.freeze(e)},tfe=Zoe.generateClientID,nfe=Zoe.generateClientObjectClientID,rfe=wle,ife=Zie.createNormalizationSelector,ofe=Dle,sfe=bce.normalize,afe=kie,lfe=afe.RELAY_RESOLVER_ERROR_KEY,cfe=afe.RELAY_RESOLVER_INVALIDATION_KEY,ufe=afe.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,dfe=afe.RELAY_RESOLVER_SNAPSHOT_KEY,ffe=afe.RELAY_RESOLVER_VALUE_KEY,hfe=afe.getReadTimeResolverStorageKey,pfe=afe.getStorageKey,gfe=Hde,mfe=Jde,vfe=Qae.isSuspenseSentinel,yfe=gre,_fe="__resolverLiveStateSubscription",bfe="__resolverLiveStateValue",xfe="__resolverLiveStateDirty",Sfe="__RELAY_RESOLVER__";function wfe(e,t,n){var r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}var Efe=function(){function e(e,t){this._resolverIDToRecordIDs=new Map,this._recordIDToResolverIDs=new Map,this._getRecordSource=e,this._store=t,this._handlingBatch=!1,this._liveResolverBatchRecordSource=null}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){var o,s=this._getRecordSource(),a=Rfe(s,e),l=hfe(t,n),c=rfe.getLinkedRecordID(a,l),u=null==c?null:s.get(c);if(null==u||this._isInvalid(u,i)){var d;null!=u&&Tfe(u),c=null!==(d=c)&&void 0!==d?d:tfe(e,l),u=rfe.create(c,Sfe);var f=r();if(rfe.setValue(u,dfe,f.snapshot),rfe.setValue(u,lfe,f.error),t.kind===Yde){if(null!=f.resolverResult){null!=f.error&&yfe(!1);var h=f.resolverResult;o=this._setLiveStateValue(u,c,h,t,n)}}else o=this._setResolverValue(u,f.resolverResult,t,n);s.set(c,u);var p=Rfe(s,e),g=rfe.clone(p);if(rfe.setLinkedRecordID(g,l,c),s.set(e,g),null!=t.fragment){var m,v=pfe(t.fragment,n),y=tfe(e,v);wfe(this._resolverIDToRecordIDs,y,c),wfe(this._recordIDToResolverIDs,e,y);var _=null===(m=f.snapshot)||void 0===m?void 0:m.seenRecords;if(null!=_){var b,x=(0,Xde.default)(_);try{for(x.s();!(b=x.n()).done;){var S=b.value;wfe(this._recordIDToResolverIDs,S,y)}}catch(R){x.e(R)}finally{x.f()}}}}else if(t.kind===Yde&&rfe.getValue(u,xfe)){var w;c=null!==(w=c)&&void 0!==w?w:tfe(e,l),u=rfe.clone(u);var E=rfe.getValue(u,bfe);mfe(E)||yfe(!1),o=this._setLiveResolverValue(u,E,t,n),rfe.setValue(u,xfe,!1),s.set(c,u)}var k,C=this._getResolverValue(u),A=rfe.getValue(u,dfe),N=rfe.getValue(u,lfe),T=null;vfe(C)&&(T=null!==(k=c)&&void 0!==k?k:tfe(e,l));return[C,c,N,A,T,o]},t.getLiveResolverPromise=function(e){var t=this._getRecordSource().get(e);null==t&&yfe(!1);var n=rfe.getValue(t,bfe);return new Promise(function(e){var t=n.subscribe(function(){t(),e()})})},t._setLiveStateValue=function(e,t,n,r,i){var o=this._makeLiveStateHandler(t),s=n.subscribe(o);rfe.setValue(e,bfe,n);var a=this._setLiveResolverValue(e,n,r,i);return rfe.setValue(e,xfe,!1),rfe.setValue(e,_fe,s),a},t._makeLiveStateHandler=function(e){var t=this;return function(){var n=t._getRecordSource().get(e);if(n&&rfe.hasValue(n,bfe)){var r=rfe.clone(n);rfe.setValue(r,xfe,!0),t._setLiveResolverUpdate(e,r)}}},t._setLiveResolverUpdate=function(e,t){if(this._handlingBatch)null==this._liveResolverBatchRecordSource&&(this._liveResolverBatchRecordSource=ofe.create()),this._liveResolverBatchRecordSource.set(e,t);else{var n=ofe.create();n.set(e,t),this._store.publish(n),this._store.notify()}},t.batchLiveStateUpdates=function(e){this._handlingBatch&&yfe(!1),this._handlingBatch=!0;try{e()}finally{null!=this._liveResolverBatchRecordSource&&(this._store.publish(this._liveResolverBatchRecordSource),this._store.notify()),this._liveResolverBatchRecordSource=null,this._handlingBatch=!1}},t._setLiveResolverValue=function(e,t,n,r){var i=null,o=null;try{i=t.read()}catch(pU){o=pU}return rfe.setValue(e,lfe,o),this._setResolverValue(e,i,n,r)},t._setResolverValue=function(e,t,n,r){var i=n.normalizationInfo,o=null;if(null==t||null==i||vfe(t))efe(t),rfe.setValue(e,ffe,t);else{var s,a=gfe(e),l=new Set,c=this._getRecordSource();if(i.plural){Array.isArray(t)||yfe(!1),s=[];for(var u=ofe.create(),d=0;d<t.length;d++){var f=t[d];if(null!=f){"object"!=typeof f&&yfe(!1);var h,p=Dfe(i,f),g=nfe(p,rfe.getDataID(e),d),m=this._normalizeOutputTypeValue(g,f,r,i,[n.path,String(d)],p),v=(0,Xde.default)(m.getRecordIDs());try{for(v.s();!(h=v.n()).done;){var y=h.value;u.set(y,Rfe(m,y)),l.add(y)}}catch(k){v.e(k)}finally{v.f()}s.push(g)}}o=kfe(c,u,a)}else{"object"!=typeof t&&yfe(!1);var _,b=Dfe(i,t),x=nfe(b,rfe.getDataID(e)),S=this._normalizeOutputTypeValue(x,t,r,i,[n.path],b),w=(0,Xde.default)(S.getRecordIDs());try{for(w.s();!(_=w.n()).done;){var E=_.value;l.add(E)}}catch(k){w.e(k)}finally{w.f()}s=x,o=kfe(c,S,a)}rfe.setValue(e,ufe,l),efe(s),rfe.setValue(e,ffe,s)}return o},t.notifyUpdatedSubscribers=function(e){this._store.__notifyUpdatedSubscribers(e)},t._getResolverValue=function(e){return rfe.getValue(e,ffe)},t.invalidateDataIDs=function(e){for(var t=this._getRecordSource(),n=new Set,r=Array.from(e);r.length;){var i=r.pop();n.add(i),e.add(i);var o=this._recordIDToResolverIDs.get(i);if(null!=o){var s,a=(0,Xde.default)(o);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(!n.has(l)){n.add(l);var c=this._resolverIDToRecordIDs.get(l);if(null==c)continue;var u,d=(0,Xde.default)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;Cfe(f,t),n.has(f)||(n.add(f),r.push(f))}}catch(h){d.e(h)}finally{d.f()}}}}catch(h){a.e(h)}finally{a.f()}}}},t._isInvalid=function(e,t){if(!rfe.getValue(e,cfe))return!1;var n=rfe.getValue(e,dfe),r=null==n?void 0:n.data,i=null==n?void 0:n.selector;if(null==r||null==i)return!0;var o=t(i).data;if(Qde(r,o)!==r)return!0;if(Zde.MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD){var s=rfe.clone(e);rfe.setValue(s,cfe,!1),this._getRecordSource().set(rfe.getDataID(e),s)}return!1},t._normalizeOutputTypeValue=function(e,t,n,r,i,o){var s=ofe.create();switch(r.kind){case"OutputType":var a=rfe.create(e,o);s.set(e,a);var l=ife(r.normalizationNode,e,n),c=this._store.__getNormalizationOptions(i);return sfe(s,l,t,c,void 0,!1).source;case"WeakModel":var u=rfe.create(e,o);return rfe.setValue(u,"__relay_model_instance",t),s.set(e,u),s;default:r.kind,yfe(!1)}},t.ensureClientRecord=function(e,t){var n=nfe(t,e),r=this._getRecordSource();if(!r.has(n)){var i=rfe.create(n,t);rfe.setValue(i,"id",e),r.set(n,i)}return n},t.unsubscribeFromLiveResolverRecords=function(e){return function(e,t){if(0===t.size)return;var n,r=(0,Xde.default)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e.get(i);null!=o&&Nfe(o)&&Tfe(o)}}catch(s){r.e(s)}finally{r.f()}}(this._getRecordSource(),e)},t.invalidateResolverRecords=function(e){if(0!==e.size){var t,n=(0,Xde.default)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this._getRecordSource().get(r);null!=i&&Nfe(i)&&this._getRecordSource().delete(r)}}catch(o){n.e(o)}finally{n.f()}}},e}();function kfe(e,t,n){var r=new Set;if(null!=n){var i,o=(0,Xde.default)(n);try{for(o.s();!(i=o.n()).done;){var s=i.value;t.has(s)||(r.add(s),e.remove(s))}}catch(h){o.e(h)}finally{o.f()}}var a,l=(0,Xde.default)(t.getRecordIDs());try{for(l.s();!(a=l.n()).done;){var c=a.value,u=Rfe(t,c);if(e.has(c)){var d=Rfe(e,c),f=rfe.update(d,u);f!==d&&(r.add(c),e.set(c,f),Afe(d,e))}else e.set(c,u)}}catch(h){l.e(h)}finally{l.f()}return r}function Cfe(e,t){var n=t.get(e);if(n){var r=rfe.clone(n);rfe.setValue(r,cfe,!0),t.set(e,r)}}function Afe(e,t){var n,r=function(e){var t=new Set;return rfe.getFields(e).forEach(function(n){if(rfe.hasLinkedRecordID(e,n)){var r=rfe.getLinkedRecordID(e,n);null!=r&&t.add(r)}else if(rfe.hasLinkedRecordIDs(e,n)){var i;null===(i=rfe.getLinkedRecordIDs(e,n))||void 0===i||i.forEach(function(e){null!=e&&t.add(e)})}}),t}(e),i=(0,Xde.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=t.get(o);null!=s&&Nfe(s)&&Cfe(o,t)}}catch(a){i.e(a)}finally{i.f()}}function Nfe(e){return rfe.getType(e)===Sfe}function Tfe(e){var t=rfe.getValue(e,_fe);null!=t&&t()}function Rfe(e,t){var n=e.get(t);return null==n&&yfe(!1),n}function Dfe(e,t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;return null==r&&yfe(!1),r}var Ife={LiveResolverCache:Efe,getUpdatedDataIDs:function(e){return e},RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY:_fe},Ffe=(0,Nre.default)(zre),Ofe=wle,Pfe=Dle,Mfe=gre,Lfe=Ofe.fromObject(Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0})),zfe=function(){function e(e){this._base=e,this._sink=Pfe.create()}var t=e.prototype;return t.has=function(e){return this._sink.has(e)?this._sink.get(e)!==Lfe:this._base.has(e)},t.get=function(e){if(this._sink.has(e)){var t=this._sink.get(e);return t===Lfe?void 0:t}return this._base.get(e)},t.getStatus=function(e){var t=this.get(e);return void 0===t?"UNKNOWN":null===t?"NONEXISTENT":"EXISTENT"},t.clear=function(){this._base=Pfe.create(),this._sink.clear()},t.delete=function(e){this._sink.delete(e)},t.remove=function(e){this._sink.set(e,Lfe)},t.set=function(e,t){this._sink.set(e,t)},t.getRecordIDs=function(){return Object.keys(this.toJSON())},t.size=function(){return Object.keys(this.toJSON()).length},t.toJSON=function(){var e=this,t=(0,Ffe.default)({},this._base.toJSON());return this._sink.getRecordIDs().forEach(function(n){var r=e.get(n);void 0===r?delete t[n]:t[n]=Ofe.toJSON(r)}),t},t.getOptimisticRecordIDs=function(){return new Set(this._sink.getRecordIDs())},e}();var jfe={create:function(e){return new zfe(e)},getOptimisticRecordIDs:function(e){return e instanceof zfe||Mfe(!1),e.getOptimisticRecordIDs()}},Ufe=pre.RELAY_LIVE_RESOLVER,Bfe=gre,$fe=function(){function e(){}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){t.kind===Ufe&&Bfe(!1);var o=r(),s=o.resolverResult,a=o.snapshot;return[s,void 0,o.error,a,void 0,void 0]},t.invalidateDataIDs=function(e){},t.ensureClientRecord=function(e,t){Bfe(!1)},t.notifyUpdatedSubscribers=function(e){},e}(),qfe={NoopResolverCache:$fe},Gfe=Nre.default,Vfe=Gfe(zre),Kfe=Gfe(Lre),Wfe=Gfe(Zae),Hfe=Gfe(iie),Jfe=["message"],Xfe=cie,Qfe=Qae.isSuspenseSentinel,Yfe=Tie,Zfe=wle,ehe=kie,the=ehe.CLIENT_EDGE_TRAVERSAL_PATH,nhe=ehe.FRAGMENT_OWNER_KEY,rhe=ehe.FRAGMENT_PROP_NAME_KEY,ihe=ehe.FRAGMENTS_KEY,ohe=ehe.ID_KEY,she=ehe.MODULE_COMPONENT_KEY,ahe=ehe.ROOT_ID,lhe=ehe.getArgumentValues,che=ehe.getModuleComponentKey,uhe=ehe.getStorageKey,dhe=qfe.NoopResolverCache,fhe=soe.RESOLVER_FRAGMENT_ERRORED_SENTINEL,hhe=soe.withResolverContext,phe=Wle.generateTypeID,ghe=gre;function mhe(e,t,n,r){return new vhe(e,t,null!=n?n:new dhe,r).read()}var vhe=function(){function e(e,t,n,r){var i,o,s,a;this._clientEdgeTraversalPath=null!==(i=t.clientEdgeTraversalPath)&&void 0!==i&&i.length?(0,Hfe.default)(t.clientEdgeTraversalPath):[],this._missingClientEdges=[],this._missingLiveResolverFields=[],this._isMissingData=!1,this._isWithinUnmatchedTypeRefinement=!1,this._fieldErrors=null,this._owner=t.owner,this._useExecTimeResolvers=null!==(o=null!==(s=this._owner.node.operation.use_exec_time_resolvers)&&void 0!==s?s:!0===(null===(a=this._owner.node.operation.exec_time_resolvers_enabled_provider)||void 0===a?void 0:a.get()))&&void 0!==o&&o,this._recordSource=e,this._seenRecords=new Set,this._selector=t,this._variables=t.variables,this._resolverCache=n,this._fragmentName=t.node.name,this._updatedDataIDs=new Set,this._resolverContext=r}var t=e.prototype;return t.read=function(){var e,t=this._selector,n=t.node,r=t.dataID,i=t.isWithinUnmatchedTypeRefinement,o=n.abstractKey,s=this._recordSource.get(r),a=!i;(a&&null==o&&null!=s&&(this._recordMatchesTypeCondition(s,n.type)||(a=!1)),a&&null!=o&&null!=s)&&(!1===this._implementsInterface(s,o)&&(a=!1));this._isWithinUnmatchedTypeRefinement=!a;var l=this._traverse(n,r,null),c=null===(e=this._selector.node.metadata)||void 0===e?void 0:e.catchTo;return null!=c&&(l=this._catchErrors(l,c,null)),this._updatedDataIDs.size>0&&(this._resolverCache.notifyUpdatedSubscribers(this._updatedDataIDs),this._updatedDataIDs.clear()),{data:l,isMissingData:this._isMissingData&&a,missingClientEdges:this._missingClientEdges.length?this._missingClientEdges:null,missingLiveResolverFields:this._missingLiveResolverFields,seenRecords:this._seenRecords,selector:this._selector,fieldErrors:this._fieldErrors}},t._maybeAddFieldErrors=function(e,t){var n=Zfe.getErrors(e,t);if(null!=n){var r=this._fragmentName;null==this._fieldErrors&&(this._fieldErrors=[]);for(var i=0;i<n.length;i++){var o,s,a,l=n[i];this._fieldErrors.push({kind:"relay_field_payload.error",owner:r,fieldPath:(null!==(o=l.path)&&void 0!==o?o:[]).join("."),error:l,shouldThrow:null!==(s=null===(a=this._selector.node.metadata)||void 0===a?void 0:a.throwOnFieldError)&&void 0!==s&&s,handled:!1,uiContext:void 0})}}},t._markDataAsMissing=function(e){var t,n;if(!this._isWithinUnmatchedTypeRefinement){null==this._fieldErrors&&(this._fieldErrors=[]);var r=this._fragmentName;if(this._fieldErrors.push(null!==(t=null===(n=this._selector.node.metadata)||void 0===n?void 0:n.throwOnFieldError)&&void 0!==t&&t?{kind:"missing_expected_data.throw",owner:r,fieldPath:e,handled:!1,uiContext:void 0}:{kind:"missing_expected_data.log",owner:r,fieldPath:e,uiContext:void 0}),this._isMissingData=!0,this._clientEdgeTraversalPath.length){var i=this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1];null!==i&&this._missingClientEdges.push({request:i.readerClientEdge.operation,clientEdgeDestinationID:i.clientEdgeDestinationID})}}},t._traverse=function(e,t,n){var r=this._recordSource.get(t);if(this._seenRecords.add(t),null==r)return void 0===r&&this._markDataAsMissing("<record>"),r;var i=n||{};return this._traverseSelections(e.selections,r,i)?i:null},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||ghe(!1),this._variables[e]},t._maybeReportUnexpectedNull=function(e){if("NONE"!==e.action){var t,n,r,i=this._fragmentName;if(null==this._fieldErrors&&(this._fieldErrors=[]),null!=e.field.linkedField)t=null!==(n=e.field.linkedField.alias)&&void 0!==n?n:e.field.linkedField.name;else t=null!==(r=e.field.alias)&&void 0!==r?r:e.field.name;switch(e.action){case"THROW":return void this._fieldErrors.push({kind:"missing_required_field.throw",fieldPath:t,owner:i,handled:!1,uiContext:void 0});case"LOG":return void this._fieldErrors.push({kind:"missing_required_field.log",fieldPath:t,owner:i,uiContext:void 0});default:e.action}}},t._handleRequiredFieldValue=function(e,t){return null!=t||(this._maybeReportUnexpectedNull(e),!1)},t._catchErrors=function(e,t,n){var r=e;switch(t){case"RESULT":r=this._asResult(e);break;case"NULL":null!=this._fieldErrors&&this._fieldErrors.length>0&&(r=null)}var i=this._fieldErrors;if(this._fieldErrors=n,null!=i){null==this._fieldErrors&&(this._fieldErrors=[]);for(var o=0;o<i.length;o++)this._fieldErrors.push(yhe(i[o]))}return r},t._asResult=function(e){if(null==this._fieldErrors||0===this._fieldErrors.length)return{ok:!0,value:e};var t=this._fieldErrors.map(function(e){switch(e.kind){case"relay_field_payload.error":var t=e.error;return t.message,(0,Wfe.default)(t,Jfe);case"missing_expected_data.throw":case"missing_expected_data.log":return{path:e.fieldPath.split(".")};case"relay_resolver.error":return{message:"Relay: Error in resolver for field at ".concat(e.fieldPath," in ").concat(e.owner)};case"missing_required_field.throw":return{message:"Relay: Missing @required value at path '".concat(e.fieldPath,"' in '").concat(e.owner,"'.")};case"missing_required_field.log":return null;default:e.kind,ghe(!1)}}).filter(Boolean);return{ok:!1,errors:t}},t._traverseSelections=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];switch(i.kind){case"RequiredField":var o=this._readClientSideDirectiveField(i,t,n);if(!this._handleRequiredFieldValue(i,o))return!1;break;case"CatchField":var s,a,l,c=this._fieldErrors;this._fieldErrors=null;var u=this._readClientSideDirectiveField(i,t,n),d=null!==(s=null===(a=i.field)||void 0===a?void 0:a.backingField)&&void 0!==s?s:i.field,f=null!==(l=null==d?void 0:d.alias)&&void 0!==l?l:null==d?void 0:d.name;null==f&&ghe(!1),n[f]=this._catchErrors(u,i.to,c);break;case"ScalarField":this._readScalar(i,t,n);break;case"LinkedField":i.plural?this._readPluralLink(i,t,n):this._readLink(i,t,n);break;case"Condition":if(Boolean(this._getVariableValue(i.condition))===i.passingValue)if(!this._traverseSelections(i.selections,t,n))return!1;break;case"InlineFragment":if(!1===this._readInlineFragment(i,t,n,!1))return!1;break;case"RelayLiveResolver":case"RelayResolver":this._useExecTimeResolvers?this._readScalar(i,t,n):this._readResolverField(i,t,n);break;case"FragmentSpread":this._createFragmentPointer(i,t,n);break;case"AliasedInlineFragmentSpread":this._readAliasedInlineFragment(i,t,n);break;case"ModuleImport":this._readModuleImport(i,t,n);break;case"InlineDataFragmentSpread":this._createInlineDataOrResolverFragmentPointer(i,t,n);break;case"Defer":case"ClientExtension":var h=this._isMissingData,p=this._missingClientEdges.length;this._clientEdgeTraversalPath.push(null);var g=this._traverseSelections(i.selections,t,n);if(this._isMissingData=h||this._missingClientEdges.length>p||this._missingLiveResolverFields.length>0,this._clientEdgeTraversalPath.pop(),!g)return!1;break;case"Stream":if(!this._traverseSelections(i.selections,t,n))return!1;break;case"ActorChange":this._readActorChange(i,t,n);break;case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(!this._useExecTimeResolvers||"RelayResolver"!==i.backingField.kind&&"RelayLiveResolver"!==i.backingField.kind)this._readClientEdge(i,t,n);else{var m=i.linkedField;m.plural?this._readPluralLink(m,t,n):this._readLink(m,t,n)}break;default:ghe(!1)}}return!0},t._readClientSideDirectiveField=function(e,t,n){switch(e.field.kind){case"ScalarField":return this._readScalar(e.field,t,n);case"LinkedField":return e.field.plural?this._readPluralLink(e.field,t,n):this._readLink(e.field,t,n);case"RelayResolver":case"RelayLiveResolver":return this._useExecTimeResolvers?this._readScalar(e.field,t,n):this._readResolverField(e.field,t,n);case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(!this._useExecTimeResolvers||"RelayResolver"!==e.field.backingField.kind&&"RelayLiveResolver"!==e.field.backingField.kind)return this._readClientEdge(e.field,t,n);var r=e.field;return r.linkedField.plural?this._readPluralLink(r.linkedField,t,n):this._readLink(r.linkedField,t,n);case"AliasedInlineFragmentSpread":return this._readAliasedInlineFragment(e.field,t,n);default:e.field.kind,ghe(!1)}},t._readResolverField=function(e,t,n){var r,i=Zfe.getDataID(t),o=this._fieldErrors;this._fieldErrors=null;var s=this._readResolverFieldImpl(e,i),a=null!==(r=e.alias)&&void 0!==r?r:e.name;return this._prependPreviousErrors(o,a),n[a]=s,s},t._readResolverFieldImpl=function(e,t){var n,r=this,i=e.fragment,o=function(e){return null!=n?{data:n.data,isMissingData:n.isMissingData,fieldErrors:n.fieldErrors}:{data:(n=mhe(r._recordSource,e,r._resolverCache)).data,isMissingData:n.isMissingData,fieldErrors:n.fieldErrors}},s=this._resolverCache.readFromCacheOrEvaluate(t,e,this._variables,function(){if(null!=i){var s={__id:t,__fragmentOwner:r._owner,__fragments:(0,Kfe.default)({},i.name,i.args?lhe(i.args,r._variables):{})};return r._clientEdgeTraversalPath.length>0&&null!==r._clientEdgeTraversalPath[r._clientEdgeTraversalPath.length-1]&&(s[the]=(0,Hfe.default)(r._clientEdgeTraversalPath)),hhe({getDataForResolverFragment:o},function(){var t=_he(e,r._variables,s,r._resolverContext),i=t[0],o=t[1];return{resolverResult:i,snapshot:n,error:o}})}var a=_he(e,r._variables,null,r._resolverContext);return{resolverResult:a[0],snapshot:void 0,error:a[1]}},o),a=s[0],l=s[1],c=s[2],u=s[3],d=s[4],f=s[5];return this._propagateResolverMetadata(e.path,u,c,l,d,f),a},t._propagateResolverMetadata=function(e,t,n,r,i,o){var s=this;if(null!=t){if(null!=t.missingClientEdges)for(var a=0;a<t.missingClientEdges.length;a++){var l=t.missingClientEdges[a];this._missingClientEdges.push(l)}if(null!=t.missingLiveResolverFields){this._isMissingData=this._isMissingData||t.missingLiveResolverFields.length>0;for(var c=0;c<t.missingLiveResolverFields.length;c++){var u=t.missingLiveResolverFields[c];this._missingLiveResolverFields.push(u)}}if(null!=t.fieldErrors){null==this._fieldErrors&&(this._fieldErrors=[]);for(var d=0;d<t.fieldErrors.length;d++){var f,h=t.fieldErrors[d];!0===(null===(f=this._selector.node.metadata)||void 0===f?void 0:f.throwOnFieldError)?this._fieldErrors.push(h):this._fieldErrors.push(yhe(h))}}this._isMissingData=this._isMissingData||t.isMissingData}if(n){var p,g,m={kind:"relay_resolver.error",fieldPath:e,owner:this._fragmentName,error:n,shouldThrow:null!==(p=null===(g=this._selector.node.metadata)||void 0===g?void 0:g.throwOnFieldError)&&void 0!==p&&p,handled:!1,uiContext:void 0};null==this._fieldErrors?this._fieldErrors=[m]:this._fieldErrors.push(m)}null!=r&&this._seenRecords.add(r),null!=i&&(this._isMissingData=!0,this._missingLiveResolverFields.push(i)),null!=o&&o.forEach(function(e){s._updatedDataIDs.add(e)})},t._readClientEdge=function(e,t,n){var r,i=this,o=e.backingField;"ClientExtension"===o.kind&&ghe(!1);var s=null!==(r=o.alias)&&void 0!==r?r:o.name,a={};this._traverseSelections([o],t,a);var l=a[s];if(null==l||Qfe(l))return n[s]=l,l;if(e.linkedField.plural){var c;Array.isArray(l)||ghe(!1),"ClientEdgeToClientObject"!==e.kind&&ghe(!1),c=null==e.backingField.normalizationInfo?l.map(function(t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;"string"!=typeof r&&ghe(!1);var s=bhe(t,o.path,i._owner.identifier),a=i._resolverCache.ensureClientRecord(s,r),l=e.modelResolvers;if(null!=l){var c=l[r];return void 0===c&&ghe(!1),null!=i._readResolverFieldImpl(c,a)?a:null}return a}):l.map(function(e){return bhe(e,o.path,i._owner.identifier)}),this._clientEdgeTraversalPath.push(null);var u=this._readLinkedIds(e.linkedField,c,t,n);return this._clientEdgeTraversalPath.pop(),n[s]=u,u}var d,f,h,p=bhe(l,o.path,this._owner.identifier),g=null!==(d=e.concreteType)&&void 0!==d?d:l.__typename;"ClientEdgeToClientObject"===e.kind?null==e.backingField.normalizationInfo?("string"!=typeof g&&ghe(!1),f=this._resolverCache.ensureClientRecord(p,g),h=null):(f=p,h=null):(f=p,h={readerClientEdge:e,clientEdgeDestinationID:p});var m=e.modelResolvers;if(null!=m){"string"!=typeof g&&ghe(!1);var v=m[g];if(void 0===v&&ghe(!1),null==this._readResolverFieldImpl(v,f))return n[s]=null,null}this._clientEdgeTraversalPath.push(h);var y=n[s];null!=y&&"object"!=typeof y&&ghe(!1);var _=this._fieldErrors;this._fieldErrors=null;var b=this._traverse(e.linkedField,f,y);return this._prependPreviousErrors(_,s),this._clientEdgeTraversalPath.pop(),n[s]=b,b},t._readScalar=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=uhe(e,this._variables),s=Zfe.getValue(t,o);return null===s||Xfe.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(s)&&0===s.length?this._maybeAddFieldErrors(t,o):void 0===s&&this._markDataAsMissing(i),n[i]=s,s},t._readLink=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=uhe(e,this._variables),s=Zfe.getLinkedRecordID(t,o);if(null==s)return n[i]=s,null===s?this._maybeAddFieldErrors(t,o):void 0===s&&this._markDataAsMissing(i),s;var a=n[i];null!=a&&"object"!=typeof a&&ghe(!1);var l=this._fieldErrors;this._fieldErrors=null;var c=this._traverse(e,s,a);return this._prependPreviousErrors(l,i),n[i]=c,c},t._prependPreviousErrors=function(e,t){if(null!=this._fieldErrors){for(var n=0;n<this._fieldErrors.length;n++){var r=this._fieldErrors[n];r.owner!==this._fragmentName||"missing_expected_data.throw"!==r.kind&&"missing_expected_data.log"!==r.kind&&"missing_required_field.throw"!==r.kind&&"missing_required_field.log"!==r.kind||(r.fieldPath="".concat(t,".").concat(r.fieldPath))}if(null!=e){for(var i=this._fieldErrors.length-1;i>=0;i--)e.push(this._fieldErrors[i]);this._fieldErrors=e}}else this._fieldErrors=e},t._readActorChange=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=uhe(e,this._variables),s=Zfe.getActorLinkedRecordID(t,o);if(null==s)return n[i]=s,void 0===s?this._markDataAsMissing(i):null===s&&this._maybeAddFieldErrors(t,o),n[i];var a=s[0],l=s[1],c={};return this._createFragmentPointer(e.fragmentSpread,Zfe.fromObject({__id:l}),c),n[i]={__fragmentRef:c,__viewer:a},n[i]},t._readPluralLink=function(e,t,n){var r=uhe(e,this._variables),i=Zfe.getLinkedRecordIDs(t,r);return(null===i||Xfe.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(i)&&0===i.length)&&this._maybeAddFieldErrors(t,r),this._readLinkedIds(e,i,t,n)},t._readLinkedIds=function(e,t,n,r){var i,o=this,s=null!==(i=e.alias)&&void 0!==i?i:e.name;if(null==t)return r[s]=t,void 0===t&&this._markDataAsMissing(s),t;var a=r[s];null==a||Array.isArray(a)||ghe(!1);var l=this._fieldErrors;this._fieldErrors=null;var c=a||[];return t.forEach(function(t,n){if(null==t)return void 0===t&&o._markDataAsMissing(String(n)),void(c[n]=t);var r=c[n];null!=r&&"object"!=typeof r&&ghe(!1);var i=o._fieldErrors;o._fieldErrors=null,c[n]=o._traverse(e,t,r),o._prependPreviousErrors(i,n)}),this._prependPreviousErrors(l,s),r[s]=c,c},t._readModuleImport=function(e,t,n){var r=che(e.documentName),i=Zfe.getValue(t,r),o=void 0!==i?i:e.componentModuleProvider;null!=o?(this._createFragmentPointer({kind:"FragmentSpread",name:e.fragmentName,args:e.args},t,n),n[rhe]=e.fragmentPropName,n[she]=o):void 0===o&&this._markDataAsMissing("<module-import>")},t._readAliasedInlineFragment=function(e,t,n){var r=this._fieldErrors;this._fieldErrors=null;var i=this._readInlineFragment(e.fragment,t,{},!0);this._prependPreviousErrors(r,e.name),!1===i&&(i=null),n[e.name]=i},t._readInlineFragment=function(e,t,n,r){if(null==e.type)return!1!==this._traverseSelections(e.selections,t,n)&&n;var i=e.abstractKey;if(null==i){if(!this._recordMatchesTypeCondition(t,e.type))return null;if(!this._traverseSelections(e.selections,t,n))return!1}else{var o=this._implementsInterface(t,i);if(!1===o&&r)return null;var s=this._isMissingData,a=this._isWithinUnmatchedTypeRefinement;this._isWithinUnmatchedTypeRefinement=a||!1===o;var l=this._traverseSelections(e.selections,t,n);if(this._isWithinUnmatchedTypeRefinement=a,!1===o)return this._isMissingData=s,null;if(null==o)return;if(!1===l)return!1}return n},t._recordMatchesTypeCondition=function(e,t){var n=Zfe.getType(e);return null!=n&&n===t||Zfe.getDataID(e)===ahe},t._createFragmentPointer=function(e,t,n){var r=n[ihe];null==r&&(r=n[ihe]={}),("object"!=typeof r||null==r)&&ghe(!1),null==n[ohe]&&(n[ohe]=Zfe.getDataID(t)),r[e.name]=lhe(e.args,this._variables,this._isWithinUnmatchedTypeRefinement),n[nhe]=this._owner,this._clientEdgeTraversalPath.length>0&&null!==this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1]&&(n[the]=(0,Hfe.default)(this._clientEdgeTraversalPath))},t._createInlineDataOrResolverFragmentPointer=function(e,t,n){var r=n[ihe];null==r&&(r=n[ihe]={}),("object"!=typeof r||null==r)&&ghe(!1),null==n[ohe]&&(n[ohe]=Zfe.getDataID(t));var i={},o=this._fragmentName;this._fragmentName=e.name;var s=this._variables,a=e.args?lhe(e.args,this._variables):{};this._variables=Yfe.getFragmentVariables(e,this._owner.variables,a),this._traverseSelections(e.selections,t,i),this._variables=s,this._fragmentName=o,r[e.name]=i},t._implementsInterface=function(e,t){var n=Zfe.getType(e),r=this._recordSource.get(phe(n)),i=null!=r?Zfe.getValue(r,t):null;return null==i&&this._markDataAsMissing("<abstract-type-hint>"),i},e}();function yhe(e){switch(e.kind){case"missing_expected_data.throw":case"missing_required_field.throw":case"relay_field_payload.error":case"relay_resolver.error":return(0,Vfe.default)((0,Vfe.default)({},e),{},{handled:!0});case"missing_expected_data.log":case"missing_required_field.log":return e;default:e.kind,ghe(!1)}}function _he(e,t,n,r){var i="function"==typeof e.resolverModule?e.resolverModule:e.resolverModule.default,o=null,s=null;try{var a=[];null!=e.fragment&&a.push(n);var l=e.args?lhe(e.args,t):void 0;a.push(l),a.push(r),o=i.apply(null,a)}catch(pU){o=null,pU!==fhe&&(s=pU)}return[o,s]}function bhe(e,t,n){return"string"==typeof e?e:"object"==typeof e&&null!=e&&"string"==typeof e.id?e.id:void ghe(!1)}var xhe={read:mhe},She=(0,Nre.default)(Gre),whe=Kce,Ehe=_de,khe=Hde,Che=Tie.getLocalVariables,Ahe=wle,Nhe=kie,The=Wle.generateTypeID,Rhe=gre,Dhe=Nhe.getReadTimeResolverStorageKey,Ihe=Nhe.getStorageKey,Fhe=Nhe.getModuleOperationKey;var Ohe=function(){function e(e,t,n,r,i,o){this._operationLoader=null!=r?r:null,this._operationName=null,this._useExecTimeResolvers=null!=o&&o,this._recordSource=e,this._references=n,this._variables=t,this._shouldProcessClientComponents=i}var t=e.prototype;return t.mark=function(e,t){"Operation"!==e.kind&&"SplitOperation"!==e.kind||(this._operationName=e.name),this._traverse(e,t)},t._traverse=function(e,t){this._references.add(t);var n=this._recordSource.get(t);null!=n&&this._traverseSelections(e.selections,n)},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||Rhe(!1),this._variables[e]},t._traverseSelections=function(e,t){var n=this;e.forEach(function(r){switch(r.kind){case"ActorChange":n._traverseLink(r.linkedField,t);break;case"LinkedField":r.plural?n._traversePluralLink(r,t):n._traverseLink(r,t);break;case"Condition":Boolean(n._getVariableValue(r.condition))===r.passingValue&&n._traverseSelections(r.selections,t);break;case"InlineFragment":if(null==r.abstractKey){var i=Ahe.getType(t);(null!=i&&i===r.type||i===Nhe.ROOT_TYPE)&&n._traverseSelections(r.selections,t)}else{var o=Ahe.getType(t),s=The(o);n._references.add(s),n._traverseSelections(r.selections,t)}break;case"FragmentSpread":var a=n._variables;n._variables=Che(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=a;break;case"LinkedHandle":var l=Ehe(r,e,n._variables);l.plural?n._traversePluralLink(l,t):n._traverseLink(l,t);break;case"Defer":case"Stream":case"ClientExtension":n._traverseSelections(r.selections,t);break;case"ScalarField":case"ScalarHandle":break;case"TypeDiscriminator":var c=Ahe.getType(t),u=The(c);n._references.add(u);break;case"ModuleImport":n._traverseModuleImport(r,t);break;case"ClientComponent":if(!1===n._shouldProcessClientComponents)break;n._traverseSelections(r.fragment.selections,t);break;case"RelayResolver":case"RelayLiveResolver":n._traverseResolverField(r,t);break;case"ClientEdgeToClientObject":n._traverseClientEdgeToClientObject(r,t);break;default:Rhe(!1)}})},t._traverseClientEdgeToClientObject=function(e,t){if(this._useExecTimeResolvers)this._traverseLink(e.linkedField,t);else{var n=this._traverseResolverField(e.backingField,t);if(null!=n){var r=this._recordSource.get(n);if(null!=r)if(e.backingField.isOutputType){var i=khe(r);if(null!=i){var o,s=(0,She.default)(i);try{for(s.s();!(o=s.n()).done;){var a=o.value;this._references.add(a)}}catch(g){s.e(g)}finally{s.f()}}}else{var l=e.linkedField,c=l.concreteType;if(null==c)return;if(l.plural){var u=Ahe.getResolverLinkedRecordIDs(r,c);if(null!=u){var d,f=(0,She.default)(u);try{for(f.s();!(d=f.n()).done;){var h=d.value;null!=h&&this._traverse(l,h)}}catch(g){f.e(g)}finally{f.f()}}}else{var p=Ahe.getResolverLinkedRecordID(r,c);null!=p&&this._traverse(l,p)}}}}},t._traverseResolverField=function(e,t){if(!this._useExecTimeResolvers){var n=Dhe(e,this._variables),r=Ahe.getLinkedRecordID(t,n);null!=r&&this._references.add(r);var i=e.fragment;return null!=i&&this._traverseSelections([i],t),r}},t._traverseModuleImport=function(e,t){var n=this._operationLoader;null===n&&Rhe(!1);var r=Fhe(e.documentName),i=Ahe.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=whe(o),a=this._variables;this._variables=Che(this._variables,s.argumentDefinitions,e.args),this._traverseSelections(s.selections,t),this._variables=a}}},t._traverseLink=function(e,t){var n=Ihe(e,this._variables),r=Ahe.getLinkedRecordID(t,n);null!=r&&this._traverse(e,r)},t._traversePluralLink=function(e,t){var n=this,r=Ihe(e,this._variables),i=Ahe.getLinkedRecordIDs(t,r);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}(),Phe={mark:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;new Ohe(e,l,n,r,i,o).mark(a,s)}},Mhe=Symbol.iterator;var Lhe=function(e,t){for(var n=e[Mhe](),r=n.next();!r.done;){var i=r.value;if(t.has(i))return!0;r=n.next()}return!1},zhe=kie.ROOT_ID,jhe=Uce.VIEWER_ID,Uhe=Symbol.iterator;var Bhe=function(e,t){for(var n=e[Uhe](),r=n.next();!r.done;){var i=r.value;if(t.has(i)&&i!==zhe&&i!==jhe)return!0;r=n.next()}return!1},$he=xae,qhe=cie,Ghe=Lhe,Vhe=Bhe,Khe=xhe,Whe=function(){function e(e,t,n){this._subscriptions=new Set,this.__log=e,this._resolverCache=t,this._resolverContext=n}var t=e.prototype;return t.subscribe=function(e,t){var n=this,r={backup:null,callback:t,snapshot:e,stale:!1};return this._subscriptions.add(r),{dispose:function(){n._subscriptions.delete(r)}}},t.snapshotSubscriptions=function(e){var t=this;this._subscriptions.forEach(function(n){if(n.stale){var r=n.snapshot,i=Khe.read(e,r.selector,t._resolverCache,t._resolverContext),o=$he(r.data,i.data);i.data=o,n.backup=i}else n.backup=n.snapshot})},t.restoreSubscriptions=function(){this._subscriptions.forEach(function(e){var t=e.backup;e.backup=null,t?(t.data!==e.snapshot.data&&(e.stale=!0),e.snapshot={data:e.snapshot.data,isMissingData:t.isMissingData,missingClientEdges:t.missingClientEdges,missingLiveResolverFields:t.missingLiveResolverFields,seenRecords:t.seenRecords,selector:t.selector,fieldErrors:t.fieldErrors}):e.stale=!0})},t.updateSubscriptions=function(e,t,n,r){var i=this,o=0!==t.size;this._subscriptions.forEach(function(s){var a=i._updateSubscription(e,s,t,o,r);null!=a&&n.push(a)})},t._updateSubscription=function(e,t,n,r,i){var o=t.backup,s=t.callback,a=t.snapshot,l=t.stale,c=r&&Ghe(a.seenRecords,n);if(l||c){var u=c||!o?Khe.read(e,a.selector,this._resolverCache,this._resolverContext):o;return u={data:$he(a.data,u.data),isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors},t.snapshot=u,t.stale=!1,u.data!==a.data?(this.__log&&qhe.ENABLE_NOTIFY_SUBSCRIPTION&&this.__log({name:"store.notify.subscription",sourceOperation:i,snapshot:a,nextSnapshot:u}),s(u),a.selector.owner):qhe.ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION&&(l||Vhe(a.seenRecords,n))?a.selector.owner:void 0}},t.size=function(){return this._subscriptions.size},e}(),Hhe=Whe,Jhe=Nre.default,Xhe=Jhe(Gre),Qhe=Jhe(Lre),Yhe=Ole.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,Zhe=Ole.assertInternalActorIdentifier,epe=Aue,tpe=Gde,npe=qce,rpe=Ife.LiveResolverCache,ipe=Ife.RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY,ope=Ife.getUpdatedDataIDs,spe=wle,ape=jfe,lpe=xhe,cpe=Phe,upe=Hhe,dpe=kie,fpe=kie,hpe=fpe.ROOT_ID,ppe=fpe.ROOT_TYPE,gpe=gre,mpe=function(){function e(e,t){var n,r,i,o,s,a,l,c,u=this;(0,Qhe.default)(this,"_gcStep",function(){u._gcRun&&(u._gcRun.next().done?u._gcRun=null:u._gcScheduler(u._gcStep))}),this._currentWriteEpoch=0,this._gcHoldCounter=0,this._gcReleaseBufferSize=null!==(n=null==t?void 0:t.gcReleaseBufferSize)&&void 0!==n?n:10,this._shouldRetainWithinTTL_EXPERIMENTAL=null!==(r=null==t?void 0:t.shouldRetainWithinTTL_EXPERIMENTAL)&&void 0!==r&&r,this._gcRun=null,this._gcScheduler=null!==(i=null==t?void 0:t.gcScheduler)&&void 0!==i?i:epe,this._getDataID=null!==(o=null==t?void 0:t.getDataID)&&void 0!==o?o:npe,this._globalInvalidationEpoch=null,this._invalidationSubscriptions=new Set,this._invalidatedRecordIDs=new Set,this.__log=null!==(s=null==t?void 0:t.log)&&void 0!==s?s:null,this._queryCacheExpirationTime=null==t?void 0:t.queryCacheExpirationTime,this._operationLoader=null!==(a=null==t?void 0:t.operationLoader)&&void 0!==a?a:null,this._optimisticSource=null,this._recordSource=e,this._releaseBuffer=[],this._roots=new Map,this._shouldScheduleGC=!1,this._resolverCache=new rpe(function(){return u._getMutableRecordSource()},this),this._resolverContext=null==t?void 0:t.resolverContext,this._storeSubscriptions=new upe(null==t?void 0:t.log,this._resolverCache,this._resolverContext),this._updatedRecordIDs=new Set,this._shouldProcessClientComponents=null!==(l=null==t?void 0:t.shouldProcessClientComponents)&&void 0!==l&&l,this._treatMissingFieldsAsNull=null!==(c=null==t?void 0:t.treatMissingFieldsAsNull)&&void 0!==c&&c,this._actorIdentifier=null==t?void 0:t.actorIdentifier,function(e){if(!e.has(hpe)){var t=spe.create(hpe,ppe);e.set(hpe,t)}}(this._recordSource)}var t=e.prototype;return t.getSource=function(){var e;return null!==(e=this._optimisticSource)&&void 0!==e?e:this._recordSource},t.getOperationLoader=function(){return this._operationLoader},t._getMutableRecordSource=function(){var e;return null!==(e=this._optimisticSource)&&void 0!==e?e:this._recordSource},t.getLiveResolverPromise=function(e){return this._resolverCache.getLiveResolverPromise(e)},t.batchLiveStateUpdates=function(e){null!=this.__log&&this.__log({name:"liveresolver.batch.start"});try{this._resolverCache.batchLiveStateUpdates(e)}finally{null!=this.__log&&this.__log({name:"liveresolver.batch.end"})}},t.check=function(e,t){var n,r,i,o,s,a,l,c=e.root,u=this._getMutableRecordSource(),d=this._globalInvalidationEpoch,f=null!==(n=null!==(r=e.request.node.operation.use_exec_time_resolvers)&&void 0!==r?r:!0===(null===(i=e.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===i?void 0:i.get()))&&void 0!==n&&n,h=this._roots.get(e.request.identifier),p=null!=h?h.epoch:null;if(null!=d&&(null==p||p<=d))return{status:"stale"};var g=null!==(o=null==t?void 0:t.handlers)&&void 0!==o?o:[],m=null!==(s=null==t?void 0:t.getSourceForActor)&&void 0!==s?s:function(e){return Zhe(e),u},v=null!==(a=null==t?void 0:t.getTargetForActor)&&void 0!==a?a:function(e){return Zhe(e),u};return function(e,t,n,r){var i=e.mostRecentlyInvalidatedAt,o=e.status;if("number"==typeof i&&(null==t||i>t))return{status:"stale"};if("missing"===o)return{status:"missing"};if(null!=n&&null!=r){if(n<=Date.now()-r)return{status:"stale"}}return{status:"available",fetchTime:null!=n?n:null}}(tpe.check(m,v,null!==(l=null==t?void 0:t.defaultActorIdentifier)&&void 0!==l?l:Yhe,c,g,this._operationLoader,this._getDataID,this._shouldProcessClientComponents,this.__log,f),p,null==h?void 0:h.fetchTime,this._queryCacheExpirationTime)},t.retain=function(e){var t=this,n=e.request.identifier,r=!1,i=this._roots.get(n);return null!=i?(0===i.refCount&&(this._releaseBuffer=this._releaseBuffer.filter(function(e){return e!==n})),i.refCount+=1):this._roots.set(n,{operation:e,refCount:1,epoch:null,fetchTime:null}),{dispose:function(){if(!r){r=!0;var e=t._roots.get(n);if(null!=e&&(e.refCount--,0===e.refCount)){var i=t._queryCacheExpirationTime;if(null!=e.fetchTime&&null!=i&&e.fetchTime<=Date.now()-i)t._shouldRetainWithinTTL_EXPERIMENTAL||t._roots.delete(n),t.scheduleGC();else if(t._releaseBuffer.push(n),t._releaseBuffer.length>t._gcReleaseBufferSize){var o=t._releaseBuffer.shift();t._shouldRetainWithinTTL_EXPERIMENTAL||t._roots.delete(o),t.scheduleGC()}}}}}},t.lookup=function(e){var t=this.__log;null!=t&&t({name:"store.lookup.start",selector:e});var n=this.getSource(),r=lpe.read(n,e,this._resolverCache,this._resolverContext);return null!=t&&t({name:"store.lookup.end",selector:e}),r},t.notify=function(e,t){var n=this,r=this.__log;null!=r&&r({name:"store.notify.start",sourceOperation:e}),this._currentWriteEpoch++,!0===t&&(this._globalInvalidationEpoch=this._currentWriteEpoch),this._resolverCache.invalidateDataIDs(this._updatedRecordIDs);var i=this.getSource(),o=[];if(this._storeSubscriptions.updateSubscriptions(i,this._updatedRecordIDs,o,e),this._invalidationSubscriptions.forEach(function(e){n._updateInvalidationSubscription(e,!0===t)}),null!=e){var s=e.request.identifier,a=this._roots.get(s);if(null!=a)a.epoch=this._currentWriteEpoch,a.fetchTime=Date.now();else if("query"===e.request.node.params.operationKind&&this._gcReleaseBufferSize>0&&this._releaseBuffer.length<this._gcReleaseBufferSize){var l={operation:e,refCount:0,epoch:this._currentWriteEpoch,fetchTime:Date.now()};this._releaseBuffer.push(s),this._roots.set(s,l)}}return null!=r&&r({name:"store.notify.complete",sourceOperation:e,updatedRecordIDs:this._updatedRecordIDs,invalidatedRecordIDs:this._invalidatedRecordIDs,subscriptionsSize:this._storeSubscriptions.size(),updatedOwners:o}),this._updatedRecordIDs.clear(),this._invalidatedRecordIDs.clear(),o},t.publish=function(e,t){var n=this._getMutableRecordSource();!function(e,t,n,r,i,o){r&&r.forEach(function(r){var i,s=e.get(r),a=t.get(r);null!==a&&((i=null!=s?spe.clone(s):null!=a?spe.clone(a):null)&&(spe.setValue(i,dpe.INVALIDATED_AT_KEY,n),o.add(r),e.set(r,i)))});for(var s=t.getRecordIDs(),a=0;a<s.length;a++){var l=s[a],c=t.get(l),u=e.get(l);if(c&&u){var d=spe.update(u,c);d!==u&&(i.add(l),e.set(l,d))}else null===c?(e.delete(l),null!==u&&i.add(l)):c&&(e.set(l,c),i.add(l))}}(n,e,this._currentWriteEpoch+1,t,this._updatedRecordIDs,this._invalidatedRecordIDs);var r=this.__log;null!=r&&r({name:"store.publish",source:e,optimistic:n===this._optimisticSource})},t.subscribe=function(e,t){return this._storeSubscriptions.subscribe(e,t)},t.holdGC=function(){var e=this;this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._gcHoldCounter++;return{dispose:function(){e._gcHoldCounter>0&&(e._gcHoldCounter--,0===e._gcHoldCounter&&e._shouldScheduleGC&&(e.scheduleGC(),e._shouldScheduleGC=!1))}}},t.toJSON=function(){return"RelayModernStore()"},t.getEpoch=function(){return this._currentWriteEpoch},t.__getUpdatedRecordIDs=function(){return this._updatedRecordIDs},t.lookupInvalidationState=function(e){var t=this,n=new Map;return e.forEach(function(e){var r,i=t.getSource().get(e);n.set(e,null!==(r=spe.getInvalidationEpoch(i))&&void 0!==r?r:null)}),n.set("global",this._globalInvalidationEpoch),{dataIDs:e,invalidations:n}},t.checkInvalidationState=function(e){var t=this.lookupInvalidationState(e.dataIDs).invalidations,n=e.invalidations;if(t.get("global")!==n.get("global"))return!0;var r,i=(0,Xhe.default)(e.dataIDs);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.get(o)!==n.get(o))return!0}}catch(s){i.e(s)}finally{i.f()}return!1},t.subscribeToInvalidationState=function(e,t){var n=this,r={callback:t,invalidationState:e};return this._invalidationSubscriptions.add(r),{dispose:function(){n._invalidationSubscriptions.delete(r)}}},t._updateInvalidationSubscription=function(e,t){var n=this,r=e.callback,i=e.invalidationState.dataIDs;(t||i.some(function(e){return n._invalidatedRecordIDs.has(e)}))&&r()},t.snapshot=function(){null!=this._optimisticSource&&gpe(!1);var e=this.__log;null!=e&&e({name:"store.snapshot"}),this._storeSubscriptions.snapshotSubscriptions(this.getSource()),this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._optimisticSource=ape.create(this.getSource())},t.restore=function(){var e=this._optimisticSource;e||gpe(!1);var t=this.__log;null!=t&&t({name:"store.restore"});var n=ape.getOptimisticRecordIDs(e);this._resolverCache.unsubscribeFromLiveResolverRecords(n),this._optimisticSource=null,this._shouldScheduleGC&&this.scheduleGC(),this._storeSubscriptions.restoreSubscriptions(),this._resolverCache.invalidateResolverRecords(n)},t.scheduleGC=function(){this._gcHoldCounter>0?this._shouldScheduleGC=!0:this._gcRun||(this._gcRun=this._collect(),this._gcScheduler(this._gcStep))},t.__gc=function(){if(null==this._optimisticSource)for(var e=this._collect();!e.next().done;);},t._collect=function*(){if(!this._shouldRetainWithinTTL_EXPERIMENTAL||null!=this._queryCacheExpirationTime){var e=this.__log;e:for(;;){null!=e&&e({name:"store.gc.start"});var t,n=this._currentWriteEpoch,r=new Set,i=(0,Xhe.default)(this._roots.entries());try{for(i.s();!(t=i.n()).done;){var o,s,a,l=t.value,c=l[0],u=l[1],d=u.operation,f=u.refCount,h=u.fetchTime;if(this._shouldRetainWithinTTL_EXPERIMENTAL){var p=this._queryCacheExpirationTime;if(null==p&&gpe(!1),(null==h||h<=Date.now()-p)&&0===f&&!this._releaseBuffer.includes(c))continue}var g=d.root,m=null!==(o=null!==(s=d.request.node.operation.use_exec_time_resolvers)&&void 0!==s?s:!0===(null===(a=d.request.node.operation.exec_time_resolvers_enabled_provider)||void 0===a?void 0:a.get()))&&void 0!==o&&o;if(cpe.mark(this._recordSource,g,r,this._operationLoader,this._shouldProcessClientComponents,m),yield,n!==this._currentWriteEpoch){null!=e&&e({name:"store.gc.interrupted"});continue e}}}catch(S){i.e(S)}finally{i.f()}for(var v=this._recordSource.getRecordIDs(),y=0;y<v.length;y++){var _=v[y];if(!r.has(_)){var b=this._recordSource.get(_);if(null!=b){var x=spe.getValue(b,ipe);null!=x&&x()}this._recordSource.remove(_),this._shouldRetainWithinTTL_EXPERIMENTAL&&this._roots.delete(_)}}return void(null!=e&&e({name:"store.gc.end",references:r}))}}},t.__getNormalizationOptions=function(e){return{path:e,getDataID:this._getDataID,log:this.__log,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents,actorIdentifier:this._actorIdentifier}},t.__notifyUpdatedSubscribers=function(e){var t=ope(e),n=this._updatedRecordIDs;this._updatedRecordIDs=t,this.notify(),this._updatedRecordIDs=n},e}();var vpe,ype,_pe=mpe,bpe=kie,xpe=bpe.ROOT_TYPE,Spe=bpe.getStorageKey,wpe=Wue.readUpdatableFragment,Epe=Xue.readUpdatableQuery,kpe=gre,Cpe=function(){function e(e,t,n,r){this.__mutator=e,this.__recordSource=t,this._readSelector=n,this._missingFieldHandlers=r}var t=e.prototype;return t.create=function(e,t){return this.__recordSource.create(e,t)},t.delete=function(e){this.__recordSource.delete(e)},t.get=function(e){return this.__recordSource.get(e)},t.getRoot=function(){return this.__recordSource.getRoot()},t.getOperationRoot=function(){var e=this.__recordSource.get(this._readSelector.dataID);return e||(e=this.__recordSource.create(this._readSelector.dataID,xpe)),e},t._getRootField=function(e,t,n){var r=e.node.selections.find(function(e){return"LinkedField"===e.kind&&e.name===t||"RequiredField"===e.kind&&e.field.name===t});return r&&"RequiredField"===r.kind&&(r=r.field),r&&"LinkedField"===r.kind||kpe(!1),r.plural!==n&&kpe(!1),r},t.getRootField=function(e){var t=this._getRootField(this._readSelector,e,!1),n=Spe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecord(n)},t.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),n=Spe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecords(n)},t.invalidateStore=function(){this.__recordSource.invalidateStore()},t.readUpdatableQuery=function(e,t){return Epe(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return wpe(e,t,this,this._missingFieldHandlers)},e}(),Ape=Iue,Npe=pde,Tpe=Cpe,Rpe=cie,Dpe=xhe,Ipe=Dle,Fpe=gre,Ope=void 0!==k?k:"undefined"!=typeof window?window:void 0,Ppe=null!==(vpe=null==Ope||null===(ype=Ope.ErrorUtils)||void 0===ype?void 0:ype.applyWithGuard)&&void 0!==vpe?vpe:function(e,t,n,r,i){return e.apply(t,n)},Mpe=function(){function e(e,t,n,r,i){this._hasStoreSnapshot=!1,this._handlerProvider=t||null,this._pendingBackupRebase=!1,this._pendingData=new Set,this._pendingOptimisticUpdates=new Set,this._store=e,this._appliedOptimisticUpdates=new Set,this._gcHold=null,this._getDataID=n,this._missingFieldHandlers=r,this._log=i}var t=e.prototype;return t.applyUpdate=function(e){(this._appliedOptimisticUpdates.has(e)||this._pendingOptimisticUpdates.has(e))&&Fpe(!1),this._pendingOptimisticUpdates.add(e)},t.revertUpdate=function(e){this._pendingOptimisticUpdates.has(e)?this._pendingOptimisticUpdates.delete(e):this._appliedOptimisticUpdates.has(e)&&(this._pendingBackupRebase=!0,this._appliedOptimisticUpdates.delete(e))},t.revertAll=function(){this._pendingBackupRebase=!0,this._pendingOptimisticUpdates.clear(),this._appliedOptimisticUpdates.clear()},t.commitPayload=function(e,t,n){this._pendingBackupRebase=!0,this._pendingData.add({kind:"payload",operation:e,payload:t,updater:n})},t.commitUpdate=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"updater",updater:e})},t.commitSource=function(e){this._pendingBackupRebase=!0,this._pendingData.add({kind:"source",source:e})},t.run=function(e){var t=0===this._appliedOptimisticUpdates&&!!this._gcHold,n=!this._pendingBackupRebase&&0===this._pendingOptimisticUpdates.size&&!t;if(Rpe.DISALLOW_NESTED_UPDATES&&!0===this._isRunning&&Fpe(!1),this._isRunning=!0,n)return this._isRunning=!1,[];this._pendingBackupRebase&&this._hasStoreSnapshot&&(this._store.restore(),this._hasStoreSnapshot=!1);var r=this._commitData();return(this._pendingOptimisticUpdates.size||this._pendingBackupRebase&&this._appliedOptimisticUpdates.size)&&(this._hasStoreSnapshot||(this._store.snapshot(),this._hasStoreSnapshot=!0),this._applyUpdates()),this._pendingBackupRebase=!1,this._appliedOptimisticUpdates.size>0?this._gcHold||(this._gcHold=this._store.holdGC()):this._gcHold&&(this._gcHold.dispose(),this._gcHold=null),this._isRunning=!1,this._store.notify(e,r)},t._publishSourceFromPayload=function(e){var t=this,n=e.payload,r=e.operation,i=e.updater,o=n.source,s=n.fieldPayloads,a=new Ape(this._store.getSource(),o),l=new Npe(a,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log);if(s&&s.length&&s.forEach(function(e){var n=t._handlerProvider&&t._handlerProvider(e.handle);n||Fpe(!1),n.update(l,e)}),i){var c=r.fragment;null==c&&Fpe(!1),i(new Tpe(a,l,c,this._missingFieldHandlers),Lpe(o,c))}var u=l.getIDsMarkedForInvalidation();return this._store.publish(o,u),l.isStoreMarkedForInvalidation()},t._commitData=function(){var e=this;if(!this._pendingData.size)return!1;var t=!1;return this._pendingData.forEach(function(n){if("payload"===n.kind){var r=e._publishSourceFromPayload(n);t=t||r}else if("source"===n.kind){var i=n.source;e._store.publish(i)}else{var o=n.updater,s=Ipe.create(),a=new Ape(e._store.getSource(),s),l=new Npe(a,e._getDataID,e._handlerProvider,e._missingFieldHandlers,e._log);Ppe(o,null,[l],null,"RelayPublishQueue:commitData"),t=t||l.isStoreMarkedForInvalidation();var c=l.getIDsMarkedForInvalidation();e._store.publish(s,c)}}),this._pendingData.clear(),t},t._applyUpdates=function(){var e=this,t=Ipe.create(),n=new Ape(this._store.getSource(),t),r=new Npe(n,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log),i=function(t){if(t.storeUpdater){var i=t.storeUpdater;Ppe(i,null,[r],null,"RelayPublishQueue:applyUpdates")}else{var o=t.operation,s=t.payload,a=t.updater,l=s.source,c=s.fieldPayloads;if(l&&r.publishSource(l,c),a){var u;l&&(u=Lpe(l,o.fragment));var d=new Tpe(n,r,o.fragment,e._missingFieldHandlers);Ppe(a,null,[d,u],null,"RelayPublishQueue:applyUpdates")}}};this._pendingBackupRebase&&this._appliedOptimisticUpdates.size&&this._appliedOptimisticUpdates.forEach(i),this._pendingOptimisticUpdates.size&&(this._pendingOptimisticUpdates.forEach(function(t){i(t),e._appliedOptimisticUpdates.add(t)}),this._pendingOptimisticUpdates.clear()),this._store.publish(t)},e}();function Lpe(e,t){return Dpe.read(e,t).data}var zpe=Mpe,jpe=(0,Nre.default)(zre),Upe=Nse,Bpe=Ole.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,$pe=Ole.assertInternalActorIdentifier,qpe=hoe,Gpe=Oce,Vpe=zce,Kpe=jce,Wpe=qce,Hpe=Gce,Jpe=Cce,Xpe=Eue,Qpe=_pe,Ype=zpe,Zpe=Dle,ege=function(){function e(e){var t,n,r,i,o,s,a,l,c,u,d,f=this;this.configName=e.configName,this._treatMissingFieldsAsNull=!0===e.treatMissingFieldsAsNull;var h=e.operationLoader,p=null!==(t=e.store)&&void 0!==t?t:new Qpe(new Zpe,{log:e.log,operationLoader:e.operationLoader,getDataID:e.getDataID,shouldProcessClientComponents:e.shouldProcessClientComponents});this.__log=null!==(n=e.log)&&void 0!==n?n:tge,this.relayFieldLogger=null!==(r=e.relayFieldLogger)&&void 0!==r?r:Hpe,this._defaultRenderPolicy=null!==(i=e.UNSTABLE_defaultRenderPolicy)&&void 0!==i?i:"partial",this._operationLoader=h,this._operationExecutions=new Map,this._network=Gpe(this,e.network),this._getDataID=null!==(o=e.getDataID)&&void 0!==o?o:Wpe,this._missingFieldHandlers=null!==(s=e.missingFieldHandlers)&&void 0!==s?s:[],this._publishQueue=new Ype(p,null!==(a=e.handlerProvider)&&void 0!==a?a:Upe,this._getDataID,this._missingFieldHandlers,this.__log),this._scheduler=null!==(l=e.scheduler)&&void 0!==l?l:null,this._store=p,this.options=e.options,this._isServer=null!==(c=e.isServer)&&void 0!==c&&c,this._normalizeResponse=null!==(u=e.normalizeResponse)&&void 0!==u?u:Jpe,this.__setNet=function(e){return f._network=Gpe(f,e)},this._operationTracker=null!==(d=e.operationTracker)&&void 0!==d?d:new Vpe,this._shouldProcessClientComponents=e.shouldProcessClientComponents,Kpe(this)}var t=e.prototype;return t.getStore=function(){return this._store},t.getNetwork=function(){return this._network},t.getOperationTracker=function(){return this._operationTracker},t.getScheduler=function(){return this._scheduler},t.isRequestActive=function(e){return"active"===this._operationExecutions.get(e)},t.UNSTABLE_getDefaultRenderPolicy=function(){return this._defaultRenderPolicy},t.applyUpdate=function(e){var t=this;return this._scheduleUpdates(function(){t._publishQueue.applyUpdate(e),t._publishQueue.run()}),{dispose:function(){t._scheduleUpdates(function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()})}}},t.revertUpdate=function(e){var t=this;this._scheduleUpdates(function(){t._publishQueue.revertUpdate(e),t._publishQueue.run()})},t.replaceUpdate=function(e,t){var n=this;this._scheduleUpdates(function(){n._publishQueue.revertUpdate(e),n._publishQueue.applyUpdate(t),n._publishQueue.run()})},t.applyMutation=function(e){var t=this._execute({createSource:function(){return qpe.create(function(e){})},isClientPayload:!1,operation:e.operation,optimisticConfig:e,updater:null}).subscribe({});return{dispose:function(){return t.unsubscribe()}}},t.check=function(e){return 0!==this._missingFieldHandlers.length||function(e){return"Operation"===e.root.node.kind&&null!=e.root.node.clientAbstractTypes}(e)?this._checkSelectorAndHandleMissingFields(e,this._missingFieldHandlers):this._store.check(e)},t.commitPayload=function(e,t){this._execute({createSource:function(){return qpe.from({data:t})},isClientPayload:!0,operation:e,optimisticConfig:null,updater:null}).subscribe({})},t.commitUpdate=function(e){var t=this;this._scheduleUpdates(function(){t._publishQueue.commitUpdate(e),t._publishQueue.run()})},t.lookup=function(e){return this._store.lookup(e)},t.subscribe=function(e,t){return this._store.subscribe(e,t)},t.retain=function(e){return this._store.retain(e)},t.isServer=function(){return this._isServer},t._checkSelectorAndHandleMissingFields=function(e,t){var n=this,r=Zpe.create(),i=this._store.getSource(),o=this._store.check(e,{handlers:t,defaultActorIdentifier:Bpe,getSourceForActor:function(e){return $pe(e),i},getTargetForActor:function(e){return $pe(e),r}});return r.size()>0&&this._scheduleUpdates(function(){n._publishQueue.commitSource(r),n._publishQueue.run()}),o},t._scheduleUpdates=function(e){var t=this._scheduler;null!=t?t.schedule(e):e()},t.execute=function(e){var t=this,n=e.operation;return this._execute({createSource:function(){return t.getNetwork().execute(n.request.node.params,n.request.variables,n.request.cacheConfig||{},null,void 0,void 0,void 0,function(){return t.check(n)})},isClientPayload:!1,operation:n,optimisticConfig:null,updater:null})},t.executeSubscription=function(e){var t=this,n=e.operation,r=e.updater;return this._execute({createSource:function(){return t.getNetwork().execute(n.request.node.params,n.request.variables,n.request.cacheConfig||{},null)},isClientPayload:!1,operation:n,optimisticConfig:null,updater:r})},t.executeMutation=function(e){var t,n=this,r=e.operation,i=e.optimisticResponse,o=e.optimisticUpdater,s=e.updater,a=e.uploadables;return(i||o)&&(t={operation:r,response:i,updater:o}),this._execute({createSource:function(){return n.getNetwork().execute(r.request.node.params,r.request.variables,(0,jpe.default)((0,jpe.default)({},r.request.cacheConfig),{},{force:!0}),a)},isClientPayload:!1,operation:r,optimisticConfig:t,updater:s})},t.executeWithSource=function(e){var t=e.operation,n=e.source;return this._execute({createSource:function(){return n},isClientPayload:!1,operation:t,optimisticConfig:null,updater:null})},t.toJSON=function(){var e;return"RelayModernEnvironment(".concat(null!==(e=this.configName)&&void 0!==e?e:"",")")},t._execute=function(e){var t=this,n=e.createSource,r=e.isClientPayload,i=e.operation,o=e.optimisticConfig,s=e.updater,a=this._publishQueue,l=this._store;return qpe.create(function(e){var c=Xpe.execute({actorIdentifier:Bpe,getDataID:t._getDataID,isClientPayload:r,log:t.__log,operation:i,operationExecutions:t._operationExecutions,operationLoader:t._operationLoader,operationTracker:t._operationTracker,optimisticConfig:o,getPublishQueue:function(e){return $pe(e),a},scheduler:t._scheduler,shouldProcessClientComponents:t._shouldProcessClientComponents,sink:e,source:n(),getStore:function(e){return $pe(e),l},treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,updater:s,normalizeResponse:t._normalizeResponse});return function(){return c.cancel()}})},e}();function tge(){}ege.prototype["@@RelayModernEnvironment"]=!0;var nge=ege,rge=Fse,ige=Cre.getRequest,oge=Goe.createOperationDescriptor,sge=Zie.createReaderSelector;var age=function(e,t){var n=ige(t.subscription);if("subscription"!==n.params.operationKind)throw new Error("requestSubscription: Must use Subscription operation");var r=t.configs,i=t.onCompleted,o=t.onError,s=t.onNext,a=t.variables,l=t.cacheConfig,c=oge(n,a,l),u=(r?rge.convert(r,n,null,t.updater):t).updater,d=e.executeSubscription({operation:c,updater:u}).subscribe({next:function(t){if(null!=s){var n,r,i,o,a=c.fragment;if(Array.isArray(t))n=null===(r=t[0])||void 0===r||null===(i=r.extensions)||void 0===i?void 0:i.__relay_subscription_root_id;else n=null===(o=t.extensions)||void 0===o?void 0:o.__relay_subscription_root_id;"string"==typeof n&&(a=sge(a.node,n,a.variables,a.owner));var l=e.lookup(a).data;s(l)}},error:o,complete:i});return{dispose:d.unsubscribe}};(0,Nre.default)(zre);var lge=kie;lge.getModuleComponentKey,lge.getModuleOperationKey;var cge=Object.prototype.hasOwnProperty;var uge=Zie.getDataIDsFromFragment,dge=Zie.getSelector,fge=Zie.getVariablesFromFragment,hge=function(e){for(var t in e)if(cge.call(e,t))return!1;return!0},pge=cie,gge=uie.stableCopy,mge=Hoe.intern;var vge=function(e,t){var n=dge(e,t),r=null==n?"null":"SingularReaderSelector"===n.kind?n.owner.identifier:"["+n.selectors.map(function(e){return e.owner.identifier}).join(",")+"]",i=fge(e,t),o=uge(e,t);if(pge.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION){var s=void 0===o?"missing":null==o?"null":Array.isArray(o)?"["+o.join(",")+"]":o;return s=pge.STRING_INTERN_LEVEL<=1?s:mge(s,pge.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+(null==i||hge(i)?"{}":JSON.stringify(gge(i)))+"/"+s}var a,l=null!==(a=JSON.stringify(o))&&void 0!==a?a:"missing";return l=pge.STRING_INTERN_LEVEL<=1?l:mge(l,pge.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+JSON.stringify(gge(i))+"/"+l},yge=gre;var _ge=function(e,t){var n,r;!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)&&yge(!1);var i=null===(r=e.metadata)||void 0===r?void 0:r.refetch;null==i&&yge(!1);var o=i.operation.default?i.operation.default:i.operation,s=i.fragmentPathInResult;"string"==typeof o&&yge(!1);var a=i.identifierInfo;return null!=a&&(null!=a.identifierField&&"string"!=typeof a.identifierField&&yge(!1),null!=a.identifierQueryVariableName&&"string"!=typeof a.identifierQueryVariableName&&yge(!1)),{fragmentRefPathInResponse:s,identifierInfo:a,refetchableRequest:o,refetchMetadata:i}},bge=_ge,xge=gre;var Sge=function(e,t){var n,r,i=bge(e),o=i.refetchableRequest,s=i.refetchMetadata,a=s.connection;null==a&&xge(!1);var l=a.path,c=(null!==(n=null===(r=e.metadata)||void 0===r?void 0:r.connection)&&void 0!==n?n:[])[0];null==c&&xge(!1);var u=s.identifierInfo;return null!=(null==u?void 0:u.identifierField)&&"string"!=typeof u.identifierField&&xge(!1),{connectionPathInFragmentData:l,identifierField:null==u?void 0:u.identifierField,paginationRequest:o,paginationMetadata:a,stream:!0===c.stream}},wge=Nre.default,Ege=wge(Lre),kge=wge(zre),Cge=gre;var Age=function(e,t,n,r,i,o){var s,a=o.backward,l=o.forward;if("backward"===e){var c;(null==a||null==a.count||null==a.cursor)&&Cge(!1);var u=(0,kge.default)((0,kge.default)((0,kge.default)({},r),i),{},(c={},(0,Ege.default)(c,a.cursor,n),(0,Ege.default)(c,a.count,t),c));return l&&l.cursor&&(u[l.cursor]=null),l&&l.count&&(u[l.count]=null),u}(null==l||null==l.count||null==l.cursor)&&Cge(!1);var d=(0,kge.default)((0,kge.default)((0,kge.default)({},r),i),{},(s={},(0,Ege.default)(s,l.cursor,n),(0,Ege.default)(s,l.count,t),s));return a&&a.cursor&&(d[a.cursor]=null),a&&a.count&&(d[a.count]=null),d},Nge=(0,Nre.default)(Gre),Tge=gre;var Rge=function(e,t){var n,r=e,i=(0,Nge.default)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(null==r)return null;"number"==typeof o?(Array.isArray(r)||Tge(!1),r=r[o]):(("object"!=typeof r||Array.isArray(r))&&Tge(!1),r=r[o])}}catch(s){i.e(s)}finally{i.f()}return r},Dge=fse,Ige=nse,Fge=jse,Oge=Use,Pge=Hse,Mge=Fse,Lge=dae,zge=pae,jge=Toe,Uge=Cre,Bge=mae,$ge=Wae,qge=Jae,Gge=Tse,Vge=Rce,Kge=Tie,Wge=Zie,Hge=kie,Jge=soe,Xge=Uce,Qge=age,Yge=Doe,Zge=vge,eme=Sge,tme=Age,nme=yae,rme=_ge,ime=Ooe,ome=Rge,sme=Xre.handlePotentialSnapshotErrors,ame=coe,lme=_ae,cme=xae,ume=oie,dme=cie,fme={Environment:nge,Network:nae,Observable:hoe,RecordSource:Dle,ReplaySubject:boe,Store:_pe,areEqualSelectors:Wge.areEqualSelectors,createFragmentSpecResolver:qae,createNormalizationSelector:Wge.createNormalizationSelector,createOperationDescriptor:Goe.createOperationDescriptor,createReaderSelector:Wge.createReaderSelector,createRequestDescriptor:Goe.createRequestDescriptor,getArgumentValues:Hge.getArgumentValues,getDataIDsFromFragment:Wge.getDataIDsFromFragment,getDataIDsFromObject:Wge.getDataIDsFromObject,getNode:Uge.getNode,getFragment:Uge.getFragment,getInlineDataFragment:Uge.getInlineDataFragment,getModuleComponentKey:Hge.getModuleComponentKey,getModuleOperationKey:Hge.getModuleOperationKey,getPaginationFragment:Uge.getPaginationFragment,getPluralSelector:Wge.getPluralSelector,getRefetchableFragment:Uge.getRefetchableFragment,getRequest:Uge.getRequest,getRequestIdentifier:ime,getSelector:Wge.getSelector,getSelectorsFromObject:Wge.getSelectorsFromObject,getSingularSelector:Wge.getSingularSelector,getStorageKey:Hge.getStorageKey,getVariablesFromFragment:Wge.getVariablesFromFragment,getVariablesFromObject:Wge.getVariablesFromObject,getVariablesFromPluralFragment:Wge.getVariablesFromPluralFragment,getVariablesFromSingularFragment:Wge.getVariablesFromSingularFragment,handlePotentialSnapshotErrors:sme,graphql:Uge.graphql,isFragment:Uge.isFragment,isInlineDataFragment:Uge.isInlineDataFragment,isRequest:Uge.isRequest,readInlineData:Vge,readFragment:Jge.readFragment,MutationTypes:Mge.MutationTypes,RangeOperations:Mge.RangeOperations,ConnectionHandler:Dge,VIEWER_ID:Xge.VIEWER_ID,VIEWER_TYPE:Xge.VIEWER_TYPE,applyOptimisticMutation:Fge,commitLocalUpdate:Oge,commitMutation:Pge,fetchQuery:Lge,fetchQuery_DEPRECATED:zge,isRelayModernEnvironment:Gge,requestSubscription:Qge,ConnectionInterface:Ige,PreloadableQueryRegistry:Bge,RelayFeatureFlags:dme,DEFAULT_HANDLE_KEY:ume.DEFAULT_HANDLE_KEY,FRAGMENTS_KEY:Hge.FRAGMENTS_KEY,FRAGMENT_OWNER_KEY:Hge.FRAGMENT_OWNER_KEY,ID_KEY:Hge.ID_KEY,REF_KEY:Hge.REF_KEY,REFS_KEY:Hge.REFS_KEY,ROOT_ID:Hge.ROOT_ID,ROOT_TYPE:Hge.ROOT_TYPE,TYPENAME_KEY:Hge.TYPENAME_KEY,deepFreeze:Yge,isPromise:ame,isScalarAndEqual:lme,recycleNodesInto:cme,getFragmentIdentifier:Zge,getRefetchMetadata:rme,getPaginationMetadata:eme,getPaginationVariables:tme,getPendingOperationsForFragment:nme,getValueAtPath:ome,__internal:{createRelayContext:$ge,createRelayLoggingContext:qge,getOperationVariables:Kge.getOperationVariables,getLocalVariables:Kge.getLocalVariables,fetchQuery:jge.fetchQuery,fetchQueryDeduped:jge.fetchQueryDeduped,getPromiseForActiveRequest:jge.getPromiseForActiveRequest,getObservableForActiveRequest:jge.getObservableForActiveRequest}},hme=_pe;const pme=C(hme),gme=N({__proto__:null,default:pme},[hme]);let mme={kind:"linked",handle:(e,t,n,r)=>{let i=e.name,o=n.id;return null==t||"node"!==i||t.getType()!==fme.ROOT_TYPE?void 0:o}};let vme={make:function(e,t,n){return new fme.Store(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},makeLiveStore:function(e,t,n){return new pme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},_makeLiveStoreCjs:function(e,t,n){return new gme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})}};function yme(e,t,n){let r=[],i=e.getStore().getSource()._records.get(n);return void 0!==i&&Object.entries(i).forEach(e=>{e[0].startsWith("__"+t+"_connection")&&r.push(e[1].__ref)}),r}let _me={make:function(e,t,n,r,i,o,s){return new fme.Environment({network:e,store:t,getDataID:n,treatMissingFieldsAsNull:r,missingFieldHandlers:void 0!==i?i.concat([mme]):[mme],relayFieldLogger:o,isServer:s})},findAllConnectionIds:yme,invalidateAllOfConnection:function(e,t,n,r){let i=void 0!==r?r:[];fme.commitLocalUpdate(e,r=>{yme(e,t,n).forEach(e=>{if(!i.includes(e))return M(R(r.get(e)),e=>{e.invalidateRecord()})})})}};var bme=A,xme=(0,fme.__internal.createRelayContext)(bme),Sme={exports:{}};!function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Sme);var wme=Sme.exports,Eme={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(Eme);var kme=Eme.exports,Cme={exports:{}},Ame={exports:{}};!function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Ame);var Nme=Ame.exports;!function(e){var t=Nme;e.exports=function(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(Cme);var Tme=Cme.exports,Rme=gre;var Dme=function(e,t){for(var n in t&&"object"==typeof t||Rme(!1),t)if(t.hasOwnProperty(n)){var r=t[n];(!r||"object"!=typeof r&&"function"!=typeof r)&&Rme(!1)}};function Ime(e){return e.displayName||e.name||"Component"}var Fme={getComponentName:Ime,getContainerName:function(e){return"Relay("+Ime(e)+")"}},Ome=A.createContext({rootIsQueryRenderer:!1}),Pme=(0,Nre.default)(wme),Mme=Dme,Lme=Fme.getComponentName,zme=Fme.getContainerName,jme=xme,Ume=Ome,Bme=gre,$me=A,qme=fme.getFragment,Gme=$me.useContext;var Vme=function(e,t,n){var r=zme(e);Mme(Lme(e),t);var i={};for(var o in t)i[o]=qme(t[o]);var s=n(e,i);function a(e,t){var n,r=Gme(jme);null==r&&Bme(!1);var i=Gme(Ume);return $me.createElement(s,(0,Pme.default)({},e,{__relayContext:r,__rootIsQueryRenderer:null!==(n=null==i?void 0:i.rootIsQueryRenderer)&&void 0!==n&&n,componentRef:e.componentRef||t}))}return s.displayName=r,a.displayName=r,$me.forwardRef(a)};var Kme=function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.check&&"function"==typeof e.lookup&&"function"==typeof e.retain&&"function"==typeof e.execute&&"function"==typeof e.subscribe},Wme=gre;var Hme={assertRelayContext:function(e){return!function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Kme(e.environment)}(e)&&Wme(!1),e}},Jme=Nre.default,Xme=Jme(wme),Qme=Jme(Zae),Yme=Jme(kme),Zme=Jme(Tme),eve=Jme(Lre),tve=["componentRef","__relayContext","__rootIsQueryRenderer"],nve=Vme,rve=Fme.getContainerName,ive=Hme.assertRelayContext,ove=Fie,sve=A,ave=fme,lve=ave.createFragmentSpecResolver,cve=ave.getDataIDsFromObject,uve=ave.isScalarAndEqual;function dve(e,t){var n,r=rve(e);return n=function(n){function i(e){var i,o;o=n.call(this,e)||this,(0,eve.default)((0,Yme.default)(o),"_handleFragmentDataUpdate",function(){var e=o.state.resolver;o.setState(function(t){return e===t.resolver?{data:t.resolver.resolve(),relayProp:fve(t.relayProp.environment)}:null})});var s=ive(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=lve(s,r,t,e,a);return o.state={data:l.resolve(),prevProps:e,prevPropsContext:s,relayProp:fve(s.environment),resolver:l},o}(0,Zme.default)(i,n),i.getDerivedStateFromProps=function(e,n){var i,o=n.prevProps,s=ive(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=cve(t,o),c=cve(t,e),u=n.resolver;if(n.prevPropsContext.environment!==s.environment||!ove(l,c))return{data:(u=lve(s,r,t,e,a)).resolve(),prevPropsContext:s,prevProps:e,relayProp:fve(s.environment),resolver:u};u.setProps(e);var d=u.resolve();return d!==n.data?{data:d,prevProps:e,prevPropsContext:s,relayProp:fve(s.environment)}:null};var o=i.prototype;return o.componentDidMount=function(){this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},o.componentDidUpdate=function(e,t){this.state.resolver!==t.resolver?(t.resolver.dispose(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},o.componentWillUnmount=function(){this.state.resolver.dispose()},o.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(n.prevPropsContext.environment!==this.state.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!uve(e[o],this.props[o]))return!0}return!1},o._rerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver.resolve();t!==n&&this.setState({data:n})},o._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver,r=n.resolve();n.setCallback(this.props,this._handleFragmentDataUpdate),t!==r&&this.setState({data:r})},o.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,Qme.default)(t,tve);return sve.createElement(e,(0,Xme.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp}))},i}(sve.Component),(0,eve.default)(n,"displayName",r),n}function fve(e){return{environment:e}}var hve={createContainer:function(e,t){return nve(e,t,dve)}},pve=A,gve=fme;gve.createOperationDescriptor,gve.deepFreeze,gve.getRequest,pve.useLayoutEffect,pve.useState,pve.useRef,pve.useMemo;var mve=(0,Nre.default)(zre),vve=fme.getSelector;var yve=function(e,t){var n={};return Object.keys(e).forEach(function(r){var i,o,s,a=e[r],l=t[r],c=vve(a,l),u=null!=c&&"PluralReaderSelector"===c.kind?null!==(i=null===(o=c.selectors[0])||void 0===o?void 0:o.owner.variables)&&void 0!==i?i:{}:null!==(s=null==c?void 0:c.owner.variables)&&void 0!==s?s:{};n=(0,mve.default)((0,mve.default)({},n),u)}),n},_ve=(0,Nre.default)(Lre),bve=gre,xve=fme,Sve=xve.__internal.fetchQuery,wve=xve.createOperationDescriptor,Eve=xve.isRelayModernEnvironment,kve=function(){function e(e){(0,_ve.default)(this,"_selectionReferences",[]),(0,_ve.default)(this,"_didFetchFinish",!1),null!=e&&(this._cacheSelectionReference=e.cacheSelectionReference,this._selectionReferences=e.selectionReferences)}var t=e.prototype;return t.getSelectionReferences=function(){return{cacheSelectionReference:this._cacheSelectionReference,selectionReferences:this._selectionReferences}},t.lookupInStore=function(e,t,n){return"store-and-network"!==n&&"store-or-network"!==n||"available"!==e.check(t).status?null:(this._retainCachedOperation(e,t),e.lookup(t.fragment))},t.getFetchResult=function(){return this._didFetchFinish?null!=this._error?{error:this._error}:null!=this._snapshot?{snapshot:this._snapshot}:void 0:null},t.execute=function(e){var t=this,n=e.environment,r=e.operation,i=e.preservePreviousReferences,o=void 0!==i&&i,s=n.retain(r),a=function(){t._selectionReferences=t._selectionReferences.concat(s)},l=function(){o||t.disposeSelectionReferences(),t._selectionReferences=t._selectionReferences.concat(s)},c=function(){t._selectionReferences=t._selectionReferences.concat(s)};return Eve(n)?Sve(n,r).do({error:a,complete:l,unsubscribe:c}):n.execute({operation:r}).do({error:a,complete:l,unsubscribe:c})},t.setOnDataChange=function(e){this._fetchOptions||bve(!1),"function"==typeof e&&(this._fetchOptions.onDataChangeCallbacks=this._fetchOptions.onDataChangeCallbacks||[],this._fetchOptions.onDataChangeCallbacks.push(e),this._didFetchFinish&&(null!=this._error?e({error:this._error}):null!=this._snapshot&&e({snapshot:this._snapshot})))},t.fetch=function(e,t){var n,r=this,i=e.environment,o=e.operation,s=e.onDataChange,a=!1;this.disposeRequest();var l=this._fetchOptions&&this._fetchOptions.onDataChangeCallbacks;this._fetchOptions={environment:i,onDataChangeCallbacks:l||[],operation:o},s&&-1===this._fetchOptions.onDataChangeCallbacks.indexOf(s)&&this._fetchOptions.onDataChangeCallbacks.push(s);var c=t?wve(o.request.node,o.request.variables,t):o,u=this.execute({environment:i,operation:c}).finally(function(){r._pendingRequest=null}).subscribe({next:function(){r._didFetchFinish=!0,r._error=null,r._onQueryDataAvailable({notifyFirstResult:a})},error:function(e){r._didFetchFinish=!0,r._error=e,r._snapshot=null;var t=r._fetchOptions&&r._fetchOptions.onDataChangeCallbacks;a?t&&t.forEach(function(t){t({error:e})}):n=e}});if(this._pendingRequest={dispose:function(){u.unsubscribe()}},a=!0,n)throw n;return this._snapshot},t.retry=function(e){return this._fetchOptions||bve(!1),this.fetch({environment:this._fetchOptions.environment,operation:this._fetchOptions.operation,onDataChange:null},e)},t.dispose=function(){this.disposeRequest(),this.disposeSelectionReferences()},t.disposeRequest=function(){this._error=null,this._snapshot=null,this._pendingRequest&&this._pendingRequest.dispose(),this._rootSubscription&&(this._rootSubscription.dispose(),this._rootSubscription=null)},t._retainCachedOperation=function(e,t){this._disposeCacheSelectionReference(),this._cacheSelectionReference=e.retain(t)},t._disposeCacheSelectionReference=function(){this._cacheSelectionReference&&this._cacheSelectionReference.dispose(),this._cacheSelectionReference=null},t.disposeSelectionReferences=function(){this._disposeCacheSelectionReference(),this._selectionReferences.forEach(function(e){return e.dispose()}),this._selectionReferences=[]},t._onQueryDataAvailable=function(e){var t=this,n=e.notifyFirstResult;this._fetchOptions||bve(!1);var r=this._fetchOptions,i=r.environment,o=r.onDataChangeCallbacks,s=r.operation;if(!this._snapshot&&(this._snapshot=i.lookup(s.fragment),this._rootSubscription=i.subscribe(this._snapshot,function(e){if(null!=t._fetchOptions){var n=t._fetchOptions.onDataChangeCallbacks;Array.isArray(n)&&n.forEach(function(t){return t({snapshot:e})})}}),this._snapshot&&n&&Array.isArray(o))){var a=this._snapshot;o.forEach(function(e){return e({snapshot:a})})}},e}(),Cve=kve,Ave=Nre.default,Nve=Ave(wme),Tve=Ave(Zae),Rve=Ave(kme),Dve=Ave(Tme),Ive=Ave(Lre),Fve=Ave(zre),Ove=["componentRef"],Pve=["componentRef","__relayContext","__rootIsQueryRenderer"],Mve=["componentRef","__relayContext","__rootIsQueryRenderer"],Lve=Vme,zve=yve,jve=Fme.getComponentName,Uve=Fme.getContainerName,Bve=xme,$ve=Cve,qve=Hme.assertRelayContext,Gve=Fie,Vve=gre,Kve=A,Wve=fme,Hve=Wve.ConnectionInterface,Jve=Wve.Observable,Xve=Wve.RelayFeatureFlags,Qve=Wve.createFragmentSpecResolver,Yve=Wve.createOperationDescriptor,Zve=Wve.getDataIDsFromObject,eye=Wve.getRequest,tye=Wve.getVariablesFromObject,nye=Wve.isScalarAndEqual,rye="forward";function iye(e){return"function"==typeof e?{error:e,complete:e,unsubscribe:function(t){"function"==typeof e&&e()}}:e||{}}function oye(e,t,n){var r;jve(e);var i=Uve(e),o=function(e){var t=null,n=!1;for(var r in e){var i=e[r],o=i.metadata&&i.metadata.connection;void 0!==i.metadata&&(n=!0),o&&(1!==o.length&&Vve(!1),t&&Vve(!1),t=(0,Fve.default)((0,Fve.default)({},o[0]),{},{fragmentName:r}))}return n&&null===t&&Vve(!1),t||{}}(t),s=n.getConnectionFromProps||function(e){var t=e.path;return t||Vve(!1),function(n){for(var r=n[e.fragmentName],i=0;i<t.length;i++){if(!r||"object"!=typeof r)return null;r=r[t[i]]}return r}}(o),a=n.direction||o.direction;a||Vve(!1);var l=n.getFragmentVariables||function(e){var t=e.count;return t||Vve(!1),function(e,n){return(0,Fve.default)((0,Fve.default)({},e),{},(0,Ive.default)({},t,n))}}(o);return r=function(r){function o(e){var n,o;o=r.call(this,e)||this,(0,Ive.default)((0,Rve.default)(o),"_handleFragmentDataUpdate",function(){o.setState({data:o._resolver.resolve()})}),(0,Ive.default)((0,Rve.default)(o),"_hasMore",function(){var e=o._getConnectionData();return!!(e&&e.hasMore&&e.cursor)}),(0,Ive.default)((0,Rve.default)(o),"_isLoading",function(){return!!o._refetchSubscription}),(0,Ive.default)((0,Rve.default)(o),"_refetchConnection",function(e,t,n){if(!o._canFetchPage("refetchConnection"))return{dispose:function(){}};o._refetchVariables=n;var r={count:e,cursor:null,totalCount:e};return{dispose:o._fetchPage(r,iye(t),{force:!0}).unsubscribe}}),(0,Ive.default)((0,Rve.default)(o),"_loadMore",function(e,t,n){if(!o._canFetchPage("loadMore"))return{dispose:function(){}};var r=iye(t),i=o._getConnectionData();if(!i)return Jve.create(function(e){return e.complete()}).subscribe(r),null;var s=i.edgeCount+e;if(n&&n.force)return o._refetchConnection(s,t);var a=Hve.get();a.END_CURSOR,a.START_CURSOR;var l={count:e,cursor:i.cursor,totalCount:s};return{dispose:o._fetchPage(l,r,n).unsubscribe}});var s=qve(e.__relayContext),a=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n;return o._isARequestInFlight=!1,o._refetchSubscription=null,o._refetchVariables=null,!0===Xve.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?o._resolver=Qve(s,i,t,e,a):o._resolver=Qve(s,i,t,e,a,o._handleFragmentDataUpdate),o.state={data:o._resolver.resolve(),prevContext:s,contextForChildren:s,relayProp:o._buildRelayProp(s),resolverGeneration:0},o._isUnmounted=!1,o._hasFetched=!1,o}(0,Dve.default)(o,r);var c=o.prototype;return c.componentDidMount=function(){this._isUnmounted=!1,!0===Xve.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},c.componentDidUpdate=function(e,t){!0===Xve.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&(t.resolverGeneration!==this.state.resolverGeneration?this._subscribeToNewResolverAndRerenderIfStoreHasChanged():this._rerenderIfStoreHasChanged())},c.UNSAFE_componentWillReceiveProps=function(e){var n,r=this,o=qve(e.__relayContext),s=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n,a=Zve(t,this.props),l=Zve(t,e),c=zve(t,this.props),u=zve(t,e);o.environment===this.state.prevContext.environment&&Gve(c,u)&&Gve(a,l)?this._hasFetched||this._resolver.setProps(e):(this._cleanup(),!0===Xve.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?this._resolver=Qve(o,i,t,e,s):this._resolver=Qve(o,i,t,e,s,this._handleFragmentDataUpdate),this.setState(function(e){return{prevContext:o,contextForChildren:o,relayProp:r._buildRelayProp(o),resolverGeneration:e.resolverGeneration+1}}));var d=this._resolver.resolve();d!==this.state.data&&this.setState({data:d})},c.componentWillUnmount=function(){this._isUnmounted=!0,this._cleanup()},c.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data||n.relayProp!==this.state.relayProp||n.resolverGeneration!==this.state.resolverGeneration)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(n.prevContext.environment!==this.state.prevContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!nye(e[o],this.props[o]))return!0}return!1},c._buildRelayProp=function(e){return{hasMore:this._hasMore,isLoading:this._isLoading,loadMore:this._loadMore,refetchConnection:this._refetchConnection,environment:e.environment}},c._rerenderIfStoreHasChanged=function(){var e=this.state.data,t=this._resolver.resolve();e!==t&&this.setState({data:t})},c._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state.data,t=this._resolver.resolve();this._resolver.setCallback(this.props,this._handleFragmentDataUpdate),e!==t&&this.setState({data:t})},c._getConnectionData=function(){var e=this.props;e.componentRef;var t=(0,Tve.default)(e,Ove),n=(0,Fve.default)((0,Fve.default)({},t),this.state.data),r=s(n);if(null==r)return null;var i=Hve.get(),o=i.EDGES,l=i.PAGE_INFO,c=i.HAS_NEXT_PAGE,u=i.HAS_PREV_PAGE,d=i.END_CURSOR,f=i.START_CURSOR;"object"!=typeof r&&Vve(!1);var h=r[o],p=r[l];if(null==h||null==p)return null;Array.isArray(h)||Vve(!1),"object"!=typeof p&&Vve(!1);var g=a===rye?p[c]:p[u],m=a===rye?p[d]:p[f];return"boolean"!=typeof g||0!==h.length&&void 0===m?null:{cursor:m,edgeCount:h.length,hasMore:g}},c._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new $ve),this._queryFetcher},c._canFetchPage=function(e){return!this._isUnmounted},c._fetchPage=function(e,r,i){var o=this,s=qve(this.props.__relayContext).environment,a=this.props;a.componentRef,a.__relayContext,a.__rootIsQueryRenderer;var c,u=(0,Tve.default)(a,Pve),d=(0,Fve.default)((0,Fve.default)({},u),this.state.data),f=zve(t,u);c=tye(t,u),c=(0,Fve.default)((0,Fve.default)((0,Fve.default)({},f),c),this._refetchVariables);var h=n.getVariables(d,{count:e.count,cursor:e.cursor},c);("object"!=typeof h||null===h)&&Vve(!1),h=(0,Fve.default)((0,Fve.default)({},h),this._refetchVariables),c=(0,Fve.default)((0,Fve.default)({},h),c);var p=i?{force:!!i.force}:void 0;null!=p&&null!=(null==i?void 0:i.metadata)&&(p.metadata=null==i?void 0:i.metadata);var g=eye(n.query),m=Yve(g,h,p),v=null;this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._hasFetched=!0;var y=function(){o._refetchSubscription===v&&(o._refetchSubscription=null,o._isARequestInFlight=!1)};return this._isARequestInFlight=!0,v=this._getQueryFetcher().execute({environment:s,operation:m,preservePreviousReferences:!0}).mergeMap(function(t){return Jve.create(function(t){!function(t,n){var r=o._resolver.resolve();o._resolver.setVariables(l(c,e.totalCount),m.request.node);var i=o._resolver.resolve();Gve(r,i)?n():o.setState({data:i,contextForChildren:{environment:o.props.__relayContext.environment}},n)}(0,function(){t.next(),t.complete()})})}).do({error:y,complete:y,unsubscribe:y}).subscribe(r||{}),this._refetchSubscription=this._isARequestInFlight?v:null,v},c._cleanup=function(){this._resolver.dispose(),this._refetchVariables=null,this._hasFetched=!1,this._refetchSubscription&&(this._refetchSubscription.unsubscribe(),this._refetchSubscription=null,this._isARequestInFlight=!1),this._queryFetcher&&this._queryFetcher.dispose()},c.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,Tve.default)(t,Mve);return Kve.createElement(Bve.Provider,{value:this.state.contextForChildren},Kve.createElement(e,(0,Nve.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp})))},o}(Kve.Component),(0,Ive.default)(r,"displayName",i),r}var sye={createContainer:function(e,t,n){return Lve(e,t,function(e,t){return oye(e,t,n)})}},aye=Nre.default,lye=(aye(zre),aye(kme),aye(Tme),aye(Lre),A),cye=fme;cye.createOperationDescriptor;cye.deepFreeze;cye.getRequest;lye.Component;var uye=Nre.default,dye=uye(wme),fye=uye(Zae),hye=uye(zre),pye=uye(kme),gye=uye(Tme),mye=uye(Lre),vye=["componentRef","__relayContext","__rootIsQueryRenderer"],yye=Vme,_ye=yve,bye=Fme.getContainerName,xye=xme,Sye=Cve,wye=Hme.assertRelayContext,Eye=Fie,kye=A,Cye=fme,Aye=Cye.Observable,Nye=Cye.createFragmentSpecResolver,Tye=Cye.createOperationDescriptor,Rye=Cye.getDataIDsFromObject,Dye=Cye.getRequest,Iye=Cye.getVariablesFromObject,Fye=Cye.isScalarAndEqual;function Oye(e,t){return{environment:e,refetch:t}}var Pye={createContainer:function(e,t,n){return yye(e,t,function(e,t){return function(e,t,n){var r,i=bye(e);return r=function(r){function o(e){var o,s;s=r.call(this,e)||this,(0,mye.default)((0,pye.default)(s),"_handleFragmentDataUpdate",function(){var e=s.state.resolver;s.setState(function(t){return e===t.resolver?{data:t.resolver.resolve()}:null})}),(0,mye.default)((0,pye.default)(s),"_refetch",function(e,r,i,o){if(s._isUnmounted)return{dispose:function(){}};var a=wye(s.props.__relayContext).environment,l=_ye(t,s.props),c="function"==typeof e?e(s._getFragmentVariables()):e;c=(0,hye.default)((0,hye.default)({},l),c);var u=r?(0,hye.default)((0,hye.default)({},c),r):c,d=o?{force:!!o.force}:void 0;null!=d&&null!=(null==o?void 0:o.metadata)&&(d.metadata=null==o?void 0:o.metadata);var f,h="function"==typeof i?{next:i,error:i}:i||{},p=Dye(n),g=Tye(p,c,d);return s.state.localVariables=c,s._refetchSubscription&&s._refetchSubscription.unsubscribe(),null!=s._getQueryFetcher().lookupInStore(a,g,null==o?void 0:o.fetchPolicy)?(s.state.resolver.setVariables(u,g.request.node),s.setState(function(e){return{data:e.resolver.resolve(),contextForChildren:{environment:s.props.__relayContext.environment}}},function(){h.next&&h.next(),h.complete&&h.complete()}),{dispose:function(){}}):(s._getQueryFetcher().execute({environment:a,operation:g,preservePreviousReferences:!0}).mergeMap(function(e){return s.state.resolver.setVariables(u,g.request.node),Aye.create(function(e){return s.setState(function(e){return{data:e.resolver.resolve(),contextForChildren:{environment:s.props.__relayContext.environment}}},function(){e.next(),e.complete()})})}).finally(function(){s._refetchSubscription===f&&(s._refetchSubscription=null)}).subscribe((0,hye.default)((0,hye.default)({},h),{},{start:function(e){s._refetchSubscription=f=e,h.start&&h.start(e)}})),{dispose:function(){f&&f.unsubscribe()}})});var a=wye(e.__relayContext),l=null!==(o=e.__rootIsQueryRenderer)&&void 0!==o&&o;s._refetchSubscription=null;var c=Nye(a,i,t,e,l);return s.state={data:c.resolve(),localVariables:null,prevProps:e,prevPropsContext:a,contextForChildren:a,relayProp:Oye(a.environment,s._refetch),resolver:c},s._isUnmounted=!1,s}(0,gye.default)(o,r);var s=o.prototype;return s.componentDidMount=function(){this._isUnmounted=!1,this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},s.componentDidUpdate=function(e,t){this.state.resolver!==t.resolver?(t.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},o.getDerivedStateFromProps=function(e,n){var r,o=n.prevProps,s=wye(e.__relayContext),a=null!==(r=e.__rootIsQueryRenderer)&&void 0!==r&&r,l=Rye(t,o),c=Rye(t,e),u=_ye(t,o),d=_ye(t,e),f=n.resolver;if(n.prevPropsContext.environment!==s.environment||!Eye(u,d)||!Eye(l,c))return{data:(f=Nye(s,i,t,e,a)).resolve(),localVariables:null,prevProps:e,prevPropsContext:s,contextForChildren:s,relayProp:Oye(s.environment,n.relayProp.refetch),resolver:f};n.localVariables||f.setProps(e);var h=f.resolve();return h!==n.data?{data:h,prevProps:e}:null},s.componentWillUnmount=function(){this._isUnmounted=!0,this.state.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe()},s.shouldComponentUpdate=function(e,n){if(n.data!==this.state.data||n.relayProp!==this.state.relayProp)return!0;for(var r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__relayContext"===o){if(this.state.prevPropsContext.environment!==n.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(o)&&!Fye(e[o],this.props[o]))return!0}return!1},s._rerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver.resolve();t!==n&&this.setState({data:n})},s._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var e=this.state,t=e.data,n=e.resolver,r=n.resolve();n.setCallback(this.props,this._handleFragmentDataUpdate),t!==r&&this.setState({data:r})},s._getFragmentVariables=function(){return Iye(t,this.props)},s._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new Sye),this._queryFetcher},s.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,fye.default)(t,vye),i=this.state,o=i.relayProp,s=i.contextForChildren;return kye.createElement(xye.Provider,{value:s},kye.createElement(e,(0,dye.default)({},r,this.state.data,{ref:n,relay:o})))},o}(kye.Component),(0,mye.default)(r,"displayName",i),r}(e,t,n)})}};A.createContext({wrapPrepareQueryResource:function(e){return e()}});var Mye=xme,Lye=gre,zye=A.useContext;var jye=function(){var e=zye(Mye);return null==e&&Lye(!1),e.environment},Uye=A;Uye.useContext,Uye.useEffect;(0,Nre.default)(zre);var Bye=fme;Bye.__internal.fetchQueryDeduped,Bye.Observable,Bye.PreloadableQueryRegistry,Bye.ReplaySubject,Bye.createOperationDescriptor,Bye.getRequest,Bye.getRequestIdentifier;A.useMemo;var $ye=gre,qye=function(){function e(e){this._capacity=e,this._capacity>0||$ye(!1),this._map=new Map}var t=e.prototype;return t.set=function(e,t){if(this._map.delete(e),this._map.set(e,t),this._map.size>this._capacity){var n=this._map.keys().next();n.done||this._map.delete(n.value)}},t.get=function(e){var t=this._map.get(e);return null!=t&&(this._map.delete(e),this._map.set(e,t)),t},t.has=function(e){return this._map.has(e)},t.delete=function(e){this._map.delete(e)},t.size=function(){return this._map.size},t.capacity=function(){return this._capacity-this._map.size},t.clear=function(){this._map.clear()},e}();var Gye={create:function(e){return new qye(e)}},Vye=(0,Nre.default)(Lre),Kye=function(){function e(e){var t=this;(0,Vye.default)(this,"_retainCount",0),(0,Vye.default)(this,"_retainDisposable",null),(0,Vye.default)(this,"_releaseTemporaryRetain",null),this._retain=function(n){return t._retainCount++,1===t._retainCount&&(t._retainDisposable=e(n)),{dispose:function(){t._retainCount=Math.max(0,t._retainCount-1),0===t._retainCount&&null!=t._retainDisposable&&(t._retainDisposable.dispose(),t._retainDisposable=null)}}}}var t=e.prototype;return t.temporaryRetain=function(e){var t,n=this;if(e.isServer())return{dispose:function(){}};var r=this._retain(e),i=null,o=function(){clearTimeout(i),i=null,n._releaseTemporaryRetain=null,r.dispose()};return i=setTimeout(o,3e5),null===(t=this._releaseTemporaryRetain)||void 0===t||t.call(this),this._releaseTemporaryRetain=o,{dispose:function(){var e;null===(e=n._releaseTemporaryRetain)||void 0===e||e.call(n)}}},t.permanentRetain=function(e){var t=this._retain(e);return this.releaseTemporaryRetain(),t},t.releaseTemporaryRetain=function(){var e;null===(e=this._releaseTemporaryRetain)||void 0===e||e.call(this),this._releaseTemporaryRetain=null},t.getRetainCount=function(){return this._retainCount},e}(),Wye=Nre.default,Hye=Wye(zre),Jye=Wye(Lre),Xye=Gye,Qye=Kye,Yye=gre,Zye=fme.isPromise,e_e="store-or-network",t_e="store-and-network",n_e="function"==typeof WeakMap;function r_e(e){return void 0!==e.request.node.params.metadata.live}function i_e(e,t,n,r,i){var o=null!=n?n:r_e(t)?t_e:e_e,s=null!=r?r:e.UNSTABLE_getDefaultRenderPolicy(),a="".concat(o,"-").concat(s,"-").concat(t.request.identifier);return null!=i?"".concat(a,"-").concat(i):a}function o_e(e,t){var n={__id:e.fragment.dataID,__fragments:(0,Jye.default)({},e.fragment.node.name,e.request.variables),__fragmentOwner:e.request};return{cacheIdentifier:t,fragmentNode:e.request.node.fragment,fragmentRef:n,operation:e}}var s_e=2e5;function a_e(e,t,n,r,i,o){var s=r_e(t),a=r,l=i,c=new Qye(function(e){var n=e.retain(t);return{dispose:function(){s&&null!=l&&l.unsubscribe(),n.dispose(),o(u)}}}),u={cacheIdentifier:e,id:s_e++,processedPayloadsCount:0,operationAvailability:n,getValue:function(){return a},setValue:function(e){a=e},setNetworkSubscription:function(e){s&&null!=l&&l.unsubscribe(),l=e},temporaryRetain:function(e){return c.temporaryRetain(e)},permanentRetain:function(e){return c.permanentRetain(e)},releaseTemporaryRetain:function(){c.releaseTemporaryRetain()}};return u}var l_e=function(){function e(e){var t=this;(0,Jye.default)(this,"_clearCacheEntry",function(e){t._cache.delete(e.cacheIdentifier)}),this._environment=e,this._cache=Xye.create(1e3)}var t=e.prototype;return t.prepare=function(e,t,n,r,i,o,s){var a=i_e(this._environment,e,n,r,o);return this.prepareWithIdentifier(a,e,t,n,r,i,s)},t.prepareWithIdentifier=function(e,t,n,r,i,o,s){var a=this._environment,l=null!=r?r:r_e(t)?t_e:e_e,c=null!=i?i:a.UNSTABLE_getDefaultRenderPolicy(),u=this._cache.get(e),d=null,f=null!=u;null==u&&(u=this._fetchAndSaveQuery(e,t,n,l,c,s,(0,Hye.default)((0,Hye.default)({},o),{},{unsubscribe:function(e){null!=d&&d.dispose();var t=null==o?void 0:o.unsubscribe;t&&t(e)}}))),d=u.temporaryRetain(a);var h=u.getValue();if(Zye(h))throw a.__log({name:"suspense.query",fetchPolicy:l,isPromiseCached:f,operation:t,queryAvailability:u.operationAvailability,renderPolicy:c}),h;if(h instanceof Error)throw h;return h},t.retain=function(e,t){var n=this._environment,r=e.cacheIdentifier,i=e.operation,o=this._getOrCreateCacheEntry(r,i,null,e,null),s=o.permanentRetain(n);return n.__log({name:"queryresource.retain",profilerContext:t,resourceID:o.id}),{dispose:function(){s.dispose()}}},t.releaseTemporaryRetain=function(e){var t=this._cache.get(e.cacheIdentifier);null!=t&&t.releaseTemporaryRetain()},t.TESTS_ONLY__getCacheEntry=function(e,t,n,r){var i=i_e(this._environment,e,t,n,r);return this._cache.get(i)},t._getOrCreateCacheEntry=function(e,t,n,r,i){var o=this._cache.get(e);return null==o&&(o=a_e(e,t,n,r,i,this._clearCacheEntry),this._cache.set(e,o)),o},t._fetchAndSaveQuery=function(e,t,n,r,i,o,s){var a,l,c=this,u=this._environment,d=u.check(t),f=d.status,h="available"===f,p=h||"partial"===i&&"stale"!==f,g=function(){};switch(r){case"store-only":a=!1,l=!0;break;case"store-or-network":a=!h,l=p;break;case"store-and-network":a=!0,l=p;break;default:a=!0,l=!1}if(l){var m=o_e(t,e),v=a_e(e,t,d,m,null,this._clearCacheEntry);this._cache.set(e,v)}if(a){var y,_=o_e(t,e);n.subscribe({start:function(n){y=n;var r=c._cache.get(e);r&&r.setNetworkSubscription(y);var i=null==s?void 0:s.start;i&&i((0,Hye.default)((0,Hye.default)({},n),{},{unsubscribe:function(){r_e(t)&&n.unsubscribe()}}))},next:function(){var n=c._getOrCreateCacheEntry(e,t,d,_,y);n.processedPayloadsCount+=1,n.setValue(_),g();var r=null==s?void 0:s.next;null!=r&&r(u.lookup(t.fragment))},error:function(n){var r=c._getOrCreateCacheEntry(e,t,d,n,y);0===r.processedPayloadsCount&&r.setValue(n),g(),y=null,r.setNetworkSubscription(null);var i=null==s?void 0:s.error;i&&i(n)},complete:function(){g(),y=null;var t=c._cache.get(e);t&&t.setNetworkSubscription(null);var n=null==s?void 0:s.complete;n&&n()},unsubscribe:null==s?void 0:s.unsubscribe});var b=this._cache.get(e);if(!b){var x=new Promise(function(e){g=e});x.displayName="Relay("+t.fragment.node.name+")",b=a_e(e,t,d,x,y,this._clearCacheEntry),this._cache.set(e,b)}}else{var S=null==s?void 0:s.complete;S&&S()}var w=this._cache.get(e);return null==w&&Yye(!1),u.__log({name:"queryresource.fetch",resourceID:w.id,operation:t,profilerContext:o,fetchPolicy:r,renderPolicy:i,queryAvailability:d,shouldFetch:a}),w},e}();var c_e=n_e?new WeakMap:new Map;var u_e={getQueryResourceForEnvironment:function(e){var t=c_e.get(e);if(t)return t;var n=function(e){return new l_e(e)}(e);return c_e.set(e,n),n},getQueryCacheIdentifier:i_e};A.useMemo;var d_e=A;d_e.useCallback,d_e.useEffect;var f_e=A,h_e=(0,fme.__internal.createRelayLoggingContext)(f_e),p_e=A.useContext;var g_e=function(){return p_e(h_e)},m_e=Nre.default,v_e=m_e(zre),y_e=m_e(Gre),__e=m_e(iie),b_e=u_e.getQueryResourceForEnvironment,x_e=jye,S_e=g_e,w_e=gre,E_e=A;E_e.useDebugValue;var k_e=E_e.useEffect,C_e=E_e.useMemo,A_e=E_e.useRef,N_e=E_e.useState,T_e=fme,R_e=T_e.__internal,D_e=R_e.fetchQuery,I_e=R_e.getPromiseForActiveRequest,F_e=T_e.RelayFeatureFlags,O_e=T_e.areEqualSelectors,P_e=T_e.createOperationDescriptor,M_e=T_e.getPendingOperationsForFragment,L_e=T_e.getSelector,z_e=T_e.getVariablesFromFragment,j_e=T_e.handlePotentialSnapshotErrors,U_e=T_e.recycleNodesInto;function B_e(e,t){if("bailout"===t.kind)return null;var n=e.getStore().getEpoch();if(n===t.epoch)return null;if("singular"===t.kind){var r=e.lookup(t.snapshot.selector),i=U_e(t.snapshot.data,r.data),o={data:i,isMissingData:r.isMissingData,missingClientEdges:r.missingClientEdges,missingLiveResolverFields:r.missingLiveResolverFields,seenRecords:r.seenRecords,selector:r.selector,fieldErrors:r.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:n}]}for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var c=t.snapshots[l],u=e.lookup(c.selector),d=U_e(c.data,u.data),f={data:d,isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors};d!==c.data&&(s=!0),a.push(f)}return a.length!==t.snapshots.length&&w_e(!1),[s,{kind:"plural",snapshots:a,epoch:n}]}function $_e(e,t,n,r,i){var o=z_e(t,n),s=(0,v_e.default)((0,v_e.default)({},o),{},{id:r.clientEdgeDestinationID}),a=P_e(r.request,s,null==i?void 0:i.networkCacheConfig);return[b_e(e).prepare(a,D_e(e,a),null==i?void 0:i.fetchPolicy),I_e(e,a.request)]}function q_e(e,t){return null==t?{kind:"bailout"}:"PluralReaderSelector"===t.kind?{kind:"plural",snapshots:t.selectors.map(function(t){return e.lookup(t)}),epoch:e.getStore().getEpoch()}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch()}}var G_e=function(e,t,n,r){var i,o,s=C_e(function(){return L_e(e,t)},[e,t]),a=!0===(null==e||null===(i=e.metadata)||void 0===i?void 0:i.plural);a?null==t||Array.isArray(t)||w_e(!1):Array.isArray(t)&&w_e(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||w_e(!1);var l,c=x_e();F_e.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=S_e());var u=N_e(function(){return q_e(c,s)}),d=u[0],f=u[1],h=d,p=N_e(h),g=p[0],m=p[1],v=g,y=N_e(s),_=y[0],b=y[1],x=N_e(c),S=x[0],w=x[1];if(!O_e(s,_)||c!==S){b(s),w(c);var E=q_e(c,s);f(E),m(E),h=E,v=E}var k=A_e(!1);if(k_e(function(){k.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||F_e.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var C=C_e(function(){var n,i=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingClientEdges)&&void 0!==t?t:null;var n,r=null,i=(0,y_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingClientEdges){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,y_e.default)(o.missingClientEdges);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h),o=[];if(null!=i&&i.length){n=[];var s,a=(0,y_e.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=$_e(c,e,t,l,r),d=u[0],f=u[1];n.push(d),null!=f&&o.push(f)}}catch(p){a.e(p)}finally{a.f()}}return[n,o]},[h,c,e,t,r]),A=C[0],N=C[1];if(N.length)throw Promise.all(N);k_e(function(){var e=b_e(c);if(null!=A&&A.length){var t,n=[],r=(0,y_e.default)(A);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(e.retain(i))}}catch(o){r.e(o)}finally{r.f()}return function(){for(var e=0,t=n;e<t.length;e++){t[e].dispose()}}}},[c,A])}if(function(e){return"bailout"!==e.kind&&("singular"===e.kind?e.snapshot.isMissingData:e.snapshots.some(function(e){return e.isMissingData}))}(h)){var T=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingLiveResolverFields)&&void 0!==t?t:null;var n,r=null,i=(0,y_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingLiveResolverFields){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,y_e.default)(o.missingLiveResolverFields);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h);if(null!=T&&T.length>0)throw Promise.all(T.map(function(e){return c.getStore().getLiveResolverPromise(e)}));if(F_e.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==S||!k.current||!O_e(k.current,s)){null==s&&w_e(!1);var R="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,D=M_e(c,e,R);if(D)throw D.promise}}!function(e,t,n){if("singular"===t.kind)j_e(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,y_e.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;j_e(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var I,F=A_e(!1);if(k_e(function(){var e=v,t=B_e(c,v);if(null!==t){var n=t[0],r=t[1];n&&f(r),e=r}return function(e,t,n,r){if("bailout"===t.kind)return function(){};if("singular"===t.kind){var i=e.subscribe(t.snapshot,function(t){n(function(n){if("singular"!==n.kind||n.snapshot.selector!==t.selector){var i=B_e(e,n);if(null!=i){var o=i[0],s=i[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:o}),r.current=o,o?s:n}return n}return r.current=!0,{kind:"singular",snapshot:t,epoch:e.getStore().getEpoch()}})});return function(){i.dispose()}}var o=t.snapshots.map(function(t,i){return e.subscribe(t,function(t){n(function(n){var o;if("plural"!==n.kind||(null===(o=n.snapshots[i])||void 0===o?void 0:o.selector)!==t.selector){var s=B_e(e,n);if(null!=s){var a=s[0],l=s[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:a}),r.current=r.current||a,a?l:n}return n}var c=(0,__e.default)(n.snapshots);return c[i]=t,r.current=!0,{kind:"plural",snapshots:c,epoch:e.getStore().getEpoch()}})})});return function(){var e,t=(0,y_e.default)(o);try{for(t.s();!(e=t.n()).done;)e.value.dispose()}catch(n){t.e(n)}finally{t.f()}}}(c,e,f,F)},[c,v]),F.current){var O=B_e(c,h);if(null!=O){var P=O[0],M=O[1];P&&(f(M),h=M)}F.current=!1}if(a){var L=null==t;I=C_e(function(){return"bailout"===h.kind?L?null:[]:("plural"!==h.kind&&w_e(!1),h.snapshots.map(function(e){return e.data}))},[h,L])}else"bailout"===h.kind?I=null:("singular"!==h.kind&&w_e(!1),I=h.snapshot.data);return F_e.LOG_MISSING_RECORDS_IN_PROD&&null!=t&&(void 0===I||Array.isArray(I)&&I.length>0&&I.every(function(e){return void 0===e})),I},V_e=Nre.default,K_e=V_e(zre),W_e=V_e(Gre),H_e=V_e(iie),J_e=u_e.getQueryResourceForEnvironment,X_e=jye,Q_e=g_e,Y_e=gre,Z_e=A;Z_e.useDebugValue;var ebe=Z_e.useEffect,tbe=Z_e.useMemo,nbe=Z_e.useRef,rbe=Z_e.useState,ibe=fme,obe=ibe.__internal,sbe=obe.fetchQuery,abe=obe.getPromiseForActiveRequest,lbe=ibe.RelayFeatureFlags,cbe=ibe.areEqualSelectors,ube=ibe.createOperationDescriptor,dbe=ibe.getPendingOperationsForFragment,fbe=ibe.getSelector,hbe=ibe.getVariablesFromFragment,pbe=ibe.handlePotentialSnapshotErrors,gbe=ibe.recycleNodesInto;function mbe(e,t){if("bailout"===t.kind)return null;var n=e.getStore().getEpoch();if(n===t.epoch)return null;if("singular"===t.kind){var r=e.lookup(t.snapshot.selector),i=gbe(t.snapshot.data,r.data),o={data:i,isMissingData:r.isMissingData,missingClientEdges:r.missingClientEdges,missingLiveResolverFields:r.missingLiveResolverFields,seenRecords:r.seenRecords,selector:r.selector,fieldErrors:r.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:n,selector:t.selector,environment:t.environment}]}for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var c=t.snapshots[l],u=e.lookup(c.selector),d=gbe(c.data,u.data),f={data:d,isMissingData:u.isMissingData,missingClientEdges:u.missingClientEdges,missingLiveResolverFields:u.missingLiveResolverFields,seenRecords:u.seenRecords,selector:u.selector,fieldErrors:u.fieldErrors};d!==c.data&&(s=!0),a.push(f)}return a.length!==t.snapshots.length&&Y_e(!1),[s,{kind:"plural",snapshots:a,epoch:n,selector:t.selector,environment:t.environment}]}function vbe(e,t,n,r,i){var o=hbe(t,n),s=(0,K_e.default)((0,K_e.default)({},o),{},{id:r.clientEdgeDestinationID}),a=ube(r.request,s,null==i?void 0:i.networkCacheConfig),l=J_e(e).prepare(a,sbe(e,a),null==i?void 0:i.fetchPolicy),c=abe(e,a.request);return null!=c&&null==c.displayName&&(c.displayName=r.request.params.name),[l,c]}function ybe(e,t,n){if("bailout"===t.kind)return function(){};if("singular"===t.kind){var r=e.subscribe(t.snapshot,function(r){n(function(n){var i=null;if("singular"!==n.kind||n.snapshot.selector!==r.selector||n.environment!==e){var o=mbe(n.environment,n);if(null!=o){var s=o[0],a=o[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:s}),i=s?a:n}else i=n}else i={kind:"singular",snapshot:r,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment};return i})});return function(){r.dispose()}}var i=t.snapshots.map(function(r,i){return e.subscribe(r,function(r){n(function(n){var o,s=null;if("plural"!==n.kind||(null===(o=n.snapshots[i])||void 0===o?void 0:o.selector)!==r.selector||n.environment!==e){var a=mbe(n.environment,n);if(null!=a){var l=a[0],c=a[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:l}),s=l?c:n}else s=n}else{var u=(0,H_e.default)(n.snapshots);u[i]=r,s={kind:"plural",snapshots:u,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment}}return s})})});return function(){var e,t=(0,W_e.default)(i);try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}}}function _be(e,t){return null==t?{kind:"bailout",environment:e}:"PluralReaderSelector"===t.kind?{kind:"plural",snapshots:t.selectors.map(function(t){return e.lookup(t)}),epoch:e.getStore().getEpoch(),selector:t,environment:e}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch(),selector:t,environment:e}}var bbe=function(e,t,n,r){var i,o,s=tbe(function(){return fbe(e,t)},[e,t]),a=!0===(null==e||null===(i=e.metadata)||void 0===i?void 0:i.plural);a?null==t||Array.isArray(t)||Y_e(!1):Array.isArray(t)&&Y_e(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||Y_e(!1);var l,c=X_e();lbe.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=Q_e());var u=rbe(function(){return _be(c,s)}),d=u[0],f=u[1],h=d,p=h.environment;if(!cbe(s,h.selector)||c!==h.environment){var g=_be(c,s);f(g),h=g}var m=nbe(!1);if(ebe(function(){m.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||lbe.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var v=tbe(function(){var n,i=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingClientEdges)&&void 0!==t?t:null;var n,r=null,i=(0,W_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingClientEdges){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,W_e.default)(o.missingClientEdges);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h),o=[];if(null!=i&&i.length){n=[];var s,a=(0,W_e.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=vbe(c,e,t,l,r),d=u[0],f=u[1];n.push(d),null!=f&&o.push(f)}}catch(p){a.e(p)}finally{a.f()}}return[n,o]},[h,c,e,t,r]),y=v[0],_=v[1];if(_.length){var b=Promise.all(_);throw b.displayName="RelayClientEdge(".concat(_.map(function(e){return e.displayName}).join(","),")"),b}ebe(function(){var e=J_e(c);if(null!=y&&y.length){var t,n=[],r=(0,W_e.default)(y);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push(e.retain(i))}}catch(o){r.e(o)}finally{r.f()}return function(){for(var e=0,t=n;e<t.length;e++){t[e].dispose()}}}},[c,y])}if(function(e){return"bailout"!==e.kind&&("singular"===e.kind?e.snapshot.isMissingData:e.snapshots.some(function(e){return e.isMissingData}))}(h)){var x=function(e){if("bailout"===e.kind)return null;var t;if("singular"===e.kind)return null!==(t=e.snapshot.missingLiveResolverFields)&&void 0!==t?t:null;var n,r=null,i=(0,W_e.default)(e.snapshots);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.missingLiveResolverFields){var s;r=null!==(s=r)&&void 0!==s?s:[];var a,l=(0,W_e.default)(o.missingLiveResolverFields);try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(u){l.e(u)}finally{l.f()}}}}catch(u){i.e(u)}finally{i.f()}return r}(h);if(null!=x&&x.length>0){var S=Promise.all(x.map(function(e){return c.getStore().getLiveResolverPromise(e)}));throw S.displayName="RelayLiveResolver("+e.name+")",S}if(lbe.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==p||!m.current||!cbe(m.current,s)){null==s&&Y_e(!1);var w="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,E=dbe(c,e,w);if(E)throw E.promise}}!function(e,t,n){if("singular"===t.kind)pbe(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,W_e.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;pbe(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var k,C=nbe(null);if(ebe(function(){var e=C.current;if(null!=e){if(h.environment===e.environment&&h.selector===e.selector)return;e.dispose()}if("bailout"!==h.kind){var t=h,n=mbe(h.environment,h);if(null!==n){var r=n[0],i=n[1];if(r)return void f(i);t=i}var o=ybe(h.environment,t,f);C.current={dispose:o,selector:h.selector,environment:h.environment}}},[h]),ebe(function(){if(null==C.current&&"bailout"!==h.kind){var e=ybe(h.environment,h,f);C.current={dispose:e,selector:h.selector,environment:h.environment}}return function(){var e;null===(e=C.current)||void 0===e||e.dispose(),C.current=null}},[]),a){var A=null==t;k=tbe(function(){return"bailout"===h.kind?A?null:[]:("plural"!==h.kind&&Y_e(!1),h.snapshots.map(function(e){return e.data}))},[h,A])}else"bailout"===h.kind?k=null:("singular"!==h.kind&&Y_e(!1),k=h.snapshot.data);return lbe.LOG_MISSING_RECORDS_IN_PROD&&null!=t&&(void 0===k||Array.isArray(k)&&k.length>0&&k.every(function(e){return void 0===e})),k},xbe=Nre.default;xbe(G_e),xbe(bbe);var Sbe=A;Sbe.useContext,Sbe.useEffect,Sbe.useState,Sbe.useRef,A.useState;var wbe=A,Ebe=fme;Ebe.createOperationDescriptor,Ebe.getRequest,wbe.useMemo,fme.__internal.fetchQuery,(0,Nre.default)(zre);var kbe=A;kbe.useEffect,kbe.useRef,(0,Nre.default)(Gre);var Cbe=A;Cbe.useCallback,Cbe.useEffect,Cbe.useRef,Cbe.useState,A.useDebugValue,fme.getFragment,(0,Nre.default)(zre);var Abe=A;fme.commitMutation,Abe.useState,Abe.useEffect,Abe.useRef,Abe.useCallback;var Nbe=fme;Nbe.ConnectionInterface,Nbe.getValueAtPath;var Tbe=A,Rbe=fme;Rbe.__internal.getObservableForActiveRequest,Rbe.getSelector,Tbe.useEffect,Tbe.useState,Tbe.useMemo,(0,Nre.default)(zre);var Dbe=A;Dbe.useCallback,Dbe.useRef,Dbe.useState;var Ibe=fme;Ibe.__internal.fetchQuery,Ibe.createOperationDescriptor,Ibe.getPaginationVariables,Ibe.getRefetchMetadata,Ibe.getSelector,(0,Nre.default)(zre);var Fbe=A;Fbe.useCallback,Fbe.useEffect,Fbe.useState;var Obe=fme;Obe.__internal.fetchQuery,Obe.RelayFeatureFlags,Obe.createOperationDescriptor,Obe.getPaginationVariables,Obe.getRefetchMetadata,Obe.getSelector;var Pbe=Nre.default;Pbe(zre),Pbe(Gre);var Mbe=fme;Mbe.__internal.fetchQuery,Mbe.RelayFeatureFlags,Mbe.createOperationDescriptor,Mbe.getPendingOperationsForFragment,Mbe.getSelector,Mbe.getVariablesFromFragment,Mbe.handlePotentialSnapshotErrors,(0,Nre.default)(Gre);var Lbe=A;Lbe.useCallback,Lbe.useEffect,Lbe.useInsertionEffect,Lbe.useRef,Lbe.useState,fme.getRequest,(0,Nre.default)(Gre);var zbe=A;zbe.useCallback,zbe.useEffect,zbe.useRef,zbe.useState;var jbe=fme;jbe.RelayFeatureFlags,jbe.getRequest,(0,Nre.default)(zre);var Ube=A;Ube.useCallback,Ube.useContext,Ube.useReducer;var Bbe=fme;Bbe.__internal.fetchQuery,Bbe.createOperationDescriptor,Bbe.getFragmentIdentifier,Bbe.getRefetchMetadata,Bbe.getSelector,Bbe.getValueAtPath,(0,Nre.default)(zre);var $be=A;$be.useCallback,$be.useDebugValue,$be.useState;var qbe=fme;qbe.RelayFeatureFlags,qbe.getFragment,qbe.getFragmentIdentifier,qbe.getPaginationMetadata,(0,Nre.default)(zre);var Gbe=A;Gbe.useCallback,Gbe.useDebugValue,Gbe.useEffect,Gbe.useLayoutEffect,Gbe.useMemo,Gbe.useRef,Gbe.useState;var Vbe=fme;Vbe.getFragment,Vbe.getFragmentIdentifier,Vbe.getPaginationMetadata;var Kbe=fme;Kbe.ConnectionInterface,Kbe.RelayFeatureFlags,Kbe.getSelector,Kbe.getValueAtPath,A.useDebugValue;var Wbe=fme.__internal;Wbe.fetchQueryDeduped,Wbe.fetchQuery,A.useDebugValue,fme.getFragment;var Hbe=A;Hbe.useEffect,Hbe.useRef,A.useEffect,fme.requestSubscription;var Jbe=xme,Xbe=hve,Qbe=sye,Ybe=Pye,Zbe=fme,exe={ConnectionHandler:Zbe.ConnectionHandler,MutationTypes:Zbe.MutationTypes,RangeOperations:Zbe.RangeOperations,ReactRelayContext:Jbe,applyOptimisticMutation:Zbe.applyOptimisticMutation,commitLocalUpdate:Zbe.commitLocalUpdate,commitMutation:Zbe.commitMutation,createFragmentContainer:Xbe.createContainer,createPaginationContainer:Qbe.createContainer,createRefetchContainer:Ybe.createContainer,fetchQuery_DEPRECATED:Zbe.fetchQuery_DEPRECATED,graphql:Zbe.graphql,readInlineData:Zbe.readInlineData,requestSubscription:Zbe.requestSubscription,fetchQuery:Zbe.fetchQuery};let txe={make:function(e){let t=exe.ReactRelayContext.Provider;return c(t,{value:{environment:e.environment},children:e.children})}},nxe=txe;let rxe=function(e){let t=e.config,n=Cq(),r=p(()=>function(e,t,n){return _me.make(fme.Network.create(async(r,i,o,s)=>{let a=U(R(r.text),""),l=a.includes("Platform")||a.includes("platform")?e.platformApiEndpoint:e.apiEndpoint,c=Object.fromEntries([["content-type","application/json"]]),u=t();void 0!==u&&(c.Authorization="Bearer "+u);let d=(await fetch(l,{method:"POST",headers:c,body:U(JSON.stringify({query:a,variables:i}),"")})).json,f=await d();return ite(f)&&n(),f}),vme.make(new fme.RecordSource,void 0,void 0),void 0,void 0,void 0,void 0,void 0)}(t,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),[t,n]);return i(nxe.make,{environment:r,children:e.children})};function ixe(e){return"var("+e+")"}let oxe=lo([ci("background",ixe(yt.surfaceElevated)),ci("border","1px solid var("+yt.border+")"),ci("border-radius",ixe(xt.md)),ci("padding",ixe(_t.lg)),pi("flex"),gi("column"),ui("center"),bi("center"),ci("gap",ixe(_t.sm)),ci("min-height","160px"),Bi("center"),Gi({NAME:"percent",VAL:100}),ci("box-sizing","border-box")]),sxe=lo([ci("font-size","32px"),ci("line-height","1"),Ti(eo(4))]),axe=lo([ci("color",ixe(yt.textPrimary)),ci("font-size",ixe(bt.sizeMd)),ci("font-weight",ixe(bt.weightMedium)),Ti(eo(4))]),lxe=lo([ci("color",ixe(yt.textSecondary)),ci("font-size",ixe(bt.sizeSm)),ci("line-height",ixe(bt.lineHeightNormal))]),cxe=lo([ci("color",ixe(yt.textDisabled)),ci("font-size",ixe(bt.sizeXs)),ci("font-family",ixe(bt.fontFamilyMono)),Ni(eo(8))]);let uxe=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:sxe}),i("div",{children:t.title,className:axe}),i("div",{children:t.description,className:lxe}),i("div",{children:t.extensionPackage,className:cxe})],className:oxe})},dxe=lo([pi("flex"),ui("center"),bi("center"),ci("min-height","160px"),ci("color","var("+yt.textSecondary+")"),ci("font-size","var("+bt.sizeSm+")")]);function fxe(e){return i("div",{children:"Loading…",className:dxe})}lo([pi("flex"),ui("center"),bi("center"),ci("min-height","160px"),ci("color","var("+yt.error+")"),ci("font-size","var("+bt.sizeSm+")")]);let hxe=function(e){let t=uG(),n=function(e){let t=d(nV);if(void 0!==t)return t.getPanel(e)}(e.fragmentId);if(void 0===n)return null;let r=n.requiredAccess;return void 0===r||t(r)?i(S,{children:n.component(e.props),fallback:i(fxe,{})}):i(uxe,{definition:n})};let pxe=function(e){let t=function(e){let t=d(nV);return void 0!==t?t.getPanelsForPosition(e):[]}(e.name),n={contextId:e.contextId,resourceId:e.resourceId};return 0!==t.length?i("div",{children:t.map(e=>i(hxe,{fragmentId:e.fragmentId,props:n},e.fragmentId)),style:{display:"flex",flexDirection:"column",gap:"1rem"}}):null};let gxe=function(e){return r("div",{children:[r("header",{children:[i("h1",{children:"Platform overview",style:{margin:"0"}}),i("p",{children:"Summary panels contributed by connected plugins appear below.",style:{color:"#666",margin:"0.25rem 0 0"}})]}),i(pxe,{name:"platform-summary"})],style:{display:"flex",fontFamily:"system-ui",padding:"1.5rem",flexDirection:"column",gap:"1.5rem"}})},mxe={fragmentId:"host.home",title:"Home",menuEntry:{label:"Home",icon:void 0,group:void 0,sortOrder:0},requiredAccess:void 0,url:"/"};let vxe=function(e){let t=e.config,n=d(rG),r=_V(),o=sG(),s=se(void 0),l=function(e){return j(z(e.home,e=>e.trim()),e=>""===e||"/"===e?void 0:e)}(t);return a(()=>{!t.autoRedirectFirstPage&&q(l)&&(M(n,e=>e.register([mxe])),M(r,e=>e.register([Ue(Le(e=>e),i(gxe,{}))],{})))},[]),a(()=>{if((""===s||"/"===s)&&0!==o.length)if(void 0!==l)J(l);else if(t.autoRedirectFirstPage){let e=o.find(e=>!!$(e.url)&&aG(e));if(void 0!==e){let t=e.url;void 0!==t&&J(t)}}},[o.length,s]),null};function yxe(e,t){return j(j(ft(e),e=>Je(e,t)),ft)}function _xe(e){let t=yxe(e,"Upload_Release");return void 0!==t?mt(j(Je(t,"released"),pt),!0)?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:U(j(Je(t,"reason"),ut),"Could not release the uploaded file")}:{TAG:"Error",_0:"Could not release the uploaded file"}}function bxe(e,t){return{upload:(n,r)=>{let i=n.type;return ce(e()("mutation UploadPresign($store: ID!, $fileName: String!, $contentType: String) {\n Upload_Presign(store: $store, fileName: $fileName, contentType: $contentType) {\n uploadUrl\n storageRef\n }\n}",Ye([["store",t],["fileName",n.name],["contentType",i]])).then(e=>{let t=function(e){return j(yxe(e,"Upload_Presign"),e=>{let t=j(Je(e,"uploadUrl"),ut),n=j(Je(e,"storageRef"),ut);if(void 0!==t&&void 0!==n)return{uploadUrl:t,storageRef:n}})}(e);return void 0!==t?function(e,t,n,r,i){return new Promise((o,s)=>{let a=new XMLHttpRequest;a.open("PUT",e),a.setRequestHeader("Content-Type",r),a.upload.onprogress=e=>{if(e.lengthComputable&&e.total>0)return i(e.loaded/e.total*100)},a.onload=()=>{let e=a.status;return e>=200&&e<300?(i(100),o({TAG:"Ok",_0:t})):o({TAG:"Error",_0:"Upload failed (status "+e.toString()+")"})},a.onerror=()=>o({TAG:"Error",_0:"Upload failed (network error)"}),a.send(n)})}(t.uploadUrl,t.storageRef,n,i,r):Promise.resolve({TAG:"Error",_0:"Could not obtain an upload target"})}),e=>Promise.resolve({TAG:"Error",_0:"Upload request failed"}))},remove:n=>ce(e()("mutation UploadRelease($store: ID!, $storageRef: String!) {\n Upload_Release(store: $store, storageRef: $storageRef) {\n released\n reason\n }\n}",Ye([["store",t],["storageRef",n]])).then(_xe),e=>Promise.resolve({TAG:"Error",_0:"Release request failed"}))}}let xxe={pages:[],panels:[],routes:[]};function Sxe(e){return r("div",{children:[i("h1",{children:"Shell failed to boot"}),i("pre",{children:e.message})],style:{color:"#a00",fontFamily:"system-ui",padding:"2rem"}})}function wxe(e){return i("div",{children:"Loading…",style:{fontFamily:"system-ui",padding:"2rem"}})}function Exe(e){let t=e.extensions,n=d(rG),r=d(nV),i=_V();return a(()=>{0!==t.pages.length&&M(n,e=>e.register(t.pages)),0!==t.panels.length&&M(r,e=>e.register(t.panels)),0!==t.routes.length&&M(i,e=>e.register(t.routes,{}))},[]),null}function kxe(e){let t=e.uiHints,n=e.config,s=function(){let e=d(uV).routes;return p(()=>Pe(function(e){let t=e.length-1|0,n=0;for(;;){let r=n,i=t;if(i<0)return r;n={hd:e[i],tl:r},t=i-1|0}}(e.toReversed())),[e])}(),l=d(dV),c=function(e){let t=e.appName,n=e.platformName;return void 0!==t&&""!==t.trim()?t.trim():void 0!==n&&""!==n.trim()?at(n):"Reventless"}(n),u=r(o,{children:[i(Gne,{}),i(IV,{}),i(Hq,{})]});return a(()=>{document.title=c},[c]),r(o,{children:[i(vxe,{config:n}),i(yne,{config:n,uiHints:t}),i(Exe,{extensions:e.extensions}),i(tV,{appName:c,logoUrl:n.logoUrl,router:s,headerSlot:u,fallback:i(kne,{config:n,uiHints:t}),routesReady:l,loading:i(wxe,{})})]})}function Cxe(e){let t=e.discoverPlatforms,n=sV(se(void 0));if(void 0===n)return void 0!==t?i(BV,{discover:t}):i(Sxe,{message:"config.json sets mode = fleet but the app supplied no discoverPlatforms adapter to ShellApp"});let r=n[0];return i(lV,{scope:r,children:i(ne,{value:{prefix:oV(r),path:n[1]},children:i(kxe,{config:e.config,extensions:e.extensions,uiHints:e.uiHints})})})}function Axe(e){let t=e.access;return i(dG,{access:t,children:i(oG,{children:i(iV,{access:t,children:i(yV,{children:i(qa,{children:i($I.Provider.make,{children:i(rne,{children:e.children})})})})})})})}function Nxe(e){let t,n=e.uiHints,r=e.extensions,o=e.config,s=Cq();if("Single"===o.mode){let e=o.environment,s=o.platformName;t=void 0!==e&&void 0!==s?i(lV,{scope:{environment:e,platformName:s},children:i(kxe,{config:o,extensions:r,uiHints:n})}):i(kxe,{config:o,extensions:r,uiHints:n})}else t=i(Cxe,{config:o,extensions:r,uiHints:n,discoverPlatforms:e.discoverPlatforms});if("Anonymous"===o.authMode)return i(Axe,{access:o.accessTiers,children:t});if(void 0===s)return i(eG,{});let a=s.identity;return void 0!==a&&s.isAuthenticated?i(Axe,{access:a.groups.concat(o.accessTiers),children:t}):i(eG,{})}function Txe(e){let t=e.config,n=Cq();!function(e){Ke.contents=e}(t.assetOrigins);let o,s=se(void 0),l=t.mode;o="Single"===l?void 0:z(sV(s),e=>e[0]);let c=L(o,"",e=>e.environment+"|"+e.platformName),u=p(()=>{let e=function(e,t,n,r){return(i,o)=>{let s=i.includes("Platform")||i.includes("platform")?t:e,a=Object.fromEntries([["content-type","application/json"]]),l=n();return void 0!==l&&(a.Authorization="Bearer "+l),fetch(s,{method:"POST",headers:a,body:U(JSON.stringify({query:i,variables:o}),"")}).then(e=>(401===e.status&&r(),e.json())).then(e=>{let t=qO(e);return VO(t)&&r(),Promise.resolve(t)})}}(t.apiEndpoint,t.platformApiEndpoint,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),r=void 0!==o?(i=LV(o),e=>(t,n)=>{let r={contents:void 0};return i((t,n)=>e(t,n).then(e=>(r.contents=e,e.data)))(t,n).then(e=>{let t=r.contents;return void 0!==t?t:{data:e,errors:[]}})})(e):e;var i;return[KO(r),r]},[t,n,c]),d=u[0],f=h(d);f.current=d,yI.contents=d,a(()=>{let e={};hre(t=>(t=>{let n=e[t];if(void 0!==n)return n;let r=bxe(()=>f.current,t);return e[t]=r,r})(t),void 0,void 0)},[]);let g=U(t.theme,"Light"),m=L(j(n,e=>e.identity),"anonymous",e=>e.userId+"|"+e.groups.toSorted(ue).join(","));return i(xI,{execute:d,executeResult:u[1],children:i(rxe,{config:t,children:r(yO,{domainEventsEndpoint:t.domainApiEventsEndpoint,platformEventsEndpoint:t.platformApiEventsEndpoint,liveUpdates:t.liveUpdates,liveReconnectRefetch:t.liveReconnectRefetch,clientEventsNamespace:t.clientEventsNamespace,onAuthFailure:()=>M(n,e=>e.logout()),platformReadModelPrefixes:t.platformReadModelPrefixes,getToken:()=>j(n,e=>e.getToken()),children:[i(Vne,{config:t,onChange:e.reloadUiHints}),i(eO,{initialPreset:g,children:i(Nxe,{config:t,extensions:e.extensions,uiHints:e.uiHints,discoverPlatforms:e.discoverPlatforms})})]})})},m)}function Rxe(e,t){let n=s(()=>{}),r=n[1],i=n[0],o=f(()=>{(function(e){return ce(fetch(e).then(t=>t.ok?t.json().then(AF):(console.warn("[AutoUI] "+e+": not loaded (status "+t.status.toString()+") — no UI hints applied"),Promise.resolve({}))),t=>(console.warn("[AutoUI] "+e+": not loaded ("+String(t)+") — no UI hints applied"),Promise.resolve({})))})(e.uiHintsUrl).then(e=>r(t=>e))},[e.uiHintsUrl]);a(()=>{o()},[e.uiHintsUrl]);let l=p(()=>z(i,e=>function(e,t){let n={};return Object.entries(e).forEach(e=>{n[e[0]]=e[1]}),Object.entries(t).forEach(t=>{let r=t[0];$(e[r])&&console.info("[AutoUI] uiHints ("+r+"): code-supplied hints replace the ui-hints.json entry"),n[r]=t[1]}),n}(e,U(t.uiHints,{}))),[i]);return[l,o]}function Dxe(e){let t=e.extensions,n=e.config,r=Rxe(n,t),o=r[0];return i(kq,{authMode:n.authMode,apiEndpoint:n.apiEndpoint,cognitoClientId:n.identityProviderClientId,cognitoUserPoolId:n.identityProviderId,region:n.region,children:void 0!==o?i(Txe,{config:n,extensions:t,uiHints:o,reloadUiHints:r[1],discoverPlatforms:e.discoverPlatforms}):i(wxe,{})})}let Ixe=function(e){let t=e.registerModes,n=e.extensions,r=void 0!==n?n:xxe,o=s(()=>"LoadingConfig"),l=o[1],c=o[0];return a(()=>{ce(fetch("/config.json").then(e=>e.ok?e.json().then(jO):Promise.resolve({TAG:"Error",_0:"config.json: fetch failed with status "+e.status.toString()})),e=>Promise.resolve({TAG:"Error",_0:"config.json: fetch threw — "+String(e)})).then(e=>{if("Ok"===e.TAG){let n=e._0;return void 0!==t?ce(t(n).then(()=>l(e=>({TAG:"Ready",_0:n}))),e=>(console.error("[ShellApp] optional view modes failed to register — continuing without them: "+String(e)),l(e=>({TAG:"Ready",_0:n})),Promise.resolve())):(l(e=>({TAG:"Ready",_0:n})),Promise.resolve())}let n=e._0;return l(e=>({TAG:"Failed",_0:n})),Promise.resolve()})},[]),"object"!=typeof c?i(wxe,{}):"Ready"===c.TAG?i(Dxe,{config:c._0,extensions:r,discoverPlatforms:e.discoverPlatforms}):i(Sxe,{message:c._0})},Fxe=document.querySelector("#root");if(null!=Fxe){n(Fxe).render(i(Ixe,{registerModes:async function(e){await Promise.all(e.viewModes.map(async n=>{try{return await async function(e,n){switch(e){case"graph":let r=await t(()=>import("./GraphMode.res-DTTNn7pT.js"),__vite__mapDeps([1,2])).then(e=>e.init);r(n.graphLayout,void 0);let i=await t(()=>import("./StateMachineDiagram.res-B5gZ8z4Z.js"),__vite__mapDeps([3,2])).then(e=>e.init);return i();case"map":let o=await t(()=>import("./MapMode.res-BZ2EEQhC.js"),__vite__mapDeps([4])).then(e=>e.init),s=await t(()=>import("./Geocoder.res-DyJpd-ZD.js"),__vite__mapDeps([5])).then(e=>e.fromShell);return o(n.mapStyle,s(),void 0);default:return void console.error('[host-shell] config.json viewModes: unknown mode "'+e+'" — known modes: '+O.join(", "))}}(n,e)}catch(r){let e=F(r);if(e.RE_EXN_ID===I)return void console.error('[host-shell] view mode "'+n+'" failed to load: '+String(e._1));throw e}}))}}))}export{ce as $,D as A,z as B,_Q as C,fe as D,yt as E,_t as F,bt as G,ya as H,ft as I,R as J,$ as K,dt as L,fD as M,LD as N,yI as O,wP as P,xP as Q,xt as R,yQ as S,bQ as T,Z9 as a,Je as b,dQ as c,ge as d,me as e,M as f,U as g,at as h,Ds as i,XD as j,QD as k,_a as l,ut as m,j as n,$Z as o,zZ as p,ht as q,WI as r,uQ as s,BZ as t,L as u,jZ as v,YI as w,Ye as x,XF as y,T as z};