@reventlessdev/reventless-host-shell 3.0.0-alpha.90 → 3.0.0-alpha.92

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-CatoB-kl.js","assets/GraphMode.res-DGegk7zB.js","assets/GraphView.res-Ckpmr351.js","assets/StateMachineDiagram.res-c41yVijg.js","assets/MapMode.res-DTUdhw9P.js","assets/Geocoder.res-D08F-J-U.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=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}}function _e(e,t){let n=parseInt(e);return Number.isNaN(n)||n>2147483647||n<-2147483648?void 0:0|n}function be(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 xe(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 Se(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 we(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 Ee(e,t,n){for(;;){let r=e;if(0===r)return t;t=n(t,r.hd),e=r.tl}}let ke=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 Ce(e){return void 0!==e?e.h:0}function Ae(e,t,n,r){let i=Ce(e),o=Ce(r);return{k:t,v:n,h:i>=o?i+1|0:o+1|0,l:e,r:r}}function Ne(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 Ce(i)>=Ce(o)?Ae(i,e.k,e.v,Ae(o,t,n,r)):Ae(Ae(i,e.k,e.v,o.l),o.k,o.v,Ae(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 Ce(a)>=Ce(s)?Ae(Ae(e,t,n,s),r.k,r.v,a):Ae(Ae(e,t,n,s.l),s.k,s.v,Ae(s.r,r.k,r.v,a))}function Te(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?Ne(Te(e.l,t,n),r,i,e.r):Ne(e.l,r,i,Te(e.r,t,n))}let Re=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 De(e){let t=e=>{switch(e){case"":case"/":return 0;default:let t=xe(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 Ie={parsers:0,children:void 0,capture:void 0,wildcard:!1};function Fe(e,t){return{TAG:"Match",_0:e,_1:t}}function Oe(e){return"object"!=typeof e?"End"===e?0:{hd:"Wildcard",tl:0}:"Match"===e.TAG?{hd:{TAG:"Match",_0:e._0},tl:Oe(e._1)}:{hd:"Capture",tl:Oe(e._1)}}function Pe(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:we(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 Me(e){return Ee(we(e),Ie,(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:Ie);return{parsers:n.parsers,children:n.children,capture:e,wildcard:n.wildcard}}{let e=a._0,t=Re(o,e),i=r(s,void 0!==t?t:Ie);return{parsers:n.parsers,children:Te(o,e,i),capture:n.capture,wildcard:n.wildcard}}};return r(e,n)}(Oe(t._0),t,e))}function Le(e,t){let n=De(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=Re(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=Pe(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 ze(e){return e("End")}let je={prefix:function(e){return Se({hd:"",tl:e.prefix}).join("/")},wildcard_match:function(e){return Se({hd:"",tl:e.matched}).join("/")},of_parts:function(e){return{prefix:0,matched:De(e)}}},Ue=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(be(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("/"+Se(t).join("/")),t)}(e=>e,e)},Be=function(e,t){return{TAG:"Route",_0:e,_1:t,_2:e=>e}};let $e=l({});function qe(e,t){return Object.assign(Object.assign({},e),t)}function Ge(){return d($e)}let Ve=$e.Provider;let Ke=function(e){return c(Ve,{value:e.registry,children:e.children})},We={contents:{}};function He(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(We.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 Je={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 Xe(e,t){if(t in e)return T(e[t])}function Qe(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 Ye(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 Ze(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 et=/[^aeiou]y$/i;function tt(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 nt(e){return function(e){return et.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"}(tt(e))}let rt=Ze([["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 it(e){return e===e.toUpperCase()&&e!==e.toLowerCase()}function ot(e){return e===e.toLowerCase()&&e!==e.toUpperCase()}function st(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 at(e){let t=e.toLowerCase(),n=Xe(rt,t);return void 0!==n?n:0===e.length?"":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function lt(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(it(n)){let s=o>0&&ot(e.charAt(o-1|0)),a=(o+1|0)<t&&ot(e.charAt(o+1|0)),l=o>0&&it(e.charAt(o-1|0));(s||l&&a)&&i(),r.contents=r.contents+n}else if(st(n)){let t=!1;if(o>0){let n=e.charAt(o-1|0);t=it(n)||ot(n)}t&&i(),r.contents=r.contents+n}else r.contents=r.contents+n}return i(),n}(e);return 0!==t.length?t.map(at).join(" "):e}let ct=tt;function ut(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 dt(e){if("string"==typeof e)return e}function ft(e){if("number"==typeof e)return e}function ht(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return e}function pt(e){if(Array.isArray(e))return e}function gt(e){if("boolean"==typeof e)return e}let mt=function(e,t){for(var n in e)t(n)};function vt(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)&&vt(t[r],e[r])||(n.contents=!1)};return mt(e,r),n.contents&&mt(t,i),n.contents}}{let n=0;for(;;){let r=n;if(r===i)return!0;if(!vt(e[r],t[r]))return!1;n=r+1|0}}}function yt(e,t){return"number"!=typeof e&&"bigint"!=typeof e||"number"!=typeof t&&"bigint"!=typeof t?!vt(e,t):e!==t}let _t={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"},bt={xs:"--rv-spacing-xs",sm:"--rv-spacing-sm",md:"--rv-spacing-md",lg:"--rv-spacing-lg",xl:"--rv-spacing-xl",xxl:"--rv-spacing-xxl"},xt={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"},St={sm:"--rv-radius-sm",md:"--rv-radius-md",lg:"--rv-radius-lg",full:"--rv-radius-full"},wt="--rv-shadow-sm",Et="--rv-shadow-md",kt="--rv-shadow-lg";function Ct(e){switch(e){case"Wide":return 0;case"Compact":return 1;case"Narrow":return 2;case"Tight":return 3}}let At={compact:"(max-width: 1024px)",narrow:"(max-width: 720px)",tight:"(max-width: 520px)",bandRank:Ct,atLeastAsNarrow:function(e,t){return Ct(e)>=Ct(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}}},Nt="x-reventless-union",Tt="x-reventless-union-member";function Rt(e){let t,n=Xe(e,Nt);if(void 0!==n){let e=dt(n);t=void 0!==e?e:j(j(ht(n),e=>Xe(e,"name")),dt)}else t=void 0;return j(t,e=>""===e?void 0:e)}function Dt(e){return j(j(Xe(e,Tt),dt),e=>""===e?void 0:e)}function It(e){return j(ht(e),e=>j(j(Xe(e,"properties"),ht),t=>z(j(j(j(Xe(t,"TAG"),ht),e=>Xe(e,"const")),dt),n=>({tag:n,memberType:Dt(e),properties:Ze(Qe(t).filter(e=>"TAG"!==e[0]))}))))}function Ft(e){return j(ht(e),e=>ge(["oneOf","anyOf"],void 0,(t,n)=>void 0!==t?t:j(j(Xe(e,n),pt),t=>{let n=t.filter(e=>!vt(j(j(ht(e),e=>Xe(e,"type")),dt),"null")),r=n.length;if(1===r)return Ft(n[0]);if(0===r)return;let i=me(n,It);return i.length===n.length?{name:Rt(e),arms:i}:void 0})))}function Ot(e,t){let n=t.memberType;return void 0!==n?n:z(e.name,e=>e+t.tag)}function Pt(e,t){let n=e.arms.find(n=>n.tag===t||vt(Ot(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 Mt(e){return Ze([["type","object"],["properties",e.properties]])}function Lt(e){let t=ht(e);if(void 0===t)return e;let n=Xe(t,"type"),r=Xe(t,"properties");return void 0!==n||void 0!==r||$(Ft(e))?e:U(z(ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(Xe(t,n),pt),e=>e.find(e=>yt(j(j(ht(e),e=>Xe(e,"type")),dt),"null")))),Lt),e)}function zt(e){return j(ht(Lt(e)),e=>{if("array"===j(Xe(e,"type"),dt))return z(Xe(e,"items"),Lt)})}let jt={initial:"initial",inherit_:"inherit_",unset:"unset",toString:function(e){return"inherit_"===e?"inherit":"unset"===e?"unset":"initial"}};function Ut(e){return t="--",e.startsWith(t)?e:"--"+e;var t}function Bt(e){if("var"===e.NAME)return"var("+Ut(e.VAL)+")";let t=e.VAL;return"var("+Ut(t[0])+","+t[1]+")"}let $t={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 qt(e){return e.VAL.toString()+"%"}function Gt(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 Vt={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:Gt};let Kt={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 Gt(t);let n=t.NAME;if("subtract"===n){let n=t.VAL;return"calc("+e(n[0])+" - "+e(n[1])+")"}if("percent"===n)return qt(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 Gt(t);let r=t.VAL;return"calc("+e(r[0])+" * "+r[1].toString()+")"}};let Wt={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 Ht={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 Jt={auto:"auto",toString:function(e){return"auto"}};let Xt={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 Qt={toString:function(e){return"object"==typeof e?e.VAL.toString():"infinite"}};let Yt={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 Zt(e){let t=e.NAME;return"var"===t||"varDefault"===t?Bt(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 en(e){let t=e.NAME;return"percent"===t?qt(e):"num"===t?e.VAL.toString():Bt(e)}function tn(e){return"percent"===e.NAME?qt(e):Bt(e)}function nn(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()+", "+en(t[3])+")"}if("hex"===t)return"#"+e.VAL;if("hsl"===t){let t=e.VAL;return"hsl("+Zt(t[0])+", "+tn(t[1])+", "+tn(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("+Zt(n[0])+", "+tn(n[1])+", "+tn(n[2])+", "+en(n[3])+")"}let rn={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 on={toString:function(e){return"object"==typeof e?e.VAL.toString():"normal"}};let sn={toString:function(e){return"inline"===e?"inline":"block"===e?"block":"run-in"}};let an={toString:function(e){return"grid"===e?"grid":"table"===e?"table":"flex"}};let ln={toString:function(e){return"list-item"}};let cn={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 un={toString:function(e){return"contents"===e?"contents":"none"}};let dn={toString:function(e){return"inlineBlock"===e?"inline-block":"inlineFlex"===e?"inline-flex":"inlineGrid"===e?"inline-grid":"inline-table"}};let fn={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 hn={toString:function(e){return"firstBaseline"===e?"first baseline":"baseline"===e?"baseline":"last baseline"}};let pn={toString:function(e){return"normal"}};let gn={toString:function(e){return"spaceAround"===e?"space-around":"stretch"===e?"stretch":"spaceBetween"===e?"space-between":"space-evenly"}};let mn={toString:function(e){return"right"===e?"right":"justify"===e?"justify":"start"===e?"start":"center"===e?"center":"left"}};let vn={toString:function(e){return"normal"===e?"normal":"stretch"}};let yn={toString:function(e){return"stretch"===e?"stretch":"normal"===e?"normal":"auto"}};let _n={toString:function(e){return"wrapReverse"===e?"wrap-reverse":"nowrap"===e?"nowrap":"wrap"}};let bn={toString:function(e){return"row"===e?"row":"columnReverse"===e?"column-reverse":"rowReverse"===e?"row-reverse":"column"}};let xn={toString:function(e){return"none"===e?"none":"text"===e?"text":"all"===e?"all":"contain"===e?"contain":"auto"}};let Sn={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}};let wn={toString:function(e){return"none"}};let En={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}},kn={$$var:function(e){return{NAME:"var",VAL:e}},varDefault:function(e,t){return{NAME:"varDefault",VAL:[e,t]}},toString:Bt},Cn={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()+")"}},An={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 nn(e);if("lightDark"!==e.NAME)return nn(e);let t=e.VAL;return"light-dark("+nn(t[0])+", "+nn(t[1])+")"}},Nn=wn,Tn=wn,Rn=wn,Dn=wn,In=An.transparent;function Fn(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]=On(t._1);break;case"PseudoClass":e[":"+t._0]=On(t._1);break;case"PseudoClassParam":e[":"+t._0+"("+t._1+")"]=On(t._2)}return e}function On(e){return ke(e,{},Fn)}function Pn(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):"auto";let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):Kt.toString(e)}function Mn(e){if("object"!=typeof e)return An.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):An.toString(e)}function Ln(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Jt.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?kn.toString(e):Kt.toString(e)}let zn=Vt.px;function jn(e){return"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):rn.toString(e)}var Un=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(_U){}}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}(),Bn="-ms-",$n="-moz-",qn="-webkit-",Gn="comm",Vn="rule",Kn="decl",Wn="@keyframes",Hn=Math.abs,Jn=String.fromCharCode,Xn=Object.assign;function Qn(e){return e.trim()}function Yn(e,t,n){return e.replace(t,n)}function Zn(e,t){return e.indexOf(t)}function er(e,t){return 0|e.charCodeAt(t)}function tr(e,t,n){return e.slice(t,n)}function nr(e){return e.length}function rr(e){return e.length}function ir(e,t){return t.push(e),e}var or=1,sr=1,ar=0,lr=0,cr=0,ur="";function dr(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:or,column:sr,length:s,return:""}}function fr(e,t){return Xn(dr("",null,null,"",null,null,0),e,{length:-e.length},t)}function hr(){return cr=lr>0?er(ur,--lr):0,sr--,10===cr&&(sr=1,or--),cr}function pr(){return cr=lr<ar?er(ur,lr++):0,sr++,10===cr&&(sr=1,or++),cr}function gr(){return er(ur,lr)}function mr(){return lr}function vr(e,t){return tr(ur,e,t)}function yr(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 _r(e){return or=sr=1,ar=nr(ur=e),lr=0,[]}function br(e){return ur="",e}function xr(e){return Qn(vr(lr-1,Er(91===e?e+2:40===e?e+1:e)))}function Sr(e){for(;(cr=gr())&&cr<33;)pr();return yr(e)>2||yr(cr)>3?"":" "}function wr(e,t){for(;--t&&pr()&&!(cr<48||cr>102||cr>57&&cr<65||cr>70&&cr<97););return vr(e,mr()+(t<6&&32==gr()&&32==pr()))}function Er(e){for(;pr();)switch(cr){case e:return lr;case 34:case 39:34!==e&&39!==e&&Er(cr);break;case 40:41===e&&Er(e);break;case 92:pr()}return lr}function kr(e,t){for(;pr()&&e+cr!==57&&(e+cr!==84||47!==gr()););return"/*"+vr(t,lr-1)+"*"+Jn(47===e?e:pr())}function Cr(e){for(;!yr(gr());)pr();return vr(e,lr)}function Ar(e){return br(Nr("",null,null,null,[""],e=_r(e),0,[0],e))}function Nr(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=pr()){case 40:if(108!=p&&58==er(w,d-1)){-1!=Zn(w+=Yn(xr(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:w+=xr(y);break;case 9:case 10:case 13:case 32:w+=Sr(p);break;case 92:w+=wr(mr()-1,7);continue;case 47:switch(gr()){case 42:case 47:ir(Rr(kr(pr(),mr()),t,n),l);break;default:w+="/"}break;case 123*g:a[c++]=nr(w)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(w=Yn(w,/\f/g,"")),h>0&&nr(w)-d&&ir(h>32?Dr(w+";",r,n,d-1):Dr(Yn(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(ir(S=Tr(w,t,n,c,u,i,a,_,b=[],x=[],d),o),123===y)if(0===u)Nr(w,t,S,S,b,o,d,a,x);else switch(99===f&&110===er(w,3)?100:f){case 100:case 108:case 109:case 115:Nr(e,S,S,r&&ir(Tr(e,S,S,0,0,i,a,_,i,b=[],d),x),i,x,d,a,r?b:x);break;default:Nr(w,S,S,S,[""],x,0,a,x)}}c=u=h=0,g=v=1,_=w="",d=s;break;case 58:d=1+nr(w),h=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==hr())continue;switch(w+=Jn(y),y*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(nr(w)-1)*v,v=1;break;case 64:45===gr()&&(w+=xr(pr())),f=gr(),u=d=nr(_=w+=Cr(mr())),y++;break;case 45:45===p&&2==nr(w)&&(g=0)}}return o}function Tr(e,t,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=0===i?o:[""],h=rr(f),p=0,g=0,m=0;p<r;++p)for(var v=0,y=tr(e,d+1,d=Hn(g=s[p])),_=e;v<h;++v)(_=Qn(g>0?f[v]+" "+y:Yn(y,/&\f/g,f[v])))&&(l[m++]=_);return dr(e,t,n,0===i?Vn:a,l,c,u)}function Rr(e,t,n){return dr(e,t,n,Gn,Jn(cr),tr(e,2,-2),0)}function Dr(e,t,n,r){return dr(e,t,n,Kn,tr(e,0,r),tr(e,r+1,-1),r)}function Ir(e,t){for(var n="",r=rr(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Fr(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Kn:return e.return=e.return||e.value;case Gn:return"";case Wn:return e.return=e.value+"{"+Ir(e.children,r)+"}";case Vn:e.value=e.props.join(",")}return nr(n=Ir(e.children,r))?e.return=e.value+"{"+n+"}":""}function Or(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Pr=function(e,t,n){for(var r=0,i=0;r=i,i=gr(),38===r&&12===i&&(t[n]=1),!yr(i);)pr();return vr(e,lr)},Mr=function(e,t){return br(function(e,t){var n=-1,r=44;do{switch(yr(r)){case 0:38===r&&12===gr()&&(t[n]=1),e[n]+=Pr(lr-1,t,n);break;case 2:e[n]+=xr(r);break;case 4:if(44===r){e[++n]=58===gr()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Jn(r)}}while(r=pr());return e}(_r(e),t))},Lr=new WeakMap,zr=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)||Lr.get(n))&&!r){Lr.set(e,!0);for(var i=[],o=Mr(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]}}},jr=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ur(e,t){switch(function(e,t){return 45^er(e,0)?(((t<<2^er(e,0))<<2^er(e,1))<<2^er(e,2))<<2^er(e,3):0}(e,t)){case 5103:return qn+"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 qn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return qn+e+$n+e+Bn+e+e;case 6828:case 4268:return qn+e+Bn+e+e;case 6165:return qn+e+Bn+"flex-"+e+e;case 5187:return qn+e+Yn(e,/(\w+).+(:[^]+)/,qn+"box-$1$2"+Bn+"flex-$1$2")+e;case 5443:return qn+e+Bn+"flex-item-"+Yn(e,/flex-|-self/,"")+e;case 4675:return qn+e+Bn+"flex-line-pack"+Yn(e,/align-content|flex-|-self/,"")+e;case 5548:return qn+e+Bn+Yn(e,"shrink","negative")+e;case 5292:return qn+e+Bn+Yn(e,"basis","preferred-size")+e;case 6060:return qn+"box-"+Yn(e,"-grow","")+qn+e+Bn+Yn(e,"grow","positive")+e;case 4554:return qn+Yn(e,/([^-])(transform)/g,"$1"+qn+"$2")+e;case 6187:return Yn(Yn(Yn(e,/(zoom-|grab)/,qn+"$1"),/(image-set)/,qn+"$1"),e,"")+e;case 5495:case 3959:return Yn(e,/(image-set\([^]*)/,qn+"$1$`$1");case 4968:return Yn(Yn(e,/(.+:)(flex-)?(.*)/,qn+"box-pack:$3"+Bn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+qn+e+e;case 4095:case 3583:case 4068:case 2532:return Yn(e,/(.+)-inline(.+)/,qn+"$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(nr(e)-1-t>6)switch(er(e,t+1)){case 109:if(45!==er(e,t+4))break;case 102:return Yn(e,/(.+:)(.+)-([^]+)/,"$1"+qn+"$2-$3$1"+$n+(108==er(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Zn(e,"stretch")?Ur(Yn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==er(e,t+1))break;case 6444:switch(er(e,nr(e)-3-(~Zn(e,"!important")&&10))){case 107:return Yn(e,":",":"+qn)+e;case 101:return Yn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+qn+(45===er(e,14)?"inline-":"")+"box$3$1"+qn+"$2$3$1"+Bn+"$2box$3")+e}break;case 5936:switch(er(e,t+11)){case 114:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return qn+e+Bn+Yn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return qn+e+Bn+e+e}return e}var Br=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Kn:e.return=Ur(e.value,e.length);break;case Wn:return Ir([fr(e,{value:Yn(e.value,"@","@"+qn)})],r);case Vn: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 Ir([fr(e,{props:[Yn(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ir([fr(e,{props:[Yn(t,/:(plac\w+)/,":"+qn+"input-$1")]}),fr(e,{props:[Yn(t,/:(plac\w+)/,":-moz-$1")]}),fr(e,{props:[Yn(t,/:(plac\w+)/,Bn+"input-$1")]})],r)}return""})}}],$r=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||Br,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=[Fr,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=rr(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}([zr,jr].concat(o,u));i=function(e,t,n,r){l=n,Ir(Ar(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Un({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 qr={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},Gr=/[A-Z]|^ms/g,Vr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Kr=function(e){return 45===e.charCodeAt(1)},Wr=function(e){return null!=e&&"boolean"!=typeof e},Hr=Or(function(e){return Kr(e)?e:e.replace(Gr,"-$&").toLowerCase()}),Jr=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Vr,function(e,t,n){return Qr={name:t,styles:n,next:Qr},t})}return 1===qr[e]||Kr(e)||"number"!=typeof t||0===t?t:t+"px"};function Xr(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 Qr={name:i.name,styles:i.styles,next:Qr},i.name;var o=n;if(void 0!==o.styles){var s=o.next;if(void 0!==s)for(;void 0!==s;)Qr={name:s.name,styles:s.styles,next:Qr},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+=Xr(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]+"}":Wr(a)&&(r+=Hr(o)+":"+Jr(o,a)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=Xr(e,t,s);switch(o){case"animation":case"animationName":r+=Hr(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<s.length;c++)Wr(s[c])&&(r+=Hr(o)+":"+Jr(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 Qr,Yr=/label:\s*([^\s;{]+)\s*(;|$)/g;function Zr(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="";Qr=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Xr(n,t,o)):i+=o[0];for(var s=1;s<e.length;s++){if(i+=Xr(n,t,e[s]),r)i+=o[s]}Yr.lastIndex=0;for(var a,l="";null!==(a=Yr.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:Qr}}function ei(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}function ti(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function ni(e,t,n){var r=[],i=ei(e,r,n);return r.length<2?n:i+t(r)}var ri=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},ii=function(e){var t=$r(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=Zr(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 ni(t.registered,n,ri(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Zr(n,t.registered);ti(t,i)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Zr(n,t.registered),o="animation-"+i.name;return ti(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:ei.bind(null,t.registered),merge:ni.bind(null,t.registered,n)}}({key:"css"}),oi=ii.cx,si=ii.injectGlobal,ai=ii.keyframes,li=ii.css;let ci=function(e){let t=e=>ke(e,{},(e,t)=>(e[t[0].toString()+"%"]=On(t[1]),e));return{insertRule:t=>e.injectRaw(t),renderRule:(t,n)=>e.renderRaw(t,n),global:(t,n)=>e.injectRules(t,On(n)),renderGlobal:(t,n,r)=>e.renderRules(t,n,On(r)),style:t=>e.make(On(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=>{si(e)},renderRaw:function(e,t){si(t)},injectRules:function(e,t){si(Ze([[e,t]]))},renderRules:function(e,t,n){si(Ze([[t,n]]))},make:e=>li(e),mergeStyles:e=>oi(e),makeKeyframes:function(e){return ai(e)},renderKeyframes:function(e,t){return ai(t)}}),ui=function(e,t){return{TAG:"D",_0:e,_1:t}},di=function(e){return{TAG:"D",_0:"alignItems",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?hn.toString(e):"normal"===e||"stretch"===e?vn.toString(e):fn.toString(e)}},fi=function(e){return{TAG:"D",_0:"alignSelf",_1:"object"==typeof e?kn.toString(e):"selfStart"===e||"flexEnd"===e||"flexStart"===e||"center"===e||"start"===e||"selfEnd"===e||"right"===e||"left"===e||"end_"===e?fn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?hn.toString(e):yn.toString(e)}},hi=function(e){return{TAG:"D",_0:"bottom",_1:Pn(e)}},pi=function(e){return{TAG:"D",_0:"cursor",_1:Yt.toString(e)}},gi=function(e){return{TAG:"D",_0:"display",_1:"object"==typeof e?kn.toString(e):"table"===e||"grid"===e||"flex"===e?an.toString(e):"contents"===e||"none"===e?un.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"inlineGrid"===e||"inlineFlex"===e||"inlineBlock"===e||"inlineTable"===e?dn.toString(e):"block"===e||"inline"===e||"runIn"===e?sn.toString(e):"listItem"===e?ln.toString(e):cn.toString(e)}},mi=function(e){return{TAG:"D",_0:"flexDirection",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):bn.toString(e)}},vi=function(e){return{TAG:"D",_0:"flexGrow",_1:e.toString()}},yi=function(e){return{TAG:"D",_0:"flexShrink",_1:e.toString()}},_i=function(e){return{TAG:"D",_0:"flexWrap",_1:"object"==typeof e?kn.toString(e):"nowrap"===e||"wrapReverse"===e||"wrap"===e?_n.toString(e):jt.toString(e)}},bi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"height",_1:t}},xi=function(e){return{TAG:"D",_0:"justifyContent",_1:"object"==typeof e?kn.toString(e):"spaceBetween"===e||"stretch"===e||"spaceAround"===e||"spaceEvenly"===e?gn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"normal"===e?pn.toString(e):fn.toString(e)}},Si=function(e){return{TAG:"D",_0:"left",_1:Pn(e)}},wi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):"abs"===n?on.toString(e):Kt.toString(e)}else t="zero"===e?Kt.toString(e):"normal"===e?on.toString(e):jt.toString(e);return{TAG:"D",_0:"lineHeight",_1:t}},Ei=function(e){return{TAG:"D",_0:"listStyleType",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):Xt.toString(e)}},ki=function(e){return{TAG:"D",_0:"margin",_1:Ln(e)}},Ci=function(e,t){return{TAG:"D",_0:"margin",_1:Ln(e)+" "+Ln(t)}},Ai=function(e){return{TAG:"D",_0:"marginLeft",_1:Ln(e)}},Ni=function(e){return{TAG:"D",_0:"marginRight",_1:Ln(e)}},Ti=function(e){return{TAG:"D",_0:"marginTop",_1:Ln(e)}},Ri=function(e){return{TAG:"D",_0:"marginBottom",_1:Ln(e)}},Di=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Rn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"maxHeight",_1:t}},Ii=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Nn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"maxWidth",_1:t}},Fi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Dn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):En.toString(e);return{TAG:"D",_0:"minHeight",_1:t}},Oi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="none"===e?Tn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"minWidth",_1:t}},Pi=function(e){return{TAG:"D",_0:"opacity",_1:e.toString()}},Mi=function(e){return{TAG:"D",_0:"overflow",_1:Ht.toString(e)}},Li=function(e){return{TAG:"D",_0:"overflowY",_1:Ht.toString(e)}},zi=function(e){return{TAG:"D",_0:"padding",_1:Kt.toString(e)}},ji=function(e,t){return{TAG:"D",_0:"padding",_1:Kt.toString(e)+" "+Kt.toString(t)}},Ui=function(e){return{TAG:"D",_0:"position",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):Wt.toString(e)}},Bi=function(e){return{TAG:"D",_0:"right",_1:Pn(e)}},$i=function(e){return{TAG:"D",_0:"textAlign",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):mn.toString(e)}},qi=function(e){return{TAG:"D",_0:"top",_1:Pn(e)}},Gi=function(e){return{TAG:"D",_0:"userSelect",_1:"object"==typeof e?kn.toString(e):"unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):xn.toString(e)}},Vi=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?kn.toString(e):Kt.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?jt.toString(e):"zero"===e?Kt.toString(e):Sn.toString(e);return{TAG:"D",_0:"width",_1:t}},Ki=function(e){return{TAG:"D",_0:"zIndex",_1:e.toString()}},Wi=function(e,t){return{TAG:"S",_0:e,_1:t}},Hi=function(e,t){return{TAG:"S",_0:"@media "+e,_1:t}},Ji=function(e){return{TAG:"PseudoClass",_0:"disabled",_1:e}},Xi=function(e){return{TAG:"PseudoClass",_0:"focus",_1:e}},Qi=function(e){return{TAG:"PseudoClass",_0:"focus-within",_1:e}},Yi=function(e){return{TAG:"PseudoClass",_0:"hover",_1:e}},Zi=function(e){return{TAG:"PseudoClass",_0:"last-child",_1:e}},eo=function(e){return{TAG:"S",_0:"::placeholder",_1:e}},to=zn,no=function(e,t,n){return{TAG:"D",_0:"border",_1:Vt.toString(e)+" "+jn(t)+" "+Mn(n)}},ro=function(e){return{TAG:"D",_0:"animationName",_1:e}},io=function(e){return{TAG:"D",_0:"animationDuration",_1:$t.toString(e)}},oo=function(e){return{TAG:"D",_0:"animationIterationCount",_1:Qt.toString(e)}},so=function(e){return{TAG:"D",_0:"animationTimingFunction",_1:Cn.toString(e)}},ao=In,lo=ci.global,co=ci.style,uo=ci.merge,fo=ci.keyframes;function ho(e){return"var("+e+")"}let po=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",ho(bt.md)),vi(1),ui("min-height","200px"),$i("center"),ui("padding",ho(bt.xxl))]),go=co([ui("font-size","40px"),ui("color",ho(_t.textDisabled)),ui("line-height","1")]),mo=co([ui("color",ho(_t.textPrimary)),ui("font-size",ho(xt.sizeLg)),ui("font-weight",ho(xt.weightMedium)),ki(to(0))]),vo=co([ui("color",ho(_t.textSecondary)),ui("font-size",ho(xt.sizeMd)),ui("max-width","360px"),ki(to(0))]),yo=co([ui("background",ho(_t.brand)),ui("color",ho(_t.textOnBrand)),ui("border","none"),ui("border-radius",ho(St.md)),ui("padding","var("+bt.sm+") var("+bt.lg+")"),ui("font-size",ho(xt.sizeMd)),ui("cursor","pointer"),Ti(to(8))]);let _o=function(e){let t=e.title,n=void 0!==t?t:"Nothing here yet";return r("div",{children:[i("div",{children:"( )",className:go}),i("h3",{children:n,className:mo}),L(e.description,null,e=>i("p",{children:e,className:vo})),L(e.action,null,e=>{let t=e[1];return i("button",{children:e[0],className:yo,onClick:e=>t()})})],className:po})};function bo(e){return"var("+e+")"}let xo=co([Vi({NAME:"percent",VAL:100}),ui("border-collapse","collapse"),ui("font-size",bo(xt.sizeMd))]),So=co([ui("background",bo(_t.surfaceSubtle)),ui("border-bottom","2px solid var("+_t.border+")")]),wo=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",bo(_t.textSecondary)),ui("font-weight",bo(xt.weightMedium)),ui("font-size",bo(xt.sizeSm)),ui("text-align","left"),ui("white-space","nowrap"),ui("user-select","none")]),Eo=co([ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("font-size",bo(xt.sizeMd))]),ko=co([pi("pointer"),Yi([ui("color",bo(_t.textPrimary))])]),Co=co([ui("color",bo(_t.textPrimary))]),Ao=co([Ai(to(4)),ui("font-size",bo(xt.sizeXs)),ui("color",bo(_t.brand))]),No=co([ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Yi([ui("background",bo(_t.surfaceSubtle))])]),To=co([ui("min-height","44px")]),Ro=co([pi("pointer")]),Do=co([ui("background",bo(_t.surfaceSubtle)),ui("box-shadow","inset 3px 0 0 0 var("+_t.brand+")")]),Io=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",bo(_t.textPrimary)),ui("vertical-align","middle")]),Fo=co([ui("padding","var("+bt.sm+") var("+bt.md+")")]),Oo=co([$i("center"),ui("padding",bo(bt.xxl))]);function Po(e){let t=e.onSort,n=e.sortState,o="Comfortable"===e.density?wo+" "+Eo:wo;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+" "+ko+(s?" "+Co:""):o;return r("th",{children:[e.label,s?i("span",{children:"Asc"===a?"^":"v",className:Ao}):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:So})}let Mo=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?Io+" "+Fo:Io,d="Comfortable"===c?No+" "+To:No;return r("table",{children:[i(Po,{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(_o,{title:"No data"})),className:u+" "+Oo,colSpan:l.length})}):a.map(e=>{let n=s(e),r=L(o,d,e=>d+" "+Ro),a=vt(t,n)?r+" "+Do: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:xo})};function Lo(e){return e?{TAG:"Partial",_0:"FromStart"}:"Complete"}function zo(e,t){return e.toString()+" "+t+(1===e?"":"s")}function jo(e,t,n,r){let i=void 0!==r?r:"item",o=U(n,t),s=o===t?zo(o,i):o.toString()+" of "+zo(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 Uo(e,t){return t?e+"+":e}function Bo(e){switch(e){case"Small":return 20;case"Medium":return 28;case"Large":return 44}}let $o=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74","#5e7c9c"];function qo(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,$o.length)}function Go(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 Vo(e){return"var("+e+")"}let Ko=co([gi("inlineFlex"),di("center"),xi("center"),ui("border-radius",Vo(St.full)),ui("color","#ffffff"),ui("font-family",Vo(xt.fontFamily)),ui("font-weight",Vo(xt.weightMedium)),ui("flex-shrink","0"),ui("user-select","none"),ui("vertical-align","middle"),ui("overflow","hidden")]),Wo=co([ui("width","100%"),ui("height","100%"),ui("object-fit","cover")]);let Ho=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=Bo(o),u=c.toString()+"px",d=void 0!==n&&(""!==n&&!a[0]),f={background:d?"transparent":$o[qo(r)],fontSize:((c/2|0)-1|0).toString()+"px",height:u,width:u};return i("span",{children:d?i("img",{className:Wo,alt:r,src:U(n,""),onError:e=>l(e=>!0)}):Go(r),"aria-label":r,className:Ko,role:"img",style:f,title:r})};function Jo(e){return"var("+e+")"}let Xo=co([gi("flex"),_i("wrap"),ui("gap",Jo(bt.xs)),di("center")]),Qo=co([gi("inlineFlex"),di("center"),ui("padding","2px 8px"),ui("border-radius",Jo(St.full)),ui("background",Jo(_t.surfaceElevated)),ui("color",Jo(_t.textSecondary)),ui("font-size",Jo(xt.sizeXs)),ui("font-weight",Jo(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap")]),Yo=co([ui("color",Jo(_t.textDisabled)),ui("font-size",Jo(xt.sizeSm))]);let Zo=function(e){let t=e.items;return 0===t.length?i("span",{children:"—",className:Yo}):i("div",{children:t.map((e,t)=>i("span",{children:e,className:Qo},t.toString()+":"+e)),className:Xo})};function es(e){return"var("+e+")"}let ts=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("background","transparent"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",es(St.sm)),ui("padding","1px 6px"),ui("color",es(_t.textSecondary)),ui("font-size",es(xt.sizeXs)),ui("line-height","1"),pi("pointer"),Yi([ui("background",es(_t.surfaceElevated)),ui("color",es(_t.textPrimary))])]),ns=co([ui("color",es(_t.success)),ui("border-color",es(_t.success))]);let rs=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?ts+" "+ns:ts,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 is(e){return"var("+e+")"}let os=co([gi("inlineFlex"),di("center"),ui("gap",is(bt.xs)),ui("min-width","0")]),ss=co([ui("color",is(_t.brand)),ui("text-decoration","none"),ui("max-width","260px"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),Yi([ui("text-decoration","underline")])]),as=co([ui("color",is(_t.textPrimary)),ui("font-family","var(--rv-font-mono, ui-monospace, monospace)"),ui("font-size",is(xt.sizeSm)),ui("max-width","200px"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]);function ls(e,t){return e.length>t?e.slice(0,6)+"…"+e.slice(e.length-4|0,e.length):e}let cs=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:ss,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:ls(o,18),className:as,title:n}),a?i(rs,{value:n}):null],className:os})};function us(e){return"var("+e+")"}let ds=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("padding","2px 8px"),ui("border-radius",us(St.full)),ui("background",us(_t.surfaceElevated)),ui("color",us(_t.textSecondary)),ui("font-size",us(xt.sizeXs)),ui("font-weight",us(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap"),ui("border","none")]),fs=co([pi("pointer"),Yi([ui("background",us(_t.surface)),ui("color",us(_t.textPrimary))])]),hs=co([ui("font-weight",us(xt.weightBold)),ui("color",us(_t.textPrimary))]);let ps=function(e){let t=e.onClick,n=L(t,ds,e=>ds+" "+fs),s=r(o,{children:[i("span",{children:e.count.toString(),className:hs})," "+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 gs(e){let t=e.toString();return t.length<2?"0"+t:t}function ms(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()+"-"+gs(i)+"-"+gs(o)+" "+gs(s)+":"+gs(a)+":"+gs(l)}let vs=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/;function ys(e){if(vs.test(e))return ms(e)}function _s(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}function bs(e,t){return L(e,!1,_s)?void 0:ys(t)}function xs(e){return"var("+e+")"}let Ss=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[_t.success,_t.background];case"Warning":return[_t.warning,_t.background];case"Error":return[_t.error,_t.background];case"Info":return[_t.info,_t.background];case"Neutral":return[_t.surfaceElevated,_t.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],co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("padding","2px 8px"),ui("border-radius",xs(St.full)),ui("font-size",xs(xt.sizeXs)),ui("font-weight",xs(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap"),ui("background",a.startsWith("--rv-")?"var("+a+")":a),ui("color",l.startsWith("--rv-")?"var("+l+")":l)]))});var a,l};function ws(e){return z(e.plugin,t=>t+"."+e.store)}let Es={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 ks(e,t){let n=z(Xe(e,t),ut);return"JSONTrue"===n&&"object"!=typeof n}function Cs(e,t){return j(Xe(e,t),dt)}function As(e){return j(j(Xe(e,"x-reventless-semantic-target"),ht),e=>z(j(Xe(e,"store"),dt),t=>({plugin:j(Xe(e,"plugin"),dt),store:t})))}function Ns(e){return j(j(Xe(e,"x-reventless-setter"),ht),e=>z(j(Xe(e,"command"),dt),t=>({command:t,field:j(Xe(e,"field"),dt)})))}function Ts(e){return z(j(Xe(e,"x-reventless-retired"),ht),e=>{let t=j(Xe(e,"values"),pt);return{label:P(j(Xe(e,"label"),dt),e=>""!==e.trim()),showWhenFalse:ks(e,"showWhenFalse"),values:void 0!==t?me(t,e=>P(dt(e),e=>""!==e.trim())):z(P(j(Xe(e,"value"),dt),e=>""!==e.trim()),e=>[e]),namedWhenRetired:ks(e,"namedWhenRetired")}})}function Rs(e){let t=z(Xe(e,"x-reventless-index"),ut);if(void 0!==t)return"object"!=typeof t?"JSONTrue"===t?"":void 0:"JSONString"===t.TAG?t._0:void 0}function Ds(e){let t=ht(e);if(void 0===t)return;let n=ht(Lt(e));if(void 0===n)return t;if(n===t)return t;let r=Ze(Qe(n));return Qe(t).forEach(e=>{r[e[0]]=e[1]}),r}function Is(e){let t=Ds(e);return void 0!==t?{isId:ks(t,"x-reventless-id"),isCompositeId:ks(t,"x-reventless-compositeId"),isSubId:ks(t,"x-reventless-subId"),isCompositeSubId:ks(t,"x-reventless-compositeSubId"),index:Rs(t),hidden:ks(t,"x-reventless-hidden")||ks(t,"x-reventless-ui-hidden"),summary:ks(t,"x-reventless-summary"),groupBy:ks(t,"x-reventless-group-by"),drillTarget:z(Cs(t,"x-reventless-drillTarget"),e=>({slice:e,keyPath:Cs(t,"x-reventless-drillTargetKey")})),collapsed:ks(t,"x-reventless-collapsed"),scan:ks(t,"x-reventless-scan"),scanSort:ks(t,"x-reventless-scanSort"),semantic:Cs(t,"x-reventless-semantic"),semanticFromType:vt(Cs(t,"x-reventless-semantic-source"),"type"),storeTarget:As(t),channel:Cs(t,"x-reventless-channel"),setter:Ns(t),retired:Ts(t)}:Es}function Fs(e,t){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{if(t(Is(e[1])))return e[0]})),[])}function Os(e){return Fs(e,e=>e.summary)}function Ps(e){return Fs(e,e=>e.isId)[0]}function Ms(e){return j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{let t=e[0];return z(Is(e[1]).retired,e=>[t,e])})[0])}function Ls(e){return z(Ms(e),e=>e[0])}function zs(e){return Fs(e,e=>e.isCompositeId)}function js(e){return Fs(e,e=>!!e.isSubId||e.isCompositeSubId)[0]}function Us(e){return U(function(e){return j(j(ht(e),e=>Xe(e,"x-reventless-live")),e=>{let t=ut(e);if("object"!=typeof t)switch(t){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}(e),!0)}function Bs(e){return j(j(ht(e),e=>Xe(e,"x-reventless-viewmode")),dt)}function $s(e){return j(z(j(j(ht(Lt(e)),e=>Xe(e,"enum")),pt),e=>me(e,dt)),e=>{if(0!==e.length)return e})}function qs(e,t){return U(j(j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),$s),[])}function Gs(e,t){return z(Ms(e),e=>{let n=e[1],r=e[0];return{field:r,label:U(B(P(t,e=>""!==e.trim()),n.label),lt(r)),showWhenFalse:n.showWhenFalse,values:n.values,namedWhenRetired:n.namedWhenRetired}})}function Vs(e,t){let n=e.values,r=function(e,t){return j(t,t=>{let n=e.values,r=ut(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,dt),e=>i(Ss,{variant:"Warning",label:e,dot:!1})):void 0:void 0!==r?r?i(Ss,{variant:"Warning",label:e.label,dot:!1}):e.showWhenFalse?i(Ss,{variant:"Neutral",label:"Not "+e.label,dot:!1}):void 0:void 0}let Ks="archived";let Ws={param:Ks,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&&vt(t,"1")},toggleParams:function(e){return[[Ks,e?"":"1"],["after",""],["before",""]]}};function Hs(e){return"var("+e+")"}let Js=co([gi("inlineFlex"),di("center"),ui("vertical-align","middle")]),Xs=co([gi("inlineFlex"),ui("border-radius",Hs(St.full)),ui("box-shadow","0 0 0 2px var("+_t.surface+")")]),Qs=co([gi("inlineFlex"),di("center"),xi("center"),ui("border-radius",Hs(St.full)),ui("background",Hs(_t.surfaceElevated)),ui("color",Hs(_t.textSecondary)),ui("font-family",Hs(xt.fontFamily)),ui("font-weight",Hs(xt.weightMedium)),ui("flex-shrink","0"),ui("user-select","none")]);let Ys=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=Bo(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(Ho,{name:e.name,src:e.imageUrl,size:s}),className:Xs,style:h(t)},t.toString())),l>0?i("span",{children:"+"+l.toString(),className:Xs+" "+Qs,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:Js})},Zs=l(void 0),ea=Zs.Provider;let ta=function(e){return c(ea,{value:e.fill,children:e.children})};function na(e){let t=parseFloat(e);return Number.isNaN(t)?void 0:t}function ra(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 ia=["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"],oa="storageRef";function sa(e){return e===oa||"uploadableImage"===e||"uploadableFile"===e}function aa(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 la(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 ca(e,t){return j(j(Xe(e,t),dt),e=>""===e?void 0:e)}function ua(e,t,n){return j(j(j(j(Xe(e,t),ht),e=>Xe(e,n)),dt),e=>""===e?void 0:e)}function da(e,t){return"Pair"===e.TAG?ca(t,e.startField):ua(t,e._0,"start")}function fa(e,t){if("Pair"!==e.TAG)return ua(t,e._0,"end");let n=e.endField;return void 0!==n?ca(t,n):void 0}function ha(e){return"Pair"!==e.TAG||void 0!==e.endField}function pa(e,t){let n=Xe(e,t);if(void 0===n)return;let r=ft(n);return void 0!==r?r:j(dt(n),na)}function ga(e,t,n){return j(j(j(Xe(e,t),ht),e=>Xe(e,n)),ft)}function ma(e){return j(ht(e),e=>{let t=j(j(B(Xe(e,"__typename"),Xe(e,"TAG")),dt),e=>""===e?void 0:e);return z(t,t=>[t,Ze(Qe(e).filter(e=>{let t=e[0];return"__typename"!==t&&"TAG"!==t}))])})}function va(e){return j(ma(e),e=>{let t=e[1],n=e[0];if(!n.endsWith("Located"))return n.endsWith("Pending")?{TAG:"Pending",requestedFor:ca(t,"requestedFor")}:n.endsWith("Unresolvable")?{TAG:"Unresolvable",reason:ca(t,"reason")}:void 0;let r=ga(t,"point","lat"),i=ga(t,"point","lng");return{TAG:"Located",point:void 0!==r&&void 0!==i?[r,i]:void 0}})}function ya(e){switch(e.TAG){case"Located":let t=e.point;return void 0!==t?t:void 0;case"Pending":case"Unresolvable":return}}function _a(e){switch(e.TAG){case"Pending":case"Located":return;case"Unresolvable":let t=e.reason;return void 0!==t?t:void 0}}function ba(e,t){switch(e.TAG){case"Paired":let n=pa(t,e.latField),r=pa(t,e.lngField);return void 0!==n&&void 0!==r?[n,r]:void 0;case"Pointed":let i=e._0,o=ga(t,i,"lat"),s=ga(t,i,"lng");return void 0!==o&&void 0!==s?[o,s]:void 0;case"Geolocated":return j(function(e,t){return j(Xe(e,t),va)}(t,e._0),ya)}}function xa(e){return U(z(j(j(ht(Lt(e)),e=>Xe(e,"properties")),ht),Qe),[]).map(e=>[e[0],Lt(e[1])])}function Sa(e,t){return j(j(ht(Lt(e)),e=>Xe(e,t)),dt)}function wa(e){let t=Sa(e,"type");if(void 0===t)return!1;switch(t){case"integer":case"number":return!0;default:return!1}}function Ea(e){return vt(Sa(e,"type"),"string")}function ka(e){let t=Sa(e,"format");if(void 0===t)return!1;switch(t){case"date":case"date-time":return!0;default:return!1}}let Ca=["user","username","owner","assignee","assignedto","author","creator","createdby","updatedby","reporter","approver","reviewer","actor","member"];function Aa(e){return Ca.includes(e.toLowerCase())}function Na(e,t){return t.some(t=>e.endsWith(t))}function Ta(e){return L($s(e),0,e=>e.length)}function Ra(e,t){return j(j(ht(Lt(e)),e=>Xe(e,t)),ft)}let Da=[["street","streetaddress","line1","addressline1","address1","housenumber"],["city","town","locality"],["postalcode","zip","zipcode","postcode"],["state","region","province","county"],["country","countrycode"]];let Ia=["parent","parentid","manager","managerid","reportsto","reportstoid","supervisor","supervisorid"];function Fa(e,t){let n=e.toLowerCase(),r=function(e,t){if(!wa(t))return;let n=Ra(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)&&Ta(t)>0?Ta(t)<=8?["Status","name:status-enum"]:void 0:vt(Sa(t,"type"),"string")&&["imageurl","image","photo","photourl","avatar","avatarurl","thumbnail"].includes(n)?["Image","name:image"]:wa(t)&&Na(n,["price","amount","total"])?["Currency","name:currency"]:vt(Sa(t,"type"),"string")&&["email"].includes(n)?["Email","name:email"]:vt(Sa(t,"type"),"string")&&["phone","phonenumber"].includes(n)?["Phone","name:phone"]:vt(Sa(t,"type"),"string")&&["website","url","homepage"].includes(n)?["Url","name:url"]:vt(Sa(t,"type"),"string")&&(["file","attachment","upload"].includes(n)||Na(n,["storageref","fileref","attachmentref"]))?["File","name:file"]:wa(t)&&["progress","percentcomplete","percentdone","completion"].includes(n)?["Progress","name:progress"]:vt(Sa(t,"type"),"string")&&["country","countrycode","countryname"].includes(n)?["Country","name:country"]:vt(Sa(t,"type"),"string")&&["address","streetaddress","billingaddress","shippingaddress"].includes(n)?["Address","name:address"]:vt(Sa(t,"type"),"string")&&function(e){return!!Ia.includes(e)||!!e.startsWith("parent")&&e.endsWith("id")}(n)?["ParentRef","name:parent-ref"]:vt(Sa(t,"type"),"string")&&["name","title","label","displayname"].includes(n)?["Label","name:label"]:vt(Sa(t,"type"),"string")&&Ca.includes(n)?["UserRef","name:user"]:void 0}function Oa(e){return["lat","latitude"].includes(e)}function Pa(e){return["lng","lon","long","longitude"].includes(e)}let Ma={contents:[]};function La(e,t,n){let r=e+"."+t+"."+n;if(Ma.contents.some(e=>e===r))return;Ma.contents.push(r);let i=ia.map(ra).join(", ");console.error('[AutoUI] Unknown semantic "'+n+'" ('+e+') on field "'+t+'" — ignored. Valid ids: '+i+".")}function za(e,t){let n=Lt(t),r=Is(n),i=r.semanticFromType?"Type":"Annotation",o=L(r.semantic,!1,sa),s=j(r.semantic,t=>{if(t===oa)return;let n=aa(t);return void 0!==n?{semantic:n,provenance:i}:void La("x-reventless-semantic",e,t)});if(void 0!==s)return s;let a,l=e.toLowerCase(),c=vt(Sa(n,"type"),"object")&&function(e){let t=xa(e),n=(e,n)=>t.some(t=>t[0].toLowerCase()===e&&n(t[1]));return!!n("amount",wa)&&n("currency",Ea)}(n)?["Money","shape:money"]:vt(Sa(n,"type"),"object")&&function(e){let t=xa(e),n=e=>t.some(t=>{let n=t[1];return!(t[0].toLowerCase()!==e||!vt(Sa(n,"type"),"string"))&&ka(n)});return!!n("start")&&n("end")}(n)?["DateRange","shape:date-range"]:vt(Sa(n,"type"),"object")&&function(e){let t=xa(e);return Da.filter(e=>t.some(t=>e.includes(t[0].toLowerCase()))).length>=2}(n)?["Address","shape:address"]:vt(Sa(n,"type"),"object")&&function(e){let t=xa(e),n=t.some(e=>!!Oa(e[0].toLowerCase())&&wa(e[1])),r=t.some(e=>!!Pa(e[0].toLowerCase())&&wa(e[1]));return!!n&&r}(n)?["GeoPoint","shape:geo-point"]:Oa(l)&&wa(n)?["GeoLat","name:geo-pair"]:Pa(l)&&wa(n)?["GeoLng","name:geo-pair"]:void 0;if(void 0!==c)a=c;else if(vt(Sa(n,"type"),"string")&&function(e){return Na(e,["fileurl","documenturl","downloadurl","attachmenturl","pdfurl"])}(l))a=["FileUrl","name:file-url"];else{let t=function(e){let t=Sa(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:Fa(e,n)}return B(z(a,e=>({semantic:e[0],provenance:{TAG:"Heuristic",_0:e[1]}})),o?{semantic:"File",provenance:i}:void 0)}function ja(e,t){let n=za(e,t);return void 0!==n?n:j(zt(t),t=>za(ct(e),t))}function Ua(e,t,n){let r=xa(e),i={};r.forEach(e=>{let n=e[0],r=j(j(t,e=>Xe(e,n)),e=>{let t=aa(e);return void 0!==t?{semantic:t,provenance:"Hint"}:void La("uiHints.fields",n,e)});return void 0!==r?void(i[n]=r):M(za(n,e[1]),e=>{i[n]=e})});let o,s=e=>r.map(e=>e[0]).find(t=>L(Xe(i,t),!1,t=>t.semantic===e)),a=e=>r.map(e=>e[0]).find(t=>L(Xe(i,t),!1,t=>la(t.semantic).includes(e))),l=j(P(n,e=>"id"!==e.field),e=>z(r.find(t=>t[0]===e.field&&vt(Sa(t[1],"type"),"string")),e=>e[0])),c=L(n,!1,e=>vt(e.source,"annotation")),u=c?l:void 0,d=r.map(e=>e[0]).find(e=>L(Xe(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=Xe(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(Xe(i,t),!1,e=>"DateTime"===e.semantic)||ka(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)&&(!!Na(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 Ba=l([]),$a=l(e=>{}),qa=Ba.Provider,Ga=$a.Provider;let Va=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(Ga,{value:o,children:c(qa,{value:r[0],children:e.children})})};function Ka(){return d(Ba)}function Wa(e,t){let n=function(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}(t),r=nt(n),i=e.find(e=>e.name===r);return void 0!==i?i:e.find(e=>e.name===n)}function Ha(e,t){return e.find(e=>e.name===t)}function Ja(e,t){return ze(n=>Fe(e,Fe(encodeURIComponent(t),n)))}function Xa(e,t){return Fe(e,Fe(encodeURIComponent(t),"Wildcard"))}function Qa(e,t,n,r){let i=[n].concat(r).map(e=>encodeURIComponent(e));return Ue(Xa(e,t))(je.of_parts(i.join("/")))}var Ya=(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))(Ya||{});const Za=[1,0],el=[2,3],tl=[3,2],nl={L:[0,1],M:Za,Q:el,H:tl},rl=/^\d*$/,il=/^[A-Z0-9 $%*+./:-]*$/,ol="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",sl=[[-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]],al=[[-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 ll=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,Ya.Timing),this.setFunctionModule(n,6,n%2==0,Ya.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,ul(r,i));this.setFunctionModule(8,7,ul(r,6)),this.setFunctionModule(8,8,ul(r,7)),this.setFunctionModule(7,8,ul(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,ul(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,ul(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,ul(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=ul(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,Ya.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)),Ya.Alignment)}setFunctionModule(e,t,n,r=Ya.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){const t=this.version,n=this.ecc;if(e.length!==El(t,n))throw new RangeError("Invalid argument");const r=al[n[0]][t],i=sl[n[0]][t],o=Math.floor(wl(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]=Cl(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=Cl(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=kl(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(wl(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]=ul(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 cl(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 ul(e,t){return!!(e>>>t&1)}class dl{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 fl=[1,10,12,14],hl=[2,9,11,13],pl=[4,8,16,16];function gl(e,t){return e[Math.floor((t+7)/17)+1]}function ml(e){const t=[];for(const n of e)cl(n,8,t);return new dl(pl,e.length,t)}function vl(e){if(!_l(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);cl(Number.parseInt(e.substring(n,n+r),10),3*r+1,t),n+=r}return new dl(fl,e.length,t)}function yl(e){if(!bl(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*ol.indexOf(e.charAt(n));r+=ol.indexOf(e.charAt(n+1)),cl(r,11,t)}return n<e.length&&cl(ol.indexOf(e.charAt(n)),6,t),new dl(hl,e.length,t)}function _l(e){return rl.test(e)}function bl(e){return il.test(e)}function xl(e,t){let n=0;for(const r of e){const e=gl(r.mode,t);if(r.numChars>=1<<e)return Number.POSITIVE_INFINITY;n+=4+e+r.bitData.length}return n}function Sl(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 wl(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 El(e,t){return Math.floor(wl(e)/8)-sl[t[0]][e]*al[t[0]][e]}function kl(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]^=Cl(t,e))}return n}function Cl(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 Al(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?[]:_l(e)?[vl(e)]:bl(e)?[yl(e)]:[ml(Sl(e))]}(e):Array.isArray(e)?[ml(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*El(s,t),i=xl(e,s);if(i<=n){a=i;break}if(s>=r)throw new RangeError("Data too long")}for(const d of[Za,el,tl])o&&a<=8*El(s,d)&&(t=d);const l=[];for(const d of e){cl(d.mode[0],4,l),cl(d.numChars,gl(d.mode,s),l);for(const e of d.getData())l.push(e)}const c=8*El(s,t);cl(0,Math.min(4,c-l.length),l),cl(0,(8-l.length%8)%8,l);for(let d=236;l.length<c;d^=253)cl(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 ll(s,t,u,i)}(l,nl[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=Ya.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 Nl=co([gi("inlineBlock"),ui("background","#ffffff"),ui("padding","6px"),ui("border-radius",function(e){return"var("+e+")"}(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("line-height","0")]),Tl=co([ui("color","#000000"),ui("display","block")]);let Rl=function(e){let t=e.size,n=e.value,r=void 0!==t?t:128,o=function(e){if(""!==e.trim())try{return Al(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:Tl,role:"img",height:r.toString(),width:r.toString(),shapeRendering:"crispEdges",viewBox:"0 0 "+s+" "+s,xmlns:"http://www.w3.org/2000/svg"}),className:Nl});var a},Dl=["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 Il(e){return e>="0"&&e<="9"}function Fl(e){let t={};return function(e){let t=[],n=0,r=e.length;for(;n<r;)if(Il(U(e[n],""))){let i=n;for(;n<r&&Il(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 Ol(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=Fl(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(_e(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=>Dl[e]).join("")})}function Pl(e,t,n){let r=n.toString(),i=[],o=0,s=e.length;for(;o<s;)if(vt(e[o],"1")){let n=o;for(;o<s&&vt(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 Ml=co([gi("inlineBlock"),Ii({NAME:"percent",VAL:100}),ui("overflow-x","auto"),ui("background","#ffffff"),ui("padding","6px"),ui("border-radius",function(e){return"var("+e+")"}(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("line-height","0")]),Ll=co([ui("color","#000000"),ui("display","block")]);let zl=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=Ol(r);if(void 0===a)return null;let l=a.length+20|0;return i("span",{children:i("svg",{children:i("path",{d:Pl(a,10,40),fill:"currentColor"}),"aria-label":U(e.title,"Barcode for "+r),className:Ll,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:Ml})};function jl(e){return"var("+e+")"}let Ul=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.82)"),gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",jl(bt.md)),ui("padding",jl(bt.lg)),ui("z-index","1100")]),Bl=co([ui("max-width","min(92vw, 1400px)"),ui("max-height","78vh"),ui("object-fit","contain"),ui("border-radius",jl(St.sm)),ui("box-shadow",jl(kt))]),$l=co([gi("flex"),di("center"),ui("gap",jl(bt.md)),ui("max-width","100%")]),ql=co([gi("flex"),di("center"),ui("gap",jl(bt.md)),ui("max-width","92vw"),ui("color","#f5f5f5"),ui("font-size",jl(xt.sizeSm))]),Gl=co([ui("font-size",jl(xt.sizeMd)),ui("font-weight",jl(xt.weightMedium)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),Vl=co([ui("color","#c8c8c8")]),Kl=co([ui("font-family",jl(xt.fontFamilyMono)),ui("color","#c8c8c8")]),Wl=co([gi("inlineFlex"),di("center"),xi("center"),ui("background","rgba(255,255,255,0.12)"),ui("border","1px solid rgba(255,255,255,0.25)"),ui("border-radius",jl(St.md)),ui("color","#f5f5f5"),ui("padding","4px var("+bt.sm+")"),ui("font-size",jl(xt.sizeSm)),pi("pointer"),Yi([ui("background","rgba(255,255,255,0.22)")])]),Hl=uo([Wl,co([ui("width","40px"),ui("height","40px"),ui("border-radius","50%"),ui("font-size",jl(xt.sizeLg)),yi(0)])]),Jl=uo([Wl,co([Ui("absolute"),qi(to(16)),Bi(to(16)),ui("width","32px")])]);function Xl(e,t,n){return 0===t?0:fe(fe(e+n|0,t)+t|0,t)}let Ql=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(Xl(o,l,-1)):void 0;case"ArrowRight":return c?n(Xl(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[Xl(o,l,0)];if(void 0===u)return null;let d=u.title,f=u.caption;return r("div",{children:[i("button",{children:"✕",className:Jl,title:"Close",type:"button",onClick:e=>t()}),r("div",{children:[c?i("button",{children:"‹",className:Hl,title:"Previous",type:"button",onClick:e=>n(Xl(o,l,-1))}):null,i("img",{className:Bl,alt:U(u.title,""),src:u.src}),c?i("button",{children:"›",className:Hl,title:"Next",type:"button",onClick:e=>n(Xl(o,l,1))}):null],className:$l,onClick:e=>{e.stopPropagation()}}),r("div",{children:[void 0!==d?i("span",{children:d,className:Gl,title:d}):null,void 0!==f?i("span",{children:f,className:Vl}):null,c?i("span",{children:(Xl(o,l,0)+1|0).toString()+" / "+l.toString(),className:Kl}):null,U(e.action,null)],className:ql,onClick:e=>{e.stopPropagation()}})],"aria-modal":!0,className:Ul,role:"dialog",onClick:e=>t()})};function Yl(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function Zl(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function ec(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+t,1).getTime()}function tc(e){let t=0|new Date(e).getDay(),n=0===t?6:t-1|0;return Zl(Yl(e),0|-n)}function nc(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1).getTime()}function rc(e,t){return Yl(e)===Yl(t)}function ic(e,t){let n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function oc(e,t,n){let r=Yl(n);return e<r+864e5&&t>=r}function sc(e){let t=e.toString();return t.length<2?"0"+t:t}function ac(e){let t=new Date(e);return sc(0|t.getHours())+":"+sc(0|t.getMinutes())}function lc(e){return e===Yl(e)}let cc=["January","February","March","April","May","June","July","August","September","October","November","December"];function uc(e){let t=new Date(e),n=0|t.getMonth();return U(cc[n],"")+" "+t.getFullYear().toString()}let dc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function fc(e){return 0|new Date(e).getDate()}function hc(e){let t=0|new Date(e).getDay();return U(dc[0===t?6:t-1|0],"")+" "+(0|new Date(e).getDate()).toString()}function pc(e){let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}let gc=864e5;function mc(e){return"var("+e+")"}function vc(e){return co([ui("width","100%"),ui("height",e),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",mc(St.md)),ui("background",mc(_t.surfaceSubtle)),Mi("hidden")])}let yc=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",mc(bt.sm)),ui("height","100%"),ui("padding",mc(bt.lg)),ui("color",mc(_t.textSecondary)),ui("font-size",mc(xt.sizeSm)),ui("text-align","center")]),_c=co([ui("color",mc(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]);function bc(e){return U(U(e.split("?")[0],e).split("#")[0],e).toLowerCase().endsWith(".pdf")}let xc=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:_c,href:o,rel:"noopener noreferrer",target:"_blank"})],className:yc}),"aria-label":s,className:vc(a),data:o,type:"application/pdf"})};function Sc(e){return"Small"===e?"13px":"18px"}function wc(e,t){let n=t<=0?1:t;return(e<0?0:e>n?n:e)/n}function Ec(e){return"var("+e+")"}let kc=co([ui("color",Ec(_t.borderSubtle))]);let Cc=co([gi("inlineFlex"),ui("gap","2px"),di("center")]);function Ac(e,t){return co([ui("background","none"),ui("border","none"),ui("padding","0 1px"),ui("font-size",Sc(t)),ui("line-height","1"),pi("pointer"),ui("color",Ec(e?_t.warning:_t.borderSubtle)),ui("transition","color 120ms, transform 120ms"),Yi([ui("transform","scale(1.15)")]),Wi("&:focus-visible",[ui("outline","2px solid var("+_t.brand+")"),ui("outline-offset","1px"),ui("border-radius","2px")])])}let Nc=co([ui("color",Ec(_t.textSecondary)),ui("font-size",Ec(xt.sizeSm))]),Tc=co([gi("inlineFlex"),di("center"),ui("gap","6px")]),Rc=co([ui("border","1px solid var("+_t.error+")"),ui("border-radius",Ec(St.sm)),ui("padding","2px 4px")]);let Dc=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:Ac(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:Nc}):null],"aria-label":m,className:h?Cc+" "+Rc:Cc,role:"group"}:{children:[r("span",{children:[i("span",{children:g,className:kc}),i("span",{children:g,className:(y=wc(c,p),co([Ui("absolute"),ui("top","0"),ui("left","0"),ui("width",(100*y).toString()+"%"),Mi("hidden"),ui("white-space","nowrap"),ui("color",Ec(_t.warning)),ui("pointer-events","none")]))})],"aria-label":m,className:(v=d,co([gi("inlineFlex"),Ui("relative"),ui("font-size",Sc(v)),ui("line-height","1"),ui("letter-spacing","1px"),ui("white-space","nowrap"),ui("vertical-align","-1px")])),role:"img",title:m}),f?i("span",{children:(Math.round(10*c)/10).toString()+" / "+p.toString(),className:Nc}):null],className:Tc});var v,y};function Ic(e){return"var("+e+")"}let Fc=co([gi("flex"),mi("column"),ui("gap","4px")]),Oc=co([gi("flex"),xi("spaceBetween"),ui("font-size",Ic(xt.sizeSm))]),Pc=co([ui("color",Ic(_t.textSecondary))]),Mc=co([ui("color",Ic(_t.textPrimary)),ui("font-weight",Ic(xt.weightMedium))]),Lc=co([ui("background",Ic(_t.surfaceSubtle)),ui("border-radius",Ic(St.full)),ui("height","8px"),Mi("hidden")]);function zc(e,t){return co([ui("background",void 0!==t?t:"var("+_t.brand+")"),ui("border-radius",Ic(St.full)),ui("height","100%"),ui("width",e.toString()+"%"),ui("transition","width 0.3s ease")])}let jc=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:Pc})),s?i("span",{children:Math.round(l).toString()+"%",className:Mc}):null],className:Oc}):null,i("div",{children:i("div",{className:zc(l,e.color)}),className:Lc})],className:Fc})},Uc={};function Bc(e){Uc[e.id]=e}function $c(e){return Xe(Uc,e)}let qc={};let Gc={contents:[]};let Vc="#111111";function Kc(e){return"var("+e+")"}let Wc=co([gi("flex"),mi("column"),ui("gap",Kc(bt.xs))]);let Hc=co([ui("fill","#9ca3af"),ui("font-size","13px"),ui("pointer-events","none"),ui("user-select","none")]),Jc=co([ui("stroke","#e5e7eb"),ui("stroke-width","1")]),Xc=co([gi("flex"),di("center"),ui("gap",Kc(bt.sm)),ui("font-size",Kc(xt.sizeXs)),ui("color",Kc(_t.textSecondary))]),Qc=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Kc(St.sm)),ui("color",Kc(_t.textSecondary)),ui("font-size",Kc(xt.sizeXs)),ui("padding","2px 8px"),pi("pointer"),Yi([ui("border-color",Kc(_t.brand)),ui("color",Kc(_t.brand))])]),Yc=co([ui("background","#ffffff"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",Kc(St.md)),ui("padding","4px"),ui("display","inline-block"),ui("line-height","0")]),Zc=co([ui("display","block"),ui("max-width","100%"),ui("height","auto")]);function eu(e){return(Math.round(10*e)/10).toString()}function tu(e){return e.map(e=>eu(e.x)+","+eu(e.y)).join(" ")}function nu(e){return e.trim().startsWith("<svg")}function ru(e){return"data:image/svg+xml;utf8,"+encodeURIComponent(e)}let iu=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="'+tu(1===e.length?e.concat(e):e)+'"/>').join("");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+eu(t)+" "+eu(n)+'" width="'+eu(t)+'" height="'+eu(n)+'"><g fill="none" stroke="'+Vc+'" 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:Jc,x1:eu(.06*u),x2:eu(.94*u),y1:eu(.78*d),y2:eu(.78*d)}),A?null:i("text",{children:"Sign here",className:Hc,textAnchor:"middle",x:eu(u/2),y:eu(.7*d)}),i("g",{children:v.map((e,t)=>i("polyline",{points:tu(1===e.length?e.concat(e):e)},t.toString())),fill:"none",stroke:Vc,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2..toString()})],ref:T(p),"aria-label":"Signature pad",className:(N=f,co([ui("background","#ffffff"),ui("border",N?"1px solid var("+_t.error+")":"1px dashed var("+_t.border+")"),ui("border-radius",Kc(St.md)),ui("touch-action","none"),ui("max-width","100%"),ui("width","100%"),ui("height","auto"),pi("crosshair"),ui("display","block")])),role:"img",onPointerDown:w,onPointerMove:E,onPointerUp:k,onPointerCancel:k,viewBox:"0 0 "+eu(u)+" "+eu(d),xmlns:"http://www.w3.org/2000/svg"}),r("div",{children:[A?i("button",{children:"Clear",className:Qc,type:"button",onClick:e=>C()}):null,i("span",{children:"Draw your signature above"})],className:Xc})],className:Wc}):r("div",{children:[i("span",{children:i("img",{className:Zc,alt:"Signature",src:ru(c)}),className:Yc}),i("div",{children:i("button",{children:"Sign again",className:Qc,type:"button",onClick:e=>C()}),className:Xc})],className:Wc});var N};function ou(e,t,n){let r={};return r[t]=n,Object.assign({},e,r)}function su(e){return"var("+e+")"}let au=co([gi("flex"),mi("column"),ui("gap",su(bt.sm))]),lu=co([gi("flex"),ui("gap","4px")]),cu=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",su(St.sm)),ui("color",su(_t.textSecondary)),ui("font-size",su(xt.sizeXs)),ui("padding","2px 8px"),pi("pointer")]),uu=co([ui("background",su(_t.brandSubtle)),ui("border-color",su(_t.brand)),ui("color",su(_t.textPrimary))]),du=co([Vi({NAME:"percent",VAL:100}),ui("min-height","220px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",su(St.sm)),ui("background","#ffffff")]),fu=co([ui("margin","0"),ui("font-family",su(xt.fontFamilyMono)),ui("font-size",su(xt.sizeXs)),ui("line-height",su(xt.lineHeightRelaxed)),ui("color",su(_t.textPrimary)),ui("white-space","pre-wrap"),ui("word-break","break-word")]);function hu(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?cu+" "+uu:cu,type:"button",onClick:n}),u=0;return l&&void 0!==n?t=i("pre",{children:n,className:fu}):u=1,1===u&&(t=i("iframe",{className:du,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:lu}):null,t],className:au})}function pu(e,t){return i(hu,{html:e.body,textAlternative:e.textAlternative})}const gu={};function mu(e,t){"string"!=typeof t&&(t=mu.defaultChars);const n=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);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})}mu.defaultChars=";/?:@&=+$,#",mu.componentChars="";const vu={};function yu(e,t,n){"string"!=typeof t&&(n=t,t=yu.defaultChars),void 0===n&&(n=!0);const r=function(e){let t=vu[e];if(t)return t;t=vu[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 _u(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 bu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}yu.defaultChars=";/?:@&=+$,-_.!~*'()#",yu.componentChars="-_.!~*'()";const xu=/^([a-z0-9.+-]+:)/i,Su=/:[0-9]*$/,wu=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Eu=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ku=["'"].concat(Eu),Cu=["%","/","?",";","#"].concat(ku),Au=["/","?","#"],Nu=/^[+a-z0-9A-Z_-]{0,63}$/,Tu=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ru={javascript:!0,"javascript:":!0},Du={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Iu(e,t){if(e&&e instanceof bu)return e;const n=new bu;return n.parse(e,t),n}bu.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){const e=wu.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let s=xu.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&&Ru[s]||(o=o.substr(2),this.slashes=!0)),!Ru[s]&&(i||s&&!Du[s])){let e,t,n=-1;for(let a=0;a<Au.length;a++)r=o.indexOf(Au[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<Cu.length;a++)r=o.indexOf(Cu[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(Nu)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(Nu)){const r=e.slice(0,t),i=e.slice(t+1),s=n.match(Tu);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),Du[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},bu.prototype.parseHost=function(e){let t=Su.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 Fu=Object.freeze(Object.defineProperty({__proto__:null,decode:mu,encode:yu,format:_u,parse:Iu},Symbol.toStringTag,{value:"Module"})),Ou=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pu=/[\0-\x1F\x7F-\x9F]/,Mu=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Lu=/[\$\+<->\^`\|~\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]/,zu=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ju=Object.freeze(Object.defineProperty({__proto__:null,Any:Ou,Cc:Pu,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:Mu,S:Lu,Z:zu},Symbol.toStringTag,{value:"Module"})),Uu=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))),Bu=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var $u;const qu=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]]),Gu=null!==($u=String.fromCodePoint)&&void 0!==$u?$u: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 Vu;!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"}(Vu||(Vu={}));var Ku,Wu,Hu;function Ju(e){return e>=Vu.ZERO&&e<=Vu.NINE}function Xu(e){return e>=Vu.UPPER_A&&e<=Vu.UPPER_F||e>=Vu.LOWER_A&&e<=Vu.LOWER_F}function Qu(e){return e===Vu.EQUALS||function(e){return e>=Vu.UPPER_A&&e<=Vu.UPPER_Z||e>=Vu.LOWER_A&&e<=Vu.LOWER_Z||Ju(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"}(Ku||(Ku={})),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"}(Wu||(Wu={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(Hu||(Hu={}));class Yu{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Wu.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Hu.Strict}startEntity(e){this.decodeMode=e,this.state=Wu.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Wu.EntityStart:return e.charCodeAt(t)===Vu.NUM?(this.state=Wu.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Wu.NamedEntity,this.stateNamedEntity(e,t));case Wu.NumericStart:return this.stateNumericStart(e,t);case Wu.NumericDecimal:return this.stateNumericDecimal(e,t);case Wu.NumericHex:return this.stateNumericHex(e,t);case Wu.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===Vu.LOWER_X?(this.state=Wu.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Wu.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(!Ju(r)&&!Xu(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(!Ju(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===Vu.SEMI)this.consumed+=1;else if(this.decodeMode===Hu.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=qu.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==Vu.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&Ku.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=ed(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===Hu.Attribute&&(0===i||Qu(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Ku.VALUE_LENGTH)>>14,0!==i){if(o===Vu.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Hu.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]&Ku.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]&~Ku.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Wu.NamedEntity:return 0===this.result||this.decodeMode===Hu.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Wu.NumericDecimal:return this.emitNumericEntity(0,2);case Wu.NumericHex:return this.emitNumericEntity(0,3);case Wu.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wu.EntityStart:return 0}}}function Zu(e){let t="";const n=new Yu(e,e=>t+=Gu(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 ed(e,t,n,r){const i=(t&Ku.BRANCH_LENGTH)>>7,o=t&Ku.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 td=Zu(Uu);function nd(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}Zu(Bu);const rd=Object.prototype.hasOwnProperty;function id(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 od(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function sd(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 ad(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const ld=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,cd=new RegExp(ld.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),ud=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function dd(e,t){if(35===t.charCodeAt(0)&&ud.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return sd(n)?ad(n):e}const n=function(e,t=Hu.Legacy){return td(e,t)}(e);return n!==e?n:e}function fd(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(cd,function(e,t,n){return t||dd(e,n)})}const hd=/[&<>"]/,pd=/[&<>"]/g,gd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function md(e){return gd[e]}function vd(e){return hd.test(e)?e.replace(pd,md):e}const yd=/[.?*+^$[\]\\(){}|-]/g;function _d(e){switch(e){case 9:case 32:return!0}return!1}function bd(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 xd(e){return Mu.test(e)||Lu.test(e)}function Sd(e){return xd(ad(e))}function wd(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 Ed(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function kd(e){return 32===e||9===e||10===e||13===e}function Cd(e){let t=0;for(;t<e.length&&kd(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&kd(e.charCodeAt(n));n--);return e.slice(t,n+1)}const Ad={mdurl:Fu,ucmicro:ju},Nd=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:od,asciiTrim:Cd,assign:id,escapeHtml:vd,escapeRE:function(e){return e.replace(yd,"\\$&")},fromCodePoint:ad,has:function(e,t){return rd.call(e,t)},isMdAsciiPunct:wd,isPunctChar:xd,isPunctCharCode:Sd,isSpace:_d,isString:nd,isValidEntityCode:sd,isWhiteSpace:bd,lib:Ad,normalizeReference:Ed,unescapeAll:fd,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(ld,"$1")}},Symbol.toStringTag,{value:"Module"}));const Td=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=fd(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=fd(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+=fd(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+=fd(e.slice(t,o)),s}},Symbol.toStringTag,{value:"Module"})),Rd={};function Dd(){this.rules=id({},Rd)}function Id(){this.__rules__=[],this.__cache__=null}function Fd(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 Od(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Rd.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+vd(o.content)+"</code>"},Rd.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+vd(e[t].content)+"</code></pre>\n"},Rd.fence=function(e,t,n,r,i){const o=e[t],s=o.info?fd(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)||vd(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`},Rd.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)},Rd.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},Rd.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},Rd.text=function(e,t){return vd(e[t].content)},Rd.html_block=function(e,t){return e[t].content},Rd.html_inline=function(e,t){return e[t].content},Dd.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+vd(e.attrs[t][0])+'="'+vd(e.attrs[t][1])+'"';return r},Dd.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},Dd.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},Dd.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},Dd.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},Id.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},Id.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))})})},Id.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},Id.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},Id.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},Id.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},Id.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},Id.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},Id.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},Id.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},Fd.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},Fd.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},Fd.prototype.attrSet=function(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},Fd.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},Fd.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},Od.prototype.Token=Fd;const Pd=/\r\n?|\n/g,Md=/\0/g;function Ld(e){return/^<a[>\s]/i.test(e)}function zd(e){return/^<\/a\s*>/i.test(e)}const jd=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Ud=/\((c|tm|r)\)/i,Bd=/\((c|tm|r)\)/gi,$d={c:"©",r:"®",tm:"™"};function qd(e,t){return $d[t.toLowerCase()]}function Gd(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(Bd,qd)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}function Vd(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||jd.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 Kd=/['"]/,Wd=/['"]/g;function Hd(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Jd(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;){Wd.lastIndex=c;const s=Wd.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=wd(p)||Sd(p),v=wd(g)||Sd(g),y=bd(p),_=bd(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]),Hd(i,o,s.index,l),Hd(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&&Hd(i,o,s.index,"’")}else h&&Hd(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 Xd=[["normalize",function(e){let t;t=e.src.replace(Pd,"\n"),t=t.replace(Md,"�"),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&&(Ld(s.content)&&i>0&&i--,zd(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=od(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&&(Ud.test(e.tokens[t].content)&&Gd(e.tokens[t].children),jd.test(e.tokens[t].content)&&Vd(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&&Kd.test(e.tokens[t].content)&&Jd(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 Qd(){this.ruler=new Id;for(let e=0;e<Xd.length;e++)this.ruler.push(Xd[e][0],Xd[e][1])}function Yd(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(_d(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}Qd.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},Qd.prototype.State=Od,Yd.prototype.push=function(e,t,n){const r=new Fd(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Yd.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Yd.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Yd.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!_d(this.src.charCodeAt(e)))break}return e},Yd.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!_d(this.src.charCodeAt(--e)))return e+1;return e},Yd.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Yd.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},Yd.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(_d(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("")},Yd.prototype.Token=Fd;function Zd(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function ef(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 tf(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(!_d(e.src.charCodeAt(r)))return-1}return r}function nf(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),!_d(o))?-1:i}const rf="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",of="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",sf=new RegExp("^(?:"+rf+"|"+of+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),af=new RegExp("^(?:"+rf+"|"+of+")"),lf=[[/^<(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(af.source+"\\s*$"),/^$/,!1]];const cf=[["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&&!_d(a))return!1;if(45===s&&_d(a))return!1;for(;o<e.eMarks[i];){const t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!_d(t))return!1;o++}let l=Zd(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=Zd(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=ef(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=Zd(e,i).trim(),!l)break;if(e.sCount[i]-e.blkIndent>=4)break;if(c=ef(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(!_d(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&&!_d(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=nf(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=tf(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=nf(e,l),f<0)break;s=e.bMarks[l]+e.tShift[l]}else if(f=tf(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(!_d(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(!_d(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(!_d(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i)&&g)for(g="",i=f,s=h;i<o;){if(!_d(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i))return!1;const v=Ed(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<lf.length&&!lf[a][0].test(s);a++);if(a===lf.length)return!1;if(r)return lf[a][2];let l=t+1;const c=lf[a][1].test("");if(!lf[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),lf[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&&!_d(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const l=e.skipCharsBack(o,35,i);l>i&&_d(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=Cd(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=Cd(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=Cd(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 uf(){this.ruler=new Id;for(let e=0;e<cf.length;e++)this.ruler.push(cf[e][0],cf[e][1],{alt:(cf[e][2]||[]).slice()})}function df(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 ff(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}}uf.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)}},uf.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)},uf.prototype.State=Yd,df.prototype.pushPending=function(){const e=new Fd("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},df.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new Fd(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},df.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=wd(i)||Sd(i),c=wd(a)||Sd(a),u=bd(i),d=bd(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}},df.prototype.Token=Fd;const hf=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const pf=[];for(let $xe=0;$xe<256;$xe++)pf.push(0);function gf(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){pf[e.charCodeAt(0)]=1});const mf={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;gf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&gf(e,t[r].delimiters)}};function vf(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 yf={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;vf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&vf(e,t[r].delimiters)}};const _f=/^([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])?)*)$/,bf=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const xf=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Sf=/^&([a-z][a-z0-9]{1,31});/i;function wf(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 Ef=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!ff(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(hf);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&&_d(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),_d(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!==pf[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",mf.tokenize],["emphasis",yf.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),_d(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),_d(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),_d(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[Ed(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),_d(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),_d(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),_d(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[Ed(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(bf.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(_f.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(sf);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(xf);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=sd(t)?ad(t):ad(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(Sf);if(r){const n=function(e){return td(e,Hu.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}]],kf=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;wf(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&wf(t[r].delimiters)}],["strikethrough",mf.postProcess],["emphasis",yf.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 Cf(){this.ruler=new Id;for(let e=0;e<Ef.length;e++)this.ruler.push(Ef[e][0],Ef[e][1]);this.ruler2=new Id;for(let e=0;e<kf.length;e++)this.ruler2.push(kf[e][0],kf[e][1])}function Af(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Nf(e){return Object.prototype.toString.call(e)}function Tf(e){return"[object Function]"===Nf(e)}function Rf(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}Cf.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},Cf.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()},Cf.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)},Cf.prototype.State=df;const Df={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const If={"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}}},Ff="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Of(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=Ou.source,t.src_Cc=Pu.source,t.src_Z=zu.source,t.src_P=Mu.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]"===Nf(n))return!function(e){return"[object RegExp]"===Nf(e)}(n.validate)?Tf(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(Tf(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Nf(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(Rf).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 Pf(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 Mf(e,t){if(!(this instanceof Mf))return new Mf(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||Df.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=Af({},Df,t),this.__schemas__=Af({},If,e),this.__compiled__={},this.__tlds__=Ff,this.__tlds_replaced__=!1,this.re={},Of(this)}Mf.prototype.add=function(e,t){return this.__schemas__[e]=t,Of(this),this},Mf.prototype.set=function(e){return this.__opts__=Af(this.__opts__,e),this},Mf.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))},Mf.prototype.pretest=function(e){return this.re.pretest.test(e)},Mf.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Mf.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 Pf(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},Mf.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 Pf(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Mf.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(),Of(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Of(this),this)},Mf.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Mf.prototype.onCompile=function(){};const Lf=2147483647,zf=36,jf=/^xn--/,Uf=/[^\0-\x7F]/,Bf=/[\x2E\u3002\uFF0E\uFF61]/g,$f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},qf=Math.floor,Gf=String.fromCharCode;function Vf(e){throw new RangeError($f[e])}function Kf(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(Bf,".")).split("."),t).join(".");return r+i}function Wf(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 Hf=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:zf},Jf=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},Xf=function(e,t,n){let r=0;for(e=n?qf(e/700):e>>1,e+=qf(e/t);e>455;r+=zf)e=qf(e/35);return qf(r+36*e/(e+38))},Qf=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&&Vf("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=zf;;i+=zf){a>=n&&Vf("invalid-input");const s=Hf(e.charCodeAt(a++));s>=zf&&Vf("invalid-input"),s>qf((Lf-r)/t)&&Vf("overflow"),r+=s*t;const l=i<=o?1:i>=o+26?26:i-o;if(s<l)break;const c=zf-l;t>qf(Lf/c)&&Vf("overflow"),t*=c}const l=t.length+1;o=Xf(r-s,l,0==s),qf(r/l)>Lf-i&&Vf("overflow"),i+=qf(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Yf=function(e){const t=[],n=(e=Wf(e)).length;let r=128,i=0,o=72;for(const l of e)l<128&&t.push(Gf(l));const s=t.length;let a=s;for(s&&t.push("-");a<n;){let n=Lf;for(const t of e)t>=r&&t<n&&(n=t);const l=a+1;n-r>qf((Lf-i)/l)&&Vf("overflow"),i+=(n-r)*l,r=n;for(const c of e)if(c<r&&++i>Lf&&Vf("overflow"),c===r){let e=i;for(let n=zf;;n+=zf){const r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;const i=e-r,s=zf-r;t.push(Gf(Jf(r+i%s,0))),e=qf(i/s)}t.push(Gf(Jf(e,0))),o=Xf(i,l,a===s),i=0,++a}++i,++r}return t.join("")},Zf=function(e){return Kf(e,function(e){return Uf.test(e)?"xn--"+Yf(e):e})},eh=function(e){return Kf(e,function(e){return jf.test(e)?Qf(e.slice(4).toLowerCase()):e})},th={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"]}}}},nh=/^(vbscript|javascript|file|data):/,rh=/^data:image\/(gif|png|jpeg|webp);/;function ih(e){const t=e.trim().toLowerCase();return!nh.test(t)||rh.test(t)}const oh=["http:","https:","mailto:"];function sh(e){const t=Iu(e,!0);if(t.hostname&&(!t.protocol||oh.indexOf(t.protocol)>=0))try{t.hostname=Zf(t.hostname)}catch(Ey){}return yu(_u(t))}function ah(e){const t=Iu(e,!0);if(t.hostname&&(!t.protocol||oh.indexOf(t.protocol)>=0))try{t.hostname=eh(t.hostname)}catch(Ey){}return mu(_u(t),mu.defaultChars+"%")}function lh(e,t){if(!(this instanceof lh))return new lh(e,t);t||nd(e)||(t=e||{},e="default"),this.inline=new Cf,this.block=new uf,this.core=new Qd,this.renderer=new Dd,this.linkify=new Mf,this.validateLink=ih,this.normalizeLink=sh,this.normalizeLinkText=ah,this.utils=Nd,this.helpers=id({},Td),this.options={},this.configure(e),t&&this.set(t)}function ch(e){return"var("+e+")"}lh.prototype.set=function(e){return id(this.options,e),this},lh.prototype.configure=function(e){const t=this;if(nd(e)){const t=e;if(!(e=th[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},lh.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},lh.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},lh.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},lh.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},lh.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},lh.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},lh.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let uh=co([ui("color",ch(_t.textPrimary)),ui("font-size",ch(xt.sizeSm)),ui("line-height",ch(xt.lineHeightRelaxed)),ui("word-break","break-word"),Wi("& > :first-child",[ui("margin-top","0")]),Wi("& > :last-child",[ui("margin-bottom","0")]),Wi("& h1, & h2, & h3, & h4, & h5, & h6",[ui("margin","var("+bt.md+") 0 var("+bt.sm+")"),ui("line-height",ch(xt.lineHeightTight)),ui("font-weight",ch(xt.weightBold))]),Wi("& h1",[ui("font-size",ch(xt.sizeXl))]),Wi("& h2",[ui("font-size",ch(xt.sizeLg))]),Wi("& h3, & h4, & h5, & h6",[ui("font-size",ch(xt.sizeMd))]),Wi("& p",[ui("margin","var("+bt.sm+") 0")]),Wi("& a",[ui("color",ch(_t.brand)),ui("text-decoration","none")]),Wi("& a:hover",[ui("text-decoration","underline")]),Wi("& ul, & ol",[ui("margin","var("+bt.sm+") 0"),ui("padding-left","1.5em")]),Wi("& li",[ui("margin","var("+bt.xs+") 0")]),Wi("& code",[ui("font-family",ch(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("background",ch(_t.surfaceSubtle)),ui("padding","1px 4px"),ui("border-radius",ch(St.sm))]),Wi("& pre",[ui("background",ch(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",ch(St.md)),ui("padding",ch(bt.md)),ui("overflow","auto"),ui("margin","var("+bt.sm+") 0")]),Wi("& pre code",[ui("background","none"),ui("padding","0")]),Wi("& blockquote",[ui("margin","var("+bt.sm+") 0"),ui("padding-left",ch(bt.md)),ui("border-left","3px solid var("+_t.border+")"),ui("color",ch(_t.textSecondary))]),Wi("& table",[ui("border-collapse","collapse"),ui("margin","var("+bt.sm+") 0")]),Wi("& th, & td",[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("text-align","left")]),Wi("& th",[ui("background",ch(_t.surfaceSubtle)),ui("font-weight",ch(xt.weightMedium))]),Wi("& img",[ui("max-width","100%"),ui("border-radius",ch(St.sm))]),Wi("& hr",[ui("border","none"),ui("border-top","1px solid var("+_t.borderSubtle+")"),ui("margin","var("+bt.md+") 0")])]),dh=new lh({html:!1,linkify:!0});let fh=function(e){let t=e.source,n=p(()=>dh.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:uh,dangerouslySetInnerHTML:{__html:n}})};function hh(e,t){return i(fh,{source:e.body})}function ph(e){return Array.from(e).length}function gh(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 mh(e,t){return j(t,t=>{let n=gh(e,t)[1];return""===n?void 0:n})}function vh(e){return"var("+e+")"}let yh=co([gi("flex"),mi("column"),ui("gap","4px")]),_h=co([ui("background",vh(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",vh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-family","inherit"),ui("font-size",vh(xt.sizeMd)),ui("line-height",vh(xt.lineHeightNormal)),ui("color",vh(_t.textPrimary)),ui("outline","none"),ui("resize","vertical"),Vi({NAME:"percent",VAL:100}),ui("box-sizing","border-box"),ui("transition","border-color 120ms"),Xi([ui("border-color",vh(_t.brand))])]),bh=co([ui("border-color",vh(_t.error)),Xi([ui("border-color",vh(_t.error))])]),xh=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",vh(bt.sm)),ui("font-size",vh(xt.sizeXs)),ui("color",vh(_t.textSecondary))]),Sh=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("color",vh(_t.textSecondary))]),wh=co([ui("font-variant-numeric","tabular-nums")]),Eh=co([ui("color",vh(_t.error)),ui("font-weight",vh(xt.weightMedium))]),kh=co([ui("background",vh(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-left","3px solid var("+_t.error+")"),ui("border-radius",vh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",vh(xt.sizeXs)),ui("line-height",vh(xt.lineHeightNormal)),ui("white-space","pre-wrap"),ui("word-break","break-word"),ui("max-height","8em"),ui("overflow","auto")]),Ch=co([ui("color",vh(_t.textSecondary)),ui("font-size",vh(xt.sizeXs)),Ri(to(2))]),Ah=co([ui("color",vh(_t.textPrimary))]),Nh=co([ui("color",vh(_t.error)),ui("font-weight",vh(xt.weightMedium))]),Th=co([ui("color",vh(_t.textDisabled)),ui("text-decoration","line-through")]);function Rh(e){return e.toString()+" character"+(1===e?"":"s")}function Dh(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 Ih=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=mh(d,l),v=$(m),y=p||v?_h+" "+bh:_h;if(void 0!==m&&void 0!==l){let e=gh(d,l);t=r("div",{children:[i("div",{children:"Sent as:",className:Ch}),r("div",{children:[i("span",{children:e[0],className:Ah}),i("span",{children:"✂",className:Nh}),i("span",{children:m,className:Th})],className:kh})]})}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:Sh}),i("span",{children:Dh(g,l),className:v?wh+" "+Eh:wh})],className:xh}),t],className:yh})};function Fh(e){return"var("+e+")"}Bc({id:"email",label:"Email",constraints:{subjectMaxLength:78,note:"Subject lines are elided in inbox lists past ~78 characters"},preview:pu}),Bc({id:"markdown",label:"Markdown",constraints:{},preview:hh});let Oh=co([gi("flex"),mi("column"),ui("gap",Fh(bt.sm)),ui("background",Fh(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Fh(St.md)),ui("padding",Fh(bt.md))]),Ph=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",Fh(bt.sm))]),Mh=co([ui("font-size",Fh(xt.sizeSm)),ui("font-weight",Fh(xt.weightMedium)),ui("color",Fh(_t.textPrimary))]),Lh=co([ui("font-size",Fh(xt.sizeXs)),ui("color",Fh(_t.textSecondary))]),zh=co([ui("font-size",Fh(xt.sizeXs)),ui("color",Fh(_t.textSecondary)),ui("font-variant-numeric","tabular-nums"),ui("white-space","nowrap")]),jh=co([ui("color",Fh(_t.error)),ui("font-weight",Fh(xt.weightMedium))]),Uh=co([gi("flex"),di("baseline"),xi("spaceBetween"),ui("gap",Fh(bt.sm)),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("padding-bottom",Fh(bt.xs))]),Bh=co([ui("font-size",Fh(xt.sizeMd)),ui("font-weight",Fh(xt.weightMedium)),ui("color",Fh(_t.textPrimary)),ui("word-break","break-word")]),$h=co([ui("color",Fh(_t.textDisabled)),ui("text-decoration","line-through")]),qh=co([ui("color",Fh(_t.error)),ui("font-weight",Fh(xt.weightMedium))]),Gh=co([ui("margin","0"),ui("font-family","inherit"),ui("font-size",Fh(xt.sizeSm)),ui("line-height",Fh(xt.lineHeightRelaxed)),ui("color",Fh(_t.textPrimary)),ui("white-space","pre-wrap"),ui("word-break","break-word")]),Vh=co([ui("max-width","100%"),ui("border-radius",Fh(St.sm)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("object-fit","cover")]),Kh=co([ui("font-size",Fh(xt.sizeXs)),ui("color",Fh(_t.error)),ui("background",Fh(_t.surfaceSubtle)),ui("border-left","3px solid var("+_t.error+")"),ui("border-radius",Fh(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")")]);function Wh(e,t){let n=gh(e,t),s=n[1];return""===s?e:r(o,{children:[n[0],i("span",{children:"✂",className:qh}),i("span",{children:s,className:$h})]})}let Hh=function(e){let t=e.showHeader,n=e.message,o=e.channelId,s=void 0===t||t,l=$c(o);a(()=>{q(l)&&function(e,t){if(Gc.contents.some(t=>t===e))return;Gc.contents.push(e);let n=Ye(Uc).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,qc,e=>e.constraints),f=ph(n.body),h=mh(n.body,d.maxLength),p=n.subject;if(void 0!==p){let e=d.subjectMaxLength,t=ph(p),n=L(e,!1,e=>t>e);c=r("div",{children:[i("span",{children:void 0!==e?Wh(p,e):p,className:Bh}),void 0!==e?i("span",{children:t.toString()+" / "+e.toString(),className:n?zh+" "+jh:zh}):null],className:Uh})}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?Wh(n.body,e):n.body,className:Gh})}let v,y=n.imageUrl;if(void 0!==y){let e=d.mediaAspect;v=i("img",{className:Vh,style:void 0!==e?ou({},"aspectRatio",e):{},alt:"Message media",src:He(y)})}else v=null;let _=d.note;return r("div",{children:[s?r("div",{children:[i("span",{children:u,className:Mh}),i("span",{children:Dh(f,d.maxLength),className:$(h)?zh+" "+jh:zh})],className:Ph}):null,c,g,void 0!==h?i("div",{children:Rh(ph(h))+" past the limit — "+u+" will cut the tail.",className:Kh}):null,v,void 0!==_?i("span",{children:_,className:Lh}):null],className:Oh})};function Jh(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 Xh(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 Qh="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Yh=Qh&&"documentMode"in document?document.documentMode:null,Zh=Qh&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ep=Qh&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),tp=!(!Qh||!("InputEvent"in window)||Yh)&&"getTargetRanges"in new window.InputEvent("input"),np=Qh&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,rp=Qh&&/Android/.test(navigator.userAgent),ip=Qh&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!rp,op=Qh&&/^(?=.*Chrome).*/i.test(navigator.userAgent),sp=Qh&&rp&&op,ap=Qh&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Zh&&!op,lp=0,cp=1,up=2,dp=1,fp=2,hp=3,pp=4,gp=5,mp=6,vp=ip||np||ap?" ":"​",yp="\n\n",_p=ep?" ":vp,bp={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},xp={directionless:1,unmergeable:2},Sp={center:2,end:6,justify:4,left:1,right:3,start:5},wp={[fp]:"center",[mp]:"end",[pp]:"justify",[dp]:"left",[hp]:"right",[gp]:"start"},Ep={normal:0,segmented:2,token:1},kp={[lp]:"normal",[up]:"segmented",[cp]:"token"},Cp="$config";function Ap(){return iS()._blockCursorElement}function Np(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let Tp,Rp=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&&Jh(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Jh(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Jh(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=Dp(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=Dp(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 Dp(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class Ip extends Rp{withBefore(e){return new Ip(this.element,e,this.after)}withAfter(e){return new Ip(this.element,this.before,e)}withElement(e){return this.element===e?this:new Ip(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Np(t);)e=t,t=t.nextSibling;const n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===Ap()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(ap||np||ip);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=qx().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(i,r),e){const e=qx().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=Ap(),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=Fp(t,n);i.push(r);const o=Fp(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 Fp(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&&Jh(225),n.reverse()}try{Tp="0.48.0+prod.esm"}catch(Jh){}const Op=Tp??'"<unknown>+source"';let Pp=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 Mp=null;function Lp(e,t=1e3){return e instanceof zp?e.clone():e.size<t?new Map(e):(new zp).init(new Map(e),void 0,e.size)}let zp=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===Mp?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!==Mp?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!==Mp&&void 0!==n||(this._size++,n===Mp&&r.delete(e)),r.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,Mp),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!==Mp&&(void 0!==r&&(n[1]=r),yield n)}if(e)for(const n of e)n[1]===Mp||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 jp(e,t,n,r,i,o){if(X_(e)){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&((X_(s)||CS(s)&&null!==s.__slots)&&jp(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}for(const s of CS(e)&&null!==e.__slots?e.__slots.values():[]){const e=r.get(s);void 0!==e&&AS(e)&&e.__slotHost===t&&((X_(e)||CS(e)&&null!==e.__slots)&&jp(e,s,n,r,i,o),n.has(s)||o.delete(s),i.push(s))}}let Up=!1,Bp=0;function $p(e){Bp=e.timeStamp}function qp(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Qb(e,n)}function Gp(e,t,n){const r=Lx(Nx(n)),i=r&&Vx(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&&ux(t,a,o,s,!1)}function Vp(e,t,n){if(Dy(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return jb(t)&&n.isAttached()}function Kp(e,t,n){for(let r=e;r&&!gS(r);r=wx(r)){const e=Qb(r,t);if(void 0!==e){const t=Hb(e,n);if(t)return Z_(t)||!Xx(r)?void 0:[r,t]}}}function Wp(e,t,n){Up=!0;const r=performance.now()-Bp>100;try{W_(e,()=>{const i=r_()||function(e){return e.read("latest",()=>{const e=r_();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=Kp(f,e,s);if(!h)continue;const[p,g]=h;if("characterData"===d)r&&by(g)&&jb(f)&&Vp(i,f,g)&&Gp(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=Jb(n),o=n.parentNode;if(!(null==o||n===a||null!==r||qp(n,o,e)||e._slotsUsed&&Xx(n)&&n.hasAttribute("data-lexical-slot")||gS(n))){if(ep){const e=(Xx(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];(qp(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||qp(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(l&&nx(i),ep&&bx(e)&&i.insertRawText(c))})}finally{Up=!1}}function Hp(e){const t=e._observer;null!==t&&Wp(e,t.takeRecords(),t)}function Jp(e){!function(e){0===Bp&&Nx(e).addEventListener("textInput",$p,!0)}(e),e._observer=new MutationObserver((t,n)=>{Wp(e,t,n)})}const Xp="latest";let Qp=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||ag).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Yp(e,t){return new Qp(e,t)}function Zp(e,t,n=Xp){const r=(n===Xp?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function eg(e,t,n){let r;if(T_(),"function"==typeof n){const i=e.getLatest(),o=Zp(i,t);if(r=n(o),t.isEqual(o,r))return i}else r=n;const i=e.getWritable();return ig(i).updateFromKnown(t,r),i}function tg(e){const t=new Map,n=new Set;for(const{ownNodeConfig:r}of bS("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 ng=new Set(["__proto__","constructor","prototype"]);let rg=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 sg(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(ng.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=sg(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(ng.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 ig(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new rg(t,og(t));return t.__state=n,n}function og(e){return e.__state?e.__state.sharedNodeState:Tb(iS(),e.getType()).sharedNodeState}function sg(e){if(e)for(const t in e)return e}function ag(e){return e}function lg(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 cg(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 ug(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function dg(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&&lg(n,e,t)||t&&lg(n,t,e)||e&&cg(n,e,t)||t&&cg(n,t,e))}(l,c))}function fg(e,t){const n=e.mergeWithSibling(t),r=I_()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function hg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&by(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(dg(t,r)){r=fg(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&by(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(dg(r,n)){r=fg(r,n);break}break}n.remove()}}else r.remove()}function pg(e){return gg(e.anchor),gg(e.focus),e}function gg(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),by(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!X_(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}const mg=Symbol.for("@lexical/CachedTextSize");function vg(e,t){return Og.read(()=>{let n=0,r=e;for(let e=0;e<t&&null!==r;e++){const i=Fg.get(r);if(void 0===i&&Jh(345,r),X_(i)){const o=Pg.get(r);if(void 0!==o&&X_(o)&&o.__parent!==i.__parent)n+=i.getTextContentSize();else{const e=Mg.get(r),t=e&&e.__lexicalTextContent;"string"!=typeof t&&Jh(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{const e=i[mg];void 0===e&&Jh(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:xg})}function yg(e){X_(e)||void 0===e[mg]&&(e[mg]=by(e)?e.__text.length:e.getTextContentSize())}const _g=4;let bg,xg,Sg,wg="",Eg=null,kg=null,Cg=null;function Ag(){return{firstTextKey:Cg,format:Eg,style:kg}}function Ng(e){null!==e.firstTextKey&&(Eg=e.format,kg=e.style,Cg=e.firstTextKey)}function Tg(e){if(null!==Cg)return;const t=e.__lexicalFirstTextKey;if(void 0===t&&Jh(348),null===t)return;const n=Pg.get(t);by(n)&&(Eg=n.getFormat(),kg=n.getStyle(),Cg=t)}let Rg,Dg,Ig,Fg,Og,Pg,Mg,Lg,zg,jg,Ug=!1,Bg=!1;function $g(e,t){const n=Fg.get(e),r=Pg.has(e);if(null!==t){const n=dm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(xg._keyToDOMMap.delete(e),X_(n)){const e=wS(n,Fg);qg(e,0,e.length-1,null)}if(void 0!==n){for(const e of Yg(n).values()){const t=em(e);$g(e,null),null!==t&&t.remove()}yx(zg,Sg,Rg,n,"destroyed")}}}function qg(e,t,n,r){for(let i=t;i<=n;++i){const t=e[i];void 0!==t&&$g(t,r)}}function Gg(e,t){e.setProperty("text-align",t)}const Vg="40px";function Kg(e,t){const n=bg.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, ${Vg}))`)}function Wg(e,t){const n=e.style;0===t?Gg(n,""):1===t?Gg(n,"left"):2===t?Gg(n,"center"):3===t?Gg(n,"right"):4===t?Gg(n,"justify"):5===t?Gg(n,"start"):6===t&&Gg(n,"end")}function Hg(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(tb(e))return null;const n=e.getParent();return null===n||Dx(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function Jg(e){const t=qx().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function Xg(e,t,n){t||"false"===e.contentEditable?function(e,t=iS()){const n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,xg):n.removeAttribute("contenteditable")}function Qg(e,t,n){const r=wg,i=Ag();wg="";let o="";const s=Z_(e);for(const[a,l]of n){const n=Jg(a);Xg(t,s,n),t.appendChild(n),wg="";const r=Ag();nm(l,sS(e,n,xg)),Ng(r),Zg(e,a,t,n),o+=wg}return Ng(i),wg=r,o}function Yg(e){return CS(e)&&null!==e.__slots?e.__slots:kS}function Zg(e,t,n,r){const i=jg.$getSlotTargetElement(e,t,n,xg);null!==i&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function em(e){const t=Mg.get(e);return void 0!==t?t.parentElement:null}function tm(e,t,n){const r=Yg(e),i=Yg(t);for(const[u,d]of r)if(!i.has(u)){const e=em(d);$g(d,null),null!==e&&e.remove()}const o=wg,s=Ag();let a="",l=null;const c=Z_(t);for(const[u,d]of i){const e=r.get(u);let i=void 0!==e?em(e):null;wg="";const o=Ag();if(null===i){i=Jg(u);let e=null;for(const t of n.children)if(!t.hasAttribute("data-lexical-slot")){e=t;break}n.insertBefore(i,e),nm(d,sS(t,i,xg))}else e===d?am(d,i):(void 0!==e&&$g(e,i),nm(d,sS(t,i,xg)));if(Ng(o),Xg(n,c,i),Zg(t,u,n,i),a+=wg,i.parentElement===n){const e=null===l?n.firstChild:l.nextSibling;e!==i&&n.insertBefore(i,e),l=i}}return Ng(s),wg=o,a}function nm(e,t){const n=Pg.get(e);if(void 0===n&&Jh(60),null!==t){const r=Fg.get(e);if(void 0!==r){const i=Mg.get(e);if(void 0!==i){const o=AS(r)?r.__slotHost:null,s=AS(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),am(e,t.element)}}}const r=jg.$createDOM(n,xg);if(function(e,t,n){const r=n._keyToDOMMap;Xb(t,n,e),r.set(e,t)}(e,r,xg),by(n)?r.setAttribute("data-lexical-text","true"):Z_(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})),X_(n)){const e=n.__indent,t=n.__size;Hg(r,n),0!==e&&Kg(r,e);const i=Yg(n),o=i.size>0?Qg(n,r,i):"";if(0===t)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,wg+=o,i.size>0&&(r.__lexicalSlotTextLength=o.length);else{const e=wg,s=t-1;if(rm(wS(n,Pg),n,0,s,sS(n,r,xg)),""!==o){const t=r.__lexicalTextContent||"";r.__lexicalTextContent=o+t,wg=e+o+t}i.size>0&&(r.__lexicalSlotTextLength=o.length)}const s=n.__format;0!==s&&Wg(r,s),n.isInline()||im(null,n,r)}else{const t=n.getTextContent();if(Z_(n)){const t=n.decorate(xg,bg);null!==t&&lm(e,t),r.contentEditable="false";const i=Yg(n);i.size>0&&Qg(n,r,i)}wg+=t}return null!==t&&t.insertChild(r),jg.$decorateDOM(n,null,r,xg),yg(n),yx(zg,Sg,Rg,n,"created"),r}function rm(e,t,n,r,i){const o=wg,s=Ag();wg="",Eg=null,kg=null,Cg=null;let a=n;for(;a<=r;++a){const t=Ag();nm(e[a],i);const n=Pg.get(e[a]);null!==n&&by(n)?null===Eg&&(Eg=n.getFormat(),kg=n.getStyle(),Cg=n.__key):X_(n)&&a<r&&!n.isInline()&&(wg+=yp),Ng(t)}const l=xg._keyToDOMMap.get(t.__key);void 0===l&&Jh(349,t.__key),l.__lexicalTextContent=wg,l.__lexicalFirstTextKey=Cg,wg=o+wg,Ng(s)}function im(e,t,n){const r=sS(t,n,xg),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 ub(e)?"line-break":Z_(e)&&e.isInline()?"decorator":null}return Yg(e).size>0?null:"empty"}return null}(t,Pg);i!==o&&r.setManagedLineBreak(o)}function om(e,t,n){var r;Eg=null,kg=null,Cg=null,function(e,t,n){const r=wg,i=e.__size,o=t.__size;wg="";const s=n.element,a=xg._keyToDOMMap.get(t.__key);void 0===a&&Jh(351,t.__key);const l=o-i;if(!Ug&&Math.abs(l)<=1&&i>=_g&&e.__first===t.__first&&(0!==l||!xg._cloneNotNeeded.has(e.__key))){const i=a.__lexicalTextContent,c=Lg.get(e.__key);if(!Ug&&"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=Pg.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=vg(o,u);let n=o,l=0;for(;null!==n&&l<u;){const e=Pg.get(n);if(void 0===e)break;const t=Ag();am(n,s),by(e)&&null===Eg&&(Eg=e.getFormat(),kg=e.getStyle(),Cg=e.__key),Ng(t),n=e.__next,l++}let d="";for(n=o,l=0;null!==n&&l<u;){const e=Pg.get(n);if(void 0===e)break;let t;if(X_(e)){const r=xg._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;"string"!=typeof i&&Jh(352,e.getType()),t=i}else t=e.getTextContent();d+=t,l<u-1&&X_(e)&&!e.isInline()&&(d+=yp),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,wg=r+p,void sm(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=Fg.get(c);if(void 0===e)return!1;c=e.__prev}if(null===c)return!1;const u=Pg.get(o),d=Fg.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=Pg.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=Fg.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=vg(c,l);for(const E of v){const e=Ag();if("reconcile"===E.kind)am(E.key,n.element);else if("destroy"===E.kind)$g(E.key,n.element);else{let e=null;for(let t=E.nextIndex+1;t<s;t++){const n=xg._keyToDOMMap.get(f[t]);if(void 0!==n){e=n;break}}nm(E.key,n.withBefore(e??n.before))}if("destroy"!==E.kind){const e=Pg.get(E.key);e&&by(e)&&null===Eg&&(Eg=e.getFormat(),kg=e.getStyle(),Cg=e.__key)}Ng(e)}let x="";for(let E=0;E<s;E++){const e=Pg.get(f[E]);if(void 0===e)return!1;let t;if(X_(e)){const n=xg._keyToDOMMap.get(f[E]),r=n&&n.__lexicalTextContent;"string"!=typeof r&&Jh(350,e.getType()),t=r}else t=e.getTextContent();x+=t,E<s-1&&X_(e)&&!e.isInline()&&(x+=yp)}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&&Jh(353),wg=r+e,void sm(t,a,c)}}}if(0===l){let t=e.__first,n=0;for(;null!==t;){const e=Pg.get(t);if(void 0===e)break;const r=Ug||Ig.has(t)||Dg.has(t),i=Ag();if(r)am(t,s);else{let n,r;if(X_(e)){r=Mg.get(t);const i=r&&r.__lexicalTextContent;"string"!=typeof i&&Jh(354,e.getType()),n=i}else n=e.getTextContent();wg+=n,void 0!==r&&Tg(r)}by(e)?null===Eg&&(Eg=e.getFormat(),kg=e.getStyle(),Cg=e.__key):X_(e)&&n<o-1&&!e.isInline()&&(wg+=yp),Ng(i),t=e.__next,n++}return a.__lexicalTextContent=wg,a.__lexicalFirstTextKey=Cg,void(wg=r+wg)}}if(1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)am(r,s);else{const e=dm(r),t=nm(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}$g(r,null)}const o=Pg.get(i);by(o)&&null===Eg&&(Eg=o.getFormat(),kg=o.getStyle(),Cg=o.__key)}else{const r=wS(e,Fg),a=wS(t,Pg);if(r.length!==i&&Jh(227),a.length!==o&&Jh(228),0===i)0!==o&&rm(a,t,0,o-1,n);else if(0===o){if(0!==i){const e=null==n.after&&null==n.before&&0===Yg(t).size&&null==n.element.__lexicalLineBreak;qg(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=Ag();if(e===r)u=cm(am(r,o.element)),d++,f++;else{if(void 0===c&&(c=um(n,f)),void 0===l)l=um(t,d);else if(!l.has(e)){d++,Ng(i);continue}if(!c.has(e)){u=cm(dm(e)),$g(e,o.element),d++,l.delete(e),Ng(i);continue}if(l.has(r)){const e=Sx(xg,r);e!==u&&o.withBefore(u??o.before).insertChild(e),u=cm(am(r,o.element)),d++,f++}else nm(r,o.withBefore(u??o.before)),f++}const s=Pg.get(r);null!==s&&by(s)?null===Eg&&(Eg=s.getFormat(),kg=s.getStyle(),Cg=s.__key):X_(s)&&f<=a&&!s.isInline()&&(wg+=yp),Ng(i)}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1],r=void 0===t?null:xg.getElementByKey(t);rm(n,e,f,a,o.withBefore(r??o.before))}else p&&!h&&qg(t,d,s,o.element)}(t,r,a,i,o,n)}a.__lexicalTextContent=wg,a.__lexicalFirstTextKey=Cg,wg=r+wg}(e,t,sS(t,n,xg)),Dx(t)||(r=t,null==Eg||Eg===r.__textFormat||Bg||r.setTextFormat(Eg),function(e){null==kg||kg===e.__textStyle||Bg||e.setTextStyle(kg)}(t))}function sm(e,t,n){const r=t.__lexicalFirstTextKey;if(null!=r){const t=e.__key;let i=r;for(;null!==i;){const e=Pg.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=Pg.get(r);if(by(e))return Eg=e.getFormat(),void(kg=e.getStyle())}}t.__lexicalFirstTextKey=Cg}function am(e,t){const n=Fg.get(e);let r=Pg.get(e);void 0!==n&&void 0!==r||Jh(61);const i=Ug||Ig.has(e)||Dg.has(e),o=Sx(xg,e);if(n===r&&!i){let e;if(X_(n)){const t=o.__lexicalTextContent;"string"!=typeof t&&Jh(355,n.getType()),e=t,Tg(o)}else e=n.getTextContent();return wg+=e,o}if(n!==r&&i&&yx(zg,Sg,Rg,r,"updated"),jg.$updateDOM(r,n,o,xg)){const n=nm(e,null);return null===t&&Jh(62),t.replaceChild(n,o),$g(e,null),n}if(X_(n)){X_(r)||Jh(334,e);const t=r.__indent;(Ug||t!==n.__indent)&&Kg(o,t);const s=r.__format;(Ug||s!==n.__format)&&Wg(o,s);const a=i&&(Yg(r).size>0||Yg(n).size>0)?tm(n,r,o):"";if(i){const e=wg;if(om(n,r,o),tb(r)||r.isInline()||im(0,r,o),""!==a){const t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,wg=e+a+t,o.__lexicalSlotTextLength=a.length}else(Yg(r).size>0||Yg(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const e=o.__lexicalTextContent;"string"!=typeof e&&Jh(356,n.getType()),wg+=e,Tg(o)}if((Ug||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Hg(o,r),tb(r)&&!Ug))for(const e of r.getChildren())X_(e)&&Hg(Sx(xg,e.getKey()),e)}else{const t=r.getTextContent();if(Z_(r)){const t=r.decorate(xg,bg);null!==t&&lm(e,t),i&&(Yg(r).size>0||Yg(n).size>0)&&tm(n,r,o)}wg+=t}if(!Bg&&tb(r)){const e=r.getLatest();if(e.__cachedText!==wg){const t=e.getWritable();t.__cachedText=wg,r=t}}return jg.$decorateDOM(r,n,o,xg),yg(r),o}function lm(e,t){let n=xg._pendingDecorators;const r=xg._decorators;if(null===n){if(r[e]===t)return;n=Zb(xg)}n[e]=t}function cm(e){let t=e.nextSibling;return null!==t&&t===xg._blockCursorElement&&(t=t.nextSibling),t}function um(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function dm(e){const t=Mg.get(e);return void 0===t&&Jh(75,e),t}function fm(e){return{type:e}}const hm=fm("SELECTION_CHANGE_COMMAND"),pm=fm("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),gm=fm("CLICK_COMMAND"),mm=fm("BEFORE_INPUT_COMMAND"),vm=fm("INPUT_COMMAND"),ym=fm("COMPOSITION_START_COMMAND"),_m=fm("COMPOSITION_END_COMMAND"),bm=fm("DELETE_CHARACTER_COMMAND"),xm=fm("INSERT_LINE_BREAK_COMMAND"),Sm=fm("INSERT_PARAGRAPH_COMMAND"),wm=fm("CONTROLLED_TEXT_INSERTION_COMMAND"),Em=fm("PASTE_COMMAND"),km=fm("REMOVE_TEXT_COMMAND"),Cm=fm("DELETE_WORD_COMMAND"),Am=fm("DELETE_LINE_COMMAND"),Nm=fm("FORMAT_TEXT_COMMAND"),Tm=fm("SET_TEXT_FORMAT_COMMAND"),Rm=fm("UNDO_COMMAND"),Dm=fm("REDO_COMMAND"),Im=fm("KEYDOWN_COMMAND"),Fm=fm("KEY_ARROW_RIGHT_COMMAND"),Om=fm("MOVE_TO_END"),Pm=fm("KEY_ARROW_LEFT_COMMAND"),Mm=fm("MOVE_TO_START"),Lm=fm("KEY_ARROW_UP_COMMAND"),zm=fm("KEY_ARROW_DOWN_COMMAND"),jm=fm("KEY_ENTER_COMMAND"),Um=fm("KEY_SPACE_COMMAND"),Bm=fm("KEY_BACKSPACE_COMMAND"),$m=fm("KEY_ESCAPE_COMMAND"),qm=fm("KEY_DELETE_COMMAND"),Gm=fm("KEY_TAB_COMMAND"),Vm=fm("INSERT_TAB_COMMAND"),Km=fm("INDENT_CONTENT_COMMAND"),Wm=fm("OUTDENT_CONTENT_COMMAND"),Hm=fm("DROP_COMMAND"),Jm=fm("FORMAT_ELEMENT_COMMAND"),Xm=fm("DRAGSTART_COMMAND"),Qm=fm("DRAGOVER_COMMAND"),Ym=fm("DRAGEND_COMMAND"),Zm=fm("COPY_COMMAND"),ev=fm("CUT_COMMAND"),tv=fm("SELECT_ALL_COMMAND"),nv=fm("CLEAR_EDITOR_COMMAND"),rv=fm("CLEAR_HISTORY_COMMAND"),iv=fm("CAN_REDO_COMMAND"),ov=fm("CAN_UNDO_COMMAND"),sv=fm("FOCUS_COMMAND"),av=fm("BLUR_COMMAND"),lv=fm("KEY_MODIFIER_COMMAND");function cv(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}const uv=Object.freeze({}),dv=[["keydown",function(e,t){const n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&Sv(n),t.isComposing()||xx(t,Im,e)}],["pointerdown",function(e,t){const n=Hx(e),r=e.pointerType;Qx(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&W_(t,()=>{mS(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){xx(t,ym,e)}],["compositionend",function(e,t){const n=t._inputState;ep?n.compositionPhase="ending-firefox":np||!ip&&!ap?xx(t,_m,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const n=t._inputState;Sv(n),W_(t,()=>{Ev(e,t)||t.dispatchCommand(vm,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){W_(t,()=>{const n=r_(),r=Lx(Nx(t)),i=i_();if(r)if(Dy(n)){const e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!tb(t)&&1===tx().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=Vx(r,t._rootElement).anchorNode;(Xx(n)||jb(n))&&nx(n_(i,r,t,e))}xx(t,gm,e)})}],["cut",uv],["copy",uv],["dragstart",uv],["dragover",uv],["dragend",uv],["paste",uv],["focus",uv],["blur",uv],["drop",uv]];tp&&dv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType;"deleteCompositionText"===n||ep&&bx(t)||"insertCompositionText"!==n&&W_(t,()=>{Ev(e,t)||xx(t,mm,e)},{event:e})}(e,t)]);const fv=new WeakMap,hv=new WeakMap,pv=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",Ov),()=>e.removeEventListener("selectionchange",Ov)));function gv(e,t,n,r,i,o){const s=e.anchor,a=e.focus,l=s.getNode(),c=I_();let u;if(void 0!==o)u=o;else{const e=Lx(Nx(c));u=null!==e?Vx(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||!by(l)||(!i&&(!tp||c._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&p<2||ox(n))&&s.offset!==a.offset&&!l.isComposing()||zb(l)||l.isDirty()&&p>1||(i||!tp)&&null!==h&&!l.isComposing()&&d!==aS(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=Lb(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(by(t)||X_(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,l)}function mv(e,t){return jb(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function vv(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=Vx(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,mv(r,i)&&mv(o,s)&&!a.postDeleteSelectionToRestore)||W_(t,()=>{if(!n)return void nx(null);if(!Fb(t,r,o))return;let l=r_();if(a.postDeleteSelectionToRestore&&Dy(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(),nx(l))}if(a.postDeleteSelectionToRestore=null,Dy(l)){const n=l.anchor,c=n.getNode();if(l.isCollapsed()){"Range"===e.type&&r===o&&(l.dirty=!0);const i=Nx(t).event,s=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:h,timeStamp:p}=a.collapsedSelectionFormat,g=tx(),m=!1===t.isComposing()&&""===g.getTextContent();if(s<p+200&&n.offset===f&&n.key===h)yv(l,u,d);else if("text"===n.type)by(c)||Jh(141),_v(l,c);else if("element"===n.type&&!m){X_(c)||Jh(259);const e=n.getNode();e.isEmpty()?function(e,t){yv(e,t.getTextFormat(),t.getTextStyle())}(l,e):yv(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(by(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}}xx(t,hm,void 0)})}function yv(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function _v(e,t){yv(e,t.getFormat(),t.getStyle())}function bv(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function xv(e){const{lastKeyCode:t}=I_()._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=r_();if(!Dy(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!by(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const e=i.getNextSibling();if("\n"===n){if(ub(e))e.selectEnd();else if(!e){const e=SS(i,Yy),t=e&&e.getNextSibling();X_(t)&&t.selectStart()}}else"\t"===n?Ey(e)&&e.selectEnd():by(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}function Sv(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function wv(e){Sv(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Sv(e),0)}function Ev(e,t){const n=Hx(e);if(Xx(n)&&mS(n,t))return!0;const r=t.getRootElement();if(null===r)return!1;const i=Wx(r.ownerDocument);return null!==i&&r.contains(i)&&mS(i,t)}function kv(e){const t=e.inputType,n=bv(e),r=I_(),i=r._inputState,o=r_();if("insertText"===t&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Sv(i),e.preventDefault(),Dy(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=i_();if(!Dy(e))return!0;nx(e.clone())}if(Dy(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(Kb(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{W_(r,()=>{Kb(null)})},30),Dy(o)){const e=o.anchor.getNode();e.markDirty(),by(e)||Jh(142),_v(o,e)}}else{if(Kb(null),np&&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=sp&&t&&!c&&l;if(u&&o.isCollapsed()&&(u=!Z_(function(e,t){const n=e.offset;if("element"===e.type)return _x(e.getNode(),t,n);{const r=e.getNode();if(0===n||!t){const e=r.getPreviousSibling();return null===e?_x(r.getParentOrThrow(),t,r.getIndexWithinParent()+0):e}}return null}(o.anchor,!0))),!u){xx(r,bm,!0);const e=r_();sp&&Dy(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Dy(o))return!0;const s=e.data;null!==i.unprocessedBeforeInputData&&cx(!1,r,i.unprocessedBeforeInputData),o.dirty&&null===i.unprocessedBeforeInputData||!o.isCollapsed()||tb(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(),xx(r,xm,!1);else if(s===yp)e.preventDefault(),xx(r,Sm,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&gv(o,n,s,e.timeStamp,!0)?(e.preventDefault(),xx(r,wm,s),xv(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":xx(r,wm,e),xv((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const n=r._compositionKey;Kb(null),t||xx(r,wm,e),Tv(n);break}case"insertLineBreak":Kb(null),xx(r,xm,!1);break;case"insertParagraph":Kb(null),i.isInsertLineBreak&&!np?(i.isInsertLineBreak=!1,xx(r,xm,!1)):xx(r,Sm,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":xx(r,Em,e);break;case"deleteByComposition":(function(e,t){return e!==t||X_(e)||X_(t)||!Lb(e)||!Lb(t)})(c,u)&&xx(r,km,e);break;case"deleteByDrag":kx(Qv),xx(r,km,e);break;case"deleteByCut":xx(r,km,e);break;case"deleteContent":xx(r,bm,!1);break;case"deleteWordBackward":xx(r,Cm,!0);break;case"deleteWordForward":xx(r,Cm,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":xx(r,Am,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":xx(r,Am,!1);break;case"formatStrikeThrough":xx(r,Nm,"strikethrough");break;case"formatBold":xx(r,Nm,"bold");break;case"formatItalic":xx(r,Nm,"italic");break;case"formatUnderline":xx(r,Nm,"underline");break;case"historyUndo":xx(r,Rm,void 0);break;case"historyRedo":xx(r,Dm,void 0)}return!0}function Cv(e){const t=I_(),n=t._inputState,r=r_(),i=e.data,o=bv(e);let s=!1;if(null!=i&&Dy(r)){const a=Lx(Nx(t)),l=null!==a?Vx(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()&&by(u)&&zb(u);if(!c&&!d&&gv(r,o,i,e.timeStamp,!1,l)){if(s=!0,"ending-firefox"===n.compositionPhase){const e=Rv(t,i);if(n.compositionPhase="idle",e)return kx(Zv),rx(),!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;tp&&!r.isCollapsed()&&by(o)&&null!==l.anchorNode&&o.getTextContent().slice(0,u)+i+o.getTextContent().slice(u+d)===lx(l.anchorNode)||xx(t,wm,i);const f=i.length;ep&&f>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),sp&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Kb(null))}}return s||(cx(!1,t,null!==i?i:void 0),"ending-firefox"===n.compositionPhase&&(Rv(t,i||void 0),kx(Zv),n.compositionPhase="idle")),rx(),!0}function Av(e){const t=I_(),n=t._inputState,r=r_();if(Dy(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(Kb(i.key),kx(Yv),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===i.type||!r.isCollapsed()||!sp&&(o.getFormat()!==r.format||by(o)&&o.getStyle()!==r.style)||by(o)&&(zb(o)||0===i.offset&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){xx(t,wm,_p);const e=r_();Dy(e)&&Kb(e.anchor.key)}}return!0}function Nv(e){const t=I_();return t._inputState.compositionPhase="idle",Rv(t,e.data),kx(Zv),!0}function Tv(e){if(null===e)return;const t=Hb(e);if(!by(t)||"text"===t.getType()||zb(t)||!t.isAttached())return;const n=r_(),r=Dy(n)&&n.anchor.key===e?n.anchor.offset:null,i=_y(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 Rv(e,t){const n=e._compositionKey;if(Kb(null),null!==n&&null!=t){if(""===t){const t=Hb(n),r=e.getElementByKey(n),i=null!==r&&by(t)?aS(t,r,e):null;if(null!==i&&null!==i.nodeValue&&by(t)){const n=Lx(Nx(e)),r=n&&Vx(n,e._rootElement);let o=null,s=null;null!==r&&r.anchorNode===i&&(o=r.anchorOffset,s=r.focusOffset),ux(t,i.nodeValue,o,s,!0)}return Tv(n),!1}if("\n"===t[t.length-1]){const t=r_();if(Dy(t)||Fy(t)){if(Dy(t)){const e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return xx(e,jm,null),Tv(n),!1}}const r=Hb(n);if(null!==r&&by(r)&&zb(r)){r.markDirty();const e=r_(),i=r.getTextContentSize(),o=Dy(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(o,o).insertText(t),!0}}return cx(!0,e,t),Tv(n),!1}function Dv(e){const t=I_(),n=t._inputState;if(null==e.key)return!0;if("ending-safari"===n.compositionPhase){const r=mx(e);if(r&&W_(t,()=>{Rv(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if(function(e){return hx(e,"ArrowRight",{shiftKey:"any"})}(e))xx(t,Fm,e);else if(function(e){return hx(e,"ArrowRight",{...px,shiftKey:"any"})}(e))xx(t,Om,e);else if(function(e){return hx(e,"ArrowLeft",{shiftKey:"any"})}(e))xx(t,Pm,e);else if(function(e){return hx(e,"ArrowLeft",{...px,shiftKey:"any"})}(e))xx(t,Mm,e);else if(function(e){return hx(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))xx(t,Lm,e);else if(function(e){return hx(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))xx(t,zm,e);else if(function(e){return hx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,xx(t,jm,e);else if(function(e){return" "===e.key}(e))xx(t,Um,e);else if(function(e){return Zh&&hx(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,xx(t,xm,!0);else if(function(e){return hx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,xx(t,jm,e);else if(function(e){return hx(e,"Backspace",{shiftKey:"any"})||Zh&&hx(e,"h",{ctrlKey:!0})}(e))mx(e)?xx(t,Bm,e)&&wv(n):(e.preventDefault(),xx(t,bm,!0));else if(function(e){return"Escape"===e.key}(e))xx(t,$m,e);else if(function(e){return hx(e,"Delete",{})||Zh&&hx(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),xx(t,bm,!1)):xx(t,qm,e);else if(function(e){return hx(e,"Backspace",gx)}(e))e.preventDefault(),xx(t,Cm,!0);else if(function(e){return hx(e,"Delete",gx)}(e))e.preventDefault(),xx(t,Cm,!1);else if(function(e){return Zh&&hx(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),xx(t,Am,!0);else if(function(e){return Zh&&(hx(e,"Delete",{metaKey:!0})||hx(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),xx(t,Am,!1);else if(function(e){return hx(e,"b",px)}(e))e.preventDefault(),xx(t,Nm,"bold");else if(function(e){return hx(e,"u",px)}(e))e.preventDefault(),xx(t,Nm,"underline");else if(function(e){return hx(e,"i",px)}(e))e.preventDefault(),xx(t,Nm,"italic");else if(function(e){return hx(e,"Tab",{shiftKey:"any"})}(e))xx(t,Gm,e);else if(function(e){return hx(e,"z",px)}(e))e.preventDefault(),xx(t,Rm,void 0);else if(function(e){return Zh?hx(e,"z",{metaKey:!0,shiftKey:!0}):hx(e,"y",{ctrlKey:!0})||hx(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),xx(t,Dm,void 0);else{const r=t._editorState._selection;!function(e){return hx(e,"a",px)}(e)?null===r||Dy(r)||(function(e){return hx(e,"c",px)}(e)?(e.preventDefault(),xx(t,Zm,e)):function(e){return hx(e,"x",px)}(e)&&(e.preventDefault(),xx(t,ev,e))):(e.preventDefault(),xx(t,tv,e)&&wv(n))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(lv,e),!0}function Iv(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const Fv=new Map;function Ov(e){const t=function(e){const t=Ax(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=Ex(e.target);let r=null,i=null;const o=null!==n?hv.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&&zx(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=Vx(t,e).anchorNode;if(null!==a&&Pb(a)===s){if(zx(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||Xx(e)&&null!==e.shadowRoot||(r=Pb(e),null!==r&&(i=e))}}if(null===r){const e=Wx(n);r=null!==e?Pb(e):null}}if(null===r)return;if(r._inputState.isSelectionChangeFromMouseDown){if(void 0!==o)for(const e of o.editors)e._inputState.isSelectionChangeFromMouseDown=!1;W_(r,()=>{const n=i_(),o=i??Vx(t,r._rootElement).anchorNode;(Xx(o)||jb(o))&&nx(n_(n,t,r,e))})}const s=sx(r),a=s[s.length-1],l=a._key,c=Fv.get(l),u=c||a;u!==r&&vv(t,u,!1),vv(t,r,!0),r!==a?Fv.set(l,r):c&&Fv.delete(l)}function Pv(e){e._lexicalHandled=!0}function Mv(e){return!0===e._lexicalHandled}function Lv(e){const t=fv.get(e);if(void 0===t)return;const n=hv.get(t);if(void 0===n)return;fv.delete(e);const r=Mb(e);Ob(r)?(function(e){if(null!==e._parentEditor){const t=sx(e),n=t[t.length-1]._key;Fv.get(n)===e&&Fv.delete(n)}else Fv.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Jh(198);const i=Iv(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function zv(e,t,n){T_();const r=e.__key,i=e.getParent();if(null===i)return void(null!==NS(e)&&Jh(367,r,String(NS(e))));const o=function(e){const t=r_();if(!Dy(t)||!X_(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Cx(i,e)&&n.set(e.__key,0,"element"),Cx(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Dy(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(a_(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(a_(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Fy(o)&&t&&e.isSelected()&&e.selectPrevious();if(Dy(o)&&t&&!s){const t=e.getIndexWithinParent();Gb(e),o_(o,i,t,-1)}else Gb(e);n||Dx(i)||i.canBeEmpty()||!i.isEmpty()||zv(i,t),t&&o&&tb(i)&&i.isEmpty()&&i.selectEnd()}const jv=Symbol.for("ephemeral");function Uv(e){return e[jv]||!1}const Bv={configurable:!0,enumerable:!1,value:void 0,writable:!0};class $v{__type;__key;__parent;__prev;__next;__state;[mg];static getType(){const{ownNodeType:e}=_S(this);return void 0===e&&Jh(64,this.name),e}static clone(e){Jh(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||ES(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",Bv),Object.defineProperty(this,mg,Bv),qb(this,e)}getType(){return this.__type}isInline(){Jh(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Hb(e);if(null===t)break;e=null!==t.__parent?t.__parent:NS(t)}return!1}isSelected(e){const t=e||r_();if(null==t)return!1;const n=t.getNodes().some(e=>e.__key===this.__key);if(by(this))return n;if(Dy(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Z_(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:Hb(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Jh(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Dx(t)||null!==NS(e))return X_(e)||e===this&&Z_(e)||Jh(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Jh(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:Hb(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:Hb(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=X_(this)?this:this.getParent(),n=X_(e)?e:e.getParent(),r=t&&n?xw(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=xw(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===yw(t):("same"!==t.type&&"ancestor"!==t.type&&Jh(279),!1)))}isParentOf(e){return Cx(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=X_(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&&Jh(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=I_()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(Uv(this))return this;const e=Hb(this.__key);return null===e&&Jh(113),e}getWritable(){if(Uv(this))return this;T_();const e=D_(),t=I_(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,s=r_();if(null!==s&&s.setCachedNodes(null),o.has(r))return Vb(i),i;const a=dS(i);return o.add(r),Vb(a),n.set(r,a),a}getTextContent(){return jS(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Jh(70)}updateDOM(e,t,n){Jh(71)}getDOMSlot(e){return new Rp(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){Jh(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const o of og(n).flatKeys)o in t&&(void 0!==i&&i!==r||(i={...r}),i[o]=t[o]);return(n.__state||i)&&ig(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){zv(this,!0,e)}replace(e,t){T_();let n=r_();null!==n&&(n=n.clone()),Ox(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;Gb(s),null!==c&&Dy(n)&&o_(n,c,u,-1);const d=r.getPreviousSibling(),f=r.getNextSibling(),h=r.__prev,p=r.__next,g=r.__parent;zv(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&&(X_(this)&&X_(s)||Jh(139),m=s.getChildrenSize(),s.splice(m,0,this.getChildren()));const v=IS(this);if(v.length>0){CS(this)&&CS(s)||Jh(368,this.__key,s.__key);for(const e of v){const t=FS(this,e);null!==t&&(qS(this,e),$S(s,e,t))}}if(Dy(n)){nx(n);const e=n.anchor,r=n.focus;e.key===i&&(t&&"element"===e.type?e.set(s.__key,m+e.offset,"element"):Ny(e,s)),r.key===i&&(t&&"element"===r.type?r.set(s.__key,m+r.offset,"element"):Ny(r,s))}return Wb()===i&&Kb(o),s}insertAfter(e,t=!0){T_(),Ox(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.getParent(),o=r_();let s=!1,a=!1;if(null!==i){const n=e.getIndexWithinParent();if(Dy(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}Gb(r),t&&Dy(o)&&o_(o,i,n,-1)}else Gb(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&&Dy(o)){const e=this.getIndexWithinParent();o_(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){T_(),Ox(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.__key,o=r_(),s=r.getParent(),a=null!==s?r.getIndexWithinParent():-1;Gb(r),null!==s&&t&&Dy(o)&&o_(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&&Dy(o)&&o_(o,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return mb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){T_();const n=TS(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(X_(r))return r.select();if(!by(r)){const e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){T_();const n=TS(this);if(null!==n)return n.selectNext(e,t);const r=this.getNextSibling(),i=this.getParentOrThrow();if(null===r)return i.select();if(X_(r))return r.select(0,0);if(!by(r)){const e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function qv(e){return e instanceof $v}const Gv="historic",Vv="history-push",Kv="history-merge",Wv="paste",Hv="collaboration",Jv="skip-scroll-into-view",Xv="skip-dom-selection",Qv="skip-selection-focus",Yv="composition-start",Zv="composition-end";function ey(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 ty(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 ny(e,t,n=""){if(t===n)return;const r=ey(n),i=ey(t);for(const o in i)delete r[o],ty(e,o,i[o]);for(const o in r)e.removeProperty(o)}function ry(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function iy(e,t){return 1&t?"strong":2&t?"em":"span"}function oy(e,t,n,r,i){const o=r.classList;let s=vx(i,"base");void 0!==s&&o.add(...s),s=vx(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 bp){const e=bp[c];if(s=vx(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 sy(e,t,n){const r=n.isComposing(),i=e+(r?vp:""),o=iS(),s=oS(o).$getDOMSlot(n,t,o),a=s.getFirstChild();if(null===a||a.nodeType!==Node.TEXT_NODE)return void s.insertChild(qx().createTextNode(i));const l=a,c=l.nodeValue;if(c!==i)if(r||ep){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 ay(e,t,n,r,i,o){sy(i,e,t);const s=o.theme.text;void 0!==s&&oy(0,0,r,e,s)}function ly(e,t){const n=qx().createElement(t);return n.appendChild(e),n}function cy(e){return null!=e&&!0===e.__isInlineFormattable}class uy extends $v{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(e){return new uy(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 kp[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Wb()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=bp[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Bb(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=ry(0,n),i=iy(0,n),o=null===r?i:r,s=qx().createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=qx().createElement(i),s.appendChild(a)),ay(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&ny(s.style,l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=ry(0,i),a=ry(0,o),l=iy(0,i),c=iy(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&Jh(48);const i=qx().createElement(c);return ay(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&Jh(49)),sy(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&oy(0,i,o,u,d);const f=e.__style,h=this.__style;return f!==h&&ny(t.style,h,f),!1}static importDOM(){return{"#text":()=>({conversion:gy,priority:0}),b:()=>({conversion:fy,priority:0}),code:()=>({conversion:yy,priority:0}),em:()=>({conversion:yy,priority:0}),i:()=>({conversion:yy,priority:0}),mark:()=>({conversion:yy,priority:0}),s:()=>({conversion:yy,priority:0}),span:()=>({conversion:dy,priority:0}),strong:()=>({conversion:yy,priority:0}),sub:()=>({conversion:yy,priority:0}),sup:()=>({conversion:yy,priority:0}),u:()=>({conversion:yy,priority:0})}}static importJSON(e){return _y().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 Xx(t)||Jh(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=ly(t,"b")),this.hasFormat("italic")&&(t=ly(t,"i")),this.hasFormat("strikethrough")&&(t=ly(t,"s")),this.hasFormat("underline")&&(t=ly(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?bp[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?xp[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Bb(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=Ep[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){T_();let n=e,r=t;const i=r_(),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(!Dy(i))return Zy(s,n,s,r,"text","text");{const e=Wb();e!==i.anchor.key&&e!==i.focus.key||Kb(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=r_();if(r&&Dy(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){T_();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Wb(),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=r_();if(Dy(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=_y(c),d.__format=f,d.__style=h,d.__detail=p,d.__state=ug(t,d),g=!0):d=t.setTextContent(c);const _=[d];for(let w=1;w<l;w++){const e=_y(s[w]);e.__format=f,e.__style=h,e.__detail=p,e.__state=ug(t,e);const n=e.__key;i===r&&Kb(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&&Vb(t),null!==n&&Vb(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,_),this.remove()):e.splice(t,1,_),Dy(y)&&o_(y,u,t,l-1)}return _}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Jh(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;Wb()===r&&Kb(n);const s=r_();if(Dy(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&l_(i,t,n,e,o),null!==a&&a.key===r&&l_(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 dy(e){return{forChild:xy(e.style),node:null}}function fy(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:xy(t.style,n?void 0:"bold"),node:null}}const hy=new WeakMap;function py(e){if(!Xx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function gy(e){const t=e;null===e.parentElement&&Jh(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=hy.get(n))&&!py(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let o=0;o<r.length;o++)hy.set(r[o],i);return i}(t))return{node:h_(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=my(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=my(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:_y(n)}}function my(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,Xx(n)){const e=n.style.display;if(""===e&&!eS(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(jb(n))return n;if("BR"===n.nodeName)return null}}const vy={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yy(e){const t=vy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:xy(e.style,t),node:null}}function _y(e=""){return Fx(new uy(e))}function by(e){return e instanceof uy}function xy(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=>by(e)||cy(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 Sy extends uy{static getType(){return"tab"}static clone(e){return new Sy(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=vx(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return wy().updateFromJSON(e)}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||Jh(286),this}setDetail(e){return 2!==e&&Jh(127),this}setMode(e){return"normal"!==e&&Jh(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function wy(){return Fx(new Sy)}function Ey(e){return e instanceof Sy}class ky{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:vw(Dw(Sw(this,"next")),Dw(Sw(e,"next")))<0}getNode(){const e=Hb(this.key);return null===e&&Jh(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,N_()||(Wb()===o&&Kb(e),null!==i&&(i.setCachedNodes(null),Dy(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function Cy(e,t,n){return new ky(e,t,n)}function Ay(e,t){let n=t.__key,r=e.offset,i="element";if(by(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!X_(t)){const e=t.getNextSibling();if(by(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 Ny(e,t){if(X_(t)){const n=t.getLastDescendant();X_(n)||by(n)?Ay(e,n):Ay(e,t)}else Ay(e,t)}class Ty{_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(!Fy(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 Ty(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes().filter(e=>null===NS(e)),n=t.length;if(0===n)return;const r=t[n-1];let i;if(by(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=Hb(r);null!==e&&n.push(e)}return N_()||(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===NS(e));if((r_()||i_())===this&&e[0]){const t=ow(e[0],"next");Ew(gw(t,t))}for(const t of e)t.remove();Ry()}}function Ry(){const e=tx();if(e.isEmpty()){const t=mb();e.append(t),t.select()}}function Dy(e){return e instanceof Iy}class Iy{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!!Dy(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(tw(s)){const{origin:e}=s;0===t.length?i.add(e):(o.add(e),t.push(e))}else{const{origin:e}=s;X_(e)&&o.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),ew(e.focus)&&X_(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let s=cw(e.focus.origin,"previous");tw(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(t[t.length-1]);s=uw(s))i.delete(s.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!X_(e)||o.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=Dw(e.anchor),r=Dw(e.anchor.getFlipped()),i=e=>ZS(e)?e.origin:e.getNodeAtCaret(),o=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(o)}return t}(Ow(Cw(this),"next"));return N_()||(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]=Ly(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(X_(d)&&!d.isInline()){c||(l+="\n");let e="";for(const t of IS(d)){const n=FS(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(l+=e,c=!1):c=!d.isEmpty()}else if(c=!1,by(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!Z_(d)&&!ub(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=I_(),n=t.getEditorState()._selection,r=Qy(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),pg(this)}clone(){const e=this.anchor,t=this.focus;return new Iy(Cy(e.key,e.offset,e.type),Cy(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Bb(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=bp[e];return 0!==(this.format&t)}insertRawText(e){this.insertNodes(h_(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=_y();if(s.setFormat(n),s.setStyle(r),vb(o))o.splice(0,0,[s]);else if(null!==o){const e=Dx(i)?mb().append(s):s;o.insertBefore(e)}else if(Dx(i)){const e=i.getLastChild();X_(e)&&!e.isInline()&&e.isEmpty()?e.append(s):i.append(mb().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&&ww(s,Dw(Sw(s,"next")));const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];by(d)||Jh(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&&(zb(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&null===d.getNextSibling())){const t=d.getNextSibling();let n;if(by(t)&&t.canInsertTextBefore()&&!zb(t)?n=t:(n=_y(),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&&(zb(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&null===d.getPreviousSibling())){const t=d.getPreviousSibling();let n;if(!by(t)||zb(t)?(n=_y(),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!==Wb())d=d.setMode("normal").setFormat(r).setStyle(i);else{const e=_y(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||X_(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Wy(this.anchor,this.focus),void this.insertText(e)}if(1===u){if(Lb(d)){const t=_y(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Ey(d)){const t=_y(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=_y(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=X_(d)?d:d.getParentOrThrow();let r=X_(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(by(p)&&!Lb(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=_y(p.getTextContent());p.replace(e),p=e}tb(s.getNode())||"text"!==s.type||(by(p)||Jh(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)||X_(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(Lb(d))if(a===f)d.select();else{const t=_y(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=r_()===this;kw(this,Rw(Cw(this))),e&&r_()!==this&&nx(this)}formatText(e,t=null){Py(this,e,t)}insertNodes(e){if(0===e.length)return;this.isCollapsed()||this.removeText();const t=this.anchor.getNode();if("element"===this.anchor.type&&X_(t)&&null!==NS(t)){let n=t.isShadowRoot()?t.getFirstChild()??t.append(mb()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&null!==n&&!X_(n)){const e=mb();n.insertBefore(e),n=e}if(null!==n){n.selectStart();const t=r_();return Dy(t)||Jh(369),t.insertNodes(e)}}if("element"===this.anchor.type&&Dx(t)){const n=y_(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=SS(n,rS);const i=e[e.length-1];if(X_(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=g_(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(X_(e)||Z_(e))&&!e.isInline())){X_(r)||Jh(211,n.constructor.name,n.getType());const t=g_(this);return r.splice(t,0,e),void i.selectEnd()}if(X_(r)&&null!==NS(r)){const t=g_(this),n=p_(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=y_(e),n=t.getLastDescendant();let r=Sw(this.anchor,"next");for(const e of t.getChildren())r=jw(e,r);return void(null!==n&&n.selectEnd())}if(X_(r)&&!r.isParentRequired()&&!Dx(r.getParentOrThrow())){const t=g_(this),n=p_(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=y_(e),s=o.getLastDescendant(),a=o.getChildren(),l=X_(r)&&r.isEmpty()?null:this.insertParagraph();l&&!r.isAttached()&&(n=this.anchor.getNode(),r=SS(n,rS));const c=a[a.length-1];let u=a[0];var d;X_(d=u)&&rS(d)&&!d.isEmpty()&&X_(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(X_(r)||Jh(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(null===r&&Jh(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()||Jh(140),r=r.getNextSibling(),i.push(r);let o=e;for(const s of i)o=o.insertAfter(s)}(r,u));const f=SS(s,rS);l&&X_(f)&&(l.canMergeWhenEmpty()||rS(c))&&(f.append(...l.getChildren()),l.remove()),X_(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=X_(r)?r.getLastChild():null;ub(h)&&f!==r&&h.remove()}insertParagraph(){const e=this.anchor.getNode();if("element"===this.anchor.type&&Dx(e)){const t=mb();return e.splice(this.anchor.offset,0,[t]),t.select(),t}const t=g_(this),n=SS(this.anchor.getNode(),rS);if(null!==n&&null!==NS(n))return null;X_(n)||Jh(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=cb();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]=Ly(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(by(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(by(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),by(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(__(this,e,t,n))return;const r="move"===e,i=I_(),o=Lx(Nx(i));if(!o)return;const s=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();null===a||null===s||!X_(l)||l.isInline()||l.canBeEmpty()||Mx(s,i,a);const c=Sx(i,this.focus.key);let u=c;if("text"===this.focus.type&&(u=by(l)?aS(l,c,i):null),this.dirty){const e=Sx(i,this.anchor.key);let t=e;if("text"===this.anchor.type){const n=this.anchor.getNode();t=by(n)?aS(n,e,i):null}t&&u&&c_(o,t,this.anchor.offset,u,this.focus.offset)}if("character"===n&&by(l)&&l.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===l.getTextContentSize())){const e=ow(l,t?"previous":"next").getNodeAtCaret();if(by(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?aS(e,n,i):null;if(r){const e=t?r.length:0;c_(o,r,e,r,e)}}}}if(Uy(o,e,t?"backward":"forward",n),o.rangeCount>0){const e=Gx(o,i._rootElement),n=e||o.getRangeAt(0),s=this.anchor.getNode(),a=tb(s)?s:Tx(s);this.applyDOMRange(n),this.dirty=!0,r||(By(this,t,a),(e?"backward"!==o.direction:o.anchorNode===n.startContainer&&o.anchorOffset===n.startOffset)||jy(this))}"lineboundary"===n&&__(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&X_(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(X_(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=hw(Sw(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(tw(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(X_(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=Dw(t);kw(this,gw(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(ew(t)){if(X_(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(Z_(t.origin)){if(t.origin.isIsolated());else if(IS(t.origin).length>0){if(X_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=t_();e.add(t.origin.getKey()),nx(e)}}else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&X_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=t_();e.add(t.origin.getKey()),nx(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;if(IS(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(kw(this,gw(!t.origin.isEmpty()&&n.isEmpty()?Aw(ow(n,t.direction)):r.anchor,t)),this.removeText())}for(let n=t.getNode();null!==n;){if(null!==NS(n))return;if(X_(n)&&n.isShadowRoot())break;n=n.getParent()}}const i=this.focus;if($y(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&zy(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 Gy(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 Gy(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!(ox(e)||qy(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()&&tb(e.getParent())&&null===e.getPreviousSibling()&&zy(this,e),Ry()}}deleteLine(e){const t=Hy(this.anchor);if(null!==t&&Z_(TS(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&$y(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):SS(this.anchor.getNode(),rS)!==SS(this.focus.getNode(),rS)?(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;$y(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 N_()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function Fy(e){return e instanceof Ty}function Oy(e,t){if(Fy(e)){for(const n of e.getNodes())cy(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Kb(null);const n=[];for(const v of e.getNodes())by(v)?n.push(v):X_(v)?v.setTextFormat(t(v.getTextFormat())):cy(v)&&v.setFormat(t(v.getFormat()));const r=n.length;if(0===r)return e.setFormat(t(e.format)),void Kb(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(zb(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||zb(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()||zb(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 Py(e,t,n=null){const r=null===n&&Dy(e)?Bb(e.format,t,null):n;Oy(e,e=>Bb(e,t,r))}function My(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Ly(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]:[My(n),My(r)]}function zy(e,t){for(let n=t;n;n=n.getParent()){if(X_(n)){if(n.collapseAtStart(e))return!0;if(Dx(n))break}if(n.getPreviousSibling())break}return!1}function jy(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 Uy(e,t,n,r){e.modify(t,n,r)}function By(e,t,n){const r=e.getNodes(),i=r.filter(e=>Cx(e,n));if(0===i.length||i.length===r.length)return!1;const o=t?i[0]:i[i.length-1],s=X_(o)?o:o.getParentOrThrow();return t?s.selectStart():s.selectEnd(),!0}function $y(e,t,n){if(__(e,"extend",t,n))return;const r=I_(),i=Lx(Nx(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||!X_(l)||l.isInline()||l.canBeEmpty()||Mx(o,r,s);const c=e=>{const t=e.getNode(),n=r.getElementByKey(e.key);return null!==n&&"text"===e.type&&by(t)?aS(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(c_(i,g,m,g,m),Uy(i,"move",t?"backward":"forward",n),0===i.rangeCount)return;const v=Gx(i,s)||i.getRangeAt(0),y=v.startContainer,_=v.startOffset;if(h&&"character"===n&&"text"===a.type&&by(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){const n=ow(u,t?"previous":"next").getNodeAtCaret();if(by(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=tb(u)?u:Tx(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:w,startContainer:b,startOffset:x}),e.dirty=!0,!By(e,t,E)&&t&&jy(e),"lineboundary"===n&&__(e,"extend",t,n,"decorators")}const qy=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(Jh){}return()=>!1})();function Gy(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 Vy(e,t,n,r){let i,o=t,s=!1;if(Xx(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!==Qb(e,r)||mS(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=ix(d),by(i))o=aw(i,a?"next":"previous");else{let l=ix(e);if(null===l)return null;if(X_(l)){const s=r.getElementByKey(l.getKey());null===s&&Jh(214);const c=sS(l,s,r);[l,o]=c.resolveChildIndex(l,s,e,t),X_(l)||Jh(215),a&&o>=l.getChildrenSize()&&(o=Math.max(0,l.getChildrenSize()-1));let u=l.getChildAtIndex(o);if(X_(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=X_(u)?u:u.getParentOrThrow()),o=0}by(u)?(i=u,l=null,o=aw(u,a?"next":"previous")):u!==l&&a&&!f&&(X_(l)||Jh(216),o=Math.min(l.getChildrenSize(),o+1))}else{const n=TS(l),i=null!==n?n:l,s=i.getIndexWithinParent(),a=r.getElementByKey(l.getKey());let c="after";if(null!==a&&ix(e)===l){const n=sS(l,a,r);n.element!==a?c=n.resolveLeafPosition(a,e,t):0===t&&Z_(l)&&(c="before")}o="before"===c?s:s+1,l=i.getParentOrThrow()}if(X_(l))return[Cy(l.__key,o,"element"),s]}}else i=ix(e);return by(i)?[Cy(i.__key,aw(i,o,"clamp"),"text"),s]:null}function Ky(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&&X_(o)&&o.isInline()){const t=o.getPreviousSibling();by(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else X_(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):by(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&&X_(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&X_(o)&&o.isInline()&&!o.canInsertTextAfter()&&o.getTextContentSize()>1){const t=o.getNextSibling();by(t)&&e.set(t.__key,0,"text")}}}function Wy(e,t,n){if("text"===e.type&&"text"===t.type){const n=e.isBefore(t),r=e.is(t);Ky(e,n,r),Ky(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Hy(e){const t=Hb(e.key);return null===t?null:RS(t)}function Jy(e,t,n){const r=Hy(e),i=Hy(t);if(r===i||null!==r&&null!==i&&r.is(i))return!1;const o=n(r,i);if(null!==r)return X_(r)?t.set(r.getKey(),o?r.getChildrenSize():0,"element"):t.set(r.getKey(),o?r.getTextContentSize():0,"text"),!0;const s=TS(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 Xy(e){const t=Jy(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(null!==n&&null!==r){const e=TS(n),t=TS(r);if(null!==e&&e.is(t)){for(const t of DS(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=TS(n),r=Hb(t.key);return null===e||null===r||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}const i=TS(r),o=Hb(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 Qy(e,t,n,r,i,o){if(null===e||null===n||!Fb(i,e,n))return null;const s=Vy(e,t,Dy(o)?o.anchor:null,i);if(null===s)return null;const a=Vy(n,r,Dy(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=ix(e),r=ix(n);if(Z_(t)&&Z_(r))return null}const f=i._slotsUsed&&Jy(l,u,()=>0!==(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return Wy(l,u),[l,u,c||d||f]}function Yy(e){return X_(e)&&!e.isInline()}function Zy(e,t,n,r,i,o){const s=D_(),a=new Iy(Cy(e,t,i),Cy(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function e_(){const e=Cy("root",0,"element"),t=Cy("root",0,"element");return new Iy(e,t,0,"")}function t_(){return new Ty(new Set)}function n_(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=!Up&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,f;if(Dy(e)&&!l)return e.clone();{if(null===t)return null;const r=Vx(t,n._rootElement);if(c=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(a||void 0===s)&&Dy(e)&&!Fb(n,c,u))return e.clone()}const h=Qy(c,d,u,f,n,e);if(null===h)return null;const[p,g,m]=h;let v=0,y="";if(Dy(e)){const t=e.anchor;if(p.key===t.key)v=e.format,y=e.style;else{const e=p.getNode();by(e)?(v=e.getFormat(),y=e.getStyle()):X_(e)&&(v=e.getTextFormat(),y=e.getTextStyle())}}const _=new Iy(p,g,v,y);return m&&(_.dirty=!0),_}function r_(){return D_()._selection}function i_(){return I_()._editorState._selection}function o_(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"),s_(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")}}s_(e)}function s_(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!X_(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(by(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}return}if(X_(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(by(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(X_(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(by(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function a_(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,by(r)?(s=r.getTextContentSize(),a="text"):X_(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,by(i)?a="text":X_(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 l_(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 c_(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function u_(e,t,n){const r=Sx(e,t.getKey());if(X_(t)){const i=sS(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function d_(e,t,n,r,i,o){const s=o.getRootNode(),a=Ub(s)||zx(s)?Wx(s):null;if(i.has(Hv)&&a!==o||null!==a&&Ib(a,a))return;const l=Vx(r,o);let c;if(!Dy(t))return void(null!==e&&Fb(n,l.anchorNode,l.focusNode)&&r.removeAllRanges());const u=t.anchor,d=t.focus,f=u.getNode(),h=d.getNode(),[p,g]=u_(n,f,u.offset),[m,v]=u_(n,h,d.offset),y=t.format,_=t.style,b=t.isCollapsed();let x=p,S=m,w=!1;if("text"===u.type?(x=by(f)?aS(f,p,n):null,w=f.getFormat()!==y||f.getStyle()!==_):Dy(e)&&"text"===e.anchor.type&&(w=!0),"text"===d.type&&(S=by(h)?aS(h,m,n):null),null!==x&&null!==S){if(b&&(null===e||w||Dy(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?Pb(a):null;null!==e&&e!==n||i.has(Qv)||o.focus({preventScroll:!0})}if("element"!==u.type)return}if(c_(r,x,g,S,v),ep&&t.isCollapsed()&&null!==o&&!i.has(Qv)){const e=Kx(o);if(null===e||!o.contains(e)){const e=Wx(o.ownerDocument),t=null!==e?Pb(e):null;null!==t&&t!==n||o.focus({preventScroll:!0})}}if(!i.has(Jv)&&t.isCollapsed()&&null!==o&&o===Kx(o)){const e=Dy(t)&&"element"===t.anchor.type?x.childNodes[g]||null:(void 0===c&&(c=function(e,t){const n=Gx(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(jb(e)){const n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=Ex(n),i=Ax(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=Nx(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=wx(u)}}(n,t,o)}}!function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0}(n)}}function f_(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 h_(e){const t=[];return f_(e,{linebreak:()=>t.push(cb()),tab:()=>t.push(wy()),text:e=>t.push(_y(e))}),t}function p_(e){const t=[];for(const n of e)ub(n)||(!X_(n)&&!Z_(n)||n.isInline()?t.push(n):X_(n)&&t.push(...p_(n.getChildren())));return t}function g_(e){let t=e;e.isCollapsed()||t.removeText();const n=r_();Dy(n)&&(t=n),Dy(t)||Jh(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!rS(i)&&null===NS(i);){const e=i;if([i,o]=m_(i,o),e.is(i))break}return o}function m_(e,t){const n=e.getParent();if(!n){const e=mb();return tx().append(e),e.select(),[tx(),0]}if(by(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(!X_(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Iy(Cy(e.__key,t,"element"),Cy(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function v_(e){return ub(e)||function(e){return X_(e)&&e.isInline()||Z_(e)&&e.isInline()}(e)||by(e)||e.isParentRequired()}function y_(e){const t=mb();let n=null;for(let r=0;r<e.length;r++){const i=e[r];if(v_(i)){if(null===n){n=i.createParentElementNode(),t.append(n);const o=e[r+1];if(ub(i)&&(void 0===o||!v_(o)))continue}n.append(i)}else t.append(i),n=null}return t}function __(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=Sw(e.focus,n?"previous":"next"),s="lineboundary"===r,a="move"===t;let l=o,c="decorators-and-blocks"===i;if(!Iw(l)){for(const e of l){c=!1;const{origin:t}=e;if(!Z_(t)||t.isIsolated()||(l=e,!s||!t.isInline()))break}if(c)for(const e of hw(o).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(tw(e))e.origin.isInline()||(l=e);else{if(X_(e.origin))continue;Z_(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===o)return!1;if(a&&!s&&Z_(l.origin)&&l.origin.isKeyboardSelectable()){const e=t_();return e.add(l.origin.getKey()),nx(e),!0}return l=Dw(l),a&&ww(e.anchor,l),ww(e.focus,l),c||!s}let b_=null,x_=null,S_=!1,w_=!1,E_=!1;const k_=new Set;let C_=0;const A_={characterData:!0,childList:!0,subtree:!0};function N_(){return S_||null!==b_&&b_._readOnly}function T_(){S_&&Jh(13)}function R_(){C_>99&&Jh(14)}function D_(){return null===b_&&Jh(195,F_()),b_}function I_(){return null===x_&&Jh(337,F_()),x_}function F_(){let e=0;const t=new Set,n=kb.version;if("undefined"!=typeof window)for(const i of Bx(document)){const r=Mb(i);if(Ob(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 O_(){return x_}function P_(e,t,n){const r=t.__type,i=Tb(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 M_(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function L_(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 z_(e){return j_(e,I_()._nodes)}function j_(e,t){const n=e.type,r=t.get(n);void 0===r&&Jh(17,n);const i=r.klass;e.type!==i.getType()&&Jh(18,i.name);const o=i.importJSON(e),s=e.children;if(X_(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const e=j_(s[l],t);o.append(e)}const a=e.$slots;if(a){CS(o)||Jh(379,i.name);for(const e in a)$S(o,e,j_(a[e],t))}return o}function U_(e,t,n){const r=b_,i=S_,o=x_;b_=t,S_=!0,x_=e;try{return n()}finally{b_=r,S_=i,x_=o}}function B_(e,t){const n=E_;E_=!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&&G_(e,e._deferred));const o=e._editorState,s=o._selection,a=n._selection,l=0!==e._dirtyType,c=b_,u=S_,d=x_,f=e._updating,h=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==h){x_=e,b_=n,S_=!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){wg="",Eg=null,kg=null,Cg=null,Ug=2===r,xg=n,bg=n._config,jg=n._config.dom||xb,Sg=n._nodes,Rg=xg._listeners.mutation,Dg=i,Ig=o,Fg=e._nodeMap,Og=e,Pg=t._nodeMap,Bg=t._readOnly,Mg=Lp(n._keyToDOMMap),Lg=function(){const e=new Map,t=t=>{for(const n of t){const t=Pg.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(Dg.keys()),t(Ig),e}();const s=new Map;return zg=s,am("root",null),xg=void 0,Sg=void 0,Dg=void 0,Ig=void 0,Fg=void 0,Og=void 0,Pg=void 0,bg=void 0,Mg=void 0,Lg=void 0,zg=void 0,jg=xb,s}(o,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),w_)throw t;return _b(e,null,r,n),Jp(e),e._dirtyType=2,w_=!0,B_(e,o),void(w_=!1)}finally{h.observe(r,A_),e._updating=f,b_=c,S_=u,x_=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=Zb(e)),delete r[o])}(e,n);const _=i?null:Lx(Nx(e));if(e._editable&&null!==_&&(l||null===a||a.dirty||!a.is(s))&&null!==r&&!y.has(Xv)){x_=e,b_=n;try{if(null!==h&&h.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&Mx(t,e,r),d_(s,a,e,_,y,r)}!function(e,t,n){let r=e._blockCursorElement;if(Dy(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(Kx(t))){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())Px(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(null!==t&&Px(t)){const n=t.getPreviousSibling();(null===n||Px(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=sS(o,e.getElementByKey(o.__key),e).element;return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=qx().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=qw(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&&Mx(r,e,t)}(e,r,a)}finally{null!==h&&h.observe(r,A_),x_=d,b_=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),Dy(a)||null===a||null!==s&&s.is(a)||e.dispatchCommand(hm,void 0);const b=e._pendingDecorators;null!==b&&(e._decorators=b,e._pendingDecorators=null,$_("decorator",e,!0,b)),function(e,t,n){const r=ex(t),i=ex(n);r!==i&&$_("textcontent",e,!0,i)}(e,t||o,n),$_("update",e,!0,{dirtyElements:m,dirtyLeaves:g,editorState:n,mutatedNodes:p,normalizedNodes:v,prevEditorState:t||o,tags:y}),f||G_(e,e._deferred),function(e){const t=e._updates;if(0===t.length)return void(e._cascadeCount=0);if(function(e){k_.has(e)||(k_.add(e),setTimeout(()=>{k_.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;K_(e,t,r)}}(e)}(e,t)}finally{E_=n}}function $_(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 q_(e,t,n,r){const i=sx(e);let o;if(!E_)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(W_(a,()=>{for(const i of e)if(i(n,r))return void(t=!0)}),t)return t}}}return o&&o.update(()=>{q_(o,t,n,r)}),!1}function G_(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 V_(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&&Jh(191),o._flushSync=!0),s&&e._deferred.push(s),L_(e,i.tag)),null==o?K_(e,n,i):n()}}return r}function K_(e,t,n){const r=e._updateTags;let i,o=!1,s=!1;void 0!==n&&(i=n.onUpdate,L_(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=nb(l||a),c=!0),l._flushSync=s;const u=b_,d=S_,f=x_,h=e._updating;b_=l,S_=!1,e._updating=!0,x_=e;const p=e._headless||null===e.getRootElement();Ab(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=Lx(Nx(e));return Dy(n)||null==n?n_(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),o=V_(e,o),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Dy(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);by(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&hg(e)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=Wb(),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);by(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&hg(r),void 0!==r&&M_(r,o)&&P_(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){C_++;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&&M_(l,o)&&P_(t,l,s)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,C_++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),V_(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()||(X_(e)&&jp(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()||(CS(e)&&null!==e.__slots&&jp(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=I_(),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(Dy(i)){e._slotsUsed&&Xy(i);const t=l._nodeMap,n=i.anchor.key,r=i.focus.key;void 0!==t.get(n)&&void 0!==t.get(r)||Jh(19)}else Fy(i)&&0===i._nodes.size&&(l._selection=null)}catch(Jh){return Jh instanceof Error&&e._onError(Jh),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void B_(e)}finally{b_=u,S_=d,x_=f,e._updating=h,C_=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,B_(e)):c&&Db(()=>{B_(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function W_(e,t,n){x_===e&&void 0===n?t():K_(e,t,n)}function H_(e){if(Dx(e)){let t=null;for(const n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class J_ extends $v{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:H_,extends:$v})}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&&Jh(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 wp[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===IS(this).length}isDirty(){const e=I_()._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 IS(this)){const t=FS(this,n);X_(t)&&e.push(...t.getAllTextNodes())}let t=this.getFirstChild();for(;null!==t;){if(by(t)&&e.push(t),X_(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;X_(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;X_(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 X_(e)&&e.getLastDescendant()||e||null}const r=t[e];return X_(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Hb(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Jh(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Hb(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Jh(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=jS(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),X_(i)&&r!==n-1&&!i.isInline()&&(e+=yp)}return e}getTextContentSize(){let e=function(e){let t=0;for(const n of IS(e)){const r=FS(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(),X_(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=Sp[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=bp[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return Bb(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){T_();const n=r_();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(by(e)||X_(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(by(e)||X_(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Dy(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):Zy(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&&Sp[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){Uv(this)&&Jh(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Jh(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&&Jh(100);const t=e.getNextSibling(),n=e.__key;Gb(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--,Gb(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&&Jh(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=r_();if(Dy(e)){const t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;Q_(r,t,n)&&a_(r,r.getNode(),this,c,l),Q_(i,t,n)&&a_(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||Dx(this)||this.remove()}}return i}getDOMSlot(e){return new Ip(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Xx(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||Dx(this)||this.getChildren().some(by)||(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=sS(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 X_(e){return e instanceof J_}function Q_(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 Y_ extends $v{__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&&Jh(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 Z_(e){return e instanceof Y_}class eb extends J_{__cachedText;static getType(){return"root"}static clone(){return new eb}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Jh(51)}getTextContent(){const e=this.__cachedText;return null===e||!N_()&&0!==I_()._dirtyType?super.getTextContent():e}remove(){Jh(52)}replace(e){Jh(53)}insertBefore(e){Jh(54)}insertAfter(e){Jh(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const r of n)X_(r)||Z_(r)||Jh(282);return super.splice(e,t,n)}static importJSON(e){return tx().updateFromJSON(e)}collapseAtStart(){return!0}}function tb(e){return e instanceof eb}function nb(e){return new ob(Lp(e._nodeMap),null,e._slotsUsed)}function rb(){return new ob(new Map([["root",new eb]]),null,!1)}function ib(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Jh(130,n.name),X_(e)){const r=t.children;Array.isArray(r)||Jh(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=ib(i[e]);r.push(t)}}const r=IS(e);if(r.length>0){const i={};for(const t of r){const r=FS(e,t);null===r&&Jh(366,n.name,t),i[t]=ib(r)}t.$slots=i}return t}class ob{_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 U_(t&&t.editor||null,this,e)}clone(e){const t=new ob(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return U_(null,this,()=>({root:ib(tx())}))}}class sb extends J_{static getType(){return"artificial"}createDOM(e){return qx().createElement("div")}}class ab extends $v{static getType(){return"linebreak"}static clone(e){return new ab(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return qx().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>db(e)||fb(e)?null:{conversion:lb,priority:0}}}static importJSON(e){return cb().updateFromJSON(e)}}function lb(e){return{node:cb()}}function cb(){return Fx(new ab)}function ub(e){return e instanceof ab}function db(e){const t=e.parentElement;if(null!==t&&nS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&hb(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&hb(n))return!0}}return!1}function fb(e){const t=e.parentElement;if(null!==t&&nS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&hb(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&hb(r))return!0}return!1}function hb(e){return jb(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class pb extends J_{static getType(){return"paragraph"}static clone(e){return new pb(e.__key)}createDOM(e){const t=qx().createElement("p"),n=vx(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:gb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Xx(t)){this.isEmpty()&&t.append(qx().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return mb().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){const t=this.getChildren().find(by);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const n=mb();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||by(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 gb(e){const t=mb();if(pS(t,e),fS(e,t),""===t.getFormatType()){const n=e.getAttribute("align");n&&n&&n in Sp&&t.setFormat(n)}return hS(t,e),{node:t}}function mb(){return Fx(new pb)}function vb(e){return e instanceof pb}function yb(e){console.warn(e)}function _b(e,t,n,r,i){const o=e._keyToDOMMap;o.clear(),e._editorState=rb(),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),Xb(n,e,"root"))}function bb(e){const t=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of bS(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 xb={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{const n=Rb(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>X_(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>X_(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function Sb(e){const t=e||{},n=O_(),r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=rb(),a=t.namespace||(null!==i?i._config.namespace:ax()),l=t.editorState,c=[eb,uy,ab,Sy,pb,sb,...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===$v||n.prototype instanceof $v)){let r="<unknown>";try{r=JSON.parse(Op)}catch(Jh){}Jh(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))}_S(n);const o=n.getType(),s=bb(n);p.set(o,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:tg(c[e]),transforms:s})}}const g=new kb(s,i,p,{disableEvents:o,dom:{...xb,...e&&e.dom},namespace:a,theme:r},u||console.error,d||yb,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(mm,kv,0),e.registerCommand(vm,Cv,0),e.registerCommand(ym,Av,0),e.registerCommand(_m,Nv,0),e.registerCommand(Im,Dv,0)}(g),g}function wb(e,t){const n=e.get(t);e.delete(t),n&&n()}function Eb(e,t,n){return e.set(t,n),wb.bind(null,e,t)}class kb{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 zp,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=ax(),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 Eb(this._listeners.update,e)}registerEditableListener(e){return Eb(this._listeners.editable,e)}registerDecoratorListener(e){return Eb(this._listeners.decorator,e)}registerTextContentListener(e){return Eb(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return Kw(Eb(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&&Jh(35);const r=this._commands;r.has(e)||r.set(e,[new Pp,new Pp,new Pp,new Pp,new Pp]);const i=r.get(e);void 0===i&&Jh(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&&Jh(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=uS(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=uS(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=Hb(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:Kv}: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 xx(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=vx(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,_b(this,t,e,r,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||Lv(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Ax(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,Jp(this),this._updateTags.add(Kv),B_(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;fv.set(e,n);let r=hv.get(n);void 0===r&&(r={editors:new Set,hasShadowEditor:void 0},hv.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;const i=Iv(e);i.push(pv.register(n));for(let o=0;o<dv.length;o++){const[n,r]=dv[o],s="function"==typeof r?e=>{Mv(e)||(Pv(e),(t.isEditable()||"click"===n)&&r(e,t))}:e=>{if(Mv(e))return;Pv(e);const r=t.isEditable();switch(n){case"cut":return r&&xx(t,ev,e);case"copy":return xx(t,Zm,e);case"paste":return r&&xx(t,Em,e);case"dragstart":return r&&xx(t,Xm,e);case"dragover":return r&&xx(t,Qm,e);case"dragend":return r&&xx(t,Ym,e);case"focus":return r&&xx(t,sv,e);case"blur":return r&&xx(t,av,e);case"drop":return r&&xx(t,Hm,e)}};i.push(cv(e,n,s))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Kv),B_(this);$_("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Jh(38);let n=e;n._readOnly&&(n=nb(e),n._selection=e._selection?e._selection.clone():null),Hp(this);const r=this._pendingEditorState,i=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=i&&this._updateTags.add(i),B_(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,W_(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(const[e,t]of n._nodeMap.entries())X_(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=rb(),i=b_,o=S_,s=x_,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,b_=r,S_=!1,x_=t,Ab(null);try{const i=t._nodes;j_(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,b_=i,S_=o,x_=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&&B_(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]):K_(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),W_(this,()=>{const r=r_(),i=tx();null!==r?r.dirty||nx(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),kx("focus"),function(e){T_(),I_()._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=Lx(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,$_("editable",this,!0,e),this._slotsUsed&&this.update(()=>{I_()._dirtyType=2}))}toJSON(){return{editorState:this._editorState.toJSON()}}}kb.version=Op;let Cb=null;function Ab(e){Cb=e}let Nb=1;function Tb(e,t){const n=Rb(e,t);return void 0===n&&Jh(30,t),n}function Rb(e,t){return e._nodes.get(t)}const Db="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Ib(e,t){const n=void 0!==t?t:(()=>{const t=e.getRootNode();return Ub(t)||zx(t)?Wx(t):null})();if(!Xx(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;const r=Yb(n),i=n.nodeName;return qv(r)&&("INPUT"===i||"TEXTAREA"===i||"true"===n.contentEditable&&null==Mb(n))}function Fb(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 Pb(t)===e&&e.read("latest",()=>!Ib(t))}function Ob(e){return e instanceof kb}function Pb(e){let t=e;for(;null!=t;){const e=Mb(t);if(Ob(e))return e;t=wx(t)}return null}function Mb(e){return e?e.__lexicalEditor:null}function Lb(e){return Ey(e)||e.isToken()}function zb(e){return Lb(e)||e.isSegmented()}function jb(e){return Qx(e)&&3===e.nodeType}function Ub(e){return Qx(e)&&9===e.nodeType}function Bb(e,t,n){const r=bp[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 $b(e){return by(e)||ub(e)||Z_(e)}function qb(e,t){const n=function(){const e=Cb;return Cb=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);T_(),R_();const r=I_(),i=D_(),o=""+Nb++;i._nodeMap.set(o,e),X_(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),0===r._dirtyType&&(r._dirtyType=1),e.__key=o}function Gb(e){null!==NS(e)&&Jh(380,e.__key,String(NS(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 Vb(e){R_(),Uv(e)&&Jh(323,e.__key,e.__type);const t=e.getLatest(),n=null!==t.__parent?t.__parent:AS(t)?t.__slotHost:null,r=D_(),i=I_(),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:AS(e)?e.__slotHost:null}}(n,o,s);const a=t.__key;0===i._dirtyType&&(i._dirtyType=1),X_(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function Kb(e){T_();const t=I_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Hb(n);null!==e&&e.getWritable()}if(null!==e){const t=Hb(e);null!==t&&t.getWritable()}}}function Wb(){return N_()?null:I_()._compositionKey}function Hb(e,t){const n=(t||D_())._nodeMap.get(e);return void 0===n?null:n}function Jb(e,t){const n=Qb(e,I_());return void 0!==n?Hb(n,t):null}function Xb(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Qb(e,t){return e[`__lexicalKey_${t._key}`]}function Yb(e,t){let n=e;for(;null!=n;){const e=Jb(n,t);if(null!==e)return e;n=wx(n)}return null}function Zb(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function ex(e){return e.read(()=>tx().getTextContent())}function tx(){return D_()._nodeMap.get("root")}function nx(e){T_();const t=D_();null!==e&&(e.dirty=!0,e.setCachedNodes(null),Dy(e)&&I_()._slotsUsed&&Xy(e)),t._selection=e}function rx(){T_(),Hp(I_())}function ix(e){const t=function(e,t){let n=e;for(;null!=n;){const e=Qb(n,t);if(void 0!==e)return e;n=wx(n)}return null}(e,I_());return null===t?null:Hb(t)}function ox(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function sx(e){const t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function ax(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function lx(e){return jb(e)?e.nodeValue:null}function cx(e,t,n){const r=Lx(Nx(t));if(null===r)return;const i=Vx(r,t._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:a}=i;if(null!==o){let t=lx(o);const r=Yb(o);if(null!==t&&by(r)){if((t===vp||t===_p)&&n){const e=n.length;t=n,s=e,a=e}null!==t&&ux(r,t,s,a,e)}}}function ux(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(vp)&&(a=t.slice(0,-vp.length)),i)){const e=_p;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=r_();if(""===a){if(Kb(null),ip||np||ap)o.remove();else{const e=I_();dx(o,"",t),setTimeout(()=>{e.update(()=>{o.isAttached()&&""===o.getTextContent()&&o.remove()})},20)}return}const i=o.getParent(),l=i_(),c=o.getTextContentSize(),u=Wb(),d=o.getKey();if(o.isToken()&&!s||null!==u&&d===u&&!s||Dy(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(!Dy(t)||null===n||null===r)return void dx(o,a,t);if(t.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=_y(o.getTextContent());o.replace(e),o=e}dx(o,a,t)}}}function dx(e,t,n){if(e.setTextContent(t),Dy(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=aw(e,o.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function fx(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function hx(e,t,n){if(!function(e,t){return fx(e,t,"altKey")&&fx(e,t,"ctrlKey")&&fx(e,t,"shiftKey")&&fx(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 px={ctrlKey:!Zh,metaKey:Zh},gx={altKey:Zh,ctrlKey:!Zh};function mx(e){return"Backspace"===e.key}function vx(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=qw(i);return n[t]=e,e}return i}function yx(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&Jh(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 _x(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 bx(e){const t=Nx(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function xx(e,t,n){return q_(e,t,n,e)}function Sx(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Jh(75,t),n}function wx(e){const t=e.assignedSlot||e.parentElement;if(null!==t)return t;const n=e.parentNode;return zx(n)?n.host:null}function Ex(e){return Ub(e)?e:Xx(e)?e.ownerDocument:null}function kx(e){T_(),I_()._updateTags.add(e)}function Cx(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ax(e){const t=Ex(e);return t?t.defaultView:null}function Nx(e){const t=e._window;return null===t&&Jh(78),t}function Tx(e){let t=e.getLatest();for(;null!==t;){if(null!==NS(t)&&X_(t))return t;const e=t.getParentOrThrow();if(Dx(e))return e;t=e}return t}function Rx(e){return X_(e)&&e.isShadowRoot()}function Dx(e){return tb(e)||Rx(e)}function Ix(e,t=!1){const n=e.constructor.clone(e);return qb(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Fx(e){const t=I_(),n=e.getType(),r=Rb(t,n);void 0===r&&Jh(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||Jh(201,o.name,o.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||Jh(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Jh(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Ox(e,t){!tb(e.getParent())||X_(t)||Z_(t)||Jh(99)}function Px(e){if(!e||e.isInline())return!1;if(Z_(e))return!0;if(X_(e)){if(e.isShadowRoot()){const t=e.getParent();return!(X_(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Mx(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Lx(e){return Qh?(e||window).getSelection():null}function zx(e){return Yx(e)&&"host"in e}const jx=[];function Ux(e){const t=e.getRootNode();if(t===e||!zx(t))return jx;const n=[t];let r=t.host;for(;;){const e=r.getRootNode();if(e===r||!zx(e))break;n.push(e),r=e.host}return n}function*Bx(e){const t=[e];let n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const e=(Ub(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function $x(e){return null!==e?e.ownerDocument:document}function qx(){const e=O_();return $x(null!==e?e._rootElement:null)}function Gx(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;const n=Ux(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 Vx(e,t){const n=Gx(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 Kx(e){const t=e.getRootNode();return Ub(t)||zx(t)?t.activeElement:null}function Wx(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 Hx(e){const t=e.target;if(null!==t&&Xx(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){const t=e.composedPath();if(t.length>0)return t[0]}return t}function Jx(e){return Xx(e)&&"A"===e.tagName}function Xx(e){return Qx(e)&&1===e.nodeType}function Qx(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Yx(e){return Qx(e)&&11===e.nodeType}const Zx=/^(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 eS(e){return!(!Xx(e)||!e.style.display.startsWith("inline"))||Zx.test(e.nodeName)}const tS=/^(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 nS(e){return(!Xx(e)||!e.style.display.startsWith("inline"))&&tS.test(e.nodeName)}function rS(e){if(Z_(e)&&!e.isInline())return!0;if(!X_(e)||Dx(e))return!1;const t=e.getFirstChild(),n=null===t||ub(t)||by(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function iS(){return I_()}function oS(e=iS()){return e._config.dom||xb}function sS(e,t,n=iS()){const r=oS(n).$getDOMSlot(e,t,n);return X_(e)&&(function(e){return e instanceof Ip}(r)||Jh(344,e.getKey(),e.getType())),r}function aS(e,t,n=iS()){return function(e){let t=e;for(;null!=t;){if(jb(t))return t;t=t.firstChild}return null}(sS(e,t,n).element)}const lS=new WeakMap,cS=new Map;function uS(e){if(!e._readOnly&&e.isEmpty())return cS;e._readOnly||Jh(192);let t=lS.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),lS.set(e,t)),t}function dS(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function fS(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 hS(e,t){const n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function pS(e,t){const n=t.style.textAlign;return n&&n in Sp?e.setFormat(n):e}function gS(e){return!0===e.__lexicalUnmanaged}function mS(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;if(Xx(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(void 0!==Qb(n,t))return!1;n=wx(n)}return!1}function vS(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==$v[t]}const yS=new WeakMap;function _S(e){const t=yS.get(e);if(t)return t;const n=null!=e.prototype&&Cp in e.prototype?e.prototype[Cp]():void 0,r=function(e){if(!(e===$v||e.prototype instanceof $v)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(Jh){}try{kb.version&&(n=JSON.parse(kb.version))}catch(Jh){}Jh(290,e.name,t,n)}return e===Y_||e===J_||e===$v}(e),i=!r&&vS(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&&(vS(e,"getType")||(e.getType=()=>s),vS(e,"clone")||(e.clone=t=>(Ab(t),new e)),vS(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(t=>(new e).updateFromJSON(t))),!vS(e,"importDOM")&&o)){const{importDOM:t}=o;t&&(e.importDOM=()=>t)}const a={klass:e,ownNodeConfig:o,ownNodeType:s};return yS.set(e,a),a}function*bS(e){for(let t=e;t&&(t===$v||qv(t.prototype));){const e=_S(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||ES(t)}}function xS(e){const t=iS();return T_(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}const SS=(e,t)=>{let n=e;for(;null!=n&&!tb(n);){if(t(n))return n;n=n.getParent()}return null};function wS(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=null===t?Hb(r):t.get(r);null==e&&Jh(174),n.push(r),r=e.__next}return n}function ES(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 kS=new Map;function CS(e){return X_(e)||Z_(e)}function AS(e){return X_(e)||Z_(e)}function NS(e){const t=e.getLatest();return AS(t)?t.__slotHost:null}function TS(e){const t=NS(e);if(null===t)return null;const n=Hb(t);return X_(n)||Z_(n)||Jh(370),n}function RS(e){let t=e.getLatest();for(;null!==t;){if(null!==NS(t))return t;t=t.getParent()}return null}function DS(e){const t=e.getLatest();return CS(t)&&null!==t.__slots?t.__slots:kS}function IS(e){return Array.from(DS(e).keys())}function FS(e,t){const n=DS(e).get(t);return void 0===n?null:Hb(n)}const OS=["__proto__","constructor","prototype"],PS=Symbol("slotMapOwner");function MS(e){let t=e.__slots;return null!==t&&t[PS]===e||(t=new Map(t),t[PS]=e,e.__slots=t),t}const LS=new WeakMap,zS=[];function jS(e){let t="";for(const n of IS(e)){const r=FS(e,n);null!==r&&(t+=r.getTextContent())}return t}function US(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 BS(e){const t=e.__slots;if(null===t||t.size<2)return;const n=function(e){let t=LS.get(e);if(void 0===t){const n=function(e){for(const{ownNodeConfig:t}of bS(e)){const e=t&&t.slots;if(e)return e}return zS}(e),r=new Map;for(const t of n)OS.includes(t)&&Jh(371,e.name,t),r.has(t)&&Jh(372,e.name,t),r.set(t,r.size);t=r,LS.set(e,t)}return t}(e.constructor);let r=null,i=!0;for(const s of t.keys()){if(null!==r&&US(r,s,n)>0){i=!1;break}r=s}if(i)return;const o=Array.from(t).sort(([e],[t])=>US(e,t,n));t.clear();for(const[s,a]of o)t.set(s,a)}function $S(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||Jh(373,t);const r=e.getLatest();if(null!==r.__slots&&r.__slots.get(t)===n.getLatest().__key)return r;(!X_(n)&&!Z_(n)||n.isInline())&&Jh(374,n.__key);const i=e.getWritable(),o=MS(i),s=o.get(t);void 0!==s&&GS(s);const a=n.getWritable(),l=TS(a);if(null!==l){const e=function(e){const t=TS(e);if(null===t)return null;const n=e.getLatest().__key;for(const[r,i]of DS(t))if(i===n)return r;return null}(a);null!==e&&MS(l.getWritable()).delete(e),a.__slotHost=null}return Gb(a),a.__slotHost=i.__key,o.set(t,a.__key),BS(i),function(){const e=iS();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function qS(e,t){const n=e.getWritable();if(null===n.__slots)return n;const r=n.__slots.get(t);return void 0!==r&&(GS(r),MS(n).delete(t)),n}function GS(e){const t=Hb(e);if(null===t)return;const n=t.getWritable();AS(n)||Jh(377,e),n.__slotHost=null,n.remove()}const VS={next:"previous",previous:"next"};class KS{origin;constructor(e){this.origin=e}[Symbol.iterator](){return mw({hasNext:ew,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ow(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ow(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&&Jh(263,Array.from(s).join(" "))}else i.insert(a);i=ow(a,this.direction)}for(const a of s.values())a.remove();return this}}class WS extends KS{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:cw(e,this.direction)}getParentCaret(e="root"){return ow(XS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=JS(this.direction);return ow(this.getNodeAtCaret(),e)||cw(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof WS&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const HS={root:tb,shadowRoot:Dx};function JS(e){return VS[e]}function XS(e,t="root"){return null===e||HS[t](e)?null:null===NS(e)?e:null}class QS extends KS{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ow(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return X_(this.origin)?cw(this.origin,this.direction):null}getParentCaret(e="root"){return ow(XS(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=JS(this.direction);return ow(this.getNodeAtCaret(),e)||cw(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof QS&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof QS||e instanceof YS)&&this.direction===e.direction&&this.origin.is(e.origin)}}class YS extends KS{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:sw(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ow(XS(this.getParentAtCaret(),e),this.direction)}getFlipped(){return sw(this.origin,JS(this.direction),this.offset)}isSamePointCaret(e){return e instanceof YS&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof QS||e instanceof YS)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ow(this.origin,this.direction)}}function ZS(e){return e instanceof YS}function ew(e){return e instanceof QS}function tw(e){return e instanceof WS}const nw={next:class extends YS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends YS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rw={next:class extends QS{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends QS{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},iw={next:class extends WS{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends WS{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function ow(e,t){return e?new rw[t](e):null}function sw(e,t,n){return e?new nw[t](e,aw(e,n)):null}function aw(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&Xh(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function lw(e,t){return new fw(e,t)}function cw(e,t){return X_(e)?new iw[t](e):null}function uw(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class dw{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 dw(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return ZS(t)?function(e,t){const{direction:n,origin:r}=e;return lw(e,aw(r,"focus"===t?JS(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[lw(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=ZS(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=ZS(n),i=t=>t.isSameNodeCaret(n)?null:uw(t)||t.getParentCaret(e);return mw({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 fw{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 sw(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function hw(e){return gw(e,ow(tx(),e.direction))}function pw(e){return gw(e,e)}function gw(e,t){return e.direction!==t.direction&&Jh(265),new dw(e,t,e.direction)}function mw(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 vw(e,t){const n=xw(e.origin,t.origin);switch(null===n&&Jh(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 yw(n)}}function yw(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 _w(e,t){return t.is(e)}function bw(e){return X_(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function xw(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,i]=bw(e);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=bw(t);r;i=r,r=r.getParent()){const o=n.get(r);if(void 0!==o)return null===o?(_w(e,r)||Jh(276),{commonAncestor:r,type:"ancestor"}):null===i?(_w(t,r)||Jh(277),{commonAncestor:r,type:"descendant"}):((X_(o)||_w(e,o))&&(X_(i)||_w(t,i))&&r.is(o.getParent())&&r.is(i.getParent())||Jh(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function Sw(e,t){const{type:n,key:r,offset:i}=e,o=function(e){const t=Hb(e);return null===t&&Jh(63,e),t}(e.key);return"text"===n?(by(o)||Jh(266,o.getType(),r),sw(o,t,i)):(X_(o)||Jh(267,o.getType(),r),Pw(o,e.offset,t))}function ww(e,t){const{origin:n,direction:r}=t,i="next"===r;ZS(t)?e.set(n.getKey(),t.offset,"text"):ew(t)?by(n)?e.set(n.getKey(),aw(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(tw(t)&&X_(n)||Jh(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Ew(e){const t=r_(),n=Dy(t)?t:e_();return kw(n,e),nx(n),n}function kw(e,t){ww(e.anchor,t.anchor),ww(e.focus,t.focus)}function Cw(e){const{anchor:t,focus:n}=e,r=Sw(t,"next"),i=Sw(n,"next"),o=vw(r,i)<=0?"next":"previous";return gw(Fw(r,o),Fw(i,o))}function Aw(e){const{direction:t,origin:n}=e,r=ow(n,JS(t)).getNodeAtCaret();return r?ow(r,t):cw(n.getParentOrThrow(),t)}function Nw(e,t="root"){const n=[e];for(let r=tw(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Aw(r));return n}function Tw(e){return!!e&&e.origin.isAttached()}function Rw(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const o=Ow(e,r),s=Nw(o.anchor,n),a=Nw(o.focus.getFlipped(),n),l=new Set,c=[];for(const p of o.iterNodeCarets(n))if(tw(p))l.add(p.origin.getKey());else if(ew(p)){const{origin:e}=p;X_(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=Aw(ow(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=_y(t.getTextContent()).setStyle(t.getStyle()).setFormat(t.getFormat());n.replaceOrInsert(i),e=sw(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(Tw(p)){u=Dw(p);break}for(const p of a)if(Tw(p)){d=Dw(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(Dx(i))return;!n&&t(i)&&(n=i)}return n},u=c(o,rS),d=u&&c(s,e=>n.has(e.getKey())&&rS(e));return d&&IS(d).length>0?null:u&&d?[u,d]:null}(u,d,l);if(f){const[e,t]=f;cw(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(tw(e)){const t=e.origin;if(rS(t))return t}else{const t=e.getParentAtCaret();if(t&&rS(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(Rx);if(e&&t&&!tb(t)&&e.isEmpty()&&l.has(e.getKey())&&0===IS(e).length&&(!n||l.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!tb(n)&&n.isEmpty();){const e=n.getParent();if(e&&tb(e)&&e.getChildrenSize()<=1)break;const t=n;n=e,t.remove(!0)}}}const h=[u,d,...s,...a].find(Tw);if(h)return pw(Fw(Dw(h),e.direction));Jh(269,JSON.stringify(s.map(e=>e.origin.__key)))}function Dw(e){const t=function(e){let t=e;for(;tw(t);){const e=uw(t);if(!tw(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(by(t.origin))return ZS(t)?t:sw(t.origin,n,n);const r=t.getAdjacentCaret();return ew(r)&&by(r.origin)?sw(r.origin,n,JS(n)):t}function Iw(e){return ZS(e)&&e.offset!==aw(e.origin,e.direction)}function Fw(e,t){return e.direction===t?e:e.getFlipped()}function Ow(e,t){return e.direction===t?e:gw(Fw(e.focus,t),Fw(e.anchor,t))}function Pw(e,t,n){let r=cw(e,"next");for(let i=0;i<t;i++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return Fw(r,n)}function Mw(e){const{origin:t,offset:n,direction:r}=e;if(n===aw(t,r))return e.getSiblingCaret();if(n===aw(t,JS(r)))return Aw(e.getSiblingCaret());const[i]=t.splitText(n);return by(i)||Jh(281),Fw(ow(i,"next"),r)}function Lw(e,t){return!0}function zw(e,{$copyElementNode:t=Ix,$splitTextPointCaretNext:n=Mw,rootMode:r="shadowRoot",$shouldSplit:i=Lw,removeEmptyDestination:o=!1}={}){if(ZS(e))return n(e);const s=e.getParentCaret(r);if(s){const{origin:n}=s;if(tw(e)){const e=Aw(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 jw(e,t,n){let r=Fw(t,"next");ZS(r)&&(0===r.offset?r=ow(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=ow(r.origin,"next"))),r.origin.is(e)&&(ew(r)||Jh(342,e.getKey(),e.getType()),r=Aw(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=r;i;i=zw(i,n))r=i;return ZS(r)&&Jh(283),r.insert(e.isInline()?mb().append(e):e),Fw(ow(e.getLatest(),"next"),t.direction)}function Uw(e){return e}function Bw(e){return e}function $w(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function qw(...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 Gw(e,...t){const n=qw(...t);n.length>0&&e.classList.add(...n)}function Vw(e,...t){const n=qw(...t);n.length>0&&e.classList.remove(...n)}function Kw(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Ww(e){const t=iS().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function Hw(e){return Ww(tb(e)?e:e.getParentOrThrow())}function Jw(e){const t=Hw(e);return null!==t&&"rtl"===t.direction}function Xw(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!zb(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]=Ly(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=dS(e))[jv]=!0,t;var t}(t)),t.__text=h)}}return t}function Qw(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Yw(e,t,n=Qw){if(!e)return;const r=e.getStartEndPoints();let i=!1,o=null;const s=new Map;if(r){const[t,n]=r,a=SS(t.getNode(),rS);o=SS(n.getNode(),rS);const l=e.isBackward()?"previous":"next";i=X_(o)&&!o.is(a)&&function(e,t,n){const r=e.getNode();return(!X_(r)||!r.isEmpty())&&function(e,t,n){let r=Sw(e,n);if(Iw(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,JS(l)),X_(a)&&s.set(a.getKey(),a),X_(o)&&!i&&s.set(o.getKey(),o)}for(const a of e.getNodes())if(X_(a)&&rS(a)){if(i&&a.is(o))continue;s.set(a.getKey(),a)}else if(!r){const e=SS(a,rS);X_(e)&&s.set(e.getKey(),e)}for(const a of s.values()){const e=t();n(a,e),a.replace(e,!0)}}function Zw(e){const t=eE(e);return null!==t&&"vertical-rl"===t.writingMode}function eE(e){const t=e.anchor.getNode();return X_(t)?Ww(t):Hw(t)}function tE(e,t){let n=Zw(e)?!t:t;nE(e)&&(n=!n);const r=Sw(e.focus,n?"previous":"next");if(Iw(r))return!1;if(ZS(r)&&!Ey(r.origin)&&r.origin.isUnmergeable()){const e=r.getNodeAtCaret();if(by(e)&&!Ey(e))return!0}for(const i of hw(r)){if(tw(i))return!i.origin.isInline();if(!X_(i.origin)){if(Z_(i.origin))return!0;break}}return!1}function nE(e){const t=eE(e);return null!==t&&"rtl"===t.direction}function rE(e,t,n){const r=nE(e);let i;i=Zw(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}function iE(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function oE(e){const t=SS(e,e=>X_(e)&&!e.isInline());return X_(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 sE(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function aE(e){let t=null;if(sE(e,DragEvent)?t=e.dataTransfer:sE(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 lE(e){const t=r_();if(!Dy(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=SS(t,e=>X_(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 cE=Symbol.for("preact-signals");function uE(){if(mE>1)return void mE--;let e,t=!1;for(function(){let e=pE;for(pE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==fE;){let n=fE;for(fE=void 0,vE++;void 0!==n;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&xE(n))try{n.c()}catch(Qh){t||(e=Qh,t=!0)}n=r}}if(vE=0,mE--,t)throw e}let dE,fE;function hE(e){const t=dE;dE=void 0;try{return e()}finally{dE=t}}let pE,gE,mE=0,vE=0,yE=0;function _E(e){if(void 0===dE)return;let t=e.n;return void 0===t||t.t!==dE?(t={i:0,S:e,p:dE.s,n:void 0,t:dE,e:void 0,x:void 0,r:t},void 0!==dE.s&&(dE.s.n=t),dE.s=t,e.n=t,32&dE.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=dE.s,t.n=void 0,dE.s.n=t,dE.s=t),t):void 0}function bE(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 xE(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 SE(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 wE(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 EE(e,t){bE.call(this,void 0),this.x=e,this.s=void 0,this.g=yE-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 kE(e){const t=e.m;if(e.m=void 0,"function"==typeof t){mE++;const n=dE;dE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,CE(e),t}finally{dE=n,uE()}}}function CE(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,kE(e)}function AE(e){if(dE!==this)throw new Error("Out-of-order effect");wE(this),dE=e,this.f&=-2,8&this.f&&CE(this),uE()}function NE(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 TE(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}function RE(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.`)}bE.prototype.brand=cE,bE.prototype.h=function(){return!0},bE.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:hE(()=>{var e;null==(e=this.W)||e.call(this)}))},bE.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&&hE(()=>{var e;null==(e=this.Z)||e.call(this)}))}},bE.prototype.subscribe=function(e){return function(e,t){const n=new NE(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=dE;dE=void 0;try{e(t)}finally{dE=n}},{name:"sub"})},bE.prototype.valueOf=function(){return this.value},bE.prototype.toString=function(){return this.value+""},bE.prototype.toJSON=function(){return this.value},bE.prototype.peek=function(){const e=dE;dE=void 0;try{return this.value}finally{dE=e}},Object.defineProperty(bE.prototype,"value",{get(){const e=_E(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(vE>100)throw new Error("Cycle detected");!function(e){0!==mE&&0===vE&&0!==e.l&&(e.l=0,pE={S:e,v:e.v,i:e.i,o:pE})}(this),this.v=e,this.i++,yE++,mE++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{uE()}}}}),EE.prototype=new bE,EE.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===yE)return!0;if(this.g=yE,this.f|=1,this.i>0&&!xE(this))return this.f&=-2,!0;const e=dE;try{SE(this),dE=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 dE=e,wE(this),this.f&=-2,!0},EE.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)}bE.prototype.S.call(this,e)},EE.prototype.U=function(e){if(void 0!==this.t&&(bE.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)}},EE.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(EE.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=_E(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),NE.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()}},NE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,kE(this),SE(this),mE++;const e=dE;return dE=this,AE.bind(this,e)},NE.prototype.N=function(){2&this.f||(this.f|=2,this.u=fE,fE=this)},NE.prototype.d=function(){this.f|=8,1&this.f||CE(this)},NE.prototype.dispose=function(){this.d()};try{gE="0.48.0+prod.esm"}catch(Jh){}const DE=gE??'"<unknown>+source"',IE=new Set(["__proto__","constructor","prototype"]);function FE(e,t){if(e&&t&&!Array.isArray(t)&&"object"==typeof e&&"object"==typeof t){const n=e,r=t;for(const e in r)!IE.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=FE(n[e],r[e]));return e}return t}function OE(e){return 0===e.id}function PE(e){return 2===e.id}const ME=new Set;let LE=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):$w;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;PE(t)||RE(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&&RE(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&&RE(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&&RE(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&&RE(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&&RE(311),this._signal}getInitResult(){void 0===this.extension.init&&RE(312,this.extension.name);const e=this.state;return function(e){return e.id>=4}(e)||RE(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)||RE(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&&RE(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&RE(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return function(e){return e.id>=7}(e)||RE(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ME}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)||RE(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const zE={tag:Kv};function jE(){const e=tx();e.isEmpty()&&e.append(mb())}const UE=Uw({config:Bw({setOptions:zE,updateOptions:zE}),init:({$initialEditorState:e=jE})=>({$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 ob}(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:[eb,uy,ab,Sy,pb]}),BE=Symbol.for("@lexical/extension/LexicalBuilder");function $E(){}function qE(e){throw e}function GE(e){return Array.isArray(e)?e:[e]}const VE=DE;class KE{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=VE,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[GE(UE)];for(const n of e)t.push(GE(n));return new KE(t)}static maybeFromEditor(e){const t=e[BE];return t&&(t.PACKAGE_VERSION!==VE&&RE(292,t.PACKAGE_VERSION,VE),t instanceof KE||RE(293)),t}static fromEditor(e){const t=KE.maybeFromEditor(e);return void 0===t&&RE(294),t}constructEditor(){const{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(Sb({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[BE]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=$E;function t(){try{e()}finally{e=$E}}const n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Kw(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&&RE(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&&RE(296);const t=GE(e),[n]=t;"string"!=typeof n.name&&RE(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&RE(298,n.name),!r){r=new LE(this,n),this.extensionNameMap.set(n.name,r);const e=this.conflicts.get(n.name);"string"==typeof e&&RE(299,n.name,e);for(const t of n.conflictsWith||[])this.extensionNameMap.has(t)&&RE(299,n.name,t),this.conflicts.set(t,n.name);for(const t of n.dependencies||[]){const e=GE(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(PE(i))return;const o=n.extension.name;var s;OE(i)||RE(300,o,r||"[unknown]"),OE(s=i)||RE(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)||RE(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())OE(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&&RE(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 Kw(...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 TE(s)){if("function"!=typeof e){const t=n.get(e.replace);t&&RE(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&&FE(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=qE),e}}function WE(e,t){const n=KE.maybeFromEditor(e);if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}class HE extends Y_{static getType(){return"horizontalrule"}static clone(e){return new HE(e.__key)}static importJSON(e){return XE().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:JE,priority:0})}}exportDOM(){return{element:qx().createElement("hr")}}createDOM(e){const t=qx().createElement("hr");return Gw(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function JE(){return{node:XE()}}function XE(){return xS(HE)}function QE(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 YE;function ZE(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function ek(e){return YE&&YE.editor===e?YE:void 0}function tk(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;return[n,r(ZE(e,n))]}return t}function nk(e){return Object.create(e||null)}function rk(e,t){return[e,t]}function ik(e,t,n,r){return Object.assign(Yp(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}const ok="@lexical/html/DOM",sk=Symbol.for("@lexical/html/DOMExportContext"),ak=Symbol.for("@lexical/html/DOMImportContext");function lk(e,t,n){return ik(sk,e,t,n)}const ck=lk("isExport",Boolean);function uk(e=iS()){const t=function(e){const t=WE(e,ok);return t?t.output.runtime:void 0}(e);return t?t.getSessionConfig():oS(e)}const dk=function(e,t=()=>{}){return(n,r=iS())=>i=>{const o=ek(r),s=o&&o[e],a=function(e,t){let n=t;for(const r of e){const[e,i]=tk(n,r),o=e.key;if(n===t&&ZE(n,e)===i)continue;const s=n===t||void 0===n?nk(t):n;s[o]=i,n=s}return n}(n,s||t(r));return a&&a!==s?function(e,t,n,r=iS()){const i=YE,o=ek(r);try{return YE={...o,editor:r,[e]:t},n()}finally{YE=i}}(e,a,i,r):i()}}(sk,function(e){const t=WE(e,ok);return t?t.output.defaults:void 0}),fk=Symbol.for("@lexical/html/SelectorImpl");function hk(e,t){const n={kind:"element",predicate:(r=t,0===r.length?Xx: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=>hk(e,[...t,n]);return{[fk]:n,attr:(e,t,n)=>i(mk(e,t,n)),classAll:(...e)=>i(gk(e)),classAny:(...e)=>i(function(e){const t=pk(e);return 0===t.length?()=>!1:e=>{if(!Xx(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=>Xx(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Xx(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)}}QE(362,JSON.stringify(e))}(e,t,n))}}function pk(e){const t=[];for(const n of e)n&&t.push(n);return t}function gk(e){const t=pk(e);return 0===t.length?()=>!0:e=>{if(!Xx(e))return!1;const n=e.classList;for(const r of t)if(!n.contains(r))return!1;return!0}}function mk(e,t,n){if(!0===t)return t=>Xx(t)&&t.hasAttribute(e);if("string"==typeof t)return n=>Xx(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!Xx(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)}}QE(361,JSON.stringify(e))}const vk={kind:"text",predicate:jb,tags:new Set},yk={[fk]:vk},_k={kind:"comment",predicate:e=>8===e.nodeType,tags:new Set},bk={[fk]:_k},xk={any:()=>hk(new Set,[]),comment:()=>bk,tag(...e){e.length>0||QE(363);const t=new Set;for(const n of e)t.add(n.toUpperCase());return hk(t,[])},text:()=>yk};function Sk(e,t){return Xx(e)&&e.nodeName===t.toUpperCase()}const wk=/[A-Za-z0-9_-]/;let Ek=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()&&wk.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||QE(364,String(this.pos+1),t,this.source)}};function kk(e){const t=new Set,n=[],r=[];if(e.skipWhitespace(),"*"===e.peek())e.consume();else if(wk.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(mk("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(mk(t,r))}}}return r.length>0&&n.push(gk(r)),{predicates:n,tags:t}}function Ck(e){return e}function Ak(e,t,n){return ik(ak,e,t,n)}const Nk=Ak("textFormat",()=>0),Tk=Ak("textStyle",()=>({}));function Rk(e){if(!Xx(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Dk(e){if(jb(e))return!0;if(!Xx(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!nS(e)&&eS(e)}const Ik=Ak("whitespaceConfig",()=>({isInline:Dk,preservesWhitespace:Rk}));function Fk(e){return Yy(e)||Z_(e)&&!e.isInline()}function Ok(e,t){if(!Xx(t))return e;const n=t.style.textAlign;if(!Lk(n))return e;for(const r of e)Yy(r)&&""===r.getFormatType()&&r.setFormat(n);return e}const Pk=xk,Mk=new Set(["center","end","justify","left","right","start"]);function Lk(e){return Mk.has(e)}const zk={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"}},jk={CODE:16,MARK:128},Uk=new Set(["font-weight","font-style","text-decoration","vertical-align"]);Pk.tag("b","strong","em","i","code","mark","s","sub","sup","u","span");function Bk(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(jb(r))return r;if("BR"===r.nodeName)return null}}function $k(e,t){return 0!==t&&by(e)?e.setFormat(t):e}function qk(e,t){if(by(e)){const n=function(e){let t="";for(const n in e)Uk.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);""!==n&&e.setStyle(n)}return e}Pk.text(),Pk.tag("script","style"),Pk.tag("br"),Pk.tag("p"),Pk.tag("hr");function Gk(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 Vk(e){const t=[],n=new Map,r=[],i=[],o=[],s=new Set;e.forEach((e,a)=>{const l=function(e){const t=e[fk];return void 0===t&&QE(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,Gk(c,r));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:r}}function Kk(e){return"object"==typeof e&&null!==e&&"__type"in e&&"CompiledOverlayRules"===e.__type}function Wk(e){const t=function(e){const t=[];for(const n of e)if(Kk(n))for(const e of n.rules)t.push(e);else t.push(n);return t}(e);return{__type:"CompiledOverlayRules",dispatch:Vk(t),rules:t}}Pk.any(),xk.any();const Hk={any:xk.any,comment:xk.comment,css:function(e){const t=new Ek(e,0),n=[];for(;;){const e=kk(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 hk(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 hk(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:xk.tag,text:xk.text},Jk=new Set(["STYLE","SCRIPT"]);function Xk(e,t){!function(e){if(!Ub(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(!sE(n,CSSStyleRule))continue;let i;try{i=t.querySelectorAll(n.selectorText)}catch(e){continue}for(const e of Array.from(i)){if(!Xx(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=Ub(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const o of n)if(!Jk.has(o.nodeName)){const t=Zk(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 sb&&t.insertAfter(cb());for(const t of e){const e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Qk(e,t=null){return("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)&&QE(338),function(e){null!==D_()&&null===x_&&(x_=e),x_!==e&&Xh(378)}(e),function(e,t=null,n=iS()){return dk([rk(ck,!0)],n)(()=>{const r=tx(),i=uk(n),o=Dy(t)?RS(t.anchor.getNode()):null,s=e.append.bind(e);for(const e of(X_(o)?o:r).getChildren())Yk(n,e,s,t,i);return e})}(qx().createElement("div"),t,e).innerHTML}function Yk(e,t,n,r=null,i=oS(e)){let o=i.$shouldInclude(t,r,e);const s=i.$shouldExclude(t,r,e);let a=t;null!==r&&by(t)&&(a=Xw(r,t,"clone"));const l=i.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;const h=qx().createDocumentFragment(),p=f?f():X_(a)?a.getChildren():[],g=o&&Fy(r)&&X_(t)?null:r,m=h.append.bind(h);for(const v of p){const n=Yk(e,v,m,g,i);!o&&n&&i.$extractWithChild(t,v,r,"html",e)&&(o=!0)}if(o&&!s){if((Xx(c)||Yx(c))&&(d?d(h):c.append(h)),n(c),u){const e=u.call(a,c);e&&(Yx(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(h);return o}function Zk(e,t,n,r,i=new Map,o){const s=[];if(Jk.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||!Dx(a))&&(null!=a&&Yy(a)||r);for(let p=0;p<d.length;p++)f.push(...Zk(d[p],t,n,h,new Map(i),a));if(null!=u&&(f=u(f)),nS(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(Yy(e))r&&!e.getFormat()&&e.setFormat(r),i.push(e);else if(o.push(e),s===t.length-1||s<t.length-1&&Yy(t[s+1])){const e=n();e.setFormat(r),e.append(...o),i.push(e),o=[]}}return i}(e,f,h?()=>{const e=new sb;return n.push(e),e}:mb)),null==a)if(f.length>0)for(const p of f)s.push(p);else nS(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(eS(e.nextSibling)&&eS(e.previousSibling))}(e)&&s.push(cb());else X_(a)&&a.append(...f);return s}function eC(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 tC(e){const t=e.getParent();wC(t)||eC(40);let n=t,r=t;for(;null!==r;)r=r.getParent(),wC(r)&&(n=r);return n}function nC(e){let t=[];const n=e.getChildren().filter(vC);for(let r=0;r<n.length;r++){const e=n[r],i=e.getFirstChild();wC(i)?t=t.concat(nC(i)):t.push(e)}return t}function rC(e){return vC(e)&&wC(e.getFirstChild())}function iC(e,t){return vC(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function oC(e){const t=r_();if(null!==t){let n=t.getNodes();if(Dy(t)){const[r]=t.getStartEndPoints(),i=r.getNode(),o=i.getParent();if(Dx(i)){const e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=mb();i.append(e),n=e.select().getNodes()}}else if(iC(i,n)){const t=SC(e);if(Dx(o)){i.replace(t);const e=mC();X_(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(vC(i)){const e=i.getParentOrThrow();sC(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(X_(i)&&i.isEmpty()&&!vC(i)&&!r.has(i.getKey())){aC(i,e);continue}let o=$b(i)?i.getParent():vC(i)&&i.isEmpty()?i:null;for(;null!=o;){const t=o.getKey();if(wC(o)){if(!r.has(t)){const n=SC(e);sC(n,o.getChildren()),o.replace(n),r.add(t)}break}{const n=o.getParent();if(Dx(n)&&!r.has(t)){r.add(t),aC(o,e);break}o=n}}}}}function sC(e,t){e.splice(e.getChildrenSize(),0,t)}function aC(e,t){if(wC(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=mC();let o;if(sC(i,e.getChildren()),wC(n)&&t===n.getListType())n.append(i),wC(r)&&t===r.getListType()&&(sC(n,r.getChildren()),r.remove()),o=n;else if(wC(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=SC(t);n.append(i),e.replace(n),o=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=r_();return Dy(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 lC(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&rC(n)&&rC(r)&&(lC(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function cC(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())vC(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),wC(r.getFirstChild())||n++)}function uC(e){const t=new Set;if(rC(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(rC(r)&&rC(i)){const n=i.getFirstChild();if(wC(n)){n.append(e);const i=r.getFirstChild();wC(i)&&(sC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(rC(r)){const t=r.getFirstChild();if(wC(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(rC(i)){const t=i.getFirstChild();wC(t)&&t.append(e)}else if(wC(n)){const t=Ix(e),o=Ix(n);t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function dC(e){if(rC(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(wC(n?n.getParent():void 0)&&vC(n)&&wC(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=Ix(e),i=Ix(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));const o=Ix(e),s=Ix(t);o.append(s),sC(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(o),n.replace(e)}}}let fC=class extends J_{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(wC(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();wC(n)||eC(340);const r=[e];for(const t of["previous","next"]){r.reverse();for(const{origin:n}of ow(e,t)){if(!vC(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Dx(t)||(jw(n,Aw(ow(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:J_,importDOM:{li:()=>({conversion:hC,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=qx().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t){const n=t.getParent();!wC(n)||"check"!==n.getListType()||wC(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=wC(s)&&"check"===s.getListType(),l=n.getChecked(),c=n.getChildren().some(e=>wC(e)),u=[];void 0!==r.listitemChecked&&u.push(r.listitemChecked),void 0!==r.listitemUnchecked&&u.push(r.listitemUnchecked),void 0!==o&&u.push(...qw(o)),u.length>0&&Vw(e,...u);const d=[];if(void 0!==i&&d.push(...qw(i)),a){const e=l?r.listitemChecked:r.listitemUnchecked;void 0!==e&&d.push(e)}void 0!==o&&c&&d.push(...qw(o)),d.length>0&&Gw(e,...d)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&ny(t.style,i,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const o=ey(r);for(const s in o)e.style.setProperty(`--listitem-marker-${s}`,o[s]);if(""!==i)for(const s in ey(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),rC(this)?{after(e){if(Xx(e)){const t=e.previousElementSibling;if(Xx(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(X_(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(vC(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!wC(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=Ix(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&&(X_(e)||eC(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&X_(e)){const t=r_();if(Dy(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(wC(n)||eC(39),vC(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=Ix(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&&rC(t)&&rC(n)&&(lC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=Ix(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(rC(this))return!1;const t=this.getParentOrThrow();if(vC(t.getParentOrThrow()))return dC(this),!0;const n=mb().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){const e=Ix(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 wC(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(;vC(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&eC(117),(e=Math.floor(e))>=0||eC(199);let t=this.getIndent();for(;t!==e;)t<e?(uC(this),t++):(dC(this),t--);return this}canInsertAfter(e){return vC(e)}canReplaceWith(e){return vC(e)}canMergeWith(e){return vC(e)||vb(e)}extractWithChild(e,t){if(!Dy(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 SC("bullet")}canMergeWhenEmpty(){return!0}};function hC(e){if(e.classList.contains("task-list-item"))for(const r of e.children)if("INPUT"===r.tagName)return pC(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 pC(r.children[0]);const t=e.getAttribute("aria-checked"),n=mC("true"===t||"false"!==t&&void 0);return pS(n,e),{after:gC.bind(null,n),node:hS(n,e)}}function pC(e){if("checkbox"!==e.getAttribute("type"))return{node:null};const t=mC(e.hasAttribute("checked"));return{after:gC.bind(null,t),node:t}}function gC(e,t){const n=t[0];return 1===t.length&&vb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function mC(e){return Fx(new fC(void 0,e))}function vC(e){return e instanceof fC}let yC=class extends J_{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();wC(t)&&e.getListType()===t.getListType()&&lC(e,t)}(e),cC(e)},extends:J_,importDOM:{ol:()=>({conversion:bC,priority:0}),ul:()=>({conversion:bC,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=xC[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=qx().createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,_C(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(_C(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 Xx(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];vC(e)||(r===n&&(r=[...n]),r[i]=this.createListItemNode().append(!X_(e)||wC(e)||e.isInline()?e:_y(e.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return vC(e)}createListItemNode(){return mC()}};function _C(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(vC(n)){const e=n.getParent();if(wC(e)){t++,n=e.getParent();continue}eC(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(...qw(a));for(let t=0;t<e.length;t++)t!==s&&i.push(n.__tag+t)}if(void 0!==c){const e=qw(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&Vw(e,...i),r.length>0&&Gw(e,...r)}function bC(e){let t;if(function(e){return Xx(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const n=e.start;t=SC("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(Xx(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?SC("check"):SC("bullet");return hS(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(vC(t)){r.push(t);const e=t.getChildren();e.length>1&&e.forEach(e=>{wC(e)&&r.push(n().append(e))})}else r.push(n().append(t))}return r}(e,t),node:t}}const xC={ol:"number",ul:"bullet"};function SC(e="number",t=1){return Fx(new yC(e,t))}function wC(e){return e instanceof yC}function EC(e){const t=[];for(const n of e)if(vC(n)){t.push(n);const e=n.getChildren();if(e.length>1)for(const n of e)wC(n)&&t.push(mC().append(n))}else t.push(mC().append(n));return t}Hk.tag("ol","ul");function kC(e,t){if(1!==t.length)return t;const n=t[0];return vb(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function CC(e){const t=e=>Fk(e)&&!wC(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(X_(s)?s.getChildren():[s])):r.push(s);i();const o=[];for(const s of n)o.length>0&&o.push(cb()),o.push(...s);return o}Hk.tag("li");Hk.tag("li").classAll("task-list-item"),Hk.tag("li").classAll("joplin-checkbox");const AC=fm("UPDATE_LIST_START_COMMAND"),NC=fm("INSERT_UNORDERED_LIST_COMMAND"),TC=fm("INSERT_ORDERED_LIST_COMMAND"),RC=fm("REMOVE_LIST_COMMAND");function DC(e,t){return Kw(e.registerCommand(TC,()=>(oC("number"),!0),1),e.registerCommand(AC,e=>{const{listNodeKey:t,newStart:n}=e,r=Hb(t);return!!wC(r)&&("number"===r.getListType()&&(r.setStart(n),cC(r)),!0)},1),e.registerCommand(NC,()=>(oC("bullet"),!0),1),e.registerCommand(RC,()=>(function(){const e=r_();if(Dy(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(iC(r,n))t.add(tC(r));else for(let e=0;e<n.length;e++){const r=n[e];if($b(r)){const e=iE(r,fC);null!=e&&t.add(tC(e))}}for(const i of t){let t=i;const n=nC(i);for(const r of n){const n=mb().setTextStyle(e.style).setTextFormat(e.format);sC(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&ww(e.anchor,Dw(cw(n,"next"))),r.__key===e.focus.key&&ww(e.focus,Dw(cw(n,"next"))),r.remove()}i.remove()}}}(),!0),1),e.registerCommand(Sm,()=>function(e=!1){const t=r_();if(!Dy(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(vC(n)&&0===n.getChildrenSize())r=n;else if(by(n)){const e=n.getParent();vC(e)&&e.getChildren().every(e=>by(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;const i=tC(r),o=r.getParent();wC(o)||eC(40);const s=o.getParent();let a;if(Dx(s))a=mb(),i.insertAfter(a);else{if(!vC(s))return!1;a=Ix(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=Ix(o).setStart(t);if(vC(a)){const e=Ix(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||!vC(e)&&!wC(e))break;t=e}t.remove()}(r),!0}(!1),1),e.registerCommand(Bm,e=>{if(function(){const e=r_();if(!Dy(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode(),n=SS(t,vC);if(!vC(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(!wC(i)||!n.is(i.getFirstChild()))return!1;const o=i.getPreviousSibling();if(!Z_(o)||o.isIsolated()||!o.isKeyboardSelectable()&&o.isInline())return!1;const s=mb().append(...n.getChildren());return i.insertBefore(s),n.remove(),i.isEmpty()&&i.remove(),s.selectStart(),!0}())return e.preventDefault(),!0;const t=r_();if(!Dy(t)||!t.isCollapsed())return!1;const{anchor:n}=t;if(0!==n.offset)return!1;let r=n.getNode();for(;!vC(r);){if(null!==r.getPreviousSibling())return!1;const e=r.getParent();if(null===e)return!1;r=e}return!(!vC(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(fC,e=>{const t=e.getFirstChild();if(t){if(by(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=r_();Dy(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(uy,e=>{const t=e.getParent();if(vC(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function IC(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(Yv)&&(o=r,s=i,a=l),h.has(Gv))return i=0,r=p,2;h.has(Zv)&&a&&(r=o,i=s,l=a);const g=h.has(Wv)||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(!(Dy(o)&&Dy(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||tb(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)&&by(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!by(c)||!by(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(Vv);if(!o&&n&&h.has(Kv))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!(Dy(o)&&Dy(s)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!by(r)||!by(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 FC(e,t){e.undoStack=[],e.redoStack=[],e.current=null}function OC(e){return function(e,t){let n=e;for(let r=ow(e,t);r&&(QC(r.origin)||Ey(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}(e,"previous")}function PC(e,t){for(const n of e.childNodes){if(Xx(n)&&n.tagName===t)return!0;if(PC(n,t))return!0}return!1}const MC="data-language",LC="data-highlight-language",zC="data-theme";class jC extends J_{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new jC(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=qx().createElement("code");Gw(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(MC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(LC,n));const r=this.getTheme();r&&t.setAttribute(zC,r);const i=this.getStyle();return i&&ny(t.style,i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(MC,r):i&&t.removeAttribute(MC);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&t.setAttribute(LC,r):t.removeAttribute(LC):o&&r&&t.setAttribute(LC,r);const s=this.__theme,a=e.__theme;s?s!==a&&t.setAttribute(zC,s):a&&t.removeAttribute(zC);const l=this.__style,c=e.__style;return l!==c&&ny(t.style,l,c),!1}exportDOM(e){const t=qx().createElement("pre");Gw(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(MC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(LC,n));const r=this.getTheme();r&&t.setAttribute(zC,r);const i=this.getStyle();return i&&ny(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||PC(e,"BR"))?{conversion:$C,priority:1}:null,div:()=>({conversion:qC,priority:1}),pre:()=>({conversion:$C,priority:0}),table:e=>WC(e)?{conversion:GC,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&WC(n)?{conversion:VC,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&WC(t)?{conversion:VC,priority:3}:null}}}static importJSON(e){return UC().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(!WE(iS(),"@lexical/code")){const t=function(e){const{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){const e=t.getNode();if(BC(e)){const n=e.getChildrenSize();if(n>=2&&t.offset===n){const t=e.getLastChild();if(ub(t)&&ub(t.getPreviousSibling())){const t=mb();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(by(i)){let e=OC(i);const t=[];for(;;)if(Ey(e))t.push(wy()),e=e.getNextSibling();else{if(!QC(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(XC(" ".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=[cb(),...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(BC(i)){const{offset:t}=e.anchor;i.splice(t,0,[cb()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=mb();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 UC(e,t){return xS(jC).setLanguage(e).setTheme(t)}function BC(e){return e instanceof jC}function $C(e){return{node:UC(e.getAttribute(MC))}}function qC(e){const t=e,n=KC(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(KC(t))return!0;t=t.parentElement}return!1}(t)?{node:n?UC():null}:{node:null}}function GC(){return{node:UC()}}function VC(){return{node:null}}function KC(e){return null!==e.style.fontFamily.match("monospace")}function WC(e){return e.classList.contains("js-file-line-container")}class HC extends uy{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new HC(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 Gw(t,JC(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=JC(n.theme,e.__highlightType),o=JC(n.theme,this.__highlightType);return i!==o&&(i&&Vw(t,i),o&&Gw(t,o)),r}static importJSON(e){return XC().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 UC()}}function JC(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function XC(e="",t){return Fx(new HC(e,t))}function QC(e){return e instanceof HC}const YC="data-language";function ZC(e){return null!==e.style.fontFamily.match("monospace")}function eA(e){let t=e.parentElement;for(;null!==t;){if(ZC(t))return!0;t=t.parentElement}return!1}Hk.tag("tr","td"),Hk.tag("pre"),Hk.tag("code");Hk.tag("div"),Hk.tag("div","br");Hk.tag("div");Hk.tag("table").classAll("js-file-line-container"),Hk.tag("td").classAll("js-file-line");const tA=new Set(["http:","https:","mailto:","sms:","tel:"]);let nA=class e extends J_{__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=qx().createElement("a");return this.updateLinkDOM(null,t,e),Gw(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Jx(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:rA,priority:1})}}static importJSON(e){return iA().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=dA(e);try{const t=new URL(dA(e));if(!tA.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&&!tA.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=Ix(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Dy(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 rA(e){let t=null;if(Jx(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=iA(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function iA(e="",t){return Fx(new nA(e,t))}function oA(e){return e instanceof nA}let sA=class e extends nA{__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?qx().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return aA().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=aA(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function aA(e="",t){return Fx(new sA(e,t))}function lA(e){return e instanceof sA}function cA(e,t){if("element"===e.type){const n=e.getNode();return X_(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 uA=/^\+?[0-9\s()-]{5,}$/;function dA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:uA.test(e)?`tel:${e}`:`https://${e}`}function fA(e,t,n=null){const r=$x(n),i=n?Ux(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=wx(n)}return!1}(o.offsetNode,n))return{node:o.offsetNode,offset:o.offset}}if(o){const i=n.getRootNode();if(zx(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 hA(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.`)}Hk.tag("a");const pA={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};const gA=(e,t)=>{if(!Dy(t))return t.insertRawText(e),!0;const n=e=>{const t=r_();Dy(t)&&e(t)};return f_(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([wy()])),text:e=>n(t=>t.insertText(e))}),!0},mA={"application/x-lexical-editor":[(e,t,n)=>{try{const n=iS(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return CA(n,function(e){const t=[];for(const n of e)t.push(z_(n));return t}(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{const n=iS(),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 CA(n,Xk(n,r),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[gA],"text/uri-list":[gA]};function vA(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 yA(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)&&vA(e.$importMimeType[i],o,n,t))return!0}return!1}const _A={$importMimeType:mA,$insertDataTransfer:(e,t)=>yA({$importMimeType:mA,priority:pA},e,t),priority:pA},bA=Uw({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>yA(t,e,n),priority:t.priority}),config:Bw({$importMimeType:mA,priority:pA}),mergeConfig(e,t){const n=$w(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 xA(e,t=r_()){return null==t&&hA(166),Dy(t)&&t.isCollapsed()||0===t.getNodes().length?"":Qk(e,t)}function SA(e,t=r_()){return null==t&&hA(166),Dy(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=tx(),i=Dy(t)?t.anchor.getNode():Fy(t)?t.getNodes()[0]??null:null,o=null!==i?RS(i):null,s=(X_(o)?o:r).getChildren();for(let a=0;a<s.length;a++)AA(e,t,s[a],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}function wA(e,t,n){(function(){const e=function(e){return WE(iS(),e)}(bA.name);return e?e.output:_A})().$insertDataTransfer(e,t)}const EA="application/x-lexical-drag";function kA(e,t){return function(e,t,n){const r=e.dataTransfer;if(null===r)return!1;const i=function(e){const t=e.getData(EA);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=fA(e.clientX,e.clientY,t.getRootElement());if(null===n)return null;const r=Yb(n.node);if(null===r)return null;if(by(r))return sw(r,"next",n.offset);if(X_(r))return Pw(r,n.offset,"next");const i=r.getParent();return null===i?null:Pw(i,r.getIndexWithinParent()+1,"next")}(e,t);if(null===o)return!1;const s=zw(o);if(null===s)return!1;const a=i.editorKey===t.getKey(),l=r_();if(a){if(!Dy(l)||l.isCollapsed())return!1;if(function(e,t){const{anchor:n,focus:r}=Ow(Cw(t),"next");return vw(n,e)<0&&vw(e,r)<0}(o,l))return e.preventDefault(),!0;l.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(n(r,Ew(pw(s)),t),!a){const e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(const n of Bx(t)){const t=Mb(n);if(Ob(t)&&t.getKey()===e&&Xx(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,wA)}function CA(e,t,n){e.dispatchCommand(pm,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Dy(e)&&e.isCollapsed()){let t=null;const n=Sw(e.anchor,"previous");if(n)if(ZS(n))t=n.origin;else{const e=gw(n,cw(tx(),"next").getFlipped());for(const n of e){if(by(n.origin)){t=n.origin;break}if(X_(n.origin)&&!n.origin.isInline())break}}if(t&&by(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 AA(e,t,n,r=[]){let i=null===t||n.isSelected(t);const o=X_(n)&&n.excludeFromCopy("html");let s=n;null!==t&&by(s)&&(s=Xw(t,s,"clone"));const a=X_(s)?s.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&hA(58,n.name),X_(e)){const e=t.children;Array.isArray(e)||hA(59,n.name)}return t}(s);by(s)&&0===s.getTextContentSize()&&(i=!1);const c=i&&Fy(t)&&X_(n)?null:t;for(let u=0;u<a.length;u++){const r=a[u],o=AA(e,c,r,l.children);!i&&X_(n)&&o&&n.extractWithChild(r,t,"clone")&&(i=!0)}if(i&&!o){const t=IS(s);if(t.length>0){const n={};for(const r of t){const t=FS(s,r);null===t&&hA(366,s.constructor.name,r);const i=[];AA(e,null,t,i),1===i.length&&i[0].type===t.getType()||hA(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 NA=null;async function TA(e,t,n){if(null!==NA)return!1;if(null!==t)return new Promise((r,i)=>{e.update(()=>{r(RA(e,t,n))})});const r=e.getRootElement(),i=e._window||window,o=i.document,s=Lx(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(Zm,r=>(sE(r,ClipboardEvent)&&(s(),null!==NA&&(i.clearTimeout(NA),NA=null),t(RA(e,r,n))),!0),4);NA=i.setTimeout(()=>{s(),NA=null,t(!1)},50),o.execCommand("copy"),a.remove()})}function RA(e,t,n){if(void 0===n){const t=Lx(e._window),r=r_();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=Vx(t,e.getRootElement()),o=i.anchorNode,s=i.focusNode;if(null!==o&&null!==s&&!Fb(e,o,s))return!1;n=IA(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(FA(r,n),!0)}const DA=[["text/html",xA],["application/x-lexical-editor",SA]];function IA(e=r_()){return function(e,t){const n={"text/plain":""};for(const[r,i]of Object.entries(e))if(i){const e=PA(i,t);null!==e&&(n[r]=e)}return n}(function(e=iS()){const t=WE(e,MA.name);return t?t.output:OA}(),e)}function FA(e,t){for(const[n]of DA)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}const OA={"application/x-lexical-editor":[(e,t)=>e?SA(iS(),e):t()],"text/html":[(e,t)=>e?xA(iS(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function PA(e,t){const n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}const MA=Uw({build:(e,t,n)=>t.$exportMimeType,config:Bw({$exportMimeType:OA}),mergeConfig(e,t){const n=$w(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"});Hk.tag("h1","h2","h3","h4","h5","h6"),Hk.tag("blockquote");Hk.tag("blockquote"),Hk.tag("p"),Hk.tag("span");const LA=fm("DRAG_DROP_PASTE_FILE"),zA=Yp("shadowRoot",{parse:Boolean});class jA extends J_{static getType(){return"quote"}static clone(e){return new jA(e.__key)}$config(){return this.config("quote",{extends:J_,stateConfigs:[{flat:!0,stateConfig:zA}]})}isShadowRoot(){return Zp(this,zA)}setIsShadowRoot(e){return eg(this,zA,e)}createDOM(e){const t=qx().createElement("blockquote");return Gw(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:VA,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Xx(t)){this.isEmpty()&&t.append(qx().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 UA().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){const n=mb(),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=mb();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function UA(e){const t=Fx(new jA);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function BA(e){return e instanceof jA}let $A=class e extends J_{__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=qx().createElement(t),r=e.theme.heading;if(void 0!==r){Gw(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:GA,priority:0}),h2:e=>({conversion:GA,priority:0}),h3:e=>({conversion:GA,priority:0}),h4:e=>({conversion:GA,priority:0}),h5:e=>({conversion:GA,priority:0}),h6:e=>({conversion:GA,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&qA(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>qA(e)?{conversion:e=>({node:KA("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Xx(t)){this.isEmpty()&&t.append(qx().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 KA(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?mb():KA(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=mb();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){const e=mb();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function qA(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function GA(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=KA(t),fS(e,n),pS(n,e),hS(n,e)),{node:n}}function VA(e){const t=UA();return pS(t,e),fS(e,t),hS(t,e),{node:t}}function KA(e="h1"){return Fx(new $A(e))}function WA(e){return Z_(Yb(e))}function HA(e,t,n,r){let i=!1,o=null;if(e.isCollapsed()&&"text"===e.anchor.type){const t=e.anchor.getNode();if(by(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&&by(o)&&o.hasFormat(n)))continue;s=!0}e.hasFormat(n)&&e.toggleFormat(n)}s&&e.setStyle("")}const JA={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function XA(e,t){return function(e,t){if(!e.isCollapsed())return!1;const n=Sw(e.focus,t),r=SS(n.origin,Rx);if(!r)return!1;const i=e.focus.getNode();if(!r.is(i)&&!Cx(i,r))return!1;const o=gw(n,ow(r,t));if(o.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;const s=gw(o.anchor.getSiblingCaret(),o.focus);let a=s.anchor.origin;for(const c of s){if(!ew(c)||!c.origin.is(a.getParent()))return!1;a=c.origin}let l=r;for(const c of hw(ow(r,t))){if(!c.origin.is(l.getParent())){if(Px(c.origin)){const e=ow(l,t);return Ew(gw(e,e)),!0}break}if(!Rx(c.origin))break;l=c.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||"element"!==e.anchor.type)return!1;const n=Sw(e.anchor,t).getNodeAtCaret();return!(!Rx(n)||n.isInline()||(Ew(pw(Dw(cw(n,t)))),0))}(e,t)}function QA(e){return Z_(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function YA(e){const t=t_();t.add(e),nx(t)}function ZA(e,t){if(!e.isCollapsed())return!1;const n=e.focus,r=n.getNode(),i=t?"previous":"next",o=Sw(n,i);if("element"===n.type&&X_(r)&&(tb(r)||Rx(r))){const e=o.getNodeAtCaret();return!(null===e||!QA(e)||(YA(e.__key),0))}const s=SS(X_(r)?r:r.getParentOrThrow(),e=>X_(e)&&!e.isInline()&&Dx(e.getParent()));if(null===s)return!1;const a=ow(s,i).getNodeAtCaret();if(null===a||!QA(a))return!1;if(0===s.getTextContentSize())return YA(a.__key),!0;const l=iS().getRootElement();if(null===l)return!1;const c=Lx(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 eN(c,u,d,f,h),!1;const m=Yb(p);return eN(c,u,d,f,h),null!==m&&((p===u&&g===d||!m.is(s)&&!Cx(m,s))&&(YA(a.__key),!0))}function eN(e,t,n,r,i){null!==t&&null!==r&&e.setBaseAndExtent(t,n,r,i)}function tN(e,t){if(!e.isCollapsed())return!1;const n=e.focus.getNode(),r=SS(X_(n)?n:n.getParentOrThrow(),e=>X_(e)&&!e.isInline());if(null===r)return!1;const i=iS(),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(X_(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=ow(r,t?"previous":"next").getNodeAtCaret();if(null===l||!X_(l)){if(t){const e=r.getFirstDescendant();by(e)?e.select(0,0):r.select(0,0)}else{const e=r.getLastDescendant();if(by(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=Lx(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=fA(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(by(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 nN(e,t){const n=ow(e,t),r=n.getAdjacentCaret();null!==r&&X_(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Ew(pw(n)):"next"===t?e.selectNext(0,0):e.selectPrevious()}function rN(e,t,n){n.preventDefault(),n.stopPropagation();const r=e.getNodes();if(0===r.length)return!0;const i=r.map(e=>ow(e,"next")).sort(vw),o=(t?i[0]:i[i.length-1]).origin,s=SS(o,e=>e!==o&&X_(e)&&!e.isInline())??tx(),a=t?0:s.getChildrenSize();return s.select(a,a),!0}function iN(e,t=function(e,t){return new bE(e,t)}(JA)){return Kw(e.registerCommand(gm,()=>{const e=r_();return Fy(e)?(e.clear(),!0):(Dy(e)&&HA(e,"click","both",t.peek()),!1)},0),e.registerCommand(bm,e=>{const t=r_();return Dy(t)?(t.deleteCharacter(e),!0):!!Fy(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(Cm,e=>{const t=r_();return!!Dy(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(Am,e=>{const t=r_();return!!Dy(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(wm,e=>{const t=r_();if("string"==typeof e)null!==t&&t.insertText(e);else{if(null===t)return!1;const n=e.dataTransfer;if(null!=n)wA(n,t);else if(Dy(t)){const n=e.data;return n&&t.insertText(n),!0}}return!0},0),e.registerCommand(km,()=>{const e=r_();return!!Dy(e)&&(e.removeText(),!0)},0),e.registerCommand(Nm,e=>{const t=r_();return!(!Dy(t)&&!Fy(t)||(Py(t,e),0))},0),e.registerCommand(Tm,e=>{const t=r_();return!(!Dy(t)&&!Fy(t)||(function(e,t){const n=[];for(const[r,i]of Object.entries(t))"boolean"==typeof i&&n.push([r,i]);0!==n.length&&Oy(e,e=>{for(const[t,r]of n)e=Bb(e,t,r?bp[t]:0);return e})}(t,e),0))},0),e.registerCommand(Jm,e=>{const t=r_();if(!Dy(t)&&!Fy(t))return!1;const n=t.getNodes();for(const r of n){const t=SS(r,e=>X_(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},0),e.registerCommand(xm,e=>{const t=r_();return!!Dy(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Sm,()=>{const e=r_();return!!Dy(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(Vm,()=>{const e=wy(),t=r_();return Dy(t)&&(e.setFormat(t.format),e.setStyle(t.style)),function(e){let t=r_()||i_();null===t&&(t=tx().selectEnd()),t.insertNodes(e)}([e]),!0},0),e.registerCommand(Km,()=>lE(e=>{const t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Wm,()=>lE(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(Lm,e=>{const t=r_();if(Fy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),nN(n[0],"previous"),!0}else if(Dy(t)){if(!e.shiftKey&&XA(t,"previous"))return e.preventDefault(),!0;if(!e.shiftKey&&ZA(t,!0))return e.preventDefault(),!0;if(!e.shiftKey&&tN(t,!0))return e.preventDefault(),!0}return!1},0),e.registerCommand(zm,e=>{const t=r_();if(Fy(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),nN(n[0],"next"),!0}else if(Dy(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===tx().getChildrenSize()}(t))return e.preventDefault(),!0;if(!e.shiftKey&&XA(t,"next"))return e.preventDefault(),!0;if(!e.shiftKey&&ZA(t,!1))return e.preventDefault(),!0;if(!e.shiftKey&&tN(t,!1))return e.preventDefault(),!0}return!1},0),e.registerCommand(Pm,e=>{const n=r_();if(Fy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),nN(t[0],Jw(t[0])?"next":"previous"),!0}if(!Dy(n))return!1;if(!e.shiftKey&&XA(n,Jw(n.anchor.getNode())?"next":"previous"))return e.preventDefault(),!0;if(e.shiftKey||HA(n,"arrow","start",t.peek()),tE(n,!0)){const t=e.shiftKey;return e.preventDefault(),rE(n,t,!0),!0}return!1},0),e.registerCommand(Fm,e=>{const n=r_();if(Fy(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),nN(t[0],Jw(t[0])?"previous":"next"),!0}if(!Dy(n))return!1;if(!e.shiftKey&&XA(n,Jw(n.anchor.getNode())?"previous":"next"))return e.preventDefault(),!0;if(e.shiftKey||HA(n,"arrow","end",t.peek()),tE(n,!1)){const t=e.shiftKey;return e.preventDefault(),rE(n,t,!1),!0}return!1},0),e.registerCommand(Bm,t=>{const n=r_();if(!Fy(n)&&WA(t.target))return!1;if(Dy(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(tb(n))return!1;const r=oE(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Wm,void 0);if(np&&tp)return!1}else if(!Fy(n))return!1;return t.preventDefault(),e.dispatchCommand(bm,!0)},0),e.registerCommand(qm,t=>{const n=r_();return!(!Fy(n)&&WA(t.target))&&!(!Dy(n)&&!Fy(n))&&(t.preventDefault(),e.dispatchCommand(bm,!1))},0),e.registerCommand(jm,n=>{let r=r_();if(Fy(r)){const e=r.getNodes();1===e.length&&Z_(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Dy(r))return!1;if(HA(r,"enter","both",t.peek()),null!==n){if((np||ip||ap)&&tp)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(xm,!1)}return e.dispatchCommand(Sm,void 0)},0),e.registerCommand($m,()=>!!Dy(r_())&&(e.blur(),!0),0),e.registerCommand(Hm,t=>{const[,n]=aE(t);if(n.length>0){const r=fA(t.clientX,t.clientY,e.getRootElement());if(null!==r){const{offset:t,node:i}=r,o=Yb(i);if(null!==o){const e=e_();if(by(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")}nx(pg(e))}e.dispatchCommand(LA,n)}return t.preventDefault(),!0}return kA(t,e)},0),e.registerCommand(Xm,t=>{const[n]=aE(t),r=r_();return!(n&&!Dy(r)||(Dy(r)&&!r.isCollapsed()&&null!==t.dataTransfer&&(FA(t.dataTransfer,IA(r)),function(e,t){const n={editorKey:t.getKey()};e.setData(EA,JSON.stringify(n))}(t.dataTransfer,e)),0))},0),e.registerCommand(Qm,t=>{const[n]=aE(t),r=r_();if(n&&!Dy(r))return!1;const i=fA(t.clientX,t.clientY,e.getRootElement());if(null!==i){Z_(Yb(i.node))&&t.preventDefault()}return!0},0),e.registerCommand(tv,()=>{const e=r_();return function(e){const t=tx();if(Dy(e)){const t=e.anchor,n=e.focus,r=t.getNode();if(tb(r))return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),pg(e),e;const i=r.getTopLevelElementOrThrow(),o=i.getParent();if(null===o)return X_(i)&&(t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),pg(e)),e;const s=o;return t.set(s.getKey(),0,"element"),n.set(s.getKey(),s.getChildrenSize(),"element"),pg(e),e}{const e=t.select(0,t.getChildrenSize());nx(pg(e))}}(Dy(e)&&null!==RS(e.anchor.getNode())?e:null),!0},0),e.registerCommand(Zm,t=>(TA(e,sE(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(ev,t=>(async function(e,t){await TA(t,sE(e,ClipboardEvent)?e:null),t.update(()=>{const e=r_();Dy(e)?e.removeText():Fy(e)&&e.getNodes().forEach(e=>e.remove())},{tag:"cut"})}(t,e),!0),0),e.registerCommand(Em,t=>{const[,n,r]=aE(t);return n.length>0&&!r?(e.dispatchCommand(LA,n),!0):(!Qx(t.target)||!Ib(t.target))&&(null!==r_()&&(function(e,t){e.preventDefault(),t.update(()=>{const t=r_(),n=sE(e,InputEvent)||sE(e,KeyboardEvent)?null:e.clipboardData;null!=n&&null!==t&&wA(n,t)},{tag:Wv})}(t,e),!0))},0),e.registerCommand(Um,()=>{const e=r_();return Dy(e)&&HA(e,"space","both",t.peek()),!1},0),e.registerCommand(Gm,()=>{const e=r_();return Dy(e)&&HA(e,"tab","both",t.peek()),!1},0),e.registerCommand(Om,e=>{const t=r_();if(Fy(t))return rN(t,!1,e);if(!Dy(t))return!1;const{anchor:n}=t;if("element"!==n.type||0!==n.offset)return!1;const r=n.getNode();if(!X_(r))return!1;const i=r.getFirstChild();if(!Z_(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(Mm,e=>{const t=r_();if(Fy(t))return rN(t,!0,e);if(!Dy(t))return!1;const{anchor:n,focus:r}=t,i=SS(r.getNode(),e=>X_(e)&&!e.isInline());if(null===i)return!1;const o=i.getFirstChild();if(!Z_(o)||!o.isInline())return!1;if(SS(n.getNode(),e=>X_(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 oN(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 sN(e){const t=oN(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const aN=/[!-/:-@[-`{-~\s]/,lN=/\s/,cN=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,uN=/^\s{0,3}$/;function dN(e){if(!vb(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&by(t)&&uN.test(t.getTextContent())}function fN(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}const hN=/^(\s*)(\d{1,})\.\s/,pN=/^(\s*)[-*+]\s/,gN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,mN=/^(#{1,6})\s/,vN=/^>\s/,yN=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,_N=/^[ \t]*`{3,}$/,bN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,xN=/^(?:\|)(.+)(?:\|)\s?$/;function SN(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 wN=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,EN=/^<\/[a-z_][\w-]*\s*>/i,kN=e=>new RegExp(`(?:${e.source})$`,e.flags),CN=Yp("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),AN=Yp("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),NN=Yp("mdHardLineBreak",{parse:e=>"string"==typeof e&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function TN(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function RN(e){const t=cb(),n=function(e){const t=e.getChildren(),n=t.length-1,r=t[n];if(!by(r))return null;const i=r.getTextContent(),o=TN(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(ub(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(""),i):null}(e);return null!==n&&eg(t,NN,n),t}const DN=e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},IN=e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),a=mC("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==CN.parse(l)?void 0:l;if(wC(s)&&s.getListType()===e){c&&eg(s,CN,c);const n=s.getFirstChild();null!==n?n.insertBefore(a):s.append(a),"number"===e&&s.setStart(Number(r[2])),t.remove()}else if(wC(o)&&o.getListType()===e)c&&eg(o,CN,c),o.append(a),t.remove();else{const n=SC(e,"number"===e?Number(r[2]):void 0);c&&eg(n,CN,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)},FN=(e,t,n,r)=>{const i=[],o=e.getChildren();let s=0;for(const a of o)if(vC(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if(wC(e)){const o=FN(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=Zp(e,CN),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")},ON={dependencies:[$A],export:(e,t)=>{if(!function(e){return e instanceof $A}(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:mN,replace:DN(e=>KA("h"+e[1].length)),triggerOnEnter:!0,type:"element"},PN={dependencies:[jA],export:(e,t)=>{if(!BA(e))return null;const n=t(e).split("\n"),r=[];for(const i of n)r.push("> "+i);return r.join("\n")},regExp:vN,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(BA(n))return n.splice(n.getChildrenSize(),0,[RN(n),...t]),void e.remove()}const i=UA();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:"element"},MN={dependencies:[jC],export:e=>{if(!BC(e))return null;const t=e.getTextContent();let n=Zp(e,AN);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]="",MN.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),MN.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),MN.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:_N},regExpStart:yN,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=UC(c),a=i[0]):(s=UC(c),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=UC(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")}eg(s,AN,l);const t=_y(a);s.append(t),e.append(s)}else t&&DN(e=>UC(e?e[2]:void 0))(e,t,n,o)},type:"multiline-element"},LN={dependencies:[yC,fC],export:(e,t,n)=>wC(e)?FN(e,t,0,n):null,regExp:pN,replace:IN("bullet"),triggerOnEnter:!0,type:"element"},zN={dependencies:[yC,fC],export:(e,t,n)=>wC(e)?FN(e,t,0,n):null,regExp:hN,replace:IN("number"),triggerOnEnter:!0,type:"element"},jN={dependencies:[nA],export:(e,t,n)=>{if(!oA(e)||lA(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(SS(e,oA))return;const[,n,r,i]=t,o=iA(null!=r?fN(r):void 0,{title:null!=i?fN(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=_y(l);return u.setFormat(e.getFormat()),o.append(u),e.replace(o),c&&o.insertBefore(_y(c)),u},trigger:")",type:"text-match"},UN=[...[ON,PN,LN,zN],...[MN],...[{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"}],...[jN]];function BN(e,t,n,r,i){for(const o of t){if(!o.export)continue;const t=o.export(e,e=>$N(e,n,r,void 0,void 0,i));if(null!=t)return t}return X_(e)?$N(e,n,r,void 0,void 0,i):Z_(e)?e.getTextContent():null}function $N(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=>$N(e,t,n,r,[...i,...r],o),(e,n)=>GN(e,n,t,r,i,o));if(null!=a){s.push(a);continue e}}ub(l)?s.push(qN(l)):by(l)?s.push(GN(l,l.getTextContent(),t,r,i,o)):X_(l)?s.push($N(l,t,n,r,i,o)):Z_(l)&&s.push(l.getTextContent())}return s.join("")}function qN(e){return Zp(e,NN)+"\n"}function GN(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=VN(e,!0),m=VN(e,!1),v=new Set;for(const y of n){const t=y.format[0],n=y.tag;"code"!==t&&WN(e,t)&&!v.has(t)&&(v.add(t),WN(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=KN(e,r[y].format),n=KN(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 VN(e,t){const n=t?e.getPreviousSibling():e.getNextSibling();return by(n)?n:null}function KN(e,t){return by(e)&&e.hasFormat(t)}function WN(e,t){return!(!KN(e,t)||"code"!==t&&e&&/^\s*$/.test(e.getTextContent()))}function HN(e,t,n,r,i){if(!JN(t,n,r,i))return!1;if("*"===e)return!0;if("_"===e){if(!JN(t,n,r,!i))return!0;const e=i?t[n-1]:t[n+r];return void 0!==e&&cN.test(e)}return!0}function JN(e,t,n,r){const i=e[t-1],o=e[t+n],[s,a]=r?[o,i]:[i,o];return void 0!==s&&!lN.test(s)&&(!cN.test(s)||void 0===a||lN.test(a)||cN.test(a))}function XN(e){return by(e)&&!e.hasFormat("code")}function QN(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=HN(t,e,a,n,!0),c=HN(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);XN(i.nodeAfter)&&QN(i.nodeAfter,t,n),XN(i.nodeBefore)&&QN(i.nodeBefore,t,n),XN(i.transformedNode)&&QN(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;XN(r.nodeAfter)&&QN(r.nodeAfter,t,n),XN(r.nodeBefore)&&QN(r.nodeBefore,t,n),XN(r.transformedNode)&&QN(r.transformedNode,t,n)}const o=fN(e.getTextContent());e.setTextContent(o)}function YN(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 ZN(e,t,n,r,i,o){const s=_y(e),a=mb();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(QN(s,r,i),null!==a.getParent()&&e.length>0){const e=a.getPreviousSibling();if(!o&&(vb(e)||BA(e)||wC(e))){let t=e;if(wC(e)){const n=e.getLastDescendant();t=null==n?null:SS(n,vC)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[RN(t),...a.getChildren()]),a.remove())}}}function eT(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(wy())})}function tT(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 nT(e,t,n,r,i){if(!Dx(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 rT(e,t,n,r,i){if(!Dx(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 iT(e,t){let n=0;const r=e.getTextContent();for(let i=0;i<t;i++)"`"===r[i]&&n++;return n%2!=0}function oT(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(sT(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function sT(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function aT(e,t=UN,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?TN(e):null,c=void 0!==a&&null!==TN(a);if(bN.test(s))i.push(s);else if(0===r){{const e=s.match(yN);if(e){r=e[1].trim().length,i.push(s);continue}}""===s||""===a||!a||mN.test(a)||mN.test(s)||vN.test(s)||hN.test(s)||pN.test(s)||gN.test(s)||xN.test(s)||SN(s)||c||!t||wN.test(s)||EN.test(s)||kN(EN).test(a)||kN(wN).test(a)||_N.test(a)?i.push(!t&&""!==s||null!==l?e:s):i[i.length-1]=a+" "+(null===l?s:e).trimStart()}else{if(_N.test(s)&&s.trim().length>=r){r=0,i.push(s);continue}i.push(e)}}return i.join("\n")}(e,i),s=tx();s.clear(),function(e,t,n,r=!1){const i=sN(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]=YN(s,c,i.multilineElement,t);n?c=a:ZN(e,t,i.element,o,i.textMatch,r)}const l=t.getChildren();for(const c of l)if(!r&&dN(c)&&t.getChildrenSize()>1)c.remove();else if(X_(c))for(const e of c.getAllTextNodes())eT(e)}(o,s,t,r),null!==r_()&&s.selectStart()}function lT(e=UN,t,n=!1){const r=function(e,t=!1){const n=sN(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||tx()).getChildren();for(let l=0;l<a.length;l++){const e=a[l],c=BN(e,r,o,n.textMatch,t);null!=c&&s.push(i&&l>0&&!dN(e)&&!dN(a[l-1])?"\n".concat(c):c)}return s.join("\n")}}(e,n);return r(t)}let cT=[$A,jA,yC,fC,nA,jC];function uT(e){return"var("+e+")"}let dT=co([gi("flex"),_i("wrap"),di("center"),ui("gap","2px"),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),fT=co([ui("background","none"),ui("border","1px solid transparent"),ui("border-radius",uT(St.sm)),ui("color",uT(_t.textSecondary)),ui("font-family","inherit"),ui("font-size",uT(xt.sizeSm)),ui("line-height","1"),ui("min-width","26px"),ui("padding","5px 6px"),pi("pointer"),Yi([ui("background",uT(_t.surfaceSubtle))])]),hT=co([ui("background",uT(_t.surfaceSubtle)),ui("border-color",uT(_t.border)),ui("color",uT(_t.textPrimary))]),pT=co([Pi(.4),pi("notAllowed")]),gT=co([ui("width","1px"),ui("align-self","stretch"),ui("background",uT(_t.borderSubtle)),ui("margin","2px 4px")]),mT=co([gi("flex"),di("center"),ui("gap",uT(bt.xs)),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),vT=co([vi(1),ui("background",uT(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",uT(St.sm)),ui("color",uT(_t.textPrimary)),ui("font-family","inherit"),ui("font-size",uT(xt.sizeSm)),ui("padding","3px 6px"),ui("outline","none"),Xi([ui("border-color",uT(_t.brand))])]);let yT={bold:!1,italic:!1,code:!1},_T=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=r_();null!=t&&Dy(t)&&Yw(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?fT+" "+pT:o?fT+" "+hT:fT,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=r_();if(null===s||!Dy(s)&&!Fy(s))return;if(Fy(s)){const e=s.getNodes();if(0===e.length)return;return void e.forEach(e=>{if(null===n){const t=SS(e,e=>!lA(e)&&oA(e));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=SS(e,e=>!lA(e)&&oA(e));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==o&&t.setRel(o);else{const t=iA(n,{rel:o,target:r});e.insertBefore(t),t.append(e)}}})}if(s.isCollapsed()&&null===n)for(const u of s.getNodes()){const e=SS(u,e=>!lA(e)&&oA(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=SS(t,e=>!lA(e)&&oA(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())||X_(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=Ix(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=SS(e,oA);if(null!==t)return c(t)}!function(e){const t=r_();if(!Dy(t))return e();const n=pg(t),r=n.isBackward(),i=cA(n.anchor,r?-1:0),o=cA(n.focus,r?0:-1);if(e(),i||o){const e=r_();if(Dy(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")}nx(pg(t))}}}(()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const s=SS(t,oA);if(s){c(s);continue}if(X_(t)){if(!t.isInline())continue;if(oA(t)){if(!(lA(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();oA(a)&&a.is(e)?a.append(t):(e=iA(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(Nm,"bold")),p("I","Italic",n.italic,()=>f(Nm,"italic")),p("</>","Inline code",n.code,()=>f(Nm,"code")),i("span",{className:gT}),p("H1","Heading 1",void 0,()=>h(()=>KA("h1"))),p("H2","Heading 2",void 0,()=>h(()=>KA("h2"))),p("¶","Paragraph",void 0,()=>h(()=>mb())),i("span",{className:gT}),p("•","Bulleted list",void 0,()=>f(NC,void 0)),p("1.","Numbered list",void 0,()=>f(TC,void 0)),p("“","Quote",void 0,()=>h(()=>UA())),p("🔗","Link",void 0,()=>u(e=>$(e)?void 0:"")),i("span",{className:gT}),p("↩","Undo",void 0,()=>f(Rm,void 0)),p("↪","Redo",void 0,()=>f(Dm,void 0))],"aria-label":"Formatting",className:dT,role:"toolbar"}),void 0!==d?r("div",{children:[i("input",{"aria-label":"Link URL",className:vT,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:mT}):null]})};let bT={contents:void 0};function xT(e){let t=function(){let e=bT.contents;if(void 0!==e)return D(e);let t=Sb({namespace:"reventless-rich-text-probe",nodes:cT,onError:e=>{}});return bT.contents=T(t),t}(),n={contents:""};return t.update(()=>{aT(e,UN)},{discrete:!0}),t.read(()=>{n.contents=lT(UN)}),n.contents}function ST(e){return"var("+e+")"}let wT=co([gi("flex"),mi("column"),ui("background",ST(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",ST(St.sm)),ui("box-sizing","border-box"),ui("transition","border-color 120ms"),Vi({NAME:"percent",VAL:100}),Mi("hidden"),Qi([ui("border-color",ST(_t.brand))])]),ET=co([ui("border-color",ST(_t.error)),Qi([ui("border-color",ST(_t.error))])]),kT=co([gi("flex"),di("center"),ui("gap","2px"),ui("justify-content","flex-end"),ui("padding","var("+bt.xs+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]);let CT=co([ui("background",ST(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("color",ST(_t.textSecondary)),ui("font-size",ST(xt.sizeXs)),ui("line-height",ST(xt.lineHeightNormal)),ui("padding","var("+bt.xs+") var("+bt.sm+")")]),AT=co([Ui("relative"),gi("flex"),mi("column")]),NT=co([Ui("absolute"),ui("top","var("+bt.sm+")"),ui("left","var("+bt.sm+")"),ui("color",ST(_t.textDisabled)),ui("font-size",ST(xt.sizeSm)),ui("pointer-events","none"),ui("user-select","none")]);function TT(e){return co([ui("color",ST(_t.textPrimary)),ui("font-size",ST(xt.sizeSm)),ui("line-height",ST(xt.lineHeightRelaxed)),ui("min-height",e),ui("outline","none"),ui("padding",ST(bt.sm)),ui("word-break","break-word"),ui("overflow-y","auto"),ui("tab-size","4")])}let RT=co([ui("margin","0 0 var("+bt.sm+")")]),DT=co([ui("font-size",ST(xt.sizeXl)),ui("font-weight",ST(xt.weightBold)),ui("line-height",ST(xt.lineHeightTight)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),IT=co([ui("font-size",ST(xt.sizeLg)),ui("font-weight",ST(xt.weightBold)),ui("line-height",ST(xt.lineHeightTight)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),FT=co([ui("font-size",ST(xt.sizeMd)),ui("font-weight",ST(xt.weightBold)),ui("margin","var("+bt.sm+") 0 var("+bt.xs+")")]),OT=co([ui("border-left","3px solid var("+_t.border+")"),ui("color",ST(_t.textSecondary)),ui("margin","var("+bt.xs+") 0"),ui("padding-left",ST(bt.md))]),PT=co([ui("margin","var("+bt.xs+") 0"),ui("padding-left","1.5em")]),MT=co([ui("margin","2px 0")]),LT=co([ui("color",ST(_t.brand)),ui("text-decoration","underline")]),zT=co([ui("font-weight",ST(xt.weightBold))]),jT=co([ui("font-style","italic")]),UT=co([ui("text-decoration","line-through")]),BT=co([ui("background",ST(_t.surfaceSubtle)),ui("border-radius",ST(St.sm)),ui("font-family",ST(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("padding","1px 4px")]),$T=co([ui("background",ST(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",ST(St.md)),ui("display","block"),ui("font-family",ST(xt.fontFamilyMono)),ui("font-size","0.9em"),ui("margin","var("+bt.xs+") 0"),ui("padding",ST(bt.sm)),ui("white-space","pre-wrap")]);function qT(e){return co([ui("background","transparent"),ui("border","none"),ui("color",ST(_t.textPrimary)),ui("font-family",ST(xt.fontFamilyMono)),ui("font-size",ST(xt.sizeSm)),ui("line-height",ST(xt.lineHeightNormal)),ui("min-height",e),ui("outline","none"),ui("padding",ST(bt.sm)),ui("resize","vertical"),ui("box-sizing","border-box"),Vi({NAME:"percent",VAL:100})])}let GT=Object.fromEntries([["paragraph",RT],["quote",OT],["link",LT],["code",$T],["heading",Object.fromEntries([["h1",DT],["h2",IT],["h3",FT]])],["list",Object.fromEntries([["ul",PT],["ol",PT],["listitem",MT]])],["text",Object.fromEntries([["bold",zT],["italic",jT],["strikethrough",UT],["code",BT]])]]);let VT=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(()=>yT),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(()=>Sb({namespace:"reventless-rich-text",nodes:cT,onError:e=>{console.error("[RichTextEditor] Lexical error — the document may be incomplete:",e)},theme:GT}),[]),P=e=>{D.current=e,R.current=e,I.current=!0,A(t=>function(e){return""!==e.trim()&&e.trimEnd()!==xT(e).trimEnd()}(e)),O.update(()=>{aT(e,UN)})},M=()=>{let e=(()=>{let e={contents:""};return O.read(()=>{e.contents=lT(UN)}),e.contents})();return k(t=>""===e.trim()),w(e=>{let t={contents:yT};return O.read(()=>{let e=r_();null!=e&&Dy(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=Kw(iN(O),DC(O),function(e,t,n,r=Date.now,i,o=null){const s=IC(e,n,r);return Kw(e.registerCommand(Rm,()=>(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(iv,!0)),0===r.length&&e.dispatchCommand(ov,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Gv})}}(e,t),!0),0),e.registerCommand(Dm,()=>(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(ov,!0));const o=n.pop();0===n.length&&e.dispatchCommand(iv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Gv})}}(e,t),!0),0),e.registerCommand(nv,()=>(FC(t),!1),0),e.registerCommand(rv,()=>(FC(t),e.dispatchCommand(iv,!1),e.dispatchCommand(ov,!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(iv,!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(ov,!0)}}else if(2===h)return;t.current={editor:e,editorState:n}}))}(O,{current:null,redoStack:[],undoStack:[]},300),function(e,t=UN){const n=sN(t),r=n.element.filter(e=>e.triggerOnEnter),i=oN(n.textFormat,({tag:e})=>e[e.length-1]),o=oN(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)||tT(173,n.getType())}}const a=(e,t,r)=>!!(nT(e,t,r,n.element)||rT(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&&!sT(r,s,t,0,n))continue;if(" "===r[s-1])continue;const l=r[i+1];if(!1===a.intraword&&l&&!aN.test(l))continue;const c=e;let u=c,d=oT(r,s,t),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!ub(f);)if(by(f)){if(f.hasFormat("code"))continue;const e=f.getTextContent();u=f,d=oT(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&&!aN.test(p))continue;if(!a.format.includes("code")&&iT(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=r_(),_=e_();nx(_);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,bp[e]);_.anchor.set(_.focus.key,_.focus.offset,_.focus.type);for(const e of a.format)_.hasFormat(e)&&_.toggleFormat(e);return Dy(y)&&(_.format=y.format),!0}return!1}(t,r,i));return Kw(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Hv)||t.has(Gv))return;if(e.isComposing())return;const o=t.has(Zv),l=r.read(r_),c=i.read(r_);if(!Dy(c)||!Dy(l)||!l.isCollapsed()||l.is(c)&&!o)return;const u=l.anchor.key,d=l.anchor.offset,f=r._nodeMap.get(u);if(by(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(!XN(f))return;const e=f.getParent();null===e||BC(e)||a(e,f,l.anchor.offset)&&kx(Vv)})}}),e.registerCommand(jm,e=>{if(null!==e&&e.shiftKey)return!1;const t=r_();if(!Dy(t)||!t.isCollapsed())return!1;const i=t.anchor.offset,o=t.anchor.getNode();if(!by(o)||!XN(o))return!1;const s=o.getParent();return null!==s&&!BC(s)&&!(i!==o.getTextContent().length||!rT(s,o,i,n.multilineElement,!0)&&!nT(s,o,i,r,!0)||(null!==e&&e.preventDefault(),0))},1))}(O,UN),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,co([ui("background",n?ST(_t.surfaceSubtle):"transparent"),ui("border","1px solid "+(n?ST(_t.border):"transparent")),ui("border-radius",ST(St.sm)),ui("color",ST(n?_t.textPrimary:_t.textSecondary)),ui("font-family","inherit"),ui("font-size",ST(xt.sizeXs)),ui("padding","2px var("+bt.sm+")"),pi("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:TT(m),contentEditable:!y,role:"textbox",spellCheck:!0,onBlur:e=>f(),suppressContentEditableWarning:!0}),E[0]&&!y?i("div",{children:g,className:NT}):null],className:AT}):i("textarea",{"aria-label":"Markdown source",className:qT(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:kT}),!y&&L?i(_T,{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:CT}):null,z],className:v?wT+" "+ET:wT})};function KT(e){return"var("+e+")"}let WT=co([gi("inlineFlex"),di("center"),xi("center"),ui("background",KT(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("color",KT(_t.textDisabled))]),HT=uo([WT,co([ui("width","24px"),ui("height","24px"),ui("border-radius",KT(St.sm)),ui("font-size",KT(xt.sizeSm)),ui("vertical-align","middle")])]),JT=uo([WT,co([ui("border-radius",KT(St.md)),ui("font-size",KT(xt.sizeSm))])]),XT=uo([JT,co([mi("column"),ui("gap",KT(bt.xs)),ui("aspect-ratio","4 / 3")])]),QT=uo([JT,co([mi("row"),ui("gap",KT(bt.sm)),ui("padding","var("+bt.sm+") var("+bt.md+")")])]),YT=co([ui("width","240px"),ui("max-width","100%")]),ZT=co([ui("width","100%")]),eR=co([ui("width","100%"),ui("height","100%"),ui("aspect-ratio","auto")]),tR=co([ui("font-size","20px"),ui("line-height","1")]),nR=co([ui("position","absolute"),ui("width","1px"),ui("height","1px"),ui("padding","0"),ui("margin","-1px"),Mi("hidden"),ui("clip","rect(0, 0, 0, 0)"),ui("white-space","nowrap"),ui("border","0")]);function rR(e){return"Media"===e?"⬚":"▤"}function iR(e){switch(e){case"Thumb":case"Detail":return YT;case"Tile":return ZT;case"Fill":return eR}}let oR=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?XT:QT,"Media"===s?"Thumb"===a?i("span",{children:rR(s),"aria-label":l,className:HT,role:"img",title:l}):r("span",{children:[i("span",{children:rR(s),"aria-hidden":!0,className:tR}),l],"aria-label":l,className:uo([t,iR(a)]),role:"img"}):r("span","Thumb"===a?{children:[i("span",{children:rR(s),"aria-hidden":!0}),i("span",{children:l,className:nR})],className:HT,title:l}:{children:[i("span",{children:rR(s),"aria-hidden":!0,className:tR}),l],className:uo([t,iR(a)])})};function sR(e){return"var("+e+")"}let aR=co([ui("color",sR(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]),lR=co([gi("inlineBlock"),ui("width","12px"),ui("height","12px"),ui("border-radius","3px"),ui("border","1px solid var("+_t.border+")"),ui("vertical-align","-1px")]),cR=co([gi("inlineFlex"),di("center"),ui("gap","6px")]),uR=co([ui("height","24px"),ui("width","24px"),ui("object-fit","cover"),ui("border-radius",sR(St.sm)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("vertical-align","middle")]),dR=co([ui("max-height","160px"),ui("max-width","240px"),ui("object-fit","cover"),ui("border-radius",sR(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),pi("zoomIn")]),fR=co([ui("color",sR(_t.error)),ui("font-size",sR(xt.sizeXs)),ui("font-weight",sR(xt.weightMedium)),ui("white-space","nowrap"),Ai(to(6))]),hR=co([gi("inlineBlock"),ui("background",sR(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius","3px"),ui("color",sR(_t.textSecondary)),ui("font-size",sR(xt.sizeXs)),ui("font-weight",sR(xt.weightMedium)),ui("letter-spacing","0.03em"),ui("padding","1px 4px"),ui("line-height","1.2")]),pR=co([ui("color",sR(_t.textSecondary))]),gR=co([ui("color",sR(_t.warning)),ui("font-weight",sR(xt.weightMedium))]),mR=co([ui("color",sR(_t.textSecondary)),ui("font-weight",sR(xt.weightNormal))]),vR=co([gi("inlineBlock"),ui("background",sR(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius","3px"),ui("color",sR(_t.textSecondary)),ui("font-size",sR(xt.sizeXs)),ui("padding","1px 4px"),ui("line-height","1.2")]),yR=co([gi("inlineBlock"),ui("background",sR(_t.surfaceSubtle)),ui("border-radius",sR(St.full)),ui("width","64px"),ui("height","6px"),Mi("hidden")]);function _R(e){return co([ui("background",sR(_t.brand)),ui("border-radius",sR(St.full)),ui("height","100%"),ui("width",e.toString()+"%")])}let bR=co([ui("color",sR(_t.textSecondary)),ui("font-size",sR(xt.sizeXs)),ui("font-variant-numeric","tabular-nums")]),xR=co([ui("width","220px"),ui("max-width","100%")]),SR=co([gi("flex"),mi("column"),ui("gap","1px"),ui("line-height","1.35")]),wR=co([ui("background","none"),ui("border","none"),ui("padding","0"),pi("zoomIn")]),ER=co([gi("inlineFlex"),ui("background","none"),ui("border","none"),ui("padding","0"),ui("line-height","0"),ui("max-width","100%"),pi("pointer"),Yi([ui("opacity","0.75")])]),kR=co([gi("flex"),mi("column"),ui("gap",sR(bt.xs)),ui("width","100%")]),CR=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",sR(_t.textSecondary)),ui("font-size",sR(xt.sizeXs)),ui("text-decoration","underline"),pi("pointer"),Yi([ui("color",sR(_t.brand))])]),AR=co([gi("flex"),mi("column"),di("flexStart"),ui("gap","6px")]),NR=co([ui("color",sR(_t.textSecondary)),ui("font-family",sR(xt.fontFamilyMono)),ui("font-size",sR(xt.sizeXs))]),TR=co([gi("inlineBlock"),ui("background","#ffffff"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",sR(St.md)),ui("padding","4px"),ui("line-height","0")]),RR=co([ui("display","block"),ui("max-width","260px"),ui("height","auto")]),DR=co([gi("flex"),di("center"),ui("gap",sR(bt.xs))]);function IR(e){return co([ui("background",sR(_t.surface)),ui("border","1px solid var("+(e?_t.error:_t.border)+")"),ui("border-radius",sR(St.sm)),ui("color",sR(_t.textPrimary)),ui("font-family","inherit"),ui("font-size",sR(xt.sizeSm)),ui("padding","6px 8px")])}let FR=co([ui("flex","1 1 auto"),ui("min-width","0")]),OR=co([ui("flex","0 0 auto")]),PR=co([gi("inlineFlex"),di("center"),ui("gap","6px")]);function MR(e){return co([ui("color",sR(e?_t.error:_t.textSecondary)),ui("font-size",sR(xt.sizeXs)),ui("font-variant-numeric","tabular-nums")])}let LR=co([gi("flex"),mi("column"),ui("gap","4px")]),zR=co([gi("flex"),di("center"),ui("gap",sR(bt.xs))]);function jR(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function UR(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 BR(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 $R(e){let t=BR(e);return void 0!==t?D(t).resolvedOptions().maximumFractionDigits:2}function qR(e,t){let n=e*Math.pow(10,$R(t));return n<0?-Math.round(-n):Math.round(n)}function GR(e,t){let n=BR(t);return void 0!==n?D(n).format(e/Math.pow(10,$R(t))):UR(e)+" "+t}function VR(e){return j(ht(e),e=>{let t=j(Xe(e,"amount"),ft),n=j(Xe(e,"currency"),dt);if(void 0!==t&&void 0!==n)return[t,n]})}function KR(e){let t=e.toFixed(2).replace(/\.?0+$/,"");return(""===t||"-"===t?"0":t)+"%"}function WR(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 HR(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 JR(e){return j(ht(e),e=>{let t=t=>j(j(Xe(e,t),dt),e=>""===e?void 0:e),n=t("start"),r=t("end");if(void 0!==n&&void 0!==r)return[n,r]})}function XR(e,t){let n=pc(e),r=pc(t);return void 0!==n&&void 0!==r?r<n?"Ends before it starts":void 0:"Not a date-time"}function QR(e,t){let n=pc(e),r=pc(t);if(void 0!==n&&void 0!==r&&r>=n)return HR((r-n)/1e3)}function YR(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 ZR(e){return/^[A-Za-z]{2}$/.test(e)}function eD(e){if(ZR(e))return e.toUpperCase().split("").map(e=>U(e.codePointAt(0),65)+127397|0).map(e=>String.fromCodePoint(e)).join("")}let tD={contents:void 0};function nD(e){if(!ZR(e))return e;let t=function(){let e,t=tD.contents;if(void 0!==t)return D(t);try{e=T(new Intl.DisplayNames(["en"],{type:"region"}))}catch(n){e=void 0}return tD.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 rD=["street","streetaddress","line1","addressline1","address1"],iD=["line2","addressline2","address2","apartment","unit","suite"],oD=["postalcode","zip","zipcode","postcode"],sD=["city","town","locality"],aD=["state","region","province","county"],lD=["country","countrycode"];function cD(e){let t=ut(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=Qe(t._0),r=e=>j(n.find(t=>e.includes(t[0].toLowerCase())),e=>function(e){let t=ut(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(oD),o=r(sD),s=void 0!==i?void 0!==o?i+" "+o:i:void 0!==o?o:void 0,a=me([r(rD),r(iD),s,r(aD),r(lD)],e=>e).map(e=>e.trim()).filter(e=>""!==e);return 0===a.length?void 0:a;default:return}}function uD(e){let t=eD(e);return void 0!==t?t+" "+nD(e):e}function dD(e){let t=e.toFixed(5).replace(/\.?0+$/,"");return""===t||"-"===t?"0":t}function fD(e){return L(z(Ra(e,"maximum"),e=>0|e),5,e=>e<=0?5:e)}function hD(e,t){let n=Ra(e,"maximum");return void 0!==n&&n>0&&n<=1?t/n*100:t}let pD={};function gD(e,t){pD[ra(e)]=t}function mD(e,t){return j(za(e,t),e=>Xe(pD,ra(e.semantic)))}function vD(e,t,n){return j(mD(e,t),r=>r.cell(e,t,n))}function yD(e,t,n){return j(mD(e,t),r=>r.detail(e,t,n))}function _D(e,t){return j(ja(e,t),e=>Xe(pD,ra(e.semantic)))}function bD(e){e.stopPropagation()}function xD(e,t,n){return i("a",n?{children:t,className:aR,href:e,rel:"noopener noreferrer",target:"_blank",onClick:bD}:{children:t,className:aR,href:e,onClick:bD})}function SD(e){return j(dt(e),e=>""===e?void 0:e)}function wD(e){let t=(t,n,r)=>z(SD(r),e);return{cell:t,detail:t}}function ED(e){let t=(t,n,r)=>z(ft(r),t=>e(t));return{cell:t,detail:t}}function kD(e){let t=e.size,n=e.kind,r=function(e){return j(d(Zs),t=>t(e))}(e.field);if(void 0===r)return i(oR,{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(oR,{kind:n,size:t,label:o[1]}),className:ER,title:o[0],type:"button",onClick:e=>{e.stopPropagation(),r()}})}function CD(e){let t=e.alt,n=e.src,a=s(()=>!1);if(void 0===n)return i(kD,{field:e.field,kind:"Media",size:"Detail"});let l=a[1];return r(o,{children:[i("button",{children:i("img",{className:dR,alt:t,src:n}),className:wR,title:"Click to enlarge",onClick:e=>{e.stopPropagation(),l(e=>!0)}}),a[0]?i(Ql,{slides:[{key:n,src:n,title:t}],index:0,onIndexChange:e=>{},onClose:()=>l(e=>!1)}):null]})}function AD(e){let t=ut(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 ND(e,t,n){return j(SD(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(Ho,{name:t=e,size:"Small"}),t],className:cR});var t})}function TD(e,t){let n=He(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:hR}):null,i("a",{children:t,className:aR,download:"",href:n,rel:"noopener noreferrer",target:"_blank",onClick:bD})],className:cR})}function RD(e){let t=e.name,n=e.href,o=s(()=>!1),a=o[1],l=o[0];return r("span",{children:[r("span",{children:[TD(n,t),bc(n)?i("button",{children:l?"Hide preview":"Preview","aria-expanded":l,className:CR,type:"button",onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null],className:cR}),l?i(xc,{src:He(n),title:t,height:"60vh"}):null],className:kR})}function DD(e,t,n){return z(VR(n),e=>{return t=e[0],n=e[1],i("span",{children:GR(t,n),className:bR});var t,n})}function ID(e){return 0===e.length||e.includes("EUR")?"EUR":U(e[0],"EUR")}function FD(e,t){return function(e,t){return qR(e,t)/Math.pow(10,$R(t))}(e,t).toFixed($R(t))}function OD(e){let t=e.hasError,n=e.onBlur,o=e.onChange,a=e.value,l=U(j(xa(e.propSchema).find(e=>"currency"===e[0].toLowerCase()),e=>$s(e[1])),[]);let c;if(""===a)c=void 0;else try{c=VR(JSON.parse(a))}catch(v){c=void 0}let u=s(()=>{if(void 0===c)return["",ID(l)];let e=c[1];return[FD(c[0]/Math.pow(10,$R(e)),e),e]}),d=u[0],f=d[1],h=d[0],p=u[1],g=(e,t)=>{p(n=>[e,t]);let n=na(e);o(void 0!==n&&""!==t&&Number.isFinite(n)?JSON.stringify(Ze([["amount",qR(n,t)],["currency",t]])):"")},m=e=>{let t=na(h);g(void 0!==t&&""!==e?FD(t,e):h,e)};return r("span",{children:[i("input",{"aria-label":"Amount",className:IR(t)+" "+FR,inputMode:"decimal",placeholder:FD(0,f),type:"text",value:h,onBlur:e=>(()=>{let e=na(h);if(void 0!==e){let t=FD(e,f);t!==h&&p(e=>[t,f])}n()})(),onChange:e=>{let t=e.target.value.replaceAll(",",".");if(function(e,t){let n=$R(t),r=0===n?"^-?[0-9]*$":"^-?[0-9]*([.][0-9]{0,"+n.toString()+"})?$";return new RegExp(r).test(e)}(t,f))return g(t,f)}}),0===l.length?i("input",{"aria-label":"Currency",className:IR(t)+" "+OR,placeholder:"EUR",value:f,onBlur:e=>n(),onChange:e=>m(e.target.value)}):i("select",{children:l.map(e=>i("option",{children:e,value:e},e)),"aria-label":"Currency",className:IR(t)+" "+OR,value:f,onBlur:e=>n(),onChange:e=>m(e.target.value)})],className:DR})}function PD(e,t,n){return z(JR(n),e=>function(e,t){let n=XR(e,t),o=QR(e,t),s=void 0!==n?n:void 0!==o?o:"";return r("span",{children:[U(ys(e),e)+" → "+U(ys(t),t),""===s?null:i("span",{children:s,className:MR($(n))})],className:PR})}(e[0],e[1]))}function MD(e){if(""===e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t.toISOString()}function LD(e){let t=ms(e);return t===e?"":t.slice(0,10)+"T"+t.slice(11,16)}function zD(e){let t,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value;if(""===a)t=void 0;else try{t=JR(JSON.parse(a))}catch(g){t=void 0}let l,c=void 0!==t?[LD(t[0]),LD(t[1])]:["",""],u=c[1],d=c[0],f=(e,t)=>{let n=MD(e),r=MD(t);s(void 0!==n&&void 0!==r?JSON.stringify(Ze([["start",n],["end",r]])):"")},h=MD(d),p=MD(u);if(void 0!==h&&void 0!==p){let e=XR(h,p);l=void 0!==e?[e,!0]:[U(QR(h,p),""),!1]}else l=["start and end",!1];return r("span",{children:[r("span",{children:[i("input",{"aria-label":"Start",className:IR(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:IR(n),type:"datetime-local",value:u,onBlur:e=>o(),onChange:e=>f(d,e.target.value)})],className:zR}),i("span",{children:l[0],className:MR(l[1])})],className:LR})}function jD(e){let t=eD(e);return void 0!==t?r("span",{children:[i("span",{children:t,"aria-hidden":!0}),nD(e)],className:cR}):e}function UD(e,t,n){return z(SD(n),jD)}function BD(e,t,n){return z(function(e){return j(ht(e),e=>{let t=t=>j(Qe(e).find(e=>t(e[0].toLowerCase())),e=>ft(e[1])),n=t(Oa),r=t(Pa);if(void 0!==n&&void 0!==r)return[n,r]})}(n),e=>dD(e[0])+", "+dD(e[1]))}gD("Email",wD(e=>xD("mailto:"+e,e,!1))),gD("Phone",wD(e=>xD("tel:"+e,e,!1))),gD("Url",{cell:(e,t,n)=>z(SD(n),e=>xD(e,jR(e,40),!0)),detail:(e,t,n)=>z(SD(n),e=>xD(e,e,!0))}),gD("Currency",ED(UR)),gD("Percent",ED(KR)),gD("Bytes",ED(WR)),gD("Duration",ED(HR)),gD("Color",wD(e=>r("span",{children:[i("span",{className:lR,style:{background:e}}),e],className:cR}))),gD("Image",{cell:(e,t,n)=>z(AD(n),t=>void 0!==t?i("img",{className:uR,alt:e,src:He(t),onClick:bD}):i(kD,{field:e,kind:"Media",size:"Thumb"})),detail:(e,t,n)=>z(AD(n),t=>i(CD,{src:z(t,He),alt:e,field:e}))}),gD("UserRef",{cell:ND,detail:ND}),gD("Markdown",{cell:(e,t,n)=>z(SD(n),e=>jR(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(SD(n),e=>i(fh,{source:e})),input:(e,t,n,r,o,s,a)=>i(VT,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&function(e){return""===e.trim()}(n))return"Required"}}),gD("Rating",{cell:(e,t,n)=>z(ft(n),e=>i(Dc,{value:e,max:fD(t)})),detail:(e,t,n)=>z(ft(n),e=>i(Dc,{value:e,max:fD(t),size:"Medium",showValue:!0})),input:(e,t,n,r,o,s,a)=>i(Dc,{value:U(na(n),0),max:fD(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=na(n);if(void 0===i)return"Invalid rating";let o=fD(t);return i<0||i>o?"Must be between 0 and "+o.toString():void 0}}),gD("Progress",{cell:(e,t,n)=>z(ft(n),e=>{let n=function(e){return e<0?0:e>100?100:e}(hD(t,e));return r("span",{children:[i("span",{children:i("span",{className:_R(n)}),className:yR}),i("span",{children:Math.round(n).toString()+"%",className:bR})],className:cR})}),detail:(e,t,n)=>z(ft(n),e=>i("div",{children:i(jc,{value:hD(t,e)}),className:xR}))}),gD("FileUrl",{cell:(e,t,n)=>z(SD(n),e=>TD(e,jR(YR(e),40))),detail:(e,t,n)=>z(SD(n),e=>i(RD,{href:e,name:YR(e)}))}),gD("File",{cell:(e,t,n)=>z(AD(n),t=>void 0!==t?TD(t,jR(YR(t),40)):i(kD,{field:e,kind:"Document",size:"Thumb"})),detail:(e,t,n)=>z(AD(n),t=>void 0!==t?i(RD,{href:t,name:YR(t)}):i(kD,{field:e,kind:"Document",size:"Detail"}))}),gD("Money",{cell:DD,detail:DD,input:(e,t,n,r,o,s,a)=>i(OD,{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(s){i=null}let o=VR(i);return void 0!==o?function(e,t){if(!Number.isFinite(e))return"Invalid amount";if(e===Math.trunc(e))return;let n=$R(t);return 0===n?t+" has no decimal places":t+" has "+n.toString()+" decimal places"}(o[0],o[1]):"Invalid amount"}}),gD("DateRange",{cell:PD,detail:PD,input:(e,t,n,r,o,s,a)=>i(zD,{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=JR(i);return void 0!==o?XR(o[0],o[1]):"Invalid range"}}),gD("Country",{cell:UD,detail:UD}),gD("Address",{cell:(e,t,n)=>z(function(e){return z(cD(e),e=>e.map(e=>ZR(e)?nD(e):e).join(", "))}(n),e=>jR(e,60)),detail:(e,t,n)=>z(cD(n),e=>i("span",{children:e.map((e,t)=>i("span",{children:uD(e)},t.toString())),className:SR}))});let $D={cell:BD,detail:BD};gD("GeoPoint",$D);let qD="Located — this query selected only which arm the value is in, not the coordinates";function GD(e){let t=j(Is(e).channel,e=>function(e){return L(Xe(Uc,e),qc,e=>e.constraints)}(e).maxLength),n=function(e){return z(j(j(ht(e),e=>Xe(e,"maxLength")),ft),e=>0|e)}(e);return void 0!==t?void 0!==n?t<n?t:n:t:n}function VD(e){return"var("+e+")"}gD("Geolocation",{cell:function(e,t,n){return z(va(n),e=>{switch(e.TAG){case"Pending":return i("span",{children:"Locating…",className:pR});case"Located":let t=ya(e);return void 0!==t?dD(t[0])+", "+dD(t[1]):i("span",{children:"Located",className:vR,title:qD});case"Unresolvable":return i("span",{children:"Not located",className:gR,title:U(_a(e),"No reason given")})}})},detail:function(e,t,n){return z(va(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:mR}):null],className:pR});case"Located":let n=ya(e);return void 0!==n?dD(n[0])+", "+dD(n[1]):i("span",{children:"Located",className:vR,title:qD});case"Unresolvable":let o=_a(e);return r("span",{children:["Not located",void 0!==o?i("span",{children:" "+o,className:mR}):null],className:gR})}})}}),gD("ChannelText",{cell:(e,t,n)=>z(SD(n),e=>{let n=j(GD(t),t=>{if(ph(e)>t)return ph(e)-t|0});return r("span",{children:[jR(e,80),void 0!==n?i("span",{children:n.toString()+" over",className:fR}):null]})}),detail:(e,t,n)=>{let r=SD(n),o=Is(t).channel;if(void 0!==r&&void 0!==o)return i(Hh,{channelId:o,message:{body:r}})},input:(e,t,n,r,o,s,a)=>{let l=j(Is(t).channel,$c);return i(Ih,{value:n,onChange:r,onBlur:o,maxLength:GD(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(GD(t),e=>{let t=ph(n);if(t>e)return Rh(t-e|0)+" over the "+e.toString()+"-character limit"})}),gD("Qr",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(SD(n),e=>r("span",{children:[i(Rl,{value:e}),i("span",{children:e,className:NR})],className:AR}))}),gD("Barcode",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(SD(n),e=>r("span",{children:[i(zl,{value:e}),i("span",{children:e,className:NR})],className:AR}))}),gD("Signature",{cell:(e,t,n)=>j(SD(n),e=>{if(nu(e))return i("span",{children:"✓ Signed",className:bR})}),detail:(e,t,n)=>j(SD(n),e=>{if(nu(e))return i("span",{children:i("img",{className:RR,alt:"Signature",src:ru(e)}),className:TR})}),input:(e,t,n,r,o,s,a)=>i(iu,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&""===n)return"Required"}});let KD=co([gi("inlineFlex"),di("center"),_i("wrap"),ui("gap","4px"),ui("font-size",VD(xt.sizeSm)),ui("min-width","0")]),WD=co([ui("color",VD(_t.textDisabled)),ui("font-size",VD(xt.sizeXs))]),HD=co([ui("color",VD(_t.brand)),ui("text-decoration","none"),Yi([ui("text-decoration","underline")])]),JD=co([ui("color",VD(_t.textPrimary))]);let XD=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:HD,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:JD}),s?null:i("span",{children:" › ",className:WD})]},o.toString()+":"+e.label)}),className:KD})};function QD(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function YD(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function ZD(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function eI(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 tI(e,t,n){let r=Lt(t);if("compositeId"===e)return"KCompositeId";let i=Ft(r);if(void 0!==i)return{TAG:"KUnion",_0:i};let o=$s(r);if(void 0!==o)return{TAG:"KEnum",_0:o};let s=QD(r),a=0;if(void 0!==s)switch(s){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(r);if(void 0===t)return"KArrayOfStrings";if(ZD(t)||vt(QD(t),"object"))return{TAG:"KArrayOfObjects",_0:t};let n=eI(e);return void 0!==n?{TAG:"KArrayOfEntityIds",_0:n}:"KArrayOfStrings";case"boolean":return"KBoolean";case"integer":case"number":return"KNumber";case"object":return ZD(r)?{TAG:"KNestedObject",_0:r}:"KString";default:a=1}else a=1;if(1===a){let t=YD(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=eI(e);return void 0!==t?{TAG:"KEntityId",_0:t}:"KString"}}}function nI(e,t,n){let r=Wa(t,e);return void 0!==n&&void 0!==r&&n.pluginId===r.pluginId&&n.viewName===r.name}function rI(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 iI(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 oI(e,t){let n=Is(t),r=tI(e,t,n),i=U(j(j(ht(t),e=>Xe(e,"title")),dt),lt(e));return{key:e,label:i,kind:r,ann:n,propSchema:t,priority:rI(e,r,n),width:iI(r,e)}}function sI(e,t,n,r,i,o){let s,a=void 0!==t?t:"List",l=void 0!==n?n:[],c=U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[]),u=Os(e),d="List"===a&&0!==u.length,f=P(B(i,Ua(e,void 0,void 0).labelField),e=>"id"!==e),h=me(c,e=>{let t,n=e[0],i=oI(n,e[1]),s=i.kind;if("object"!=typeof s)t=!1;else switch(s.TAG){case"KEntityId":case"KArrayOfEntityIds":t=nI(s._0,l,r);break;default:t=!1}let a=vt(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)?vt(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(Ps(e),t),t("compositeId")),t("id")),[],e=>[oI(e[0],e[1])])}else s=h;return s.toSorted((e,t)=>e.priority-t.priority|0)}function aI(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function lI(e){return i(Ss,{variant:"Neutral",label:e,dot:!1})}function cI(e,t,n,r,i){let o=Wa(n,e);return void 0===o||void 0!==i&&(i.pluginId===o.pluginId&&i.viewName===o.name)?[void 0,t]:[Qa(o.pluginId,o.name,t,[]),t]}function uI(e,t,n,r){let i=Wa(n,e);return void 0!==i?t?nt(i.name):tt(i.name):r}function dI(e,t,n){let r=e.kind;if("object"!=typeof r)return e.label;switch(r.TAG){case"KEntityId":let i=r._0;return nI(i,t,n)?e.label:uI(i,!1,t,e.label);case"KArrayOfEntityIds":let o=r._0;return nI(o,t,n)?e.label:uI(o,!0,t,e.label);default:return e.label}}function fI(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 hI(e,t,n,o,s,a,l,c,u){let d=void 0!==u&&u,f=nI(t,o,l),h=U(c,Aa(t)),p=e=>{let n,s,c=cI(t,e,o,0,l),u=c[1],d=f?[u,!1]:fI(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(cs,{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(Ho,{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=ut(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,dt),c=s.length===e.length?(e=>{let n=me(e,e=>{let n=cI(t,e,o,0,l)[1],r=fI(t,n,a)[0];if(r!==n)return{name:r}});if(d&&h&&!f&&e.length>=2&&n.length===e.length)return i(Ys,{members:n,size:"Small"})})(s):void 0;return void 0!==c?c:i("span",{children:e.map((t,n)=>{let i=ut(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 pI(e,t,n){let r=ut(n);if("object"!=typeof r)switch(r){case"JSONFalse":return i(Ss,{variant:"Neutral",label:"No",dot:!1});case"JSONTrue":return i(Ss,{variant:"Success",label:"Yes",dot:!1});case"JSONNull":return"—"}else switch(r.TAG){case"JSONString":let i=r._0,o=bs(e,i);if(void 0===t)return void 0!==o?o:i;switch(t){case"date":case"date-time":return ms(i);default:return void 0!==o?o:i}case"JSONNumber":return r._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(n)}}function gI(e,t,n,o,s,a){let l=ht(t);if(void 0===l)return;let c=Xe(l,"name");if(void 0!==c&&"JSONNull"!==ut(c))return pI("name",void 0,c);let u=sI(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=Xe(l,e.key);if(!t)return;if(void 0===r)return;let i=ut(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=pI(l.key,"KDate"===c?YD(l.propSchema):void 0,o);else switch(c.TAG){case"KEnum":let e=ut(o);i="object"!=typeof e||"JSONString"!==e.TAG?pI(l.key,void 0,o):lI(e._0);break;case"KEntityId":i=hI(l.key,c._0,o,n,0,s,a,void 0,void 0);break;default:i=pI(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 mI(e,t,n,o,s,a,l,c,u){let d=void 0!==s?s:Es,f=P(o,e=>"JSONNull"!==ut(e));if(void 0===f)return U(function(e,t){return vD(e,t,null)}(e,n),"—");let h=vD(e,n,f);if(void 0!==h)return h;if("object"!=typeof t)switch(t){case"KCompositeId":return function(e){let t=ut(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(XD,{segments:n})}(f);case"KDate":return pI(e,YD(n),f);case"KBoolean":case"KNumber":return pI(e,void 0,f);case"KString":let t=ut(f);if("object"!=typeof t)return pI(e,void 0,f);if("JSONString"!==t.TAG)return pI(e,void 0,f);let r=t._0;return r.length>60?i("span",{children:aI(r,60),title:r}):pI(e,void 0,f);case"KArrayOfStrings":let o=U(z(pt(f),e=>me(e,dt)),[]);return i(Zo,{items:o})}else switch(t.TAG){case"KEnum":let n=ut(f);return"object"!=typeof n||"JSONString"!==n.TAG?pI(e,void 0,f):lI(n._0);case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":let o=t._0,s=U(pt(f),[]),h=s.length;if(d.collapsed){let e=s[0];return void 0!==e?vI(o,e,a,l,c,u):i(ps,{count:h,label:"items"})}let p=j(s[0],e=>gI(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(ps,{count:h,label:"items"});case"KNestedObject":let g=t._0;if(d.collapsed)return vI(g,f,a,l,c,u);let m=gI(g,f,a,0,c,u);if(void 0!==m)return m;let v=U(z(ht(f),e=>Object.keys(e).length),0);return i(ps,{count:v,label:"fields"});case"KUnion":return function(e,t,n,i,o,s){let a=ma(t);if(void 0===a)return JSON.stringify(t);let l=a[1],c=a[0],u=Pt(e,c),d=L(u,c,e=>e.tag),f=U(j(u,e=>gI(Mt(e),l,n,0,o,s)),null);return r("span",{children:[lI(d),f],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}})}(t._0,f,a,0,c,u)}let p=L(za(e,n),!1,e=>"UserRef"===e.semantic);return hI(0,t._0,f,a,0,c,u,!!p||void 0,!0)}function vI(e,t,n,o,s,a){let l=U(ht(t),{}),c=sI(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:dI(e,n,a),style:{fontSize:"0.85em",minWidth:"80px",opacity:"0.55"}}),i("span",{children:mI(e.key,e.kind,e.propSchema,Xe(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 yI(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 _I(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=dI(e,t,l),d=L(za(e.key,e.propSchema),!1,e=>"Image"===e.semantic||"File"===e.semantic);return{key:e.key,label:s,render:s=>{let f=mI(e.key,e.kind,e.propSchema,o(s,e.key),e.ann,t,n,a,l),p=void 0!==c&&d?i(ta,{fill:e=>c(s,e),children:f}):f;if(void 0===u)return p;if($(u.values)&&e.key===u.field){let e=Vs(u,o(s,u.field));return void 0!==e?e:p}if(void 0!==u.values)return p;if(!vt(h,e.key))return p;let g=Vs(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&&yI(e.kind),width:e.width}})}function bI(e){return(t,n)=>e(t,n).then(e=>e.data)}let xI=l(void 0),SI=l(void 0),wI={contents:void 0},EI=xI.Provider,kI=SI.Provider;let CI=function(e){let t=e.executeResult,n=e.execute,r=p(()=>void 0!==n?n:void 0!==t?bI(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(EI,{value:r,children:c(kI,{value:t,children:e.children})})};function AI(){return d(xI)}function NI(){return d(SI)}let TI={hasNextPage:!1,hasPreviousPage:!1,startCursor:void 0,endCursor:void 0};function RI(e,t){let n=ht(e),r=j(j(j(n,e=>Xe(e,"data")),ht),e=>Xe(e,t));return void 0!==r?r:j(n,e=>Xe(e,t))}function DI(e,t){let n=RI(e,t),r=j(n,pt);return void 0!==r?r:me(U(j(j(j(n,ht),e=>Xe(e,"edges")),pt),[]),e=>j(ht(e),e=>Xe(e,"node")))}function II(e,t){return me(DI(e,t),ht)}function FI(e,t){let n=(e,t)=>U(j(Xe(e,t),gt),!1),r=(e,t)=>j(Xe(e,t),dt);return L(j(j(j(RI(e,t),ht),e=>Xe(e,"pageInfo")),ht),TI,e=>({hasNextPage:n(e,"hasNextPage"),hasPreviousPage:n(e,"hasPreviousPage"),startCursor:r(e,"startCursor"),endCursor:r(e,"endCursor")}))}let OI=[];let PI={};function MI(e,t,n,r){return j(Wa(n,t),t=>j(Xe(e,t.queryField),e=>Xe(e.labels,r)))}function LI(e,t,n,r){return j(Wa(n,t),t=>j(t.namedRetirement,n=>j(j(Xe(e,t.queryField),e=>Xe(e.states,r)),e=>{let t=n.values;return Vs(n,void 0===t||e)})))}function zI(e,t,n,r,i){if(i)return!0;let o=Wa(n,t);if(void 0===o)return!0;let s=Xe(e,o.queryField);return void 0===s||q(Xe(s.states,r))}function jI(e,t,n,r){let i=Wa(n,t);if(void 0===i)return!1;let o=Xe(e,i.queryField);return!(void 0===o||!o.loaded||!L(o.asked,!0,e=>$(Xe(e,r))))&&q(Xe(o.labels,r))}function UI(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(Xe(e,t),pt),[]),ht)).flat())(e,t.key),sI(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(Xe(e,t),ht)))(e,t.key),sI(a._0,"Drill",n,r,void 0,void 0),s-1|0):void 0;default:return}let l=a._0;if(nI(l,n,r))return;let c=Wa(n,l);void 0===c||e.forEach(e=>M(Xe(e,t.key),e=>{(function(e){let t=ut(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,dt).filter(e=>""!==e);default:return[]}})(e).forEach(e=>{let t=c.queryField,n=U(Xe(i,t),[]);n.some(t=>t===e)||n.push(e),i[t]=n})}))})};return o(e,t,3),i}function BI(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 $I(e,t,n){let r={};return II(e,t).forEach(e=>{let t=j(Xe(e,"id"),dt),i=U(j(Xe(e,n),dt),"");if(void 0===t)return;let o=BI(t),s="id"===n?void 0!==o?o:t:""===i?t:i;r[t]=s,void 0===o||(r[o]=s)}),r}function qI(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(ht(U(j(ht(e),e=>Xe(e,"data")),e)),e=>Xe(e,t+"Refs")),pt))}(t,r)?Promise.resolve(function(e,t){let n={},r={};return U(j(j(ht(U(j(ht(e),e=>Xe(e,"data")),e)),e=>Xe(e,t+"Refs")),pt),[]).forEach(e=>{let t=ht(e);if(void 0===t)return;let i=j(Xe(t,"id"),dt);if(void 0===i)return;let o=U(j(Xe(t,"label"),dt),i),s=U(j(Xe(t,"retired"),gt),!1),a=U(j(Xe(t,"retiredState"),dt),""),l=e=>{n[e]=o,s&&(r[e]=a)};l(i),M(BI(i),l)}),[n,r]}(t,r)):e(a,l).then(e=>[$I(e,r,i),{}]))}let GI=l(void 0);let VI=GI.Provider;let KI={provider:VI,make:function(e){let t=AI(),n=s(()=>PI),r=n[1],i=n[0],o=h({}),a=(e,t)=>r(n=>{let r=Ze(Qe(n)),i=Ze(L(Xe(o.current,e),[],e=>e.ids).map(e=>[e,!0])),s={...t(Xe(n,e))};return s.asked=i,r[e]=s,r}),l=(e,t)=>{let n=Ze(Qe(e));return Qe(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=Xe(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(qI(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=Xe(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)=>{Qe(e).forEach(e=>{let n=e[0],r=Xe(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(VI,{value:y,children:e.children})}},WI={context:GI,use:function(){return d(GI)},useInvalidate:function(){let e=d(GI);return void 0!==e?e.invalidate:e=>{}},Provider:KI};function HI(e,t,n,r,i){let o=void 0===i||i,l=AI(),c=d(GI),u=s(()=>PI),f=u[1],h=o?UI(e,t,n,r):{},p=function(e){return Qe(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&&Qe(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(qI(l,o,r).then(t=>{if(e.contents)return;let n=t[1],r=t[0];f(e=>{let t=Ze(Qe(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=Ze(Qe(e));return t[i]={loaded:!0,labels:{},states:{}},t})),Promise.resolve()))})),()=>{e.contents=!0}},[p,l]),void 0!==c?c.entries:u[0]}let JI={registry:[]},XI="table",QI={contents:[]};function YI(e){QI.contents.some(t=>t.id===e.id)?QI.contents=QI.contents.map(t=>t.id===e.id?e:t):QI.contents=QI.contents.concat([e])}function ZI(e){return QI.contents.find(t=>t.id===e)}function eF(){return QI.contents}function tF(e,t){let n=void 0!==t?t:JI,r=Ua(e,void 0,void 0),i=QI.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===XI).concat(i.filter(e=>e.id!==XI))}function nF(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 rF(e,t,n){let r=void 0!==n?n:"item";return jo(nF(e),function(e){return ge(e,0,(e,t)=>e+t.rows.length|0)}(e),t,r)}function iF(e){try{return R(localStorage.getItem(e))}catch(t){return}}function oF(e,t,n){return"autoui.viewmode."+U(e,"default")+"."+t+L(n,"",e=>"."+e)}function sF(e){return z(iF(e),e=>{let t=function(e){try{return ht(JSON.parse(e))}catch(t){return}}(e);if(void 0===t)return{mode:e};let n=j(Xe(t,"mode"),dt);return void 0!==n?{mode:n,band:j(j(Xe(t,"band"),dt),At.bandOfName)}:{mode:e}})}function aF(e,t,n){let r={};r.mode=t,r.band=At.bandName(n),function(e,t){try{return localStorage.setItem(e,t)}catch(n){return}}(e,JSON.stringify(r))}function lF(e){return"var("+e+")"}let cF=co([gi("inlineFlex"),di("center"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",lF(St.md)),ui("overflow","hidden")]),uF=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("background","none"),ui("border","none"),ui("padding","2px var("+bt.sm+")"),ui("color",lF(_t.textSecondary)),ui("font-size",lF(xt.sizeSm)),pi("pointer"),Yi([ui("background",lF(_t.surfaceSubtle)),ui("color",lF(_t.textPrimary))])]),dF=uo([uF,co([ui("background",lF(_t.surfaceSubtle)),ui("color",lF(_t.textPrimary)),ui("font-weight",lF(xt.weightMedium))])]),fF=co([Hi(At.compact,[ui("display","none")])]);let hF={Style:{group:cF,btn:uF,btnActive:dF,btnLabel:fF},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:fF})],"aria-label":e.label,"aria-pressed":e.id===n?"true":"false",className:e.id===n?dF:uF,title:e.label,onClick:n=>t(e.id)},e.id)),"aria-label":"View mode",className:cF,role:"group"})}};function pF(e){let t=e.source,n=Ka(),r=Ge(),o=sI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=t.rows.map((e,t)=>{let n=U(ht(e),{});return{rowKey:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}}),a=HI(s.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),l=t.refLabels,c=void 0!==l?l:{lookupLabel:(e,t)=>MI(a,e,n,t),isMissing:(e,t)=>jI(a,e,n,t),retiredBadge:(e,t)=>LI(a,e,n,t),linkable:(e,t)=>zI(a,e,n,t,!1)},u=o.map(e=>({key:e.key,label:dI(e,n,t.ownEntity),render:i=>mI(e.key,e.kind,e.propSchema,Xe(i.dict,e.key),e.ann,n,r,c,t.ownEntity),sortable:!1,width:e.width}));return i(Mo,{columns:u,data:s,keyFn:e=>e.rowKey,onRowClick:e=>t.onOpenRow(e.rowKey,e.json)})}let gF=i("span",{children:"▦","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});YI({id:XI,label:"Table",icon:gF,arity:"Single",isCapable:(e,t,n)=>!0,render:e=>{let t=e[0];return void 0!==t?i(pF,{source:t}):null},capability:"always — the universal default"});let mF=["resources","events"],vF=["split","full"],yF=["funnel","scatter"],_F={};function bF(e,t){return j(e.views,e=>Xe(e,t))}function xF(e,t){return j(e.fields,e=>Xe(e,t))}function SF(e,t){console.error("[AutoUI] ui-hints "+e+": "+t)}function wF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.string(r);return void 0!==i?i:void SF(n+"."+t,"expected a string — dropped")}function EF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.bool(r);return void 0!==i?i:void SF(n+"."+t,"expected a boolean — dropped")}function kF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.float(r);return void 0!==i?i===Math.trunc(i)?0|i:void SF(n+"."+t,"expected a whole number — dropped"):void SF(n+"."+t,"expected a number — dropped")}function CF(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.array(r);return void 0!==i?me(i,Je.string):void SF(n+"."+t,"expected an array of strings — dropped")}function AF(e,t,n,r){let i=e[t];if(void 0===i)return;let o=Je.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}SF(n+"."+t,"expected an object — dropped")}function NF(e,t){let n=Je.object(e);if(void 0!==n){let e={};return Object.entries(n).forEach(n=>{let r=n[0],i=Je.string(n[1]);return void 0!==i?void(e[r]=i):SF(t+"."+r,"expected a string — dropped")}),e}SF(t,"expected an object of string values — dropped")}function TF(e,t){let n=Je.object(e);return void 0!==n?{label:wF(n,"label",t),scopedLabel:wF(n,"scopedLabel",t),group:wF(n,"group",t),order:kF(n,"order",t),hidden:EF(n,"hidden",t)}:void SF(t,"expected an object — dropped")}function RF(e,t){let n=Je.object(e);if(void 0!==n){let e,r=n.nav,i=n.rowActions;if(void 0!==i){let n=Je.array(i);void 0!==n?e=ve(n,(e,n)=>function(e,t){let n=Je.object(e);if(void 0!==n){let e=wF(n,"pluginId",t),r=wF(n,"slice",t),i=wF(n,"command",t),o=wF(n,"field",t);return void 0!==e&&void 0!==r&&void 0!==i&&void 0!==o?{label:wF(n,"label",t),pluginId:e,slice:r,command:i,field:o,then:wF(n,"then",t)}:void SF(t,"a row action needs pluginId, slice, command and field — dropped")}SF(t,"expected an object — dropped")}(e,t+".rowActions["+n.toString()+"]")):(SF(t+".rowActions","expected an array of row actions — dropped"),e=void 0)}else e=void 0;let o=n.transitions;return{mode:wF(n,"mode",t),layout:wF(n,"layout",t),canvas:wF(n,"canvas",t),role:wF(n,"role",t),resourceRef:wF(n,"resourceRef",t),accent:wF(n,"accent",t),audit:EF(n,"audit",t),presence:EF(n,"presence",t),related:CF(n,"related",t),nav:void 0!==r?TF(r,t+".nav"):void 0,rowActions:e,suppressRowActions:CF(n,"suppressRowActions",t),retiredLabel:wF(n,"retiredLabel",t),suppress:CF(n,"suppress",t),transitions:void 0!==o?NF(o,t+".transitions"):void 0}}SF(t,"expected an object — dropped")}function DF(e,t){let n=void 0!==e?e:"ui-hints",r=Je.object(t);if(void 0!==r){let e,t=r.dashboard;if(void 0!==t){let r=Je.array(t);void 0!==r?e=ve(r,(e,t)=>function(e,t){let n=Je.object(e);if(void 0!==n){let e=wF(n,"view",t);return void 0!==e?{view:e,label:wF(n,"label",t),field:wF(n,"field",t),aggregate:wF(n,"aggregate",t),viz:wF(n,"viz",t),xField:wF(n,"xField",t)}:void SF(t,"metric without a `view` — dropped")}SF(t,"expected an object — dropped")}(e,n+".dashboard["+t.toString()+"]")):(SF(n+".dashboard","expected an array of metrics — dropped"),e=void 0)}else e=void 0;return{views:AF(r,"views",n,RF),fields:AF(r,"fields",n,NF),dashboard:e}}return SF(n,"expected an object — no hints applied"),_F}function IF(e){let t=Je.object(e);if(void 0!==t){let e={};return Object.entries(t).forEach(t=>{let n=t[0];e[n]=DF('ui-hints["'+n+'"]',t[1])}),e}return SF("ui-hints.json","top-level value is not a {pluginId: hints} object — ignored"),{}}function FF(e){return U(z(j(j(ht(Lt(e)),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function OF(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(ht(Lt(e)),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),Lt),ht),e=>Xe(e,"items"))}(r,n);return void 0!==i?{TAG:"Ok",_0:{schema:i}}:FF(r).includes(n)?L(j(j(j(ht(Lt(r)),e=>Xe(e,"properties")),ht),e=>Xe(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 PF(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 MF(e,t){if(void 0!==ZI(e))return;let n=eF().map(e=>e.id).join(", ");return t+': unknown view-mode id "'+e+'" — registered modes: '+n}function LF(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=>{Qe(e).forEach(e=>{let n=e[1],r=e[0],i=OF(t,r);"Ok"!==i.TAG&&l('views["'+r+'"]: '+i._0),M(n.role,e=>{if(!mF.includes(e))return l('views["'+r+'"].role: unknown role "'+e+'" — expected '+mF.join(" or "));if("events"!==e)return;let t=n.resourceRef;return void 0!==t?"Ok"!==i.TAG||FF(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(yt(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=PF(t,r);n="Ok"===i.TAG&&void 0!==s?qs(i._0.schema,s):[],0===n.length&&l('views["'+r+'"].transitions: the view declares no status enum, so no transition can apply'),Qe(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=FF(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(Xe(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=Ms(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(MF(e,'views["'+r+'"].mode'),l)),M(n.layout,e=>{if(!vF.includes(e))return l('views["'+r+'"].layout: unknown layout "'+e+'" — expected '+vF.join(" or "))}),M(n.suppress,e=>{e.forEach(e=>{if(M(MF(e,'views["'+r+'"].suppress'),l),e===XI)return l('views["'+r+'"].suppress: the "table" mode is the universal fallback and cannot be suppressed')})})})}),M(e.fields,e=>{Qe(e).forEach(e=>{let n=e[0],r=OF(t,n);if("Ok"!==r.TAG)return l('fields["'+n+'"]: '+r._0);let i=FF(r._0.schema);Qe(e[1]).forEach(e=>{let t=e[1],r=e[0];if(i.includes(r)||l('fields["'+n+'"]: unknown field "'+r+'"'),q(aa(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=OF(t,e.view);if("Ok"!==r.TAG)return l("dashboard metric: "+r._0);let i=r._0.schema;M(e.field,t=>{if(!FF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown field "'+t+'"')}),M(e.xField,t=>{if(!FF(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown xField "'+t+'"')}),M(e.viz,n=>{if(!yF.includes(n))return l('dashboard metric on "'+e.view+'": unknown viz "'+n+'" — expected '+yF.join(", "));if("funnel"===n&&0===function(e,t,n){let r=B(PF(e,t),Ua(n,void 0,void 0).statusField);return void 0!==r?qs(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=FF(i),n=function(e){return xa(e).filter(e=>wa(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 zF(e,t,n){let r=tF(e,void 0!==n?n:JI),i=j(t,e=>e.suppress);return void 0!==i?r.filter(e=>e.id===XI||!i.includes(e.id)):r}function jF(e,t,n,r,i){let o=e=>j(e,e=>i.find(t=>t.id===e)),s=vt(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&&At.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 UF(e){switch(e){case"full":return"Full";case"split":return"Split";default:return}}function BF(e){return"hide"===e.toLowerCase()?"Hide":"Lock"}function $F(e,t){return void 0===t||0===t.length||t.some(t=>e.includes(t))}function qF(e){return j(e,e=>e[0])}function GF(e,t){let n=t=>t.filter(t=>$F(e,t.requiredAccess));return t.map(t=>{let r={...t};return r.internalQueryables=z(t.internalQueryables,t=>t.filter(t=>$F(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=>$F(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=>$F(e,t.requiredAccess)).map(e=>{let t={...e};return t.commands=n(e.commands),t}),r})}function VF(e,t){let n={},r=(t,r)=>{let i=!$F(e,r),o=qF(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 KF(e,t){let n={},r=(t,r)=>{if(0!==r.length&&r.every(t=>!$F(e,t.requiredAccess)))return M(j(r[0],e=>qF(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 WF=[ui(_t.background,"#0d1117"),ui(_t.surface,"#161b22"),ui(_t.surfaceSubtle,"#1c2128"),ui(_t.surfaceElevated,"#21262d"),ui(_t.brand,"#2f81f7"),ui(_t.brandSubtle,"#1f4b8e"),ui(_t.success,"#3fb950"),ui(_t.warning,"#d29922"),ui(_t.error,"#f85149"),ui(_t.info,"#58a6ff"),ui(_t.textPrimary,"#e6edf3"),ui(_t.textSecondary,"#8b949e"),ui(_t.textDisabled,"#484f58"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#30363d"),ui(_t.borderSubtle,"#21262d"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.4)"),ui(Et,"0 4px 12px rgba(0,0,0,0.5)"),ui(kt,"0 8px 24px rgba(0,0,0,0.6)")],HF=[ui(_t.background,"#ffffff"),ui(_t.surface,"#f6f8fa"),ui(_t.surfaceSubtle,"#eaeef2"),ui(_t.surfaceElevated,"#ffffff"),ui(_t.brand,"#0969da"),ui(_t.brandSubtle,"#ddf4ff"),ui(_t.success,"#1a7f37"),ui(_t.warning,"#9a6700"),ui(_t.error,"#cf222e"),ui(_t.info,"#0550ae"),ui(_t.textPrimary,"#1f2328"),ui(_t.textSecondary,"#636c76"),ui(_t.textDisabled,"#bec1c5"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#d0d7de"),ui(_t.borderSubtle,"#eaeef2"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.08)"),ui(Et,"0 4px 12px rgba(0,0,0,0.12)"),ui(kt,"0 8px 24px rgba(0,0,0,0.16)")],JF=[ui(_t.background,"#f5f5f5"),ui(_t.surface,"#ffffff"),ui(_t.surfaceSubtle,"#eeeeee"),ui(_t.surfaceElevated,"#ffffff"),ui(_t.brand,"#424242"),ui(_t.brandSubtle,"#e0e0e0"),ui(_t.success,"#388e3c"),ui(_t.warning,"#f57c00"),ui(_t.error,"#d32f2f"),ui(_t.info,"#1976d2"),ui(_t.textPrimary,"#212121"),ui(_t.textSecondary,"#757575"),ui(_t.textDisabled,"#bdbdbd"),ui(_t.textOnBrand,"#ffffff"),ui(_t.border,"#bdbdbd"),ui(_t.borderSubtle,"#e0e0e0"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(0,0,0,0.12)"),ui(Et,"0 4px 12px rgba(0,0,0,0.14)"),ui(kt,"0 8px 24px rgba(0,0,0,0.18)")],XF=[ui(_t.background,"#000000"),ui(_t.surface,"#0a0a0a"),ui(_t.surfaceSubtle,"#111111"),ui(_t.surfaceElevated,"#1a1a1a"),ui(_t.brand,"#ffdd00"),ui(_t.brandSubtle,"#332b00"),ui(_t.success,"#00ff00"),ui(_t.warning,"#ffaa00"),ui(_t.error,"#ff4444"),ui(_t.info,"#44aaff"),ui(_t.textPrimary,"#ffffff"),ui(_t.textSecondary,"#cccccc"),ui(_t.textDisabled,"#555555"),ui(_t.textOnBrand,"#000000"),ui(_t.border,"#ffffff"),ui(_t.borderSubtle,"#888888"),ui(bt.xs,"4px"),ui(bt.sm,"8px"),ui(bt.md,"16px"),ui(bt.lg,"24px"),ui(bt.xl,"32px"),ui(bt.xxl,"48px"),ui(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),ui(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),ui(xt.sizeXs,"11px"),ui(xt.sizeSm,"12px"),ui(xt.sizeMd,"14px"),ui(xt.sizeLg,"16px"),ui(xt.sizeXl,"20px"),ui(xt.sizeXxl,"24px"),ui(xt.weightNormal,"400"),ui(xt.weightMedium,"500"),ui(xt.weightBold,"600"),ui(xt.lineHeightTight,"1.25"),ui(xt.lineHeightNormal,"1.5"),ui(xt.lineHeightRelaxed,"1.75"),ui(St.sm,"4px"),ui(St.md,"6px"),ui(St.lg,"12px"),ui(St.full,"9999px"),ui(wt,"0 1px 3px rgba(255,255,255,0.1)"),ui(Et,"0 4px 12px rgba(255,255,255,0.15)"),ui(kt,"0 8px 24px rgba(255,255,255,0.2)")];function QF(e,t){let n=void 0!==t?[ui(_t.brand,t.primaryColor)]:[];return co(e.concat(n))}let YF=function(e){let t,n=e.theme;switch(n.preset){case"Dark":t=QF(WF,n.brand);break;case"Light":t=QF(HF,n.brand);break;case"Neutral":t=QF(JF,n.brand);break;case"HighContrast":t=QF(XF,n.brand)}return i("div",{children:e.children,className:t})};let ZF=l({preset:"Light",setPreset:function(e){}}),eO=ZF.Provider;function tO(){return d(ZF)}let nO="reventless-ui:theme",rO=["Light","Dark","Neutral","HighContrast"];function iO(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"HighContrast"}}let oO=function(e){let t=e.initialPreset,n=void 0!==t?t:"Light",r=s(()=>function(e){let t=localStorage.getItem(nO);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(nO,iO(e)),o(t=>e)},[]),c=p(()=>({preset:a,setPreset:l}),[a,l]);return i(eO,{value:c,children:i(YF,{theme:{preset:a,brand:e.brand},children:e.children})})};function sO(e){return!!e.startsWith("/")&&!e.startsWith("//")}function aO(e,t){return"header-"+function(e){return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}(JSON.stringify(Object.fromEntries([["host",e],["Authorization",t]])))}function lO(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 cO(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 uO(e){let t=j(e.errors,Je.array);return void 0!==t&&0!==t.length?t.map(e=>{let t=Je.object(e);if(void 0===t)return JSON.stringify(e);let n=e=>j(t[e],Je.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 dO(e,t){let n;try{n=JSON.parse(t)}catch(o){n=void 0}let r=j(n,Je.object);if(void 0===r)return;let i=j(r.type,Je.string);if(void 0!==i)switch(i){case"connection_ack":return lO(e,"Open"),e.reconnectAttempts=0,function(e){e.subscriptions.forEach(t=>cO(e,t))}(e);case"connection_error":return void console.error("Events connection refused: "+uO(r));case"data":let t=j(r.id,Je.string),n=U(r.event,null),i=e=>{let t=Je.string(e);if(void 0===t)return e;try{return JSON.parse(t)}catch(o){return e}},s=Je.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,Je.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+": "+uO(r));default:return}}function fO(e){if(e.disposed)return;let t=["aws-appsync-event-ws"],n=e.getToken(),r=void 0!==n?t.concat([aO(e.host,n)]):t,i=new WebSocket(e.url,r);e.ws=T(i),lO(e,"Connecting"),i.onopen=()=>{try{return void i.send('{"type":"connection_init"}')}catch(e){return}},i.onmessage=t=>dO(e,t.data),i.onclose=t=>{if(e.ws=void 0,function(e){return 4401===e||4403===e}(t.code))return lO(e,"Unauthorized"),M(e.onAuthFailure,e=>{try{return e()}catch(t){return}});if(lO(e,"Closed"),e.disposed)return;let n=e.reconnectAttempts+1|0;e.reconnectAttempts=n,e.reconnectTimer=setTimeout(()=>fO(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 hO(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 fO(s),s}function pO(e,t,n){let r=crypto.randomUUID(),i={id:r,channel:t,onMessage:n};return e.subscriptions.set(r,i),"Open"===e.state&&cO(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 gO(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 mO(){return L(R(globalThis.document),!1,e=>e.hidden)}let vO=["Platform_"];function yO(e,t){let n=t.toLowerCase();return e.some(e=>n.startsWith(e.toLowerCase()))?"Platform":"Domain"}let _O=l(void 0);function bO(){return d(_O)}function xO(){return{client:void 0,registry:new Map,refcount:0,idleTimer:void 0,reconnectListeners:[],torndown:!1}}let SO=_O.Provider;let wO=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:vO,m=h(t);a(()=>{m.current=t},[t]);let v=()=>m.current(),y=h(xO()),_=h(xO()),b=h(mO()),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):sO(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):sO(e)?location.host:e,n=t.indexOf("/");return-1!==n?t.slice(0,n):t}(i),a=hO(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=pO(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&&(gO(e),t.client=void 0),t.idleTimer=void 0},3e4))}}},L=e=>!!l&&$(N(yO(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=mO();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&&gO(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=>yO(g,e),statusFor:z,registerReconnect:j,publish:G,clientChannelsAvailable:B,clientNamespace:()=>i,liveUpdatesEnabled:()=>l}),[l,d,u,w,C,i,g]);return c(SO,{value:V,children:e.children})};function EO(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 kO(e,t){let n=ht(e);if(void 0===n)return e;let r=j(Xe(n,"properties"),ht);if(void 0===r)return e;let i=j(Xe(r,t),ht);if(void 0===i)return e;let o=Ze(Qe(i));o["x-reventless-ui-hidden"]=!0;let s=Ze(Qe(r));s[t]=o;let a=Ze(Qe(n));return a.properties=s,a}function CO(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?kO(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=ht(e);if(void 0===r)return e;let i={};i.field=t,i.as=n.map(e=>e);let o=Ze(Qe(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 AO(e,t){let n=dt(t);return function(e){let t=Ms(e);return void 0!==t&&void 0===t[1].values?kO(e,t[0]):e}(function(e,t){return M(j(j(ht(t),e=>Xe(e,"properties")),ht),t=>{Ye(t).forEach(t=>M(j(j(ht(t),e=>Xe(e,"x-reventless-semantic-target")),ht),t=>{let n=Xe(t,"store"),r=Xe(t,"plugin");void 0===n||void 0!==r||(t.plugin=e)}))}),t}(e,void 0!==n?JSON.parse(n):t))}function NO(e){switch(e){case"boolean":return"Boolean";case"integer":return"Int";case"number":return"Float";default:return"String"}}function TO(e){let t=e.toLowerCase();return t.length>=2&&t.endsWith("id")}function RO(e){if(vt(j(Xe(e,"type"),dt),"object"))return j(Xe(e,"x-reventless-graphql-input"),dt)}function DO(e){return j(Xe(e,"x-reventless-graphql-type"),dt)}function IO(e){return z(j(j(ht(e),e=>Xe(e,"required")),pt),e=>me(e,dt))}function FO(e,t,n){let r=IO(t),i=U(z(j(j(ht(t),e=>Xe(e,"properties")),ht),e=>Object.keys(e).filter(e=>"TAG"!==e).map(t=>{let n,i=j(Xe(e,t),ht),o=j(i,DO);if(void 0!==o)n=o;else{let e=L(i,"String",e=>function(e,t){let n=U(j(Xe(t,"type"),dt),"string");if("array"===n){let n=j(Xe(t,"items"),ht),r=j(n,RO),i=void 0!==r?r:U(z(j(j(n,e=>Xe(e,"type")),dt),t=>"string"===t&&(function(e){let t=e.toLowerCase();return t.length>3&&t.endsWith("ids")}(e)||TO(e))?"ID":NO(t)),"String");return"["+i+"!]"}let r=RO(t);return void 0!==r?r:TO(e)&&"string"===n?"ID":NO(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 OO(e){let t=e.split(".");return U(t[t.length-1|0],e)}function PO(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function MO(e){return me(U(pt(e),[]),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{fieldName:t("fieldName"),entity:t("entity"),plugin:j(Xe(e,"plugin"),dt)}}))}function LO(e){return yt(j(Xe(e,"apiExposed"),gt),!1)}function zO(e,t,n){return me(U(pt(n),[]),n=>z(j(ht(n),e=>{if(t(e))return e}),t=>{let n=e=>U(j(Xe(t,e),dt),""),r=n("name"),i="Instance"===n("level")?"Instance":"Collection",o=U(z(Xe(t,"schema"),t=>AO(e,t)),null),s=n("mutationField"),a=j(Xe(t,"aggregateIdField"),dt),l=U(z(Xe(t,"references"),MO),[]),c=z(j(Xe(t,"allowedStates"),pt),e=>me(e,dt)),u=j(Xe(t,"targetState"),dt),d=j(z(j(Xe(t,"requiredAccess"),pt),e=>me(e,dt)),e=>0===e.length?void 0:e);return{name:r,label:PO(OO(r)),schema:o,mutationDocument:""===s?"":FO(s,o,a),requiredRole:void 0,level:i,aggregateIdField:a,refFields:[],references:l,allowedStates:c,targetState:u,requiredAccess:d,ownerField:j(Xe(t,"ownerField"),dt)}}))}function jO(e,t){return zO(e,e=>!LO(e),t)}function UO(e){return me(U(pt(e),[]),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),pt),[]),n=(e,t)=>me(U(j(Xe(e,t),pt),[]),dt),r=(t=>U(j(Xe(e,t),dt),""))("pluginId"),i=e=>j(z(j(Xe(e,"requiredAccess"),pt),e=>me(e,dt)),e=>0===e.length?void 0:e),o=me(t("readModels"),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{name:t("name"),schema:U(z(Xe(e,"schema"),e=>AO(r,e)),null),queryDocument:"",queryField:t("queryField"),sortIndex:0,commands:[],linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Xe(e,"labelFieldSource"),dt),searchableFields:n(e,"searchableFields"),lifecycleField:j(Xe(e,"lifecycleField"),dt),requiredAccess:i(e),ownerField:j(Xe(e,"ownerField"),dt)}})),s=me(t("aggregates"),e=>z(ht(e),e=>({name:(t=>U(j(Xe(e,t),dt),""))("name"),schema:null,commands:zO(r,LO,U(Xe(e,"commands"),[])),systemCommands:jO(r,U(Xe(e,"commands"),[])),linkedViews:n(e,"linkedViews")}))),a=e=>me(t(e),e=>z(ht(e),e=>{let t=t=>U(j(Xe(e,t),dt),"");return{name:t("name"),schema:U(z(Xe(e,"schema"),e=>AO(r,e)),null),queryField:t("queryField"),sortIndex:0,linkedWriteSide:n(e,"linkedWriteSide"),labelField:t("labelField"),labelFieldSource:j(Xe(e,"labelFieldSource"),dt),searchableFields:n(e,"searchableFields"),lifecycleField:j(Xe(e,"lifecycleField"),dt),requiredAccess:i(e),ownerField:j(Xe(e,"ownerField"),dt)}})),l=a("stateViewSlices"),c=a("internalQueryables"),u=me(t("stateChangeSlices"),e=>z(ht(e),e=>({name:(t=>U(j(Xe(e,t),dt),""))("name"),commands:zO(r,LO,U(Xe(e,"commands"),[])),systemCommands:jO(r,U(Xe(e,"commands"),[])),linkedViews:n(e,"linkedViews"),consistencyRead:j(Xe(e,"consistencyRead"),dt)}))),d=z(j(Xe(e,"derivedPages"),pt),e=>me(e,dt));return{id:r,name:r,readModels:o,aggregates:s,stateViewSlices:l,stateChangeSlices:u,internalQueryables:c,derivedPages:d}}))}function BO(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 $O(e){return"fleet"===e.toLowerCase()?"Fleet":"Single"}function qO(e){switch(e.toLowerCase()){case"cognito":return"Cognito";case"inmemory":case"local":return"Local";default:return"Anonymous"}}function GO(e){let t=Je.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],Je.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],Je.bool);return{TAG:"Ok",_0:{apiEndpoint:r,platformApiEndpoint:i,platformApiSubscriptionEndpoint:U(n("platformApiSubscriptionEndpoint"),BO(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,Je.array),e=>me(e,Je.string)),vO),region:n("region"),authMode:U(z(n("authMode"),qO),"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"),$O),"Single"),environment:n("environment"),platformName:n("platformName"),accessTiers:me(U(j(t.accessTiers,Je.array),[]),Je.string),viewModes:me(U(j(t.viewModes,Je.array),[]),Je.string),mapStyle:n("mapStyle"),graphLayout:n("graphLayout"),assetOrigins:(e=>U(z(j(t[e],Je.object),e=>Object.fromEntries(me(Object.entries(e),e=>{let t=e[0];return z(Je.string(e[1]),e=>[t,e])}))),{}))("assetOrigins"),uiHintsUrl:U(n("uiHintsUrl"),"/ui-hints.json"),manifestUrl:n("manifestUrl"),journeyManifestUrls:L(j(t.journeyManifestUrls,Je.object),{},e=>{let t={};return((e,t)=>{for(var n in e)t(e[n],n)})(e,(e,n)=>M(Je.string(e),e=>{t[n]=e})),t}),hostShellUrl:n("hostShellUrl"),deniedSurfaces:U(z(n("deniedSurfaces"),BF),"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 '+rO.join(", ")+". Opening on the default instead.")}),elevatedGroups:me(U(j(t.elevatedGroups,Je.array),[]),Je.string)}}}function VO(e){return ce(fetch(e).then(t=>t.ok?ce(t.json().then(t=>{let n=function(e){if(void 0!==Je.array(e))return{TAG:"Ok",_0:UO(e)};let t=P(j(j(j(Je.object(e),e=>e.data),Je.object),e=>e.Platform_ComponentDefinitions),e=>$(Je.array(e)));return void 0!==t?{TAG:"Ok",_0:UO(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 KO(e){let t=Je.string(e);return void 0!==t?t:z(Je.float(e),e=>e.toString())}function WO(e){return z(Je.object(e),e=>({message:U(j(e.message,Je.string),""),path:me(U(j(e.path,Je.array),[]),KO),code:j(j(j(e.extensions,Je.object),e=>e.code),Je.string),errorType:j(e.errorType,Je.string)}))}function HO(e){let t=Je.object(e);return{data:U(j(t,e=>e.data),null),errors:me(U(j(j(t,e=>e.errors),Je.array),[]),WO)}}function JO(e,t){let n=j(Je.object(e.data),e=>e[t]);return void 0!==n&&"JSONNull"!==ut(n)?void 0:function(e,t){return e.errors.find(e=>vt(e.path[0],t))}(e,t)}function XO(e){return e.errors.some(e=>vt(e.code,"UNAUTHORIZED"))}let QO=bI;class YO extends Error{}function ZO(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)}}YO.prototype.name="InvalidTokenError";let eP=function(e){return e&&e.name?String(e.name):"UnknownError"},tP=function(e){return e&&e.message?String(e.message):""};function nP(e){return{name:eP(e),message:tP(e)}}function rP(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 iP,oP;!function(e){e.HTTP="http",e.HTTPS="https"}(iP||(iP={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(oP||(oP={}));const sP="__smithy_context";class aP{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 aP({...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 aP.clone(this)}}class lP{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 cP={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},uP=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!aP.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),cP)}}),dP={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},fP={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},hP=e=>e[sP]||(e[sP]={}),pP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const gP=(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=hP(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)},mP={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},vP=e=>e=>{throw e},yP=(e,t)=>{},_P={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},bP=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!aP.isInstance(n.request))return e(n);const r=hP(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||vP)(i));return(s.successHandler||yP)(a.response,i),a},_P)}}),xP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},SP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wP=Object.entries(SP).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),EP=SP.split(""),kP=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 wP))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);t|=wP[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)},CP=e=>(new TextEncoder).encode(e),AP=e=>"string"==typeof e?CP(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),NP=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 TP(e){let t;t="string"==typeof e?CP(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+=EP[(e&63<<n)>>n]}i+="==".slice(0,4-r)}return i}class RP extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return"base64"===t?RP.mutate(kP(e)):RP.mutate(CP(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,RP.prototype),e}transformToString(e="utf-8"){return"base64"===e?TP(this):NP(this)}}const DP=e=>encodeURIComponent(e).replace(/[!'()*]/g,IP),IP=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function FP(e,t){return new Request(e,t)}function OP(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 PP={supported:void 0};class MP{config;configProvider;static create(e){return"function"==typeof e?.handle?e:new MP(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===PP.supported&&(PP.supported=Boolean("undefined"!=typeof Request&&"keepalive"in FP("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=LP(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=DP(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${DP(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${DP(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),PP.supported&&(h.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(h,this.config.requestInit(e));let p=()=>{};const g=FP(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 lP({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new lP({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),OP(r)];return t&&m.push(new Promise((e,n)=>{const r=()=>{const e=LP(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 LP(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 zP=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=kP(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 jP={},UP={};for(let $xe=0;$xe<256;$xe++){let e=$xe.toString(16).toLowerCase();1===e.length&&(e=`0${e}`),jP[$xe]=e,UP[e]=$xe}function BP(e){let t="";for(let n=0;n<e.byteLength;n++)t+=jP[e[n]];return t}const $P=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return RP.mutate(e);if(!e)return RP.mutate(new Uint8Array);const n=t.streamCollector(e);return RP.mutate(await n)},qP=e=>"function"==typeof e?e():e,GP=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),VP=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1];const KP=e=>{if("string"==typeof e)return KP(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}},WP=e=>(t,n)=>async r=>{const{operationSchema:i}=hP(n),[,o,s,a,l,c]=i??[],u=n.endpointV2?async()=>(e=>{if("object"==typeof e){if("url"in e){const t=KP(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 KP(e)})(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(GP(o,s,a,l,c),r.input,{...e,...n,endpoint:u});return t({...r,request:d})},HP={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},JP={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function XP(e){return{applyToStack:t=>{t.add(WP(e),JP),t.add((e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:o}=hP(n),[,s,a,l,c,u]=o??[];try{return{response:i,output:await e.protocol.deserializeResponse(GP(s,a,l,c,u),{...e,...n},i)}}catch(Ine){if(Object.defineProperty(Ine,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in Ine)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{Ine.message+="\n "+t}catch(_U){n.logger&&"NoOpLogger"!==n.logger?.constructor?.name?n.logger?.warn?.(t):console.warn(t)}void 0!==Ine.$responseBodyText&&Ine.$response&&(Ine.$response.body=Ine.$responseBodyText);try{if(lP.isInstance(i)){const{headers:t={}}=i,n=Object.entries(t);Ine.$metadata={httpStatusCode:i.statusCode,requestId:VP(/^x-[\w-]+-request-?id$/,n),extendedRequestId:VP(/^x-[\w-]+-id-2$/,n),cfId:VP(/^x-[\w-]+-cf-id$/,n)}}}catch(_U){}}throw Ine}})(e),HP),e.protocol.setSerdeContext(e)}}}const QP=[];function YP(e){if("object"==typeof e)return e;if(QP[e|=0])return QP[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 QP[e]=t}const ZP=Symbol.for("@smithy/nor-struct-it"),eM=Symbol.for("@smithy/ns"),tM=[],nM={};class rM{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=rM.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;oM(r);)n.push(r[1]),r=r[0],i=qP(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,YP(t))}}else this.memberTraits=0;if(i instanceof rM){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=qP(i),sM(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(tM[e])return tM[e]}else if("string"==typeof e){if(nM[e])return nM[e]}else if(t&&e[eM])return e[eM];const n=qP(e);if(n instanceof rM)return n;if(oM(n)){const[t,r]=n;if(t instanceof rM)return Object.assign(t.getMergedTraits(),YP(r)),t;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const r=new rM(n);return t?e[eM]=r:"string"==typeof n?nM[n]=r:"number"==typeof n?tM[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 YP(this.memberTraits)}getOwnTraits(){return YP(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 iM([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 iM([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 iM(oM(r)?r:[r,0],e)}if(this.isDocumentSchema())return iM([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[ZP];if(n&&t===n.length)yield*n;else{n=Array(t);for(let r=0;r<t;++r){const t=e[4][r],i=iM([e[5][r],0],t);yield n[r]=[t,i]}e[ZP]=n}}}function iM(e,t){if(e instanceof rM)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new rM(e,t)}const oM=e=>Array.isArray(e)&&2===e.length,sM=e=>Array.isArray(e)&&e.length>=5;class aM{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 aM.registries.has(e)||aM.registries.set(e,new aM(e)),aM.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,aM.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,aM.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 aM.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 lM=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&_M.warn(yM(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},cM=Math.ceil(2**127*(2-2**-23)),uM=e=>{const t=lM(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>cM)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},dM=e=>hM(e,16),fM=e=>hM(e,8),hM=(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&&pM(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},pM=(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]}},gM=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,mM=e=>{const t=e.match(gM);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},vM=e=>dM("string"==typeof e?mM(e):e),yM=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),_M={warn:console.warn},bM=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xM=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const SM=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),wM=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$/),EM=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$/),kM=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})$/),CM=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=wM.exec(e);if(t){const[e,n,r,i,o,s,a,l]=t;return NM(vM(zM(i)),DM(r),PM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l})}if(t=EM.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return RM(NM(TM(i),DM(r),PM(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l}))}if(t=kM.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return NM(vM(zM(l)),DM(n),PM(r.trimLeft(),"day",1,31),{hours:i,minutes:o,seconds:s,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},AM=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(e=>lM("string"==typeof e?mM(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))},NM=(e,t,n,r)=>{const i=t-1;return FM(e,i,n),new Date(Date.UTC(e,i,n,PM(r.hours,"hour",0,23),PM(r.minutes,"minute",0,59),PM(r.seconds,"seconds",0,60),MM(r.fractionalMilliseconds)))},TM=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+vM(zM(e));return n<t?n+100:n},RM=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,DM=e=>{const t=xM.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},IM=[31,28,31,30,31,30,31,31,30,31,30,31],FM=(e,t,n)=>{let r=IM[t];if(1===t&&OM(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${xM[t]} in ${e}: ${n}`)},OM=e=>e%4==0&&(e%100!=0||e%400==0),PM=(e,t,n,r)=>{const i=(e=>fM("string"==typeof e?mM(e):e))(zM(e));if(i<n||i>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},MM=e=>null==e?0:1e3*(e=>uM("string"==typeof e?mM(e):e))("0."+e),LM=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},zM=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},jM="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),UM=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),BM=()=>{if(jM)return jM();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,UM[e[0]]+UM[e[1]]+UM[e[2]]+UM[e[3]]+"-"+UM[e[4]]+UM[e[5]]+"-"+UM[e[6]]+UM[e[7]]+"-"+UM[e[8]]+UM[e[9]]+"-"+UM[e[10]]+UM[e[11]]+UM[e[12]]+UM[e[13]]+UM[e[14]]+UM[e[15]]},$M=function(e){return Object.assign(new String(e),{deserializeJSON:()=>JSON.parse(String(e)),toString:()=>String(e),toJSON:()=>String(e)})};$M.from=e=>e&&"object"==typeof e&&(e instanceof $M||"deserializeJSON"in e)?e:"string"==typeof e||Object.getPrototypeOf(e)===String.prototype?$M(String(e)):$M(JSON.stringify(e)),$M.fromObject=$M.from;const qM=/^-?\d*(\.\d+)?$/;class GM{string;type;constructor(e,t){if(this.string=e,this.type=t,!qM.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 GM.prototype.isPrototypeOf(e)||"bigDecimal"===t.type&&qM.test(t.string)}}class VM{serdeContext;setSerdeContext(e){this.serdeContext=e}}class KM extends VM{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=aM.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return aP}getResponseType(){return lP}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=rM.of(t.input),i=YP(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-CatoB-kl.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 WM extends KM{async serializeRequest(e,t,n){const r=this.serializer,i={},o={},s=await n.endpoint(),a=rM.of(e?.input),l=a.getSchema();let c;const u=t&&"object"==typeof t?t:{},d=new aP({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=rM.of(e.output),o={};if(n.statusCode>=300){const i=await $P(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 $P(n.body,t);e.byteLength>0&&Object.assign(o,await r.read(i,e))}return o.$metadata=this.deserializeMetadata(n),o}}function HM(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 JM{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 XM{async sign(e,t,n){return e}}const QM=(YM=3e5,function(e){return ZM(e)&&e.expiration.getTime()-Date.now()<YM});var YM;const ZM=e=>void 0!==e.expiration;class eL{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 eL(e,t,n,r)}}class tL extends Error{constructor(e){super(e),this.name="EndpointError"}}function nL(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${nL(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(nL).join(", ")})`:JSON.stringify(e,null,2)}const rL={};const iL=(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 tL(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new tL(`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 tL(`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),oL=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),sL=(e,t=!1)=>{if(!t)return oL.test(e);const n=e.split(".");for(const r of n)if(!sL(r))return!1;return!0};const aL=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}$"),lL=e=>aL.test(e)||e.startsWith("[")&&e.endsWith("]"),cL={[iP.HTTP]:80,[iP.HTTPS]:443};const uL={booleanEquals:(e,t)=>e===t,coalesce:function(...e){for(const t of e)if(null!=t)return t},getAttr:iL,isSet:e=>null!=e,isValidHostLabel:sL,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(Ine){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(iP).includes(l))return null;const c=lL(i);return{scheme:l,authority:`${r}${n.includes(`${r}:${cL[l]}`)||"string"==typeof e&&e.includes(`${r}:${cL[l]}`)?`:${cL[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()}`)},dL=(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(iL(r[e]??i[e],t))}else n.push(r[a]??i[a]);o=s+1}return n.join("")},fL=(e,t,n)=>{if("string"==typeof e)return dL(e,n);if(e.fn)return pL.callFunction(e,n);if(e.ref)return(({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e])(e,n);throw new tL(`'${t}': ${String(e)} is not a string, function or reference.`)},hL=({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:pL.evaluateExpression(e,"arg",n)}const i=e.indexOf(".");if(-1!==i){const t=rL[e.slice(0,i)],n=t?.[e.slice(i+1)];if("function"==typeof n)return n(...r)}const o=uL[e];if("function"==typeof o)return o(...r);throw new Error(`function ${e} not loaded in endpointFunctions.`)},pL={evaluateExpression:fL,callFunction:hL},gL=(e,t)=>{const{assign:n}=e;if(n&&n in t.referenceRecord)throw new tL(`'${n}' is already defined in Reference Record.`);const r=hL(e,t);t.logger?.debug?.(`endpoints evaluateCondition: ${nL(e)} = ${nL(r)}`);const i=""===r||!!r;return null!=n?{result:i,toAssign:{name:n,value:r}}:{result:i}},mL=(e,t)=>Object.entries(e??{}).reduce((e,[n,r])=>(e[n]=r.map(e=>{const r=fL(e,"Header value entry",t);if("string"!=typeof r)throw new tL(`Header '${n}' value '${r}' is not a string`);return r}),e),{}),vL=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=_L.getEndpointProperty(r,t),e),{}),yL=(e,t)=>{if(Array.isArray(e))return e.map(e=>yL(e,t));switch(typeof e){case"string":return dL(e,t);case"object":if(null===e)throw new tL(`Unexpected endpoint property: ${e}`);return _L.getEndpointProperties(e,t);case"boolean":return e;default:throw new tL("Unexpected endpoint property type: "+typeof e)}},_L={getEndpointProperty:yL,getEndpointProperties:vL},bL=(e,t)=>{const n=fL(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(Ine){throw console.error(`Failed to construct URL with ${n}`,Ine),Ine}throw new tL("Endpoint URL must be a string, got "+typeof n)},xL=1e8,SL=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!SL(t))return!1;return!0}return!!sL(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!lL(e)))};let wL={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 EL={isVirtualHostableS3Bucket:SL,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}=wL;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 kL(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 CL;rL.aws=EL,function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(CL||(CL={}));const AL=CL.STANDARD,NL=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],TL=["TimeoutError","RequestTimeout","RequestTimeoutException"],RL=[500,502,503,504],DL=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],IL=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],FL=e=>429===e.$metadata?.httpStatusCode||NL.includes(e.name)||1==e.$retryable?.throttling,OL=(e,t=0)=>(e=>void 0!==e?.$retryable)(e)||(e=>e.$metadata?.clockSkewCorrected)(e)||TL.includes(e.name)||DL.includes(e?.code||"")||IL.includes(e?.code||"")||RL.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&&OL(e.cause,t+1);class PL{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||FL(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=>PL.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 ML={};class LL{static v2026="undefined"!=typeof process&&"true"===ML?.SMITHY_NEW_RETRIES_2026;static delay(){return LL.v2026?50:100}static throttlingDelay(){return LL.v2026?1e3:500}static cost(){return LL.v2026?14:5}static throttlingCost(){return LL.v2026?5:10}static modifiedCostType(){return LL.v2026?"THROTTLING":"TRANSIENT"}}class zL{x=LL.delay();computeNextBackoffDelay(e){const t=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(t)}setDelayBase(e){this.x=e}}class jL{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 UL{mode=CL.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??=LL.delay(),this.retryBackoffStrategy??=new zL}async acquireInitialRetryToken(e){return new jL(LL.delay(),0,void 0,LL.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?LL.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 jL(o,e.getRetryCount()+1,t,e.isLongPoll?.()??!1)}throw Object.assign(new Error("No retry token available"),{$backoff:LL.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(Ine){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===LL.modifiedCostType()?LL.throttlingCost():LL.cost()}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}async maxAttempts(){return this.maxAttemptsProvider()}}class BL{mode=CL.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new PL,this.standardRetryStrategy=new UL(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 $L=/\d{12}\.ddb/;const qL="user-agent",GL="x-amz-user-agent",VL=/[^!$%&'*+\-.^_`|~\w]/g,KL=/[^!$%&'*+\-.^_`|~\w#]/g;const WL=e=>(t,n)=>async r=>{const{request:i}=r;if(!aP.isInstance(i))return t(r);const{headers:o}=i,s=n?.userAgent?.map(HL)||[],a=(await e.defaultUserAgentProvider()).map(HL);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&kL(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();if("string"==typeof n.mode)switch(n.mode){case CL.ADAPTIVE:kL(e,"RETRY_MODE_ADAPTIVE","F");break;case CL.STANDARD:kL(e,"RETRY_MODE_STANDARD","E")}}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match($L)&&kL(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":kL(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":kL(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":kL(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&kL(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))kL(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(HL)||[],u=await e.userAgentAppId();u&&a.push(HL(["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[GL]=o[GL]?`${o[qL]} ${f}`:f),o[qL]=d):o[GL]=d,t({...r,request:i})},HL=e=>{const t=e[0].split("/").map(e=>e.replace(VL,"-")).join("/"),n=e[1]?.replace(KL,"-"),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}`}},"")},JL={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},XL=new Set,QL=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),YL=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const e=(e=>QL(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=sL)=>{if(XL.has(e)||t(e))XL.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!!QL(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})},ZL="content-length";const ez={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},tz=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(aP.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(ZL))try{const t=n(e);r.headers={...r.headers,[ZL]:String(t)}}catch(Ine){}}return e({...t,request:r})}),ez)}}),nz=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,rz=/(\d+\.){3}\d+/,iz=/\.\./,oz=e=>nz.test(e)&&!rz.test(e)&&!iz.test(e),sz=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},az=(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},lz=async e=>{},cz=e=>{if("object"==typeof e){if("url"in e){const t=KP(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 KP(e)},uz=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 az(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("?"))),sz(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!oz(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},dz=({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 lz(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(cz(e)),n.isCustomEndpoint=!0)}const i=await uz(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=hP(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})},fz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},hz=(e,t)=>({applyToStack:n=>{n.addRelativeTo(dz({config:e,instructions:t}),fz)}}),pz=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}`),gz=e=>{const{retryStrategy:t,retryMode:n}=e,r=pP(e.maxAttempts??3);let i=t?Promise.resolve(t):void 0;return Object.assign(e,{maxAttempts:r,retryStrategy:()=>i??=(async()=>await pP(n)()===CL.ADAPTIVE?new BL(r):new UL(r))()})},mz=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},vz=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,yz=()=>{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 mz(t.name,t.aliases))s[n]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const n of mz(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 ${vz(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)=>_z[t.step]-_z[e.step]||bz[t.priority||"normal"]-bz[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=mz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${vz(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(`"${vz(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${vz(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=mz(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${vz(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(`"${vz(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${vz(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(yz()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const o=e=>{const t=mz(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 mz(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=mz(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(yz());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 vz(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},_z={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},bz={high:3,normal:2,low:1};class xz{config;middlewareStack=yz();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 Sz="***SensitiveInformation***";function wz(e,t){if(null==t)return t;const n=rM.of(e);if(n.getMergedTraits().sensitive)return Sz;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Sz}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Sz}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=wz(i,e[t]));return r}return t}let Ez=class{middlewareStack=yz();schema;static classBuilder(){return new kz}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,[sP]:{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 kz{_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 Ez{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?wz.bind(null,s):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?wz.bind(null,a):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Cz 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 Cz.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===Cz?Cz.isInstance(e):!!Cz.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const Az=(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},Nz=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{}}},Tz=Object.values(oP),Rz=e=>Object.assign((e=>{const t=[];for(const n in oP){const r=oP[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();Tz.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)),Dz=e=>Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{const n=e.algorithmId();Tz.includes(n)&&(t[n]=e.checksumConstructor())}),t})(e),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(e));class Iz{trace(){}debug(){}info(){}warn(){}error(){}}const Fz=e=>e?.body instanceof ReadableStream;const Oz=e=>new Promise(t=>setTimeout(t,e)),Pz=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,Mz=(e,t)=>{const n={error:e,errorType:Lz(e)},r=function(e,t){if(lP.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=(CM(r).getTime()-Date.now())/1e3}catch(_U){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(_U)}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},Lz=e=>FL(e)?"THROTTLING":OL(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!OL(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",zz={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},jz=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const o=await e.maxAttempts();if(!Pz(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=aP.isInstance(d);for(f&&(d.headers["amz-sdk-invocation-id"]=BM());;)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(_U){const r=Mz(_U,e.logger);if(l=pz(_U),f&&Fz(d))throw(n.logger instanceof Iz?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 Oz(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 Oz(o)}}})(e),zz)}}),Uz=e=>lP.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Bz=e=>new Date(Date.now()+e),$z=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(Bz(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},qz=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class Gz{async sign(e,t,n){if(!aP.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=qz("context",e.context),n=qz("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=qz("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:Bz(i.systemClockOffset),signingRegion:s,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??Uz(t.$response);if(n){const r=qz("config",e.config),i=r.systemClockOffset;r.systemClockOffset=$z(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=Uz(e);if(n){const e=qz("config",t.config);e.systemClockOffset=$z(n,e.systemClockOffset)}}}const Vz=(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)},Kz="X-Amz-Date",Wz="X-Amz-Signature",Hz="X-Amz-Security-Token",Jz="authorization",Xz=Kz.toLowerCase(),Qz=[Jz,Xz,"date"],Yz=Wz.toLowerCase(),Zz="x-amz-content-sha256",ej=Hz.toLowerCase(),tj={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},nj=/^proxy-/,rj=/^sec-/,ij="AWS4-HMAC-SHA256",oj="AWS4-HMAC-SHA256-PAYLOAD",sj="aws4_request",aj={},lj=[],cj=(e,t,n)=>`${e}/${t}/${n}/${sj}`,uj=(e,t,n)=>{const r=new e(t);return r.update(AP(n)),r.digest()},dj=({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 tj||t?.has(o)||nj.test(o)||rj.test(o))&&(!n||n&&!n.has(o))||(r[o]=e[i].trim().replace(/\s+/g," "))}return r},fj=async({headers:e,body:t},n)=>{for(const i of Object.keys(e))if(i.toLowerCase()===Zz)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(AP(t)),BP(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class hj{format(e){const t=[];for(const i of Object.keys(e)){const n=CP(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=CP(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(mj.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!gj.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 UP))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=UP[r]}return t}(e.value.replace(/\-/g,"")),1),u}}}var pj;!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"}(pj||(pj={}));const gj=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class mj{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&&vj(t),new mj(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&vj(e),parseInt(BP(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function vj(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const yj=e=>{e=aP.clone(e);for(const t of Object.keys(e.headers))Qz.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},_j=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class bj{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=pP(n),this.credentialProvider=pP(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()===Yz)continue;const i=DP(r);t.push(i);const o=e[r];"string"==typeof o?n[i]=`${i}=${DP(o)}`:Array.isArray(o)&&(n[i]=o.slice(0).reduce((e,t)=>e.concat([`${i}=${DP(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(AP(n));return`${r}\n${e}\n${t}\n${BP(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 DP(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=>_j(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 xj extends bj{headerFormatter=new hj;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=cj(h,d,c??this.service),g=((e,t={})=>{const{headers:n,query:r={}}=aP.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}})(yj(e),{unhoistableHeaders:o,hoistableHeaders:a});u.sessionToken&&(g.query[Hz]=u.sessionToken),g.query["X-Amz-Algorithm"]=ij,g.query["X-Amz-Credential"]=`${u.accessKeyId}/${p}`,g.query[Kz]=f,g.query["X-Amz-Expires"]=r.toString(10);const m=dj(g,i,s);return g.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(m),g.query[Wz]=await this.getSignature(f,p,this.getSigningKey(u,d,h,c),this.createCanonicalRequest(g,m,await fj(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=cj(l,a,o??this.service),d=await fj({headers:{},body:t},this.sha256),f=new this.sha256;f.update(e);const h=BP(await f.digest()),p=[oj,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(AP(e)),BP(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=yj(e),{longDate:c,shortDate:u}=this.formatDate(t),d=cj(u,a,o??this.service);l.headers[Xz]=c,s.sessionToken&&(l.headers[ej]=s.sessionToken);const f=await fj(l,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(Zz,l.headers)&&this.applyChecksum&&(l.headers[Zz]=f);const h=dj(l,r,n),p=await this.getSignature(c,d,this.getSigningKey(s,a,u,o),this.createCanonicalRequest(l,h,f));return l.headers[Jz]=`${ij} 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,ij),o=new this.sha256(await n);return o.update(AP(i)),BP(await o.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const o=`${n}:${r}:${i}:${BP(await uj(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(o in aj)return aj[o];for(lj.push(o);lj.length>50;)delete aj[lj.shift()];let s=`AWS4${t.secretAccessKey}`;for(const a of[n,r,i,sj])s=await uj(e,s,a);return aj[o]=s})(this.sha256,e,n,t,r||this.service)}}const Sj=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,QM,ZM):n?xP(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?xP(e.signer):e.regionInfoProvider?()=>xP(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||xj)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await xP(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||xj)(o)};return Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:a})};const wj=async(e,t,n)=>({operation:hP(t).operation,region:await pP(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const Ej=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},kj={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Cj="3.1033.0";var Aj="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function Nj(e){return e instanceof Uint8Array?e:"string"==typeof e?Aj(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Tj(e){return"string"==typeof e?0===e.length:0===e.byteLength}var Rj={name:"SHA-256"},Dj={name:"HMAC",hash:Rj},Ij=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 Fj={};function Oj(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:Fj}var Pj=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!Tj(e)){var t=Nj(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 Oj().crypto.subtle.sign(Dj,t,e.toHash).then(function(e){return new Uint8Array(e)})}):Tj(this.toHash)?Promise.resolve(Ij):Promise.resolve().then(function(){return Oj().crypto.subtle.digest(Rj,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){Oj().crypto.subtle.importKey("raw",Nj(e.secret),Dj,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function Mj(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(_U){o(_U)}}function a(e){try{l(r.throw(e))}catch(_U){o(_U)}}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 Lj(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(_U){a=[6,_U],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 zj=64,jj=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]),Uj=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Bj=Math.pow(2,53)-1,$j=function(){function e(){this.state=Int32Array.from(Uj),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>Bj)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===zj&&(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%zj>=56){for(var r=this.bufferLength;r<zj;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<zj;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+(jj[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}(),qj=function(){function e(e){this.secret=e,this.hash=new $j,this.reset()}return e.prototype.update=function(e){if(!Tj(e)&&!this.error)try{this.hash.update(Nj(e))}catch(_U){this.error=_U}},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 Mj(this,void 0,void 0,function(){return Lj(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new $j,this.secret){this.outer=new $j;var e=function(e){var t=Nj(e);if(t.byteLength>zj){var n=new $j;n.update(t),t=n.digest()}var r=new Uint8Array(zj);return r.set(t),r}(this.secret),t=new Uint8Array(zj);t.set(e);for(var n=0;n<zj;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 Gj=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Vj(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&&Gj.every(function(t){return"function"==typeof e[t]})}(e.crypto.subtle)}var Kj=function(){function e(e){Vj(Oj())?this.hash=new Pj(e):this.hash=new qj(e)}return e.prototype.update=function(e,t){this.hash.update(Nj(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();const Wj=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window?window.navigator:void 0,i=r?.userAgent??"",o=r?.userAgentData?.platform??Hj.os(i)??"other",s=r?.userAgentData?.brands??[],a=s[s.length-1],l=a?.brand??Hj.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},Hj={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},Jj=e=>()=>Promise.reject(e),Xj="function"==typeof TextEncoder?new TextEncoder:null,Qj=e=>{if("string"==typeof e){if(Xj)return Xj.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}`)},Yj=["in-region","cross-region","mobile","standard","legacy"],Zj=()=>{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 eU{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(_U){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=aM.for(r),o=aM.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=Az(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 Az(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(_U){return e.find(e=>rM.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}class tU{serdeContext;setSerdeContext(e){this.serdeContext=e}}class nU{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 rU(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 GM(e,"bigDecimal"):BigInt(e)}}return t}const iU=(e,t)=>((e,t)=>$P(e,t).then(e=>(t?.utf8Encoder??NP)(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(_U){throw"SyntaxError"===_U?.name&&Object.defineProperty(_U,"$responseBodyText",{value:e}),_U}return{}}),oU=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),sU=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 aU extends tU{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,"string"==typeof t?JSON.parse(t,rU):await iU(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=null!==t&&"object"==typeof t,r=rM.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 nU(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 kP(t);const i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&"string"==typeof t&&i){return"application/json"===i||i.endsWith("+json")?$M.from(t):t}if(r.isTimestampSchema()&&null!=t){switch(HM(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=SM.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=vM(zM(r)),f=PM(i,"month",1,12),h=PM(o,"day",1,31),p=NM(d,f,h,{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c});return"Z"!=u.toUpperCase()&&p.setTime(p.getTime()-LM(u)),p})(t);case 6:return CM(t);case 7:return AM(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 GM)return t;const e=t;return"bigDecimal"===e.type&&"string"in e?new GM(e.string,e.type):new GM(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 GM?i:this._read(r,i)}return e}return structuredClone(t)}return t}}const lU=String.fromCharCode(925);class cU{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 GM){const e=lU+"nv"+this.counter+++"_"+t.string;return this.values.set(`"${e}"`,t.string),e}if("bigint"==typeof t){const e=t.toString(),n=lU+"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 uU extends tU{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=rM.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 cU;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=rM.of(e).getName(!0))}_write(e,t,n){const r=null!==t&&"object"==typeof t,i=rM.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??TP)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema())){switch(HM(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`${bM[r]}, ${i<10?`0${i}`:`${i}`} ${xM[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 GM&&(this.useReplacer=!0)}if(null!==t||!n?.isStructSchema()){if(i.isStringSchema()){if(void 0===t&&i.isIdempotencyToken())return BM();const e=i.getMergedTraits().mediaType;if(null!=t&&e){if("application/json"===e||e.endsWith("+json"))return $M.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??TP)(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 GM?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r)}return e}return structuredClone(t)}return t}}}class dU extends tU{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new uU(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new aU(this.settings);return e.setSerdeContext(this.serdeContext),e}}class fU extends WM{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 dU({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new eU(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"!==qP(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=oU(e.headers,"x-amzn-errortype");if(void 0!==n)return sU(e.headers[n]);if(t&&"object"==typeof t){const e=oU(t,"code");if(e&&void 0!==t[e])return sU(t[e]);if(void 0!==t.__type)return sU(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=rM.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 hU extends fU{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 pU="ref",gU=-1,mU=!0,vU="isSet",yU="PartitionResult",_U="booleanEquals",bU="getAttr",xU="stringEquals",SU={[pU]:"Endpoint"},wU={[pU]:yU},EU={[pU]:"Region"},kU={},CU=[EU],AU={conditions:[[vU,[SU]],[vU,CU],["aws.partition",CU,yU],[_U,[{[pU]:"UseFIPS"},mU]],[_U,[{fn:bU,argv:[wU,"supportsFIPS"]},mU]],[_U,[{[pU]:"UseDualStack"},mU]],[_U,[{fn:bU,argv:[wU,"supportsDualStack"]},mU]],[xU,[{fn:bU,argv:[wU,"name"]},"aws"]],[xU,[EU,"us-east-1"]],[xU,[EU,"us-east-2"]],[xU,[EU,"us-west-1"]],[xU,[EU,"us-west-2"]]],results:[[gU],[gU,"Invalid Configuration: FIPS and custom endpoint are not supported"],[gU,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[SU,kU],["https://cognito-idp-fips.us-east-1.amazonaws.com",kU],["https://cognito-idp-fips.us-east-2.amazonaws.com",kU],["https://cognito-idp-fips.us-west-1.amazonaws.com",kU],["https://cognito-idp-fips.us-west-2.amazonaws.com",kU],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",kU],[gU,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",kU],[gU,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",kU],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",kU],[gU,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",kU],[gU,"Invalid Configuration: Missing Region"]]},NU=1e8,TU=new Int32Array([-1,1,-1,0,17,3,1,4,NU+16,2,5,NU+16,3,9,6,5,7,NU+15,6,8,NU+14,7,NU+12,NU+13,4,11,10,5,NU+9,NU+11,5,12,NU+10,6,13,NU+9,8,NU+4,14,9,NU+5,15,10,NU+6,16,11,NU+7,NU+8,3,NU+1,18,5,NU+2,NU+3]),RU=eL.from(TU,2,AU.conditions,AU.results),DU=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"]}),IU=(e,t={})=>DU.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<xL;){const e=3*(Math.abs(s)-1),[t,r,i]=[n[e],n[e+1],n[e+2]],[c,u,d]=o[t],f=gL({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>=xL){const e=i[s-xL];if(-1===e[0]){const[,t]=e;throw new tL(fL(t,"Error",l))}const[t,n,r]=e;return{url:bL(t,l),properties:vL(n,l),headers:mL(r??{},l)}}throw new tL("No matching endpoint.")})(RU,{endpointParams:e,logger:t.logger}));rL.aws=EL;class FU extends Cz{constructor(e){super(e),Object.setPrototypeOf(this,FU.prototype)}}class OU extends FU{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,OU.prototype)}}class PU extends FU{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,PU.prototype)}}class MU extends FU{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,MU.prototype),this.reasonCode=e.reasonCode}}class LU extends FU{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,LU.prototype)}}class zU extends FU{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,zU.prototype)}}class jU extends FU{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,jU.prototype)}}class UU extends FU{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,UU.prototype)}}class BU extends FU{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,BU.prototype)}}class $U extends FU{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,$U.prototype)}}class qU extends FU{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,qU.prototype)}}class GU extends FU{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,GU.prototype)}}class VU extends FU{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,VU.prototype)}}class KU extends FU{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,KU.prototype)}}class WU extends FU{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,WU.prototype)}}class HU extends FU{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,HU.prototype)}}class JU extends FU{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,JU.prototype)}}class XU extends FU{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,XU.prototype)}}class QU extends FU{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,QU.prototype)}}class YU extends FU{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,YU.prototype)}}class ZU extends FU{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,ZU.prototype)}}class eB extends FU{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,eB.prototype)}}class tB extends FU{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,tB.prototype)}}class nB extends FU{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,nB.prototype)}}class rB extends FU{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,rB.prototype)}}class iB extends FU{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,iB.prototype)}}class oB extends FU{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,oB.prototype)}}class sB extends FU{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,sB.prototype)}}class aB extends FU{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,aB.prototype)}}class lB extends FU{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,lB.prototype)}}class cB extends FU{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,cB.prototype)}}class uB extends FU{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,uB.prototype)}}class dB extends FU{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,dB.prototype)}}class fB extends FU{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,fB.prototype)}}class hB extends FU{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,hB.prototype)}}class pB extends FU{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,pB.prototype)}}class gB extends FU{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,gB.prototype)}}class mB extends FU{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,mB.prototype)}}class vB extends FU{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,vB.prototype)}}class yB extends FU{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,yB.prototype)}}class _B extends FU{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,_B.prototype)}}class bB extends FU{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,bB.prototype)}}class xB extends FU{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,xB.prototype)}}class SB extends FU{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,SB.prototype)}}class wB extends FU{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,wB.prototype)}}class EB extends FU{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,EB.prototype)}}class kB extends FU{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,kB.prototype)}}class CB extends FU{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,CB.prototype)}}class AB extends FU{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,AB.prototype)}}class NB extends FU{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,NB.prototype)}}class TB extends FU{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,TB.prototype)}}class RB extends FU{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,RB.prototype)}}class DB extends FU{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,DB.prototype)}}class IB extends FU{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,IB.prototype)}}class FB extends FU{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,FB.prototype)}}class OB extends FU{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,OB.prototype)}}class PB extends FU{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,PB.prototype)}}class MB extends FU{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,MB.prototype)}}const LB="Session",zB="client",jB="error",UB="httpError",BB="message",$B="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",qB="server",GB="com.amazonaws.cognitoidentityprovider",VB=aM.for($B);var KB=[-3,$B,"CognitoIdentityProviderServiceException",0,[],[]];VB.registerError(KB,FU);const WB=aM.for(GB);var HB=[-3,GB,"AccessDeniedException",{[jB]:zB,[UB]:403},[BB],[0]];WB.registerError(HB,OU);var JB=[-3,GB,"AliasExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(JB,tB);var XB=[-3,GB,"CodeDeliveryFailureException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(XB,HU);var QB=[-3,GB,"CodeMismatchException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(QB,cB);var YB=[-3,GB,"ConcurrentModificationException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(YB,hB);var ZB=[-3,GB,"DeviceKeyExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(ZB,xB);var e$=[-3,GB,"DuplicateProviderException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(e$,wB);var t$=[-3,GB,"EnableSoftwareTokenMFAException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(t$,MB);var n$=[-3,GB,"ExpiredCodeException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(n$,uB);var r$=[-3,GB,"FeatureUnavailableInTierException",{[jB]:zB,[UB]:403},[BB],[0]];WB.registerError(r$,CB);var i$=[-3,GB,"ForbiddenException",{[jB]:zB,[UB]:403},[BB],[0]];WB.registerError(i$,pB);var o$=[-3,GB,"GroupExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(o$,SB);var s$=[-3,GB,"InternalErrorException",{[jB]:qB},[BB],[0]];WB.registerError(s$,PU);var a$=[-3,GB,"InternalServerException",{[jB]:qB},[BB],[0]];WB.registerError(a$,BU);var l$=[-3,GB,"InvalidEmailRoleAccessPolicyException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(l$,rB);var c$=[-3,GB,"InvalidLambdaResponseException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(c$,GU);var u$=[-3,GB,"InvalidOAuthFlowException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(u$,TB);var d$=[-3,GB,"InvalidParameterException",{[jB]:zB,[UB]:400},[BB,"reasonCode"],[0,0]];WB.registerError(d$,MU);var f$=[-3,GB,"InvalidPasswordException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(f$,JU);var h$=[-3,GB,"InvalidSmsRoleAccessPolicyException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(h$,XU);var p$=[-3,GB,"InvalidSmsRoleTrustRelationshipException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(p$,QU);var g$=[-3,GB,"InvalidUserPoolConfigurationException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(g$,nB);var m$=[-3,GB,"LimitExceededException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(m$,$U);var v$=[-3,GB,"ManagedLoginBrandingExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(v$,EB);var y$=[-3,GB,"MFAMethodNotFoundException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(y$,iB);var _$=[-3,GB,"NotAuthorizedException",{[jB]:zB,[UB]:403},[BB],[0]];WB.registerError(_$,LU);var b$=[-3,GB,"PasswordHistoryPolicyViolationException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(b$,dB);var x$=[-3,GB,"PasswordResetRequiredException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(x$,oB);var S$=[-3,GB,"PreconditionNotMetException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(S$,YU);var w$=[-3,GB,"RefreshTokenReuseException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(w$,IB);var E$=[-3,GB,"ResourceNotFoundException",{[jB]:zB,[UB]:404},[BB],[0]];WB.registerError(E$,zU);var k$=[-3,GB,"ScopeDoesNotExistException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(k$,RB);var C$=[-3,GB,"SoftwareTokenMFANotFoundException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(C$,fB);var A$=[-3,GB,"TermsExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(A$,kB);var N$=[-3,GB,"TierChangeNotAllowedException",{[jB]:zB,[UB]:403},[BB],[0]];WB.registerError(N$,AB);var T$=[-3,GB,"TooManyFailedAttemptsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(T$,VU);var R$=[-3,GB,"TooManyRequestsException",{[jB]:zB,[UB]:429},[BB],[0]];WB.registerError(R$,jU);var D$=[-3,GB,"UnauthorizedException",{[jB]:zB,[UB]:401},[BB],[0]];WB.registerError(D$,FB);var I$=[-3,GB,"UnexpectedLambdaException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(I$,KU);var F$=[-3,GB,"UnsupportedIdentityProviderException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(F$,DB);var O$=[-3,GB,"UnsupportedOperationException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(O$,sB);var P$=[-3,GB,"UnsupportedTokenTypeException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(P$,OB);var M$=[-3,GB,"UnsupportedUserStateException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(M$,ZU);var L$=[-3,GB,"UserImportInProgressException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(L$,UU);var z$=[-3,GB,"UserLambdaValidationException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(z$,WU);var j$=[-3,GB,"UsernameExistsException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(j$,eB);var U$=[-3,GB,"UserNotConfirmedException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(U$,aB);var B$=[-3,GB,"UserNotFoundException",{[jB]:zB,[UB]:404},[BB],[0]];WB.registerError(B$,qU);var $$=[-3,GB,"UserPoolAddOnNotEnabledException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError($$,lB);var q$=[-3,GB,"UserPoolTaggingException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(q$,NB);var G$=[-3,GB,"WebAuthnChallengeNotFoundException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(G$,gB);var V$=[-3,GB,"WebAuthnClientMismatchException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(V$,mB);var K$=[-3,GB,"WebAuthnConfigurationMissingException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(K$,PB);var W$=[-3,GB,"WebAuthnCredentialNotSupportedException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(W$,vB);var H$=[-3,GB,"WebAuthnNotEnabledException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(H$,yB);var J$=[-3,GB,"WebAuthnOriginNotAllowedException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(J$,_B);var X$=[-3,GB,"WebAuthnRelyingPartyMismatchException",{[jB]:zB,[UB]:400},[BB],[0]];WB.registerError(X$,bB);const Q$=[VB,WB];var Y$=[0,GB,"ClientIdType",8,0],Z$=[0,GB,"SessionType",8,0],eq=[0,GB,"TokenModelType",8,0],tq=[3,GB,"AnalyticsMetadataType",0,["AnalyticsEndpointId"],[0]],nq=[3,GB,"AuthenticationResultType",0,["AccessToken","ExpiresIn","TokenType","RefreshToken","IdToken","NewDeviceMetadata"],[[()=>eq,0],1,0,[()=>eq,0],[()=>eq,0],()=>oq]],rq=[3,GB,"InitiateAuthRequest",0,["AuthFlow","ClientId","AuthParameters","ClientMetadata","AnalyticsMetadata","UserContextData",LB],[0,[()=>Y$,0],[()=>aq,0],128,()=>tq,[()=>sq,0],[()=>Z$,0]],2],iq=[3,GB,"InitiateAuthResponse",0,["ChallengeName",LB,"ChallengeParameters","AuthenticationResult","AvailableChallenges"],[0,[()=>Z$,0],128,[()=>nq,0],64]],oq=[3,GB,"NewDeviceMetadataType",0,["DeviceKey","DeviceGroupKey"],[0,0]],sq=[3,GB,"UserContextDataType",8,["IpAddress","EncodedData"],[0,0]],aq=[2,GB,"AuthParametersType",8,0,0],lq=[9,GB,"InitiateAuth",0,()=>rq,()=>iq];const cq=e=>{const t=(({defaultsMode:e}={})=>Vz(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(Zj()?"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 ${Yj.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(Nz),r=(e=>({apiVersion:"2016-04-18",base64Decoder:e?.base64Decoder??kP,base64Encoder:e?.base64Encoder??TP,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??IU,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Ej,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Gz},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new XM}],logger:e?.logger??new Iz,protocol:e?.protocol??hU,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:Q$,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??KP,utf8Decoder:e?.utf8Decoder??CP,utf8Encoder:e?.utf8Encoder??NP}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Qj,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Wj({serviceId:r.serviceId,clientVersion:Cj}),maxAttempts:e?.maxAttempts??3,region:e?.region??Jj("Region is missing"),requestHandler:MP.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||AL),sha256:e?.sha256??Kj,streamCollector:e?.streamCollector??zP,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))}};class uq extends xz{config;constructor(...[e]){const t=cq(e||{});super(t),this.initConfig=t;var n;const r=function(e){const t=xP(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=gz(r),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,o=null!=n?async()=>cz(await pP(n)()):void 0,s=!!n,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:s,useDualstackEndpoint:pP(r??!1),useFipsEndpoint:pP(i??!1)});let l;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!l&&(l=lz(e.serviceId)),l),a})(YL(i)),s=(e=>{const t=Sj(e);return Object.assign(t,{authSchemePreference:pP(e.authSchemePreference??[])})})(o),a=((e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),Rz(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()},Dz(n),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n))})(s,e?.extensions||[]);this.config=a,this.middlewareStack.use(XP(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.add(WL(e),JL)}}))(this.config)),this.middlewareStack.use(jz(this.config)),this.middlewareStack.use(tz(this.config)),this.middlewareStack.use(uP(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(Ine){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:Ine,metadata:Ine.$metadata}),Ine}},dP)}})),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add(e=>async t=>e(t),fP)}})),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(gP(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),mP)}}))(this.config,{httpAuthSchemeParametersProvider:wj,identityProviderConfigProvider:async e=>new JM({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(bP(this.config))}destroy(){super.destroy()}}class dq extends(Ez.classBuilder().ep(kj).m(function(e,t,n,r){return[hz(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(lq).build()){}let fq="reventless.role-switched",hq="activeRole",pq="availableRoles",gq="activeRoleStale";function mq(e){return e.split(",").map(e=>e.trim()).filter(e=>""!==e)}function vq(e){let t=t=>U(j(e[t],Je.string),""),n=me(U(j(e.groups,Je.array),[]),Je.string),r=t=>j(j(j(e.claims,Je.object),e=>e[t]),Je.string);return{userId:t("userId"),username:t("username"),groups:n,provider:t("provider"),activeRole:r(hq),availableRoles:L(r(pq),[],mq),staleRole:r(gq)}}function yq(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([hq,t])}),0!==i.length&&e.push([pq,i.join(",")]),M(o,t=>{e.push([gq,t])}),t=[["claims",Object.fromEntries(e)]]}return Object.fromEntries(n.concat(t))}function _q(e,t){let n=[["token",t.token],["identity",yq(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 bq(e){let t=t=>j(e[t],Je.string),n=me(U(j(e["cognito:groups"],Je.array),[]),Je.string);return{userId:U(t("sub"),""),username:U(B(t("cognito:username"),t("email")),""),groups:n,provider:"Cognito",activeRole:t(hq),availableRoles:L(t(pq),[],mq),staleRole:t(gq)}}async function xq(e){try{let t=await e.text();return JSON.parse(t)}catch(t){return}}function Sq(e,t){return t+" (HTTP "+e.status.toString()+")"}function wq(e){return JSON.stringify(void 0!==e?Object.fromEntries([["activeRole",e]]):{})}async function Eq(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 xq(i),Je.object),e=>e.errors),Je.array),e=>e.at(0)),Je.object),e=>e.message),Je.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:rP(nP(F(r)))}}}function kq(e){try{return function(e,t){if("string"!=typeof e)throw new YO("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 YO(`Invalid token specified: missing part #${n+1}`);let i;try{i=ZO(r)}catch(_U){throw new YO(`Invalid token specified: invalid base64 for part #${n+1} (${_U.message})`)}try{return JSON.parse(i)}catch(_U){throw new YO(`Invalid token specified: invalid json for part #${n+1} (${_U.message})`)}}(e)}catch(t){return}}function Cq(e){let t=e.IdToken;if(void 0===t)return;let n=kq(t);if(void 0===n)return;let r=e.ExpiresIn,i=void 0!==r?Date.now()+1e3*r:void 0;return{token:t,identity:bq(n),refreshToken:e.RefreshToken,expiresAt:i}}async function Aq(e,t,n,r){try{let i=new uq({region:t}),o=new dq({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(kq(a),bq),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:rP(nP(F(i)))}}}let Nq=l(void 0),Tq=Nq.Provider;let Rq=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=Je.object(e);if(void 0===n)return;let r=j(n.token,Je.string),i=n.identity,o=j(n.refreshToken,Je.string),s=j(n.expiresAt,Je.float);return void 0!==r&&void 0!==i?z(Je.object(i),e=>({token:r,identity:vq(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(()=>{Aq(r,n,e,i).then(e=>{if("Ok"===e.TAG){let t=e._0;return _q(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 uq({region:t}),o=new dq({ClientId:e,AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:Object.fromEntries([["USERNAME",n],["PASSWORD",r]])}),s=j((await i.send(o)).AuthenticationResult,Cq);return void 0!==s?{TAG:"Ok",_0:s}:{TAG:"Error",_0:"Cognito returned no usable tokens"}}catch(i){return{TAG:"Error",_0:rP(nP(F(i)))}}}(r,n,e,t);if("Ok"!==i.TAG)return{TAG:"LoginErr",_0:i._0};let o=i._0;return _q(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 xq(n);if(n.ok){let e=j(r,Je.object);if(void 0===e)return{TAG:"LoginErr",_0:"Malformed login response"};let t=j(e.token,Je.string),n=j(e.identity,Je.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:vq(n),refreshToken:void 0,expiresAt:void 0};return _q(l,i),d(e=>i),"LoginOk"}let o=U(j(j(j(r,Je.object),e=>e.error),Je.string),Sq(n,"Login failed"));return{TAG:"LoginErr",_0:o}}}catch(s){return{TAG:"LoginErr",_0:rP(nP(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 Eq(i,f.token,e);if("Ok"!==s.TAG)return{TAG:"LoginErr",_0:s._0};let a=await Aq(r,n,o,f.identity),c=0;if("Ok"===a.TAG){let t=a._0;if(vt(t.identity.activeRole,e))return _q(l,t),sessionStorage.setItem(fq,"1"),d(e=>t),"LoginOk";c=2}else c=2;if(2===c)return await Eq(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:wq(e)}),n=await xq(t);if(!t.ok)return{TAG:"LoginErr",_0:U(j(j(j(n,Je.object),e=>e.error),Je.string),Sq(t,"Could not switch role"))};let r=j(n,Je.object);if(void 0===r)return{TAG:"LoginErr",_0:"Malformed switch response"};let o=j(r.token,Je.string),s=j(r.identity,Je.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:vq(s),refreshToken:void 0,expiresAt:void 0};return _q(l,a),sessionStorage.setItem(fq,"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(Tq,{value:m,children:e.children})};function Dq(){return d(Nq)}function Iq(e){let t=globalThis.window;if(null!=t)try{return R(t.matchMedia(e))}catch(n){return}}function Fq(e){let t=Iq(e);if(void 0===t)return!1;try{return D(t).matches}catch(n){return!1}}function Oq(e){let t=s(()=>Fq(e)),n=t[1];return a(()=>{n(t=>Fq(e));let t=Iq(e);if(void 0===t)return;let r=D(t),i=()=>n(t=>Fq(e));try{return r.addEventListener("change",i),()=>{try{return void r.removeEventListener("change",i)}catch(e){return}}}catch(o){return}},[e]),t[0]}function Pq(){return{compact:Oq(At.compact),narrow:Oq(At.narrow),tight:Oq(At.tight)}}function Mq(e){return e.tight?"Tight":e.narrow?"Narrow":e.compact?"Compact":"Wide"}function Lq(){return Mq(Pq())}let zq={background:"var("+_t.surface+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",display:"inline-flex",fontFamily:"var("+xt.fontFamily+")",fontSize:"var("+xt.sizeSm+")",fontWeight:"var("+xt.weightMedium+")",lineHeight:"1",padding:"0.375rem 0.75rem",borderRadius:"var("+St.md+")",alignItems:"center",gap:"0.375rem"},jq={color:"var("+_t.textSecondary+")",fontSize:"0.625rem"},Uq={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",minWidth:"200px",padding:"0.75rem 1rem",position:"absolute",right:"0",top:"calc(100% + 0.5rem)",zIndex:"10",borderRadius:"var("+St.md+")",boxShadow:"var("+Et+")"},Bq={background:"var("+_t.brandSubtle+")",color:"var("+_t.brand+")",display:"inline-block",fontSize:"var("+xt.sizeXs+")",marginRight:"0.25rem",marginBottom:"0.25rem",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"},$q={border:"none",borderTop:"1px solid var("+_t.borderSubtle+")",margin:"0.5rem 0"},qq={background:"transparent",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"0.375rem 0.5rem",width:"100%",borderRadius:"var("+St.sm+")"},Gq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",letterSpacing:"0.04em",marginBottom:"0.25rem",textTransform:"uppercase"};let Vq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")"},Kq={color:"var("+_t.textSecondary+")",fontWeight:"var("+xt.weightNormal+")"},Wq={background:"transparent",border:"none",color:"var("+_t.textSecondary+")",cursor:"pointer",display:"block",fontFamily:"var("+xt.fontFamily+")",fontSize:"var("+xt.sizeSm+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+St.sm+")"},Hq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"},Jq={color:"var("+_t.error+")",fontSize:"var("+xt.sizeXs+")",marginTop:"0.25rem"},Xq={color:"var("+_t.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"};function Qq(e){let t=e.trim()[0];return void 0!==t&&""!==t.trim()?t.toUpperCase():"☺"}function Yq(e,t){if(!e)return[];let n=t.availableRoles;return 0!==n.length?n:t.groups}let Zq=function(e){let t=Dq(),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=Oq(At.compact);if(void 0===t)return null;let m=t.identity;if(void 0===m)return null;let v,y=Yq(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:Gq}),void 0!==t?null:i("div",{children:"All of them — choose one to narrow.",style:Hq}),y.map(e=>{let t=vt(m.activeRole,e);return r("button",{children:[e,t?i("span",{children:"✓",style:Vq}):null],"aria-checked":t?"true":"false",role:"radio",style:(n=t,{background:"transparent",border:"none",color:"var("+_t.textPrimary+")",cursor:n?"default":"pointer",display:"flex",fontSize:"var("+xt.sizeSm+")",fontWeight:"var("+(n?xt.weightMedium:xt.weightNormal)+")",padding:"0.3125rem 0.5rem",textAlign:"left",width:"100%",borderRadius:"var("+St.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:$q}),i("button",{children:"Stop acting as one role",style:Wq,disabled:d,onClick:e=>b(void 0)})]}):null,void 0!==p?i("div",{children:p,style:Jq}):null]})}else e=null;v=r("div",{children:[i("div",{children:m.username,style:{fontSize:"var("+xt.sizeMd+")",fontWeight:"var("+xt.weightMedium+")",marginBottom:"0.25rem"}}),0!==m.groups.length&&y.length<=1?i("div",{children:m.groups.map(e=>i("span",{children:e,style:Bq},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:Xq}):null,e,i("hr",{style:$q}),i("button",{children:"Sign out",style:qq,onClick:e=>{a(e=>!1),t.logout()}})],style:Uq})}else v=null;return r("div",{children:[r("button",{children:[g?Qq(m.username):r(o,{children:[m.username,void 0!==_?i("span",{children:"· "+_,style:Kq}):null]}),i("span",{children:l?"▴":"▾",style:jq})],"aria-label":void 0!==_?"Signed in as "+m.username+", acting as "+_:"Signed in as "+m.username,style:zq,onClick:e=>a(e=>!e)}),v],style:{position:"relative"}})},eG={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"360px",padding:"2rem",borderRadius:"var("+St.md+")"},tG={color:"var("+_t.textSecondary+")",display:"block",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.25rem"},nG={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",fontSize:"var("+xt.sizeMd+")",marginBottom:"1rem",padding:"0.5rem 0.75rem",width:"100%",borderRadius:"var("+St.sm+")",boxSizing:"border-box"};function rG(e){return{background:e?"var("+_t.textDisabled+")":"var("+_t.brand+")",border:"none",color:"var("+_t.textOnBrand+")",cursor:e?"not-allowed":"pointer",fontSize:"var("+xt.sizeMd+")",fontWeight:"var("+xt.weightMedium+")",padding:"0.625rem",width:"100%",borderRadius:"var("+St.sm+")"}}let iG={color:"var("+_t.error+")",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.75rem"};let oG=function(e){let t=Dq(),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("+xt.sizeXl+")",fontWeight:"var("+xt.weightBold+")",margin:"0 0 1.5rem"}}),r("form",{children:[i("label",{children:"Username",style:tG}),i("input",{style:nG,autoComplete:"username",autoFocus:!0,type:"text",value:a,onChange:e=>{let t=e.target.value;o(e=>t)}}),i("label",{children:"Password",style:tG}),i("input",{style:nG,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:iG}):null,i("button",{children:m?"Signing in…":"Sign in",style:rG(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:eG})};let sG=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=Le(e,t);return"object"!=typeof n?void 0:T(n._0)}(e.routes,r),i)};let aG=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)}})},lG=l(void 0),cG=lG.Provider;let uG=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(cG,{value:u,children:e.children})};function dG(){let e=d(lG);return void 0!==e?e.getPages():[]}function fG(e){return!U(e.menuEntry.hidden,!1)}let hG=l({activeAccess:[],hasAccess:function(e){return!1}}),pG=hG.Provider;function gG(){return d(hG).hasAccess}let mG=function(e){let t=e.access,n={activeAccess:t,hasAccess:e=>t.some(t=>t===e)};return c(pG,{value:n,children:e.children})};function vG(e){return"var("+e+")"}let yG=co([gi("flex"),di("center"),ui("gap",vG(bt.sm)),ui("padding","6px var("+bt.sm+") 6px 14px"),ui("border-radius",vG(St.md)),ui("color",vG(_t.textDisabled)),ui("font-size",vG(xt.sizeSm)),pi("notAllowed"),Gi("none")]),_G=co([ui("font-size","14px"),yi(0)]),bG=co([vi(1),ui("font-weight",vG(xt.weightMedium))]),xG=co([ui("font-size",vG(xt.sizeXs)),ui("color",vG(_t.brand)),pi("pointer"),ui("text-decoration","none"),yi(0)]);let SG=function(e){return r("div",{children:[i("span",{children:"[locked]",className:_G}),i("span",{children:e.label,className:bG}),i("span",{children:"Upgrade",className:xG})],className:yG})};function wG(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r?0:n<r?-1:1}function EG(e,t){return e.menuEntry.sortOrder===t.menuEntry.sortOrder?wG(e.menuEntry.label,t.menuEntry.label):de(e.menuEntry.sortOrder,t.menuEntry.sortOrder)}function kG(e){return ge(e,999,(e,t)=>e<t.menuEntry.sortOrder?e:t.menuEntry.sortOrder)}function CG(e){return"var("+e+")"}let AG=co([gi("flex"),mi("column"),ui("gap","2px"),ui("padding","var("+bt.sm+")"),Wi("& a",[ui("text-decoration","none"),ui("color","inherit"),ui("display","block"),ui("outline-offset","2px")])]),NG=co([ui("color",CG(_t.textDisabled)),ui("font-size",CG(xt.sizeXs)),ui("font-weight",CG(xt.weightBold)),ui("letter-spacing","0.08em"),ui("text-transform","uppercase"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),Ti(to(12)),Ri(to(2))]),TG=co([Ui("relative"),gi("flex"),di("center"),ui("gap",CG(bt.sm)),ui("padding","6px var("+bt.sm+") 6px 14px"),ui("color",CG(_t.textSecondary)),ui("font-size",CG(xt.sizeMd)),ui("line-height","1.4"),pi("pointer"),ui("border-radius",CG(St.md)),ui("text-decoration","none"),ui("transition","background-color 140ms ease, color 140ms ease, transform 140ms ease"),Wi("&::before",[ui("content","''"),Ui("absolute"),ui("left","4px"),ui("top","50%"),ui("width","3px"),ui("height","0"),ui("border-radius",CG(St.full)),ui("background",CG(_t.brand)),ui("transform","translateY(-50%)"),ui("transition","height 160ms ease")]),Yi([ui("background",CG(_t.surfaceSubtle)),ui("color",CG(_t.textPrimary)),ui("transform","translateX(2px)")]),Hi("(prefers-reduced-motion: reduce)",[ui("transition","none"),Yi([ui("transform","none")]),Wi("&::before",[ui("transition","none")])])]),RG=co([ui("background",CG(_t.brandSubtle)),ui("color",CG(_t.textPrimary)),ui("font-weight",CG(xt.weightMedium)),Wi("&::before",[ui("height","56%")]),Yi([ui("background",CG(_t.brandSubtle)),ui("color",CG(_t.textPrimary)),ui("transform","none")])]),DG=co([ui("font-size","14px"),ui("line-height","1"),yi(0)]),IG=co([ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),FG=co([ui("font-size","12px"),ui("color",CG(_t.textDisabled)),Ai("auto"),yi(0)]);function OG(e,t){let n=e.url;return void 0!==n&&(n===t||t.startsWith(n+"/"))}function PG(e){let t=e.onNavigate,n=e.hasAccess,s=e.isActive,a=e.page,l=L(a.requiredAccess,!1,e=>!n(e)),c=s?TG+" "+RG:TG,u=r(o,{children:[L(a.menuEntry.icon,null,e=>i("span",{children:e,"aria-hidden":!0,className:DG})),i("span",{children:a.menuEntry.label,className:IG}),l?i("span",{children:"[locked]",className:FG}):null]}),d=a.url;return l||void 0===d?i("div",{children:u,className:c,role:"button"}):i(aG,{route:d,children:i("span",{children:u,"aria-current":s?"page":void 0,className:c,onClick:e=>t()})})}function MG(e){let t=e.onNavigate,n=e.hasAccess,s=e.currentUrl,a=e.pages.toSorted(EG);return r(o,{children:[L(e.label,null,e=>i("div",{children:e,className:NG})),a.map(e=>i(PG,{page:e,isActive:OG(e,s),hasAccess:n,onNavigate:t},e.fragmentId))]})}let LG=function(e){let t=e.onNavigate,n=e.currentUrl,o=void 0!==t?t:()=>{},s=dG(),a=gG(),l=s.filter(fG),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=kG(e[1]),r=kG(t[1]);return n===r?wG(e[0],t[0]):de(n,r)});return r("nav",{children:[0!==u.length?i(MG,{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(MG,{label:r,pages:t,currentUrl:n,hasAccess:a,onNavigate:o},r);case"Locked":return i(SG,{label:r},r);case"Absent":return null}})],"aria-label":"primary navigation",className:AG})},zG=l(void 0),jG=l(void 0),UG=zG.Provider,BG=jG.Provider;let $G=function(e){return c(UG,{value:e.target,children:c(BG,{value:e.controlsTarget,children:e.children})})};function qG(){return d(zG)}function GG(e,t){return void 0!==e?w(t,D(e)):t}function VG(e){return"var("+e+")"}let KG="52px",WG=co([gi("flex"),mi("row"),bi({NAME:"vh",VAL:100}),ui("overflow","hidden"),ui("background",VG(_t.background)),ui("font-family",VG(xt.fontFamily)),ui("color",VG(_t.textPrimary))]),HG=co([gi("flex"),mi("column"),ui("width","236px"),yi(0),ui("background",VG(_t.surface)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden"),Hi(At.compact,[Ui("fixed"),qi(to(0)),Si(to(0)),hi(to(0)),ui("width","min(268px, 82vw)"),ui("z-index","950"),ui("box-shadow",VG(kt)),ui("transform","translateX(-100%)"),ui("visibility","hidden"),ui("transition","transform 180ms ease, visibility 0s linear 180ms")]),Hi("(prefers-reduced-motion: reduce)",[ui("transition","none")])]),JG=uo([HG,co([Hi(At.compact,[ui("transform","translateX(0)"),ui("visibility","visible"),ui("transition","transform 180ms ease, visibility 0s linear 0s")])])]),XG=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.45)"),ui("z-index","900"),ui("display","none"),Hi(At.compact,[ui("display","block")])]),QG=co([ui("display","none"),Hi(At.compact,[ui("display","inline-flex")]),di("center"),xi("center"),ui("vertical-align","middle"),ui("margin-right",VG(bt.sm)),ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",VG(St.md)),ui("padding","2px var("+bt.sm+")"),ui("color",VG(_t.textSecondary)),ui("font-size",VG(xt.sizeMd)),ui("line-height","1.6"),pi("pointer"),Yi([ui("background",VG(_t.surfaceSubtle)),ui("color",VG(_t.textPrimary))])]),YG=co([gi("flex"),di("center"),ui("gap",VG(bt.sm)),ui("height",KG),yi(0),ui("padding","0 var("+bt.md+")"),ui("color",VG(_t.textPrimary)),ui("font-size",VG(xt.sizeLg)),ui("font-weight",VG(xt.weightBold)),ui("letter-spacing","-0.01em")]),ZG=co([ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),eV=co([vi(1),ui("overflow-y","auto"),ui("min-height","0")]),tV=co([gi("flex"),mi("column"),vi(1),ui("min-width","0"),ui("overflow","hidden")]),nV=co([gi("flex"),di("center"),ui("min-height",KG),yi(0),ui("padding","var("+bt.xs+") var("+bt.lg+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("background",VG(_t.surface))]),rV=co([ui("display","flow-root"),vi(1),ui("min-width","0")]),iV=co([ui("display","contents")]),oV=co([ui("float","right"),gi("flex"),di("center"),xi("flexEnd"),ui("flex-wrap","wrap"),ui("gap",VG(bt.sm)),ui("margin-left",VG(bt.md)),ui("max-width","100%"),Wi("& > *, & > ."+iV+" > *",[ui("min-width","0"),ui("max-width","100%")])]),sV=co([ui("display","block"),ui("min-width","0")]),aV=co([gi("flex"),mi("column"),vi(1),ui("overflow","auto"),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("background",VG(_t.background))]),lV="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])";let cV=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=Oq(At.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(lV))[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(lV)),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:ZG,title:c})],className:YG}),i("div",{children:i(LG,{currentUrl:g,onNavigate:k}),className:eV})],ref:T(A),className:w?JG:HG,id:"rv-shell-nav"}),w?i("div",{"aria-hidden":!0,className:XG,onClick:e=>k()}):null,r("main",{children:[i("div",{children:r("div",{children:[r("div",{children:[i("div",{ref:T(e=>b(_,e)),className:iV}),U(e.headerSlot,null)],className:oV}),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:sV})],className:rV}),className:nV}),i("div",{children:i($G,{target:m[0],controlsTarget:y[0],children:d?i(sG,{url:g,routes:e.router,children:u}):p}),className:aV})],className:tV})],className:WG})},uV=l(void 0),dV=uV.Provider;let fV=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(dV,{value:f,children:e.children})};function hV(e){return"/"+e.environment+"/"+e.platformName}function pV(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=hV(o),a=t.startsWith(s)?t.slice(s.length):"/";return[o,""===a?"/":a]}let gV=l(void 0).Provider;let mV=function(e){return c(gV,{value:e.scope,children:e.children})};let vV=l(void 0),yV=l({routes:[],publicLinks:{}}),_V=l(!1),bV=vV.Provider;function xV(e){return c(bV,{value:e.value,children:e.children})}let SV=yV.Provider;function wV(e){return c(SV,{value:e.value,children:e.children})}let EV=_V.Provider;function kV(e){return c(EV,{value:e.value,children:e.children})}let CV=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=qe(r.publicLinks,l.publicLinks),h={routes:d,publicLinks:f},p={register:(e,t)=>n(n=>({routes:n.routes.concat(e),publicLinks:qe(n.publicLinks,t)})),setPluginRoutes:(e,t)=>{a(n=>({routes:e,publicLinks:t})),u(e=>!0)}};return i(xV,{value:p,children:i(kV,{value:c[0],children:i(wV,{value:h,children:i(Ke,{registry:f,children:e.children})})})})};function AV(){return d(vV)}function NV(e){return"var("+e+")"}let TV=co([ui("position","relative"),gi("inlineFlex")]),RV=co([gi("inlineFlex"),di("center"),ui("gap","3px"),ui("background",NV(_t.surface)),ui("color",NV(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",NV(St.md)),ui("padding","2px var("+bt.xs+")"),ui("font-family",NV(xt.fontFamily)),ui("font-size",NV(xt.sizeMd)),ui("line-height","1.4"),pi("pointer"),Yi([ui("background",NV(_t.surfaceSubtle))])]),DV=co([ui("font-size","0.625rem"),ui("color",NV(_t.textSecondary))]),IV=co([ui("position","absolute"),ui("top","calc(100% + 0.5rem)"),ui("right","0"),ui("min-width","170px"),ui("padding",NV(bt.xs)),ui("background",NV(_t.surfaceElevated)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",NV(St.md)),ui("box-shadow",NV(Et)),ui("z-index","10")]),FV=co([gi("flex"),di("center"),ui("gap",NV(bt.sm)),ui("width","100%"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("background","transparent"),ui("border","none"),ui("border-radius",NV(St.sm)),ui("color",NV(_t.textPrimary)),ui("font-family",NV(xt.fontFamily)),ui("font-size",NV(xt.sizeSm)),ui("text-align","left"),pi("pointer"),Yi([ui("background",NV(_t.surfaceSubtle))])]),OV=uo([FV,co([ui("font-weight",NV(xt.weightMedium))])]),PV=co([ui("font-size",NV(xt.sizeMd)),ui("line-height","1"),ui("width","1.25em"),ui("text-align","center"),yi(0)]),MV=co([ui("margin-left","auto"),ui("color",NV(_t.textSecondary)),ui("font-size",NV(xt.sizeXs))]);function LV(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"High contrast"}}function zV(e){switch(e){case"Dark":return"☾";case"Light":return"☀";case"Neutral":return"◯";case"HighContrast":return"◐"}}let jV=["Light","Dark","Neutral","HighContrast"];let UV=function(e){let t=tO(),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:zV(o),"aria-hidden":!0}),i("span",{children:u?"▴":"▾","aria-hidden":!0,className:DV})],"aria-label":"Theme: "+LV(o),"aria-expanded":u,"aria-haspopup":"menu",className:RV,title:"Theme: "+LV(o),onClick:e=>c(e=>!e)}),u?i("div",{children:jV.map(e=>{let t=e===o;return r("button",{children:[i("span",{children:zV(e),"aria-hidden":!0,className:PV}),LV(e),t?i("span",{children:"✓",className:MV}):null],"aria-checked":t?"true":"false",className:t?OV:FV,role:"radio",onClick:t=>{n(e),c(e=>!1)}},iO(e))}),"aria-label":"Theme",className:IV,role:"radiogroup"}):null],ref:T(d),className:TV})};function BV(e){return Object.fromEntries([["eq",e]])}let $V=/\$filter\s*:\s*[A-Za-z0-9_]*Filter\b/,qV=/\$filter\s*:/,GV={};function VV(e){return t=>(n,r)=>$V.test(n)?t(n,function(e,t){let n=Je.object(e),r=void 0!==n?Object.fromEntries(Object.entries(n)):{},i=j(r.filter,Je.object),o=void 0!==i?Object.fromEntries(Object.entries(i)):{};return o.environment=BV(t.environment),o.platformName=BV(t.platformName),r.filter=o,r}(r,e)):(qV.test(n)&&function(e){void 0!==GV[e]||(GV[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 KV={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"480px",padding:"2rem",borderRadius:"var("+St.md+")"},WV={background:"var("+_t.surfaceElevated+")",border:"1px solid var("+_t.border+")",color:"var("+_t.textPrimary+")",cursor:"pointer",display:"flex",fontSize:"var("+xt.sizeMd+")",marginBottom:"0.5rem",padding:"0.75rem 1rem",textAlign:"left",width:"100%",borderRadius:"var("+St.sm+")",alignItems:"center",justifyContent:"space-between"},HV={background:"var("+_t.brandSubtle+")",color:"var("+_t.brand+")",fontSize:"var("+xt.sizeXs+")",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"};let JV=function(e){let t,n=e.discover,o=AI(),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("+_t.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:HV})],style:WV,onClick:t=>J(hV(e)+"/")},e.environment+"/"+e.platformName)):i("div",{children:"No platforms discovered.",style:{color:"var("+_t.textSecondary+")"}})}else t=i("div",{children:u._0,style:{color:"var("+_t.error+")",fontSize:"var("+xt.sizeSm+")"}});return r("div",{children:[i("h1",{children:"Select a platform",style:{fontSize:"var("+xt.sizeXl+")",fontWeight:"var("+xt.weightBold+")",margin:"0 0 1.5rem"}}),t],style:KV})};function XV(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?XV(j(s,e=>e.scopedLabel)):void 0,l=void 0!==a?a:XV(j(s,e=>e.label));return{label:U(l,t),icon:void 0,group:U(XV(j(s,e=>e.group)),e),sortOrder:U(j(s,e=>e.order),n),hidden:j(s,e=>e.hidden)}}function YV(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 ZV={contents:[]};function eK(e){if(!ZV.contents.includes(e))return ZV.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 tK(e,t){return j(Xe(e,t),dt)}function nK(e){let t=U(ht(e),{}),n=U(j(Xe(t,"meta"),ht),{}),r=me(U(j(Xe(t,"tags"),pt),[]),e=>{let t=U(ht(e),{}),n=tK(t,"key"),r=tK(t,"value");if(void 0!==n&&void 0!==r)return[n,r]}),i=tK(t,"position"),o=tK(t,"eventType");if(void 0===i)return;if(void 0===o)return;let s=U(tK(n,"time"),U(tK(t,"recordedAt"),""));return{position:i,eventType:o,payload:U(Xe(t,"payload"),{}),tags:r,actor:tK(n,"user"),time:s,recordedAt:U(tK(t,"recordedAt"),s)}}function rK(e,t){return lt(e.startsWith(t)&&e.length>t.length?e.slice(t.length):e).toLowerCase()}function iK(e){let t={};return e.map(e=>{let n=JSON.stringify(Ze(Qe(t)),null,2);var r;return(r=e.payload,U(z(ht(r),Qe),[]).filter(e=>"TAG"!==e[0])).forEach(e=>{t[e[0]]=e[1]}),[n,JSON.stringify(Ze(Qe(t)),null,2)]})}function oK(e,t){let n=iK(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:rK(e.eventType,t),subject:o,actor:U(e.actor,"System"),timestamp:e.time,before:i[0],after:i[1]}}).toReversed()}function sK(e){let t=[];return e.forEach(e=>M(e.actor,e=>t.includes(e)?void 0:void t.push(e))),t.toSorted(ue)}function aK(e){let t=[];return e.forEach(e=>t.includes(e.eventType)?void 0:void t.push(e.eventType)),t.toSorted(ue)}function lK(e){return"var("+e+")"}let cK=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",lK(bt.lg)),ui("padding",lK(bt.xxl)),Vi({NAME:"percent",VAL:100}),bi({NAME:"percent",VAL:100}),$i("center"),ui("min-height","400px")]),uK=co([ui("font-size","48px"),ui("line-height","1")]),dK=co([ui("color",lK(_t.textPrimary)),ui("font-size",lK(xt.sizeXxl)),ui("font-weight",lK(xt.weightBold)),ki(to(0))]),fK=co([ui("color",lK(_t.textSecondary)),ui("font-size",lK(xt.sizeLg)),ui("line-height",lK(xt.lineHeightRelaxed)),ui("max-width","480px"),ki(to(0))]),hK=co([ui("background",lK(_t.brand)),ui("color",lK(_t.textOnBrand)),ui("border-radius",lK(St.md)),ui("padding","var("+bt.sm+") var("+bt.lg+")"),ui("font-size",lK(xt.sizeMd)),ui("font-weight",lK(xt.weightMedium)),ui("border","none"),ui("cursor","pointer"),Ti(to(8))]);let pK=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:uK}),i("h2",{children:t.title,className:dK}),i("p",{children:L(t.requiredAccess,"This feature requires an upgrade.",e=>'This feature requires the "'+e+'" access tier.'),className:fK}),i("button",{children:"Upgrade to unlock",className:hK})],className:cK})};let gK=function(e){let t=e.children,n=e.definition,r=gG(),o=n.requiredAccess;return void 0===o||r(o)?t:i(pK,{definition:n})},mK=Xe;function vK(e,t){let n=j(t[0],t=>Xe(e,t));if(void 0!==n&&t.every(t=>vt(Xe(e,t),n)))return n}function yK(e,t,n){let r=Xe(e,t);return void 0===r||n(r)}function _K(e,t,n){return me(t,t=>{let r=Xe(e,t);if(void 0!==r&&!n(r))return t+': requires "'+r+'"'})}let bK=["body","text","message","comment","content"],xK=["author","createdby","user","commenter","postedby"],SK=["createdat","postedat","at","commentedat"];function wK(e){return me(xa(e),e=>{if(Ea(e[1]))return e[0]})}function EK(e,t){return wK(e).find(e=>t.includes(e.toLowerCase()))}function kK(e){let t=Ua(e,void 0,void 0),n=xa(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:EK(e,xK)}function CK(e){return wK(e).filter(e=>{let t=e.toLowerCase();return"id"!==t&&t.endsWith("id")})}function AK(e,t){let n=tt(t).toLowerCase();return CK(e).find(e=>e.toLowerCase()===n+"id")}function NK(e,t){let n=e.toLowerCase(),r=t.toLowerCase(),i=tt(t).toLowerCase();return!!n.endsWith("comments")&&(n===i+"comments"||n===r+"comments")}let TK=["addcomment","postcomment","comment","writecomment","leavecomment"];function RK(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=>TK.some(t=>e.name.toLowerCase().startsWith(t)))}let DK={contents:[]};function IK(e,t){return me(e.readModels.filter(e=>e.name!==t&&(!!L(j(ht(e.schema),e=>Xe(e,"x-reventless-comments")),!1,e=>{let t=ut(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||NK(e.name,t))),n=>{let r=AK(n.schema,t),i=void 0!==r?r:NK(n.name,t)?function(e){let t=CK(e);return 1!==t.length?void 0:t[0]}(n.schema):void 0,o=EK(n.schema,bK);return void 0!==o?void 0!==i?{readModel:n,entityField:i,bodyField:o,authorField:kK(n.schema),timestampField:(s=n.schema,me(xa(s),e=>{if(ka(e[1]))return e[0]}).find(e=>SK.includes(e.toLowerCase()))),postCommand:RK(n,e)}:void 0:void function(e){if(!DK.contents.includes(e))DK.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 '+bK.join(" | ")+' (plus an entity ref like "orderId"); see docs/guides/comments-read-model-convention.md.')}(n.name);var s})[0]}function FK(e,t){return j(Xe(e,t),dt)}function OK(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 PK(e){return OK(e.ann)}function MK(e){let t=$(Ps(e)),n=0!==Os(e).length,r=0!==zs(e).length;return{search:t||n||r}}function LK(e){let t=U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[]),n=t.map(e=>OK(Is(e[1]))),r=n.some(e=>e.filter),i=n.some(e=>e.sort);return{hasFilter:r,hasSort:i,hasSearch:MK(e).search}}function zK(e,t){let n={},r={};return Qe(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(OK(s.ann).filter?n[o]=i:r[o]=i)}r[o]=i}),[n,r]}function jK(e,t,n){if(void 0===e)return"NoSort";let r=n.find(t=>t.key===e);return void 0!==r?OK(r.ann).sort?{TAG:"ServerSort",_0:e,_1:t}:{TAG:"ClientSort",_0:e,_1:t}:"NoSort"}function UK(e,t,n,r){let i={};return n.search&&""!==t&&(i.search=t),Qe(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(na(n),e=>e),n);break;default:t=n}else t=n;i[o+"Eq"]=t}),0===Qe(i).length?void 0:i}let BK={contents:[]};function $K(e,t){return me(e.readModels.filter(e=>e.name!==t),e=>{let n=AK(e.schema,t);if(void 0!==n)return function(e,t){return L(xa(e).find(e=>e[0]===t),!1,e=>OK(Is(e[1])).filter)}(e.schema,n)?{readModel:e,refField:n}:void function(e,t,n){let r=e+"."+t;if(!BK.contents.includes(r))BK.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 qK(e){return"var("+e+")"}function GK(e){switch(e){case"Success":return _t.success;case"Warning":return _t.warning;case"Error":return _t.error;case"Info":return _t.info}}function VK(e){return co([gi("flex"),di("flexStart"),ui("gap",qK(bt.sm)),ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("border-radius",qK(St.md)),ui("border-left","3px solid var("+GK(e)+")"),ui("background",qK(_t.surfaceElevated)),ui("font-size",qK(xt.sizeMd)),ui("line-height",qK(xt.lineHeightNormal))])}let KK=co([vi(1)]),WK=co([ui("font-weight",qK(xt.weightMedium)),ui("color",qK(_t.textPrimary)),Ri(to(2))]),HK=co([ui("color",qK(_t.textSecondary))]),JK=co([ui("background","none"),no(to(0),"none",ao),pi("pointer"),ui("color",qK(_t.textSecondary)),ui("font-size","16px"),ui("line-height","1"),ui("padding","0"),yi(0)]);function XK(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:XK(n),className:(o=n,co([ui("color",qK(GK(o))),ui("font-size","16px"),yi(0),Ti(to(1))]))}),r("div",{children:[L(e.title,null,e=>i("div",{children:e,className:WK})),i("div",{children:e.message,className:HK})],className:KK}),L(e.onDismiss,null,e=>i("button",{children:"×","aria-label":"Dismiss",className:JK,onClick:t=>e()}))],className:VK(n),role:"alert"});var o};function YK(e){return"var("+e+")"}let ZK=co([Ui("fixed"),qi(to(0)),Si(to(0)),Bi(to(0)),hi(to(0)),ui("background","rgba(0,0,0,0.5)"),gi("flex"),di("center"),xi("center"),ui("z-index","1000"),ui("backdrop-filter","blur(2px)")]),eW=co([ui("background",YK(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",YK(St.lg)),ui("box-shadow",YK(kt)),gi("flex"),mi("column"),ui("max-height","90vh"),ui("max-width","90vw"),ui("min-width","400px"),ui("overflow","hidden")]),tW=co([gi("flex"),di("center"),xi("spaceBetween"),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),yi(0)]),nW=co([ui("color",YK(_t.textPrimary)),ui("font-size",YK(xt.sizeLg)),ui("font-weight",YK(xt.weightMedium)),ki(to(0))]),rW=co([ui("background","none"),ui("border","none"),ui("cursor","pointer"),ui("color",YK(_t.textSecondary)),ui("font-size","18px"),ui("padding","0"),ui("line-height","1"),Yi([ui("color",YK(_t.textPrimary))])]),iW=co([ui("padding",YK(bt.lg)),ui("overflow-y","auto"),vi(1)]),oW=co([gi("flex"),di("center"),xi("flexEnd"),ui("gap",YK(bt.sm)),ui("padding","var("+bt.md+") var("+bt.lg+")"),ui("border-top","1px solid var("+_t.borderSubtle+")"),yi(0)]);let sW=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:nW}),i("button",{children:"x",className:rW,onClick:e=>t()})],className:tW}),i("div",{children:e.children,className:iW}),L(e.footer,null,e=>i("div",{children:e,className:oW}))],className:eW,style:L(e.width,{},e=>({width:e})),onClick:e=>{e.stopPropagation()}}),className:ZK,onClick:e=>t()}):null};function aW(e){switch(e){case"Added":return"Added";case"BulkInvalidated":return"BulkInvalidated";case"Removed":return"Removed";case"Updated":return"Updated";default:return}}function lW(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}let cW="default";function uW(e,t,n,r,i){let o=void 0===n||n,s=bO(),l=function(e,t){let n=lW(e);return"object"!=typeof t?"/"+cW+"/"+n+"/*":"/"+cW+"/"+n+"/"+lW(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=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=t.state,i=void 0!==r&&$(Je.object(r))?r:void 0,o=j(n("changeKind"),aW),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,vt(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 dW(e){return"var("+e+")"}let fW=co([gi("flex"),mi("column"),ui("gap",dW(bt.sm))]),hW=co([ui("overflow-x","auto")]),pW=co([ui("border-collapse","collapse"),ui("font-size",dW(xt.sizeSm)),ui("min-width","min-content")]),gW=[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("background",dW(_t.surfaceSubtle)),ui("white-space","nowrap"),ui("font-weight",dW(xt.weightMedium))],mW=co(gW.concat([ui("text-align","left"),ui("color",dW(_t.textSecondary))])),vW=co(gW.concat([ui("text-align","right"),ui("color",dW(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("font-size",dW(xt.sizeXs))])),yW=co(gW.concat([ui("text-align","left"),ui("color",dW(_t.textPrimary))]));let _W=co([gi("flex"),di("center"),ui("gap","6px"),ui("font-size",dW(xt.sizeXs)),ui("color",dW(_t.textSecondary))]);function bW(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<.12?.12:n>1?1:n}let xW=[.12,.35,.6,.85,1];let SW=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:mW,scope:"col"}),n.map(e=>i("th",{children:e.label,className:vW,scope:"col"},e.value))]})}),i("tbody",{children:e.rowHeaders.map((e,s)=>r("tr",{children:[i("th",{children:e.label,className:yW,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=bW(a.value,o),co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("white-space","nowrap"),ui("background",l<=0?"transparent":"color-mix(in srgb, var("+_t.brand+") "+Math.round(100*l).toString()+"%, transparent)"),ui("color",dW(l>=.55?_t.textOnBrand:l<=0?_t.textDisabled:_t.textPrimary))]))},e.value+":"+n.value);var l})]},e.value))})],className:pW}),className:hW}),r("div",{children:["0",xW.map(e=>{return i("span",{className:(t=e,co([ui("width","18px"),ui("height","10px"),ui("background","color-mix(in srgb, var("+_t.brand+") "+Math.round(100*t).toString()+"%, transparent)"),ui("border","1px solid var("+_t.borderSubtle+")")]))},e.toString());var t}),e.maxLabel],className:_W})],className:fW})};function wW(e){let t=e.parent;if(void 0!==t&&""!==t)return t}function EW(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=wW(e);if(void 0!==a){if(void 0!==Xe(t,a)){if(function(e,t,n){let r=j(Xe(e,t),wW);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(Xe(e,i),wW);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(Xe(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=Xe(t,e);if(void 0!==o)return{node:o,children:i>=n?[]:me(U(Xe(r,e),[]),e=>a(e,i+1|0))}};return{roots:me(i,e=>a(e,0)),detached:o.contents,cycles:s.contents}}function kW(e){return ge(e.children,e.children.length,(e,t)=>e+kW(t)|0)}function CW(e){return"var("+e+")"}let AW=co([gi("flex"),mi("column"),ui("gap",CW(bt.sm))]),NW=co([ui("overflow-x","auto"),ui("padding-bottom","4px")]),TW=co([gi("flex"),di("flexStart"),xi("center"),ui("gap",CW(bt.lg)),ui("min-width","min-content"),ui("padding","var("+bt.xs+") 0")]),RW=co([gi("flex"),mi("column"),di("center"),ui("min-width","min-content")]);let DW=co([ui("font-size",CW(xt.sizeSm)),ui("font-weight",CW(xt.weightMedium)),ui("color",CW(_t.textPrimary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),IW=co([ui("font-size",CW(xt.sizeXs)),ui("color",CW(_t.textSecondary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),FW=co([ui("margin-top","2px"),ui("padding","0 6px"),ui("border","1px solid var("+_t.border+")"),ui("border-radius","10px"),ui("background",CW(_t.surface)),ui("color",CW(_t.textSecondary)),ui("font-size",CW(xt.sizeXs)),ui("line-height","16px"),pi("pointer"),Yi([ui("color",CW(_t.textPrimary))])]),OW=co([ui("width","1px"),ui("height","14px"),ui("background",CW(_t.border))]),PW=co([gi("flex"),di("flexStart"),ui("min-width","min-content")]),MW=co([gi("flex"),mi("column"),di("center"),ui("min-width","min-content")]),LW=co([ui("padding","0 var("+bt.xs+")")]),zW=co([gi("flex"),ui("width","100%"),ui("height","1px")]);function jW(e){return co([ui("flex","1 1 50%"),ui("background",e?CW(_t.border):"transparent")])}let UW=co([ui("font-size",CW(xt.sizeXs)),ui("color",CW(_t.textDisabled))]),BW="var("+_t.brand+")",$W=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"]]},$W,{make:function(e){let t=e.depth,n=e.tree,a=s(()=>!1),l=a[1],c=a[0],u=kW(n),d=n.children.length,f=n.node.subtitle;return r("div",{children:[r("button",{children:[i("span",{children:n.node.title,className:DW}),void 0!==f&&""!==f?i("span",{children:f,className:IW}):null],className:(h=U(n.node.accent,BW),co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","132px"),ui("max-width","180px"),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-top","3px solid "+h),ui("border-radius",CW(St.md)),ui("background",CW(_t.surface)),ui("text-align","left"),pi("pointer"),Yi([ui("background",CW(_t.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:FW,title:c?"Expand":"Collapse",onClick:e=>l(e=>!e)}),c?null:r(o,{children:[i("div",{className:OW}),i("div",{children:n.children.map((e,n)=>r("div",{children:[r("div",{children:[i("div",{className:jW(n>0)}),i("div",{className:jW(n<(d-1|0))})],className:zW}),i("div",{className:OW}),i("div",{children:i($W.make,{tree:e,depth:t+1|0}),className:LW})],className:MW},e.node.key)),className:PW})]})]})],className:RW});var h}});let qW=function(e){let t=EW(e.nodes);if(0===t.roots.length)return i(_o,{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($W.make,{tree:e,depth:0},e.node.key)),className:TW}),className:NW}),0===n.length?null:i("span",{children:n.join(" · "),className:UW})],className:AW})};function GW(e){return"var("+e+")"}let VW=co([Ui("relative"),ui("padding-left","28px"),gi("flex"),mi("column"),ui("gap",GW(bt.md))]),KW=co([Ui("absolute"),Si(to(7)),qi(to(8)),hi(to(0)),ui("width","2px"),ui("background",GW(_t.borderSubtle))]),WW=co([Ui("absolute"),Si(to(-21)),qi(to(6)),ui("width","10px"),ui("height","10px"),ui("border-radius","50%"),ui("background",GW(_t.brand)),ui("border","2px solid var("+_t.surface+")"),yi(0)]),HW=co([Ui("relative"),gi("flex"),mi("column"),ui("gap","2px")]),JW=uo([HW,co([ui("background","none"),ui("border","none"),ui("padding","0"),$i("left"),pi("pointer"),Yi([ui("opacity","0.85")])])]),XW=co([gi("flex"),di("center"),ui("gap",GW(bt.sm))]),QW=co([ui("color",GW(_t.textDisabled)),ui("font-size",GW(xt.sizeXs)),ui("font-family",GW(xt.fontFamilyMono))]),YW=co([ui("color",GW(_t.textPrimary)),ui("font-size",GW(xt.sizeMd)),ui("font-weight",GW(xt.weightMedium))]),ZW=co([ui("color",GW(_t.textSecondary)),ui("font-size",GW(xt.sizeSm)),ui("line-height",GW(xt.lineHeightNormal)),Ai(to(0))]);let eH=function(e){let t=e.onSelect,n=e=>r(o,{children:[i("div",{className:WW,style:z(e.accent,e=>({background:e}))}),r("div",{children:[i("span",{children:e.timestamp,className:QW}),L(e.variant,null,t=>i(Ss,{variant:t,label:e.label})),L(e.variant,i("span",{children:e.label,className:YW}),e=>null)],className:XW}),L(e.detail,null,e=>i("div",{children:e,className:ZW}))]});return r("div",{children:[i("div",{className:KW}),e.entries.map(e=>void 0!==t?i("button",{children:n(e),className:JW,type:"button",onClick:n=>t(e.id)},e.id):i("div",{children:n(e),className:HW},e.id))],className:VW})};function tH(e){let t=j(j(ht(e),e=>Ye(e)[0]),ht),n=j(j(t,e=>Xe(e,"__typename")),dt);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=>Xe(e,"errorCode")),dt),detail:j(j(t,e=>Xe(e,"errorDetail")),dt)}};default:return{TAG:"NotExecuted",_0:"The server answered with an unexpected result type ("+n+")."}}}function nH(e){let t=tH(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 rH(e,t){let n=Xe(e,t);if(void 0===n)return;let r=dt(n);return void 0!==r?r:j(j(ht(n),e=>Xe(e,"TAG")),dt)}function iH(e,t,n){if(void 0===n)return e;let r=rH(t,n);return e.filter(e=>{let t=e.allowedStates;return void 0===t||void 0!==r&&t.includes(r)})}function oH(e){let t=0|new Date(e).getMonth();return U(cc[t],"").slice(0,3)}function sH(e,t){switch(t){case"Days":return hc(e);case"Weeks":return fc(e).toString()+" "+oH(e);case"Months":let t=new Date(e).getFullYear().toString();return oH(e)+" '"+t.slice(2)}}function aH(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function lH(e){return e<0?0:e>100?100:e}function cH(e,t,n){let r=lH(aH(e.start,t,n)),i=lH(aH(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 uH(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 dH(e){return uH(e).filter(e=>e.violated)}let fH="184px";function hH(e){return"var("+e+")"}let pH=co([gi("flex"),mi("column"),ui("gap",hH(bt.sm))]),gH=co([gi("flex"),di("center"),xi("spaceBetween"),_i("wrap"),ui("gap",hH(bt.sm))]),mH=co([gi("inlineFlex"),di("center"),ui("gap",hH(bt.xs))]),vH=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",hH(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",hH(_t.textSecondary)),ui("font-size",hH(xt.sizeSm)),pi("pointer"),Yi([ui("background",hH(_t.surfaceSubtle)),ui("color",hH(_t.textPrimary))])]),yH=uo([vH,co([ui("background",hH(_t.surfaceSubtle)),ui("color",hH(_t.textPrimary)),ui("font-weight",hH(xt.weightMedium))])]),_H=co([ui("font-size",hH(xt.sizeMd)),ui("font-weight",hH(xt.weightMedium)),ui("color",hH(_t.textPrimary))]),bH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",hH(St.md)),ui("overflow","hidden")]),xH=co([gi("flex"),di("stretch")]),SH=uo([xH,co([ui("background",hH(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")])]),wH=co([ui("flex","0 0 "+fH),ui("padding","4px var("+bt.sm+")"),ui("font-size",hH(xt.sizeXs)),ui("color",hH(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),EH=co([Ui("relative"),ui("flex","1 1 auto"),ui("height","22px"),ui("overflow","hidden")]),kH=co([Ui("absolute"),ui("top","4px"),ui("padding-left","3px"),ui("border-left","1px solid var("+_t.borderSubtle+")"),ui("font-size",hH(xt.sizeXs)),ui("color",hH(_t.textSecondary)),ui("white-space","nowrap"),ui("pointer-events","none")]),CH=co([Ui("relative")]),AH=uo([xH,co([ui("height",30..toString()+"px"),ui("border-top","1px solid var("+_t.borderSubtle+")")])]),NH=co([ui("flex","0 0 "+fH),gi("flex"),di("center"),ui("gap","4px"),ui("padding","0 var("+bt.sm+")"),ui("font-size",hH(xt.sizeSm)),ui("color",hH(_t.textPrimary)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden")]),TH=co([ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),RH=co([ui("color",hH(_t.warning)),ui("font-size",hH(xt.sizeXs)),ui("flex","0 0 auto")]),DH=co([Ui("relative"),ui("flex","1 1 auto")]),IH=co([Ui("absolute"),ui("top","0"),ui("bottom","0"),ui("width","1px"),ui("background",hH(_t.borderSubtle)),ui("opacity","0.6"),ui("pointer-events","none")]);let FH=co([ui("outline","2px solid var("+_t.warning+")"),ui("outline-offset","1px")]),OH=co([Ui("absolute"),ui("top","0"),ui("left",fH),ui("right","0"),ui("bottom","0"),ui("pointer-events","none")]),PH=co([ui("display","block"),ui("width","100%"),ui("height","100%")]),MH=co([ui("font-size",hH(xt.sizeXs)),ui("color",hH(_t.textDisabled))]),LH="var("+_t.brand+")";function zH(e){return(Math.round(100*e)/100).toString()}function jH(e,t){let n=Zl(t,-1);return uc(e)===uc(n)?uc(e):uc(e)+" – "+uc(n)}function UH(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=cH(c,n,t),h=cH(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=lH((p+h)/2);d=[[p,g],[e,g],[e,m],[h,m]]}else{let e=lH(p+1.4),t=lH(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("+_t.warning+")":"var("+_t.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:zH(e[0])+"%",x2:zH(n[0])+"%",y1:zH(e[1]),y2:zH(n[1])},t.toString()):null})})}let BH=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[Yl(n),Zl(Yl(r),1)]}(o);if(void 0===f)return i(_o,{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)/gc;return n<=21?"Days":n<=120?"Weeks":"Months"}(g,p)),y=function(e,t,n){let r=t=>{switch(n){case"Days":return Zl(Yl(e),t);case"Weeks":return Zl(tc(e),7*t|0);case"Months":return ec(nc(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,sH(e,n)]})}(g,p,v),_=uH(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=dH(o).length,S=(e,t)=>i("button",{children:t,className:v===e?yH:vH,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:MH})}return r("div",{children:[r("div",{children:[i("span",{children:jH(g,p),className:_H}),r("div",{children:[S("Days","Days"),S("Weeks","Weeks"),S("Months","Months")],className:mH})],className:gH}),r("div",{children:[r("div",{children:[i("div",{children:"Task",className:wH}),i("div",{children:y.map(e=>{let t=e[0];return i("span",{children:e[1],className:kH,style:{left:zH(aH(t,g,p))+"%"}},t.toString())}),className:EH})],className:SH}),r("div",{children:[o.map(e=>{let t=cH(e,g,p),n=function(e,t){return dH(e).some(e=>e.to_===t)}(o,e.key),s=(a=U(e.accent,LH),co([Ui("absolute"),ui("top","5px"),ui("height",19..toString()+"px"),ui("border","none"),ui("border-radius",hH(St.sm)),ui("background",a),ui("padding","0"),pi("pointer"),Yi([ui("filter","brightness(1.12)")])]));var a;let l=n?s+" "+FH:s;return r("div",{children:[r("div",{children:[n?i("span",{children:"▲",className:RH,title:"Starts before a dependency ends"}):null,i("span",{children:e.title,className:TH,title:e.title})],className:NH}),r("div",{children:[y.map(e=>{let t=e[0];return i("div",{className:IH,style:{left:zH(aH(t,g,p))+"%"}},t.toString())}),i("button",{className:l,style:{left:zH(t[0])+"%",width:zH(t[1])+"%"},title:e.title+" · "+hc(e.start)+" → "+hc(e.end_),onClick:t=>e.onOpen()})],className:DH})],className:AH},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("+_t.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("+_t.warning+")"}),id:d,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"})]}),_.map(e=>i(UH,{edge:e,tasks:o,from:g,to_:p,arrowId:u,arrowBadId:d},e.from+"->"+e.to_))],className:PH}),className:OH})],className:CH})],className:bH}),h],className:pH})};function $H(e){return"var("+e+")"}let qH=co([ui("overflow-x","auto")]),GH=co([ui("border-collapse","collapse"),ui("font-size",$H(xt.sizeSm)),ui("color",$H(_t.textPrimary)),ui("min-width","min-content")]),VH=[ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("white-space","nowrap")],KH=co(VH),WH=co(VH.concat([ui("color",$H(_t.textDisabled))])),HH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","left"),ui("color",$H(_t.textSecondary)),ui("font-weight",$H(xt.weightMedium)),ui("white-space","nowrap")]),JH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","right"),ui("background",$H(_t.surfaceSubtle)),ui("color",$H(_t.textSecondary)),ui("font-weight",$H(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("font-size",$H(xt.sizeXs)),ui("white-space","nowrap")]),XH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("text-align","left"),ui("background",$H(_t.surfaceSubtle)),ui("color",$H(_t.textPrimary)),ui("font-weight",$H(xt.weightMedium)),ui("white-space","nowrap")]),QH=co(VH.concat([ui("font-weight",$H(xt.weightMedium))])),YH=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("padding","4px var("+bt.sm+")"),ui("background",$H(_t.surfaceSubtle)),ui("color",$H(_t.textSecondary)),ui("font-weight",$H(xt.weightMedium)),ui("white-space","nowrap")]),ZH="Total";let eJ=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:HH,scope:"col"}),s.map(e=>i("th",{children:e.label,className:JH,scope:"col"},e.value)),i("th",{children:ZH,className:YH,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:XH,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?WH:KH},e.value)}),i("td",{children:U(n[t],""),className:QH})]},e.value)})}),i("tfoot",{children:r("tr",{children:[i("th",{children:ZH,className:YH,scope:"row"}),s.map((e,n)=>i("td",{children:U(t[n],""),className:QH},e.value)),i("td",{children:e.grandTotal,className:QH})]})})],className:GH}),className:qH})};let tJ=function(e){let t=e.label,n=e.size;return i(oR,{kind:"Media",size:void 0!==n?n:"Detail",label:void 0!==t?t:"No image"})};function nJ(e){return"var("+e+")"}let rJ=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ui("gap",nJ(bt.md))]),iJ=co([gi("flex"),mi("column"),di("stretch"),ui("gap",nJ(bt.xs)),ui("padding","0"),ui("background","none"),ui("border","none"),ui("text-align","left"),pi("pointer"),Yi([ui("opacity","0.88")])]),oJ=co([ui("width","100%"),ui("aspect-ratio","4 / 3"),ui("object-fit","cover"),ui("background",nJ(_t.surfaceSubtle)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",nJ(St.md))]),sJ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",nJ(bt.sm))]),aJ=co([ui("color",nJ(_t.textPrimary)),ui("font-size",nJ(xt.sizeSm)),ui("font-weight",nJ(xt.weightMedium)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),lJ=co([ui("color",nJ(_t.textSecondary)),ui("font-size",nJ(xt.sizeXs)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),cJ=co([ui("background","rgba(255,255,255,0.12)"),ui("border","1px solid rgba(255,255,255,0.25)"),ui("border-radius",nJ(St.md)),ui("color","#f5f5f5"),ui("padding","4px var("+bt.sm+")"),ui("font-size",nJ(xt.sizeSm)),pi("pointer"),Yi([ui("background","rgba(255,255,255,0.22)")])]),uJ=co([ui("color",nJ(_t.textDisabled)),ui("font-size",nJ(xt.sizeSm))]);let dJ=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:uJ});if(void 0!==u){let e=j(n,e=>z(d[u],t=>i("button",{children:"Open record →",className:cJ,type:"button",onClick:n=>{c(e=>{}),e(t.key)}})));t=i(Ql,{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:oJ,alt:e.title,src:t}):i(tJ,void 0!==o?{size:"Tile",label:"Add image"}:{size:"Tile"}),r("div",{children:[i("span",{children:e.title,className:aJ}),U(e.badge,null)],className:sJ}),void 0!==s?i("span",{children:s,className:lJ}):null],className:iJ,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:rJ}),t]})};const fJ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function hJ(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function pJ(e){return"nodeType"in e}function gJ(e){var t,n;return e?hJ(e)?e:pJ(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function mJ(e){const{Document:t}=gJ(e);return e instanceof t}function vJ(e){return!hJ(e)&&e instanceof gJ(e).HTMLElement}function yJ(e){return e instanceof gJ(e).SVGElement}function _J(e){return e?hJ(e)?e.document:pJ(e)?mJ(e)?e:vJ(e)||yJ(e)?e.ownerDocument:document:document:document}const bJ=fJ?v:a;function xJ(e){const t=h(e);return bJ(()=>{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 SJ(e,t){void 0===t&&(t=[e]);const n=h(e);return bJ(()=>{n.current!==e&&(n.current=e)},t),n}function wJ(e,t){const n=h();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function EJ(e){const t=xJ(e),n=h(null),r=f(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function kJ(e){const t=h();return a(()=>{t.current=e},[e]),t.current}let CJ={};function AJ(e,t){return p(()=>{if(t)return t;const n=null==CJ[e]?0:CJ[e]+1;return CJ[e]=n,e+"-"+n},[e,t])}function NJ(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 TJ=NJ(1),RJ=NJ(-1);function DJ(e){if(!e)return!1;const{KeyboardEvent:t}=gJ(e.target);return t&&e instanceof t}function IJ(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=gJ(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 FJ="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function OJ(e){return e.matches(FJ)?e:e.querySelector(FJ)}const PJ={display:"none"};function MJ(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:PJ},n)}function LJ(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 zJ=l(null);const jJ={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 "},UJ={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 BJ(e){let{announcements:t=UJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=jJ}=e;const{announce:o,announcement:l}=function(){const[e,t]=s(""),n=f(e=>{null!=e&&t(e)},[]);return{announce:n,announcement:e}}(),c=AJ("DndLiveRegion"),[u,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=d(zJ);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(MJ,{id:r,value:i.draggable}),y.createElement(LJ,{id:c,announcement:l}));return n?w(g,n):g}var $J;function qJ(){}function GJ(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"}($J||($J={}));const VJ=Object.freeze({x:0,y:0});function KJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function WJ(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 HJ=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=WJ(r,t);n>0&&i.push({id:e,data:{droppableContainer:o,value:n}})}}return i.sort(KJ)};function JJ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:VJ}function XJ(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=XJ(1);const YJ={ignoreTransform:!1};function ZJ(e,t){void 0===t&&(t=YJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=gJ(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 eX(e){return ZJ(e,{ignoreTransform:!0})}function tX(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if(mJ(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!vJ(i)||yJ(i))return n;if(n.includes(i))return n;const o=gJ(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=gJ(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=gJ(e).getComputedStyle(e)),"fixed"===t.position}(i,o)?n:r(i.parentNode)}(e):n}function nX(e){const[t]=tX(e,1);return null!=t?t:null}function rX(e){return fJ&&e?hJ(e)?e:pJ(e)?mJ(e)||e===_J(e).scrollingElement?window:vJ(e)?e:null:null:null}function iX(e){return hJ(e)?e.scrollX:e.scrollLeft}function oX(e){return hJ(e)?e.scrollY:e.scrollTop}function sX(e){return{x:iX(e),y:oX(e)}}var aX;function lX(e){return!(!fJ||!e)&&e===document.scrollingElement}function cX(e){const t={x:0,y:0},n=lX(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"}(aX||(aX={}));const uX={x:.2,y:.2};function dX(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=uX);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=cX(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=aX.Backward,p.y=r*Math.abs((t.top+g-o)/g)):!u&&l>=t.bottom-g&&(h.y=aX.Forward,p.y=r*Math.abs((t.bottom-g-l)/g)),!f&&a>=t.right-m?(h.x=aX.Forward,p.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=aX.Backward,p.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:p}}function fX(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 hX(e){return e.reduce((e,t)=>TJ(e,sX(t)),VJ)}const pX=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+iX(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+oX(t),0)}]];class gX{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=tX(t),r=hX(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of pX)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 mX{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 vX(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 yX,_X;function bX(e){e.preventDefault()}function xX(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"}(yX||(yX={})),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"}(_X||(_X={}));const SX={start:[_X.Space,_X.Enter],cancel:[_X.Esc],end:[_X.Space,_X.Enter,_X.Tab]},wX=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case _X.Right:return{...n,x:n.x+25};case _X.Left:return{...n,x:n.x-25};case _X.Down:return{...n,y:n.y+25};case _X.Up:return{...n,y:n.y-25}}};class EX{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 mX(_J(t)),this.windowListeners=new mX(gJ(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yX.Resize,this.handleCancel),this.windowListeners.add(yX.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yX.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=ZJ),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);nX(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(VJ)}handleKeyDown(e){if(DJ(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=SX,coordinateGetter:o=wX,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}:VJ;this.referenceCoordinates||(this.referenceCoordinates=c);const u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=RJ(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}=cX(n),h=fX(n),p={x:Math.min(i===_X.Right?h.right-h.width/2:h.right,Math.max(i===_X.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(i===_X.Down?h.bottom-h.height/2:h.bottom,Math.max(i===_X.Down?h.top:h.top+h.height/2,u.y))},g=i===_X.Right&&!a||i===_X.Left&&!l,m=i===_X.Down&&!c||i===_X.Up&&!o;if(g&&p.x!==u.x){const e=n.scrollLeft+t.x,o=i===_X.Right&&e<=d.x||i===_X.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=o?n.scrollLeft-e:i===_X.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===_X.Down&&e<=d.y||i===_X.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=o?n.scrollTop-e:i===_X.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,TJ(RJ(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 kX(e){return Boolean(e&&"distance"in e)}function CX(e){return Boolean(e&&"delay"in e)}EX.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=SX,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 AX{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=gJ(e);return e instanceof t?e:_J(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=_J(o),this.documentListeners=new mX(this.document),this.listeners=new mX(n),this.windowListeners=new mX(gJ(o)),this.initialCoordinates=null!=(r=IJ(i))?r:VJ,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(yX.Resize,this.handleCancel),this.windowListeners.add(yX.DragStart,bX),this.windowListeners.add(yX.VisibilityChange,this.handleCancel),this.windowListeners.add(yX.ContextMenu,bX),this.documentListeners.add(yX.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(CX(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(kX(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(yX.Click,xX,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yX.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=IJ(e))?t:VJ,l=RJ(r,a);if(!n&&s){if(kX(s)){if(null!=s.tolerance&&vX(l,s.tolerance))return this.handleCancel();if(vX(l,s.distance))return this.handleStart()}return CX(s)&&vX(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===_X.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const NX={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class TX extends AX{constructor(e){const{event:t}=e,n=_J(t.target);super(e,NX,n)}}TX.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 RX={move:{name:"mousemove"},end:{name:"mouseup"}};var DX;!function(e){e[e.RightClick=2]="RightClick"}(DX||(DX={}));(class extends AX{constructor(e){super(e,RX,_J(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==DX.RightClick&&(null==r||r({event:n}),!0)}}];const IX={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var FX,OX;function PX(e){let{acceleration:t,activator:n=FX.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:l=OX.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:g,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=kJ(t);return wJ(e=>{if(n||!r||!e)return MX;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[aX.Backward]:e.x[aX.Backward]||-1===i.x,[aX.Forward]:e.x[aX.Forward]||1===i.x},y:{[aX.Backward]:e.y[aX.Backward]||-1===i.y,[aX.Forward]:e.y[aX.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 FX.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case FX.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===OX.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}=dX(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 AX{constructor(e){super(e,IX)}static setup(){return window.addEventListener(IX.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(IX.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"}(FX||(FX={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(OX||(OX={}));const MX={x:{[aX.Backward]:!1,[aX.Forward]:!1},y:{[aX.Backward]:!1,[aX.Forward]:!1}};var LX,zX;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(LX||(LX={})),function(e){e.Optimized="optimized"}(zX||(zX={}));const jX=new Map;function UX(e,t){return wJ(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function BX(e){let{callback:t,disabled:n}=e;const r=xJ(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 $X(e){return new gX(ZJ(e),e)}function qX(e,t,n){void 0===t&&(t=$X);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=xJ(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=BX({callback:o});return bJ(()=>{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 GX=[];function VX(e,t){void 0===t&&(t=[]);const n=h(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==VJ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?RJ(e,n.current):VJ}function KX(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 WX=[];function HX(e){let{measure:t}=e;const[n,r]=s(null),i=f(e=>{for(const{target:n}of e)if(vJ(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),o=BX({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 vJ(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,c]=EJ(a);return p(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const JX=[{sensor:TX,options:{}},{sensor:EX,options:{}}],XX={current:{}},QX={draggable:{measure:eX},droppable:{measure:eX,strategy:LX.WhileDragging,frequency:zX.Optimized},dragOverlay:{measure:ZJ}};class YX 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 ZX={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new YX,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:qJ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:QX,measureDroppableContainers:qJ,windowRect:null,measuringScheduled:!1},eQ=l({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:qJ,draggableNodes:new Map,over:null,measureDroppableContainers:qJ}),tQ=l(ZX);function nQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new YX}}}function rQ(e,t){switch(t.type){case $J.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $J.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 $J.DragEnd:case $J.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $J.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new YX(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case $J.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 YX(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case $J.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new YX(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function iQ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=d(eQ),o=kJ(r),s=kJ(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&o&&null!=s){if(!DJ(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=OJ(e);if(t){t.focus();break}}})}},[r,t,i,s,o]),null}const oQ=l({...VJ,scaleX:1,scaleY:1});var sQ;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(sQ||(sQ={}));const aQ=_(function(e){var t,n,r,i;let{id:o,accessibility:l,autoScroll:c=!0,children:u,sensors:d=JX,collisionDetection:g=HJ,measuring:m,modifiers:v,..._}=e;const x=b(rQ,void 0,nQ),[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(sQ.Uninitialized),T=A===sQ.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:XX,rect:P}:null},[R,O]),L=h(null),[z,j]=s(null),[U,B]=s(null),$=SJ(_,Object.values(_)),q=AJ("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 LX.Always:return!1;case LX.BeforeDragging:return n;default:return!n}}(),m=SJ(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),_=wJ(t=>{if(g&&!n)return jX;if(!t||t===jX||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 gX(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 wJ(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(D,R),X=p(()=>U?IJ(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 UX(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;bJ(()=>{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=JJ(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=nX(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=qX(J,V.draggable.measure,Y),ee=qX(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=HX({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=JJ(le=se?null:Z,UX(le));var le;const ce=KX(ie?gJ(ie):null),ue=function(e){const t=h(e),n=wJ(n=>e?n&&n!==GX&&e&&t.current&&e.parentNode===t.current.parentNode?n:tX(e):GX,[e]);return a(()=>{t.current=e},[e]),n}(T?null!=ne?ne:J:null),de=function(e,t){void 0===t&&(t=ZJ);const[n]=e,r=KX(n?gJ(n):null),[i,o]=s(WX);function a(){o(()=>e.length?e.map(e=>lX(e)?r:new gX(t(e),e)):WX)}const l=BX({callback:a});return bJ(()=>{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?TJ(X,I):null,pe=function(e){const[t,n]=s(null),r=h(e),i=f(e=>{const t=rX(e.target);t&&n(e=>e?(e.set(t,sX(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const s=e.map(e=>{const t=rX(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,sX(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=rX(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>TJ(e,t),VJ):hX(e):VJ,[e,t])}(ue),ge=VX(pe),me=VX(pe,[Z]),ve=TJ(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:TJ(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(sQ.Initializing),w({type:$J.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:i}),j(Ee.current),B(o)})},onMove(e){w({type:$J.DragMove,coordinates:e})},onEnd:a($J.DragEnd),onCancel:a($J.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===$J.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=$J.DragCancel)}}L.current=null,E(()=>{w({type:e}),N(sQ.Uninitialized),Se(null),j(null),B(null),Ee.current=null;const t=e===$J.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(!fJ)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),bJ(()=>{Z&&A===sQ.Initializing&&N(sQ.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]),bJ(()=>{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]),PX({...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(zJ.Provider,{value:C},y.createElement(eQ.Provider,{value:Te},y.createElement(tQ.Provider,{value:Ne},y.createElement(oQ.Provider,{value:we},u)),y.createElement(iQ,{disabled:!1===(null==l?void 0:l.restoreFocus)})),y.createElement(BJ,{...l,hiddenTextDescribedById:q}))}),lQ=l(null),cQ="button";function uQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=AJ("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=d(eQ),{role:g=cQ,roleDescription:m="draggable",tabIndex:v=0}=null!=i?i:{},y=(null==l?void 0:l.id)===t,_=d(y?oQ:lQ),[b,x]=EJ(),[S,w]=EJ(),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=SJ(n);bJ(()=>(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!==cQ)||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 dQ={timeout:25};function fQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=AJ("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=d(eQ),p=h({disabled:n}),g=h(!1),m=h(null),v=h(null),{disabled:y,updateMeasurementsFor:_,timeout:b}={...dQ,...i},x=SJ(null!=_?_:r),S=BX({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]=EJ(w),C=SJ(t);return a(()=>{S&&E.current&&(S.disconnect(),g.current=!1,S.observe(E.current))},[E,S]),a(()=>(l({type:$J.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:m,data:C}}),()=>l({type:$J.UnregisterDroppable,key:o,id:r})),[r]),a(()=>{n!==p.current.disabled&&(l({type:$J.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 hQ(e,t){M(R(e.onPointerDown),e=>e(t))}function pQ(e,t){M(R(e.onKeyDown),e=>e(t))}function gQ(e){return z(null==e?void 0:T(e),e=>"translate3d("+e.x.toString()+"px, "+e.y.toString()+"px, 0)")}let mQ=[{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"}],vQ={bg:"#e2e8f0",border:"#64748b",fg:"#1e293b"};function yQ(e,t){let n=e.indexOf(t);return-1!==n?function(e){return e<0?vQ:mQ[fe(e,mQ.length)]}(n):vQ}let _Q={bg:"#dbeafe",border:"#2563eb",fg:"#1e3a8a"};function bQ(e){return"var("+e+")"}let xQ=[gi("inlineFlex"),di("center"),ui("gap","4px"),ui("font-size",bQ(xt.sizeXs)),ui("font-weight",bQ(xt.weightMedium)),ui("line-height","1.5"),ui("white-space","nowrap")];function SQ(e,t){return co(xQ.concat([ui("background",e.bg),ui("border","1px solid "+e.border),ui("color",e.fg)]).concat(t))}function wQ(e){return SQ(e,[ui("padding","2px 8px"),ui("border-radius",bQ(St.full))])}let EQ=SQ(_Q,[ui("padding","2px 8px"),ui("border-radius",bQ(St.sm))]),kQ=co(xQ.concat([ui("padding","2px 0"),ui("color",bQ(_t.textSecondary)),ui("font-weight",bQ(xt.weightNormal)),ui("font-style","italic"),ui("border-bottom","1px dashed var("+_t.border+")")]));let CQ={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:wQ(n)});var o}};let AQ={make:function(e){return i("span",{children:e.label,className:EQ})}};let NQ={make:function(e){let t=e.label;return i("span",{children:t,className:kQ,title:t+" — run by the platform, not callable"})}};function TQ(e){return"var("+e+")"}let RQ=co([gi("flex"),di("stretch"),ui("gap",TQ(bt.md)),ui("overflow-x","auto"),ui("padding-bottom",TQ(bt.sm))]),DQ=[gi("flex"),mi("column"),ui("gap",TQ(bt.sm)),ui("flex","0 0 240px"),ui("padding",TQ(bt.sm)),ui("background",TQ(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",TQ(St.md)),ui("min-height","120px")],IQ=co(DQ);let FQ=co([ui("border-color",TQ(_t.brand))]),OQ=co([Pi(.45)]),PQ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",TQ(bt.sm)),ui("font-size",TQ(xt.sizeSm)),ui("font-weight",TQ(xt.weightMedium)),ui("color",TQ(_t.textSecondary))]),MQ=co([ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),LQ=co([gi("flex"),mi("column"),di("stretch"),ui("gap","4px"),ui("padding",TQ(bt.sm)),ui("background",TQ(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",TQ(St.sm)),ui("text-align","left"),pi("pointer"),Yi([ui("border-color",TQ(_t.brand))])]),zQ=co([pi("grab")]),jQ=co([Pi(.85),ui("z-index","10"),pi("grabbing")]),UQ=co([ui("font-size",TQ(xt.sizeSm)),ui("font-weight",TQ(xt.weightMedium)),ui("color",TQ(_t.textPrimary))]),BQ=co([ui("font-size",TQ(xt.sizeXs)),ui("color",TQ(_t.textSecondary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),$Q=co([ui("color",TQ(_t.textDisabled)),ui("font-size",TQ(xt.sizeSm))]);function qQ(e){let t=e.onClick,n=e.draggable,o=e.card,s=uQ({id:o.key,disabled:!n}),a=n?LQ+" "+zQ:LQ,l=s.isDragging?a+" "+jQ:a,c=gQ(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:UQ}),void 0!==h?i("span",{children:h,className:BQ,title:h}):null],ref:T(s.setNodeRef),className:l,role:"button",style:u,tabIndex:0,onKeyDown:e=>M(f,t=>pQ(t,e)),onClick:e=>M(t,e=>e(o.key)),onPointerDown:e=>M(f,t=>hQ(t,e))})}function GQ(e){let t=e.accepts,n=e.onCardClick,o=e.draggable,s=e.column,a=void 0===t||t,l=fQ({id:s.value,disabled:!a}),c=s.swatch,u=void 0!==c?function(e){return co(DQ.concat([ui("border-top","3px solid "+e.border)]))}(c):IQ,d=l.isOver,f=a?d?u+" "+FQ:u:u+" "+OQ,h=s.swatch;return r("div",{children:[r("div",{children:[void 0!==h?i(CQ.make,{swatch:h,label:s.label}):i("span",{children:s.label,className:MQ}),i(ps,{count:s.cards.length,label:""})],className:PQ}),0===s.cards.length?i("span",{children:"—",className:$Q}):s.cards.map(e=>i(qQ,{card:e,draggable:o,onClick:n},e.key))],ref:T(l.setNodeRef),className:f})}let VQ=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])}(GJ(TX,{activationConstraint:{distance:5}}),GJ(EX,{})),c=s(()=>{}),u=c[1],d=c[0],f=e=>void 0===t||void 0===d||t(d,e.value);return i(aQ,{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(GQ,{column:e,draggable:a,onCardClick:r,accepts:f(e)},e.value)),className:RQ})})};function KQ(e){return"var("+e+")"}let WQ=co([gi("flex"),mi("column"),ui("gap",KQ(bt.sm))]),HQ=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",KQ(bt.sm))]),JQ=co([gi("inlineFlex"),di("center"),ui("gap",KQ(bt.xs))]),XQ=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",KQ(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",KQ(_t.textSecondary)),ui("font-size",KQ(xt.sizeSm)),pi("pointer"),Yi([ui("background",KQ(_t.surfaceSubtle)),ui("color",KQ(_t.textPrimary))])]),QQ=uo([XQ,co([ui("background",KQ(_t.surfaceSubtle)),ui("color",KQ(_t.textPrimary)),ui("font-weight",KQ(xt.weightMedium))])]),YQ=co([ui("font-size",KQ(xt.sizeMd)),ui("font-weight",KQ(xt.weightMedium)),ui("color",KQ(_t.textPrimary))]),ZQ=co([gi("grid"),ui("grid-template-columns","repeat(7, 1fr)"),ui("gap","1px")]),eY=co([ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ui("padding","2px var("+bt.xs+")")]),tY=co([gi("grid"),ui("grid-template-columns","repeat(7, 1fr)"),ui("gap","1px"),ui("background",KQ(_t.borderSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",KQ(St.md)),ui("overflow","hidden")]),nY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","96px"),ui("padding","4px"),ui("background",KQ(_t.surface))]),rY=uo([nY,co([ui("opacity","0.55")])]),iY=co([ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.textSecondary))]),oY=uo([iY,co([ui("color",KQ(_t.brand)),ui("font-weight",KQ(xt.weightMedium))])]);let sY=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("text-align","left"),ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.brand)),pi("pointer"),Yi([ui("text-decoration","underline")])]);let aY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","200px"),ui("padding","4px"),ui("background",KQ(_t.surface))]),lY=co([ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.textSecondary)),ui("padding-bottom","2px"),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),cY=co([gi("flex"),_i("wrap"),di("center"),ui("gap",KQ(bt.md)),ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.textSecondary))]);let uY=co([ui("font-size",KQ(xt.sizeXs)),ui("color",KQ(_t.textDisabled))]),dY="var("+_t.brand+")";function fY(e,t){return e.filter(e=>oc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function hY(e,t){return lc(e.start)||!rc(e.start,t)?e.title:ac(e.start)+" "+e.title}let pY=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(()=>Yl(U(a,Date.now()))),m=g[1],v=g[0],y=Yl(Date.now()),_=e=>m(t=>{switch(p){case"Month":return ec(t,e);case"Week":return Zl(t,7*e|0);case"Day":return Zl(t,e)}}),b=(e,t)=>{return i("button",{children:hY(e,t),className:(n=U(e.accent,dY),co([gi("block"),ui("width","100%"),ui("text-align","left"),ui("border","none"),ui("border-left","3px solid "+n),ui("border-radius",KQ(St.sm)),ui("background",KQ(_t.surfaceSubtle)),ui("color",KQ(_t.textPrimary)),ui("font-size",KQ(xt.sizeXs)),ui("padding","1px var("+bt.xs+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",KQ(_t.surfaceElevated))])])),title:e.title,onClick:t=>e.onOpen()},e.key);var n},x=()=>{let e=function(e){let t=tc(nc(e));return pe(42,e=>Zl(t,e))}(v);return r(o,{children:[i("div",{children:dc.map(e=>i("div",{children:e,className:eY},e)),className:ZQ}),i("div",{children:e.map(e=>{let t=fY(u,e),n=t.slice(0,3),o=t.length-n.length|0;return r("div",{children:[i("span",{children:fc(e).toString(),className:e===y?oY:iY}),n.map(t=>b(t,e)),o>0?i("button",{children:"+"+o.toString()+" more",className:sY,onClick:t=>{m(t=>e),h(e=>"Day")}}):null],className:ic(e,v)?nY:rY},e.toString())}),className:tY})]})},S=e=>{return i("div",{children:e.map(e=>r("div",{children:[i("div",{children:hc(e),className:lY}),fY(u,e).map(t=>b(t,e))],className:aY},e.toString())),className:(t=e.length,co([gi("grid"),ui("grid-template-columns","repeat("+t.toString()+", 1fr)"),ui("gap","1px"),ui("background",KQ(_t.borderSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",KQ(St.md)),ui("overflow","hidden")]))});var t};switch(p){case"Month":t=x();break;case"Week":t=S(pe(7,e=>Zl(tc(v),e)));break;case"Day":t=S([Yl(v)])}switch(p){case"Month":case"Week":n=uc(v);break;case"Day":n=hc(v)+" — "+uc(v)}let w=(e,t)=>i("button",{children:t,className:p===e?QQ:XQ,onClick:t=>h(t=>e)});return r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:XQ,onClick:e=>_(-1)}),i("button",{children:"Today",className:XQ,onClick:e=>m(e=>y)}),i("button",{children:"›",className:XQ,onClick:e=>_(1)}),i("span",{children:n,className:YQ})],className:JQ}),r("div",{children:[w("Month","Month"),w("Week","Week"),w("Day","Day")],className:JQ})],className:HQ}),0!==d.length?i("div",{children:d.map(e=>{return r("span",{children:[i("span",{className:(t=e.accent,co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",t),ui("margin-right","4px")]))}),e.label]},e.label);var t}),className:cY}):null,t,void 0!==l?i("span",{children:l,className:uY}):null],className:WQ})};function gY(e){return"var("+e+")"}let mY=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(220px, 1fr))"),ui("gap",gY(bt.md))]),vY=co([gi("flex"),mi("column"),di("stretch"),ui("gap",gY(bt.sm)),ui("padding",gY(bt.md)),ui("background",gY(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",gY(St.md)),ui("text-align","left"),Yi([ui("border-color",gY(_t.brand)),ui("background",gY(_t.surfaceSubtle))])]),yY=co([gi("flex"),mi("column"),di("stretch"),ui("gap",gY(bt.sm)),ui("background","none"),ui("border","none"),ui("padding","0"),ui("font","inherit"),ui("color","inherit"),ui("text-align","left"),pi("pointer")]),_Y=co([gi("flex"),_i("wrap"),ui("gap","4px")]),bY=co([ui("background",gY(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",gY(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",gY(_t.textPrimary)),ui("font-size",gY(xt.sizeSm)),pi("pointer"),Yi([ui("border-color",gY(_t.brand)),ui("color",gY(_t.brand))])]),xY=co([ui("width","100%"),ui("height","96px"),ui("object-fit","cover"),ui("border-radius",gY(St.sm))]),SY=co([ui("width","100%"),ui("height","96px")]),wY=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",gY(bt.sm))]),EY=co([ui("font-size",gY(xt.sizeMd)),ui("font-weight",gY(xt.weightMedium)),ui("color",gY(_t.textPrimary)),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),kY=co([gi("flex"),di("baseline"),ui("gap",gY(bt.sm)),ui("font-size",gY(xt.sizeSm))]),CY=co([ui("color",gY(_t.textSecondary)),ui("white-space","nowrap"),yi(0)]),AY=co([ui("color",gY(_t.textPrimary)),ui("min-width","0"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),NY=co([ui("color",gY(_t.textDisabled)),ui("font-size",gY(xt.sizeSm))]);let TY=function(e){let t=e.cards;if(0===t.length)return i("span",{children:"(empty)",className:NY});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(tJ,{size:"Fill"}),className:SY}):i("img",{className:xY,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:EY,title:e.title}),U(e.badge,null)],className:wY}),e.fields.map(e=>r("div",{children:[i("span",{children:e.label,className:CY}),i("span",{children:e.value,className:AY})],className:kY},e.label))],className:yY,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:bY,onClick:t=>e.onClick()},e.label)),className:_Y}):null],className:vY},e.key)}),className:mY})};function RY(e){return"var("+e+")"}let DY=co([ui("font-family",RY(xt.fontFamilyMono)),ui("font-size",RY(xt.sizeSm)),ui("line-height",RY(xt.lineHeightNormal)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",RY(St.md)),Mi("auto")]),IY=co([gi("flex"),ui("padding","1px var("+bt.md+")")]),FY=co([ui("background","rgba(248,81,73,0.12)"),ui("color",RY(_t.error))]),OY=co([ui("background","rgba(63,185,80,0.12)"),ui("color",RY(_t.success))]),PY=co([ui("color",RY(_t.textSecondary))]),MY=co([ui("width","16px"),yi(0),ui("user-select","none"),Ni(to(8))]);let LY=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=[IY+" "+FY,"-"];break;case"Added":n=[IY+" "+OY,"+"];break;case"Unchanged":n=[IY+" "+PY," "]}return r("div",{children:[i("span",{children:n[1],className:MY}),i("span",{children:e.text})],className:n[0]},t.toString())}),className:DY})};function zY(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 jY(e){return"var("+e+")"}let UY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("font-family",jY(xt.fontFamily)),ui("font-size",jY(xt.sizeSm))]),BY=co([gi("flex"),di("flexStart"),ui("gap","10px"),ui("padding",jY(bt.xs)+" "+jY(bt.sm)),ui("border-radius",jY(St.sm))]),$Y=co([pi("pointer"),Yi([ui("background",jY(_t.surfaceSubtle))])]),qY=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0"),ui("flex","1")]),GY=co([ui("color",jY(_t.textPrimary))]),VY=co([ui("font-weight",jY(xt.weightMedium))]),KY=co([ui("color",jY(_t.textSecondary))]),WY=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("color",jY(_t.textSecondary)),ui("font-size",jY(xt.sizeXs)),ui("white-space","nowrap")]),HY=co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("flex-shrink","0")]),JY=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",jY(_t.brand)),ui("font-size",jY(xt.sizeXs)),pi("pointer"),ui("text-align","left"),Yi([ui("text-decoration","underline")])]),XY=co([ui("margin-top","4px"),ui("max-width","560px")]),QY=co([ui("color",jY(_t.textSecondary)),ui("padding",jY(bt.md)),$i("center")]);function YY(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?BY+" "+$Y:BY,f=n.actor,h=n.accent,p=n.timestamp;return r("div",{children:[i(Ho,{name:u,src:n.actorImageUrl,size:"Medium"}),r("div",{children:[r("span",{children:[void 0!==f?i("span",{children:f+" ",className:VY}):null,i("span",{children:n.verb+" ",className:KY}),n.subject],className:GY}),r("span",{children:[void 0!==h?i("span",{className:HY,style:{background:h}}):null,void 0!==p?zY(e.nowMs,p):null],className:WY}),c?i("button",{children:l?"Hide changes":"Show changes",className:JY,onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null,l&&c?i("div",{children:i(LY,{before:U(n.before,""),after:U(n.after,"")}),className:XY}):null],className:qY})],className:d,onClick:e=>M(t,e=>e(n))})}let ZY=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(YY,{entry:e,nowMs:a,onClick:n},e.id)),className:UY})};function eZ(e){return"var("+e+")"}let tZ=co([gi("flex"),di("flexStart"),ui("gap","0"),ui("width","100%")]),nZ=co([gi("flex"),mi("column"),di("center"),ui("gap","4px"),ui("flex","0 0 auto")]);let rZ=[gi("inlineFlex"),di("center"),xi("center"),ui("width","24px"),ui("height","24px"),ui("border-radius","50%"),ui("font-size",eZ(xt.sizeXs)),ui("font-weight",eZ(xt.weightMedium)),ui("box-sizing","border-box")],iZ=co(rZ.concat([ui("background",eZ(_t.brand)),ui("color","#fff")])),oZ=co(rZ.concat([ui("background",eZ(_t.surface)),ui("color",eZ(_t.brand)),ui("border","2px solid var("+_t.brand+")")])),sZ=co(rZ.concat([ui("background",eZ(_t.surface)),ui("color",eZ(_t.textDisabled)),ui("border","1px solid var("+_t.border+")")])),aZ=[ui("font-size",eZ(xt.sizeXs)),ui("text-align","center"),ui("max-width","96px")],lZ=co(aZ.concat([ui("color",eZ(_t.textPrimary))])),cZ=co(aZ.concat([ui("color",eZ(_t.textDisabled))])),uZ=co([ui("display","none")]);function dZ(e){switch(e){case"Done":return iZ;case"Current":return oZ;case"Upcoming":return sZ}}function fZ(e,t){switch(e){case"Done":return"✓";case"Current":case"Upcoming":return(t+1|0).toString()}}let hZ=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,co([ui("flex","1 1 auto"),ui("height","2px"),ui("margin","0 6px"),ui("margin-top","11px"),ui("min-width","16px"),ui("background",eZ(s?_t.brand:_t.borderSubtle))]))},e.key+":c");var s;let a=n?uZ:function(e){switch(e){case"Done":case"Current":return lZ;case"Upcoming":return cZ}}(e.state);return r(g,{children:[o,r("div",{children:[i("span",{children:fZ(e.state,t),className:dZ(e.state)}),i("span",{children:e.label,className:a})],className:nZ,role:"listitem"})]},e.key)}),"aria-label":"Progress",className:tZ,role:"list"})};function pZ(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 gZ(e){if("object"==typeof e)return lt(e._0);switch(e){case"Approved":return"Approved";case"Rejected":return"Rejected";case"Pending":return"Pending";case"Skipped":return"Skipped"}}function mZ(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 vZ(e){if("object"==typeof e)return"•";switch(e){case"Approved":return"✓";case"Rejected":return"✕";case"Pending":return"•";case"Skipped":return"–"}}function yZ(e){if("object"==typeof e)return"var("+_t.border+")";switch(e){case"Approved":return"var("+_t.success+")";case"Rejected":return"var("+_t.error+")";case"Pending":return"var("+_t.info+")";case"Skipped":return"var("+_t.border+")"}}function _Z(e){return"var("+e+")"}let bZ=co([gi("flex"),mi("column"),ui("gap",_Z(bt.md)),ui("font-family",_Z(xt.fontFamily))]),xZ=co([gi("flex"),mi("column")]),SZ=co([gi("flex"),di("stretch"),ui("gap",_Z(bt.sm))]),wZ=co([gi("flex"),mi("column"),di("center"),ui("flex","0 0 22px")]);let EZ=co([ui("flex","1 1 auto"),ui("width","1px"),ui("min-height","12px"),ui("background",_Z(_t.borderSubtle))]),kZ=co([gi("flex"),mi("column"),ui("gap","2px"),ui("flex","1 1 auto"),ui("min-width","0"),ui("padding-bottom",_Z(bt.sm))]),CZ=co([pi("pointer"),Yi([ui("background",_Z(_t.surfaceSubtle))]),ui("border-radius",_Z(St.sm)),ui("padding-left","4px"),ui("margin-left","-4px")]),AZ=co([gi("flex"),di("center"),_i("wrap"),ui("gap",_Z(bt.xs))]),NZ=co([ui("font-size",_Z(xt.sizeSm)),ui("font-weight",_Z(xt.weightMedium)),ui("color",_Z(_t.textPrimary))]),TZ=co([gi("flex"),di("center"),ui("gap","6px"),ui("font-size",_Z(xt.sizeXs)),ui("color",_Z(_t.textSecondary))]),RZ=co([ui("font-size",_Z(xt.sizeSm)),ui("color",_Z(_t.textSecondary)),ui("white-space","pre-wrap")]),DZ=co([ui("font-size",_Z(xt.sizeXs)),ui("color",_Z(_t.textDisabled))]);let IZ=function(e){let t=e.entries;if(0===t.length)return i(_o,{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(hZ,{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(Ho,{name:c,src:e.actorImageUrl,size:"Small"}),i("span",{children:c})]}):null,void 0!==u?i("span",{children:zY(U(s,Date.now()),u),title:U(ys(u),u)}):null],className:TZ}));let f=e.note;return r("div",{children:[r("div",{children:[i("span",{children:vZ(e.decision),className:(h=yZ(e.decision),co([gi("inlineFlex"),di("center"),xi("center"),ui("width","20px"),ui("height","20px"),ui("border-radius","50%"),ui("box-sizing","border-box"),ui("border","2px solid "+h),ui("color",h),ui("background",_Z(_t.surface)),ui("font-size","11px"),ui("line-height","1"),ui("flex","0 0 auto")]))}),t===l?null:i("div",{className:EZ})],className:wZ}),r("div",{children:[r("div",{children:[i("span",{children:e.step,className:NZ}),i(Ss,{variant:mZ(e.decision),label:gZ(e.decision)})],className:AZ}),n,void 0!==f&&""!==f?i("div",{children:f,className:RZ}):null],className:a?kZ+" "+CZ:kZ,onClick:t=>M(e.onOpen,e=>e())})],className:SZ},e.key);var h}),className:xZ}),void 0!==n?i("span",{children:n,className:DZ}):null],className:bZ})};function FZ(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let OZ=["approved","approve","accepted","granted","signed","confirmed","rejected","reject","declined","denied","refused","withdrawn","pending","awaiting","submitted","inreview","underreview","escalated","skipped","waived","notrequired"],PZ=["decision","outcome","verdict","approval","approvalstatus","result"],MZ=["step","stage","level","tier","approvalstep","approvallevel","phase"],LZ=["note","notes","comment","comments","reason","remarks","justification","rationale"];function zZ(e){return me(xa(e),e=>{let t=e[1],n=e[0];if(Ea(t))return z(function(e){let t=$s(e);if(void 0!==t&&t.length>=2&&t.length<=12)return t}(t),e=>[n,e])})}function jZ(e){let t=zZ(e),n=t.find(e=>PZ.includes(FZ(e[0])));return void 0!==n?n:t.find(e=>function(e){return e.filter(e=>OZ.includes(FZ(e))).length>=2}(e[1]))}function UZ(e,t){let n=xa(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:xa(e).map(e=>e[0]).find(e=>L(eI(e),!1,Aa))}function BZ(e,t){let n=U(t,Ua(e,void 0,void 0)),r=jZ(e),i=n.dateSpan;if(void 0===r)return;if(void 0===i)return;let o=r[0],s=zZ(e).find(e=>{let t=e[0];return t!==o&&MZ.includes(FZ(t))});return{decisionField:o,dateSpan:i,stepField:z(s,e=>e[0]),stepValues:L(s,[],e=>e[1]),actorField:UZ(e,n),noteField:me(xa(e),e=>{let t=e[0];if(Ea(e[1])&&LZ.includes(FZ(t)))return t})[0]}}function $Z(e){return e.rows.map((e,t)=>{let n=U(ht(e),{});return{key:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}})}function qZ(e,t){return j(Xe(e,t),dt)}function GZ(e,t){return j(da(t,e),pc)}function VZ(e,t){if(void 0===t)return e.length;let n=e.findIndex(e=>FZ(e)===FZ(t));return-1!==n?n:e.length}function KZ(e){return e.rows.map((e,t)=>{let n=U(ht(e),{});return{key:U(j(Xe(n,"id"),dt),"#"+t.toString()),json:e,dict:n}})}function WZ(e,t){return j(Xe(e,t),dt)}function HZ(e,t,n){return z(WZ(t,n),t=>{let r=eI(n);return void 0!==r?U(j(e.refLabels,e=>e.lookupLabel(r,t)),t):t})}function JZ(e,t){return U(j(e.semantics.labelField,e=>WZ(t.dict,e)),t.key)}function XZ(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:rF(e,t,void 0!==n?n:"item"),style:{color:"var("+_t.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})}function YZ(e,t,n,i){return r("div",{children:[e,QZ(t,n,void 0!==i?i:"item")],style:{display:"flex",flexDirection:"column",gap:"var("+bt.sm+")"}})}function ZZ(e){let t=e.source,n=Ka(),s=Ge(),a=KZ(t),l=sI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),c=HI(a.map(e=>e.dict),l,n,t.ownEntity,q(t.refLabels)),u=t.refLabels,d=void 0!==u?u:{lookupLabel:(e,t)=>MI(c,e,n,t),isMissing:(e,t)=>jI(c,e,n,t),retiredBadge:(e,t)=>LI(c,e,n,t),linkable:(e,t)=>zI(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=>rH(e.dict,t)),e=>i(Ss,{variant:"Neutral",label:lt(e),dot:!1})),l=j(t.retired,t=>Vs(t,Xe(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(WZ(t.dict,e),e=>""===e?void 0:e);return void 0!==n?{TAG:"Picture",_0:He(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:JZ(t,e),media:u,badge:c,fields:h.map(r=>({label:dI(r,n,t.ownEntity),value:mI(r.key,r.kind,r.propSchema,Xe(e.dict,r.key),r.ann,n,s,d,t.ownEntity)})),actions:f}});return YZ(i(TY,{cards:p,onCardClick:e=>XZ(t,a,e)}),[t],void 0,void 0)}function e0(e){let t=e.source,n=KZ(t),r=U(t.semantics.statusField,""),o=function(e){let t=KZ(e),n=U(e.semantics.statusField,""),r=qs(e.schema,n),i=e=>U(rH(e.dict,n),""),o=o=>o.map(o=>({value:o,label:""===o?"(no status)":lt(o),cards:t.filter(e=>i(e)===o).map(t=>{let r=me(Os(e.schema),r=>r===n?void 0:HZ(e,t.dict,r))[0];return{key:t.key,title:JZ(e,t),meta:r}}),swatch:yQ(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=>rH(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 YZ(i(VQ,{columns:o,onCardClick:e=>XZ(t,n,e),onMove:l,canDrop:void 0!==c?(e,t)=>$(s(e,t)):void 0}),[t],void 0,"card")}let t0=["var("+_t.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function n0(e,t){return U(e.accent,t0[fe(t,t0.length)])}function r0(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=n0(e,t),r=e.semantics.dateSpan;return void 0!==r?me(KZ(e),i=>z(j(da(r,i.dict),pc),o=>{let s=j(fa(r,i.dict),pc);return{key:t.toString()+":"+i.key,title:JZ(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:n0(e,t)})):[];return i(pY,{events:n,legend:r,windowNote:rF(t,void 0,void 0)})}function i0(e){let t=e.sources,n=function(e){let t=e.map((e,t)=>{let n=e.semantics.dateSpan,r=n0(e,t);return KZ(e).map(i=>{let o=j(n,e=>da(e,i.dict)),s=j(o,pc),a=void 0!==o?U(ys(o),o):"",l=z(j(e.semantics.statusField,e=>rH(i.dict,e)),lt);return{entry:{id:t.toString()+":"+i.key,timestamp:a,label:JZ(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 YZ(i(eH,{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 o0(e,t){let n=Xe(e,t);if(void 0===n)return[];let r=dt(n);return void 0!==r?[r]:me(U(pt(n),[]),dt)}function s0(e){let t=KZ(e),n=function(e,t){let n=t.map(e=>e.key);return me(xa(e.schema),e=>{let t=e[0];return z(eI(t),e=>t)}).filter(e=>t.some(t=>o0(t.dict,e).some(e=>e!==t.key&&n.includes(e))))}(e,t),r=P(e.semantics.dateSpan,ha);return void 0!==r?me(t,t=>z(j(da(r,t.dict),pc),i=>{let o=U(j(fa(r,t.dict),pc),i);return{key:t.key,title:JZ(e,t),start:i,end_:o<i?i:o,accent:e.accent,dependsOn:n.map(e=>o0(t.dict,e)).flat(),onOpen:()=>e.onOpenRow(t.key,t.json)}})):[]}function a0(e){let t=e.source,n=s0(t),r=t.rows.length,o=n.length,s=rF([t],o,void 0);return i(BH,{tasks:n,windowNote:o===r?s:s+" (the rest carry no start date)"})}function l0(e,t){let n=e.semantics.labelField,r=j(e.semantics.statusField,e=>WZ(t.dict,e));return void 0!==r?r:j(Os(e.schema).find(t=>!!yt(t,n)&&yt(t,e.semantics.parentField)),n=>HZ(e,t.dict,n))}function c0(e){let t=e.source,n=function(e){let t=KZ(e),n=e.semantics.parentField;return t.map(t=>({key:t.key,title:JZ(e,t),subtitle:l0(e,t),parent:j(n,e=>WZ(t.dict,e)),accent:e.accent,onOpen:()=>e.onOpenRow(t.key,t.json)}))}(t);return i(qW,{nodes:n,windowNote:rF([t],void 0,void 0)})}function u0(e){let t=e.source,n=Ka(),r=$Z(t),o=sI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=HI(r.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),a=t.refLabels,l=void 0!==a?a.lookupLabel:(e,t)=>MI(s,e,n,t),c=BZ(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=$Z(e).map(e=>{let n=j(t.stepField,t=>qZ(e.dict,t)),r=qZ(e.dict,t.decisionField);return[e,n,r]}),o=i.slice();void 0!==t.stepField?o.sort((e,n)=>VZ(t.stepValues,e[1])-VZ(t.stepValues,n[1])|0):o.sort((e,n)=>{let r=GZ(e[0].dict,t.dateSpan),i=GZ(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],lt),U(j(e.semantics.labelField,e=>qZ(i.dict,e)),"Decision")),decision:L(n[2],"Pending",pZ),actor:z(j(t.actorField,e=>qZ(i.dict,e)),r),at:da(t.dateSpan,i.dict),note:j(t.noteField,e=>qZ(i.dict,e)),onOpen:()=>e.onOpenRow(i.key,i.json)}}),a=me(o,e=>z(e[1],FZ)),l=t.stepValues.filter(e=>!a.includes(FZ(e))).map(e=>({key:"pending:"+e,step:lt(e),decision:"Pending"}));return s.concat(l)}(t,c,e=>{let t=j(c.actorField,eI);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($Z(e),e=>{let r=qZ(e.dict,n),i=qZ(e.dict,t.decisionField);if(void 0===r)return;if(void 0===i)return;let o=pZ(i);return"object"!=typeof o&&"Pending"===o?void 0:FZ(r)}),i=t.stepValues.find(e=>!r.includes(FZ(e)));return t.stepValues.map(e=>({key:e,label:lt(e),state:r.includes(FZ(e))?"Done":vt(i,e)?"Current":"Upcoming"}))}(t,c);return i(IZ,{entries:u,steps:d,windowNote:rF([t],void 0,"decision")})}function d0(e){let t=function(e){return me(xa(e),e=>{let t=$s(e[1]);if(void 0!==t&&t.length>=2&&t.length<=12)return[e[0],t]})}(e),n=Ua(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 f0(e){let t=e.source,n=s(()=>"Numbers"),o=n[1],a=n[0],l=function(e){return z(d0(e.schema),t=>{let n=t[1],r=n[1],i=n[0],o=t[0],s=o[1],a=o[0],l=KZ(e),c=(e,t)=>U(rH(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)":lt(e),d=lt(l.rowField),f=lt(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 Uo(e.toString(),function(e){return"object"==typeof e}(t))}(e,nF([t])),v=(e,t)=>i("button",{children:t,style:{background:"none",backgroundColor:a===e?"var("+_t.surfaceSubtle+")":"transparent",border:"1px solid var("+_t.border+")",color:a===e?"var("+_t.textPrimary+")":"var("+_t.textSecondary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"2px var("+bt.sm+")",borderRadius:"var("+St.sm+")"},type:"button",onClick:t=>o(t=>e)});return c="Numbers"===a?i(eJ,{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(SW,{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("+bt.xs+")"}}),c,QZ([t],void 0,"row")],style:{display:"flex",flexDirection:"column",gap:"var("+bt.sm+")"}})}function h0(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=e.semantics.imageField;return KZ(e).map(r=>{let i=j(j(n,e=>WZ(r.dict,e)),e=>""===e?void 0:He(e)),o=z(j(e.semantics.statusField,e=>rH(r.dict,e)),lt),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:JZ(e,r),caption:o,onUpload:a},open_:()=>e.onOpenRow(r.key,r.json)}})}).flat()}(t);return YZ(i(dJ,{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 p0(e){return i("span",{children:e,"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}})}function g0(e,t){let n=e[0];return void 0!==n?t(n):null}function m0(e,t){return e===t?0:e<t?-1:1}function v0(e,t){if(void 0===t)return"";let n=ut(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,dt).join(", ")}else if("KUnion"===e.TAG&&"object"==typeof n){if("JSONObject"!==n.TAG)return JSON.stringify(t);let r=ma(t);if(void 0===r)return"";let i=r[0];return L(Pt(e._0,i),i,e=>e.tag)}return"object"!=typeof n?"JSONFalse"===n?"false":"true":JSON.stringify(t)}function y0(e,t,n){let r=Qe(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,dt),!1,e=>e===n);if("KBoolean"!==e)return!0;let r=z(t,ut);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,Xe(e,r),n[1])}))}function _0(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=>v0(t.kind,Xe(e,t.key)).toLowerCase().includes(r))}(e,t,n))}function b0(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"===ut(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=ut(e);return"object"==typeof t?0:"JSONTrue"===t?1:0};return r(t)-r(n);case"KDate":return m0(v0(e,t),v0(e,n));case"KNumber":return U(j(t,ft),0)-U(j(n,ft),0)}return m0(v0(e,t),v0(e,n))}(i.kind,Xe(e,n),Xe(t,n))*o)}function x0(e){return"var("+e+")"}YI({id:"cards",label:"Cards",icon:p0("▤"),arity:"Single",isCapable:(e,t,n)=>!0,render:e=>g0(e,e=>i(ZZ,{source:e})),capability:"always — richer with label/image semantics and summary fields"}),YI({id:"board",label:"Board",icon:p0("▥"),arity:"Single",isCapable:(e,t,n)=>L(t.statusField,!1,t=>0!==qs(e,t).length),render:e=>g0(e,e=>i(e0,{source:e})),capability:"statusField — status/state/stage string enum (≤ 8 values) supplying the columns"}),YI({id:"calendar",label:"Calendar",icon:p0("▣"),arity:{TAG:"Multi",min:1},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(r0,{sources:e}),capability:"dateSpan — a `date-range` field, a start*/end* date-time pair, or a lone non-infrastructure date field"}),YI({id:"timeline",label:"Timeline",icon:p0("▚"),arity:{TAG:"Multi",min:2},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(i0,{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"}),YI({id:"gantt",label:"Gantt",icon:p0("▬"),arity:"Single",isCapable:(e,t,n)=>L(t.dateSpan,!1,ha),render:e=>g0(e,e=>i(a0,{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"}),YI({id:"hierarchy",label:"Hierarchy",icon:p0("⑂"),arity:"Single",isCapable:(e,t,n)=>$(t.parentField),render:e=>g0(e,e=>i(c0,{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"}),YI({id:"approvals",label:"Approvals",icon:p0("✓"),arity:"Single",isCapable:(e,t,n)=>function(e){return $(BZ(e,void 0))}(e),render:e=>g0(e,e=>i(u0,{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"}),YI({id:"pivot",label:"Pivot",icon:p0("⊞"),arity:"Single",isCapable:(e,t,n)=>$(d0(e)),render:e=>g0(e,e=>i(f0,{source:e})),capability:"two small string enums (2–12 values) as the row and column dimensions"}),YI({id:"gallery",label:"Gallery",icon:p0("▨"),arity:"Single",isCapable:(e,t,n)=>$(t.imageField),render:e=>i(h0,{sources:e}),capability:"imageField — a string field named image/imageUrl/photo/avatar/thumbnail (or annotated `image`) supplying each row's picture"});let S0=co([Ui("relative"),gi("inlineFlex"),di("center")]),w0=co([ui("background",x0(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",x0(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("padding-left","32px"),ui("font-size",x0(xt.sizeMd)),ui("color",x0(_t.textPrimary)),ui("outline","none"),ui("width","240px"),Xi([ui("border-color",x0(_t.brand))]),eo([ui("color",x0(_t.textDisabled))])]),E0=co([Ui("absolute"),Si(to(10)),ui("color",x0(_t.textDisabled)),ui("font-size",x0(xt.sizeSm)),ui("pointer-events","none")]),k0=co([Ui("absolute"),Bi(to(8)),ui("background","none"),ui("border","none"),ui("cursor","pointer"),ui("color",x0(_t.textDisabled)),ui("font-size",x0(xt.sizeSm)),ui("padding","0"),ui("line-height","1"),Yi([ui("color",x0(_t.textSecondary))])]);let C0=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:E0}),i("input",{className:w0,placeholder:s,type:"text",value:o,onChange:e=>n(e.target.value)}),""!==o?i("button",{children:"x",className:k0,onClick:e=>n("")}):null],className:S0})};function A0(e){return"var("+e+")"}let N0=co([gi("flex"),di("center"),ui("gap",A0(bt.sm)),_i("wrap")]),T0=co([gi("flex"),di("center"),ui("gap","4px")]),R0=co([ui("color",A0(_t.textSecondary)),ui("font-size",A0(xt.sizeSm)),ui("white-space","nowrap")]),D0=co([ui("background",A0(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",A0(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",A0(xt.sizeSm)),ui("color",A0(_t.textPrimary)),ui("cursor","pointer"),ui("outline","none"),Xi([ui("border-color",A0(_t.brand))])]);function I0(e){let t=e.onChange,n=e.filter;return r("div",{children:[i("span",{children:n.label+":",className:R0}),r("select",{children:[i("option",{children:"All",value:""}),n.options.map(e=>i("option",{children:e.label,value:e.value},e.value))],className:D0,value:n.value,onChange:e=>t(n.key,e.target.value)})],className:T0})}let F0=I0;let O0=function(e){let t=e.onSearchChange,n=e.searchValue,o=e.onFilterChange;return r("div",{children:[void 0!==n&&void 0!==t?i(C0,{value:n,onChange:t}):null,e.filters.map(e=>i(I0,{filter:e,onChange:o},e.key))],className:N0})};function P0(){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 M0(e){try{return decodeURIComponent(e)}catch(t){return e}}function L0(e){let t=e.split("/");if(2!==t.length)return[e,void 0];let n=t[0],r=t[1];return[M0(n),M0(r)]}function z0(e){return"var("+e+")"}let j0=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",z0(bt.md)),vi(1),ui("min-height","160px"),$i("center"),ui("padding",z0(bt.lg))]),U0=co([ui("font-size","32px"),ui("color",z0(_t.error)),ui("line-height","1")]),B0=co([ui("color",z0(_t.textPrimary)),ui("font-size",z0(xt.sizeLg)),ui("font-weight",z0(xt.weightMedium)),ki(to(0))]),$0=co([ui("color",z0(_t.textSecondary)),ui("font-size",z0(xt.sizeSm)),ui("line-height",z0(xt.lineHeightNormal)),ki(to(0))]),q0=co([ui("background",z0(_t.brand)),ui("color",z0(_t.textOnBrand)),ui("border","none"),ui("border-radius",z0(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",z0(xt.sizeSm)),ui("cursor","pointer"),Ti(to(4))]);let G0=function(e){let t=e.title,n=void 0!==t?t:"Something went wrong";return r("div",{children:[i("div",{children:"X",className:U0}),i("h3",{children:n,className:B0}),L(e.detail,null,e=>i("p",{children:e,className:$0})),L(e.onRetry,null,e=>i("button",{children:"Try again",className:q0,onClick:t=>e()}))],className:j0})};function V0(e){return"var("+e+")"}let K0=co([gi("flex"),di("center"),ui("gap",V0(bt.xs)),ui("font-size",V0(xt.sizeSm)),ui("color",V0(_t.textSecondary)),ui("min-width","0")]),W0=co([ui("color",V0(_t.brand)),ui("text-decoration","none"),ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("max-width","18ch"),Yi([ui("text-decoration","underline")])]),H0=co([ui("color",V0(_t.textPrimary)),ui("font-weight",V0(xt.weightMedium))]),J0=co([ui("color",V0(_t.textDisabled)),ui("font-size",V0(xt.sizeLg)),ui("line-height","1"),yi(0),Gi("none")]),X0=i("span",{children:"›","aria-hidden":!0,className:J0});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?X0:null,s||q(e.href)&&q(e.onClick)?i("span",{children:e.label,className:H0}):i("a",{children:e.label,className:W0,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:K0})};function Y0(e){return"var("+e+")"}let Z0=co([Ui("relative"),gi("inlineBlock")]),e1=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Y0(St.sm)),ui("cursor","pointer"),ui("color",Y0(_t.textSecondary)),ui("padding","2px var("+bt.sm+")"),ui("font-size",Y0(xt.sizeSm)),Yi([ui("background",Y0(_t.surfaceSubtle)),ui("color",Y0(_t.textPrimary))])]),t1=co([Ui("absolute"),Bi(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),ui("background",Y0(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",Y0(St.md)),ui("box-shadow",Y0(Et)),ui("min-width","160px"),ui("z-index","200"),ui("overflow","hidden"),ji(to(4),to(0))]);let n1=co([ui("border","none"),ui("border-top","1px solid var("+_t.borderSubtle+")"),Ci(to(4),to(0))]);let r1=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:e1,onClick:e=>{e.stopPropagation(),l(e=>!e)}}),c?i("div",{children:e.items.map((e,t)=>{if("object"!=typeof e)return i("hr",{className:n1},t.toString());let n=e.onClick,r=e.label;return i("button",{children:r,className:(o=e.danger,co([gi("block"),Vi({NAME:"percent",VAL:100}),ui("background","none"),ui("border","none"),ui("text-align","left"),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",Y0(xt.sizeMd)),ui("color",Y0(o?_t.error:_t.textPrimary)),pi("pointer"),Yi([ui("background",Y0(_t.surfaceSubtle))])])),onClick:e=>{l(e=>!1),n()}},r);var o}),className:t1,onClick:e=>{e.stopPropagation()}}):null],className:Z0})};function i1(e){return"var("+e+")"}let o1=co([gi("flex"),di("center"),ui("gap",i1(bt.md)),ui("flex-wrap","wrap"),ui("padding-bottom",i1(bt.sm)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),s1=co([ui("display","inline-flex"),di("center"),ui("vertical-align","middle"),ui("gap",i1(bt.xs)),ui("min-width","0"),ui("max-width","100%"),ui("margin-right",i1(bt.md)),ui("flex","0 1 auto")]),a1=co([ui("font-size",i1(xt.sizeLg)),ui("font-weight",i1(xt.weightMedium)),ui("color",i1(_t.textPrimary)),ui("line-height",i1(xt.lineHeightTight)),ki(to(0)),ui("min-width","8ch"),ui("white-space","nowrap"),ui("overflow","hidden"),ui("text-overflow","ellipsis")]),l1=co([ui("display","inline-flex"),di("center"),ui("vertical-align","middle"),ui("flex-wrap","wrap"),ui("gap",i1(bt.sm)),ui("flex","0 1 auto"),ui("min-width","0"),ui("max-width","100%")]),c1=co([gi("flex"),di("center"),ui("flex-wrap","wrap"),xi("flexEnd"),ui("gap",i1(bt.sm)),yi(0),ui("margin-left","auto")]),u1={titleGroup:s1};function d1(e){return"var("+e+")"}let f1=co([gi("inlineFlex"),di("center"),ui("gap","4px"),ui("border-radius",d1(St.md)),ui("padding","2px var("+bt.sm+")"),ui("font-size",d1(xt.sizeSm)),ui("line-height","1.6"),ui("white-space","nowrap"),pi("pointer"),Ji([ui("opacity","0.4"),pi("notAllowed")])]),h1=uo([f1,co([ui("background",d1(_t.brand)),ui("color",d1(_t.textOnBrand)),ui("border","1px solid transparent"),Yi([ui("filter","brightness(1.08)")])])]),p1=uo([f1,co([ui("background",d1(_t.surface)),ui("color",d1(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),Yi([ui("background",d1(_t.surfaceSubtle))])])]);let g1=p1,m1=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(jG),y=Oq(At.narrow),_=0!==f.length,b=e=>i("button",{children:e.label,className:U(e.primary,!1)?h1:p1,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(r1,{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=>GG(m?v:void 0,i("div",{children:e,className:c1}))),S=r(o,{children:[r("div",{children:[_?i(Q0,{crumbs:f,allLinks:!0}):null,_?X0:null,i("h1",{children:c,className:a1,title:c}),h],className:s1}),r("div",{children:[t,g],className:l1}),x]});return m?S:i("div",{children:S,className:o1})};function v1(e,t){return void 0!==t?(e,n)=>t(e,n).then(nH):void 0!==e?(t,n)=>e(t,n).then(tH):void 0}function y1(){return v1(AI(),NI())}let _1=Ze([["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 b1(e,t){return L(j(ht(e),e=>Xe(e,t)),[],e=>{let t=ut(e);if("object"!=typeof t)return[];switch(t.TAG){case"JSONString":let e=t._0;return""!==e?[e]:[];case"JSONArray":return me(t._0,dt).filter(e=>""!==e);default:return[]}})}function x1(e,t){return ge(Qe(t),e,(e,t)=>e.replaceAll("{{"+t[0]+"}}",t[1]))}function S1(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=Xe(_1,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=b1(s,r);return 0===i.length?Promise.resolve([r,""]):function(e,t,n,r){let i=Wa(t,n);return void 0!==i?ce(qI(e,i,r).then(e=>{let t=e[0];return r.map(e=>{let n=Xe(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(x1(o.template,t))})}let a={};return o.idFields.forEach(e=>{let t=e.field,n=b1(s,t);a[t]=n.join(", ")}),Promise.resolve(x1(o.template,a))}let w1="This command could not be sent. See the console for details.";function E1(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=v1(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 Qe(U(ht(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(),S1(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:w1}})):(console.error("[AutoUI] "+r+': command "'+t+'" not sent — no GraphQL executor in context'),u({TAG:"Failed",_0:{command:t,reason:w1}}))}}function k1(e){return"var("+e+")"}let C1=co([Ui("relative"),gi("inlineBlock")]),A1=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background",k1(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",k1(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",k1(_t.textSecondary)),ui("font-size",k1(xt.sizeSm)),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",k1(_t.surfaceSubtle)),ui("color",k1(_t.textPrimary))])]),N1=co([gi("inlineFlex"),di("center"),xi("center"),ui("min-width","16px"),ui("height","16px"),ui("padding","0 4px"),ui("border-radius",k1(St.full)),ui("background",k1(_t.brand)),ui("color",k1(_t.textOnBrand)),ui("font-size",k1(xt.sizeXs)),ui("line-height","1")]),T1=co([Ui("absolute"),Si(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),gi("flex"),mi("column"),ui("gap",k1(bt.sm)),ui("align-items","stretch"),ui("background",k1(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",k1(St.md)),ui("box-shadow",k1(Et)),ui("padding",k1(bt.md)),ui("min-width","220px"),ui("max-width","min(320px, calc(100vw - 32px))"),ui("max-height","min(60vh, 420px)"),ui("overflow-y","auto"),ui("z-index","200")]);let R1=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:N1}):null,i("span",{children:"▾","aria-hidden":!0})],"aria-expanded":u,className:A1,onClick:e=>{e.stopPropagation(),c(e=>!e)}}),u?i("div",{children:e.children,className:T1,onKeyDown:e=>{if("Escape"===e.key)return c(e=>!1)},onClick:e=>{e.stopPropagation()}}):null],className:C1})};function D1(e){return"var("+e+")"}let I1=co([gi("grid"),ui("grid-template-columns","minmax(0, 1fr) minmax(0, 1.4fr)"),ui("gap",D1(bt.lg)),ui("align-items","start"),Hi(At.narrow,[ui("grid-template-columns","minmax(0, 1fr)")])]),F1=co([ui("min-width","0"),ui("overflow","auto")]),O1=uo([F1,co([ui("border-left","1px solid var("+_t.border+")"),ui("padding-left",D1(bt.lg)),Hi(At.narrow,[ui("border-left","none"),ui("padding-left","0"),ui("border-top","1px solid var("+_t.border+")"),ui("padding-top",D1(bt.lg))])])]);let P1=function(e){return r("div",{children:[i("div",{children:e.master,className:F1}),i("div",{children:e.detail,className:O1})],className:I1})};function M1(e){return"var("+e+")"}let L1=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",M1(bt.md)),vi(1),ui("min-height","160px"),ui("color",M1(_t.textSecondary))]),z1=co([ui("width","32px"),ui("height","32px"),ui("border","3px solid var("+_t.borderSubtle+")"),ui("border-top-color",M1(_t.brand)),ui("border-radius","50%"),ui("animation","rv-spin 0.7s linear infinite")]),j1=co([ui("font-size",M1(xt.sizeSm)),ui("color",M1(_t.textSecondary))]);lo("@keyframes rv-spin",[Wi("from",[ui("transform","rotate(0deg)")]),Wi("to",[ui("transform","rotate(360deg)")])]);let U1=function(e){return r("div",{children:[i("div",{className:z1}),L(e.label,null,e=>i("span",{children:e,className:j1}))],className:L1})};function B1(e,t,n){let r={},i=[];e.forEach(e=>{let n=function(e,t){return U(j(Xe(e,t),dt),"")}(e,t),o=Xe(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(Xe(r,e),[])])}function $1(e){return j(j(ht(e),e=>Xe(e,"id")),dt)}function q1(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function G1(e,t){return j(ht(e),e=>Xe(e,t))}function V1(e){return!!e.startsWith("__")||e.startsWith("$")}let K1="$offload";function W1(e){let t=ut(e);if("object"!=typeof t)return!1;switch(t.TAG){case"JSONObject":let e=t._0;return!!$(Xe(e,K1))||Ye(e).some(W1);case"JSONArray":return t._0.some(W1);default:return!1}}function H1(e){let t=ut(e);if("object"==typeof t)switch(t.TAG){case"JSONObject":let e=t._0,n=j(Xe(e,K1),ht);if(void 0===n)return ge(Ye(e),void 0,(e,t)=>B(e,H1(t)));let r=j(Xe(n,"hash"),dt);return void 0!==r?r:j(Xe(n,"key"),dt);case"JSONArray":return ge(t._0,void 0,(e,t)=>B(e,H1(t)));default:return}}function J1(e,t){return me(t,t=>z(j(G1(e,t),H1),e=>[t,e]))}let X1=new Map;function Q1(e,t,n,r){let i=void 0!==r?r:[],o=t.state;if(void 0===o)return;let s=q1(n);if(0===s.length)return;!function(e,t){let n=L(ht(e),[],e=>Object.keys(e).filter(e=>!V1(e)&&!t.includes(e)));if(0===n.length)return;let r=n.join(",");q(X1.get(r))&&(X1.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(J1(t,n),t=>{let n=t[1],i=t[0],o=r.some(e=>e[0]===i&&e[1]===n),s=L(G1(e,i),!1,e=>"JSONNull"!==ut(e));if(o&&s)return i})}(e,o,s,i),l=function(e,t,n,r){let i=void 0!==r?r:[],o=ht(e),s=ht(t);if(void 0===o)return e;if(void 0===s)return e;let a=Ze(Qe(o));return n.filter(e=>!i.includes(e)).forEach(e=>{let t=Xe(s,e),n=Xe(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(G1(t,e),!1,W1)),s=L(ht(e),!1,e=>Object.keys(e).some(e=>!V1(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)&&yt(G1(e,n),G1(t,n)));return!o&&!a}(e,l,s,a)?l:void 0}let Y1={fromBatch:function(e,t,n){return z(j(j(ht(t),e=>Xe(e,n)),pt),t=>{let n=me(t,$1);return{rows:t,gone:e.filter(e=>!n.includes(e))}})},fromSingle:function(e,t){let n=j(ht(e),e=>Xe(e,t));if(void 0!==n)return"JSONNull"===ut(n)?"Absent":{TAG:"Present",_0:n}},drop:function(e,t){return 0===t.length?e:e.filter(e=>{let n=$1(e);return void 0===n||!t.includes(n)})}},Z1=/^[0-9]+$/;function e2(e){if(!Z1.test(e))return;let t=e.length;return e.slice((n=>{for(;;){let r=n;if(!(r<(t-1|0)&&vt(e[r],"0")))return r;n=r+1|0}})(0))}function t2(e,t,n){if(void 0===n)return!0;let r=e.get(t);return void 0===r||function(e,t){let n=e2(e),r=e2(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 n2={make:function(){return new Map},shouldApply:t2,record:function(e,t,n){void 0!==n&&t2(e,t,n)&&e.set(t,n)}};function r2(e,t){return U(e.get(t),[])}function i2(e,t,n){0===n.length||e.set(t,n)}let o2={make:function(){return new Map},known:r2,record:i2,apply:function(e,t,n,r){let i=Q1(t,n,r,r2(e,n.id)),o=n.state;return void 0!==o&&i2(e,n.id,J1(o,q1(r))),i}};function s2(e,t,n){return me(II(e,t),e=>{let t=j(Xe(e,"id"),dt),r=U(j(Xe(e,n),dt),U(t,""));return z(t,e=>({id:e,label:r}))})}function a2(e){return"var("+e+")"}function l2(e){if(""===e)return[];let t=pt(JSON.parse(e));return void 0!==t?me(t,dt):[e]}function c2(e){return JSON.stringify(e.map(e=>e))}let u2=co([Ui("relative"),Vi({NAME:"percent",VAL:100})]),d2=co([ui("background",a2(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",a2(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",a2(xt.sizeMd)),ui("color",a2(_t.textPrimary)),ui("outline","none"),Vi({NAME:"percent",VAL:100}),Fi(to(34)),gi("flex"),di("center"),_i("wrap"),ui("gap","4px"),pi("pointer"),$i("left"),Xi([ui("border-color",a2(_t.brand))])]),f2=co([ui("border-color",a2(_t.brand))]),h2=co([ui("border-color",a2(_t.error))]),p2=co([ui("color",a2(_t.textSecondary))]),g2=co([gi("inlineFlex"),di("center"),ui("background",a2(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",a2(St.sm)),ui("padding","2px 6px"),ui("font-size",a2(xt.sizeSm)),ui("gap","4px")]),m2=co([pi("pointer"),ui("color",a2(_t.textSecondary)),ui("font-weight",a2(xt.weightBold))]),v2=co([ui("border","none"),ui("background","transparent"),ui("outline","none"),ui("color",a2(_t.textPrimary)),ui("font-size",a2(xt.sizeMd)),vi(1),Oi(to(40))]),y2=co([Ui("absolute"),qi({NAME:"percent",VAL:100}),Si("zero"),Bi("zero"),Ti(to(2)),ui("background",a2(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",a2(St.sm)),ui("box-shadow",a2(Et)),Ei("none"),ki("zero"),zi("zero"),Di(to(240)),Li("auto"),Ki(20)]),_2=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),pi("pointer"),ui("color",a2(_t.textPrimary)),ui("font-size",a2(xt.sizeMd))]),b2=co([ui("background",a2(_t.surfaceSubtle))]),x2=co([ui("background",a2(_t.brandSubtle))]),S2=co([ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("color",a2(_t.textSecondary)),ui("font-size",a2(xt.sizeSm))]);let w2=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=AI(),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=s2(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=AI(),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=ht(r),s=U(j(j(i,e=>Xe(e,"data")),ht),{}),a=Xe(s,e),l=void 0!==a?a:j(i,t=>Xe(t,e)),c=j(l,ht);if(void 0!==c){let e=U(j(Xe(c,"id"),dt),t),r=U(j(Xe(c,n),dt),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=AI(),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=s2(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=l2(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=l2(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?d2+" "+f2:d2,re=_?ne+" "+h2: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:S2});else if(0===Q)K=i("li",{children:""===O?"No options":"No matches",className:S2});else{let e=f?l2(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}([[_2],n===D?[b2]:[],r?[x2]:[]]).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:y2,role:"listbox",style:oe});return se="Inline"===t?i("button",{children:""===u?i("span",{children:d?"Select…":"—",className:p2}):V(u),className:re,autoFocus:b,type:"button",onKeyDown:te,onBlur:e=>y(),onClick:e=>C(e=>!e)}):r("div",{children:[f?l2(u).map(e=>r("span",{children:[V(e),i("span",{children:"×",className:m2,onClick:t=>{t.stopPropagation(),Z(e)}})],className:g2},e)):null,i("input",{ref:T($),className:v2,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:u2})};function E2(e){return e.pluginId+"."+e.slice+"."+e.command.name}function k2(e,t,n){return e}function C2(e,t,n){let r=void 0!==n?n:k2;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 A2(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(ht(e.schema),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),Lt),ht),e=>Xe(e,"type")),dt),"")}function N2(e,t){return Ze([[e.field,A2(e.command,e.field)?c2([t]):t]])}function T2(e,t){return{command:e.command,initialValues:N2(e,t),navigateTo:e.navigateTo,formKey:e.command.name+":"+t}}function R2(e){return"var("+e+")"}let D2="168px",I2=co([gi("flex"),mi("column"),ui("gap",R2(bt.sm))]),F2=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",R2(bt.sm))]),O2=co([gi("inlineFlex"),di("center"),ui("gap",R2(bt.xs))]),P2=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",R2(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",R2(_t.textSecondary)),ui("font-size",R2(xt.sizeSm)),pi("pointer"),Yi([ui("background",R2(_t.surfaceSubtle)),ui("color",R2(_t.textPrimary))])]),M2=uo([P2,co([ui("background",R2(_t.surfaceSubtle)),ui("color",R2(_t.textPrimary)),ui("font-weight",R2(xt.weightMedium))])]),L2=co([ui("font-size",R2(xt.sizeMd)),ui("font-weight",R2(xt.weightMedium)),ui("color",R2(_t.textPrimary))]),z2=co([ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",R2(St.md)),ui("overflow","hidden")]),j2=co([gi("flex"),di("stretch")]),U2=uo([j2,co([ui("background",R2(_t.surfaceSubtle)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")])]),B2=uo([j2,co([ui("border-top","1px solid var("+_t.borderSubtle+")")])]),$2=co([ui("flex","0 0 "+D2),ui("padding","4px var("+bt.sm+")"),ui("font-size",R2(xt.sizeXs)),ui("color",R2(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),q2=co([ui("flex","0 0 "+D2),ui("padding","6px var("+bt.sm+")"),ui("font-size",R2(xt.sizeSm)),ui("font-weight",R2(xt.weightMedium)),ui("color",R2(_t.textPrimary)),ui("border-right","1px solid var("+_t.borderSubtle+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),G2=uo([q2,co([ui("color",R2(_t.textDisabled)),ui("font-style","italic")])]);function V2(e){return co([gi("grid"),ui("flex","1 1 auto"),ui("grid-template-columns","repeat("+e.toString()+", minmax(0, 1fr))")])}let K2=co([ui("background",R2(_t.surfaceSubtle))]),W2=co([ui("padding","4px var("+bt.xs+")"),ui("font-size",R2(xt.sizeXs)),ui("color",R2(_t.textSecondary)),ui("border-left","1px solid var("+_t.borderSubtle+")")]),H2=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-height","48px"),ui("padding","3px"),ui("border-left","1px solid var("+_t.borderSubtle+")")]),J2=uo([H2,co([ui("background",R2(_t.surfaceSubtle))])]);function X2(e){return co([gi("block"),ui("width","100%"),ui("text-align","left"),ui("border","none"),ui("border-left","3px solid "+e),ui("border-radius",R2(St.sm)),ui("background",R2(_t.surfaceSubtle)),ui("color",R2(_t.textPrimary)),ui("font-size",R2(xt.sizeXs)),ui("padding","1px var("+bt.xs+")"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap"),pi("pointer"),Yi([ui("background",R2(_t.surfaceElevated))])])}let Q2=co([pi("grab")]),Y2=co([Pi(.85),ui("z-index","10"),pi("grabbing")]),Z2=co([ui("font-size",R2(xt.sizeXs)),ui("color",R2(_t.textDisabled))]),e3="var("+_t.brand+")";function t3(e,t){return e.filter(e=>oc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function n3(e,t){return lc(e.start)||!rc(e.start,t)?e.title:ac(e.start)+" "+e.title}function r3(e){let t=e.draggable,n=e.event,r=uQ({id:n.key,disabled:!t}),o=t?X2(U(n.accent,e3))+" "+Q2:X2(U(n.accent,e3)),s=r.isDragging?o+" "+Y2:o,a=z(gQ(r.transform),e=>({transform:e})),l=r.listeners,c=null==l?void 0:T(l);return i("button",{children:n3(n,e.day),ref:T(r.setNodeRef),className:s,style:a,title:n.title,onKeyDown:e=>M(c,t=>pQ(t,e)),onClick:e=>n.onOpen(),onPointerDown:e=>M(c,t=>hQ(t,e))})}function i3(e){let t=e.draggable,n=e.today,o=e.days,s=e.lane,a=fQ({id:s.unassigned?"":s.resourceId}),l=!s.unassigned&&a.isOver?V2(o.length)+" "+K2:V2(o.length);return r("div",{children:[i("div",{children:s.label,className:s.unassigned?G2:q2}),i("div",{children:o.map(e=>i("div",{children:t3(s.events,e).map(n=>i(r3,{event:n,day:e,draggable:t},n.key)),className:e===n?J2:H2},e.toString())),ref:T(a.setNodeRef),className:l})],className:B2})}let o3=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(()=>Yl(U(o,Date.now()))),h=f[1],p=f[0],g=Yl(Date.now()),m=$(n);t="Week"===d?pe(7,e=>Zl(tc(p),e)):[Yl(p)];let v,y=e=>h(t=>Zl(t,"Week"===d?7*e|0:e)),_=(e,t)=>i("button",{children:t,className:d===e?M2:P2,onClick:t=>u(t=>e)});return v="Week"===d?uc(p):hc(p)+" — "+uc(p),r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:P2,onClick:e=>y(-1)}),i("button",{children:"Today",className:P2,onClick:e=>h(e=>g)}),i("button",{children:"›",className:P2,onClick:e=>y(1)}),i("span",{children:v,className:L2})],className:O2}),r("div",{children:[_("Week","Week"),_("Day","Day")],className:O2})],className:F2}),i(aQ,{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:$2}),i("div",{children:t.map(e=>i("div",{children:hc(e),className:W2},e.toString())),className:V2(t.length)})],className:U2}),l.map(e=>i(i3,{lane:e,days:t,today:g,draggable:m},e.unassigned?"\0unassigned":e.resourceId))],className:z2})}),void 0!==a?i("span",{children:a,className:Z2}):null],className:I2})};function s3(e){switch(e){case"Hints":return"hints";case"DeclaredTarget":return"declared-target";case"SchemaTarget":return"schema-target";case"Setter":return"setter"}}function a3(e,t){return e+"→"+t}function l3(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function c3(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt).filter(e=>"TAG"!==e)}function u3(e){return e.filter(e=>"Instance"===e.level)}function d3(e,t){let n=e.allowedStates;return void 0===n||0===n.length||n.includes(t)}function f3(e){let t=e.allowedStates,n=e.targetState;return void 0!==t&&void 0===n}function h3(e,t,n){return l3(e.schema).includes(t)?Ze([[t,n]]):{}}function p3(e){return 1!==e.length?void 0:e[0]}function g3(e,t,n){let r=u3(t),i=function(e,t){let n=e.filter(e=>!(f3(e)||!l3(e.schema).includes(t))&&c3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField)));return 1!==n.length?void 0:n[0]}(r,e);return(t,o)=>{let s=(n,r)=>{if(d3(n,t))return{command:n.name,patch:h3(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(p3(r.filter(e=>!!d3(e,t)&&vt(e.targetState,o))),e=>s(e,"DeclaredTarget"));if(void 0!==l)return l;let c=j(p3(r.filter(n=>!(f3(n)||!d3(n,t))&&vt(function(e,t){let n=j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Xe(e,t));if(void 0===n)return;let r=j(j(ht(n),e=>Xe(e,"const")),dt);if(void 0!==r)return r;let i=$s(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 m3(e,t,n,r){let i=g3(t,n,r),o=qs(e,t),s={};return o.forEach(e=>{o.forEach(t=>M(i(e,t),n=>{s[a3(e,t)]=n}))}),s}function v3(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 y3="resources",_3="events";function b3(e){return e.filter(e=>vt(e.role,_3))}function x3(e,t){return j(Xe(e,t),dt)}function S3(e){let t=function(e){return e.find(e=>vt(e.role,y3))}(e),n=b3(e),r=void 0!==t?t.rows.map(e=>{let n=U(ht(e),{}),r=U(x3(n,"id"),""),i=U(j(t.semantics.labelField,e=>x3(n,e)),r);return[r,i]}):[],i=r.map(e=>e[0]),o=n.map((e,t)=>me(e.rows,n=>{let r=U(ht(n),{}),i=U(x3(r,"id"),""),o=e.semantics.dateSpan;if(void 0!==o)return z(j(da(o,r),pc),s=>{let a=j(fa(o,r),pc),l=U(j(e.semantics.labelField,e=>x3(r,e)),i),c=U(j(e.resourceRef,e=>x3(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 w3(e){let t=e.sources,n=S3(t),r=b3(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(_e(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,Ze([[o,t]]))})}):void 0,a=ge(r,0,(e,t)=>e+t.rows.length|0),l=jo(nF(t),a,void 0,"scheduled item");return i(o3,{lanes:n,windowNote:l,onReassign:s})}let E3=i("span",{children:"☰","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),k3="scheduler";function C3(e){return!!$(Ua(e,void 0,void 0).dateSpan)&&xa(e).some(e=>$(eI(e[0])))}function A3(e,t){let n=e.filter(e=>"Instance"===e.level).filter(e=>!!l3(e.schema).includes(t)&&c3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField)));if(1===n.length)return n[0].name}function N3(e){return"var("+e+")"}YI({id:k3,label:"Scheduler",icon:E3,arity:{TAG:"Slots",_0:[{role:y3,min:1,max:1},{role:_3,min:1}]},isCapable:(e,t,n)=>C3(e),render:e=>i(w3,{sources:e}),capability:"role join: a resources source (lanes) + an events source with a date span and an entity-ref to the resource"});let T3=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",N3(St.full)),ui("padding","2px var("+bt.sm+")"),ui("color",N3(_t.textSecondary)),ui("font-size",N3(xt.sizeXs)),ui("line-height","1.5")]),R3=co([pi("pointer"),Yi([ui("background",N3(_t.surfaceSubtle)),ui("color",N3(_t.textPrimary))])]),D3=co([Pi(.6),pi("notAllowed")]),I3=co([Hi(At.compact,[ui("display","none")])]);function F3(e){return co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",e)])}let O3=F3(N3(_t.success)),P3=F3(N3(_t.border)),M3=F3(N3(_t.border)),L3=fo([[0,[Pi(.4)]],[50,[Pi(1)]],[100,[Pi(.4)]]]),z3=co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",N3(_t.warning)),ro(L3),io({NAME:"ms",VAL:1200}),oo("infinite"),so("easeInOut")]);let j3=function(e){let t=e.onToggle,n=e.reconnecting,o=e.canBeLive,s=e.live,a=void 0!==n&&n,l=o?s&&a?[T3+" "+R3,z3,"Reconnecting…"]:s?[T3+" "+R3,O3,"Live"]:[T3+" "+R3,P3,"Snapshot"]:[T3+" "+D3,M3,"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:I3})],"aria-label":"Live updates: "+c,className:l[0],title:d,disabled:!o,type:"button",onClick:u})};function U3(e){return"var("+e+")"}let B3=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("background",U3(_t.brand)),ui("color",U3(_t.textOnBrand)),ui("border","none"),ui("border-radius",U3(St.full)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",U3(xt.sizeSm)),ui("font-weight",U3(xt.weightMedium)),pi("pointer"),Yi([ui("opacity","0.85")])]),$3=co([gi("flex"),di("center"),xi("center"),ui("padding","var("+bt.xs+") 0")]);let q3=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:B3,type:"button",onClick:e=>t()}),className:$3})};function G3(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=AI(),h=NI(),p=s(()=>[]),g=p[1],m=s(()=>TI),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,JO(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=Ze(L(ht(l),[],Qe));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=>DI(r,e.queryField)),v(t=>FI(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 V3(e,t,n){let r=void 0===t||t,i=G3(e,void 0,void 0,r,void 0,50),o=h(void 0),s=h(n2.make()),a=h(o2.make()),l=bO(),c=r&&L(l,!1,t=>t.isLive(e.queryField));return uW(e.queryField,"All",c,t=>{if(!n2.shouldApply(s.current,t.id,t.seq))return;n2.record(s.current,t.id,t.seq);let n,r=t.changeKind;return n="Updated"===r?j(i.rows.find(e=>vt($1(e),t.id)),n=>o2.apply(a.current,n,t,e.schema)):void 0,void 0!==n?i.setRows(e=>e.map(e=>vt($1(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 K3(){try{return R(globalThis.localStorage)}catch(e){return}}let W3="reventless.live.";function H3(e){let t=K3();if(void 0===t)return!1;try{let n=D(t).getItem(W3+e);return null!=n&&"true"===n}catch(n){return!1}}function J3(e){let t=s(()=>H3(e)),n=t[1],r=t[0];a(()=>{n(t=>H3(e))},[e]);let i=f(()=>{let t=!r;!function(e,t){let n=K3();if(void 0!==n)try{return void D(n).setItem(W3+e,t?"true":"false")}catch(r){return}}(e,t),n(e=>t)},[r,e]);return[r,i]}function X3(e){switch(e.TAG){case"Invalid":return e._1;case"Valid":case"Pending":return 0}}function Q3(e){return[e._0,X3(e)]}function Y3(e,t){return Ee(t,e,(e,t)=>t(e))}function Z3(e){switch(e.TAG){case"Invalid":return e;case"Valid":case"Pending":return{TAG:"Valid",_0:e._0}}}function e4(e){if(!e.includes("."))return e;let t=e.replace(/0+$/,"");return t.endsWith(".")?t.slice(0,t.length-1|0):t}function t4(e){let t=Q3(e),n=t[0];return isFinite(n)&&(0|n)===n?Z3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a whole number",tl:t[1]}}}function n4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return 0|n._0}function r4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return n._0}function i4(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONString"===n.TAG)return n._0}function o4(e){let t=n4(e,"minLength"),n=n4(e,"maxLength"),r=z(i4(e,"pattern"),e=>new RegExp(e)),i=function(e){let t=i4(e,"format");if("cuid"===i4(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:i4(e,"description")}}function s4(e,t){return{min:r4(e,"minimum"),max:r4(e,"maximum"),integer:t}}function a4(e){return{minItems:n4(e,"minItems"),maxItems:n4(e,"maxItems")}}function l4(e){if("object"!=typeof e)return!1;switch(e.TAG){case"TextField":case"NumberField":case"EnumField":case"RefField":case"ItemsField":return e.required}}function c4(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 u4(e){return j(Xe(e,"items"),e=>{let t=j(ht(e),e=>Xe(e,"type"));if(void 0!==t&&vt(dt(t),"object"))return e})}function d4(e,t){let n={},r={};(void 0!==t?t:[]).forEach(e=>{let t=c4(e.propertyKey);if(void 0!==t){let n=t[0],i=U(Xe(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=ut(e);if("object"!=typeof i)return[];if("JSONObject"!==i.TAG)return[];let o,s=i._0,a=Xe(s,"required");if(void 0!==a){let e=ut(a);o="object"!=typeof e?[]:"JSONArray"===e.TAG?me(e._0,e=>{let t=ut(e);return"object"!=typeof t||"JSONString"!==t.TAG?void 0:t._0}):[]}else o=[];let l=Xe(s,"properties");if(void 0===l)return[];let c=ut(l);return"object"!=typeof c?[]:"JSONObject"===c.TAG?me(Qe(c._0),e=>{let t=e[1],i=e[0],s=ut(t);if("object"!=typeof s)return;if("JSONObject"!==s.TAG)return;let a=s._0;if($(Xe(a,"const")))return;let l,c=Xe(a,"type");if(void 0!==c){let e=ut(c);l="object"!=typeof e||"JSONString"!==e.TAG?"string":e._0}else l="string";let u,d=o.some(e=>e===i),f=Xe(n,i);if(void 0!==f)u=f.multi?f.entityNamePlural:f.entityName;else{let e=Xe(a,"title");if(void 0!==e){let t=ut(e);u="object"!=typeof t||"JSONString"!==t.TAG?lt(i):t._0}else u=lt(i)}let h,p,g=Xe(a,"enum");if(void 0!==g){let e=ut(g);h="object"!=typeof e||"JSONArray"!==e.TAG?void 0:me(e._0,e=>{let t=ut(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?a4(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=u4(a);p=void 0!==e?{TAG:"ItemsField",itemSchema:e,itemRefFields:U(Xe(r,i),[]),required:d}:{TAG:"TextField",required:d,constraints:o4(a)};break;case"integer":p={TAG:"NumberField",required:d,constraints:s4(a,!0)};break;case"number":p={TAG:"NumberField",required:d,constraints:s4(a,!1)};break;default:p={TAG:"TextField",required:d,constraints:o4(a)}}return z(p,e=>({key:i,label:u,fieldType:e,propSchema:t}))}):[]}function f4(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 h4(e,t){return j(z(Xe(e,t),Lt),ht)}function p4(e,t){let n=function(e){return U(j(j(ht(e),e=>Xe(e,"properties")),ht),{})}(e),r=IO(e),i={};return Qe(t).forEach(e=>{let t=e[1],o=e[0],s=function(e,t){return U(j(j(h4(e,t),e=>Xe(e,"type")),dt),"string")}(n,o),a=function(e,t){return $(j(j(h4(e,t),e=>Xe(e,"enum")),pt))}(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(na(n),e=>e),n)}}(s,a,t))}),i}function g4(e){let t={};return M(ht(e),e=>{Qe(e).forEach(e=>{t[e[0]]=function(e){let t=ut(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 m4=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function v4(e){let t=Q3(e),n=t[0];return null!==m4.exec(n)?Z3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid email address",tl:t[1]}}}function y4(e){let t,n=Q3(e),r=n[0];try{new URL(r),t=!0}catch(i){t=!1}return t?Z3(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid URL",tl:n[1]}}}let _4=/^[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 b4(e){let t=Q3(e),n=t[0];return null!==_4.exec(n)?Z3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid UUID",tl:t[1]}}}let x4=/^c[a-z0-9]{23,24}$/;function S4(e){let t=Q3(e),n=t[0];return null!==x4.exec(n)?Z3(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid CUID",tl:t[1]}}}function w4(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]}}:Z3(e)}function E4(e){let t=X3(e);if(0!==t)return t.hd}function k4(e,t,n){if(""===e)return t?function(e){let t=Q3(e),n=t[0];return n.length>0?Z3(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?Z3(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?Z3(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 v4;case"Url":return y4;case"Uuid":return b4;case"Cuid":return S4;case"DateTime":return w4}}(e))}),M(n.pattern,e=>{r.push(function(e,t){return n=>{let r=Q3(n),i=r[0];return null!==e.exec(i)?Z3(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}:Y3({TAG:"Pending",_0:e},xe(r))}function C4(e,t,n){if(""===e)return t?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e};let r=na(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(t4),M(n.min,e=>{i.push(function(e){return t=>{let n=Q3(t),r=n[0];return r>=e?Z3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+e4(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?Z3(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+e4(e.toString()),tl:n[1]}}}}(e))});let o=X3(Y3({TAG:"Pending",_0:r},xe(i)));return 0!==o?{TAG:"Invalid",_0:e,_1:o}:{TAG:"Valid",_0:e}}function A4(e,t){return t&&""===e?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e}}function N4(e,t){let n=e.propSchema;if(void 0!==n&&function(e,t){return L(_D(e,t),!1,e=>$(e.input))}(e.key,n)){let r=l4(e.fieldType),i=function(e,t,n,r){return j(j(_D(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 k4(t,r.required,r.constraints);case"NumberField":return C4(t,r.required,r.constraints);case"EnumField":return A4(t,r.required);case"RefField":return r.multi?function(e,t,n){let r=l2(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):A4(t,r.required);case"ItemsField":return function(e,t,n,r){let i;if(""===e)i=[];else try{i=pt(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=d4(n,r),s=me(i.map((e,t)=>{let n=g4(e);return me(o,e=>z(E4(N4(e,U(Xe(n,e.key),""))),e=>"Row "+(t+1|0).toString()+": "+e))[0]}),e=>e);return 0!==s.length?{TAG:"Invalid",_0:e,_1:xe(s)}:{TAG:"Valid",_0:e}}(t,r.required,r.itemSchema,r.itemRefFields)}}function T4(e){return"var("+e+")"}let R4=co([gi("flex"),mi("column"),ui("gap",T4(bt.md))]),D4=co([gi("flex"),mi("column"),ui("gap","4px")]),I4=co([ui("color",T4(_t.textSecondary)),ui("font-size",T4(xt.sizeSm)),ui("font-weight",T4(xt.weightMedium))]),F4=co([ui("color",T4(_t.error)),Ai(to(2))]),O4=co([ui("background",T4(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",T4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",T4(xt.sizeMd)),ui("color",T4(_t.textPrimary)),ui("outline","none"),Vi({NAME:"percent",VAL:100}),ui("transition","border-color 120ms, box-shadow 120ms"),Xi([ui("border-color",T4(_t.brand))])]),P4=co([ui("border-color",T4(_t.error)),Xi([ui("border-color",T4(_t.error)),ui("box-shadow","0 0 0 2px color-mix(in srgb, var("+_t.error+") 25%, transparent)")])]),M4=co([ui("color",T4(_t.error)),ui("font-size",T4(xt.sizeXs)),ui("min-height","1.1em"),ui("line-height","1.1"),Ti(to(2))]),L4=co([pi("pointer"),Ni(to(6))]),z4=co([ui("background",T4(_t.brand)),ui("color",T4(_t.textOnBrand)),ui("border","none"),ui("border-radius",T4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",T4(xt.sizeMd)),pi("pointer"),fi("flexStart"),ui("transition","opacity 120ms")]),j4=co([Pi(.5),pi("notAllowed")]),U4=co([gi("flex"),mi("column"),ui("gap",T4(bt.sm)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",T4(St.sm)),ui("padding",T4(bt.sm))]),B4=co([ui("color",T4(_t.textSecondary)),ui("font-size",T4(xt.sizeSm))]),$4=co([gi("flex"),di("flexStart"),ui("gap",T4(bt.sm)),ui("padding-bottom",T4(bt.sm)),ui("border-bottom","1px solid var("+_t.border+")")]),q4=co([gi("flex"),_i("wrap"),ui("gap",T4(bt.sm)),vi(1),Oi(to(0))]),G4=co([ui("background",T4(_t.surface)),ui("color",T4(_t.textPrimary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",T4(St.sm)),ui("padding","var("+bt.xs+") var("+bt.sm+")"),ui("font-size",T4(xt.sizeSm)),pi("pointer")]),V4=co([ui("margin-top","1.4em")]),K4=co([fi("flexStart")]);function W4(e){let t=e.error;return r("div",{children:[r("label",{children:[e.label,e.required?i("span",{children:"*",className:F4}):null],className:I4}),e.children,i("div",{children:void 0!==t?t:null,className:M4})],className:D4})}function H4(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=l4(l.fieldType),f=c?O4+" "+P4:O4,h=e=>o(l.key),p=l.propSchema,g=void 0!==p?function(e,t,n,r,i,o,s){return z(j(_D(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:L4,checked:"true"===a,type:"checkbox",onBlur:h,onChange:e=>s(l.key,e.target.checked?"true":"false")}),"Enabled"],className:I4});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(w2,{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 J4(e){let t=e.showError,n=e.onBlur,o=e.onChange,s=e.itemRefFields,a=e.itemSchema,l=e.fieldKey,c=p(()=>d4(a,s),[a,s]),u=function(e,t){let n,r=f4(t);if(""===e)n=[];else{let t;try{t=pt(JSON.parse(e))}catch(i){t=void 0}n=void 0!==t?t:[]}return n.map(e=>{let t=Ze(Qe(r));return Qe(g4(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=>p4(t,e)))}(e,a));return r("div",{children:[0===u.length?i("div",{children:"No rows yet.",className:B4}):null,u.map((e,o)=>r("div",{children:[i("div",{children:c.map(r=>{let s=U(Xe(e,r.key),""),a=t?E4(N4(r,s)):void 0;return i(W4,{label:r.label,required:l4(r.fieldType),error:a,children:i(H4,{field:r,value:s,onChange:(e,t)=>d(u.map((n,r)=>{if(r!==o)return n;let i=Ze(Qe(n));return i[e]=t,i})),onBlur:e=>n(l),hasError:$(a)})},r.key)}),className:q4}),i("button",{children:"Remove","aria-label":"Remove row "+(o+1|0).toString(),className:G4+" "+V4,type:"button",onClick:e=>d(u.filter((e,t)=>t!==o))})],className:$4},o.toString())),i("button",{children:"Add row",className:G4+" "+K4,type:"button",onClick:e=>d(u.concat([f4(c)]))})],className:U4})}function X4(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=l4(c.fieldType),h=u&&$(o),p=c.fieldType,g=0;return"object"!=typeof p||"ItemsField"!==p.TAG?g=1:t=i(J4,{fieldKey:c.key,itemSchema:p.itemSchema,itemRefFields:p.itemRefFields,value:l,onChange:a,onBlur:s,showError:u}),1===g&&(t=i(H4,{field:c,value:l,onChange:a,onBlur:s,hasError:h,autoFocus:d})),i(W4,{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(()=>d4(l,u),[l,u]),f=s(()=>{let e=f4(d);return M(n,t=>{Qe(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(Xe(g,e.key),"");return[e.key,N4(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=E4(e[1]);void 0===t||(E[e[0]]=t)});let k=(e,t)=>h(n=>{let r=Ze(Qe(n));return r[e]=t,r}),C=e=>v(t=>{let n=Ze(Qe(t));return n[e]=!0,n}),A=x&&!w,N=A?z4+" "+j4:z4;return r("form",{children:[d.map((e,t)=>{let n=U(Xe(y,e.key),!1);return i(X4,{field:e,value:U(Xe(g,e.key),""),onChange:k,onBlur:C,errorMessage:Xe(E,e.key),showError:n||x,autoFocus:0===t},e.key)}),i("button",{children:c,className:N,disabled:A,type:"submit"})],className:R4,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),b(e=>!0),w)return a(g)}})};function Y4(e){switch(e){case"SubmitStarted":return!1;case"FormOpened":case"SubmitFailed":return!0}}let Z4=l(void 0),e5=Z4.Provider;let t5=function(e){return c(e5,{value:e.session,children:e.children})};let n5=co([gi("flex"),mi("column"),ui("gap",function(e){return"var("+e+")"}(bt.md))]);let r5=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(Y4("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(ht(f),e=>{let t=Ze(Qe(e));return M(j(Xe(t,"properties"),ht),e=>{let n=Ze(Qe(e).filter(e=>!C.includes(e[0])));t.properties=n}),t}),f);return i(t5,{session:E,children:r("div",{children:[L(y[0],null,e=>i(QK,{variant:"Error",message:e})),b[0]?i(U1,{label:"Submitting..."}):null,i(Q4,{schema:A,onSubmit:e=>{let t=Ze(Qe(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=Y4("SubmitStarted"),n(t).then(e=>{if(x(e=>!1),"object"==typeof e){let t=e._0;w.current=Y4("SubmitFailed"),_(e=>t)}return Promise.resolve()})},submitLabel:v,initialValues:e.initialValues,refFields:m})],className:n5})})};function i5(e){let t=Qe(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 o5(e,t){let n=t.filter(e=>""===e[1]).map(e=>e[0]),r=t.filter(e=>""!==e[1]),i=Qe(e).filter(e=>{let t=e[0];return!n.includes(t)&&!r.some(e=>e[0]===t)});return Ze(i.concat(r))}function s5(){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=i5(e);J(n+t+r)};return{params:t,get:e=>Xe(t,e),set:(e,n)=>i(o5(t,[[e,n]])),setMany:e=>i(o5(t,e))}}let a5=l(void 0),l5=a5.Provider;let c5=function(e){return c(l5,{value:e.chrome,children:e.children})};function u5(e){return"var("+e+")"}let d5=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",u5(bt.md)),vi(1),ui("min-height","160px"),$i("center"),ui("padding",u5(bt.lg))]),f5=co([ui("font-size","32px"),ui("color",u5(_t.warning)),ui("line-height","1")]),h5=co([ui("color",u5(_t.textPrimary)),ui("font-size",u5(xt.sizeLg)),ui("font-weight",u5(xt.weightMedium)),ki(to(0))]),p5=co([ui("color",u5(_t.textSecondary)),ui("font-size",u5(xt.sizeSm)),ui("line-height",u5(xt.lineHeightNormal)),ui("max-width","440px"),ki(to(0))]),g5=co([ui("background","transparent"),ui("color",u5(_t.textSecondary)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",u5(St.md)),ui("padding","var("+bt.xs+") var("+bt.md+")"),ui("font-size",u5(xt.sizeSm)),ui("cursor","pointer"),Ti(to(4))]);let m5=function(e){let t=e.title,n=void 0!==t?t:"Unavailable";return r("div",{children:[i("div",{children:"( ! )",className:f5}),i("h3",{children:n,className:h5}),i("p",{children:e.detail,className:p5}),L(e.onRetry,null,e=>i("button",{children:"Try again",className:g5,onClick:t=>e()}))],className:d5})};function v5(e){return L(j(j(ht(e),e=>Xe(e,"properties")),ht),[],Qe)}function y5(e){return 1!==e.length?void 0:T(e[0])}function _5(e,t){return z(y5(v5(e.schema).filter(e=>t(e[0],e[1]))),e=>e[0])}function b5(e,t,n){return y5(me(e,e=>j(_5(e,n),n=>{if(function(e,t){return c3(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField))}(e,n))return{command:e,argument:n,tier:t}})))}function x5(e,t){return vt(Is(e).storeTarget,t)}let S5={contents:[]};function w5(e,t,n){let r=e+"."+t.command+"."+U(t.field,"")+"."+n;if(!S5.contents.some(e=>e===r))return S5.contents.push(r),void console.error('[AutoUI] x-reventless-setter on field "'+e+'": '+n)}function E5(e,t,n,r){let i=y5(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?v5(e.schema).some(e=>e[0]===i)?i:void 0:B(j(r,t=>_5(e,(e,n)=>x5(n,t))),_5(e,(e,t)=>e===n))}(i,t,n,r);return void 0!==e?{command:i,argument:e,tier:"Declared"}:void w5(n,t,'"'+t.command+'" takes no argument this field could fill — the slot stays static.')}w5(n,t,'no exposed instance command named "'+t.command+'" — the slot stays static.')}function k5(e,t,n){return j(function(e,t){return z(v5(e).find(e=>e[0]===t),e=>e[1])}(e,t),e=>{let r=Is(e),i=r.storeTarget,o=n.filter(e=>"Instance"===e.level),s=r.setter;if(void 0!==s)return E5(o,s,t,i);let a=j(i,e=>b5(o,"StoreMatch",(t,n)=>x5(n,e)));return void 0!==a?a:b5(o,"NameMatch",(e,n)=>e===t)})}function C5(e,t){let n=e.requiredRole;return void 0===n||t.includes(n)}let A5=function(e){let t=e.resource,n=V3(t,void 0),r={readModelName:t.name,rows:n.rows,schema:t.schema,semantics:e.resourceSemantics,window:Lo(n.canLoadMore),onOpenRow:(e,t)=>{},role:y3},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:_3,resourceRef:e.resourceRef,assignCommand:e.assignCommand},s=n.fetchState;return"object"!=typeof s?"Loading"===s?i(U1,{}):e.mode.render([r,o]):"Error"===s.TAG?i(G0,{detail:s._0,onRetry:()=>n.refetch()}):i(m5,{detail:s._0,onRetry:()=>n.refetch()})},N5=l(void 0),T5=N5.Provider;let R5=function(e){return c(T5,{value:e.refresh,children:e.children})};function D5(e){return"var("+e+")"}let I5=co([gi("flex"),mi("column"),ui("gap",D5(bt.lg))]),F5=co([gi("flex"),mi("column"),ui("gap",D5(bt.lg))]),O5=co([gi("flex"),mi("column"),ui("gap",D5(bt.sm))]),P5=co([ui("font-size",D5(xt.sizeSm)),ui("font-weight",D5(xt.weightMedium)),ui("color",D5(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em"),ki(to(0))]),M5=co([gi("flex"),di("center"),ui("gap",D5(bt.sm)),ui("flex-wrap","wrap")]),L5=co([gi("inlineFlex"),di("center"),ui("gap","6px"),ui("margin-left","auto"),ui("font-size",D5(xt.sizeSm)),ui("color",D5(_t.textSecondary)),ui("cursor","pointer"),ui("white-space","nowrap")]),z5=co([gi("flex"),mi("column"),ui("gap",D5(bt.sm)),ui("align-items","stretch"),Wi("& ."+L5,[ui("margin-left","0")])]),j5=co([gi("flex"),di("center"),xi("flexEnd"),ui("gap",D5(bt.xs)),ui("padding-top",D5(bt.sm))]),U5=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",D5(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",D5(_t.textSecondary)),ui("font-size",D5(xt.sizeSm)),pi("pointer"),Yi([ui("background",D5(_t.surfaceSubtle)),ui("color",D5(_t.textPrimary))]),Ji([ui("opacity","0.4"),pi("notAllowed")])]);let B5={contents:[]},$5={contents:[]};let q5={contents:[]};let G5=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=AI(),T=NI(),I=y1(),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=bO(),re=L(ne,!1,e=>e.isLive(w.queryField)),ie=J3(U(b,"default")+"."+w.name),oe=ie[0],se=re&&k&&oe,le=Ka(),ue=z(b,e=>({pluginId:e,viewName:w.name})),de=j(u,e=>bF(e,w.name)),fe=zF(w.schema,de,{registry:le,ownEntity:ue}),he=L(j(de,e=>e.suppress),!1,e=>e.includes(k3));if(void 0!==c&&(pe=w.schema,!he&&C3(pe))){let e=ZI(k3);t=void 0===e||fe.some(t=>t.id===e.id)?fe:fe.concat([e])}else t=fe;var pe;let ve=oF(b,w.name,void 0),ye=s(()=>sF(ve)),_e=ye[1],be=Pq(),xe=be.narrow,Se=Mq(be),we=jF(ye[0],de,Bs(w.schema),Se,t),Ee=void 0!==c&&void 0!==we&&we.id===k3,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,UF);if(void 0!==i)return i;let o=j(j(t,e=>e.layout),UF);return void 0!==o?o:U(j(n,UF),"Full")}(Ae[0],de,function(e){return j(j(ht(e),e=>Xe(e,"x-reventless-layout")),dt)}(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(n2.make()),ze=h(n2.make()),je=h(o2.make()),Be=h(o2.make()),$e=h(new Map),qe=e=>{$e.current.set(e,Date.now())},Ve=s5(),Ke=i5(Ve.params),We=h(OI),He=ae(),Je=z(b,e=>Ue(Ja(e,w.name))+Ke),Ye=js(w.schema),et=$(Ls(w.schema)),tt=e=>z(j(Xe(e,"id"),dt),t=>{let n=j(Ye,t=>j(Xe(e,t),dt));return void 0!==n?function(e,t){return encodeURIComponent(e)+"/"+encodeURIComponent(t)}(t,n):t}),nt=e=>void 0!==Ye?L0(e)[0]:e,rt=(e,t)=>{let n=void 0===e||e,r={};if(void 0!==Ye){let e=L0(t);r.id=e[0],M(e[1],e=>{r.subId=e})}else r.id=t;return et&&(r.includeRetired=n),r},it=void 0!==_?_:V,ot=e=>void 0!==b?He(Qa(b,w.name,e,[])+Ke):G(t=>e),st=()=>void 0!==Je?He(Je):G(e=>{}),at=LK(w.schema),ct=MK(w.schema),ft=at.hasFilter||at.hasSort||at.hasSearch,gt=Ua(w.schema,j(u,e=>xF(e,w.name)),{field:w.labelField,source:w.labelFieldSource}),mt=sI(w.schema,void 0,le,ue,gt.labelField,gt.projectedLabelField),_t=Gs(w.schema,j(de,e=>e.retiredLabel)),bt=Ws.offered(A,_t),xt=Ws.showing(bt,Ve.get(Ws.param)),St=[];Qe(Ve.params).forEach(e=>{let t=e[1];if(""===t)return;let n=e[0];if("after"===n||"before"===n)return void St.push(n+"="+t);if(n===Ws.param&&bt)return void St.push(n+"="+t);if(!ft)return;if("sort"===n||"dir"===n)return void St.push(n+"="+t);if("q"===n&&ct.search)return void St.push(n+"="+t);if(!n.startsWith("f."))return;let r=n.slice(2),i=L(mt.find(e=>e.key===r),!1,e=>PK(e).filter);i&&St.push(n+"="+t)});let wt=St.toSorted((e,t)=>e===t?0:e<t?-1:1).join("|"),Et={};if(ft){let e={};Qe(Ve.params).forEach(t=>{let n=t[0];n.startsWith("f.")&&(e[n.slice(2)]=t[1])});let t=zK(e,mt),n=U(Ve.get("q"),""),r=UK(t[0],n,ct,mt),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 Ze([["field",e._0],["direction",t]])}(jK(Ve.get("sort"),i,mt));M(r,e=>{Et.filter=e}),M(o,e=>{Et.orderBy=e})}var kt,Ct,At;(kt=Ve.get("after"),Ct=Ve.get("before"),At=50,void 0!==Ct&&""!==Ct?[["before",Ct],["first",At]]:void 0!==kt&&""!==kt?[["first",At],["after",kt]]:[["first",At]]).forEach(e=>{Et[e[0]]=e[1]}),bt&&(Et.includeRetired=xt);let Nt=G3(w,Et,wt,void 0,()=>W(e=>({})),void 0),Tt=Nt.refetch,Rt=Nt.fetchState,Dt=Nt.pageInfo,It=Nt.setRows,Ft=Nt.rows,Ot=e=>{if(void 0===m)return;if(void 0===v)return;let t=((e,t,n)=>void 0!==T?()=>T(e,rt(void 0,n)).then(e=>[e.data,JO(e,t)]):void 0!==N?()=>N(e,rt(void 0,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(ht(t[0]),e=>Xe(e,v)),i=0;return void 0!==n||void 0===r||"JSONNull"===ut(r)?i=1:(W(t=>{let n=Ze(Qe(t));return n[e]=r,n}),Q(e=>"Loaded")),1===i&&(W(t=>Ze(Qe(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};a(()=>{let e=void 0!==_?_:V;void 0!==e&&(q(Xe(H,e))?Ot(e):Q(e=>"Loaded"))},[_,V]);let Pt=Ge(),Mt=P0(),Lt=L(j(Dq(),e=>e.identity),[],e=>e.groups),zt=(e,t)=>z(P(k5(w.schema,t,w.commands),e=>C5(e.command,Lt)),t=>()=>O(n=>({command:t.command,rowId:e,formKey:t.command.name+":"+e}))),jt=e=>{let t=j(Xe(e,"id"),dt);return void 0!==t?C.map(e=>{let n=T2(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(ht(t),{})),Bt=(void 0!==S?S:Ft).map(e=>U(ht(e),{})),$t=HI(Bt,mt,le,ue,void 0),qt={lookupLabel:(e,t)=>MI($t,e,le,t),isMissing:(e,t)=>jI($t,e,le,t),retiredBadge:(e,t)=>LI($t,e,le,t),linkable:(e,t)=>zI($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}(Dt,Gt),Kt=function(e,t){return!!e.hasPreviousPage||"Forward"===t}(Dt,Gt),Wt=Vt||Kt,Ht=_I(mt,le,Pt,Xe,!0,qt,ue,(e,t)=>j(j(Xe(e,"id"),dt),e=>zt(e,t)),_t,gt.labelField).map(e=>{if(!e.sortable)return e;if(!Wt)return e;let t=L(mt.find(t=>t.key===e.key),!1,e=>PK(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=>It(t=>t.map(t=>{let n=$1(t);if(void 0===n)return t;let r=e.find(e=>vt($1(e),n));return void 0!==r?r:t})),Yt=void 0!==f?me(Ft,e=>j(j(ht(e),e=>Xe(e,f)),dt)):[],Zt=e=>{let t=Dt.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 It(t=>Y1.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 Tt();if(void 0!==g&&void 0!==p&&void 0!==N){let t={};return t.ids=e.map(e=>e),bt&&(t.includeRetired=xt),void ce(N(p,t).then(t=>{let n=Y1.fromBatch(e,t,g);return void 0!==n&&(Qt(n.rows),q(Ye)&&en(n.gone)),Promise.resolve()}),e=>Promise.resolve())}return void 0!==Ye||void 0===v||void 0===m||void 0===N?Tt():void e.forEach(e=>{let t=rt(xt,e);ce(N(m,t).then(t=>{let n=Y1.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=>It(t=>{let n=t.map(t=>{let n=$1(t);if(void 0===n)return t;let r=e.find(e=>vt($1(e),n));return void 0!==r?r:t}),r=me(n,$1),i=e.filter(e=>{let t=$1(e);return void 0!==t&&!r.includes(t)});return n.concat(i)}),on=e=>Ft.find(t=>vt($1(t),e)),sn=e=>!De||L(e,!1,e=>q(on(e))),an=()=>{if(M(it,Ot),sn(z(it,nt)))return Tt()},ln=WI.useInvalidate();uW(w.queryField,"All",se,e=>{if(!n2.shouldApply(Le.current,e.id,e.seq))return;n2.record(Le.current,e.id,e.seq),ln(w.queryField);let t=on(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!==Ye||void 0===r){let t=e.id;if(void 0!==Ye)return Tt();if(void 0!==g&&void 0!==p&&void 0!==N){let e={};return e.ids=[t],et&&(e.includeRetired=xt),void ce(N(p,e).then(e=>{let t=U(j(j(ht(e),e=>Xe(e,g)),pt),[]);return rn(t),Promise.resolve()}),e=>Promise.resolve())}if(void 0===v)return Tt();if(void 0===m)return Tt();if(void 0===N)return Tt();let n=rt(xt,t);return void ce(N(m,n).then(e=>{let t=j(ht(e),e=>Xe(e,v));return void 0!==t&&"JSONNull"!==ut(t)&&rn([t]),Promise.resolve()}),e=>Promise.resolve())}return rn([r]);case"Updated":if(void 0!==Ye)return n?nn(e.id):void 0;if(void 0===t)return;let i=Zt(e.sortKeyValue),o=o2.apply(je.current,t,e,w.schema);return i||void 0===o?nn(e.id):Qt([o]);case"Removed":return n?void 0!==Ye?nn(e.id):It(t=>t.filter(t=>yt($1(t),e.id))):void 0;case"BulkInvalidated":return Fe(e=>0),Tt()}},()=>Tt()),uW(w.queryField,{_0:U(z(it,nt),"")},se&&$(it),e=>{if(void 0===it)return;if(e.id!==nt(it))return;if(!n2.shouldApply(ze.current,e.id,e.seq))return;n2.record(ze.current,e.id,e.seq),ln(w.queryField);let t=e.changeKind;if(void 0!==Ye)switch(t){case"Updated":case"Removed":return Ot(it);case"Added":case"BulkInvalidated":return}else switch(t){case"Updated":let t=j(Xe(H,it),t=>o2.apply(Be.current,t,e,w.schema));return void 0!==t?(W(e=>{let n=Ze(Qe(e));return n[it]=t,n}),Q(e=>"Loaded")):Ot(it);case"Removed":return ee(e=>it);case"Added":case"BulkInvalidated":return}},()=>{void 0===it||void 0===m||void 0===v||void 0===N||ce(N(m,rt(void 0,it)).then(e=>{let t=j(ht(e),e=>Xe(e,v)),n=0;return void 0!==t&&"JSONNull"!==ut(t)?(W(e=>{let n=Ze(Qe(e));return n[it]=t,n}),Q(e=>"Loaded")):n=1,1===n&&ee(e=>it),Promise.resolve()}),e=>Promise.resolve())}),a(()=>{ee(e=>{})},[U(it,"")]);let cn=U(Ve.get("q"),""),un={};Qe(Ve.params).forEach(e=>{let t=e[0];t.startsWith("f.")&&(un[t.slice(2)]=e[1])});let dn,fn=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(Xe(t,e.key),"")}})}(mt,un),hn=0!==fn.length,pn=z(Jt,e=>({key:e,direction:"Asc"===Xt?"Asc":"Desc"})),gn=(e,t)=>{let n="Asc"===t?"asc":"desc";We.current=OI,Ve.setMany([["sort",e],["dir",n],["after",""],["before",""]])},mn=(e,t)=>{We.current=OI,Ve.setMany([["f."+e,t],["after",""],["before",""]])},vn=()=>M(Dt.endCursor,e=>{We.current=function(e,t){return e.concat([U(t,"")])}(We.current,Ve.get("after")),Ve.setMany([["after",e],["before",""]])}),yn=w.commands.filter(e=>"Instance"===e.level);if(0!==yn.length||0!==C.length){let e=e=>{let t=j(Xe(e,"id"),dt),n=w.lifecycleField;if(void 0!==n){void 0!==Xe(e,n)?void 0===rH(e,n)&&function(e,t,n){let r=U(e,"<no-plugin>")+"."+t;if(!$5.contents.some(e=>e===r))$5.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(!B5.contents.some(e=>e===r))B5.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=iH(yn,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(r1,{items:r.concat(o),triggerLabel:"..."})},t={key:"__actions",label:"",render:e,sortable:!1,width:"56px"};dn=Ht.concat([t])}else dn=Ht;let _n,bn=w.commands.filter(e=>"Collection"===e.level),xn=e=>{let t,n=e.map(e=>U(ht(e),{})),r=zK(un,mt),i=ft&&ct.search?"":cn,o=jK(Jt,Xt,mt);return t="object"!=typeof o||"ServerSort"===o.TAG?[void 0,Xt]:[o._0,o._1],b0(_0(y0(n,mt,r[1]),mt,i),mt,t[0],t[1])},Sn=e=>{if(void 0!==we&&we.id!==XI){let n=z(gt.statusField,e=>g3(e,yn,j(de,e=>e.transitions))),r=E1(N,T,yn,w.name,se,()=>Tt(),le,Mt.onNotice,qe),o=xn(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===k3){let e=Ua(c.resource.schema,j(u,e=>xF(e,c.resource.name)),{field:c.resource.labelField,source:c.resource.labelFieldSource});return i(A5,{mode:we,resource:c.resource,resourceSemantics:e,resourceRef:c.resourceRef,assignCommand:A3(yn,c.resourceRef),eventReadModelName:w.name,eventSchema:w.schema,eventRows:o,eventWindow:s,eventSemantics:gt,eventAccent:j(de,e=>e.accent),onOpenEvent:(e,t)=>M(j(ht(t),tt),ot),onCommand:r})}let a=w.name,l=w.schema,d=j(de,e=>e.accent),f=s,h=(e,t)=>M(j(ht(t),tt),ot),p=z(n,e=>r),g=zt,m=0===C.length?void 0:Ut,v={readModelName:a,rows:o,schema:l,semantics:gt,accent:d,window:f,onOpenRow:h,onCommand:p,statusCommandFor:n,fillSlot:g,rowActionsFor:m,ownEntity:ue,retired:_t,refLabels:qt};return we.render([v])}{let t=xn(e),n=z(x,e=>e=>M(tt(e),ot)),o=e=>U(tt(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(!q5.contents.some(e=>e===n))q5.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(Mo,{columns:e,data:t,keyFn:o,sortState:pn,onSort:gn,onRowClick:n,activeKey:it})},a=function(e){return Fs(e,e=>e.groupBy)[0]}(w.schema);if(void 0===a)return s(dn,t);let l=B1(t,a,qs(w.schema,a)),c=l.length;if(1===c)return s(dn,t);if(0===c)return s(dn,t);let u=dn.filter(e=>e.key!==a);return i("div",{children:l.map(e=>{let t=e[0];return r("div",{children:[i("div",{children:lt(t),className:P5}),s(u,e[1])],className:O5},t)}),className:F5})}var t},wn=void 0!==S?Sn(S):"object"!=typeof Rt?"Loading"===Rt?i(U1,{}):Sn(Ft):"Error"===Rt.TAG?i(G0,{detail:Rt._0,onRetry:()=>Tt()}):i(m5,{detail:Rt._0,onRetry:()=>Tt()});if(void 0!==it&&void 0!==x){let e=(void 0!==S?S:Ft).find(e=>vt(j(ht(e),tt),it)),t=Xe(H,it);_n=[it,x,void 0!==t?t:e]}else _n=void 0;let En,kn=e=>{let t=e[2],n=e[0];if(vt(te,n))return i(G0,{title:"Entity removed",detail:"This entity no longer exists. Return to the list to continue.",onRetry:()=>st()});if(void 0!==t)return e[1](nt(n),E,D(t));let r=0,o=0,s=0;if("object"!=typeof Rt){if("Loading"===Rt)return i(U1,{});if("object"!=typeof Y){if("Loading"!==Y)return i(G0,{title:"Row not found",detail:"The row data is no longer in the current page."});s=4}else{if("Error"!==Y.TAG)return i(m5,{detail:Y._0,onRetry:()=>Tt()});r=2}}else s=4;if(4===s)if("object"!=typeof Y){if("Loading"===Y)return i(U1,{});o=3}else o=3;if(3===o&&"object"==typeof Rt){if("Error"===Rt.TAG)return i(G0,{detail:Rt._0,onRetry:()=>Tt()});r=2}return 2===r&&"object"==typeof Y&&"Error"===Y.TAG?i(G0,{detail:Y._0,onRetry:()=>Tt()}):i(m5,{detail:Rt._0,onRetry:()=>Tt()})},Cn=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:hF.Style.btnLabel})],"aria-label":n,"aria-pressed":t?"true":"false",className:t?hF.Style.btnActive:hF.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:hF.Style.group,role:"group"}):null,An=qG(),Nn=k?i(j3,{live:oe,canBeLive:re,reconnecting:Re,onToggle:ie[1]}):null,Tn=i(m1,{title:w.name,commands:bn.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(hF.make,{modes:t,activeId:L(we,XI,e=>e.id),onSelect:e=>{aF(ve,e,Se),_e(t=>({mode:e,band:Se}))}}):null,Cn,Nn]}),inBar:$(An)}),Rn=GG(An,Tn),Dn=void 0!==_t&&bt?r("label",{children:[i("input",{checked:xt,type:"checkbox",onChange:e=>Ve.setMany(Ws.toggleParams(xt))}),Ws.label(_t)],className:L5}):null,In=hn?i(O0,{filters:fn,onFilterChange:mn}):null,Fn=ge(fn,0,(e,t)=>""===t.value?e:e+1|0)+(xt&&bt?1:0)|0,On=r(o,{children:[r("div",{children:[i(C0,{value:cn,onChange:e=>{We.current=OI,Ve.setMany([["q",e],["after",""],["before",""]])}}),xe&&(hn||bt)?i(R1,{activeCount:Fn,children:r("div",{children:[fn.map(e=>i(F0,{filter:e,onChange:mn},e.key)),Dn],className:z5})}):r(o,{children:[In,Dn]})],className:M5}),Oe>0?i(q3,{count:Oe,onClick:()=>{Fe(e=>0),We.current=OI,Ve.setMany([["after",""],["before",""]]),Tt()}}):null]}),Pn=Wt?r("div",{children:[i("button",{children:"‹ Prev",className:U5,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(Dt.startCursor,e=>Ve.setMany([["before",e],["after",""]]))})()}),i("button",{children:"Next ›",className:U5,disabled:!Vt,onClick:e=>vn()})],className:j5}):null,Mn=function(e){let t=ht(e),n=e=>U(j(j(j(j(j(j(t,e=>Xe(e,"properties")),ht),t=>Xe(t,e)),ht),e=>Xe(e,"title")),dt),lt(e));return j(j(j(t,e=>Xe(e,"x-reventless-owner-unscoped")),ht),e=>z(j(Xe(e,"field"),dt),t=>({ownerLabel:n(t),matchedGroups:L(j(Xe(e,"as"),pt),[],e=>me(e,dt))})))}(w.schema);if(void 0!==Mn){let e=Mn.matchedGroups,t=e.length,n=1!==t?0!==t?e.join(" / "):"an elevated role":e[0];En=i(QK,{variant:"Info",title:"Viewing as "+n,message:"This list is not filtered to you — it shows rows for every "+Mn.ownerLabel+"."})}else En=null;let Ln,zn=r(o,{children:[On,En,Mt.element,wn,Pn]});if("Full"===Te)if(void 0!==_n){let e=_n[2],t=_n[1],n=_n[0],o={label:w.name,href:Je,onClick:st},s=(e=>!!yt(te,e[0])&&$(e[2]))([n,t,e]),a={placement:$(An)?"Bar":"Pane",ancestors:[o],controls:Nn};Ln=i(R5,{refresh:an,children:r("div",{children:[s?null:GG(An,i("div",{children:i(Q0,{crumbs:[o],allLinks:!0}),className:u1.titleGroup})),i(c5,{chrome:a,children:kn([n,t,e])})],className:I5})})}else Ln=r("div",{children:[Rn,zn],className:I5});else{let e=void 0!==_n?kn(_n):i(_o,{title:"Select an item",description:"Choose a row on the left to see its details here."});Ln=i(R5,{refresh:an,children:r("div",{children:[Rn,i(c5,{chrome:{placement:"Pane",ancestors:[]},children:i(P1,{master:zn,detail:e})})],className:I5})})}return r(o,{children:[Ln,L(F[0],null,e=>i(sW,{isOpen:!0,onClose:()=>O(e=>{}),title:e.command.label,children:i(r5,{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?qe(n):M(Xe(t,U(e.command.aggregateIdField,"id")),qe),ce(I(e.command.mutationDocument,p4(e.command.schema,t)).then(t=>{if("object"!=typeof t)return"Accepted"===t?(O(e=>{}),sn(e.rowId)&&Tt(),M(e.navigateTo,J),Promise.resolve("Ok")):(O(e=>{}),sn(e.rowId)&&q(e.navigateTo)&&setTimeout(()=>Tt(),500),M(e.navigateTo,J),Promise.resolve("Ok"));{if("Rejected"===t.TAG){let e=t._0;return S1(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 V5(e){return e.map(e=>e.x.toString()+","+e.y.toString()).join(" ")}let K5=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("+_t.brand+")":a;return l.length<2?null:i("svg",{children:i("polyline",{fill:"none",points:V5(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 W5(e){return"var("+e+")"}let H5=co([gi("flex"),mi("column"),ui("gap",W5(bt.xs)),ui("padding",W5(bt.lg)),ui("background",W5(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",W5(St.md))]),J5=co([ui("color",W5(_t.textSecondary)),ui("font-size",W5(xt.sizeSm)),ui("font-weight",W5(xt.weightMedium))]),X5=co([gi("flex"),di("baseline"),ui("gap",W5(bt.sm))]),Q5=co([ui("color",W5(_t.textPrimary)),ui("font-size",W5(xt.sizeXxl)),ui("font-weight",W5(xt.weightBold)),ui("line-height",W5(xt.lineHeightTight))]);function Y5(e){switch(e){case"Up":return _t.success;case"Down":return _t.error;case"Neutral":return _t.textDisabled}}function Z5(e){return co([ui("color",W5(Y5(e))),ui("font-size",W5(xt.sizeSm)),ui("font-weight",W5(xt.weightMedium))])}let e6=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:Z5(o)})}else t=null;return r("div",{children:[i("div",{children:e.label,className:J5}),r("div",{children:[i("span",{children:e.value,className:Q5}),t],className:X5}),L(e.sublabel,null,e=>i("div",{children:e,style:{color:"var("+_t.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})),U(e.footer,null)],className:H5})};function t6(e){return"var("+e+")"}let n6=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),ui("gap",t6(bt.md))]),r6=co([pi("pointer"),ui("border-radius",t6(St.md)),Yi([ui("filter","brightness(0.98)")])]);let i6=function(e){let t=e.kpis;return 0===t.length?null:i("div",{children:t.map(e=>{let t=z(e.spark,e=>i(K5,{values:e,width:120,height:24})),n=i(e6,{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:r6,role:"button",tabIndex:0,onKeyDown:e=>{if("Enter"===e.key)return r()},onClick:e=>r()}:{children:n},e.key)}),className:n6})},o6=["var("+_t.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function s6(e,t){return U(e.color,o6[fe(t,o6.length)])}function a6(e,t,n,r){let i=2*(r-.25)*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function l6(e){return(Math.round(1e3*e)/1e3).toString()}function c6(e,t,n,r,i,o){let s=a6(e,t,n,i),a=s[1],l=s[0],c=a6(e,t,n,o),u=c[1],d=c[0],f=o-i>.5?"1":"0";if(r<=0)return"M "+l6(e)+" "+l6(t)+" L "+l6(l)+" "+l6(a)+" A "+l6(n)+" "+l6(n)+" 0 "+f+" 1 "+l6(d)+" "+l6(u)+" Z";let h=a6(e,t,r,i),p=a6(e,t,r,o);return"M "+l6(l)+" "+l6(a)+" A "+l6(n)+" "+l6(n)+" 0 "+f+" 1 "+l6(d)+" "+l6(u)+" L "+l6(p[0])+" "+l6(p[1])+" A "+l6(r)+" "+l6(r)+" 0 "+f+" 0 "+l6(h[0])+" "+l6(h[1])+" Z"}let u6=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=s6(s,t),d=n-o>=.999?c6(l,l,c,u,o,o+.5)+" "+c6(l,l,c,u,o+.5,n):c6(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()})},d6=["var("+_t.brand+")","var("+_t.success+")"];let f6=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(d6[t],"var("+_t.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 h6=function(e){let t=e.size,n=void 0!==t?t:120;return i(u6,{slices:e.slices,size:n,innerRatio:.6})};function p6(e){return"var("+e+")"}let g6=co([Ui("relative"),ui("width","100%"),ui("line-height","0")]),m6=co([Ui("absolute"),ui("left","0"),ui("right","0"),ui("bottom","0"),ui("text-align","center"),ui("line-height","1.1"),ui("font-size",p6(xt.sizeXl)),ui("font-weight",p6(xt.weightMedium)),ui("color",p6(_t.textPrimary))]),v6=co([gi("flex"),xi("spaceBetween"),ui("width","100%"),ui("font-size",p6(xt.sizeXs)),ui("color",p6(_t.textDisabled))]),y6=co([ui("font-size",p6(xt.sizeSm)),ui("color",p6(_t.textSecondary))]);function _6(e){return(Math.round(100*e)/100).toString()}function b6(e,t,n,r){let i=Math.PI+r*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function x6(e,t,n,r,i){let o=b6(e,t,n,r),s=b6(e,t,n,i);return"M "+_6(o[0])+" "+_6(o[1])+" A "+_6(n)+" "+_6(n)+" 0 0 1 "+_6(s[0])+" "+_6(s[1])}let S6=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:x6(f,p,h,0,1),fill:"none",stroke:"var("+_t.surfaceSubtle+")",strokeLinecap:"round",strokeWidth:_6(d)}),u<=0?null:i("path",{d:x6(f,p,h,0,u),fill:"none",stroke:"var("+_t.brand+")",strokeLinecap:"round",strokeWidth:_6(d)})],"aria-label":_6(a)+" of "+_6(o),role:"img",style:{display:"block",height:"auto",maxWidth:"100%"},height:_6(g),width:_6(c),viewBox:"0 0 "+_6(c)+" "+_6(g)}),i("div",{children:U(e.display,_6(a)),className:m6})],className:g6}),r("div",{children:[i("span",{children:_6(l)}),i("span",{children:_6(o)})],className:v6}),void 0!==n?i("div",{children:n,className:y6}):null],className:(m=c,co([gi("flex"),mi("column"),di("center"),ui("gap","2px"),ui("width","100%"),ui("max-width",m.toString()+"px")]))});var m};function w6(e){return"var("+e+")"}let E6=co([gi("flex"),mi("column"),ui("gap","6px")]),k6=co([ui("overflow-x","auto")]),C6=co([gi("flex"),ui("gap","4px"),di("flexStart")]);function A6(e){return co([gi("grid"),ui("grid-template-rows","repeat(7, "+e.toString()+"px)"),ui("gap","2px"),di("center"),ui("font-size",w6(xt.sizeXs)),ui("color",w6(_t.textDisabled)),ui("line-height","1")])}function N6(e){return co([gi("grid"),ui("grid-auto-flow","column"),ui("grid-auto-columns",e.toString()+"px"),ui("grid-template-rows","repeat(7, "+e.toString()+"px)"),ui("gap","2px")])}let T6=co([ui("visibility","hidden")]),R6=co([gi("flex"),di("center"),_i("wrap"),ui("gap",w6(bt.md)),ui("font-size",w6(xt.sizeXs)),ui("color",w6(_t.textSecondary))]),D6=co([gi("flex"),di("center"),ui("gap","4px")]);function I6(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 F6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let O6=function(e){let t=e.cellSize,n=e.days,o=void 0!==t?t:11,s=I6(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?uc(l.time)+" – "+uc(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(dc[t],""):"")},e.toString());var t}),className:A6(o)}),i("div",{children:s.map((e,t)=>e.map((e,n)=>{return void 0!==e?i("div",{className:(r=bW(e.value,a),co([ui("border-radius","2px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("background",r<=0?"transparent":"color-mix(in srgb, var("+_t.brand+") "+Math.round(100*r).toString()+"%, transparent)")])),title:hc(e.time)+" "+uc(e.time)+": "+F6(e.value)},e.time.toString()):i("div",{className:T6},"b:"+t.toString()+":"+n.toString());var r})),className:N6(o)})],className:C6}),className:k6}),r("div",{children:[i("span",{children:u}),r("span",{children:["less",xW.map(e=>{return i("span",{className:(t=e,co([ui("width","10px"),ui("height","10px"),ui("border-radius","2px"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("background","color-mix(in srgb, var("+_t.brand+") "+Math.round(100*t).toString()+"%, transparent)")]))},e.toString());var t}),"more (max "+F6(a)+")"],className:D6})],className:R6})],className:E6})};function P6(e){return"var("+e+")"}let M6=co([gi("flex"),mi("column"),ui("gap","2px")]),L6=co([gi("flex"),mi("column"),ui("gap","3px")]),z6=co([gi("flex"),xi("spaceBetween"),di("baseline"),ui("gap",P6(bt.sm)),ui("font-size",P6(xt.sizeSm))]),j6=co([ui("color",P6(_t.textPrimary))]),U6=co([ui("color",P6(_t.textPrimary)),ui("font-weight",P6(xt.weightMedium)),ui("white-space","nowrap")]),B6=co([ui("color",P6(_t.textSecondary)),ui("font-weight",P6(xt.weightNormal))]),$6=co([ui("background",P6(_t.surfaceSubtle)),ui("border-radius",P6(St.sm)),ui("height","14px"),Mi("hidden")]);function q6(e,t){return co([ui("background",t),ui("border-radius",P6(St.sm)),ui("height","100%"),ui("width",e.toString()+"%"),ui("min-width",e>0?"2px":"0")])}let G6=co([ui("padding","2px 0 4px"),ui("font-size",P6(xt.sizeXs)),ui("color",P6(_t.textDisabled))]),V6=co([ui("padding-top","4px"),ui("font-size",P6(xt.sizeXs)),ui("color",P6(_t.textDisabled))]);function K6(e,t){return t<=0?0:Math.round(e/t*1e3)/10}function W6(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let H6=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:K6(n.value,t),dropOff:void 0!==i&&i.value>0&&n.value<i.value?K6(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:G6}):null,r("div",{children:[r("div",{children:[i("span",{children:e.label,className:j6}),r("span",{children:[W6(e.value),0===t?null:i("span",{children:" · "+L(n,0,e=>e.conversion).toString()+"%",className:B6})],className:U6})],className:z6}),i("div",{children:i("div",{className:q6(a,U(e.color,"var("+_t.brand+")"))}),className:$6})],className:L6})]},e.label+":"+t.toString())}),void 0!==n?i("div",{children:n,className:V6}):null],className:M6})};function J6(e){return"var("+e+")"}let X6=co([gi("flex"),mi("column"),ui("gap","2px")]),Q6=co([gi("flex"),ui("gap","4px")]),Y6=[ui("font-size",J6(xt.sizeXs)),ui("color",J6(_t.textDisabled)),ui("white-space","nowrap")],Z6=co(Y6.concat([gi("flex"),mi("column"),xi("spaceBetween"),ui("text-align","right")]));let e8=co([gi("flex"),xi("spaceBetween"),ui("gap",J6(bt.sm)),ui("font-size",J6(xt.sizeXs)),ui("color",J6(_t.textSecondary))]);function t8(e){return(Math.round(100*e)/100).toString()}function n8(e,t,n){return n<=t?.5:(e-t)/(n-t)}let r8=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:e8})),r("div",{children:[r("div",{children:[r("div",{children:[i("span",{children:t8(u.yMax)}),i("span",{children:t8(u.yMin)})],className:Z6,style:{width:34..toString()+"px"}}),r("svg",{children:[i("line",{stroke:"var("+_t.borderSubtle+")",strokeWidth:"1",x1:t8(f),x2:t8(l-f),y1:t8(c-f),y2:t8(c-f)}),i("line",{stroke:"var("+_t.borderSubtle+")",strokeWidth:"1",x1:t8(f),x2:t8(f),y1:t8(f),y2:t8(c-f)}),a.map((e,t)=>{let n=f+n8(e.x,u.xMin,u.xMax)*h,r=f+(1-n8(e.y,u.yMin,u.yMax))*p;return i("circle",{children:i("title",{children:e.label+" — "+U(s,"x")+": "+t8(e.x)+", "+U(o,"y")+": "+t8(e.y)}),cx:t8(n),cy:t8(r),fill:U(e.color,"var("+_t.brand+")"),fillOpacity:"0.75",r:t8(3.5)},e.label+":"+t.toString())})],style:{display:"block",height:"auto",maxWidth:"100%",minWidth:"0"},height:t8(c),width:t8(l),viewBox:"0 0 "+t8(l)+" "+t8(c)})],className:Q6}),r("div",{children:[i("span",{children:t8(u.xMin)}),i("span",{children:t8(u.xMax)})],className:(m=38,co(Y6.concat([gi("flex"),xi("spaceBetween"),ui("margin-left",m.toString()+"px")])))}),d],className:X6});var m};function i8(e){return"var("+e+")"}let o8=co([gi("flex"),mi("column"),ui("gap","6px"),ki(to(0)),ui("padding","0"),ui("list-style","none")]),s8=[gi("grid"),ui("grid-template-columns","1.5rem 1fr auto"),di("center"),ui("gap",i8(bt.sm)),ui("font-size",i8(xt.sizeSm)),ui("color",i8(_t.textPrimary))],a8=co(s8),l8=co(s8.concat([pi("pointer"),ui("background","transparent"),ui("border","none"),ui("padding","2px 0"),ui("text-align","left"),ui("width","100%"),ui("font","inherit"),Yi([ui("color",i8(_t.brand))])])),c8=co([ui("align-self","start"),ui("font-size",i8(xt.sizeXs)),ui("color",i8(_t.textDisabled)),ui("text-align","right"),ui("font-variant-numeric","tabular-nums")]),u8=co([gi("flex"),mi("column"),ui("gap","3px"),Oi(to(0))]),d8=co([ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),f8=co([ui("background",i8(_t.surfaceSubtle)),ui("border-radius",i8(St.sm)),ui("height","6px"),Mi("hidden")]);function h8(e){return co([ui("background",i8(_t.brand)),ui("border-radius",i8(St.sm)),ui("height","100%"),ui("width",e.toString()+"%"),ui("min-width",e>0?"2px":"0")])}let p8=co([ui("align-self","start"),ui("font-weight",i8(xt.weightMedium)),ui("white-space","nowrap"),ui("font-variant-numeric","tabular-nums")]);function g8(e,t){return t<=0||e<=0?0:e/t*100}let m8=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:c8}),r("span",{children:[i("span",{children:e.label,className:d8,title:e.label}),i("span",{children:i("span",{className:h8(g8(e.value,a))}),className:f8})],className:u8}),i("span",{children:e.display,className:p8})]}),s=e.onOpen;return i("li",{children:void 0!==s?i("button",{children:n,className:l8,type:"button",onClick:e=>s()}):i("div",{children:n,className:a8})},e.key)}),className:o8})};let v8=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("+_t.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 y8(e){return"var("+e+")"}let _8=co([gi("flex"),mi("column"),ui("gap",y8(bt.lg))]),b8=co([ui("font-size",y8(xt.sizeXl)),ui("font-weight",y8(xt.weightMedium)),ui("color",y8(_t.textPrimary)),ki(to(0))]),x8=co([gi("grid"),ui("grid-template-columns","repeat(auto-fill, minmax(300px, 1fr))"),ui("gap",y8(bt.md))]),S8=co([gi("flex"),mi("column"),ui("gap",y8(bt.sm)),ui("padding",y8(bt.lg)),ui("background",y8(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",y8(St.md))]),w8=co([ui("font-size",y8(xt.sizeSm)),ui("font-weight",y8(xt.weightMedium)),ui("color",y8(_t.textSecondary))]),E8=co([gi("flex"),di("center"),ui("gap",y8(bt.lg))]),k8=co([gi("flex"),mi("column"),ui("gap","4px"),ui("font-size",y8(xt.sizeSm)),ui("color",y8(_t.textSecondary))]),C8=co([gi("flex"),di("center"),ui("gap","6px")]);function A8(e){return co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",e)])}let N8=co([ui("font-size",y8(xt.sizeXs)),ui("color",y8(_t.textDisabled))]),T8=co([gi("flex"),xi("spaceBetween"),di("center"),ui("gap",y8(bt.sm))]),R8=co([gi("inlineFlex"),ui("gap",y8(bt.xs))]);function D8(e,t){return j(Xe(e,t),e=>{let t=ft(e);return void 0!==t?t:z(VR(e),e=>e[0])})}function I8(e){return e.map(e=>U(ht(e),{}))}function F8(e,t,n){switch(t){case"avg":case"sum":break;default:return e.length}if(void 0===n)return e.length;let r=I8(e),i=me(r,e=>D8(e,n)),o=ge(i,0,(e,t)=>e+t),s=function(e,t){return ye(e,e=>z(j(Xe(e,t),VR),e=>e[1]))}(r,n),a=void 0!==s?function(e,t){return e/Math.pow(10,$R(t))}(o,s):o;return"sum"===t?a:0===i.length?0:a/i.length}function O8(e){let t=Math.round(100*e)/100;return t===Math.trunc(t)?Math.trunc(t).toString():t.toString()}function P8(e,t,n){return Uo(e,n&&("count"===t||"sum"===t))}function M8(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 L8(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 "+lt(r):e.view;case"sum":return void 0!==r?e.view+" — total "+lt(r):e.view;default:return e.view}}function z8(e,t,n,r){let i=pe(n,e=>[]);return I8(e).forEach(e=>M(j(da(t,e),pc),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 j8(e,t,n,r,i,o){return z8(e,t,n,r).map(e=>F8(e.map(e=>e),i,o))}function U8(e,t){return me(I8(e),e=>rH(e,t))}function B8(e,t,n){let r=qs(t,n),i=ge(e.filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r.concat(i)}function $8(e){return o6[fe(e,o6.length)]}function q8(e,t){return z(Xe(e.semantics,t),e=>e.semantic)}function G8(e,t,n){let r=function(e,t){return z(xa(e).find(e=>e[0]===t),e=>e[1])}(e,t);if(void 0===r)return;let i=Ra(r,"maximum");if(void 0===i)return vt(q8(n,t),"Percent")?{min:0,max:100}:void 0;let o=U(Ra(r,"minimum"),0);return i>o?{min:o,max:i}:void 0}function V8(e,t,n){let r=q8(e,t);if(void 0===r)return O8(n);switch(r){case"Percent":return KR(n);case"Bytes":return WR(n);case"Duration":return HR(n);case"Currency":case"Money":return UR(n);default:return O8(n)}}function K8(e,t,n,r,i,o){return j8(e,t,n,r,i,o).map((e,t)=>({time:Yl(r-((n-1|0)-t|0)*gc),value:e}))}function W8(e){let t,n=s(()=>"Days30"),o=n[1],a=n[0],l=(e,t)=>{return i("button",{children:t,className:(n=a===e,co([ui("background",n?y8(_t.surfaceSubtle):"transparent"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",y8(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",y8(xt.sizeXs)),ui("color",y8(n?_t.textPrimary:_t.textSecondary)),pi("pointer")])),type:"button",onClick:t=>o(t=>e)});var n};return t="Days30"===a?e.body:i(O6,{days:e.yearDays}),r("div",{children:[r("div",{children:[i("span",{children:e.title,className:w8}),r("div",{children:[l("Days30","30 days"),l("Year","Year")],className:R8})],className:T8}),t],className:S8})}let H8=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=gG(),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=yK(u,e.name,f);return[e,t,V3(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&&yK(u,t.name,f)),t=>{return{metric:e,readModel:t,rows:(r=t.name,void 0!==n?U(Xe(n,r),[]):L(p.find(e=>e[0].name===r),[],e=>e[2].rows)),partial:g(t.name),semantics:Ua(t.schema,j(s,e=>xF(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=>j8(e.rows,t,14,m,n,e.metric.field));return{key:t.toString()+":"+e.readModel.name,label:L8(e.metric),value:P8(O8(F8(e.rows,n,e.metric.field)),n,e.partial),sublabel:M8(e.readModel.name,n,e.partial,e.rows.length),spark:r,onOpen:()=>d(Ue(Ja(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=L8(e.metric)+" — trend",c=_(e);if("count"===a&&void 0!==c){let s=function(e,t,n,r,i,o){let s=z8(e,t,n,r),a=e=>me(e,e=>rH(e,o)),l=s.flatMap(a),c=B8(l,i,o).filter(e=>l.some(t=>t===e)),u=s.map((e,t)=>{let i=a(e);return{label:hc(r-864e5*((n-1|0)-t|0)),segments:c.map((e,t)=>({key:lt(e),value:i.filter(t=>t===e).length,color:$8(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(v8,{bars:s.bars}),i("div",{children:a.map((e,t)=>r("span",{children:[i("span",{className:A8($8(t))}),lt(e)],className:C8},e)),className:k8})]})}else n=void 0;if(void 0!==n)s=n;else{let n=j8(e.rows,t,30,m,a,e.metric.field);s=i(f6,{series:[{label:L8(e.metric),values:n}]})}return i(W8,{title:l,body:s,yearDays:K8(e.rows,t,365,m,a,e.metric.field)},"trend:"+L8(e.metric))})),x=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if("avg"===t&&void 0!==n)return z(G8(e.readModel.schema,n,e.semantics),t=>{let o=F8(e.rows,"avg",n);return r("div",{children:[i("span",{children:L8(e.metric),className:w8}),i(S6,{value:o,min:t.min,max:t.max,display:V8(e.semantics,n,o),caption:e.readModel.name+" · "+lt(n)})],className:S8},"gauge:"+L8(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(I8(e),e=>z(D8(e,t),t=>{let r=U(j(Xe(e,"id"),dt),"");return{id:r,label:U(j(Xe(e,n),dt),""===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:V8(e.semantics,n,t.value),value:t.value,onOpen:""===t.id?void 0:()=>d(Qa(c,e.readModel.name,t.id,[]))}));return 0===o.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — top by "+lt(n),className:w8}),i(m8,{entries:o})],className:S8},"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(I8(a),e=>{let t=D8(e,l),n=D8(e,c);if(void 0!==t&&void 0!==n)return{label:U(j(Xe(e,u),dt),U(j(Xe(e,"id"),dt),"—")),x:t,y:n}}));var a,l,c,u;return 0===s.length?void 0:r("div",{children:[i("span",{children:e.readModel.name+" — "+lt(n)+" by "+lt(o),className:w8}),i(r8,{points:s,xLabel:lt(o),yLabel:lt(n)})],className:S8},"scatter:"+L8(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=qs(t,n),i=U8(e,n),o=me(i,e=>{let t=r.indexOf(e);return t<0?void 0:t});return{stages:r.map((e,t)=>({label:lt(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:L8(e.metric)+" — "+lt(n)+" funnel",className:w8}),i(H6,{stages:s,note:0===a?void 0:a.toString()+" row(s) with an unlisted "+lt(n)+" excluded"})],className:S8},"funnel:"+L8(e.metric))}),C=me(v,e=>{let t=U(e.metric.aggregate,"count"),n=vt(e.metric.viz,"funnel")?void 0:_(e);if("count"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=U8(e,n);return me(B8(r,t,n),e=>{let t=r.filter(t=>t===e).length;return 0===t?void 0:{label:lt(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 "+lt(n),className:w8}),r("div",{children:[i(h6,{slices:o}),i("div",{children:o.map((e,t)=>r("span",{children:[i("span",{className:A8(s6(e,t))}),e.label+" ("+O8(e.value)+")"],className:C8},e.label)),className:k8})],className:E8})],className:S8},"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(_K(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:b8}),i(i6,{kpis:y}),0!==N.length?i("div",{children:N,className:x8}):null,0!==T.length?i("span",{children:"Figures cover the rows loaded for: "+T.join(", "),className:N8}):null,0!==A.length?i("span",{children:A.join(" · "),className:N8}):null],className:_8})};function J8(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 X8(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 Y8(e){return 0!==e.vetoes.length}function Z8(e){return!!q(e.tier)&&0===e.vetoes.length}function e9(e,t,n,r,i,o){let s=[];vt(e.command.ownerField,n)&&s.push("PlatformSuppliedField");let a=e.enclosingAggregate,l=eI(n),c=void 0!==a&&void 0!==l&&l.toLowerCase()===a.name.toLowerCase();return"Collection"===e.command.level&&(vt(e.command.aggregateIdField,n)||c)&&s.push("NewEntityIdentity"),nI(function(e){let t=e.command.aggregateIdField;if(void 0!==t)return U(eI(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 t9(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:k2,a=[];return o.forEach(t=>{let n=c3(t.command.schema);var i;(i=t.command.schema,L(j(j(ht(i),e=>Xe(e,"properties")),ht),[],e=>me(Qe(e),e=>{let t=e[0],n=ht(e[1]),r=$(j(n,e=>Xe(e,"const"))),i=j(j(n,e=>Xe(e,"type")),dt),o=j(j(j(j(n,e=>Xe(e,"items")),ht),e=>Xe(e,"type")),dt);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=Ha(r,e.entity);return void 0!==i?i:Wa(r,e.entity)})}(t.command,i,r),c=function(e,t){return j(eI(e),e=>Wa(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=e9(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 n9(e,t){return e.filter(e=>e.viewName===t)}let r9={actor:"",eventType:"",timeFrom:"",timeTo:""};function i9(e){return""!==e.actor||""!==e.eventType||""!==e.timeFrom||""!==e.timeTo}function o9(e){return"var("+e+")"}let s9=co([gi("flex"),mi("column"),ui("gap",o9(bt.sm))]),a9=co([gi("flex"),di("center"),ui("gap",o9(bt.md)),_i("wrap"),ui("padding-bottom",o9(bt.xs)),ui("border-bottom","1px solid var("+_t.border+")")]),l9=co([gi("flex"),di("center"),ui("gap","4px")]),c9=co([ui("color",o9(_t.textSecondary)),ui("font-size",o9(xt.sizeSm)),ui("white-space","nowrap")]),u9=co([ui("background",o9(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",o9(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("font-size",o9(xt.sizeSm)),ui("color",o9(_t.textPrimary)),ui("outline","none"),Xi([ui("border-color",o9(_t.brand))])]),d9=co([ui("background","none"),ui("border","none"),ui("padding","0"),ui("color",o9(_t.brand)),ui("font-size",o9(xt.sizeSm)),pi("pointer"),Yi([ui("text-decoration","underline")])]),f9=co([gi("flex"),xi("center"),ui("padding-top",o9(bt.xs))]),h9=co([ui("background",o9(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",o9(St.sm)),ui("padding","4px var("+bt.md+")"),ui("font-size",o9(xt.sizeSm)),ui("color",o9(_t.textPrimary)),pi("pointer"),Yi([ui("border-color",o9(_t.brand))])]);let p9=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:lt(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(O0,{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:c9}),i("input",{className:u9,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:c9}),i("input",{className:u9,type:"date",value:l.timeTo,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:e.target.value})})],className:l9}),i9(l)?i("button",{children:"Clear filters",className:d9,onClick:e=>a(r9)}):null],className:a9}),i(ZY,{entries:e.entries,emptyLabel:i9(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:h9,disabled:u,onClick:e=>M(n,e=>e())}),className:f9}):null],className:s9})};let g9=function(e){let t=e.entityId,n=e.binding,r=AI(),o=gG(),l=L(e.requiredAccess,!1,e=>!o(e)),c=s(()=>[]),u=c[1],d=c[0],f=s(()=>r9),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(DI(e,t),nK)}(t,n.queryField),i=function(e,t){let n=FI(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(G0,{title:"History unavailable",detail:b,onRetry:()=>k(e=>e+1|0)}):i(p9,{entries:oK(d,n.displayName),actors:sK(d),eventTypes:aK(d),filter:g,onFilterChange:T,hasMore:x[0],loading:m[0],onLoadMore:R})};function m9(e){return"var("+e+")"}let v9=co([gi("flex"),mi("column"),ui("gap",m9(bt.lg))]),y9=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",m9(bt.md))]),_9=co([ui("font-size",m9(xt.sizeXl)),ui("font-weight",m9(xt.weightMedium)),ui("color",m9(_t.textPrimary)),ki(to(0))]),b9=co([gi("flex"),_i("wrap"),di("center"),ui("gap",m9(bt.md)),ui("font-size",m9(xt.sizeSm)),ui("color",m9(_t.textSecondary))]),x9=co([gi("inlineFlex"),di("center"),ui("gap","4px"),pi("pointer")]);let S9=co([ui("font-size",m9(xt.sizeXs)),ui("color",m9(_t.textDisabled))]),w9=co([gi("flex"),di("center"),ui("gap",m9(bt.sm))]),E9=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",m9(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",m9(_t.textSecondary)),ui("font-size",m9(xt.sizeSm)),pi("pointer"),Yi([ui("background",m9(_t.surfaceSubtle)),ui("color",m9(_t.textPrimary))])]);let k9=function(e){let t=e.viewAccess,n=e.uiHints,o=e.readModels,a=e.pluginId,l=void 0!==t?t:{},c=ae(),u=gG(),d=AI(),f=NI(),h=Ka(),p=P0(),g=s(()=>[]),m=g[1],v=g[0],y=o.map((e,t)=>{let n=yK(l,e.name,u),r=n&&!v.includes(e.name);return[e,t,r,n,V3(e,r)]}),_=(e,t)=>U(j(j(n,t=>bF(t,e.name)),e=>e.accent),t0[fe(t,t0.length)]),b=me(y,e=>{let t=e[4],r=e[0],i=j(n,e=>bF(e,r.name)),o=Ua(r.schema,j(n,e=>xF(e,r.name)),{field:r.labelField,source:r.labelFieldSource}),s=z(o.statusField,e=>g3(e,r.commands,j(i,e=>e.transitions))),l=E1(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:Lo(t.canLoadMore),onOpenRow:(e,t)=>c(Qa(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(_K(l,o.map(e=>e.name),u));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:_9}),className:y9}),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]),co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",n)]))}),t.name],className:x9},t.name);var n}),className:b9}),p.element,e.mode.render(b),0!==x.length?r("div",{children:[i("button",{children:"Load more",className:E9,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:S9})],className:w9}):null,0!==S.length?i("span",{children:S.join(" · "),className:S9}):null],className:v9})};function C9(e){return"var("+e+")"}let A9=co([gi("flex"),mi("column"),ui("gap",C9(bt.lg)),ui("padding","0 var("+bt.md+")"),ui("min-width","0")]),N9=co([gi("flex"),di("center"),ui("gap",C9(bt.sm)),yi(0)]),T9=co([gi("flex"),mi("column"),ui("gap",C9(bt.sm)),ui("min-width","0")]),R9=co([gi("flex"),di("start"),ui("gap",C9(bt.md)),ui("padding","var("+bt.xs+") 0"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Zi([ui("border-bottom","none")])]),D9=co([ui("color",C9(_t.textSecondary)),ui("font-size",C9(xt.sizeMd)),ui("font-weight",C9(xt.weightMedium)),ui("white-space","nowrap"),ui("padding-top","2px"),yi(0),ui("min-width","200px")]),I9=co([ui("color",C9(_t.textPrimary)),ui("font-size",C9(xt.sizeMd)),ui("word-break","break-word"),ui("min-width","0")]),F9=co([gi("flex"),di("start"),ui("gap",C9(bt.md)),ui("padding","var("+bt.xs+") 0"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),Zi([ui("border-bottom","none")])]),O9=co([ui("color",C9(_t.textSecondary)),ui("font-size",C9(xt.sizeMd)),ui("font-weight",C9(xt.weightMedium)),ui("padding-top","2px"),yi(0),ui("min-width","200px")]),P9=co([gi("flex"),mi("column"),ui("gap",C9(bt.sm)),vi(1),ui("padding",C9(bt.md)),ui("background",C9(_t.surfaceSubtle)),ui("border-radius",C9(St.md)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("min-width","0")]),M9=co([gi("flex"),mi("column"),ui("gap",C9(bt.sm)),ui("min-width","0")]),L9=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",C9(bt.md)),ui("padding-bottom",C9(bt.xs)),ui("border-bottom","1px solid var("+_t.borderSubtle+")")]),z9=co([ui("color",C9(_t.textPrimary)),ui("font-size",C9(xt.sizeMd)),ui("font-weight",C9(xt.weightMedium))]),j9=co([ui("overflow-x","auto"),ui("max-width","100%"),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",C9(St.md))]),U9=co([ui("color",C9(_t.textDisabled)),ui("font-size",C9(xt.sizeSm))]);function B9(e,t){return U(j(j(ht(e),e=>Xe(e,"title")),dt),lt(t))}function $9(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function q9(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function G9(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function V9(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 K9(e,t){let n=Lt(t),r=$9(n),i=Ft(n);if(void 0!==i)return{TAG:"TaggedUnion",_0:i};if(void 0!==r)switch(r){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(n);if(void 0===t)return"ArrayOfScalars";let r=$9(t);if(G9(t)||vt(r,"object"))return{TAG:"ArrayOfObjects",_0:t};if(!vt(r,"string"))return"ArrayOfScalars";let i=V9(e);return void 0!==i?{TAG:"EntityRefArray",_0:i}:"ArrayOfStrings";case"boolean":return"Bool";case"object":return G9(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:q9(n)};let o=V9(e);return void 0!==o?{TAG:"EntityRef",_0:o}:{TAG:"Scalar",_0:U(r,"string"),_1:q9(n)}}function W9(e,t,n,r){let o=ut(e);if("object"!=typeof o)switch(o){case"JSONFalse":return i(Ss,{variant:"Neutral",label:"false",dot:!1});case"JSONTrue":return i(Ss,{variant:"Success",label:"true",dot:!1});case"JSONNull":return i("span",{children:"—",className:U9})}else switch(o.TAG){case"JSONString":let r=o._0;return"date-time"===t?ms(r):U(bs(n,r),r);case"JSONNumber":return o._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}function H9(e){return U(z(pt(e),e=>e.map(e=>{let t=ut(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 J9(e){return U(z(pt(e),e=>me(e,ht)),[])}function X9(e,t){let n=j(Xe(e,"id"),dt);if(void 0!==n)return n;let r=j(Xe(e,"compositeId"),dt);return void 0!==r?r:"#"+t.toString()}function Q9(e){return e.map((e,t)=>({key:X9(e,t),row:e}))}let Y9=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=AI(),k=y1(),C=Ka(),A=Ge(),N=d(N5),T=qG(),R=d(a5),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=Lq(),Q=$(u)&&$(c)?w:O[0],Y=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return F(Qa(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=$(ht(o.data)),l=pt(o.data);if(a){let e=U(ht(o.data),{}),t=j(j(ht(o.schema),e=>Xe(e,"properties")),ht),n=j(t,e=>Xe(e,i)),r=Xe(e,i);s=void 0!==r&&void 0!==n?{data:r,schema:n,label:B9(n,i)}:void 0}else if($(l)){let e=U(l,[]),t=U(j(ht(o.schema),e=>Xe(e,"items")),o.schema),n=e.find((e,t)=>X9(U(ht(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(ht(b),{}),te=sI(_,"Drill",C,I,h,void 0),ne=HI([ee],te,C,I,void 0),re={lookupLabel:(e,t)=>MI(ne,e,C,t),isMissing:(e,t)=>jI(ne,e,C,t),retiredBadge:(e,t)=>LI(ne,e,C,t),linkable:(e,t)=>zI(ne,e,C,t,!1)},ie=L(j(Dq(),e=>e.identity),[],e=>e.groups),oe=(e,t,n)=>r("div",{children:[i("div",{children:t,className:D9}),i("div",{children:n,className:I9})],className:R9},e),se=(e,t,n)=>nI(e,C,I)?n:uI(e,t,C,n),le=function(e,t){if(void 0!==t&&"id"!==t)return j(j(j(ht(e),e=>Xe(e,t)),dt),e=>""===e?void 0:e)}(b,h),ue=e=>{let t=ut(e.data);if("object"!=typeof t){if("JSONNull"===t)return i("span",{children:"—",className:U9})}else switch(t.TAG){case"JSONObject":let t=U(ht(e.data),{}),n=0===Q.length,o=sI(e.schema,"Drill",C,I,n?h:void 0,void 0),s=n&&$(le)?function(e,t){let n=e.filter(e=>yt(e.key,t));return 0===n.length?e:n}(o,h):o;return 0===s.length?i("span",{children:"(no fields)",className:U9}):i("div",{children:s.map(e=>{let n=e.key,o=e.propSchema,s=P(Xe(t,n),e=>"JSONNull"!==ut(e)),a=B9(o,n),d=K9(n,o);if(void 0===s)return oe(n,a,U(function(e,t){return yD(e,t,null)}(n,o),i("span",{children:"—",className:U9})));if("object"!=typeof d){if("Bool"===d)return oe(n,a,W9(s,void 0,n))}else switch(d.TAG){case"Scalar":let e=yD(n,o,s);return oe(n,a,void 0!==e?e:W9(s,d._1,n));case"EntityRef":let f=d._0;return oe(n,se(f,!1,a),hI(0,f,s,C,0,re,I,void 0,void 0));case"EntityRefArray":let h=d._0;return oe(n,se(h,!0,a),hI(0,h,s,C,0,re,I,void 0,void 0));case"NestedObject":let p=yD(n,o,s);if(void 0!==p)return oe(n,a,p);let g=sI(d._0,"Drill",C,I,void 0,void 0),m=U(j(Xe(t,n),ht),{});return r("div",{children:[i("div",{children:a,className:O9}),i("div",{children:g.map(e=>{let t=Xe(m,e.key);return r("div",{children:[i("div",{children:dI(e,C,I),className:D9}),i("div",{children:mI(e.key,e.kind,e.propSchema,t,void 0,C,A,re,I),className:I9})],className:R9},e.key)}),className:P9})],className:F9},n);case"ArrayOfObjects":let v=d._0,_=Q9(J9(s)),b=_.length,x=U(c,y),S=x+"."+n,w=j(l,e=>bF(e,S)),E=zF(v,w,{registry:C,ownEntity:I}),k=oF(u,x,n),N=Xe(H,n),T=jF(void 0!==N?N:sF(k),w,Bs(v),void 0,E),R=e=>{aF(k,e,X),W(t=>{let r=Ze(Qe(t));return r[n]={mode:e,band:X},r})},D=U(pt(s),[]),F=e=>{let t=Ua(v,j(l,e=>xF(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=sI(v,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:e.label,render:t=>mI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width})),P=0===b?i("span",{children:"(empty)",className:U9}):i("div",{children:i(Mo,{columns:O,data:_,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([n,e.key])),density:"Comfortable"}),className:j9}),M=void 0!==T&&T.id!==XI?F(T):P;return r("div",{children:[r("div",{children:[i("span",{children:a,className:z9}),r("span",{children:[E.length>1?i(hF.make,{modes:E,activeId:L(T,XI,e=>e.id),onSelect:R}):null,i(ps,{count:b,label:"items",onClick:()=>Y(Q.concat([n]))})],style:{display:"inline-flex",alignItems:"center",gap:"8px"}})],className:L9}),M],className:M9},n);case"TaggedUnion":let z=yD(n,o,s);if(void 0!==z)return oe(n,a,z);let B=ma(s);if(void 0===B)return oe(n,a,W9(s,void 0,n));let $=B[1],q=B[0],G=Pt(d._0,q),V=L(G,q,e=>e.tag),K=L(G,[],e=>sI(Mt(e),"Drill",C,I,void 0,void 0)),J=r("span",{children:[a,lI(V)],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}});return 0!==K.length?r("div",{children:[i("div",{children:J,className:O9}),i("div",{children:K.map(e=>r("div",{children:[i("div",{children:dI(e,C,I),className:D9}),i("div",{children:mI(e.key,e.kind,e.propSchema,Xe($,e.key),void 0,C,A,re,I),className:I9})],className:R9},e.key)),className:P9})],className:F9},n):oe(n,a,lI(V))}return oe(n,a,i(Zo,{items:H9(s)}))}),className:T9});case"JSONArray":let a=Q9(J9(e.data)),d=U(j(ht(e.schema),e=>Xe(e,"items")),e.schema),f=sI(d,"Drill",C,I,void 0,void 0).map(e=>({key:e.key,label:dI(e,C,I),render:t=>mI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,C,A,re,I),sortable:!1,width:e.width}));return 0===a.length?i("span",{children:"(empty)",className:U9}):i("div",{children:i(Mo,{columns:f,data:a,keyFn:e=>e.key,onRowClick:e=>Y(Q.concat([e.key])),density:"Comfortable"}),className:j9})}return i("div",{children:W9(e.data,void 0,void 0),className:I9})},de=U(le,U(p,y)),fe=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return Qa(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(G0,{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?iH(x.filter(e=>"Instance"===e.level),ee,g):[];if(me&&void 0!==g){let e=qs(_,g),t=g3(g,x,j(j(l,e=>j(c,t=>bF(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"])}(qs(e,t),n).map(e=>{let t=e[0];return{key:t,label:lt(t),state:e[1]}})}(_,g,U(rH(ee,g),""));ge=0!==e.length?i(hZ,{steps:e}):void 0}}else ge=void 0;let ye=me?U(j(Gs(_,j(j(l,e=>j(c,t=>bF(e,t))),e=>e.retiredLabel)),e=>Vs(e,Xe(ee,e.field))),null):null,_e=me&&void 0!==p?S.map(e=>{let t=T2(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(m1,{crumbs:pe,title:t,titleAccessory:r("div",{children:[ye,me&&void 0!==o&&void 0!==p?o(p):null],className:N9}),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:[GG(D?T:void 0,be),U(ge,null),me?i(ta,{fill:e=>{if(void 0!==p)return z(P(k5(_,e,x),e=>C5(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(sW,{isOpen:!0,onClose:()=>V(e=>{}),title:t.label,children:i(r5,{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,p4(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 S1(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:A9})};function Z9(e){return"var("+e+")"}let e7=co([gi("flex"),mi("column"),ui("gap",Z9(bt.md))]),t7=co([gi("flex"),di("center"),ui("gap",Z9(bt.md)),ui("flex-wrap","wrap"),ui("padding-bottom",Z9(bt.sm)),ui("border-bottom","1px solid var("+_t.border+")")]),n7=co([ui("font-size",Z9(xt.sizeLg)),ui("font-weight",Z9(xt.weightMedium)),ui("color",Z9(_t.textPrimary)),ki(to(0))]),r7=co([gi("flex"),di("center"),_i("wrap"),ui("gap",Z9(bt.sm)),ui("margin-left","auto")]);let i7=function(e){let t=e.contextId,n=e.slice,o=AI(),a=y1(),l=Ka(),c=s(()=>{}),u=c[1];return r("div",{children:[r("div",{children:[i("h2",{children:n.name,className:n7}),i("div",{children:n.commands.map(e=>i("button",{children:e.label,className:g1,onClick:t=>u(t=>e)},e.name)),className:r7})],className:t7}),L(c[0],null,e=>i(sW,{isOpen:!0,onClose:()=>u(e=>{}),title:e.label,children:i(r5,{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,p4(e.schema,t)).then(t=>{if("object"==typeof t){if("Rejected"===t.TAG){let e=t._0;return S1(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:e7})};let o7=function(e){let t=e.uiHints,n=e.hostViewName,a=e.entityId,l=e.binding,c=Ka(),u=Ge(),d=ae(),f=gG(),h=L(e.requiredAccess,!1,e=>!f(e)),p=G3(l.readModel,function(e,t){let n={};return M(UK(Ze([[e.refField,t]]),"",{search:!1},[]),e=>{n.filter=e}),n}(l,a),a,!h,void 0,25),g=p.rows.map(e=>U(ht(e),{})),m=function(e,t){let n=ht(e);if(void 0===n)return e;let r=Ze(Qe(n)),i=j(Xe(r,"properties"),ht);if(void 0===i)return e;let o=Ze(Qe(i).filter(e=>e[0]!==t));r.properties=o;let s=j(Xe(r,"required"),pt);return void 0!==s&&(r.required=s.filter(e=>yt(dt(e),t))),r}(l.readModel.schema,l.refField),v=Ha(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=Ua(m,j(t,e=>xF(e,_)),{field:l.readModel.labelField,source:l.readModel.labelFieldSource}),x=sI(m,"List",c,y,b.labelField,b.projectedLabelField),S=j(t,e=>bF(e,_)),w=zF(l.readModel.schema,S,{registry:c,ownEntity:y}),E=oF(e.pluginId,n,l.readModel.name),k=s(()=>sF(E)),C=k[1],A=Lq(),N=jF(k[0],S,Bs(l.readModel.schema),void 0,w),T=HI(g,x,c,y,void 0),R={lookupLabel:(e,t)=>MI(T,e,c,t),isMissing:(e,t)=>jI(T,e,c,t),retiredBadge:(e,t)=>LI(T,e,c,t),linkable:(e,t)=>zI(T,e,c,t,!1)},D=_I(x,c,u,Xe,void 0,R,y,void 0,void 0,void 0),I=e=>j(Xe(e,"id"),dt),F=e=>U(I(e),JSON.stringify(e)),O=e=>M(v,t=>d(Qa(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(U1,{});else{let e,t=0;void 0!==N&&N.id!==XI?e=(e=>{let t=l.readModel.name,n=p.rows,r=j(S,e=>e.accent),i=Lo(p.canLoadMore),o={readModelName:t,rows:n,schema:m,semantics:b,accent:r,window:i,onOpenRow:(e,t)=>{let n=j(ht(t),I);return O(void 0!==n?n:e)},ownEntity:y,refLabels:R};return e.render([o])})(N):t=1,1===t&&(e=i(Mo,{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(G0,{title:"Could not load related rows",detail:$._0,onRetry:p.refetch}):i(G0,{title:"Not available",detail:$._0});return r("section",{children:[r("div",{children:[i("h3",{children:lt(l.readModel.name)}),w.length>1?i(hF.make,{modes:w,activeId:L(N,XI,e=>e.id),onSelect:e=>{aF(E,e,A),C(t=>({mode:e,band:A}))}}):null],style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}}),B]})},s7={contents:void 0};function a7(e){s7.contents=e}function l7(e){return e.filter(e=>"Instance"===e.level)}function c7(e,t,n,r,i){let o=void 0!==r?r:[],s=l7(n),a=l7(o),l=qs(e,t),c=m3(e,t,n,i),u=function(e,t,n){let r=u3(n),i=qs(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[a3(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?v3(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:lt(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 u7(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(l7(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)&&yt(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 d7(e){return"var("+e+")"}let f7=co([gi("flex"),mi("column"),ui("gap",d7(bt.md))]),h7=co([ui("font-size",d7(xt.sizeLg)),ui("font-weight",d7(xt.weightMedium)),ui("color",d7(_t.textPrimary)),ki(to(0))]),p7=co([ui("font-size",d7(xt.sizeXs)),ui("color",d7(_t.textDisabled))]),g7=co([gi("flex"),ui("flex-wrap","wrap"),di("flexStart"),ui("gap",d7(bt.md))]);let m7=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",d7(bt.sm))]),v7=co([ui("font-size",d7(xt.sizeXs)),ui("color",d7(_t.textDisabled)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),y7=co([gi("flex"),mi("column"),ui("gap","6px")]),_7=co([gi("flex"),di("center"),ui("flex-wrap","wrap"),ui("gap","4px")]),b7=co([ui("color",d7(_t.textSecondary)),ui("font-size",d7(xt.sizeSm))]),x7=co([ui("font-size",d7(xt.sizeXs)),ui("color",d7(_t.textDisabled))]),S7=co([gi("flex"),mi("column"),ui("gap",d7(bt.sm)),ui("padding-top",d7(bt.sm))]),w7=co([ui("font-size",d7(xt.sizeXs)),ui("font-weight",d7(xt.weightMedium)),ui("color",d7(_t.textSecondary)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),E7=co([gi("flex"),ui("flex-wrap","wrap"),ui("gap","6px")]);function k7(e,t){let n=t.toState;return r("div",{children:[t.system?i(NQ.make,{label:t.label}):i(AQ.make,{label:t.label}),void 0!==n?r(o,{children:[i("span",{children:"→",className:b7}),i(CQ.make,{swatch:yQ(e,n),label:lt(n),dot:!1})]}):null],className:_7},t.commandName)}let C7=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=c7(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(s7.contents,n=>n(e,t))}(u7(d,c),U(s,lt(l))),r("div",{children:[void 0!==s?i("h3",{children:s,className:h7}):null,i("div",{children:"Lifecycle on “"+lt(l)+"”",className:p7}),void 0!==t?t:r(o,{children:[i("div",{children:d.states.map(e=>{let t=yQ(f,e.value);return r("div",{children:[r("div",{children:[i(CQ.make,{swatch:t,label:e.label}),e.terminal?i("span",{children:"end",className:v7}):null],className:m7}),e.terminal?i("span",{children:"No commands available",className:x7}):i("div",{children:e.outgoing.map(e=>k7(f,e)),className:y7})],className:(n=t,co([gi("flex"),mi("column"),ui("gap",d7(bt.sm)),ui("flex","0 1 240px"),ui("padding",d7(bt.md)),ui("background",d7(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-left","3px solid "+n.border),ui("border-radius",d7(St.md))]))},e.value);var n}),className:g7}),0!==d.anyState.length?r("div",{children:[i("span",{children:"Any state",className:w7}),i("div",{children:d.anyState.map(e=>k7(f,e)),className:E7})],className:S7}):null]})],className:f7})};function A7(e){return"var("+e+")"}let N7=co([gi("flex"),mi("column"),ui("gap",A7(bt.xl))]),T7=co([ui("font-size",A7(xt.sizeXl)),ui("font-weight",A7(xt.weightMedium)),ui("color",A7(_t.textPrimary)),ki(to(0))]),R7=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",A7(bt.md))]),D7=co([gi("flex"),mi("column"),ui("gap",A7(bt.md)),ui("padding",A7(bt.lg)),ui("background",A7(_t.surfaceSubtle)),ui("border","1px solid var("+_t.borderSubtle+")"),ui("border-radius",A7(St.md))]);function I7(e){return e.filter(e=>function(e,t,n,r){let i=void 0!==r?r:[];return void 0!==t&&0!==qs(e,t).length&&l7(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 F7="lifecycle",O7="diagram";let P7=function(e){let t=e.uiHints,n=s5(),o=I7(e.views),s=vt(n.get(F7),O7)?"Diagram":"Lane",a=(e,t,r)=>i("button",{children:e,"aria-pressed":r?"true":"false",className:r?hF.Style.btnActive:hF.Style.btn,onClick:e=>n.set(F7,t)},t),l=$(s7.contents)?r("div",{children:[a("Lane","","Lane"===s),a("Diagram",O7,"Diagram"===s)],"aria-label":"Lifecycle rendering",className:hF.Style.group,role:"group"}):null;return r("div",{children:[r("div",{children:[i("h2",{children:"Lifecycles",className:T7}),l],className:R7}),0!==o.length?o.map(e=>i("div",{children:i(C7,{schema:e.schema,lifecycleField:U(e.lifecycleField,""),commands:e.commands,systemCommands:U(e.systemCommands,[]),title:e.name,transitions:j(j(t,t=>bF(t,e.name)),e=>e.transitions),display:s}),className:D7},e.name)):i(_o,{title:"No lifecycles",description:"No view in this plugin declares a lifecycle enum with state-scoped commands."})],className:N7})};function M7(e){return"var("+e+")"}let L7=co([gi("flex"),mi("column"),ui("gap",M7(bt.md)),ui("font-family",M7(xt.fontFamily))]),z7=co([gi("flex"),di("center"),ui("gap",M7(bt.sm)),ui("color",M7(_t.textSecondary)),ui("font-size",M7(xt.sizeSm)),ui("font-weight",M7(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),j7=co([gi("inlineFlex"),di("center"),ui("padding","0 6px"),ui("border-radius",M7(St.full)),ui("background",M7(_t.surfaceElevated)),ui("color",M7(_t.textPrimary)),ui("font-size",M7(xt.sizeXs)),ui("letter-spacing","0")]),U7=co([gi("flex"),mi("column"),ui("gap",M7(bt.md))]),B7=co([gi("flex"),di("flexStart"),ui("gap",M7(bt.sm))]),$7=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0"),vi(1)]),q7=co([gi("flex"),di("baseline"),ui("gap",M7(bt.sm))]),G7=co([ui("color",M7(_t.textPrimary)),ui("font-size",M7(xt.sizeSm)),ui("font-weight",M7(xt.weightMedium))]),V7=co([ui("color",M7(_t.textDisabled)),ui("font-size",M7(xt.sizeXs))]),K7=co([ui("color",M7(_t.textPrimary)),ui("font-size",M7(xt.sizeSm)),ui("line-height",M7(xt.lineHeightNormal)),ui("white-space","pre-wrap"),ui("word-break","break-word")]),W7=co([ui("color",M7(_t.textDisabled)),ui("font-size",M7(xt.sizeSm)),ui("padding","var("+bt.sm+") 0")]),H7=co([gi("flex"),mi("column"),di("flexEnd"),ui("gap",M7(bt.sm))]),J7=co([ui("width","100%"),ui("min-height","64px"),ui("padding",M7(bt.sm)),ui("background",M7(_t.surface)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",M7(St.md)),ui("color",M7(_t.textPrimary)),ui("font-family",M7(xt.fontFamily)),ui("font-size",M7(xt.sizeSm)),ui("resize","vertical")]),X7=co([ui("background",M7(_t.brand)),ui("border","none"),ui("border-radius",M7(St.md)),ui("color",M7(_t.textOnBrand)),ui("padding","4px var("+bt.md+")"),ui("font-size",M7(xt.sizeSm)),ui("font-weight",M7(xt.weightMedium)),pi("pointer"),Ji([ui("opacity","0.5"),pi("default")])]),Q7=co([ui("color",M7(_t.error)),ui("font-size",M7(xt.sizeXs)),ui("align-self","flex-start")]);function Y7(e){let t=e.comment,n=t.timestamp;return r("div",{children:[i(Ho,{name:U(t.author,"?"),src:t.authorImageUrl,size:"Medium"}),r("div",{children:[r("div",{children:[i("span",{children:U(t.author,"Unknown"),className:G7}),void 0!==n?i("span",{children:zY(e.nowMs,n),className:V7}):null],className:q7}),i("span",{children:t.body,className:K7})],className:$7})],className:B7})}let Z7=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:j7})],className:z7}),0===u.length?i("div",{children:f,className:W7}):i("div",{children:u.map(e=>i(Y7,{comment:e,nowMs:p},e.id)),className:U7}),void 0!==a?r("div",{children:[i("textarea",{className:J7,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:X7,disabled:!_,onClick:e=>b()})],className:H7}):null],className:L7})};let eee=function(e){let t=e.entityId,n=e.binding,r=AI(),o=y1(),a=Ka(),l=gG(),c=L(e.requiredAccess,!1,e=>!l(e)),u=V3(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(ht(t),{});if(vt(FK(r,e.entityField),n))return r}),i=t=>j(j(e.timestampField,e=>FK(t,e)),pc);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(FK(t,"id"),"#"+n.toString()),body:U(FK(t,e.bodyField),""),author:j(e.authorField,e=>FK(t,e)),timestamp:j(e.timestampField,e=>FK(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=>EK(e.schema,bK)),e.bodyField);return Ze([[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 S1(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(Z7,{comments:g,onPost:v,posting:d[0],error:h[0]})};function tee(e){return"var("+e+")"}let nee=co([gi("flex"),mi("column"),ui("gap",tee(bt.lg))]),ree=co([gi("flex"),di("center"),xi("spaceBetween"),ui("gap",tee(bt.md))]),iee=co([ui("font-size",tee(xt.sizeXl)),ui("font-weight",tee(xt.weightMedium)),ui("color",tee(_t.textPrimary)),ki(to(0))]),oee=co([gi("flex"),_i("wrap"),di("center"),ui("gap",tee(bt.md)),ui("font-size",tee(xt.sizeSm)),ui("color",tee(_t.textSecondary))]),see=co([gi("inlineFlex"),di("center"),ui("gap","4px"),pi("pointer")]);let aee=co([ui("font-size",tee(xt.sizeXs)),ui("color",tee(_t.textDisabled))]),lee=co([gi("flex"),di("center"),ui("gap",tee(bt.sm))]),cee=co([ui("background","none"),ui("border","1px solid var("+_t.border+")"),ui("border-radius",tee(St.sm)),ui("padding","2px var("+bt.sm+")"),ui("color",tee(_t.textSecondary)),ui("font-size",tee(xt.sizeSm)),pi("pointer"),Yi([ui("background",tee(_t.surfaceSubtle)),ui("color",tee(_t.textPrimary))])]);let uee=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=gG(),h=AI(),p=NI(),g=Ka(),m=P0(),v=s(()=>[]),y=v[1],_=v[0],b=e=>Ua(e.schema,j(o,t=>xF(t,e.name)),{field:e.labelField,source:e.labelFieldSource}),x=V3(l,!0),S={readModelName:l.name,rows:x.rows,schema:l.schema,semantics:b(l),window:Lo(x.canLoadMore),onOpenRow:(e,t)=>d(Qa(c,l.name,e,[])),role:y3,ownEntity:{pluginId:c,viewName:l.name}},w=a.map((e,t)=>{let n=yK(u,e.readModel.name,f),r=n&&!_.includes(e.readModel.name);return[e,t,r,n,V3(e.readModel,r)]}),E=(e,t)=>U(j(j(o,t=>bF(t,e.name)),e=>e.accent),t0[fe(t,t0.length)]),k=me(w,e=>{let t=e[4],n=e[0],r=A3(n.readModel.commands,n.resourceRef),i=E1(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:Lo(t.canLoadMore),onOpenRow:(e,t)=>d(Qa(c,n.readModel.name,e,[])),onCommand:z(r,e=>i),role:_3,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(_K(u,a.map(e=>e.readModel.name),f)));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:iee}),className:ree}),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]),co([gi("inlineBlock"),ui("width","8px"),ui("height","8px"),ui("border-radius","50%"),ui("background",n)]))}),t.readModel.name],className:see},t.readModel.name);var n}),className:oee}),m.element,e.mode.render(C),0!==A.length?r("div",{children:[i("button",{children:"Load more",className:cee,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:aee})],className:lee}):null,0!==R.length?i("span",{children:R.join(" · "),className:aee}):null],className:nee})};function dee(e){return e}function fee(e,t){let n=void 0!==t?t:[];return e.map(e=>({name:e.name,schema:e.schema,commands:e.commands,rowActionCandidates:n9(n,e.name),declaredLabelField:e.labelField,declaredLabelSource:e.labelFieldSource}))}function hee(e){if("object"==typeof e)return"heuristic:"+e._0;switch(e){case"Annotation":return"annotation";case"Type":return"type";case"Hint":return"hint"}}function pee(e,t,n){return void 0!==t?Object.entries(m3(e.schema,t,e.commands,j(n,e=>e.transitions))):[]}function gee(e){let t=[["command",E2(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(J8)]]:[];return Ze(t.concat(n).concat(i))}function mee(e){let t=t=>e.filter(t).map(gee);return Ze([["attached",t(Q8)],["vetoed",t(Y8)],["deferred",t(Z8)]])}function vee(e){return z(e.declaredLabelField,t=>({field:t,source:e.declaredLabelSource}))}function yee(e,t){return L(P(e.declaredLabelSource,n=>vt(e.declaredLabelField,t)),t,e=>t+" ("+e+")")}function _ee(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(Xe(e.semantics,n),n,e=>n+" ("+hee(e.provenance)+")")}function bee(e,t){switch(t.TAG){case"Paired":return t.latField+"/"+t.lngField;case"Pointed":let n=t._0;return L(Xe(e.semantics,n),n,e=>n+" ("+hee(e.provenance)+")");case"Geolocated":let r=t._0;return L(Xe(e.semantics,r),r+" (point on Located)",e=>r+" ("+hee(e.provenance)+", point on Located)")}}function xee(e,t,n,r){return Ze([["plugin",e],["hintErrors",(void 0!==r?r:[]).map(dee)],["views",t.map(e=>function(e,t,n){let r=e.name,i=e.schema,o=Ua(i,t,vee(e)),s=Qe(o.semantics).map(e=>{let t=e[1];return Ze([["field",e[0]],["semantic",ra(t.semantic)],["provenance",hee(t.provenance)]])}),a=[];M(o.geo,e=>{a.push(["geo",bee(o,e)])}),M(o.dateSpan,e=>{a.push(["dateSpan",_ee(o,e)])}),M(o.statusField,e=>{a.push(["status",e])}),M(o.labelField,t=>{a.push(["label",yee(e,t)])}),M(o.imageField,e=>{a.push(["image",e])}),M(o.parentField,e=>{a.push(["parent",e])});let l=tF(i,void 0).map(e=>e.id),c=pee(e,o.statusField,n).map(e=>{let t=e[1];return[e[0],t.command+" ("+s3(t.tier)+")"]});return Ze([["view",r],["capableModes",l],["roles",Ze(a)],["transitions",Ze(c)],["rowActions",mee(U(e.rowActionCandidates,[]))],["fields",s]])}(e,j(n,t=>xF(t,e.name)),j(n,t=>bF(t,e.name))))]])}function See(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=Ua(r,j(t,e=>xF(e,n)),vee(e)),o=tF(r,void 0).map(e=>e.id).join(", "),s=[];M(i.geo,e=>{s.push("geo="+bee(i,e))}),M(i.dateSpan,e=>{s.push("dateSpan="+_ee(i,e))}),M(i.statusField,e=>{s.push("status="+e)}),M(i.labelField,t=>{s.push("label="+yee(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=pee(e,i.statusField,j(t,e=>bF(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(Y8)+" vetoed, "+p(Z8)+" 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(X8).join("; "):"deferred — no tier admits it yet"),console.log(" "+e.name+" · "+E2(t.action)+"("+t.action.field+"): "+n)})}),console.log(JSON.stringify(xee(e,t,n,i),null,2))}function wee(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}function Eee(e){return Object.fromEntries([["kind",e.kind],["senderId",e.senderId],["sentAt",e.sentAt],["body",e.body]])}function kee(e,t,n,r,i){let o=void 0===r||r,s=bO(),l=j(s,e=>e.clientNamespace()),c=o&&$(l)&&L(s,!1,e=>e.clientChannelsAvailable()),u=void 0!==l?function(e,t,n){return"/"+wee(e)+"/"+wee(t)+"/"+wee(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=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=n("kind"),i=n("senderId");return void 0!==r&&void 0!==i?{kind:r,senderId:i,sentAt:U(j(t.sentAt,Je.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,[Eee(o)]).then(e=>{"Ok"!==e.TAG&&console.warn("[AutoClientChannel] publish to "+u+" failed: "+e._0)})}}}let Cee="heartbeat",Aee="hello",Nee="leave";function Tee(e){let t=Je.object(e);if(void 0===t)return;let n=e=>j(t[e],Je.string),r=n("userId");return void 0!==r&&""!==r?[r,U(n("username"),r)]:void 0}function Ree(e,t,n,r,i){let o=void 0===i||i,l=s(()=>[]),c=l[1],u=h(void 0),d=kee("presence",t,n,o&&""!==n,e=>{if(c(t=>function(e,t,n){let r=t.kind;if(r===Nee){let n=Tee(t.body);if(void 0===n)return e;let r=n[0];return e.filter(e=>e.userId!==r)}if(r!==Cee&&r!==Aee)return e;let i=Tee(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!==Aee)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(Cee,e);u.current=t,p(Aee,e),p(Cee,e);let i=setInterval(t,1e4);return()=>{clearInterval(i),u.current=void 0,p(Nee,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 Dee(e){return"var("+e+")"}let Iee=co([gi("inlineFlex"),di("center"),ui("gap",Dee(bt.xs))]),Fee=co([ui("font-family",Dee(xt.fontFamily)),ui("font-size",Dee(xt.sizeSm)),ui("color",Dee(_t.textSecondary)),ui("white-space","nowrap")]);function Oee(e){return 1===e?"1 other here":e.toString()+" others here"}let Pee=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(Ys,{members:u,size:a,max:l}),c?i("span",{children:Oee(s.length),className:Fee}):null],className:Iee,title:s.map(e=>e.username).join(", ")})};let Mee=function(e){let t=j(Dq(),e=>e.identity),n=L(t,"",e=>e.userId),r=L(t,"",e=>e.username),o=Ree(0,e.readModel+"-"+e.entityId,n,""===r?n:r,""!==n).map(e=>({userId:e.userId,username:e.username}));return i(Pee,{people:o})};function Lee(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}let zee={contents:[]},jee={contents:[]};function Uee(e,t,n){if("id"!==n)return;let r=e+"."+t;return zee.contents.some(e=>e===r)?void 0:(zee.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 Bee(e,t,n,r){if("id"===n||0!==r.length&&r.some(e=>e===n))return;let i=e+"."+t;return jee.contents.some(e=>e===i)?void 0:(jee.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 $ee(e){let t=[];return e.forEach(e=>{let n=(n,r,i,o,s)=>{Uee(e.id,n,i),Bee(e.id,n,i,o);let a=Gs(s,void 0),l=void 0!==a&&a.namedWhenRetired?a:void 0;t.push({pluginId:e.id,name:n,queryField:r,singleQueryField:tt(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 qee(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 Gee(e){return[tt(e),nt(e)]}function Vee(e,t){return e.find(e=>e.name===t)}function Kee(e,t){let n=Lee(t),r=Vee(e,nt(n));return void 0!==r?r:Vee(e,n)}function Wee(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt)}function Hee(e,t,n,r){return me(e.references,i=>{let o,s=i.fieldName.includes("[]"),a=c4(i.fieldName);if(void 0!==a){let e=a[1],t=j(j(Xe(r,a[0]),ht),u4),n=j(j(j(j(t,ht),e=>Xe(e,"properties")),ht),t=>Xe(t,e));o=void 0!==n?[n,!0,U(z(t,Wee),[]).some(t=>t===e)]:[void 0,!1,!1]}else o=s?[void 0,!1,!1]:[Xe(r,i.fieldName),!0,n.some(e=>e===i.fieldName)];let l=j(o[0],ht),c=j(j(l,e=>Xe(e,"type")),dt),u=vt(c,"array"),d=i.plugin,f=void 0!==d?t.filter(e=>e.pluginId===d):t,h=Vee(f,i.entity),p=void 0!==h?h:Kee(f,i.entity);if(o[1]){if(void 0!==p){let e=Gee(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 Jee(e,t,n,r,i,o){let s=[];return void 0!==i&&Qe(i).forEach(i=>{let a=i[0],l=ht(i[1]),c=$(j(l,e=>Xe(e,"const")));if(c)return;let u,d=j(j(l,e=>Xe(e,"type")),dt),f=j(j(j(j(l,e=>Xe(e,"items")),ht),e=>Xe(e,"type")),dt);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(vt(e.aggregateIdField,a))n=!0;else{let e=qee(a,!1);n=void 0!==e&&e.toLowerCase()===t.name.toLowerCase()}else n=vt(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=Vee(n,nt(t.name));p=void 0!==e?e:Vee(n,t.name)}if(void 0!==p)g=p;else{let e=qee(a,u);g=void 0!==e?Kee(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=Gee(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===qee(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 Xee(e,t,n,r){let i=Wee(e.schema),o=j(j(ht(e.schema),e=>Xe(e,"properties")),ht);return 0===e.references.length?Jee(e,t,n,i,o,r):Hee(e,n,i,U(o,{}))}function Qee(e,t){let n=(n,r)=>{let i={...n};return i.refFields=Xee(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 Yee={capitalize:Lee,singularize:tt,warnedIdLabel:zee,warnedUnsearchable:jee,warnIfIdLabel:Uee,warnIfUnsearchable:Bee,buildRegistry:$ee,stemFromKey:qee,entityDisplayNames:Gee,findByName:Vee,findByStem:Kee,requiredSet:Wee,resolveExplicitRefs:Hee,resolveByHeuristic:Jee,resolveForCommand:Xee,enrichPlugin:Qee};function Zee(e){let t=Je.object(e);if(void 0===t)return;if($(Ft(e)))return;let n=j(t.properties,Je.object);if(void 0!==n)return n;let r=j(j(j(t.items,Je.object),e=>e.properties),Je.object);return void 0!==r?r:ge(["anyOf","oneOf","allOf"],void 0,(e,n)=>void 0!==e?e:j(j(t[n],Je.array),e=>ge(e,void 0,(e,t)=>void 0!==e?e:Zee(t))))}function ete(e,t){let n=me(Object.entries(e),e=>L(Ds(e[1]),!1,e=>ks(e,"x-reventless-hidden"))?void 0:e[0]);return t&&!n.includes("id")?["id"].concat(n):n}let tte=new Map;function nte(e,t,n){let r=me(t.arms,e=>{let r=Ot(t,e);if(void 0===r)return;let i=n(e);return""===i?void 0:"... on "+r+" { "+i+" }"});return t.arms.some(e=>q(Ot(t,e)))&&function(e){if(q(tte.get(e)))tte.set(e,!0),console.error('AutoUI: the union field "'+e+'" carries neither '+Nt+" on the field nor "+Tt+" 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 rte(e,t,n){let r=void 0!==t?t:3;return ete(e,void 0===n||n).map(t=>{let n=j(e[t],Ft);if(void 0!==n)return nte(t,n,e=>r<=0?"":rte(e.properties,r-1|0,!1));if(r<=0)return t;let i=j(e[t],Zee);return void 0!==i?t+" { "+rte(i,r-1|0,!1)+" }":t}).join(" ")}function ite(e,t,n){return me(ete(e,!0),t=>{let n=e[t];if(void 0===n)return t;let r=Ft(n);if(void 0!==r)return nte(t,r,e=>rte(e.properties,1,!1));let i=Zee(n);if(void 0===i)return t;let o=function(e,t){return me(ete(e,t),t=>{let n=e[t];if(void 0===n)return t;let r=Ft(n);return void 0!==r?nte(t,r,e=>rte(e.properties,1,!1)):q(Zee(n))?t:void 0}).join(" ")}(i,!1);return""===o?void 0:t+" { "+o+" }"}).join(" ")}function ote(e){return U(j(j(Je.object(e),e=>e.properties),Je.object),{})}function ste(e,t,n,r,i,o){let s,a=void 0!==r&&r,l=void 0!==i&&i,c=void 0!==o&&o,u=ite(ote(t)),d=a||c,f=["$first: Int","$after: String","$last: Int","$before: String"],h=["first: $first","after: $after","last: $last","before: $before"],p=$(Ls(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 ate(e,t){let n=rte(ote(t),void 0,void 0),r=$(Ls(t))?[", $includeRetired: Boolean",", includeRetired: $includeRetired"]:["",""],i=r[1],o=r[0],s=js(t);return void 0!==s?"query($id: ID!, $subId: String!"+o+") { "+e+"(id: $id, "+s+": $subId"+i+") { "+n+" } }":"query($id: ID!"+o+") { "+e+"(id: $id"+i+") { "+n+" } }"}function lte(e,t,n){return"Operator"===e?t:U(n,[])}function cte(e,t){let n={},r=(e,t)=>{let r=Xe(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,lte(t,e.commands,e.systemCommands)))}),e.stateChangeSlices.forEach(e=>{let n=lte(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 ute(e,t,n,r,i){let o=void 0!==i?i:k2,s=e.readModels.map(e=>e.name).concat(e.stateViewSlices.map(e=>e.name)).map(t=>({pluginId:e.id,name:t,placed:U(Xe(r,t),[]).map(e=>e.name)}));return t9(s,t,0,n,o)}function dte(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=$ee(A),T=Qee(e,N),R=cte(T,"Operator"),D=cte(T,"System"),I=(e,t,n)=>{let r={...e};return r.refFields=Xee(e,t,N,n),r},F=ute(T,A,N,R,I),O=b.find(e=>e.id===T.id);if(void 0!==O){let e=$ee(b);v=ute(O,b,e,cte(O,"Operator"),void 0)}else v=F;let P={};v.filter(Q8).forEach(e=>{P[e.viewName]=U(Xe(P,e.viewName),[]).concat([E2(e.action)])});let B=L(p,[],e=>LF(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=>bF(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===E2(e)))}(function(e,t,n){let r=void 0!==n?n:k2;return me(U(j(e,e=>e.rowActions),[]),e=>C2(e,t,r))}(t,A,I),function(e,t){return n9(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===zs(l=e.schema).length&&q(js(l));var l;let c=a?e.queryField+"ByIds":void 0,u=a?function(e,t){let n=ite(ote(t)),r=$(Ls(t))?["$ids: [String!]!, $includeRetired: Boolean","ids: $ids, includeRetired: $includeRetired"]:["$ids: [String!]!","ids: $ids"];return"query("+r[0]+") { "+e+"ByIds("+r[1]+") { "+n+" } }"}(e.queryField,e.schema):void 0,d=function(e){let t=Object.keys(ote(e));return t.includes("updatedAt")?"updatedAt":t.includes("createdAt")?"createdAt":void 0}(e.schema),f=Us(e.schema),h=e.name,g=Ue(Ja(K,h)),m=Xe(E,h),v=n+h,y=QV(T.name,h,e.sortIndex,j(p,e=>bF(e,h)),C&&$(e.ownerField)),_={fragmentId:v,title:h,menuEntry:y,requiredAccess:m,url:g},b=H(h),x=K+"."+h;return G.push(Be(Xa(K,h),n=>{let a=function(e){let t=je.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(gK,{definition:_,children:(l=a[0],h=a[1],i(G5,{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)]=Ue(r)}(V,K,h,Ja(K,h)),_},X=T.readModels.filter(e=>!x.includes(e.name)).map(e=>{let t=U(Xe(R,e.name),e.commands),n=U(Xe(D,e.name),U(e.systemCommands,[])),r=tt(e.queryField),i=LK(e.schema);if(""===e.queryDocument){let o={...e};return o.systemCommands=n,o.commands=t,o.queryDocument=ste(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(Xe(R,e.name),[]),n=U(Xe(D,e.name),[]),r=tt(e.queryField),i=LK(e.schema),o=ste(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 eF().filter(e=>{let t=e.arity;return"object"==typeof t&&"Multi"!==t.TAG}).forEach(n=>{let o={},s={},a=(e,t,n)=>{let r=Xe(e,t);void 0!==r?r.push(n):e[t]=[n]};e.forEach(e=>{let r=j(t,t=>bF(t,e.name)),i=U(j(r,e=>e.canvas),n.label),l=j(r,e=>e.role);if(void 0!==l)return l===y3?a(o,i,e):l===_3?M(j(r,e=>e.resourceRef),t=>a(s,i,[e,t])):void 0}),Qe(s).forEach(e=>{let t=e[0],n=U(Xe(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,_F),n=(r=bF(t,e.name),s=e.schema,o=L(j(ht(s),e=>Xe(e,"x-reventless-audit")),!1,e=>{let t=ut(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)eK(e.name);else{if(void 0!==r){let e=function(e,t){return e+"_"+t+"EventHistory"}(r,n);return{queryField:e,queryDocument:YV(e),displayName:n}}eK(e.name)}}(e,n),t=>{let n=Xe(E,e.name);return e=>i(g9,{binding:t,entityId:e,requiredAccess:n})})},te=e=>{let t=U(p,_F);if(U(j(bF(t,e.name),e=>e.presence),!1))return t=>i(Mee,{readModel:e.name,entityId:t})},ne={...T};ne.readModels=X.concat(Q);let re=e=>{let t=U(p,_F);return(n=$K(ne,e.name),s=bF(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=Xe(E,t.readModel.name);return r=>i(o7,{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(IK(Z,n),e=>{let t=Xe(E,e.readModel.name);return n=>i(eee,{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=tt(e.queryField),n=ate(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(Y9,{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,Xe(Y,e.name))}),se=Q.map(e=>{let t=tt(e.queryField),n=ate(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(Y9,{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,Xe(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(i7,{slice:e,contextId:t.contextId}),requiredAccess:Xe(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));$(iF("autoui.inferenceReport"))&&See(T.id,fee(le,F),p,B),M(m,e=>e(xee(T.id,fee(le,F),p,B)));let ce,fe=le.map(e=>[e,Ua(e.schema,void 0,void 0)]),he=me(eF(),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=>bF(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=Xe(r,a);void 0!==l?l.push(t):r[a]=[t]}),me(Qe(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=vK(E,t.map(e=>e.name)),l=Ue(Ja(K,r)),c={fragmentId:o,title:r,menuEntry:s,requiredAccess:a,url:l};return G.push(Be(Xa(K,r),e=>i(gK,{definition:c,children:i(k9,{pluginId:K,mode:n,canvasName:r,readModels:t,uiHints:p,viewAccess:E})}))),c}):[],ve=W("scheduler")?me(eF(),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=Xe(e,t);void 0!==r?r.push(n):e[t]=[n]};le.forEach(e=>{let t=j(p,t=>bF(t,e.name)),i=U(j(t,e=>e.canvas),n.label),a=j(t,e=>e.role);if(void 0!==a)return a===y3?s(r,i,e):a===_3?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(y3,1),c=a(_3,1);return me(Qe(r),e=>{let t=e[1],r=e[0],s=U(Xe(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=mK(E,a.name),g=Ue(Ja(K,r)),m={fragmentId:d,title:r,menuEntry:f,requiredAccess:h,url:g};return G.push(Be(Xa(K,r),e=>i(gK,{definition:m,children:i(uee,{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(ht(t),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{let t=e[0];return j(j(j(ht(e[1]),e=>Xe(e,"x-reventless-metric")),ht),e=>{let n=j(Xe(e,"aggregate"),dt),r=j(Xe(e,"label"),dt);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=Ua(e,t,void 0).semantics;return me(xa(e),e=>{let t=e[0];return j(Xe(n,t),e=>{if(la(e.semantic).includes("Measure"))return t})})}(e.schema,j(p,t=>xF(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=vK(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:Ue(Ja(K,e))};G.push(Be(Xa(K,e),e=>i(gK,{definition:s,children:i(H8,{pluginId:K,metrics:ke,readModels:t,uiHints:p,viewAccess:E})}))),ce=[s]}else ce=[];let Ce,Ae=I7(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:Ue(Ja(K,e))};G.push(Be(Xa(K,e),e=>i(P7,{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 fte(e){return XO(HO(e))}function hte(e){return HO(e).errors.some(e=>!!vt(e.code,"FORBIDDEN")||vt(e.errorType,"Unauthorized"))}let pte=new Map;async function gte(t,n,r){!function(t,n){let r=pte.get(t);if(void 0===r||r!==n)e.registerRemotes([{name:t,entry:n,type:"module"}]),pte.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 mte=l(null),vte={didCatch:!1,error:null};class yte extends x{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=vte}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(vte)}}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(vte))}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(mte.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function _te(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 bte(e,t){console.error("Fragment crashed:",e)}let xte=function(e){let t=e.fallbackComponent;return c(yte,{FallbackComponent:void 0!==t?t:_te,onError:bte,children:e.children})};let Ste=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 gte(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(xte,{children:c(u._0,e.panelProps)}):i("div",{children:"Panel error: "+u._0,style:{color:"#a00",padding:"0.75rem"}})};function wte(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function Ete(e){return"object"===wte(e)}function kte(e,t){return e.length<124?e:t}var Cte,Ate;function Nte(e){if(!Ete(e))throw new Error(`Message is expected to be an object, but got ${wte(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 ${wte(e.type)}`);switch(e.type){case Ate.ConnectionInit:case Ate.ConnectionAck:case Ate.Ping:case Ate.Pong:if(null!=e.payload&&!Ete(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 Ate.Subscribe:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${wte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Ete(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${wte(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 ${wte(e.payload.query)}`);if(null!=e.payload.variables&&!Ete(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 ${wte(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==wte(e.payload.operationName))throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${wte(e.payload.operationName)}`);if(null!=e.payload.extensions&&!Ete(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 ${wte(e.payload.extensions)}`);break;case Ate.Next:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${wte(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Ete(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${wte(e.payload)}`);break;case Ate.Error:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${wte(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 Ate.Complete:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${wte(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 Tte(e,t){return Nte(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"}(Cte||(Cte={})),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"}(Ate||(Ate={}));var Rte=function(e){return this instanceof Rte?(this.v=e,this):new Rte(e)},Dte=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 Rte?Promise.resolve(e.value.v).then(l,c):u(o[0][2],e)}(i[e](t))}catch(_U){u(o[0][3],_U)}}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 Ite(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=Ote,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(Tte({type:Ate.Ping})),x.emit("ping",!1,void 0))},s))}S(e=>{w=void 0,clearTimeout(o),clearTimeout(c),r(e),e instanceof Fte&&(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(Tte(e?{type:Ate.ConnectionInit,payload:e}:{type:Ate.ConnectionInit},m)),isFinite(l)&&l>0&&(o=setTimeout(()=>{i.close(Cte.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),d()}catch(e){x.emit("error",e),i.close(Cte.InternalClientError,kte(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 Nte("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(Tte(n.payload?{type:Ate.Pong,payload:n.payload}:{type:Ate.Pong})),x.emit("pong",!1,n.payload)));if(f)return;if(n.type!==Ate.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(Cte.BadResponse,kte(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(Ote(e)&&(function(e){return![1e3,1001,1006,1005,1012,1013,1014].includes(e)&&(e>=1e3&&e<=1999)}(e.code)||[Cte.InternalServerError,Cte.InternalClientError,Cte.BadRequest,Cte.BadResponse,Cte.Unauthorized,Cte.SubprotocolNotAcceptable,Cte.SubscriberAlreadyExists,Cte.TooManyInitialisationRequests].includes(e.code)))throw e;if(N)return!1;if(Ote(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 Ate.Next:return void t.next(e.payload);case Ate.Error:return i=!0,r=!0,t.error(e.payload),void o();case Ate.Complete:return r=!0,void o()}});return s.send(Tte({id:n,type:Ate.Subscribe,payload:e},m)),o=()=>{r||s.readyState!==b.OPEN||s.send(Tte({id:n,type:Ate.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 Dte(this,arguments,function*(){for(;;){for(t.length||(yield Rte(new Promise(e=>n.resolve=e)));t.length;)yield yield Rte(t.shift());if(n.error)throw n.error;if(n.done)return yield Rte(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 Fte)}}}class Fte extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function Ote(e){return Ete(e)&&"code"in e&&"reason"in e}function Pte(e,t){return j(e[t],Je.string)}function Mte(e,t){return U(Pte(e,t),"")}function Lte(e,t){return z(j(e[t],Je.float),e=>0|e)}function zte(e,t){return me(U(j(e[t],Je.array),[]),Je.string)}function jte(e){let t=Je.object(e);return void 0!==t?{label:Mte(t,"label"),icon:Pte(t,"icon"),group:Pte(t,"group"),sortOrder:U(Lte(t,"sortOrder"),0)}:{label:"",icon:void 0,group:void 0,sortOrder:0}}function Ute(e){return z(Je.object(e),e=>({fragmentId:Mte(e,"fragmentId"),title:Mte(e,"title"),description:Mte(e,"description"),positions:zte(e,"positions"),requiredAccess:Pte(e,"requiredAccess")}))}function Bte(e){return z(Je.object(e),e=>({fragmentId:Mte(e,"fragmentId"),title:Mte(e,"title"),menuEntry:U(z(e.menuEntry,jte),{label:Mte(e,"title"),icon:void 0,group:void 0,sortOrder:0}),requiredAccess:Pte(e,"requiredAccess")}))}function $te(e){return z(Je.object(e),e=>({pluginId:Mte(e,"pluginId"),remoteEntryUrl:Mte(e,"remoteEntryUrl"),panels:me(U(j(e.panels,Je.array),[]),Ute),pages:me(U(j(e.pages,Je.array),[]),Bte),registeredAt:Mte(e,"registeredAt"),updatedAt:Mte(e,"updatedAt")}))}let qte=["message","body","text","title","content"],Gte=["userId","recipientId","recipient","user","targetUserId"],Vte=["createdAt","sentAt","notifiedAt","at","timestamp"],Kte=["read","isRead","seen","acknowledged"];function Wte(e,t){return t.some(t=>t.toLowerCase()===e.toLowerCase())}function Hte(e){return me(xa(e),e=>{if(Ea(e[1]))return e[0]})}function Jte(e,t){return Hte(e).find(e=>Wte(e,t))}function Xte(e){return me(xa(e),e=>{if(vt(Sa(e[1],"type"),"boolean"))return e[0]}).find(e=>Wte(e,Kte))}function Qte(e,t){return me(Hte(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 Yte=["markread","marknotificationread","readnotification","acknowledge","dismiss","markseen"];function Zte(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=>Yte.some(t=>e.name.toLowerCase().startsWith(t)))}let ene={contents:[]};function tne(e,t,n){if(!ene.contents.includes(e))return ene.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 nne(e){return me(e.readModels.filter(e=>!!L(j(ht(e.schema),e=>Xe(e,"x-reventless-notifications")),!1,e=>{let t=ut(e);return"object"!=typeof t?"JSONTrue"===t:"JSONString"===t.TAG})||e.name.toLowerCase().endsWith("notifications")),t=>{let n=Jte(t.schema,qte),r=function(e){let t=Jte(e,Gte);if(void 0!==t)return t;let n=Ua(e,void 0,void 0);return xa(e).map(e=>e[0]).find(e=>L(Xe(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(xa(i),e=>{if(ka(e[1]))return e[0]}).find(e=>Wte(e,Vte))),readField:Xte(t.schema),refFields:Qte(t.schema,r),markReadCommand:Zte(t,e)}:void tne(t.name,"recipient",Gte):void tne(t.name,"message",qte);var i})[0]}function rne(e,t){return j(Xe(e,t),dt)}function ine(e,t){return j(j(t.timestampField,t=>rne(e,t)),pc)}function one(e,t,n){let r=t.readField;if(void 0!==r){let t=z(Xe(e,r),ut);return"JSONTrue"===t&&"object"!=typeof t}let i=ine(e,t);return void 0===i||void 0!==n&&i<=n}function sne(e,t,n,r){return me(t,t=>{let r=U(ht(t),{});if(function(e,t,n){let r=rne(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=ine(t,e),i=ine(n,e);return void 0!==r?void 0!==i?i-r:-1:void 0!==i?1:0}).map((t,n)=>({id:U(rne(t,"id"),"#"+n.toString()),message:U(rne(t,e.messageField),""),timestamp:j(e.timestampField,e=>rne(t,e)),read:one(t,e,r),refs:me(e.refFields,e=>z(rne(t,e.field),t=>[e.stem,t]))}))}let ane=l([]),lne=l(e=>{}),cne=ane.Provider,une=lne.Provider;let dne=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(une,{value:o,children:c(cne,{value:r[0],children:e.children})})};function fne(e,t){return e+"/"+t}function hne(e,t,n){return e.map(e=>{let r=function(e,t,n){return e.get(fne(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(Ste,{pluginId:t,fragmentId:e.fragmentId,remoteEntryUrl:r,panelProps:n}),requiredAccess:e.requiredAccess,minWidth:e.minWidth}:e})}function pne(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 gne={contents:[]};function mne(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 vne(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(fne(e.pluginId,r.fragmentId),n)}),void e.panels.forEach(r=>{t.set(fne(e.pluginId,r.fragmentId),n)})}),t}(t),c=function(e,t,n){return"Lock"===e?[n,VF(t,n),KF(t,n)]:[GF(t,n),{},{}]}(i,r,e),u=c[2],d=c[1],f=CO(o,s,c[0]);a="object"!=typeof o&&"Unknown"!==o;let h=Yee.buildRegistry(f),p=me(f,e=>z(nne(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=>pne(t.fragmentId,e)),n.panels.map(t=>pne(t.fragmentId,e))]:[[],[]]}(r.id,t),o=dte(r,0,0,0,f,e,i[0],i[1],0,d,u,a,n[r.id],void 0),s=hne(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=qe(y.contents,o.publicLinks)}),t.forEach(e=>{}),{pages:g,panels:m,routes:v,publicLinks:y.contents,entities:h,notificationBindings:p}}let yne="Admin";function _ne(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 "+yne+" 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 bne(e,t,n,r){if(void 0!==e.manifestUrl&&("object"!=typeof t||!n.includes(yne)))return function(e,t){return B(j(t,t=>e.journeyManifestUrls[t]),e.manifestUrl)}(e,r)}function xne(e,t){return"/"===t||e.some(e=>t===e||t.startsWith(e+"/"))}function Sne(e){if(null==sessionStorage.getItem(fq)||(sessionStorage.removeItem(fq),0))return;let t=gne.contents;if(xne(t,"/"+Se(Y(void 0).path).join("/")))return;let n=P(j(z(e.home,e=>e.trim()),e=>""===e?void 0:e),e=>xne(t,e));J(U(B(n,t[0]),"/"))}function wne(e){return"ManifestUnreadable"===e.TAG?"Component manifest could not be loaded":"Nothing here for the role you are acting as"}function Ene(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=vne(o,s,a,l,c,u,d);r(f.entities),i(f.notificationBindings),M(e,e=>e.setPluginPages(f.pages)),gne.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=bne(e,u,f,h);if(void 0!==g)return VO(g).then(e=>{if("Ok"!==e.TAG)return{TAG:"ManifestUnreadable",_0:e._0};p(e._0,[])});let m=mne(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=mne(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=hte(i)||hte(r),s=o||fte(i)||fte(r);var a;if(p((a=i,U(z(j(j(j(Je.object(a),e=>e.data),Je.object),e=>e.Platform_ComponentDefinitions),UO),[])),function(e){return me(U(j(j(j(j(Je.object(e),e=>e.data),Je.object),e=>e.Platform_UIFragments),Je.array),[]),$te)}(r)),s)return function(e,t){return!e&&t.includes(yne)}(o,f)?void n():{TAG:"NoSurfacesForCaller",_0:_ne(h,e.hostShellUrl)}})}function kne(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("+_t.surfaceSubtle+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.error+")",margin:"1rem",padding:"1rem 1.25rem",borderRadius:"0.375rem"}})}let Cne=function(e){let t=e.uiHints,n=e.config,r=void 0!==t?t:{},o=d(lG),l=d(uV),c=AV(),u=d($a),f=d(lne),h=Dq(),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=EO(n.elevatedGroups,g),_=L(j(h,e=>e.identity),"",e=>e.userId),b=s(()=>{}),x=b[1],S=b[0];return a(()=>{Ene(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),Sne(n)})},[p,r]),a(()=>{if(function(e,t,n,r){return q(bne(e,t,n,r))}(n,y,g,m))try{let e=function(e,t){return Ite({url:e,connectionParams:void 0!==t?{Authorization:"Bearer "+t}:void 0,lazy:!0,retryAttempts:5})}(n.platformApiSubscriptionEndpoint,p),t=()=>{Ene(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(kne,{message:S._0,title:wne(S)}):null};async function Ane(e,t,n,r,i,o){let s=[],a=function(e,t,n){return me(t,t=>vt(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 VO(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(vne(n._0,[],i,[a].concat(e.accessTiers),e.deniedSurfaces,EO(e.elevatedGroups,[a]),o).pages,e=>e.url);xne(l,r)&&s.push(a)}),s}let Nne={display:"flex",padding:"2rem",alignItems:"flex-start",flexDirection:"column",gap:"var("+bt.sm+")"},Tne={fontSize:"var("+xt.sizeLg+")",fontWeight:"var("+xt.weightMedium+")",margin:"0"},Rne={color:"var("+_t.textSecondary+")",margin:"0"},Dne={background:"var("+_t.surface+")",border:"1px solid var("+_t.borderSubtle+")",color:"var("+_t.textPrimary+")",cursor:"pointer",padding:"0.4rem 0.9rem",borderRadius:"0.375rem"},Ine={color:"var("+_t.error+")",margin:"0"};let Fne=function(e){let t,n=e.uiHints,l=e.config,c=Dq(),u=le(),d=j(c,e=>e.identity),f=L(c,!1,e=>e.canSwitchRoles),h=L(d,[],e=>Yq(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 Ane(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:Rne}),y.map(e=>i("button",{children:"Act as "+e,style:Dne,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:Ine}):null]})}else t=null;return r("div",{children:[i("h1",{children:"404 — Page not found",style:Tne}),t],style:Nne})};function One(e){return"var("+e+")"}let Pne=co([Ui("relative"),gi("inlineBlock")]),Mne=co([Ui("relative"),gi("inlineFlex"),di("center"),xi("center"),ui("background","none"),ui("border","none"),ui("border-radius",One(St.md)),ui("cursor","pointer"),ui("color",One(_t.textSecondary)),ui("padding","6px"),Yi([ui("background",One(_t.surfaceSubtle)),ui("color",One(_t.textPrimary))])]),Lne=co([Ui("absolute"),qi(to(0)),Bi(to(0)),gi("inlineFlex"),di("center"),xi("center"),ui("min-width","16px"),ui("height","16px"),ui("padding","0 4px"),ui("border-radius",One(St.full)),ui("background",One(_t.brand)),ui("color",One(_t.textOnBrand)),ui("font-family",One(xt.fontFamily)),ui("font-size","10px"),ui("font-weight",One(xt.weightBold)),ui("line-height","1")]),zne=co([Ui("absolute"),Bi(to(0)),qi({NAME:"percent",VAL:100}),Ti(to(4)),ui("width","320px"),ui("background",One(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",One(St.md)),ui("box-shadow",One(Et)),ui("z-index","200"),ui("overflow","hidden"),ui("font-family",One(xt.fontFamily))]),jne=co([gi("flex"),di("center"),xi("spaceBetween"),ui("padding","var("+bt.sm+") var("+bt.md+")"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("color",One(_t.textSecondary)),ui("font-size",One(xt.sizeSm)),ui("font-weight",One(xt.weightMedium)),ui("text-transform","uppercase"),ui("letter-spacing","0.04em")]),Une=co([ui("background","none"),ui("border","none"),ui("color",One(_t.brand)),ui("font-size",One(xt.sizeXs)),ui("text-transform","none"),ui("letter-spacing","0"),pi("pointer"),Yi([ui("text-decoration","underline")])]),Bne=co([ui("max-height","360px"),ui("overflow-y","auto")]);function $ne(e){return co([gi("flex"),di("flexStart"),ui("gap",One(bt.sm)),ui("width","100%"),ui("background","none"),ui("border","none"),ui("border-bottom","1px solid var("+_t.borderSubtle+")"),ui("text-align","left"),ui("padding","var("+bt.sm+") var("+bt.md+")"),pi(e?"pointer":"default"),Yi(e?[ui("background",One(_t.surfaceSubtle))]:[])])}function qne(e){return co([ui("width","8px"),ui("height","8px"),ui("border-radius",One(St.full)),ui("margin-top","5px"),ui("flex-shrink","0"),ui("background",e?"transparent":One(_t.brand))])}let Gne=co([gi("flex"),mi("column"),ui("gap","2px"),ui("min-width","0")]);function Vne(e){return co([ui("color",One(_t.textPrimary)),ui("font-size",One(xt.sizeSm)),ui("font-weight",One(e?xt.weightNormal:xt.weightMedium)),ui("line-height",One(xt.lineHeightNormal)),ui("word-break","break-word")])}let Kne=co([ui("color",One(_t.textDisabled)),ui("font-size",One(xt.sizeXs))]),Wne=co([ui("color",One(_t.textDisabled)),ui("font-size",One(xt.sizeSm)),ui("padding",One(bt.md)),ui("text-align","center")]);function Hne(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 Jne=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(Hne,{}),y>0?i("span",{children:y>99?"99+":y.toString(),className:Lne}):null],"aria-label":y>0?"Notifications ("+y.toString()+" unread)":"Notifications",className:Mne,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:Une,type:"button",onClick:e=>c()}):null],className:jne}),0===d.length?i("div",{children:f,className:Wne}):i("div",{children:d.map(e=>{let t=e.timestamp;return r("button",{children:[i("span",{className:qne(e.read)}),r("span",{children:[i("span",{children:e.message,className:Vne(e.read)}),void 0!==t?i("span",{children:zY(p,t),className:Kne}):null],className:Gne})],className:$ne($(u)),type:"button",onClick:t=>{M(u,t=>t(e)),m(e=>!1)}},e.id)}),className:Bne})],className:zne,onClick:e=>{e.stopPropagation()}}):null],className:Pne})};function Xne(e){return"autoui.notifications.seen."+e}function Qne(e){let t=e.onData,n=V3(e.binding.readModel,void 0);return a(()=>{t({rows:n.rows,refetch:n.refetch})},[n.rows]),null}let Yne=function(e){let t=d(ane),n=Dq(),a=AI(),l=y1(),c=Ka(),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(Xe(p,e.pluginId),[],e=>e.rows);return sne(e.binding,t,m,function(e){let t=localStorage.getItem(Xne(e));if(null!=t)return na(t)}(e.pluginId)).map(t=>({key:e.pluginId+":"+t.id,appBinding:e,entry:t}))}).toSorted((e,t)=>{let n=j(e.entry.timestamp,pc),r=j(t.entry.timestamp,pc);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 Ze([[n,t]])}(e.binding,t)).then(t=>{if("object"!=typeof t){let t=e.pluginId;return M(Xe(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(ye(e.entry.refs,e=>{let t=e[1];return z(Wa(c,e[0]),e=>[e,t])}),e=>{let t=e[0];u(Qa(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(Xe(p,e.pluginId),[],e=>e.rows);M(function(e,t){return ge(t,void 0,(t,n)=>{let r=ine(U(ht(n),{}),e);return void 0!==t?void 0!==r?Math.max(t,r):t:r})}(e.binding,t),t=>function(e,t){localStorage.setItem(Xne(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=Ze(Qe(n));return r[t]=e,r}))},e.pluginId);var t}),i(Jne,{notifications:w,onOpen:_,onMarkAllRead:b?x:void 0,onPanelOpen:S})]})};let Zne=function(e){let t,n=e.onChange,r=bO();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 ere(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 tre(e){return"var("+e+")"}let nre=co([gi("flex"),mi("column"),di("center"),xi("center"),ui("gap","6px"),ui("padding",tre(bt.lg)),ui("border","2px dashed var("+_t.border+")"),ui("border-radius",tre(St.md)),ui("color",tre(_t.textSecondary)),ui("font-family",tre(xt.fontFamily)),ui("font-size",tre(xt.sizeSm)),pi("pointer"),ui("transition","border-color 120ms, background 120ms"),$i("center")]),rre=co([ui("border-color",tre(_t.brand)),ui("background",tre(_t.brandSubtle))]),ire=co([ui("font-size",tre(xt.sizeXs))]),ore=co([gi("flex"),di("center"),ui("gap","8px"),ui("padding",tre(bt.xs)+" 0"),ui("font-family",tre(xt.fontFamily)),ui("font-size",tre(xt.sizeSm)),ui("color",tre(_t.textPrimary))]),sre=co([ui("flex","1"),ui("min-width","0"),ui("overflow","hidden"),ui("text-overflow","ellipsis"),ui("white-space","nowrap")]),are=co([ui("color",tre(_t.textSecondary)),ui("font-size",tre(xt.sizeXs)),ui("white-space","nowrap")]),lre=co([ui("color",tre(_t.success))]),cre=co([ui("color",tre(_t.error))]),ure=co([ui("width","120px")]),dre=co([ui("flex","0 0 auto"),ui("border","none"),ui("background","transparent"),ui("padding","0 4px"),ui("color",tre(_t.textSecondary)),ui("font-size",tre(xt.sizeMd)),wi({NAME:"abs",VAL:1}),pi("pointer")]),fre=co([ui("width","40px"),ui("height","40px"),ui("flex","0 0 auto"),ui("object-fit","cover"),ui("border-radius",tre(St.sm)),ui("border","1px solid var("+_t.border+")")]);let hre=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]?nre+" "+rre:nre;return r("div",{children:[r("div",{children:[i("span",{children:f}),void 0!==c?i("span",{children:"Accepted: "+c,className:ire}):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(jc,{value:o._0,showValue:!1}),className:ure});break;case"Done":t=i("span",{children:"Uploaded",className:lre});break;case"Rejected":t=i("span",{children:"Rejected",className:cre,title:o._0});break;case"Failed":t=i("span",{children:"Failed",className:cre,title:o._0})}return r("div",{children:[void 0!==n?i("img",{className:fre,alt:e.name,src:n}):null,i("span",{children:e.name,className:sre,title:e.name}),i("span",{children:ere(e.size),className:are}),t,i("button",{children:"×","aria-label":"Remove "+e.name,className:dre,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:ore},e.key)})]})};function pre(e){if(""===e)return[];let t;try{t=pt(JSON.parse(e))}catch(n){return[e]}return void 0!==t?me(t,dt):[e]}function gre(e,t){let n=ja(e,t);if(void 0!==n&&"Image"===n.semantic)return"image/*"}function mre(e){return vt(j(j(ht(Lt(e)),e=>Xe(e,"type")),dt),"array")}function vre(e){let t=e=>j(Is(e).storeTarget,ws);return B(t(e),j(zt(e),t))}function yre(e,t,n){return U(function(e,t,n){return B(j(vre(e),n),t)}(e,t,n),(r=vre(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 _re(e){let t=e.onChange,n=e.value,r=e.multiple,o=e.adapter,s=h(r?pre(n):""===n?[]:[n]),l=h([]),c=d(Z4),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(hre,{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 bre(e,t,n,r){if(r&&0===pre(n).length)return"Required"}function xre(e,t,n){let r=void 0!==e?e:e=>{},o=(e,o,s,a,l,c,u)=>i(_re,{adapter:yre(o,void 0,r),accept:B(t,gre(e,o)),multiple:U(n,mre(o)),value:s,onChange:a}),s=e=>{let t=U(function(e){return Xe(pD,ra(e))}(e),{cell:(e,t,n)=>{},detail:(e,t,n)=>{}}),n={...t};gD(e,(n.validateInput=bre,n.input=o,n))};s("File"),s("Image")}var Sre={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"},wre=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 Ere(e){return function(){return e}}var kre=function(){};kre.thatReturns=Ere,kre.thatReturnsFalse=Ere(!1),kre.thatReturnsTrue=Ere(!0),kre.thatReturnsNull=Ere(null),kre.thatReturnsThis=function(){return this},kre.thatReturnsArgument=function(e){return e};var Cre=Sre,Are=wre;function Nre(e){var t=e;return"function"==typeof t?t=t():t.default&&(t=t.default),t}function Tre(e){var t=Nre(e);return"object"==typeof t&&null!==t&&t.kind===Cre.FRAGMENT}function Rre(e){var t=Nre(e);return"object"==typeof t&&null!==t&&t.kind===Cre.REQUEST}function Dre(e){var t=Nre(e);return"object"==typeof t&&null!==t&&t.kind===Cre.INLINE_DATA_FRAGMENT}function Ire(e){var t=Nre(e);return Tre(t)||Are(!1),t}var Fre,Ore={getFragment:Ire,getNode:Nre,getPaginationFragment:function(e){var t,n=Ire(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=Ire(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=Nre(e);return Rre(t)||Are(!1),t},getUpdatableQuery:function(e){var t=Nre(e);return!function(e){var t=Nre(e);return"object"==typeof t&&null!==t&&t.kind===Cre.UPDATABLE_QUERY}(t)&&Are(!1),t},getInlineDataFragment:function(e){var t=Nre(e);return Dre(t)||Are(!1),t},graphql:function(e){Are(!1)},isFragment:Tre,isRequest:Rre,isInlineDataFragment:Dre},Pre={exports:{}};(Fre=Pre).exports=function(e){return e&&e.__esModule?e:{default:e}},Fre.exports.__esModule=!0,Fre.exports.default=Fre.exports;var Mre=Pre.exports,Lre={exports:{}},zre={exports:{}},jre={exports:{}},Ure={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}(Ure);var Bre=Ure.exports,$re={exports:{}};!function(e){var t=Bre.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}($re);var qre=$re.exports;!function(e){var t=Bre.default,n=qre;e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(jre);var Gre=jre.exports;!function(e){var t=Gre;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}(zre);var Vre=zre.exports;!function(e){var t=Vre;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}(Lre);var Kre=Lre.exports,Wre={exports:{}},Hre={exports:{}},Jre={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}(Jre);var Xre=Jre.exports;!function(e){var t=Xre;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}(Hre);var Qre=Hre.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}(Wre);var Yre=Wre.exports,Zre=Mre.default,eie=Zre(Kre),tie=Zre(Yre),nie=wre;function rie(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 iie={handlePotentialSnapshotErrors:function(e,t,n){null!=t&&function(e,t,n){var r,i=(0,tie.default)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.relayFieldLogger((0,eie.default)((0,eie.default)({},o),{},{uiContext:n}))}}catch(c){i.e(c)}finally{i.f()}var s,a=(0,tie.default)(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(rie(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,nie(!1)}}}catch(c){a.e(c)}finally{a.f()}}(e,t,n)},eventShouldThrow:rie},oie={exports:{}},sie={exports:{}};!function(e){var t=Xre;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(sie);var aie=sie.exports,lie={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}(lie);var cie=lie.exports,uie={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}(uie);var die=uie.exports;!function(e){var t=aie,n=cie,r=Qre,i=die;e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(oie);var fie=oie.exports,hie={DEFAULT_HANDLE_KEY:""},pie=hie.DEFAULT_HANDLE_KEY,gie=wre;var mie=function(e,t,n){return t&&t!==pie?"__".concat(t,"_").concat(e):(null==n&&gie(!1),"__".concat(n,"_").concat(e))},vie={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 yie={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)})}},_ie=(0,Mre.default)(fie),bie=mie,xie=vie,Sie=yie.stableCopy,wie=wre,Eie=Sre.VARIABLE,kie=Sre.LITERAL,Cie=Sre.OBJECT_VALUE,Aie=Sre.LIST_VALUE;function Nie(e,t){if(e.kind===Eie)return function(e,t){return t.hasOwnProperty(e)||wie(!1),Sie(t[e])}(e.variableName,t);if(e.kind===kie)return e.value;if(e.kind===Cie){var n={};return e.fields.forEach(function(e){n[e.name]=Nie(e,t)}),n}if(e.kind===Aie){var r=[];return e.items.forEach(function(e){null!=e&&r.push(Nie(e,t))}),r}}function Tie(e,t,n){var r={};return n&&(r[Iie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),e&&e.forEach(function(e){r[e.name]=Nie(e,t)}),r}function Rie(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?Die(r,Tie(n,t)):r}function Die(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 Iie={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:Tie,getHandleStorageKey:function(e,t){var n=e.dynamicKey,r=e.handle,i=e.key,o=e.name,s=e.args,a=e.filters,l=bie(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,_ie.default)(c)):[n]),null===c?l:Die(l,Tie(c,t))},getStorageKey:Rie,getReadTimeResolverStorageKey:function(e,t){var n=Rie(e,t);return xie.ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX?"$r:"+n:n},getStableStorageKey:function(e,t){return Die(e,Sie(t))},getModuleComponentKey:function(e){return"".concat("__module_component_").concat(e)},getModuleOperationKey:function(e){return"".concat("__module_operation_").concat(e)}},Fie=Iie,Oie=(0,Mre.default)(Kre),Pie=Fie.getArgumentValues,Mie=wre;var Lie={getLocalVariables:function(e,t,n){if(null==t)return e;var r=(0,Oie.default)({},e),i=n?Pie(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,Oie.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:Mie(!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}},zie=[],jie=[];function Uie(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(!Uie(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(!Uie(e[l[c]],t[l[c]],n,r))return!1}return n.pop(),r.pop(),!0}var Bie=
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=zie.length?zie.pop():[],r=jie.length?jie.pop():[],i=Uie(e,t,n,r);return n.length=0,r.length=0,zie.push(n),jie.push(r),i},$ie=Lie.getFragmentVariables,qie=Fie,Gie=qie.CLIENT_EDGE_TRAVERSAL_PATH,Vie=qie.FRAGMENT_OWNER_KEY,Kie=qie.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT,Wie=qie.FRAGMENTS_KEY,Hie=qie.ID_KEY,Jie=Bie,Xie=wre;function Qie(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Xie(!1);var n=t[Hie],r=t[Wie],i=t[Vie],o=t[Gie];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 soe(e,n,$ie(e,s.variables,l),s,!0===l[Kie],a)}return null}function Yie(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 Zie(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Xie(!1),Yie(e,t)):(Array.isArray(t)&&Xie(!1),Qie(e,t))}function eoe(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Xie(!1),function(e,t){var n=null;return t.forEach(function(t){var r=null!=t?toe(e,t):null;null!=r&&(n=n||[]).push(r)}),n}(e,t)):(Array.isArray(t)&&Xie(!1),toe(e,t))}function toe(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Xie(!1);var n=t[Hie];return"string"==typeof n?n:null}function noe(e,t){var n;return null==t?{}:!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)?(Array.isArray(t)||Xie(!1),ioe(e,t)):(Array.isArray(t)&&Xie(!1),roe(e,t)||{})}function roe(e,t){var n=Qie(e,t);return n?n.variables:null}function ioe(e,t){var n={};return t.forEach(function(t,r){if(null!=t){var i=roe(e,t);null!=i&&Object.assign(n,i)}}),n}function ooe(e,t){return e.dataID===t.dataID&&e.node===t.node&&Jie(e.variables,t.variables)&&(n=e.owner,r=t.owner,n===r||n.identifier===r.identifier&&Jie(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 soe(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 aoe={areEqualSelectors:function(e,t){return e===t||(null==e?null==t:null==t?null==e:"SingularReaderSelector"===e.kind&&"SingularReaderSelector"===t.kind?ooe(e,t):"PluralReaderSelector"===e.kind&&"PluralReaderSelector"===t.kind&&(e.selectors.length===t.selectors.length&&e.selectors.every(function(e,n){return ooe(e,t.selectors[n])})))},createReaderSelector:soe,createNormalizationSelector:function(e,t,n){return{dataID:t,node:e,variables:n}},getDataIDsFromFragment:eoe,getDataIDsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=eoe(i,o)}return n},getSingularSelector:Qie,getPluralSelector:Yie,getSelector:Zie,getSelectorsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=Zie(i,o)}return n},getVariablesFromSingularFragment:roe,getVariablesFromPluralFragment:ioe,getVariablesFromFragment:noe,getVariablesFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=noe(e[r],t[r]);Object.assign(n,i)}return n}},loe=Ore.getFragment,coe=iie.eventShouldThrow,uoe=aoe.getSelector,doe=wre,foe=[];var hoe={},poe={readFragment:function(e,t){if(!foe.length)throw new Error("readFragment should be called only from within a Relay Resolver function.");var n=foe[foe.length-1],r=loe(e),i=uoe(r,t);null==i&&doe(!1),"SingularReaderSelector"!==i.kind&&doe(!1);var o=n.getDataForResolverFragment(i,t),s=o.data,a=o.isMissingData,l=o.fieldErrors;if(a||null!=l&&l.some(coe))throw hoe;return s},withResolverContext:function(e,t){foe.push(e);try{return t()}finally{foe.pop()}},RESOLVER_FRAGMENT_ERRORED_SENTINEL:hoe},goe={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}(goe);var moe=goe.exports;var voe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.then},yoe=voe,_oe=function(e,t){},boe=function(){function e(e){this._source=e}e.create=function(t){return new e(t)},e.onUnhandledError=function(e){_oe=e},e.from=function(e){return function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}(e)?function(e){return e instanceof boe?e:boe.create(function(t){return e.subscribe(t)})}(e):yoe(e)?(t=e,boe.create(function(e){t.then(function(t){e.next(t),e.complete()},e.error)})):function(e){return boe.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(Ine){_oe(Ine,!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(Ine){_oe(Ine,!0)}n=void 0}}var s=i({unsubscribe:function(){if(!r){r=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(Ine){_oe(Ine,!0)}finally{o()}}}});try{t.start&&t.start(s)}catch(Ine){_oe(Ine,!0)}if(r)return s;var a=i({next:function(e){if(!r&&t.next)try{t.next(e)}catch(Ine){_oe(Ine,!0)}},error:function(e,n){if(r||!t.error)r=!0,_oe(e,n||!1),o();else{r=!0;try{t.error(e)}catch(i){_oe(i,!0)}finally{o()}}},complete:function(){if(!r){r=!0;try{t.complete&&t.complete()}catch(Ine){_oe(Ine,!0)}finally{o()}}}});try{n=e(a)}catch(Ine){a.error(Ine,!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(Ine){e.error(Ine,!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(Ine){r.error(Ine,!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 xoe=boe,Soe=Mre.default,woe=Soe(Yre),Eoe=Soe(Vre),koe=xoe,Coe=wre,Aoe=function(){function e(){var e=this;(0,Eoe.default)(this,"_complete",!1),(0,Eoe.default)(this,"_events",[]),(0,Eoe.default)(this,"_sinks",new Set),(0,Eoe.default)(this,"_subscription",[]),this._observable=koe.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,Coe(!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,woe.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}(),Noe=Aoe,Toe=xoe,Roe=Noe,Doe=wre,Ioe="function"==typeof WeakMap?new WeakMap:new Map;function Foe(e,t,n){return Toe.create(function(r){var i=Poe(e),o=i.get(t);return o||n().finally(function(){return i.delete(t)}).subscribe({start:function(e){o={identifier:t,subject:new Roe,subjectForInFlightStatus:new Roe,subscription:e,promise:null},i.set(t,o)},next:function(e){var n=Moe(i,t);n.subject.next(e),n.subjectForInFlightStatus.next(e)},error:function(e){var n=Moe(i,t);n.subject.error(e),n.subjectForInFlightStatus.error(e)},complete:function(){var e=Moe(i,t);e.subject.complete(),e.subjectForInFlightStatus.complete()},unsubscribe:function(e){var n=Moe(i,t);n.subject.unsubscribe(),n.subjectForInFlightStatus.unsubscribe()}}),null==o&&Doe(!1),function(e,t){return Toe.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 Ooe(e,t,n){return Toe.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 Poe(e){var t=Ioe.get(e);if(null!=t)return t;var n=new Map;return Ioe.set(e,n),n}function Moe(e,t){var n=e.get(t);return null==n&&Doe(!1),n}var Loe={fetchQuery:function(e,t){return Foe(e,t.request.identifier,function(){return e.execute({operation:t})})},fetchQueryDeduped:Foe,getPromiseForActiveRequest:function(e,t){var n=Poe(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;Ooe(e,0,r).subscribe({complete:t,error:n,next:function(e){i&&t(e)}}),i=!0});return i},getObservableForActiveRequest:function(e,t){var n=Poe(e),r=n.get(t.identifier);return r&&e.isRequestActive(r.identifier)?Ooe(e,0,r):null}},zoe=Mre.default;moe.default;zoe(Yre);var joe=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},Uoe=yie.stableCopy,Boe=wre;var $oe=function(e,t){var n=null!=e.cacheID?e.cacheID:e.id;return null==n&&Boe(!1),n+JSON.stringify(Uoe(t))},qoe=$oe,Goe=vie,Voe=yie.hasCycle,Koe=Lie.getOperationVariables,Woe=aoe.createNormalizationSelector,Hoe=aoe.createReaderSelector,Joe=Fie.ROOT_ID,Xoe=wre;function Qoe(e,t,n){return{identifier:qoe(e.params,t),node:e,variables:t,cacheConfig:n}}var Yoe={createOperationDescriptor:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Joe,i=e.operation,o=Koe(i,e.params.providedVariables,t);Goe.ENABLE_CYLE_DETECTION_IN_VARIABLES&&Voe(o)&&Xoe(!1);var s=Qoe(e,o,n);return{fragment:Hoe(e.fragment,r,o,s),request:s,root:Woe(i,r,o)}},createRequestDescriptor:Qoe};(0,Mre.default)(Vre);moe.default;var Zoe=new Map,ese=1,tse=function(){for(var e=new Set,t=0;t<10;++t)e.add(t.toString());return e}();var nse={intern:function(e,t){if(null==t||e.length<t)return function(e){return"\t"===e[0]&&tse.has(e[1])||"\v"===e[0]?"\v"+e:e}(e);var n=Zoe.get(e);return null!=n||(n="\t"+ese++,Zoe.set(e,n)),n}},rse=vie,ise=nse.intern,ose="client:";var sse=0;var ase={generateClientID:function(e,t,n){var r=(rse.STRING_INTERN_LEVEL<=0?e:ise(e,rse.MAX_DATA_ID_LENGTH))+":"+t;return null!=n&&(r+=":"+n),0!==r.indexOf(ose)&&(r=ose+r),r},generateClientObjectClientID:function(e,t,n){var r="".concat(ose).concat(e,":").concat(t);return null!=n&&(r+=":"+n),r},generateUniqueClientID:function(){return"".concat(ose,"local:").concat(sse++)},isClientID:function(e){return 0===e.indexOf(ose)}},lse={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},cse={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"},use={inject:function(e){cse=e},get:function(){return cse},isConnectionCall:function(e){return lse.hasOwnProperty(e.name)}},dse=ase.generateClientID,fse=Fie.getStableStorageKey,hse=mie,pse=use,gse=wre,mse="connection",vse="__connection_next_edge_index";function yse(e,t,n){if(null==n)return n;var r=pse.get().EDGES,i=t.getValue(vse);"number"!=typeof i&&gse(!1);var o=dse(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,vse),s}function _se(e,t,n){for(var r=pse.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 bse={buildConnectionEdge:yse,createEdge:function(e,t,n,r){var i=pse.get().NODE,o=dse(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=pse.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=hse(mse,t,null);return e.getLinkedRecord(r,n)},getConnectionID:function(e,t,n){var r=hse(mse,t,null),i=fse(r,n);return dse(e,i)},insertEdgeAfter:function(e,t,n){var r=pse.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=pse.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=pse.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=dse(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 yse(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;_se(_,x,C),_se(y,x,C)}else if(null!=S.before){if(!m||S.before!==m.getValue(u))return;var A=new Set;_se(y,x,A),_se(_,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,vse),R.copyFieldsFrom(d);var D=d.getLinkedRecords(i);D&&(D=D.map(function(t){return yse(e,R,t)}),R.setLinkedRecords(D,i)),n.setLinkedRecord(R,t.handleKey),(m=e.create(dse(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))}}},xse=(0,Mre.default)(Yre),Sse=bse,wse=use,Ese=wre,kse={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)})}}},Cse={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=t.handleArgs.connections;null==r&&Ese(!1);var i=n.getValue(t.fieldKey);(Array.isArray(i)?i:[i]).forEach(function(t){if("string"==typeof t){var n,i=(0,xse.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=e.get(o);null!=s&&Sse.deleteNode(s,t)}}catch(a){i.e(a)}finally{i.f()}}})}}},Ase={update:Dse(Sse.insertEdgeAfter)},Nse={update:Dse(Sse.insertEdgeBefore)},Tse={update:Ise(Sse.insertEdgeAfter)},Rse={update:Ise(Sse.insertEdgeBefore)};function Dse(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs.connections;null==a&&Ese(!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=wse.get(),u=c.NODE,d=c.EDGES,f=null!==(r=s)&&void 0!==r?r:[o],h=(0,xse.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,xse.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=Sse.buildConnectionEdge(t,f,n);null==h&&Ese(!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 Ise(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&&Ese(!1),null==c&&Ese(!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=wse.get(),f=d.NODE,h=d.EDGES,p=null!==(r=s)&&void 0!==r?r:[o],g=(0,xse.default)(p);try{var m=function(){var n=u.value;if(null==n)return"continue";var r,i=n.getDataID(),o=(0,xse.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=Sse.createEdge(t,a,n,c);null==d&&Ese(!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 Fse=bse,Ose={AppendEdgeHandler:Ase,DeleteRecordHandler:kse,PrependEdgeHandler:Nse,AppendNodeHandler:Tse,PrependNodeHandler:Rse,DeleteEdgeHandler:Cse},Pse=wre;var Mse=function(e){switch(e){case"connection":return Fse;case"deleteRecord":return Ose.DeleteRecordHandler;case"deleteEdge":return Ose.DeleteEdgeHandler;case"appendEdge":return Ose.AppendEdgeHandler;case"prependEdge":return Ose.PrependEdgeHandler;case"appendNode":return Ose.AppendNodeHandler;case"prependNode":return Ose.PrependNodeHandler}Pse(!1)};var Lse=function(e){return Boolean(e&&e["@@RelayModernEnvironment"])},zse=(0,Mre.default)(Yre),jse=bse;function Use(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}var Bse={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=Use(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=Use(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,zse.default)(r);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(c){var f=jse.getConnection(s,d.key,d.filters);if(f){var h=jse.buildConnectionEdge(e,f,c);if(h)switch(d.rangeBehavior){case"append":jse.insertEdgeAfter(f,h);break;case"prepend":jse.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=Use(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,zse.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,zse.default)(t);try{var u=function(){var e=l.value,t=jse.getConnection(s,e.key,e.filters);t&&i.forEach(function(e){jse.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)})}}}},$se=Ore.getRequest,qse=Lse,Gse=Yoe.createOperationDescriptor,Vse=Bse,Kse=wre;var Wse=function(e,t){qse(e)||Kse(!1);var n=$se(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=Gse(n,s);return i&&(r=Vse.convert(i,n,r).optimisticUpdater),e.applyMutation({operation:a,response:o,updater:r})};var Hse=function(e,t){e.commitUpdate(t)};(0,Mre.default)(Kre);var Jse=(0,Mre.default)(fie),Xse=Ore.getRequest,Qse=ase.generateUniqueClientID,Yse=Lse,Zse=Yoe.createOperationDescriptor,eae=Bse,tae=wre;var nae=function(e,t){Yse(e)||tae(!1);var n=Xse(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=Zse(n,u,a,Qse());if("function"==typeof r&&(r=r()),s){var h=eae.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,Jse.default)(e.errors))}):e.errors&&p.push.apply(p,(0,Jse.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}},rae="function"==typeof WeakMap?new WeakMap:new Map;function iae(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(rae.has(r)){var o=rae.get(r);n[e]=o}else rae.set(r,i),n[e]=i}),n}return e}iae.tests_only_resetDebugCache=void 0;var oae=xoe;var sae={convertFetch:function(e){return function(t,n,r,i,o){var s=e(t,n,r,i,o);return s instanceof Error?oae.create(function(e){return e.error(s)}):oae.from(s)}}},aae=iae,lae=sae.convertFetch,cae=wre;var uae={create:function(e,t){var n=lae(e);return{execute:function(e,r,i,o,s){var a=aae(r,e.providedVariables);if("subscription"===e.operationKind)return t||cae(!1),o&&cae(!1),t(e,a,i);var l=i.poll;return null!=l?(o&&cae(!1),n(e,a,{force:!0}).poll(l)):n(e,a,i,o,s)}}}};(0,Mre.default)(Kre);var dae=(0,Mre.default)(Kre),fae=xoe,hae=Yoe.createOperationDescriptor,pae=iie.handlePotentialSnapshotErrors,gae=Loe,mae=Ore.getRequest,vae=wre;function yae(e,t){return gae.fetchQuery(e,t).map(function(){return e.lookup(t.fragment)})}var _ae=function(e,t,n,r){var i,o=mae(t);"query"!==o.params.operationKind&&vae(!1);var s=(0,dae.default)({force:!0},null==r?void 0:r.networkCacheConfig),a=hae(o,n,s),l=null!==(i=null==r?void 0:r.fetchPolicy)&&void 0!==i?i:"network-only";function c(t){return pae(e,t.fieldErrors),t.data}switch(l){case"network-only":return yae(e,a).map(c);case"store-or-network":return"available"===e.check(a).status?fae.from(e.lookup(a.fragment)).map(c):yae(e,a).map(c);default:throw new Error("fetchQuery: Invalid fetchPolicy "+l)}},bae=Yoe.createOperationDescriptor,xae=Ore.getRequest;var Sae=function(e,t,n,r){var i=xae(t);if("query"!==i.params.operationKind)throw new Error("fetchQuery: Expected query operation");var o=bae(i,n,r);return e.execute({operation:o}).map(function(){return e.lookup(o.fragment).data}).toPromise()},wae=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(_U){setTimeout(function(){throw _U},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}(),Eae=new wae,kae=Loe.getPromiseForActiveRequest;var Cae=function(e,t,n){var r,i,o=[],s=kae(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 Aae=function(e,t){return e===t&&(null===e||"object"!=typeof e)};function Nae(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=Nae(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=Nae(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 Tae=function(e,t){return Nae(e,t,!0)},Rae=Mre.default,Dae=Rae(Kre),Iae=Rae(Vre),Fae=Cae,Oae=iie.handlePotentialSnapshotErrors,Pae=Aae,Mae=Tae,Lae=vie,zae=Yoe.createRequestDescriptor,jae=aoe.areEqualSelectors,Uae=aoe.createReaderSelector,Bae=aoe.getSelectorsFromObject,$ae=Bie,qae=wre,Gae=function(){function e(e,t,n,r,i){var o=this;(0,Iae.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)&&Wae(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,Dae.default)({},t))[n]=o)}else{var s=this._props[n],a=void 0!==s?s:null;!e&&Pae(a,i)||((e=e||(0,Dae.default)({},t))[n]=a)}}this._data=e||t,this._stale=!1}return this._data},t.setCallback=function(e,t){this._callback=t,!0===Lae.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this.setProps(e)},t.setProps=function(e){this._props={};var t=Bae(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 Kae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Kae||qae(!1),i.setSelector(r)):null==i?i=new Vae(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Vae||qae(!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}(),Vae=function(){function e(e,t,n,r,i){var o=this;(0,Iae.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===Lae.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=Fae(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 Oae(this._environment,this._fieldErrors),this._data},t.setSelector=function(e){if(null==this._subscription||!jae(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=Mae(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(!$ae(e,this._selector.variables)){var n=zae(t,e),r=Uae(this._selector.node,this._selector.dataID,e,n);this.setSelector(r)}},e}(),Kae=function(){function e(e,t,n,r,i){var o=this;(0,Iae.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(Wae)},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 Vae(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 Wae(e){e&&e.dispose()}var Hae=Gae;var Jae,Xae,Qae=function(e,t,n,r,i,o){return new Hae(e,n,r,o,i)},Yae=wre;var Zae,ele,tle=function(e){return Jae||(Jae=e.createContext(null),Xae=e),e!==Xae&&Yae(!1),Jae},nle=wre;var rle=function(e){return Zae||(Zae=e.createContext(null),ele=e),e!==ele&&nle(!1),Zae},ile=Object.freeze({__LIVE_RESOLVER_SUSPENSE_SENTINEL:!0});var ole={isSuspenseSentinel:function(e){return e===ile},suspenseSentinel:function(){return ile}},sle={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}(sle);var ale=sle.exports,lle=Mre.default,cle=lle(Vre),ule=lle(ale),dle=lle(Gre),fle=lle(Kre),hle=joe,ple=ase,gle=ple.generateClientObjectClientID,mle=ole.isSuspenseSentinel,vle=Fie,yle=vle.ACTOR_IDENTIFIER_KEY,_le=vle.ERRORS_KEY,ble=vle.ID_KEY,xle=vle.INVALIDATED_AT_KEY,Sle=vle.REF_KEY,wle=vle.REFS_KEY,Ele=vle.RELAY_RESOLVER_VALUE_KEY;vle.ROOT_ID;var kle=vle.TYPENAME_KEY,Cle=Bie,Ale=wre;function Nle(e,t){var n=e[t];return n&&"object"==typeof n&&(n.hasOwnProperty(Sle)||n.hasOwnProperty(wle))&&Ale(!1),n}function Tle(e,t,n){var r=e[_le];if(null!=n&&n.length>0)null==r?e[_le]=(0,cle.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[_le]}}function Rle(e,t,n){e[t]=n}var Dle={clone:function(e){return(0,fle.default)({},e)},copyFields:function(e,t){for(var n in e)e.hasOwnProperty(n)&&n!==ble&&n!==kle&&(t[n]=e[n])},create:function(e,t){var n={};return n[ble]=e,n[kle]=t,n},freeze:function(e){hle(e)},fromObject:function(e){return e},getDataID:function(e){return e[ble]},getErrors:function(e,t){var n;return null===(n=e[_le])||void 0===n?void 0:n[t]},getFields:function(e){return _le in e?Object.keys(e).filter(function(e){return e!==_le}):Object.keys(e)},getInvalidationEpoch:function(e){if(null==e)return null;var t=e[xle];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[Sle]||Ale(!1),r[Sle]},getLinkedRecordIDs:function(e,t){var n=e[t];return null==n?n:("object"==typeof n&&Array.isArray(n[wle])||Ale(!1),n[wle])},getType:function(e){return e[kle]},getValue:Nle,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[Sle])},hasLinkedRecordIDs:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&Array.isArray(n[wle])&&n[wle].every(function(e){return"string"==typeof e}))},merge:function(e,t){if(_le in e||_le in t){var n=e[_le],r=(0,ule.default)(e,[_le].map(dle.default)),i=t[_le],o=(0,ule.default)(t,[_le].map(dle.default)),s=(0,fle.default)((0,fle.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[_le]=a;break}return s}return(0,fle.default)((0,fle.default)({},e),t)},setErrors:Tle,setValue:Rle,setLinkedRecordID:function(e,t,n){var r={};r[Sle]=n,e[t]=r},setLinkedRecordIDs:function(e,t,n){var r={};r[wle]=n,e[t]=r},update:function(e,t){var n,r=e[_le],i=t[_le],o=null;if(null==r&&null==i){var s;for(var a in t)!o&&Cle(e[a],t[a])||((o=null!==o?o:(0,fle.default)({},e))[a]=t[a]);return null!==(s=o)&&void 0!==s?s:e}for(var l in t)if(l!==_le){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(Cle(d,c)&&Cle(f,u))continue;o=(0,fle.default)({},e),null!=r&&(o[_le]=(0,fle.default)({},r))}Rle(o,l,c),Tle(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[Sle]||null==n[yle])&&Ale(!1),[n[yle],n[Sle]])},setActorLinkedRecordID:function(e,t,n,r){var i={};i[Sle]=r,i[yle]=n,e[t]=i},getResolverLinkedRecordID:function(e,t){var n=Nle(e,Ele);return null==n||mle(n)?null:("object"==typeof n&&(n=n.id),"string"!=typeof n&&Ale(!1),gle(t,n))},getResolverLinkedRecordIDs:function(e,t){var n=Nle(e,Ele);return null==n||mle(n)?null:(Array.isArray(n)||Ale(!1),n.map(function(e){return null==e?null:("object"==typeof e&&(e=e.id),"string"!=typeof e&&Ale(!1),gle(t,e))}))},toJSON:function(e){return e}},Ile={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"},Fle=(0,Mre.default)(Yre),Ole=Dle,Ple=Ile.EXISTENT,Mle=Ile.NONEXISTENT,Lle=Ile.UNKNOWN,zle=function(){function e(e){var t=this;this._records=new Map,null!=e&&Object.keys(e).forEach(function(n){var r=e[n],i=Ole.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)?Mle:Ple:Lle},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,Fle.default)(this._records);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r[0],o=r[1];t[i]=Ole.toJSON(o)}}catch(s){n.e(s)}finally{n.f()}return t},e}(),jle=zle,Ule=wre,Ble="INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";var $le={assertInternalActorIdentifier:function(e){e!==Ble&&Ule(!1)},getActorIdentifier:function(e){return e},INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE:Ble},qle="actor_key",Gle=$le.getActorIdentifier;var Vle={ACTOR_IDENTIFIER_FIELD_NAME:qle,getActorIdentifierFromPayload:function(e){if(null!=e&&"object"==typeof e&&"string"==typeof e[qle])return Gle(e[qle])}},Kle=Mre.default,Wle=Kle(Kre),Hle=Kle(ale),Jle=Kle(Yre),Xle=Kle(fie),Qle=["path","locations"],Yle=Symbol("$SELF");function Zle(e,t){var n,r=(0,Jle.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,Xle.default)(s)):Zle(s,t),o!==Yle)for(var l=t.length,c=a;c<l;c++){var u=t[c];null==u.path?t[c]=(0,Wle.default)((0,Wle.default)({},u),{},{path:[o]}):u.path.unshift(o)}}}catch(d){r.e(d)}finally{r.f()}}var ece={buildErrorTrie:function(e){if(null==e)return null;var t,n=new Map,r=(0,Jle.default)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.path,s=(i.locations,(0,Hle.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(Yle,f),c.set(d,h),c=h}}var p=o[l],g=c.get(p);g instanceof Map&&(g=(c=g).get(p),p=Yle),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 Zle(n,r),r}};var tce={generateTypeID:function(e){return"client:__type:"+e},TYPE_SCHEMA_TYPE:"__TypeSchema"},nce=Mre.default,rce=nce(Yre),ice=nce(fie),oce=Vle,sce=oce.getActorIdentifierFromPayload,ace=vie,lce=ase.generateClientID,cce=ase.isClientID,uce=Lie.getLocalVariables,dce=ece.buildErrorTrie,fce=ece.getErrorsByKey,hce=ece.getNestedErrorTrieByKey,pce=Dle,gce=aoe.createNormalizationSelector,mce=Fie,vce=mce.ROOT_ID,yce=mce.TYPENAME_KEY,_ce=mce.getArgumentValues,bce=mce.getHandleStorageKey,xce=mce.getModuleComponentKey,Sce=mce.getModuleOperationKey,wce=mce.getStorageKey,Ece=tce.TYPE_SCHEMA_TYPE,kce=tce.generateTypeID,Cce=wre;var Ace=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,ice.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||Cce(!1),this._assignClientAbstractTypes(e),this._errorTrie=dce(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,rce.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=kce(a),c=this._recordSource.get(l);null==c&&(c=pce.create(l,Ece),this._recordSource.set(l,c)),pce.setValue(c,o,!0)}}catch(u){s.e(u)}finally{s.f()}}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||Cce(!1),this._variables[e]},t._getRecordType=function(e){var t=e[yce];return null==t&&Cce(!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=uce(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){pce.getType(t)===i.type&&this._traverseSelections(i,t,n)}else{var a=Object.prototype.hasOwnProperty.call(n,s),l=pce.getType(t),c=kce(l),u=this._recordSource.get(c);null==u&&(u=pce.create(c,Ece),this._recordSource.set(c,u)),pce.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=pce.getType(t),p=kce(h),g=this._recordSource.get(p);null==g&&(g=pce.create(p,Ece),this._recordSource.set(p,g)),pce.setValue(g,d,f);break;case"LinkedHandle":case"ScalarHandle":var m=i.args?_ce(i.args,this._variables):{},v=wce(i,this._variables),y=bce(i,this._variables);this._handleFieldPayloads.push({args:m,dataID:pce.getDataID(t),fieldKey:v,handle:i.handle,handleKey:y,handleArgs:i.handleArgs?_ce(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:Cce(!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,ice.default)(this._path),selector:gce(e,pce.getDataID(t),this._variables),typeName:pce.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,ice.default)(this._path),parentID:pce.getDataID(t),node:e,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeModuleImport=function(e,t,n){"object"==typeof n&&n||Cce(!1);var r=pce.getType(t),i=xce(e.documentName),o=e.componentModuleProvider||n[i];pce.setValue(t,i,null!=o?o:null);var s=Sce(e.documentName),a=e.operationModuleProvider||n[s];pce.setValue(t,s,null!=a?a:null),null!=a&&this._followupPayloads.push({kind:"ModuleImportPayload",args:e.args,data:n,dataID:pce.getDataID(t),operationReference:a,path:(0,ice.default)(this._path),typeName:r,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeField=function(e,t,n){"object"==typeof n&&n||Cce(!1);var r=e.alias||e.name,i=wce(e,this._variables),o=n[r],s=ace.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?pce.setLinkedRecordIDs(t,i,[]):pce.setValue(t,i,[]):pce.setValue(t,i,null);var a=this._errorTrie;if(null!=a){var l=fce(a,r);null!=l&&pce.setErrors(t,i,l)}}else if("ScalarField"===e.kind)this._validateConflictingFieldsWithIdenticalId(t,i,o),pce.setValue(t,i,o);else if("LinkedField"===e.kind){this._path.push(r);var c=this._errorTrie;this._errorTrie=null==c?null:hce(c,r),e.plural?this._normalizePluralLink(e,t,i,o):this._normalizeLink(e,t,i,o),this._errorTrie=c,this._path.pop()}else Cce(!1)},t._normalizeActorChange=function(e,t,n){var r,i=e.linkedField;"object"==typeof n&&n||Cce(!1);var o=i.alias||i.name,s=wce(i,this._variables),a=n[o];if(null!=a){var l=sce(a);if(null!=l){var c=null!==(r=i.concreteType)&&void 0!==r?r:this._getRecordType(a),u=this._getDataId(a,c)||pce.getLinkedRecordID(t,s)||lce(pce.getDataID(t),s);"string"!=typeof u&&Cce(!1),pce.setActorLinkedRecordID(t,s,l,u),this._followupPayloads.push({kind:"ActorPayload",data:a,dataID:u,path:[].concat((0,ice.default)(this._path),[o]),typeName:c,variables:this._variables,node:i,actorIdentifier:l})}else pce.setValue(t,s,null)}else{if(void 0===a){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}pce.setValue(t,s,null)}},t._normalizeLink=function(e,t,n,r){var i;"object"==typeof r&&r||Cce(!1);var o=this._getDataId(r,null!==(i=e.concreteType)&&void 0!==i?i:this._getRecordType(r))||pce.getLinkedRecordID(t,n)||lce(pce.getDataID(t),n);"string"!=typeof o&&Cce(!1),this._validateConflictingLinkedFieldsWithIdenticalId(pce.getLinkedRecordID(t,n),o,n),pce.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=pce.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)||Cce(!1);var o=pce.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:hce(c,a),"object"!=typeof r&&Cce(!1);var u=i._getDataId(r,null!==(l=e.concreteType)&&void 0!==l?l:i._getRecordType(r))||o&&o[a]||lce(pce.getDataID(t),n,a);"string"!=typeof u&&Cce(!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=pce.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)}),pce.setLinkedRecordIDs(t,n,s)},t._validateRecordType=function(e,t,n){if(ace.ENABLE_STORE_ID_COLLISION_LOGGING){var r,i=null!==(r=t.concreteType)&&void 0!==r?r:this._getRecordType(n),o=pce.getDataID(e);if(!(cce(o)&&o!==vce||pce.getType(e)===i)){var s={name:"idCollision.typename",previous_typename:pce.getType(e),new_typename:i};null!=this._log&&this._log(s)}}},t._validateConflictingFieldsWithIdenticalId=function(e,t,n){},t._validateConflictingLinkedFieldsWithIdenticalId=function(e,t,n){},e}(),Nce={normalize:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;return new Ace(e,l,r,null!=o&&o).normalizeResponse(a,s,n,i)}},Tce=Mre.default,Rce=Tce(Kre),Dce=Tce(Dle),Ice=Tce(jle),Fce=Tce(Nce);var Oce=function(e,t,n,r,i){var o,s=e.data,a=e.errors,l=Ice.default.create(),c=Dce.default.create(t.dataID,n);l.set(t.dataID,c);var u=Fce.default.normalize(l,t,s,r,a,i);return(0,Rce.default)((0,Rce.default)({},u),{},{isFinal:!0===(null===(o=e.extensions)||void 0===o?void 0:o.is_final)})},Pce=Ore.getInlineDataFragment,Mce=Fie.FRAGMENTS_KEY,Lce=wre;var zce=function(e,t){var n,r=Pce(e);if(null==t)return t;"object"!=typeof t&&Lce(!1);var i=null===(n=t[Mce])||void 0===n?void 0:n[r.name];return null==i&&Lce(!1),i},jce=1e5;var Uce=function(){return jce++},Bce=Uce;var $ce=function(e,t){return{execute:function(n,r,i,o,s,a,l,c){var u=Bce(),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)}}},qce=(0,Mre.default)(Yre),Gce=wre,Vce=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,qce.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,qce.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,qce.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,qce.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,qce.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&&Gce(!1);var s=Array.from(n.values());return this._ownersToPendingPromise.set(t,{promise:o,resolve:r,pendingOperations:s}),{promise:o,pendingOperations:s}},e}(),Kce=Vce;var Wce=function(e){var t=void 0!==k?k:"undefined"!=typeof window?window:void 0,n=t&&t.__RELAY_DEVTOOLS_HOOK__;n&&n.registerEnvironment(e)},Hce={VIEWER_ID:(0,ase.generateClientID)(Fie.ROOT_ID,"viewer"),VIEWER_TYPE:"Viewer"},Jce=Hce.VIEWER_ID,Xce=Hce.VIEWER_TYPE;var Qce=function(e,t){return t===Xce&&null==e.id?Jce:e.id},Yce=function(e){},Zce=Sre.REQUEST;var eue=function(e){return e.kind===Zce?e.operation:e};function tue(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 nue,rue,iue={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 tue.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 tue.apply(void 0,["warn",e,t].concat(r))}},oue="undefined"!=typeof window&&"function"==typeof(null===(nue=window)||void 0===nue||null===(rue=nue.performance)||void 0===rue?void 0:rue.now);function sue(){return oue?window.performance.now():Date.now()}var aue=function(e){var t=sue(),n=e();return[t,sue()-t,n]},lue=Mre.default,cue=lue(Yre),uue=lue(fie),due=xoe,fue=Uce,hue=eue,pue=iue,gue=vie,mue=yie.stableCopy,vue=aue,yue=ase.generateClientID,_ue=ase.generateUniqueClientID,bue=Lie.getLocalVariables,xue=Dle,Sue=aoe.createNormalizationSelector,wue=aoe.createReaderSelector,Eue=jle,kue=Fie,Cue=kue.ROOT_TYPE,Aue=kue.TYPENAME_KEY,Nue=kue.getStorageKey,Tue=wre;var Rue=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=fue(),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++;gue.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(Ine){v.error(Ine)}},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})}}),gue.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,Tue(!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++;due.create(function(n){var i=r.schedule(function(){try{e(),n.complete()}catch(Ine){n.error(Ine)}},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=pue.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)})&&Tue(!1),!1;var n=e[0],r=!0===(null===(t=n.extensions)||void 0===t?void 0:t.isOptimistic);return r&&"started"!==this._state&&Tue(!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||Tue(!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=_ue();this._operation={request:this._operation.request,fragment:wue(this._operation.fragment.node,u,this._operation.fragment.variables,this._operation.fragment.owner),root:Sue(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 Eue(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&&Tue(!1),null!=e||null!=t){var i=[];if(e){var o=this._normalizeResponse(e,this._operation.root,Cue,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[],shouldProcessClientComponents:this._shouldProcessClientComponents,treatMissingFieldsAsNull:n},this._useExecTimeResolvers);Due(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:Eue.create(),isFinal:!1},updater:t});this._optimisticUpdates=i,i.forEach(function(e){return r._getPublishQueueAndSaveActor().applyUpdate(e)});var s=this._runPublishQueue();gue.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,cue.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,uue.default)(a))}break;case"ActorPayload":break;default:Tue(!1)}}}catch(l){i.e(l)}finally{i.f()}}},t._normalizeFollowupPayload=function(e,t){var n;n="SplitOperation"===t.kind&&"ModuleImportPayload"===e.kind?bue(e.variables,t.argumentDefinitions,e.args):e.variables;var r=Sue(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=hue(e),r=[],i=this._normalizeFollowupPayload(t,n);return Due(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,uue.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,Cue,{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,hue(r));else{var i=this._nextSubscriptionId++;this._pendingModulePayloadsCount++;var o=function(){t._pendingModulePayloadsCount--,t._maybeCompleteSubscriptionOperationTracking()},s=due.from(new Promise(function(t,r){n.load(e.operationReference).then(t,r)}));due.create(function(n){var r,i=s.subscribe({next:function(i){if(null!=i){var o=function(){try{var r=hue(i),o=gue.BATCH_ASYNC_MODULE_UPDATES_FN,s=null!=o&&t._pendingModulePayloadsCount>1,a=vue(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(Ine){n.error(Ine)}},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:Tue(!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:Tue(!1);var c,u,d=e.source.get(s),f=(null!==(n=e.fieldPayloads)&&void 0!==n?n:[]).filter(function(e){var t=yue(e.dataID,e.fieldKey);return e.dataID===s||t===s});null==d&&Tue(!1);var h=this._source.get(s);if(null!=h){c=xue.update(h.record,d);var p=new Map,g=function(e){var t=function(e){var t;return null!==(t=JSON.stringify(mue(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&&Tue(!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&&Tue(!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&&Tue(!1);var c=l.fieldPayloads;if(0!==c.length){var u,d={errors:null,fieldPayloads:c,incrementalPlaceholders:null,followupPayloads:null,source:Eue.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)&&Tue(!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,uue.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:Eue.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&&Tue(!1);var d=null!==(s=n.alias)&&void 0!==s?s:n.name,f=Nue(n,r),h=this._source.get(t);null==h&&Tue(!1);var p=h.record,g=h.fieldPayloads,m=xue.getLinkedRecordIDs(p,f);null==m&&Tue(!1);var v=i[i.length-1],y=parseInt(v,10);y===v&&y>=0||Tue(!1);var _=null!==(a=n.concreteType)&&void 0!==a?a:u[Aue];"string"!=typeof _&&Tue(!1);var b=null!==(l=null!==(c=this._getDataID(u,_))&&void 0!==c?c:null==m?void 0:m[y])&&void 0!==l?l:yue(t,f,y);"string"!=typeof b&&Tue(!1);var x=Sue(n,b,r),S=xue.clone(p),w=(0,uue.default)(m);return w[y]=b,xue.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,uue.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,cue.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,cue.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,cue.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,cue.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||Tue(!1),e},e}();function Due(e){var t=e.incrementalPlaceholders;null!=t&&0!==t.length&&Tue(!1)}var Iue={execute:function(e){return new Rue(e)}},Fue=Promise.resolve();function Oue(e){setTimeout(function(){throw e},0)}var Pue=function(e){Fue.then(e).catch(Oue)},Mue=Dle,Lue=Ile.EXISTENT,zue=wre,jue=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:Mue.clone(t):null===n?null:null!=t?Mue.update(t,n):Mue.clone(n)},t._getSinkRecord=function(e){var t=this._sink.get(e);if(!t){var n=this._base.get(e);n||zue(!1),t=Mue.create(e,Mue.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||zue(!1);var i=this._getSinkRecord(t);r&&Mue.copyFields(r,i),n&&Mue.copyFields(n,i)},t.copyFieldsFromRecord=function(e,t){var n=this._getSinkRecord(t);Mue.copyFields(e,n)},t.create=function(e,t){(this._base.getStatus(e)===Lue||this._sink.getStatus(e)===Lue)&&zue(!1);var n=Mue.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 Mue.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=Mue.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);Mue.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=Mue.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);Mue.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=Mue.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);Mue.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=Mue.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);Mue.setLinkedRecordIDs(r,t,n)},e}(),Uue=jue,Bue=(0,Mre.default)(Yre),$ue=Fie.getArgumentValues,que=["id","__id","__typename","js"];function Gue(e,t,n,r,i,o){var s,a,l=(0,Bue.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:Wue(r,n,t,i,o),set:Vue(r,n,t,i)}):Object.defineProperty(e,null!==(d=r.alias)&&void 0!==d?d:r.name,{get:Hue(r,n,t,i,o),set:Kue(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=$ue(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,Bue.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:que.includes(r.name)?void 0:function(e){var i,o=$ue(null!==(i=r.args)&&void 0!==i?i:[],n);t.setValue__UNSAFE(e,r.name,o)}});break;case"InlineFragment":t.getType()===r.type&&Gue(e,t,n,r.selections,i,o);break;case"ClientExtension":Gue(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 Vue(e,t,n,r){return function(i){var o,s=$ue(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 Kue(e,t,n,r){return function(i){var o,s=$ue(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 Wue(e,t,n,r,i){return function(){var o,s=$ue(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,Bue.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 Gue(o,n,t,e.selections,r,i),o}return n}):a}}function Hue(e,t,n,r,i){return function(){var o,s=$ue(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,Bue.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 Gue(l,a,t,e.selections,r,i),l}return a}}var Jue={createUpdatableProxy:function(e,t,n,r,i){var o={};return Gue(o,e,t,n,r,i),o}},Xue=Ore.getFragment,Que=aoe.getVariablesFromFragment,Yue=Fie.ID_KEY,Zue=Jue.createUpdatableProxy,ede=wre;var tde={readUpdatableFragment:function(e,t,n,r){var i=Xue(e),o=Que(i,t),s=t[Yue],a=n.get(s);return null==a&&ede(!1),{updatableData:Zue(a,o,i.selections,n,r)}}},nde=Ore.getUpdatableQuery,rde=Jue.createUpdatableProxy;var ide={readUpdatableQuery:function(e,t,n,r){var i=nde(e);return{updatableData:rde(n.getRoot(),t,i.fragment.selections,n,r)}}},ode=ase.generateClientID,sde=Fie.getStableStorageKey,ade=wre,lde=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&&ade(!1),e},t.getValue=function(e,t){var n=sde(e,t);return this._mutator.getValue(this._dataID,n)},t.setValue=function(e,t,n,r){return cde(e)||ade(!1),this.setValue__UNSAFE(e,t,n,r)},t.getErrors=function(e,t){var n=sde(e,t);return this._mutator.getErrors(this._dataID,n)},t.setValue__UNSAFE=function(e,t,n,r){var i=sde(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=sde(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||ade(!1);var i=sde(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=sde(e,n),s=ode(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=sde(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)||ade(!1);var r=sde(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 cde(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every(cde)}var ude=lde,dde=Dle,fde=Ile.EXISTENT,hde=Ile.NONEXISTENT,pde=Fie,gde=pde.ROOT_ID,mde=pde.ROOT_TYPE,vde=tde.readUpdatableFragment,yde=ide.readUpdatableQuery,_de=ude,bde=wre,xde=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===fde){var i=e.get(t);i&&(n.__mutator.getStatus(t)!==fde&&n.create(t,dde.getType(i)),n.__mutator.copyFieldsFromRecord(i,t))}else r===hde&&n.delete(t)}),t&&t.length&&t.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);t||bde(!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||bde(!1),n},t.delete=function(e){e===gde&&bde(!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===fde?new _de(this,this.__mutator,e):t===hde?null:void 0}return this._proxies[e]},t.getRoot=function(){var e=this.get(gde);return e||(e=this.create(gde,mde)),e&&e.getType()===mde||bde(!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 yde(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return vde(e,t,this,this._missingFieldHandlers)},e}(),Sde=xde,wde=Sre.LINKED_FIELD,Ede=Fie.getHandleStorageKey,kde=Bie,Cde=wre;var Ade=function(e,t,n){var r=t.find(function(t){return t.kind===wde&&t.name===e.name&&t.alias===e.alias&&kde(t.args,e.args)});r&&r.kind===wde||Cde(!1);var i=Ede(e,n);return{kind:"LinkedField",alias:r.alias,name:i,storageKey:i,args:null,concreteType:r.concreteType,plural:r.plural,selections:r.selections}},Nde=Sre.SCALAR_FIELD,Tde=Fie.getHandleStorageKey,Rde=Bie,Dde=wre;var Ide=function(e,t,n){var r=t.find(function(t){return t.kind===Nde&&t.name===e.name&&t.alias===e.alias&&Rde(t.args,e.args)});r&&r.kind===Nde||Dde(!1);var i=Tde(e,n);return{kind:"ScalarField",alias:r.alias,name:i,storageKey:i,args:null}},Fde=(0,Mre.default)(Yre),Ode=Uue,Pde=Sde,Mde=eue,Lde=ase.isClientID,zde=Ade,jde=Ide,Ude=Lie.getLocalVariables,Bde=Dle,$de=Ile.EXISTENT,qde=Ile.UNKNOWN,Gde=Fie,Vde=tce.TYPE_SCHEMA_TYPE,Kde=tce.generateTypeID,Wde=wre,Hde=Gde.getModuleOperationKey,Jde=Gde.getStorageKey,Xde=Gde.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 Ode(this._getSourceForActor(e),n);t=[r,new Pde(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)||Wde(!1),this._variables[e]},t._handleMissing=function(){this._recordWasMissing=!0},t._handleMissingScalarField=function(e,t){if("id"!==e.name||null!=e.alias||!Lde(t)){var n,r=null!=e.args?Xde(e.args,this._variables):{},i=(0,Fde.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?Xde(e.args,this._variables):{},i=(0,Fde.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)===$de))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?Xde(e.args,this._variables):{},o=(0,Fde.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)===$de}))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===qde&&this._handleMissing(),n===$de){var r=this._source.get(t),i=Bde.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&&Wde(!1);var s=Kde(o),a=n._mutator.getValue(s,i);!0===a?n._traverseSelections(r.selections,t):null==a&&n._handleMissing()}break;case"LinkedHandle":var l=zde(r,e,n._variables);l.plural?n._checkPluralLink(l,t):n._checkLink(l,t);break;case"ScalarHandle":var c=jde(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=Ude(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&&Wde(!1);var p=Kde(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:Wde(!1)}})},t._checkResolver=function(e,t){e.fragment&&this._traverseSelections([e.fragment],t)},t._checkModuleImport=function(e,t){var n=this._operationLoader;null===n&&Wde(!1);var r=Hde(e.documentName),i=this._mutator.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=Mde(o),a=this._variables;this._variables=Ude(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=Jde(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=Jde(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=Jde(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=Jde(e,this._variables),r=this._source.get(t),i=null!=r?Bde.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,Fde.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=Kde(a);null==this._source.get(l)&&this._mutator.create(l,Vde),null==this._mutator.getValue(l,o)&&this._mutator.setValue(l,o,!0)}}catch(c){s.e(c)}finally{s.f()}}},e}(),Yde={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}},Zde=Dle,efe=Fie.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,tfe=wre;var nfe=function(e){var t=Zde.getValue(e,efe);return null==t?null:(t instanceof Set||tfe(!1),t)};var rfe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.read&&"function"==typeof e.subscribe},ife=(0,Mre.default)(Yre),ofe=Tae,sfe=Sre.RELAY_LIVE_RESOLVER,afe=vie,lfe=function(e){"object"!=typeof e||null==e||!Array.isArray(e)&&e.constructor!==Object||Object.freeze(e)},cfe=ase.generateClientID,ufe=ase.generateClientObjectClientID,dfe=Dle,ffe=aoe.createNormalizationSelector,hfe=jle,pfe=Nce.normalize,gfe=Fie,mfe=gfe.RELAY_RESOLVER_ERROR_KEY,vfe=gfe.RELAY_RESOLVER_INVALIDATION_KEY,yfe=gfe.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,_fe=gfe.RELAY_RESOLVER_SNAPSHOT_KEY,bfe=gfe.RELAY_RESOLVER_VALUE_KEY,xfe=gfe.getReadTimeResolverStorageKey,Sfe=gfe.getStorageKey,wfe=nfe,Efe=rfe,kfe=ole.isSuspenseSentinel,Cfe=wre,Afe="__resolverLiveStateSubscription",Nfe="__resolverLiveStateValue",Tfe="__resolverLiveStateDirty",Rfe="__RELAY_RESOLVER__";function Dfe(e,t,n){var r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}var Ife=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=zfe(s,e),l=xfe(t,n),c=dfe.getLinkedRecordID(a,l),u=null==c?null:s.get(c);if(null==u||this._isInvalid(u,i)){var d;null!=u&&Lfe(u),c=null!==(d=c)&&void 0!==d?d:cfe(e,l),u=dfe.create(c,Rfe);var f=r();if(dfe.setValue(u,_fe,f.snapshot),dfe.setValue(u,mfe,f.error),t.kind===sfe){if(null!=f.resolverResult){null!=f.error&&Cfe(!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=zfe(s,e),g=dfe.clone(p);if(dfe.setLinkedRecordID(g,l,c),s.set(e,g),null!=t.fragment){var m,v=Sfe(t.fragment,n),y=cfe(e,v);Dfe(this._resolverIDToRecordIDs,y,c),Dfe(this._recordIDToResolverIDs,e,y);var _=null===(m=f.snapshot)||void 0===m?void 0:m.seenRecords;if(null!=_){var b,x=(0,ife.default)(_);try{for(x.s();!(b=x.n()).done;){var S=b.value;Dfe(this._recordIDToResolverIDs,S,y)}}catch(R){x.e(R)}finally{x.f()}}}}else if(t.kind===sfe&&dfe.getValue(u,Tfe)){var w;c=null!==(w=c)&&void 0!==w?w:cfe(e,l),u=dfe.clone(u);var E=dfe.getValue(u,Nfe);Efe(E)||Cfe(!1),o=this._setLiveResolverValue(u,E,t,n),dfe.setValue(u,Tfe,!1),s.set(c,u)}var k,C=this._getResolverValue(u),A=dfe.getValue(u,_fe),N=dfe.getValue(u,mfe),T=null;kfe(C)&&(T=null!==(k=c)&&void 0!==k?k:cfe(e,l));return[C,c,N,A,T,o]},t.getLiveResolverPromise=function(e){var t=this._getRecordSource().get(e);null==t&&Cfe(!1);var n=dfe.getValue(t,Nfe);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);dfe.setValue(e,Nfe,n);var a=this._setLiveResolverValue(e,n,r,i);return dfe.setValue(e,Tfe,!1),dfe.setValue(e,Afe,s),a},t._makeLiveStateHandler=function(e){var t=this;return function(){var n=t._getRecordSource().get(e);if(n&&dfe.hasValue(n,Nfe)){var r=dfe.clone(n);dfe.setValue(r,Tfe,!0),t._setLiveResolverUpdate(e,r)}}},t._setLiveResolverUpdate=function(e,t){if(this._handlingBatch)null==this._liveResolverBatchRecordSource&&(this._liveResolverBatchRecordSource=hfe.create()),this._liveResolverBatchRecordSource.set(e,t);else{var n=hfe.create();n.set(e,t),this._store.publish(n),this._store.notify()}},t.batchLiveStateUpdates=function(e){this._handlingBatch&&Cfe(!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(_U){o=_U}return dfe.setValue(e,mfe,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||kfe(t))lfe(t),dfe.setValue(e,bfe,t);else{var s,a=wfe(e),l=new Set,c=this._getRecordSource();if(i.plural){Array.isArray(t)||Cfe(!1),s=[];for(var u=hfe.create(),d=0;d<t.length;d++){var f=t[d];if(null!=f){"object"!=typeof f&&Cfe(!1);var h,p=jfe(i,f),g=ufe(p,dfe.getDataID(e),d),m=this._normalizeOutputTypeValue(g,f,r,i,[n.path,String(d)],p),v=(0,ife.default)(m.getRecordIDs());try{for(v.s();!(h=v.n()).done;){var y=h.value;u.set(y,zfe(m,y)),l.add(y)}}catch(k){v.e(k)}finally{v.f()}s.push(g)}}o=Ffe(c,u,a)}else{"object"!=typeof t&&Cfe(!1);var _,b=jfe(i,t),x=ufe(b,dfe.getDataID(e)),S=this._normalizeOutputTypeValue(x,t,r,i,[n.path],b),w=(0,ife.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=Ffe(c,S,a)}dfe.setValue(e,yfe,l),lfe(s),dfe.setValue(e,bfe,s)}return o},t.notifyUpdatedSubscribers=function(e){this._store.__notifyUpdatedSubscribers(e)},t._getResolverValue=function(e){return dfe.getValue(e,bfe)},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,ife.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,ife.default)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;Ofe(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(!dfe.getValue(e,vfe))return!1;var n=dfe.getValue(e,_fe),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(ofe(r,o)!==r)return!0;if(afe.MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD){var s=dfe.clone(e);dfe.setValue(s,vfe,!1),this._getRecordSource().set(dfe.getDataID(e),s)}return!1},t._normalizeOutputTypeValue=function(e,t,n,r,i,o){var s=hfe.create();switch(r.kind){case"OutputType":var a=dfe.create(e,o);s.set(e,a);var l=ffe(r.normalizationNode,e,n),c=this._store.__getNormalizationOptions(i);return pfe(s,l,t,c,void 0,!1).source;case"WeakModel":var u=dfe.create(e,o);return dfe.setValue(u,"__relay_model_instance",t),s.set(e,u),s;default:r.kind,Cfe(!1)}},t.ensureClientRecord=function(e,t){var n=ufe(t,e),r=this._getRecordSource();if(!r.has(n)){var i=dfe.create(n,t);dfe.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,ife.default)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e.get(i);null!=o&&Mfe(o)&&Lfe(o)}}catch(s){r.e(s)}finally{r.f()}}(this._getRecordSource(),e)},t.invalidateResolverRecords=function(e){if(0!==e.size){var t,n=(0,ife.default)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this._getRecordSource().get(r);null!=i&&Mfe(i)&&this._getRecordSource().delete(r)}}catch(o){n.e(o)}finally{n.f()}}},e}();function Ffe(e,t,n){var r=new Set;if(null!=n){var i,o=(0,ife.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,ife.default)(t.getRecordIDs());try{for(l.s();!(a=l.n()).done;){var c=a.value,u=zfe(t,c);if(e.has(c)){var d=zfe(e,c),f=dfe.update(d,u);f!==d&&(r.add(c),e.set(c,f),Pfe(d,e))}else e.set(c,u)}}catch(h){l.e(h)}finally{l.f()}return r}function Ofe(e,t){var n=t.get(e);if(n){var r=dfe.clone(n);dfe.setValue(r,vfe,!0),t.set(e,r)}}function Pfe(e,t){var n,r=function(e){var t=new Set;return dfe.getFields(e).forEach(function(n){if(dfe.hasLinkedRecordID(e,n)){var r=dfe.getLinkedRecordID(e,n);null!=r&&t.add(r)}else if(dfe.hasLinkedRecordIDs(e,n)){var i;null===(i=dfe.getLinkedRecordIDs(e,n))||void 0===i||i.forEach(function(e){null!=e&&t.add(e)})}}),t}(e),i=(0,ife.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=t.get(o);null!=s&&Mfe(s)&&Ofe(o,t)}}catch(a){i.e(a)}finally{i.f()}}function Mfe(e){return dfe.getType(e)===Rfe}function Lfe(e){var t=dfe.getValue(e,Afe);null!=t&&t()}function zfe(e,t){var n=e.get(t);return null==n&&Cfe(!1),n}function jfe(e,t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;return null==r&&Cfe(!1),r}var Ufe={LiveResolverCache:Ife,getUpdatedDataIDs:function(e){return e},RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY:Afe},Bfe=(0,Mre.default)(Kre),$fe=Dle,qfe=jle,Gfe=wre,Vfe=$fe.fromObject(Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0})),Kfe=function(){function e(e){this._base=e,this._sink=qfe.create()}var t=e.prototype;return t.has=function(e){return this._sink.has(e)?this._sink.get(e)!==Vfe:this._base.has(e)},t.get=function(e){if(this._sink.has(e)){var t=this._sink.get(e);return t===Vfe?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=qfe.create(),this._sink.clear()},t.delete=function(e){this._sink.delete(e)},t.remove=function(e){this._sink.set(e,Vfe)},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,Bfe.default)({},this._base.toJSON());return this._sink.getRecordIDs().forEach(function(n){var r=e.get(n);void 0===r?delete t[n]:t[n]=$fe.toJSON(r)}),t},t.getOptimisticRecordIDs=function(){return new Set(this._sink.getRecordIDs())},e}();var Wfe={create:function(e){return new Kfe(e)},getOptimisticRecordIDs:function(e){return e instanceof Kfe||Gfe(!1),e.getOptimisticRecordIDs()}},Hfe=Sre.RELAY_LIVE_RESOLVER,Jfe=wre,Xfe=function(){function e(){}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){t.kind===Hfe&&Jfe(!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){Jfe(!1)},t.notifyUpdatedSubscribers=function(e){},e}(),Qfe={NoopResolverCache:Xfe},Yfe=Mre.default,Zfe=Yfe(Kre),ehe=Yfe(Vre),the=Yfe(ale),nhe=Yfe(fie),rhe=["message"],ihe=vie,ohe=ole.isSuspenseSentinel,she=Lie,ahe=Dle,lhe=Fie,che=lhe.CLIENT_EDGE_TRAVERSAL_PATH,uhe=lhe.FRAGMENT_OWNER_KEY,dhe=lhe.FRAGMENT_PROP_NAME_KEY,fhe=lhe.FRAGMENTS_KEY,hhe=lhe.ID_KEY,phe=lhe.MODULE_COMPONENT_KEY,ghe=lhe.ROOT_ID,mhe=lhe.getArgumentValues,vhe=lhe.getModuleComponentKey,yhe=lhe.getStorageKey,_he=Qfe.NoopResolverCache,bhe=poe.RESOLVER_FRAGMENT_ERRORED_SENTINEL,xhe=poe.withResolverContext,She=tce.generateTypeID,whe=wre;function Ehe(e,t,n,r){return new khe(e,t,null!=n?n:new _he,r).read()}var khe=function(){function e(e,t,n,r){var i,o,s,a;this._clientEdgeTraversalPath=null!==(i=t.clientEdgeTraversalPath)&&void 0!==i&&i.length?(0,nhe.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=ahe.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)||whe(!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(Che(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,the.default)(t,rhe);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,whe(!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&&whe(!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:whe(!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,whe(!1)}},t._readResolverField=function(e,t,n){var r,i=ahe.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=Ehe(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,ehe.default)({},i.name,i.args?mhe(i.args,r._variables):{})};return r._clientEdgeTraversalPath.length>0&&null!==r._clientEdgeTraversalPath[r._clientEdgeTraversalPath.length-1]&&(s[che]=(0,nhe.default)(r._clientEdgeTraversalPath)),xhe({getDataForResolverFragment:o},function(){var t=Ahe(e,r._variables,s,r._resolverContext),i=t[0],o=t[1];return{resolverResult:i,snapshot:n,error:o}})}var a=Ahe(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(Che(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&&whe(!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||ohe(l))return n[s]=l,l;if(e.linkedField.plural){var c;Array.isArray(l)||whe(!1),"ClientEdgeToClientObject"!==e.kind&&whe(!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&&whe(!1);var s=Nhe(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&&whe(!1),null!=i._readResolverFieldImpl(c,a)?a:null}return a}):l.map(function(e){return Nhe(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=Nhe(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&&whe(!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&&whe(!1);var v=m[g];if(void 0===v&&whe(!1),null==this._readResolverFieldImpl(v,f))return n[s]=null,null}this._clientEdgeTraversalPath.push(h);var y=n[s];null!=y&&"object"!=typeof y&&whe(!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=yhe(e,this._variables),s=ahe.getValue(t,o);return null===s||ihe.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=yhe(e,this._variables),s=ahe.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&&whe(!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=yhe(e,this._variables),s=ahe.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,ahe.fromObject({__id:l}),c),n[i]={__fragmentRef:c,__viewer:a},n[i]},t._readPluralLink=function(e,t,n){var r=yhe(e,this._variables),i=ahe.getLinkedRecordIDs(t,r);return(null===i||ihe.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)||whe(!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&&whe(!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=vhe(e.documentName),i=ahe.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[dhe]=e.fragmentPropName,n[phe]=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=ahe.getType(e);return null!=n&&n===t||ahe.getDataID(e)===ghe},t._createFragmentPointer=function(e,t,n){var r=n[fhe];null==r&&(r=n[fhe]={}),("object"!=typeof r||null==r)&&whe(!1),null==n[hhe]&&(n[hhe]=ahe.getDataID(t)),r[e.name]=mhe(e.args,this._variables,this._isWithinUnmatchedTypeRefinement),n[uhe]=this._owner,this._clientEdgeTraversalPath.length>0&&null!==this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1]&&(n[che]=(0,nhe.default)(this._clientEdgeTraversalPath))},t._createInlineDataOrResolverFragmentPointer=function(e,t,n){var r=n[fhe];null==r&&(r=n[fhe]={}),("object"!=typeof r||null==r)&&whe(!1),null==n[hhe]&&(n[hhe]=ahe.getDataID(t));var i={},o=this._fragmentName;this._fragmentName=e.name;var s=this._variables,a=e.args?mhe(e.args,this._variables):{};this._variables=she.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=ahe.getType(e),r=this._recordSource.get(She(n)),i=null!=r?ahe.getValue(r,t):null;return null==i&&this._markDataAsMissing("<abstract-type-hint>"),i},e}();function Che(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,Zfe.default)((0,Zfe.default)({},e),{},{handled:!0});case"missing_expected_data.log":case"missing_required_field.log":return e;default:e.kind,whe(!1)}}function Ahe(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?mhe(e.args,t):void 0;a.push(l),a.push(r),o=i.apply(null,a)}catch(_U){o=null,_U!==bhe&&(s=_U)}return[o,s]}function Nhe(e,t,n){return"string"==typeof e?e:"object"==typeof e&&null!=e&&"string"==typeof e.id?e.id:void whe(!1)}var The={read:Ehe},Rhe=(0,Mre.default)(Yre),Dhe=eue,Ihe=Ade,Fhe=nfe,Ohe=Lie.getLocalVariables,Phe=Dle,Mhe=Fie,Lhe=tce.generateTypeID,zhe=wre,jhe=Mhe.getReadTimeResolverStorageKey,Uhe=Mhe.getStorageKey,Bhe=Mhe.getModuleOperationKey;var $he=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)||zhe(!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=Phe.getType(t);(null!=i&&i===r.type||i===Mhe.ROOT_TYPE)&&n._traverseSelections(r.selections,t)}else{var o=Phe.getType(t),s=Lhe(o);n._references.add(s),n._traverseSelections(r.selections,t)}break;case"FragmentSpread":var a=n._variables;n._variables=Ohe(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=a;break;case"LinkedHandle":var l=Ihe(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=Phe.getType(t),u=Lhe(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:zhe(!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=Fhe(r);if(null!=i){var o,s=(0,Rhe.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=Phe.getResolverLinkedRecordIDs(r,c);if(null!=u){var d,f=(0,Rhe.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=Phe.getResolverLinkedRecordID(r,c);null!=p&&this._traverse(l,p)}}}}},t._traverseResolverField=function(e,t){if(!this._useExecTimeResolvers){var n=jhe(e,this._variables),r=Phe.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&&zhe(!1);var r=Bhe(e.documentName),i=Phe.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=Dhe(o),a=this._variables;this._variables=Ohe(this._variables,s.argumentDefinitions,e.args),this._traverseSelections(s.selections,t),this._variables=a}}},t._traverseLink=function(e,t){var n=Uhe(e,this._variables),r=Phe.getLinkedRecordID(t,n);null!=r&&this._traverse(e,r)},t._traversePluralLink=function(e,t){var n=this,r=Uhe(e,this._variables),i=Phe.getLinkedRecordIDs(t,r);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}(),qhe={mark:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;new $he(e,l,n,r,i,o).mark(a,s)}},Ghe=Symbol.iterator;var Vhe=function(e,t){for(var n=e[Ghe](),r=n.next();!r.done;){var i=r.value;if(t.has(i))return!0;r=n.next()}return!1},Khe=Fie.ROOT_ID,Whe=Hce.VIEWER_ID,Hhe=Symbol.iterator;var Jhe=function(e,t){for(var n=e[Hhe](),r=n.next();!r.done;){var i=r.value;if(t.has(i)&&i!==Khe&&i!==Whe)return!0;r=n.next()}return!1},Xhe=Tae,Qhe=vie,Yhe=Vhe,Zhe=Jhe,epe=The,tpe=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=epe.read(e,r.selector,t._resolverCache,t._resolverContext),o=Xhe(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&&Yhe(a.seenRecords,n);if(l||c){var u=c||!o?epe.read(e,a.selector,this._resolverCache,this._resolverContext):o;return u={data:Xhe(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||Zhe(a.seenRecords,n))?a.selector.owner:void 0}},t.size=function(){return this._subscriptions.size},e}(),npe=tpe,rpe=Mre.default,ipe=rpe(Yre),ope=rpe(Vre),spe=$le.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,ape=$le.assertInternalActorIdentifier,lpe=Pue,cpe=Yde,upe=Qce,dpe=Ufe.LiveResolverCache,fpe=Ufe.RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY,hpe=Ufe.getUpdatedDataIDs,ppe=Dle,gpe=Wfe,mpe=The,vpe=qhe,ype=npe,_pe=Fie,bpe=Fie,xpe=bpe.ROOT_ID,Spe=bpe.ROOT_TYPE,wpe=wre,Epe=function(){function e(e,t){var n,r,i,o,s,a,l,c,u=this;(0,ope.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:lpe,this._getDataID=null!==(o=null==t?void 0:t.getDataID)&&void 0!==o?o:upe,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 dpe(function(){return u._getMutableRecordSource()},this),this._resolverContext=null==t?void 0:t.resolverContext,this._storeSubscriptions=new ype(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(xpe)){var t=ppe.create(xpe,Spe);e.set(xpe,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 ape(e),u},v=null!==(a=null==t?void 0:t.getTargetForActor)&&void 0!==a?a:function(e){return ape(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}}(cpe.check(m,v,null!==(l=null==t?void 0:t.defaultActorIdentifier)&&void 0!==l?l:spe,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=mpe.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?ppe.clone(s):null!=a?ppe.clone(a):null)&&(ppe.setValue(i,_pe.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=ppe.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=ppe.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,ipe.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&&wpe(!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=gpe.create(this.getSource())},t.restore=function(){var e=this._optimisticSource;e||wpe(!1);var t=this.__log;null!=t&&t({name:"store.restore"});var n=gpe.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,ipe.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&&wpe(!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(vpe.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=ppe.getValue(b,fpe);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=hpe(e),n=this._updatedRecordIDs;this._updatedRecordIDs=t,this.notify(),this._updatedRecordIDs=n},e}();var kpe,Cpe,Ape=Epe,Npe=Fie,Tpe=Npe.ROOT_TYPE,Rpe=Npe.getStorageKey,Dpe=tde.readUpdatableFragment,Ipe=ide.readUpdatableQuery,Fpe=wre,Ope=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,Tpe)),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||Fpe(!1),r.plural!==n&&Fpe(!1),r},t.getRootField=function(e){var t=this._getRootField(this._readSelector,e,!1),n=Rpe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecord(n)},t.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),n=Rpe(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecords(n)},t.invalidateStore=function(){this.__recordSource.invalidateStore()},t.readUpdatableQuery=function(e,t){return Ipe(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return Dpe(e,t,this,this._missingFieldHandlers)},e}(),Ppe=Uue,Mpe=Sde,Lpe=Ope,zpe=vie,jpe=The,Upe=jle,Bpe=wre,$pe=void 0!==k?k:"undefined"!=typeof window?window:void 0,qpe=null!==(kpe=null==$pe||null===(Cpe=$pe.ErrorUtils)||void 0===Cpe?void 0:Cpe.applyWithGuard)&&void 0!==kpe?kpe:function(e,t,n,r,i){return e.apply(t,n)},Gpe=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))&&Bpe(!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(zpe.DISALLOW_NESTED_UPDATES&&!0===this._isRunning&&Bpe(!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 Ppe(this._store.getSource(),o),l=new Mpe(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||Bpe(!1),n.update(l,e)}),i){var c=r.fragment;null==c&&Bpe(!1),i(new Lpe(a,l,c,this._missingFieldHandlers),Vpe(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=Upe.create(),a=new Ppe(e._store.getSource(),s),l=new Mpe(a,e._getDataID,e._handlerProvider,e._missingFieldHandlers,e._log);qpe(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=Upe.create(),n=new Ppe(this._store.getSource(),t),r=new Mpe(n,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log),i=function(t){if(t.storeUpdater){var i=t.storeUpdater;qpe(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=Vpe(l,o.fragment));var d=new Lpe(n,r,o.fragment,e._missingFieldHandlers);qpe(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 Vpe(e,t){return jpe.read(e,t).data}var Kpe=Gpe,Wpe=(0,Mre.default)(Kre),Hpe=Mse,Jpe=$le.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,Xpe=$le.assertInternalActorIdentifier,Qpe=xoe,Ype=$ce,Zpe=Kce,ege=Wce,tge=Qce,nge=Yce,rge=Oce,ige=Iue,oge=Ape,sge=Kpe,age=jle,lge=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 oge(new age,{log:e.log,operationLoader:e.operationLoader,getDataID:e.getDataID,shouldProcessClientComponents:e.shouldProcessClientComponents});this.__log=null!==(n=e.log)&&void 0!==n?n:cge,this.relayFieldLogger=null!==(r=e.relayFieldLogger)&&void 0!==r?r:nge,this._defaultRenderPolicy=null!==(i=e.UNSTABLE_defaultRenderPolicy)&&void 0!==i?i:"partial",this._operationLoader=h,this._operationExecutions=new Map,this._network=Ype(this,e.network),this._getDataID=null!==(o=e.getDataID)&&void 0!==o?o:tge,this._missingFieldHandlers=null!==(s=e.missingFieldHandlers)&&void 0!==s?s:[],this._publishQueue=new sge(p,null!==(a=e.handlerProvider)&&void 0!==a?a:Hpe,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:rge,this.__setNet=function(e){return f._network=Ype(f,e)},this._operationTracker=null!==(d=e.operationTracker)&&void 0!==d?d:new Zpe,this._shouldProcessClientComponents=e.shouldProcessClientComponents,ege(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=age.create(),i=this._store.getSource(),o=this._store.check(e,{handlers:t,defaultActorIdentifier:Jpe,getSourceForActor:function(e){return Xpe(e),i},getTargetForActor:function(e){return Xpe(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,Wpe.default)((0,Wpe.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=ige.execute({actorIdentifier:Jpe,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 Xpe(e),a},scheduler:t._scheduler,shouldProcessClientComponents:t._shouldProcessClientComponents,sink:e,source:n(),getStore:function(e){return Xpe(e),l},treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,updater:s,normalizeResponse:t._normalizeResponse});return function(){return c.cancel()}})},e}();function cge(){}lge.prototype["@@RelayModernEnvironment"]=!0;var uge=lge,dge=Bse,fge=Ore.getRequest,hge=Yoe.createOperationDescriptor,pge=aoe.createReaderSelector;var gge=function(e,t){var n=fge(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=hge(n,a,l),u=(r?dge.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=pge(a.node,n,a.variables,a.owner));var l=e.lookup(a).data;s(l)}},error:o,complete:i});return{dispose:d.unsubscribe}};(0,Mre.default)(Kre);var mge=Fie;mge.getModuleComponentKey,mge.getModuleOperationKey;var vge=Object.prototype.hasOwnProperty;var yge=aoe.getDataIDsFromFragment,_ge=aoe.getSelector,bge=aoe.getVariablesFromFragment,xge=function(e){for(var t in e)if(vge.call(e,t))return!1;return!0},Sge=vie,wge=yie.stableCopy,Ege=nse.intern;var kge=function(e,t){var n=_ge(e,t),r=null==n?"null":"SingularReaderSelector"===n.kind?n.owner.identifier:"["+n.selectors.map(function(e){return e.owner.identifier}).join(",")+"]",i=bge(e,t),o=yge(e,t);if(Sge.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION){var s=void 0===o?"missing":null==o?"null":Array.isArray(o)?"["+o.join(",")+"]":o;return s=Sge.STRING_INTERN_LEVEL<=1?s:Ege(s,Sge.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+(null==i||xge(i)?"{}":JSON.stringify(wge(i)))+"/"+s}var a,l=null!==(a=JSON.stringify(o))&&void 0!==a?a:"missing";return l=Sge.STRING_INTERN_LEVEL<=1?l:Ege(l,Sge.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+JSON.stringify(wge(i))+"/"+l},Cge=wre;var Age=function(e,t){var n,r;!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)&&Cge(!1);var i=null===(r=e.metadata)||void 0===r?void 0:r.refetch;null==i&&Cge(!1);var o=i.operation.default?i.operation.default:i.operation,s=i.fragmentPathInResult;"string"==typeof o&&Cge(!1);var a=i.identifierInfo;return null!=a&&(null!=a.identifierField&&"string"!=typeof a.identifierField&&Cge(!1),null!=a.identifierQueryVariableName&&"string"!=typeof a.identifierQueryVariableName&&Cge(!1)),{fragmentRefPathInResponse:s,identifierInfo:a,refetchableRequest:o,refetchMetadata:i}},Nge=Age,Tge=wre;var Rge=function(e,t){var n,r,i=Nge(e),o=i.refetchableRequest,s=i.refetchMetadata,a=s.connection;null==a&&Tge(!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&&Tge(!1);var u=s.identifierInfo;return null!=(null==u?void 0:u.identifierField)&&"string"!=typeof u.identifierField&&Tge(!1),{connectionPathInFragmentData:l,identifierField:null==u?void 0:u.identifierField,paginationRequest:o,paginationMetadata:a,stream:!0===c.stream}},Dge=Mre.default,Ige=Dge(Vre),Fge=Dge(Kre),Oge=wre;var Pge=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)&&Oge(!1);var u=(0,Fge.default)((0,Fge.default)((0,Fge.default)({},r),i),{},(c={},(0,Ige.default)(c,a.cursor,n),(0,Ige.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)&&Oge(!1);var d=(0,Fge.default)((0,Fge.default)((0,Fge.default)({},r),i),{},(s={},(0,Ige.default)(s,l.cursor,n),(0,Ige.default)(s,l.count,t),s));return a&&a.cursor&&(d[a.cursor]=null),a&&a.count&&(d[a.count]=null),d},Mge=(0,Mre.default)(Yre),Lge=wre;var zge=function(e,t){var n,r=e,i=(0,Mge.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)||Lge(!1),r=r[o]):(("object"!=typeof r||Array.isArray(r))&&Lge(!1),r=r[o])}}catch(s){i.e(s)}finally{i.f()}return r},jge=bse,Uge=use,Bge=Wse,$ge=Hse,qge=nae,Gge=Bse,Vge=_ae,Kge=Sae,Wge=Loe,Hge=Ore,Jge=Eae,Xge=tle,Qge=rle,Yge=Lse,Zge=zce,eme=Lie,tme=aoe,nme=Fie,rme=poe,ime=Hce,ome=gge,sme=joe,ame=kge,lme=Rge,cme=Pge,ume=Cae,dme=Age,fme=$oe,hme=zge,pme=iie.handlePotentialSnapshotErrors,gme=voe,mme=Aae,vme=Tae,yme=hie,_me=vie,bme={Environment:uge,Network:uae,Observable:xoe,RecordSource:jle,ReplaySubject:Noe,Store:Ape,areEqualSelectors:tme.areEqualSelectors,createFragmentSpecResolver:Qae,createNormalizationSelector:tme.createNormalizationSelector,createOperationDescriptor:Yoe.createOperationDescriptor,createReaderSelector:tme.createReaderSelector,createRequestDescriptor:Yoe.createRequestDescriptor,getArgumentValues:nme.getArgumentValues,getDataIDsFromFragment:tme.getDataIDsFromFragment,getDataIDsFromObject:tme.getDataIDsFromObject,getNode:Hge.getNode,getFragment:Hge.getFragment,getInlineDataFragment:Hge.getInlineDataFragment,getModuleComponentKey:nme.getModuleComponentKey,getModuleOperationKey:nme.getModuleOperationKey,getPaginationFragment:Hge.getPaginationFragment,getPluralSelector:tme.getPluralSelector,getRefetchableFragment:Hge.getRefetchableFragment,getRequest:Hge.getRequest,getRequestIdentifier:fme,getSelector:tme.getSelector,getSelectorsFromObject:tme.getSelectorsFromObject,getSingularSelector:tme.getSingularSelector,getStorageKey:nme.getStorageKey,getVariablesFromFragment:tme.getVariablesFromFragment,getVariablesFromObject:tme.getVariablesFromObject,getVariablesFromPluralFragment:tme.getVariablesFromPluralFragment,getVariablesFromSingularFragment:tme.getVariablesFromSingularFragment,handlePotentialSnapshotErrors:pme,graphql:Hge.graphql,isFragment:Hge.isFragment,isInlineDataFragment:Hge.isInlineDataFragment,isRequest:Hge.isRequest,readInlineData:Zge,readFragment:rme.readFragment,MutationTypes:Gge.MutationTypes,RangeOperations:Gge.RangeOperations,ConnectionHandler:jge,VIEWER_ID:ime.VIEWER_ID,VIEWER_TYPE:ime.VIEWER_TYPE,applyOptimisticMutation:Bge,commitLocalUpdate:$ge,commitMutation:qge,fetchQuery:Vge,fetchQuery_DEPRECATED:Kge,isRelayModernEnvironment:Yge,requestSubscription:ome,ConnectionInterface:Uge,PreloadableQueryRegistry:Jge,RelayFeatureFlags:_me,DEFAULT_HANDLE_KEY:yme.DEFAULT_HANDLE_KEY,FRAGMENTS_KEY:nme.FRAGMENTS_KEY,FRAGMENT_OWNER_KEY:nme.FRAGMENT_OWNER_KEY,ID_KEY:nme.ID_KEY,REF_KEY:nme.REF_KEY,REFS_KEY:nme.REFS_KEY,ROOT_ID:nme.ROOT_ID,ROOT_TYPE:nme.ROOT_TYPE,TYPENAME_KEY:nme.TYPENAME_KEY,deepFreeze:sme,isPromise:gme,isScalarAndEqual:mme,recycleNodesInto:vme,getFragmentIdentifier:ame,getRefetchMetadata:dme,getPaginationMetadata:lme,getPaginationVariables:cme,getPendingOperationsForFragment:ume,getValueAtPath:hme,__internal:{createRelayContext:Xge,createRelayLoggingContext:Qge,getOperationVariables:eme.getOperationVariables,getLocalVariables:eme.getLocalVariables,fetchQuery:Wge.fetchQuery,fetchQueryDeduped:Wge.fetchQueryDeduped,getPromiseForActiveRequest:Wge.getPromiseForActiveRequest,getObservableForActiveRequest:Wge.getObservableForActiveRequest}},xme=Ape;const Sme=C(xme),wme=N({__proto__:null,default:Sme},[xme]);let Eme={kind:"linked",handle:(e,t,n,r)=>{let i=e.name,o=n.id;return null==t||"node"!==i||t.getType()!==bme.ROOT_TYPE?void 0:o}};let kme={make:function(e,t,n){return new bme.Store(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},makeLiveStore:function(e,t,n){return new Sme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},_makeLiveStoreCjs:function(e,t,n){return new wme(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})}};function Cme(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 Ame={make:function(e,t,n,r,i,o,s){return new bme.Environment({network:e,store:t,getDataID:n,treatMissingFieldsAsNull:r,missingFieldHandlers:void 0!==i?i.concat([Eme]):[Eme],relayFieldLogger:o,isServer:s})},findAllConnectionIds:Cme,invalidateAllOfConnection:function(e,t,n,r){let i=void 0!==r?r:[];bme.commitLocalUpdate(e,r=>{Cme(e,t,n).forEach(e=>{if(!i.includes(e))return M(R(r.get(e)),e=>{e.invalidateRecord()})})})}};var Nme=A,Tme=(0,bme.__internal.createRelayContext)(Nme),Rme={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}(Rme);var Dme=Rme.exports,Ime={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}(Ime);var Fme=Ime.exports,Ome={exports:{}},Pme={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}(Pme);var Mme=Pme.exports;!function(e){var t=Mme;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}(Ome);var Lme=Ome.exports,zme=wre;var jme=function(e,t){for(var n in t&&"object"==typeof t||zme(!1),t)if(t.hasOwnProperty(n)){var r=t[n];(!r||"object"!=typeof r&&"function"!=typeof r)&&zme(!1)}};function Ume(e){return e.displayName||e.name||"Component"}var Bme={getComponentName:Ume,getContainerName:function(e){return"Relay("+Ume(e)+")"}},$me=A.createContext({rootIsQueryRenderer:!1}),qme=(0,Mre.default)(Dme),Gme=jme,Vme=Bme.getComponentName,Kme=Bme.getContainerName,Wme=Tme,Hme=$me,Jme=wre,Xme=A,Qme=bme.getFragment,Yme=Xme.useContext;var Zme=function(e,t,n){var r=Kme(e);Gme(Vme(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=Yme(Wme);null==r&&Jme(!1);var i=Yme(Hme);return Xme.createElement(s,(0,qme.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,Xme.forwardRef(a)};var eve=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},tve=wre;var nve={assertRelayContext:function(e){return!function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&eve(e.environment)}(e)&&tve(!1),e}},rve=Mre.default,ive=rve(Dme),ove=rve(ale),sve=rve(Fme),ave=rve(Lme),lve=rve(Vre),cve=["componentRef","__relayContext","__rootIsQueryRenderer"],uve=Zme,dve=Bme.getContainerName,fve=nve.assertRelayContext,hve=Bie,pve=A,gve=bme,mve=gve.createFragmentSpecResolver,vve=gve.getDataIDsFromObject,yve=gve.isScalarAndEqual;function _ve(e,t){var n,r=dve(e);return n=function(n){function i(e){var i,o;o=n.call(this,e)||this,(0,lve.default)((0,sve.default)(o),"_handleFragmentDataUpdate",function(){var e=o.state.resolver;o.setState(function(t){return e===t.resolver?{data:t.resolver.resolve(),relayProp:bve(t.relayProp.environment)}:null})});var s=fve(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=mve(s,r,t,e,a);return o.state={data:l.resolve(),prevProps:e,prevPropsContext:s,relayProp:bve(s.environment),resolver:l},o}(0,ave.default)(i,n),i.getDerivedStateFromProps=function(e,n){var i,o=n.prevProps,s=fve(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=vve(t,o),c=vve(t,e),u=n.resolver;if(n.prevPropsContext.environment!==s.environment||!hve(l,c))return{data:(u=mve(s,r,t,e,a)).resolve(),prevPropsContext:s,prevProps:e,relayProp:bve(s.environment),resolver:u};u.setProps(e);var d=u.resolve();return d!==n.data?{data:d,prevProps:e,prevPropsContext:s,relayProp:bve(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)&&!yve(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,ove.default)(t,cve);return pve.createElement(e,(0,ive.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp}))},i}(pve.Component),(0,lve.default)(n,"displayName",r),n}function bve(e){return{environment:e}}var xve={createContainer:function(e,t){return uve(e,t,_ve)}},Sve=A,wve=bme;wve.createOperationDescriptor,wve.deepFreeze,wve.getRequest,Sve.useLayoutEffect,Sve.useState,Sve.useRef,Sve.useMemo;var Eve=(0,Mre.default)(Kre),kve=bme.getSelector;var Cve=function(e,t){var n={};return Object.keys(e).forEach(function(r){var i,o,s,a=e[r],l=t[r],c=kve(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,Eve.default)((0,Eve.default)({},n),u)}),n},Ave=(0,Mre.default)(Vre),Nve=wre,Tve=bme,Rve=Tve.__internal.fetchQuery,Dve=Tve.createOperationDescriptor,Ive=Tve.isRelayModernEnvironment,Fve=function(){function e(e){(0,Ave.default)(this,"_selectionReferences",[]),(0,Ave.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 Ive(n)?Rve(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||Nve(!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?Dve(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||Nve(!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||Nve(!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}(),Ove=Fve,Pve=Mre.default,Mve=Pve(Dme),Lve=Pve(ale),zve=Pve(Fme),jve=Pve(Lme),Uve=Pve(Vre),Bve=Pve(Kre),$ve=["componentRef"],qve=["componentRef","__relayContext","__rootIsQueryRenderer"],Gve=["componentRef","__relayContext","__rootIsQueryRenderer"],Vve=Zme,Kve=Cve,Wve=Bme.getComponentName,Hve=Bme.getContainerName,Jve=Tme,Xve=Ove,Qve=nve.assertRelayContext,Yve=Bie,Zve=wre,eye=A,tye=bme,nye=tye.ConnectionInterface,rye=tye.Observable,iye=tye.RelayFeatureFlags,oye=tye.createFragmentSpecResolver,sye=tye.createOperationDescriptor,aye=tye.getDataIDsFromObject,lye=tye.getRequest,cye=tye.getVariablesFromObject,uye=tye.isScalarAndEqual,dye="forward";function fye(e){return"function"==typeof e?{error:e,complete:e,unsubscribe:function(t){"function"==typeof e&&e()}}:e||{}}function hye(e,t,n){var r;Wve(e);var i=Hve(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&&Zve(!1),t&&Zve(!1),t=(0,Bve.default)((0,Bve.default)({},o[0]),{},{fragmentName:r}))}return n&&null===t&&Zve(!1),t||{}}(t),s=n.getConnectionFromProps||function(e){var t=e.path;return t||Zve(!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||Zve(!1);var l=n.getFragmentVariables||function(e){var t=e.count;return t||Zve(!1),function(e,n){return(0,Bve.default)((0,Bve.default)({},e),{},(0,Uve.default)({},t,n))}}(o);return r=function(r){function o(e){var n,o;o=r.call(this,e)||this,(0,Uve.default)((0,zve.default)(o),"_handleFragmentDataUpdate",function(){o.setState({data:o._resolver.resolve()})}),(0,Uve.default)((0,zve.default)(o),"_hasMore",function(){var e=o._getConnectionData();return!!(e&&e.hasMore&&e.cursor)}),(0,Uve.default)((0,zve.default)(o),"_isLoading",function(){return!!o._refetchSubscription}),(0,Uve.default)((0,zve.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,fye(t),{force:!0}).unsubscribe}}),(0,Uve.default)((0,zve.default)(o),"_loadMore",function(e,t,n){if(!o._canFetchPage("loadMore"))return{dispose:function(){}};var r=fye(t),i=o._getConnectionData();if(!i)return rye.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=nye.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===iye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?o._resolver=oye(s,i,t,e,a):o._resolver=oye(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,jve.default)(o,r);var c=o.prototype;return c.componentDidMount=function(){this._isUnmounted=!1,!0===iye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},c.componentDidUpdate=function(e,t){!0===iye.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=aye(t,this.props),l=aye(t,e),c=Kve(t,this.props),u=Kve(t,e);o.environment===this.state.prevContext.environment&&Yve(c,u)&&Yve(a,l)?this._hasFetched||this._resolver.setProps(e):(this._cleanup(),!0===iye.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?this._resolver=oye(o,i,t,e,s):this._resolver=oye(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)&&!uye(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,Lve.default)(e,$ve),n=(0,Bve.default)((0,Bve.default)({},t),this.state.data),r=s(n);if(null==r)return null;var i=nye.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&&Zve(!1);var h=r[o],p=r[l];if(null==h||null==p)return null;Array.isArray(h)||Zve(!1),"object"!=typeof p&&Zve(!1);var g=a===dye?p[c]:p[u],m=a===dye?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 Xve),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,Lve.default)(a,qve),d=(0,Bve.default)((0,Bve.default)({},u),this.state.data),f=Kve(t,u);c=cye(t,u),c=(0,Bve.default)((0,Bve.default)((0,Bve.default)({},f),c),this._refetchVariables);var h=n.getVariables(d,{count:e.count,cursor:e.cursor},c);("object"!=typeof h||null===h)&&Zve(!1),h=(0,Bve.default)((0,Bve.default)({},h),this._refetchVariables),c=(0,Bve.default)((0,Bve.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=lye(n.query),m=sye(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 rye.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();Yve(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,Lve.default)(t,Gve);return eye.createElement(Jve.Provider,{value:this.state.contextForChildren},eye.createElement(e,(0,Mve.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp})))},o}(eye.Component),(0,Uve.default)(r,"displayName",i),r}var pye={createContainer:function(e,t,n){return Vve(e,t,function(e,t){return hye(e,t,n)})}},gye=Mre.default,mye=(gye(Kre),gye(Fme),gye(Lme),gye(Vre),A),vye=bme;vye.createOperationDescriptor;vye.deepFreeze;vye.getRequest;mye.Component;var yye=Mre.default,_ye=yye(Dme),bye=yye(ale),xye=yye(Kre),Sye=yye(Fme),wye=yye(Lme),Eye=yye(Vre),kye=["componentRef","__relayContext","__rootIsQueryRenderer"],Cye=Zme,Aye=Cve,Nye=Bme.getContainerName,Tye=Tme,Rye=Ove,Dye=nve.assertRelayContext,Iye=Bie,Fye=A,Oye=bme,Pye=Oye.Observable,Mye=Oye.createFragmentSpecResolver,Lye=Oye.createOperationDescriptor,zye=Oye.getDataIDsFromObject,jye=Oye.getRequest,Uye=Oye.getVariablesFromObject,Bye=Oye.isScalarAndEqual;function $ye(e,t){return{environment:e,refetch:t}}var qye={createContainer:function(e,t,n){return Cye(e,t,function(e,t){return function(e,t,n){var r,i=Nye(e);return r=function(r){function o(e){var o,s;s=r.call(this,e)||this,(0,Eye.default)((0,Sye.default)(s),"_handleFragmentDataUpdate",function(){var e=s.state.resolver;s.setState(function(t){return e===t.resolver?{data:t.resolver.resolve()}:null})}),(0,Eye.default)((0,Sye.default)(s),"_refetch",function(e,r,i,o){if(s._isUnmounted)return{dispose:function(){}};var a=Dye(s.props.__relayContext).environment,l=Aye(t,s.props),c="function"==typeof e?e(s._getFragmentVariables()):e;c=(0,xye.default)((0,xye.default)({},l),c);var u=r?(0,xye.default)((0,xye.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=jye(n),g=Lye(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),Pye.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,xye.default)((0,xye.default)({},h),{},{start:function(e){s._refetchSubscription=f=e,h.start&&h.start(e)}})),{dispose:function(){f&&f.unsubscribe()}})});var a=Dye(e.__relayContext),l=null!==(o=e.__rootIsQueryRenderer)&&void 0!==o&&o;s._refetchSubscription=null;var c=Mye(a,i,t,e,l);return s.state={data:c.resolve(),localVariables:null,prevProps:e,prevPropsContext:a,contextForChildren:a,relayProp:$ye(a.environment,s._refetch),resolver:c},s._isUnmounted=!1,s}(0,wye.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=Dye(e.__relayContext),a=null!==(r=e.__rootIsQueryRenderer)&&void 0!==r&&r,l=zye(t,o),c=zye(t,e),u=Aye(t,o),d=Aye(t,e),f=n.resolver;if(n.prevPropsContext.environment!==s.environment||!Iye(u,d)||!Iye(l,c))return{data:(f=Mye(s,i,t,e,a)).resolve(),localVariables:null,prevProps:e,prevPropsContext:s,contextForChildren:s,relayProp:$ye(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)&&!Bye(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 Uye(t,this.props)},s._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new Rye),this._queryFetcher},s.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,bye.default)(t,kye),i=this.state,o=i.relayProp,s=i.contextForChildren;return Fye.createElement(Tye.Provider,{value:s},Fye.createElement(e,(0,_ye.default)({},r,this.state.data,{ref:n,relay:o})))},o}(Fye.Component),(0,Eye.default)(r,"displayName",i),r}(e,t,n)})}};A.createContext({wrapPrepareQueryResource:function(e){return e()}});var Gye=Tme,Vye=wre,Kye=A.useContext;var Wye=function(){var e=Kye(Gye);return null==e&&Vye(!1),e.environment},Hye=A;Hye.useContext,Hye.useEffect;(0,Mre.default)(Kre);var Jye=bme;Jye.__internal.fetchQueryDeduped,Jye.Observable,Jye.PreloadableQueryRegistry,Jye.ReplaySubject,Jye.createOperationDescriptor,Jye.getRequest,Jye.getRequestIdentifier;A.useMemo;var Xye=wre,Qye=function(){function e(e){this._capacity=e,this._capacity>0||Xye(!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 Yye={create:function(e){return new Qye(e)}},Zye=(0,Mre.default)(Vre),e_e=function(){function e(e){var t=this;(0,Zye.default)(this,"_retainCount",0),(0,Zye.default)(this,"_retainDisposable",null),(0,Zye.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}(),t_e=Mre.default,n_e=t_e(Kre),r_e=t_e(Vre),i_e=Yye,o_e=e_e,s_e=wre,a_e=bme.isPromise,l_e="store-or-network",c_e="store-and-network",u_e="function"==typeof WeakMap;function d_e(e){return void 0!==e.request.node.params.metadata.live}function f_e(e,t,n,r,i){var o=null!=n?n:d_e(t)?c_e:l_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 h_e(e,t){var n={__id:e.fragment.dataID,__fragments:(0,r_e.default)({},e.fragment.node.name,e.request.variables),__fragmentOwner:e.request};return{cacheIdentifier:t,fragmentNode:e.request.node.fragment,fragmentRef:n,operation:e}}var p_e=2e5;function g_e(e,t,n,r,i,o){var s=d_e(t),a=r,l=i,c=new o_e(function(e){var n=e.retain(t);return{dispose:function(){s&&null!=l&&l.unsubscribe(),n.dispose(),o(u)}}}),u={cacheIdentifier:e,id:p_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 m_e=function(){function e(e){var t=this;(0,r_e.default)(this,"_clearCacheEntry",function(e){t._cache.delete(e.cacheIdentifier)}),this._environment=e,this._cache=i_e.create(1e3)}var t=e.prototype;return t.prepare=function(e,t,n,r,i,o,s){var a=f_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:d_e(t)?c_e:l_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,n_e.default)((0,n_e.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(a_e(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=f_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=g_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=h_e(t,e),v=g_e(e,t,d,m,null,this._clearCacheEntry);this._cache.set(e,v)}if(a){var y,_=h_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,n_e.default)((0,n_e.default)({},n),{},{unsubscribe:function(){d_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=g_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&&s_e(!1),u.__log({name:"queryresource.fetch",resourceID:w.id,operation:t,profilerContext:o,fetchPolicy:r,renderPolicy:i,queryAvailability:d,shouldFetch:a}),w},e}();var v_e=u_e?new WeakMap:new Map;var y_e={getQueryResourceForEnvironment:function(e){var t=v_e.get(e);if(t)return t;var n=function(e){return new m_e(e)}(e);return v_e.set(e,n),n},getQueryCacheIdentifier:f_e};A.useMemo;var __e=A;__e.useCallback,__e.useEffect;var b_e=A,x_e=(0,bme.__internal.createRelayLoggingContext)(b_e),S_e=A.useContext;var w_e=function(){return S_e(x_e)},E_e=Mre.default,k_e=E_e(Kre),C_e=E_e(Yre),A_e=E_e(fie),N_e=y_e.getQueryResourceForEnvironment,T_e=Wye,R_e=w_e,D_e=wre,I_e=A;I_e.useDebugValue;var F_e=I_e.useEffect,O_e=I_e.useMemo,P_e=I_e.useRef,M_e=I_e.useState,L_e=bme,z_e=L_e.__internal,j_e=z_e.fetchQuery,U_e=z_e.getPromiseForActiveRequest,B_e=L_e.RelayFeatureFlags,$_e=L_e.areEqualSelectors,q_e=L_e.createOperationDescriptor,G_e=L_e.getPendingOperationsForFragment,V_e=L_e.getSelector,K_e=L_e.getVariablesFromFragment,W_e=L_e.handlePotentialSnapshotErrors,H_e=L_e.recycleNodesInto;function J_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=H_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=H_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&&D_e(!1),[s,{kind:"plural",snapshots:a,epoch:n}]}function X_e(e,t,n,r,i){var o=K_e(t,n),s=(0,k_e.default)((0,k_e.default)({},o),{},{id:r.clientEdgeDestinationID}),a=q_e(r.request,s,null==i?void 0:i.networkCacheConfig);return[N_e(e).prepare(a,j_e(e,a),null==i?void 0:i.fetchPolicy),U_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 Y_e=function(e,t,n,r){var i,o,s=O_e(function(){return V_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)||D_e(!1):Array.isArray(t)&&D_e(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||D_e(!1);var l,c=T_e();B_e.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=R_e());var u=M_e(function(){return Q_e(c,s)}),d=u[0],f=u[1],h=d,p=M_e(h),g=p[0],m=p[1],v=g,y=M_e(s),_=y[0],b=y[1],x=M_e(c),S=x[0],w=x[1];if(!$_e(s,_)||c!==S){b(s),w(c);var E=Q_e(c,s);f(E),m(E),h=E,v=E}var k=P_e(!1);if(F_e(function(){k.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||B_e.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var C=O_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,C_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,C_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,C_e.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=X_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);F_e(function(){var e=N_e(c);if(null!=A&&A.length){var t,n=[],r=(0,C_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,C_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,C_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(B_e.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==S||!k.current||!$_e(k.current,s)){null==s&&D_e(!1);var R="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,D=G_e(c,e,R);if(D)throw D.promise}}!function(e,t,n){if("singular"===t.kind)W_e(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,C_e.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;W_e(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var I,F=P_e(!1);if(F_e(function(){var e=v,t=J_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=J_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=J_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,A_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,C_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=J_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=O_e(function(){return"bailout"===h.kind?L?null:[]:("plural"!==h.kind&&D_e(!1),h.snapshots.map(function(e){return e.data}))},[h,L])}else"bailout"===h.kind?I=null:("singular"!==h.kind&&D_e(!1),I=h.snapshot.data);return B_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},Z_e=Mre.default,ebe=Z_e(Kre),tbe=Z_e(Yre),nbe=Z_e(fie),rbe=y_e.getQueryResourceForEnvironment,ibe=Wye,obe=w_e,sbe=wre,abe=A;abe.useDebugValue;var lbe=abe.useEffect,cbe=abe.useMemo,ube=abe.useRef,dbe=abe.useState,fbe=bme,hbe=fbe.__internal,pbe=hbe.fetchQuery,gbe=hbe.getPromiseForActiveRequest,mbe=fbe.RelayFeatureFlags,vbe=fbe.areEqualSelectors,ybe=fbe.createOperationDescriptor,_be=fbe.getPendingOperationsForFragment,bbe=fbe.getSelector,xbe=fbe.getVariablesFromFragment,Sbe=fbe.handlePotentialSnapshotErrors,wbe=fbe.recycleNodesInto;function Ebe(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=wbe(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=wbe(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&&sbe(!1),[s,{kind:"plural",snapshots:a,epoch:n,selector:t.selector,environment:t.environment}]}function kbe(e,t,n,r,i){var o=xbe(t,n),s=(0,ebe.default)((0,ebe.default)({},o),{},{id:r.clientEdgeDestinationID}),a=ybe(r.request,s,null==i?void 0:i.networkCacheConfig),l=rbe(e).prepare(a,pbe(e,a),null==i?void 0:i.fetchPolicy),c=gbe(e,a.request);return null!=c&&null==c.displayName&&(c.displayName=r.request.params.name),[l,c]}function Cbe(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=Ebe(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=Ebe(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,nbe.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,tbe.default)(i);try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}}}function Abe(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 Nbe=function(e,t,n,r){var i,o,s=cbe(function(){return bbe(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)||sbe(!1):Array.isArray(t)&&sbe(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||sbe(!1);var l,c=ibe();mbe.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=obe());var u=dbe(function(){return Abe(c,s)}),d=u[0],f=u[1],h=d,p=h.environment;if(!vbe(s,h.selector)||c!==h.environment){var g=Abe(c,s);f(g),h=g}var m=ube(!1);if(lbe(function(){m.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||mbe.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var v=cbe(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,tbe.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,tbe.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,tbe.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=kbe(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}lbe(function(){var e=rbe(c);if(null!=y&&y.length){var t,n=[],r=(0,tbe.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,tbe.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,tbe.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(mbe.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==p||!m.current||!vbe(m.current,s)){null==s&&sbe(!1);var w="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,E=_be(c,e,w);if(E)throw E.promise}}!function(e,t,n){if("singular"===t.kind)Sbe(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,tbe.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;Sbe(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var k,C=ube(null);if(lbe(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=Ebe(h.environment,h);if(null!==n){var r=n[0],i=n[1];if(r)return void f(i);t=i}var o=Cbe(h.environment,t,f);C.current={dispose:o,selector:h.selector,environment:h.environment}}},[h]),lbe(function(){if(null==C.current&&"bailout"!==h.kind){var e=Cbe(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=cbe(function(){return"bailout"===h.kind?A?null:[]:("plural"!==h.kind&&sbe(!1),h.snapshots.map(function(e){return e.data}))},[h,A])}else"bailout"===h.kind?k=null:("singular"!==h.kind&&sbe(!1),k=h.snapshot.data);return mbe.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},Tbe=Mre.default;Tbe(Y_e),Tbe(Nbe);var Rbe=A;Rbe.useContext,Rbe.useEffect,Rbe.useState,Rbe.useRef,A.useState;var Dbe=A,Ibe=bme;Ibe.createOperationDescriptor,Ibe.getRequest,Dbe.useMemo,bme.__internal.fetchQuery,(0,Mre.default)(Kre);var Fbe=A;Fbe.useEffect,Fbe.useRef,(0,Mre.default)(Yre);var Obe=A;Obe.useCallback,Obe.useEffect,Obe.useRef,Obe.useState,A.useDebugValue,bme.getFragment,(0,Mre.default)(Kre);var Pbe=A;bme.commitMutation,Pbe.useState,Pbe.useEffect,Pbe.useRef,Pbe.useCallback;var Mbe=bme;Mbe.ConnectionInterface,Mbe.getValueAtPath;var Lbe=A,zbe=bme;zbe.__internal.getObservableForActiveRequest,zbe.getSelector,Lbe.useEffect,Lbe.useState,Lbe.useMemo,(0,Mre.default)(Kre);var jbe=A;jbe.useCallback,jbe.useRef,jbe.useState;var Ube=bme;Ube.__internal.fetchQuery,Ube.createOperationDescriptor,Ube.getPaginationVariables,Ube.getRefetchMetadata,Ube.getSelector,(0,Mre.default)(Kre);var Bbe=A;Bbe.useCallback,Bbe.useEffect,Bbe.useState;var $be=bme;$be.__internal.fetchQuery,$be.RelayFeatureFlags,$be.createOperationDescriptor,$be.getPaginationVariables,$be.getRefetchMetadata,$be.getSelector;var qbe=Mre.default;qbe(Kre),qbe(Yre);var Gbe=bme;Gbe.__internal.fetchQuery,Gbe.RelayFeatureFlags,Gbe.createOperationDescriptor,Gbe.getPendingOperationsForFragment,Gbe.getSelector,Gbe.getVariablesFromFragment,Gbe.handlePotentialSnapshotErrors,(0,Mre.default)(Yre);var Vbe=A;Vbe.useCallback,Vbe.useEffect,Vbe.useInsertionEffect,Vbe.useRef,Vbe.useState,bme.getRequest,(0,Mre.default)(Yre);var Kbe=A;Kbe.useCallback,Kbe.useEffect,Kbe.useRef,Kbe.useState;var Wbe=bme;Wbe.RelayFeatureFlags,Wbe.getRequest,(0,Mre.default)(Kre);var Hbe=A;Hbe.useCallback,Hbe.useContext,Hbe.useReducer;var Jbe=bme;Jbe.__internal.fetchQuery,Jbe.createOperationDescriptor,Jbe.getFragmentIdentifier,Jbe.getRefetchMetadata,Jbe.getSelector,Jbe.getValueAtPath,(0,Mre.default)(Kre);var Xbe=A;Xbe.useCallback,Xbe.useDebugValue,Xbe.useState;var Qbe=bme;Qbe.RelayFeatureFlags,Qbe.getFragment,Qbe.getFragmentIdentifier,Qbe.getPaginationMetadata,(0,Mre.default)(Kre);var Ybe=A;Ybe.useCallback,Ybe.useDebugValue,Ybe.useEffect,Ybe.useLayoutEffect,Ybe.useMemo,Ybe.useRef,Ybe.useState;var Zbe=bme;Zbe.getFragment,Zbe.getFragmentIdentifier,Zbe.getPaginationMetadata;var exe=bme;exe.ConnectionInterface,exe.RelayFeatureFlags,exe.getSelector,exe.getValueAtPath,A.useDebugValue;var txe=bme.__internal;txe.fetchQueryDeduped,txe.fetchQuery,A.useDebugValue,bme.getFragment;var nxe=A;nxe.useEffect,nxe.useRef,A.useEffect,bme.requestSubscription;var rxe=Tme,ixe=xve,oxe=pye,sxe=qye,axe=bme,lxe={ConnectionHandler:axe.ConnectionHandler,MutationTypes:axe.MutationTypes,RangeOperations:axe.RangeOperations,ReactRelayContext:rxe,applyOptimisticMutation:axe.applyOptimisticMutation,commitLocalUpdate:axe.commitLocalUpdate,commitMutation:axe.commitMutation,createFragmentContainer:ixe.createContainer,createPaginationContainer:oxe.createContainer,createRefetchContainer:sxe.createContainer,fetchQuery_DEPRECATED:axe.fetchQuery_DEPRECATED,graphql:axe.graphql,readInlineData:axe.readInlineData,requestSubscription:axe.requestSubscription,fetchQuery:axe.fetchQuery};let cxe={make:function(e){let t=lxe.ReactRelayContext.Provider;return c(t,{value:{environment:e.environment},children:e.children})}},uxe=cxe;let dxe=function(e){let t=e.config,n=Dq(),r=p(()=>function(e,t,n){return Ame.make(bme.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 fte(f)&&n(),f}),kme.make(new bme.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(uxe.make,{environment:r,children:e.children})};function fxe(e){return"var("+e+")"}let hxe=co([ui("background",fxe(_t.surfaceElevated)),ui("border","1px solid var("+_t.border+")"),ui("border-radius",fxe(St.md)),ui("padding",fxe(bt.lg)),gi("flex"),mi("column"),di("center"),xi("center"),ui("gap",fxe(bt.sm)),ui("min-height","160px"),$i("center"),Vi({NAME:"percent",VAL:100}),ui("box-sizing","border-box")]),pxe=co([ui("font-size","32px"),ui("line-height","1"),Ri(to(4))]),gxe=co([ui("color",fxe(_t.textPrimary)),ui("font-size",fxe(xt.sizeMd)),ui("font-weight",fxe(xt.weightMedium)),Ri(to(4))]),mxe=co([ui("color",fxe(_t.textSecondary)),ui("font-size",fxe(xt.sizeSm)),ui("line-height",fxe(xt.lineHeightNormal))]),vxe=co([ui("color",fxe(_t.textDisabled)),ui("font-size",fxe(xt.sizeXs)),ui("font-family",fxe(xt.fontFamilyMono)),Ti(to(8))]);let yxe=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:pxe}),i("div",{children:t.title,className:gxe}),i("div",{children:t.description,className:mxe}),i("div",{children:t.extensionPackage,className:vxe})],className:hxe})},_xe=co([gi("flex"),di("center"),xi("center"),ui("min-height","160px"),ui("color","var("+_t.textSecondary+")"),ui("font-size","var("+xt.sizeSm+")")]);function bxe(e){return i("div",{children:"Loading…",className:_xe})}co([gi("flex"),di("center"),xi("center"),ui("min-height","160px"),ui("color","var("+_t.error+")"),ui("font-size","var("+xt.sizeSm+")")]);let xxe=function(e){let t=gG(),n=function(e){let t=d(uV);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(bxe,{})}):i(yxe,{definition:n})};let Sxe=function(e){let t=function(e){let t=d(uV);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(xxe,{fragmentId:e.fragmentId,props:n},e.fragmentId)),style:{display:"flex",flexDirection:"column",gap:"1rem"}}):null};let wxe=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(Sxe,{name:"platform-summary"})],style:{display:"flex",fontFamily:"system-ui",padding:"1.5rem",flexDirection:"column",gap:"1.5rem"}})},Exe={fragmentId:"host.home",title:"Home",menuEntry:{label:"Home",icon:void 0,group:void 0,sortOrder:0},requiredAccess:void 0,url:"/"};let kxe=function(e){let t=e.config,n=d(lG),r=AV(),o=dG(),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([Exe])),M(r,e=>e.register([Be(ze(e=>e),i(wxe,{}))],{})))},[]),a(()=>{if((""===s||"/"===s)&&0!==o.length)if(void 0!==l)J(l);else if(t.autoRedirectFirstPage){let e=o.find(e=>!!$(e.url)&&fG(e));if(void 0!==e){let t=e.url;void 0!==t&&J(t)}}},[o.length,s]),null};function Cxe(e,t){return j(j(ht(e),e=>Xe(e,t)),ht)}function Axe(e){let t=Cxe(e,"Upload_Release");return void 0!==t?vt(j(Xe(t,"released"),gt),!0)?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:U(j(Xe(t,"reason"),dt),"Could not release the uploaded file")}:{TAG:"Error",_0:"Could not release the uploaded file"}}function Nxe(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}",Ze([["store",t],["fileName",n.name],["contentType",i]])).then(e=>{let t=function(e){return j(Cxe(e,"Upload_Presign"),e=>{let t=j(Xe(e,"uploadUrl"),dt),n=j(Xe(e,"storageRef"),dt);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}",Ze([["store",t],["storageRef",n]])).then(Axe),e=>Promise.resolve({TAG:"Error",_0:"Release request failed"}))}}let Txe={pages:[],panels:[],routes:[]};function Rxe(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 Dxe(e){return i("div",{children:"Loading…",style:{fontFamily:"system-ui",padding:"2rem"}})}function Ixe(e){let t=e.extensions,n=d(lG),r=d(uV),i=AV();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 Fxe(e){let t=e.uiHints,n=e.config,s=function(){let e=d(yV).routes;return p(()=>Me(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(_V),c=function(e){let t=e.appName,n=e.platformName;return void 0!==t&&""!==t.trim()?t.trim():void 0!==n&&""!==n.trim()?lt(n):"Reventless"}(n),u=r(o,{children:[i(Yne,{}),i(UV,{}),i(Zq,{})]});return a(()=>{document.title=c},[c]),r(o,{children:[i(kxe,{config:n}),i(Cne,{config:n,uiHints:t}),i(Ixe,{extensions:e.extensions}),i(cV,{appName:c,logoUrl:n.logoUrl,router:s,headerSlot:u,fallback:i(Fne,{config:n,uiHints:t}),routesReady:l,loading:i(Dxe,{})})]})}function Oxe(e){let t=e.discoverPlatforms,n=pV(se(void 0));if(void 0===n)return void 0!==t?i(JV,{discover:t}):i(Rxe,{message:"config.json sets mode = fleet but the app supplied no discoverPlatforms adapter to ShellApp"});let r=n[0];return i(mV,{scope:r,children:i(ne,{value:{prefix:hV(r),path:n[1]},children:i(Fxe,{config:e.config,extensions:e.extensions,uiHints:e.uiHints})})})}function Pxe(e){let t=e.access;return i(mG,{access:t,children:i(uG,{children:i(fV,{access:t,children:i(CV,{children:i(Va,{children:i(WI.Provider.make,{children:i(dne,{children:e.children})})})})})})})}function Mxe(e){let t,n=e.uiHints,r=e.extensions,o=e.config,s=Dq();if("Single"===o.mode){let e=o.environment,s=o.platformName;t=void 0!==e&&void 0!==s?i(mV,{scope:{environment:e,platformName:s},children:i(Fxe,{config:o,extensions:r,uiHints:n})}):i(Fxe,{config:o,extensions:r,uiHints:n})}else t=i(Oxe,{config:o,extensions:r,uiHints:n,discoverPlatforms:e.discoverPlatforms});if("Anonymous"===o.authMode)return i(Pxe,{access:o.accessTiers,children:t});if(void 0===s)return i(oG,{});let a=s.identity;return void 0!==a&&s.isAuthenticated?i(Pxe,{access:a.groups.concat(o.accessTiers),children:t}):i(oG,{})}function Lxe(e){let t=e.config,n=Dq();!function(e){We.contents=e}(t.assetOrigins);let o,s=se(void 0),l=t.mode;o="Single"===l?void 0:z(pV(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=HO(e);return XO(t)&&r(),Promise.resolve(t)})}}(t.apiEndpoint,t.platformApiEndpoint,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),r=void 0!==o?(i=VV(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[QO(r),r]},[t,n,c]),d=u[0],f=h(d);f.current=d,wI.contents=d,a(()=>{let e={};xre(t=>(t=>{let n=e[t];if(void 0!==n)return n;let r=Nxe(()=>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(CI,{execute:d,executeResult:u[1],children:i(dxe,{config:t,children:r(wO,{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(Zne,{config:t,onChange:e.reloadUiHints}),i(oO,{initialPreset:g,children:i(Mxe,{config:t,extensions:e.extensions,uiHints:e.uiHints,discoverPlatforms:e.discoverPlatforms})})]})})},m)}function zxe(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(IF):(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 jxe(e){let t=e.extensions,n=e.config,r=zxe(n,t),o=r[0];return i(Rq,{authMode:n.authMode,apiEndpoint:n.apiEndpoint,cognitoClientId:n.identityProviderClientId,cognitoUserPoolId:n.identityProviderId,region:n.region,children:void 0!==o?i(Lxe,{config:n,extensions:t,uiHints:o,reloadUiHints:r[1],discoverPlatforms:e.discoverPlatforms}):i(Dxe,{})})}let Uxe=function(e){let t=e.registerModes,n=e.extensions,r=void 0!==n?n:Txe,o=s(()=>"LoadingConfig"),l=o[1],c=o[0];return a(()=>{ce(fetch("/config.json").then(e=>e.ok?e.json().then(GO):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(Dxe,{}):"Ready"===c.TAG?i(jxe,{config:c._0,extensions:r,discoverPlatforms:e.discoverPlatforms}):i(Rxe,{message:c._0})},Bxe=document.querySelector("#root");if(null!=Bxe){n(Bxe).render(i(Uxe,{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-DGegk7zB.js"),__vite__mapDeps([1,2])).then(e=>e.init);r(n.graphLayout,void 0);let i=await t(()=>import("./StateMachineDiagram.res-c41yVijg.js"),__vite__mapDeps([3,2])).then(e=>e.init);return i();case"map":let o=await t(()=>import("./MapMode.res-DTUdhw9P.js"),__vite__mapDeps([4])).then(e=>e.init),s=await t(()=>import("./Geocoder.res-D08F-J-U.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,AQ as C,fe as D,_t as E,bt as F,xt as G,ba as H,ht as I,R as J,$ as K,ft as L,gD as M,$D as N,wI as O,NP as P,CP as Q,St as R,CQ as S,NQ as T,a7 as a,Xe as b,_Q as c,ge as d,me as e,M as f,U as g,lt as h,Is as i,tI as j,nI as k,xa as l,dt as m,j as n,XZ as o,KZ as p,pt as q,YI as r,yQ as s,JZ as t,L as u,WZ as v,rF as w,Ze as x,tO as y,T as z};