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

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.
@@ -0,0 +1,11 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BsvJS9sj.js","assets/GraphMode.res-DCY-ySmR.js","assets/GraphView.res-BwPEUtlZ.js","assets/StateMachineDiagram.res-C7eML_uK.js","assets/MapMode.res-Bdm4mDHW.js","assets/Geocoder.res-CDDxpwqX.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 b,o as _,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 be(e,t){let n=parseInt(e);return Number.isNaN(n)||n>2147483647||n<-2147483648?void 0:0|n}function _e(e,t){if(0===e)return t;let n={hd:e.hd,tl:0};return(function(e,t){for(;;){let n=t,r=e;if(0===r)return n;let i={hd:r.hd,tl:0};n.tl=i,t=i,e=r.tl}}(e.tl,n)).tl=t,n}function 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(_e(e.matched,0));if("Match"===r.TAG){let n=r._0;t=r._1,e=e=>i({hd:n,tl:e});continue}let o=r._1,s=r._0.to_;return e=>n(t=>i({hd:s(e),tl:t}),o)}};return n(t=>e("/"+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 bt={background:"--rv-color-background",surface:"--rv-color-surface",surfaceSubtle:"--rv-color-surface-subtle",surfaceElevated:"--rv-color-surface-elevated",brand:"--rv-color-brand",brandSubtle:"--rv-color-brand-subtle",success:"--rv-color-success",warning:"--rv-color-warning",error:"--rv-color-error",info:"--rv-color-info",textPrimary:"--rv-color-text-primary",textSecondary:"--rv-color-text-secondary",textDisabled:"--rv-color-text-disabled",textOnBrand:"--rv-color-text-on-brand",border:"--rv-color-border",borderSubtle:"--rv-color-border-subtle"},_t={xs:"--rv-spacing-xs",sm:"--rv-spacing-sm",md:"--rv-spacing-md",lg:"--rv-spacing-lg",xl:"--rv-spacing-xl",xxl:"--rv-spacing-xxl"},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}}};function Nt(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 Tt(e){let t=Nt(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 Rt(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 Dt(e,t,n){if(void 0===n)return e;let r=Rt(t,n);return e.filter(e=>{let t=e.allowedStates;return void 0===t||void 0!==r&&t.includes(r)})}let It="x-reventless-union",Ft="x-reventless-union-member";function Ot(e){let t,n=Xe(e,It);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 Pt(e){return j(j(Xe(e,Ft),dt),e=>""===e?void 0:e)}function Mt(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:Pt(e),properties:Ze(Qe(t).filter(e=>"TAG"!==e[0]))}))))}function Lt(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 Lt(n[0]);if(0===r)return;let i=me(n,Mt);return i.length===n.length?{name:Ot(e),arms:i}:void 0})))}function zt(e,t){let n=t.memberType;return void 0!==n?n:z(e.name,e=>e+t.tag)}function jt(e,t){let n=e.arms.find(n=>n.tag===t||vt(zt(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 Ut(e){return Ze([["type","object"],["properties",e.properties]])}function Bt(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||$(Lt(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")))),Bt),e)}function $t(e){return j(ht(Bt(e)),e=>{if("array"===j(Xe(e,"type"),dt))return z(Xe(e,"items"),Bt)})}function qt(e){let t=parseFloat(e);return Number.isNaN(t)?void 0:t}function Gt(e){return z(e.plugin,t=>t+"."+e.store)}let Vt={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,memberTarget:void 0,channel:void 0,setter:void 0,retired:void 0};function Kt(e,t){let n=z(Xe(e,t),ut);return"JSONTrue"===n&&"object"!=typeof n}function Wt(e,t){return j(Xe(e,t),dt)}function Ht(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 Jt(e){return j(j(Xe(e,"x-reventless-semantic-target"),ht),e=>z(j(Xe(e,"field"),dt),t=>({plugin:j(Xe(e,"plugin"),dt),view:j(Xe(e,"view"),dt),field:t,content:j(Xe(e,"content"),dt)})))}function Xt(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 Qt(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:Kt(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:Kt(e,"namedWhenRetired")}})}function Yt(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 Zt(e){let t=ht(e);if(void 0===t)return;let n=ht(Bt(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 en(e){let t=Zt(e);return void 0!==t?{isId:Kt(t,"x-reventless-id"),isCompositeId:Kt(t,"x-reventless-compositeId"),isSubId:Kt(t,"x-reventless-subId"),isCompositeSubId:Kt(t,"x-reventless-compositeSubId"),index:Yt(t),hidden:Kt(t,"x-reventless-hidden")||Kt(t,"x-reventless-ui-hidden"),summary:Kt(t,"x-reventless-summary"),groupBy:Kt(t,"x-reventless-group-by"),drillTarget:z(Wt(t,"x-reventless-drillTarget"),e=>({slice:e,keyPath:Wt(t,"x-reventless-drillTargetKey")})),collapsed:Kt(t,"x-reventless-collapsed"),scan:Kt(t,"x-reventless-scan"),scanSort:Kt(t,"x-reventless-scanSort"),semantic:Wt(t,"x-reventless-semantic"),semanticFromType:vt(Wt(t,"x-reventless-semantic-source"),"type"),storeTarget:Ht(t),memberTarget:Jt(t),channel:Wt(t,"x-reventless-channel"),setter:Xt(t),retired:Qt(t)}:Vt}function tn(e,t){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{if(t(en(e[1])))return e[0]})),[])}function nn(e){return tn(e,e=>e.summary)}function rn(e){return tn(e,e=>e.isId)[0]}function on(e){return j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>me(Qe(e),e=>{let t=e[0];return z(en(e[1]).retired,e=>[t,e])})[0])}function sn(e){return z(on(e),e=>e[0])}function an(e){return tn(e,e=>e.isCompositeId)}function ln(e){return tn(e,e=>!!e.isSubId||e.isCompositeSubId)[0]}function cn(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 un(e){return j(j(ht(e),e=>Xe(e,"x-reventless-viewmode")),dt)}function dn(e){return j(z(j(j(ht(Bt(e)),e=>Xe(e,"enum")),pt),e=>me(e,dt)),e=>{if(0!==e.length)return e})}function fn(e,t){return U(j(j(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),dn),[])}function hn(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";case"CaptionedImage":return"captionedImage";case"ImageSet":return"imageSet";case"MemberRef":return"memberRef"}}let pn=["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","CaptionedImage","ImageSet","MemberRef"],gn="storageRef",mn="captionedImage";function vn(e){return e===gn||"uploadableImage"===e||"uploadableFile"===e||e===mn}function yn(e){switch(e){case"address":return"Address";case"barcode":return"Barcode";case"bytes":return"Bytes";case"captionedImage":return"CaptionedImage";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"imageSet":return"ImageSet";case"label":return"Label";case"markdown":return"Markdown";case"memberRef":return"MemberRef";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 bn(e){switch(e){case"Status":return["Stageable"];case"ParentRef":return["Hierarchical"];case"Money":return["Measure"];case"DateRange":return["Schedulable"];case"GeoPoint":case"Geolocation":return["Mappable"];case"Image":case"CaptionedImage":case"ImageSet":return["Illustrable"];default:return[]}}function _n(e,t){return j(j(Xe(e,t),dt),e=>""===e?void 0:e)}function xn(e,t){return j(j(Xe(e,t),dt),e=>""===e?void 0:e)}function Sn(e){return j(ht(e),e=>z(xn(e,"ref"),t=>({ref:t,altText:xn(e,"altText"),caption:xn(e,"caption")})))}function wn(e){return me(U(pt(e),[]),Sn)}function En(e){let t=e.altText;return void 0!==t?t:e.caption}function kn(e,t,n){return j(j(j(j(Xe(e,t),ht),e=>Xe(e,n)),dt),e=>""===e?void 0:e)}function Cn(e,t){return"Pair"===e.TAG?_n(t,e.startField):kn(t,e._0,"start")}function An(e,t){if("Pair"!==e.TAG)return kn(t,e._0,"end");let n=e.endField;return void 0!==n?_n(t,n):void 0}function Nn(e){return"Pair"!==e.TAG||void 0!==e.endField}function Tn(e,t){let n=Xe(e,t);if(void 0===n)return;let r=ft(n);return void 0!==r?r:j(dt(n),qt)}function Rn(e,t,n){return j(j(j(Xe(e,t),ht),e=>Xe(e,n)),ft)}function Dn(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 In(e){return j(Dn(e),e=>{let t=e[1],n=e[0];if(!n.endsWith("Located"))return n.endsWith("Pending")?{TAG:"Pending",requestedFor:_n(t,"requestedFor")}:n.endsWith("Unresolvable")?{TAG:"Unresolvable",reason:_n(t,"reason")}:void 0;let r=Rn(t,"point","lat"),i=Rn(t,"point","lng");return{TAG:"Located",point:void 0!==r&&void 0!==i?[r,i]:void 0}})}function Fn(e){switch(e.TAG){case"Located":let t=e.point;return void 0!==t?t:void 0;case"Pending":case"Unresolvable":return}}function On(e){switch(e.TAG){case"Pending":case"Located":return;case"Unresolvable":let t=e.reason;return void 0!==t?t:void 0}}function Pn(e,t){switch(e.TAG){case"Paired":let n=Tn(t,e.latField),r=Tn(t,e.lngField);return void 0!==n&&void 0!==r?[n,r]:void 0;case"Pointed":let i=e._0,o=Rn(t,i,"lat"),s=Rn(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),In)}(t,e._0),Fn)}}function Mn(e){return U(z(j(j(ht(Bt(e)),e=>Xe(e,"properties")),ht),Qe),[]).map(e=>[e[0],Bt(e[1])])}function Ln(e,t){return j(j(ht(Bt(e)),e=>Xe(e,t)),dt)}function zn(e){return Ln(e,"type")}function jn(e){let t=Ln(e,"type");if(void 0===t)return!1;switch(t){case"integer":case"number":return!0;default:return!1}}function Un(e){return vt(Ln(e,"type"),"string")}function Bn(e){let t=Ln(e,"format");if(void 0===t)return!1;switch(t){case"date":case"date-time":return!0;default:return!1}}let $n=["user","username","owner","assignee","assignedto","author","creator","createdby","updatedby","reporter","approver","reviewer","actor","member"];function qn(e){return $n.includes(e.toLowerCase())}function Gn(e,t){return t.some(t=>e.endsWith(t))}function Vn(e){return L(dn(e),0,e=>e.length)}function Kn(e,t){return j(j(ht(Bt(e)),e=>Xe(e,t)),ft)}let Wn=[["street","streetaddress","line1","addressline1","address1","housenumber"],["city","town","locality"],["postalcode","zip","zipcode","postcode"],["state","region","province","county"],["country","countrycode"]];let Hn=["parent","parentid","manager","managerid","reportsto","reportstoid","supervisor","supervisorid"];function Jn(e,t){let n=e.toLowerCase(),r=function(e,t){if(!jn(t))return;let n=Kn(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)&&Vn(t)>0?Vn(t)<=8?["Status","name:status-enum"]:void 0:vt(Ln(t,"type"),"string")&&["imageurl","image","photo","photourl","avatar","avatarurl","thumbnail"].includes(n)?["Image","name:image"]:jn(t)&&Gn(n,["price","amount","total"])?["Currency","name:currency"]:vt(Ln(t,"type"),"string")&&["email"].includes(n)?["Email","name:email"]:vt(Ln(t,"type"),"string")&&["phone","phonenumber"].includes(n)?["Phone","name:phone"]:vt(Ln(t,"type"),"string")&&["website","url","homepage"].includes(n)?["Url","name:url"]:vt(Ln(t,"type"),"string")&&(["file","attachment","upload"].includes(n)||Gn(n,["storageref","fileref","attachmentref"]))?["File","name:file"]:jn(t)&&["progress","percentcomplete","percentdone","completion"].includes(n)?["Progress","name:progress"]:vt(Ln(t,"type"),"string")&&["country","countrycode","countryname"].includes(n)?["Country","name:country"]:vt(Ln(t,"type"),"string")&&["address","streetaddress","billingaddress","shippingaddress"].includes(n)?["Address","name:address"]:vt(Ln(t,"type"),"string")&&function(e){return!!Hn.includes(e)||!!e.startsWith("parent")&&e.endsWith("id")}(n)?["ParentRef","name:parent-ref"]:vt(Ln(t,"type"),"string")&&["name","title","label","displayname"].includes(n)?["Label","name:label"]:vt(Ln(t,"type"),"string")&&$n.includes(n)?["UserRef","name:user"]:void 0}function Xn(e){return["lat","latitude"].includes(e)}function Qn(e){return["lng","lon","long","longitude"].includes(e)}let Yn={contents:[]};function Zn(e,t,n){let r=e+"."+t+"."+n;if(Yn.contents.some(e=>e===r))return;Yn.contents.push(r);let i=pn.map(hn).join(", ");console.error('[AutoUI] Unknown semantic "'+n+'" ('+e+') on field "'+t+'" — ignored. Valid ids: '+i+".")}function er(e,t){let n=Bt(t),r=en(n),i=r.semanticFromType?"Type":"Annotation",o=L(r.semantic,!1,vn),s=j(r.semantic,t=>{if(t===gn)return;let n=yn(t);return void 0!==n?{semantic:n,provenance:i}:void Zn("x-reventless-semantic",e,t)}),a=j(z($t(n),en),e=>{if(vt(e.semantic,mn))return{semantic:"ImageSet",provenance:e.semanticFromType?"Type":"Annotation"}}),l=B(s,a);if(void 0!==l)return l;let c,u=e.toLowerCase(),d=vt(Ln(n,"type"),"object")&&function(e){let t=Mn(e),n=(e,n)=>t.some(t=>t[0].toLowerCase()===e&&n(t[1]));return!!n("amount",jn)&&n("currency",Un)}(n)?["Money","shape:money"]:vt(Ln(n,"type"),"object")&&function(e){let t=Mn(e),n=e=>t.some(t=>{let n=t[1];return!(t[0].toLowerCase()!==e||!vt(Ln(n,"type"),"string"))&&Bn(n)});return!!n("start")&&n("end")}(n)?["DateRange","shape:date-range"]:vt(Ln(n,"type"),"object")&&function(e){let t=Mn(e);return Wn.filter(e=>t.some(t=>e.includes(t[0].toLowerCase()))).length>=2}(n)?["Address","shape:address"]:vt(Ln(n,"type"),"object")&&function(e){let t=Mn(e),n=t.some(e=>!!Xn(e[0].toLowerCase())&&jn(e[1])),r=t.some(e=>!!Qn(e[0].toLowerCase())&&jn(e[1]));return!!n&&r}(n)?["GeoPoint","shape:geo-point"]:Xn(u)&&jn(n)?["GeoLat","name:geo-pair"]:Qn(u)&&jn(n)?["GeoLng","name:geo-pair"]:void 0;if(void 0!==d)c=d;else if(vt(Ln(n,"type"),"string")&&function(e){return Gn(e,["fileurl","documenturl","downloadurl","attachmenturl","pdfurl"])}(u))c=["FileUrl","name:file-url"];else{let t=function(e){let t=Ln(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);c=void 0!==t?t:Jn(e,n)}return B(z(c,e=>({semantic:e[0],provenance:{TAG:"Heuristic",_0:e[1]}})),o?{semantic:"File",provenance:i}:void 0)}function tr(e){return j(j(en(Bt(e)).memberTarget,e=>e.content),yn)}function nr(e,t){let n=er(e,t);return void 0!==n?n:j($t(t),t=>er(ct(e),t))}function rr(e,t,n){let r=Mn(e),i={};r.forEach(e=>{let n=e[0],r=j(j(t,e=>Xe(e,n)),e=>{let t=yn(e);return void 0!==t?{semantic:t,provenance:"Hint"}:void Zn("uiHints.fields",n,e)});return void 0!==r?void(i[n]=r):M(er(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=>bn(t.semantic).includes(e))),l=j(P(n,e=>"id"!==e.field),e=>z(r.find(t=>t[0]===e.field&&vt(Ln(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"),b=me(r,e=>{let t=e[0];if(L(Xe(i,t),!1,e=>"DateTime"===e.semantic)||Bn(e[1]))return t}),_=b.find(e=>e.toLowerCase().startsWith("start")),x=b.find(e=>e.toLowerCase().startsWith("end")),S=void 0!==_?void 0!==x?{TAG:"Pair",startField:_,endField:x}:{TAG:"Pair",startField:_}:z(b.find(e=>{let t=e.toLowerCase();return!function(e){return["createdat","updatedat","deletedat"].includes(e)}(t)&&(!!Gn(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")}}function ir(e,t){return j(e.imageField,n=>{let r=z(Xe(e.semantics,n),e=>e.semantic);if(void 0!==r)switch(r){case"CaptionedImage":return j(Xe(t,n),Sn);case"ImageSet":return j(Xe(t,n),e=>wn(e)[0])}return z(_n(t,n),e=>({ref:e}))})}function or(e){return me(Mn(e),e=>{let t=e[1],n=e[0];if(Un(t))return z(function(e){let t=dn(e);if(void 0!==t&&t.length>=2&&t.length<=12)return t}(t),e=>[n,e])})}function sr(e,t,n){let r=function(e){return me(Mn(e),e=>{if(vt(zn(e[1]),"boolean"))return e[0]})}(t),i=P(n,e=>r.includes(e)),o=r.filter(e=>yt(e,i)),s=or(t)[0],a=or(t)[1];if(void 0===s)return;if(void 0===a)return;let l=a[1],c=a[0],u=s[1],d=s[0];return z(o[0],t=>({collectionField:e,rowField:d,rowValues:u,colField:c,colValues:l,valueField:t,availableField:i}))}function ar(e,t){return function(e){return 1!==e.length?void 0:T(e[0])}(me(Mn(e),e=>{let n=e[0];return j($t(e[1]),e=>sr(n,e,t))}))}function lr(e,t){let n=[t.rowField,t.colField];return e.filter(e=>{let t=function(e){return Mn(e.schema).map(e=>e[0]).filter(t=>!("TAG"===t||"id"===t||!yt(t,e.aggregateIdField))&&yt(t,e.ownerField))}(e);return"Instance"===e.level&&t.length===n.length&&n.every(e=>t.includes(e))})}function cr(e,t){return me(U(j(Xe(e,t.collectionField),pt),[]),ht)}function ur(e,t){return U(Rt(e,t),"")}function dr(e,t,n,r){let i=ge(e.flatMap(e=>cr(e,t)).map(e=>ur(e,n)).filter(e=>""!==e&&!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r.concat(i)}function fr(e,t){return j(Xe(e,t),gt)}let hr={initial:"initial",inherit_:"inherit_",unset:"unset",toString:function(e){return"inherit_"===e?"inherit":"unset"===e?"unset":"initial"}};function pr(e){return t="--",e.startsWith(t)?e:"--"+e;var t}function gr(e){if("var"===e.NAME)return"var("+pr(e.VAL)+")";let t=e.VAL;return"var("+pr(t[0])+","+t[1]+")"}let mr={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 vr(e){return e.VAL.toString()+"%"}function yr(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 br={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:yr};let _r={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 yr(t);let n=t.NAME;if("subtract"===n){let n=t.VAL;return"calc("+e(n[0])+" - "+e(n[1])+")"}if("percent"===n)return vr(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 yr(t);let r=t.VAL;return"calc("+e(r[0])+" * "+r[1].toString()+")"}};let xr={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 Sr={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 wr={auto:"auto",toString:function(e){return"auto"}};let Er={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 kr={toString:function(e){return"object"==typeof e?e.VAL.toString():"infinite"}};let Cr={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 Ar(e){let t=e.NAME;return"var"===t||"varDefault"===t?gr(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 Nr(e){let t=e.NAME;return"percent"===t?vr(e):"num"===t?e.VAL.toString():gr(e)}function Tr(e){return"percent"===e.NAME?vr(e):gr(e)}function Rr(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()+", "+Nr(t[3])+")"}if("hex"===t)return"#"+e.VAL;if("hsl"===t){let t=e.VAL;return"hsl("+Ar(t[0])+", "+Tr(t[1])+", "+Tr(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("+Ar(n[0])+", "+Tr(n[1])+", "+Tr(n[2])+", "+Nr(n[3])+")"}let Dr={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 Ir={toString:function(e){return"object"==typeof e?e.VAL.toString():"normal"}};let Fr={toString:function(e){return"inline"===e?"inline":"block"===e?"block":"run-in"}};let Or={toString:function(e){return"grid"===e?"grid":"table"===e?"table":"flex"}};let Pr={toString:function(e){return"list-item"}};let Mr={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 Lr={toString:function(e){return"contents"===e?"contents":"none"}};let zr={toString:function(e){return"inlineBlock"===e?"inline-block":"inlineFlex"===e?"inline-flex":"inlineGrid"===e?"inline-grid":"inline-table"}};let jr={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 Ur={toString:function(e){return"firstBaseline"===e?"first baseline":"baseline"===e?"baseline":"last baseline"}};let Br={toString:function(e){return"normal"}};let $r={toString:function(e){return"spaceAround"===e?"space-around":"stretch"===e?"stretch":"spaceBetween"===e?"space-between":"space-evenly"}};let qr={toString:function(e){return"right"===e?"right":"justify"===e?"justify":"start"===e?"start":"center"===e?"center":"left"}};let Gr={toString:function(e){return"normal"===e?"normal":"stretch"}};let Vr={toString:function(e){return"stretch"===e?"stretch":"normal"===e?"normal":"auto"}};let Kr={toString:function(e){return"wrapReverse"===e?"wrap-reverse":"nowrap"===e?"nowrap":"wrap"}};let Wr={toString:function(e){return"row"===e?"row":"columnReverse"===e?"column-reverse":"rowReverse"===e?"row-reverse":"column"}};let Hr={toString:function(e){return"none"===e?"none":"text"===e?"text":"all"===e?"all":"contain"===e?"contain":"auto"}};let Jr={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}};let Xr={toString:function(e){return"none"}};let Qr={toString:function(e){return"minContent"===e?"min-content":"fitContent"===e?"fit-content":"maxContent"===e?"max-content":"auto"}},Yr={$$var:function(e){return{NAME:"var",VAL:e}},varDefault:function(e,t){return{NAME:"varDefault",VAL:[e,t]}},toString:gr},Zr={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()+")"}},ei={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 Rr(e);if("lightDark"!==e.NAME)return Rr(e);let t=e.VAL;return"light-dark("+Rr(t[0])+", "+Rr(t[1])+")"}},ti=Xr,ni=Xr,ri=Xr,ii=Xr,oi=ei.transparent;function si(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]=ai(t._1);break;case"PseudoClass":e[":"+t._0]=ai(t._1);break;case"PseudoClassParam":e[":"+t._0+"("+t._1+")"]=ai(t._2)}return e}function ai(e){return ke(e,{},si)}function li(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):"auto";let t=e.NAME;return"var"===t||"varDefault"===t?Yr.toString(e):_r.toString(e)}function ci(e){if("object"!=typeof e)return ei.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?Yr.toString(e):ei.toString(e)}function ui(e){if("object"!=typeof e)return"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):wr.toString(e);let t=e.NAME;return"var"===t||"varDefault"===t?Yr.toString(e):_r.toString(e)}let di=br.px;function fi(e){return"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):Dr.toString(e)}var hi=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(iB){}}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}(),pi="-ms-",gi="-moz-",mi="-webkit-",vi="comm",yi="rule",bi="decl",_i="@keyframes",xi=Math.abs,Si=String.fromCharCode,wi=Object.assign;function Ei(e){return e.trim()}function ki(e,t,n){return e.replace(t,n)}function Ci(e,t){return e.indexOf(t)}function Ai(e,t){return 0|e.charCodeAt(t)}function Ni(e,t,n){return e.slice(t,n)}function Ti(e){return e.length}function Ri(e){return e.length}function Di(e,t){return t.push(e),e}var Ii=1,Fi=1,Oi=0,Pi=0,Mi=0,Li="";function zi(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Ii,column:Fi,length:s,return:""}}function ji(e,t){return wi(zi("",null,null,"",null,null,0),e,{length:-e.length},t)}function Ui(){return Mi=Pi>0?Ai(Li,--Pi):0,Fi--,10===Mi&&(Fi=1,Ii--),Mi}function Bi(){return Mi=Pi<Oi?Ai(Li,Pi++):0,Fi++,10===Mi&&(Fi=1,Ii++),Mi}function $i(){return Ai(Li,Pi)}function qi(){return Pi}function Gi(e,t){return Ni(Li,e,t)}function Vi(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 Ki(e){return Ii=Fi=1,Oi=Ti(Li=e),Pi=0,[]}function Wi(e){return Li="",e}function Hi(e){return Ei(Gi(Pi-1,Qi(91===e?e+2:40===e?e+1:e)))}function Ji(e){for(;(Mi=$i())&&Mi<33;)Bi();return Vi(e)>2||Vi(Mi)>3?"":" "}function Xi(e,t){for(;--t&&Bi()&&!(Mi<48||Mi>102||Mi>57&&Mi<65||Mi>70&&Mi<97););return Gi(e,qi()+(t<6&&32==$i()&&32==Bi()))}function Qi(e){for(;Bi();)switch(Mi){case e:return Pi;case 34:case 39:34!==e&&39!==e&&Qi(Mi);break;case 40:41===e&&Qi(e);break;case 92:Bi()}return Pi}function Yi(e,t){for(;Bi()&&e+Mi!==57&&(e+Mi!==84||47!==$i()););return"/*"+Gi(t,Pi-1)+"*"+Si(47===e?e:Bi())}function Zi(e){for(;!Vi($i());)Bi();return Gi(e,Pi)}function eo(e){return Wi(to("",null,null,null,[""],e=Ki(e),0,[0],e))}function to(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=b;m;)switch(p=y,y=Bi()){case 40:if(108!=p&&58==Ai(w,d-1)){-1!=Ci(w+=ki(Hi(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:w+=Hi(y);break;case 9:case 10:case 13:case 32:w+=Ji(p);break;case 92:w+=Xi(qi()-1,7);continue;case 47:switch($i()){case 42:case 47:Di(ro(Yi(Bi(),qi()),t,n),l);break;default:w+="/"}break;case 123*g:a[c++]=Ti(w)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(w=ki(w,/\f/g,"")),h>0&&Ti(w)-d&&Di(h>32?io(w+";",r,n,d-1):io(ki(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(Di(S=no(w,t,n,c,u,i,a,b,_=[],x=[],d),o),123===y)if(0===u)to(w,t,S,S,_,o,d,a,x);else switch(99===f&&110===Ai(w,3)?100:f){case 100:case 108:case 109:case 115:to(e,S,S,r&&Di(no(e,S,S,0,0,i,a,b,i,_=[],d),x),i,x,d,a,r?_:x);break;default:to(w,S,S,S,[""],x,0,a,x)}}c=u=h=0,g=v=1,b=w="",d=s;break;case 58:d=1+Ti(w),h=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==Ui())continue;switch(w+=Si(y),y*g){case 38:v=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(Ti(w)-1)*v,v=1;break;case 64:45===$i()&&(w+=Hi(Bi())),f=$i(),u=d=Ti(b=w+=Zi(qi())),y++;break;case 45:45===p&&2==Ti(w)&&(g=0)}}return o}function no(e,t,n,r,i,o,s,a,l,c,u){for(var d=i-1,f=0===i?o:[""],h=Ri(f),p=0,g=0,m=0;p<r;++p)for(var v=0,y=Ni(e,d+1,d=xi(g=s[p])),b=e;v<h;++v)(b=Ei(g>0?f[v]+" "+y:ki(y,/&\f/g,f[v])))&&(l[m++]=b);return zi(e,t,n,0===i?yi:a,l,c,u)}function ro(e,t,n){return zi(e,t,n,vi,Si(Mi),Ni(e,2,-2),0)}function io(e,t,n,r){return zi(e,t,n,bi,Ni(e,0,r),Ni(e,r+1,-1),r)}function oo(e,t){for(var n="",r=Ri(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function so(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case bi:return e.return=e.return||e.value;case vi:return"";case _i:return e.return=e.value+"{"+oo(e.children,r)+"}";case yi:e.value=e.props.join(",")}return Ti(n=oo(e.children,r))?e.return=e.value+"{"+n+"}":""}function ao(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var lo=function(e,t,n){for(var r=0,i=0;r=i,i=$i(),38===r&&12===i&&(t[n]=1),!Vi(i);)Bi();return Gi(e,Pi)},co=function(e,t){return Wi(function(e,t){var n=-1,r=44;do{switch(Vi(r)){case 0:38===r&&12===$i()&&(t[n]=1),e[n]+=lo(Pi-1,t,n);break;case 2:e[n]+=Hi(r);break;case 4:if(44===r){e[++n]=58===$i()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Si(r)}}while(r=Bi());return e}(Ki(e),t))},uo=new WeakMap,fo=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)||uo.get(n))&&!r){uo.set(e,!0);for(var i=[],o=co(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]}}},ho=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function po(e,t){switch(function(e,t){return 45^Ai(e,0)?(((t<<2^Ai(e,0))<<2^Ai(e,1))<<2^Ai(e,2))<<2^Ai(e,3):0}(e,t)){case 5103:return mi+"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 mi+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return mi+e+gi+e+pi+e+e;case 6828:case 4268:return mi+e+pi+e+e;case 6165:return mi+e+pi+"flex-"+e+e;case 5187:return mi+e+ki(e,/(\w+).+(:[^]+)/,mi+"box-$1$2"+pi+"flex-$1$2")+e;case 5443:return mi+e+pi+"flex-item-"+ki(e,/flex-|-self/,"")+e;case 4675:return mi+e+pi+"flex-line-pack"+ki(e,/align-content|flex-|-self/,"")+e;case 5548:return mi+e+pi+ki(e,"shrink","negative")+e;case 5292:return mi+e+pi+ki(e,"basis","preferred-size")+e;case 6060:return mi+"box-"+ki(e,"-grow","")+mi+e+pi+ki(e,"grow","positive")+e;case 4554:return mi+ki(e,/([^-])(transform)/g,"$1"+mi+"$2")+e;case 6187:return ki(ki(ki(e,/(zoom-|grab)/,mi+"$1"),/(image-set)/,mi+"$1"),e,"")+e;case 5495:case 3959:return ki(e,/(image-set\([^]*)/,mi+"$1$`$1");case 4968:return ki(ki(e,/(.+:)(flex-)?(.*)/,mi+"box-pack:$3"+pi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+mi+e+e;case 4095:case 3583:case 4068:case 2532:return ki(e,/(.+)-inline(.+)/,mi+"$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(Ti(e)-1-t>6)switch(Ai(e,t+1)){case 109:if(45!==Ai(e,t+4))break;case 102:return ki(e,/(.+:)(.+)-([^]+)/,"$1"+mi+"$2-$3$1"+gi+(108==Ai(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ci(e,"stretch")?po(ki(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Ai(e,t+1))break;case 6444:switch(Ai(e,Ti(e)-3-(~Ci(e,"!important")&&10))){case 107:return ki(e,":",":"+mi)+e;case 101:return ki(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+mi+(45===Ai(e,14)?"inline-":"")+"box$3$1"+mi+"$2$3$1"+pi+"$2box$3")+e}break;case 5936:switch(Ai(e,t+11)){case 114:return mi+e+pi+ki(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return mi+e+pi+ki(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return mi+e+pi+ki(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return mi+e+pi+e+e}return e}var go=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case bi:e.return=po(e.value,e.length);break;case _i:return oo([ji(e,{value:ki(e.value,"@","@"+mi)})],r);case yi: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 oo([ji(e,{props:[ki(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return oo([ji(e,{props:[ki(t,/:(plac\w+)/,":"+mi+"input-$1")]}),ji(e,{props:[ki(t,/:(plac\w+)/,":-moz-$1")]}),ji(e,{props:[ki(t,/:(plac\w+)/,pi+"input-$1")]})],r)}return""})}}],mo=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||go,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=[so,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Ri(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}([fo,ho].concat(o,u));i=function(e,t,n,r){l=n,oo(eo(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new hi({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 vo={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},yo=/[A-Z]|^ms/g,bo=/_EMO_([^_]+?)_([^]*?)_EMO_/g,_o=function(e){return 45===e.charCodeAt(1)},xo=function(e){return null!=e&&"boolean"!=typeof e},So=ao(function(e){return _o(e)?e:e.replace(yo,"-$&").toLowerCase()}),wo=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(bo,function(e,t,n){return ko={name:t,styles:n,next:ko},t})}return 1===vo[e]||_o(e)||"number"!=typeof t||0===t?t:t+"px"};function Eo(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 ko={name:i.name,styles:i.styles,next:ko},i.name;var o=n;if(void 0!==o.styles){var s=o.next;if(void 0!==s)for(;void 0!==s;)ko={name:s.name,styles:s.styles,next:ko},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+=Eo(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]+"}":xo(a)&&(r+=So(o)+":"+wo(o,a)+";")}else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var l=Eo(e,t,s);switch(o){case"animation":case"animationName":r+=So(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<s.length;c++)xo(s[c])&&(r+=So(o)+":"+wo(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 ko,Co=/label:\s*([^\s;{]+)\s*(;|$)/g;function Ao(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="";ko=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=Eo(n,t,o)):i+=o[0];for(var s=1;s<e.length;s++){if(i+=Eo(n,t,e[s]),r)i+=o[s]}Co.lastIndex=0;for(var a,l="";null!==(a=Co.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:ko}}function No(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}function To(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function Ro(e,t,n){var r=[],i=No(e,r,n);return r.length<2?n:i+t(r)}var Do=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},Io=function(e){var t=mo(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=Ao(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 Ro(t.registered,n,Do(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Ao(n,t.registered);To(t,i)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=Ao(n,t.registered),o="animation-"+i.name;return To(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:No.bind(null,t.registered),merge:Ro.bind(null,t.registered,n)}}({key:"css"}),Fo=Io.cx,Oo=Io.injectGlobal,Po=Io.keyframes,Mo=Io.css;let Lo=function(e){let t=e=>ke(e,{},(e,t)=>(e[t[0].toString()+"%"]=ai(t[1]),e));return{insertRule:t=>e.injectRaw(t),renderRule:(t,n)=>e.renderRaw(t,n),global:(t,n)=>e.injectRules(t,ai(n)),renderGlobal:(t,n,r)=>e.renderRules(t,n,ai(r)),style:t=>e.make(ai(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=>{Oo(e)},renderRaw:function(e,t){Oo(t)},injectRules:function(e,t){Oo(Ze([[e,t]]))},renderRules:function(e,t,n){Oo(Ze([[t,n]]))},make:e=>Mo(e),mergeStyles:e=>Fo(e),makeKeyframes:function(e){return Po(e)},renderKeyframes:function(e,t){return Po(t)}}),zo=function(e,t){return{TAG:"D",_0:e,_1:t}},jo=function(e){return{TAG:"D",_0:"alignItems",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?Ur.toString(e):"normal"===e||"stretch"===e?Gr.toString(e):jr.toString(e)}},Uo=function(e){return{TAG:"D",_0:"alignSelf",_1:"object"==typeof e?Yr.toString(e):"selfStart"===e||"flexEnd"===e||"flexStart"===e||"center"===e||"start"===e||"selfEnd"===e||"right"===e||"left"===e||"end_"===e?jr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"baseline"===e||"firstBaseline"===e||"lastBaseline"===e?Ur.toString(e):Vr.toString(e)}},Bo=function(e){return{TAG:"D",_0:"bottom",_1:li(e)}},$o=function(e){return{TAG:"D",_0:"cursor",_1:Cr.toString(e)}},qo=function(e){return{TAG:"D",_0:"display",_1:"object"==typeof e?Yr.toString(e):"table"===e||"grid"===e||"flex"===e?Or.toString(e):"contents"===e||"none"===e?Lr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"inlineGrid"===e||"inlineFlex"===e||"inlineBlock"===e||"inlineTable"===e?zr.toString(e):"block"===e||"inline"===e||"runIn"===e?Fr.toString(e):"listItem"===e?Pr.toString(e):Mr.toString(e)}},Go=function(e){return{TAG:"D",_0:"flexDirection",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):Wr.toString(e)}},Vo=function(e){return{TAG:"D",_0:"flexGrow",_1:e.toString()}},Ko=function(e){return{TAG:"D",_0:"flexShrink",_1:e.toString()}},Wo=function(e){return{TAG:"D",_0:"flexWrap",_1:"object"==typeof e?Yr.toString(e):"nowrap"===e||"wrapReverse"===e||"wrap"===e?Kr.toString(e):hr.toString(e)}},Ho=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Qr.toString(e);return{TAG:"D",_0:"height",_1:t}},Jo=function(e){return{TAG:"D",_0:"justifyContent",_1:"object"==typeof e?Yr.toString(e):"spaceBetween"===e||"stretch"===e||"spaceAround"===e||"spaceEvenly"===e?$r.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"normal"===e?Br.toString(e):jr.toString(e)}},Xo=function(e){return{TAG:"D",_0:"left",_1:li(e)}},Qo=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):"abs"===n?Ir.toString(e):_r.toString(e)}else t="zero"===e?_r.toString(e):"normal"===e?Ir.toString(e):hr.toString(e);return{TAG:"D",_0:"lineHeight",_1:t}},Yo=function(e){return{TAG:"D",_0:"listStyleType",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):Er.toString(e)}},Zo=function(e){return{TAG:"D",_0:"margin",_1:ui(e)}},es=function(e,t){return{TAG:"D",_0:"margin",_1:ui(e)+" "+ui(t)}},ts=function(e){return{TAG:"D",_0:"marginLeft",_1:ui(e)}},ns=function(e){return{TAG:"D",_0:"marginRight",_1:ui(e)}},rs=function(e){return{TAG:"D",_0:"marginTop",_1:ui(e)}},is=function(e){return{TAG:"D",_0:"marginBottom",_1:ui(e)}},os=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="none"===e?ri.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Qr.toString(e);return{TAG:"D",_0:"maxHeight",_1:t}},ss=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="none"===e?ti.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Jr.toString(e);return{TAG:"D",_0:"maxWidth",_1:t}},as=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="none"===e?ii.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Qr.toString(e);return{TAG:"D",_0:"minHeight",_1:t}},ls=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="none"===e?ni.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Jr.toString(e);return{TAG:"D",_0:"minWidth",_1:t}},cs=function(e){return{TAG:"D",_0:"opacity",_1:e.toString()}},us=function(e){return{TAG:"D",_0:"overflow",_1:Sr.toString(e)}},ds=function(e){return{TAG:"D",_0:"overflowY",_1:Sr.toString(e)}},fs=function(e){return{TAG:"D",_0:"padding",_1:_r.toString(e)}},hs=function(e,t){return{TAG:"D",_0:"padding",_1:_r.toString(e)+" "+_r.toString(t)}},ps=function(e){return{TAG:"D",_0:"position",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):xr.toString(e)}},gs=function(e){return{TAG:"D",_0:"right",_1:li(e)}},ms=function(e){return{TAG:"D",_0:"textAlign",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):qr.toString(e)}},vs=function(e){return{TAG:"D",_0:"top",_1:li(e)}},ys=function(e){return{TAG:"D",_0:"userSelect",_1:"object"==typeof e?Yr.toString(e):"unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):Hr.toString(e)}},bs=function(e){let t;if("object"==typeof e){let n=e.NAME;t="var"===n||"varDefault"===n?Yr.toString(e):_r.toString(e)}else t="unset"===e||"inherit_"===e||"initial"===e?hr.toString(e):"zero"===e?_r.toString(e):Jr.toString(e);return{TAG:"D",_0:"width",_1:t}},_s=function(e){return{TAG:"D",_0:"zIndex",_1:e.toString()}},xs=function(e,t){return{TAG:"S",_0:e,_1:t}},Ss=function(e,t){return{TAG:"S",_0:"@media "+e,_1:t}},ws=function(e){return{TAG:"PseudoClass",_0:"disabled",_1:e}},Es=function(e){return{TAG:"PseudoClass",_0:"focus",_1:e}},ks=function(e){return{TAG:"PseudoClass",_0:"focus-within",_1:e}},Cs=function(e){return{TAG:"PseudoClass",_0:"hover",_1:e}},As=function(e){return{TAG:"PseudoClass",_0:"last-child",_1:e}},Ns=function(e){return{TAG:"S",_0:"::placeholder",_1:e}},Ts=di,Rs=function(e,t,n){return{TAG:"D",_0:"border",_1:br.toString(e)+" "+fi(t)+" "+ci(n)}},Ds=function(e){return{TAG:"D",_0:"animationName",_1:e}},Is=function(e){return{TAG:"D",_0:"animationDuration",_1:mr.toString(e)}},Fs=function(e){return{TAG:"D",_0:"animationIterationCount",_1:kr.toString(e)}},Os=function(e){return{TAG:"D",_0:"animationTimingFunction",_1:Zr.toString(e)}},Ps=oi,Ms=Lo.global,Ls=Lo.style,zs=Lo.merge,js=Lo.keyframes;function Us(e){return"var("+e+")"}let Bs=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",Us(_t.md)),Vo(1),zo("min-height","200px"),ms("center"),zo("padding",Us(_t.xxl))]),$s=Ls([zo("font-size","40px"),zo("color",Us(bt.textDisabled)),zo("line-height","1")]),qs=Ls([zo("color",Us(bt.textPrimary)),zo("font-size",Us(xt.sizeLg)),zo("font-weight",Us(xt.weightMedium)),Zo(Ts(0))]),Gs=Ls([zo("color",Us(bt.textSecondary)),zo("font-size",Us(xt.sizeMd)),zo("max-width","360px"),Zo(Ts(0))]),Vs=Ls([zo("background",Us(bt.brand)),zo("color",Us(bt.textOnBrand)),zo("border","none"),zo("border-radius",Us(St.md)),zo("padding","var("+_t.sm+") var("+_t.lg+")"),zo("font-size",Us(xt.sizeMd)),zo("cursor","pointer"),rs(Ts(8))]);let Ks=function(e){let t=e.title,n=void 0!==t?t:"Nothing here yet";return r("div",{children:[i("div",{children:"( )",className:$s}),i("h3",{children:n,className:qs}),L(e.description,null,e=>i("p",{children:e,className:Gs})),L(e.action,null,e=>{let t=e[1];return i("button",{children:e[0],className:Vs,onClick:e=>t()})})],className:Bs})};function Ws(e){return"var("+e+")"}let Hs=Ls([bs({NAME:"percent",VAL:100}),zo("border-collapse","collapse"),zo("font-size",Ws(xt.sizeMd))]),Js=Ls([zo("background",Ws(bt.surfaceSubtle)),zo("border-bottom","2px solid var("+bt.border+")")]),Xs=Ls([zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("color",Ws(bt.textSecondary)),zo("font-weight",Ws(xt.weightMedium)),zo("font-size",Ws(xt.sizeSm)),zo("text-align","left"),zo("white-space","nowrap"),zo("user-select","none")]),Qs=Ls([zo("padding","var("+_t.sm+") var("+_t.md+")"),zo("font-size",Ws(xt.sizeMd))]),Ys=Ls([$o("pointer"),Cs([zo("color",Ws(bt.textPrimary))])]),Zs=Ls([zo("color",Ws(bt.textPrimary))]),ea=Ls([ts(Ts(4)),zo("font-size",Ws(xt.sizeXs)),zo("color",Ws(bt.brand))]),ta=Ls([zo("border-bottom","1px solid var("+bt.borderSubtle+")"),Cs([zo("background",Ws(bt.surfaceSubtle))])]),na=Ls([zo("min-height","44px")]),ra=Ls([$o("pointer")]),ia=Ls([zo("background",Ws(bt.surfaceSubtle)),zo("box-shadow","inset 3px 0 0 0 var("+bt.brand+")")]),oa=Ls([zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("color",Ws(bt.textPrimary)),zo("vertical-align","middle")]),sa=Ls([zo("padding","var("+_t.sm+") var("+_t.md+")")]),aa=Ls([ms("center"),zo("padding",Ws(_t.xxl))]);function la(e){let t=e.onSort,n=e.sortState,o="Comfortable"===e.density?Xs+" "+Qs:Xs;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+" "+Ys+(s?" "+Zs:""):o;return r("th",{children:[e.label,s?i("span",{children:"Asc"===a?"^":"v",className:ea}):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:Js})}let ca=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?oa+" "+sa:oa,d="Comfortable"===c?ta+" "+na:ta;return r("table",{children:[i(la,{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(Ks,{title:"No data"})),className:u+" "+aa,colSpan:l.length})}):a.map(e=>{let n=s(e),r=L(o,d,e=>d+" "+ra),a=vt(t,n)?r+" "+ia: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:Hs})};function ua(e){return e?{TAG:"Partial",_0:"FromStart"}:"Complete"}function da(e,t){return e.toString()+" "+t+(1===e?"":"s")}function fa(e,t,n,r){let i=void 0!==r?r:"item",o=U(n,t),s=o===t?da(o,i):o.toString()+" of "+da(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 ha(e,t){return t?e+"+":e}function pa(e){switch(e){case"Small":return 20;case"Medium":return 28;case"Large":return 44}}let ga=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74","#5e7c9c"];function ma(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,ga.length)}function va(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 ya(e){return"var("+e+")"}let ba=Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("border-radius",ya(St.full)),zo("color","#ffffff"),zo("font-family",ya(xt.fontFamily)),zo("font-weight",ya(xt.weightMedium)),zo("flex-shrink","0"),zo("user-select","none"),zo("vertical-align","middle"),zo("overflow","hidden")]),_a=Ls([zo("width","100%"),zo("height","100%"),zo("object-fit","cover")]);let xa=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=pa(o),u=c.toString()+"px",d=void 0!==n&&(""!==n&&!a[0]),f={background:d?"transparent":ga[ma(r)],fontSize:((c/2|0)-1|0).toString()+"px",height:u,width:u};return i("span",{children:d?i("img",{className:_a,alt:r,src:U(n,""),onError:e=>l(e=>!0)}):va(r),"aria-label":r,className:ba,role:"img",style:f,title:r})};function Sa(e){return"var("+e+")"}let wa=Ls([qo("flex"),Wo("wrap"),zo("gap",Sa(_t.xs)),jo("center")]),Ea=Ls([qo("inlineFlex"),jo("center"),zo("padding","2px 8px"),zo("border-radius",Sa(St.full)),zo("background",Sa(bt.surfaceElevated)),zo("color",Sa(bt.textSecondary)),zo("font-size",Sa(xt.sizeXs)),zo("font-weight",Sa(xt.weightMedium)),zo("line-height","1.5"),zo("white-space","nowrap")]),ka=Ls([zo("color",Sa(bt.textDisabled)),zo("font-size",Sa(xt.sizeSm))]);let Ca=function(e){let t=e.items;return 0===t.length?i("span",{children:"—",className:ka}):i("div",{children:t.map((e,t)=>i("span",{children:e,className:Ea},t.toString()+":"+e)),className:wa})};function Aa(e){return"var("+e+")"}let Na=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("background","transparent"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Aa(St.sm)),zo("padding","1px 6px"),zo("color",Aa(bt.textSecondary)),zo("font-size",Aa(xt.sizeXs)),zo("line-height","1"),$o("pointer"),Cs([zo("background",Aa(bt.surfaceElevated)),zo("color",Aa(bt.textPrimary))])]),Ta=Ls([zo("color",Aa(bt.success)),zo("border-color",Aa(bt.success))]);let Ra=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?Na+" "+Ta:Na,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 Da(e){return"var("+e+")"}let Ia=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[bt.success,bt.background];case"Warning":return[bt.warning,bt.background];case"Error":return[bt.error,bt.background];case"Info":return[bt.info,bt.background];case"Neutral":return[bt.surfaceElevated,bt.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],Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("padding","2px 8px"),zo("border-radius",Da(St.full)),zo("font-size",Da(xt.sizeXs)),zo("font-weight",Da(xt.weightMedium)),zo("line-height","1.5"),zo("white-space","nowrap"),zo("background",a.startsWith("--rv-")?"var("+a+")":a),zo("color",l.startsWith("--rv-")?"var("+l+")":l)]))});var a,l};function Fa(e){return"var("+e+")"}let Oa=Ls([qo("inlineFlex"),jo("center"),zo("gap",Fa(_t.xs)),zo("min-width","0")]),Pa=Ls([zo("color",Fa(bt.brand)),zo("text-decoration","none"),zo("max-width","260px"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap"),Cs([zo("text-decoration","underline")])]),Ma=Ls([zo("color",Fa(bt.textPrimary)),zo("font-family","var(--rv-font-mono, ui-monospace, monospace)"),zo("font-size",Fa(xt.sizeSm)),zo("max-width","200px"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),La=Ls([zo("text-decoration","none"),zo("color","inherit"),qo("inlineFlex"),Cs([zo("filter","brightness(0.94)")])]);function za(e,t){return e.length>t?e.slice(0,6)+"…"+e.slice(e.length-4|0,e.length):e}let ja=function(e){let t=e.presentation,n=e.copyable,o=e.rawValue,s=e.label,a=e.href,l=void 0!==n&&n,c=void 0!==t?t:"Text",u=ae(),d=e=>{if(!(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||0!==e.button)&&void 0!==a)return e.preventDefault(),e.stopPropagation(),u(a)},f=U(e.title,"Chip"===c?o:s),h="Text"===c?void 0!==a?i("a",{children:s,className:Pa,title:f,href:a,onClick:d}):i("span",{children:za(s,18),className:Ma,title:f}):void 0!==a?i("a",{children:i(Ia,{label:s,dot:!1}),className:La,title:f,href:a,onClick:d}):i("span",{children:i(Ia,{label:s,dot:!1}),className:La,title:f});return r("span",{children:[h,l?i(Ra,{value:o}):null],className:Oa})};function Ua(e){return"var("+e+")"}let Ba=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("padding","2px 8px"),zo("border-radius",Ua(St.full)),zo("background",Ua(bt.surfaceElevated)),zo("color",Ua(bt.textSecondary)),zo("font-size",Ua(xt.sizeXs)),zo("font-weight",Ua(xt.weightMedium)),zo("line-height","1.5"),zo("white-space","nowrap"),zo("border","none")]),$a=Ls([$o("pointer"),Cs([zo("background",Ua(bt.surface)),zo("color",Ua(bt.textPrimary))])]),qa=Ls([zo("font-weight",Ua(xt.weightBold)),zo("color",Ua(bt.textPrimary))]);let Ga=function(e){let t=e.onClick,n=L(t,Ba,e=>Ba+" "+$a),s=r(o,{children:[i("span",{children:e.count.toString(),className:qa})," "+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 Va(e){let t=e.toString();return t.length<2?"0"+t:t}function Ka(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()+"-"+Va(i)+"-"+Va(o)+" "+Va(s)+":"+Va(a)+":"+Va(l)}let Wa=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/;function Ha(e){if(Wa.test(e))return Ka(e)}function Ja(e){let t=e.toLowerCase(),n=t.length;return!!(n>2&&t.endsWith("id")&&"id"!==t)||n>3&&t.endsWith("ids")}function Xa(e,t){return L(e,!1,Ja)?void 0:Ha(t)}function Qa(e,t){return z(on(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 Ya(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}})}function Za(e,t){let n=e.values,r=Ya(e,t);return void 0!==n?void 0!==r&&r?z(j(t,dt),e=>i(Ia,{variant:"Warning",label:e,dot:!1})):void 0:void 0!==r?r?i(Ia,{variant:"Warning",label:e.label,dot:!1}):e.showWhenFalse?i(Ia,{variant:"Neutral",label:"Not "+e.label,dot:!1}):void 0:void 0}let el="archived";let tl={param:el,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[[el,e?"":"1"],["after",""],["before",""]]}};function nl(e){return"var("+e+")"}let rl=Ls([qo("inlineFlex"),jo("center"),zo("vertical-align","middle")]),il=Ls([qo("inlineFlex"),zo("border-radius",nl(St.full)),zo("box-shadow","0 0 0 2px var("+bt.surface+")")]),ol=Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("border-radius",nl(St.full)),zo("background",nl(bt.surfaceElevated)),zo("color",nl(bt.textSecondary)),zo("font-family",nl(xt.fontFamily)),zo("font-weight",nl(xt.weightMedium)),zo("flex-shrink","0"),zo("user-select","none")]);let sl=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=pa(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(xa,{name:e.name,src:e.imageUrl,size:s}),className:il,style:h(t)},t.toString())),l>0?i("span",{children:"+"+l.toString(),className:il+" "+ol,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:rl})},al=l(void 0),ll=al.Provider;let cl=function(e){return c(ll,{value:e.fill,children:e.children})};let ul=l([]),dl=l(e=>{}),fl=ul.Provider,hl=dl.Provider;let pl=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(hl,{value:o,children:c(fl,{value:r[0],children:e.children})})};function gl(){return d(ul)}let ml={};function vl(e,t){let n,r=t.split("/");if(2!==r.length)n=[e,t];else{let i=r[0],o=r[1];n=""!==i&&""!==o?[e.filter(e=>e.pluginId===i),o]:[e,t]}let i=n[1],o=function(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.filter(e=>e.name===r);return 0!==i.length?i:e.filter(e=>e.name===n)}(n[0],i);if(o.length>1&&q(Xe(ml,i))){ml[i]=!0;let e=o.map(e=>e.pluginId).join(", ");console.warn('[AutoUI] reference target "'+i+'" matches views in '+e+'; linking to the first. Qualify it as "<pluginId>/'+i+'".')}return o[0]}let yl=vl;function bl(e,t){return e.find(e=>e.name===t)}function _l(e,t){return ze(n=>Fe(e,Fe(encodeURIComponent(t),n)))}function xl(e,t){return Fe(e,Fe(encodeURIComponent(t),"Wildcard"))}function Sl(e,t,n,r){let i=[n].concat(r).map(e=>encodeURIComponent(e));return Ue(xl(e,t))(je.of_parts(i.join("/")))}var wl=(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))(wl||{});const El=[1,0],kl=[2,3],Cl=[3,2],Al={L:[0,1],M:El,Q:kl,H:Cl},Nl=/^\d*$/,Tl=/^[A-Z0-9 $%*+./:-]*$/,Rl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Dl=[[-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]],Il=[[-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 Fl=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,wl.Timing),this.setFunctionModule(n,6,n%2==0,wl.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,Pl(r,i));this.setFunctionModule(8,7,Pl(r,6)),this.setFunctionModule(8,8,Pl(r,7)),this.setFunctionModule(7,8,Pl(r,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,Pl(r,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,Pl(r,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,Pl(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=Pl(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,wl.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)),wl.Alignment)}setFunctionModule(e,t,n,r=wl.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){const t=this.version,n=this.ecc;if(e.length!==Jl(t,n))throw new RangeError("Invalid argument");const r=Il[n[0]][t],i=Dl[n[0]][t],o=Math.floor(Hl(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]=Ql(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=Ql(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=Xl(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(Hl(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]=Pl(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 Ol(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 Pl(e,t){return!!(e>>>t&1)}class Ml{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 Ll=[1,10,12,14],zl=[2,9,11,13],jl=[4,8,16,16];function Ul(e,t){return e[Math.floor((t+7)/17)+1]}function Bl(e){const t=[];for(const n of e)Ol(n,8,t);return new Ml(jl,e.length,t)}function $l(e){if(!Gl(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);Ol(Number.parseInt(e.substring(n,n+r),10),3*r+1,t),n+=r}return new Ml(Ll,e.length,t)}function ql(e){if(!Vl(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let n;for(n=0;n+2<=e.length;n+=2){let r=45*Rl.indexOf(e.charAt(n));r+=Rl.indexOf(e.charAt(n+1)),Ol(r,11,t)}return n<e.length&&Ol(Rl.indexOf(e.charAt(n)),6,t),new Ml(zl,e.length,t)}function Gl(e){return Nl.test(e)}function Vl(e){return Tl.test(e)}function Kl(e,t){let n=0;for(const r of e){const e=Ul(r.mode,t);if(r.numChars>=1<<e)return Number.POSITIVE_INFINITY;n+=4+e+r.bitData.length}return n}function Wl(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 Hl(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 Jl(e,t){return Math.floor(Hl(e)/8)-Dl[t[0]][e]*Il[t[0]][e]}function Xl(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]^=Ql(t,e))}return n}function Ql(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 Yl(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?[]:Gl(e)?[$l(e)]:Vl(e)?[ql(e)]:[Bl(Wl(e))]}(e):Array.isArray(e)?[Bl(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*Jl(s,t),i=Kl(e,s);if(i<=n){a=i;break}if(s>=r)throw new RangeError("Data too long")}for(const d of[El,kl,Cl])o&&a<=8*Jl(s,d)&&(t=d);const l=[];for(const d of e){Ol(d.mode[0],4,l),Ol(d.numChars,Ul(d.mode,s),l);for(const e of d.getData())l.push(e)}const c=8*Jl(s,t);Ol(0,Math.min(4,c-l.length),l),Ol(0,(8-l.length%8)%8,l);for(let d=236;l.length<c;d^=253)Ol(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 Fl(s,t,u,i)}(l,Al[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=wl.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 Zl=Ls([qo("inlineBlock"),zo("background","#ffffff"),zo("padding","6px"),zo("border-radius",function(e){return"var("+e+")"}(St.md)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("line-height","0")]),ec=Ls([zo("color","#000000"),zo("display","block")]);let tc=function(e){let t=e.size,n=e.value,r=void 0!==t?t:128,o=function(e){if(""!==e.trim())try{return Yl(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:ec,role:"img",height:r.toString(),width:r.toString(),shapeRendering:"crispEdges",viewBox:"0 0 "+s+" "+s,xmlns:"http://www.w3.org/2000/svg"}),className:Zl});var a},nc=["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 rc(e){return e>="0"&&e<="9"}function ic(e){let t={};return function(e){let t=[],n=0,r=e.length;for(;n<r;)if(rc(U(e[n],""))){let i=n;for(;n<r&&rc(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 oc(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=ic(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(be(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=>nc[e]).join("")})}function sc(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 ac=Ls([qo("inlineBlock"),ss({NAME:"percent",VAL:100}),zo("overflow-x","auto"),zo("background","#ffffff"),zo("padding","6px"),zo("border-radius",function(e){return"var("+e+")"}(St.md)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("line-height","0")]),lc=Ls([zo("color","#000000"),zo("display","block")]);let cc=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=oc(r);if(void 0===a)return null;let l=a.length+20|0;return i("span",{children:i("svg",{children:i("path",{d:sc(a,10,40),fill:"currentColor"}),"aria-label":U(e.title,"Barcode for "+r),className:lc,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:ac})};function uc(e){return"var("+e+")"}let dc=Ls([ps("fixed"),vs(Ts(0)),Xo(Ts(0)),gs(Ts(0)),Bo(Ts(0)),zo("background","rgba(0,0,0,0.82)"),qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",uc(_t.md)),zo("padding",uc(_t.lg)),zo("z-index","1100")]),fc=Ls([zo("max-width","min(92vw, 1400px)"),zo("max-height","78vh"),zo("object-fit","contain"),zo("border-radius",uc(St.sm)),zo("box-shadow",uc(kt))]),hc=Ls([qo("flex"),jo("center"),zo("gap",uc(_t.md)),zo("max-width","100%")]),pc=Ls([qo("flex"),jo("center"),zo("gap",uc(_t.md)),zo("max-width","92vw"),zo("color","#f5f5f5"),zo("font-size",uc(xt.sizeSm))]),gc=Ls([zo("font-size",uc(xt.sizeMd)),zo("font-weight",uc(xt.weightMedium)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),mc=Ls([zo("color","#c8c8c8")]),vc=Ls([zo("font-family",uc(xt.fontFamilyMono)),zo("color","#c8c8c8")]),yc=Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("background","rgba(255,255,255,0.12)"),zo("border","1px solid rgba(255,255,255,0.25)"),zo("border-radius",uc(St.md)),zo("color","#f5f5f5"),zo("padding","4px var("+_t.sm+")"),zo("font-size",uc(xt.sizeSm)),$o("pointer"),Cs([zo("background","rgba(255,255,255,0.22)")])]),bc=zs([yc,Ls([zo("width","40px"),zo("height","40px"),zo("border-radius","50%"),zo("font-size",uc(xt.sizeLg)),Ko(0)])]),_c=zs([yc,Ls([ps("absolute"),vs(Ts(16)),gs(Ts(16)),zo("width","32px")])]);function xc(e,t,n){return 0===t?0:fe(fe(e+n|0,t)+t|0,t)}let Sc=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(xc(o,l,-1)):void 0;case"ArrowRight":return c?n(xc(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[xc(o,l,0)];if(void 0===u)return null;let d=u.title,f=u.caption;return r("div",{children:[i("button",{children:"✕",className:_c,title:"Close",type:"button",onClick:e=>t()}),r("div",{children:[c?i("button",{children:"‹",className:bc,title:"Previous",type:"button",onClick:e=>n(xc(o,l,-1))}):null,i("img",{className:fc,alt:U(u.title,""),src:u.src}),c?i("button",{children:"›",className:bc,title:"Next",type:"button",onClick:e=>n(xc(o,l,1))}):null],className:hc,onClick:e=>{e.stopPropagation()}}),r("div",{children:[void 0!==d?i("span",{children:d,className:gc,title:d}):null,void 0!==f?i("span",{children:f,className:mc}):null,c?i("span",{children:(xc(o,l,0)+1|0).toString()+" / "+l.toString(),className:vc}):null,U(e.action,null)],className:pc,onClick:e=>{e.stopPropagation()}})],"aria-modal":!0,className:dc,role:"dialog",onClick:e=>t()})};function wc(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function Ec(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t).getTime()}function kc(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth()+t,1).getTime()}function Cc(e){let t=0|new Date(e).getDay(),n=0===t?6:t-1|0;return Ec(wc(e),0|-n)}function Ac(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1).getTime()}function Nc(e,t){return wc(e)===wc(t)}function Tc(e,t){let n=new Date(e),r=new Date(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Rc(e,t,n){let r=wc(n);return e<r+864e5&&t>=r}function Dc(e){let t=e.toString();return t.length<2?"0"+t:t}function Ic(e){let t=new Date(e);return Dc(0|t.getHours())+":"+Dc(0|t.getMinutes())}function Fc(e){return e===wc(e)}let Oc=["January","February","March","April","May","June","July","August","September","October","November","December"];function Pc(e){let t=new Date(e),n=0|t.getMonth();return U(Oc[n],"")+" "+t.getFullYear().toString()}let Mc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function Lc(e){return 0|new Date(e).getDate()}function zc(e){let t=0|new Date(e).getDay();return U(Mc[0===t?6:t-1|0],"")+" "+(0|new Date(e).getDate()).toString()}function jc(e){let t=new Date(e).getTime();return Number.isNaN(t)?void 0:t}let Uc=864e5;function Bc(e){return"var("+e+")"}function $c(e){return Ls([zo("width","100%"),zo("height",e),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Bc(St.md)),zo("background",Bc(bt.surfaceSubtle)),us("hidden")])}let qc=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",Bc(_t.sm)),zo("height","100%"),zo("padding",Bc(_t.lg)),zo("color",Bc(bt.textSecondary)),zo("font-size",Bc(xt.sizeSm)),zo("text-align","center")]),Gc=Ls([zo("color",Bc(bt.brand)),zo("text-decoration","none"),Cs([zo("text-decoration","underline")])]);function Vc(e){return U(U(e.split("?")[0],e).split("#")[0],e).toLowerCase().endsWith(".pdf")}let Kc=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:Gc,href:o,rel:"noopener noreferrer",target:"_blank"})],className:qc}),"aria-label":s,className:$c(a),data:o,type:"application/pdf"})};function Wc(e){return"Small"===e?"13px":"18px"}function Hc(e,t){let n=t<=0?1:t;return(e<0?0:e>n?n:e)/n}function Jc(e){return"var("+e+")"}let Xc=Ls([zo("color",Jc(bt.borderSubtle))]);let Qc=Ls([qo("inlineFlex"),zo("gap","2px"),jo("center")]);function Yc(e,t){return Ls([zo("background","none"),zo("border","none"),zo("padding","0 1px"),zo("font-size",Wc(t)),zo("line-height","1"),$o("pointer"),zo("color",Jc(e?bt.warning:bt.borderSubtle)),zo("transition","color 120ms, transform 120ms"),Cs([zo("transform","scale(1.15)")]),xs("&:focus-visible",[zo("outline","2px solid var("+bt.brand+")"),zo("outline-offset","1px"),zo("border-radius","2px")])])}let Zc=Ls([zo("color",Jc(bt.textSecondary)),zo("font-size",Jc(xt.sizeSm))]),eu=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px")]),tu=Ls([zo("border","1px solid var("+bt.error+")"),zo("border-radius",Jc(St.sm)),zo("padding","2px 4px")]);let nu=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:Yc(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:Zc}):null],"aria-label":m,className:h?Qc+" "+tu:Qc,role:"group"}:{children:[r("span",{children:[i("span",{children:g,className:Xc}),i("span",{children:g,className:(y=Hc(c,p),Ls([ps("absolute"),zo("top","0"),zo("left","0"),zo("width",(100*y).toString()+"%"),us("hidden"),zo("white-space","nowrap"),zo("color",Jc(bt.warning)),zo("pointer-events","none")]))})],"aria-label":m,className:(v=d,Ls([qo("inlineFlex"),ps("relative"),zo("font-size",Wc(v)),zo("line-height","1"),zo("letter-spacing","1px"),zo("white-space","nowrap"),zo("vertical-align","-1px")])),role:"img",title:m}),f?i("span",{children:(Math.round(10*c)/10).toString()+" / "+p.toString(),className:Zc}):null],className:eu});var v,y};function ru(e){return"var("+e+")"}let iu=Ls([qo("flex"),Go("column"),zo("gap","4px")]),ou=Ls([qo("flex"),Jo("spaceBetween"),zo("font-size",ru(xt.sizeSm))]),su=Ls([zo("color",ru(bt.textSecondary))]),au=Ls([zo("color",ru(bt.textPrimary)),zo("font-weight",ru(xt.weightMedium))]),lu=Ls([zo("background",ru(bt.surfaceSubtle)),zo("border-radius",ru(St.full)),zo("height","8px"),us("hidden")]);function cu(e,t){return Ls([zo("background",void 0!==t?t:"var("+bt.brand+")"),zo("border-radius",ru(St.full)),zo("height","100%"),zo("width",e.toString()+"%"),zo("transition","width 0.3s ease")])}let uu=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:su})),s?i("span",{children:Math.round(l).toString()+"%",className:au}):null],className:ou}):null,i("div",{children:i("div",{className:cu(l,e.color)}),className:lu})],className:iu})},du={};function fu(e){du[e.id]=e}function hu(e){return Xe(du,e)}let pu={};let gu={contents:[]};let mu="#111111";function vu(e){return"var("+e+")"}let yu=Ls([qo("flex"),Go("column"),zo("gap",vu(_t.xs))]);let bu=Ls([zo("fill","#9ca3af"),zo("font-size","13px"),zo("pointer-events","none"),zo("user-select","none")]),_u=Ls([zo("stroke","#e5e7eb"),zo("stroke-width","1")]),xu=Ls([qo("flex"),jo("center"),zo("gap",vu(_t.sm)),zo("font-size",vu(xt.sizeXs)),zo("color",vu(bt.textSecondary))]),Su=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",vu(St.sm)),zo("color",vu(bt.textSecondary)),zo("font-size",vu(xt.sizeXs)),zo("padding","2px 8px"),$o("pointer"),Cs([zo("border-color",vu(bt.brand)),zo("color",vu(bt.brand))])]),wu=Ls([zo("background","#ffffff"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",vu(St.md)),zo("padding","4px"),zo("display","inline-block"),zo("line-height","0")]),Eu=Ls([zo("display","block"),zo("max-width","100%"),zo("height","auto")]);function ku(e){return(Math.round(10*e)/10).toString()}function Cu(e){return e.map(e=>ku(e.x)+","+ku(e.y)).join(" ")}function Au(e){return e.trim().startsWith("<svg")}function Nu(e){return"data:image/svg+xml;utf8,"+encodeURIComponent(e)}let Tu=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),b=y[1],_=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="'+Cu(1===e.length?e.concat(e):e)+'"/>').join("");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+ku(t)+" "+ku(n)+'" width="'+ku(t)+'" height="'+ku(n)+'"><g fill="none" stroke="'+mu+'" 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 _.current=!0,M(R(p.current),t=>{t.setPointerCapture(e.pointerId)}),m(e=>e.concat([[t]]))},E=e=>{if(!_.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(_.current)return _.current=!1,S(v),M(a,e=>e())},C=()=>{m(e=>[]),b(e=>!0),l("")},A=0!==v.length;return!c.trim().startsWith("<svg")||A||y[0]?r("div",{children:[r("svg",{children:[i("line",{className:_u,x1:ku(.06*u),x2:ku(.94*u),y1:ku(.78*d),y2:ku(.78*d)}),A?null:i("text",{children:"Sign here",className:bu,textAnchor:"middle",x:ku(u/2),y:ku(.7*d)}),i("g",{children:v.map((e,t)=>i("polyline",{points:Cu(1===e.length?e.concat(e):e)},t.toString())),fill:"none",stroke:mu,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2..toString()})],ref:T(p),"aria-label":"Signature pad",className:(N=f,Ls([zo("background","#ffffff"),zo("border",N?"1px solid var("+bt.error+")":"1px dashed var("+bt.border+")"),zo("border-radius",vu(St.md)),zo("touch-action","none"),zo("max-width","100%"),zo("width","100%"),zo("height","auto"),$o("crosshair"),zo("display","block")])),role:"img",onPointerDown:w,onPointerMove:E,onPointerUp:k,onPointerCancel:k,viewBox:"0 0 "+ku(u)+" "+ku(d),xmlns:"http://www.w3.org/2000/svg"}),r("div",{children:[A?i("button",{children:"Clear",className:Su,type:"button",onClick:e=>C()}):null,i("span",{children:"Draw your signature above"})],className:xu})],className:yu}):r("div",{children:[i("span",{children:i("img",{className:Eu,alt:"Signature",src:Nu(c)}),className:wu}),i("div",{children:i("button",{children:"Sign again",className:Su,type:"button",onClick:e=>C()}),className:xu})],className:yu});var N};function Ru(e,t,n){let r={};return r[t]=n,Object.assign({},e,r)}function Du(e){return"var("+e+")"}let Iu=Ls([qo("flex"),Go("column"),zo("gap",Du(_t.sm))]),Fu=Ls([qo("flex"),zo("gap","4px")]),Ou=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",Du(St.sm)),zo("color",Du(bt.textSecondary)),zo("font-size",Du(xt.sizeXs)),zo("padding","2px 8px"),$o("pointer")]),Pu=Ls([zo("background",Du(bt.brandSubtle)),zo("border-color",Du(bt.brand)),zo("color",Du(bt.textPrimary))]),Mu=Ls([bs({NAME:"percent",VAL:100}),zo("min-height","220px"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Du(St.sm)),zo("background","#ffffff")]),Lu=Ls([zo("margin","0"),zo("font-family",Du(xt.fontFamilyMono)),zo("font-size",Du(xt.sizeXs)),zo("line-height",Du(xt.lineHeightRelaxed)),zo("color",Du(bt.textPrimary)),zo("white-space","pre-wrap"),zo("word-break","break-word")]);function zu(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?Ou+" "+Pu:Ou,type:"button",onClick:n}),u=0;return l&&void 0!==n?t=i("pre",{children:n,className:Lu}):u=1,1===u&&(t=i("iframe",{className:Mu,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:Fu}):null,t],className:Iu})}function ju(e,t){return i(zu,{html:e.body,textAlternative:e.textAlternative})}const Uu={};function Bu(e,t){"string"!=typeof t&&(t=Bu.defaultChars);const n=function(e){let t=Uu[e];if(t)return t;t=Uu[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})}Bu.defaultChars=";/?:@&=+$,#",Bu.componentChars="";const $u={};function qu(e,t,n){"string"!=typeof t&&(n=t,t=qu.defaultChars),void 0===n&&(n=!0);const r=function(e){let t=$u[e];if(t)return t;t=$u[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 Gu(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 Vu(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}qu.defaultChars=";/?:@&=+$,-_.!~*'()#",qu.componentChars="-_.!~*'()";const Ku=/^([a-z0-9.+-]+:)/i,Wu=/:[0-9]*$/,Hu=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ju=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Xu=["'"].concat(Ju),Qu=["%","/","?",";","#"].concat(Xu),Yu=["/","?","#"],Zu=/^[+a-z0-9A-Z_-]{0,63}$/,ed=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,td={javascript:!0,"javascript:":!0},nd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function rd(e,t){if(e&&e instanceof Vu)return e;const n=new Vu;return n.parse(e,t),n}Vu.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){const e=Hu.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let s=Ku.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&&td[s]||(o=o.substr(2),this.slashes=!0)),!td[s]&&(i||s&&!nd[s])){let e,t,n=-1;for(let a=0;a<Yu.length;a++)r=o.indexOf(Yu[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<Qu.length;a++)r=o.indexOf(Qu[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(Zu)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(Zu)){const r=e.slice(0,t),i=e.slice(t+1),s=n.match(ed);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),nd[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Vu.prototype.parseHost=function(e){let t=Wu.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 id=Object.freeze(Object.defineProperty({__proto__:null,decode:Bu,encode:qu,format:Gu,parse:rd},Symbol.toStringTag,{value:"Module"})),od=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,sd=/[\0-\x1F\x7F-\x9F]/,ad=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,ld=/[\$\+<->\^`\|~\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]/,cd=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ud=Object.freeze(Object.defineProperty({__proto__:null,Any:od,Cc:sd,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:ad,S:ld,Z:cd},Symbol.toStringTag,{value:"Module"})),dd=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))),fd=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var hd;const pd=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]]),gd=null!==(hd=String.fromCodePoint)&&void 0!==hd?hd: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 md;!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"}(md||(md={}));var vd,yd,bd;function _d(e){return e>=md.ZERO&&e<=md.NINE}function xd(e){return e>=md.UPPER_A&&e<=md.UPPER_F||e>=md.LOWER_A&&e<=md.LOWER_F}function Sd(e){return e===md.EQUALS||function(e){return e>=md.UPPER_A&&e<=md.UPPER_Z||e>=md.LOWER_A&&e<=md.LOWER_Z||_d(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"}(vd||(vd={})),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"}(yd||(yd={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(bd||(bd={}));class wd{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=yd.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bd.Strict}startEntity(e){this.decodeMode=e,this.state=yd.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case yd.EntityStart:return e.charCodeAt(t)===md.NUM?(this.state=yd.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=yd.NamedEntity,this.stateNamedEntity(e,t));case yd.NumericStart:return this.stateNumericStart(e,t);case yd.NumericDecimal:return this.stateNumericDecimal(e,t);case yd.NumericHex:return this.stateNumericHex(e,t);case yd.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===md.LOWER_X?(this.state=yd.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=yd.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(!_d(r)&&!xd(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(!_d(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===md.SEMI)this.consumed+=1;else if(this.decodeMode===bd.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=pd.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==md.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&vd.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=kd(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===bd.Attribute&&(0===i||Sd(o))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&vd.VALUE_LENGTH)>>14,0!==i){if(o===md.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==bd.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]&vd.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]&~vd.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case yd.NamedEntity:return 0===this.result||this.decodeMode===bd.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case yd.NumericDecimal:return this.emitNumericEntity(0,2);case yd.NumericHex:return this.emitNumericEntity(0,3);case yd.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yd.EntityStart:return 0}}}function Ed(e){let t="";const n=new wd(e,e=>t+=gd(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 kd(e,t,n,r){const i=(t&vd.BRANCH_LENGTH)>>7,o=t&vd.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 Cd=Ed(dd);function Ad(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)}Ed(fd);const Nd=Object.prototype.hasOwnProperty;function Td(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function Rd(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Dd(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 Id(e){if(e>65535){const t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Fd=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Od=new RegExp(Fd.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),Pd=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Md(e,t){if(35===t.charCodeAt(0)&&Pd.test(t)){const n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Dd(n)?Id(n):e}const n=function(e,t=bd.Legacy){return Cd(e,t)}(e);return n!==e?n:e}function Ld(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Od,function(e,t,n){return t||Md(e,n)})}const zd=/[&<>"]/,jd=/[&<>"]/g,Ud={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Bd(e){return Ud[e]}function $d(e){return zd.test(e)?e.replace(jd,Bd):e}const qd=/[.?*+^$[\]\\(){}|-]/g;function Gd(e){switch(e){case 9:case 32:return!0}return!1}function Vd(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 Kd(e){return ad.test(e)||ld.test(e)}function Wd(e){return Kd(Id(e))}function Hd(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 Jd(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Xd(e){return 32===e||9===e||10===e||13===e}function Qd(e){let t=0;for(;t<e.length&&Xd(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Xd(e.charCodeAt(n));n--);return e.slice(t,n+1)}const Yd={mdurl:id,ucmicro:ud},Zd=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Rd,asciiTrim:Qd,assign:Td,escapeHtml:$d,escapeRE:function(e){return e.replace(qd,"\\$&")},fromCodePoint:Id,has:function(e,t){return Nd.call(e,t)},isMdAsciiPunct:Hd,isPunctChar:Kd,isPunctCharCode:Wd,isSpace:Gd,isString:Ad,isValidEntityCode:Dd,isWhiteSpace:Vd,lib:Yd,normalizeReference:Jd,unescapeAll:Ld,unescapeMd:function(e){return e.indexOf("\\")<0?e:e.replace(Fd,"$1")}},Symbol.toStringTag,{value:"Module"}));const ef=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=Ld(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=Ld(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+=Ld(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+=Ld(e.slice(t,o)),s}},Symbol.toStringTag,{value:"Module"})),tf={};function nf(){this.rules=Td({},tf)}function rf(){this.__rules__=[],this.__cache__=null}function of(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 sf(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}tf.code_inline=function(e,t,n,r,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+$d(o.content)+"</code>"},tf.code_block=function(e,t,n,r,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+$d(e[t].content)+"</code></pre>\n"},tf.fence=function(e,t,n,r,i){const o=e[t],s=o.info?Ld(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)||$d(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`},tf.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)},tf.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},tf.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},tf.text=function(e,t){return $d(e[t].content)},tf.html_block=function(e,t){return e[t].content},tf.html_inline=function(e,t){return e[t].content},nf.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t<n;t++)r+=" "+$d(e.attrs[t][0])+'="'+$d(e.attrs[t][1])+'"';return r},nf.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},nf.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},nf.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},nf.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},rf.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},rf.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))})})},rf.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},rf.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},rf.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},rf.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},rf.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},rf.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},rf.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},rf.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},of.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},of.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},of.prototype.attrSet=function(e,t){const n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},of.prototype.attrGet=function(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n},of.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},sf.prototype.Token=of;const af=/\r\n?|\n/g,lf=/\0/g;function cf(e){return/^<a[>\s]/i.test(e)}function uf(e){return/^<\/a\s*>/i.test(e)}const df=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ff=/\((c|tm|r)\)/i,hf=/\((c|tm|r)\)/gi,pf={c:"©",r:"®",tm:"™"};function gf(e,t){return pf[t.toLowerCase()]}function mf(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(hf,gf)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}function vf(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];"text"!==r.type||t||df.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 yf=/['"]/,bf=/['"]/g;function _f(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function xf(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;){bf.lastIndex=c;const s=bf.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=Hd(p)||Wd(p),v=Hd(g)||Wd(g),y=Vd(p),b=Vd(g);if(b?d=!1:v&&(y||m||(d=!1)),y?f=!1:m&&(b||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]),_f(i,o,s.index,l),_f(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&&_f(i,o,s.index,"’")}else h&&_f(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 Sf=[["normalize",function(e){let t;t=e.src.replace(af,"\n"),t=t.replace(lf,"�"),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&&(cf(s.content)&&i>0&&i--,uf(s.content)&&i++),!(i>0)&&"text"===s.type&&e.md.linkify.test(s.content)){const i=s.content;let a=e.md.linkify.match(i);const l=[];let c=s.level,u=0;a.length>0&&0===a[0].index&&o>0&&"text_special"===r[o-1].type&&(a=a.slice(1));for(let t=0;t<a.length;t++){const n=a[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let o=a[t].text;o=a[t].schema?"mailto:"!==a[t].schema||/^mailto:/i.test(o)?e.md.normalizeLinkText(o):e.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");const s=a[t].index;if(s>u){const t=new e.Token("text","",0);t.content=i.slice(u,s),t.level=c,l.push(t)}const d=new e.Token("link_open","a",1);d.attrs=[["href",r]],d.level=c++,d.markup="linkify",d.info="auto",l.push(d);const f=new e.Token("text","",0);f.content=o,f.level=c,l.push(f);const h=new e.Token("link_close","a",-1);h.level=--c,h.markup="linkify",h.info="auto",l.push(h),u=a[t].lastIndex}if(u<i.length){const t=new e.Token("text","",0);t.content=i.slice(u),t.level=c,l.push(t)}t[n].children=r=Rd(r,o,l)}}else for(o--;r[o].level!==s.level&&"link_open"!==r[o].type;)o--}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(ff.test(e.tokens[t].content)&&mf(e.tokens[t].children),df.test(e.tokens[t].content)&&vf(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&&yf.test(e.tokens[t].content)&&xf(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 wf(){this.ruler=new rf;for(let e=0;e<Sf.length;e++)this.ruler.push(Sf[e][0],Sf[e][1])}function Ef(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(Gd(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}wf.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},wf.prototype.State=sf,Ef.prototype.push=function(e,t,n){const r=new of(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Ef.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},Ef.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},Ef.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){if(!Gd(this.src.charCodeAt(e)))break}return e},Ef.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Gd(this.src.charCodeAt(--e)))return e+1;return e},Ef.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},Ef.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},Ef.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(Gd(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("")},Ef.prototype.Token=of;function kf(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Cf(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 Af(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(!Gd(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),!Gd(o))?-1:i}const Tf="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",Rf="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Df=new RegExp("^(?:"+Tf+"|"+Rf+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),If=new RegExp("^(?:"+Tf+"|"+Rf+")"),Ff=[[/^<(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(If.source+"\\s*$"),/^$/,!1]];const Of=[["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&&!Gd(a))return!1;if(45===s&&Gd(a))return!1;for(;o<e.eMarks[i];){const t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!Gd(t))return!1;o++}let l=kf(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=kf(e,t).trim(),-1===l.indexOf("|"))return!1;if(e.sCount[t]-e.blkIndent>=4)return!1;c=Cf(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=kf(e,i).trim(),!l)break;if(e.sCount[i]-e.blkIndent>=4)break;if(c=Cf(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(!Gd(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&&!Gd(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=Af(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"),b=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 b=e.tight,_=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]=_,e.sCount[l]=x,e.tight=b,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=Af(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=b,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(!Gd(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(!Gd(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(!Gd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i)&&g)for(g="",i=f,s=h;i<o;){if(!Gd(l.charCodeAt(i)))break;i++}if(i<o&&10!==l.charCodeAt(i))return!1;const v=Jd(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<Ff.length&&!Ff[a][0].test(s);a++);if(a===Ff.length)return!1;if(r)return Ff[a][2];let l=t+1;const c=Ff[a][1].test("");if(!Ff[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),Ff[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&&!Gd(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);const l=e.skipCharsBack(o,35,i);l>i&&Gd(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=Qd(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=Qd(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=Qd(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 Pf(){this.ruler=new rf;for(let e=0;e<Of.length;e++)this.ruler.push(Of[e][0],Of[e][1],{alt:(Of[e][2]||[]).slice()})}function Mf(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 Lf(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}}Pf.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)}},Pf.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)},Pf.prototype.State=Ef,Mf.prototype.pushPending=function(){const e=new of("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Mf.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new of(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},Mf.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=Hd(i)||Wd(i),c=Hd(a)||Wd(a),u=Vd(i),d=Vd(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}},Mf.prototype.Token=of;const zf=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;const jf=[];for(let xwe=0;xwe<256;xwe++)jf.push(0);function Uf(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){jf[e.charCodeAt(0)]=1});const Bf={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;Uf(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Uf(e,t[r].delimiters)}};function $f(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 qf={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;$f(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&$f(e,t[r].delimiters)}};const Gf=/^([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])?)*)$/,Vf=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;const Kf=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Wf=/^&([a-z][a-z0-9]{1,31});/i;function Hf(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 Jf=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!Lf(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(zf);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&&Gd(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),Gd(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!==jf[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",Bf.tokenize],["emphasis",qf.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),Gd(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),Gd(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),Gd(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[Jd(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),Gd(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),Gd(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),Gd(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[Jd(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(Vf.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(Gf.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(Df);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(Kf);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=Dd(t)?Id(t):Id(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{const r=e.src.slice(n).match(Wf);if(r){const n=function(e){return Cd(e,bd.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}]],Xf=[["balance_pairs",function(e){const t=e.tokens_meta,n=e.tokens_meta.length;Hf(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&Hf(t[r].delimiters)}],["strikethrough",Bf.postProcess],["emphasis",qf.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 Qf(){this.ruler=new rf;for(let e=0;e<Jf.length;e++)this.ruler.push(Jf[e][0],Jf[e][1]);this.ruler2=new rf;for(let e=0;e<Xf.length;e++)this.ruler2.push(Xf[e][0],Xf[e][1])}function Yf(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Zf(e){return Object.prototype.toString.call(e)}function eh(e){return"[object Function]"===Zf(e)}function th(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}Qf.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},Qf.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()},Qf.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)},Qf.prototype.State=Mf;const nh={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};const rh={"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}}},ih="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function oh(e){const t=e.re=function(e){const t={};e=e||{},t.src_Any=od.source,t.src_Cc=sd.source,t.src_Z=cd.source,t.src_P=ad.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]"===Zf(n))return!function(e){return"[object RegExp]"===Zf(e)}(n.validate)?eh(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(eh(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===Zf(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(th).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 sh(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 ah(e,t){if(!(this instanceof ah))return new ah(e,t);var n;t||(n=e,Object.keys(n||{}).reduce(function(e,t){return e||nh.hasOwnProperty(t)},!1)&&(t=e,e={})),this.__opts__=Yf({},nh,t),this.__schemas__=Yf({},rh,e),this.__compiled__={},this.__tlds__=ih,this.__tlds_replaced__=!1,this.re={},oh(this)}ah.prototype.add=function(e,t){return this.__schemas__[e]=t,oh(this),this},ah.prototype.set=function(e){return this.__opts__=Yf(this.__opts__,e),this},ah.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))},ah.prototype.pretest=function(e){return this.re.pretest.test(e)},ah.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},ah.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 sh(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},ah.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 sh(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},ah.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(),oh(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,oh(this),this)},ah.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},ah.prototype.onCompile=function(){};const lh=2147483647,ch=36,uh=/^xn--/,dh=/[^\0-\x7F]/,fh=/[\x2E\u3002\uFF0E\uFF61]/g,hh={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ph=Math.floor,gh=String.fromCharCode;function mh(e){throw new RangeError(hh[e])}function vh(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(fh,".")).split("."),t).join(".");return r+i}function yh(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 bh=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:ch},_h=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},xh=function(e,t,n){let r=0;for(e=n?ph(e/700):e>>1,e+=ph(e/t);e>455;r+=ch)e=ph(e/35);return ph(r+36*e/(e+38))},Sh=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&&mh("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=ch;;i+=ch){a>=n&&mh("invalid-input");const s=bh(e.charCodeAt(a++));s>=ch&&mh("invalid-input"),s>ph((lh-r)/t)&&mh("overflow"),r+=s*t;const l=i<=o?1:i>=o+26?26:i-o;if(s<l)break;const c=ch-l;t>ph(lh/c)&&mh("overflow"),t*=c}const l=t.length+1;o=xh(r-s,l,0==s),ph(r/l)>lh-i&&mh("overflow"),i+=ph(r/l),r%=l,t.splice(r++,0,i)}return String.fromCodePoint(...t)},wh=function(e){const t=[],n=(e=yh(e)).length;let r=128,i=0,o=72;for(const l of e)l<128&&t.push(gh(l));const s=t.length;let a=s;for(s&&t.push("-");a<n;){let n=lh;for(const t of e)t>=r&&t<n&&(n=t);const l=a+1;n-r>ph((lh-i)/l)&&mh("overflow"),i+=(n-r)*l,r=n;for(const c of e)if(c<r&&++i>lh&&mh("overflow"),c===r){let e=i;for(let n=ch;;n+=ch){const r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;const i=e-r,s=ch-r;t.push(gh(_h(r+i%s,0))),e=ph(i/s)}t.push(gh(_h(e,0))),o=xh(i,l,a===s),i=0,++a}++i,++r}return t.join("")},Eh=function(e){return vh(e,function(e){return dh.test(e)?"xn--"+wh(e):e})},kh=function(e){return vh(e,function(e){return uh.test(e)?Sh(e.slice(4).toLowerCase()):e})},Ch={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"]}}}},Ah=/^(vbscript|javascript|file|data):/,Nh=/^data:image\/(gif|png|jpeg|webp);/;function Th(e){const t=e.trim().toLowerCase();return!Ah.test(t)||Nh.test(t)}const Rh=["http:","https:","mailto:"];function Dh(e){const t=rd(e,!0);if(t.hostname&&(!t.protocol||Rh.indexOf(t.protocol)>=0))try{t.hostname=Eh(t.hostname)}catch(Jy){}return qu(Gu(t))}function Ih(e){const t=rd(e,!0);if(t.hostname&&(!t.protocol||Rh.indexOf(t.protocol)>=0))try{t.hostname=kh(t.hostname)}catch(Jy){}return Bu(Gu(t),Bu.defaultChars+"%")}function Fh(e,t){if(!(this instanceof Fh))return new Fh(e,t);t||Ad(e)||(t=e||{},e="default"),this.inline=new Qf,this.block=new Pf,this.core=new wf,this.renderer=new nf,this.linkify=new ah,this.validateLink=Th,this.normalizeLink=Dh,this.normalizeLinkText=Ih,this.utils=Zd,this.helpers=Td({},ef),this.options={},this.configure(e),t&&this.set(t)}function Oh(e){return"var("+e+")"}Fh.prototype.set=function(e){return Td(this.options,e),this},Fh.prototype.configure=function(e){const t=this;if(Ad(e)){const t=e;if(!(e=Ch[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},Fh.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},Fh.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},Fh.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},Fh.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},Fh.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Fh.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Fh.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let Ph=Ls([zo("color",Oh(bt.textPrimary)),zo("font-size",Oh(xt.sizeSm)),zo("line-height",Oh(xt.lineHeightRelaxed)),zo("word-break","break-word"),xs("& > :first-child",[zo("margin-top","0")]),xs("& > :last-child",[zo("margin-bottom","0")]),xs("& h1, & h2, & h3, & h4, & h5, & h6",[zo("margin","var("+_t.md+") 0 var("+_t.sm+")"),zo("line-height",Oh(xt.lineHeightTight)),zo("font-weight",Oh(xt.weightBold))]),xs("& h1",[zo("font-size",Oh(xt.sizeXl))]),xs("& h2",[zo("font-size",Oh(xt.sizeLg))]),xs("& h3, & h4, & h5, & h6",[zo("font-size",Oh(xt.sizeMd))]),xs("& p",[zo("margin","var("+_t.sm+") 0")]),xs("& a",[zo("color",Oh(bt.brand)),zo("text-decoration","none")]),xs("& a:hover",[zo("text-decoration","underline")]),xs("& ul, & ol",[zo("margin","var("+_t.sm+") 0"),zo("padding-left","1.5em")]),xs("& li",[zo("margin","var("+_t.xs+") 0")]),xs("& code",[zo("font-family",Oh(xt.fontFamilyMono)),zo("font-size","0.9em"),zo("background",Oh(bt.surfaceSubtle)),zo("padding","1px 4px"),zo("border-radius",Oh(St.sm))]),xs("& pre",[zo("background",Oh(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Oh(St.md)),zo("padding",Oh(_t.md)),zo("overflow","auto"),zo("margin","var("+_t.sm+") 0")]),xs("& pre code",[zo("background","none"),zo("padding","0")]),xs("& blockquote",[zo("margin","var("+_t.sm+") 0"),zo("padding-left",Oh(_t.md)),zo("border-left","3px solid var("+bt.border+")"),zo("color",Oh(bt.textSecondary))]),xs("& table",[zo("border-collapse","collapse"),zo("margin","var("+_t.sm+") 0")]),xs("& th, & td",[zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("text-align","left")]),xs("& th",[zo("background",Oh(bt.surfaceSubtle)),zo("font-weight",Oh(xt.weightMedium))]),xs("& img",[zo("max-width","100%"),zo("border-radius",Oh(St.sm))]),xs("& hr",[zo("border","none"),zo("border-top","1px solid var("+bt.borderSubtle+")"),zo("margin","var("+_t.md+") 0")])]),Mh=new Fh({html:!1,linkify:!0});let Lh=function(e){let t=e.source,n=p(()=>Mh.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:Ph,dangerouslySetInnerHTML:{__html:n}})};function zh(e,t){return i(Lh,{source:e.body})}function jh(e){return Array.from(e).length}function Uh(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 Bh(e,t){return j(t,t=>{let n=Uh(e,t)[1];return""===n?void 0:n})}function $h(e){return"var("+e+")"}let qh=Ls([qo("flex"),Go("column"),zo("gap","4px")]),Gh=Ls([zo("background",$h(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",$h(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("font-family","inherit"),zo("font-size",$h(xt.sizeMd)),zo("line-height",$h(xt.lineHeightNormal)),zo("color",$h(bt.textPrimary)),zo("outline","none"),zo("resize","vertical"),bs({NAME:"percent",VAL:100}),zo("box-sizing","border-box"),zo("transition","border-color 120ms"),Es([zo("border-color",$h(bt.brand))])]),Vh=Ls([zo("border-color",$h(bt.error)),Es([zo("border-color",$h(bt.error))])]),Kh=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",$h(_t.sm)),zo("font-size",$h(xt.sizeXs)),zo("color",$h(bt.textSecondary))]),Wh=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("color",$h(bt.textSecondary))]),Hh=Ls([zo("font-variant-numeric","tabular-nums")]),Jh=Ls([zo("color",$h(bt.error)),zo("font-weight",$h(xt.weightMedium))]),Xh=Ls([zo("background",$h(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-left","3px solid var("+bt.error+")"),zo("border-radius",$h(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("font-size",$h(xt.sizeXs)),zo("line-height",$h(xt.lineHeightNormal)),zo("white-space","pre-wrap"),zo("word-break","break-word"),zo("max-height","8em"),zo("overflow","auto")]),Qh=Ls([zo("color",$h(bt.textSecondary)),zo("font-size",$h(xt.sizeXs)),is(Ts(2))]),Yh=Ls([zo("color",$h(bt.textPrimary))]),Zh=Ls([zo("color",$h(bt.error)),zo("font-weight",$h(xt.weightMedium))]),ep=Ls([zo("color",$h(bt.textDisabled)),zo("text-decoration","line-through")]);function tp(e){return e.toString()+" character"+(1===e?"":"s")}function np(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 rp=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=Bh(d,l),v=$(m),y=p||v?Gh+" "+Vh:Gh;if(void 0!==m&&void 0!==l){let e=Uh(d,l);t=r("div",{children:[i("div",{children:"Sent as:",className:Qh}),r("div",{children:[i("span",{children:e[0],className:Yh}),i("span",{children:"✂",className:Zh}),i("span",{children:m,className:ep})],className:Xh})]})}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:Wh}),i("span",{children:np(g,l),className:v?Hh+" "+Jh:Hh})],className:Kh}),t],className:qh})};function ip(e){return"var("+e+")"}fu({id:"email",label:"Email",constraints:{subjectMaxLength:78,note:"Subject lines are elided in inbox lists past ~78 characters"},preview:ju}),fu({id:"markdown",label:"Markdown",constraints:{},preview:zh});let op=Ls([qo("flex"),Go("column"),zo("gap",ip(_t.sm)),zo("background",ip(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",ip(St.md)),zo("padding",ip(_t.md))]),sp=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",ip(_t.sm))]),ap=Ls([zo("font-size",ip(xt.sizeSm)),zo("font-weight",ip(xt.weightMedium)),zo("color",ip(bt.textPrimary))]),lp=Ls([zo("font-size",ip(xt.sizeXs)),zo("color",ip(bt.textSecondary))]),cp=Ls([zo("font-size",ip(xt.sizeXs)),zo("color",ip(bt.textSecondary)),zo("font-variant-numeric","tabular-nums"),zo("white-space","nowrap")]),up=Ls([zo("color",ip(bt.error)),zo("font-weight",ip(xt.weightMedium))]),dp=Ls([qo("flex"),jo("baseline"),Jo("spaceBetween"),zo("gap",ip(_t.sm)),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),zo("padding-bottom",ip(_t.xs))]),fp=Ls([zo("font-size",ip(xt.sizeMd)),zo("font-weight",ip(xt.weightMedium)),zo("color",ip(bt.textPrimary)),zo("word-break","break-word")]),hp=Ls([zo("color",ip(bt.textDisabled)),zo("text-decoration","line-through")]),pp=Ls([zo("color",ip(bt.error)),zo("font-weight",ip(xt.weightMedium))]),gp=Ls([zo("margin","0"),zo("font-family","inherit"),zo("font-size",ip(xt.sizeSm)),zo("line-height",ip(xt.lineHeightRelaxed)),zo("color",ip(bt.textPrimary)),zo("white-space","pre-wrap"),zo("word-break","break-word")]),mp=Ls([zo("max-width","100%"),zo("border-radius",ip(St.sm)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("object-fit","cover")]),vp=Ls([zo("font-size",ip(xt.sizeXs)),zo("color",ip(bt.error)),zo("background",ip(bt.surfaceSubtle)),zo("border-left","3px solid var("+bt.error+")"),zo("border-radius",ip(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")")]);function yp(e,t){let n=Uh(e,t),s=n[1];return""===s?e:r(o,{children:[n[0],i("span",{children:"✂",className:pp}),i("span",{children:s,className:hp})]})}let bp=function(e){let t=e.showHeader,n=e.message,o=e.channelId,s=void 0===t||t,l=hu(o);a(()=>{q(l)&&function(e,t){if(gu.contents.some(t=>t===e))return;gu.contents.push(e);let n=Ye(du).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,pu,e=>e.constraints),f=jh(n.body),h=Bh(n.body,d.maxLength),p=n.subject;if(void 0!==p){let e=d.subjectMaxLength,t=jh(p),n=L(e,!1,e=>t>e);c=r("div",{children:[i("span",{children:void 0!==e?yp(p,e):p,className:fp}),void 0!==e?i("span",{children:t.toString()+" / "+e.toString(),className:n?cp+" "+up:cp}):null],className:dp})}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?yp(n.body,e):n.body,className:gp})}let v,y=n.imageUrl;if(void 0!==y){let e=d.mediaAspect;v=i("img",{className:mp,style:void 0!==e?Ru({},"aspectRatio",e):{},alt:"Message media",src:He(y)})}else v=null;let b=d.note;return r("div",{children:[s?r("div",{children:[i("span",{children:u,className:ap}),i("span",{children:np(f,d.maxLength),className:$(h)?cp+" "+up:cp})],className:sp}):null,c,g,void 0!==h?i("div",{children:tp(jh(h))+" past the limit — "+u+" will cut the tail.",className:vp}):null,v,void 0!==b?i("span",{children:b,className:lp}):null],className:op})};function _p(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 xp(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 Sp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,wp=Sp&&"documentMode"in document?document.documentMode:null,Ep=Sp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),kp=Sp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cp=!(!Sp||!("InputEvent"in window)||wp)&&"getTargetRanges"in new window.InputEvent("input"),Ap=Sp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Np=Sp&&/Android/.test(navigator.userAgent),Tp=Sp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Np,Rp=Sp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dp=Sp&&Np&&Rp,Ip=Sp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ep&&!Rp,Fp=0,Op=1,Pp=2,Mp=1,Lp=2,zp=3,jp=4,Up=5,Bp=6,$p=Tp||Ap||Ip?" ":"​",qp="\n\n",Gp=kp?" ":$p,Vp={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Kp={directionless:1,unmergeable:2},Wp={center:2,end:6,justify:4,left:1,right:3,start:5},Hp={[Lp]:"center",[Bp]:"end",[jp]:"justify",[Mp]:"left",[zp]:"right",[Up]:"start"},Jp={normal:0,segmented:2,token:1},Xp={[Fp]:"normal",[Pp]:"segmented",[Op]:"token"},Qp="$config";function Yp(){return TS()._blockCursorElement}function Zp(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let eg,tg=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&&_p(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&_p(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&_p(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=ng(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=ng(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 ng(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class rg extends tg{withBefore(e){return new rg(this.element,e,this.after)}withAfter(e){return new rg(this.element,this.before,e)}withElement(e){return this.element===e?this:new rg(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Zp(t);)e=t,t=t.nextSibling;const n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===Yp()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(Ip||Ap||Tp);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=pS().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(i,r),e){const e=pS().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=Yp(),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=ig(t,n);i.push(r);const o=ig(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 ig(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&&_p(225),n.reverse()}try{eg="0.48.0+prod.esm"}catch(_p){}const og=eg??'"<unknown>+source"';let sg=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 ag=null;function lg(e,t=1e3){return e instanceof cg?e.clone():e.size<t?new Map(e):(new cg).init(new Map(e),void 0,e.size)}let cg=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===ag?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!==ag?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!==ag&&void 0!==n||(this._size++,n===ag&&r.delete(e)),r.set(e,t),this}delete(e){const t=this.has(e);return t&&(this.getNursery().set(e,ag),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!==ag&&(void 0!==r&&(n[1]=r),yield n)}if(e)for(const n of e)n[1]===ag||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 ug(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)||QS(s)&&null!==s.__slots)&&ug(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}for(const s of QS(e)&&null!==e.__slots?e.__slots.values():[]){const e=r.get(s);void 0!==e&&YS(e)&&e.__slotHost===t&&((x_(e)||QS(e)&&null!==e.__slots)&&ug(e,s,n,r,i,o),n.has(s)||o.delete(s),i.push(s))}}let dg=!1,fg=0;function hg(e){fg=e.timeStamp}function pg(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Sx(e,n)}function gg(e,t,n){const r=lS(Zx(n)),i=r&&mS(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&&Px(t,a,o,s,!1)}function mg(e,t,n){if(nb(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return ux(t)&&n.isAttached()}function vg(e,t,n){for(let r=e;r&&!US(r);r=Hx(r)){const e=Sx(r,t);if(void 0!==e){const t=bx(e,n);if(t)return E_(t)||!xS(r)?void 0:[r,t]}}}function yg(e,t,n){dg=!0;const r=performance.now()-fg>100;try{y_(e,()=>{const i=Nb()||function(e){return e.read("latest",()=>{const e=Nb();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=vg(f,e,s);if(!h)continue;const[p,g]=h;if("characterData"===d)r&&Vy(g)&&ux(f)&&mg(i,f,g)&&gg(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=_x(n),o=n.parentNode;if(!(null==o||n===a||null!==r||pg(n,o,e)||e._slotsUsed&&xS(n)&&n.hasAttribute("data-lexical-slot")||US(n))){if(kp){const e=(xS(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];(pg(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||pg(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(l&&Ax(i),kp&&Vx(e)&&i.insertRawText(c))})}finally{dg=!1}}function bg(e){const t=e._observer;null!==t&&yg(e,t.takeRecords(),t)}function _g(e){!function(e){0===fg&&Zx(e).addEventListener("textInput",hg,!0)}(e),e._observer=new MutationObserver((t,n)=>{yg(e,t,n)})}const xg="latest";let Sg=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Ig).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function wg(e,t){return new Sg(e,t)}function Eg(e,t,n=xg){const r=(n===xg?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function kg(e,t,n){let r;if(e_(),"function"==typeof n){const i=e.getLatest(),o=Eg(i,t);if(r=n(o),t.isEqual(o,r))return i}else r=n;const i=e.getWritable();return Tg(i).updateFromKnown(t,r),i}function Cg(e){const t=new Map,n=new Set;for(const{ownNodeConfig:r}of VS("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 Ag=new Set(["__proto__","constructor","prototype"]);let Ng=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 Dg(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(Ag.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=Dg(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(Ag.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 Tg(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Ng(t,Rg(t));return t.__state=n,n}function Rg(e){return e.__state?e.__state.sharedNodeState:ex(TS(),e.getType()).sharedNodeState}function Dg(e){if(e)for(const t in e)return e}function Ig(e){return e}function Fg(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 Og(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 Pg(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Mg(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&&Fg(n,e,t)||t&&Fg(n,t,e)||e&&Og(n,e,t)||t&&Og(n,t,e))}(l,c))}function Lg(e,t){const n=e.mergeWithSibling(t),r=r_()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function zg(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Vy(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Mg(t,r)){r=Lg(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Vy(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Mg(r,n)){r=Lg(r,n);break}break}n.remove()}}else r.remove()}function jg(e){return Ug(e.anchor),Ug(e.focus),e}function Ug(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),Vy(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 Bg=Symbol.for("@lexical/CachedTextSize");function $g(e,t){return om.read(()=>{let n=0,r=e;for(let e=0;e<t&&null!==r;e++){const i=im.get(r);if(void 0===i&&_p(345,r),x_(i)){const o=sm.get(r);if(void 0!==o&&x_(o)&&o.__parent!==i.__parent)n+=i.getTextContentSize();else{const e=am.get(r),t=e&&e.__lexicalTextContent;"string"!=typeof t&&_p(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{const e=i[Bg];void 0===e&&_p(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:Kg})}function qg(e){x_(e)||void 0===e[Bg]&&(e[Bg]=Vy(e)?e.__text.length:e.getTextContentSize())}const Gg=4;let Vg,Kg,Wg,Hg="",Jg=null,Xg=null,Qg=null;function Yg(){return{firstTextKey:Qg,format:Jg,style:Xg}}function Zg(e){null!==e.firstTextKey&&(Jg=e.format,Xg=e.style,Qg=e.firstTextKey)}function em(e){if(null!==Qg)return;const t=e.__lexicalFirstTextKey;if(void 0===t&&_p(348),null===t)return;const n=sm.get(t);Vy(n)&&(Jg=n.getFormat(),Xg=n.getStyle(),Qg=t)}let tm,nm,rm,im,om,sm,am,lm,cm,um,dm=!1,fm=!1;function hm(e,t){const n=im.get(e),r=sm.has(e);if(null!==t){const n=Mm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(Kg._keyToDOMMap.delete(e),x_(n)){const e=HS(n,im);pm(e,0,e.length-1,null)}if(void 0!==n){for(const e of wm(n).values()){const t=km(e);hm(e,null),null!==t&&t.remove()}qx(cm,Wg,tm,n,"destroyed")}}}function pm(e,t,n,r){for(let i=t;i<=n;++i){const t=e[i];void 0!==t&&hm(t,r)}}function gm(e,t){e.setProperty("text-align",t)}const mm="40px";function vm(e,t){const n=Vg.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, ${mm}))`)}function ym(e,t){const n=e.style;0===t?gm(n,""):1===t?gm(n,"left"):2===t?gm(n,"center"):3===t?gm(n,"right"):4===t?gm(n,"justify"):5===t?gm(n,"start"):6===t&&gm(n,"end")}function bm(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(C_(e))return null;const n=e.getParent();return null===n||nS(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function _m(e){const t=pS().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function xm(e,t,n){t||"false"===e.contentEditable?function(e,t=TS()){const n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,Kg):n.removeAttribute("contenteditable")}function Sm(e,t,n){const r=Hg,i=Yg();Hg="";let o="";const s=E_(e);for(const[a,l]of n){const n=_m(a);xm(t,s,n),t.appendChild(n),Hg="";const r=Yg();Am(l,DS(e,n,Kg)),Zg(r),Em(e,a,t,n),o+=Hg}return Zg(i),Hg=r,o}function wm(e){return QS(e)&&null!==e.__slots?e.__slots:XS}function Em(e,t,n,r){const i=um.$getSlotTargetElement(e,t,n,Kg);null!==i&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function km(e){const t=am.get(e);return void 0!==t?t.parentElement:null}function Cm(e,t,n){const r=wm(e),i=wm(t);for(const[u,d]of r)if(!i.has(u)){const e=km(d);hm(d,null),null!==e&&e.remove()}const o=Hg,s=Yg();let a="",l=null;const c=E_(t);for(const[u,d]of i){const e=r.get(u);let i=void 0!==e?km(e):null;Hg="";const o=Yg();if(null===i){i=_m(u);let e=null;for(const t of n.children)if(!t.hasAttribute("data-lexical-slot")){e=t;break}n.insertBefore(i,e),Am(d,DS(t,i,Kg))}else e===d?Im(d,i):(void 0!==e&&hm(e,i),Am(d,DS(t,i,Kg)));if(Zg(o),xm(n,c,i),Em(t,u,n,i),a+=Hg,i.parentElement===n){const e=null===l?n.firstChild:l.nextSibling;e!==i&&n.insertBefore(i,e),l=i}}return Zg(s),Hg=o,a}function Am(e,t){const n=sm.get(e);if(void 0===n&&_p(60),null!==t){const r=im.get(e);if(void 0!==r){const i=am.get(e);if(void 0!==i){const o=YS(r)?r.__slotHost:null,s=YS(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),Im(e,t.element)}}}const r=um.$createDOM(n,Kg);if(function(e,t,n){const r=n._keyToDOMMap;xx(t,n,e),r.set(e,t)}(e,r,Kg),Vy(n)?r.setAttribute("data-lexical-text","true"):E_(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;bm(r,n),0!==e&&vm(r,e);const i=wm(n),o=i.size>0?Sm(n,r,i):"";if(0===t)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,Hg+=o,i.size>0&&(r.__lexicalSlotTextLength=o.length);else{const e=Hg,s=t-1;if(Nm(HS(n,sm),n,0,s,DS(n,r,Kg)),""!==o){const t=r.__lexicalTextContent||"";r.__lexicalTextContent=o+t,Hg=e+o+t}i.size>0&&(r.__lexicalSlotTextLength=o.length)}const s=n.__format;0!==s&&ym(r,s),n.isInline()||Tm(null,n,r)}else{const t=n.getTextContent();if(E_(n)){const t=n.decorate(Kg,Vg);null!==t&&Fm(e,t),r.contentEditable="false";const i=wm(n);i.size>0&&Sm(n,r,i)}Hg+=t}return null!==t&&t.insertChild(r),um.$decorateDOM(n,null,r,Kg),qg(n),qx(cm,Wg,tm,n,"created"),r}function Nm(e,t,n,r,i){const o=Hg,s=Yg();Hg="",Jg=null,Xg=null,Qg=null;let a=n;for(;a<=r;++a){const t=Yg();Am(e[a],i);const n=sm.get(e[a]);null!==n&&Vy(n)?null===Jg&&(Jg=n.getFormat(),Xg=n.getStyle(),Qg=n.__key):x_(n)&&a<r&&!n.isInline()&&(Hg+=qp),Zg(t)}const l=Kg._keyToDOMMap.get(t.__key);void 0===l&&_p(349,t.__key),l.__lexicalTextContent=Hg,l.__lexicalFirstTextKey=Qg,Hg=o+Hg,Zg(s)}function Tm(e,t,n){const r=DS(t,n,Kg),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 P_(e)?"line-break":E_(e)&&e.isInline()?"decorator":null}return wm(e).size>0?null:"empty"}return null}(t,sm);i!==o&&r.setManagedLineBreak(o)}function Rm(e,t,n){var r;Jg=null,Xg=null,Qg=null,function(e,t,n){const r=Hg,i=e.__size,o=t.__size;Hg="";const s=n.element,a=Kg._keyToDOMMap.get(t.__key);void 0===a&&_p(351,t.__key);const l=o-i;if(!dm&&Math.abs(l)<=1&&i>=Gg&&e.__first===t.__first&&(0!==l||!Kg._cloneNotNeeded.has(e.__key))){const i=a.__lexicalTextContent,c=lm.get(e.__key);if(!dm&&"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=sm.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=$g(o,u);let n=o,l=0;for(;null!==n&&l<u;){const e=sm.get(n);if(void 0===e)break;const t=Yg();Im(n,s),Vy(e)&&null===Jg&&(Jg=e.getFormat(),Xg=e.getStyle(),Qg=e.__key),Zg(t),n=e.__next,l++}let d="";for(n=o,l=0;null!==n&&l<u;){const e=sm.get(n);if(void 0===e)break;let t;if(x_(e)){const r=Kg._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;"string"!=typeof i&&_p(352,e.getType()),t=i}else t=e.getTextContent();d+=t,l<u-1&&x_(e)&&!e.isInline()&&(d+=qp),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,Hg=r+p,void Dm(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=im.get(c);if(void 0===e)return!1;c=e.__prev}if(null===c)return!1;const u=sm.get(o),d=im.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=sm.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=im.get(h);h=e?e.__next:null}const g=new Set(p),m=new Set(f),v=[];let y=0,b=0;for(;y<l&&b<s;)if(f[b]===p[y])v.push({key:f[b],kind:"reconcile"}),y++,b++;else if(m.has(p[y])){if(g.has(f[b]))return!1;v.push({key:f[b],kind:"create",nextIndex:b}),b++}else v.push({key:p[y],kind:"destroy"}),y++;for(;y<l;)v.push({key:p[y++],kind:"destroy"});for(;b<s;)v.push({key:f[b],kind:"create",nextIndex:b}),b++;const _=$g(c,l);for(const E of v){const e=Yg();if("reconcile"===E.kind)Im(E.key,n.element);else if("destroy"===E.kind)hm(E.key,n.element);else{let e=null;for(let t=E.nextIndex+1;t<s;t++){const n=Kg._keyToDOMMap.get(f[t]);if(void 0!==n){e=n;break}}Am(E.key,n.withBefore(e??n.before))}if("destroy"!==E.kind){const e=sm.get(E.key);e&&Vy(e)&&null===Jg&&(Jg=e.getFormat(),Xg=e.getStyle(),Qg=e.__key)}Zg(e)}let x="";for(let E=0;E<s;E++){const e=sm.get(f[E]);if(void 0===e)return!1;let t;if(x_(e)){const n=Kg._keyToDOMMap.get(f[E]),r=n&&n.__lexicalTextContent;"string"!=typeof r&&_p(350,e.getType()),t=r}else t=e.getTextContent();x+=t,E<s-1&&x_(e)&&!e.isInline()&&(x+=qp)}const S=r.__lexicalSlotTextLength||0,w=S>0?i.slice(S):i;return r.__lexicalTextContent=w.slice(0,w.length-_)+x,!0}(e,0,n,a,i,o,u,l)){const e=a.__lexicalTextContent;return"string"!=typeof e&&_p(353),Hg=r+e,void Dm(t,a,c)}}}if(0===l){let t=e.__first,n=0;for(;null!==t;){const e=sm.get(t);if(void 0===e)break;const r=dm||rm.has(t)||nm.has(t),i=Yg();if(r)Im(t,s);else{let n,r;if(x_(e)){r=am.get(t);const i=r&&r.__lexicalTextContent;"string"!=typeof i&&_p(354,e.getType()),n=i}else n=e.getTextContent();Hg+=n,void 0!==r&&em(r)}Vy(e)?null===Jg&&(Jg=e.getFormat(),Xg=e.getStyle(),Qg=e.__key):x_(e)&&n<o-1&&!e.isInline()&&(Hg+=qp),Zg(i),t=e.__next,n++}return a.__lexicalTextContent=Hg,a.__lexicalFirstTextKey=Qg,void(Hg=r+Hg)}}if(1===i&&1===o){const r=e.__first,i=t.__first;if(r===i)Im(r,s);else{const e=Mm(r),t=Am(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}hm(r,null)}const o=sm.get(i);Vy(o)&&null===Jg&&(Jg=o.getFormat(),Xg=o.getStyle(),Qg=o.__key)}else{const r=HS(e,im),a=HS(t,sm);if(r.length!==i&&_p(227),a.length!==o&&_p(228),0===i)0!==o&&Nm(a,t,0,o-1,n);else if(0===o){if(0!==i){const e=null==n.after&&null==n.before&&0===wm(t).size&&null==n.element.__lexicalLineBreak;pm(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=Yg();if(e===r)u=Om(Im(r,o.element)),d++,f++;else{if(void 0===c&&(c=Pm(n,f)),void 0===l)l=Pm(t,d);else if(!l.has(e)){d++,Zg(i);continue}if(!c.has(e)){u=Om(Mm(e)),hm(e,o.element),d++,l.delete(e),Zg(i);continue}if(l.has(r)){const e=Wx(Kg,r);e!==u&&o.withBefore(u??o.before).insertChild(e),u=Om(Im(r,o.element)),d++,f++}else Am(r,o.withBefore(u??o.before)),f++}const s=sm.get(r);null!==s&&Vy(s)?null===Jg&&(Jg=s.getFormat(),Xg=s.getStyle(),Qg=s.__key):x_(s)&&f<=a&&!s.isInline()&&(Hg+=qp),Zg(i)}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1],r=void 0===t?null:Kg.getElementByKey(t);Nm(n,e,f,a,o.withBefore(r??o.before))}else p&&!h&&pm(t,d,s,o.element)}(t,r,a,i,o,n)}a.__lexicalTextContent=Hg,a.__lexicalFirstTextKey=Qg,Hg=r+Hg}(e,t,DS(t,n,Kg)),nS(t)||(r=t,null==Jg||Jg===r.__textFormat||fm||r.setTextFormat(Jg),function(e){null==Xg||Xg===e.__textStyle||fm||e.setTextStyle(Xg)}(t))}function Dm(e,t,n){const r=t.__lexicalFirstTextKey;if(null!=r){const t=e.__key;let i=r;for(;null!==i;){const e=sm.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=sm.get(r);if(Vy(e))return Jg=e.getFormat(),void(Xg=e.getStyle())}}t.__lexicalFirstTextKey=Qg}function Im(e,t){const n=im.get(e);let r=sm.get(e);void 0!==n&&void 0!==r||_p(61);const i=dm||rm.has(e)||nm.has(e),o=Wx(Kg,e);if(n===r&&!i){let e;if(x_(n)){const t=o.__lexicalTextContent;"string"!=typeof t&&_p(355,n.getType()),e=t,em(o)}else e=n.getTextContent();return Hg+=e,o}if(n!==r&&i&&qx(cm,Wg,tm,r,"updated"),um.$updateDOM(r,n,o,Kg)){const n=Am(e,null);return null===t&&_p(62),t.replaceChild(n,o),hm(e,null),n}if(x_(n)){x_(r)||_p(334,e);const t=r.__indent;(dm||t!==n.__indent)&&vm(o,t);const s=r.__format;(dm||s!==n.__format)&&ym(o,s);const a=i&&(wm(r).size>0||wm(n).size>0)?Cm(n,r,o):"";if(i){const e=Hg;if(Rm(n,r,o),C_(r)||r.isInline()||Tm(0,r,o),""!==a){const t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,Hg=e+a+t,o.__lexicalSlotTextLength=a.length}else(wm(r).size>0||wm(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const e=o.__lexicalTextContent;"string"!=typeof e&&_p(356,n.getType()),Hg+=e,em(o)}if((dm||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(bm(o,r),C_(r)&&!dm))for(const e of r.getChildren())x_(e)&&bm(Wx(Kg,e.getKey()),e)}else{const t=r.getTextContent();if(E_(r)){const t=r.decorate(Kg,Vg);null!==t&&Fm(e,t),i&&(wm(r).size>0||wm(n).size>0)&&Cm(n,r,o)}Hg+=t}if(!fm&&C_(r)){const e=r.getLatest();if(e.__cachedText!==Hg){const t=e.getWritable();t.__cachedText=Hg,r=t}}return um.$decorateDOM(r,n,o,Kg),qg(r),o}function Fm(e,t){let n=Kg._pendingDecorators;const r=Kg._decorators;if(null===n){if(r[e]===t)return;n=Ex(Kg)}n[e]=t}function Om(e){let t=e.nextSibling;return null!==t&&t===Kg._blockCursorElement&&(t=t.nextSibling),t}function Pm(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Mm(e){const t=am.get(e);return void 0===t&&_p(75,e),t}function Lm(e){return{type:e}}const zm=Lm("SELECTION_CHANGE_COMMAND"),jm=Lm("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Um=Lm("CLICK_COMMAND"),Bm=Lm("BEFORE_INPUT_COMMAND"),$m=Lm("INPUT_COMMAND"),qm=Lm("COMPOSITION_START_COMMAND"),Gm=Lm("COMPOSITION_END_COMMAND"),Vm=Lm("DELETE_CHARACTER_COMMAND"),Km=Lm("INSERT_LINE_BREAK_COMMAND"),Wm=Lm("INSERT_PARAGRAPH_COMMAND"),Hm=Lm("CONTROLLED_TEXT_INSERTION_COMMAND"),Jm=Lm("PASTE_COMMAND"),Xm=Lm("REMOVE_TEXT_COMMAND"),Qm=Lm("DELETE_WORD_COMMAND"),Ym=Lm("DELETE_LINE_COMMAND"),Zm=Lm("FORMAT_TEXT_COMMAND"),ev=Lm("SET_TEXT_FORMAT_COMMAND"),tv=Lm("UNDO_COMMAND"),nv=Lm("REDO_COMMAND"),rv=Lm("KEYDOWN_COMMAND"),iv=Lm("KEY_ARROW_RIGHT_COMMAND"),ov=Lm("MOVE_TO_END"),sv=Lm("KEY_ARROW_LEFT_COMMAND"),av=Lm("MOVE_TO_START"),lv=Lm("KEY_ARROW_UP_COMMAND"),cv=Lm("KEY_ARROW_DOWN_COMMAND"),uv=Lm("KEY_ENTER_COMMAND"),dv=Lm("KEY_SPACE_COMMAND"),fv=Lm("KEY_BACKSPACE_COMMAND"),hv=Lm("KEY_ESCAPE_COMMAND"),pv=Lm("KEY_DELETE_COMMAND"),gv=Lm("KEY_TAB_COMMAND"),mv=Lm("INSERT_TAB_COMMAND"),vv=Lm("INDENT_CONTENT_COMMAND"),yv=Lm("OUTDENT_CONTENT_COMMAND"),bv=Lm("DROP_COMMAND"),_v=Lm("FORMAT_ELEMENT_COMMAND"),xv=Lm("DRAGSTART_COMMAND"),Sv=Lm("DRAGOVER_COMMAND"),wv=Lm("DRAGEND_COMMAND"),Ev=Lm("COPY_COMMAND"),kv=Lm("CUT_COMMAND"),Cv=Lm("SELECT_ALL_COMMAND"),Av=Lm("CLEAR_EDITOR_COMMAND"),Nv=Lm("CLEAR_HISTORY_COMMAND"),Tv=Lm("CAN_REDO_COMMAND"),Rv=Lm("CAN_UNDO_COMMAND"),Dv=Lm("FOCUS_COMMAND"),Iv=Lm("BLUR_COMMAND"),Fv=Lm("KEY_MODIFIER_COMMAND");function Ov(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}const Pv=Object.freeze({}),Mv=[["keydown",function(e,t){const n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&Wv(n),t.isComposing()||Kx(t,rv,e)}],["pointerdown",function(e,t){const n=bS(e),r=e.pointerType;SS(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&y_(t,()=>{BS(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){Kx(t,qm,e)}],["compositionend",function(e,t){const n=t._inputState;kp?n.compositionPhase="ending-firefox":Ap||!Tp&&!Ip?Kx(t,Gm,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const n=t._inputState;Wv(n),y_(t,()=>{Jv(e,t)||t.dispatchCommand($m,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){y_(t,()=>{const n=Nb(),r=lS(Zx(t)),i=Tb();if(r)if(nb(n)){const e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!C_(t)&&1===Cx().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=mS(r,t._rootElement).anchorNode;(xS(n)||ux(n))&&Ax(Ab(i,r,t,e))}Kx(t,Um,e)})}],["cut",Pv],["copy",Pv],["dragstart",Pv],["dragover",Pv],["dragend",Pv],["paste",Pv],["focus",Pv],["blur",Pv],["drop",Pv]];Cp&&Mv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType;"deleteCompositionText"===n||kp&&Vx(t)||"insertCompositionText"!==n&&y_(t,()=>{Jv(e,t)||Kx(t,Bm,e)},{event:e})}(e,t)]);const Lv=new WeakMap,zv=new WeakMap,jv=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",oy),()=>e.removeEventListener("selectionchange",oy)));function Uv(e,t,n,r,i,o){const s=e.anchor,a=e.focus,l=s.getNode(),c=r_();let u;if(void 0!==o)u=o;else{const e=lS(Zx(c));u=null!==e?mS(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||!Vy(l)||(!i&&(!Cp||c._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||l.isDirty()&&p<2||Rx(n))&&s.offset!==a.offset&&!l.isComposing()||cx(l)||l.isDirty()&&p>1||(i||!Cp)&&null!==h&&!l.isComposing()&&d!==IS(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=lx(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Vy(t)||x_(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,l)}function Bv(e,t){return ux(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function $v(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=mS(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,Bv(r,i)&&Bv(o,s)&&!a.postDeleteSelectionToRestore)||y_(t,()=>{if(!n)return void Ax(null);if(!ix(t,r,o))return;let l=Nb();if(a.postDeleteSelectionToRestore&&nb(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(),Ax(l))}if(a.postDeleteSelectionToRestore=null,nb(l)){const n=l.anchor,c=n.getNode();if(l.isCollapsed()){"Range"===e.type&&r===o&&(l.dirty=!0);const i=Zx(t).event,s=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:h,timeStamp:p}=a.collapsedSelectionFormat,g=Cx(),m=!1===t.isComposing()&&""===g.getTextContent();if(s<p+200&&n.offset===f&&n.key===h)qv(l,u,d);else if("text"===n.type)Vy(c)||_p(141),Gv(l,c);else if("element"===n.type&&!m){x_(c)||_p(259);const e=n.getNode();e.isEmpty()?function(e,t){qv(e,t.getTextFormat(),t.getTextStyle())}(l,e):qv(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(Vy(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}}Kx(t,zm,void 0)})}function qv(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Gv(e,t){qv(e,t.getFormat(),t.getStyle())}function Vv(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function Kv(e){const{lastKeyCode:t}=r_()._inputState;if(null==e||e.length<=1||null==t)return;const n=1===t.length?t:"Enter"===t?"\n":"Tab"===t?"\t":null;if(!n)return;const r=Nb();if(!nb(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!Vy(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const e=i.getNextSibling();if("\n"===n){if(P_(e))e.selectEnd();else if(!e){const e=WS(i,wb),t=e&&e.getNextSibling();x_(t)&&t.selectStart()}}else"\t"===n?Jy(e)&&e.selectEnd():Vy(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}function Wv(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Hv(e){Wv(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Wv(e),0)}function Jv(e,t){const n=bS(e);if(xS(n)&&BS(n,t))return!0;const r=t.getRootElement();if(null===r)return!1;const i=yS(r.ownerDocument);return null!==i&&r.contains(i)&&BS(i,t)}function Xv(e){const t=e.inputType,n=Vv(e),r=r_(),i=r._inputState,o=Nb();if("insertText"===t&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Wv(i),e.preventDefault(),nb(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=Tb();if(!nb(e))return!0;Ax(e.clone())}if(nb(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(vx(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{y_(r,()=>{vx(null)})},30),nb(o)){const e=o.anchor.getNode();e.markDirty(),Vy(e)||_p(142),Gv(o,e)}}else{if(vx(null),Ap&&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=Dp&&t&&!c&&l;if(u&&o.isCollapsed()&&(u=!E_(function(e,t){const n=e.offset;if("element"===e.type)return Gx(e.getNode(),t,n);{const r=e.getNode();if(0===n||!t){const e=r.getPreviousSibling();return null===e?Gx(r.getParentOrThrow(),t,r.getIndexWithinParent()+0):e}}return null}(o.anchor,!0))),!u){Kx(r,Vm,!0);const e=Nb();Dp&&nb(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!nb(o))return!0;const s=e.data;null!==i.unprocessedBeforeInputData&&Ox(!1,r,i.unprocessedBeforeInputData),o.dirty&&null===i.unprocessedBeforeInputData||!o.isCollapsed()||C_(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(),Kx(r,Km,!1);else if(s===qp)e.preventDefault(),Kx(r,Wm,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Uv(o,n,s,e.timeStamp,!0)?(e.preventDefault(),Kx(r,Hm,s),Kv(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Kx(r,Hm,e),Kv((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const n=r._compositionKey;vx(null),t||Kx(r,Hm,e),ey(n);break}case"insertLineBreak":vx(null),Kx(r,Km,!1);break;case"insertParagraph":vx(null),i.isInsertLineBreak&&!Ap?(i.isInsertLineBreak=!1,Kx(r,Km,!1)):Kx(r,Wm,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Kx(r,Jm,e);break;case"deleteByComposition":(function(e,t){return e!==t||x_(e)||x_(t)||!lx(e)||!lx(t)})(c,u)&&Kx(r,Xm,e);break;case"deleteByDrag":Xx(Sy),Kx(r,Xm,e);break;case"deleteByCut":Kx(r,Xm,e);break;case"deleteContent":Kx(r,Vm,!1);break;case"deleteWordBackward":Kx(r,Qm,!0);break;case"deleteWordForward":Kx(r,Qm,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Kx(r,Ym,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Kx(r,Ym,!1);break;case"formatStrikeThrough":Kx(r,Zm,"strikethrough");break;case"formatBold":Kx(r,Zm,"bold");break;case"formatItalic":Kx(r,Zm,"italic");break;case"formatUnderline":Kx(r,Zm,"underline");break;case"historyUndo":Kx(r,tv,void 0);break;case"historyRedo":Kx(r,nv,void 0)}return!0}function Qv(e){const t=r_(),n=t._inputState,r=Nb(),i=e.data,o=Vv(e);let s=!1;if(null!=i&&nb(r)){const a=lS(Zx(t)),l=null!==a?mS(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()&&Vy(u)&&cx(u);if(!c&&!d&&Uv(r,o,i,e.timeStamp,!1,l)){if(s=!0,"ending-firefox"===n.compositionPhase){const e=ty(t,i);if(n.compositionPhase="idle",e)return Xx(Ey),Nx(),!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;Cp&&!r.isCollapsed()&&Vy(o)&&null!==l.anchorNode&&o.getTextContent().slice(0,u)+i+o.getTextContent().slice(u+d)===Fx(l.anchorNode)||Kx(t,Hm,i);const f=i.length;kp&&f>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),Dp&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,vx(null))}}return s||(Ox(!1,t,null!==i?i:void 0),"ending-firefox"===n.compositionPhase&&(ty(t,i||void 0),Xx(Ey),n.compositionPhase="idle")),Nx(),!0}function Yv(e){const t=r_(),n=t._inputState,r=Nb();if(nb(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(vx(i.key),Xx(wy),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===i.type||!r.isCollapsed()||!Dp&&(o.getFormat()!==r.format||Vy(o)&&o.getStyle()!==r.style)||Vy(o)&&(cx(o)||0===i.offset&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){Kx(t,Hm,Gp);const e=Nb();nb(e)&&vx(e.anchor.key)}}return!0}function Zv(e){const t=r_();return t._inputState.compositionPhase="idle",ty(t,e.data),Xx(Ey),!0}function ey(e){if(null===e)return;const t=bx(e);if(!Vy(t)||"text"===t.getType()||cx(t)||!t.isAttached())return;const n=Nb(),r=nb(n)&&n.anchor.key===e?n.anchor.offset:null,i=Gy(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 ty(e,t){const n=e._compositionKey;if(vx(null),null!==n&&null!=t){if(""===t){const t=bx(n),r=e.getElementByKey(n),i=null!==r&&Vy(t)?IS(t,r,e):null;if(null!==i&&null!==i.nodeValue&&Vy(t)){const n=lS(Zx(e)),r=n&&mS(n,e._rootElement);let o=null,s=null;null!==r&&r.anchorNode===i&&(o=r.anchorOffset,s=r.focusOffset),Px(t,i.nodeValue,o,s,!0)}return ey(n),!1}if("\n"===t[t.length-1]){const t=Nb();if(nb(t)||ib(t)){if(nb(t)){const e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return Kx(e,uv,null),ey(n),!1}}const r=bx(n);if(null!==r&&Vy(r)&&cx(r)){r.markDirty();const e=Nb(),i=r.getTextContentSize(),o=nb(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(o,o).insertText(t),!0}}return Ox(!0,e,t),ey(n),!1}function ny(e){const t=r_(),n=t._inputState;if(null==e.key)return!0;if("ending-safari"===n.compositionPhase){const r=Bx(e);if(r&&y_(t,()=>{ty(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if(function(e){return zx(e,"ArrowRight",{shiftKey:"any"})}(e))Kx(t,iv,e);else if(function(e){return zx(e,"ArrowRight",{...jx,shiftKey:"any"})}(e))Kx(t,ov,e);else if(function(e){return zx(e,"ArrowLeft",{shiftKey:"any"})}(e))Kx(t,sv,e);else if(function(e){return zx(e,"ArrowLeft",{...jx,shiftKey:"any"})}(e))Kx(t,av,e);else if(function(e){return zx(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))Kx(t,lv,e);else if(function(e){return zx(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))Kx(t,cv,e);else if(function(e){return zx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))n.isInsertLineBreak=!0,Kx(t,uv,e);else if(function(e){return" "===e.key}(e))Kx(t,dv,e);else if(function(e){return Ep&&zx(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,Kx(t,Km,!0);else if(function(e){return zx(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))n.isInsertLineBreak=!1,Kx(t,uv,e);else if(function(e){return zx(e,"Backspace",{shiftKey:"any"})||Ep&&zx(e,"h",{ctrlKey:!0})}(e))Bx(e)?Kx(t,fv,e)&&Hv(n):(e.preventDefault(),Kx(t,Vm,!0));else if(function(e){return"Escape"===e.key}(e))Kx(t,hv,e);else if(function(e){return zx(e,"Delete",{})||Ep&&zx(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),Kx(t,Vm,!1)):Kx(t,pv,e);else if(function(e){return zx(e,"Backspace",Ux)}(e))e.preventDefault(),Kx(t,Qm,!0);else if(function(e){return zx(e,"Delete",Ux)}(e))e.preventDefault(),Kx(t,Qm,!1);else if(function(e){return Ep&&zx(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),Kx(t,Ym,!0);else if(function(e){return Ep&&(zx(e,"Delete",{metaKey:!0})||zx(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),Kx(t,Ym,!1);else if(function(e){return zx(e,"b",jx)}(e))e.preventDefault(),Kx(t,Zm,"bold");else if(function(e){return zx(e,"u",jx)}(e))e.preventDefault(),Kx(t,Zm,"underline");else if(function(e){return zx(e,"i",jx)}(e))e.preventDefault(),Kx(t,Zm,"italic");else if(function(e){return zx(e,"Tab",{shiftKey:"any"})}(e))Kx(t,gv,e);else if(function(e){return zx(e,"z",jx)}(e))e.preventDefault(),Kx(t,tv,void 0);else if(function(e){return Ep?zx(e,"z",{metaKey:!0,shiftKey:!0}):zx(e,"y",{ctrlKey:!0})||zx(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),Kx(t,nv,void 0);else{const r=t._editorState._selection;!function(e){return zx(e,"a",jx)}(e)?null===r||nb(r)||(function(e){return zx(e,"c",jx)}(e)?(e.preventDefault(),Kx(t,Ev,e)):function(e){return zx(e,"x",jx)}(e)&&(e.preventDefault(),Kx(t,kv,e))):(e.preventDefault(),Kx(t,Cv,e)&&Hv(n))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Fv,e),!0}function ry(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const iy=new Map;function oy(e){const t=function(e){const t=Yx(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=Jx(e.target);let r=null,i=null;const o=null!==n?zv.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&&cS(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=mS(t,e).anchorNode;if(null!==a&&sx(a)===s){if(cS(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||xS(e)&&null!==e.shadowRoot||(r=sx(e),null!==r&&(i=e))}}if(null===r){const e=yS(n);r=null!==e?sx(e):null}}if(null===r)return;if(r._inputState.isSelectionChangeFromMouseDown){if(void 0!==o)for(const e of o.editors)e._inputState.isSelectionChangeFromMouseDown=!1;y_(r,()=>{const n=Tb(),o=i??mS(t,r._rootElement).anchorNode;(xS(o)||ux(o))&&Ax(Ab(n,t,r,e))})}const s=Dx(r),a=s[s.length-1],l=a._key,c=iy.get(l),u=c||a;u!==r&&$v(t,u,!1),$v(t,r,!0),r!==a?iy.set(l,r):c&&iy.delete(l)}function sy(e){e._lexicalHandled=!0}function ay(e){return!0===e._lexicalHandled}function ly(e){const t=Lv.get(e);if(void 0===t)return;const n=zv.get(t);if(void 0===n)return;Lv.delete(e);const r=ax(e);ox(r)?(function(e){if(null!==e._parentEditor){const t=Dx(e),n=t[t.length-1]._key;iy.get(n)===e&&iy.delete(n)}else iy.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&_p(198);const i=ry(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function cy(e,t,n){e_();const r=e.__key,i=e.getParent();if(null===i)return void(null!==ZS(e)&&_p(367,r,String(ZS(e))));const o=function(e){const t=Nb();if(!nb(t)||!x_(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return Qx(i,e)&&n.set(e.__key,0,"element"),Qx(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(nb(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(Ib(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(Ib(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else ib(o)&&t&&e.isSelected()&&e.selectPrevious();if(nb(o)&&t&&!s){const t=e.getIndexWithinParent();gx(e),Rb(o,i,t,-1)}else gx(e);n||nS(i)||i.canBeEmpty()||!i.isEmpty()||cy(i,t),t&&o&&C_(i)&&i.isEmpty()&&i.selectEnd()}const uy=Symbol.for("ephemeral");function dy(e){return e[uy]||!1}const fy={configurable:!0,enumerable:!1,value:void 0,writable:!0};class hy{__type;__key;__parent;__prev;__next;__state;[Bg];static getType(){const{ownNodeType:e}=GS(this);return void 0===e&&_p(64,this.name),e}static clone(e){_p(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||JS(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",fy),Object.defineProperty(this,Bg,fy),px(this,e)}getType(){return this.__type}isInline(){_p(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=bx(e);if(null===t)break;e=null!==t.__parent?t.__parent:ZS(t)}return!1}isSelected(e){const t=e||Nb();if(null==t)return!1;const n=t.getNodes().some(e=>e.__key===this.__key);if(Vy(this))return n;if(nb(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(E_(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:bx(e)}getParentOrThrow(){const e=this.getParent();return null===e&&_p(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(nS(t)||null!==ZS(e))return x_(e)||e===this&&E_(e)||_p(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&_p(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:bx(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:bx(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?Kw(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=Kw(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===qw(t):("same"!==t.type&&"ancestor"!==t.type&&_p(279),!1)))}isParentOf(e){return Qx(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&&_p(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=r_()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(dy(this))return this;const e=bx(this.__key);return null===e&&_p(113),e}getWritable(){if(dy(this))return this;e_();const e=n_(),t=r_(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,s=Nb();if(null!==s&&s.setCachedNodes(null),o.has(r))return mx(i),i;const a=MS(i);return o.add(r),mx(a),n.set(r,a),a}getTextContent(){return uw(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){_p(70)}updateDOM(e,t,n){_p(71)}getDOMSlot(e){return new tg(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){_p(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const o of Rg(n).flatKeys)o in t&&(void 0!==i&&i!==r||(i={...r}),i[o]=t[o]);return(n.__state||i)&&Tg(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){cy(this,!0,e)}replace(e,t){e_();let n=Nb();null!==n&&(n=n.clone()),oS(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;gx(s),null!==c&&nb(n)&&Rb(n,c,u,-1);const d=r.getPreviousSibling(),f=r.getNextSibling(),h=r.__prev,p=r.__next,g=r.__parent;cy(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)||_p(139),m=s.getChildrenSize(),s.splice(m,0,this.getChildren()));const v=rw(this);if(v.length>0){QS(this)&&QS(s)||_p(368,this.__key,s.__key);for(const e of v){const t=iw(this,e);null!==t&&(pw(this,e),hw(s,e,t))}}if(nb(n)){Ax(n);const e=n.anchor,r=n.focus;e.key===i&&(t&&"element"===e.type?e.set(s.__key,m+e.offset,"element"):Zy(e,s)),r.key===i&&(t&&"element"===r.type?r.set(s.__key,m+r.offset,"element"):Zy(r,s))}return yx()===i&&vx(o),s}insertAfter(e,t=!0){e_(),oS(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.getParent(),o=Nb();let s=!1,a=!1;if(null!==i){const n=e.getIndexWithinParent();if(nb(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}gx(r),t&&nb(o)&&Rb(o,i,n,-1)}else gx(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&&nb(o)){const e=this.getIndexWithinParent();Rb(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){e_(),oS(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.__key,o=Nb(),s=r.getParent(),a=null!==s?r.getIndexWithinParent():-1;gx(r),null!==s&&t&&nb(o)&&Rb(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&&nb(o)&&Rb(o,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return B_()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){e_();const n=ew(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(!Vy(r)){const e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){e_();const n=ew(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(!Vy(r)){const e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function py(e){return e instanceof hy}const gy="historic",my="history-push",vy="history-merge",yy="paste",by="collaboration",_y="skip-scroll-into-view",xy="skip-dom-selection",Sy="skip-selection-focus",wy="composition-start",Ey="composition-end";function ky(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 Cy(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 Ay(e,t,n=""){if(t===n)return;const r=ky(n),i=ky(t);for(const o in i)delete r[o],Cy(e,o,i[o]);for(const o in r)e.removeProperty(o)}function Ny(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Ty(e,t){return 1&t?"strong":2&t?"em":"span"}function Ry(e,t,n,r,i){const o=r.classList;let s=$x(i,"base");void 0!==s&&o.add(...s),s=$x(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 Vp){const e=Vp[c];if(s=$x(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 Dy(e,t,n){const r=n.isComposing(),i=e+(r?$p:""),o=TS(),s=RS(o).$getDOMSlot(n,t,o),a=s.getFirstChild();if(null===a||a.nodeType!==Node.TEXT_NODE)return void s.insertChild(pS().createTextNode(i));const l=a,c=l.nodeValue;if(c!==i)if(r||kp){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 Iy(e,t,n,r,i,o){Dy(i,e,t);const s=o.theme.text;void 0!==s&&Ry(0,0,r,e,s)}function Fy(e,t){const n=pS().createElement(t);return n.appendChild(e),n}function Oy(e){return null!=e&&!0===e.__isInlineFormattable}class Py extends hy{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(e){return new Py(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 Xp[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===yx()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Vp[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return fx(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=Ny(0,n),i=Ty(0,n),o=null===r?i:r,s=pS().createElement(o);let a=s;this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(a=pS().createElement(i),s.appendChild(a)),Iy(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&Ay(s.style,l),s}updateDOM(e,t,n){const r=this.__text,i=e.__format,o=this.__format,s=Ny(0,i),a=Ny(0,o),l=Ty(0,i),c=Ty(0,o);if((null===s?l:s)!==(null===a?c:a))return!0;if(s===a&&l!==c){const e=t.firstChild;null==e&&_p(48);const i=pS().createElement(c);return Iy(i,this,0,o,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==s&&(u=t.firstChild,null==u&&_p(49)),Dy(r,u,this);const d=n.theme.text;void 0!==d&&i!==o&&Ry(0,i,o,u,d);const f=e.__style,h=this.__style;return f!==h&&Ay(t.style,h,f),!1}static importDOM(){return{"#text":()=>({conversion:Uy,priority:0}),b:()=>({conversion:Ly,priority:0}),code:()=>({conversion:qy,priority:0}),em:()=>({conversion:qy,priority:0}),i:()=>({conversion:qy,priority:0}),mark:()=>({conversion:qy,priority:0}),s:()=>({conversion:qy,priority:0}),span:()=>({conversion:My,priority:0}),strong:()=>({conversion:qy,priority:0}),sub:()=>({conversion:qy,priority:0}),sup:()=>({conversion:qy,priority:0}),u:()=>({conversion:qy,priority:0})}}static importJSON(e){return Gy().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 xS(t)||_p(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=Fy(t,"b")),this.hasFormat("italic")&&(t=Fy(t,"i")),this.hasFormat("strikethrough")&&(t=Fy(t,"s")),this.hasFormat("underline")&&(t=Fy(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?Vp[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Kp[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=fx(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=Jp[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){e_();let n=e,r=t;const i=Nb(),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(!nb(i))return Eb(s,n,s,r,"text","text");{const e=yx();e!==i.anchor.key&&e!==i.focus.key||vx(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=Nb();if(r&&nb(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){e_();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=yx(),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=Nb();if(nb(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=Gy(c),d.__format=f,d.__style=h,d.__detail=p,d.__state=Pg(t,d),g=!0):d=t.setTextContent(c);const b=[d];for(let w=1;w<l;w++){const e=Gy(s[w]);e.__format=f,e.__style=h,e.__detail=p,e.__state=Pg(t,e);const n=e.__key;i===r&&vx(n),b.push(e)}const _=m?m.offset:null,x=v?v.offset:null;let S=0;for(const w of b){if(!m&&!v)break;const e=S+w.getTextContentSize();if(null!==m&&null!==_&&_<=e&&_>=S&&(m.set(w.getKey(),_-S,"text"),_<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&&mx(t),null!==n&&mx(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,b),this.remove()):e.splice(t,1,b),nb(y)&&Rb(y,u,t,l-1)}return b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||_p(50);const n=this.__key,r=e.__key,i=this.__text,o=i.length;yx()===r&&vx(n);const s=Nb();if(nb(s)){const i=s.anchor,a=s.focus;null!==i&&i.key===r&&Fb(i,t,n,e,o),null!==a&&a.key===r&&Fb(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 My(e){return{forChild:Ky(e.style),node:null}}function Ly(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Ky(t.style,n?void 0:"bold"),node:null}}const zy=new WeakMap;function jy(e){if(!xS(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Uy(e){const t=e;null===e.parentElement&&_p(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=zy.get(n))&&!jy(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let o=0;o<r.length;o++)zy.set(r[o],i);return i}(t))return{node:zb(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=By(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=By(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:Gy(n)}}function By(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,xS(n)){const e=n.style.display;if(""===e&&!kS(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(ux(n))return n;if("BR"===n.nodeName)return null}}const $y={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qy(e){const t=$y[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Ky(e.style,t),node:null}}function Gy(e=""){return iS(new Py(e))}function Vy(e){return e instanceof Py}function Ky(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=>Vy(e)||Oy(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 Wy extends Py{static getType(){return"tab"}static clone(e){return new Wy(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=$x(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Hy().updateFromJSON(e)}setTextContent(e){return super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||_p(286),this}setDetail(e){return 2!==e&&_p(127),this}setMode(e){return"normal"!==e&&_p(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Hy(){return iS(new Wy)}function Jy(e){return e instanceof Wy}class Xy{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:$w(nE(Ww(this,"next")),nE(Ww(e,"next")))<0}getNode(){const e=bx(this.key);return null===e&&_p(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,Zb()||(yx()===o&&vx(e),null!==i&&(i.setCachedNodes(null),nb(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function Qy(e,t,n){return new Xy(e,t,n)}function Yy(e,t){let n=t.__key,r=e.offset,i="element";if(Vy(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!x_(t)){const e=t.getNextSibling();if(Vy(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 Zy(e,t){if(x_(t)){const n=t.getLastDescendant();x_(n)||Vy(n)?Yy(e,n):Yy(e,t)}else Yy(e,t)}class eb{_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(!ib(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 eb(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes().filter(e=>null===ZS(e)),n=t.length;if(0===n)return;const r=t[n-1];let i;if(Vy(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=bx(r);null!==e&&n.push(e)}return Zb()||(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===ZS(e));if((Nb()||Tb())===this&&e[0]){const t=Rw(e[0],"next");Jw(Uw(t,t))}for(const t of e)t.remove();tb()}}function tb(){const e=Cx();if(e.isEmpty()){const t=B_();e.append(t),t.select()}}function nb(e){return e instanceof rb}class rb{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!!nb(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(Cw(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),kw(e.focus)&&x_(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let s=Ow(e.focus.origin,"previous");Cw(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(t[t.length-1]);s=Pw(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=nE(e.anchor),r=nE(e.anchor.getFlipped()),i=e=>Ew(e)?e.origin:e.getNodeAtCaret(),o=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(o)}return t}(oE(Qw(this),"next"));return Zb()||(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]=lb(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 rw(d)){const n=iw(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(l+=e,c=!1):c=!d.isEmpty()}else if(c=!1,Vy(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!E_(d)&&!P_(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=r_(),n=t.getEditorState()._selection,r=Sb(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),jg(this)}clone(){const e=this.anchor,t=this.focus;return new rb(Qy(e.key,e.offset,e.type),Qy(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=fx(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=Vp[e];return 0!==(this.format&t)}insertRawText(e){this.insertNodes(zb(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=Gy();if(s.setFormat(n),s.setStyle(r),$_(o))o.splice(0,0,[s]);else if(null!==o){const e=nS(i)?B_().append(s):s;o.insertBefore(e)}else if(nS(i)){const e=i.getLastChild();x_(e)&&!e.isInline()&&e.isEmpty()?e.append(s):i.append(B_().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&&Hw(s,nE(Ww(s,"next")));const a=o.offset;let l=s.offset;const c=this.getNodes(),u=c.length;let d=c[0];Vy(d)||_p(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&&(cx(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&null===d.getNextSibling())){const t=d.getNextSibling();let n;if(Vy(t)&&t.canInsertTextBefore()&&!cx(t)?n=t:(n=Gy(),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&&(cx(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&null===d.getPreviousSibling())){const t=d.getPreviousSibling();let n;if(!Vy(t)||cx(t)?(n=Gy(),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!==yx())d=d.setMode("normal").setFormat(r).setStyle(i);else{const e=Gy(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(""),yb(this.anchor,this.focus),void this.insertText(e)}if(1===u){if(lx(d)){const t=Gy(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Jy(d)){const t=Gy(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Gy(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(Vy(p)&&!lx(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=Gy(p.getTextContent());p.replace(e),p=e}C_(s.getNode())||"text"!==s.type||(Vy(p)||_p(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(lx(d))if(a===f)d.select();else{const t=Gy(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=Nb()===this;Xw(this,tE(Qw(this))),e&&Nb()!==this&&Ax(this)}formatText(e,t=null){sb(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!==ZS(t)){let n=t.isShadowRoot()?t.getFirstChild()??t.append(B_()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&null!==n&&!x_(n)){const e=B_();n.insertBefore(e),n=e}if(null!==n){n.selectStart();const t=Nb();return nb(t)||_p(369),t.insertNodes(e)}}if("element"===this.anchor.type&&nS(t)){const n=qb(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=WS(n,NS);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=Ub(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(x_(e)||E_(e))&&!e.isInline())){x_(r)||_p(211,n.constructor.name,n.getType());const t=Ub(this);return r.splice(t,0,e),void i.selectEnd()}if(x_(r)&&null!==ZS(r)){const t=Ub(this),n=jb(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=qb(e),n=t.getLastDescendant();let r=Ww(this.anchor,"next");for(const e of t.getChildren())r=uE(e,r);return void(null!==n&&n.selectEnd())}if(x_(r)&&!r.isParentRequired()&&!nS(r.getParentOrThrow())){const t=Ub(this),n=jb(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=qb(e),s=o.getLastDescendant(),a=o.getChildren(),l=x_(r)&&r.isEmpty()?null:this.insertParagraph();l&&!r.isAttached()&&(n=this.anchor.getNode(),r=WS(n,NS));const c=a[a.length-1];let u=a[0];var d;x_(d=u)&&NS(d)&&!d.isEmpty()&&x_(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(x_(r)||_p(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(null===r&&_p(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()||_p(140),r=r.getNextSibling(),i.push(r);let o=e;for(const s of i)o=o.insertAfter(s)}(r,u));const f=WS(s,NS);l&&x_(f)&&(l.canMergeWhenEmpty()||NS(c))&&(f.append(...l.getChildren()),l.remove()),x_(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=x_(r)?r.getLastChild():null;P_(h)&&f!==r&&h.remove()}insertParagraph(){const e=this.anchor.getNode();if("element"===this.anchor.type&&nS(e)){const t=B_();return e.splice(this.anchor.offset,0,[t]),t.select(),t}const t=Ub(this),n=WS(this.anchor.getNode(),NS);if(null!==n&&null!==ZS(n))return null;x_(n)||_p(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=O_();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]=lb(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(Vy(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(Vy(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),Vy(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(Gb(this,e,t,n))return;const r="move"===e,i=r_(),o=lS(Zx(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()||aS(s,i,a);const c=Wx(i,this.focus.key);let u=c;if("text"===this.focus.type&&(u=Vy(l)?IS(l,c,i):null),this.dirty){const e=Wx(i,this.anchor.key);let t=e;if("text"===this.anchor.type){const n=this.anchor.getNode();t=Vy(n)?IS(n,e,i):null}t&&u&&Ob(o,t,this.anchor.offset,u,this.focus.offset)}if("character"===n&&Vy(l)&&l.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===l.getTextContentSize())){const e=Rw(l,t?"previous":"next").getNodeAtCaret();if(Vy(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?IS(e,n,i):null;if(r){const e=t?r.length:0;Ob(o,r,e,r,e)}}}}if(db(o,e,t?"backward":"forward",n),o.rangeCount>0){const e=gS(o,i._rootElement),n=e||o.getRangeAt(0),s=this.anchor.getNode(),a=C_(s)?s:eS(s);this.applyDOMRange(n),this.dirty=!0,r||(fb(this,t,a),(e?"backward"!==o.direction:o.anchorNode===n.startContainer&&o.anchorOffset===n.startOffset)||ub(this))}"lineboundary"===n&&Gb(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=zw(Ww(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(Cw(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=nE(t);Xw(this,Uw(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(kw(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(E_(t.origin)){if(t.origin.isIsolated());else if(rw(t.origin).length>0){if(x_(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=Cb();e.add(t.origin.getKey()),Ax(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=Cb();e.add(t.origin.getKey()),Ax(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;if(rw(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Xw(this,Uw(!t.origin.isEmpty()&&n.isEmpty()?Yw(Rw(n,t.direction)):r.anchor,t)),this.removeText())}for(let n=t.getNode();null!==n;){if(null!==ZS(n))return;if(x_(n)&&n.isShadowRoot())break;n=n.getParent()}}const i=this.focus;if(hb(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&cb(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 gb(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 gb(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,a=s?e:o,l=s?o:e,c=l-1;a!==c&&function(e){return!(Rx(e)||pb(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()&&C_(e.getParent())&&null===e.getPreviousSibling()&&cb(this,e),tb()}}deleteLine(e){const t=bb(this.anchor);if(null!==t&&E_(ew(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&hb(this,e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):WS(this.anchor.getNode(),NS)!==WS(this.focus.getNode(),NS)?(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;hb(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 Zb()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function ib(e){return e instanceof eb}function ob(e,t){if(ib(e)){for(const n of e.getNodes())Oy(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void vx(null);const n=[];for(const v of e.getNodes())Vy(v)?n.push(v):x_(v)?v.setTextFormat(t(v.getTextFormat())):Oy(v)&&v.setFormat(t(v.getFormat()));const r=n.length;if(0===r)return e.setFormat(t(e.format)),void vx(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(cx(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||cx(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()||cx(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 sb(e,t,n=null){const r=null===n&&nb(e)?fx(e.format,t,null):n;ob(e,e=>fx(e,t,r))}function ab(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function lb(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]:[ab(n),ab(r)]}function cb(e,t){for(let n=t;n;n=n.getParent()){if(x_(n)){if(n.collapseAtStart(e))return!0;if(nS(n))break}if(n.getPreviousSibling())break}return!1}function ub(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 db(e,t,n,r){e.modify(t,n,r)}function fb(e,t,n){const r=e.getNodes(),i=r.filter(e=>Qx(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 hb(e,t,n){if(Gb(e,"extend",t,n))return;const r=r_(),i=lS(Zx(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()||aS(o,r,s);const c=e=>{const t=e.getNode(),n=r.getElementByKey(e.key);return null!==n&&"text"===e.type&&Vy(t)?IS(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(Ob(i,g,m,g,m),db(i,"move",t?"backward":"forward",n),0===i.rangeCount)return;const v=gS(i,s)||i.getRangeAt(0),y=v.startContainer,b=v.startOffset;if(h&&"character"===n&&"text"===a.type&&Vy(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){const n=Rw(u,t?"previous":"next").getNodeAtCaret();if(Vy(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?b:f!==n?n:-1;if(r>=0)return void(r!==f&&(e.focus.set(a.key,r,"text"),e.dirty=!0))}const[_,x,S,w]=t?[y,b,d,f]:[d,f,y,b],E=C_(u)?u:eS(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:w,startContainer:_,startOffset:x}),e.dirty=!0,!fb(e,t,E)&&t&&ub(e),"lineboundary"===n&&Gb(e,"extend",t,n,"decorators")}const pb=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(_p){}return()=>!1})();function gb(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 mb(e,t,n,r){let i,o=t,s=!1;if(xS(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!==Sx(e,r)||BS(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=Tx(d),Vy(i))o=Iw(i,a?"next":"previous");else{let l=Tx(e);if(null===l)return null;if(x_(l)){const s=r.getElementByKey(l.getKey());null===s&&_p(214);const c=DS(l,s,r);[l,o]=c.resolveChildIndex(l,s,e,t),x_(l)||_p(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}Vy(u)?(i=u,l=null,o=Iw(u,a?"next":"previous")):u!==l&&a&&!f&&(x_(l)||_p(216),o=Math.min(l.getChildrenSize(),o+1))}else{const n=ew(l),i=null!==n?n:l,s=i.getIndexWithinParent(),a=r.getElementByKey(l.getKey());let c="after";if(null!==a&&Tx(e)===l){const n=DS(l,a,r);n.element!==a?c=n.resolveLeafPosition(a,e,t):0===t&&E_(l)&&(c="before")}o="before"===c?s:s+1,l=i.getParentOrThrow()}if(x_(l))return[Qy(l.__key,o,"element"),s]}}else i=Tx(e);return Vy(i)?[Qy(i.__key,Iw(i,o,"clamp"),"text"),s]:null}function vb(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();Vy(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else x_(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Vy(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();Vy(t)&&e.set(t.__key,0,"text")}}}function yb(e,t,n){if("text"===e.type&&"text"===t.type){const n=e.isBefore(t),r=e.is(t);vb(e,n,r),vb(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function bb(e){const t=bx(e.key);return null===t?null:tw(t)}function _b(e,t,n){const r=bb(e),i=bb(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=ew(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 xb(e){const t=_b(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(null!==n&&null!==r){const e=ew(n),t=ew(r);if(null!==e&&e.is(t)){for(const t of nw(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=ew(n),r=bx(t.key);return null===e||null===r||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}const i=ew(r),o=bx(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 Sb(e,t,n,r,i,o){if(null===e||null===n||!ix(i,e,n))return null;const s=mb(e,t,nb(o)?o.anchor:null,i);if(null===s)return null;const a=mb(n,r,nb(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=Tx(e),r=Tx(n);if(E_(t)&&E_(r))return null}const f=i._slotsUsed&&_b(l,u,()=>0!==(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return yb(l,u),[l,u,c||d||f]}function wb(e){return x_(e)&&!e.isInline()}function Eb(e,t,n,r,i,o){const s=n_(),a=new rb(Qy(e,t,i),Qy(n,r,o),0,"");return a.dirty=!0,s._selection=a,a}function kb(){const e=Qy("root",0,"element"),t=Qy("root",0,"element");return new rb(e,t,0,"")}function Cb(){return new eb(new Set)}function Ab(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=!dg&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,f;if(nb(e)&&!l)return e.clone();{if(null===t)return null;const r=mS(t,n._rootElement);if(c=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(a||void 0===s)&&nb(e)&&!ix(n,c,u))return e.clone()}const h=Sb(c,d,u,f,n,e);if(null===h)return null;const[p,g,m]=h;let v=0,y="";if(nb(e)){const t=e.anchor;if(p.key===t.key)v=e.format,y=e.style;else{const e=p.getNode();Vy(e)?(v=e.getFormat(),y=e.getStyle()):x_(e)&&(v=e.getTextFormat(),y=e.getTextStyle())}}const b=new rb(p,g,v,y);return m&&(b.dirty=!0),b}function Nb(){return n_()._selection}function Tb(){return r_()._editorState._selection}function Rb(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"),Db(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")}}Db(e)}function Db(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(Vy(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(Vy(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(Vy(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function Ib(e,t,n,r,i){let o=null,s=0,a=null;null!==r?(o=r.__key,Vy(r)?(s=r.getTextContentSize(),a="text"):x_(r)&&(s=r.getChildrenSize(),a="element")):null!==i&&(o=i.__key,Vy(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 Fb(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 Ob(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function Pb(e,t,n){const r=Wx(e,t.getKey());if(x_(t)){const i=DS(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Mb(e,t,n,r,i,o){const s=o.getRootNode(),a=dx(s)||cS(s)?yS(s):null;if(i.has(by)&&a!==o||null!==a&&rx(a,a))return;const l=mS(r,o);let c;if(!nb(t))return void(null!==e&&ix(n,l.anchorNode,l.focusNode)&&r.removeAllRanges());const u=t.anchor,d=t.focus,f=u.getNode(),h=d.getNode(),[p,g]=Pb(n,f,u.offset),[m,v]=Pb(n,h,d.offset),y=t.format,b=t.style,_=t.isCollapsed();let x=p,S=m,w=!1;if("text"===u.type?(x=Vy(f)?IS(f,p,n):null,w=f.getFormat()!==y||f.getStyle()!==b):nb(e)&&"text"===e.anchor.type&&(w=!0),"text"===d.type&&(S=Vy(h)?IS(h,m,n):null),null!==x&&null!==S){if(_&&(null===e||w||nb(e)&&(e.format!==y||e.style!==b))&&function(e,t,n,r,i,o){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:o}}(n,y,b,g,u.key,performance.now()),("Range"!==r.type||!_)&&l.anchorOffset===g&&l.focusOffset===v&&l.anchorNode===x&&l.focusNode===S){if(null===a||!o.contains(a)){const e=null!==a?sx(a):null;null!==e&&e!==n||i.has(Sy)||o.focus({preventScroll:!0})}if("element"!==u.type)return}if(Ob(r,x,g,S,v),kp&&t.isCollapsed()&&null!==o&&!i.has(Sy)){const e=vS(o);if(null===e||!o.contains(e)){const e=yS(o.ownerDocument),t=null!==e?sx(e):null;null!==t&&t!==n||o.focus({preventScroll:!0})}}if(!i.has(_y)&&t.isCollapsed()&&null!==o&&o===vS(o)){const e=nb(t)&&"element"===t.anchor.type?x.childNodes[g]||null:(void 0===c&&(c=function(e,t){const n=gS(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(ux(e)){const n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=Jx(n),i=Yx(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=Zx(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=Hx(u)}}(n,t,o)}}!function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0}(n)}}function Lb(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 zb(e){const t=[];return Lb(e,{linebreak:()=>t.push(O_()),tab:()=>t.push(Hy()),text:e=>t.push(Gy(e))}),t}function jb(e){const t=[];for(const n of e)P_(n)||(!x_(n)&&!E_(n)||n.isInline()?t.push(n):x_(n)&&t.push(...jb(n.getChildren())));return t}function Ub(e){let t=e;e.isCollapsed()||t.removeText();const n=Nb();nb(n)&&(t=n),nb(t)||_p(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!NS(i)&&null===ZS(i);){const e=i;if([i,o]=Bb(i,o),e.is(i))break}return o}function Bb(e,t){const n=e.getParent();if(!n){const e=B_();return Cx().append(e),e.select(),[Cx(),0]}if(Vy(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 rb(Qy(e.__key,t,"element"),Qy(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function $b(e){return P_(e)||function(e){return x_(e)&&e.isInline()||E_(e)&&e.isInline()}(e)||Vy(e)||e.isParentRequired()}function qb(e){const t=B_();let n=null;for(let r=0;r<e.length;r++){const i=e[r];if($b(i)){if(null===n){n=i.createParentElementNode(),t.append(n);const o=e[r+1];if(P_(i)&&(void 0===o||!$b(o)))continue}n.append(i)}else t.append(i),n=null}return t}function Gb(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=Ww(e.focus,n?"previous":"next"),s="lineboundary"===r,a="move"===t;let l=o,c="decorators-and-blocks"===i;if(!rE(l)){for(const e of l){c=!1;const{origin:t}=e;if(!E_(t)||t.isIsolated()||(l=e,!s||!t.isInline()))break}if(c)for(const e of zw(o).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(Cw(e))e.origin.isInline()||(l=e);else{if(x_(e.origin))continue;E_(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===o)return!1;if(a&&!s&&E_(l.origin)&&l.origin.isKeyboardSelectable()){const e=Cb();return e.add(l.origin.getKey()),Ax(e),!0}return l=nE(l),a&&Hw(e.anchor,l),Hw(e.focus,l),c||!s}let Vb=null,Kb=null,Wb=!1,Hb=!1,Jb=!1;const Xb=new Set;let Qb=0;const Yb={characterData:!0,childList:!0,subtree:!0};function Zb(){return Wb||null!==Vb&&Vb._readOnly}function e_(){Wb&&_p(13)}function t_(){Qb>99&&_p(14)}function n_(){return null===Vb&&_p(195,i_()),Vb}function r_(){return null===Kb&&_p(337,i_()),Kb}function i_(){let e=0;const t=new Set,n=X_.version;if("undefined"!=typeof window)for(const i of fS(document)){const r=ax(i);if(ox(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 Kb}function s_(e,t,n){const r=t.__type,i=ex(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 a_(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 c_(e){return u_(e,r_()._nodes)}function u_(e,t){const n=e.type,r=t.get(n);void 0===r&&_p(17,n);const i=r.klass;e.type!==i.getType()&&_p(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=u_(s[l],t);o.append(e)}const a=e.$slots;if(a){QS(o)||_p(379,i.name);for(const e in a)hw(o,e,u_(a[e],t))}return o}function d_(e,t,n){const r=Vb,i=Wb,o=Kb;Vb=t,Wb=!0,Kb=e;try{return n()}finally{Vb=r,Wb=i,Kb=o}}function f_(e,t){const n=Jb;Jb=!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=Vb,u=Wb,d=Kb,f=e._updating,h=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==h){Kb=e,Vb=n,Wb=!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){Hg="",Jg=null,Xg=null,Qg=null,dm=2===r,Kg=n,Vg=n._config,um=n._config.dom||K_,Wg=n._nodes,tm=Kg._listeners.mutation,nm=i,rm=o,im=e._nodeMap,om=e,sm=t._nodeMap,fm=t._readOnly,am=lg(n._keyToDOMMap),lm=function(){const e=new Map,t=t=>{for(const n of t){const t=sm.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(nm.keys()),t(rm),e}();const s=new Map;return cm=s,Im("root",null),Kg=void 0,Wg=void 0,nm=void 0,rm=void 0,im=void 0,om=void 0,sm=void 0,Vg=void 0,am=void 0,lm=void 0,cm=void 0,um=K_,s}(o,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Hb)throw t;return G_(e,null,r,n),_g(e),e._dirtyType=2,Hb=!0,f_(e,o),void(Hb=!1)}finally{h.observe(r,Yb),e._updating=f,Vb=c,Wb=u,Kb=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=Ex(e)),delete r[o])}(e,n);const b=i?null:lS(Zx(e));if(e._editable&&null!==b&&(l||null===a||a.dirty||!a.is(s))&&null!==r&&!y.has(xy)){Kb=e,Vb=n;try{if(null!==h&&h.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&aS(t,e,r),Mb(s,a,e,b,y,r)}!function(e,t,n){let r=e._blockCursorElement;if(nb(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(vS(t))){const i=n.anchor,o=i.getNode(),s=i.offset;let a=!1,l=null;if(s===o.getChildrenSize())sS(o.getChildAtIndex(s-1))&&(a=!0);else{const t=o.getChildAtIndex(s);if(null!==t&&sS(t)){const n=t.getPreviousSibling();(null===n||sS(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=DS(o,e.getElementByKey(o.__key),e).element;return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=pS().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=pE(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&&aS(r,e,t)}(e,r,a)}finally{null!==h&&h.observe(r,Yb),Kb=d,Vb=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),nb(a)||null===a||null!==s&&s.is(a)||e.dispatchCommand(zm,void 0);const _=e._pendingDecorators;null!==_&&(e._decorators=_,e._pendingDecorators=null,h_("decorator",e,!0,_)),function(e,t,n){const r=kx(t),i=kx(n);r!==i&&h_("textcontent",e,!0,i)}(e,t||o,n),h_("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){Xb.has(e)||(Xb.add(e),setTimeout(()=>{Xb.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;v_(e,t,r)}}(e)}(e,t)}finally{Jb=n}}function h_(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 p_(e,t,n,r){const i=Dx(e);let o;if(!Jb)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(y_(a,()=>{for(const i of e)if(i(n,r))return void(t=!0)}),t)return t}}}return o&&o.update(()=>{p_(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 m_(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&&_p(191),o._flushSync=!0),s&&e._deferred.push(s),l_(e,i.tag)),null==o?v_(e,n,i):n()}}return r}function v_(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=A_(l||a),c=!0),l._flushSync=s;const u=Vb,d=Wb,f=Kb,h=e._updating;Vb=l,Wb=!1,e._updating=!0,Kb=e;const p=e._headless||null===e.getRootElement();Y_(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=lS(Zx(e));return nb(n)||null==n?Ab(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),o=m_(e,o),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(nb(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);Vy(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&zg(e)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=yx(),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);Vy(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&zg(r),void 0!==r&&a_(r,o)&&s_(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Qb++;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&&a_(l,o)&&s_(t,l,s)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Qb++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),m_(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)&&ug(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()||(QS(e)&&null!==e.__slots&&ug(e,c,i,o,s,n),i.has(c)||n.delete(c),s.push(c))}for(const c of s)o.delete(c);const a=r_(),l=a._compositionKey;null===l||o.has(l)||(a._compositionKey=null)}(a,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);const i=l._selection;if(nb(i)){e._slotsUsed&&xb(i);const t=l._nodeMap,n=i.anchor.key,r=i.focus.key;void 0!==t.get(n)&&void 0!==t.get(r)||_p(19)}else ib(i)&&0===i._nodes.size&&(l._selection=null)}catch(_p){return _p instanceof Error&&e._onError(_p),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void f_(e)}finally{Vb=u,Wb=d,Kb=f,e._updating=h,Qb=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,f_(e)):c&&nx(()=>{f_(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function y_(e,t,n){Kb===e&&void 0===n?t():v_(e,t,n)}function b_(e){if(nS(e)){let t=null;for(const n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}class __ extends hy{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:b_,extends:hy})}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&&_p(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 Hp[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===rw(this).length}isDirty(){const e=r_()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];for(const n of rw(this)){const t=iw(this,n);x_(t)&&e.push(...t.getAllTextNodes())}let t=this.getFirstChild();for(;null!==t;){if(Vy(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:bx(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&_p(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:bx(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&_p(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=uw(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+=qp)}return e}getTextContentSize(){let e=function(e){let t=0;for(const n of rw(e)){const r=iw(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=Wp[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=Vp[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return fx(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){e_();const n=Nb();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Vy(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(Vy(e)||x_(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return nb(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):Eb(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&&Wp[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){dy(this)&&_p(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||_p(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&&_p(100);const t=e.getNextSibling(),n=e.__key;gx(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--,gx(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&&_p(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=Nb();if(nb(e)){const t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;S_(r,t,n)&&Ib(r,r.getNode(),this,c,l),S_(i,t,n)&&Ib(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||nS(this)||this.remove()}}return i}getDOMSlot(e){return new rg(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(xS(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||nS(this)||this.getChildren().some(Vy)||(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=DS(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 __}function S_(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 w_ extends hy{__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&&_p(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 E_(e){return e instanceof w_}class k_ extends __{__cachedText;static getType(){return"root"}static clone(){return new k_}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){_p(51)}getTextContent(){const e=this.__cachedText;return null===e||!Zb()&&0!==r_()._dirtyType?super.getTextContent():e}remove(){_p(52)}replace(e){_p(53)}insertBefore(e){_p(54)}insertAfter(e){_p(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const r of n)x_(r)||E_(r)||_p(282);return super.splice(e,t,n)}static importJSON(e){return Cx().updateFromJSON(e)}collapseAtStart(){return!0}}function C_(e){return e instanceof k_}function A_(e){return new R_(lg(e._nodeMap),null,e._slotsUsed)}function N_(){return new R_(new Map([["root",new k_]]),null,!1)}function T_(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&_p(130,n.name),x_(e)){const r=t.children;Array.isArray(r)||_p(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=T_(i[e]);r.push(t)}}const r=rw(e);if(r.length>0){const i={};for(const t of r){const r=iw(e,t);null===r&&_p(366,n.name,t),i[t]=T_(r)}t.$slots=i}return t}class R_{_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 d_(t&&t.editor||null,this,e)}clone(e){const t=new R_(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t}toJSON(){return d_(null,this,()=>({root:T_(Cx())}))}}class D_ extends __{static getType(){return"artificial"}createDOM(e){return pS().createElement("div")}}class I_ extends hy{static getType(){return"linebreak"}static clone(e){return new I_(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return pS().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>M_(e)||L_(e)?null:{conversion:F_,priority:0}}}static importJSON(e){return O_().updateFromJSON(e)}}function F_(e){return{node:O_()}}function O_(){return iS(new I_)}function P_(e){return e instanceof I_}function M_(e){const t=e.parentElement;if(null!==t&&AS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&z_(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&z_(n))return!0}}return!1}function L_(e){const t=e.parentElement;if(null!==t&&AS(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&z_(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&z_(r))return!0}return!1}function z_(e){return ux(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class j_ extends __{static getType(){return"paragraph"}static clone(e){return new j_(e.__key)}createDOM(e){const t=pS().createElement("p"),n=$x(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:U_,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(xS(t)){this.isEmpty()&&t.append(pS().createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return B_().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){const t=this.getChildren().find(Vy);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const n=B_();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||Vy(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 U_(e){const t=B_();if(jS(t,e),LS(e,t),""===t.getFormatType()){const n=e.getAttribute("align");n&&n&&n in Wp&&t.setFormat(n)}return zS(t,e),{node:t}}function B_(){return iS(new j_)}function $_(e){return e instanceof j_}function q_(e){console.warn(e)}function G_(e,t,n,r,i){const o=e._keyToDOMMap;o.clear(),e._editorState=N_(),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),xx(n,e,"root"))}function V_(e){const t=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of VS(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 K_={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{const n=tx(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 W_(e){const t=e||{},n=o_(),r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=N_(),a=t.namespace||(null!==i?i._config.namespace:Ix()),l=t.editorState,c=[k_,Py,I_,Wy,j_,D_,...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===hy||n.prototype instanceof hy)){let r="<unknown>";try{r=JSON.parse(og)}catch(_p){}_p(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))}GS(n);const o=n.getType(),s=V_(n);p.set(o,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Cg(c[e]),transforms:s})}}const g=new X_(s,i,p,{disableEvents:o,dom:{...K_,...e&&e.dom},namespace:a,theme:r},u||console.error,d||q_,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(Bm,Xv,0),e.registerCommand($m,Qv,0),e.registerCommand(qm,Yv,0),e.registerCommand(Gm,Zv,0),e.registerCommand(rv,ny,0)}(g),g}function H_(e,t){const n=e.get(t);e.delete(t),n&&n()}function J_(e,t,n){return e.set(t,n),H_.bind(null,e,t)}class X_{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 cg,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=Ix(),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 J_(this._listeners.update,e)}registerEditableListener(e){return J_(this._listeners.editable,e)}registerDecoratorListener(e){return J_(this._listeners.decorator,e)}registerTextContentListener(e){return J_(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return vE(J_(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&&_p(35);const r=this._commands;r.has(e)||r.set(e,[new sg,new sg,new sg,new sg,new sg]);const i=r.get(e);void 0===i&&_p(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&&_p(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=PS(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=PS(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=bx(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:vy}: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 Kx(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=$x(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,G_(this,t,e,r,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||ly(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Yx(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,_g(this),this._updateTags.add(vy),f_(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;Lv.set(e,n);let r=zv.get(n);void 0===r&&(r={editors:new Set,hasShadowEditor:void 0},zv.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;const i=ry(e);i.push(jv.register(n));for(let o=0;o<Mv.length;o++){const[n,r]=Mv[o],s="function"==typeof r?e=>{ay(e)||(sy(e),(t.isEditable()||"click"===n)&&r(e,t))}:e=>{if(ay(e))return;sy(e);const r=t.isEditable();switch(n){case"cut":return r&&Kx(t,kv,e);case"copy":return Kx(t,Ev,e);case"paste":return r&&Kx(t,Jm,e);case"dragstart":return r&&Kx(t,xv,e);case"dragover":return r&&Kx(t,Sv,e);case"dragend":return r&&Kx(t,wv,e);case"focus":return r&&Kx(t,Dv,e);case"blur":return r&&Kx(t,Iv,e);case"drop":return r&&Kx(t,bv,e)}};i.push(Ov(e,n,s))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(vy),f_(this);h_("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&_p(38);let n=e;n._readOnly&&(n=A_(e),n._selection=e._selection?e._selection.clone():null),bg(this);const r=this._pendingEditorState,i=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=i&&this._updateTags.add(i),f_(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,y_(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=N_(),i=Vb,o=Wb,s=Kb,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,Vb=r,Wb=!1,Kb=t,Y_(null);try{const i=t._nodes;u_(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,Vb=i,Wb=o,Kb=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&&f_(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]):v_(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),y_(this,()=>{const r=Nb(),i=Cx();null!==r?r.dirty||Ax(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),Xx("focus"),function(e){e_(),r_()._deferred.push(e)}(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=lS(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,h_("editable",this,!0,e),this._slotsUsed&&this.update(()=>{r_()._dirtyType=2}))}toJSON(){return{editorState:this._editorState.toJSON()}}}X_.version=og;let Q_=null;function Y_(e){Q_=e}let Z_=1;function ex(e,t){const n=tx(e,t);return void 0===n&&_p(30,t),n}function tx(e,t){return e._nodes.get(t)}const nx="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function rx(e,t){const n=void 0!==t?t:(()=>{const t=e.getRootNode();return dx(t)||cS(t)?yS(t):null})();if(!xS(n))return!1;if(n.hasAttribute("data-lexical-slot"))return!1;const r=wx(n),i=n.nodeName;return py(r)&&("INPUT"===i||"TEXTAREA"===i||"true"===n.contentEditable&&null==ax(n))}function ix(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 sx(t)===e&&e.read("latest",()=>!rx(t))}function ox(e){return e instanceof X_}function sx(e){let t=e;for(;null!=t;){const e=ax(t);if(ox(e))return e;t=Hx(t)}return null}function ax(e){return e?e.__lexicalEditor:null}function lx(e){return Jy(e)||e.isToken()}function cx(e){return lx(e)||e.isSegmented()}function ux(e){return SS(e)&&3===e.nodeType}function dx(e){return SS(e)&&9===e.nodeType}function fx(e,t,n){const r=Vp[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 hx(e){return Vy(e)||P_(e)||E_(e)}function px(e,t){const n=function(){const e=Q_;return Q_=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);e_(),t_();const r=r_(),i=n_(),o=""+Z_++;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 gx(e){null!==ZS(e)&&_p(380,e.__key,String(ZS(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 mx(e){t_(),dy(e)&&_p(323,e.__key,e.__type);const t=e.getLatest(),n=null!==t.__parent?t.__parent:YS(t)?t.__slotHost:null,r=n_(),i=r_(),o=r._nodeMap,s=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=null!==e.__parent?e.__parent:YS(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 vx(e){e_();const t=r_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=bx(n);null!==e&&e.getWritable()}if(null!==e){const t=bx(e);null!==t&&t.getWritable()}}}function yx(){return Zb()?null:r_()._compositionKey}function bx(e,t){const n=(t||n_())._nodeMap.get(e);return void 0===n?null:n}function _x(e,t){const n=Sx(e,r_());return void 0!==n?bx(n,t):null}function xx(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Sx(e,t){return e[`__lexicalKey_${t._key}`]}function wx(e,t){let n=e;for(;null!=n;){const e=_x(n,t);if(null!==e)return e;n=Hx(n)}return null}function Ex(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function kx(e){return e.read(()=>Cx().getTextContent())}function Cx(){return n_()._nodeMap.get("root")}function Ax(e){e_();const t=n_();null!==e&&(e.dirty=!0,e.setCachedNodes(null),nb(e)&&r_()._slotsUsed&&xb(e)),t._selection=e}function Nx(){e_(),bg(r_())}function Tx(e){const t=function(e,t){let n=e;for(;null!=n;){const e=Sx(n,t);if(void 0!==e)return e;n=Hx(n)}return null}(e,r_());return null===t?null:bx(t)}function Rx(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Dx(e){const t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function Ix(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Fx(e){return ux(e)?e.nodeValue:null}function Ox(e,t,n){const r=lS(Zx(t));if(null===r)return;const i=mS(r,t._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:a}=i;if(null!==o){let t=Fx(o);const r=wx(o);if(null!==t&&Vy(r)){if((t===$p||t===Gp)&&n){const e=n.length;t=n,s=e,a=e}null!==t&&Px(r,t,s,a,e)}}}function Px(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($p)&&(a=t.slice(0,-$p.length)),i)){const e=Gp;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=Nb();if(""===a){if(vx(null),Tp||Ap||Ip)o.remove();else{const e=r_();Mx(o,"",t),setTimeout(()=>{e.update(()=>{o.isAttached()&&""===o.getTextContent()&&o.remove()})},20)}return}const i=o.getParent(),l=Tb(),c=o.getTextContentSize(),u=yx(),d=o.getKey();if(o.isToken()&&!s||null!==u&&d===u&&!s||nb(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(!nb(t)||null===n||null===r)return void Mx(o,a,t);if(t.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=Gy(o.getTextContent());o.replace(e),o=e}Mx(o,a,t)}}}function Mx(e,t,n){if(e.setTextContent(t),nb(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=Iw(e,o.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Lx(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function zx(e,t,n){if(!function(e,t){return Lx(e,t,"altKey")&&Lx(e,t,"ctrlKey")&&Lx(e,t,"shiftKey")&&Lx(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 jx={ctrlKey:!Ep,metaKey:Ep},Ux={altKey:Ep,ctrlKey:!Ep};function Bx(e){return"Backspace"===e.key}function $x(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=pE(i);return n[t]=e,e}return i}function qx(e,t,n,r,i){if(0===n.size)return;const o=r.__type,s=r.__key,a=t.get(o);void 0===a&&_p(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 Gx(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 Vx(e){const t=Zx(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Kx(e,t,n){return p_(e,t,n,e)}function Wx(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&_p(75,t),n}function Hx(e){const t=e.assignedSlot||e.parentElement;if(null!==t)return t;const n=e.parentNode;return cS(n)?n.host:null}function Jx(e){return dx(e)?e:xS(e)?e.ownerDocument:null}function Xx(e){e_(),r_()._updateTags.add(e)}function Qx(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Yx(e){const t=Jx(e);return t?t.defaultView:null}function Zx(e){const t=e._window;return null===t&&_p(78),t}function eS(e){let t=e.getLatest();for(;null!==t;){if(null!==ZS(t)&&x_(t))return t;const e=t.getParentOrThrow();if(nS(e))return e;t=e}return t}function tS(e){return x_(e)&&e.isShadowRoot()}function nS(e){return C_(e)||tS(e)}function rS(e,t=!1){const n=e.constructor.clone(e);return px(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function iS(e){const t=r_(),n=e.getType(),r=tx(t,n);void 0===r&&_p(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||_p(201,o.name,o.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||_p(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&_p(203,e.constructor.name,n,r.name,r.getType()),t}return e}function oS(e,t){!C_(e.getParent())||x_(t)||E_(t)||_p(99)}function sS(e){if(!e||e.isInline())return!1;if(E_(e))return!0;if(x_(e)){if(e.isShadowRoot()){const t=e.getParent();return!(x_(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function aS(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function lS(e){return Sp?(e||window).getSelection():null}function cS(e){return wS(e)&&"host"in e}const uS=[];function dS(e){const t=e.getRootNode();if(t===e||!cS(t))return uS;const n=[t];let r=t.host;for(;;){const e=r.getRootNode();if(e===r||!cS(e))break;n.push(e),r=e.host}return n}function*fS(e){const t=[e];let n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const e=(dx(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function hS(e){return null!==e?e.ownerDocument:document}function pS(){const e=o_();return hS(null!==e?e._rootElement:null)}function gS(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;const n=dS(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 mS(e,t){const n=gS(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 vS(e){const t=e.getRootNode();return dx(t)||cS(t)?t.activeElement:null}function yS(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 bS(e){const t=e.target;if(null!==t&&xS(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){const t=e.composedPath();if(t.length>0)return t[0]}return t}function _S(e){return xS(e)&&"A"===e.tagName}function xS(e){return SS(e)&&1===e.nodeType}function SS(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function wS(e){return SS(e)&&11===e.nodeType}const ES=/^(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 kS(e){return!(!xS(e)||!e.style.display.startsWith("inline"))||ES.test(e.nodeName)}const CS=/^(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 AS(e){return(!xS(e)||!e.style.display.startsWith("inline"))&&CS.test(e.nodeName)}function NS(e){if(E_(e)&&!e.isInline())return!0;if(!x_(e)||nS(e))return!1;const t=e.getFirstChild(),n=null===t||P_(t)||Vy(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function TS(){return r_()}function RS(e=TS()){return e._config.dom||K_}function DS(e,t,n=TS()){const r=RS(n).$getDOMSlot(e,t,n);return x_(e)&&(function(e){return e instanceof rg}(r)||_p(344,e.getKey(),e.getType())),r}function IS(e,t,n=TS()){return function(e){let t=e;for(;null!=t;){if(ux(t))return t;t=t.firstChild}return null}(DS(e,t,n).element)}const FS=new WeakMap,OS=new Map;function PS(e){if(!e._readOnly&&e.isEmpty())return OS;e._readOnly||_p(192);let t=FS.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),FS.set(e,t)),t}function MS(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function LS(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 zS(e,t){const n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function jS(e,t){const n=t.style.textAlign;return n&&n in Wp?e.setFormat(n):e}function US(e){return!0===e.__lexicalUnmanaged}function BS(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;if(xS(n)&&n.hasAttribute("data-lexical-slot"))return!1;if(void 0!==Sx(n,t))return!1;n=Hx(n)}return!1}function $S(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==hy[t]}const qS=new WeakMap;function GS(e){const t=qS.get(e);if(t)return t;const n=null!=e.prototype&&Qp in e.prototype?e.prototype[Qp]():void 0,r=function(e){if(!(e===hy||e.prototype instanceof hy)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(_p){}try{X_.version&&(n=JSON.parse(X_.version))}catch(_p){}_p(290,e.name,t,n)}return e===w_||e===__||e===hy}(e),i=!r&&$S(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&&($S(e,"getType")||(e.getType=()=>s),$S(e,"clone")||(e.clone=t=>(Y_(t),new e)),$S(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(t=>(new e).updateFromJSON(t))),!$S(e,"importDOM")&&o)){const{importDOM:t}=o;t&&(e.importDOM=()=>t)}const a={klass:e,ownNodeConfig:o,ownNodeType:s};return qS.set(e,a),a}function*VS(e){for(let t=e;t&&(t===hy||py(t.prototype));){const e=GS(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||JS(t)}}function KS(e){const t=TS();return e_(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}const WS=(e,t)=>{let n=e;for(;null!=n&&!C_(n);){if(t(n))return n;n=n.getParent()}return null};function HS(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=null===t?bx(r):t.get(r);null==e&&_p(174),n.push(r),r=e.__next}return n}function JS(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 XS=new Map;function QS(e){return x_(e)||E_(e)}function YS(e){return x_(e)||E_(e)}function ZS(e){const t=e.getLatest();return YS(t)?t.__slotHost:null}function ew(e){const t=ZS(e);if(null===t)return null;const n=bx(t);return x_(n)||E_(n)||_p(370),n}function tw(e){let t=e.getLatest();for(;null!==t;){if(null!==ZS(t))return t;t=t.getParent()}return null}function nw(e){const t=e.getLatest();return QS(t)&&null!==t.__slots?t.__slots:XS}function rw(e){return Array.from(nw(e).keys())}function iw(e,t){const n=nw(e).get(t);return void 0===n?null:bx(n)}const ow=["__proto__","constructor","prototype"],sw=Symbol("slotMapOwner");function aw(e){let t=e.__slots;return null!==t&&t[sw]===e||(t=new Map(t),t[sw]=e,e.__slots=t),t}const lw=new WeakMap,cw=[];function uw(e){let t="";for(const n of rw(e)){const r=iw(e,n);null!==r&&(t+=r.getTextContent())}return t}function dw(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 fw(e){const t=e.__slots;if(null===t||t.size<2)return;const n=function(e){let t=lw.get(e);if(void 0===t){const n=function(e){for(const{ownNodeConfig:t}of VS(e)){const e=t&&t.slots;if(e)return e}return cw}(e),r=new Map;for(const t of n)ow.includes(t)&&_p(371,e.name,t),r.has(t)&&_p(372,e.name,t),r.set(t,r.size);t=r,lw.set(e,t)}return t}(e.constructor);let r=null,i=!0;for(const s of t.keys()){if(null!==r&&dw(r,s,n)>0){i=!1;break}r=s}if(i)return;const o=Array.from(t).sort(([e],[t])=>dw(e,t,n));t.clear();for(const[s,a]of o)t.set(s,a)}function hw(e,t,n){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||_p(373,t);const r=e.getLatest();if(null!==r.__slots&&r.__slots.get(t)===n.getLatest().__key)return r;(!x_(n)&&!E_(n)||n.isInline())&&_p(374,n.__key);const i=e.getWritable(),o=aw(i),s=o.get(t);void 0!==s&&gw(s);const a=n.getWritable(),l=ew(a);if(null!==l){const e=function(e){const t=ew(e);if(null===t)return null;const n=e.getLatest().__key;for(const[r,i]of nw(t))if(i===n)return r;return null}(a);null!==e&&aw(l.getWritable()).delete(e),a.__slotHost=null}return gx(a),a.__slotHost=i.__key,o.set(t,a.__key),fw(i),function(){const e=TS();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function pw(e,t){const n=e.getWritable();if(null===n.__slots)return n;const r=n.__slots.get(t);return void 0!==r&&(gw(r),aw(n).delete(t)),n}function gw(e){const t=bx(e);if(null===t)return;const n=t.getWritable();YS(n)||_p(377,e),n.__slotHost=null,n.remove()}const mw={next:"previous",previous:"next"};class vw{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Bw({hasNext:kw,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Rw(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Rw(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const o=this.getParentAtCaret(),s=new Map;for(let a=i.getAdjacentCaret();null!==a&&s.size<e;a=a.getAdjacentCaret()){const e=a.origin.getWritable();s.set(e.getKey(),e)}for(const a of r){if(s.size>0){const e=i.getNodeAtCaret();if(e)if(s.delete(e.getKey()),s.delete(a.getKey()),e.is(a)||i.origin.is(a));else{const t=a.getParent();t&&t.is(o)&&a.remove(),e.replace(a)}else null===e&&_p(263,Array.from(s).join(" "))}else i.insert(a);i=Rw(a,this.direction)}for(const a of s.values())a.remove();return this}}class yw extends vw{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Ow(e,this.direction)}getParentCaret(e="root"){return Rw(xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=_w(this.direction);return Rw(this.getNodeAtCaret(),e)||Ow(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof yw&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const bw={root:C_,shadowRoot:nS};function _w(e){return mw[e]}function xw(e,t="root"){return null===e||bw[t](e)?null:null===ZS(e)?e:null}class Sw extends vw{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Rw(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return x_(this.origin)?Ow(this.origin,this.direction):null}getParentCaret(e="root"){return Rw(xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=_w(this.direction);return Rw(this.getNodeAtCaret(),e)||Ow(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Sw&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Sw||e instanceof ww)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ww extends vw{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Dw(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Rw(xw(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Dw(this.origin,_w(this.direction),this.offset)}isSamePointCaret(e){return e instanceof ww&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Sw||e instanceof ww)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Rw(this.origin,this.direction)}}function Ew(e){return e instanceof ww}function kw(e){return e instanceof Sw}function Cw(e){return e instanceof yw}const Aw={next:class extends ww{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ww{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Nw={next:class extends Sw{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Sw{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Tw={next:class extends yw{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends yw{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Rw(e,t){return e?new Nw[t](e):null}function Dw(e,t,n){return e?new Aw[t](e,Iw(e,n)):null}function Iw(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&xp(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Fw(e,t){return new Lw(e,t)}function Ow(e,t){return x_(e)?new Tw[t](e):null}function Pw(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class Mw{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 Mw(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return Ew(t)?function(e,t){const{direction:n,origin:r}=e;return Fw(e,Iw(r,"focus"===t?_w(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[Fw(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=Ew(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Ew(n),i=t=>t.isSameNodeCaret(n)?null:Pw(t)||t.getParentCaret(e);return Bw({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 Lw{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 Dw(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function zw(e){return Uw(e,Rw(Cx(),e.direction))}function jw(e){return Uw(e,e)}function Uw(e,t){return e.direction!==t.direction&&_p(265),new Mw(e,t,e.direction)}function Bw(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 $w(e,t){const n=Kw(e.origin,t.origin);switch(null===n&&_p(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 qw(n)}}function qw(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 Gw(e,t){return t.is(e)}function Vw(e){return x_(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Kw(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,i]=Vw(e);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=Vw(t);r;i=r,r=r.getParent()){const o=n.get(r);if(void 0!==o)return null===o?(Gw(e,r)||_p(276),{commonAncestor:r,type:"ancestor"}):null===i?(Gw(t,r)||_p(277),{commonAncestor:r,type:"descendant"}):((x_(o)||Gw(e,o))&&(x_(i)||Gw(t,i))&&r.is(o.getParent())&&r.is(i.getParent())||_p(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function Ww(e,t){const{type:n,key:r,offset:i}=e,o=function(e){const t=bx(e);return null===t&&_p(63,e),t}(e.key);return"text"===n?(Vy(o)||_p(266,o.getType(),r),Dw(o,t,i)):(x_(o)||_p(267,o.getType(),r),sE(o,e.offset,t))}function Hw(e,t){const{origin:n,direction:r}=t,i="next"===r;Ew(t)?e.set(n.getKey(),t.offset,"text"):kw(t)?Vy(n)?e.set(n.getKey(),Iw(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(Cw(t)&&x_(n)||_p(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Jw(e){const t=Nb(),n=nb(t)?t:kb();return Xw(n,e),Ax(n),n}function Xw(e,t){Hw(e.anchor,t.anchor),Hw(e.focus,t.focus)}function Qw(e){const{anchor:t,focus:n}=e,r=Ww(t,"next"),i=Ww(n,"next"),o=$w(r,i)<=0?"next":"previous";return Uw(iE(r,o),iE(i,o))}function Yw(e){const{direction:t,origin:n}=e,r=Rw(n,_w(t)).getNodeAtCaret();return r?Rw(r,t):Ow(n.getParentOrThrow(),t)}function Zw(e,t="root"){const n=[e];for(let r=Cw(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Yw(r));return n}function eE(e){return!!e&&e.origin.isAttached()}function tE(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const o=oE(e,r),s=Zw(o.anchor,n),a=Zw(o.focus.getFlipped(),n),l=new Set,c=[];for(const p of o.iterNodeCarets(n))if(Cw(p))l.add(p.origin.getKey());else if(kw(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=Yw(Rw(e,r)),o=e.getMode();if(Math.abs(p.distance)===t&&"removeEmptySlices"===i||"token"===o&&0!==p.distance)n.remove();else if(0!==p.distance){i="removeEmptySlices";let e=p.removeTextSlice();const t=p.caret.origin;if("segmented"===o){const t=e.origin,i=Gy(t.getTextContent()).setStyle(t.getStyle()).setFormat(t.getFormat());n.replaceOrInsert(i),e=Dw(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(eE(p)){u=nE(p);break}for(const p of a)if(eE(p)){d=nE(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(nS(i))return;!n&&t(i)&&(n=i)}return n},u=c(o,NS),d=u&&c(s,e=>n.has(e.getKey())&&NS(e));return d&&rw(d).length>0?null:u&&d?[u,d]:null}(u,d,l);if(f){const[e,t]=f;Ow(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(Cw(e)){const t=e.origin;if(NS(t))return t}else{const t=e.getParentAtCaret();if(t&&NS(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(tS);if(e&&t&&!C_(t)&&e.isEmpty()&&l.has(e.getKey())&&0===rw(e).length&&(!n||l.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!C_(n)&&n.isEmpty();){const e=n.getParent();if(e&&C_(e)&&e.getChildrenSize()<=1)break;const t=n;n=e,t.remove(!0)}}}const h=[u,d,...s,...a].find(eE);if(h)return jw(iE(nE(h),e.direction));_p(269,JSON.stringify(s.map(e=>e.origin.__key)))}function nE(e){const t=function(e){let t=e;for(;Cw(t);){const e=Pw(t);if(!Cw(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Vy(t.origin))return Ew(t)?t:Dw(t.origin,n,n);const r=t.getAdjacentCaret();return kw(r)&&Vy(r.origin)?Dw(r.origin,n,_w(n)):t}function rE(e){return Ew(e)&&e.offset!==Iw(e.origin,e.direction)}function iE(e,t){return e.direction===t?e:e.getFlipped()}function oE(e,t){return e.direction===t?e:Uw(iE(e.focus,t),iE(e.anchor,t))}function sE(e,t,n){let r=Ow(e,"next");for(let i=0;i<t;i++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return iE(r,n)}function aE(e){const{origin:t,offset:n,direction:r}=e;if(n===Iw(t,r))return e.getSiblingCaret();if(n===Iw(t,_w(r)))return Yw(e.getSiblingCaret());const[i]=t.splitText(n);return Vy(i)||_p(281),iE(Rw(i,"next"),r)}function lE(e,t){return!0}function cE(e,{$copyElementNode:t=rS,$splitTextPointCaretNext:n=aE,rootMode:r="shadowRoot",$shouldSplit:i=lE,removeEmptyDestination:o=!1}={}){if(Ew(e))return n(e);const s=e.getParentCaret(r);if(s){const{origin:n}=s;if(Cw(e)){const e=Yw(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 uE(e,t,n){let r=iE(t,"next");Ew(r)&&(0===r.offset?r=Rw(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Rw(r.origin,"next"))),r.origin.is(e)&&(kw(r)||_p(342,e.getKey(),e.getType()),r=Yw(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=r;i;i=cE(i,n))r=i;return Ew(r)&&_p(283),r.insert(e.isInline()?B_().append(e):e),iE(Rw(e.getLatest(),"next"),t.direction)}function dE(e){return e}function fE(e){return e}function hE(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function pE(...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 gE(e,...t){const n=pE(...t);n.length>0&&e.classList.add(...n)}function mE(e,...t){const n=pE(...t);n.length>0&&e.classList.remove(...n)}function vE(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function yE(e){const t=TS().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function bE(e){return yE(C_(e)?e:e.getParentOrThrow())}function _E(e){const t=bE(e);return null!==t&&"rtl"===t.direction}function xE(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!cx(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]=lb(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=MS(e))[uy]=!0,t;var t}(t)),t.__text=h)}}return t}function SE(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function wE(e,t,n=SE){if(!e)return;const r=e.getStartEndPoints();let i=!1,o=null;const s=new Map;if(r){const[t,n]=r,a=WS(t.getNode(),NS);o=WS(n.getNode(),NS);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=Ww(e,n);if(rE(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,_w(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)&&NS(a)){if(i&&a.is(o))continue;s.set(a.getKey(),a)}else if(!r){const e=WS(a,NS);x_(e)&&s.set(e.getKey(),e)}for(const a of s.values()){const e=t();n(a,e),a.replace(e,!0)}}function EE(e){const t=kE(e);return null!==t&&"vertical-rl"===t.writingMode}function kE(e){const t=e.anchor.getNode();return x_(t)?yE(t):bE(t)}function CE(e,t){let n=EE(e)?!t:t;AE(e)&&(n=!n);const r=Ww(e.focus,n?"previous":"next");if(rE(r))return!1;if(Ew(r)&&!Jy(r.origin)&&r.origin.isUnmergeable()){const e=r.getNodeAtCaret();if(Vy(e)&&!Jy(e))return!0}for(const i of zw(r)){if(Cw(i))return!i.origin.isInline();if(!x_(i.origin)){if(E_(i.origin))return!0;break}}return!1}function AE(e){const t=kE(e);return null!==t&&"rtl"===t.direction}function NE(e,t,n){const r=AE(e);let i;i=EE(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}function TE(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function RE(e){const t=WS(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 DE(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function IE(e){let t=null;if(DE(e,DragEvent)?t=e.dataTransfer:DE(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 FE(e){const t=Nb();if(!nb(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=WS(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 OE=Symbol.for("preact-signals");function PE(){if(BE>1)return void BE--;let e,t=!1;for(function(){let e=jE;for(jE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==LE;){let n=LE;for(LE=void 0,$E++;void 0!==n;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&KE(n))try{n.c()}catch(Sp){t||(e=Sp,t=!0)}n=r}}if($E=0,BE--,t)throw e}let ME,LE;function zE(e){const t=ME;ME=void 0;try{return e()}finally{ME=t}}let jE,UE,BE=0,$E=0,qE=0;function GE(e){if(void 0===ME)return;let t=e.n;return void 0===t||t.t!==ME?(t={i:0,S:e,p:ME.s,n:void 0,t:ME,e:void 0,x:void 0,r:t},void 0!==ME.s&&(ME.s.n=t),ME.s=t,e.n=t,32&ME.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=ME.s,t.n=void 0,ME.s.n=t,ME.s=t),t):void 0}function VE(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 KE(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 WE(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 HE(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 JE(e,t){VE.call(this,void 0),this.x=e,this.s=void 0,this.g=qE-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 XE(e){const t=e.m;if(e.m=void 0,"function"==typeof t){BE++;const n=ME;ME=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,QE(e),t}finally{ME=n,PE()}}}function QE(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,XE(e)}function YE(e){if(ME!==this)throw new Error("Out-of-order effect");HE(this),ME=e,this.f&=-2,8&this.f&&QE(this),PE()}function ZE(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 ek(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}function tk(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.`)}VE.prototype.brand=OE,VE.prototype.h=function(){return!0},VE.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:zE(()=>{var e;null==(e=this.W)||e.call(this)}))},VE.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&&zE(()=>{var e;null==(e=this.Z)||e.call(this)}))}},VE.prototype.subscribe=function(e){return function(e,t){const n=new ZE(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=ME;ME=void 0;try{e(t)}finally{ME=n}},{name:"sub"})},VE.prototype.valueOf=function(){return this.value},VE.prototype.toString=function(){return this.value+""},VE.prototype.toJSON=function(){return this.value},VE.prototype.peek=function(){const e=ME;ME=void 0;try{return this.value}finally{ME=e}},Object.defineProperty(VE.prototype,"value",{get(){const e=GE(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if($E>100)throw new Error("Cycle detected");!function(e){0!==BE&&0===$E&&0!==e.l&&(e.l=0,jE={S:e,v:e.v,i:e.i,o:jE})}(this),this.v=e,this.i++,qE++,BE++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{PE()}}}}),JE.prototype=new VE,JE.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===qE)return!0;if(this.g=qE,this.f|=1,this.i>0&&!KE(this))return this.f&=-2,!0;const e=ME;try{WE(this),ME=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 ME=e,HE(this),this.f&=-2,!0},JE.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)}VE.prototype.S.call(this,e)},JE.prototype.U=function(e){if(void 0!==this.t&&(VE.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)}},JE.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(JE.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=GE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ZE.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()}},ZE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,XE(this),WE(this),BE++;const e=ME;return ME=this,YE.bind(this,e)},ZE.prototype.N=function(){2&this.f||(this.f|=2,this.u=LE,LE=this)},ZE.prototype.d=function(){this.f|=8,1&this.f||QE(this)},ZE.prototype.dispose=function(){this.d()};try{UE="0.48.0+prod.esm"}catch(_p){}const nk=UE??'"<unknown>+source"',rk=new Set(["__proto__","constructor","prototype"]);function ik(e,t){if(e&&t&&!Array.isArray(t)&&"object"==typeof e&&"object"==typeof t){const n=e,r=t;for(const e in r)!rk.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=ik(n[e],r[e]));return e}return t}function ok(e){return 0===e.id}function sk(e){return 2===e.id}const ak=new Set;let lk=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):hE;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;sk(t)||tk(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&&tk(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&&tk(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&&tk(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&&tk(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&&tk(311),this._signal}getInitResult(){void 0===this.extension.init&&tk(312,this.extension.name);const e=this.state;return function(e){return e.id>=4}(e)||tk(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)||tk(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&&tk(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&tk(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return function(e){return e.id>=7}(e)||tk(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ak}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)||tk(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const ck={tag:vy};function uk(){const e=Cx();e.isEmpty()&&e.append(B_())}const dk=dE({config:fE({setOptions:ck,updateOptions:ck}),init:({$initialEditorState:e=uk})=>({$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 R_}(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:[k_,Py,I_,Wy,j_]}),fk=Symbol.for("@lexical/extension/LexicalBuilder");function hk(){}function pk(e){throw e}function gk(e){return Array.isArray(e)?e:[e]}const mk=nk;class vk{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=mk,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[gk(dk)];for(const n of e)t.push(gk(n));return new vk(t)}static maybeFromEditor(e){const t=e[fk];return t&&(t.PACKAGE_VERSION!==mk&&tk(292,t.PACKAGE_VERSION,mk),t instanceof vk||tk(293)),t}static fromEditor(e){const t=vk.maybeFromEditor(e);return void 0===t&&tk(294),t}constructEditor(){const{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(W_({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[fk]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=hk;function t(){try{e()}finally{e=hk}}const n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=vE(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&&tk(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&&tk(296);const t=gk(e),[n]=t;"string"!=typeof n.name&&tk(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&tk(298,n.name),!r){r=new lk(this,n),this.extensionNameMap.set(n.name,r);const e=this.conflicts.get(n.name);"string"==typeof e&&tk(299,n.name,e);for(const t of n.conflictsWith||[])this.extensionNameMap.has(t)&&tk(299,n.name,t),this.conflicts.set(t,n.name);for(const t of n.dependencies||[]){const e=gk(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(sk(i))return;const o=n.extension.name;var s;ok(i)||tk(300,o,r||"[unknown]"),ok(s=i)||tk(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)||tk(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())ok(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&&tk(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 vE(...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 ek(s)){if("function"!=typeof e){const t=n.get(e.replace);t&&tk(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&&ik(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=pk),e}}function yk(e,t){const n=vk.maybeFromEditor(e);if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}class bk extends w_{static getType(){return"horizontalrule"}static clone(e){return new bk(e.__key)}static importJSON(e){return xk().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:_k,priority:0})}}exportDOM(){return{element:pS().createElement("hr")}}createDOM(e){const t=pS().createElement("hr");return gE(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function _k(){return{node:xk()}}function xk(){return KS(bk)}function Sk(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 wk;function Ek(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function kk(e){return wk&&wk.editor===e?wk:void 0}function Ck(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;return[n,r(Ek(e,n))]}return t}function Ak(e){return Object.create(e||null)}function Nk(e,t){return[e,t]}function Tk(e,t,n,r){return Object.assign(wg(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}const Rk="@lexical/html/DOM",Dk=Symbol.for("@lexical/html/DOMExportContext"),Ik=Symbol.for("@lexical/html/DOMImportContext");function Fk(e,t,n){return Tk(Dk,e,t,n)}const Ok=Fk("isExport",Boolean);function Pk(e=TS()){const t=function(e){const t=yk(e,Rk);return t?t.output.runtime:void 0}(e);return t?t.getSessionConfig():RS(e)}const Mk=function(e,t=()=>{}){return(n,r=TS())=>i=>{const o=kk(r),s=o&&o[e],a=function(e,t){let n=t;for(const r of e){const[e,i]=Ck(n,r),o=e.key;if(n===t&&Ek(n,e)===i)continue;const s=n===t||void 0===n?Ak(t):n;s[o]=i,n=s}return n}(n,s||t(r));return a&&a!==s?function(e,t,n,r=TS()){const i=wk,o=kk(r);try{return wk={...o,editor:r,[e]:t},n()}finally{wk=i}}(e,a,i,r):i()}}(Dk,function(e){const t=yk(e,Rk);return t?t.output.defaults:void 0}),Lk=Symbol.for("@lexical/html/SelectorImpl");function zk(e,t){const n={kind:"element",predicate:(r=t,0===r.length?xS: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=>zk(e,[...t,n]);return{[Lk]:n,attr:(e,t,n)=>i(Bk(e,t,n)),classAll:(...e)=>i(Uk(e)),classAny:(...e)=>i(function(e){const t=jk(e);return 0===t.length?()=>!1:e=>{if(!xS(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=>xS(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!xS(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)}}Sk(362,JSON.stringify(e))}(e,t,n))}}function jk(e){const t=[];for(const n of e)n&&t.push(n);return t}function Uk(e){const t=jk(e);return 0===t.length?()=>!0:e=>{if(!xS(e))return!1;const n=e.classList;for(const r of t)if(!n.contains(r))return!1;return!0}}function Bk(e,t,n){if(!0===t)return t=>xS(t)&&t.hasAttribute(e);if("string"==typeof t)return n=>xS(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(t,n)=>{if(!xS(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)}}Sk(361,JSON.stringify(e))}const $k={kind:"text",predicate:ux,tags:new Set},qk={[Lk]:$k},Gk={kind:"comment",predicate:e=>8===e.nodeType,tags:new Set},Vk={[Lk]:Gk},Kk={any:()=>zk(new Set,[]),comment:()=>Vk,tag(...e){e.length>0||Sk(363);const t=new Set;for(const n of e)t.add(n.toUpperCase());return zk(t,[])},text:()=>qk};function Wk(e,t){return xS(e)&&e.nodeName===t.toUpperCase()}const Hk=/[A-Za-z0-9_-]/;let Jk=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()&&Hk.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||Sk(364,String(this.pos+1),t,this.source)}};function Xk(e){const t=new Set,n=[],r=[];if(e.skipWhitespace(),"*"===e.peek())e.consume();else if(Hk.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(Bk("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(Bk(t,r))}}}return r.length>0&&n.push(Uk(r)),{predicates:n,tags:t}}function Qk(e){return e}function Yk(e,t,n){return Tk(Ik,e,t,n)}const Zk=Yk("textFormat",()=>0),eC=Yk("textStyle",()=>({}));function tC(e){if(!xS(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function nC(e){if(ux(e))return!0;if(!xS(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!AS(e)&&kS(e)}const rC=Yk("whitespaceConfig",()=>({isInline:nC,preservesWhitespace:tC}));function iC(e){return wb(e)||E_(e)&&!e.isInline()}function oC(e,t){if(!xS(t))return e;const n=t.style.textAlign;if(!lC(n))return e;for(const r of e)wb(r)&&""===r.getFormatType()&&r.setFormat(n);return e}const sC=Kk,aC=new Set(["center","end","justify","left","right","start"]);function lC(e){return aC.has(e)}const cC={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"}},uC={CODE:16,MARK:128},dC=new Set(["font-weight","font-style","text-decoration","vertical-align"]);sC.tag("b","strong","em","i","code","mark","s","sub","sup","u","span");function fC(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(ux(r))return r;if("BR"===r.nodeName)return null}}function hC(e,t){return 0!==t&&Vy(e)?e.setFormat(t):e}function pC(e,t){if(Vy(e)){const n=function(e){let t="";for(const n in e)dC.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);""!==n&&e.setStyle(n)}return e}sC.text(),sC.tag("script","style"),sC.tag("br"),sC.tag("p"),sC.tag("hr");function gC(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 mC(e){const t=[],n=new Map,r=[],i=[],o=[],s=new Set;e.forEach((e,a)=>{const l=function(e){const t=e[Lk];return void 0===t&&Sk(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,gC(c,r));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:r}}function vC(e){return"object"==typeof e&&null!==e&&"__type"in e&&"CompiledOverlayRules"===e.__type}function yC(e){const t=function(e){const t=[];for(const n of e)if(vC(n))for(const e of n.rules)t.push(e);else t.push(n);return t}(e);return{__type:"CompiledOverlayRules",dispatch:mC(t),rules:t}}sC.any(),Kk.any();const bC={any:Kk.any,comment:Kk.comment,css:function(e){const t=new Jk(e,0),n=[];for(;;){const e=Xk(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 zk(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 zk(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:Kk.tag,text:Kk.text},_C=new Set(["STYLE","SCRIPT"]);function xC(e,t){!function(e){if(!dx(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(!DE(n,CSSStyleRule))continue;let i;try{i=t.querySelectorAll(n.selectorText)}catch(e){continue}for(const e of Array.from(i)){if(!xS(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=dx(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const o of n)if(!_C.has(o.nodeName)){const t=EC(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 D_&&t.insertAfter(O_());for(const t of e){const e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function SC(e,t=null){return("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)&&Sk(338),function(e){null!==n_()&&null===Kb&&(Kb=e),Kb!==e&&xp(378)}(e),function(e,t=null,n=TS()){return Mk([Nk(Ok,!0)],n)(()=>{const r=Cx(),i=Pk(n),o=nb(t)?tw(t.anchor.getNode()):null,s=e.append.bind(e);for(const e of(x_(o)?o:r).getChildren())wC(n,e,s,t,i);return e})}(pS().createElement("div"),t,e).innerHTML}function wC(e,t,n,r=null,i=RS(e)){let o=i.$shouldInclude(t,r,e);const s=i.$shouldExclude(t,r,e);let a=t;null!==r&&Vy(t)&&(a=xE(r,t,"clone"));const l=i.$exportDOM(a,e),{element:c,after:u,append:d,$getChildNodes:f}=l;if(!c)return!1;const h=pS().createDocumentFragment(),p=f?f():x_(a)?a.getChildren():[],g=o&&ib(r)&&x_(t)?null:r,m=h.append.bind(h);for(const v of p){const n=wC(e,v,m,g,i);!o&&n&&i.$extractWithChild(t,v,r,"html",e)&&(o=!0)}if(o&&!s){if((xS(c)||wS(c))&&(d?d(h):c.append(h)),n(c),u){const e=u.call(a,c);e&&(wS(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(h);return o}function EC(e,t,n,r,i=new Map,o){const s=[];if(_C.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||!nS(a))&&(null!=a&&wb(a)||r);for(let p=0;p<d.length;p++)f.push(...EC(d[p],t,n,h,new Map(i),a));if(null!=u&&(f=u(f)),AS(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(wb(e))r&&!e.getFormat()&&e.setFormat(r),i.push(e);else if(o.push(e),s===t.length-1||s<t.length-1&&wb(t[s+1])){const e=n();e.setFormat(r),e.append(...o),i.push(e),o=[]}}return i}(e,f,h?()=>{const e=new D_;return n.push(e),e}:B_)),null==a)if(f.length>0)for(const p of f)s.push(p);else AS(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(kS(e.nextSibling)&&kS(e.previousSibling))}(e)&&s.push(O_());else x_(a)&&a.append(...f);return s}function kC(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 CC(e){const t=e.getParent();HC(t)||kC(40);let n=t,r=t;for(;null!==r;)r=r.getParent(),HC(r)&&(n=r);return n}function AC(e){let t=[];const n=e.getChildren().filter($C);for(let r=0;r<n.length;r++){const e=n[r],i=e.getFirstChild();HC(i)?t=t.concat(AC(i)):t.push(e)}return t}function NC(e){return $C(e)&&HC(e.getFirstChild())}function TC(e,t){return $C(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function RC(e){const t=Nb();if(null!==t){let n=t.getNodes();if(nb(t)){const[r]=t.getStartEndPoints(),i=r.getNode(),o=i.getParent();if(nS(i)){const e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=B_();i.append(e),n=e.select().getNodes()}}else if(TC(i,n)){const t=WC(e);if(nS(o)){i.replace(t);const e=BC();x_(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if($C(i)){const e=i.getParentOrThrow();DC(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()&&!$C(i)&&!r.has(i.getKey())){IC(i,e);continue}let o=hx(i)?i.getParent():$C(i)&&i.isEmpty()?i:null;for(;null!=o;){const t=o.getKey();if(HC(o)){if(!r.has(t)){const n=WC(e);DC(n,o.getChildren()),o.replace(n),r.add(t)}break}{const n=o.getParent();if(nS(n)&&!r.has(t)){r.add(t),IC(o,e);break}o=n}}}}}function DC(e,t){e.splice(e.getChildrenSize(),0,t)}function IC(e,t){if(HC(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=BC();let o;if(DC(i,e.getChildren()),HC(n)&&t===n.getListType())n.append(i),HC(r)&&t===r.getListType()&&(DC(n,r.getChildren()),r.remove()),o=n;else if(HC(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=WC(t);n.append(i),e.replace(n),o=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=Nb();return nb(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 FC(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&NC(n)&&NC(r)&&(FC(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function OC(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())$C(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),HC(r.getFirstChild())||n++)}function PC(e){const t=new Set;if(NC(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(NC(r)&&NC(i)){const n=i.getFirstChild();if(HC(n)){n.append(e);const i=r.getFirstChild();HC(i)&&(DC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(NC(r)){const t=r.getFirstChild();if(HC(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(NC(i)){const t=i.getFirstChild();HC(t)&&t.append(e)}else if(HC(n)){const t=rS(e),o=rS(n);t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function MC(e){if(NC(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(HC(n?n.getParent():void 0)&&$C(n)&&HC(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=rS(e),i=rS(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));const o=rS(e),s=rS(t);o.append(s),DC(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(o),n.replace(e)}}}let LC=class extends __{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(HC(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();HC(n)||kC(340);const r=[e];for(const t of["previous","next"]){r.reverse();for(const{origin:n}of Rw(e,t)){if(!$C(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),nS(t)||(uE(n,Yw(Rw(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:__,importDOM:{li:()=>({conversion:zC,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=pS().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t){const n=t.getParent();!HC(n)||"check"!==n.getListType()||HC(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=HC(s)&&"check"===s.getListType(),l=n.getChecked(),c=n.getChildren().some(e=>HC(e)),u=[];void 0!==r.listitemChecked&&u.push(r.listitemChecked),void 0!==r.listitemUnchecked&&u.push(r.listitemUnchecked),void 0!==o&&u.push(...pE(o)),u.length>0&&mE(e,...u);const d=[];if(void 0!==i&&d.push(...pE(i)),a){const e=l?r.listitemChecked:r.listitemUnchecked;void 0!==e&&d.push(e)}void 0!==o&&c&&d.push(...pE(o)),d.length>0&&gE(e,...d)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&Ay(t.style,i,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const o=ky(r);for(const s in o)e.style.setProperty(`--listitem-marker-${s}`,o[s]);if(""!==i)for(const s in ky(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),NC(this)?{after(e){if(xS(e)){const t=e.previousElementSibling;if(xS(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($C(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!HC(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=rS(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)||kC(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&x_(e)){const t=Nb();if(nb(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(HC(n)||kC(39),$C(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=rS(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&&NC(t)&&NC(n)&&(FC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=rS(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(NC(this))return!1;const t=this.getParentOrThrow();if($C(t.getParentOrThrow()))return MC(this),!0;const n=B_().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){const e=rS(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 HC(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(;$C(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&kC(117),(e=Math.floor(e))>=0||kC(199);let t=this.getIndent();for(;t!==e;)t<e?(PC(this),t++):(MC(this),t--);return this}canInsertAfter(e){return $C(e)}canReplaceWith(e){return $C(e)}canMergeWith(e){return $C(e)||$_(e)}extractWithChild(e,t){if(!nb(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 WC("bullet")}canMergeWhenEmpty(){return!0}};function zC(e){if(e.classList.contains("task-list-item"))for(const r of e.children)if("INPUT"===r.tagName)return jC(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 jC(r.children[0]);const t=e.getAttribute("aria-checked"),n=BC("true"===t||"false"!==t&&void 0);return jS(n,e),{after:UC.bind(null,n),node:zS(n,e)}}function jC(e){if("checkbox"!==e.getAttribute("type"))return{node:null};const t=BC(e.hasAttribute("checked"));return{after:UC.bind(null,t),node:t}}function UC(e,t){const n=t[0];return 1===t.length&&$_(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function BC(e){return iS(new LC(void 0,e))}function $C(e){return e instanceof LC}let qC=class extends __{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();HC(t)&&e.getListType()===t.getListType()&&FC(e,t)}(e),OC(e)},extends:__,importDOM:{ol:()=>({conversion:VC,priority:0}),ul:()=>({conversion:VC,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=KC[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=pS().createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,GC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(GC(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 xS(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];$C(e)||(r===n&&(r=[...n]),r[i]=this.createListItemNode().append(!x_(e)||HC(e)||e.isInline()?e:Gy(e.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return $C(e)}createListItemNode(){return BC()}};function GC(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($C(n)){const e=n.getParent();if(HC(e)){t++,n=e.getParent();continue}kC(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(...pE(a));for(let t=0;t<e.length;t++)t!==s&&i.push(n.__tag+t)}if(void 0!==c){const e=pE(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&mE(e,...i),r.length>0&&gE(e,...r)}function VC(e){let t;if(function(e){return xS(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const n=e.start;t=WC("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(xS(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?WC("check"):WC("bullet");return zS(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($C(t)){r.push(t);const e=t.getChildren();e.length>1&&e.forEach(e=>{HC(e)&&r.push(n().append(e))})}else r.push(n().append(t))}return r}(e,t),node:t}}const KC={ol:"number",ul:"bullet"};function WC(e="number",t=1){return iS(new qC(e,t))}function HC(e){return e instanceof qC}function JC(e){const t=[];for(const n of e)if($C(n)){t.push(n);const e=n.getChildren();if(e.length>1)for(const n of e)HC(n)&&t.push(BC().append(n))}else t.push(BC().append(n));return t}bC.tag("ol","ul");function XC(e,t){if(1!==t.length)return t;const n=t[0];return $_(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function QC(e){const t=e=>iC(e)&&!HC(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(O_()),o.push(...s);return o}bC.tag("li");bC.tag("li").classAll("task-list-item"),bC.tag("li").classAll("joplin-checkbox");const YC=Lm("UPDATE_LIST_START_COMMAND"),ZC=Lm("INSERT_UNORDERED_LIST_COMMAND"),eA=Lm("INSERT_ORDERED_LIST_COMMAND"),tA=Lm("REMOVE_LIST_COMMAND");function nA(e,t){return vE(e.registerCommand(eA,()=>(RC("number"),!0),1),e.registerCommand(YC,e=>{const{listNodeKey:t,newStart:n}=e,r=bx(t);return!!HC(r)&&("number"===r.getListType()&&(r.setStart(n),OC(r)),!0)},1),e.registerCommand(ZC,()=>(RC("bullet"),!0),1),e.registerCommand(tA,()=>(function(){const e=Nb();if(nb(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(TC(r,n))t.add(CC(r));else for(let e=0;e<n.length;e++){const r=n[e];if(hx(r)){const e=TE(r,LC);null!=e&&t.add(CC(e))}}for(const i of t){let t=i;const n=AC(i);for(const r of n){const n=B_().setTextStyle(e.style).setTextFormat(e.format);DC(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&Hw(e.anchor,nE(Ow(n,"next"))),r.__key===e.focus.key&&Hw(e.focus,nE(Ow(n,"next"))),r.remove()}i.remove()}}}(),!0),1),e.registerCommand(Wm,()=>function(e=!1){const t=Nb();if(!nb(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if($C(n)&&0===n.getChildrenSize())r=n;else if(Vy(n)){const e=n.getParent();$C(e)&&e.getChildren().every(e=>Vy(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;const i=CC(r),o=r.getParent();HC(o)||kC(40);const s=o.getParent();let a;if(nS(s))a=B_(),i.insertAfter(a);else{if(!$C(s))return!1;a=rS(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=rS(o).setStart(t);if($C(a)){const e=rS(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||!$C(e)&&!HC(e))break;t=e}t.remove()}(r),!0}(!1),1),e.registerCommand(fv,e=>{if(function(){const e=Nb();if(!nb(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=e.anchor.getNode(),n=WS(t,$C);if(!$C(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(!HC(i)||!n.is(i.getFirstChild()))return!1;const o=i.getPreviousSibling();if(!E_(o)||o.isIsolated()||!o.isKeyboardSelectable()&&o.isInline())return!1;const s=B_().append(...n.getChildren());return i.insertBefore(s),n.remove(),i.isEmpty()&&i.remove(),s.selectStart(),!0}())return e.preventDefault(),!0;const t=Nb();if(!nb(t)||!t.isCollapsed())return!1;const{anchor:n}=t;if(0!==n.offset)return!1;let r=n.getNode();for(;!$C(r);){if(null!==r.getPreviousSibling())return!1;const e=r.getParent();if(null===e)return!1;r=e}return!(!$C(r)||!r.collapseAtStart(t)||(e.preventDefault(),0))},-8),e.registerNodeTransform(LC,e=>{const t=e.getFirstChild();if(t){if(Vy(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=Nb();nb(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(Py,e=>{const t=e.getParent();if($C(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function rA(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(wy)&&(o=r,s=i,a=l),h.has(gy))return i=0,r=p,2;h.has(Ey)&&a&&(r=o,i=s,l=a);const g=h.has(yy)||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(!(nb(o)&&nb(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||C_(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)&&Vy(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Vy(c)||!Vy(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(my);if(!o&&n&&h.has(vy))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!(nb(o)&&nb(s)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!Vy(r)||!Vy(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 iA(e,t){e.undoStack=[],e.redoStack=[],e.current=null}function oA(e){return function(e,t){let n=e;for(let r=Rw(e,t);r&&(SA(r.origin)||Jy(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}(e,"previous")}function sA(e,t){for(const n of e.childNodes){if(xS(n)&&n.tagName===t)return!0;if(sA(n,t))return!0}return!1}const aA="data-language",lA="data-highlight-language",cA="data-theme";class uA extends __{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new uA(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=pS().createElement("code");gE(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(aA,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(lA,n));const r=this.getTheme();r&&t.setAttribute(cA,r);const i=this.getStyle();return i&&Ay(t.style,i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(aA,r):i&&t.removeAttribute(aA);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&t.setAttribute(lA,r):t.removeAttribute(lA):o&&r&&t.setAttribute(lA,r);const s=this.__theme,a=e.__theme;s?s!==a&&t.setAttribute(cA,s):a&&t.removeAttribute(cA);const l=this.__style,c=e.__style;return l!==c&&Ay(t.style,l,c),!1}exportDOM(e){const t=pS().createElement("pre");gE(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(aA,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(lA,n));const r=this.getTheme();r&&t.setAttribute(cA,r);const i=this.getStyle();return i&&Ay(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||sA(e,"BR"))?{conversion:hA,priority:1}:null,div:()=>({conversion:pA,priority:1}),pre:()=>({conversion:hA,priority:0}),table:e=>yA(e)?{conversion:gA,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&yA(n)?{conversion:mA,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&yA(t)?{conversion:mA,priority:3}:null}}}static importJSON(e){return dA().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(!yk(TS(),"@lexical/code")){const t=function(e){const{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){const e=t.getNode();if(fA(e)){const n=e.getChildrenSize();if(n>=2&&t.offset===n){const t=e.getLastChild();if(P_(t)&&P_(t.getPreviousSibling())){const t=B_();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(Vy(i)){let e=oA(i);const t=[];for(;;)if(Jy(e))t.push(Hy()),e=e.getNextSibling();else{if(!SA(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(xA(" ".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=[O_(),...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(fA(i)){const{offset:t}=e.anchor;i.splice(t,0,[O_()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=B_();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 dA(e,t){return KS(uA).setLanguage(e).setTheme(t)}function fA(e){return e instanceof uA}function hA(e){return{node:dA(e.getAttribute(aA))}}function pA(e){const t=e,n=vA(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(vA(t))return!0;t=t.parentElement}return!1}(t)?{node:n?dA():null}:{node:null}}function gA(){return{node:dA()}}function mA(){return{node:null}}function vA(e){return null!==e.style.fontFamily.match("monospace")}function yA(e){return e.classList.contains("js-file-line-container")}class bA extends Py{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new bA(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 gE(t,_A(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=_A(n.theme,e.__highlightType),o=_A(n.theme,this.__highlightType);return i!==o&&(i&&mE(t,i),o&&gE(t,o)),r}static importJSON(e){return xA().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 dA()}}function _A(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function xA(e="",t){return iS(new bA(e,t))}function SA(e){return e instanceof bA}const wA="data-language";function EA(e){return null!==e.style.fontFamily.match("monospace")}function kA(e){let t=e.parentElement;for(;null!==t;){if(EA(t))return!0;t=t.parentElement}return!1}bC.tag("tr","td"),bC.tag("pre"),bC.tag("code");bC.tag("div"),bC.tag("div","br");bC.tag("div");bC.tag("table").classAll("js-file-line-container"),bC.tag("td").classAll("js-file-line");const CA=new Set(["http:","https:","mailto:","sms:","tel:"]);let AA=class e extends __{__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=pS().createElement("a");return this.updateLinkDOM(null,t,e),gE(t,e.theme.link),t}updateLinkDOM(e,t,n){if(_S(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:NA,priority:1})}}static importJSON(e){return TA().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=MA(e);try{const t=new URL(MA(e));if(!CA.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&&!CA.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=rS(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!nb(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 NA(e){let t=null;if(_S(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=TA(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function TA(e="",t){return iS(new AA(e,t))}function RA(e){return e instanceof AA}let DA=class e extends AA{__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?pS().createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return IA().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=IA(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function IA(e="",t){return iS(new DA(e,t))}function FA(e){return e instanceof DA}function OA(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 PA=/^\+?[0-9\s()-]{5,}$/;function MA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:PA.test(e)?`tel:${e}`:`https://${e}`}function LA(e,t,n=null){const r=hS(n),i=n?dS(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=Hx(n)}return!1}(o.offsetNode,n))return{node:o.offsetNode,offset:o.offset}}if(o){const i=n.getRootNode();if(cS(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 zA(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.`)}bC.tag("a");const jA={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};const UA=(e,t)=>{if(!nb(t))return t.insertRawText(e),!0;const n=e=>{const t=Nb();nb(t)&&e(t)};return Lb(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([Hy()])),text:e=>n(t=>t.insertText(e))}),!0},BA={"application/x-lexical-editor":[(e,t,n)=>{try{const n=TS(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return QA(n,function(e){const t=[];for(const n of e)t.push(c_(n));return t}(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{const n=TS(),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 QA(n,xC(n,r),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[UA],"text/uri-list":[UA]};function $A(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 qA(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)&&$A(e.$importMimeType[i],o,n,t))return!0}return!1}const GA={$importMimeType:BA,$insertDataTransfer:(e,t)=>qA({$importMimeType:BA,priority:jA},e,t),priority:jA},VA=dE({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>qA(t,e,n),priority:t.priority}),config:fE({$importMimeType:BA,priority:jA}),mergeConfig(e,t){const n=hE(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 KA(e,t=Nb()){return null==t&&zA(166),nb(t)&&t.isCollapsed()||0===t.getNodes().length?"":SC(e,t)}function WA(e,t=Nb()){return null==t&&zA(166),nb(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=Cx(),i=nb(t)?t.anchor.getNode():ib(t)?t.getNodes()[0]??null:null,o=null!==i?tw(i):null,s=(x_(o)?o:r).getChildren();for(let a=0;a<s.length;a++)YA(e,t,s[a],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}function HA(e,t,n){(function(){const e=function(e){return yk(TS(),e)}(VA.name);return e?e.output:GA})().$insertDataTransfer(e,t)}const JA="application/x-lexical-drag";function XA(e,t){return function(e,t,n){const r=e.dataTransfer;if(null===r)return!1;const i=function(e){const t=e.getData(JA);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=LA(e.clientX,e.clientY,t.getRootElement());if(null===n)return null;const r=wx(n.node);if(null===r)return null;if(Vy(r))return Dw(r,"next",n.offset);if(x_(r))return sE(r,n.offset,"next");const i=r.getParent();return null===i?null:sE(i,r.getIndexWithinParent()+1,"next")}(e,t);if(null===o)return!1;const s=cE(o);if(null===s)return!1;const a=i.editorKey===t.getKey(),l=Nb();if(a){if(!nb(l)||l.isCollapsed())return!1;if(function(e,t){const{anchor:n,focus:r}=oE(Qw(t),"next");return $w(n,e)<0&&$w(e,r)<0}(o,l))return e.preventDefault(),!0;l.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(n(r,Jw(jw(s)),t),!a){const e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(const n of fS(t)){const t=ax(n);if(ox(t)&&t.getKey()===e&&xS(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,HA)}function QA(e,t,n){e.dispatchCommand(jm,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(nb(e)&&e.isCollapsed()){let t=null;const n=Ww(e.anchor,"previous");if(n)if(Ew(n))t=n.origin;else{const e=Uw(n,Ow(Cx(),"next").getFlipped());for(const n of e){if(Vy(n.origin)){t=n.origin;break}if(x_(n.origin)&&!n.origin.isInline())break}}if(t&&Vy(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 YA(e,t,n,r=[]){let i=null===t||n.isSelected(t);const o=x_(n)&&n.excludeFromCopy("html");let s=n;null!==t&&Vy(s)&&(s=xE(t,s,"clone"));const a=x_(s)?s.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&zA(58,n.name),x_(e)){const e=t.children;Array.isArray(e)||zA(59,n.name)}return t}(s);Vy(s)&&0===s.getTextContentSize()&&(i=!1);const c=i&&ib(t)&&x_(n)?null:t;for(let u=0;u<a.length;u++){const r=a[u],o=YA(e,c,r,l.children);!i&&x_(n)&&o&&n.extractWithChild(r,t,"clone")&&(i=!0)}if(i&&!o){const t=rw(s);if(t.length>0){const n={};for(const r of t){const t=iw(s,r);null===t&&zA(366,s.constructor.name,r);const i=[];YA(e,null,t,i),1===i.length&&i[0].type===t.getType()||zA(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 ZA=null;async function eN(e,t,n){if(null!==ZA)return!1;if(null!==t)return new Promise((r,i)=>{e.update(()=>{r(tN(e,t,n))})});const r=e.getRootElement(),i=e._window||window,o=i.document,s=lS(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(Ev,r=>(DE(r,ClipboardEvent)&&(s(),null!==ZA&&(i.clearTimeout(ZA),ZA=null),t(tN(e,r,n))),!0),4);ZA=i.setTimeout(()=>{s(),ZA=null,t(!1)},50),o.execCommand("copy"),a.remove()})}function tN(e,t,n){if(void 0===n){const t=lS(e._window),r=Nb();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=mS(t,e.getRootElement()),o=i.anchorNode,s=i.focusNode;if(null!==o&&null!==s&&!ix(e,o,s))return!1;n=rN(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(iN(r,n),!0)}const nN=[["text/html",KA],["application/x-lexical-editor",WA]];function rN(e=Nb()){return function(e,t){const n={"text/plain":""};for(const[r,i]of Object.entries(e))if(i){const e=sN(i,t);null!==e&&(n[r]=e)}return n}(function(e=TS()){const t=yk(e,aN.name);return t?t.output:oN}(),e)}function iN(e,t){for(const[n]of nN)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}const oN={"application/x-lexical-editor":[(e,t)=>e?WA(TS(),e):t()],"text/html":[(e,t)=>e?KA(TS(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function sN(e,t){const n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}const aN=dE({build:(e,t,n)=>t.$exportMimeType,config:fE({$exportMimeType:oN}),mergeConfig(e,t){const n=hE(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"});bC.tag("h1","h2","h3","h4","h5","h6"),bC.tag("blockquote");bC.tag("blockquote"),bC.tag("p"),bC.tag("span");const lN=Lm("DRAG_DROP_PASTE_FILE"),cN=wg("shadowRoot",{parse:Boolean});class uN extends __{static getType(){return"quote"}static clone(e){return new uN(e.__key)}$config(){return this.config("quote",{extends:__,stateConfigs:[{flat:!0,stateConfig:cN}]})}isShadowRoot(){return Eg(this,cN)}setIsShadowRoot(e){return kg(this,cN,e)}createDOM(e){const t=pS().createElement("blockquote");return gE(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:mN,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(xS(t)){this.isEmpty()&&t.append(pS().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 dN().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){const n=B_(),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=B_();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function dN(e){const t=iS(new uN);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function fN(e){return e instanceof uN}let hN=class e extends __{__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=pS().createElement(t),r=e.theme.heading;if(void 0!==r){gE(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:gN,priority:0}),h2:e=>({conversion:gN,priority:0}),h3:e=>({conversion:gN,priority:0}),h4:e=>({conversion:gN,priority:0}),h5:e=>({conversion:gN,priority:0}),h6:e=>({conversion:gN,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&pN(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>pN(e)?{conversion:e=>({node:vN("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(xS(t)){this.isEmpty()&&t.append(pS().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 vN(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?B_():vN(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=B_();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){const e=B_();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function pN(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function gN(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=vN(t),LS(e,n),jS(n,e),zS(n,e)),{node:n}}function mN(e){const t=dN();return jS(t,e),LS(e,t),zS(t,e),{node:t}}function vN(e="h1"){return iS(new hN(e))}function yN(e){return E_(wx(e))}function bN(e,t,n,r){let i=!1,o=null;if(e.isCollapsed()&&"text"===e.anchor.type){const t=e.anchor.getNode();if(Vy(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&&Vy(o)&&o.hasFormat(n)))continue;s=!0}e.hasFormat(n)&&e.toggleFormat(n)}s&&e.setStyle("")}const _N={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function xN(e,t){return function(e,t){if(!e.isCollapsed())return!1;const n=Ww(e.focus,t),r=WS(n.origin,tS);if(!r)return!1;const i=e.focus.getNode();if(!r.is(i)&&!Qx(i,r))return!1;const o=Uw(n,Rw(r,t));if(o.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;const s=Uw(o.anchor.getSiblingCaret(),o.focus);let a=s.anchor.origin;for(const c of s){if(!kw(c)||!c.origin.is(a.getParent()))return!1;a=c.origin}let l=r;for(const c of zw(Rw(r,t))){if(!c.origin.is(l.getParent())){if(sS(c.origin)){const e=Rw(l,t);return Jw(Uw(e,e)),!0}break}if(!tS(c.origin))break;l=c.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||"element"!==e.anchor.type)return!1;const n=Ww(e.anchor,t).getNodeAtCaret();return!(!tS(n)||n.isInline()||(Jw(jw(nE(Ow(n,t)))),0))}(e,t)}function SN(e){return E_(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function wN(e){const t=Cb();t.add(e),Ax(t)}function EN(e,t){if(!e.isCollapsed())return!1;const n=e.focus,r=n.getNode(),i=t?"previous":"next",o=Ww(n,i);if("element"===n.type&&x_(r)&&(C_(r)||tS(r))){const e=o.getNodeAtCaret();return!(null===e||!SN(e)||(wN(e.__key),0))}const s=WS(x_(r)?r:r.getParentOrThrow(),e=>x_(e)&&!e.isInline()&&nS(e.getParent()));if(null===s)return!1;const a=Rw(s,i).getNodeAtCaret();if(null===a||!SN(a))return!1;if(0===s.getTextContentSize())return wN(a.__key),!0;const l=TS().getRootElement();if(null===l)return!1;const c=lS(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 kN(c,u,d,f,h),!1;const m=wx(p);return kN(c,u,d,f,h),null!==m&&((p===u&&g===d||!m.is(s)&&!Qx(m,s))&&(wN(a.__key),!0))}function kN(e,t,n,r,i){null!==t&&null!==r&&e.setBaseAndExtent(t,n,r,i)}function CN(e,t){if(!e.isCollapsed())return!1;const n=e.focus.getNode(),r=WS(x_(n)?n:n.getParentOrThrow(),e=>x_(e)&&!e.isInline());if(null===r)return!1;const i=TS(),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=Rw(r,t?"previous":"next").getNodeAtCaret();if(null===l||!x_(l)){if(t){const e=r.getFirstDescendant();Vy(e)?e.select(0,0):r.select(0,0)}else{const e=r.getLastDescendant();if(Vy(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=lS(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=LA(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(Vy(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 AN(e,t){const n=Rw(e,t),r=n.getAdjacentCaret();null!==r&&x_(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Jw(jw(n)):"next"===t?e.selectNext(0,0):e.selectPrevious()}function NN(e,t,n){n.preventDefault(),n.stopPropagation();const r=e.getNodes();if(0===r.length)return!0;const i=r.map(e=>Rw(e,"next")).sort($w),o=(t?i[0]:i[i.length-1]).origin,s=WS(o,e=>e!==o&&x_(e)&&!e.isInline())??Cx(),a=t?0:s.getChildrenSize();return s.select(a,a),!0}function TN(e,t=function(e,t){return new VE(e,t)}(_N)){return vE(e.registerCommand(Um,()=>{const e=Nb();return ib(e)?(e.clear(),!0):(nb(e)&&bN(e,"click","both",t.peek()),!1)},0),e.registerCommand(Vm,e=>{const t=Nb();return nb(t)?(t.deleteCharacter(e),!0):!!ib(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(Qm,e=>{const t=Nb();return!!nb(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(Ym,e=>{const t=Nb();return!!nb(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Hm,e=>{const t=Nb();if("string"==typeof e)null!==t&&t.insertText(e);else{if(null===t)return!1;const n=e.dataTransfer;if(null!=n)HA(n,t);else if(nb(t)){const n=e.data;return n&&t.insertText(n),!0}}return!0},0),e.registerCommand(Xm,()=>{const e=Nb();return!!nb(e)&&(e.removeText(),!0)},0),e.registerCommand(Zm,e=>{const t=Nb();return!(!nb(t)&&!ib(t)||(sb(t,e),0))},0),e.registerCommand(ev,e=>{const t=Nb();return!(!nb(t)&&!ib(t)||(function(e,t){const n=[];for(const[r,i]of Object.entries(t))"boolean"==typeof i&&n.push([r,i]);0!==n.length&&ob(e,e=>{for(const[t,r]of n)e=fx(e,t,r?Vp[t]:0);return e})}(t,e),0))},0),e.registerCommand(_v,e=>{const t=Nb();if(!nb(t)&&!ib(t))return!1;const n=t.getNodes();for(const r of n){const t=WS(r,e=>x_(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},0),e.registerCommand(Km,e=>{const t=Nb();return!!nb(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Wm,()=>{const e=Nb();return!!nb(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(mv,()=>{const e=Hy(),t=Nb();return nb(t)&&(e.setFormat(t.format),e.setStyle(t.style)),function(e){let t=Nb()||Tb();null===t&&(t=Cx().selectEnd()),t.insertNodes(e)}([e]),!0},0),e.registerCommand(vv,()=>FE(e=>{const t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(yv,()=>FE(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(lv,e=>{const t=Nb();if(ib(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),AN(n[0],"previous"),!0}else if(nb(t)){if(!e.shiftKey&&xN(t,"previous"))return e.preventDefault(),!0;if(!e.shiftKey&&EN(t,!0))return e.preventDefault(),!0;if(!e.shiftKey&&CN(t,!0))return e.preventDefault(),!0}return!1},0),e.registerCommand(cv,e=>{const t=Nb();if(ib(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),AN(n[0],"next"),!0}else if(nb(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===Cx().getChildrenSize()}(t))return e.preventDefault(),!0;if(!e.shiftKey&&xN(t,"next"))return e.preventDefault(),!0;if(!e.shiftKey&&EN(t,!1))return e.preventDefault(),!0;if(!e.shiftKey&&CN(t,!1))return e.preventDefault(),!0}return!1},0),e.registerCommand(sv,e=>{const n=Nb();if(ib(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),AN(t[0],_E(t[0])?"next":"previous"),!0}if(!nb(n))return!1;if(!e.shiftKey&&xN(n,_E(n.anchor.getNode())?"next":"previous"))return e.preventDefault(),!0;if(e.shiftKey||bN(n,"arrow","start",t.peek()),CE(n,!0)){const t=e.shiftKey;return e.preventDefault(),NE(n,t,!0),!0}return!1},0),e.registerCommand(iv,e=>{const n=Nb();if(ib(n)){const t=n.getNodes();if(t.length>0)return e.preventDefault(),AN(t[0],_E(t[0])?"previous":"next"),!0}if(!nb(n))return!1;if(!e.shiftKey&&xN(n,_E(n.anchor.getNode())?"previous":"next"))return e.preventDefault(),!0;if(e.shiftKey||bN(n,"arrow","end",t.peek()),CE(n,!1)){const t=e.shiftKey;return e.preventDefault(),NE(n,t,!1),!0}return!1},0),e.registerCommand(fv,t=>{const n=Nb();if(!ib(n)&&yN(t.target))return!1;if(nb(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(C_(n))return!1;const r=RE(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(yv,void 0);if(Ap&&Cp)return!1}else if(!ib(n))return!1;return t.preventDefault(),e.dispatchCommand(Vm,!0)},0),e.registerCommand(pv,t=>{const n=Nb();return!(!ib(n)&&yN(t.target))&&!(!nb(n)&&!ib(n))&&(t.preventDefault(),e.dispatchCommand(Vm,!1))},0),e.registerCommand(uv,n=>{let r=Nb();if(ib(r)){const e=r.getNodes();1===e.length&&E_(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!nb(r))return!1;if(bN(r,"enter","both",t.peek()),null!==n){if((Ap||Tp||Ip)&&Cp)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(Km,!1)}return e.dispatchCommand(Wm,void 0)},0),e.registerCommand(hv,()=>!!nb(Nb())&&(e.blur(),!0),0),e.registerCommand(bv,t=>{const[,n]=IE(t);if(n.length>0){const r=LA(t.clientX,t.clientY,e.getRootElement());if(null!==r){const{offset:t,node:i}=r,o=wx(i);if(null!==o){const e=kb();if(Vy(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")}Ax(jg(e))}e.dispatchCommand(lN,n)}return t.preventDefault(),!0}return XA(t,e)},0),e.registerCommand(xv,t=>{const[n]=IE(t),r=Nb();return!(n&&!nb(r)||(nb(r)&&!r.isCollapsed()&&null!==t.dataTransfer&&(iN(t.dataTransfer,rN(r)),function(e,t){const n={editorKey:t.getKey()};e.setData(JA,JSON.stringify(n))}(t.dataTransfer,e)),0))},0),e.registerCommand(Sv,t=>{const[n]=IE(t),r=Nb();if(n&&!nb(r))return!1;const i=LA(t.clientX,t.clientY,e.getRootElement());if(null!==i){E_(wx(i.node))&&t.preventDefault()}return!0},0),e.registerCommand(Cv,()=>{const e=Nb();return function(e){const t=Cx();if(nb(e)){const t=e.anchor,n=e.focus,r=t.getNode();if(C_(r))return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),jg(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"),jg(e)),e;const s=o;return t.set(s.getKey(),0,"element"),n.set(s.getKey(),s.getChildrenSize(),"element"),jg(e),e}{const e=t.select(0,t.getChildrenSize());Ax(jg(e))}}(nb(e)&&null!==tw(e.anchor.getNode())?e:null),!0},0),e.registerCommand(Ev,t=>(eN(e,DE(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(kv,t=>(async function(e,t){await eN(t,DE(e,ClipboardEvent)?e:null),t.update(()=>{const e=Nb();nb(e)?e.removeText():ib(e)&&e.getNodes().forEach(e=>e.remove())},{tag:"cut"})}(t,e),!0),0),e.registerCommand(Jm,t=>{const[,n,r]=IE(t);return n.length>0&&!r?(e.dispatchCommand(lN,n),!0):(!SS(t.target)||!rx(t.target))&&(null!==Nb()&&(function(e,t){e.preventDefault(),t.update(()=>{const t=Nb(),n=DE(e,InputEvent)||DE(e,KeyboardEvent)?null:e.clipboardData;null!=n&&null!==t&&HA(n,t)},{tag:yy})}(t,e),!0))},0),e.registerCommand(dv,()=>{const e=Nb();return nb(e)&&bN(e,"space","both",t.peek()),!1},0),e.registerCommand(gv,()=>{const e=Nb();return nb(e)&&bN(e,"tab","both",t.peek()),!1},0),e.registerCommand(ov,e=>{const t=Nb();if(ib(t))return NN(t,!1,e);if(!nb(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(!E_(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(av,e=>{const t=Nb();if(ib(t))return NN(t,!0,e);if(!nb(t))return!1;const{anchor:n,focus:r}=t,i=WS(r.getNode(),e=>x_(e)&&!e.isInline());if(null===i)return!1;const o=i.getFirstChild();if(!E_(o)||!o.isInline())return!1;if(WS(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 RN(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function DN(e){const t=RN(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const IN=/[!-/:-@[-`{-~\s]/,FN=/\s/,ON=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,PN=/^\s{0,3}$/;function MN(e){if(!$_(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&Vy(t)&&PN.test(t.getTextContent())}function LN(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}const zN=/^(\s*)(\d{1,})\.\s/,jN=/^(\s*)[-*+]\s/,UN=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,BN=/^(#{1,6})\s/,$N=/^>\s/,qN=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,GN=/^[ \t]*`{3,}$/,VN=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,KN=/^(?:\|)(.+)(?:\|)\s?$/;function WN(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 HN=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,JN=/^<\/[a-z_][\w-]*\s*>/i,XN=e=>new RegExp(`(?:${e.source})$`,e.flags),QN=wg("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),YN=wg("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),ZN=wg("mdHardLineBreak",{parse:e=>"string"==typeof e&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function eT(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function tT(e){const t=O_(),n=function(e){const t=e.getChildren(),n=t.length-1,r=t[n];if(!Vy(r))return null;const i=r.getTextContent(),o=eT(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(P_(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(""),i):null}(e);return null!==n&&kg(t,ZN,n),t}const nT=e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},rT=e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),a=BC("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==QN.parse(l)?void 0:l;if(HC(s)&&s.getListType()===e){c&&kg(s,QN,c);const n=s.getFirstChild();null!==n?n.insertBefore(a):s.append(a),"number"===e&&s.setStart(Number(r[2])),t.remove()}else if(HC(o)&&o.getListType()===e)c&&kg(o,QN,c),o.append(a),t.remove();else{const n=WC(e,"number"===e?Number(r[2]):void 0);c&&kg(n,QN,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)},iT=(e,t,n,r)=>{const i=[],o=e.getChildren();let s=0;for(const a of o)if($C(a)){if(1===a.getChildrenSize()){const e=a.getFirstChild();if(HC(e)){const o=iT(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=Eg(e,QN),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")},oT={dependencies:[hN],export:(e,t)=>{if(!function(e){return e instanceof hN}(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:BN,replace:nT(e=>vN("h"+e[1].length)),triggerOnEnter:!0,type:"element"},sT={dependencies:[uN],export:(e,t)=>{if(!fN(e))return null;const n=t(e).split("\n"),r=[];for(const i of n)r.push("> "+i);return r.join("\n")},regExp:$N,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(fN(n))return n.splice(n.getChildrenSize(),0,[tT(n),...t]),void e.remove()}const i=dN();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:"element"},aT={dependencies:[uA],export:e=>{if(!fA(e))return null;const t=e.getTextContent();let n=Eg(e,YN);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]="",aT.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),aT.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),aT.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:GN},regExpStart:qN,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=dA(c),a=i[0]):(s=dA(c),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=dA(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")}kg(s,YN,l);const t=Gy(a);s.append(t),e.append(s)}else t&&nT(e=>dA(e?e[2]:void 0))(e,t,n,o)},type:"multiline-element"},lT={dependencies:[qC,LC],export:(e,t,n)=>HC(e)?iT(e,t,0,n):null,regExp:jN,replace:rT("bullet"),triggerOnEnter:!0,type:"element"},cT={dependencies:[qC,LC],export:(e,t,n)=>HC(e)?iT(e,t,0,n):null,regExp:zN,replace:rT("number"),triggerOnEnter:!0,type:"element"},uT={dependencies:[AA],export:(e,t,n)=>{if(!RA(e)||FA(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(WS(e,RA))return;const[,n,r,i]=t,o=TA(null!=r?LN(r):void 0,{title:null!=i?LN(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=Gy(l);return u.setFormat(e.getFormat()),o.append(u),e.replace(o),c&&o.insertBefore(Gy(c)),u},trigger:")",type:"text-match"},dT=[...[oT,sT,lT,cT],...[aT],...[{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"}],...[uT]];function fT(e,t,n,r,i){for(const o of t){if(!o.export)continue;const t=o.export(e,e=>hT(e,n,r,void 0,void 0,i));if(null!=t)return t}return x_(e)?hT(e,n,r,void 0,void 0,i):E_(e)?e.getTextContent():null}function hT(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=>hT(e,t,n,r,[...i,...r],o),(e,n)=>gT(e,n,t,r,i,o));if(null!=a){s.push(a);continue e}}P_(l)?s.push(pT(l)):Vy(l)?s.push(gT(l,l.getTextContent(),t,r,i,o)):x_(l)?s.push(hT(l,t,n,r,i,o)):E_(l)&&s.push(l.getTextContent())}return s.join("")}function pT(e){return Eg(e,ZN)+"\n"}function gT(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=mT(e,!0),m=mT(e,!1),v=new Set;for(const y of n){const t=y.format[0],n=y.tag;"code"!==t&&yT(e,t)&&!v.has(t)&&(v.add(t),yT(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=vT(e,r[y].format),n=vT(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 mT(e,t){const n=t?e.getPreviousSibling():e.getNextSibling();return Vy(n)?n:null}function vT(e,t){return Vy(e)&&e.hasFormat(t)}function yT(e,t){return!(!vT(e,t)||"code"!==t&&e&&/^\s*$/.test(e.getTextContent()))}function bT(e,t,n,r,i){if(!_T(t,n,r,i))return!1;if("*"===e)return!0;if("_"===e){if(!_T(t,n,r,!i))return!0;const e=i?t[n-1]:t[n+r];return void 0!==e&&ON.test(e)}return!0}function _T(e,t,n,r){const i=e[t-1],o=e[t+n],[s,a]=r?[o,i]:[i,o];return void 0!==s&&!FN.test(s)&&(!ON.test(s)||void 0===a||FN.test(a)||ON.test(a))}function xT(e){return Vy(e)&&!e.hasFormat("code")}function ST(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=bT(t,e,a,n,!0),c=bT(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);xT(i.nodeAfter)&&ST(i.nodeAfter,t,n),xT(i.nodeBefore)&&ST(i.nodeBefore,t,n),xT(i.transformedNode)&&ST(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;xT(r.nodeAfter)&&ST(r.nodeAfter,t,n),xT(r.nodeBefore)&&ST(r.nodeBefore,t,n),xT(r.transformedNode)&&ST(r.transformedNode,t,n)}const o=LN(e.getTextContent());e.setTextContent(o)}function wT(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 ET(e,t,n,r,i,o){const s=Gy(e),a=B_();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(ST(s,r,i),null!==a.getParent()&&e.length>0){const e=a.getPreviousSibling();if(!o&&($_(e)||fN(e)||HC(e))){let t=e;if(HC(e)){const n=e.getLastDescendant();t=null==n?null:WS(n,$C)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[tT(t),...a.getChildren()]),a.remove())}}}function kT(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(Hy())})}function CT(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 AT(e,t,n,r,i){if(!nS(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 NT(e,t,n,r,i){if(!nS(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 TT(e,t){let n=0;const r=e.getTextContent();for(let i=0;i<t;i++)"`"===r[i]&&n++;return n%2!=0}function RT(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(DT(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function DT(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function IT(e,t=dT,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?eT(e):null,c=void 0!==a&&null!==eT(a);if(VN.test(s))i.push(s);else if(0===r){{const e=s.match(qN);if(e){r=e[1].trim().length,i.push(s);continue}}""===s||""===a||!a||BN.test(a)||BN.test(s)||$N.test(s)||zN.test(s)||jN.test(s)||UN.test(s)||KN.test(s)||WN(s)||c||!t||HN.test(s)||JN.test(s)||XN(JN).test(a)||XN(HN).test(a)||GN.test(a)?i.push(!t&&""!==s||null!==l?e:s):i[i.length-1]=a+" "+(null===l?s:e).trimStart()}else{if(GN.test(s)&&s.trim().length>=r){r=0,i.push(s);continue}i.push(e)}}return i.join("\n")}(e,i),s=Cx();s.clear(),function(e,t,n,r=!1){const i=DN(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]=wT(s,c,i.multilineElement,t);n?c=a:ET(e,t,i.element,o,i.textMatch,r)}const l=t.getChildren();for(const c of l)if(!r&&MN(c)&&t.getChildrenSize()>1)c.remove();else if(x_(c))for(const e of c.getAllTextNodes())kT(e)}(o,s,t,r),null!==Nb()&&s.selectStart()}function FT(e=dT,t,n=!1){const r=function(e,t=!1){const n=DN(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||Cx()).getChildren();for(let l=0;l<a.length;l++){const e=a[l],c=fT(e,r,o,n.textMatch,t);null!=c&&s.push(i&&l>0&&!MN(e)&&!MN(a[l-1])?"\n".concat(c):c)}return s.join("\n")}}(e,n);return r(t)}let OT=[hN,uN,qC,LC,AA,uA];function PT(e){return"var("+e+")"}let MT=Ls([qo("flex"),Wo("wrap"),jo("center"),zo("gap","2px"),zo("padding","var("+_t.xs+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]),LT=Ls([zo("background","none"),zo("border","1px solid transparent"),zo("border-radius",PT(St.sm)),zo("color",PT(bt.textSecondary)),zo("font-family","inherit"),zo("font-size",PT(xt.sizeSm)),zo("line-height","1"),zo("min-width","26px"),zo("padding","5px 6px"),$o("pointer"),Cs([zo("background",PT(bt.surfaceSubtle))])]),zT=Ls([zo("background",PT(bt.surfaceSubtle)),zo("border-color",PT(bt.border)),zo("color",PT(bt.textPrimary))]),jT=Ls([cs(.4),$o("notAllowed")]),UT=Ls([zo("width","1px"),zo("align-self","stretch"),zo("background",PT(bt.borderSubtle)),zo("margin","2px 4px")]),BT=Ls([qo("flex"),jo("center"),zo("gap",PT(_t.xs)),zo("padding","var("+_t.xs+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]),$T=Ls([Vo(1),zo("background",PT(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",PT(St.sm)),zo("color",PT(bt.textPrimary)),zo("font-family","inherit"),zo("font-size",PT(xt.sizeSm)),zo("padding","3px 6px"),zo("outline","none"),Es([zo("border-color",PT(bt.brand))])]);let qT={bold:!1,italic:!1,code:!1},GT=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=Nb();null!=t&&nb(t)&&wE(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?LT+" "+jT:o?LT+" "+zT:LT,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=Nb();if(null===s||!nb(s)&&!ib(s))return;if(ib(s)){const e=s.getNodes();if(0===e.length)return;return void e.forEach(e=>{if(null===n){const t=WS(e,e=>!FA(e)&&RA(e));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=WS(e,e=>!FA(e)&&RA(e));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==o&&t.setRel(o);else{const t=TA(n,{rel:o,target:r});e.insertBefore(t),t.append(e)}}})}if(s.isCollapsed()&&null===n)for(const u of s.getNodes()){const e=WS(u,e=>!FA(e)&&RA(e));return void(null!==e&&(e.getParentOrThrow().splice(e.getIndexWithinParent(),0,e.getChildren()),e.remove()))}const a=s.extract();if(null===n){const e=new Set;return void a.forEach(t=>{const n=WS(t,e=>!FA(e)&&RA(e));if(null!==n){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||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=rS(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=WS(e,RA);if(null!==t)return c(t)}!function(e){const t=Nb();if(!nb(t))return e();const n=jg(t),r=n.isBackward(),i=OA(n.anchor,r?-1:0),o=OA(n.focus,r?0:-1);if(e(),i||o){const e=Nb();if(nb(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")}Ax(jg(t))}}}(()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const s=WS(t,RA);if(s){c(s);continue}if(x_(t)){if(!t.isInline())continue;if(RA(t)){if(!(FA(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();RA(a)&&a.is(e)?a.append(t):(e=TA(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(Zm,"bold")),p("I","Italic",n.italic,()=>f(Zm,"italic")),p("</>","Inline code",n.code,()=>f(Zm,"code")),i("span",{className:UT}),p("H1","Heading 1",void 0,()=>h(()=>vN("h1"))),p("H2","Heading 2",void 0,()=>h(()=>vN("h2"))),p("¶","Paragraph",void 0,()=>h(()=>B_())),i("span",{className:UT}),p("•","Bulleted list",void 0,()=>f(ZC,void 0)),p("1.","Numbered list",void 0,()=>f(eA,void 0)),p("“","Quote",void 0,()=>h(()=>dN())),p("🔗","Link",void 0,()=>u(e=>$(e)?void 0:"")),i("span",{className:UT}),p("↩","Undo",void 0,()=>f(tv,void 0)),p("↪","Redo",void 0,()=>f(nv,void 0))],"aria-label":"Formatting",className:MT,role:"toolbar"}),void 0!==d?r("div",{children:[i("input",{"aria-label":"Link URL",className:$T,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:BT}):null]})};let VT={contents:void 0};function KT(e){let t=function(){let e=VT.contents;if(void 0!==e)return D(e);let t=W_({namespace:"reventless-rich-text-probe",nodes:OT,onError:e=>{}});return VT.contents=T(t),t}(),n={contents:""};return t.update(()=>{IT(e,dT)},{discrete:!0}),t.read(()=>{n.contents=FT(dT)}),n.contents}function WT(e){return"var("+e+")"}let HT=Ls([qo("flex"),Go("column"),zo("background",WT(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",WT(St.sm)),zo("box-sizing","border-box"),zo("transition","border-color 120ms"),bs({NAME:"percent",VAL:100}),us("hidden"),ks([zo("border-color",WT(bt.brand))])]),JT=Ls([zo("border-color",WT(bt.error)),ks([zo("border-color",WT(bt.error))])]),XT=Ls([qo("flex"),jo("center"),zo("gap","2px"),zo("justify-content","flex-end"),zo("padding","var("+_t.xs+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]);let QT=Ls([zo("background",WT(bt.surfaceSubtle)),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),zo("color",WT(bt.textSecondary)),zo("font-size",WT(xt.sizeXs)),zo("line-height",WT(xt.lineHeightNormal)),zo("padding","var("+_t.xs+") var("+_t.sm+")")]),YT=Ls([ps("relative"),qo("flex"),Go("column")]),ZT=Ls([ps("absolute"),zo("top","var("+_t.sm+")"),zo("left","var("+_t.sm+")"),zo("color",WT(bt.textDisabled)),zo("font-size",WT(xt.sizeSm)),zo("pointer-events","none"),zo("user-select","none")]);function eR(e){return Ls([zo("color",WT(bt.textPrimary)),zo("font-size",WT(xt.sizeSm)),zo("line-height",WT(xt.lineHeightRelaxed)),zo("min-height",e),zo("outline","none"),zo("padding",WT(_t.sm)),zo("word-break","break-word"),zo("overflow-y","auto"),zo("tab-size","4")])}let tR=Ls([zo("margin","0 0 var("+_t.sm+")")]),nR=Ls([zo("font-size",WT(xt.sizeXl)),zo("font-weight",WT(xt.weightBold)),zo("line-height",WT(xt.lineHeightTight)),zo("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),rR=Ls([zo("font-size",WT(xt.sizeLg)),zo("font-weight",WT(xt.weightBold)),zo("line-height",WT(xt.lineHeightTight)),zo("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),iR=Ls([zo("font-size",WT(xt.sizeMd)),zo("font-weight",WT(xt.weightBold)),zo("margin","var("+_t.sm+") 0 var("+_t.xs+")")]),oR=Ls([zo("border-left","3px solid var("+bt.border+")"),zo("color",WT(bt.textSecondary)),zo("margin","var("+_t.xs+") 0"),zo("padding-left",WT(_t.md))]),sR=Ls([zo("margin","var("+_t.xs+") 0"),zo("padding-left","1.5em")]),aR=Ls([zo("margin","2px 0")]),lR=Ls([zo("color",WT(bt.brand)),zo("text-decoration","underline")]),cR=Ls([zo("font-weight",WT(xt.weightBold))]),uR=Ls([zo("font-style","italic")]),dR=Ls([zo("text-decoration","line-through")]),fR=Ls([zo("background",WT(bt.surfaceSubtle)),zo("border-radius",WT(St.sm)),zo("font-family",WT(xt.fontFamilyMono)),zo("font-size","0.9em"),zo("padding","1px 4px")]),hR=Ls([zo("background",WT(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",WT(St.md)),zo("display","block"),zo("font-family",WT(xt.fontFamilyMono)),zo("font-size","0.9em"),zo("margin","var("+_t.xs+") 0"),zo("padding",WT(_t.sm)),zo("white-space","pre-wrap")]);function pR(e){return Ls([zo("background","transparent"),zo("border","none"),zo("color",WT(bt.textPrimary)),zo("font-family",WT(xt.fontFamilyMono)),zo("font-size",WT(xt.sizeSm)),zo("line-height",WT(xt.lineHeightNormal)),zo("min-height",e),zo("outline","none"),zo("padding",WT(_t.sm)),zo("resize","vertical"),zo("box-sizing","border-box"),bs({NAME:"percent",VAL:100})])}let gR=Object.fromEntries([["paragraph",tR],["quote",oR],["link",lR],["code",hR],["heading",Object.fromEntries([["h1",nR],["h2",rR],["h3",iR]])],["list",Object.fromEntries([["ul",sR],["ol",sR],["listitem",aR]])],["text",Object.fromEntries([["bold",cR],["italic",uR],["strikethrough",dR],["code",fR]])]]);let mR=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,b=s(()=>"Rich"),_=b[1],x=b[0],S=s(()=>qT),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(()=>W_({namespace:"reventless-rich-text",nodes:OT,onError:e=>{console.error("[RichTextEditor] Lexical error — the document may be incomplete:",e)},theme:gR}),[]),P=e=>{D.current=e,R.current=e,I.current=!0,A(t=>function(e){return""!==e.trim()&&e.trimEnd()!==KT(e).trimEnd()}(e)),O.update(()=>{IT(e,dT)})},M=()=>{let e=(()=>{let e={contents:""};return O.read(()=>{e.contents=FT(dT)}),e.contents})();return k(t=>""===e.trim()),w(e=>{let t={contents:qT};return O.read(()=>{let e=Nb();null!=e&&nb(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=vE(TN(O),nA(O),function(e,t,n,r=Date.now,i,o=null){const s=rA(e,n,r);return vE(e.registerCommand(tv,()=>(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(Tv,!0)),0===r.length&&e.dispatchCommand(Rv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:gy})}}(e,t),!0),0),e.registerCommand(nv,()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Rv,!0));const o=n.pop();0===n.length&&e.dispatchCommand(Tv,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:gy})}}(e,t),!0),0),e.registerCommand(Av,()=>(iA(t),!1),0),e.registerCommand(Nv,()=>(iA(t),e.dispatchCommand(Tv,!1),e.dispatchCommand(Rv,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:a,tags:l})=>{const c=t.current,u=t.redoStack,d=t.undoStack,f=null===c?null:c.editorState;if(null!==c&&n===f)return;const h=s(r,n,c,i,a,l);if(1===h){if(0!==u.length&&(t.redoStack=[],e.dispatchCommand(Tv,!1)),null!==c){d.push({...c});const t="number"==typeof o||null===o?o:o.peek();null!==t&&d.length>t&&d.splice(0,d.length-t),e.dispatchCommand(Rv,!0)}}else if(2===h)return;t.current={editor:e,editorState:n}}))}(O,{current:null,redoStack:[],undoStack:[]},300),function(e,t=dT){const n=DN(t),r=n.element.filter(e=>e.triggerOnEnter),i=RN(n.textFormat,({tag:e})=>e[e.length-1]),o=RN(n.textMatch,({trigger:e})=>e),s=new Set([" "]);for(const l of n.textFormat)s.add(l.tag.slice(-1));for(const l of n.textMatch)void 0!==l.trigger&&s.add(l.trigger);for(const l of t){const t=l.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=l.dependencies;for(const n of t)e.hasNode(n)||CT(173,n.getType())}}const a=(e,t,r)=>!!(AT(e,t,r,n.element)||NT(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&&!DT(r,s,t,0,n))continue;if(" "===r[s-1])continue;const l=r[i+1];if(!1===a.intraword&&l&&!IN.test(l))continue;const c=e;let u=c,d=RT(r,s,t),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!P_(f);)if(Vy(f)){if(f.hasFormat("code"))continue;const e=f.getTextContent();u=f,d=RT(e,e.length,t)}if(d<0)continue;if(u===c&&d+n===s)continue;const h=u.getTextContent();if(d>0&&h[d-1]===o)continue;const p=h[d-1];if(!1===a.intraword&&p&&!IN.test(p))continue;if(!a.format.includes("code")&&TT(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=Nb(),b=kb();Ax(b);const _=i-n*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,_,"text");for(const e of a.format)b.formatText(e,Vp[e]);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of a.format)b.hasFormat(e)&&b.toggleFormat(e);return nb(y)&&(b.format=y.format),!0}return!1}(t,r,i));return vE(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(by)||t.has(gy))return;if(e.isComposing())return;const o=t.has(Ey),l=r.read(Nb),c=i.read(Nb);if(!nb(c)||!nb(l)||!l.isCollapsed()||l.is(c)&&!o)return;const u=l.anchor.key,d=l.anchor.offset,f=r._nodeMap.get(u);if(Vy(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(!xT(f))return;const e=f.getParent();null===e||fA(e)||a(e,f,l.anchor.offset)&&Xx(my)})}}),e.registerCommand(uv,e=>{if(null!==e&&e.shiftKey)return!1;const t=Nb();if(!nb(t)||!t.isCollapsed())return!1;const i=t.anchor.offset,o=t.anchor.getNode();if(!Vy(o)||!xT(o))return!1;const s=o.getParent();return null!==s&&!fA(s)&&!(i!==o.getTextContent().length||!NT(s,o,i,n.multilineElement,!0)&&!AT(s,o,i,r,!0)||(null!==e&&e.preventDefault(),0))},1))}(O,dT),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,Ls([zo("background",n?WT(bt.surfaceSubtle):"transparent"),zo("border","1px solid "+(n?WT(bt.border):"transparent")),zo("border-radius",WT(St.sm)),zo("color",WT(n?bt.textPrimary:bt.textSecondary)),zo("font-family","inherit"),zo("font-size",WT(xt.sizeXs)),zo("padding","2px var("+_t.sm+")"),$o("pointer")])),type:"button",onClick:t=>{if(_(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:eR(m),contentEditable:!y,role:"textbox",spellCheck:!0,onBlur:e=>f(),suppressContentEditableWarning:!0}),E[0]&&!y?i("div",{children:g,className:ZT}):null],className:YT}):i("textarea",{"aria-label":"Markdown source",className:pR(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:XT}),!y&&L?i(GT,{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:QT}):null,z],className:v?HT+" "+JT:HT})};function vR(e){return"var("+e+")"}let yR=Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("background",vR(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("color",vR(bt.textDisabled))]),bR=zs([yR,Ls([zo("width","24px"),zo("height","24px"),zo("border-radius",vR(St.sm)),zo("font-size",vR(xt.sizeSm)),zo("vertical-align","middle")])]),_R=zs([yR,Ls([zo("border-radius",vR(St.md)),zo("font-size",vR(xt.sizeSm))])]),xR=zs([_R,Ls([Go("column"),zo("gap",vR(_t.xs)),zo("aspect-ratio","4 / 3")])]),SR=zs([_R,Ls([Go("row"),zo("gap",vR(_t.sm)),zo("padding","var("+_t.sm+") var("+_t.md+")")])]),wR=Ls([zo("width","240px"),zo("max-width","100%")]),ER=Ls([zo("width","100%")]),kR=Ls([zo("width","100%"),zo("height","100%"),zo("aspect-ratio","auto")]),CR=Ls([zo("font-size","20px"),zo("line-height","1")]),AR=Ls([zo("position","absolute"),zo("width","1px"),zo("height","1px"),zo("padding","0"),zo("margin","-1px"),us("hidden"),zo("clip","rect(0, 0, 0, 0)"),zo("white-space","nowrap"),zo("border","0")]);function NR(e){return"Media"===e?"⬚":"▤"}function TR(e){switch(e){case"Thumb":case"Detail":return wR;case"Tile":return ER;case"Fill":return kR}}let RR=function(e){let t,n=e.size,o=e.kind,s=void 0!==o?o:"Media",a=void 0!==n?n:"Detail",l=U(e.label,"Media"===s?"No image":"No file");return t="Media"===s?xR:SR,"Media"===s?"Thumb"===a?i("span",{children:NR(s),"aria-label":l,className:bR,role:"img",title:l}):r("span",{children:[i("span",{children:NR(s),"aria-hidden":!0,className:CR}),l],"aria-label":l,className:zs([t,TR(a)]),role:"img"}):r("span","Thumb"===a?{children:[i("span",{children:NR(s),"aria-hidden":!0}),i("span",{children:l,className:AR})],className:bR,title:l}:{children:[i("span",{children:NR(s),"aria-hidden":!0,className:CR}),l],className:zs([t,TR(a)])})};function DR(e){return"var("+e+")"}let IR=Ls([zo("color",DR(bt.brand)),zo("text-decoration","none"),Cs([zo("text-decoration","underline")])]),FR=Ls([qo("inlineBlock"),zo("width","12px"),zo("height","12px"),zo("border-radius","3px"),zo("border","1px solid var("+bt.border+")"),zo("vertical-align","-1px")]),OR=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px")]),PR=Ls([zo("height","24px"),zo("width","24px"),zo("object-fit","cover"),zo("border-radius",DR(St.sm)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("vertical-align","middle")]),MR=Ls([zo("max-height","160px"),zo("max-width","240px"),zo("object-fit","cover"),zo("border-radius",DR(St.md)),zo("border","1px solid var("+bt.borderSubtle+")"),$o("zoomIn")]),LR=Ls([zo("color",DR(bt.error)),zo("font-size",DR(xt.sizeXs)),zo("font-weight",DR(xt.weightMedium)),zo("white-space","nowrap"),ts(Ts(6))]),zR=Ls([qo("inlineBlock"),zo("background",DR(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius","3px"),zo("color",DR(bt.textSecondary)),zo("font-size",DR(xt.sizeXs)),zo("font-weight",DR(xt.weightMedium)),zo("letter-spacing","0.03em"),zo("padding","1px 4px"),zo("line-height","1.2")]),jR=Ls([zo("color",DR(bt.textSecondary))]),UR=Ls([zo("color",DR(bt.warning)),zo("font-weight",DR(xt.weightMedium))]),BR=Ls([zo("color",DR(bt.textSecondary)),zo("font-weight",DR(xt.weightNormal))]),$R=Ls([qo("inlineBlock"),zo("background",DR(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius","3px"),zo("color",DR(bt.textSecondary)),zo("font-size",DR(xt.sizeXs)),zo("padding","1px 4px"),zo("line-height","1.2")]),qR=Ls([qo("inlineBlock"),zo("background",DR(bt.surfaceSubtle)),zo("border-radius",DR(St.full)),zo("width","64px"),zo("height","6px"),us("hidden")]);function GR(e){return Ls([zo("background",DR(bt.brand)),zo("border-radius",DR(St.full)),zo("height","100%"),zo("width",e.toString()+"%")])}let VR=Ls([zo("color",DR(bt.textSecondary)),zo("font-size",DR(xt.sizeXs)),zo("font-variant-numeric","tabular-nums")]),KR=Ls([zo("width","220px"),zo("max-width","100%")]),WR=Ls([qo("flex"),Go("column"),zo("gap","1px"),zo("line-height","1.35")]),HR=Ls([zo("background","none"),zo("border","none"),zo("padding","0"),$o("zoomIn")]),JR=Ls([qo("inlineFlex"),zo("background","none"),zo("border","none"),zo("padding","0"),zo("line-height","0"),zo("max-width","100%"),$o("pointer"),Cs([zo("opacity","0.75")])]),XR=Ls([qo("flex"),Go("column"),zo("gap",DR(_t.xs)),zo("width","100%")]),QR=Ls([zo("background","none"),zo("border","none"),zo("padding","0"),zo("color",DR(bt.textSecondary)),zo("font-size",DR(xt.sizeXs)),zo("text-decoration","underline"),$o("pointer"),Cs([zo("color",DR(bt.brand))])]),YR=Ls([qo("flex"),Go("column"),jo("flexStart"),zo("gap","6px")]),ZR=Ls([zo("color",DR(bt.textSecondary)),zo("font-family",DR(xt.fontFamilyMono)),zo("font-size",DR(xt.sizeXs))]),eD=Ls([qo("inlineBlock"),zo("background","#ffffff"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",DR(St.md)),zo("padding","4px"),zo("line-height","0")]),tD=Ls([zo("display","block"),zo("max-width","260px"),zo("height","auto")]),nD=Ls([qo("flex"),jo("center"),zo("gap",DR(_t.xs))]);function rD(e){return Ls([zo("background",DR(bt.surface)),zo("border","1px solid var("+(e?bt.error:bt.border)+")"),zo("border-radius",DR(St.sm)),zo("color",DR(bt.textPrimary)),zo("font-family","inherit"),zo("font-size",DR(xt.sizeSm)),zo("padding","6px 8px")])}let iD=Ls([zo("flex","1 1 auto"),zo("min-width","0")]),oD=Ls([zo("flex","0 0 auto")]),sD=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px")]);function aD(e){return Ls([zo("color",DR(e?bt.error:bt.textSecondary)),zo("font-size",DR(xt.sizeXs)),zo("font-variant-numeric","tabular-nums")])}let lD=Ls([qo("flex"),Go("column"),zo("gap","4px")]),cD=Ls([qo("flex"),jo("center"),zo("gap",DR(_t.xs))]);function uD(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function dD(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 fD(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 hD(e){let t=fD(e);return void 0!==t?D(t).resolvedOptions().maximumFractionDigits:2}function pD(e,t){let n=e*Math.pow(10,hD(t));return n<0?-Math.round(-n):Math.round(n)}function gD(e,t){let n=fD(t);return void 0!==n?D(n).format(e/Math.pow(10,hD(t))):dD(e)+" "+t}function mD(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 vD(e){let t=e.toFixed(2).replace(/\.?0+$/,"");return(""===t||"-"===t?"0":t)+"%"}function yD(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 bD(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 _D(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 xD(e,t){let n=jc(e),r=jc(t);return void 0!==n&&void 0!==r?r<n?"Ends before it starts":void 0:"Not a date-time"}function SD(e,t){let n=jc(e),r=jc(t);if(void 0!==n&&void 0!==r&&r>=n)return bD((r-n)/1e3)}function wD(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 ED(e){return/^[A-Za-z]{2}$/.test(e)}function kD(e){if(ED(e))return e.toUpperCase().split("").map(e=>U(e.codePointAt(0),65)+127397|0).map(e=>String.fromCodePoint(e)).join("")}let CD={contents:void 0};function AD(e){if(!ED(e))return e;let t=function(){let e,t=CD.contents;if(void 0!==t)return D(t);try{e=T(new Intl.DisplayNames(["en"],{type:"region"}))}catch(n){e=void 0}return CD.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 ND=["street","streetaddress","line1","addressline1","address1"],TD=["line2","addressline2","address2","apartment","unit","suite"],RD=["postalcode","zip","zipcode","postcode"],DD=["city","town","locality"],ID=["state","region","province","county"],FD=["country","countrycode"];function OD(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(RD),o=r(DD),s=void 0!==i?void 0!==o?i+" "+o:i:void 0!==o?o:void 0,a=me([r(ND),r(TD),s,r(ID),r(FD)],e=>e).map(e=>e.trim()).filter(e=>""!==e);return 0===a.length?void 0:a;default:return}}function PD(e){let t=kD(e);return void 0!==t?t+" "+AD(e):e}function MD(e){let t=e.toFixed(5).replace(/\.?0+$/,"");return""===t||"-"===t?"0":t}function LD(e){return L(z(Kn(e,"maximum"),e=>0|e),5,e=>e<=0?5:e)}function zD(e,t){let n=Kn(e,"maximum");return void 0!==n&&n>0&&n<=1?t/n*100:t}let jD={};function UD(e,t){jD[hn(e)]=t}function BD(e){return Xe(jD,hn(e))}function $D(e,t){return j(er(e,t),e=>Xe(jD,hn(e.semantic)))}function qD(e,t,n){return j($D(e,t),r=>r.cell(e,t,n))}function GD(e,t,n){return j($D(e,t),r=>r.detail(e,t,n))}function VD(e,t){return j(nr(e,t),e=>Xe(jD,hn(e.semantic)))}function KD(e){e.stopPropagation()}function WD(e,t,n){return i("a",n?{children:t,className:IR,href:e,rel:"noopener noreferrer",target:"_blank",onClick:KD}:{children:t,className:IR,href:e,onClick:KD})}function HD(e){return j(dt(e),e=>""===e?void 0:e)}function JD(e){let t=(t,n,r)=>z(HD(r),e);return{cell:t,detail:t}}function XD(e){let t=(t,n,r)=>z(ft(r),t=>e(t));return{cell:t,detail:t}}function QD(e){let t=e.size,n=e.kind,r=function(e){return j(d(al),t=>t(e))}(e.field);if(void 0===r)return i(RR,{kind:n,size:t});let o=function(e){return"Media"===e?["Add an image","Add image"]:["Add a file","Add file"]}(n);return i("button",{children:i(RR,{kind:n,size:t,label:o[1]}),className:JR,title:o[0],type:"button",onClick:e=>{e.stopPropagation(),r()}})}function YD(e){let t=e.alt,n=e.src,a=s(()=>!1);if(void 0===n)return i(QD,{field:e.field,kind:"Media",size:"Detail"});let l=a[1];return r(o,{children:[i("button",{children:i("img",{className:MR,alt:t,src:n}),className:HR,title:"Click to enlarge",onClick:e=>{e.stopPropagation(),l(e=>!0)}}),a[0]?i(Sc,{slides:[{key:n,src:n,title:t}],index:0,onIndexChange:e=>{},onClose:()=>l(e=>!1)}):null]})}function ZD(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 eI(e,t){return U(En(e),lt(t))}function tI(e,t){return i("img",{className:PR,alt:eI(e,t),src:He(e.ref),onClick:KD})}function nI(e){let t=ut(e);return"object"!=typeof t?"JSONNull"===t?T(void 0):void 0:"JSONObject"===t.TAG?z(Sn(e),e=>e):void 0}function rI(e,t,n){return j(HD(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(xa,{name:t=e,size:"Small"}),t],className:OR});var t})}function iI(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:zR}):null,i("a",{children:t,className:IR,download:"",href:n,rel:"noopener noreferrer",target:"_blank",onClick:KD})],className:OR})}function oI(e){let t=e.name,n=e.href,o=s(()=>!1),a=o[1],l=o[0];return r("span",{children:[r("span",{children:[iI(n,t),Vc(n)?i("button",{children:l?"Hide preview":"Preview","aria-expanded":l,className:QR,type:"button",onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null],className:OR}),l?i(Kc,{src:He(n),title:t,height:"60vh"}):null],className:XR})}function sI(e,t,n){return z(mD(n),e=>{return t=e[0],n=e[1],i("span",{children:gD(t,n),className:VR});var t,n})}function aI(e){return 0===e.length||e.includes("EUR")?"EUR":U(e[0],"EUR")}function lI(e,t){return function(e,t){return pD(e,t)/Math.pow(10,hD(t))}(e,t).toFixed(hD(t))}function cI(e){let t=e.hasError,n=e.onBlur,o=e.onChange,a=e.value,l=U(j(Mn(e.propSchema).find(e=>"currency"===e[0].toLowerCase()),e=>dn(e[1])),[]);let c;if(""===a)c=void 0;else try{c=mD(JSON.parse(a))}catch(v){c=void 0}let u=s(()=>{if(void 0===c)return["",aI(l)];let e=c[1];return[lI(c[0]/Math.pow(10,hD(e)),e),e]}),d=u[0],f=d[1],h=d[0],p=u[1],g=(e,t)=>{p(n=>[e,t]);let n=qt(e);o(void 0!==n&&""!==t&&Number.isFinite(n)?JSON.stringify(Ze([["amount",pD(n,t)],["currency",t]])):"")},m=e=>{let t=qt(h);g(void 0!==t&&""!==e?lI(t,e):h,e)};return r("span",{children:[i("input",{"aria-label":"Amount",className:rD(t)+" "+iD,inputMode:"decimal",placeholder:lI(0,f),type:"text",value:h,onBlur:e=>(()=>{let e=qt(h);if(void 0!==e){let t=lI(e,f);t!==h&&p(e=>[t,f])}n()})(),onChange:e=>{let t=e.target.value.replaceAll(",",".");if(function(e,t){let n=hD(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:rD(t)+" "+oD,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:rD(t)+" "+oD,value:f,onBlur:e=>n(),onChange:e=>m(e.target.value)})],className:nD})}function uI(e,t,n){return z(_D(n),e=>function(e,t){let n=xD(e,t),o=SD(e,t),s=void 0!==n?n:void 0!==o?o:"";return r("span",{children:[U(Ha(e),e)+" → "+U(Ha(t),t),""===s?null:i("span",{children:s,className:aD($(n))})],className:sD})}(e[0],e[1]))}function dI(e){if(""===e)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t.toISOString()}function fI(e){let t=Ka(e);return t===e?"":t.slice(0,10)+"T"+t.slice(11,16)}function hI(e){let t,n=e.hasError,o=e.onBlur,s=e.onChange,a=e.value;if(""===a)t=void 0;else try{t=_D(JSON.parse(a))}catch(g){t=void 0}let l,c=void 0!==t?[fI(t[0]),fI(t[1])]:["",""],u=c[1],d=c[0],f=(e,t)=>{let n=dI(e),r=dI(t);s(void 0!==n&&void 0!==r?JSON.stringify(Ze([["start",n],["end",r]])):"")},h=dI(d),p=dI(u);if(void 0!==h&&void 0!==p){let e=xD(h,p);l=void 0!==e?[e,!0]:[U(SD(h,p),""),!1]}else l=["start and end",!1];return r("span",{children:[r("span",{children:[i("input",{"aria-label":"Start",className:rD(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:rD(n),type:"datetime-local",value:u,onBlur:e=>o(),onChange:e=>f(d,e.target.value)})],className:cD}),i("span",{children:l[0],className:aD(l[1])})],className:lD})}function pI(e){let t=kD(e);return void 0!==t?r("span",{children:[i("span",{children:t,"aria-hidden":!0}),AD(e)],className:OR}):e}function gI(e,t,n){return z(HD(n),pI)}function mI(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(Xn),r=t(Qn);if(void 0!==n&&void 0!==r)return[n,r]})}(n),e=>MD(e[0])+", "+MD(e[1]))}UD("Email",JD(e=>WD("mailto:"+e,e,!1))),UD("Phone",JD(e=>WD("tel:"+e,e,!1))),UD("Url",{cell:(e,t,n)=>z(HD(n),e=>WD(e,uD(e,40),!0)),detail:(e,t,n)=>z(HD(n),e=>WD(e,e,!0))}),UD("Currency",XD(dD)),UD("Percent",XD(vD)),UD("Bytes",XD(yD)),UD("Duration",XD(bD)),UD("Color",JD(e=>r("span",{children:[i("span",{className:FR,style:{background:e}}),e],className:OR}))),UD("Image",{cell:(e,t,n)=>z(ZD(n),t=>void 0!==t?i("img",{className:PR,alt:e,src:He(t),onClick:KD}):i(QD,{field:e,kind:"Media",size:"Thumb"})),detail:(e,t,n)=>z(ZD(n),t=>i(YD,{src:z(t,He),alt:e,field:e}))}),UD("CaptionedImage",{cell:(e,t,n)=>z(nI(n),t=>void 0!==t?tI(t,e):i(QD,{field:e,kind:"Media",size:"Thumb"})),detail:(e,t,n)=>z(nI(n),t=>i(YD,{src:z(t,e=>He(e.ref)),alt:L(t,lt(e),t=>eI(t,e)),field:e}))}),UD("ImageSet",{cell:(e,t,n)=>{let r=ut(n);if("object"!=typeof r)return"JSONNull"===r?i(QD,{field:e,kind:"Media",size:"Thumb"}):void 0;if("JSONArray"!==r.TAG)return;let o=wn(n)[0];return void 0!==o?tI(o,e):i(QD,{field:e,kind:"Media",size:"Thumb"})},detail:(e,t,n)=>{}}),UD("MemberRef",{cell:(e,t,n)=>j(j(tr(t),BD),r=>r.cell(e,t,n)),detail:(e,t,n)=>j(j(tr(t),BD),r=>r.detail(e,t,n))}),UD("UserRef",{cell:rI,detail:rI}),UD("Markdown",{cell:(e,t,n)=>z(HD(n),e=>uD(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(HD(n),e=>i(Lh,{source:e})),input:(e,t,n,r,o,s,a)=>i(mR,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&function(e){return""===e.trim()}(n))return"Required"}}),UD("Rating",{cell:(e,t,n)=>z(ft(n),e=>i(nu,{value:e,max:LD(t)})),detail:(e,t,n)=>z(ft(n),e=>i(nu,{value:e,max:LD(t),size:"Medium",showValue:!0})),input:(e,t,n,r,o,s,a)=>i(nu,{value:U(qt(n),0),max:LD(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=qt(n);if(void 0===i)return"Invalid rating";let o=LD(t);return i<0||i>o?"Must be between 0 and "+o.toString():void 0}}),UD("Progress",{cell:(e,t,n)=>z(ft(n),e=>{let n=function(e){return e<0?0:e>100?100:e}(zD(t,e));return r("span",{children:[i("span",{children:i("span",{className:GR(n)}),className:qR}),i("span",{children:Math.round(n).toString()+"%",className:VR})],className:OR})}),detail:(e,t,n)=>z(ft(n),e=>i("div",{children:i(uu,{value:zD(t,e)}),className:KR}))}),UD("FileUrl",{cell:(e,t,n)=>z(HD(n),e=>iI(e,uD(wD(e),40))),detail:(e,t,n)=>z(HD(n),e=>i(oI,{href:e,name:wD(e)}))}),UD("File",{cell:(e,t,n)=>z(ZD(n),t=>void 0!==t?iI(t,uD(wD(t),40)):i(QD,{field:e,kind:"Document",size:"Thumb"})),detail:(e,t,n)=>z(ZD(n),t=>void 0!==t?i(oI,{href:t,name:wD(t)}):i(QD,{field:e,kind:"Document",size:"Detail"}))}),UD("Money",{cell:sI,detail:sI,input:(e,t,n,r,o,s,a)=>i(cI,{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=mD(i);return void 0!==o?function(e,t){if(!Number.isFinite(e))return"Invalid amount";if(e===Math.trunc(e))return;let n=hD(t);return 0===n?t+" has no decimal places":t+" has "+n.toString()+" decimal places"}(o[0],o[1]):"Invalid amount"}}),UD("DateRange",{cell:uI,detail:uI,input:(e,t,n,r,o,s,a)=>i(hI,{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=_D(i);return void 0!==o?xD(o[0],o[1]):"Invalid range"}}),UD("Country",{cell:gI,detail:gI}),UD("Address",{cell:(e,t,n)=>z(function(e){return z(OD(e),e=>e.map(e=>ED(e)?AD(e):e).join(", "))}(n),e=>uD(e,60)),detail:(e,t,n)=>z(OD(n),e=>i("span",{children:e.map((e,t)=>i("span",{children:PD(e)},t.toString())),className:WR}))});let vI={cell:mI,detail:mI};UD("GeoPoint",vI);let yI="Located — this query selected only which arm the value is in, not the coordinates";function bI(e){let t=j(en(e).channel,e=>function(e){return L(Xe(du,e),pu,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 _I(e){return"var("+e+")"}UD("Geolocation",{cell:function(e,t,n){return z(In(n),e=>{switch(e.TAG){case"Pending":return i("span",{children:"Locating…",className:jR});case"Located":let t=Fn(e);return void 0!==t?MD(t[0])+", "+MD(t[1]):i("span",{children:"Located",className:$R,title:yI});case"Unresolvable":return i("span",{children:"Not located",className:UR,title:U(On(e),"No reason given")})}})},detail:function(e,t,n){return z(In(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:BR}):null],className:jR});case"Located":let n=Fn(e);return void 0!==n?MD(n[0])+", "+MD(n[1]):i("span",{children:"Located",className:$R,title:yI});case"Unresolvable":let o=On(e);return r("span",{children:["Not located",void 0!==o?i("span",{children:" "+o,className:BR}):null],className:UR})}})}}),UD("ChannelText",{cell:(e,t,n)=>z(HD(n),e=>{let n=j(bI(t),t=>{if(jh(e)>t)return jh(e)-t|0});return r("span",{children:[uD(e,80),void 0!==n?i("span",{children:n.toString()+" over",className:LR}):null]})}),detail:(e,t,n)=>{let r=HD(n),o=en(t).channel;if(void 0!==r&&void 0!==o)return i(bp,{channelId:o,message:{body:r}})},input:(e,t,n,r,o,s,a)=>{let l=j(en(t).channel,hu);return i(rp,{value:n,onChange:r,onBlur:o,maxLength:bI(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(bI(t),e=>{let t=jh(n);if(t>e)return tp(t-e|0)+" over the "+e.toString()+"-character limit"})}),UD("Qr",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(HD(n),e=>r("span",{children:[i(tc,{value:e}),i("span",{children:e,className:ZR})],className:YR}))}),UD("Barcode",{cell:(e,t,n)=>{},detail:(e,t,n)=>z(HD(n),e=>r("span",{children:[i(cc,{value:e}),i("span",{children:e,className:ZR})],className:YR}))}),UD("Signature",{cell:(e,t,n)=>j(HD(n),e=>{if(Au(e))return i("span",{children:"✓ Signed",className:VR})}),detail:(e,t,n)=>j(HD(n),e=>{if(Au(e))return i("span",{children:i("img",{className:tD,alt:"Signature",src:Nu(e)}),className:eD})}),input:(e,t,n,r,o,s,a)=>i(Tu,{value:n,onChange:r,onBlur:o,hasError:a}),validateInput:(e,t,n,r)=>{if(r&&""===n)return"Required"}});let xI=Ls([qo("inlineFlex"),jo("center"),Wo("wrap"),zo("gap","4px"),zo("font-size",_I(xt.sizeSm)),zo("min-width","0")]),SI=Ls([zo("color",_I(bt.textDisabled)),zo("font-size",_I(xt.sizeXs))]),wI=Ls([zo("color",_I(bt.brand)),zo("text-decoration","none"),Cs([zo("text-decoration","underline")])]),EI=Ls([zo("color",_I(bt.textPrimary))]);let kI=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:wI,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:EI}),s?null:i("span",{children:" › ",className:SI})]},o.toString()+":"+e.label)}),className:xI})};function CI(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function AI(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function NI(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function TI(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 RI(e){let t=function(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("refs");return void 0!==i?i:r("ref")}(e);return void 0!==t?t:U(TI(e),e)}function DI(e,t){let n=RI(e)+"Type";if(t.some(e=>e===n))return n}function II(e,t,n,r){let i=void 0!==r?r:[],o=Bt(t);if("compositeId"===e)return"KCompositeId";let s=Lt(o);if(void 0!==s)return{TAG:"KUnion",_0:s};let a=dn(o);if(void 0!==a)return{TAG:"KEnum",_0:a};let l=CI(o),c=0;if(void 0!==l)switch(l){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(o);if(void 0===t)return"KArrayOfStrings";if(NI(t)||vt(CI(t),"object"))return{TAG:"KArrayOfObjects",_0:t};let n=TI(e);return void 0!==n?{TAG:"KArrayOfEntityIds",_0:n}:"KArrayOfStrings";case"boolean":return"KBoolean";case"integer":case"number":return"KNumber";case"object":return NI(o)?{TAG:"KNestedObject",_0:o}:"KString";default:c=1}else c=1;if(1===c){let t=AI(o),r=0;if(void 0!==t)switch(t){case"date":case"date-time":return"KDate";default:r=2}else r=2;if(2===r){if(n.isId)return"KString";let t=DI(e,i);if(void 0!==t)return{TAG:"KDynamicEntityId",idKey:e,typeKey:t};let r=TI(e);return void 0!==r?{TAG:"KEntityId",_0:r}:"KString"}}}function FI(e,t,n){let r=vl(t,e);return void 0!==n&&void 0!==r&&n.pluginId===r.pluginId&&n.viewName===r.name}function OI(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"KArrayOfEntityIds":return 10;case"KEntityId":case"KDynamicEntityId":return 9;case"KArrayOfObjects":return 12;case"KNestedObject":return 13;case"KUnion":return 14}}function PI(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"KArrayOfEntityIds":return"260px";case"KEntityId":case"KDynamicEntityId":return"220px";default:return"240px"}}function MI(e,t,n){let r=void 0!==n?n:[],i=en(t),o=II(e,t,i,r),s=U(j(j(ht(t),e=>Xe(e,"title")),dt),lt(e));return{key:e,label:s,kind:o,ann:i,propSchema:t,priority:OI(e,o,i),width:PI(o,e)}}function LI(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=c.map(e=>e[0]),d=nn(e),f="List"===a&&0!==d.length,h=P(B(i,rr(e,void 0,void 0).labelField),e=>"id"!==e),p=c.map(e=>MI(e[0],e[1],u)),g=me(p,e=>{let t=e.kind;return"object"!=typeof t||"KDynamicEntityId"!==t.TAG?void 0:t.typeKey}),m=me(p,e=>{let t,n=e.kind;if("object"!=typeof n)t=!1;else switch(n.TAG){case"KEntityId":case"KArrayOfEntityIds":t=FI(n._0,l,r);break;default:t=!1}let i=vt(e.key,o),s=g.some(t=>t===e.key);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)}(e.key,e.ann,f,h)&&!t&&!i&&!s)return e});if(0===m.length){let t=e=>c.find(t=>t[0]===e);s=L(B(B(j(rn(e),t),t("compositeId")),t("id")),[],e=>[MI(e[0],e[1],void 0)])}else s=m;return s.toSorted((e,t)=>e.priority-t.priority|0)}function zI(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function jI(e){return i(Ia,{variant:"Neutral",label:e,dot:!1})}function UI(e,t,n,r,i){let o=vl(n,e);return void 0===o||void 0!==i&&(i.pluginId===o.pluginId&&i.viewName===o.name)?[void 0,t]:[Sl(o.pluginId,o.name,t,[]),t]}function BI(e,t,n,r){let i=vl(n,e);return void 0!==i?t?nt(i.name):tt(i.name):r}function $I(e,t,n){let r=e.kind;if("object"!=typeof r)return e.label;switch(r.TAG){case"KEntityId":let i=r._0;return FI(i,t,n)?e.label:BI(i,!1,t,e.label);case"KArrayOfEntityIds":let o=r._0;return FI(o,t,n)?e.label:BI(o,!0,t,e.label);case"KDynamicEntityId":return lt(RI(r.idKey));default:return e.label}}function qI(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 GI(e,t){return P(j(j(e,e=>Xe(e,t)),dt),e=>""!==e)}function VI(e,t,n,o,s){let a,l,c=FI(e,n,s),u=vl(n,e),d=void 0!==u?tt(u.name):e,f=void 0===u||c?void 0:Sl(u.pluginId,u.name,t,[]),h=P(o,e=>!c),p=P(j(h,n=>n.lookupLabel(e,t)),e=>e!==t&&""!==e);if(void 0!==h){let n=h.retiredBadge;a=void 0!==n?n(e,t):void 0}else a=void 0;if(void 0!==h){let n=h.linkable;l=void 0===n||n(e,t)}else l=!0;let g=L(h,!1,n=>n.isMissing(e,t)),m=d+" "+t,v=void 0!==p?r("span",{children:[i(ja,{href:void 0,label:d,rawValue:t,presentation:"Chip",title:m}),l?i(ja,{href:f,label:p,rawValue:t,title:m}):i("span",{children:p,title:p+" is not available to open"})],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):i(ja,{href:l?f:void 0,label:d,rawValue:t,presentation:"Chip",title:m}),y=void 0!==a?r("span",{children:[v,a],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):v;return g?i("span",{children:y,style:{fontStyle:"italic",opacity:"0.55"},title:"Referenced "+d+" not found (id: "+t+")"}):y}function KI(e,t,n,o,s,a,l,c,u){let d=void 0!==u&&u,f=FI(t,o,l),h=U(c,qn(t)),p=e=>{let n,s,c=UI(t,e,o,0,l),u=c[1],d=f?[u,!1]:qI(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(ja,{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(xa,{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=UI(t,e,o,0,l)[1],r=qI(t,n,a)[0];if(r!==n)return{name:r}});if(d&&h&&!f&&e.length>=2&&n.length===e.length)return i(sl,{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 WI(e,t,n){let r=ut(n);if("object"!=typeof r)switch(r){case"JSONFalse":return i(Ia,{variant:"Neutral",label:"No",dot:!1});case"JSONTrue":return i(Ia,{variant:"Success",label:"Yes",dot:!1});case"JSONNull":return"—"}else switch(r.TAG){case"JSONString":let i=r._0,o=Xa(e,i);if(void 0===t)return void 0!==o?o:i;switch(t){case"date":case"date-time":return Ka(i);default:return void 0!==o?o:i}case"JSONNumber":return r._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(n)}}function HI(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 WI("name",void 0,c);let u=LI(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],c=e[0],u=c.kind;if("object"!=typeof u)i=WI(c.key,"KDate"===u?AI(c.propSchema):void 0,o);else switch(u.TAG){case"KEnum":let e=ut(o);i="object"!=typeof e||"JSONString"!==e.TAG?WI(c.key,void 0,o):jI(e._0);break;case"KEntityId":i=KI(c.key,u._0,o,n,0,s,a,void 0,void 0);break;case"KDynamicEntityId":let t=GI(l,u.typeKey),r=dt(o);i=void 0!==t&&void 0!==r?VI(t,r,n,s,a):WI(c.key,void 0,o);break;default:i=WI(c.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 JI(e,t,n,o,s,a,l,c,u,d){let f=void 0!==s?s:Vt,h=P(o,e=>"JSONNull"!==ut(e));if(void 0===h)return U(function(e,t){return qD(e,t,null)}(e,n),"—");let p=qD(e,n,h);if(void 0!==p)return p;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(kI,{segments:n})}(h);case"KDate":return WI(e,AI(n),h);case"KBoolean":case"KNumber":return WI(e,void 0,h);case"KString":let t=ut(h);if("object"!=typeof t)return WI(e,void 0,h);if("JSONString"!==t.TAG)return WI(e,void 0,h);let r=t._0;return r.length>60?i("span",{children:zI(r,60),title:r}):WI(e,void 0,h);case"KArrayOfStrings":let o=U(z(pt(h),e=>me(e,dt)),[]);return i(Ca,{items:o})}else switch(t.TAG){case"KEnum":let n=ut(h);return"object"!=typeof n||"JSONString"!==n.TAG?WI(e,void 0,h):jI(n._0);case"KEntityId":case"KArrayOfEntityIds":break;case"KDynamicEntityId":let o=GI(d,t.typeKey),s=dt(h);return void 0!==o&&void 0!==s?VI(o,s,a,c,u):WI(e,void 0,h);case"KArrayOfObjects":let p=t._0,g=U(pt(h),[]),m=g.length;if(f.collapsed){let e=g[0];return void 0!==e?XI(p,e,a,l,c,u):i(Ga,{count:m,label:"items"})}let v=j(g[0],e=>HI(p,e,a,0,c,u));return void 0!==v?r("span",{children:[v,m>1?i("span",{children:"+"+(m-1|0).toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}}):i(Ga,{count:m,label:"items"});case"KNestedObject":let y=t._0;if(f.collapsed)return XI(y,h,a,l,c,u);let b=HI(y,h,a,0,c,u);if(void 0!==b)return b;let _=U(z(ht(h),e=>Object.keys(e).length),0);return i(Ga,{count:_,label:"fields"});case"KUnion":return function(e,t,n,i,o,s){let a=Dn(t);if(void 0===a)return JSON.stringify(t);let l=a[1],c=a[0],u=jt(e,c),d=L(u,c,e=>e.tag),f=U(j(u,e=>HI(Ut(e),l,n,0,o,s)),null);return r("span",{children:[jI(d),f],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}})}(t._0,h,a,0,c,u)}let g=L(er(e,n),!1,e=>"UserRef"===e.semantic);return KI(0,t._0,h,a,0,c,u,!!g||void 0,!0)}function XI(e,t,n,o,s,a){let l=U(ht(t),{}),c=LI(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:$I(e,n,a),style:{fontSize:"0.85em",minWidth:"80px",opacity:"0.55"}}),i("span",{children:JI(e.key,e.kind,e.propSchema,Xe(l,e.key),e.ann,n,o,s,a,l)})],style:{display:"flex",alignItems:"baseline",gap:"6px"}},e.key)),style:{display:"flex",maxHeight:"120px",overflow:"auto",flexDirection:"column",gap:"2px"}})}function QI(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 YI(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=$I(e,t,l),d=L(er(e.key,e.propSchema),!1,e=>{switch(e.semantic){case"Image":case"File":case"CaptionedImage":case"ImageSet":return!0;default:return!1}});return{key:e.key,label:s,render:s=>{let f=JI(e.key,e.kind,e.propSchema,o(s,e.key),e.ann,t,n,a,l,s),p=void 0!==c&&d?i(cl,{fill:e=>c(s,e),children:f}):f;if(void 0===u)return p;if($(u.values)&&e.key===u.field){let e=Za(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=Za(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&&QI(e.kind),width:e.width}})}function ZI(e){return(t,n)=>e(t,n).then(e=>e.data)}let eF=l(void 0),tF=l(void 0),nF={contents:void 0},rF=eF.Provider,iF=tF.Provider;let oF=function(e){let t=e.executeResult,n=e.execute,r=p(()=>void 0!==n?n:void 0!==t?ZI(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(rF,{value:r,children:c(iF,{value:t,children:e.children})})};function sF(){return d(eF)}function aF(){return d(tF)}let lF={hasNextPage:!1,hasPreviousPage:!1,startCursor:void 0,endCursor:void 0};function cF(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 uF(e,t){let n=cF(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 dF(e,t){return me(uF(e,t),ht)}function fF(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(cF(e,t),ht),e=>Xe(e,"pageInfo")),ht),lF,e=>({hasNextPage:n(e,"hasNextPage"),hasPreviousPage:n(e,"hasPreviousPage"),startCursor:r(e,"startCursor"),endCursor:r(e,"endCursor")}))}let hF=[];let pF={};function gF(e,t,n,r){return j(vl(n,t),t=>j(Xe(e,t.queryField),e=>Xe(e.labels,r)))}function mF(e,t,n,r){return j(vl(n,t),t=>j(t.namedRetirement,n=>j(j(Xe(e,t.queryField),e=>Xe(e.states,r)),e=>{let t=n.values;return Za(n,void 0===t||e)})))}function vF(e,t,n,r,i){if(i)return!0;let o=vl(n,t);if(void 0===o)return!0;let s=Xe(e,o.queryField);return void 0===s||q(Xe(s.states,r))}function yF(e,t,n,r){let i=vl(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 bF(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 _F(e,t,n,r){let i={},o=(e,t)=>{let n=U(Xe(i,e),[]);n.some(e=>e===t)||n.push(t),i[e]=n},s=(e,t,i)=>{t.forEach(t=>{let a=t.kind;if("object"!=typeof a)return;switch(a.TAG){case"KEntityId":case"KArrayOfEntityIds":break;case"KDynamicEntityId":let l=a.typeKey,c=a.idKey;return void e.forEach(e=>{let t=GI(e,l);if(void 0===t)return;if(FI(t,n,r))return;let i=vl(n,t);return void 0!==i?M(Xe(e,c),e=>{bF(e).forEach(e=>o(i.queryField,e))}):void 0});case"KArrayOfObjects":return i>0?s(((e,t)=>e.map(e=>me(U(j(Xe(e,t),pt),[]),ht)).flat())(e,t.key),LI(a._0,"Drill",n,r,void 0,void 0),i-1|0):void 0;case"KNestedObject":return i>0?s(((e,t)=>me(e,e=>j(Xe(e,t),ht)))(e,t.key),LI(a._0,"Drill",n,r,void 0,void 0),i-1|0):void 0;default:return}let l=a._0;if(FI(l,n,r))return;let c=vl(n,l);void 0===c||e.forEach(e=>M(Xe(e,t.key),e=>{bF(e).forEach(e=>o(c.queryField,e))}))})};return s(e,t,3),i}function xF(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 SF(e,t,n){let r={};return dF(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=xF(t),s="id"===n?void 0!==o?o:t:""===i?t:i;r[t]=s,void 0===o||(r[o]=s)}),r}function wF(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(xF(i),l)}),[n,r]}(t,r)):e(a,l).then(e=>[SF(e,r,i),{}]))}let EF=l(void 0);let kF=EF.Provider;let CF={provider:kF,make:function(e){let t=sF(),n=s(()=>pF),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(wF(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(kF,{value:y,children:e.children})}},AF={context:EF,use:function(){return d(EF)},useInvalidate:function(){let e=d(EF);return void 0!==e?e.invalidate:e=>{}},Provider:CF};function NF(e,t,n,r,i){let o=void 0===i||i,l=sF(),c=d(EF),u=s(()=>pF),f=u[1],h=o?_F(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(wF(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]}function TF(e,t,n){return U(P(j(j(e.valueLabels,e=>Xe(e,t)),e=>Xe(e,n)),e=>""!==e.trim()),lt(n))}let RF={registry:[]},DF="table",IF={contents:[]};function FF(e){IF.contents.some(t=>t.id===e.id)?IF.contents=IF.contents.map(t=>t.id===e.id?e:t):IF.contents=IF.contents.concat([e])}function OF(e){return IF.contents.find(t=>t.id===e)}function PF(){return IF.contents}function MF(e,t){let n=void 0!==t?t:RF,r=rr(e,void 0,void 0),i=IF.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===DF).concat(i.filter(e=>e.id!==DF))}function LF(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 zF(e,t,n){let r=void 0!==n?n:"item";return fa(LF(e),function(e){return ge(e,0,(e,t)=>e+t.rows.length|0)}(e),t,r)}function jF(e){try{return R(localStorage.getItem(e))}catch(t){return}}function UF(e,t,n){return"autoui.viewmode."+U(e,"default")+"."+t+L(n,"",e=>"."+e)}function BF(e){return z(jF(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 $F(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 qF(e){return"var("+e+")"}let GF=Ls([qo("inlineFlex"),jo("center"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",qF(St.md)),zo("overflow","hidden")]),VF=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("background","none"),zo("border","none"),zo("padding","2px var("+_t.sm+")"),zo("color",qF(bt.textSecondary)),zo("font-size",qF(xt.sizeSm)),$o("pointer"),Cs([zo("background",qF(bt.surfaceSubtle)),zo("color",qF(bt.textPrimary))])]),KF=zs([VF,Ls([zo("background",qF(bt.surfaceSubtle)),zo("color",qF(bt.textPrimary)),zo("font-weight",qF(xt.weightMedium))])]),WF=Ls([Ss(At.compact,[zo("display","none")])]);let HF={Style:{group:GF,btn:VF,btnActive:KF,btnLabel:WF},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:WF})],"aria-label":e.label,"aria-pressed":e.id===n?"true":"false",className:e.id===n?KF:VF,title:e.label,onClick:n=>t(e.id)},e.id)),"aria-label":"View mode",className:GF,role:"group"})}};function JF(e){let t=e.source,n=gl(),r=Ge(),o=LI(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=NF(s.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),l=t.refLabels,c=void 0!==l?l:{lookupLabel:(e,t)=>gF(a,e,n,t),isMissing:(e,t)=>yF(a,e,n,t),retiredBadge:(e,t)=>mF(a,e,n,t),linkable:(e,t)=>vF(a,e,n,t,!1)},u=o.map(e=>({key:e.key,label:$I(e,n,t.ownEntity),render:i=>JI(e.key,e.kind,e.propSchema,Xe(i.dict,e.key),e.ann,n,r,c,t.ownEntity,i.dict),sortable:!1,width:e.width}));return i(ca,{columns:u,data:s,keyFn:e=>e.rowKey,onRowClick:e=>t.onOpenRow(e.rowKey,e.json)})}let XF=i("span",{children:"▦","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});FF({id:DF,label:"Table",icon:XF,arity:"Single",isCapable:(e,t,n)=>!0,render:e=>{let t=e[0];return void 0!==t?i(JF,{source:t}):null},capability:"always — the universal default"});let QF=["resources","events"],YF=["split","full"],ZF=["funnel","scatter"],eO={};function tO(e,t){return j(e.views,e=>Xe(e,t))}function nO(e,t){return z(j(e.fields,e=>Xe(e,t)),e=>e.semantics)}function rO(e,t){console.error("[AutoUI] ui-hints "+e+": "+t)}function iO(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.string(r);return void 0!==i?i:void rO(n+"."+t,"expected a string — dropped")}function oO(e,t,n){let r=e[t];if(void 0===r)return;let i=Je.bool(r);return void 0!==i?i:void rO(n+"."+t,"expected a boolean — dropped")}function sO(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 rO(n+"."+t,"expected a whole number — dropped"):void rO(n+"."+t,"expected a number — dropped")}function aO(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 rO(n+"."+t,"expected an array of strings — dropped")}function lO(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}rO(n+"."+t,"expected an object — dropped")}function cO(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):rO(t+"."+r,"expected a string — dropped")}),e}rO(t,"expected an object of string values — dropped")}function uO(e,t){let n=Je.object(e);return void 0!==n?{label:iO(n,"label",t),scopedLabel:iO(n,"scopedLabel",t),group:iO(n,"group",t),order:sO(n,"order",t),hidden:oO(n,"hidden",t)}:void rO(t,"expected an object — dropped")}function dO(e,t){let n=Je.object(e);if(void 0!==n){let e={},r={};return Object.entries(n).forEach(n=>{let i=n[1],o=n[0],s=t+"."+o,a=Je.string(i),l=Je.object(i);return void 0!==a?void(e[o]=a):void 0!==l?M(cO(i,s),e=>{r[o]=e}):rO(s,"expected a semantic id or an object of enum-value labels — dropped")}),{semantics:e,values:0===Object.entries(r).length?void 0:r}}rO(t,"expected an object — dropped")}function fO(e,t){let n=Je.object(e);return void 0!==n?{enable:iO(n,"enable",t),disable:iO(n,"disable",t),available:iO(n,"available",t)}:void rO(t,"expected an object — dropped")}function hO(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=iO(n,"pluginId",t),r=iO(n,"slice",t),i=iO(n,"command",t),o=iO(n,"field",t);return void 0!==e&&void 0!==r&&void 0!==i&&void 0!==o?{label:iO(n,"label",t),pluginId:e,slice:r,command:i,field:o,whenState:aO(n,"whenState",t),whenRetired:oO(n,"whenRetired",t),then:iO(n,"then",t)}:void rO(t,"a row action needs pluginId, slice, command and field — dropped")}rO(t,"expected an object — dropped")}(e,t+".rowActions["+n.toString()+"]")):(rO(t+".rowActions","expected an array of row actions — dropped"),e=void 0)}else e=void 0;let o=n.transitions,s=n.matrix;return{mode:iO(n,"mode",t),layout:iO(n,"layout",t),canvas:iO(n,"canvas",t),role:iO(n,"role",t),resourceRef:iO(n,"resourceRef",t),accent:iO(n,"accent",t),audit:oO(n,"audit",t),presence:oO(n,"presence",t),related:aO(n,"related",t),nav:void 0!==r?uO(r,t+".nav"):void 0,rowActions:e,suppressRowActions:aO(n,"suppressRowActions",t),retiredLabel:iO(n,"retiredLabel",t),suppress:aO(n,"suppress",t),transitions:void 0!==o?cO(o,t+".transitions"):void 0,matrix:void 0!==s?fO(s,t+".matrix"):void 0}}rO(t,"expected an object — dropped")}function pO(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=iO(n,"view",t);return void 0!==e?{view:e,label:iO(n,"label",t),field:iO(n,"field",t),aggregate:iO(n,"aggregate",t),viz:iO(n,"viz",t),xField:iO(n,"xField",t)}:void rO(t,"metric without a `view` — dropped")}rO(t,"expected an object — dropped")}(e,n+".dashboard["+t.toString()+"]")):(rO(n+".dashboard","expected an array of metrics — dropped"),e=void 0)}else e=void 0;return{views:lO(r,"views",n,hO),fields:lO(r,"fields",n,dO),dashboard:e}}return rO(n,"expected an object — no hints applied"),eO}function gO(e){let t=Je.object(e);if(void 0!==t){let e={};return Object.entries(t).forEach(t=>{let n=t[0];e[n]=pO('ui-hints["'+n+'"]',t[1])}),e}return rO("ui-hints.json","top-level value is not a {pluginId: hints} object — ignored"),{}}function mO(e){return U(z(j(j(ht(Bt(e)),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function vO(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(Bt(e)),e=>Xe(e,"properties")),ht),e=>Xe(e,t)),Bt),ht),e=>Xe(e,"items"))}(r,n);return void 0!==i?{TAG:"Ok",_0:{schema:i}}:mO(r).includes(n)?L(j(j(j(ht(Bt(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 yO(e){return e.aggregates.flatMap(e=>e.commands).concat(e.stateChangeSlices.flatMap(e=>e.commands).concat(e.readModels.flatMap(e=>e.commands)))}function bO(e){return yO(e).map(e=>e.name)}function _O(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 xO(e,t){if(void 0!==OF(e))return;let n=PF().map(e=>e.id).join(", ");return t+': unknown view-mode id "'+e+'" — registered modes: '+n}function SO(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=vO(t,r);"Ok"!==i.TAG&&l('views["'+r+'"]: '+i._0),M(n.role,e=>{if(!QF.includes(e))return l('views["'+r+'"].role: unknown role "'+e+'" — expected '+QF.join(" or "));if("events"!==e)return;let t=n.resourceRef;return void 0!==t?"Ok"!==i.TAG||mO(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=bO(t),s=_O(t,r);n="Ok"===i.TAG&&void 0!==s?fn(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.matrix,e=>{let n='views["'+r+'"].matrix';if("Ok"!==i.TAG)return;let o=i._0.schema;if(r.includes("."))return l(n+": a nested path names a collection drilled into inside a detail, and a nested source carries no write path — a grid registered there could never toggle anything, so the matrix hint belongs on the top-level view");let s=ar(o,void 0);if(void 0===s)return l(n+": this view holds no matrix — a grid needs exactly one nested collection whose items carry two small string enums (2–12 values) and a boolean");let a=ar(o,e.available);M(e.available,e=>{if(yt(j(a,e=>e.availableField),e))return l(n+'.available: "'+e+'" is not a spare boolean of "'+s.collectionField+"\" items — the cell's own value needs one too, so the collection must declare two")});let c=U(a,s),u=lr(yO(t),c).map(e=>e.name),d=bO(t);[["enable",e.enable],["disable",e.disable]].forEach(e=>{let t=e[0];M(e[1],e=>d.includes(e)?u.includes(e)?void 0:l(n+"."+t+': "'+e+'" cannot be run by a cell — a cell names only its row and its column, so the command must take exactly '+c.rowField+" and "+c.colField+" beyond the row's id and owner"+(0!==u.length?"; these can: "+u.join(", "):"")):l(n+"."+t+': unknown command "'+e+'" — known commands: '+d.join(", ")))});let f=e.enable,h=e.disable;return void 0!==f?void 0!==h?void 0:l(n+": names one half of the pair — declare both enable and disable, or neither"):void 0!==h?l(n+": names one half of the pair — declare both enable and disable, or neither"):void 0}),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,n)=>{let o='views["'+r+'"].rowActions['+n.toString()+"]",a=s.find(t=>t.id===e.pluginId);if(void 0!==a){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))}}(a,e.slice);if("Ok"===t.TAG){let n=t._0,r=n.find(t=>t.name===e.command);if(void 0!==r){let t=mO(r.schema);t.includes(e.field)||l(o+': unknown field "'+e.field+'" on command "'+e.command+'" — known fields: '+t.join(", "))}else l(o+': unknown command "'+e.command+'" in "'+e.slice+'" — known commands: '+n.map(e=>e.name).join(", "))}else l(o+': unknown slice "'+e.slice+'" in plugin "'+e.pluginId+'" — known aggregates and slices: '+t._0.join(", "))}else l(o+': unknown plugin "'+e.pluginId+'" — known plugins: '+s.map(e=>e.id).join(", "));M(e.whenState,e=>{let n,s=_O(t,r);return n="Ok"===i.TAG&&void 0!==s?fn(i._0.schema,s):[],0===n.length?l(o+".whenState: the view declares no lifecycle enum, so no row carries a state this could match"):0===e.length?l(o+".whenState: empty — it matches no row, so the action never appears"):void e.forEach(e=>{if(!n.includes(e))return l(o+'.whenState: unknown state "'+e+'" — known states: '+n.join(", "))})}),M(e.whenRetired,e=>{if(e&&"Ok"===i.TAG&&q(on(i._0.schema)))return l(o+".whenRetired: the view declares no @retired field, so no row of it is ever withheld from this action")}),M(e.then,e=>{if(""===e.trim())return l(o+".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=on(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(xO(e,'views["'+r+'"].mode'),l)),M(n.layout,e=>{if(!YF.includes(e))return l('views["'+r+'"].layout: unknown layout "'+e+'" — expected '+YF.join(" or "))}),M(n.suppress,e=>{e.forEach(e=>{if(M(xO(e,'views["'+r+'"].suppress'),l),e===DF)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[1],r=e[0],i=vO(t,r);if("Ok"!==i.TAG)return l('fields["'+r+'"]: '+i._0);let o=i._0.schema,s=mO(o);Qe(n.semantics).forEach(e=>{let t=e[1],n=e[0];if(s.includes(n)||l('fields["'+r+'"]: unknown field "'+n+'"'),q(yn(t)))return l('fields["'+r+'"].'+n+': unknown semantic "'+t+'"')}),Qe(U(n.values,{})).forEach(e=>{let t=e[0];if(!s.includes(t))return l('fields["'+r+'"]: unknown field "'+t+'"');let n=fn(o,t);return 0===n.length?l('fields["'+r+'"].'+t+": the field declares no enum, so it has no values to label"):void Qe(e[1]).forEach(e=>{let i=e[0];return n.includes(i)?""===e[1].trim()?l('fields["'+r+'"].'+t+"."+i+": blank — an empty label renders nothing, so it is ignored"):void 0:l('fields["'+r+'"].'+t+': unknown value "'+i+'" — known values: '+n.join(", "))})})})}),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=vO(t,e.view);if("Ok"!==r.TAG)return l("dashboard metric: "+r._0);let i=r._0.schema;M(e.field,t=>{if(!mO(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown field "'+t+'"')}),M(e.xField,t=>{if(!mO(i).includes(t))return l('dashboard metric on "'+e.view+'": unknown xField "'+t+'"')}),M(e.viz,n=>{if(!ZF.includes(n))return l('dashboard metric on "'+e.view+'": unknown viz "'+n+'" — expected '+ZF.join(", "));if("funnel"===n&&0===function(e,t,n){let r=B(_O(e,t),rr(n,void 0,void 0).statusField);return void 0!==r?fn(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=mO(i),n=function(e){return Mn(e).filter(e=>jn(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 wO(e,t,n){let r=MF(e,void 0!==n?n:RF),i=j(t,e=>e.suppress);return void 0!==i?r.filter(e=>e.id===DF||!i.includes(e.id)):r}function EO(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 kO(e){switch(e){case"full":return"Full";case"split":return"Split";default:return}}function CO(e){return"hide"===e.toLowerCase()?"Hide":"Lock"}function AO(e,t){return void 0===t||0===t.length||t.some(t=>e.includes(t))}function NO(e){return j(e,e=>e[0])}function TO(e,t){let n=t=>t.filter(t=>AO(e,t.requiredAccess));return t.map(t=>{let r={...t};return r.internalQueryables=z(t.internalQueryables,t=>t.filter(t=>AO(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=>AO(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=>AO(e,t.requiredAccess)).map(e=>{let t={...e};return t.commands=n(e.commands),t}),r})}function RO(e,t){let n={},r=(t,r)=>{let i=!AO(e,r),o=NO(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 DO(e,t){let n={},r=(t,r)=>{if(0!==r.length&&r.every(t=>!AO(e,t.requiredAccess)))return M(j(r[0],e=>NO(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 IO=[zo(bt.background,"#0d1117"),zo(bt.surface,"#161b22"),zo(bt.surfaceSubtle,"#1c2128"),zo(bt.surfaceElevated,"#21262d"),zo(bt.brand,"#2f81f7"),zo(bt.brandSubtle,"#1f4b8e"),zo(bt.success,"#3fb950"),zo(bt.warning,"#d29922"),zo(bt.error,"#f85149"),zo(bt.info,"#58a6ff"),zo(bt.textPrimary,"#e6edf3"),zo(bt.textSecondary,"#8b949e"),zo(bt.textDisabled,"#484f58"),zo(bt.textOnBrand,"#ffffff"),zo(bt.border,"#30363d"),zo(bt.borderSubtle,"#21262d"),zo(_t.xs,"4px"),zo(_t.sm,"8px"),zo(_t.md,"16px"),zo(_t.lg,"24px"),zo(_t.xl,"32px"),zo(_t.xxl,"48px"),zo(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),zo(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),zo(xt.sizeXs,"11px"),zo(xt.sizeSm,"12px"),zo(xt.sizeMd,"14px"),zo(xt.sizeLg,"16px"),zo(xt.sizeXl,"20px"),zo(xt.sizeXxl,"24px"),zo(xt.weightNormal,"400"),zo(xt.weightMedium,"500"),zo(xt.weightBold,"600"),zo(xt.lineHeightTight,"1.25"),zo(xt.lineHeightNormal,"1.5"),zo(xt.lineHeightRelaxed,"1.75"),zo(St.sm,"4px"),zo(St.md,"6px"),zo(St.lg,"12px"),zo(St.full,"9999px"),zo(wt,"0 1px 3px rgba(0,0,0,0.4)"),zo(Et,"0 4px 12px rgba(0,0,0,0.5)"),zo(kt,"0 8px 24px rgba(0,0,0,0.6)")],FO=[zo(bt.background,"#ffffff"),zo(bt.surface,"#f6f8fa"),zo(bt.surfaceSubtle,"#eaeef2"),zo(bt.surfaceElevated,"#ffffff"),zo(bt.brand,"#0969da"),zo(bt.brandSubtle,"#ddf4ff"),zo(bt.success,"#1a7f37"),zo(bt.warning,"#9a6700"),zo(bt.error,"#cf222e"),zo(bt.info,"#0550ae"),zo(bt.textPrimary,"#1f2328"),zo(bt.textSecondary,"#636c76"),zo(bt.textDisabled,"#bec1c5"),zo(bt.textOnBrand,"#ffffff"),zo(bt.border,"#d0d7de"),zo(bt.borderSubtle,"#eaeef2"),zo(_t.xs,"4px"),zo(_t.sm,"8px"),zo(_t.md,"16px"),zo(_t.lg,"24px"),zo(_t.xl,"32px"),zo(_t.xxl,"48px"),zo(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),zo(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),zo(xt.sizeXs,"11px"),zo(xt.sizeSm,"12px"),zo(xt.sizeMd,"14px"),zo(xt.sizeLg,"16px"),zo(xt.sizeXl,"20px"),zo(xt.sizeXxl,"24px"),zo(xt.weightNormal,"400"),zo(xt.weightMedium,"500"),zo(xt.weightBold,"600"),zo(xt.lineHeightTight,"1.25"),zo(xt.lineHeightNormal,"1.5"),zo(xt.lineHeightRelaxed,"1.75"),zo(St.sm,"4px"),zo(St.md,"6px"),zo(St.lg,"12px"),zo(St.full,"9999px"),zo(wt,"0 1px 3px rgba(0,0,0,0.08)"),zo(Et,"0 4px 12px rgba(0,0,0,0.12)"),zo(kt,"0 8px 24px rgba(0,0,0,0.16)")],OO=[zo(bt.background,"#f5f5f5"),zo(bt.surface,"#ffffff"),zo(bt.surfaceSubtle,"#eeeeee"),zo(bt.surfaceElevated,"#ffffff"),zo(bt.brand,"#424242"),zo(bt.brandSubtle,"#e0e0e0"),zo(bt.success,"#388e3c"),zo(bt.warning,"#f57c00"),zo(bt.error,"#d32f2f"),zo(bt.info,"#1976d2"),zo(bt.textPrimary,"#212121"),zo(bt.textSecondary,"#757575"),zo(bt.textDisabled,"#bdbdbd"),zo(bt.textOnBrand,"#ffffff"),zo(bt.border,"#bdbdbd"),zo(bt.borderSubtle,"#e0e0e0"),zo(_t.xs,"4px"),zo(_t.sm,"8px"),zo(_t.md,"16px"),zo(_t.lg,"24px"),zo(_t.xl,"32px"),zo(_t.xxl,"48px"),zo(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),zo(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),zo(xt.sizeXs,"11px"),zo(xt.sizeSm,"12px"),zo(xt.sizeMd,"14px"),zo(xt.sizeLg,"16px"),zo(xt.sizeXl,"20px"),zo(xt.sizeXxl,"24px"),zo(xt.weightNormal,"400"),zo(xt.weightMedium,"500"),zo(xt.weightBold,"600"),zo(xt.lineHeightTight,"1.25"),zo(xt.lineHeightNormal,"1.5"),zo(xt.lineHeightRelaxed,"1.75"),zo(St.sm,"4px"),zo(St.md,"6px"),zo(St.lg,"12px"),zo(St.full,"9999px"),zo(wt,"0 1px 3px rgba(0,0,0,0.12)"),zo(Et,"0 4px 12px rgba(0,0,0,0.14)"),zo(kt,"0 8px 24px rgba(0,0,0,0.18)")],PO=[zo(bt.background,"#000000"),zo(bt.surface,"#0a0a0a"),zo(bt.surfaceSubtle,"#111111"),zo(bt.surfaceElevated,"#1a1a1a"),zo(bt.brand,"#ffdd00"),zo(bt.brandSubtle,"#332b00"),zo(bt.success,"#00ff00"),zo(bt.warning,"#ffaa00"),zo(bt.error,"#ff4444"),zo(bt.info,"#44aaff"),zo(bt.textPrimary,"#ffffff"),zo(bt.textSecondary,"#cccccc"),zo(bt.textDisabled,"#555555"),zo(bt.textOnBrand,"#000000"),zo(bt.border,"#ffffff"),zo(bt.borderSubtle,"#888888"),zo(_t.xs,"4px"),zo(_t.sm,"8px"),zo(_t.md,"16px"),zo(_t.lg,"24px"),zo(_t.xl,"32px"),zo(_t.xxl,"48px"),zo(xt.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),zo(xt.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),zo(xt.sizeXs,"11px"),zo(xt.sizeSm,"12px"),zo(xt.sizeMd,"14px"),zo(xt.sizeLg,"16px"),zo(xt.sizeXl,"20px"),zo(xt.sizeXxl,"24px"),zo(xt.weightNormal,"400"),zo(xt.weightMedium,"500"),zo(xt.weightBold,"600"),zo(xt.lineHeightTight,"1.25"),zo(xt.lineHeightNormal,"1.5"),zo(xt.lineHeightRelaxed,"1.75"),zo(St.sm,"4px"),zo(St.md,"6px"),zo(St.lg,"12px"),zo(St.full,"9999px"),zo(wt,"0 1px 3px rgba(255,255,255,0.1)"),zo(Et,"0 4px 12px rgba(255,255,255,0.15)"),zo(kt,"0 8px 24px rgba(255,255,255,0.2)")];function MO(e,t){let n=void 0!==t?[zo(bt.brand,t.primaryColor)]:[];return Ls(e.concat(n))}let LO=function(e){let t,n=e.theme;switch(n.preset){case"Dark":t=MO(IO,n.brand);break;case"Light":t=MO(FO,n.brand);break;case"Neutral":t=MO(OO,n.brand);break;case"HighContrast":t=MO(PO,n.brand)}return i("div",{children:e.children,className:t})};let zO=l({preset:"Light",setPreset:function(e){}}),jO=zO.Provider;function UO(){return d(zO)}let BO="reventless-ui:theme",$O=["Light","Dark","Neutral","HighContrast"];function qO(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"HighContrast"}}let GO=function(e){let t=e.initialPreset,n=void 0!==t?t:"Light",r=s(()=>function(e){let t=localStorage.getItem(BO);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(BO,qO(e)),o(t=>e)},[]),c=p(()=>({preset:a,setPreset:l}),[a,l]);return i(jO,{value:c,children:i(LO,{theme:{preset:a,brand:e.brand},children:e.children})})};function VO(e){return!!e.startsWith("/")&&!e.startsWith("//")}function KO(e,t){return"header-"+function(e){return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}(JSON.stringify(Object.fromEntries([["host",e],["Authorization",t]])))}function WO(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 HO(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 JO(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 XO(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 WO(e,"Open"),e.reconnectAttempts=0,function(e){e.subscriptions.forEach(t=>HO(e,t))}(e);case"connection_error":return void console.error("Events connection refused: "+JO(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+": "+JO(r));default:return}}function QO(e){if(e.disposed)return;let t=["aws-appsync-event-ws"],n=e.getToken(),r=void 0!==n?t.concat([KO(e.host,n)]):t,i=new WebSocket(e.url,r);e.ws=T(i),WO(e,"Connecting"),i.onopen=()=>{try{return void i.send('{"type":"connection_init"}')}catch(e){return}},i.onmessage=t=>XO(e,t.data),i.onclose=t=>{if(e.ws=void 0,function(e){return 4401===e||4403===e}(t.code))return WO(e,"Unauthorized"),M(e.onAuthFailure,e=>{try{return e()}catch(t){return}});if(WO(e,"Closed"),e.disposed)return;let n=e.reconnectAttempts+1|0;e.reconnectAttempts=n,e.reconnectTimer=setTimeout(()=>QO(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 YO(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 QO(s),s}function ZO(e,t,n){let r=crypto.randomUUID(),i={id:r,channel:t,onMessage:n};return e.subscriptions.set(r,i),"Open"===e.state&&HO(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 eP(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 tP(){return L(R(globalThis.document),!1,e=>e.hidden)}let nP=["Platform_"];function rP(e,t){let n=t.toLowerCase();return e.some(e=>n.startsWith(e.toLowerCase()))?"Platform":"Domain"}let iP=l(void 0);function oP(){return d(iP)}function sP(){return{client:void 0,registry:new Map,refcount:0,idleTimer:void 0,reconnectListeners:[],torndown:!1}}let aP=iP.Provider;let lP=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:nP,m=h(t);a(()=>{m.current=t},[t]);let v=()=>m.current(),y=h(sP()),b=h(sP()),_=h(tP()),x=s(()=>"Closed"),S=x[1],w=x[0],E=s(()=>"Closed"),k=E[1],C=E[0],A=e=>"Domain"===e?y:b,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):VO(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):VO(e)?location.host:e,n=t.indexOf("/");return-1!==n?t.slice(0,n):t}(i),a=YO(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=ZO(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||_.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&&(eP(e),t.client=void 0),t.idleTimer=void 0},3e4))}}},L=e=>!!l&&$(N(rP(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=tP();if(e!==_.current)return _.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&&eP(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=>rP(g,e),statusFor:z,registerReconnect:j,publish:G,clientChannelsAvailable:B,clientNamespace:()=>i,liveUpdatesEnabled:()=>l}),[l,d,u,w,C,i,g]);return c(aP,{value:V,children:e.children})};function cP(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 uP(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 dP(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?uP(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 fP(e,t){let n=dt(t);return function(e){let t=on(e);return void 0!==t&&void 0===t[1].values?uP(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 hP(e){switch(e){case"boolean":return"Boolean";case"integer":return"Int";case"number":return"Float";default:return"String"}}function pP(e){let t=e.toLowerCase();return t.length>=2&&t.endsWith("id")}function gP(e){if(vt(j(Xe(e,"type"),dt),"object"))return j(Xe(e,"x-reventless-graphql-input"),dt)}function mP(e){return j(Xe(e,"x-reventless-graphql-type"),dt)}function vP(e){return z(j(j(ht(e),e=>Xe(e,"required")),pt),e=>me(e,dt))}function yP(e,t,n){let r=vP(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,mP);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,gP),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)||pP(e))?"ID":hP(t)),"String");return"["+i+"!]"}let r=gP(t);return void 0!==r?r:pP(e)&&"string"===n?"ID":hP(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 bP(e){let t=e.split(".");return U(t[t.length-1|0],e)}function _P(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function xP(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 SP(e){return yt(j(Xe(e,"apiExposed"),gt),!1)}function wP(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=>fP(e,t)),null),s=n("mutationField"),a=j(Xe(t,"aggregateIdField"),dt),l=U(z(Xe(t,"references"),xP),[]),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:_P(bP(r)),schema:o,mutationDocument:""===s?"":yP(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 EP(e,t){return wP(e,e=>!SP(e),t)}function kP(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=>fP(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:wP(r,SP,U(Xe(e,"commands"),[])),systemCommands:EP(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=>fP(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:wP(r,SP,U(Xe(e,"commands"),[])),systemCommands:EP(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 CP(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 AP(e){return"fleet"===e.toLowerCase()?"Fleet":"Single"}function NP(e){switch(e.toLowerCase()){case"cognito":return"Cognito";case"inmemory":case"local":return"Local";default:return"Anonymous"}}function TP(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"),CP(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)),nP),region:n("region"),authMode:U(z(n("authMode"),NP),"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"),AP),"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"),CO),"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 '+$O.join(", ")+". Opening on the default instead.")}),elevatedGroups:me(U(j(t.elevatedGroups,Je.array),[]),Je.string)}}}function RP(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:kP(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:kP(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 DP(e){let t=Je.string(e);return void 0!==t?t:z(Je.float(e),e=>e.toString())}function IP(e){return z(Je.object(e),e=>({message:U(j(e.message,Je.string),""),path:me(U(j(e.path,Je.array),[]),DP),code:j(j(j(e.extensions,Je.object),e=>e.code),Je.string),errorType:j(e.errorType,Je.string)}))}function FP(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),[]),IP)}}function OP(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 PP(e){return e.errors.some(e=>vt(e.code,"UNAUTHORIZED"))}let MP=ZI;class LP extends Error{}function zP(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)}}LP.prototype.name="InvalidTokenError";let jP=function(e){return e&&e.name?String(e.name):"UnknownError"},UP=function(e){return e&&e.message?String(e.message):""};function BP(e){return{name:jP(e),message:UP(e)}}function $P(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 qP,GP;!function(e){e.HTTP="http",e.HTTPS="https"}(qP||(qP={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(GP||(GP={}));const VP="__smithy_context";class KP{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 KP({...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 KP.clone(this)}}class WP{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 HP={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},JP=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!KP.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),HP)}}),XP={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},QP={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},YP=e=>e[VP]||(e[VP]={}),ZP=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t};const eM=(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=YP(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)},tM={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},nM=e=>e=>{throw e},rM=(e,t)=>{},iM={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},oM=e=>({applyToStack:e=>{e.addRelativeTo((e,t)=>async n=>{if(!KP.isInstance(n.request))return e(n);const r=YP(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||nM)(i));return(s.successHandler||rM)(a.response,i),a},iM)}}),sM=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t},aM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lM=Object.entries(aM).reduce((e,[t,n])=>(e[n]=Number(t),e),{}),cM=aM.split(""),uM=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 lM))throw new TypeError(`Invalid character ${e[r]} in base64 string.`);t|=lM[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)},dM=e=>(new TextEncoder).encode(e),fM=e=>"string"==typeof e?dM(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),hM=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 pM(e){let t;t="string"==typeof e?dM(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+=cM[(e&63<<n)>>n]}i+="==".slice(0,4-r)}return i}class gM extends Uint8Array{static fromString(e,t="utf-8"){if("string"==typeof e)return"base64"===t?gM.mutate(uM(e)):gM.mutate(dM(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,gM.prototype),e}transformToString(e="utf-8"){return"base64"===e?pM(this):hM(this)}}const mM=e=>encodeURIComponent(e).replace(/[!'()*]/g,vM),vM=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function yM(e,t){return new Request(e,t)}function bM(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 _M={supported:void 0};class xM{config;configProvider;static create(e){return"function"==typeof e?.handle?e:new xM(e)}constructor(e){"function"==typeof e?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),void 0===_M.supported&&(_M.supported=Boolean("undefined"!=typeof Request&&"keepalive"in yM("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=SM(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=mM(n),Array.isArray(r))for(let e=0,i=r.length;e<i;e++)t.push(`${n}=${mM(r[e])}`);else{let e=n;(r||"string"==typeof r)&&(e+=`=${mM(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),_M.supported&&(h.keepalive=i),"function"==typeof this.config.requestInit&&Object.assign(h,this.config.requestInit(e));let p=()=>{};const g=yM(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 WP({headers:n,reason:e.statusText,statusCode:e.status,body:e.body})}:e.blob().then(t=>({response:new WP({headers:n,reason:e.statusText,statusCode:e.status,body:t})}))}),bM(r)];return t&&m.push(new Promise((e,n)=>{const r=()=>{const e=SM(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 SM(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 wM=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=uM(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 EM={},kM={};for(let xwe=0;xwe<256;xwe++){let e=xwe.toString(16).toLowerCase();1===e.length&&(e=`0${e}`),EM[xwe]=e,kM[e]=xwe}function CM(e){let t="";for(let n=0;n<e.byteLength;n++)t+=EM[e[n]];return t}const AM=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return gM.mutate(e);if(!e)return gM.mutate(new Uint8Array);const n=t.streamCollector(e);return gM.mutate(await n)},NM=e=>"function"==typeof e?e():e,TM=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i}),RM=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1];const DM=e=>{if("string"==typeof e)return DM(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}},IM=e=>(t,n)=>async r=>{const{operationSchema:i}=YP(n),[,o,s,a,l,c]=i??[],u=n.endpointV2?async()=>(e=>{if("object"==typeof e){if("url"in e){const t=DM(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 DM(e)})(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(TM(o,s,a,l,c),r.input,{...e,...n,endpoint:u});return t({...r,request:d})},FM={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},OM={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function PM(e){return{applyToStack:t=>{t.add(IM(e),OM),t.add((e=>(t,n)=>async r=>{const{response:i}=await t(r),{operationSchema:o}=YP(n),[,s,a,l,c,u]=o??[];try{return{response:i,output:await e.protocol.deserializeResponse(TM(s,a,l,c,u),{...e,...n},i)}}catch(fie){if(Object.defineProperty(fie,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in fie)){const t="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{fie.message+="\n "+t}catch(iB){n.logger&&"NoOpLogger"!==n.logger?.constructor?.name?n.logger?.warn?.(t):console.warn(t)}void 0!==fie.$responseBodyText&&fie.$response&&(fie.$response.body=fie.$responseBodyText);try{if(WP.isInstance(i)){const{headers:t={}}=i,n=Object.entries(t);fie.$metadata={httpStatusCode:i.statusCode,requestId:RM(/^x-[\w-]+-request-?id$/,n),extendedRequestId:RM(/^x-[\w-]+-id-2$/,n),cfId:RM(/^x-[\w-]+-cf-id$/,n)}}}catch(iB){}}throw fie}})(e),FM),e.protocol.setSerdeContext(e)}}}const MM=[];function LM(e){if("object"==typeof e)return e;if(MM[e|=0])return MM[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 MM[e]=t}const zM=Symbol.for("@smithy/nor-struct-it"),jM=Symbol.for("@smithy/ns"),UM=[],BM={};class $M{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=$M.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;GM(r);)n.push(r[1]),r=r[0],i=NM(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,LM(t))}}else this.memberTraits=0;if(i instanceof $M){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=NM(i),VM(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(UM[e])return UM[e]}else if("string"==typeof e){if(BM[e])return BM[e]}else if(t&&e[jM])return e[jM];const n=NM(e);if(n instanceof $M)return n;if(GM(n)){const[t,r]=n;if(t instanceof $M)return Object.assign(t.getMergedTraits(),LM(r)),t;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const r=new $M(n);return t?e[jM]=r:"string"==typeof n?BM[n]=r:"number"==typeof n?UM[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 LM(this.memberTraits)}getOwnTraits(){return LM(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 qM([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 qM([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 qM(GM(r)?r:[r,0],e)}if(this.isDocumentSchema())return qM([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[zM];if(n&&t===n.length)yield*n;else{n=Array(t);for(let r=0;r<t;++r){const t=e[4][r],i=qM([e[5][r],0],t);yield n[r]=[t,i]}e[zM]=n}}}function qM(e,t){if(e instanceof $M)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new $M(e,t)}const GM=e=>Array.isArray(e)&&2===e.length,VM=e=>Array.isArray(e)&&e.length>=5;class KM{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 KM.registries.has(e)||KM.registries.set(e,new KM(e)),KM.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,KM.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,KM.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 KM.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 WM=e=>{if(null!=e){if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&iL.warn(rL(`Expected number but observed string: ${e}`)),t}if("number"==typeof e)return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},HM=Math.ceil(2**127*(2-2**-23)),JM=e=>{const t=WM(e);if(void 0!==t&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>HM)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},XM=e=>YM(e,16),QM=e=>YM(e,8),YM=(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&&ZM(n,t)!==n)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return n},ZM=(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]}},eL=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,tL=e=>{const t=e.match(eL);if(null===t||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},nL=e=>XM("string"==typeof e?tL(e):e),rL=e=>String(new TypeError(e).stack||e).split("\n").slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join("\n"),iL={warn:console.warn},oL=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],sL=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];const aL=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),lL=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$/),cL=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$/),uL=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})$/),dL=e=>{if(null==e)return;if("string"!=typeof e)throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=lL.exec(e);if(t){const[e,n,r,i,o,s,a,l]=t;return hL(nL(wL(i)),mL(r),_L(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l})}if(t=cL.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return gL(hL(pL(i),mL(r),_L(n,"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l}))}if(t=uL.exec(e),t){const[e,n,r,i,o,s,a,l]=t;return hL(nL(wL(l)),mL(n),_L(r.trimLeft(),"day",1,31),{hours:i,minutes:o,seconds:s,fractionalMilliseconds:a})}throw new TypeError("Invalid RFC-7231 date-time value")},fL=e=>{if(null==e)return;let t;if("number"==typeof e)t=e;else if("string"==typeof e)t=(e=>WM("string"==typeof e?tL(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))},hL=(e,t,n,r)=>{const i=t-1;return yL(e,i,n),new Date(Date.UTC(e,i,n,_L(r.hours,"hour",0,23),_L(r.minutes,"minute",0,59),_L(r.seconds,"seconds",0,60),xL(r.fractionalMilliseconds)))},pL=e=>{const t=(new Date).getUTCFullYear(),n=100*Math.floor(t/100)+nL(wL(e));return n<t?n+100:n},gL=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,mL=e=>{const t=sL.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},vL=[31,28,31,30,31,30,31,31,30,31,30,31],yL=(e,t,n)=>{let r=vL[t];if(1===t&&bL(e)&&(r=29),n>r)throw new TypeError(`Invalid day for ${sL[t]} in ${e}: ${n}`)},bL=e=>e%4==0&&(e%100!=0||e%400==0),_L=(e,t,n,r)=>{const i=(e=>QM("string"==typeof e?tL(e):e))(wL(e));if(i<n||i>r)throw new TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},xL=e=>null==e?0:1e3*(e=>JM("string"==typeof e?tL(e):e))("0."+e),SL=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},wL=e=>{let t=0;for(;t<e.length-1&&"0"===e.charAt(t);)t++;return 0===t?e:e.slice(t)},EL="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kL=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),CL=()=>{if(EL)return EL();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128,kL[e[0]]+kL[e[1]]+kL[e[2]]+kL[e[3]]+"-"+kL[e[4]]+kL[e[5]]+"-"+kL[e[6]]+kL[e[7]]+"-"+kL[e[8]]+kL[e[9]]+"-"+kL[e[10]]+kL[e[11]]+kL[e[12]]+kL[e[13]]+kL[e[14]]+kL[e[15]]},AL=function(e){return Object.assign(new String(e),{deserializeJSON:()=>JSON.parse(String(e)),toString:()=>String(e),toJSON:()=>String(e)})};AL.from=e=>e&&"object"==typeof e&&(e instanceof AL||"deserializeJSON"in e)?e:"string"==typeof e||Object.getPrototypeOf(e)===String.prototype?AL(String(e)):AL(JSON.stringify(e)),AL.fromObject=AL.from;const NL=/^-?\d*(\.\d+)?$/;class TL{string;type;constructor(e,t){if(this.string=e,this.type=t,!NL.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 TL.prototype.isPrototypeOf(e)||"bigDecimal"===t.type&&NL.test(t.string)}}class RL{serdeContext;setSerdeContext(e){this.serdeContext=e}}class DL extends RL{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=KM.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return KP}getResponseType(){return WP}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=$M.of(t.input),i=LM(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-BsvJS9sj.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 IL extends DL{async serializeRequest(e,t,n){const r=this.serializer,i={},o={},s=await n.endpoint(),a=$M.of(e?.input),l=a.getSchema();let c;const u=t&&"object"==typeof t?t:{},d=new KP({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=$M.of(e.output),o={};if(n.statusCode>=300){const i=await AM(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 AM(n.body,t);e.byteLength>0&&Object.assign(o,await r.read(i,e))}return o.$metadata=this.deserializeMetadata(n),o}}function FL(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 OL{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 PL{async sign(e,t,n){return e}}const ML=(LL=3e5,function(e){return zL(e)&&e.expiration.getTime()-Date.now()<LL});var LL;const zL=e=>void 0!==e.expiration;class jL{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 jL(e,t,n,r)}}class UL extends Error{constructor(e){super(e),this.name="EndpointError"}}function BL(e){return"object"!=typeof e||null==e?e:"ref"in e?`$${BL(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(BL).join(", ")})`:JSON.stringify(e,null,2)}const $L={};const qL=(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 UL(`Path: '${e}' does not end with ']'`);const i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new UL(`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 UL(`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),GL=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),VL=(e,t=!1)=>{if(!t)return GL.test(e);const n=e.split(".");for(const r of n)if(!VL(r))return!1;return!0};const KL=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}$"),WL=e=>KL.test(e)||e.startsWith("[")&&e.endsWith("]"),HL={[qP.HTTP]:80,[qP.HTTPS]:443};const JL={booleanEquals:(e,t)=>e===t,coalesce:function(...e){for(const t of e)if(null!=t)return t},getAttr:qL,isSet:e=>null!=e,isValidHostLabel:VL,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(fie){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(qP).includes(l))return null;const c=WL(i);return{scheme:l,authority:`${r}${n.includes(`${r}:${HL[l]}`)||"string"==typeof e&&e.includes(`${r}:${HL[l]}`)?`:${HL[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()}`)},XL=(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(qL(r[e]??i[e],t))}else n.push(r[a]??i[a]);o=s+1}return n.join("")},QL=(e,t,n)=>{if("string"==typeof e)return XL(e,n);if(e.fn)return ZL.callFunction(e,n);if(e.ref)return(({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e])(e,n);throw new UL(`'${t}': ${String(e)} is not a string, function or reference.`)},YL=({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:ZL.evaluateExpression(e,"arg",n)}const i=e.indexOf(".");if(-1!==i){const t=$L[e.slice(0,i)],n=t?.[e.slice(i+1)];if("function"==typeof n)return n(...r)}const o=JL[e];if("function"==typeof o)return o(...r);throw new Error(`function ${e} not loaded in endpointFunctions.`)},ZL={evaluateExpression:QL,callFunction:YL},ez=(e,t)=>{const{assign:n}=e;if(n&&n in t.referenceRecord)throw new UL(`'${n}' is already defined in Reference Record.`);const r=YL(e,t);t.logger?.debug?.(`endpoints evaluateCondition: ${BL(e)} = ${BL(r)}`);const i=""===r||!!r;return null!=n?{result:i,toAssign:{name:n,value:r}}:{result:i}},tz=(e,t)=>Object.entries(e??{}).reduce((e,[n,r])=>(e[n]=r.map(e=>{const r=QL(e,"Header value entry",t);if("string"!=typeof r)throw new UL(`Header '${n}' value '${r}' is not a string`);return r}),e),{}),nz=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=iz.getEndpointProperty(r,t),e),{}),rz=(e,t)=>{if(Array.isArray(e))return e.map(e=>rz(e,t));switch(typeof e){case"string":return XL(e,t);case"object":if(null===e)throw new UL(`Unexpected endpoint property: ${e}`);return iz.getEndpointProperties(e,t);case"boolean":return e;default:throw new UL("Unexpected endpoint property type: "+typeof e)}},iz={getEndpointProperty:rz,getEndpointProperties:nz},oz=(e,t)=>{const n=QL(e,"Endpoint URL",t);if("string"==typeof n)try{return new URL(n)}catch(fie){throw console.error(`Failed to construct URL with ${n}`,fie),fie}throw new UL("Endpoint URL must be a string, got "+typeof n)},sz=1e8,az=(e,t=!1)=>{if(t){for(const t of e.split("."))if(!az(t))return!1;return!0}return!!VL(e)&&(!(e.length<3||e.length>63)&&(e===e.toLowerCase()&&!WL(e)))};let lz={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 cz={isVirtualHostableS3Bucket:az,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}=lz;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 uz(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 dz;$L.aws=cz,function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"}(dz||(dz={}));const fz=dz.STANDARD,hz=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],pz=["TimeoutError","RequestTimeout","RequestTimeoutException"],gz=[500,502,503,504],mz=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],vz=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],yz=e=>429===e.$metadata?.httpStatusCode||hz.includes(e.name)||1==e.$retryable?.throttling,bz=(e,t=0)=>(e=>void 0!==e?.$retryable)(e)||(e=>e.$metadata?.clockSkewCorrected)(e)||pz.includes(e.name)||mz.includes(e?.code||"")||vz.includes(e?.code||"")||gz.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&&bz(e.cause,t+1);class _z{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||yz(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=>_z.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 xz={};class Sz{static v2026="undefined"!=typeof process&&"true"===xz?.SMITHY_NEW_RETRIES_2026;static delay(){return Sz.v2026?50:100}static throttlingDelay(){return Sz.v2026?1e3:500}static cost(){return Sz.v2026?14:5}static throttlingCost(){return Sz.v2026?5:10}static modifiedCostType(){return Sz.v2026?"THROTTLING":"TRANSIENT"}}class wz{x=Sz.delay();computeNextBackoffDelay(e){const t=Math.random()*Math.min(this.x*2**e,2e4);return Math.floor(t)}setDelayBase(e){this.x=e}}class Ez{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 kz{mode=dz.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??=Sz.delay(),this.retryBackoffStrategy??=new wz}async acquireInitialRetryToken(e){return new Ez(Sz.delay(),0,void 0,Sz.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?Sz.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 Ez(o,e.getRetryCount()+1,t,e.isLongPoll?.()??!1)}throw Object.assign(new Error("No retry token available"),{$backoff:Sz.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(fie){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===Sz.modifiedCostType()?Sz.throttlingCost():Sz.cost()}isRetryableError(e){return"THROTTLING"===e||"TRANSIENT"===e}async maxAttempts(){return this.maxAttemptsProvider()}}class Cz{mode=dz.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new _z,this.standardRetryStrategy=new kz(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 Az=/\d{12}\.ddb/;const Nz="user-agent",Tz="x-amz-user-agent",Rz=/[^!$%&'*+\-.^_`|~\w]/g,Dz=/[^!$%&'*+\-.^_`|~\w#]/g;const Iz=e=>(t,n)=>async r=>{const{request:i}=r;if(!KP.isInstance(i))return t(r);const{headers:o}=i,s=n?.userAgent?.map(Fz)||[],a=(await e.defaultUserAgentProvider()).map(Fz);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&uz(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();if("string"==typeof n.mode)switch(n.mode){case dz.ADAPTIVE:uz(e,"RETRY_MODE_ADAPTIVE","F");break;case dz.STANDARD:uz(e,"RETRY_MODE_STANDARD","E")}}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(Az)&&uz(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":uz(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":uz(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":uz(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const t=i;t.accountId&&uz(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))uz(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(Fz)||[],u=await e.userAgentAppId();u&&a.push(Fz(["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[Tz]=o[Tz]?`${o[Nz]} ${f}`:f),o[Nz]=d):o[Tz]=d,t({...r,request:i})},Fz=e=>{const t=e[0].split("/").map(e=>e.replace(Rz,"-")).join("/"),n=e[1]?.replace(Dz,"-"),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}`}},"")},Oz={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Pz=new Set,Mz=e=>"string"==typeof e&&(e.startsWith("fips-")||e.endsWith("-fips")),Lz=e=>{const{region:t,useFipsEndpoint:n}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const e=(e=>Mz(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=VL)=>{if(Pz.has(e)||t(e))Pz.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!!Mz(e)||("function"!=typeof n?Promise.resolve(!!n):n())}})},zz="content-length";const jz={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Uz=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const r=t.request;if(KP.isInstance(r)){const{body:e,headers:t}=r;if(e&&-1===Object.keys(t).map(e=>e.toLowerCase()).indexOf(zz))try{const t=n(e);r.headers={...r.headers,[zz]:String(t)}}catch(fie){}}return e({...t,request:r})}),jz)}}),Bz=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,$z=/(\d+\.){3}\d+/,qz=/\.\./,Gz=e=>Bz.test(e)&&!$z.test(e)&&!qz.test(e),Vz=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},Kz=(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},Wz=async e=>{},Hz=e=>{if("object"==typeof e){if("url"in e){const t=DM(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 DM(e)},Jz=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 Kz(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("?"))),Vz(t)){if(!0===e.ForcePathStyle)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Gz(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},Xz=({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 Wz(n.serviceId),e&&(n.endpoint=()=>Promise.resolve(Hz(e)),n.isCustomEndpoint=!0)}const i=await Jz(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=YP(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})},Qz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},Yz=(e,t)=>({applyToStack:n=>{n.addRelativeTo(Xz({config:e,instructions:t}),Qz)}}),Zz=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}`),ej=e=>{const{retryStrategy:t,retryMode:n}=e,r=ZP(e.maxAttempts??3);let i=t?Promise.resolve(t):void 0;return Object.assign(e,{maxAttempts:r,retryStrategy:()=>i??=(async()=>await ZP(n)()===dz.ADAPTIVE?new Cz(r):new kz(r))()})},tj=(e,t)=>{const n=[];if(e&&n.push(e),t)for(const r of t)n.push(r);return n},nj=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,rj=()=>{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 tj(t.name,t.aliases))s[n]=t;r.push(t)}),t.forEach(e=>{const t={...e,before:[],after:[]};for(const n of tj(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 ${nj(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)=>ij[t.step]-ij[e.step]||oj[t.priority||"normal"]-oj[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=tj(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${nj(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(`"${nj(r.name,r.aliases)}" middleware with ${r.priority} priority in ${r.step} step cannot be overridden by "${nj(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=tj(i,s);if(l.length>0){if(l.some(e=>r.has(e))){if(!o)throw new Error(`Duplicate middleware name '${nj(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(`"${nj(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${nj(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(rj()),use:e=>{e.applyToStack(a)},remove:n=>"string"==typeof n?(n=>{let i=!1;const o=e=>{const t=tj(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 tj(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=tj(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(rj());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 nj(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},ij={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},oj={high:3,normal:2,low:1};class sj{config;middlewareStack=rj();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 aj="***SensitiveInformation***";function lj(e,t){if(null==t)return t;const n=$M.of(e);if(n.getMergedTraits().sensitive)return aj;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return aj}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return aj}else if(n.isStructSchema()&&"object"==typeof t){const e=t,r={};for(const[t,i]of n.structIterator())null!=e[t]&&(r[t]=lj(i,e[t]));return r}return t}let cj=class{middlewareStack=rj();schema;static classBuilder(){return new uj}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,[VP]:{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 uj{_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 cj{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?lj.bind(null,s):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?lj.bind(null,a):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class dj 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 dj.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===dj?dj.isInstance(e):!!dj.isInstance(e)&&(t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e))}}const fj=(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},hj=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{}}},pj=Object.values(GP),gj=e=>Object.assign((e=>{const t=[];for(const n in GP){const r=GP[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();pj.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)),mj=e=>Object.assign((e=>{const t={};return e.checksumAlgorithms().forEach(e=>{const n=e.algorithmId();pj.includes(n)&&(t[n]=e.checksumConstructor())}),t})(e),(e=>{const t={};return t.retryStrategy=e.retryStrategy(),t})(e));class vj{trace(){}debug(){}info(){}warn(){}error(){}}const yj=e=>e?.body instanceof ReadableStream;const bj=e=>new Promise(t=>setTimeout(t,e)),_j=e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess,xj=(e,t)=>{const n={error:e,errorType:Sj(e)},r=function(e,t){if(WP.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=(dL(r).getTime()-Date.now())/1e3}catch(iB){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(iB)}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},Sj=e=>yz(e)?"THROTTLING":bz(e)?"TRANSIENT":(e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!bz(e)}return!1})(e)?"SERVER_ERROR":"CLIENT_ERROR",wj={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Ej=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async r=>{let i=await e.retryStrategy();const o=await e.maxAttempts();if(!_j(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=KP.isInstance(d);for(f&&(d.headers["amz-sdk-invocation-id"]=CL());;)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(iB){const r=xj(iB,e.logger);if(l=Zz(iB),f&&yj(d))throw(n.logger instanceof vj?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 bj(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 bj(o)}}})(e),wj)}}),kj=e=>WP.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,Cj=e=>new Date(Date.now()+e),Aj=(e,t)=>{const n=Date.parse(e);return((e,t)=>Math.abs(Cj(t).getTime()-e)>=3e5)(n,t)?n-Date.now():t},Nj=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t};class Tj{async sign(e,t,n){if(!KP.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const r=await(async e=>{const t=Nj("context",e.context),n=Nj("config",e.config),r=t.endpointV2?.properties?.authSchemes?.[0],i=Nj("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:Cj(i.systemClockOffset),signingRegion:s,signingService:a})}errorHandler(e){return t=>{const n=t.ServerTime??kj(t.$response);if(n){const r=Nj("config",e.config),i=r.systemClockOffset;r.systemClockOffset=Aj(n,r.systemClockOffset);r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=kj(e);if(n){const e=Nj("config",t.config);e.systemClockOffset=Aj(n,e.systemClockOffset)}}}const Rj=(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)},Dj="X-Amz-Date",Ij="X-Amz-Signature",Fj="X-Amz-Security-Token",Oj="authorization",Pj=Dj.toLowerCase(),Mj=[Oj,Pj,"date"],Lj=Ij.toLowerCase(),zj="x-amz-content-sha256",jj=Fj.toLowerCase(),Uj={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},Bj=/^proxy-/,$j=/^sec-/,qj="AWS4-HMAC-SHA256",Gj="AWS4-HMAC-SHA256-PAYLOAD",Vj="aws4_request",Kj={},Wj=[],Hj=(e,t,n)=>`${e}/${t}/${n}/${Vj}`,Jj=(e,t,n)=>{const r=new e(t);return r.update(fM(n)),r.digest()},Xj=({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 Uj||t?.has(o)||Bj.test(o)||$j.test(o))&&(!n||n&&!n.has(o))||(r[o]=e[i].trim().replace(/\s+/g," "))}return r},Qj=async({headers:e,body:t},n)=>{for(const i of Object.keys(e))if(i.toLowerCase()===zj)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(fM(t)),CM(await e.digest())}var r;return"UNSIGNED-PAYLOAD"};class Yj{format(e){const t=[];for(const i of Object.keys(e)){const n=dM(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=dM(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(tU.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!eU.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 kM))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=kM[r]}return t}(e.value.replace(/\-/g,"")),1),u}}}var Zj;!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"}(Zj||(Zj={}));const eU=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class tU{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&&nU(t),new tU(t)}valueOf(){const e=this.bytes.slice(0),t=128&e[0];return t&&nU(e),parseInt(CM(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function nU(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,0===e[t]);t--);}const rU=e=>{e=KP.clone(e);for(const t of Object.keys(e.headers))Mj.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},iU=e=>"number"==typeof e?new Date(1e3*e):"string"==typeof e?Number(e)?new Date(1e3*Number(e)):new Date(e):e;class oU{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=ZP(n),this.credentialProvider=ZP(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()===Lj)continue;const i=mM(r);t.push(i);const o=e[r];"string"==typeof o?n[i]=`${i}=${mM(o)}`:Array.isArray(o)&&(n[i]=o.slice(0).reduce((e,t)=>e.concat([`${i}=${mM(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(fM(n));return`${r}\n${e}\n${t}\n${CM(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 mM(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=>iU(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 sU extends oU{headerFormatter=new Yj;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=Hj(h,d,c??this.service),g=((e,t={})=>{const{headers:n,query:r={}}=KP.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}})(rU(e),{unhoistableHeaders:o,hoistableHeaders:a});u.sessionToken&&(g.query[Fj]=u.sessionToken),g.query["X-Amz-Algorithm"]=qj,g.query["X-Amz-Credential"]=`${u.accessKeyId}/${p}`,g.query[Dj]=f,g.query["X-Amz-Expires"]=r.toString(10);const m=Xj(g,i,s);return g.query["X-Amz-SignedHeaders"]=this.getCanonicalHeaderList(m),g.query[Ij]=await this.getSignature(f,p,this.getSigningKey(u,d,h,c),this.createCanonicalRequest(g,m,await Qj(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=Hj(l,a,o??this.service),d=await Qj({headers:{},body:t},this.sha256),f=new this.sha256;f.update(e);const h=CM(await f.digest()),p=[Gj,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(fM(e)),CM(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=rU(e),{longDate:c,shortDate:u}=this.formatDate(t),d=Hj(u,a,o??this.service);l.headers[Pj]=c,s.sessionToken&&(l.headers[jj]=s.sessionToken);const f=await Qj(l,this.sha256);!((e,t)=>{e=e.toLowerCase();for(const n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1})(zj,l.headers)&&this.applyChecksum&&(l.headers[zj]=f);const h=Xj(l,r,n),p=await this.getSignature(c,d,this.getSigningKey(s,a,u,o),this.createCanonicalRequest(l,h,f));return l.headers[Oj]=`${qj} 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,qj),o=new this.sha256(await n);return o.update(fM(i)),CM(await o.digest())}getSigningKey(e,t,n,r){return(async(e,t,n,r,i)=>{const o=`${n}:${r}:${i}:${CM(await Jj(e,t.secretAccessKey,t.accessKeyId))}:${t.sessionToken}`;if(o in Kj)return Kj[o];for(Wj.push(o);Wj.length>50;)delete Kj[Wj.shift()];let s=`AWS4${t.secretAccessKey}`;for(const a of[n,r,i,Vj])s=await Jj(e,s,a);return Kj[o]=s})(this.sha256,e,n,t,r||this.service)}}const aU=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,ML,zL):n?sM(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?sM(e.signer):e.regionInfoProvider?()=>sM(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||sU)(a)}):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await sM(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||sU)(o)};return Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:a})};const lU=async(e,t,n)=>({operation:YP(t).operation,region:await ZP(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});const cU=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},uU={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},dU="3.1033.0";var fU="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>(new TextEncoder).encode(e);function hU(e){return e instanceof Uint8Array?e:"string"==typeof e?fU(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function pU(e){return"string"==typeof e?0===e.length:0===e.byteLength}var gU={name:"SHA-256"},mU={name:"HMAC",hash:gU},vU=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 yU={};function bU(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:yU}var _U=function(){function e(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return e.prototype.update=function(e){if(!pU(e)){var t=hU(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 bU().crypto.subtle.sign(mU,t,e.toHash).then(function(e){return new Uint8Array(e)})}):pU(this.toHash)?Promise.resolve(vU):Promise.resolve().then(function(){return bU().crypto.subtle.digest(gU,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){bU().crypto.subtle.importKey("raw",hU(e.secret),mU,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},e}();function xU(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(iB){o(iB)}}function a(e){try{l(r.throw(e))}catch(iB){o(iB)}}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 SU(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(iB){a=[6,iB],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 wU=64,EU=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]),kU=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],CU=Math.pow(2,53)-1,AU=function(){function e(){this.state=Int32Array.from(kU),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>CU)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===wU&&(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%wU>=56){for(var r=this.bufferLength;r<wU;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<wU;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+(EU[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}(),NU=function(){function e(e){this.secret=e,this.hash=new AU,this.reset()}return e.prototype.update=function(e){if(!pU(e)&&!this.error)try{this.hash.update(hU(e))}catch(iB){this.error=iB}},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 xU(this,void 0,void 0,function(){return SU(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new AU,this.secret){this.outer=new AU;var e=function(e){var t=hU(e);if(t.byteLength>wU){var n=new AU;n.update(t),t=n.digest()}var r=new Uint8Array(wU);return r.set(t),r}(this.secret),t=new Uint8Array(wU);t.set(e);for(var n=0;n<wU;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 TU=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function RU(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&&TU.every(function(t){return"function"==typeof e[t]})}(e.crypto.subtle)}var DU=function(){function e(e){RU(bU())?this.hash=new _U(e):this.hash=new NU(e)}return e.prototype.update=function(e,t){this.hash.update(hU(e))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();const IU=({serviceId:e,clientVersion:t})=>async n=>{const r="undefined"!=typeof window?window.navigator:void 0,i=r?.userAgent??"",o=r?.userAgentData?.platform??FU.os(i)??"other",s=r?.userAgentData?.brands??[],a=s[s.length-1],l=a?.brand??FU.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},FU={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},OU=e=>()=>Promise.reject(e),PU="function"==typeof TextEncoder?new TextEncoder:null,MU=e=>{if("string"==typeof e){if(PU)return PU.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}`)},LU=["in-region","cross-region","mobile","standard","legacy"],zU=()=>{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 jU{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(iB){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=KM.for(r),o=KM.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=fj(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 fj(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(iB){return e.find(e=>$M.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}class UU{serdeContext;setSerdeContext(e){this.serdeContext=e}}class BU{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 $U(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 TL(e,"bigDecimal"):BigInt(e)}}return t}const qU=(e,t)=>((e,t)=>AM(e,t).then(e=>(t?.utf8Encoder??hM)(e)))(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(iB){throw"SyntaxError"===iB?.name&&Object.defineProperty(iB,"$responseBodyText",{value:e}),iB}return{}}),GU=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),VU=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 KU extends UU{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,"string"==typeof t?JSON.parse(t,$U):await qU(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=null!==t&&"object"==typeof t,r=$M.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 BU(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 uM(t);const i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&"string"==typeof t&&i){return"application/json"===i||i.endsWith("+json")?AL.from(t):t}if(r.isTimestampSchema()&&null!=t){switch(FL(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=aL.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=nL(wL(r)),f=_L(i,"month",1,12),h=_L(o,"day",1,31),p=hL(d,f,h,{hours:s,minutes:a,seconds:l,fractionalMilliseconds:c});return"Z"!=u.toUpperCase()&&p.setTime(p.getTime()-SL(u)),p})(t);case 6:return dL(t);case 7:return fL(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 TL)return t;const e=t;return"bigDecimal"===e.type&&"string"in e?new TL(e.string,e.type):new TL(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 TL?i:this._read(r,i)}return e}return structuredClone(t)}return t}}const WU=String.fromCharCode(925);class HU{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 TL){const e=WU+"nv"+this.counter+++"_"+t.string;return this.values.set(`"${e}"`,t.string),e}if("bigint"==typeof t){const e=t.toString(),n=WU+"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 JU extends UU{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=$M.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 HU;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=$M.of(e).getName(!0))}_write(e,t,n){const r=null!==t&&"object"==typeof t,i=$M.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??pM)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema())){switch(FL(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`${oL[r]}, ${i<10?`0${i}`:`${i}`} ${sL[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 TL&&(this.useReplacer=!0)}if(null!==t||!n?.isStructSchema()){if(i.isStringSchema()){if(void 0===t&&i.isIdempotencyToken())return CL();const e=i.getMergedTraits().mediaType;if(null!=t&&e){if("application/json"===e||e.endsWith("+json"))return AL.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??pM)(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 TL?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r)}return e}return structuredClone(t)}return t}}}class XU extends UU{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new JU(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new KU(this.settings);return e.setSerdeContext(this.serdeContext),e}}class QU extends IL{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 XU({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new jU(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"!==NM(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=GU(e.headers,"x-amzn-errortype");if(void 0!==n)return VU(e.headers[n]);if(t&&"object"==typeof t){const e=GU(t,"code");if(e&&void 0!==t[e])return VU(t[e]);if(void 0!==t.__type)return VU(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=$M.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 YU extends QU{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 ZU="ref",eB=-1,tB=!0,nB="isSet",rB="PartitionResult",iB="booleanEquals",oB="getAttr",sB="stringEquals",aB={[ZU]:"Endpoint"},lB={[ZU]:rB},cB={[ZU]:"Region"},uB={},dB=[cB],fB={conditions:[[nB,[aB]],[nB,dB],["aws.partition",dB,rB],[iB,[{[ZU]:"UseFIPS"},tB]],[iB,[{fn:oB,argv:[lB,"supportsFIPS"]},tB]],[iB,[{[ZU]:"UseDualStack"},tB]],[iB,[{fn:oB,argv:[lB,"supportsDualStack"]},tB]],[sB,[{fn:oB,argv:[lB,"name"]},"aws"]],[sB,[cB,"us-east-1"]],[sB,[cB,"us-east-2"]],[sB,[cB,"us-west-1"]],[sB,[cB,"us-west-2"]]],results:[[eB],[eB,"Invalid Configuration: FIPS and custom endpoint are not supported"],[eB,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[aB,uB],["https://cognito-idp-fips.us-east-1.amazonaws.com",uB],["https://cognito-idp-fips.us-east-2.amazonaws.com",uB],["https://cognito-idp-fips.us-west-1.amazonaws.com",uB],["https://cognito-idp-fips.us-west-2.amazonaws.com",uB],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",uB],[eB,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",uB],[eB,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",uB],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",uB],[eB,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",uB],[eB,"Invalid Configuration: Missing Region"]]},hB=1e8,pB=new Int32Array([-1,1,-1,0,17,3,1,4,hB+16,2,5,hB+16,3,9,6,5,7,hB+15,6,8,hB+14,7,hB+12,hB+13,4,11,10,5,hB+9,hB+11,5,12,hB+10,6,13,hB+9,8,hB+4,14,9,hB+5,15,10,hB+6,16,11,hB+7,hB+8,3,hB+1,18,5,hB+2,hB+3]),gB=jL.from(pB,2,fB.conditions,fB.results),mB=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"]}),vB=(e,t={})=>mB.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<sz;){const e=3*(Math.abs(s)-1),[t,r,i]=[n[e],n[e+1],n[e+2]],[c,u,d]=o[t],f=ez({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>=sz){const e=i[s-sz];if(-1===e[0]){const[,t]=e;throw new UL(QL(t,"Error",l))}const[t,n,r]=e;return{url:oz(t,l),properties:nz(n,l),headers:tz(r??{},l)}}throw new UL("No matching endpoint.")})(gB,{endpointParams:e,logger:t.logger}));$L.aws=cz;class yB extends dj{constructor(e){super(e),Object.setPrototypeOf(this,yB.prototype)}}class bB extends yB{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,bB.prototype)}}class _B extends yB{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,_B.prototype)}}class xB extends yB{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,xB.prototype),this.reasonCode=e.reasonCode}}class SB extends yB{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,SB.prototype)}}class wB extends yB{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,wB.prototype)}}class EB extends yB{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,EB.prototype)}}class kB extends yB{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,kB.prototype)}}class CB extends yB{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,CB.prototype)}}class AB extends yB{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,AB.prototype)}}class NB extends yB{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,NB.prototype)}}class TB extends yB{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,TB.prototype)}}class RB extends yB{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,RB.prototype)}}class DB extends yB{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,DB.prototype)}}class IB extends yB{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,IB.prototype)}}class FB extends yB{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,FB.prototype)}}class OB extends yB{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,OB.prototype)}}class PB extends yB{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,PB.prototype)}}class MB extends yB{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,MB.prototype)}}class LB extends yB{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,LB.prototype)}}class zB extends yB{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,zB.prototype)}}class jB extends yB{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,jB.prototype)}}class UB extends yB{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,UB.prototype)}}class BB extends yB{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,BB.prototype)}}class $B extends yB{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,$B.prototype)}}class qB extends yB{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,qB.prototype)}}class GB extends yB{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,GB.prototype)}}class VB extends yB{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,VB.prototype)}}class KB extends yB{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,KB.prototype)}}class WB extends yB{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,WB.prototype)}}class HB extends yB{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,HB.prototype)}}class JB extends yB{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,JB.prototype)}}class XB extends yB{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,XB.prototype)}}class QB extends yB{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,QB.prototype)}}class YB extends yB{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,YB.prototype)}}class ZB extends yB{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,ZB.prototype)}}class e$ extends yB{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,e$.prototype)}}class t$ extends yB{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,t$.prototype)}}class n$ extends yB{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,n$.prototype)}}class r$ extends yB{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,r$.prototype)}}class i$ extends yB{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,i$.prototype)}}class o$ extends yB{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,o$.prototype)}}class s$ extends yB{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,s$.prototype)}}class a$ extends yB{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,a$.prototype)}}class l$ extends yB{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,l$.prototype)}}class c$ extends yB{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,c$.prototype)}}class u$ extends yB{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,u$.prototype)}}class d$ extends yB{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,d$.prototype)}}class f$ extends yB{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,f$.prototype)}}class h$ extends yB{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,h$.prototype)}}class p$ extends yB{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,p$.prototype)}}class g$ extends yB{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,g$.prototype)}}class m$ extends yB{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,m$.prototype)}}class v$ extends yB{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,v$.prototype)}}class y$ extends yB{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,y$.prototype)}}class b$ extends yB{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,b$.prototype)}}class _$ extends yB{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,_$.prototype)}}class x$ extends yB{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,x$.prototype)}}const S$="Session",w$="client",E$="error",k$="httpError",C$="message",A$="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",N$="server",T$="com.amazonaws.cognitoidentityprovider",R$=KM.for(A$);var D$=[-3,A$,"CognitoIdentityProviderServiceException",0,[],[]];R$.registerError(D$,yB);const I$=KM.for(T$);var F$=[-3,T$,"AccessDeniedException",{[E$]:w$,[k$]:403},[C$],[0]];I$.registerError(F$,bB);var O$=[-3,T$,"AliasExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(O$,UB);var P$=[-3,T$,"CodeDeliveryFailureException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(P$,FB);var M$=[-3,T$,"CodeMismatchException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(M$,HB);var L$=[-3,T$,"ConcurrentModificationException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(L$,YB);var z$=[-3,T$,"DeviceKeyExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(z$,s$);var j$=[-3,T$,"DuplicateProviderException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(j$,l$);var U$=[-3,T$,"EnableSoftwareTokenMFAException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(U$,x$);var B$=[-3,T$,"ExpiredCodeException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(B$,JB);var $$=[-3,T$,"FeatureUnavailableInTierException",{[E$]:w$,[k$]:403},[C$],[0]];I$.registerError($$,d$);var q$=[-3,T$,"ForbiddenException",{[E$]:w$,[k$]:403},[C$],[0]];I$.registerError(q$,ZB);var G$=[-3,T$,"GroupExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(G$,a$);var V$=[-3,T$,"InternalErrorException",{[E$]:N$},[C$],[0]];I$.registerError(V$,_B);var K$=[-3,T$,"InternalServerException",{[E$]:N$},[C$],[0]];I$.registerError(K$,CB);var W$=[-3,T$,"InvalidEmailRoleAccessPolicyException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(W$,$B);var H$=[-3,T$,"InvalidLambdaResponseException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(H$,TB);var J$=[-3,T$,"InvalidOAuthFlowException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(J$,p$);var X$=[-3,T$,"InvalidParameterException",{[E$]:w$,[k$]:400},[C$,"reasonCode"],[0,0]];I$.registerError(X$,xB);var Q$=[-3,T$,"InvalidPasswordException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Q$,OB);var Y$=[-3,T$,"InvalidSmsRoleAccessPolicyException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Y$,PB);var Z$=[-3,T$,"InvalidSmsRoleTrustRelationshipException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Z$,MB);var eq=[-3,T$,"InvalidUserPoolConfigurationException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(eq,BB);var tq=[-3,T$,"LimitExceededException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(tq,AB);var nq=[-3,T$,"ManagedLoginBrandingExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(nq,c$);var rq=[-3,T$,"MFAMethodNotFoundException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(rq,qB);var iq=[-3,T$,"NotAuthorizedException",{[E$]:w$,[k$]:403},[C$],[0]];I$.registerError(iq,SB);var oq=[-3,T$,"PasswordHistoryPolicyViolationException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(oq,XB);var sq=[-3,T$,"PasswordResetRequiredException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(sq,GB);var aq=[-3,T$,"PreconditionNotMetException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(aq,LB);var lq=[-3,T$,"RefreshTokenReuseException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(lq,v$);var cq=[-3,T$,"ResourceNotFoundException",{[E$]:w$,[k$]:404},[C$],[0]];I$.registerError(cq,wB);var uq=[-3,T$,"ScopeDoesNotExistException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(uq,g$);var dq=[-3,T$,"SoftwareTokenMFANotFoundException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(dq,QB);var fq=[-3,T$,"TermsExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(fq,u$);var hq=[-3,T$,"TierChangeNotAllowedException",{[E$]:w$,[k$]:403},[C$],[0]];I$.registerError(hq,f$);var pq=[-3,T$,"TooManyFailedAttemptsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(pq,RB);var gq=[-3,T$,"TooManyRequestsException",{[E$]:w$,[k$]:429},[C$],[0]];I$.registerError(gq,EB);var mq=[-3,T$,"UnauthorizedException",{[E$]:w$,[k$]:401},[C$],[0]];I$.registerError(mq,y$);var vq=[-3,T$,"UnexpectedLambdaException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(vq,DB);var yq=[-3,T$,"UnsupportedIdentityProviderException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(yq,m$);var bq=[-3,T$,"UnsupportedOperationException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(bq,VB);var _q=[-3,T$,"UnsupportedTokenTypeException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(_q,b$);var xq=[-3,T$,"UnsupportedUserStateException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(xq,zB);var Sq=[-3,T$,"UserImportInProgressException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Sq,kB);var wq=[-3,T$,"UserLambdaValidationException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(wq,IB);var Eq=[-3,T$,"UsernameExistsException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Eq,jB);var kq=[-3,T$,"UserNotConfirmedException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(kq,KB);var Cq=[-3,T$,"UserNotFoundException",{[E$]:w$,[k$]:404},[C$],[0]];I$.registerError(Cq,NB);var Aq=[-3,T$,"UserPoolAddOnNotEnabledException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Aq,WB);var Nq=[-3,T$,"UserPoolTaggingException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Nq,h$);var Tq=[-3,T$,"WebAuthnChallengeNotFoundException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Tq,e$);var Rq=[-3,T$,"WebAuthnClientMismatchException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Rq,t$);var Dq=[-3,T$,"WebAuthnConfigurationMissingException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Dq,_$);var Iq=[-3,T$,"WebAuthnCredentialNotSupportedException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Iq,n$);var Fq=[-3,T$,"WebAuthnNotEnabledException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Fq,r$);var Oq=[-3,T$,"WebAuthnOriginNotAllowedException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Oq,i$);var Pq=[-3,T$,"WebAuthnRelyingPartyMismatchException",{[E$]:w$,[k$]:400},[C$],[0]];I$.registerError(Pq,o$);const Mq=[R$,I$];var Lq=[0,T$,"ClientIdType",8,0],zq=[0,T$,"SessionType",8,0],jq=[0,T$,"TokenModelType",8,0],Uq=[3,T$,"AnalyticsMetadataType",0,["AnalyticsEndpointId"],[0]],Bq=[3,T$,"AuthenticationResultType",0,["AccessToken","ExpiresIn","TokenType","RefreshToken","IdToken","NewDeviceMetadata"],[[()=>jq,0],1,0,[()=>jq,0],[()=>jq,0],()=>Gq]],$q=[3,T$,"InitiateAuthRequest",0,["AuthFlow","ClientId","AuthParameters","ClientMetadata","AnalyticsMetadata","UserContextData",S$],[0,[()=>Lq,0],[()=>Kq,0],128,()=>Uq,[()=>Vq,0],[()=>zq,0]],2],qq=[3,T$,"InitiateAuthResponse",0,["ChallengeName",S$,"ChallengeParameters","AuthenticationResult","AvailableChallenges"],[0,[()=>zq,0],128,[()=>Bq,0],64]],Gq=[3,T$,"NewDeviceMetadataType",0,["DeviceKey","DeviceGroupKey"],[0,0]],Vq=[3,T$,"UserContextDataType",8,["IpAddress","EncodedData"],[0,0]],Kq=[2,T$,"AuthParametersType",8,0,0],Wq=[9,T$,"InitiateAuth",0,()=>$q,()=>qq];const Hq=e=>{const t=(({defaultsMode:e}={})=>Rj(async()=>{const t="function"==typeof e?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(zU()?"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 ${LU.join(", ")}, got ${t}`)}}))(e),n=()=>t().then(hj),r=(e=>({apiVersion:"2016-04-18",base64Decoder:e?.base64Decoder??uM,base64Encoder:e?.base64Encoder??pM,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??vB,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??cU,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new Tj},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new PL}],logger:e?.logger??new vj,protocol:e?.protocol??YU,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:Mq,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??DM,utf8Decoder:e?.utf8Decoder??dM,utf8Encoder:e?.utf8Encoder??hM}))(e);return{...r,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??MU,credentialDefaultProvider:e?.credentialDefaultProvider??(e=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??IU({serviceId:r.serviceId,clientVersion:dU}),maxAttempts:e?.maxAttempts??3,region:e?.region??OU("Region is missing"),requestHandler:xM.create(e?.requestHandler??n),retryMode:e?.retryMode??(async()=>(await n()).retryMode||fz),sha256:e?.sha256??DU,streamCollector:e?.streamCollector??wM,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(false)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(false))}};class Jq extends sj{config;constructor(...[e]){const t=Hq(e||{});super(t),this.initConfig=t;var n;const r=function(e){const t=sM(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=ej(r),o=(e=>{const t=e.tls??!0,{endpoint:n,useDualstackEndpoint:r,useFipsEndpoint:i}=e,o=null!=n?async()=>Hz(await ZP(n)()):void 0,s=!!n,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:s,useDualstackEndpoint:ZP(r??!1),useFipsEndpoint:ZP(i??!1)});let l;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!l&&(l=Wz(e.serviceId)),l),a})(Lz(i)),s=(e=>{const t=aU(e);return Object.assign(t,{authSchemePreference:ZP(e.authSchemePreference??[])})})(o),a=((e,t)=>{const n=Object.assign((e=>({setRegion(t){e.region=t},region:()=>e.region}))(e),gj(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()},mj(n),{httpHandler:n.httpHandler()},(e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}))(n))})(s,e?.extensions||[]);this.config=a,this.middlewareStack.use(PM(this.config)),this.middlewareStack.use((e=>({applyToStack:t=>{t.add(Iz(e),Oz)}}))(this.config)),this.middlewareStack.use(Ej(this.config)),this.middlewareStack.use(Uz(this.config)),this.middlewareStack.use(JP(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(fie){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:fie,metadata:fie.$metadata}),fie}},XP)}})),this.middlewareStack.use((this.config,{applyToStack:e=>{e.add(e=>async t=>e(t),QP)}})),this.middlewareStack.use(((e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(eM(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),tM)}}))(this.config,{httpAuthSchemeParametersProvider:lU,identityProviderConfigProvider:async e=>new OL({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(oM(this.config))}destroy(){super.destroy()}}class Xq extends(cj.classBuilder().ep(uU).m(function(e,t,n,r){return[Yz(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(Wq).build()){}let Qq="reventless.role-switched",Yq="activeRole",Zq="availableRoles",eG="activeRoleStale";function tG(e){return e.split(",").map(e=>e.trim()).filter(e=>""!==e)}function nG(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(Yq),availableRoles:L(r(Zq),[],tG),staleRole:r(eG)}}function rG(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([Yq,t])}),0!==i.length&&e.push([Zq,i.join(",")]),M(o,t=>{e.push([eG,t])}),t=[["claims",Object.fromEntries(e)]]}return Object.fromEntries(n.concat(t))}function iG(e,t){let n=[["token",t.token],["identity",rG(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 oG(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(Yq),availableRoles:L(t(Zq),[],tG),staleRole:t(eG)}}async function sG(e){try{let t=await e.text();return JSON.parse(t)}catch(t){return}}function aG(e,t){return t+" (HTTP "+e.status.toString()+")"}function lG(e){return JSON.stringify(void 0!==e?Object.fromEntries([["activeRole",e]]):{})}async function cG(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 sG(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:$P(BP(F(r)))}}}function uG(e){try{return function(e,t){if("string"!=typeof e)throw new LP("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 LP(`Invalid token specified: missing part #${n+1}`);let i;try{i=zP(r)}catch(iB){throw new LP(`Invalid token specified: invalid base64 for part #${n+1} (${iB.message})`)}try{return JSON.parse(i)}catch(iB){throw new LP(`Invalid token specified: invalid json for part #${n+1} (${iB.message})`)}}(e)}catch(t){return}}function dG(e){let t=e.IdToken;if(void 0===t)return;let n=uG(t);if(void 0===n)return;let r=e.ExpiresIn,i=void 0!==r?Date.now()+1e3*r:void 0;return{token:t,identity:oG(n),refreshToken:e.RefreshToken,expiresAt:i}}async function fG(e,t,n,r){try{let i=new Jq({region:t}),o=new Xq({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(uG(a),oG),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:$P(BP(F(i)))}}}let hG=l(void 0),pG=hG.Provider;let gG=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:nG(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(()=>{fG(r,n,e,i).then(e=>{if("Ok"===e.TAG){let t=e._0;return iG(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 Jq({region:t}),o=new Xq({ClientId:e,AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:Object.fromEntries([["USERNAME",n],["PASSWORD",r]])}),s=j((await i.send(o)).AuthenticationResult,dG);return void 0!==s?{TAG:"Ok",_0:s}:{TAG:"Error",_0:"Cognito returned no usable tokens"}}catch(i){return{TAG:"Error",_0:$P(BP(F(i)))}}}(r,n,e,t);if("Ok"!==i.TAG)return{TAG:"LoginErr",_0:i._0};let o=i._0;return iG(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 sG(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:nG(n),refreshToken:void 0,expiresAt:void 0};return iG(l,i),d(e=>i),"LoginOk"}let o=U(j(j(j(r,Je.object),e=>e.error),Je.string),aG(n,"Login failed"));return{TAG:"LoginErr",_0:o}}}catch(s){return{TAG:"LoginErr",_0:$P(BP(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 cG(i,f.token,e);if("Ok"!==s.TAG)return{TAG:"LoginErr",_0:s._0};let a=await fG(r,n,o,f.identity),c=0;if("Ok"===a.TAG){let t=a._0;if(vt(t.identity.activeRole,e))return iG(l,t),sessionStorage.setItem(Qq,"1"),d(e=>t),"LoginOk";c=2}else c=2;if(2===c)return await cG(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:lG(e)}),n=await sG(t);if(!t.ok)return{TAG:"LoginErr",_0:U(j(j(j(n,Je.object),e=>e.error),Je.string),aG(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:nG(s),refreshToken:void 0,expiresAt:void 0};return iG(l,a),sessionStorage.setItem(Qq,"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(pG,{value:m,children:e.children})};function mG(){return d(hG)}function vG(e){let t=globalThis.window;if(null!=t)try{return R(t.matchMedia(e))}catch(n){return}}function yG(e){let t=vG(e);if(void 0===t)return!1;try{return D(t).matches}catch(n){return!1}}function bG(e){let t=s(()=>yG(e)),n=t[1];return a(()=>{n(t=>yG(e));let t=vG(e);if(void 0===t)return;let r=D(t),i=()=>n(t=>yG(e));try{return r.addEventListener("change",i),()=>{try{return void r.removeEventListener("change",i)}catch(e){return}}}catch(o){return}},[e]),t[0]}function _G(){return{compact:bG(At.compact),narrow:bG(At.narrow),tight:bG(At.tight)}}function xG(e){return e.tight?"Tight":e.narrow?"Narrow":e.compact?"Compact":"Wide"}function SG(){return xG(_G())}let wG={background:"var("+bt.surface+")",border:"1px solid var("+bt.border+")",color:"var("+bt.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"},EG={color:"var("+bt.textSecondary+")",fontSize:"0.625rem"},kG={background:"var("+bt.surfaceElevated+")",border:"1px solid var("+bt.borderSubtle+")",color:"var("+bt.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+")"},CG={background:"var("+bt.brandSubtle+")",color:"var("+bt.brand+")",display:"inline-block",fontSize:"var("+xt.sizeXs+")",marginRight:"0.25rem",marginBottom:"0.25rem",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"},AG={border:"none",borderTop:"1px solid var("+bt.borderSubtle+")",margin:"0.5rem 0"},NG={background:"transparent",border:"1px solid var("+bt.border+")",color:"var("+bt.textPrimary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"0.375rem 0.5rem",width:"100%",borderRadius:"var("+St.sm+")"},TG={color:"var("+bt.textSecondary+")",fontSize:"var("+xt.sizeXs+")",letterSpacing:"0.04em",marginBottom:"0.25rem",textTransform:"uppercase"};let RG={color:"var("+bt.textSecondary+")",fontSize:"var("+xt.sizeXs+")"},DG={color:"var("+bt.textSecondary+")",fontWeight:"var("+xt.weightNormal+")"},IG={background:"transparent",border:"none",color:"var("+bt.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+")"},FG={color:"var("+bt.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"},OG={color:"var("+bt.error+")",fontSize:"var("+xt.sizeXs+")",marginTop:"0.25rem"},PG={color:"var("+bt.textSecondary+")",fontSize:"var("+xt.sizeXs+")",marginBottom:"0.25rem"};function MG(e){let t=e.trim()[0];return void 0!==t&&""!==t.trim()?t.toUpperCase():"☺"}function LG(e,t){if(!e)return[];let n=t.availableRoles;return 0!==n.length?n:t.groups}let zG=function(e){let t=mG(),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=bG(At.compact);if(void 0===t)return null;let m=t.identity;if(void 0===m)return null;let v,y=LG(t.canSwitchRoles,m),b=function(e,t){let n=e.length;if(1!==n&&0!==n)return t.activeRole}(y,m),_=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:TG}),void 0!==t?null:i("div",{children:"All of them — choose one to narrow.",style:FG}),y.map(e=>{let t=vt(m.activeRole,e);return r("button",{children:[e,t?i("span",{children:"✓",style:RG}):null],"aria-checked":t?"true":"false",role:"radio",style:(n=t,{background:"transparent",border:"none",color:"var("+bt.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 _(e)}},e);var n})],"aria-label":"Acting as",role:"radiogroup"}),void 0!==n?r(o,{children:[i("hr",{style:AG}),i("button",{children:"Stop acting as one role",style:IG,disabled:d,onClick:e=>_(void 0)})]}):null,void 0!==p?i("div",{children:p,style:OG}):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:CG},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:PG}):null,e,i("hr",{style:AG}),i("button",{children:"Sign out",style:NG,onClick:e=>{a(e=>!1),t.logout()}})],style:kG})}else v=null;return r("div",{children:[r("button",{children:[g?MG(m.username):r(o,{children:[m.username,void 0!==b?i("span",{children:"· "+b,style:DG}):null]}),i("span",{children:l?"▴":"▾",style:EG})],"aria-label":void 0!==b?"Signed in as "+m.username+", acting as "+b:"Signed in as "+m.username,style:wG,onClick:e=>a(e=>!e)}),v],style:{position:"relative"}})},jG={background:"var("+bt.surface+")",border:"1px solid var("+bt.borderSubtle+")",color:"var("+bt.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"360px",padding:"2rem",borderRadius:"var("+St.md+")"},UG={color:"var("+bt.textSecondary+")",display:"block",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.25rem"},BG={background:"var("+bt.surfaceElevated+")",border:"1px solid var("+bt.border+")",color:"var("+bt.textPrimary+")",fontSize:"var("+xt.sizeMd+")",marginBottom:"1rem",padding:"0.5rem 0.75rem",width:"100%",borderRadius:"var("+St.sm+")",boxSizing:"border-box"};function $G(e){return{background:e?"var("+bt.textDisabled+")":"var("+bt.brand+")",border:"none",color:"var("+bt.textOnBrand+")",cursor:e?"not-allowed":"pointer",fontSize:"var("+xt.sizeMd+")",fontWeight:"var("+xt.weightMedium+")",padding:"0.625rem",width:"100%",borderRadius:"var("+St.sm+")"}}let qG={color:"var("+bt.error+")",fontSize:"var("+xt.sizeSm+")",marginBottom:"0.75rem"};let GG=function(e){let t=mG(),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:UG}),i("input",{style:BG,autoComplete:"username",autoFocus:!0,type:"text",value:a,onChange:e=>{let t=e.target.value;o(e=>t)}}),i("label",{children:"Password",style:UG}),i("input",{style:BG,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:qG}):null,i("button",{children:m?"Signing in…":"Sign in",style:$G(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:jG})};let VG=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 KG=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)}})},WG=l(void 0),HG=WG.Provider;let JG=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(HG,{value:u,children:e.children})};function XG(){let e=d(WG);return void 0!==e?e.getPages():[]}function QG(e){return!U(e.menuEntry.hidden,!1)}let YG=l({activeAccess:[],hasAccess:function(e){return!1}}),ZG=YG.Provider;function eV(){return d(YG).hasAccess}let tV=function(e){let t=e.access,n={activeAccess:t,hasAccess:e=>t.some(t=>t===e)};return c(ZG,{value:n,children:e.children})};function nV(e){return"var("+e+")"}let rV=Ls([qo("flex"),jo("center"),zo("gap",nV(_t.sm)),zo("padding","6px var("+_t.sm+") 6px 14px"),zo("border-radius",nV(St.md)),zo("color",nV(bt.textDisabled)),zo("font-size",nV(xt.sizeSm)),$o("notAllowed"),ys("none")]),iV=Ls([zo("font-size","14px"),Ko(0)]),oV=Ls([Vo(1),zo("font-weight",nV(xt.weightMedium))]),sV=Ls([zo("font-size",nV(xt.sizeXs)),zo("color",nV(bt.brand)),$o("pointer"),zo("text-decoration","none"),Ko(0)]);let aV=function(e){return r("div",{children:[i("span",{children:"[locked]",className:iV}),i("span",{children:e.label,className:oV}),i("span",{children:"Upgrade",className:sV})],className:rV})};function lV(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r?0:n<r?-1:1}function cV(e,t){return e.menuEntry.sortOrder===t.menuEntry.sortOrder?lV(e.menuEntry.label,t.menuEntry.label):de(e.menuEntry.sortOrder,t.menuEntry.sortOrder)}function uV(e){return ge(e,999,(e,t)=>e<t.menuEntry.sortOrder?e:t.menuEntry.sortOrder)}function dV(e){return"var("+e+")"}let fV=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("padding","var("+_t.sm+")"),xs("& a",[zo("text-decoration","none"),zo("color","inherit"),zo("display","block"),zo("outline-offset","2px")])]),hV=Ls([zo("color",dV(bt.textDisabled)),zo("font-size",dV(xt.sizeXs)),zo("font-weight",dV(xt.weightBold)),zo("letter-spacing","0.08em"),zo("text-transform","uppercase"),zo("padding","var("+_t.xs+") var("+_t.sm+")"),rs(Ts(12)),is(Ts(2))]),pV=Ls([ps("relative"),qo("flex"),jo("center"),zo("gap",dV(_t.sm)),zo("padding","6px var("+_t.sm+") 6px 14px"),zo("color",dV(bt.textSecondary)),zo("font-size",dV(xt.sizeMd)),zo("line-height","1.4"),$o("pointer"),zo("border-radius",dV(St.md)),zo("text-decoration","none"),zo("transition","background-color 140ms ease, color 140ms ease, transform 140ms ease"),xs("&::before",[zo("content","''"),ps("absolute"),zo("left","4px"),zo("top","50%"),zo("width","3px"),zo("height","0"),zo("border-radius",dV(St.full)),zo("background",dV(bt.brand)),zo("transform","translateY(-50%)"),zo("transition","height 160ms ease")]),Cs([zo("background",dV(bt.surfaceSubtle)),zo("color",dV(bt.textPrimary)),zo("transform","translateX(2px)")]),Ss("(prefers-reduced-motion: reduce)",[zo("transition","none"),Cs([zo("transform","none")]),xs("&::before",[zo("transition","none")])])]),gV=Ls([zo("background",dV(bt.brandSubtle)),zo("color",dV(bt.textPrimary)),zo("font-weight",dV(xt.weightMedium)),xs("&::before",[zo("height","56%")]),Cs([zo("background",dV(bt.brandSubtle)),zo("color",dV(bt.textPrimary)),zo("transform","none")])]),mV=Ls([zo("font-size","14px"),zo("line-height","1"),Ko(0)]),vV=Ls([zo("white-space","nowrap"),zo("overflow","hidden"),zo("text-overflow","ellipsis")]),yV=Ls([zo("font-size","12px"),zo("color",dV(bt.textDisabled)),ts("auto"),Ko(0)]);function bV(e,t){let n=e.url;return void 0!==n&&(n===t||t.startsWith(n+"/"))}function _V(e){let t=e.onNavigate,n=e.hasAccess,s=e.isActive,a=e.page,l=L(a.requiredAccess,!1,e=>!n(e)),c=s?pV+" "+gV:pV,u=r(o,{children:[L(a.menuEntry.icon,null,e=>i("span",{children:e,"aria-hidden":!0,className:mV})),i("span",{children:a.menuEntry.label,className:vV}),l?i("span",{children:"[locked]",className:yV}):null]}),d=a.url;return l||void 0===d?i("div",{children:u,className:c,role:"button"}):i(KG,{route:d,children:i("span",{children:u,"aria-current":s?"page":void 0,className:c,onClick:e=>t()})})}function xV(e){let t=e.onNavigate,n=e.hasAccess,s=e.currentUrl,a=e.pages.toSorted(cV);return r(o,{children:[L(e.label,null,e=>i("div",{children:e,className:hV})),a.map(e=>i(_V,{page:e,isActive:bV(e,s),hasAccess:n,onNavigate:t},e.fragmentId))]})}let SV=function(e){let t=e.onNavigate,n=e.currentUrl,o=void 0!==t?t:()=>{},s=XG(),a=eV(),l=s.filter(QG),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=uV(e[1]),r=uV(t[1]);return n===r?lV(e[0],t[0]):de(n,r)});return r("nav",{children:[0!==u.length?i(xV,{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(xV,{label:r,pages:t,currentUrl:n,hasAccess:a,onNavigate:o},r);case"Locked":return i(aV,{label:r},r);case"Absent":return null}})],"aria-label":"primary navigation",className:fV})},wV=l(void 0),EV=l(void 0),kV=wV.Provider,CV=EV.Provider;let AV=function(e){return c(kV,{value:e.target,children:c(CV,{value:e.controlsTarget,children:e.children})})};function NV(){return d(wV)}function TV(e,t){return void 0!==e?w(t,D(e)):t}function RV(e){return"var("+e+")"}let DV="52px",IV=Ls([qo("flex"),Go("row"),Ho({NAME:"vh",VAL:100}),zo("overflow","hidden"),zo("background",RV(bt.background)),zo("font-family",RV(xt.fontFamily)),zo("color",RV(bt.textPrimary))]),FV=Ls([qo("flex"),Go("column"),zo("width","236px"),Ko(0),zo("background",RV(bt.surface)),zo("border-right","1px solid var("+bt.borderSubtle+")"),zo("overflow","hidden"),Ss(At.compact,[ps("fixed"),vs(Ts(0)),Xo(Ts(0)),Bo(Ts(0)),zo("width","min(268px, 82vw)"),zo("z-index","950"),zo("box-shadow",RV(kt)),zo("transform","translateX(-100%)"),zo("visibility","hidden"),zo("transition","transform 180ms ease, visibility 0s linear 180ms")]),Ss("(prefers-reduced-motion: reduce)",[zo("transition","none")])]),OV=zs([FV,Ls([Ss(At.compact,[zo("transform","translateX(0)"),zo("visibility","visible"),zo("transition","transform 180ms ease, visibility 0s linear 0s")])])]),PV=Ls([ps("fixed"),vs(Ts(0)),Xo(Ts(0)),gs(Ts(0)),Bo(Ts(0)),zo("background","rgba(0,0,0,0.45)"),zo("z-index","900"),zo("display","none"),Ss(At.compact,[zo("display","block")])]),MV=Ls([zo("display","none"),Ss(At.compact,[zo("display","inline-flex")]),jo("center"),Jo("center"),zo("vertical-align","middle"),zo("margin-right",RV(_t.sm)),zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",RV(St.md)),zo("padding","2px var("+_t.sm+")"),zo("color",RV(bt.textSecondary)),zo("font-size",RV(xt.sizeMd)),zo("line-height","1.6"),$o("pointer"),Cs([zo("background",RV(bt.surfaceSubtle)),zo("color",RV(bt.textPrimary))])]),LV=Ls([qo("flex"),jo("center"),zo("gap",RV(_t.sm)),zo("height",DV),Ko(0),zo("padding","0 var("+_t.md+")"),zo("color",RV(bt.textPrimary)),zo("font-size",RV(xt.sizeLg)),zo("font-weight",RV(xt.weightBold)),zo("letter-spacing","-0.01em")]),zV=Ls([zo("white-space","nowrap"),zo("overflow","hidden"),zo("text-overflow","ellipsis")]),jV=Ls([Vo(1),zo("overflow-y","auto"),zo("min-height","0")]),UV=Ls([qo("flex"),Go("column"),Vo(1),zo("min-width","0"),zo("overflow","hidden")]),BV=Ls([qo("flex"),jo("center"),zo("min-height",DV),Ko(0),zo("padding","var("+_t.xs+") var("+_t.lg+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),zo("background",RV(bt.surface))]),$V=Ls([zo("display","flow-root"),Vo(1),zo("min-width","0")]),qV=Ls([zo("display","contents")]),GV=Ls([zo("float","right"),qo("flex"),jo("center"),Jo("flexEnd"),zo("flex-wrap","wrap"),zo("gap",RV(_t.sm)),zo("margin-left",RV(_t.md)),zo("max-width","100%"),xs("& > *, & > ."+qV+" > *",[zo("min-width","0"),zo("max-width","100%")])]),VV=Ls([zo("display","block"),zo("min-width","0")]),KV=Ls([qo("flex"),Go("column"),Vo(1),zo("overflow","auto"),zo("padding","var("+_t.md+") var("+_t.lg+")"),zo("background",RV(bt.background))]),WV="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])";let HV=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(()=>{}),b=y[1],_=(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=bG(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(WV))[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(WV)),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:zV,title:c})],className:LV}),i("div",{children:i(SV,{currentUrl:g,onNavigate:k}),className:jV})],ref:T(A),className:w?OV:FV,id:"rv-shell-nav"}),w?i("div",{"aria-hidden":!0,className:PV,onClick:e=>k()}):null,r("main",{children:[i("div",{children:r("div",{children:[r("div",{children:[i("div",{ref:T(e=>_(b,e)),className:qV}),U(e.headerSlot,null)],className:GV}),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:MV,onClick:e=>S(e=>!e)}),ref:T(e=>_(v,e)),className:VV})],className:$V}),className:BV}),i("div",{children:i(AV,{target:m[0],controlsTarget:y[0],children:d?i(VG,{url:g,routes:e.router,children:u}):p}),className:KV})],className:UV})],className:IV})},JV=l(void 0),XV=JV.Provider;let QV=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(XV,{value:f,children:e.children})};function YV(e){return"/"+e.environment+"/"+e.platformName}function ZV(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=YV(o),a=t.startsWith(s)?t.slice(s.length):"/";return[o,""===a?"/":a]}let eK=l(void 0).Provider;let tK=function(e){return c(eK,{value:e.scope,children:e.children})};let nK=l(void 0),rK=l({routes:[],publicLinks:{}}),iK=l(!1),oK=nK.Provider;function sK(e){return c(oK,{value:e.value,children:e.children})}let aK=rK.Provider;function lK(e){return c(aK,{value:e.value,children:e.children})}let cK=iK.Provider;function uK(e){return c(cK,{value:e.value,children:e.children})}let dK=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(sK,{value:p,children:i(uK,{value:c[0],children:i(lK,{value:h,children:i(Ke,{registry:f,children:e.children})})})})};function fK(){return d(nK)}function hK(e){return"var("+e+")"}let pK=Ls([zo("position","relative"),qo("inlineFlex")]),gK=Ls([qo("inlineFlex"),jo("center"),zo("gap","3px"),zo("background",hK(bt.surface)),zo("color",hK(bt.textPrimary)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",hK(St.md)),zo("padding","2px var("+_t.xs+")"),zo("font-family",hK(xt.fontFamily)),zo("font-size",hK(xt.sizeMd)),zo("line-height","1.4"),$o("pointer"),Cs([zo("background",hK(bt.surfaceSubtle))])]),mK=Ls([zo("font-size","0.625rem"),zo("color",hK(bt.textSecondary))]),vK=Ls([zo("position","absolute"),zo("top","calc(100% + 0.5rem)"),zo("right","0"),zo("min-width","170px"),zo("padding",hK(_t.xs)),zo("background",hK(bt.surfaceElevated)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",hK(St.md)),zo("box-shadow",hK(Et)),zo("z-index","10")]),yK=Ls([qo("flex"),jo("center"),zo("gap",hK(_t.sm)),zo("width","100%"),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("background","transparent"),zo("border","none"),zo("border-radius",hK(St.sm)),zo("color",hK(bt.textPrimary)),zo("font-family",hK(xt.fontFamily)),zo("font-size",hK(xt.sizeSm)),zo("text-align","left"),$o("pointer"),Cs([zo("background",hK(bt.surfaceSubtle))])]),bK=zs([yK,Ls([zo("font-weight",hK(xt.weightMedium))])]),_K=Ls([zo("font-size",hK(xt.sizeMd)),zo("line-height","1"),zo("width","1.25em"),zo("text-align","center"),Ko(0)]),xK=Ls([zo("margin-left","auto"),zo("color",hK(bt.textSecondary)),zo("font-size",hK(xt.sizeXs))]);function SK(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"High contrast"}}function wK(e){switch(e){case"Dark":return"☾";case"Light":return"☀";case"Neutral":return"◯";case"HighContrast":return"◐"}}let EK=["Light","Dark","Neutral","HighContrast"];let kK=function(e){let t=UO(),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:wK(o),"aria-hidden":!0}),i("span",{children:u?"▴":"▾","aria-hidden":!0,className:mK})],"aria-label":"Theme: "+SK(o),"aria-expanded":u,"aria-haspopup":"menu",className:gK,title:"Theme: "+SK(o),onClick:e=>c(e=>!e)}),u?i("div",{children:EK.map(e=>{let t=e===o;return r("button",{children:[i("span",{children:wK(e),"aria-hidden":!0,className:_K}),SK(e),t?i("span",{children:"✓",className:xK}):null],"aria-checked":t?"true":"false",className:t?bK:yK,role:"radio",onClick:t=>{n(e),c(e=>!1)}},qO(e))}),"aria-label":"Theme",className:vK,role:"radiogroup"}):null],ref:T(d),className:pK})};function CK(e){return Object.fromEntries([["eq",e]])}let AK=/\$filter\s*:\s*[A-Za-z0-9_]*Filter\b/,NK=/\$filter\s*:/,TK={};function RK(e){return t=>(n,r)=>AK.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=CK(t.environment),o.platformName=CK(t.platformName),r.filter=o,r}(r,e)):(NK.test(n)&&function(e){void 0!==TK[e]||(TK[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 DK={background:"var("+bt.surface+")",border:"1px solid var("+bt.borderSubtle+")",color:"var("+bt.textPrimary+")",fontFamily:"var("+xt.fontFamily+")",margin:"6rem auto",maxWidth:"480px",padding:"2rem",borderRadius:"var("+St.md+")"},IK={background:"var("+bt.surfaceElevated+")",border:"1px solid var("+bt.border+")",color:"var("+bt.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"},FK={background:"var("+bt.brandSubtle+")",color:"var("+bt.brand+")",fontSize:"var("+xt.sizeXs+")",padding:"0.125rem 0.5rem",borderRadius:"var("+St.full+")"};let OK=function(e){let t,n=e.discover,o=sF(),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("+bt.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:FK})],style:IK,onClick:t=>J(YV(e)+"/")},e.environment+"/"+e.platformName)):i("div",{children:"No platforms discovered.",style:{color:"var("+bt.textSecondary+")"}})}else t=i("div",{children:u._0,style:{color:"var("+bt.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:DK})};function PK(e){return j(e,e=>""===e.trim()?void 0:e)}function MK(e,t,n,r,i){let o=void 0!==i&&i,s=j(r,e=>e.nav),a=o?PK(j(s,e=>e.scopedLabel)):void 0,l=void 0!==a?a:PK(j(s,e=>e.label));return{label:U(l,t),icon:void 0,group:U(PK(j(s,e=>e.group)),e),sortOrder:U(j(s,e=>e.order),n),hidden:j(s,e=>e.hidden)}}function LK(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 zK={contents:[]};function jK(e){if(!zK.contents.includes(e))return zK.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 UK(e,t){return j(Xe(e,t),dt)}function BK(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=UK(t,"key"),r=UK(t,"value");if(void 0!==n&&void 0!==r)return[n,r]}),i=UK(t,"position"),o=UK(t,"eventType");if(void 0===i)return;if(void 0===o)return;let s=U(UK(n,"time"),U(UK(t,"recordedAt"),""));return{position:i,eventType:o,payload:U(Xe(t,"payload"),{}),tags:r,actor:UK(n,"user"),time:s,recordedAt:U(UK(t,"recordedAt"),s)}}function $K(e,t){return lt(e.startsWith(t)&&e.length>t.length?e.slice(t.length):e).toLowerCase()}function qK(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 GK(e,t){let n=qK(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:$K(e.eventType,t),subject:o,actor:U(e.actor,"System"),timestamp:e.time,before:i[0],after:i[1]}}).toReversed()}function VK(e){let t=[];return e.forEach(e=>M(e.actor,e=>t.includes(e)?void 0:void t.push(e))),t.toSorted(ue)}function KK(e){let t=[];return e.forEach(e=>t.includes(e.eventType)?void 0:void t.push(e.eventType)),t.toSorted(ue)}function WK(e){return"var("+e+")"}let HK=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",WK(_t.lg)),zo("padding",WK(_t.xxl)),bs({NAME:"percent",VAL:100}),Ho({NAME:"percent",VAL:100}),ms("center"),zo("min-height","400px")]),JK=Ls([zo("font-size","48px"),zo("line-height","1")]),XK=Ls([zo("color",WK(bt.textPrimary)),zo("font-size",WK(xt.sizeXxl)),zo("font-weight",WK(xt.weightBold)),Zo(Ts(0))]),QK=Ls([zo("color",WK(bt.textSecondary)),zo("font-size",WK(xt.sizeLg)),zo("line-height",WK(xt.lineHeightRelaxed)),zo("max-width","480px"),Zo(Ts(0))]),YK=Ls([zo("background",WK(bt.brand)),zo("color",WK(bt.textOnBrand)),zo("border-radius",WK(St.md)),zo("padding","var("+_t.sm+") var("+_t.lg+")"),zo("font-size",WK(xt.sizeMd)),zo("font-weight",WK(xt.weightMedium)),zo("border","none"),zo("cursor","pointer"),rs(Ts(8))]);let ZK=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:JK}),i("h2",{children:t.title,className:XK}),i("p",{children:L(t.requiredAccess,"This feature requires an upgrade.",e=>'This feature requires the "'+e+'" access tier.'),className:QK}),i("button",{children:"Upgrade to unlock",className:YK})],className:HK})};let eW=function(e){let t=e.children,n=e.definition,r=eV(),o=n.requiredAccess;return void 0===o||r(o)?t:i(ZK,{definition:n})},tW=Xe;function nW(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 rW(e,t,n){let r=Xe(e,t);return void 0===r||n(r)}function iW(e,t,n){return me(t,t=>{let r=Xe(e,t);if(void 0!==r&&!n(r))return t+': requires "'+r+'"'})}let oW=["body","text","message","comment","content"],sW=["author","createdby","user","commenter","postedby"],aW=["createdat","postedat","at","commentedat"];function lW(e){return me(Mn(e),e=>{if(Un(e[1]))return e[0]})}function cW(e,t){return lW(e).find(e=>t.includes(e.toLowerCase()))}function uW(e){let t=rr(e,void 0,void 0),n=Mn(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:cW(e,sW)}function dW(e){return lW(e).filter(e=>{let t=e.toLowerCase();return"id"!==t&&t.endsWith("id")})}function fW(e,t){let n=tt(t).toLowerCase();return dW(e).find(e=>e.toLowerCase()===n+"id")}function hW(e,t){let n=e.toLowerCase(),r=t.toLowerCase(),i=tt(t).toLowerCase();return!!n.endsWith("comments")&&(n===i+"comments"||n===r+"comments")}let pW=["addcomment","postcomment","comment","writecomment","leavecomment"];function gW(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=>pW.some(t=>e.name.toLowerCase().startsWith(t)))}let mW={contents:[]};function vW(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})||hW(e.name,t))),n=>{let r=fW(n.schema,t),i=void 0!==r?r:hW(n.name,t)?function(e){let t=dW(e);return 1!==t.length?void 0:t[0]}(n.schema):void 0,o=cW(n.schema,oW);return void 0!==o?void 0!==i?{readModel:n,entityField:i,bodyField:o,authorField:uW(n.schema),timestampField:(s=n.schema,me(Mn(s),e=>{if(Bn(e[1]))return e[0]}).find(e=>aW.includes(e.toLowerCase()))),postCommand:gW(n,e)}:void 0:void function(e){if(!mW.contents.includes(e))mW.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 '+oW.join(" | ")+' (plus an entity ref like "orderId"); see docs/guides/comments-read-model-convention.md.')}(n.name);var s})[0]}function yW(e,t){return j(Xe(e,t),dt)}function bW(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 _W(e){return bW(e.ann)}function xW(e){let t=$(rn(e)),n=0!==nn(e).length,r=0!==an(e).length;return{search:t||n||r}}function SW(e){let t=U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[]),n=t.map(e=>bW(en(e[1]))),r=n.some(e=>e.filter),i=n.some(e=>e.sort);return{hasFilter:r,hasSort:i,hasSearch:xW(e).search}}function wW(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(bW(s.ann).filter?n[o]=i:r[o]=i)}r[o]=i}),[n,r]}function EW(e,t,n){if(void 0===e)return"NoSort";let r=n.find(t=>t.key===e);return void 0!==r?bW(r.ann).sort?{TAG:"ServerSort",_0:e,_1:t}:{TAG:"ClientSort",_0:e,_1:t}:"NoSort"}function kW(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(qt(n),e=>e),n);break;default:t=n}else t=n;i[o+"Eq"]=t}),0===Qe(i).length?void 0:i}let CW={contents:[]};function AW(e,t){return me(e.readModels.filter(e=>e.name!==t),e=>{let n=fW(e.schema,t);if(void 0!==n)return function(e,t){return L(Mn(e).find(e=>e[0]===t),!1,e=>bW(en(e[1])).filter)}(e.schema,n)?{readModel:e,refField:n}:void function(e,t,n){let r=e+"."+t;if(!CW.contents.includes(r))CW.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 NW(e){return"var("+e+")"}function TW(e){switch(e){case"Success":return bt.success;case"Warning":return bt.warning;case"Error":return bt.error;case"Info":return bt.info}}function RW(e){return Ls([qo("flex"),jo("flexStart"),zo("gap",NW(_t.sm)),zo("padding","var("+_t.sm+") var("+_t.md+")"),zo("border-radius",NW(St.md)),zo("border-left","3px solid var("+TW(e)+")"),zo("background",NW(bt.surfaceElevated)),zo("font-size",NW(xt.sizeMd)),zo("line-height",NW(xt.lineHeightNormal))])}let DW=Ls([Vo(1)]),IW=Ls([zo("font-weight",NW(xt.weightMedium)),zo("color",NW(bt.textPrimary)),is(Ts(2))]),FW=Ls([zo("color",NW(bt.textSecondary))]),OW=Ls([zo("background","none"),Rs(Ts(0),"none",Ps),$o("pointer"),zo("color",NW(bt.textSecondary)),zo("font-size","16px"),zo("line-height","1"),zo("padding","0"),Ko(0)]);function PW(e){switch(e){case"Success":return"OK";case"Warning":return"!";case"Error":return"X";case"Info":return"i"}}let MW=function(e){let t=e.variant,n=void 0!==t?t:"Info";return r("div",{children:[i("span",{children:PW(n),className:(o=n,Ls([zo("color",NW(TW(o))),zo("font-size","16px"),Ko(0),rs(Ts(1))]))}),r("div",{children:[L(e.title,null,e=>i("div",{children:e,className:IW})),i("div",{children:e.message,className:FW})],className:DW}),L(e.onDismiss,null,e=>i("button",{children:"×","aria-label":"Dismiss",className:OW,onClick:t=>e()}))],className:RW(n),role:"alert"});var o};function LW(e){switch(e){case"Added":return"Added";case"BulkInvalidated":return"BulkInvalidated";case"Removed":return"Removed";case"Updated":return"Updated";default:return}}function zW(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}let jW="default";function UW(e,t,n,r,i){let o=void 0===n||n,s=oP(),l=function(e,t){let n=zW(e);return"object"!=typeof t?"/"+jW+"/"+n+"/*":"/"+jW+"/"+n+"/"+zW(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"),LW),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 BW(e){return"var("+e+")"}let $W=Ls([qo("flex"),Go("column"),zo("gap",BW(_t.sm))]),qW=Ls([zo("overflow-x","auto")]),GW=Ls([zo("border-collapse","collapse"),zo("font-size",BW(xt.sizeSm)),zo("min-width","min-content")]),VW=[zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("background",BW(bt.surfaceSubtle)),zo("white-space","nowrap"),zo("font-weight",BW(xt.weightMedium))],KW=Ls(VW.concat([zo("text-align","left"),zo("color",BW(bt.textSecondary))])),WW=Ls(VW.concat([zo("text-align","right"),zo("color",BW(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em"),zo("font-size",BW(xt.sizeXs))])),HW=Ls(VW.concat([zo("text-align","left"),zo("color",BW(bt.textPrimary))]));let JW=Ls([qo("flex"),jo("center"),zo("gap","6px"),zo("font-size",BW(xt.sizeXs)),zo("color",BW(bt.textSecondary))]);function XW(e,t){if(e<=0||t<=0)return 0;let n=e/t;return n<.12?.12:n>1?1:n}let QW=[.12,.35,.6,.85,1];let YW=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:KW,scope:"col"}),n.map(e=>i("th",{children:e.label,className:WW,scope:"col"},e.value))]})}),i("tbody",{children:e.rowHeaders.map((e,s)=>r("tr",{children:[i("th",{children:e.label,className:HW,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=XW(a.value,o),Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","right"),zo("white-space","nowrap"),zo("background",l<=0?"transparent":"color-mix(in srgb, var("+bt.brand+") "+Math.round(100*l).toString()+"%, transparent)"),zo("color",BW(l>=.55?bt.textOnBrand:l<=0?bt.textDisabled:bt.textPrimary))]))},e.value+":"+n.value);var l})]},e.value))})],className:GW}),className:qW}),r("div",{children:["0",QW.map(e=>{return i("span",{className:(t=e,Ls([zo("width","18px"),zo("height","10px"),zo("background","color-mix(in srgb, var("+bt.brand+") "+Math.round(100*t).toString()+"%, transparent)"),zo("border","1px solid var("+bt.borderSubtle+")")]))},e.toString());var t}),e.maxLabel],className:JW})],className:$W})};function ZW(e){let t=e.parent;if(void 0!==t&&""!==t)return t}function eH(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=ZW(e);if(void 0!==a){if(void 0!==Xe(t,a)){if(function(e,t,n){let r=j(Xe(e,t),ZW);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),ZW);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 tH(e){return ge(e.children,e.children.length,(e,t)=>e+tH(t)|0)}function nH(e){return"var("+e+")"}let rH=Ls([qo("flex"),Go("column"),zo("gap",nH(_t.sm))]),iH=Ls([zo("overflow-x","auto"),zo("padding-bottom","4px")]),oH=Ls([qo("flex"),jo("flexStart"),Jo("center"),zo("gap",nH(_t.lg)),zo("min-width","min-content"),zo("padding","var("+_t.xs+") 0")]),sH=Ls([qo("flex"),Go("column"),jo("center"),zo("min-width","min-content")]);let aH=Ls([zo("font-size",nH(xt.sizeSm)),zo("font-weight",nH(xt.weightMedium)),zo("color",nH(bt.textPrimary)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),lH=Ls([zo("font-size",nH(xt.sizeXs)),zo("color",nH(bt.textSecondary)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),cH=Ls([zo("margin-top","2px"),zo("padding","0 6px"),zo("border","1px solid var("+bt.border+")"),zo("border-radius","10px"),zo("background",nH(bt.surface)),zo("color",nH(bt.textSecondary)),zo("font-size",nH(xt.sizeXs)),zo("line-height","16px"),$o("pointer"),Cs([zo("color",nH(bt.textPrimary))])]),uH=Ls([zo("width","1px"),zo("height","14px"),zo("background",nH(bt.border))]),dH=Ls([qo("flex"),jo("flexStart"),zo("min-width","min-content")]),fH=Ls([qo("flex"),Go("column"),jo("center"),zo("min-width","min-content")]),hH=Ls([zo("padding","0 var("+_t.xs+")")]),pH=Ls([qo("flex"),zo("width","100%"),zo("height","1px")]);function gH(e){return Ls([zo("flex","1 1 50%"),zo("background",e?nH(bt.border):"transparent")])}let mH=Ls([zo("font-size",nH(xt.sizeXs)),zo("color",nH(bt.textDisabled))]),vH="var("+bt.brand+")",yH=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"]]},yH,{make:function(e){let t=e.depth,n=e.tree,a=s(()=>!1),l=a[1],c=a[0],u=tH(n),d=n.children.length,f=n.node.subtitle;return r("div",{children:[r("button",{children:[i("span",{children:n.node.title,className:aH}),void 0!==f&&""!==f?i("span",{children:f,className:lH}):null],className:(h=U(n.node.accent,vH),Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-width","132px"),zo("max-width","180px"),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-top","3px solid "+h),zo("border-radius",nH(St.md)),zo("background",nH(bt.surface)),zo("text-align","left"),$o("pointer"),Cs([zo("background",nH(bt.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:cH,title:c?"Expand":"Collapse",onClick:e=>l(e=>!e)}),c?null:r(o,{children:[i("div",{className:uH}),i("div",{children:n.children.map((e,n)=>r("div",{children:[r("div",{children:[i("div",{className:gH(n>0)}),i("div",{className:gH(n<(d-1|0))})],className:pH}),i("div",{className:uH}),i("div",{children:i(yH.make,{tree:e,depth:t+1|0}),className:hH})],className:fH},e.node.key)),className:dH})]})]})],className:sH});var h}});let bH=function(e){let t=eH(e.nodes);if(0===t.roots.length)return i(Ks,{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(yH.make,{tree:e,depth:0},e.node.key)),className:oH}),className:iH}),0===n.length?null:i("span",{children:n.join(" · "),className:mH})],className:rH})};function _H(e){return"var("+e+")"}let xH=Ls([ps("relative"),zo("padding-left","28px"),qo("flex"),Go("column"),zo("gap",_H(_t.md))]),SH=Ls([ps("absolute"),Xo(Ts(7)),vs(Ts(8)),Bo(Ts(0)),zo("width","2px"),zo("background",_H(bt.borderSubtle))]),wH=Ls([ps("absolute"),Xo(Ts(-21)),vs(Ts(6)),zo("width","10px"),zo("height","10px"),zo("border-radius","50%"),zo("background",_H(bt.brand)),zo("border","2px solid var("+bt.surface+")"),Ko(0)]),EH=Ls([ps("relative"),qo("flex"),Go("column"),zo("gap","2px")]),kH=zs([EH,Ls([zo("background","none"),zo("border","none"),zo("padding","0"),ms("left"),$o("pointer"),Cs([zo("opacity","0.85")])])]),CH=Ls([qo("flex"),jo("center"),zo("gap",_H(_t.sm))]),AH=Ls([zo("color",_H(bt.textDisabled)),zo("font-size",_H(xt.sizeXs)),zo("font-family",_H(xt.fontFamilyMono))]),NH=Ls([zo("color",_H(bt.textPrimary)),zo("font-size",_H(xt.sizeMd)),zo("font-weight",_H(xt.weightMedium))]),TH=Ls([zo("color",_H(bt.textSecondary)),zo("font-size",_H(xt.sizeSm)),zo("line-height",_H(xt.lineHeightNormal)),ts(Ts(0))]);let RH=function(e){let t=e.onSelect,n=e=>r(o,{children:[i("div",{className:wH,style:z(e.accent,e=>({background:e}))}),r("div",{children:[i("span",{children:e.timestamp,className:AH}),L(e.variant,null,t=>i(Ia,{variant:t,label:e.label})),L(e.variant,i("span",{children:e.label,className:NH}),e=>null)],className:CH}),L(e.detail,null,e=>i("div",{children:e,className:TH}))]});return r("div",{children:[i("div",{className:SH}),e.entries.map(e=>void 0!==t?i("button",{children:n(e),className:kH,type:"button",onClick:n=>t(e.id)},e.id):i("div",{children:n(e),className:EH},e.id))],className:xH})};function DH(e){let t=0|new Date(e).getMonth();return U(Oc[t],"").slice(0,3)}function IH(e,t){switch(t){case"Days":return zc(e);case"Weeks":return Lc(e).toString()+" "+DH(e);case"Months":let t=new Date(e).getFullYear().toString();return DH(e)+" '"+t.slice(2)}}function FH(e,t,n){return n<=t?0:(e-t)/(n-t)*100}function OH(e){return e<0?0:e>100?100:e}function PH(e,t,n){let r=OH(FH(e.start,t,n)),i=OH(FH(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 MH(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 LH(e){return MH(e).filter(e=>e.violated)}let zH="184px";function jH(e){return"var("+e+")"}let UH=Ls([qo("flex"),Go("column"),zo("gap",jH(_t.sm))]),BH=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),Wo("wrap"),zo("gap",jH(_t.sm))]),$H=Ls([qo("inlineFlex"),jo("center"),zo("gap",jH(_t.xs))]),qH=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",jH(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",jH(bt.textSecondary)),zo("font-size",jH(xt.sizeSm)),$o("pointer"),Cs([zo("background",jH(bt.surfaceSubtle)),zo("color",jH(bt.textPrimary))])]),GH=zs([qH,Ls([zo("background",jH(bt.surfaceSubtle)),zo("color",jH(bt.textPrimary)),zo("font-weight",jH(xt.weightMedium))])]),VH=Ls([zo("font-size",jH(xt.sizeMd)),zo("font-weight",jH(xt.weightMedium)),zo("color",jH(bt.textPrimary))]),KH=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",jH(St.md)),zo("overflow","hidden")]),WH=Ls([qo("flex"),jo("stretch")]),HH=zs([WH,Ls([zo("background",jH(bt.surfaceSubtle)),zo("border-bottom","1px solid var("+bt.borderSubtle+")")])]),JH=Ls([zo("flex","0 0 "+zH),zo("padding","4px var("+_t.sm+")"),zo("font-size",jH(xt.sizeXs)),zo("color",jH(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),XH=Ls([ps("relative"),zo("flex","1 1 auto"),zo("height","22px"),zo("overflow","hidden")]),QH=Ls([ps("absolute"),zo("top","4px"),zo("padding-left","3px"),zo("border-left","1px solid var("+bt.borderSubtle+")"),zo("font-size",jH(xt.sizeXs)),zo("color",jH(bt.textSecondary)),zo("white-space","nowrap"),zo("pointer-events","none")]),YH=Ls([ps("relative")]),ZH=zs([WH,Ls([zo("height",30..toString()+"px"),zo("border-top","1px solid var("+bt.borderSubtle+")")])]),eJ=Ls([zo("flex","0 0 "+zH),qo("flex"),jo("center"),zo("gap","4px"),zo("padding","0 var("+_t.sm+")"),zo("font-size",jH(xt.sizeSm)),zo("color",jH(bt.textPrimary)),zo("border-right","1px solid var("+bt.borderSubtle+")"),zo("overflow","hidden")]),tJ=Ls([zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),nJ=Ls([zo("color",jH(bt.warning)),zo("font-size",jH(xt.sizeXs)),zo("flex","0 0 auto")]),rJ=Ls([ps("relative"),zo("flex","1 1 auto")]),iJ=Ls([ps("absolute"),zo("top","0"),zo("bottom","0"),zo("width","1px"),zo("background",jH(bt.borderSubtle)),zo("opacity","0.6"),zo("pointer-events","none")]);let oJ=Ls([zo("outline","2px solid var("+bt.warning+")"),zo("outline-offset","1px")]),sJ=Ls([ps("absolute"),zo("top","0"),zo("left",zH),zo("right","0"),zo("bottom","0"),zo("pointer-events","none")]),aJ=Ls([zo("display","block"),zo("width","100%"),zo("height","100%")]),lJ=Ls([zo("font-size",jH(xt.sizeXs)),zo("color",jH(bt.textDisabled))]),cJ="var("+bt.brand+")";function uJ(e){return(Math.round(100*e)/100).toString()}function dJ(e,t){let n=Ec(t,-1);return Pc(e)===Pc(n)?Pc(e):Pc(e)+" – "+Pc(n)}function fJ(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=PH(c,n,t),h=PH(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=OH((p+h)/2);d=[[p,g],[e,g],[e,m],[h,m]]}else{let e=OH(p+1.4),t=OH(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("+bt.warning+")":"var("+bt.border+")",b=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===b?"url(#"+v+")":void 0,stroke:y,strokeWidth:"1.5",x1:uJ(e[0])+"%",x2:uJ(n[0])+"%",y1:uJ(e[1]),y2:uJ(n[1])},t.toString()):null})})}let hJ=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[wc(n),Ec(wc(r),1)]}(o);if(void 0===f)return i(Ks,{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)/Uc;return n<=21?"Days":n<=120?"Weeks":"Months"}(g,p)),y=function(e,t,n){let r=t=>{switch(n){case"Days":return Ec(wc(e),t);case"Weeks":return Ec(Cc(e),7*t|0);case"Months":return kc(Ac(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,IH(e,n)]})}(g,p,v),b=MH(o),_=function(e){return ge(e,0,(t,n)=>t+n.dependsOn.filter(t=>!e.some(e=>e.key===t)).length|0)}(o),x=LH(o).length,S=(e,t)=>i("button",{children:t,className:v===e?GH:qH,onClick:t=>c(t=>e)}),w=0;if(void 0!==n||0!==_||0!==x?w=1:h=null,1===w){let e=me([n,_>0?_.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:lJ})}return r("div",{children:[r("div",{children:[i("span",{children:dJ(g,p),className:VH}),r("div",{children:[S("Days","Days"),S("Weeks","Weeks"),S("Months","Months")],className:$H})],className:BH}),r("div",{children:[r("div",{children:[i("div",{children:"Task",className:JH}),i("div",{children:y.map(e=>{let t=e[0];return i("span",{children:e[1],className:QH,style:{left:uJ(FH(t,g,p))+"%"}},t.toString())}),className:XH})],className:HH}),r("div",{children:[o.map(e=>{let t=PH(e,g,p),n=function(e,t){return LH(e).some(e=>e.to_===t)}(o,e.key),s=(a=U(e.accent,cJ),Ls([ps("absolute"),zo("top","5px"),zo("height",19..toString()+"px"),zo("border","none"),zo("border-radius",jH(St.sm)),zo("background",a),zo("padding","0"),$o("pointer"),Cs([zo("filter","brightness(1.12)")])]));var a;let l=n?s+" "+oJ:s;return r("div",{children:[r("div",{children:[n?i("span",{children:"▲",className:nJ,title:"Starts before a dependency ends"}):null,i("span",{children:e.title,className:tJ,title:e.title})],className:eJ}),r("div",{children:[y.map(e=>{let t=e[0];return i("div",{className:iJ,style:{left:uJ(FH(t,g,p))+"%"}},t.toString())}),i("button",{className:l,style:{left:uJ(t[0])+"%",width:uJ(t[1])+"%"},title:e.title+" · "+zc(e.start)+" → "+zc(e.end_),onClick:t=>e.onOpen()})],className:rJ})],className:ZH},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("+bt.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("+bt.warning+")"}),id:d,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"})]}),b.map(e=>i(fJ,{edge:e,tasks:o,from:g,to_:p,arrowId:u,arrowBadId:d},e.from+"->"+e.to_))],className:aJ}),className:sJ})],className:YH})],className:KH}),h],className:UH})};function pJ(e){return"var("+e+")"}let gJ=Ls([zo("overflow-x","auto")]),mJ=Ls([zo("border-collapse","collapse"),zo("font-size",pJ(xt.sizeSm)),zo("color",pJ(bt.textPrimary)),zo("min-width","min-content")]),vJ=[zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","right"),zo("white-space","nowrap")],yJ=Ls(vJ),bJ=Ls(vJ.concat([zo("color",pJ(bt.textDisabled))])),_J=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","left"),zo("color",pJ(bt.textSecondary)),zo("font-weight",pJ(xt.weightMedium)),zo("white-space","nowrap")]),xJ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","right"),zo("background",pJ(bt.surfaceSubtle)),zo("color",pJ(bt.textSecondary)),zo("font-weight",pJ(xt.weightMedium)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em"),zo("font-size",pJ(xt.sizeXs)),zo("white-space","nowrap")]),SJ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","left"),zo("background",pJ(bt.surfaceSubtle)),zo("color",pJ(bt.textPrimary)),zo("font-weight",pJ(xt.weightMedium)),zo("white-space","nowrap")]),wJ=Ls(vJ.concat([zo("font-weight",pJ(xt.weightMedium))])),EJ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("background",pJ(bt.surfaceSubtle)),zo("color",pJ(bt.textSecondary)),zo("font-weight",pJ(xt.weightMedium)),zo("white-space","nowrap")]),kJ="Total";let CJ=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:_J,scope:"col"}),s.map(e=>i("th",{children:e.label,className:xJ,scope:"col"},e.value)),i("th",{children:kJ,className:EJ,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:SJ,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?bJ:yJ},e.value)}),i("td",{children:U(n[t],""),className:wJ})]},e.value)})}),i("tfoot",{children:r("tr",{children:[i("th",{children:kJ,className:EJ,scope:"row"}),s.map((e,n)=>i("td",{children:U(t[n],""),className:wJ},e.value)),i("td",{children:e.grandTotal,className:wJ})]})})],className:mJ}),className:gJ})};let AJ=function(e){let t=e.label,n=e.size;return i(RR,{kind:"Media",size:void 0!==n?n:"Detail",label:void 0!==t?t:"No image"})};function NJ(e){return"var("+e+")"}let TJ=Ls([qo("grid"),zo("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),zo("gap",NJ(_t.md))]),RJ=Ls([qo("flex"),Go("column"),jo("stretch"),zo("gap",NJ(_t.xs)),zo("padding","0"),zo("background","none"),zo("border","none"),zo("text-align","left"),$o("pointer"),Cs([zo("opacity","0.88")])]),DJ=Ls([zo("width","100%"),zo("aspect-ratio","4 / 3"),zo("object-fit","cover"),zo("background",NJ(bt.surfaceSubtle)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",NJ(St.md))]),IJ=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",NJ(_t.sm))]),FJ=Ls([zo("color",NJ(bt.textPrimary)),zo("font-size",NJ(xt.sizeSm)),zo("font-weight",NJ(xt.weightMedium)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),OJ=Ls([zo("color",NJ(bt.textSecondary)),zo("font-size",NJ(xt.sizeXs)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),PJ=Ls([zo("background","rgba(255,255,255,0.12)"),zo("border","1px solid rgba(255,255,255,0.25)"),zo("border-radius",NJ(St.md)),zo("color","#f5f5f5"),zo("padding","4px var("+_t.sm+")"),zo("font-size",NJ(xt.sizeSm)),$o("pointer"),Cs([zo("background","rgba(255,255,255,0.22)")])]),MJ=Ls([zo("color",NJ(bt.textDisabled)),zo("font-size",NJ(xt.sizeSm))]);let LJ=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:MJ});if(void 0!==u){let e=j(n,e=>z(d[u],t=>i("button",{children:"Open record →",className:PJ,type:"button",onClick:n=>{c(e=>{}),e(t.key)}})));t=i(Sc,{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:DJ,alt:U(e.alt,e.title),src:t}):i(AJ,void 0!==o?{size:"Tile",label:"Add image"}:{size:"Tile"}),r("div",{children:[i("span",{children:e.title,className:FJ}),U(e.badge,null)],className:IJ}),void 0!==s?i("span",{children:s,className:OJ}):null],className:RJ,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:TJ}),t]})};const zJ="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function jJ(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function UJ(e){return"nodeType"in e}function BJ(e){var t,n;return e?jJ(e)?e:UJ(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function $J(e){const{Document:t}=BJ(e);return e instanceof t}function qJ(e){return!jJ(e)&&e instanceof BJ(e).HTMLElement}function GJ(e){return e instanceof BJ(e).SVGElement}function VJ(e){return e?jJ(e)?e.document:UJ(e)?$J(e)?e:qJ(e)||GJ(e)?e.ownerDocument:document:document:document}const KJ=zJ?v:a;function WJ(e){const t=h(e);return KJ(()=>{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 HJ(e,t){void 0===t&&(t=[e]);const n=h(e);return KJ(()=>{n.current!==e&&(n.current=e)},t),n}function JJ(e,t){const n=h();return p(()=>{const t=e(n.current);return n.current=t,t},[...t])}function XJ(e){const t=WJ(e),n=h(null),r=f(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function QJ(e){const t=h();return a(()=>{t.current=e},[e]),t.current}let YJ={};function ZJ(e,t){return p(()=>{if(t)return t;const n=null==YJ[e]?0:YJ[e]+1;return YJ[e]=n,e+"-"+n},[e,t])}function eX(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 tX=eX(1),nX=eX(-1);function rX(e){if(!e)return!1;const{KeyboardEvent:t}=BJ(e.target);return t&&e instanceof t}function iX(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=BJ(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 oX="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function sX(e){return e.matches(oX)?e:e.querySelector(oX)}const aX={display:"none"};function lX(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:aX},n)}function cX(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 uX=l(null);const dX={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 "},fX={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 hX(e){let{announcements:t=fX,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=dX}=e;const{announce:o,announcement:l}=function(){const[e,t]=s(""),n=f(e=>{null!=e&&t(e)},[]);return{announce:n,announcement:e}}(),c=ZJ("DndLiveRegion"),[u,h]=s(!1);if(a(()=>{h(!0)},[]),function(e){const t=d(uX);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(lX,{id:r,value:i.draggable}),y.createElement(cX,{id:c,announcement:l}));return n?w(g,n):g}var pX;function gX(){}function mX(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"}(pX||(pX={}));const vX=Object.freeze({x:0,y:0});function yX(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function bX(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 _X=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=bX(r,t);n>0&&i.push({id:e,data:{droppableContainer:o,value:n}})}}return i.sort(yX)};function xX(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:vX}function SX(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 wX=SX(1);const EX={ignoreTransform:!1};function kX(e,t){void 0===t&&(t=EX);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=BJ(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 CX(e){return kX(e,{ignoreTransform:!0})}function AX(e,t){const n=[];return e?function r(i){if(null!=t&&n.length>=t)return n;if(!i)return n;if($J(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!qJ(i)||GJ(i))return n;if(n.includes(i))return n;const o=BJ(e).getComputedStyle(i);return i!==e&&function(e,t){void 0===t&&(t=BJ(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=BJ(e).getComputedStyle(e)),"fixed"===t.position}(i,o)?n:r(i.parentNode)}(e):n}function NX(e){const[t]=AX(e,1);return null!=t?t:null}function TX(e){return zJ&&e?jJ(e)?e:UJ(e)?$J(e)||e===VJ(e).scrollingElement?window:qJ(e)?e:null:null:null}function RX(e){return jJ(e)?e.scrollX:e.scrollLeft}function DX(e){return jJ(e)?e.scrollY:e.scrollTop}function IX(e){return{x:RX(e),y:DX(e)}}var FX;function OX(e){return!(!zJ||!e)&&e===document.scrollingElement}function PX(e){const t={x:0,y:0},n=OX(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"}(FX||(FX={}));const MX={x:.2,y:.2};function LX(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===i&&(i=MX);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=PX(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=FX.Backward,p.y=r*Math.abs((t.top+g-o)/g)):!u&&l>=t.bottom-g&&(h.y=FX.Forward,p.y=r*Math.abs((t.bottom-g-l)/g)),!f&&a>=t.right-m?(h.x=FX.Forward,p.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=FX.Backward,p.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:p}}function zX(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 jX(e){return e.reduce((e,t)=>tX(e,IX(t)),vX)}const UX=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+RX(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+DX(t),0)}]];class BX{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=AX(t),r=jX(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,s]of UX)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 $X{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 qX(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 GX,VX;function KX(e){e.preventDefault()}function WX(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"}(GX||(GX={})),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"}(VX||(VX={}));const HX={start:[VX.Space,VX.Enter],cancel:[VX.Esc],end:[VX.Space,VX.Enter,VX.Tab]},JX=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case VX.Right:return{...n,x:n.x+25};case VX.Left:return{...n,x:n.x-25};case VX.Down:return{...n,y:n.y+25};case VX.Up:return{...n,y:n.y-25}}};class XX{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 $X(VJ(t)),this.windowListeners=new $X(BJ(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(GX.Resize,this.handleCancel),this.windowListeners.add(GX.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(GX.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=kX),!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(vX)}handleKeyDown(e){if(rX(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:i=HX,coordinateGetter:o=JX,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}:vX;this.referenceCoordinates||(this.referenceCoordinates=c);const u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=nX(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}=PX(n),h=zX(n),p={x:Math.min(i===VX.Right?h.right-h.width/2:h.right,Math.max(i===VX.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(i===VX.Down?h.bottom-h.height/2:h.bottom,Math.max(i===VX.Down?h.top:h.top+h.height/2,u.y))},g=i===VX.Right&&!a||i===VX.Left&&!l,m=i===VX.Down&&!c||i===VX.Up&&!o;if(g&&p.x!==u.x){const e=n.scrollLeft+t.x,o=i===VX.Right&&e<=d.x||i===VX.Left&&e>=f.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=o?n.scrollLeft-e:i===VX.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===VX.Down&&e<=d.y||i===VX.Up&&e>=f.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=o?n.scrollTop-e:i===VX.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,tX(nX(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 QX(e){return Boolean(e&&"distance"in e)}function YX(e){return Boolean(e&&"delay"in e)}XX.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=HX,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 ZX{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=BJ(e);return e instanceof t?e:VJ(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=VJ(o),this.documentListeners=new $X(this.document),this.listeners=new $X(n),this.windowListeners=new $X(BJ(o)),this.initialCoordinates=null!=(r=iX(i))?r:vX,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(GX.Resize,this.handleCancel),this.windowListeners.add(GX.DragStart,KX),this.windowListeners.add(GX.VisibilityChange,this.handleCancel),this.windowListeners.add(GX.ContextMenu,KX),this.documentListeners.add(GX.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(YX(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(QX(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(GX.Click,WX,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(GX.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=iX(e))?t:vX,l=nX(r,a);if(!n&&s){if(QX(s)){if(null!=s.tolerance&&qX(l,s.tolerance))return this.handleCancel();if(qX(l,s.distance))return this.handleStart()}return YX(s)&&qX(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===VX.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const eQ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tQ extends ZX{constructor(e){const{event:t}=e,n=VJ(t.target);super(e,eQ,n)}}tQ.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 nQ={move:{name:"mousemove"},end:{name:"mouseup"}};var rQ;!function(e){e[e.RightClick=2]="RightClick"}(rQ||(rQ={}));(class extends ZX{constructor(e){super(e,nQ,VJ(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==rQ.RightClick&&(null==r||r({event:n}),!0)}}];const iQ={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var oQ,sQ;function aQ(e){let{acceleration:t,activator:n=oQ.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:l=sQ.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:g,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const r=QJ(t);return JJ(e=>{if(n||!r||!e)return lQ;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[FX.Backward]:e.x[FX.Backward]||-1===i.x,[FX.Forward]:e.x[FX.Forward]||1===i.x},y:{[FX.Backward]:e.y[FX.Backward]||-1===i.y,[FX.Forward]:e.y[FX.Forward]||1===i.y}}},[n,t,r])}({delta:g,disabled:!o}),[y,b]=function(){const e=h(null);return[f((t,n)=>{e.current=setInterval(t,n)},[]),f(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),_=h({x:0,y:0}),x=h({x:0,y:0}),S=p(()=>{switch(n){case oQ.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case oQ.DraggableRect:return i}},[n,i,c]),w=h(null),E=f(()=>{const e=w.current;if(!e)return;const t=_.current.x*x.current.x,n=_.current.y*x.current.y;e.scrollBy(t,n)},[]),k=p(()=>l===sQ.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}=LX(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 b(),w.current=e,y(E,s),_.current=a,void(x.current=o)}_.current={x:0,y:0},x.current={x:0,y:0},b()}else b()},[t,E,r,b,o,s,JSON.stringify(S),JSON.stringify(v),y,u,k,d,JSON.stringify(m)])}(class extends ZX{constructor(e){super(e,iQ)}static setup(){return window.addEventListener(iQ.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(iQ.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"}(oQ||(oQ={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(sQ||(sQ={}));const lQ={x:{[FX.Backward]:!1,[FX.Forward]:!1},y:{[FX.Backward]:!1,[FX.Forward]:!1}};var cQ,uQ;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(cQ||(cQ={})),function(e){e.Optimized="optimized"}(uQ||(uQ={}));const dQ=new Map;function fQ(e,t){return JJ(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function hQ(e){let{callback:t,disabled:n}=e;const r=WJ(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 pQ(e){return new BX(kX(e),e)}function gQ(e,t,n){void 0===t&&(t=pQ);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=WJ(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=hQ({callback:o});return KJ(()=>{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 mQ=[];function vQ(e,t){void 0===t&&(t=[]);const n=h(null);return a(()=>{n.current=null},t),a(()=>{const t=e!==vX;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?nX(e,n.current):vX}function yQ(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 bQ=[];function _Q(e){let{measure:t}=e;const[n,r]=s(null),i=f(e=>{for(const{target:n}of e)if(qJ(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t]),o=hQ({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 qJ(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,c]=XJ(a);return p(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const xQ=[{sensor:tQ,options:{}},{sensor:XX,options:{}}],SQ={current:{}},wQ={draggable:{measure:CX},droppable:{measure:CX,strategy:cQ.WhileDragging,frequency:uQ.Optimized},dragOverlay:{measure:kX}};class EQ 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 kQ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new EQ,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:gX},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wQ,measureDroppableContainers:gX,windowRect:null,measuringScheduled:!1},CQ=l({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:gX,draggableNodes:new Map,over:null,measureDroppableContainers:gX}),AQ=l(kQ);function NQ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new EQ}}}function TQ(e,t){switch(t.type){case pX.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case pX.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 pX.DragEnd:case pX.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pX.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new EQ(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case pX.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 EQ(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case pX.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new EQ(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function RQ(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=d(CQ),o=QJ(r),s=QJ(null==n?void 0:n.id);return a(()=>{if(!t&&!r&&o&&null!=s){if(!rX(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=sX(e);if(t){t.focus();break}}})}},[r,t,i,s,o]),null}const DQ=l({...vX,scaleX:1,scaleY:1});var IQ;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(IQ||(IQ={}));const FQ=b(function(e){var t,n,r,i;let{id:o,accessibility:l,autoScroll:c=!0,children:u,sensors:d=xQ,collisionDetection:g=_X,measuring:m,modifiers:v,...b}=e;const x=_(TQ,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(IQ.Uninitialized),T=A===IQ.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:SQ,rect:P}:null},[R,O]),L=h(null),[z,j]=s(null),[U,B]=s(null),$=HJ(b,Object.values(b)),q=ZJ("DndDescribedBy",o),G=p(()=>F.getEnabled(),[F]),V=function(e){return p(()=>({draggable:{...wQ.draggable,...null==e?void 0:e.draggable},droppable:{...wQ.droppable,...null==e?void 0:e.droppable},dragOverlay:{...wQ.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 cQ.Always:return!1;case cQ.BeforeDragging:return n;default:return!n}}(),m=HJ(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),b=JJ(t=>{if(g&&!n)return dQ;if(!t||t===dQ||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 BX(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:b,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 JJ(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(D,R),X=p(()=>U?iX(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 fQ(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;KJ(()=>{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=xX(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=gQ(J,V.draggable.measure,Y),ee=gQ(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=_Q({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=xX(le=se?null:Z,fQ(le));var le;const ce=yQ(ie?BJ(ie):null),ue=function(e){const t=h(e),n=JJ(n=>e?n&&n!==mQ&&e&&t.current&&e.parentNode===t.current.parentNode?n:AX(e):mQ,[e]);return a(()=>{t.current=e},[e]),n}(T?null!=ne?ne:J:null),de=function(e,t){void 0===t&&(t=kX);const[n]=e,r=yQ(n?BJ(n):null),[i,o]=s(bQ);function a(){o(()=>e.length?e.map(e=>OX(e)?r:new BX(t(e),e)):bQ)}const l=hQ({callback:a});return KJ(()=>{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?tX(X,I):null,pe=function(e){const[t,n]=s(null),r=h(e),i=f(e=>{const t=TX(e.target);t&&n(e=>e?(e.set(t,IX(t)),new Map(e)):null)},[]);return a(()=>{const t=r.current;if(e!==t){o(t);const s=e.map(e=>{const t=TX(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,IX(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=TX(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),p(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>tX(e,t),vX):jX(e):vX,[e,t])}(ue),ge=vQ(pe),me=vQ(pe,[Z]),ve=tX(fe,ge),ye=oe?wX(oe,fe):null,be=M&&ye?g({active:M,collisionRect:ye,droppableRects:K,droppableContainers:G,pointerCoordinates:he}):null,_e=function(e,t){if(!e||0===e.length)return null;const[n]=e;return n[t]}(be,"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:tX(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(IQ.Initializing),w({type:pX.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:i}),j(Ee.current),B(o)})},onMove(e){w({type:pX.DragMove,coordinates:e})},onEnd:a(pX.DragEnd),onCancel:a(pX.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===pX.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=pX.DragCancel)}}L.current=null,E(()=>{w({type:e}),N(IQ.Uninitialized),Se(null),j(null),B(null),Ee.current=null;const t=e===pX.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(!zJ)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),KJ(()=>{Z&&A===IQ.Initializing&&N(IQ.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(_e),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})})},[_e]),KJ(()=>{te.current={activatorEvent:U,active:M,activeNode:J,collisionRect:ye,collisions:be,droppableRects:K,draggableNodes:D,draggingNode:ie,draggingNodeRect:oe,droppableContainers:F,over:xe,scrollableAncestors:ue,scrollAdjustedTranslate:ve},P.current={initial:oe,translated:ye}},[M,J,be,ye,D,ie,oe,K,F,xe,ue,ve]),aQ({...Q,delta:I,draggingRect:ye,pointerCoordinates:he,scrollableAncestors:ue,scrollableAncestorRects:de});const Ne=p(()=>({active:M,activeNode:J,activeNodeRect:Z,activatorEvent:U,collisions:be,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,be,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(uX.Provider,{value:C},y.createElement(CQ.Provider,{value:Te},y.createElement(AQ.Provider,{value:Ne},y.createElement(DQ.Provider,{value:we},u)),y.createElement(RQ,{disabled:!1===(null==l?void 0:l.restoreFocus)})),y.createElement(hX,{...l,hiddenTextDescribedById:q}))}),OQ=l(null),PQ="button";function MQ(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=ZJ("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:h}=d(CQ),{role:g=PQ,roleDescription:m="draggable",tabIndex:v=0}=null!=i?i:{},y=(null==l?void 0:l.id)===t,b=d(y?DQ:OQ),[_,x]=XJ(),[S,w]=XJ(),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=HJ(n);KJ(()=>(f.set(t,{id:t,key:o,node:_,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!==PQ)||void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,g,v,y,m,u.draggable]),isDragging:y,listeners:r?void 0:E,node:_,over:h,setNodeRef:x,setActivatorNodeRef:w,transform:b}}const LQ={timeout:25};function zQ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=ZJ("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:u}=d(CQ),p=h({disabled:n}),g=h(!1),m=h(null),v=h(null),{disabled:y,updateMeasurementsFor:b,timeout:_}={...LQ,...i},x=HJ(null!=b?b:r),S=hQ({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},_)):g.current=!0},[_]),disabled:y||!s}),w=f((e,t)=>{S&&(t&&(S.unobserve(t),g.current=!1),e&&S.observe(e))},[S]),[E,k]=XJ(w),C=HJ(t);return a(()=>{S&&E.current&&(S.disconnect(),g.current=!1,S.observe(E.current))},[E,S]),a(()=>(l({type:pX.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:m,data:C}}),()=>l({type:pX.UnregisterDroppable,key:o,id:r})),[r]),a(()=>{n!==p.current.disabled&&(l({type:pX.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 jQ(e,t){M(R(e.onPointerDown),e=>e(t))}function UQ(e,t){M(R(e.onKeyDown),e=>e(t))}function BQ(e){return z(null==e?void 0:T(e),e=>"translate3d("+e.x.toString()+"px, "+e.y.toString()+"px, 0)")}function $Q(e){return"var("+e+")"}let qQ=Ls([ps("relative"),qo("inlineBlock")]),GQ=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",$Q(St.sm)),zo("cursor","pointer"),zo("color",$Q(bt.textSecondary)),zo("padding","2px var("+_t.sm+")"),zo("font-size",$Q(xt.sizeSm)),Cs([zo("background",$Q(bt.surfaceSubtle)),zo("color",$Q(bt.textPrimary))])]),VQ=Ls([ps("absolute"),gs(Ts(0)),vs({NAME:"percent",VAL:100}),rs(Ts(4)),zo("background",$Q(bt.surfaceElevated)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",$Q(St.md)),zo("box-shadow",$Q(Et)),zo("min-width","160px"),zo("z-index","200"),zo("overflow","hidden"),hs(Ts(4),Ts(0))]),KQ=Ls([zo("margin-left",$Q(_t.sm)),zo("font-size",$Q(xt.sizeSm)),zo("white-space","nowrap")]);let WQ=Ls([zo("border","none"),zo("border-top","1px solid var("+bt.borderSubtle+")"),es(Ts(4),Ts(0))]);let HQ=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:GQ,onClick:e=>{e.stopPropagation(),l(e=>!e)}}),c?i("div",{children:e.items.map((e,t)=>{if("object"!=typeof e)return i("hr",{className:WQ},t.toString());let n=e.trailing,o=e.onClick,s=e.label;return r("button",{children:[i("span",{children:s}),void 0!==n?i("span",{children:"→ "+n,className:KQ,style:z(e.trailingColour,e=>({color:e}))}):null],className:(a=e.danger,Ls([qo("flex"),jo("center"),Jo("spaceBetween"),bs({NAME:"percent",VAL:100}),zo("background","none"),zo("border","none"),zo("text-align","left"),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("font-size",$Q(xt.sizeMd)),zo("color",$Q(a?bt.error:bt.textPrimary)),$o("pointer"),Cs([zo("background",$Q(bt.surfaceSubtle))])])),onClick:e=>{l(e=>!1),o()}},s);var a}),className:VQ,onClick:e=>{e.stopPropagation()}}):null],className:qQ})},JQ=[{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"}],XQ={bg:"#e2e8f0",border:"#64748b",fg:"#1e293b"};function QQ(e,t){let n=e.indexOf(t);return-1!==n?function(e){return e<0?XQ:JQ[fe(e,JQ.length)]}(n):XQ}let YQ={bg:"#dbeafe",border:"#2563eb",fg:"#1e3a8a"};function ZQ(e){return"var("+e+")"}let eY=[qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("font-size",ZQ(xt.sizeXs)),zo("font-weight",ZQ(xt.weightMedium)),zo("line-height","1.5"),zo("white-space","nowrap")];function tY(e,t){return Ls(eY.concat([zo("background",e.bg),zo("border","1px solid "+e.border),zo("color",e.fg)]).concat(t))}function nY(e){return tY(e,[zo("padding","2px 8px"),zo("border-radius",ZQ(St.full))])}let rY=tY(YQ,[zo("padding","2px 8px"),zo("border-radius",ZQ(St.sm))]),iY=Ls(eY.concat([zo("padding","2px 0"),zo("color",ZQ(bt.textSecondary)),zo("font-weight",ZQ(xt.weightNormal)),zo("font-style","italic"),zo("border-bottom","1px dashed var("+bt.border+")")]));let oY={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:nY(n)});var o}};let sY={make:function(e){return i("span",{children:e.label,className:rY})}};let aY={make:function(e){let t=e.label;return i("span",{children:t,className:iY,title:t+" — run by the platform, not callable"})}};function lY(e){return"var("+e+")"}let cY=Ls([qo("flex"),jo("stretch"),zo("gap",lY(_t.md)),zo("overflow-x","auto"),zo("padding-bottom",lY(_t.sm))]),uY=[qo("flex"),Go("column"),zo("gap",lY(_t.sm)),zo("flex","0 0 240px"),zo("padding",lY(_t.sm)),zo("background",lY(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",lY(St.md)),zo("min-height","120px")],dY=Ls(uY);let fY=Ls([zo("border-color",lY(bt.brand))]),hY=Ls([cs(.45)]),pY=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",lY(_t.sm)),zo("font-size",lY(xt.sizeSm)),zo("font-weight",lY(xt.weightMedium)),zo("color",lY(bt.textSecondary))]),gY=Ls([zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),mY=Ls([qo("flex"),Go("column"),jo("stretch"),zo("gap","4px"),zo("padding",lY(_t.sm)),zo("background",lY(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",lY(St.sm)),zo("text-align","left"),$o("pointer"),Cs([zo("border-color",lY(bt.brand))])]),vY=Ls([$o("grab")]),yY=Ls([cs(.85),zo("z-index","10"),$o("grabbing")]),bY=Ls([qo("flex"),jo("flexStart"),Jo("spaceBetween"),zo("gap",lY(_t.xs))]),_Y=Ls([zo("font-size",lY(xt.sizeSm)),zo("font-weight",lY(xt.weightMedium)),zo("color",lY(bt.textPrimary))]),xY=Ls([zo("font-size",lY(xt.sizeXs)),zo("color",lY(bt.textSecondary)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),SY=Ls([zo("color",lY(bt.textDisabled)),zo("font-size",lY(xt.sizeSm))]);function wY(e){let t=e.onClick,n=e.draggable,o=e.card,s=MQ({id:o.key,disabled:!n}),a=n?mY+" "+vY:mY,l=s.isDragging?a+" "+yY:a,c=BQ(s.transform),u=void 0!==c?{transform:c}:void 0,d=s.listeners,f=null==d?void 0:T(d),h=o.actions,p=o.meta;return r("div",{children:[r("div",{children:[i("span",{children:o.title,className:_Y}),void 0!==h&&0!==h.length?i("div",{children:i(HQ,{items:h}),onClick:e=>{e.stopPropagation()},onPointerDown:e=>{e.stopPropagation()}}):null],className:bY}),void 0!==p?i("span",{children:p,className:xY,title:p}):null],ref:T(s.setNodeRef),className:l,role:"button",style:u,tabIndex:0,onKeyDown:e=>M(f,t=>UQ(t,e)),onClick:e=>M(t,e=>e(o.key)),onPointerDown:e=>M(f,t=>jQ(t,e))})}function EY(e){let t=e.accepts,n=e.onCardClick,o=e.draggable,s=e.column,a=void 0===t||t,l=zQ({id:s.value,disabled:!a}),c=s.swatch,u=void 0!==c?function(e){return Ls(uY.concat([zo("border-top","3px solid "+e.border)]))}(c):dY,d=l.isOver,f=a?d?u+" "+fY:u:u+" "+hY,h=s.swatch;return r("div",{children:[r("div",{children:[void 0!==h?i(oY.make,{swatch:h,label:s.label}):i("span",{children:s.label,className:gY}),i(Ga,{count:s.cards.length,label:""})],className:pY}),0===s.cards.length?i("span",{children:"—",className:SY}):s.cards.map(e=>i(wY,{card:e,draggable:o,onClick:n},e.key))],ref:T(l.setNodeRef),className:f})}let kY=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])}(mX(tQ,{activationConstraint:{distance:5}}),mX(XX,{})),c=s(()=>{}),u=c[1],d=c[0],f=e=>void 0===t||void 0===d||t(d,e.value);return i(FQ,{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(EY,{column:e,draggable:a,onCardClick:r,accepts:f(e)},e.value)),className:cY})})};function CY(e){return"var("+e+")"}let AY=Ls([qo("flex"),Go("column"),zo("gap",CY(_t.sm))]),NY=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",CY(_t.sm))]),TY=Ls([qo("inlineFlex"),jo("center"),zo("gap",CY(_t.xs))]),RY=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",CY(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",CY(bt.textSecondary)),zo("font-size",CY(xt.sizeSm)),$o("pointer"),Cs([zo("background",CY(bt.surfaceSubtle)),zo("color",CY(bt.textPrimary))])]),DY=zs([RY,Ls([zo("background",CY(bt.surfaceSubtle)),zo("color",CY(bt.textPrimary)),zo("font-weight",CY(xt.weightMedium))])]),IY=Ls([zo("font-size",CY(xt.sizeMd)),zo("font-weight",CY(xt.weightMedium)),zo("color",CY(bt.textPrimary))]),FY=Ls([qo("grid"),zo("grid-template-columns","repeat(7, 1fr)"),zo("gap","1px")]),OY=Ls([zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em"),zo("padding","2px var("+_t.xs+")")]),PY=Ls([qo("grid"),zo("grid-template-columns","repeat(7, 1fr)"),zo("gap","1px"),zo("background",CY(bt.borderSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",CY(St.md)),zo("overflow","hidden")]),MY=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-height","96px"),zo("padding","4px"),zo("background",CY(bt.surface))]),LY=zs([MY,Ls([zo("opacity","0.55")])]),zY=Ls([zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.textSecondary))]),jY=zs([zY,Ls([zo("color",CY(bt.brand)),zo("font-weight",CY(xt.weightMedium))])]);let UY=Ls([zo("background","none"),zo("border","none"),zo("padding","0"),zo("text-align","left"),zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.brand)),$o("pointer"),Cs([zo("text-decoration","underline")])]);let BY=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-height","200px"),zo("padding","4px"),zo("background",CY(bt.surface))]),$Y=Ls([zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.textSecondary)),zo("padding-bottom","2px"),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]),qY=Ls([qo("flex"),Wo("wrap"),jo("center"),zo("gap",CY(_t.md)),zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.textSecondary))]);let GY=Ls([zo("font-size",CY(xt.sizeXs)),zo("color",CY(bt.textDisabled))]),VY="var("+bt.brand+")";function KY(e,t){return e.filter(e=>Rc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function WY(e,t){return Fc(e.start)||!Nc(e.start,t)?e.title:Ic(e.start)+" "+e.title}let HY=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(()=>wc(U(a,Date.now()))),m=g[1],v=g[0],y=wc(Date.now()),b=e=>m(t=>{switch(p){case"Month":return kc(t,e);case"Week":return Ec(t,7*e|0);case"Day":return Ec(t,e)}}),_=(e,t)=>{return i("button",{children:WY(e,t),className:(n=U(e.accent,VY),Ls([qo("block"),zo("width","100%"),zo("text-align","left"),zo("border","none"),zo("border-left","3px solid "+n),zo("border-radius",CY(St.sm)),zo("background",CY(bt.surfaceSubtle)),zo("color",CY(bt.textPrimary)),zo("font-size",CY(xt.sizeXs)),zo("padding","1px var("+_t.xs+")"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap"),$o("pointer"),Cs([zo("background",CY(bt.surfaceElevated))])])),title:e.title,onClick:t=>e.onOpen()},e.key);var n},x=()=>{let e=function(e){let t=Cc(Ac(e));return pe(42,e=>Ec(t,e))}(v);return r(o,{children:[i("div",{children:Mc.map(e=>i("div",{children:e,className:OY},e)),className:FY}),i("div",{children:e.map(e=>{let t=KY(u,e),n=t.slice(0,3),o=t.length-n.length|0;return r("div",{children:[i("span",{children:Lc(e).toString(),className:e===y?jY:zY}),n.map(t=>_(t,e)),o>0?i("button",{children:"+"+o.toString()+" more",className:UY,onClick:t=>{m(t=>e),h(e=>"Day")}}):null],className:Tc(e,v)?MY:LY},e.toString())}),className:PY})]})},S=e=>{return i("div",{children:e.map(e=>r("div",{children:[i("div",{children:zc(e),className:$Y}),KY(u,e).map(t=>_(t,e))],className:BY},e.toString())),className:(t=e.length,Ls([qo("grid"),zo("grid-template-columns","repeat("+t.toString()+", 1fr)"),zo("gap","1px"),zo("background",CY(bt.borderSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",CY(St.md)),zo("overflow","hidden")]))});var t};switch(p){case"Month":t=x();break;case"Week":t=S(pe(7,e=>Ec(Cc(v),e)));break;case"Day":t=S([wc(v)])}switch(p){case"Month":case"Week":n=Pc(v);break;case"Day":n=zc(v)+" — "+Pc(v)}let w=(e,t)=>i("button",{children:t,className:p===e?DY:RY,onClick:t=>h(t=>e)});return r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:RY,onClick:e=>b(-1)}),i("button",{children:"Today",className:RY,onClick:e=>m(e=>y)}),i("button",{children:"›",className:RY,onClick:e=>b(1)}),i("span",{children:n,className:IY})],className:TY}),r("div",{children:[w("Month","Month"),w("Week","Week"),w("Day","Day")],className:TY})],className:NY}),0!==d.length?i("div",{children:d.map(e=>{return r("span",{children:[i("span",{className:(t=e.accent,Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",t),zo("margin-right","4px")]))}),e.label]},e.label);var t}),className:qY}):null,t,void 0!==l?i("span",{children:l,className:GY}):null],className:AY})};function JY(e){return"var("+e+")"}let XY=Ls([qo("grid"),zo("grid-template-columns","repeat(auto-fill, minmax(220px, 1fr))"),zo("gap",JY(_t.md))]),QY=Ls([qo("flex"),Go("column"),jo("stretch"),zo("gap",JY(_t.sm)),zo("padding",JY(_t.md)),zo("background",JY(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",JY(St.md)),zo("text-align","left"),Cs([zo("border-color",JY(bt.brand)),zo("background",JY(bt.surfaceSubtle))])]),YY=Ls([qo("flex"),Go("column"),jo("stretch"),zo("gap",JY(_t.sm)),zo("background","none"),zo("border","none"),zo("padding","0"),zo("font","inherit"),zo("color","inherit"),zo("text-align","left"),$o("pointer")]),ZY=Ls([qo("flex"),Wo("wrap"),zo("gap","4px")]),eZ=Ls([zo("background",JY(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",JY(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",JY(bt.textPrimary)),zo("font-size",JY(xt.sizeSm)),$o("pointer"),Cs([zo("border-color",JY(bt.brand)),zo("color",JY(bt.brand))])]),tZ=Ls([zo("width","100%"),zo("height","96px"),zo("object-fit","cover"),zo("border-radius",JY(St.sm))]),nZ=Ls([zo("width","100%"),zo("height","96px")]),rZ=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",JY(_t.sm))]),iZ=Ls([zo("font-size",JY(xt.sizeMd)),zo("font-weight",JY(xt.weightMedium)),zo("color",JY(bt.textPrimary)),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),oZ=Ls([qo("flex"),jo("baseline"),zo("gap",JY(_t.sm)),zo("font-size",JY(xt.sizeSm))]),sZ=Ls([zo("color",JY(bt.textSecondary)),zo("white-space","nowrap"),Ko(0)]),aZ=Ls([zo("color",JY(bt.textPrimary)),zo("min-width","0"),zo("overflow","hidden"),zo("text-overflow","ellipsis")]),lZ=Ls([zo("color",JY(bt.textDisabled)),zo("font-size",JY(xt.sizeSm))]);let cZ=function(e){let t=e.cards;if(0===t.length)return i("span",{children:"(empty)",className:lZ});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(AJ,{size:"Fill"}),className:nZ}):i("img",{className:tZ,alt:o.alt,src:o.src}):null;let s=e.actions;return r("div",{children:[r("button",{children:[t,r("div",{children:[i("span",{children:e.title,className:iZ,title:e.title}),U(e.badge,null)],className:rZ}),e.fields.map(e=>r("div",{children:[i("span",{children:e.label,className:sZ}),i("span",{children:e.value,className:aZ})],className:oZ},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:eZ,onClick:t=>e.onClick()},e.label)),className:ZY}):null],className:QY},e.key)}),className:XY})};function uZ(e){return"var("+e+")"}let dZ=Ls([zo("overflow-x","auto")]),fZ=Ls([zo("border-collapse","collapse"),zo("font-size",uZ(xt.sizeSm)),zo("color",uZ(bt.textPrimary)),zo("min-width","min-content")]),hZ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","center"),zo("white-space","nowrap")]),pZ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","left"),zo("color",uZ(bt.textSecondary)),zo("font-weight",uZ(xt.weightMedium)),zo("white-space","nowrap")]),gZ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","center"),zo("background",uZ(bt.surfaceSubtle)),zo("color",uZ(bt.textSecondary)),zo("font-weight",uZ(xt.weightMedium)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em"),zo("font-size",uZ(xt.sizeXs)),zo("white-space","nowrap")]),mZ=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("padding","4px var("+_t.sm+")"),zo("text-align","left"),zo("background",uZ(bt.surfaceSubtle)),zo("color",uZ(bt.textPrimary)),zo("font-weight",uZ(xt.weightMedium)),zo("white-space","nowrap")]),vZ=[qo("inlineFlex"),jo("center"),zo("width","34px"),zo("height","18px"),zo("padding","2px"),zo("border","1px solid var("+bt.border+")"),zo("border-radius","999px"),zo("transition","background 120ms ease")],yZ=Ls(vZ.concat([zo("background",uZ(bt.surfaceSubtle)),zo("justify-content","flex-start"),$o("pointer")])),bZ=Ls(vZ.concat([zo("background",uZ(bt.brand)),zo("border-color",uZ(bt.brand)),zo("justify-content","flex-end"),$o("pointer")])),_Z=Ls(vZ.concat([zo("background","transparent"),zo("border-style","dashed"),zo("justify-content","center"),$o("notAllowed")])),xZ=Ls([zo("width","12px"),zo("height","12px"),zo("border-radius","999px"),zo("background",uZ(bt.surface)),zo("box-shadow","0 1px 2px rgba(0, 0, 0, 0.25)")]),SZ=zs([xZ,Ls([zo("opacity","0.5")])]),wZ=Ls([zo("color",uZ(bt.textSecondary))]),EZ=Ls([zo("color",uZ(bt.textDisabled))]),kZ=Ls([zo("color",uZ(bt.textSecondary)),zo("font-size",uZ(xt.sizeXs)),zo("padding-bottom",uZ(_t.xs)),zo("text-align","left")]);let CZ=function(e){let t=e.caption,n=e.onToggle,o=e.cells,s=e.colHeaders,a=e.rowHeaders,l=(e,t)=>L(e.find(e=>e.value===t),t,e=>e.label),c=e=>{let t,r=function(e,t,n){let r;if("object"!=typeof n)switch(n){case"On":r="on";break;case"Off":r="off";break;case"Unavailable":r="unavailable";break;case"Absent":r="not set"}else r=n._0?"turning on":"turning off";return e+" · "+t+" — "+r}(l(a,e.rowValue),l(s,e.colValue),e.state),o=e.state,c=e.reason;t="object"!=typeof o&&"Unavailable"===o&&void 0!==c?r+" — "+c:r;let u,d=e.state,f=0;if(void 0!==n){let o=0;if("object"!=typeof d)switch(d){case"Unavailable":f=2;break;case"Absent":break;default:o=3}else o=3;if(3===o){let o;o="object"!=typeof d?["On"===d,!0]:[d._0,!1];let s=o[1],a=o[0];return i("button",{children:i("span",{className:s?xZ:SZ}),"aria-label":r,"aria-checked":a?"true":"false",className:a?bZ:yZ,role:"switch",title:t,disabled:!s,type:"button",onClick:t=>n(e.rowValue,e.colValue,!a)})}}else f=2;if(2===f&&"object"!=typeof d&&"Unavailable"===d)return i("span",{"aria-label":r,className:_Z,title:t});if("object"!=typeof d)switch(d){case"On":u="✓";break;case"Off":u="·";break;case"Unavailable":case"Absent":u="—"}else u="…";return i("span",{children:u,"aria-label":r,className:"On"===d?wZ:EZ,title:t})};return i("div",{children:r("table",{children:[void 0!==t?i("caption",{children:t,className:kZ}):null,i("thead",{children:r("tr",{children:[i("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:pZ,scope:"col"}),s.map(e=>i("th",{children:e.label,className:gZ,scope:"col"},e.value))]})}),i("tbody",{children:a.map((e,t)=>{let n=U(o[t],[]);return r("tr",{children:[i("th",{children:e.label,className:mZ,scope:"row"}),s.map((e,t)=>{let r=n[t];return i("td",{children:void 0!==r?c(r):null,className:hZ},e.value)})]},e.value)})})],className:fZ}),className:dZ})};function AZ(e){return"var("+e+")"}let NZ=Ls([zo("font-family",AZ(xt.fontFamilyMono)),zo("font-size",AZ(xt.sizeSm)),zo("line-height",AZ(xt.lineHeightNormal)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",AZ(St.md)),us("auto")]),TZ=Ls([qo("flex"),zo("padding","1px var("+_t.md+")")]),RZ=Ls([zo("background","rgba(248,81,73,0.12)"),zo("color",AZ(bt.error))]),DZ=Ls([zo("background","rgba(63,185,80,0.12)"),zo("color",AZ(bt.success))]),IZ=Ls([zo("color",AZ(bt.textSecondary))]),FZ=Ls([zo("width","16px"),Ko(0),zo("user-select","none"),ns(Ts(8))]);let OZ=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=[TZ+" "+RZ,"-"];break;case"Added":n=[TZ+" "+DZ,"+"];break;case"Unchanged":n=[TZ+" "+IZ," "]}return r("div",{children:[i("span",{children:n[1],className:FZ}),i("span",{children:e.text})],className:n[0]},t.toString())}),className:NZ})};function PZ(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 MZ(e){return"var("+e+")"}let LZ=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("font-family",MZ(xt.fontFamily)),zo("font-size",MZ(xt.sizeSm))]),zZ=Ls([qo("flex"),jo("flexStart"),zo("gap","10px"),zo("padding",MZ(_t.xs)+" "+MZ(_t.sm)),zo("border-radius",MZ(St.sm))]),jZ=Ls([$o("pointer"),Cs([zo("background",MZ(bt.surfaceSubtle))])]),UZ=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-width","0"),zo("flex","1")]),BZ=Ls([zo("color",MZ(bt.textPrimary))]),$Z=Ls([zo("font-weight",MZ(xt.weightMedium))]),qZ=Ls([zo("color",MZ(bt.textSecondary))]),GZ=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px"),zo("color",MZ(bt.textSecondary)),zo("font-size",MZ(xt.sizeXs)),zo("white-space","nowrap")]),VZ=Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("flex-shrink","0")]),KZ=Ls([zo("background","none"),zo("border","none"),zo("padding","0"),zo("color",MZ(bt.brand)),zo("font-size",MZ(xt.sizeXs)),$o("pointer"),zo("text-align","left"),Cs([zo("text-decoration","underline")])]),WZ=Ls([zo("margin-top","4px"),zo("max-width","560px")]),HZ=Ls([zo("color",MZ(bt.textSecondary)),zo("padding",MZ(_t.md)),ms("center")]);function JZ(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?zZ+" "+jZ:zZ,f=n.actor,h=n.accent,p=n.timestamp;return r("div",{children:[i(xa,{name:u,src:n.actorImageUrl,size:"Medium"}),r("div",{children:[r("span",{children:[void 0!==f?i("span",{children:f+" ",className:$Z}):null,i("span",{children:n.verb+" ",className:qZ}),n.subject],className:BZ}),r("span",{children:[void 0!==h?i("span",{className:VZ,style:{background:h}}):null,void 0!==p?PZ(e.nowMs,p):null],className:GZ}),c?i("button",{children:l?"Hide changes":"Show changes",className:KZ,onClick:e=>{e.stopPropagation(),a(e=>!e)}}):null,l&&c?i("div",{children:i(OZ,{before:U(n.before,""),after:U(n.after,"")}),className:WZ}):null],className:UZ})],className:d,onClick:e=>M(t,e=>e(n))})}let XZ=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:HZ}):i("div",{children:o.map(e=>i(JZ,{entry:e,nowMs:a,onClick:n},e.id)),className:LZ})};function QZ(e){return"var("+e+")"}let YZ=Ls([qo("flex"),jo("flexStart"),zo("gap","0"),zo("width","100%")]),ZZ=Ls([qo("flex"),Go("column"),jo("center"),zo("gap","4px"),zo("flex","0 0 auto")]);let e0=[qo("inlineFlex"),jo("center"),Jo("center"),zo("width","24px"),zo("height","24px"),zo("border-radius","50%"),zo("font-size",QZ(xt.sizeXs)),zo("font-weight",QZ(xt.weightMedium)),zo("box-sizing","border-box")],t0=Ls(e0.concat([zo("background",QZ(bt.brand)),zo("color","#fff")])),n0=Ls(e0.concat([zo("background",QZ(bt.surface)),zo("color",QZ(bt.brand)),zo("border","2px solid var("+bt.brand+")")])),r0=Ls(e0.concat([zo("background",QZ(bt.surface)),zo("color",QZ(bt.textDisabled)),zo("border","1px solid var("+bt.border+")")])),i0=[zo("font-size",QZ(xt.sizeXs)),zo("text-align","center"),zo("max-width","96px")],o0=Ls(i0.concat([zo("color",QZ(bt.textPrimary))])),s0=Ls(i0.concat([zo("color",QZ(bt.textDisabled))])),a0=Ls([zo("display","none")]);function l0(e){switch(e){case"Done":return t0;case"Current":return n0;case"Upcoming":return r0}}function c0(e,t){switch(e){case"Done":return"✓";case"Current":case"Upcoming":return(t+1|0).toString()}}let u0=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,Ls([zo("flex","1 1 auto"),zo("height","2px"),zo("margin","0 6px"),zo("margin-top","11px"),zo("min-width","16px"),zo("background",QZ(s?bt.brand:bt.borderSubtle))]))},e.key+":c");var s;let a=n?a0:function(e){switch(e){case"Done":case"Current":return o0;case"Upcoming":return s0}}(e.state);return r(g,{children:[o,r("div",{children:[i("span",{children:c0(e.state,t),className:l0(e.state)}),i("span",{children:e.label,className:a})],className:ZZ,role:"listitem"})]},e.key)}),"aria-label":"Progress",className:YZ,role:"list"})};function d0(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 f0(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 h0(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 p0(e){if("object"==typeof e)return"•";switch(e){case"Approved":return"✓";case"Rejected":return"✕";case"Pending":return"•";case"Skipped":return"–"}}function g0(e){if("object"==typeof e)return"var("+bt.border+")";switch(e){case"Approved":return"var("+bt.success+")";case"Rejected":return"var("+bt.error+")";case"Pending":return"var("+bt.info+")";case"Skipped":return"var("+bt.border+")"}}function m0(e){return"var("+e+")"}let v0=Ls([qo("flex"),Go("column"),zo("gap",m0(_t.md)),zo("font-family",m0(xt.fontFamily))]),y0=Ls([qo("flex"),Go("column")]),b0=Ls([qo("flex"),jo("stretch"),zo("gap",m0(_t.sm))]),_0=Ls([qo("flex"),Go("column"),jo("center"),zo("flex","0 0 22px")]);let x0=Ls([zo("flex","1 1 auto"),zo("width","1px"),zo("min-height","12px"),zo("background",m0(bt.borderSubtle))]),S0=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("flex","1 1 auto"),zo("min-width","0"),zo("padding-bottom",m0(_t.sm))]),w0=Ls([$o("pointer"),Cs([zo("background",m0(bt.surfaceSubtle))]),zo("border-radius",m0(St.sm)),zo("padding-left","4px"),zo("margin-left","-4px")]),E0=Ls([qo("flex"),jo("center"),Wo("wrap"),zo("gap",m0(_t.xs))]),k0=Ls([zo("font-size",m0(xt.sizeSm)),zo("font-weight",m0(xt.weightMedium)),zo("color",m0(bt.textPrimary))]),C0=Ls([qo("flex"),jo("center"),zo("gap","6px"),zo("font-size",m0(xt.sizeXs)),zo("color",m0(bt.textSecondary))]),A0=Ls([zo("font-size",m0(xt.sizeSm)),zo("color",m0(bt.textSecondary)),zo("white-space","pre-wrap")]),N0=Ls([zo("font-size",m0(xt.sizeXs)),zo("color",m0(bt.textDisabled))]);let T0=function(e){let t=e.entries;if(0===t.length)return i(Ks,{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(u0,{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(xa,{name:c,src:e.actorImageUrl,size:"Small"}),i("span",{children:c})]}):null,void 0!==u?i("span",{children:PZ(U(s,Date.now()),u),title:U(Ha(u),u)}):null],className:C0}));let f=e.note;return r("div",{children:[r("div",{children:[i("span",{children:p0(e.decision),className:(h=g0(e.decision),Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("width","20px"),zo("height","20px"),zo("border-radius","50%"),zo("box-sizing","border-box"),zo("border","2px solid "+h),zo("color",h),zo("background",m0(bt.surface)),zo("font-size","11px"),zo("line-height","1"),zo("flex","0 0 auto")]))}),t===l?null:i("div",{className:x0})],className:_0}),r("div",{children:[r("div",{children:[i("span",{children:e.step,className:k0}),i(Ia,{variant:h0(e.decision),label:f0(e.decision)})],className:E0}),n,void 0!==f&&""!==f?i("div",{children:f,className:A0}):null],className:a?S0+" "+w0:S0,onClick:t=>M(e.onOpen,e=>e())})],className:b0},e.key);var h}),className:y0}),void 0!==n?i("span",{children:n,className:N0}):null],className:v0})};function R0(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let D0=["approved","approve","accepted","granted","signed","confirmed","rejected","reject","declined","denied","refused","withdrawn","pending","awaiting","submitted","inreview","underreview","escalated","skipped","waived","notrequired"],I0=["decision","outcome","verdict","approval","approvalstatus","result"],F0=["step","stage","level","tier","approvalstep","approvallevel","phase"],O0=["note","notes","comment","comments","reason","remarks","justification","rationale"];function P0(e){return me(Mn(e),e=>{let t=e[1],n=e[0];if(Un(t))return z(function(e){let t=dn(e);if(void 0!==t&&t.length>=2&&t.length<=12)return t}(t),e=>[n,e])})}function M0(e){let t=P0(e),n=t.find(e=>I0.includes(R0(e[0])));return void 0!==n?n:t.find(e=>function(e){return e.filter(e=>D0.includes(R0(e))).length>=2}(e[1]))}function L0(e,t){let n=Mn(e).map(e=>e[0]).find(e=>L(Xe(t.semantics,e),!1,e=>"UserRef"===e.semantic));return void 0!==n?n:Mn(e).map(e=>e[0]).find(e=>L(TI(e),!1,qn))}function z0(e,t){let n=U(t,rr(e,void 0,void 0)),r=M0(e),i=n.dateSpan;if(void 0===r)return;if(void 0===i)return;let o=r[0],s=P0(e).find(e=>{let t=e[0];return t!==o&&F0.includes(R0(t))});return{decisionField:o,dateSpan:i,stepField:z(s,e=>e[0]),stepValues:L(s,[],e=>e[1]),actorField:L0(e,n),noteField:me(Mn(e),e=>{let t=e[0];if(Un(e[1])&&O0.includes(R0(t)))return t})[0]}}function j0(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 U0(e,t){return j(Xe(e,t),dt)}function B0(e,t){return j(Cn(t,e),jc)}function $0(e,t){if(void 0===t)return e.length;let n=e.findIndex(e=>R0(e)===R0(t));return-1!==n?n:e.length}function q0(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 G0(e,t){return j(Xe(e,t),dt)}function V0(e,t,n){return z(G0(t,n),t=>{let r=TI(n);return void 0!==r?U(j(e.refLabels,e=>e.lookupLabel(r,t)),t):t})}function K0(e,t){return U(j(e.semantics.labelField,e=>G0(t.dict,e)),t.key)}function W0(e,t,n){M(t.find(e=>e.key===n),t=>e.onOpenRow(t.key,t.json))}function H0(e,t,n){return i("span",{children:zF(e,t,void 0!==n?n:"item"),style:{color:"var("+bt.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})}function J0(e,t,n,i){return r("div",{children:[e,H0(t,n,void 0!==i?i:"item")],style:{display:"flex",flexDirection:"column",gap:"var("+_t.sm+")"}})}function X0(e){let t=e.source,n=gl(),s=Ge(),a=q0(t),l=LI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),c=NF(a.map(e=>e.dict),l,n,t.ownEntity,q(t.refLabels)),u=t.refLabels,d=void 0!==u?u:{lookupLabel:(e,t)=>gF(c,e,n,t),isMissing:(e,t)=>yF(c,e,n,t),retiredBadge:(e,t)=>mF(c,e,n,t),linkable:(e,t)=>vF(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=>Rt(e.dict,t)),e=>i(Ia,{variant:"Neutral",label:lt(e),dot:!1})),l=j(t.retired,t=>Za(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,n=>{let r=ir(e.semantics,t.dict);return void 0!==r?{TAG:"Picture",src:He(r.ref),alt:U(En(r),K0(e,t))}:"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:K0(t,e),media:u,badge:c,fields:h.map(r=>({label:$I(r,n,t.ownEntity),value:JI(r.key,r.kind,r.propSchema,Xe(e.dict,r.key),r.ann,n,s,d,t.ownEntity,e.dict)})),actions:f}});return J0(i(cZ,{cards:p,onCardClick:e=>W0(t,a,e)}),[t],void 0,void 0)}function Q0(e){let t=e.source,n=q0(t),r=U(t.semantics.statusField,""),o=function(e){let t=q0(e),n=U(e.semantics.statusField,""),r=fn(e.schema,n),i=e=>U(Rt(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(nn(e.schema),r=>r===n?void 0:V0(e,t.dict,r))[0];return{key:t.key,title:K0(e,t),meta:r}}),swatch:QQ(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=>n.find(t=>t.key===e),a=e=>{let n=t.rowCommandsFor;return void 0!==n?n(e.key,e.json):[]},l=(e,n)=>{let i=z(j(t.statusCommandFor,t=>t((e=>U(j(s(e),e=>Rt(e.dict,r)),""))(e),n)),e=>({TAG:"Dispatch",_0:e}));return void 0!==i?i:j(z(s(e),e=>a(e).filter(e=>vt(e.target,n))),e=>{if(1!==e.length)return;return{TAG:"Ask",_0:e[0].run}})},c=t.onCommand,u=void 0!==c&&$(t.statusCommandFor)?(e,t)=>{let n=l(e,t);if(void 0===n)return;if("Dispatch"!==n.TAG)return n._0();let r=n._0;c(r.command,e,r.patch)}:void 0,d=void 0!==t.statusCommandFor?(e,t)=>$(l(e,t)):void 0,f=fn(t.schema,r),h=e=>a(e).map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1,trailing:z(e.target,lt),trailingColour:z(e.target,e=>QQ(f,e).border)})),p=void 0!==t.rowCommandsFor?o.map(e=>{let t={...e};return t.cards=e.cards.map(e=>{let t={...e};return t.actions=z(s(e.key),h),t}),t}):o;return J0(i(kY,{columns:p,onCardClick:e=>W0(t,n,e),onMove:u,canDrop:d}),[t],void 0,"card")}let Y0=["var("+bt.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function Z0(e,t){return U(e.accent,Y0[fe(t,Y0.length)])}function e1(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=Z0(e,t),r=e.semantics.dateSpan;return void 0!==r?me(q0(e),i=>z(j(Cn(r,i.dict),jc),o=>{let s=j(An(r,i.dict),jc);return{key:t.toString()+":"+i.key,title:K0(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:Z0(e,t)})):[];return i(HY,{events:n,legend:r,windowNote:zF(t,void 0,void 0)})}function t1(e){let t=e.sources,n=function(e){let t=e.map((e,t)=>{let n=e.semantics.dateSpan,r=Z0(e,t);return q0(e).map(i=>{let o=j(n,e=>Cn(e,i.dict)),s=j(o,jc),a=void 0!==o?U(Ha(o),o):"",l=z(j(e.semantics.statusField,e=>Rt(i.dict,e)),lt);return{entry:{id:t.toString()+":"+i.key,timestamp:a,label:K0(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 J0(i(RH,{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 n1(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 r1(e){let t=q0(e),n=function(e,t){let n=t.map(e=>e.key);return me(Mn(e.schema),e=>{let t=e[0];return z(TI(t),e=>t)}).filter(e=>t.some(t=>n1(t.dict,e).some(e=>e!==t.key&&n.includes(e))))}(e,t),r=P(e.semantics.dateSpan,Nn);return void 0!==r?me(t,t=>z(j(Cn(r,t.dict),jc),i=>{let o=U(j(An(r,t.dict),jc),i);return{key:t.key,title:K0(e,t),start:i,end_:o<i?i:o,accent:e.accent,dependsOn:n.map(e=>n1(t.dict,e)).flat(),onOpen:()=>e.onOpenRow(t.key,t.json)}})):[]}function i1(e){let t=e.source,n=r1(t),r=t.rows.length,o=n.length,s=zF([t],o,void 0);return i(hJ,{tasks:n,windowNote:o===r?s:s+" (the rest carry no start date)"})}function o1(e,t){let n=e.semantics.labelField,r=j(e.semantics.statusField,e=>G0(t.dict,e));return void 0!==r?r:j(nn(e.schema).find(t=>!!yt(t,n)&&yt(t,e.semantics.parentField)),n=>V0(e,t.dict,n))}function s1(e){let t=e.source,n=function(e){let t=q0(e),n=e.semantics.parentField;return t.map(t=>({key:t.key,title:K0(e,t),subtitle:o1(e,t),parent:j(n,e=>G0(t.dict,e)),accent:e.accent,onOpen:()=>e.onOpenRow(t.key,t.json)}))}(t);return i(bH,{nodes:n,windowNote:zF([t],void 0,void 0)})}function a1(e){let t=e.source,n=gl(),r=j0(t),o=LI(t.schema,"List",n,t.ownEntity,t.semantics.labelField,t.semantics.projectedLabelField),s=NF(r.map(e=>e.dict),o,n,t.ownEntity,q(t.refLabels)),a=t.refLabels,l=void 0!==a?a.lookupLabel:(e,t)=>gF(s,e,n,t),c=z0(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=j0(e).map(e=>{let n=j(t.stepField,t=>U0(e.dict,t)),r=U0(e.dict,t.decisionField);return[e,n,r]}),o=i.slice();void 0!==t.stepField?o.sort((e,n)=>$0(t.stepValues,e[1])-$0(t.stepValues,n[1])|0):o.sort((e,n)=>{let r=B0(e[0].dict,t.dateSpan),i=B0(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=>U0(i.dict,e)),"Decision")),decision:L(n[2],"Pending",d0),actor:z(j(t.actorField,e=>U0(i.dict,e)),r),at:Cn(t.dateSpan,i.dict),note:j(t.noteField,e=>U0(i.dict,e)),onOpen:()=>e.onOpenRow(i.key,i.json)}}),a=me(o,e=>z(e[1],R0)),l=t.stepValues.filter(e=>!a.includes(R0(e))).map(e=>({key:"pending:"+e,step:lt(e),decision:"Pending"}));return s.concat(l)}(t,c,e=>{let t=j(c.actorField,TI);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(j0(e),e=>{let r=U0(e.dict,n),i=U0(e.dict,t.decisionField);if(void 0===r)return;if(void 0===i)return;let o=d0(i);return"object"!=typeof o&&"Pending"===o?void 0:R0(r)}),i=t.stepValues.find(e=>!r.includes(R0(e)));return t.stepValues.map(e=>({key:e,label:lt(e),state:r.includes(R0(e))?"Done":vt(i,e)?"Current":"Upcoming"}))}(t,c);return i(T0,{entries:u,steps:d,windowNote:zF([t],void 0,"decision")})}function l1(e){let t=function(e){return me(Mn(e),e=>{let t=dn(e[1]);if(void 0!==t&&t.length>=2&&t.length<=12)return[e[0],t]})}(e),n=rr(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 c1(e){let t=e.source,n=s(()=>"Numbers"),o=n[1],a=n[0],l=function(e){return z(l1(e.schema),t=>{let n=t[1],r=n[1],i=n[0],o=t[0],s=o[1],a=o[0],l=q0(e),c=(e,t)=>U(Rt(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 ha(e.toString(),function(e){return"object"==typeof e}(t))}(e,LF([t])),v=(e,t)=>i("button",{children:t,style:{background:"none",backgroundColor:a===e?"var("+bt.surfaceSubtle+")":"transparent",border:"1px solid var("+bt.border+")",color:a===e?"var("+bt.textPrimary+")":"var("+bt.textSecondary+")",cursor:"pointer",fontSize:"var("+xt.sizeSm+")",padding:"2px var("+_t.sm+")",borderRadius:"var("+St.sm+")"},type:"button",onClick:t=>o(t=>e)});return c="Numbers"===a?i(CJ,{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(YW,{rowDimLabel:d,colDimLabel:f,rowHeaders:h.map(e=>({value:e[0],label:e[1]})),colHeaders:p.map(e=>({value:e[0],label:e[1]})),cells:l.counts.map(e=>e.map(e=>({value:e,display:e.toString()}))),maxLabel:g.toString()}),r("div",{children:[r("div",{children:[v("Numbers","Numbers"),v("Heat","Heat")],style:{display:"inline-flex",alignSelf:"flex-end",gap:"var("+_t.xs+")"}}),c,H0([t],void 0,"row")],style:{display:"flex",flexDirection:"column",gap:"var("+_t.sm+")"}})}function u1(e,t,n){return e+"|"+t+"|"+n}function d1(e,t){return void 0!==t?{TAG:"Pending",_0:t}:e.available?e.present?e.on?"On":"Off":"Absent":"Unavailable"}function f1(e){let t=e.source,n=s(()=>({})),r=n[1],o=n[0],a=q0(t),l=t.matrix,c=ar(t.schema,j(l,e=>e.availableField));if(void 0===c)return null;let u=a.map(e=>e.dict),d=function(e,t){return dr(e,t,t.rowField,t.rowValues)}(u,c),f=function(e,t){return dr(e,t,t.colField,t.colValues)}(u,c),h=(e,n)=>n.map(n=>({value:n,label:TF(t,e,n)})),p=j(l,e=>e.enable),g=j(l,e=>e.disable),m=void 0!==p&&void 0!==g?[p,g]:void 0,v=(e,t)=>r(n=>{let r=Ze(Qe(n).filter(t=>t[0]!==e));return M(t,t=>{r[e]=t}),r}),y=e=>{let n=t.onCommand;if(void 0===n)return;if(void 0===m)return;let r=m[1],i=m[0],o=function(e,t,n){let r=t=>j(Xe(e,t),dt);return U(B(j(rn(t),r),r("id")),n)}(e.dict,t.schema,e.key);return(t,s,a)=>{let l=u1(e.key,t,s);v(l,a),n(a?i:r,o,Ze([[c.rowField,t],[c.colField,s]])).then(()=>(v(l,void 0),Promise.resolve()))}},b=e=>function(e,t,n,r){let i=cr(e,t);return n.map(e=>r.map(n=>{let r=i.find(r=>ur(r,t.rowField)===e&&ur(r,t.colField)===n);return void 0!==r?{rowValue:e,colValue:n,on:U(fr(r,t.valueField),!1),available:U(j(t.availableField,e=>fr(r,e)),!0),present:!0}:{rowValue:e,colValue:n,on:!1,available:!0,present:!1}}))}(e.dict,c,d,f).map(t=>t.map(t=>{let n=u1(e.key,t.rowValue,t.colValue);return{rowValue:t.rowValue,colValue:t.colValue,state:d1(t,Xe(o,n))}})),_=e=>i(CZ,{rowDimLabel:lt(c.rowField),colDimLabel:lt(c.colField),rowHeaders:h(c.rowField,d),colHeaders:h(c.colField,f),cells:b(e),onToggle:y(e),caption:K0(t,e)}),x=t.ownerScoped;return void 0!==x&&x&&1===a.length?_(a[0]):J0(i("div",{children:a.map(e=>i("div",{children:_(e)},e.key)),style:{display:"flex",flexDirection:"column",gap:"var("+_t.lg+")"}}),[t],void 0,void 0)}function h1(e){let t=e.sources,n=function(e){return e.map((e,t)=>{let n=e.semantics.imageField;return q0(e).map(r=>{let i=ir(e.semantics,r.dict),o=z(i,e=>He(e.ref)),s=z(j(e.semantics.statusField,e=>Rt(r.dict,e)),lt),a=e.fillSlot,l=void 0!==o||void 0===a||void 0===n?void 0:a(r.key,n);return{item:{key:t.toString()+":"+r.key,src:o,alt:j(i,En),title:K0(e,r),caption:s,onUpload:l},open_:()=>e.onOpenRow(r.key,r.json)}})}).flat()}(t);return J0(i(LJ,{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 p1(e){return i("span",{children:e,"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}})}function g1(e,t){let n=e[0];return void 0!==n?t(n):null}function m1(e,t){return e===t?0:e<t?-1:1}function v1(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=Dn(t);if(void 0===r)return"";let i=r[0];return L(jt(e._0,i),i,e=>e.tag)}return"object"!=typeof n?"JSONFalse"===n?"false":"true":JSON.stringify(t)}function y1(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 b1(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=>v1(t.kind,Xe(e,t.key)).toLowerCase().includes(r))}(e,t,n))}function _1(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 m1(v1(e,t),v1(e,n));case"KNumber":return U(j(t,ft),0)-U(j(n,ft),0)}return m1(v1(e,t),v1(e,n))}(i.kind,Xe(e,n),Xe(t,n))*o)}function x1(e){return"var("+e+")"}FF({id:"cards",label:"Cards",icon:p1("▤"),arity:"Single",isCapable:(e,t,n)=>!0,render:e=>g1(e,e=>i(X0,{source:e})),capability:"always — richer with label/image semantics and summary fields"}),FF({id:"board",label:"Board",icon:p1("▥"),arity:"Single",isCapable:(e,t,n)=>L(t.statusField,!1,t=>0!==fn(e,t).length),render:e=>g1(e,e=>i(Q0,{source:e})),capability:"statusField — status/state/stage string enum (≤ 8 values) supplying the columns"}),FF({id:"calendar",label:"Calendar",icon:p1("▣"),arity:{TAG:"Multi",min:1},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(e1,{sources:e}),capability:"dateSpan — a `date-range` field, a start*/end* date-time pair, or a lone non-infrastructure date field"}),FF({id:"timeline",label:"Timeline",icon:p1("▚"),arity:{TAG:"Multi",min:2},isCapable:(e,t,n)=>$(t.dateSpan),render:e=>i(t1,{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"}),FF({id:"gantt",label:"Gantt",icon:p1("▬"),arity:"Single",isCapable:(e,t,n)=>L(t.dateSpan,!1,Nn),render:e=>g1(e,e=>i(i1,{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"}),FF({id:"hierarchy",label:"Hierarchy",icon:p1("⑂"),arity:"Single",isCapable:(e,t,n)=>$(t.parentField),render:e=>g1(e,e=>i(s1,{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"}),FF({id:"approvals",label:"Approvals",icon:p1("✓"),arity:"Single",isCapable:(e,t,n)=>function(e){return $(z0(e,void 0))}(e),render:e=>g1(e,e=>i(a1,{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"}),FF({id:"pivot",label:"Pivot",icon:p1("⊞"),arity:"Single",isCapable:(e,t,n)=>$(l1(e)),render:e=>g1(e,e=>i(c1,{source:e})),capability:"two small string enums (2–12 values) as the row and column dimensions"}),FF({id:"matrix",label:"Matrix",icon:p1("⊟"),arity:"Single",isCapable:(e,t,n)=>function(e){return $(ar(e,void 0))}(e),render:e=>g1(e,e=>i(f1,{source:e})),capability:"one nested collection whose items carry two small string enums (2–12 values) as the axes plus a boolean as the cell; toggling additionally needs an enable/disable command pair, declared in `uiHints.views.<v>.matrix` or resolved from a closed table of opposing verbs"}),FF({id:"gallery",label:"Gallery",icon:p1("▨"),arity:"Single",isCapable:(e,t,n)=>$(t.imageField),render:e=>i(h1,{sources:e}),capability:"imageField — a string field named image/imageUrl/photo/avatar/thumbnail (or annotated `image`) supplying each row's picture"});let S1=Ls([ps("relative"),qo("inlineFlex"),jo("center")]),w1=Ls([zo("background",x1(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",x1(St.md)),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("padding-left","32px"),zo("font-size",x1(xt.sizeMd)),zo("color",x1(bt.textPrimary)),zo("outline","none"),zo("width","240px"),Es([zo("border-color",x1(bt.brand))]),Ns([zo("color",x1(bt.textDisabled))])]),E1=Ls([ps("absolute"),Xo(Ts(10)),zo("color",x1(bt.textDisabled)),zo("font-size",x1(xt.sizeSm)),zo("pointer-events","none")]),k1=Ls([ps("absolute"),gs(Ts(8)),zo("background","none"),zo("border","none"),zo("cursor","pointer"),zo("color",x1(bt.textDisabled)),zo("font-size",x1(xt.sizeSm)),zo("padding","0"),zo("line-height","1"),Cs([zo("color",x1(bt.textSecondary))])]);let C1=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:E1}),i("input",{className:w1,placeholder:s,type:"text",value:o,onChange:e=>n(e.target.value)}),""!==o?i("button",{children:"x",className:k1,onClick:e=>n("")}):null],className:S1})};function A1(e){return"var("+e+")"}let N1=Ls([qo("flex"),jo("center"),zo("gap",A1(_t.sm)),Wo("wrap")]),T1=Ls([qo("flex"),jo("center"),zo("gap","4px")]),R1=Ls([zo("color",A1(bt.textSecondary)),zo("font-size",A1(xt.sizeSm)),zo("white-space","nowrap")]),D1=Ls([zo("background",A1(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",A1(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("font-size",A1(xt.sizeSm)),zo("color",A1(bt.textPrimary)),zo("cursor","pointer"),zo("outline","none"),Es([zo("border-color",A1(bt.brand))])]);function I1(e){let t=e.onChange,n=e.filter;return r("div",{children:[i("span",{children:n.label+":",className:R1}),r("select",{children:[i("option",{children:"All",value:""}),n.options.map(e=>i("option",{children:e.label,value:e.value},e.value))],className:D1,value:n.value,onChange:e=>t(n.key,e.target.value)})],className:T1})}let F1=I1;let O1=function(e){let t=e.onSearchChange,n=e.searchValue,o=e.onFilterChange;return r("div",{children:[void 0!==n&&void 0!==t?i(C1,{value:n,onChange:t}):null,e.filters.map(e=>i(I1,{filter:e,onChange:o},e.key))],className:N1})};function P1(){let e=s(()=>{}),t=e[1],n=e[0];return{element:void 0!==n?i(MW,{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 M1(e){try{return decodeURIComponent(e)}catch(t){return e}}function L1(e){let t=e.split("/");if(2!==t.length)return[e,void 0];let n=t[0],r=t[1];return[M1(n),M1(r)]}function z1(e){return"var("+e+")"}let j1=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",z1(_t.md)),Vo(1),zo("min-height","160px"),ms("center"),zo("padding",z1(_t.lg))]),U1=Ls([zo("font-size","32px"),zo("color",z1(bt.error)),zo("line-height","1")]),B1=Ls([zo("color",z1(bt.textPrimary)),zo("font-size",z1(xt.sizeLg)),zo("font-weight",z1(xt.weightMedium)),Zo(Ts(0))]),$1=Ls([zo("color",z1(bt.textSecondary)),zo("font-size",z1(xt.sizeSm)),zo("line-height",z1(xt.lineHeightNormal)),Zo(Ts(0))]),q1=Ls([zo("background",z1(bt.brand)),zo("color",z1(bt.textOnBrand)),zo("border","none"),zo("border-radius",z1(St.md)),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("font-size",z1(xt.sizeSm)),zo("cursor","pointer"),rs(Ts(4))]);let G1=function(e){let t=e.title,n=void 0!==t?t:"Something went wrong";return r("div",{children:[i("div",{children:"X",className:U1}),i("h3",{children:n,className:B1}),L(e.detail,null,e=>i("p",{children:e,className:$1})),L(e.onRetry,null,e=>i("button",{children:"Try again",className:q1,onClick:t=>e()}))],className:j1})};function V1(e){return"var("+e+")"}let K1=Ls([qo("flex"),jo("center"),zo("gap",V1(_t.xs)),zo("font-size",V1(xt.sizeSm)),zo("color",V1(bt.textSecondary)),zo("min-width","0")]),W1=Ls([zo("color",V1(bt.brand)),zo("text-decoration","none"),zo("white-space","nowrap"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("max-width","18ch"),Cs([zo("text-decoration","underline")])]),H1=Ls([zo("color",V1(bt.textPrimary)),zo("font-weight",V1(xt.weightMedium))]),J1=Ls([zo("color",V1(bt.textDisabled)),zo("font-size",V1(xt.sizeLg)),zo("line-height","1"),Ko(0),ys("none")]),X1=i("span",{children:"›","aria-hidden":!0,className:J1});let Q1=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?X1:null,s||q(e.href)&&q(e.onClick)?i("span",{children:e.label,className:H1}):i("a",{children:e.label,className:W1,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:K1})};function Y1(e){return"var("+e+")"}let Z1=Ls([qo("flex"),jo("center"),zo("gap",Y1(_t.md)),zo("flex-wrap","wrap"),zo("padding-bottom",Y1(_t.sm)),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]),e2=Ls([zo("display","inline-flex"),jo("center"),zo("vertical-align","middle"),zo("gap",Y1(_t.xs)),zo("min-width","0"),zo("max-width","100%"),zo("margin-right",Y1(_t.md)),zo("flex","0 1 auto")]),t2=Ls([zo("font-size",Y1(xt.sizeLg)),zo("font-weight",Y1(xt.weightMedium)),zo("color",Y1(bt.textPrimary)),zo("line-height",Y1(xt.lineHeightTight)),Zo(Ts(0)),zo("min-width","8ch"),zo("white-space","nowrap"),zo("overflow","hidden"),zo("text-overflow","ellipsis")]),n2=Ls([zo("display","inline-flex"),jo("center"),zo("vertical-align","middle"),zo("flex-wrap","wrap"),zo("gap",Y1(_t.sm)),zo("flex","0 1 auto"),zo("min-width","0"),zo("max-width","100%")]),r2=Ls([qo("flex"),jo("center"),zo("flex-wrap","wrap"),Jo("flexEnd"),zo("gap",Y1(_t.sm)),Ko(0),zo("margin-left","auto")]),i2={titleGroup:e2};function o2(e){return"var("+e+")"}let s2=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),zo("border-radius",o2(St.md)),zo("padding","2px var("+_t.sm+")"),zo("font-size",o2(xt.sizeSm)),zo("line-height","1.6"),zo("white-space","nowrap"),$o("pointer"),ws([zo("opacity","0.4"),$o("notAllowed")])]),a2=zs([s2,Ls([zo("background",o2(bt.brand)),zo("color",o2(bt.textOnBrand)),zo("border","1px solid transparent"),Cs([zo("filter","brightness(1.08)")])])]),l2=zs([s2,Ls([zo("background",o2(bt.surface)),zo("color",o2(bt.textPrimary)),zo("border","1px solid var("+bt.border+")"),Cs([zo("background",o2(bt.surfaceSubtle))])])]);let c2=l2,u2=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(EV),y=bG(At.narrow),b=0!==f.length,_=e=>i("button",{children:e.label,className:U(e.primary,!1)?a2:l2,onClick:t=>e.run()},e.key);if(y&&p.length>2){let e=p.slice(1);t=r(o,{children:[L(p[0],null,_),i(HQ,{items:e.map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1})),triggerLabel:"⋯ "+e.length.toString()})]})}else t=p.map(_);let x=L(e.controls,null,e=>TV(m?v:void 0,i("div",{children:e,className:r2}))),S=r(o,{children:[r("div",{children:[b?i(Q1,{crumbs:f,allLinks:!0}):null,b?X1:null,i("h1",{children:c,className:t2,title:c}),h],className:e2}),r("div",{children:[t,g],className:n2}),x]});return m?S:i("div",{children:S,className:Z1})};function d2(e,t){return void 0!==t?(e,n)=>t(e,n).then(Tt):void 0!==e?(t,n)=>e(t,n).then(Nt):void 0}function f2(){return d2(sF(),aF())}let h2=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 p2(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 g2(e,t){return ge(Qe(t),e,(e,t)=>e.replaceAll("{{"+t[0]+"}}",t[1]))}function m2(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(h2,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=p2(s,r);return 0===i.length?Promise.resolve([r,""]):function(e,t,n,r){let i=yl(t,n);return void 0!==i?ce(wF(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(g2(o.template,t))})}let a={};return o.idFields.forEach(e=>{let t=e.field,n=p2(s,t);a[t]=n.join(", ")}),Promise.resolve(g2(o.template,a))}let v2="This command could not be sent. See the console for details.";function y2(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=d2(e,t);return(t,n,s)=>{let a=f.find(e=>e.name===t);return void 0!==h?void 0!==a?(d(n),ce(h(a.mutationDocument,function(e,t,n){let r={};Qe(U(ht(n),{})).forEach(e=>{r[e[0]]=e[1]});let i=e.ownerField,o=e.ownerValue;return void 0!==i&&void 0!==o&&(r[i]=o),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(),m2(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:v2}}),Promise.resolve()):(console.error("[AutoUI] "+r+': command "'+t+'" not sent — no GraphQL executor in context'),u({TAG:"Failed",_0:{command:t,reason:v2}}),Promise.resolve())}}function b2(e){return"var("+e+")"}let _2=Ls([ps("relative"),qo("inlineBlock")]),x2=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px"),zo("background",b2(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",b2(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",b2(bt.textSecondary)),zo("font-size",b2(xt.sizeSm)),zo("white-space","nowrap"),$o("pointer"),Cs([zo("background",b2(bt.surfaceSubtle)),zo("color",b2(bt.textPrimary))])]),S2=Ls([qo("inlineFlex"),jo("center"),Jo("center"),zo("min-width","16px"),zo("height","16px"),zo("padding","0 4px"),zo("border-radius",b2(St.full)),zo("background",b2(bt.brand)),zo("color",b2(bt.textOnBrand)),zo("font-size",b2(xt.sizeXs)),zo("line-height","1")]),w2=Ls([ps("absolute"),Xo(Ts(0)),vs({NAME:"percent",VAL:100}),rs(Ts(4)),qo("flex"),Go("column"),zo("gap",b2(_t.sm)),zo("align-items","stretch"),zo("background",b2(bt.surfaceElevated)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",b2(St.md)),zo("box-shadow",b2(Et)),zo("padding",b2(_t.md)),zo("min-width","220px"),zo("max-width","min(320px, calc(100vw - 32px))"),zo("max-height","min(60vh, 420px)"),zo("overflow-y","auto"),zo("z-index","200")]);let E2=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:S2}):null,i("span",{children:"▾","aria-hidden":!0})],"aria-expanded":u,className:x2,onClick:e=>{e.stopPropagation(),c(e=>!e)}}),u?i("div",{children:e.children,className:w2,onKeyDown:e=>{if("Escape"===e.key)return c(e=>!1)},onClick:e=>{e.stopPropagation()}}):null],className:_2})};function k2(e){return"var("+e+")"}let C2=Ls([qo("grid"),zo("grid-template-columns","minmax(0, 1fr) minmax(0, 1.4fr)"),zo("gap",k2(_t.lg)),zo("align-items","start"),Ss(At.narrow,[zo("grid-template-columns","minmax(0, 1fr)")])]),A2=Ls([zo("min-width","0"),zo("overflow","auto")]),N2=zs([A2,Ls([zo("border-left","1px solid var("+bt.border+")"),zo("padding-left",k2(_t.lg)),Ss(At.narrow,[zo("border-left","none"),zo("padding-left","0"),zo("border-top","1px solid var("+bt.border+")"),zo("padding-top",k2(_t.lg))])])]);let T2=function(e){return r("div",{children:[i("div",{children:e.master,className:A2}),i("div",{children:e.detail,className:N2})],className:C2})};function R2(e){return"var("+e+")"}let D2=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",R2(_t.md)),Vo(1),zo("min-height","160px"),zo("color",R2(bt.textSecondary))]),I2=Ls([zo("width","32px"),zo("height","32px"),zo("border","3px solid var("+bt.borderSubtle+")"),zo("border-top-color",R2(bt.brand)),zo("border-radius","50%"),zo("animation","rv-spin 0.7s linear infinite")]),F2=Ls([zo("font-size",R2(xt.sizeSm)),zo("color",R2(bt.textSecondary))]);Ms("@keyframes rv-spin",[xs("from",[zo("transform","rotate(0deg)")]),xs("to",[zo("transform","rotate(360deg)")])]);let O2=function(e){return r("div",{children:[i("div",{className:I2}),L(e.label,null,e=>i("span",{children:e,className:F2}))],className:D2})};function P2(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 M2(e){return j(j(ht(e),e=>Xe(e,"id")),dt)}function L2(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function z2(e,t){return j(ht(e),e=>Xe(e,t))}function j2(e){return!!e.startsWith("__")||e.startsWith("$")}let U2="$offload";function B2(e){let t=ut(e);if("object"!=typeof t)return!1;switch(t.TAG){case"JSONObject":let e=t._0;return!!$(Xe(e,U2))||Ye(e).some(B2);case"JSONArray":return t._0.some(B2);default:return!1}}function $2(e){let t=ut(e);if("object"==typeof t)switch(t.TAG){case"JSONObject":let e=t._0,n=j(Xe(e,U2),ht);if(void 0===n)return ge(Ye(e),void 0,(e,t)=>B(e,$2(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,$2(t)));default:return}}function q2(e,t){return me(t,t=>z(j(z2(e,t),$2),e=>[t,e]))}let G2=new Map;function V2(e,t,n,r){let i=void 0!==r?r:[],o=t.state;if(void 0===o)return;let s=L2(n);if(0===s.length)return;!function(e,t){let n=L(ht(e),[],e=>Object.keys(e).filter(e=>!j2(e)&&!t.includes(e)));if(0===n.length)return;let r=n.join(",");q(G2.get(r))&&(G2.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(q2(t,n),t=>{let n=t[1],i=t[0],o=r.some(e=>e[0]===i&&e[1]===n),s=L(z2(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(z2(t,e),!1,B2)),s=L(ht(e),!1,e=>Object.keys(e).some(e=>!j2(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(z2(e,n),z2(t,n)));return!o&&!a}(e,l,s,a)?l:void 0}let K2={fromBatch:function(e,t,n){return z(j(j(ht(t),e=>Xe(e,n)),pt),t=>{let n=me(t,M2);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=M2(e);return void 0===n||!t.includes(n)})}},W2=/^[0-9]+$/;function H2(e){if(!W2.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 J2(e,t,n){if(void 0===n)return!0;let r=e.get(t);return void 0===r||function(e,t){let n=H2(e),r=H2(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 X2={make:function(){return new Map},shouldApply:J2,record:function(e,t,n){void 0!==n&&J2(e,t,n)&&e.set(t,n)}};function Q2(e,t){return U(e.get(t),[])}function Y2(e,t,n){0===n.length||e.set(t,n)}let Z2={make:function(){return new Map},known:Q2,record:Y2,apply:function(e,t,n,r){let i=V2(t,n,r,Q2(e,n.id)),o=n.state;return void 0!==o&&Y2(e,n.id,q2(o,L2(r))),i}};function e3(e,t,n){return me(dF(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 t3(e){return"var("+e+")"}function n3(e){if(""===e)return[];let t=pt(JSON.parse(e));return void 0!==t?me(t,dt):[e]}function r3(e){return JSON.stringify(e.map(e=>e))}let i3=Ls([ps("relative"),bs({NAME:"percent",VAL:100})]),o3=Ls([zo("background",t3(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",t3(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("font-size",t3(xt.sizeMd)),zo("color",t3(bt.textPrimary)),zo("outline","none"),bs({NAME:"percent",VAL:100}),as(Ts(34)),qo("flex"),jo("center"),Wo("wrap"),zo("gap","4px"),$o("pointer"),ms("left"),Es([zo("border-color",t3(bt.brand))])]),s3=Ls([zo("border-color",t3(bt.brand))]),a3=Ls([zo("border-color",t3(bt.error))]),l3=Ls([zo("color",t3(bt.textSecondary))]),c3=Ls([qo("inlineFlex"),jo("center"),zo("background",t3(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",t3(St.sm)),zo("padding","2px 6px"),zo("font-size",t3(xt.sizeSm)),zo("gap","4px")]),u3=Ls([$o("pointer"),zo("color",t3(bt.textSecondary)),zo("font-weight",t3(xt.weightBold))]),d3=Ls([zo("border","none"),zo("background","transparent"),zo("outline","none"),zo("color",t3(bt.textPrimary)),zo("font-size",t3(xt.sizeMd)),Vo(1),ls(Ts(40))]),f3=Ls([ps("absolute"),vs({NAME:"percent",VAL:100}),Xo("zero"),gs("zero"),rs(Ts(2)),zo("background",t3(bt.surfaceElevated)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",t3(St.sm)),zo("box-shadow",t3(Et)),Yo("none"),Zo("zero"),fs("zero"),os(Ts(240)),ds("auto"),_s(20)]),h3=Ls([zo("padding","var("+_t.xs+") var("+_t.sm+")"),$o("pointer"),zo("color",t3(bt.textPrimary)),zo("font-size",t3(xt.sizeMd))]),p3=Ls([zo("background",t3(bt.surfaceSubtle))]),g3=Ls([zo("background",t3(bt.brandSubtle))]),m3=Ls([zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("color",t3(bt.textSecondary)),zo("font-size",t3(xt.sizeSm))]);let v3=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:()=>{},b=void 0!==o&&o,_=void 0!==n&&n,x=function(e,t){let n=sF(),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=e3(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=sF(),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=sF(),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=e3(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=n3(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=n3(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?o3+" "+s3:o3,re=b?ne+" "+a3: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:m3});else if(0===Q)K=i("li",{children:""===O?"No options":"No matches",className:m3});else{let e=f?n3(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}([[h3],n===D?[p3]:[],r?[g3]:[]]).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:f3,role:"listbox",style:oe});return se="Inline"===t?i("button",{children:""===u?i("span",{children:d?"Select…":"—",className:l3}):V(u),className:re,autoFocus:_,type:"button",onKeyDown:te,onBlur:e=>y(),onClick:e=>C(e=>!e)}):r("div",{children:[f?n3(u).map(e=>r("span",{children:[V(e),i("span",{children:"×",className:u3,onClick:t=>{t.stopPropagation(),Z(e)}})],className:c3},e)):null,i("input",{ref:T($),className:d3,autoFocus:_,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:i3})};function y3(e){return e.pluginId+"."+e.slice+"."+e.command.name}function b3(e,t,n){return e}function _3(e,t,n){let r=void 0!==n?n:b3;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,whenState:e.whenState,whenRetired:e.whenRetired,navigateTo:j(e.then,e=>""===e.trim()?void 0:e)}})}function x3(e,t,n,r){let i=U(j(r,e=>Ya(e,Xe(t,e.field))),!1),o=j(n,e=>Rt(t,e));return e.filter(e=>{if(i&&!vt(e.whenRetired,!0))return!1;let t=e.whenState;return void 0===t||L(o,!1,e=>t.includes(e))})}function S3(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)),Bt),ht),e=>Xe(e,"type")),dt),"")}function w3(e,t,n){let r=void 0!==n?n:[],i=me(["id",e.aggregateIdField,e.ownerField],e=>e),o={};return Qe(U(j(j(ht(e.schema),e=>Xe(e,"properties")),ht),{})).forEach(e=>{let n=e[0];if("TAG"===n||i.includes(n)||r.includes(n))return;let s=Xe(t,n);return void 0!==s&&function(e,t){let n,r=Bt(e),i=j(j(ht(r),e=>Xe(e,"type")),dt),o=ut(t);if(void 0!==i)switch(i){case"boolean":if("object"!=typeof o)switch(o){case"JSONFalse":case"JSONTrue":n=!0;break;default:n=!1}else n=!1;break;case"integer":case"number":n="object"==typeof o&&"JSONNumber"===o.TAG;break;case"string":n="object"==typeof o&&"JSONString"===o.TAG;break;default:n=!1}else n=!1;if(!n)return!1;let s=dn(r),a=dt(t);return void 0===s||void 0!==a&&s.includes(a)}(e[1],s)?M(function(e){let t=ut(e);if("object"!=typeof t)switch(t){case"JSONFalse":return"false";case"JSONTrue":return"true";default:return}else switch(t.TAG){case"JSONString":return t._0;case"JSONNumber":return t._0.toString();default:return}}(s),e=>{o[n]=e}):void 0}),o}function E3(e,t,n){let r=void 0!==n?n:{},i=w3(e.command,r,[e.field]);return Qe(function(e,t){return Ze([[e.field,S3(e.command,e.field)?r3([t]):t]])}(e,t)).forEach(e=>{i[e[0]]=e[1]}),{command:e.command,initialValues:i,navigateTo:e.navigateTo,formKey:e.command.name+":"+t}}function k3(e){return"var("+e+")"}let C3="168px",A3=Ls([qo("flex"),Go("column"),zo("gap",k3(_t.sm))]),N3=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",k3(_t.sm))]),T3=Ls([qo("inlineFlex"),jo("center"),zo("gap",k3(_t.xs))]),R3=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",k3(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",k3(bt.textSecondary)),zo("font-size",k3(xt.sizeSm)),$o("pointer"),Cs([zo("background",k3(bt.surfaceSubtle)),zo("color",k3(bt.textPrimary))])]),D3=zs([R3,Ls([zo("background",k3(bt.surfaceSubtle)),zo("color",k3(bt.textPrimary)),zo("font-weight",k3(xt.weightMedium))])]),I3=Ls([zo("font-size",k3(xt.sizeMd)),zo("font-weight",k3(xt.weightMedium)),zo("color",k3(bt.textPrimary))]),F3=Ls([zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",k3(St.md)),zo("overflow","hidden")]),O3=Ls([qo("flex"),jo("stretch")]),P3=zs([O3,Ls([zo("background",k3(bt.surfaceSubtle)),zo("border-bottom","1px solid var("+bt.borderSubtle+")")])]),M3=zs([O3,Ls([zo("border-top","1px solid var("+bt.borderSubtle+")")])]),L3=Ls([zo("flex","0 0 "+C3),zo("padding","4px var("+_t.sm+")"),zo("font-size",k3(xt.sizeXs)),zo("color",k3(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),z3=Ls([zo("flex","0 0 "+C3),zo("padding","6px var("+_t.sm+")"),zo("font-size",k3(xt.sizeSm)),zo("font-weight",k3(xt.weightMedium)),zo("color",k3(bt.textPrimary)),zo("border-right","1px solid var("+bt.borderSubtle+")"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),j3=zs([z3,Ls([zo("color",k3(bt.textDisabled)),zo("font-style","italic")])]);function U3(e){return Ls([qo("grid"),zo("flex","1 1 auto"),zo("grid-template-columns","repeat("+e.toString()+", minmax(0, 1fr))")])}let B3=Ls([zo("background",k3(bt.surfaceSubtle))]),$3=Ls([zo("padding","4px var("+_t.xs+")"),zo("font-size",k3(xt.sizeXs)),zo("color",k3(bt.textSecondary)),zo("border-left","1px solid var("+bt.borderSubtle+")")]),q3=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-height","48px"),zo("padding","3px"),zo("border-left","1px solid var("+bt.borderSubtle+")")]),G3=zs([q3,Ls([zo("background",k3(bt.surfaceSubtle))])]);function V3(e){return Ls([qo("block"),zo("width","100%"),zo("text-align","left"),zo("border","none"),zo("border-left","3px solid "+e),zo("border-radius",k3(St.sm)),zo("background",k3(bt.surfaceSubtle)),zo("color",k3(bt.textPrimary)),zo("font-size",k3(xt.sizeXs)),zo("padding","1px var("+_t.xs+")"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap"),$o("pointer"),Cs([zo("background",k3(bt.surfaceElevated))])])}let K3=Ls([$o("grab")]),W3=Ls([cs(.85),zo("z-index","10"),$o("grabbing")]),H3=Ls([zo("font-size",k3(xt.sizeXs)),zo("color",k3(bt.textDisabled))]),J3="var("+bt.brand+")";function X3(e,t){return e.filter(e=>Rc(e.start,function(e){return U(e.end_,e.start)}(e),t)).toSorted((e,t)=>e.start-t.start)}function Q3(e,t){return Fc(e.start)||!Nc(e.start,t)?e.title:Ic(e.start)+" "+e.title}function Y3(e){let t=e.draggable,n=e.event,r=MQ({id:n.key,disabled:!t}),o=t?V3(U(n.accent,J3))+" "+K3:V3(U(n.accent,J3)),s=r.isDragging?o+" "+W3:o,a=z(BQ(r.transform),e=>({transform:e})),l=r.listeners,c=null==l?void 0:T(l);return i("button",{children:Q3(n,e.day),ref:T(r.setNodeRef),className:s,style:a,title:n.title,onKeyDown:e=>M(c,t=>UQ(t,e)),onClick:e=>n.onOpen(),onPointerDown:e=>M(c,t=>jQ(t,e))})}function Z3(e){let t=e.draggable,n=e.today,o=e.days,s=e.lane,a=zQ({id:s.unassigned?"":s.resourceId}),l=!s.unassigned&&a.isOver?U3(o.length)+" "+B3:U3(o.length);return r("div",{children:[i("div",{children:s.label,className:s.unassigned?j3:z3}),i("div",{children:o.map(e=>i("div",{children:X3(s.events,e).map(n=>i(Y3,{event:n,day:e,draggable:t},n.key)),className:e===n?G3:q3},e.toString())),ref:T(a.setNodeRef),className:l})],className:M3})}let e4=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(()=>wc(U(o,Date.now()))),h=f[1],p=f[0],g=wc(Date.now()),m=$(n);t="Week"===d?pe(7,e=>Ec(Cc(p),e)):[wc(p)];let v,y=e=>h(t=>Ec(t,"Week"===d?7*e|0:e)),b=(e,t)=>i("button",{children:t,className:d===e?D3:R3,onClick:t=>u(t=>e)});return v="Week"===d?Pc(p):zc(p)+" — "+Pc(p),r("div",{children:[r("div",{children:[r("div",{children:[i("button",{children:"‹",className:R3,onClick:e=>y(-1)}),i("button",{children:"Today",className:R3,onClick:e=>h(e=>g)}),i("button",{children:"›",className:R3,onClick:e=>y(1)}),i("span",{children:v,className:I3})],className:T3}),r("div",{children:[b("Week","Week"),b("Day","Day")],className:T3})],className:N3}),i(FQ,{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:L3}),i("div",{children:t.map(e=>i("div",{children:zc(e),className:$3},e.toString())),className:U3(t.length)})],className:P3}),l.map(e=>i(Z3,{lane:e,days:t,today:g,draggable:m},e.unassigned?"\0unassigned":e.resourceId))],className:F3})}),void 0!==a?i("span",{children:a,className:H3}):null],className:A3})};function t4(e){switch(e){case"Hints":return"hints";case"DeclaredTarget":return"declared-target";case"SchemaTarget":return"schema-target";case"Setter":return"setter"}}function n4(e,t){return e+"→"+t}function r4(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),e=>Object.keys(e)),[])}function i4(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt).filter(e=>"TAG"!==e)}function o4(e,t){return i4(e.schema).filter(n=>!function(e,t,n){return!(n!==t&&"id"!==n&&!vt(n,e.aggregateIdField))||!!$(e.ownerValue)&&vt(e.ownerField,n)}(e,t,n))}function s4(e,t){return 0===o4(e,t).length}function a4(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=dn(n);return void 0!==i&&1===i.length?i[0]:void 0}function l4(e){return e.filter(e=>"Instance"===e.level)}function c4(e,t){let n=e.allowedStates;return void 0===n||0===n.length||n.includes(t)}function u4(e){let t=e.allowedStates,n=e.targetState;return void 0!==t&&void 0===n}function d4(e,t,n){return r4(e.schema).includes(t)?Ze([[t,n]]):{}}function f4(e){return 1!==e.length?void 0:e[0]}function h4(e,t,n){let r=l4(t),i=function(e,t){let n=e.filter(e=>!(u4(e)||!r4(e.schema).includes(t))&&s4(e,t));return 1!==n.length?void 0:n[0]}(r,e);return(t,o)=>{let s=(n,r)=>{if(c4(n,t)&&s4(n,e))return{command:n.name,patch:d4(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(f4(r.filter(e=>!!c4(e,t)&&vt(e.targetState,o))),e=>s(e,"DeclaredTarget"));if(void 0!==l)return l;let c=j(f4(r.filter(n=>!(u4(n)||!c4(n,t))&&vt(a4(n.schema,e),o))),e=>s(e,"SchemaTarget"));return void 0!==c?c:j(i,e=>s(e,"Setter"))}}function p4(e,t,n){let r=z(Object.entries(U(n,{})).find(t=>t[1]===e.name),e=>e[0]);if(void 0!==r)return r;let i=e.targetState;return void 0!==i?i:u4(e)?void 0:a4(e.schema,t)}function g4(e,t,n,r){let i=h4(t,n,r),o=fn(e,t),s={};return o.forEach(e=>{o.forEach(t=>M(i(e,t),n=>{s[n4(e,t)]=n}))}),s}function m4(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 v4="resources",y4="events";function b4(e){return e.filter(e=>vt(e.role,y4))}function _4(e,t){return j(Xe(e,t),dt)}function x4(e){let t=function(e){return e.find(e=>vt(e.role,v4))}(e),n=b4(e),r=void 0!==t?t.rows.map(e=>{let n=U(ht(e),{}),r=U(_4(n,"id"),""),i=U(j(t.semantics.labelField,e=>_4(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(_4(r,"id"),""),o=e.semantics.dateSpan;if(void 0!==o)return z(j(Cn(o,r),jc),s=>{let a=j(An(o,r),jc),l=U(j(e.semantics.labelField,e=>_4(r,e)),i),c=U(j(e.resourceRef,e=>_4(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 S4(e){let t=e.sources,n=x4(t),r=b4(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(be(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;void 0===r||void 0===i||void 0===o||r(i,n,Ze([[o,t]]))})}):void 0,a=ge(r,0,(e,t)=>e+t.rows.length|0),l=fa(LF(t),a,void 0,"scheduled item");return i(e4,{lanes:n,windowNote:l,onReassign:s})}let w4=i("span",{children:"☰","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),E4="scheduler";function k4(e){return!!$(rr(e,void 0,void 0).dateSpan)&&Mn(e).some(e=>$(TI(e[0])))}function C4(e,t){let n=e.filter(e=>"Instance"===e.level).filter(e=>!!r4(e.schema).includes(t)&&i4(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField)));if(1===n.length)return n[0].name}function A4(e){return"var("+e+")"}FF({id:E4,label:"Scheduler",icon:w4,arity:{TAG:"Slots",_0:[{role:v4,min:1,max:1},{role:y4,min:1}]},isCapable:(e,t,n)=>k4(e),render:e=>i(S4,{sources:e}),capability:"role join: a resources source (lanes) + an events source with a date span and an entity-ref to the resource"});let N4=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px"),zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",A4(St.full)),zo("padding","2px var("+_t.sm+")"),zo("color",A4(bt.textSecondary)),zo("font-size",A4(xt.sizeXs)),zo("line-height","1.5")]),T4=Ls([$o("pointer"),Cs([zo("background",A4(bt.surfaceSubtle)),zo("color",A4(bt.textPrimary))])]),R4=Ls([cs(.6),$o("notAllowed")]),D4=Ls([Ss(At.compact,[zo("display","none")])]);function I4(e){return Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",e)])}let F4=I4(A4(bt.success)),O4=I4(A4(bt.border)),P4=I4(A4(bt.border)),M4=js([[0,[cs(.4)]],[50,[cs(1)]],[100,[cs(.4)]]]),L4=Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",A4(bt.warning)),Ds(M4),Is({NAME:"ms",VAL:1200}),Fs("infinite"),Os("easeInOut")]);let z4=function(e){let t=e.onToggle,n=e.reconnecting,o=e.canBeLive,s=e.live,a=void 0!==n&&n,l=o?s&&a?[N4+" "+T4,L4,"Reconnecting…"]:s?[N4+" "+T4,F4,"Live"]:[N4+" "+T4,O4,"Snapshot"]:[N4+" "+R4,P4,"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:D4})],"aria-label":"Live updates: "+c,className:l[0],title:d,disabled:!o,type:"button",onClick:u})};function j4(e){return"var("+e+")"}let U4=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px"),zo("background",j4(bt.brand)),zo("color",j4(bt.textOnBrand)),zo("border","none"),zo("border-radius",j4(St.full)),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("font-size",j4(xt.sizeSm)),zo("font-weight",j4(xt.weightMedium)),$o("pointer"),Cs([zo("opacity","0.85")])]),B4=Ls([qo("flex"),jo("center"),Jo("center"),zo("padding","var("+_t.xs+") 0")]);let $4=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:U4,type:"button",onClick:e=>t()}),className:B4})};function q4(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=sF(),h=aF(),p=s(()=>[]),g=p[1],m=s(()=>lF),v=m[1],y=m[0],b=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,OP(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(_(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?_(e=>({TAG:"Refused",_0:n.message})):(g(t=>uF(r,e.queryField)),v(t=>fF(r,e.queryField)),_(e=>"Loaded")),Promise.resolve()}),e=>(_(e=>({TAG:"Error",_0:"Failed to load data"})),Promise.resolve()))}else _(e=>({TAG:"Error",_0:"Not connected"}));else _(e=>"Loaded")},[x[0],c,u,k]),{rows:p[0],setRows:g,pageInfo:y,fetchState:b[0],refetch:()=>S(e=>e+1|0),loadMore:()=>E(e=>e+1|0),canLoadMore:y.hasNextPage}}function G4(e,t,n){let r=void 0===t||t,i=q4(e,void 0,void 0,r,void 0,50),o=h(void 0),s=h(X2.make()),a=h(Z2.make()),l=oP(),c=r&&L(l,!1,t=>t.isLive(e.queryField));return UW(e.queryField,"All",c,t=>{if(!X2.shouldApply(s.current,t.id,t.seq))return;X2.record(s.current,t.id,t.seq);let n,r=t.changeKind;return n="Updated"===r?j(i.rows.find(e=>vt(M2(e),t.id)),n=>Z2.apply(a.current,n,t,e.schema)):void 0,void 0!==n?i.setRows(e=>e.map(e=>vt(M2(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 V4(e){return"var("+e+")"}let K4=Ls([ps("fixed"),vs(Ts(0)),Xo(Ts(0)),gs(Ts(0)),Bo(Ts(0)),zo("background","rgba(0,0,0,0.5)"),qo("flex"),jo("center"),Jo("center"),zo("z-index","1000"),zo("backdrop-filter","blur(2px)")]),W4=Ls([zo("background",V4(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",V4(St.lg)),zo("box-shadow",V4(kt)),qo("flex"),Go("column"),zo("max-height","90vh"),zo("max-width","90vw"),zo("min-width","400px"),zo("overflow","hidden")]),H4=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("padding","var("+_t.md+") var("+_t.lg+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),Ko(0)]),J4=Ls([zo("color",V4(bt.textPrimary)),zo("font-size",V4(xt.sizeLg)),zo("font-weight",V4(xt.weightMedium)),Zo(Ts(0))]),X4=Ls([zo("background","none"),zo("border","none"),zo("cursor","pointer"),zo("color",V4(bt.textSecondary)),zo("font-size","18px"),zo("padding","0"),zo("line-height","1"),Cs([zo("color",V4(bt.textPrimary))])]),Q4=Ls([zo("padding",V4(_t.lg)),zo("overflow-y","auto"),Vo(1)]),Y4=Ls([qo("flex"),jo("center"),Jo("flexEnd"),zo("gap",V4(_t.sm)),zo("padding","var("+_t.md+") var("+_t.lg+")"),zo("border-top","1px solid var("+bt.borderSubtle+")"),Ko(0)]);let Z4=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:J4}),i("button",{children:"x",className:X4,onClick:e=>t()})],className:H4}),i("div",{children:e.children,className:Q4}),L(e.footer,null,e=>i("div",{children:e,className:Y4}))],className:W4,style:L(e.width,{},e=>({width:e})),onClick:e=>{e.stopPropagation()}}),className:K4,onClick:e=>t()}):null};function e5(e){switch(e.TAG){case"Invalid":return e._1;case"Valid":case"Pending":return 0}}function t5(e){return[e._0,e5(e)]}function n5(e,t){return Ee(t,e,(e,t)=>t(e))}function r5(e){switch(e.TAG){case"Invalid":return e;case"Valid":case"Pending":return{TAG:"Valid",_0:e._0}}}function i5(e){if(!e.includes("."))return e;let t=e.replace(/0+$/,"");return t.endsWith(".")?t.slice(0,t.length-1|0):t}function o5(e){let t=t5(e),n=t[0];return isFinite(n)&&(0|n)===n?r5(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a whole number",tl:t[1]}}}function s5(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return 0|n._0}function a5(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONNumber"===n.TAG)return n._0}function l5(e,t){let n=z(Xe(e,t),ut);if("object"==typeof n&&"JSONString"===n.TAG)return n._0}function c5(e){let t=s5(e,"minLength"),n=s5(e,"maxLength"),r=z(l5(e,"pattern"),e=>new RegExp(e)),i=function(e){let t=l5(e,"format");if("cuid"===l5(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:l5(e,"description")}}function u5(e,t){return{min:a5(e,"minimum"),max:a5(e,"maximum"),integer:t}}function d5(e){return{minItems:s5(e,"minItems"),maxItems:s5(e,"maxItems")}}function f5(e){if("object"!=typeof e)return!1;switch(e.TAG){case"TextField":case"NumberField":case"EnumField":case"RefField":case"ItemsField":case"MemberField":return e.required}}function h5(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 p5(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 g5(e,t,n){let r=void 0!==t?t:[],i={};(void 0!==n?n:[]).forEach(e=>{i[e.fieldName]=e});let o={},s={};r.forEach(e=>{let t=h5(e.propertyKey);if(void 0!==t){let n=t[0],r=U(Xe(s,n),[]);return r.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(s[n]=r)}o[e.propertyKey]=e});let a=ut(e);if("object"!=typeof a)return[];if("JSONObject"!==a.TAG)return[];let l,c=a._0,u=Xe(c,"required");if(void 0!==u){let e=ut(u);l="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 l=[];let d=Xe(c,"properties");if(void 0===d)return[];let f=ut(d);return"object"!=typeof f?[]:"JSONObject"===f.TAG?me(Qe(f._0),e=>{let t=e[1],n=e[0],r=ut(t);if("object"!=typeof r)return;if("JSONObject"!==r.TAG)return;let a=r._0;if($(Xe(a,"const")))return;let c,u=Xe(a,"type");if(void 0!==u){let e=ut(u);c="object"!=typeof e||"JSONString"!==e.TAG?"string":e._0}else c="string";let d,f=l.some(e=>e===n),h=Xe(o,n),p=Xe(i,n);if(void 0!==h)d=h.multi?h.entityNamePlural:h.entityName;else{let e=Xe(a,"title");if(void 0!==e){let t=ut(e);d="object"!=typeof t||"JSONString"!==t.TAG?lt(n):t._0}else d=lt(n)}let g,m,v=Xe(a,"enum");if(void 0!==v){let e=ut(v);g="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 g=void 0;if($(p))m=z(p,e=>({TAG:"MemberField",options:e.options,visual:e.visual,required:f}));else if(void 0!==h)m={TAG:"RefField",queryField:h.queryField,singleQueryField:h.singleQueryField,labelField:h.labelField,multi:h.multi,required:f,constraints:h.multi?d5(a):{}};else if("boolean"===c)m="BoolField";else if(void 0!==g)m={TAG:"EnumField",options:g,required:f};else switch(c){case"array":let e=p5(a);m=void 0!==e?{TAG:"ItemsField",itemSchema:e,itemRefFields:U(Xe(s,n),[]),required:f}:{TAG:"TextField",required:f,constraints:c5(a)};break;case"integer":m={TAG:"NumberField",required:f,constraints:u5(a,!0)};break;case"number":m={TAG:"NumberField",required:f,constraints:u5(a,!1)};break;default:m={TAG:"TextField",required:f,constraints:c5(a)}}return z(m,e=>({key:n,label:d,fieldType:e,propSchema:t}))}):[]}function m5(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 v5(e,t){return j(z(Xe(e,t),Bt),ht)}function y5(e,t){let n=function(e){return U(j(j(ht(e),e=>Xe(e,"properties")),ht),{})}(e),r=vP(e),i={};return Qe(t).forEach(e=>{let t=e[1],o=e[0],s=function(e,t){return U(j(j(v5(e,t),e=>Xe(e,"type")),dt),"string")}(n,o),a=function(e,t){return $(j(j(v5(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(qt(n),e=>e),n)}}(s,a,t))}),i}function b5(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 _5=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function x5(e){let t=t5(e),n=t[0];return null!==_5.exec(n)?r5(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid email address",tl:t[1]}}}function S5(e){let t,n=t5(e),r=n[0];try{new URL(r),t=!0}catch(i){t=!1}return t?r5(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid URL",tl:n[1]}}}let w5=/^[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 E5(e){let t=t5(e),n=t[0];return null!==w5.exec(n)?r5(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid UUID",tl:t[1]}}}let k5=/^c[a-z0-9]{23,24}$/;function C5(e){let t=t5(e),n=t[0];return null!==k5.exec(n)?r5(e):{TAG:"Invalid",_0:n,_1:{hd:"Must be a valid CUID",tl:t[1]}}}function A5(e){let t=t5(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]}}:r5(e)}function N5(e){let t=e5(e);if(0!==t)return t.hd}function T5(e,t,n){if(""===e)return t?function(e){let t=t5(e),n=t[0];return n.length>0?r5(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=t5(t),r=n[0];return r.length>=e?r5(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=t5(t),r=n[0];return r.length<=e?r5(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 x5;case"Url":return S5;case"Uuid":return E5;case"Cuid":return C5;case"DateTime":return A5}}(e))}),M(n.pattern,e=>{r.push(function(e,t){return n=>{let r=t5(n),i=r[0];return null!==e.exec(i)?r5(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}:n5({TAG:"Pending",_0:e},xe(r))}function R5(e,t,n){if(""===e)return t?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e};let r=qt(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(o5),M(n.min,e=>{i.push(function(e){return t=>{let n=t5(t),r=n[0];return r>=e?r5(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at least "+i5(e.toString()),tl:n[1]}}}}(e))}),M(n.max,e=>{i.push(function(e){return t=>{let n=t5(t),r=n[0];return r<=e?r5(t):{TAG:"Invalid",_0:r,_1:{hd:"Must be at most "+i5(e.toString()),tl:n[1]}}}}(e))});let o=e5(n5({TAG:"Pending",_0:r},xe(i)));return 0!==o?{TAG:"Invalid",_0:e,_1:o}:{TAG:"Valid",_0:e}}function D5(e,t){return t&&""===e?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e}}function I5(e,t){let n=e.propSchema;if(void 0!==n&&function(e,t){return L(VD(e,t),!1,e=>$(e.input))}(e.key,n)){let r=f5(e.fieldType),i=function(e,t,n,r){return j(j(VD(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 T5(t,r.required,r.constraints);case"NumberField":return R5(t,r.required,r.constraints);case"EnumField":case"MemberField":return D5(t,r.required);case"RefField":return r.multi?function(e,t,n){let r=n3(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):D5(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=g5(n,r,void 0),s=me(i.map((e,t)=>{let n=b5(e);return me(o,e=>z(N5(I5(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 F5(e){return"var("+e+")"}let O5=Ls([qo("flex"),Go("column"),zo("gap",F5(_t.md))]),P5=Ls([qo("flex"),Go("column"),zo("gap","4px")]),M5=Ls([zo("color",F5(bt.textSecondary)),zo("font-size",F5(xt.sizeSm)),zo("font-weight",F5(xt.weightMedium))]),L5=Ls([zo("color",F5(bt.error)),ts(Ts(2))]),z5=Ls([zo("background",F5(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",F5(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("font-size",F5(xt.sizeMd)),zo("color",F5(bt.textPrimary)),zo("outline","none"),bs({NAME:"percent",VAL:100}),zo("transition","border-color 120ms, box-shadow 120ms"),Es([zo("border-color",F5(bt.brand))])]),j5=Ls([zo("border-color",F5(bt.error)),Es([zo("border-color",F5(bt.error)),zo("box-shadow","0 0 0 2px color-mix(in srgb, var("+bt.error+") 25%, transparent)")])]),U5=Ls([zo("color",F5(bt.error)),zo("font-size",F5(xt.sizeXs)),zo("min-height","1.1em"),zo("line-height","1.1"),rs(Ts(2))]),B5=Ls([$o("pointer"),ns(Ts(6))]),$5=Ls([zo("background",F5(bt.brand)),zo("color",F5(bt.textOnBrand)),zo("border","none"),zo("border-radius",F5(St.sm)),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("font-size",F5(xt.sizeMd)),$o("pointer"),Uo("flexStart"),zo("transition","opacity 120ms")]),q5=Ls([cs(.5),$o("notAllowed")]),G5=Ls([qo("flex"),Go("column"),zo("gap",F5(_t.sm)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",F5(St.sm)),zo("padding",F5(_t.sm))]),V5=Ls([zo("color",F5(bt.textSecondary)),zo("font-size",F5(xt.sizeSm))]),K5=Ls([qo("flex"),jo("flexStart"),zo("gap",F5(_t.sm)),zo("padding-bottom",F5(_t.sm)),zo("border-bottom","1px solid var("+bt.border+")")]),W5=Ls([qo("flex"),Wo("wrap"),zo("gap",F5(_t.sm)),Vo(1),ls(Ts(0))]),H5=Ls([zo("background",F5(bt.surface)),zo("color",F5(bt.textPrimary)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",F5(St.sm)),zo("padding","var("+_t.xs+") var("+_t.sm+")"),zo("font-size",F5(xt.sizeSm)),$o("pointer")]),J5=Ls([zo("margin-top","1.4em")]),X5=Ls([Uo("flexStart")]),Q5=Ls([qo("flex"),Wo("wrap"),zo("gap",F5(_t.sm))]),Y5=Ls([qo("flex"),Go("column"),jo("center"),zo("gap","4px"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",F5(St.sm)),zo("padding","4px"),zo("background",F5(bt.surface)),$o("pointer"),bs(Ts(96))]),Z5=Ls([zo("border-color",F5(bt.brand)),zo("box-shadow","0 0 0 2px color-mix(in srgb, var("+bt.brand+") 35%, transparent)")]),e6=Ls([bs({NAME:"percent",VAL:100}),Ho(Ts(64)),zo("object-fit","cover"),zo("border-radius",F5(St.sm))]),t6=Ls([zo("font-size",F5(xt.sizeXs)),zo("color",F5(bt.textSecondary)),zo("max-width","100%"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),n6=Ls([zo("color",F5(bt.textSecondary)),zo("font-size",F5(xt.sizeSm))]);function r6(e){let t=e.error;return r("div",{children:[r("label",{children:[e.label,e.required?i("span",{children:"*",className:L5}):null],className:M5}),e.children,i("div",{children:void 0!==t?t:null,className:U5})],className:P5})}function i6(e){let t=e.onBlur,n=e.onChange,o=e.value,s=e.options;return 0!==s.length?e.visual?i("div",{children:s.map(e=>{let s=e.value===o,a=e.image;return r("button",{children:[void 0!==a?i("img",{className:e6,alt:e.label,src:a}):null,i("span",{children:e.label,className:t6,title:e.label})],"aria-pressed":s?"true":"false",className:s?Y5+" "+Z5:Y5,type:"button",onBlur:e=>t(),onClick:t=>n(s?"":e.value)},e.value)}),className:Q5}):i("select",{children:(e.required&&""===o?[i("option",{children:"—",value:""},"")]:[]).concat(s.map(e=>i("option",{children:e.label,value:e.value},e.value))),className:e.hasError?z5+" "+j5:z5,value:o,onBlur:e=>t(),onChange:e=>n(e.target.value)}):i("div",{children:"Nothing to choose from yet.",className:n6})}function o6(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=f5(l.fieldType),f=c?z5+" "+j5:z5,h=e=>o(l.key),p=l.propSchema,g=void 0!==p?function(e,t,n,r,i,o,s){return z(j(VD(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:B5,checked:"true"===a,type:"checkbox",onBlur:h,onChange:e=>s(l.key,e.target.checked?"true":"false")}),"Enabled"],className:M5});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(v3,{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)});case"MemberField":return i(i6,{options:m.options,visual:m.visual,value:a,required:m.required,hasError:c,onChange:e=>s(l.key,e),onBlur:()=>o(l.key)})}}function s6(e){let t=e.showError,n=e.onBlur,o=e.onChange,s=e.itemRefFields,a=e.itemSchema,l=e.fieldKey,c=p(()=>g5(a,s,void 0),[a,s]),u=function(e,t){let n,r=m5(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(b5(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=>y5(t,e)))}(e,a));return r("div",{children:[0===u.length?i("div",{children:"No rows yet.",className:V5}):null,u.map((e,o)=>r("div",{children:[i("div",{children:c.map(r=>{let s=U(Xe(e,r.key),""),a=t?N5(I5(r,s)):void 0;return i(r6,{label:r.label,required:f5(r.fieldType),error:a,children:i(o6,{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:W5}),i("button",{children:"Remove","aria-label":"Remove row "+(o+1|0).toString(),className:H5+" "+J5,type:"button",onClick:e=>d(u.filter((e,t)=>t!==o))})],className:K5},o.toString())),i("button",{children:"Add row",className:H5+" "+X5,type:"button",onClick:e=>d(u.concat([m5(c)]))})],className:G5})}function a6(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=f5(c.fieldType),h=u&&$(o),p=c.fieldType,g=0;return"object"!=typeof p||"ItemsField"!==p.TAG?g=1:t=i(s6,{fieldKey:c.key,itemSchema:p.itemSchema,itemRefFields:p.itemRefFields,value:l,onChange:a,onBlur:s,showError:u}),1===g&&(t=i(o6,{field:c,value:l,onChange:a,onBlur:s,hasError:h,autoFocus:d})),i(r6,{label:c.label,required:f,error:h?o:void 0,children:t})}let l6=function(e){let t=e.memberFields,n=e.refFields,o=e.initialValues,a=e.submitLabel,l=e.onSubmit,c=e.schema,u=void 0!==a?a:"Submit",d=void 0!==n?n:[],f=void 0!==t?t:[],h=p(()=>g5(c,d,f),[c,d,f]),g=s(()=>{let e=m5(h);return M(o,t=>{Qe(t).forEach(t=>{e[t[0]]=t[1]})}),e}),m=g[1],v=g[0],y=s(()=>({})),b=y[1],_=y[0],x=s(()=>!1),S=x[1],w=x[0],E=p(()=>h.map(e=>{let t=U(Xe(v,e.key),"");return[e.key,I5(e,t)]}),[h,v]),k=E.every(e=>function(e){return function(e){switch(e.TAG){case"Valid":return!0;case"Invalid":case"Pending":return!1}}(e)}(e[1])),C={};E.forEach(e=>{let t=N5(e[1]);void 0===t||(C[e[0]]=t)});let A=(e,t)=>m(n=>{let r=Ze(Qe(n));return r[e]=t,r}),N=e=>b(t=>{let n=Ze(Qe(t));return n[e]=!0,n}),T=w&&!k,R=T?$5+" "+q5:$5;return r("form",{children:[h.map((e,t)=>{let n=U(Xe(_,e.key),!1);return i(a6,{field:e,value:U(Xe(v,e.key),""),onChange:A,onBlur:N,errorMessage:Xe(C,e.key),showError:n||w,autoFocus:0===t},e.key)}),i("button",{children:u,className:R,disabled:T,type:"submit"})],className:O5,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),S(e=>!0),k)return l(v)}})};function c6(e){switch(e){case"SubmitStarted":return!1;case"FormOpened":case"SubmitFailed":return!0}}let u6=l(void 0),d6=u6.Provider;let f6=function(e){return c(d6,{value:e.session,children:e.children})};let h6=Ls([qo("flex"),Go("column"),zo("gap",function(e){return"var("+e+")"}(_t.md))]);let p6=function(e){let t=e.submitLabel,n=e.onSubmit,o=e.memberFields,a=e.refFields,l=e.ownerValue,c=e.ownerField,u=e.injectNewId,d=e.aggregateIdField,f=e.aggregateId,g=e.schema,m=void 0!==u&&u,v=void 0!==a?a:[],y=void 0!==o?o:[],b=void 0!==t?t:"Submit",_=s(()=>{}),x=_[1],S=s(()=>!1),w=S[1],E=s(()=>crypto.randomUUID())[0],k=h(c6("FormOpened")),C=p(()=>({armed:k}),[]),A=void 0!==c&&void 0!==l?[c,l]:void 0,N=me([void 0!==f?void 0!==d||m?d:void 0:m?d:void 0,z(A,e=>e[0])],e=>e),T=0===N.length?g:U(z(ht(g),e=>{let t=Ze(Qe(e));return M(j(Xe(t,"properties"),ht),e=>{let n=Ze(Qe(e).filter(e=>!N.includes(e[0])));t.properties=n}),t}),g);return i(f6,{session:C,children:r("div",{children:[L(_[0],null,e=>i(MW,{variant:"Error",message:e})),S[0]?i(O2,{label:"Submitting..."}):null,i(l6,{schema:T,onSubmit:e=>{let t=Ze(Qe(e));M(A,e=>{t[e[0]]=e[1]}),M(f,e=>{t[U(d,"id")]=e}),m&&(t[U(d,"id")]=E),w(e=>!0),x(e=>{}),k.current=c6("SubmitStarted"),n(t).then(e=>{if(w(e=>!1),"object"==typeof e){let t=e._0;k.current=c6("SubmitFailed"),x(e=>t)}return Promise.resolve()})},submitLabel:b,initialValues:e.initialValues,refFields:v,memberFields:y})],className:h6})})};function g6(e,t,n){let r=void 0!==t?t:"",i=void 0!==n?n:"";return""===i?e+":"+r:e+":"+r+":"+i}let m6=function(e){let t=e.submitLabel,n=e.scope,r=e.onSucceeded,o=e.beforeSend,s=e.onClose,a=e.state,l=void 0!==o?o:e=>{},c=void 0!==r?r:e=>{},u=void 0!==t?t:"Execute",d=sF(),f=f2(),h=gl(),p=a.command;return i(Z4,{isOpen:!0,onClose:()=>s(),title:p.label,children:i(p6,{schema:p.schema,aggregateId:a.rowId,aggregateIdField:p.aggregateIdField,injectNewId:"Collection"===p.level,ownerField:p.ownerField,ownerValue:p.ownerValue,initialValues:a.initialValues,refFields:p.refFields,memberFields:U(a.memberFields,[]),onSubmit:e=>void 0!==f?(l(e),ce(f(p.mutationDocument,y5(p.schema,e)).then(e=>{if("object"!=typeof e)return"Accepted"===e?(s(),c(!1),Promise.resolve("Ok")):(s(),c(!0),Promise.resolve("Ok"));{if("Rejected"===e.TAG){let t=e._0;return m2(d,h,t.errorCode,t.detail).then(e=>Promise.resolve({TAG:"Err",_0:e}))}let t=e._0;return console.error("[AutoUI] "+L(n,"",e=>e+": ")+"command "+p.name+" not executed — "+t),Promise.resolve({TAG:"Err",_0:t})}}),e=>Promise.resolve({TAG:"Err",_0:"Request failed"}))):(s(),Promise.resolve("Ok")),submitLabel:u},a.formKey)})};function v6(){try{return R(globalThis.localStorage)}catch(e){return}}let y6="reventless.live.";function b6(e){let t=v6();if(void 0===t)return!1;try{let n=D(t).getItem(y6+e);return null!=n&&"true"===n}catch(n){return!1}}function _6(e){let t=s(()=>b6(e)),n=t[1],r=t[0];a(()=>{n(t=>b6(e))},[e]);let i=f(()=>{let t=!r;!function(e,t){let n=v6();if(void 0!==n)try{return void D(n).setItem(y6+e,t?"true":"false")}catch(r){return}}(e,t),n(e=>t)},[r,e]);return[r,i]}function x6(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 S6(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 w6(){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=x6(e);J(n+t+r)};return{params:t,get:e=>Xe(t,e),set:(e,n)=>i(S6(t,[[e,n]])),setMany:e=>i(S6(t,e))}}let E6=l(void 0),k6=E6.Provider;let C6=function(e){return c(k6,{value:e.chrome,children:e.children})};function A6(e){return"var("+e+")"}let N6=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",A6(_t.md)),Vo(1),zo("min-height","160px"),ms("center"),zo("padding",A6(_t.lg))]),T6=Ls([zo("font-size","32px"),zo("color",A6(bt.warning)),zo("line-height","1")]),R6=Ls([zo("color",A6(bt.textPrimary)),zo("font-size",A6(xt.sizeLg)),zo("font-weight",A6(xt.weightMedium)),Zo(Ts(0))]),D6=Ls([zo("color",A6(bt.textSecondary)),zo("font-size",A6(xt.sizeSm)),zo("line-height",A6(xt.lineHeightNormal)),zo("max-width","440px"),Zo(Ts(0))]),I6=Ls([zo("background","transparent"),zo("color",A6(bt.textSecondary)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",A6(St.md)),zo("padding","var("+_t.xs+") var("+_t.md+")"),zo("font-size",A6(xt.sizeSm)),zo("cursor","pointer"),rs(Ts(4))]);let F6=function(e){let t=e.title,n=void 0!==t?t:"Unavailable";return r("div",{children:[i("div",{children:"( ! )",className:T6}),i("h3",{children:n,className:R6}),i("p",{children:e.detail,className:D6}),L(e.onRetry,null,e=>i("button",{children:"Try again",className:I6,onClick:t=>e()}))],className:N6})};function O6(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let P6=[["subscribe","unsubscribe"],["enable","disable"],["optin","optout"],["allow","deny"],["grant","revoke"],["add","remove"]];function M6(e,t,n){let r=n[1];return!(!e.includes(n[0])||!t.includes(r))&&!e.includes(r)}function L6(e,t,n){let r=lr(e,t);if(2!==r.length)return;let i=r[0],o=r[1],s=j(n,e=>function(e,t){let n=t.enable,r=t.disable;if(void 0===n)return;if(void 0===r)return;let i=e.find(e=>e.name===n),o=e.find(e=>e.name===r);return void 0!==i&&void 0!==o&&i.name!==o.name?{enable:i,disable:o,tier:"Declared"}:void 0}(r,e));return void 0!==s?s:L(n,!1,e=>!!$(e.enable)||$(e.disable))?void 0:function(e,t){let n=O6(e.name),r=O6(t.name),i=P6.some(e=>M6(n,r,e)),o=P6.some(e=>M6(r,n,e));return i?o?void 0:{enable:e,disable:t,tier:"VerbPair"}:o?{enable:t,disable:e,tier:"VerbPair"}:void 0}(i,o)}function z6(e){return U(e.split("/").at(-1),e)}let j6=["alttext","alt","caption","description"];function U6(e,t,n,r){let i=dt(e);return void 0!==i?{value:i,label:z6(i),image:r?i:void 0}:j(ht(e),e=>z(j(j(t,t=>Xe(e,t)),dt),t=>{let i=U(P(j(j(n,t=>Xe(e,t)),dt),e=>""!==e),z6(t));return{value:t,label:i,image:r?t:void 0}}))}function B6(e,t,n,r){return z(function(e){return en(Bt(e)).memberTarget}(t),t=>{let i=j(t.content,yn),o=vt(i,"Image"),s=j(j(r,e=>Mn(e).find(e=>e[0]===t.field)),e=>$t(e[1])),a=void 0!==s&&void 0!==i?function(e,t){return j(j(j(ht(Bt(e)),e=>Xe(e,"properties")),ht),e=>z(Qe(e).find(e=>L(er(e[0],e[1]),!1,e=>e.semantic===t)),e=>e[0]))}(s,i):void 0,l=void 0!==s&&void 0!==a?function(e,t){let n=j(rr(e,void 0,void 0).labelField,e=>{if(e!==t)return e});return void 0!==n?n:z(Mn(e).find(e=>{let n=e[0];return!(n===t||!Un(e[1]))&&j6.includes(n.toLowerCase())}),e=>e[0])}(s,a):void 0,c=me(U(j(Xe(n,t.field),pt),[]),e=>U6(e,a,l,o));return{fieldName:e,options:c,visual:o}})}function $6(e,t,n){return me(Mn(e),e=>B6(e[0],e[1],t,n))}function q6(e){return L(j(j(ht(e),e=>Xe(e,"properties")),ht),[],Qe)}function G6(e){return 1!==e.length?void 0:T(e[0])}function V6(e,t){return z(G6(q6(e.schema).filter(e=>t(e[0],e[1]))),e=>e[0])}function K6(e,t,n){return G6(me(e,e=>j(V6(e,n),n=>{if(function(e,t){return i4(e.schema).every(n=>n===t||"id"===n||vt(n,e.aggregateIdField))}(e,n))return{command:e,argument:n,tier:t}})))}function W6(e,t){return vt(en(e).storeTarget,t)}let H6={contents:[]};function J6(e,t,n){let r=e+"."+t.command+"."+U(t.field,"")+"."+n;if(!H6.contents.some(e=>e===r))return H6.contents.push(r),void console.error('[AutoUI] x-reventless-setter on field "'+e+'": '+n)}function X6(e,t,n,r){let i=G6(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?q6(e.schema).some(e=>e[0]===i)?i:void 0:B(j(r,t=>V6(e,(e,n)=>W6(n,t))),V6(e,(e,t)=>e===n))}(i,t,n,r);return void 0!==e?{command:i,argument:e,tier:"Declared"}:void J6(n,t,'"'+t.command+'" takes no argument this field could fill — the slot stays static.')}J6(n,t,'no exposed instance command named "'+t.command+'" — the slot stays static.')}function Q6(e,t,n){return j(function(e,t){return z(q6(e).find(e=>e[0]===t),e=>e[1])}(e,t),e=>{let r=en(e),i=r.storeTarget,o=n.filter(e=>"Instance"===e.level),s=r.setter;if(void 0!==s)return X6(o,s,t,i);let a=j(i,e=>K6(o,"StoreMatch",(t,n)=>W6(n,e)));return void 0!==a?a:K6(o,"NameMatch",(e,n)=>e===t)})}function Y6(e,t){let n=e.requiredRole;return void 0===n||t.includes(n)}let Z6=function(e){let t=e.resource,n=G4(t,void 0),r={readModelName:t.name,rows:n.rows,schema:t.schema,semantics:e.resourceSemantics,window:ua(n.canLoadMore),onOpenRow:(e,t)=>{},role:v4},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:y4,resourceRef:e.resourceRef,assignCommand:e.assignCommand},s=n.fetchState;return"object"!=typeof s?"Loading"===s?i(O2,{}):e.mode.render([r,o]):"Error"===s.TAG?i(G1,{detail:s._0,onRetry:()=>n.refetch()}):i(F6,{detail:s._0,onRetry:()=>n.refetch()})},e8=l(void 0),t8=e8.Provider;let n8=function(e){return c(t8,{value:e.refresh,children:e.children})};function r8(e){return"var("+e+")"}let i8=Ls([qo("flex"),Go("column"),zo("gap",r8(_t.lg))]),o8=Ls([qo("flex"),Go("column"),zo("gap",r8(_t.lg))]),s8=Ls([qo("flex"),Go("column"),zo("gap",r8(_t.sm))]),a8=Ls([zo("font-size",r8(xt.sizeSm)),zo("font-weight",r8(xt.weightMedium)),zo("color",r8(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em"),Zo(Ts(0))]),l8=Ls([qo("flex"),jo("center"),zo("gap",r8(_t.sm)),zo("flex-wrap","wrap")]),c8=Ls([qo("inlineFlex"),jo("center"),zo("gap","6px"),zo("margin-left","auto"),zo("font-size",r8(xt.sizeSm)),zo("color",r8(bt.textSecondary)),zo("cursor","pointer"),zo("white-space","nowrap")]),u8=Ls([qo("flex"),Go("column"),zo("gap",r8(_t.sm)),zo("align-items","stretch"),xs("& ."+c8,[zo("margin-left","0")])]),d8=Ls([qo("flex"),jo("center"),Jo("flexEnd"),zo("gap",r8(_t.xs)),zo("padding-top",r8(_t.sm))]),f8=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",r8(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",r8(bt.textSecondary)),zo("font-size",r8(xt.sizeSm)),$o("pointer"),Cs([zo("background",r8(bt.surfaceSubtle)),zo("color",r8(bt.textPrimary))]),ws([zo("opacity","0.4"),$o("notAllowed")])]);let h8={contents:[]},p8={contents:[]};let g8={contents:[]};let m8=function(e){let t,n=e.ownerScoped,l=e.archiveOffered,c=e.rowActions,u=e.schedulerJoin,d=e.uiHints,f=e.liveOffered,p=e.sortKeyField,g=e.byIdsQueryDocument,m=e.byIdsQueryField,v=e.detailQueryDocument,y=e.singleQueryField,b=e.drillPath,_=e.openRowId,x=e.pluginId,S=e.detailView,w=e.rows,E=e.readModel,k=void 0!==b?b:[],C=void 0===f||f,A=void 0!==c?c:[],N=void 0!==l&&l,T=void 0!==n&&n,I=sF(),F=aF(),O=s(()=>{}),B=O[1],G=s(()=>{}),V=G[1],K=G[0],W=s(()=>({})),H=W[1],X=W[0],Q=s(()=>"Loaded"),Y=Q[1],Z=Q[0],ee=s(()=>{}),te=ee[1],ne=ee[0],re=oP(),ie=L(re,!1,e=>e.isLive(E.queryField)),oe=_6(U(x,"default")+"."+E.name),se=oe[0],le=ie&&C&&se,ue=gl(),de=z(x,e=>({pluginId:e,viewName:E.name})),fe=j(d,e=>tO(e,E.name)),he=wO(E.schema,fe,{registry:ue,ownEntity:de}),pe=L(j(fe,e=>e.suppress),!1,e=>e.includes(E4));if(void 0!==u&&(ve=E.schema,!pe&&k4(ve))){let e=OF(E4);t=void 0===e||he.some(t=>t.id===e.id)?he:he.concat([e])}else t=he;var ve;let ye=UF(x,E.name,void 0),be=s(()=>BF(ye)),_e=be[1],xe=_G(),Se=xe.narrow,we=xG(xe),Ee=EO(be[0],fe,un(E.schema),we,t),ke=void 0!==u&&void 0!==Ee&&Ee.id===E4,Ce=$(S)&&!ke,Ae="reventless.layout."+U(x,"default")+"."+E.name,Ne=s(()=>function(e){try{return R(localStorage.getItem(e))}catch(t){return}}(Ae)),Te=Ne[1],Re=function(e,t,n,r){if(!r)return"Full";let i=j(e,kO);if(void 0!==i)return i;let o=j(j(t,e=>e.layout),kO);return void 0!==o?o:U(j(n,kO),"Full")}(Ne[0],fe,function(e){return j(j(ht(e),e=>Xe(e,"x-reventless-layout")),dt)}(E.schema),Ce),De=!(void 0===re||!le)&&"Open"!==re.statusFor(re.apiForReadModel(E.queryField)),Ie=le&&!De,Fe=s(()=>0),Oe=Fe[1],Pe=Fe[0],Me=h({}),Le=h(void 0),ze=h(X2.make()),je=h(X2.make()),Be=h(Z2.make()),$e=h(Z2.make()),qe=h(new Map),Ve=e=>{qe.current.set(e,Date.now())},Ke=w6(),We=x6(Ke.params),He=h(hF),Je=ae(),Ye=z(x,e=>Ue(_l(e,E.name))+We),et=ln(E.schema),tt=$(sn(E.schema)),nt=e=>z(j(Xe(e,"id"),dt),t=>{let n=j(et,t=>j(Xe(e,t),dt));return void 0!==n?function(e,t){return encodeURIComponent(e)+"/"+encodeURIComponent(t)}(t,n):t}),rt=e=>void 0!==et?L1(e)[0]:e,it=(e,t)=>{let n=void 0===e||e,r={};if(void 0!==et){let e=L1(t);r.id=e[0],M(e[1],e=>{r.subId=e})}else r.id=t;return tt&&(r.includeRetired=n),r},ot=void 0!==_?_:K,st=e=>void 0!==x?Je(Sl(x,E.name,e,[])+We):V(t=>e),at=()=>void 0!==Ye?Je(Ye):V(e=>{}),ct=SW(E.schema),ft=xW(E.schema),gt=ct.hasFilter||ct.hasSort||ct.hasSearch,mt=rr(E.schema,j(d,e=>nO(e,E.name)),{field:E.labelField,source:E.labelFieldSource}),bt=LI(E.schema,void 0,ue,de,mt.labelField,mt.projectedLabelField),_t=Qa(E.schema,j(fe,e=>e.retiredLabel)),xt=tl.offered(N,_t),St=tl.showing(xt,Ke.get(tl.param)),wt=[];Qe(Ke.params).forEach(e=>{let t=e[1];if(""===t)return;let n=e[0];if("after"===n||"before"===n)return void wt.push(n+"="+t);if(n===tl.param&&xt)return void wt.push(n+"="+t);if(!gt)return;if("sort"===n||"dir"===n)return void wt.push(n+"="+t);if("q"===n&&ft.search)return void wt.push(n+"="+t);if(!n.startsWith("f."))return;let r=n.slice(2),i=L(bt.find(e=>e.key===r),!1,e=>_W(e).filter);i&&wt.push(n+"="+t)});let Et=wt.toSorted((e,t)=>e===t?0:e<t?-1:1).join("|"),kt={};if(gt){let e={};Qe(Ke.params).forEach(t=>{let n=t[0];n.startsWith("f.")&&(e[n.slice(2)]=t[1])});let t=wW(e,bt),n=U(Ke.get("q"),""),r=kW(t[0],n,ft,bt),i="desc"===Ke.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]])}(EW(Ke.get("sort"),i,bt));M(r,e=>{kt.filter=e}),M(o,e=>{kt.orderBy=e})}var Ct,At,Nt;(Ct=Ke.get("after"),At=Ke.get("before"),Nt=50,void 0!==At&&""!==At?[["before",At],["first",Nt]]:void 0!==Ct&&""!==Ct?[["first",Nt],["after",Ct]]:[["first",Nt]]).forEach(e=>{kt[e[0]]=e[1]}),xt&&(kt.includeRetired=St);let Tt=q4(E,kt,Et,void 0,()=>H(e=>({})),void 0),It=Tt.refetch,Ft=Tt.fetchState,Ot=Tt.pageInfo,Pt=Tt.setRows,Mt=Tt.rows,Lt=e=>{if(void 0===v)return;if(void 0===y)return;let t=((e,t,n)=>void 0!==F?()=>F(e,it(void 0,n)).then(e=>[e.data,OP(e,t)]):void 0!==I?()=>I(e,it(void 0,n)).then(e=>[e,void 0]):void 0)(v,y,e);return void 0!==t?(Y(e=>"Loading"),void ce(t().then(t=>{let n=t[1],r=j(ht(t[0]),e=>Xe(e,y)),i=0;return void 0!==n||void 0===r||"JSONNull"===ut(r)?i=1:(H(t=>{let n=Ze(Qe(t));return n[e]=r,n}),Y(e=>"Loaded")),1===i&&(H(t=>Ze(Qe(t).filter(t=>t[0]!==e))),Y(e=>void 0!==n?{TAG:"Refused",_0:n.message}:{TAG:"Error",_0:"Detail not found"})),Promise.resolve()}),e=>(Y(e=>({TAG:"Error",_0:"Failed to load detail"})),Promise.resolve()))):void 0};a(()=>{let e=void 0!==_?_:K;void 0!==e&&(q(Xe(X,e))?Lt(e):Y(e=>"Loaded"))},[_,K]);let zt=Ge(),jt=P1(),Ut=L(j(mG(),e=>e.identity),[],e=>e.groups),Bt=(e,t)=>z(P(Q6(E.schema,t,E.commands),e=>Y6(e.command,Ut)),t=>()=>B(n=>({command:t.command,rowId:e,formKey:t.command.name+":"+e}))),$t=e=>{let t=j(Xe(e,"id"),dt);return void 0!==t?x3(A,e,E.lifecycleField,_t).map(n=>{let r=E3(n,t,e);return{label:n.label,run:()=>B(e=>({command:r.command,rowId:void 0,initialValues:r.initialValues,navigateTo:r.navigateTo,formKey:r.formKey}))}}):[]},qt=(e,t)=>$t(U(ht(t),{})),Gt=(void 0!==w?w:Mt).map(e=>U(ht(e),{})),Vt=NF(Gt,bt,ue,de,void 0),Kt={lookupLabel:(e,t)=>gF(Vt,e,ue,t),isMissing:(e,t)=>yF(Vt,e,ue,t),retiredBadge:(e,t)=>mF(Vt,e,ue,t),linkable:(e,t)=>vF(Vt,e,ue,t,N)},Wt=function(e,t){return void 0!==t&&""!==t?"Backward":void 0!==e&&""!==e?"Forward":"FirstPage"}(Ke.get("after"),Ke.get("before")),Ht=function(e,t){return!!e.hasNextPage||"Backward"===t}(Ot,Wt),Jt=function(e,t){return!!e.hasPreviousPage||"Forward"===t}(Ot,Wt),Xt=Ht||Jt,Qt=YI(bt,ue,zt,Xe,!0,Kt,de,(e,t)=>j(j(Xe(e,"id"),dt),e=>Bt(e,t)),_t,mt.labelField).map(e=>{if(!e.sortable)return e;if(!Xt)return e;let t=L(bt.find(t=>t.key===e.key),!1,e=>_W(e).sort);return{key:e.key,label:e.label,render:e.render,sortable:t,width:e.width}}),Yt=Ke.get("sort"),Zt="desc"===Ke.get("dir")?"Desc":"Asc",en=e=>Pt(t=>t.map(t=>{let n=M2(t);if(void 0===n)return t;let r=e.find(e=>vt(M2(e),n));return void 0!==r?r:t})),nn=void 0!==p?me(Mt,e=>j(j(ht(e),e=>Xe(e,p)),dt)):[],rn=e=>{let t=Ot.hasNextPage,n=nn.length;if(void 0===e)return!1;if(void 0===p)return!1;if(!t)return!1;if(n<=0)return!1;let r=nn[0];if("Asc"===Zt){let t=ge(nn,r,(e,t)=>e>t?e:t);return e>t}let i=ge(nn,r,(e,t)=>e<t?e:t);return e<i},on=e=>{if(0!==e.length)return Pt(t=>K2.drop(t,e))},an=()=>{let e=Object.keys(Me.current);if(Me.current={},Le.current=void 0,0!==e.length){if(e.length>10)return It();if(void 0!==m&&void 0!==g&&void 0!==I){let t={};return t.ids=e.map(e=>e),xt&&(t.includeRetired=St),void ce(I(g,t).then(t=>{let n=K2.fromBatch(e,t,m);return void 0!==n&&(en(n.rows),q(et)&&on(n.gone)),Promise.resolve()}),e=>Promise.resolve())}return void 0!==et||void 0===y||void 0===v||void 0===I?It():void e.forEach(e=>{let t=it(St,e);ce(I(v,t).then(t=>{let n=K2.fromSingle(t,y);return void 0!==n&&("object"!=typeof n?on([e]):en([n._0])),Promise.resolve()}),e=>Promise.resolve())})}},cn=e=>{Me.current[e]=!0;let t=Le.current;void 0!==t&&clearTimeout(t),Le.current=setTimeout(an,150)},dn=e=>Pt(t=>{let n=t.map(t=>{let n=M2(t);if(void 0===n)return t;let r=e.find(e=>vt(M2(e),n));return void 0!==r?r:t}),r=me(n,M2),i=e.filter(e=>{let t=M2(e);return void 0!==t&&!r.includes(t)});return n.concat(i)}),hn=e=>Mt.find(t=>vt(M2(t),e)),pn=e=>!Ie||L(e,!1,e=>q(hn(e))),gn=()=>{if(M(ot,Lt),pn(z(ot,rt)))return It()},mn=AF.useInvalidate();UW(E.queryField,"All",le,e=>{if(!X2.shouldApply(ze.current,e.id,e.seq))return;X2.record(ze.current,e.id,e.seq),mn(E.queryField);let t=hn(e.id),n=$(t);switch(e.changeKind){case"Added":if(!(e=>{let t=qe.current.get(e);return void 0!==t&&Date.now()-t<6e4})(e.id))return rn(e.sortKeyValue)?void 0:Oe(e=>e+1|0);if(qe.current.delete(e.id),n)return;let r=function(e,t){return V2({},e,t,void 0)}(e,E.schema);if(void 0!==et||void 0===r){let t=e.id;if(void 0!==et)return It();if(void 0!==m&&void 0!==g&&void 0!==I){let e={};return e.ids=[t],tt&&(e.includeRetired=St),void ce(I(g,e).then(e=>{let t=U(j(j(ht(e),e=>Xe(e,m)),pt),[]);return dn(t),Promise.resolve()}),e=>Promise.resolve())}if(void 0===y)return It();if(void 0===v)return It();if(void 0===I)return It();let n=it(St,t);return void ce(I(v,n).then(e=>{let t=j(ht(e),e=>Xe(e,y));return void 0!==t&&"JSONNull"!==ut(t)&&dn([t]),Promise.resolve()}),e=>Promise.resolve())}return dn([r]);case"Updated":if(void 0!==et)return n?cn(e.id):void 0;if(void 0===t)return;let i=rn(e.sortKeyValue),o=Z2.apply(Be.current,t,e,E.schema);return i||void 0===o?cn(e.id):en([o]);case"Removed":return n?void 0!==et?cn(e.id):Pt(t=>t.filter(t=>yt(M2(t),e.id))):void 0;case"BulkInvalidated":return Oe(e=>0),It()}},()=>It()),UW(E.queryField,{_0:U(z(ot,rt),"")},le&&$(ot),e=>{if(void 0===ot)return;if(e.id!==rt(ot))return;if(!X2.shouldApply(je.current,e.id,e.seq))return;X2.record(je.current,e.id,e.seq),mn(E.queryField);let t=e.changeKind;if(void 0!==et)switch(t){case"Updated":case"Removed":return Lt(ot);case"Added":case"BulkInvalidated":return}else switch(t){case"Updated":let t=j(Xe(X,ot),t=>Z2.apply($e.current,t,e,E.schema));return void 0!==t?(H(e=>{let n=Ze(Qe(e));return n[ot]=t,n}),Y(e=>"Loaded")):Lt(ot);case"Removed":return te(e=>ot);case"Added":case"BulkInvalidated":return}},()=>{void 0===ot||void 0===v||void 0===y||void 0===I||ce(I(v,it(void 0,ot)).then(e=>{let t=j(ht(e),e=>Xe(e,y)),n=0;return void 0!==t&&"JSONNull"!==ut(t)?(H(e=>{let n=Ze(Qe(e));return n[ot]=t,n}),Y(e=>"Loaded")):n=1,1===n&&te(e=>ot),Promise.resolve()}),e=>Promise.resolve())}),a(()=>{te(e=>{})},[U(ot,"")]);let vn=U(Ke.get("q"),""),yn={};Qe(Ke.params).forEach(e=>{let t=e[0];t.startsWith("f.")&&(yn[t.slice(2)]=e[1])});let bn,_n=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),"")}})}(bt,yn),xn=0!==_n.length,Sn=z(Yt,e=>({key:e,direction:"Asc"===Zt?"Asc":"Desc"})),wn=(e,t)=>{let n="Asc"===t?"asc":"desc";He.current=hF,Ke.setMany([["sort",e],["dir",n],["after",""],["before",""]])},En=(e,t)=>{He.current=hF,Ke.setMany([["f."+e,t],["after",""],["before",""]])},kn=()=>M(Ot.endCursor,e=>{He.current=function(e,t){return e.concat([U(t,"")])}(He.current,Ke.get("after")),Ke.setMany([["after",e],["before",""]])}),Cn=E.commands.filter(e=>"Instance"===e.level);if(0!==Cn.length||0!==A.length){let e=e=>{let t=j(Xe(e,"id"),dt),n=E.lifecycleField;if(void 0!==n){void 0!==Xe(e,n)?void 0===Rt(e,n)&&function(e,t,n){let r=U(e,"<no-plugin>")+"."+t;if(!p8.contents.some(e=>e===r))p8.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.')}(x,E.name,n):function(e,t,n){let r=U(e,"<no-plugin>")+"."+t+"."+n;if(!h8.contents.some(e=>e===r))h8.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.")}(x,E.name,n)}let r=Dt(Cn,e,E.lifecycleField).map(n=>({TAG:"Action",label:n.label,onClick:()=>B(r=>({command:n,rowId:t,initialValues:w3(n,e,void 0),memberFields:$6(n.schema,e,E.schema),formKey:g6(n.name,U(t,""),void 0)})),danger:!1})),o=$t(e).map(e=>({TAG:"Action",label:e.label,onClick:e.run,danger:!1}));return i(HQ,{items:r.concat(o),triggerLabel:"..."})},t={key:"__actions",label:"",render:e,sortable:!1,width:"56px"};bn=Qt.concat([t])}else bn=Qt;let An,Nn=E.commands.filter(e=>"Collection"===e.level),Tn=e=>{let t,n=e.map(e=>U(ht(e),{})),r=wW(yn,bt),i=gt&&ft.search?"":vn,o=EW(Yt,Zt,bt);return t="object"!=typeof o||"ServerSort"===o.TAG?[void 0,Zt]:[o._0,o._1],_1(b1(y1(n,bt,r[1]),bt,i),bt,t[0],t[1])},Rn=e=>{if(void 0!==Ee&&Ee.id!==DF){let n=z(mt.statusField,e=>h4(e,Cn,j(fe,e=>e.transitions))),r=y2(I,F,Cn,E.name,le,()=>It(),ue,jt.onNotice,Ve),o=function(e,t,n,r){return z(ar(t,j(n,e=>e.available)),t=>{let i=P(L6(e,t,n),e=>!!r||q(e.enable.ownerField));return{enable:z(i,e=>e.enable.name),disable:z(i,e=>e.disable.name),availableField:t.availableField}})}(Cn,E.schema,j(fe,e=>e.matrix),T),s={},a=e=>{Qe(U(z(d,t=>function(e,t){return U(j(j(e.fields,e=>Xe(e,t)),e=>e.values),{})}(t,e)),{})).forEach(e=>{s[e[0]]=e[1]})};a(E.name),M(o,e=>M(ar(E.schema,void 0),e=>a(E.name+"."+e.collectionField)));let l=mt.statusField,c=void 0!==l?(e,t)=>{let n=U(ht(t),{}),i=U(j(Xe(n,"id"),dt),e);return function(e,t,n,r){return l4(t).filter(e=>c4(e,r)).map(t=>({command:t,target:p4(t,e,n),needsInput:!s4(t,e)}))}(l,Cn,j(fe,e=>e.transitions),U(Rt(n,l),"")).map(e=>{let t=e.command,o=e.target,s=void 0!==o?d4(t,l,o):{};return{command:t.name,label:t.label,target:e.target,needsInput:e.needsInput,run:()=>{if(e.needsInput){let r=w3(t,n,void 0);return Qe(U(ht(s),{})).forEach(e=>{let t=e[0];M(dt(e[1]),e=>{r[t]=e})}),B(o=>({command:t,rowId:i,initialValues:r,memberFields:$6(t.schema,n,E.schema),formKey:g6(t.name,i,e.target)}))}r(t.name,i,s)}}})}:void 0,f=Tn(e).map(e=>e),h=(t=Ht,Jt?t?{TAG:"Partial",_0:"Between"}:{TAG:"Partial",_0:"ToEnd"}:t?{TAG:"Partial",_0:"FromStart"}:"Complete");if(void 0!==u&&Ee.id===E4){let e=rr(u.resource.schema,j(d,e=>nO(e,u.resource.name)),{field:u.resource.labelField,source:u.resource.labelFieldSource});return i(Z6,{mode:Ee,resource:u.resource,resourceSemantics:e,resourceRef:u.resourceRef,assignCommand:C4(Cn,u.resourceRef),eventReadModelName:E.name,eventSchema:E.schema,eventRows:f,eventWindow:h,eventSemantics:mt,eventAccent:j(fe,e=>e.accent),onOpenEvent:(e,t)=>M(j(ht(t),nt),st),onCommand:r})}let p=E.name,g=E.schema,m=j(fe,e=>e.accent),v=h,y=(e,t)=>M(j(ht(t),nt),st),b=r,_=Bt,x=0===A.length?void 0:qt,S={readModelName:p,rows:f,schema:g,semantics:mt,accent:m,window:v,onOpenRow:y,onCommand:b,statusCommandFor:n,fillSlot:_,rowActionsFor:x,rowCommandsFor:c,ownEntity:de,retired:_t,matrix:o,ownerScoped:T,valueLabels:s,refLabels:Kt};return Ee.render([S])}{let t=Tn(e),n=z(S,e=>e=>M(nt(e),st)),o=e=>U(nt(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(!g8.contents.some(e=>e===n))g8.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.")}(x,E.name),i(ca,{columns:e,data:t,keyFn:o,sortState:Sn,onSort:wn,onRowClick:n,activeKey:ot})},a=function(e){return tn(e,e=>e.groupBy)[0]}(E.schema);if(void 0===a)return s(bn,t);let l=P2(t,a,fn(E.schema,a)),c=l.length;if(1===c)return s(bn,t);if(0===c)return s(bn,t);let u=bn.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:a8}),s(u,e[1])],className:s8},t)}),className:o8})}var t},Dn=void 0!==w?Rn(w):"object"!=typeof Ft?"Loading"===Ft?i(O2,{}):Rn(Mt):"Error"===Ft.TAG?i(G1,{detail:Ft._0,onRetry:()=>It()}):i(F6,{detail:Ft._0,onRetry:()=>It()});if(void 0!==ot&&void 0!==S){let e=(void 0!==w?w:Mt).find(e=>vt(j(ht(e),nt),ot)),t=Xe(X,ot);An=[ot,S,void 0!==t?t:e]}else An=void 0;let In,Fn=e=>{let t=e[2],n=e[0];if(vt(ne,n))return i(G1,{title:"Entity removed",detail:"This entity no longer exists. Return to the list to continue.",onRetry:()=>at()});if(void 0!==t)return e[1](rt(n),k,D(t));let r=0,o=0,s=0;if("object"!=typeof Ft){if("Loading"===Ft)return i(O2,{});if("object"!=typeof Z){if("Loading"!==Z)return i(G1,{title:"Row not found",detail:"The row data is no longer in the current page."});s=4}else{if("Error"!==Z.TAG)return i(F6,{detail:Z._0,onRetry:()=>It()});r=2}}else s=4;if(4===s)if("object"!=typeof Z){if("Loading"===Z)return i(O2,{});o=3}else o=3;if(3===o&&"object"==typeof Ft){if("Error"===Ft.TAG)return i(G1,{detail:Ft._0,onRetry:()=>It()});r=2}return 2===r&&"object"==typeof Z&&"Error"===Z.TAG?i(G1,{detail:Z._0,onRetry:()=>It()}):i(F6,{detail:Ft._0,onRetry:()=>It()})},On=Ce?i("div",{children:[["full","Full","▭"],["split","Split","▤"]].map(e=>{let t,n=e[1],o=e[0];return t="Full"===Re?"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}}(Ae,o),Te(e=>o)}},o)}),"aria-label":"Layout",className:HF.Style.group,role:"group"}):null,Pn=NV(),Mn=C?i(z4,{live:se,canBeLive:ie,reconnecting:De,onToggle:oe[1]}):null,Ln=i(u2,{title:E.name,commands:Nn.map(e=>({key:e.name,label:"+ "+e.label,run:()=>B(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(Ee,DF,e=>e.id),onSelect:e=>{$F(ye,e,we),_e(t=>({mode:e,band:we}))}}):null,On,Mn]}),inBar:$(Pn)}),zn=TV(Pn,Ln),jn=void 0!==_t&&xt?r("label",{children:[i("input",{checked:St,type:"checkbox",onChange:e=>Ke.setMany(tl.toggleParams(St))}),tl.label(_t)],className:c8}):null,Un=xn?i(O1,{filters:_n,onFilterChange:En}):null,Bn=ge(_n,0,(e,t)=>""===t.value?e:e+1|0)+(St&&xt?1:0)|0,$n=r(o,{children:[r("div",{children:[i(C1,{value:vn,onChange:e=>{He.current=hF,Ke.setMany([["q",e],["after",""],["before",""]])}}),Se&&(xn||xt)?i(E2,{activeCount:Bn,children:r("div",{children:[_n.map(e=>i(F1,{filter:e,onChange:En},e.key)),jn],className:u8})}):r(o,{children:[Un,jn]})],className:l8}),Pe>0?i($4,{count:Pe,onClick:()=>{Oe(e=>0),He.current=hF,Ke.setMany([["after",""],["before",""]]),It()}}):null]}),qn=Xt?r("div",{children:[i("button",{children:"‹ Prev",className:f8,disabled:!Jt,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]}(He.current),t=e[1];return void 0!==t?(He.current=e[0],Ke.setMany([["after",t],["before",""]])):M(Ot.startCursor,e=>Ke.setMany([["before",e],["after",""]]))})()}),i("button",{children:"Next ›",className:f8,disabled:!Ht,onClick:e=>kn()})],className:d8}):null,Gn=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))})))}(E.schema);if(void 0!==Gn){let e=Gn.matchedGroups,t=e.length,n=1!==t?0!==t?e.join(" / "):"an elevated role":e[0];In=i(MW,{variant:"Info",title:"Viewing as "+n,message:"This list is not filtered to you — it shows rows for every "+Gn.ownerLabel+"."})}else In=null;let Vn,Kn=r(o,{children:[$n,In,jt.element,Dn,qn]});if("Full"===Re)if(void 0!==An){let e=An[2],t=An[1],n=An[0],o={label:E.name,href:Ye,onClick:at},s=(e=>!!yt(ne,e[0])&&$(e[2]))([n,t,e]),a={placement:$(Pn)?"Bar":"Pane",ancestors:[o],controls:Mn};Vn=i(n8,{refresh:gn,children:r("div",{children:[s?null:TV(Pn,i("div",{children:i(Q1,{crumbs:[o],allLinks:!0}),className:i2.titleGroup})),i(C6,{chrome:a,children:Fn([n,t,e])})],className:i8})})}else Vn=r("div",{children:[zn,Kn],className:i8});else{let e=void 0!==An?Fn(An):i(Ks,{title:"Select an item",description:"Choose a row on the left to see its details here."});Vn=i(n8,{refresh:gn,children:r("div",{children:[zn,i(C6,{chrome:{placement:"Pane",ancestors:[]},children:i(T2,{master:Kn,detail:e})})],className:i8})})}return r(o,{children:[Vn,L(O[0],null,e=>i(m6,{state:e,onClose:()=>B(e=>{}),beforeSend:t=>{let n=e.rowId;return void 0!==n?Ve(n):M(Xe(t,U(e.command.aggregateIdField,"id")),Ve)},onSucceeded:t=>{t?pn(e.rowId)&&q(e.navigateTo)&&setTimeout(()=>It(),500):pn(e.rowId)&&It(),M(e.navigateTo,J)},scope:E.name}))]})};function v8(e){return e.map(e=>e.x.toString()+","+e.y.toString()).join(" ")}let y8=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("+bt.brand+")":a;return l.length<2?null:i("svg",{children:i("polyline",{fill:"none",points:v8(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 b8(e){return"var("+e+")"}let _8=Ls([qo("flex"),Go("column"),zo("gap",b8(_t.xs)),zo("padding",b8(_t.lg)),zo("background",b8(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",b8(St.md))]),x8=Ls([zo("color",b8(bt.textSecondary)),zo("font-size",b8(xt.sizeSm)),zo("font-weight",b8(xt.weightMedium))]),S8=Ls([qo("flex"),jo("baseline"),zo("gap",b8(_t.sm))]),w8=Ls([zo("color",b8(bt.textPrimary)),zo("font-size",b8(xt.sizeXxl)),zo("font-weight",b8(xt.weightBold)),zo("line-height",b8(xt.lineHeightTight))]);function E8(e){switch(e){case"Up":return bt.success;case"Down":return bt.error;case"Neutral":return bt.textDisabled}}function k8(e){return Ls([zo("color",b8(E8(e))),zo("font-size",b8(xt.sizeSm)),zo("font-weight",b8(xt.weightMedium))])}let C8=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:k8(o)})}else t=null;return r("div",{children:[i("div",{children:e.label,className:x8}),r("div",{children:[i("span",{children:e.value,className:w8}),t],className:S8}),L(e.sublabel,null,e=>i("div",{children:e,style:{color:"var("+bt.textDisabled+")",fontSize:"var("+xt.sizeXs+")"}})),U(e.footer,null)],className:_8})};function A8(e){return"var("+e+")"}let N8=Ls([qo("grid"),zo("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),zo("gap",A8(_t.md))]),T8=Ls([$o("pointer"),zo("border-radius",A8(St.md)),Cs([zo("filter","brightness(0.98)")])]);let R8=function(e){let t=e.kpis;return 0===t.length?null:i("div",{children:t.map(e=>{let t=z(e.spark,e=>i(y8,{values:e,width:120,height:24})),n=i(C8,{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:T8,role:"button",tabIndex:0,onKeyDown:e=>{if("Enter"===e.key)return r()},onClick:e=>r()}:{children:n},e.key)}),className:N8})},D8=["var("+bt.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function I8(e,t){return U(e.color,D8[fe(t,D8.length)])}function F8(e,t,n,r){let i=2*(r-.25)*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function O8(e){return(Math.round(1e3*e)/1e3).toString()}function P8(e,t,n,r,i,o){let s=F8(e,t,n,i),a=s[1],l=s[0],c=F8(e,t,n,o),u=c[1],d=c[0],f=o-i>.5?"1":"0";if(r<=0)return"M "+O8(e)+" "+O8(t)+" L "+O8(l)+" "+O8(a)+" A "+O8(n)+" "+O8(n)+" 0 "+f+" 1 "+O8(d)+" "+O8(u)+" Z";let h=F8(e,t,r,i),p=F8(e,t,r,o);return"M "+O8(l)+" "+O8(a)+" A "+O8(n)+" "+O8(n)+" 0 "+f+" 1 "+O8(d)+" "+O8(u)+" L "+O8(p[0])+" "+O8(p[1])+" A "+O8(r)+" "+O8(r)+" 0 "+f+" 0 "+O8(h[0])+" "+O8(h[1])+" Z"}let M8=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=I8(s,t),d=n-o>=.999?P8(l,l,c,u,o,o+.5)+" "+P8(l,l,c,u,o+.5,n):P8(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()})},L8=["var("+bt.brand+")","var("+bt.success+")"];let z8=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(L8[t],"var("+bt.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 j8=function(e){let t=e.size,n=void 0!==t?t:120;return i(M8,{slices:e.slices,size:n,innerRatio:.6})};function U8(e){return"var("+e+")"}let B8=Ls([ps("relative"),zo("width","100%"),zo("line-height","0")]),$8=Ls([ps("absolute"),zo("left","0"),zo("right","0"),zo("bottom","0"),zo("text-align","center"),zo("line-height","1.1"),zo("font-size",U8(xt.sizeXl)),zo("font-weight",U8(xt.weightMedium)),zo("color",U8(bt.textPrimary))]),q8=Ls([qo("flex"),Jo("spaceBetween"),zo("width","100%"),zo("font-size",U8(xt.sizeXs)),zo("color",U8(bt.textDisabled))]),G8=Ls([zo("font-size",U8(xt.sizeSm)),zo("color",U8(bt.textSecondary))]);function V8(e){return(Math.round(100*e)/100).toString()}function K8(e,t,n,r){let i=Math.PI+r*Math.PI;return[e+n*Math.cos(i),t+n*Math.sin(i)]}function W8(e,t,n,r,i){let o=K8(e,t,n,r),s=K8(e,t,n,i);return"M "+V8(o[0])+" "+V8(o[1])+" A "+V8(n)+" "+V8(n)+" 0 0 1 "+V8(s[0])+" "+V8(s[1])}let H8=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:W8(f,p,h,0,1),fill:"none",stroke:"var("+bt.surfaceSubtle+")",strokeLinecap:"round",strokeWidth:V8(d)}),u<=0?null:i("path",{d:W8(f,p,h,0,u),fill:"none",stroke:"var("+bt.brand+")",strokeLinecap:"round",strokeWidth:V8(d)})],"aria-label":V8(a)+" of "+V8(o),role:"img",style:{display:"block",height:"auto",maxWidth:"100%"},height:V8(g),width:V8(c),viewBox:"0 0 "+V8(c)+" "+V8(g)}),i("div",{children:U(e.display,V8(a)),className:$8})],className:B8}),r("div",{children:[i("span",{children:V8(l)}),i("span",{children:V8(o)})],className:q8}),void 0!==n?i("div",{children:n,className:G8}):null],className:(m=c,Ls([qo("flex"),Go("column"),jo("center"),zo("gap","2px"),zo("width","100%"),zo("max-width",m.toString()+"px")]))});var m};function J8(e){return"var("+e+")"}let X8=Ls([qo("flex"),Go("column"),zo("gap","6px")]),Q8=Ls([zo("overflow-x","auto")]),Y8=Ls([qo("flex"),zo("gap","4px"),jo("flexStart")]);function Z8(e){return Ls([qo("grid"),zo("grid-template-rows","repeat(7, "+e.toString()+"px)"),zo("gap","2px"),jo("center"),zo("font-size",J8(xt.sizeXs)),zo("color",J8(bt.textDisabled)),zo("line-height","1")])}function e9(e){return Ls([qo("grid"),zo("grid-auto-flow","column"),zo("grid-auto-columns",e.toString()+"px"),zo("grid-template-rows","repeat(7, "+e.toString()+"px)"),zo("gap","2px")])}let t9=Ls([zo("visibility","hidden")]),n9=Ls([qo("flex"),jo("center"),Wo("wrap"),zo("gap",J8(_t.md)),zo("font-size",J8(xt.sizeXs)),zo("color",J8(bt.textSecondary))]),r9=Ls([qo("flex"),jo("center"),zo("gap","4px")]);function i9(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 o9(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let s9=function(e){let t=e.cellSize,n=e.days,o=void 0!==t?t:11,s=i9(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?Pc(l.time)+" – "+Pc(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(Mc[t],""):"")},e.toString());var t}),className:Z8(o)}),i("div",{children:s.map((e,t)=>e.map((e,n)=>{return void 0!==e?i("div",{className:(r=XW(e.value,a),Ls([zo("border-radius","2px"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("background",r<=0?"transparent":"color-mix(in srgb, var("+bt.brand+") "+Math.round(100*r).toString()+"%, transparent)")])),title:zc(e.time)+" "+Pc(e.time)+": "+o9(e.value)},e.time.toString()):i("div",{className:t9},"b:"+t.toString()+":"+n.toString());var r})),className:e9(o)})],className:Y8}),className:Q8}),r("div",{children:[i("span",{children:u}),r("span",{children:["less",QW.map(e=>{return i("span",{className:(t=e,Ls([zo("width","10px"),zo("height","10px"),zo("border-radius","2px"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("background","color-mix(in srgb, var("+bt.brand+") "+Math.round(100*t).toString()+"%, transparent)")]))},e.toString());var t}),"more (max "+o9(a)+")"],className:r9})],className:n9})],className:X8})};function a9(e){return"var("+e+")"}let l9=Ls([qo("flex"),Go("column"),zo("gap","2px")]),c9=Ls([qo("flex"),Go("column"),zo("gap","3px")]),u9=Ls([qo("flex"),Jo("spaceBetween"),jo("baseline"),zo("gap",a9(_t.sm)),zo("font-size",a9(xt.sizeSm))]),d9=Ls([zo("color",a9(bt.textPrimary))]),f9=Ls([zo("color",a9(bt.textPrimary)),zo("font-weight",a9(xt.weightMedium)),zo("white-space","nowrap")]),h9=Ls([zo("color",a9(bt.textSecondary)),zo("font-weight",a9(xt.weightNormal))]),p9=Ls([zo("background",a9(bt.surfaceSubtle)),zo("border-radius",a9(St.sm)),zo("height","14px"),us("hidden")]);function g9(e,t){return Ls([zo("background",t),zo("border-radius",a9(St.sm)),zo("height","100%"),zo("width",e.toString()+"%"),zo("min-width",e>0?"2px":"0")])}let m9=Ls([zo("padding","2px 0 4px"),zo("font-size",a9(xt.sizeXs)),zo("color",a9(bt.textDisabled))]),v9=Ls([zo("padding-top","4px"),zo("font-size",a9(xt.sizeXs)),zo("color",a9(bt.textDisabled))]);function y9(e,t){return t<=0?0:Math.round(e/t*1e3)/10}function b9(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}let _9=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:y9(n.value,t),dropOff:void 0!==i&&i.value>0&&n.value<i.value?y9(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:m9}):null,r("div",{children:[r("div",{children:[i("span",{children:e.label,className:d9}),r("span",{children:[b9(e.value),0===t?null:i("span",{children:" · "+L(n,0,e=>e.conversion).toString()+"%",className:h9})],className:f9})],className:u9}),i("div",{children:i("div",{className:g9(a,U(e.color,"var("+bt.brand+")"))}),className:p9})],className:c9})]},e.label+":"+t.toString())}),void 0!==n?i("div",{children:n,className:v9}):null],className:l9})};function x9(e){return"var("+e+")"}let S9=Ls([qo("flex"),Go("column"),zo("gap","2px")]),w9=Ls([qo("flex"),zo("gap","4px")]),E9=[zo("font-size",x9(xt.sizeXs)),zo("color",x9(bt.textDisabled)),zo("white-space","nowrap")],k9=Ls(E9.concat([qo("flex"),Go("column"),Jo("spaceBetween"),zo("text-align","right")]));let C9=Ls([qo("flex"),Jo("spaceBetween"),zo("gap",x9(_t.sm)),zo("font-size",x9(xt.sizeXs)),zo("color",x9(bt.textSecondary))]);function A9(e){return(Math.round(100*e)/100).toString()}function N9(e,t,n){return n<=t?.5:(e-t)/(n-t)}let T9=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:C9})),r("div",{children:[r("div",{children:[r("div",{children:[i("span",{children:A9(u.yMax)}),i("span",{children:A9(u.yMin)})],className:k9,style:{width:34..toString()+"px"}}),r("svg",{children:[i("line",{stroke:"var("+bt.borderSubtle+")",strokeWidth:"1",x1:A9(f),x2:A9(l-f),y1:A9(c-f),y2:A9(c-f)}),i("line",{stroke:"var("+bt.borderSubtle+")",strokeWidth:"1",x1:A9(f),x2:A9(f),y1:A9(f),y2:A9(c-f)}),a.map((e,t)=>{let n=f+N9(e.x,u.xMin,u.xMax)*h,r=f+(1-N9(e.y,u.yMin,u.yMax))*p;return i("circle",{children:i("title",{children:e.label+" — "+U(s,"x")+": "+A9(e.x)+", "+U(o,"y")+": "+A9(e.y)}),cx:A9(n),cy:A9(r),fill:U(e.color,"var("+bt.brand+")"),fillOpacity:"0.75",r:A9(3.5)},e.label+":"+t.toString())})],style:{display:"block",height:"auto",maxWidth:"100%",minWidth:"0"},height:A9(c),width:A9(l),viewBox:"0 0 "+A9(l)+" "+A9(c)})],className:w9}),r("div",{children:[i("span",{children:A9(u.xMin)}),i("span",{children:A9(u.xMax)})],className:(m=38,Ls(E9.concat([qo("flex"),Jo("spaceBetween"),zo("margin-left",m.toString()+"px")])))}),d],className:S9});var m};function R9(e){return"var("+e+")"}let D9=Ls([qo("flex"),Go("column"),zo("gap","6px"),Zo(Ts(0)),zo("padding","0"),zo("list-style","none")]),I9=[qo("grid"),zo("grid-template-columns","1.5rem 1fr auto"),jo("center"),zo("gap",R9(_t.sm)),zo("font-size",R9(xt.sizeSm)),zo("color",R9(bt.textPrimary))],F9=Ls(I9),O9=Ls(I9.concat([$o("pointer"),zo("background","transparent"),zo("border","none"),zo("padding","2px 0"),zo("text-align","left"),zo("width","100%"),zo("font","inherit"),Cs([zo("color",R9(bt.brand))])])),P9=Ls([zo("align-self","start"),zo("font-size",R9(xt.sizeXs)),zo("color",R9(bt.textDisabled)),zo("text-align","right"),zo("font-variant-numeric","tabular-nums")]),M9=Ls([qo("flex"),Go("column"),zo("gap","3px"),ls(Ts(0))]),L9=Ls([zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),z9=Ls([zo("background",R9(bt.surfaceSubtle)),zo("border-radius",R9(St.sm)),zo("height","6px"),us("hidden")]);function j9(e){return Ls([zo("background",R9(bt.brand)),zo("border-radius",R9(St.sm)),zo("height","100%"),zo("width",e.toString()+"%"),zo("min-width",e>0?"2px":"0")])}let U9=Ls([zo("align-self","start"),zo("font-weight",R9(xt.weightMedium)),zo("white-space","nowrap"),zo("font-variant-numeric","tabular-nums")]);function B9(e,t){return t<=0||e<=0?0:e/t*100}let $9=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:P9}),r("span",{children:[i("span",{children:e.label,className:L9,title:e.label}),i("span",{children:i("span",{className:j9(B9(e.value,a))}),className:z9})],className:M9}),i("span",{children:e.display,className:U9})]}),s=e.onOpen;return i("li",{children:void 0!==s?i("button",{children:n,className:O9,type:"button",onClick:e=>s()}):i("div",{children:n,className:F9})},e.key)}),className:D9})};let q9=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("+bt.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 G9(e){return"var("+e+")"}let V9=Ls([qo("flex"),Go("column"),zo("gap",G9(_t.lg))]),K9=Ls([zo("font-size",G9(xt.sizeXl)),zo("font-weight",G9(xt.weightMedium)),zo("color",G9(bt.textPrimary)),Zo(Ts(0))]),W9=Ls([qo("grid"),zo("grid-template-columns","repeat(auto-fill, minmax(300px, 1fr))"),zo("gap",G9(_t.md))]),H9=Ls([qo("flex"),Go("column"),zo("gap",G9(_t.sm)),zo("padding",G9(_t.lg)),zo("background",G9(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",G9(St.md))]),J9=Ls([zo("font-size",G9(xt.sizeSm)),zo("font-weight",G9(xt.weightMedium)),zo("color",G9(bt.textSecondary))]),X9=Ls([qo("flex"),jo("center"),zo("gap",G9(_t.lg))]),Q9=Ls([qo("flex"),Go("column"),zo("gap","4px"),zo("font-size",G9(xt.sizeSm)),zo("color",G9(bt.textSecondary))]),Y9=Ls([qo("flex"),jo("center"),zo("gap","6px")]);function Z9(e){return Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",e)])}let e7=Ls([zo("font-size",G9(xt.sizeXs)),zo("color",G9(bt.textDisabled))]),t7=Ls([qo("flex"),Jo("spaceBetween"),jo("center"),zo("gap",G9(_t.sm))]),n7=Ls([qo("inlineFlex"),zo("gap",G9(_t.xs))]);function r7(e,t){return j(Xe(e,t),e=>{let t=ft(e);return void 0!==t?t:z(mD(e),e=>e[0])})}function i7(e){return e.map(e=>U(ht(e),{}))}function o7(e,t,n){switch(t){case"avg":case"sum":break;default:return e.length}if(void 0===n)return e.length;let r=i7(e),i=me(r,e=>r7(e,n)),o=ge(i,0,(e,t)=>e+t),s=function(e,t){return ye(e,e=>z(j(Xe(e,t),mD),e=>e[1]))}(r,n),a=void 0!==s?function(e,t){return e/Math.pow(10,hD(t))}(o,s):o;return"sum"===t?a:0===i.length?0:a/i.length}function s7(e){let t=Math.round(100*e)/100;return t===Math.trunc(t)?Math.trunc(t).toString():t.toString()}function a7(e,t,n){return ha(e,n&&("count"===t||"sum"===t))}function l7(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 c7(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 u7(e,t,n,r){let i=pe(n,e=>[]);return i7(e).forEach(e=>M(j(Cn(t,e),jc),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 d7(e,t,n,r,i,o){return u7(e,t,n,r).map(e=>o7(e.map(e=>e),i,o))}function f7(e,t){return me(i7(e),e=>Rt(e,t))}function h7(e,t,n){let r=fn(t,n),i=ge(e.filter(e=>!r.includes(e)),[],(e,t)=>e.includes(t)?e:e.concat([t]));return r.concat(i)}function p7(e){return D8[fe(e,D8.length)]}function g7(e,t){return z(Xe(e.semantics,t),e=>e.semantic)}function m7(e,t,n){let r=function(e,t){return z(Mn(e).find(e=>e[0]===t),e=>e[1])}(e,t);if(void 0===r)return;let i=Kn(r,"maximum");if(void 0===i)return vt(g7(n,t),"Percent")?{min:0,max:100}:void 0;let o=U(Kn(r,"minimum"),0);return i>o?{min:o,max:i}:void 0}function v7(e,t,n){let r=g7(e,t);if(void 0===r)return s7(n);switch(r){case"Percent":return vD(n);case"Bytes":return yD(n);case"Duration":return bD(n);case"Currency":case"Money":return dD(n);default:return s7(n)}}function y7(e,t,n,r,i,o){return d7(e,t,n,r,i,o).map((e,t)=>({time:wc(r-((n-1|0)-t|0)*Uc),value:e}))}function b7(e){let t,n=s(()=>"Days30"),o=n[1],a=n[0],l=(e,t)=>{return i("button",{children:t,className:(n=a===e,Ls([zo("background",n?G9(bt.surfaceSubtle):"transparent"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",G9(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("font-size",G9(xt.sizeXs)),zo("color",G9(n?bt.textPrimary:bt.textSecondary)),$o("pointer")])),type:"button",onClick:t=>o(t=>e)});var n};return t="Days30"===a?e.body:i(s9,{days:e.yearDays}),r("div",{children:[r("div",{children:[i("span",{children:e.title,className:J9}),r("div",{children:[l("Days30","30 days"),l("Year","Year")],className:n7})],className:t7}),t],className:H9})}let _7=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=eV(),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=rW(u,e.name,f);return[e,t,G4(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&&rW(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:rr(t.schema,j(s,e=>nO(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=>d7(e.rows,t,14,m,n,e.metric.field));return{key:t.toString()+":"+e.readModel.name,label:c7(e.metric),value:a7(s7(o7(e.rows,n,e.metric.field)),n,e.partial),sublabel:l7(e.readModel.name,n,e.partial,e.rows.length),spark:r,onOpen:()=>d(Ue(_l(c,e.readModel.name)))}}),b=e=>{let t=e.readModel.lifecycleField;return void 0!==t?t:e.semantics.statusField},_=me(v,e=>z(e.semantics.dateSpan,t=>{let n,s,a=U(e.metric.aggregate,"count"),l=c7(e.metric)+" — trend",c=b(e);if("count"===a&&void 0!==c){let s=function(e,t,n,r,i,o){let s=u7(e,t,n,r),a=e=>me(e,e=>Rt(e,o)),l=s.flatMap(a),c=h7(l,i,o).filter(e=>l.some(t=>t===e)),u=s.map((e,t)=>{let i=a(e);return{label:zc(r-864e5*((n-1|0)-t|0)),segments:c.map((e,t)=>({key:lt(e),value:i.filter(t=>t===e).length,color:p7(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(q9,{bars:s.bars}),i("div",{children:a.map((e,t)=>r("span",{children:[i("span",{className:Z9(p7(t))}),lt(e)],className:Y9},e)),className:Q9})]})}else n=void 0;if(void 0!==n)s=n;else{let n=d7(e.rows,t,30,m,a,e.metric.field);s=i(z8,{series:[{label:c7(e.metric),values:n}]})}return i(b7,{title:l,body:s,yearDays:y7(e.rows,t,365,m,a,e.metric.field)},"trend:"+c7(e.metric))})),x=me(v,e=>{let t=e.metric.aggregate,n=e.metric.field;if("avg"===t&&void 0!==n)return z(m7(e.readModel.schema,n,e.semantics),t=>{let o=o7(e.rows,"avg",n);return r("div",{children:[i("span",{children:c7(e.metric),className:J9}),i(H8,{value:o,min:t.min,max:t.max,display:v7(e.semantics,n,o),caption:e.readModel.name+" · "+lt(n)})],className:H9},"gauge:"+c7(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(i7(e),e=>z(r7(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:v7(e.semantics,n,t.value),value:t.value,onOpen:""===t.id?void 0:()=>d(Sl(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:J9}),i($9,{entries:o})],className:H9},"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(i7(a),e=>{let t=r7(e,l),n=r7(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:J9}),i(T9,{points:s,xLabel:lt(o),yLabel:lt(n)})],className:H9},"scatter:"+c7(e.metric))}),k=me(v,e=>{let t=e.metric.viz,n=b(e);if(void 0===t)return;if("funnel"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=fn(t,n),i=f7(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:c7(e.metric)+" — "+lt(n)+" funnel",className:J9}),i(_9,{stages:s,note:0===a?void 0:a.toString()+" row(s) with an unlisted "+lt(n)+" excluded"})],className:H9},"funnel:"+c7(e.metric))}),C=me(v,e=>{let t=U(e.metric.aggregate,"count"),n=vt(e.metric.viz,"funnel")?void 0:b(e);if("count"!==t)return;if(void 0===n)return;let o=function(e,t,n){let r=f7(e,n);return me(h7(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:J9}),r("div",{children:[i(j8,{slices:o}),i("div",{children:o.map((e,t)=>r("span",{children:[i("span",{className:Z9(I8(e,t))}),e.label+" ("+s7(e.value)+")"],className:Y9},e.label)),className:Q9})],className:X9})],className:H9},"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(iW(u,h.map(e=>e.name),f)),N=[k,E,x,_,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:K9}),i(R8,{kpis:y}),0!==N.length?i("div",{children:N,className:W9}):null,0!==T.length?i("span",{children:"Figures cover the rows loaded for: "+T.join(", "),className:e7}):null,0!==A.length?i("span",{children:A.join(" · "),className:e7}):null],className:V9})};function x7(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 S7(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 w7(e){return!!$(e.tier)&&0===e.vetoes.length}function E7(e){return 0!==e.vetoes.length}function k7(e){return!!q(e.tier)&&0===e.vetoes.length}function C7(e,t,n,r,i,o){let s=[];vt(e.command.ownerField,n)&&s.push("PlatformSuppliedField");let a=e.enclosingAggregate,l=TI(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"),FI(function(e){let t=e.command.aggregateIdField;if(void 0!==t)return U(TI(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 A7(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:b3,a=[];return o.forEach(t=>{let n=i4(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=bl(r,e.entity);return void 0!==i?i:yl(r,e.entity)})}(t.command,i,r),c=function(e,t){return j(TI(e),e=>yl(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=C7(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 N7(e,t){return e.filter(e=>e.viewName===t)}let T7={actor:"",eventType:"",timeFrom:"",timeTo:""};function R7(e){return""!==e.actor||""!==e.eventType||""!==e.timeFrom||""!==e.timeTo}function D7(e){return"var("+e+")"}let I7=Ls([qo("flex"),Go("column"),zo("gap",D7(_t.sm))]),F7=Ls([qo("flex"),jo("center"),zo("gap",D7(_t.md)),Wo("wrap"),zo("padding-bottom",D7(_t.xs)),zo("border-bottom","1px solid var("+bt.border+")")]),O7=Ls([qo("flex"),jo("center"),zo("gap","4px")]),P7=Ls([zo("color",D7(bt.textSecondary)),zo("font-size",D7(xt.sizeSm)),zo("white-space","nowrap")]),M7=Ls([zo("background",D7(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",D7(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("font-size",D7(xt.sizeSm)),zo("color",D7(bt.textPrimary)),zo("outline","none"),Es([zo("border-color",D7(bt.brand))])]),L7=Ls([zo("background","none"),zo("border","none"),zo("padding","0"),zo("color",D7(bt.brand)),zo("font-size",D7(xt.sizeSm)),$o("pointer"),Cs([zo("text-decoration","underline")])]),z7=Ls([qo("flex"),Jo("center"),zo("padding-top",D7(_t.xs))]),j7=Ls([zo("background",D7(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",D7(St.sm)),zo("padding","4px var("+_t.md+")"),zo("font-size",D7(xt.sizeSm)),zo("color",D7(bt.textPrimary)),$o("pointer"),Cs([zo("border-color",D7(bt.brand))])]);let U7=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(O1,{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:P7}),i("input",{className:M7,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:P7}),i("input",{className:M7,type:"date",value:l.timeTo,onChange:e=>a({actor:l.actor,eventType:l.eventType,timeFrom:l.timeFrom,timeTo:e.target.value})})],className:O7}),R7(l)?i("button",{children:"Clear filters",className:L7,onClick:e=>a(T7)}):null],className:F7}),i(XZ,{entries:e.entries,emptyLabel:R7(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:j7,disabled:u,onClick:e=>M(n,e=>e())}),className:z7}):null],className:I7})};let B7=function(e){let t=e.entityId,n=e.binding,r=sF(),o=eV(),l=L(e.requiredAccess,!1,e=>!o(e)),c=s(()=>[]),u=c[1],d=c[0],f=s(()=>T7),p=f[1],g=f[0],m=s(()=>!0),v=m[1],y=s(()=>{}),b=y[1],_=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),b(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(uF(e,t),BK)}(t,n.queryField),i=function(e,t){let n=fF(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),b(e=>"Could not load the history for this record."),Promise.resolve()))}else b(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!==_?i(G1,{title:"History unavailable",detail:_,onRetry:()=>k(e=>e+1|0)}):i(U7,{entries:GK(d,n.displayName),actors:VK(d),eventTypes:KK(d),filter:g,onFilterChange:T,hasMore:x[0],loading:m[0],onLoadMore:R})};function $7(e){return"var("+e+")"}let q7=Ls([qo("flex"),Go("column"),zo("gap",$7(_t.lg))]),G7=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",$7(_t.md))]),V7=Ls([zo("font-size",$7(xt.sizeXl)),zo("font-weight",$7(xt.weightMedium)),zo("color",$7(bt.textPrimary)),Zo(Ts(0))]),K7=Ls([qo("flex"),Wo("wrap"),jo("center"),zo("gap",$7(_t.md)),zo("font-size",$7(xt.sizeSm)),zo("color",$7(bt.textSecondary))]),W7=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),$o("pointer")]);let H7=Ls([zo("font-size",$7(xt.sizeXs)),zo("color",$7(bt.textDisabled))]),J7=Ls([qo("flex"),jo("center"),zo("gap",$7(_t.sm))]),X7=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",$7(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",$7(bt.textSecondary)),zo("font-size",$7(xt.sizeSm)),$o("pointer"),Cs([zo("background",$7(bt.surfaceSubtle)),zo("color",$7(bt.textPrimary))])]);let Q7=function(e){let t=e.viewAccess,n=e.uiHints,o=e.readModels,a=e.pluginId,l=void 0!==t?t:{},c=ae(),u=eV(),d=sF(),f=aF(),h=gl(),p=P1(),g=s(()=>[]),m=g[1],v=g[0],y=o.map((e,t)=>{let n=rW(l,e.name,u),r=n&&!v.includes(e.name);return[e,t,r,n,G4(e,r)]}),b=(e,t)=>U(j(j(n,t=>tO(t,e.name)),e=>e.accent),Y0[fe(t,Y0.length)]),_=me(y,e=>{let t=e[4],r=e[0],i=j(n,e=>tO(e,r.name)),o=rr(r.schema,j(n,e=>nO(e,r.name)),{field:r.labelField,source:r.labelFieldSource}),s=z(o.statusField,e=>h4(e,r.commands,j(i,e=>e.transitions))),l=y2(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:b(r,e[1]),window:ua(t.canLoadMore),onOpenRow:(e,t)=>c(Sl(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(iW(l,o.map(e=>e.name),u));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:V7}),className:G7}),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=b(t,e[1]),Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",n)]))}),t.name],className:W7},t.name);var n}),className:K7}),p.element,e.mode.render(_),0!==x.length?r("div",{children:[i("button",{children:"Load more",className:X7,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:H7})],className:J7}):null,0!==S.length?i("span",{children:S.join(" · "),className:H7}):null],className:q7})};function Y7(e){return"var("+e+")"}let Z7=Ls([qo("flex"),Go("column"),zo("gap",Y7(_t.lg)),zo("padding","0 var("+_t.md+")"),zo("min-width","0")]),eee=Ls([qo("flex"),jo("center"),zo("gap",Y7(_t.sm)),Ko(0)]),tee=Ls([qo("flex"),Go("column"),zo("gap",Y7(_t.sm)),zo("min-width","0")]),nee=Ls([qo("flex"),jo("start"),zo("gap",Y7(_t.md)),zo("padding","var("+_t.xs+") 0"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),As([zo("border-bottom","none")])]),ree=Ls([zo("color",Y7(bt.textSecondary)),zo("font-size",Y7(xt.sizeMd)),zo("font-weight",Y7(xt.weightMedium)),zo("white-space","nowrap"),zo("padding-top","2px"),Ko(0),zo("min-width","200px")]),iee=Ls([zo("color",Y7(bt.textPrimary)),zo("font-size",Y7(xt.sizeMd)),zo("word-break","break-word"),zo("min-width","0")]),oee=Ls([qo("flex"),jo("start"),zo("gap",Y7(_t.md)),zo("padding","var("+_t.xs+") 0"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),As([zo("border-bottom","none")])]),see=Ls([zo("color",Y7(bt.textSecondary)),zo("font-size",Y7(xt.sizeMd)),zo("font-weight",Y7(xt.weightMedium)),zo("padding-top","2px"),Ko(0),zo("min-width","200px")]),aee=Ls([qo("flex"),Go("column"),zo("gap",Y7(_t.sm)),Vo(1),zo("padding",Y7(_t.md)),zo("background",Y7(bt.surfaceSubtle)),zo("border-radius",Y7(St.md)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("min-width","0")]),lee=Ls([qo("flex"),Go("column"),zo("gap",Y7(_t.sm)),zo("min-width","0")]),cee=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",Y7(_t.md)),zo("padding-bottom",Y7(_t.xs)),zo("border-bottom","1px solid var("+bt.borderSubtle+")")]),uee=Ls([zo("color",Y7(bt.textPrimary)),zo("font-size",Y7(xt.sizeMd)),zo("font-weight",Y7(xt.weightMedium))]),dee=Ls([zo("overflow-x","auto"),zo("max-width","100%"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Y7(St.md))]),fee=Ls([zo("color",Y7(bt.textDisabled)),zo("font-size",Y7(xt.sizeSm))]),hee=Ls([qo("grid"),zo("grid-template-columns","repeat(auto-fill, minmax(160px, 1fr))"),zo("gap",Y7(_t.md))]),pee=Ls([qo("flex"),Go("column"),zo("gap","4px"),zo("min-width","0")]),gee=Ls([ps("relative"),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",Y7(St.md)),zo("overflow","hidden"),zo("background",Y7(bt.surfaceSubtle))]),mee=Ls([zo("border-color",Y7(bt.brand)),zo("box-shadow","0 0 0 2px color-mix(in srgb, var("+bt.brand+") 30%, transparent)")]),vee=Ls([qo("block"),bs({NAME:"percent",VAL:100}),zo("aspect-ratio","4 / 3"),zo("object-fit","cover")]),yee=Ls([ps("absolute"),zo("top","6px"),zo("left","6px")]),bee=Ls([zo("font-size",Y7(xt.sizeSm)),zo("color",Y7(bt.textSecondary)),zo("overflow-wrap","anywhere")]),_ee=Ls([zo("color",Y7(bt.textDisabled)),zo("font-style","italic")]);function xee(e,t){return U(j(j(ht(e),e=>Xe(e,"title")),dt),lt(t))}function See(e){return j(j(ht(e),e=>Xe(e,"type")),dt)}function wee(e){return j(j(ht(e),e=>Xe(e,"format")),dt)}function Eee(e){return $(j(j(ht(e),e=>Xe(e,"properties")),ht))}function kee(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 Cee(e,t,n){let r=void 0!==n?n:[],i=Bt(t),o=See(i),s=Lt(i);if(void 0!==s)return{TAG:"TaggedUnion",_0:s};if(void 0!==o)switch(o){case"array":let t=function(e){return j(ht(e),e=>Xe(e,"items"))}(i);if(void 0===t)return"ArrayOfScalars";let n=See(t);if(Eee(t)||vt(n,"object"))return{TAG:"ArrayOfObjects",_0:t};if(!vt(n,"string"))return"ArrayOfScalars";let r=kee(e);return void 0!==r?{TAG:"EntityRefArray",_0:r}:"ArrayOfStrings";case"boolean":return"Bool";case"object":return Eee(i)?{TAG:"NestedObject",_0:i}:{TAG:"Scalar",_0:"object",_1:void 0}}let a=DI(e,r);if(void 0!==a)return{TAG:"DynamicEntityRef",_0:a};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(o,"string"),_1:wee(i)};let l=kee(e);return void 0!==l?{TAG:"EntityRef",_0:l}:{TAG:"Scalar",_0:U(o,"string"),_1:wee(i)}}function Aee(e,t,n,r){let o=ut(e);if("object"!=typeof o)switch(o){case"JSONFalse":return i(Ia,{variant:"Neutral",label:"false",dot:!1});case"JSONTrue":return i(Ia,{variant:"Success",label:"true",dot:!1});case"JSONNull":return i("span",{children:"—",className:fee})}else switch(o.TAG){case"JSONString":let r=o._0;return"date-time"===t?Ka(r):U(Xa(n,r),r);case"JSONNumber":return o._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}function Nee(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 Tee(e){return U(z(pt(e),e=>me(e,ht)),[])}function Ree(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 Dee(e){return e.map((e,t)=>({key:Ree(e,t),row:e}))}let Iee=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,b=e.schema,_=e.data,x=void 0!==v?v:[],S=void 0!==m?m:[],w=void 0!==f?f:[],E=gl(),k=Ge(),C=d(e8),A=NV(),N=d(E6),T=L(N,!1,e=>"Bar"===e.placement)&&$(A),R=void 0!==u&&void 0!==c?{pluginId:u,viewName:c}:void 0,D=ae(),I=s(()=>[]),F=I[1],O=s(()=>{}),B=O[1],G=s(()=>({})),V=G[1],K=G[0],W=SG(),H=$(u)&&$(c)?w:I[0],X=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return D(Sl(u,c,p,e));F(t=>e)},Q=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:xee(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)=>Ree(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:_,schema:b,label:y}],H,[]),Y=U(ht(_),{}),Z=LI(b,"Drill",E,R,h,void 0),ee=NF([Y],Z,E,R,void 0),te={lookupLabel:(e,t)=>gF(ee,e,E,t),isMissing:(e,t)=>yF(ee,e,E,t),retiredBadge:(e,t)=>mF(ee,e,E,t),linkable:(e,t)=>vF(ee,e,E,t,!1)},ne=L(j(mG(),e=>e.identity),[],e=>e.groups),re=e=>$6(e.schema,Y,b),ie=(e,t,n)=>r("div",{children:[i("div",{children:t,className:ree}),i("div",{children:n,className:iee})],className:nee},e),oe=(e,t,n)=>FI(e,E,R)?n:BI(e,t,E,n),se=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)}(_,h),le=e=>{let t=ut(e.data);if("object"!=typeof t){if("JSONNull"===t)return i("span",{children:"—",className:fee})}else switch(t.TAG){case"JSONObject":let t=U(ht(e.data),{}),n=0===H.length,o=LI(e.schema,"Drill",E,R,n?h:void 0,void 0),s=n&&$(se)?function(e,t){let n=e.filter(e=>yt(e.key,t));return 0===n.length?e:n}(o,h):o,a=function(e){return U(z(j(j(ht(e),e=>Xe(e,"properties")),ht),Qe),[])}(e.schema).map(e=>e[0]);return 0===s.length?i("span",{children:"(no fields)",className:fee}):i("div",{children:s.map(e=>{let n=e.key,o=e.propSchema,s=P(Xe(t,n),e=>"JSONNull"!==ut(e)),d=xee(o,n),f=Cee(n,o,a);if(void 0===s)return ie(n,d,U(function(e,t){return GD(e,t,null)}(n,o),i("span",{children:"—",className:fee})));if("object"!=typeof f){if("Bool"===f)return ie(n,d,Aee(s,void 0,n))}else switch(f.TAG){case"Scalar":let e=GD(n,o,s);return ie(n,d,void 0!==e?e:Aee(s,f._1,n));case"EntityRef":let a=f._0;return ie(n,oe(a,!1,d),KI(0,a,s,E,0,te,R,void 0,void 0));case"EntityRefArray":let h=f._0;return ie(n,oe(h,!0,d),KI(0,h,s,E,0,te,R,void 0,void 0));case"DynamicEntityRef":let p=GI(t,f._0),g=dt(s),m=0;if(void 0!==p){if(void 0!==g)return ie(n,lt(RI(n)),VI(p,g,E,te,R));m=2}else m=2;if(2===m)return ie(n,d,Aee(s,void 0,n));break;case"NestedObject":let v=GD(n,o,s);if(void 0!==v)return ie(n,d,v);let b=LI(f._0,"Drill",E,R,void 0,void 0),_=U(j(Xe(t,n),ht),{});return r("div",{children:[i("div",{children:d,className:see}),i("div",{children:b.map(e=>{let t=Xe(_,e.key);return r("div",{children:[i("div",{children:$I(e,E,R),className:ree}),i("div",{children:JI(e.key,e.kind,e.propSchema,t,void 0,E,k,te,R,_),className:iee})],className:nee},e.key)}),className:aee})],className:oee},n);case"ArrayOfObjects":let x=f._0,S=Dee(Tee(s)),w=S.length,C=U(c,y),A=C+"."+n,N=j(l,e=>tO(e,A)),T=wO(x,N,{registry:E,ownEntity:R}),D=UF(u,C,n),I=Xe(K,n),F=EO(void 0!==I?I:BF(D),N,un(x),void 0,T),O=e=>{$F(D,e,W),V(t=>{let r=Ze(Qe(t));return r[n]={mode:e,band:W},r})},M=U(pt(s),[]),B=e=>{let t=rr(x,j(l,e=>nO(e,A)),void 0),r=j(N,e=>e.accent),i={readModelName:A,rows:M,schema:x,semantics:t,accent:r,window:"Complete",onOpenRow:(e,t)=>{let r=function(e,t){let n=e.findIndex(t);if(-1!==n)return n}(M,e=>e===t),i=void 0!==r?L(S[r],e,e=>e.key):e;X(H.concat([n,i]))}};return e.render([i])},$=LI(x,"Drill",E,R,void 0,void 0).map(e=>({key:e.key,label:e.label,render:t=>JI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,E,k,te,R,t.row),sortable:!1,width:e.width})),G=0===w?i("span",{children:"(empty)",className:fee}):i("div",{children:i(ca,{columns:$,data:S,keyFn:e=>e.key,onRowClick:e=>X(H.concat([n,e.key])),density:"Comfortable"}),className:dee}),J=()=>z(P(er(n,o),e=>"ImageSet"===e.semantic),e=>{let t=wn(s);return 0===t.length?i("span",{children:"(empty)",className:fee}):i("div",{children:t.map((e,t)=>{let n=0===t,o=function(e){return e.caption}(e),s=q(o)&&q(e.altText);return r("div",{children:[r("div",{children:[i("img",{className:vee,alt:U(En(e),""),src:He(e.ref)}),n?i("span",{children:i(Ia,{variant:"Info",label:"Primary",dot:!1}),className:yee}):null],className:n?gee+" "+mee:gee}),void 0!==o?i("span",{children:o,className:bee}):s?i("span",{children:"No alt text",className:bee+" "+_ee}):null],className:pee},e.ref)}),className:hee})}),Q=J(),Y=void 0!==Q?Q:void 0!==F&&F.id!==DF?B(F):G;return r("div",{children:[r("div",{children:[i("span",{children:d,className:uee}),r("span",{children:[T.length>1?i(HF.make,{modes:T,activeId:L(F,DF,e=>e.id),onSelect:O}):null,i(Ga,{count:w,label:"items",onClick:()=>X(H.concat([n]))})],style:{display:"inline-flex",alignItems:"center",gap:"8px"}})],className:cee}),Y],className:lee},n);case"TaggedUnion":let Z=GD(n,o,s);if(void 0!==Z)return ie(n,d,Z);let ee=Dn(s);if(void 0===ee)return ie(n,d,Aee(s,void 0,n));let ne=ee[1],re=ee[0],se=jt(f._0,re),ae=L(se,re,e=>e.tag),le=L(se,[],e=>LI(Ut(e),"Drill",E,R,void 0,void 0)),ce=r("span",{children:[d,jI(ae)],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:"6px"}});return 0!==le.length?r("div",{children:[i("div",{children:ce,className:see}),i("div",{children:le.map(e=>r("div",{children:[i("div",{children:$I(e,E,R),className:ree}),i("div",{children:JI(e.key,e.kind,e.propSchema,Xe(ne,e.key),void 0,E,k,te,R,ne),className:iee})],className:nee},e.key)),className:aee})],className:oee},n):ie(n,d,jI(ae))}return ie(n,d,i(Ca,{items:Nee(s)}))}),className:tee});case"JSONArray":let d=Dee(Tee(e.data)),f=U(j(ht(e.schema),e=>Xe(e,"items")),e.schema),p=LI(f,"Drill",E,R,void 0,void 0).map(e=>({key:e.key,label:$I(e,E,R),render:t=>JI(e.key,e.kind,e.propSchema,Xe(t.row,e.key),void 0,E,k,te,R,t.row),sortable:!1,width:e.width}));return 0===d.length?i("span",{children:"(empty)",className:fee}):i("div",{children:i(ca,{columns:p,data:d,keyFn:e=>e.key,onRowClick:e=>X(H.concat([e.key])),density:"Comfortable"}),className:dee})}return i("div",{children:Aee(e.data,void 0,void 0),className:iee})},ce=U(se,U(p,y)),ue=e=>{if(void 0!==u&&void 0!==c&&void 0!==p)return Sl(u,c,p,H.slice(0,e))},de=void 0!==Q?Q.slice(0,Q.length-1|0).map((e,t)=>({label:0===t?ce:e.label,href:ue(t),onClick:()=>X(H.slice(0,t))})):[],fe=L(N,[],e=>e.ancestors).concat(de);if(void 0!==Q){let e=Q.length,n=Q[Q.length-1|0];t=1!==e&&void 0!==n?n.label:ce}else t=ce;if(void 0!==Q){let e=Q[Q.length-1|0];n=void 0!==e?le(e):null}else n=i(G1,{title:"Drill path no longer valid",detail:"The data shape has changed since this view was opened.",onRetry:()=>X([])});let he,pe=0===H.length,ge=pe?Dt(x.filter(e=>"Instance"===e.level),Y,g):[];if(pe&&void 0!==g){let e=fn(b,g),t=h4(g,x,j(j(l,e=>j(c,t=>tO(e,t))),e=>e.transitions));if(e.map((n,r)=>e.slice(0,r).some(e=>$(t(n,e)))).some(e=>e))he=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"])}(fn(e,t),n).map(e=>{let t=e[0];return{key:t,label:lt(t),state:e[1]}})}(b,g,U(Rt(Y,g),""));he=0!==e.length?i(u0,{steps:e}):void 0}}else he=void 0;let me=Qa(b,j(j(l,e=>j(c,t=>tO(e,t))),e=>e.retiredLabel)),ve=pe?U(j(me,e=>Za(e,Xe(Y,e.field))),null):null,ye=pe&&void 0!==p?x3(S,Y,g,me).map(e=>{let t=E3(e,p,Y);return{key:"rowAction:"+e.command.name,label:e.label,run:()=>B(e=>({command:t.command,rowId:void 0,initialValues:t.initialValues,navigateTo:t.navigateTo,memberFields:re(t.command),formKey:t.formKey}))}}):[],be=i(u2,{crumbs:fe,title:t,titleAccessory:r("div",{children:[ve,pe&&void 0!==o&&void 0!==p?o(p):null],className:eee}),commands:ge.map(e=>({key:e.name,label:e.label,run:()=>B(t=>({command:e,rowId:p,initialValues:w3(e,Y,void 0),memberFields:re(e),formKey:g6(e.name,U(p,""),void 0)}))})).concat(ye),controls:j(N,e=>e.controls),inBar:T});return r("div",{children:[TV(T?A:void 0,be),U(he,null),pe?i(cl,{fill:e=>{if(void 0!==p)return z(P(Q6(b,e,x),e=>Y6(e.command,ne)),e=>()=>B(t=>({command:e.command,rowId:p,memberFields:re(e.command),formKey:g6(e.command.name,U(p,""),void 0)})))},children:n}):n,pe&&void 0!==a&&void 0!==p?a(p):null,L(O[0],null,e=>i(m6,{state:e,onClose:()=>B(e=>{}),onSucceeded:t=>{t?q(e.navigateTo)&&M(C,e=>{setTimeout(e,500)}):M(C,e=>e()),M(e.navigateTo,J)}}))],className:Z7})};function Fee(e){return"var("+e+")"}let Oee=Ls([qo("flex"),Go("column"),zo("gap",Fee(_t.md))]),Pee=Ls([qo("flex"),jo("center"),zo("gap",Fee(_t.md)),zo("flex-wrap","wrap"),zo("padding-bottom",Fee(_t.sm)),zo("border-bottom","1px solid var("+bt.border+")")]),Mee=Ls([zo("font-size",Fee(xt.sizeLg)),zo("font-weight",Fee(xt.weightMedium)),zo("color",Fee(bt.textPrimary)),Zo(Ts(0))]),Lee=Ls([qo("flex"),jo("center"),Wo("wrap"),zo("gap",Fee(_t.sm)),zo("margin-left","auto")]);let zee=function(e){let t=e.contextId,n=e.slice,o=s(()=>{}),a=o[1];return r("div",{children:[r("div",{children:[i("h2",{children:n.name,className:Mee}),i("div",{children:n.commands.map(e=>i("button",{children:e.label,className:c2,onClick:n=>a(n=>({command:e,rowId:t,formKey:g6(e.name,U(t,""),void 0)}))},e.name)),className:Lee})],className:Pee}),L(o[0],null,e=>i(m6,{state:e,onClose:()=>a(e=>{}),scope:n.name}))],className:Oee})};let jee=function(e){let t=e.uiHints,n=e.hostViewName,a=e.entityId,l=e.binding,c=gl(),u=Ge(),d=ae(),f=eV(),h=L(e.requiredAccess,!1,e=>!f(e)),p=q4(l.readModel,function(e,t){let n={};return M(kW(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=bl(c,l.readModel.name),y=z(v,e=>({pluginId:e.pluginId,viewName:l.readModel.name})),b=function(e,t){return e+"."+t.readModel.name}(n,l),_=rr(m,j(t,e=>nO(e,b)),{field:l.readModel.labelField,source:l.readModel.labelFieldSource}),x=LI(m,"List",c,y,_.labelField,_.projectedLabelField),S=j(t,e=>tO(e,b)),w=wO(l.readModel.schema,S,{registry:c,ownEntity:y}),E=UF(e.pluginId,n,l.readModel.name),k=s(()=>BF(E)),C=k[1],A=SG(),N=EO(k[0],S,un(l.readModel.schema),void 0,w),T=NF(g,x,c,y,void 0),R={lookupLabel:(e,t)=>gF(T,e,c,t),isMissing:(e,t)=>yF(T,e,c,t),retiredBadge:(e,t)=>mF(T,e,c,t),linkable:(e,t)=>vF(T,e,c,t,!1)},D=YI(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(Sl(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(O2,{});else{let e,t=0;void 0!==N&&N.id!==DF?e=(e=>{let t=l.readModel.name,n=p.rows,r=j(S,e=>e.accent),i=ua(p.canLoadMore),o={readModelName:t,rows:n,schema:m,semantics:_,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(ca,{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(G1,{title:"Could not load related rows",detail:$._0,onRetry:p.refetch}):i(G1,{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,DF,e=>e.id),onSelect:e=>{$F(E,e,A),C(t=>({mode:e,band:A}))}}):null],style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}}),B]})},Uee={contents:void 0};function Bee(e){Uee.contents=e}function $ee(e){return e.filter(e=>"Instance"===e.level)}function qee(e,t,n,r,i){let o=void 0!==r?r:[],s=$ee(n),a=$ee(o),l=fn(e,t),c=g4(e,t,n,i),u=function(e,t,n){let r=l4(n),i=fn(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[n4(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?m4(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 Gee(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($ee(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 Vee(e){return"var("+e+")"}let Kee=Ls([qo("flex"),Go("column"),zo("gap",Vee(_t.md))]),Wee=Ls([zo("font-size",Vee(xt.sizeLg)),zo("font-weight",Vee(xt.weightMedium)),zo("color",Vee(bt.textPrimary)),Zo(Ts(0))]),Hee=Ls([zo("font-size",Vee(xt.sizeXs)),zo("color",Vee(bt.textDisabled))]),Jee=Ls([qo("flex"),zo("flex-wrap","wrap"),jo("flexStart"),zo("gap",Vee(_t.md))]);let Xee=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",Vee(_t.sm))]),Qee=Ls([zo("font-size",Vee(xt.sizeXs)),zo("color",Vee(bt.textDisabled)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),Yee=Ls([qo("flex"),Go("column"),zo("gap","6px")]),Zee=Ls([qo("flex"),jo("center"),zo("flex-wrap","wrap"),zo("gap","4px")]),ete=Ls([zo("color",Vee(bt.textSecondary)),zo("font-size",Vee(xt.sizeSm))]),tte=Ls([zo("font-size",Vee(xt.sizeXs)),zo("color",Vee(bt.textDisabled))]),nte=Ls([qo("flex"),Go("column"),zo("gap",Vee(_t.sm)),zo("padding-top",Vee(_t.sm))]),rte=Ls([zo("font-size",Vee(xt.sizeXs)),zo("font-weight",Vee(xt.weightMedium)),zo("color",Vee(bt.textSecondary)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),ite=Ls([qo("flex"),zo("flex-wrap","wrap"),zo("gap","6px")]);function ote(e,t){let n=t.toState;return r("div",{children:[t.system?i(aY.make,{label:t.label}):i(sY.make,{label:t.label}),void 0!==n?r(o,{children:[i("span",{children:"→",className:ete}),i(oY.make,{swatch:QQ(e,n),label:lt(n),dot:!1})]}):null],className:Zee},t.commandName)}let ste=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=qee(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(Uee.contents,n=>n(e,t))}(Gee(d,c),U(s,lt(l))),r("div",{children:[void 0!==s?i("h3",{children:s,className:Wee}):null,i("div",{children:"Lifecycle on “"+lt(l)+"”",className:Hee}),void 0!==t?t:r(o,{children:[i("div",{children:d.states.map(e=>{let t=QQ(f,e.value);return r("div",{children:[r("div",{children:[i(oY.make,{swatch:t,label:e.label}),e.terminal?i("span",{children:"end",className:Qee}):null],className:Xee}),e.terminal?i("span",{children:"No commands available",className:tte}):i("div",{children:e.outgoing.map(e=>ote(f,e)),className:Yee})],className:(n=t,Ls([qo("flex"),Go("column"),zo("gap",Vee(_t.sm)),zo("flex","0 1 240px"),zo("padding",Vee(_t.md)),zo("background",Vee(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-left","3px solid "+n.border),zo("border-radius",Vee(St.md))]))},e.value);var n}),className:Jee}),0!==d.anyState.length?r("div",{children:[i("span",{children:"Any state",className:rte}),i("div",{children:d.anyState.map(e=>ote(f,e)),className:ite})],className:nte}):null]})],className:Kee})};function ate(e){return"var("+e+")"}let lte=Ls([qo("flex"),Go("column"),zo("gap",ate(_t.xl))]),cte=Ls([zo("font-size",ate(xt.sizeXl)),zo("font-weight",ate(xt.weightMedium)),zo("color",ate(bt.textPrimary)),Zo(Ts(0))]),ute=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",ate(_t.md))]),dte=Ls([qo("flex"),Go("column"),zo("gap",ate(_t.md)),zo("padding",ate(_t.lg)),zo("background",ate(bt.surfaceSubtle)),zo("border","1px solid var("+bt.borderSubtle+")"),zo("border-radius",ate(St.md))]);function fte(e){return e.filter(e=>function(e,t,n,r){let i=void 0!==r?r:[];return void 0!==t&&0!==fn(e,t).length&&$ee(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 hte="lifecycle",pte="diagram";let gte=function(e){let t=e.uiHints,n=w6(),o=fte(e.views),s=vt(n.get(hte),pte)?"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(hte,t)},t),l=$(Uee.contents)?r("div",{children:[a("Lane","","Lane"===s),a("Diagram",pte,"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:cte}),l],className:ute}),0!==o.length?o.map(e=>i("div",{children:i(ste,{schema:e.schema,lifecycleField:U(e.lifecycleField,""),commands:e.commands,systemCommands:U(e.systemCommands,[]),title:e.name,transitions:j(j(t,t=>tO(t,e.name)),e=>e.transitions),display:s}),className:dte},e.name)):i(Ks,{title:"No lifecycles",description:"No view in this plugin declares a lifecycle enum with state-scoped commands."})],className:lte})};function mte(e){return"var("+e+")"}let vte=Ls([qo("flex"),Go("column"),zo("gap",mte(_t.md)),zo("font-family",mte(xt.fontFamily))]),yte=Ls([qo("flex"),jo("center"),zo("gap",mte(_t.sm)),zo("color",mte(bt.textSecondary)),zo("font-size",mte(xt.sizeSm)),zo("font-weight",mte(xt.weightMedium)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),bte=Ls([qo("inlineFlex"),jo("center"),zo("padding","0 6px"),zo("border-radius",mte(St.full)),zo("background",mte(bt.surfaceElevated)),zo("color",mte(bt.textPrimary)),zo("font-size",mte(xt.sizeXs)),zo("letter-spacing","0")]),_te=Ls([qo("flex"),Go("column"),zo("gap",mte(_t.md))]),xte=Ls([qo("flex"),jo("flexStart"),zo("gap",mte(_t.sm))]),Ste=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-width","0"),Vo(1)]),wte=Ls([qo("flex"),jo("baseline"),zo("gap",mte(_t.sm))]),Ete=Ls([zo("color",mte(bt.textPrimary)),zo("font-size",mte(xt.sizeSm)),zo("font-weight",mte(xt.weightMedium))]),kte=Ls([zo("color",mte(bt.textDisabled)),zo("font-size",mte(xt.sizeXs))]),Cte=Ls([zo("color",mte(bt.textPrimary)),zo("font-size",mte(xt.sizeSm)),zo("line-height",mte(xt.lineHeightNormal)),zo("white-space","pre-wrap"),zo("word-break","break-word")]),Ate=Ls([zo("color",mte(bt.textDisabled)),zo("font-size",mte(xt.sizeSm)),zo("padding","var("+_t.sm+") 0")]),Nte=Ls([qo("flex"),Go("column"),jo("flexEnd"),zo("gap",mte(_t.sm))]),Tte=Ls([zo("width","100%"),zo("min-height","64px"),zo("padding",mte(_t.sm)),zo("background",mte(bt.surface)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",mte(St.md)),zo("color",mte(bt.textPrimary)),zo("font-family",mte(xt.fontFamily)),zo("font-size",mte(xt.sizeSm)),zo("resize","vertical")]),Rte=Ls([zo("background",mte(bt.brand)),zo("border","none"),zo("border-radius",mte(St.md)),zo("color",mte(bt.textOnBrand)),zo("padding","4px var("+_t.md+")"),zo("font-size",mte(xt.sizeSm)),zo("font-weight",mte(xt.weightMedium)),$o("pointer"),ws([zo("opacity","0.5"),$o("default")])]),Dte=Ls([zo("color",mte(bt.error)),zo("font-size",mte(xt.sizeXs)),zo("align-self","flex-start")]);function Ite(e){let t=e.comment,n=t.timestamp;return r("div",{children:[i(xa,{name:U(t.author,"?"),src:t.authorImageUrl,size:"Medium"}),r("div",{children:[r("div",{children:[i("span",{children:U(t.author,"Unknown"),className:Ete}),void 0!==n?i("span",{children:PZ(e.nowMs,n),className:kte}):null],className:wte}),i("span",{children:t.body,className:Cte})],className:Ste})],className:xte})}let Fte=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(),b=""!==y&&!h,_=()=>{if(b)return M(a,e=>e(y)),m(e=>"")};return r("div",{children:[r("div",{children:[d,i("span",{children:u.length.toString(),className:bte})],className:yte}),0===u.length?i("div",{children:f,className:Ate}):i("div",{children:u.map(e=>i(Ite,{comment:e,nowMs:p},e.id)),className:_te}),void 0!==a?r("div",{children:[i("textarea",{className:Tte,disabled:h,placeholder:"Write a comment…",value:v,onKeyDown:e=>{if("Enter"===e.key&&(e.metaKey||e.ctrlKey))return e.preventDefault(),_()},onChange:e=>{let t=e.target.value;m(e=>t)}}),void 0!==n?i("span",{children:n,className:Dte}):null,i("button",{children:h?"Posting…":"Comment",className:Rte,disabled:!b,onClick:e=>_()})],className:Nte}):null],className:vte})};let Ote=function(e){let t=e.entityId,n=e.binding,r=sF(),o=f2(),a=gl(),l=eV(),c=L(e.requiredAccess,!1,e=>!l(e)),u=G4(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(yW(r,e.entityField),n))return r}),i=t=>j(j(e.timestampField,e=>yW(t,e)),jc);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(yW(t,"id"),"#"+n.toString()),body:U(yW(t,e.bodyField),""),author:j(e.authorField,e=>yW(t,e)),timestamp:j(e.timestampField,e=>yW(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=>cW(e.schema,oW)),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 m2(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(Fte,{comments:g,onPost:v,posting:d[0],error:h[0]})};function Pte(e){return"var("+e+")"}let Mte=Ls([qo("flex"),Go("column"),zo("gap",Pte(_t.lg))]),Lte=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("gap",Pte(_t.md))]),zte=Ls([zo("font-size",Pte(xt.sizeXl)),zo("font-weight",Pte(xt.weightMedium)),zo("color",Pte(bt.textPrimary)),Zo(Ts(0))]),jte=Ls([qo("flex"),Wo("wrap"),jo("center"),zo("gap",Pte(_t.md)),zo("font-size",Pte(xt.sizeSm)),zo("color",Pte(bt.textSecondary))]),Ute=Ls([qo("inlineFlex"),jo("center"),zo("gap","4px"),$o("pointer")]);let Bte=Ls([zo("font-size",Pte(xt.sizeXs)),zo("color",Pte(bt.textDisabled))]),$te=Ls([qo("flex"),jo("center"),zo("gap",Pte(_t.sm))]),qte=Ls([zo("background","none"),zo("border","1px solid var("+bt.border+")"),zo("border-radius",Pte(St.sm)),zo("padding","2px var("+_t.sm+")"),zo("color",Pte(bt.textSecondary)),zo("font-size",Pte(xt.sizeSm)),$o("pointer"),Cs([zo("background",Pte(bt.surfaceSubtle)),zo("color",Pte(bt.textPrimary))])]);let Gte=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=eV(),h=sF(),p=aF(),g=gl(),m=P1(),v=s(()=>[]),y=v[1],b=v[0],_=e=>rr(e.schema,j(o,t=>nO(t,e.name)),{field:e.labelField,source:e.labelFieldSource}),x=G4(l,!0),S={readModelName:l.name,rows:x.rows,schema:l.schema,semantics:_(l),window:ua(x.canLoadMore),onOpenRow:(e,t)=>d(Sl(c,l.name,e,[])),role:v4,ownEntity:{pluginId:c,viewName:l.name}},w=a.map((e,t)=>{let n=rW(u,e.readModel.name,f),r=n&&!b.includes(e.readModel.name);return[e,t,r,n,G4(e.readModel,r)]}),E=(e,t)=>U(j(j(o,t=>tO(t,e.name)),e=>e.accent),Y0[fe(t,Y0.length)]),k=me(w,e=>{let t=e[4],n=e[0],r=C4(n.readModel.commands,n.resourceRef),i=y2(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:_(n.readModel),accent:E(n.readModel,e[1]),window:ua(t.canLoadMore),onOpenRow:(e,t)=>d(Sl(c,n.readModel.name,e,[])),onCommand:z(r,e=>i),role:y4,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(iW(u,a.map(e=>e.readModel.name),f)));return r("div",{children:[i("div",{children:i("h2",{children:e.canvasName,className:zte}),className:Lte}),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]),Ls([qo("inlineBlock"),zo("width","8px"),zo("height","8px"),zo("border-radius","50%"),zo("background",n)]))}),t.readModel.name],className:Ute},t.readModel.name);var n}),className:jte}),m.element,e.mode.render(C),0!==A.length?r("div",{children:[i("button",{children:"Load more",className:qte,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:Bte})],className:$te}):null,0!==R.length?i("span",{children:R.join(" · "),className:Bte}):null],className:Mte})};function Vte(e){return e}function Kte(e,t){let n=void 0!==t?t:[];return e.map(e=>({name:e.name,schema:e.schema,commands:e.commands,rowActionCandidates:N7(n,e.name),declaredLabelField:e.labelField,declaredLabelSource:e.labelFieldSource}))}function Wte(e){if("object"==typeof e)return"heuristic:"+e._0;switch(e){case"Annotation":return"annotation";case"Type":return"type";case"Hint":return"hint"}}function Hte(e,t,n){return void 0!==t?Object.entries(g4(e.schema,t,e.commands,j(n,e=>e.transitions))):[]}function Jte(e){let t=[["command",y3(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(x7)]]:[];return Ze(t.concat(n).concat(i))}function Xte(e){let t=t=>e.filter(t).map(Jte);return Ze([["attached",t(w7)],["vetoed",t(E7)],["deferred",t(k7)]])}function Qte(e){return z(e.declaredLabelField,t=>({field:t,source:e.declaredLabelSource}))}function Yte(e,t){return L(P(e.declaredLabelSource,n=>vt(e.declaredLabelField,t)),t,e=>t+" ("+e+")")}function Zte(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+" ("+Wte(e.provenance)+")")}function ene(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+" ("+Wte(e.provenance)+")");case"Geolocated":let r=t._0;return L(Xe(e.semantics,r),r+" (point on Located)",e=>r+" ("+Wte(e.provenance)+", point on Located)")}}function tne(e,t,n,r){return Ze([["plugin",e],["hintErrors",(void 0!==r?r:[]).map(Vte)],["views",t.map(e=>function(e,t,n){let r=e.name,i=e.schema,o=rr(i,t,Qte(e)),s=Qe(o.semantics).map(e=>{let t=e[1];return Ze([["field",e[0]],["semantic",hn(t.semantic)],["provenance",Wte(t.provenance)]])}),a=[];M(o.geo,e=>{a.push(["geo",ene(o,e)])}),M(o.dateSpan,e=>{a.push(["dateSpan",Zte(o,e)])}),M(o.statusField,e=>{a.push(["status",e])}),M(o.labelField,t=>{a.push(["label",Yte(e,t)])}),M(o.imageField,e=>{a.push(["image",e])}),M(o.parentField,e=>{a.push(["parent",e])});let l=MF(i,void 0).map(e=>e.id),c=Hte(e,o.statusField,n).map(e=>{let t=e[1];return[e[0],t.command+" ("+t4(t.tier)+")"]});return Ze([["view",r],["capableModes",l],["roles",Ze(a)],["transitions",Ze(c)],["rowActions",Xte(U(e.rowActionCandidates,[]))],["fields",s]])}(e,j(n,t=>nO(t,e.name)),j(n,t=>tO(t,e.name))))]])}function nne(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=rr(r,j(t,e=>nO(e,n)),Qte(e)),o=MF(r,void 0).map(e=>e.id).join(", "),s=[];M(i.geo,e=>{s.push("geo="+ene(i,e))}),M(i.dateSpan,e=>{s.push("dateSpan="+Zte(i,e))}),M(i.statusField,e=>{s.push("status="+e)}),M(i.labelField,t=>{s.push("label="+Yte(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=Hte(e,i.statusField,j(t,e=>tO(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(w7)+" attached, "+p(E7)+" vetoed, "+p(k7)+" 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(S7).join("; "):"deferred — no tier admits it yet"),console.log(" "+e.name+" · "+y3(t.action)+"("+t.action.field+"): "+n)})}),console.log(JSON.stringify(tne(e,t,n,i),null,2))}function rne(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}function ine(e){return Object.fromEntries([["kind",e.kind],["senderId",e.senderId],["sentAt",e.sentAt],["body",e.body]])}function one(e,t,n,r,i){let o=void 0===r||r,s=oP(),l=j(s,e=>e.clientNamespace()),c=o&&$(l)&&L(s,!1,e=>e.clientChannelsAvailable()),u=void 0!==l?function(e,t,n){return"/"+rne(e)+"/"+rne(t)+"/"+rne(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,[ine(o)]).then(e=>{"Ok"!==e.TAG&&console.warn("[AutoClientChannel] publish to "+u+" failed: "+e._0)})}}}let sne="heartbeat",ane="hello",lne="leave";function cne(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 une(e,t,n,r,i){let o=void 0===i||i,l=s(()=>[]),c=l[1],u=h(void 0),d=one("presence",t,n,o&&""!==n,e=>{if(c(t=>function(e,t,n){let r=t.kind;if(r===lne){let n=cne(t.body);if(void 0===n)return e;let r=n[0];return e.filter(e=>e.userId!==r)}if(r!==sne&&r!==ane)return e;let i=cne(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!==ane)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(sne,e);u.current=t,p(ane,e),p(sne,e);let i=setInterval(t,1e4);return()=>{clearInterval(i),u.current=void 0,p(lne,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 dne(e){return"var("+e+")"}let fne=Ls([qo("inlineFlex"),jo("center"),zo("gap",dne(_t.xs))]),hne=Ls([zo("font-family",dne(xt.fontFamily)),zo("font-size",dne(xt.sizeSm)),zo("color",dne(bt.textSecondary)),zo("white-space","nowrap")]);function pne(e){return 1===e?"1 other here":e.toString()+" others here"}let gne=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(sl,{members:u,size:a,max:l}),c?i("span",{children:pne(s.length),className:hne}):null],className:fne,title:s.map(e=>e.username).join(", ")})};let mne=function(e){let t=j(mG(),e=>e.identity),n=L(t,"",e=>e.userId),r=L(t,"",e=>e.username),o=une(0,e.readModel+"-"+e.entityId,n,""===r?n:r,""!==n).map(e=>({userId:e.userId,username:e.username}));return i(gne,{people:o})};function vne(e){return""===e?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}let yne={contents:[]},bne={contents:[]};function _ne(e,t,n){if("id"!==n)return;let r=e+"."+t;return yne.contents.some(e=>e===r)?void 0:(yne.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 xne(e,t,n,r){if("id"===n||0!==r.length&&r.some(e=>e===n))return;let i=e+"."+t;return bne.contents.some(e=>e===i)?void 0:(bne.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 Sne(e){let t=[];return e.forEach(e=>{let n=(n,r,i,o,s)=>{_ne(e.id,n,i),xne(e.id,n,i,o);let a=Qa(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 wne(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 Ene(e){return[tt(e),nt(e)]}function kne(e,t){return e.find(e=>e.name===t)}function Cne(e,t){let n=vne(t),r=kne(e,nt(n));return void 0!==r?r:kne(e,n)}function Ane(e){return me(U(j(j(ht(e),e=>Xe(e,"required")),pt),[]),dt)}function Nne(e,t,n,r){return me(e.references,i=>{let o,s=i.fieldName.includes("[]"),a=h5(i.fieldName);if(void 0!==a){let e=a[1],t=j(j(Xe(r,a[0]),ht),p5),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,Ane),[]).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=kne(f,i.entity),p=void 0!==h?h:Cne(f,i.entity);if(o[1]){if(void 0!==p){let e=Ene(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 Tne(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=wne(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=kne(n,nt(t.name));p=void 0!==e?e:kne(n,t.name)}if(void 0!==p)g=p;else{let e=wne(a,u);g=void 0!==e?Cne(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=Ene(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===wne(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 Rne(e,t,n,r){let i=Ane(e.schema),o=j(j(ht(e.schema),e=>Xe(e,"properties")),ht);return 0===e.references.length?Tne(e,t,n,i,o,r):Nne(e,n,i,U(o,{}))}function Dne(e,t){let n=(n,r)=>{let i={...n};return i.refFields=Rne(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 Ine={capitalize:vne,singularize:tt,warnedIdLabel:yne,warnedUnsearchable:bne,warnIfIdLabel:_ne,warnIfUnsearchable:xne,buildRegistry:Sne,stemFromKey:wne,entityDisplayNames:Ene,findByName:kne,findByStem:Cne,requiredSet:Ane,resolveExplicitRefs:Nne,resolveByHeuristic:Tne,resolveForCommand:Rne,enrichPlugin:Dne};function Fne(e){let t=Je.object(e);if(void 0===t)return;if($(Lt(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:Fne(t))))}function One(e,t){let n=me(Object.entries(e),e=>L(Zt(e[1]),!1,e=>Kt(e,"x-reventless-hidden"))?void 0:e[0]);return t&&!n.includes("id")?["id"].concat(n):n}let Pne=new Map;function Mne(e,t,n){let r=me(t.arms,e=>{let r=zt(t,e);if(void 0===r)return;let i=n(e);return""===i?void 0:"... on "+r+" { "+i+" }"});return t.arms.some(e=>q(zt(t,e)))&&function(e){if(q(Pne.get(e)))Pne.set(e,!0),console.error('AutoUI: the union field "'+e+'" carries neither '+It+" on the field nor "+Ft+" 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 Lne(e,t,n){let r=void 0!==t?t:3;return One(e,void 0===n||n).map(t=>{let n=j(e[t],Lt);if(void 0!==n)return Mne(t,n,e=>r<=0?"":Lne(e.properties,r-1|0,!1));if(r<=0)return t;let i=j(e[t],Fne);return void 0!==i?t+" { "+Lne(i,r-1|0,!1)+" }":t}).join(" ")}function zne(e,t,n){return me(One(e,!0),t=>{let n=e[t];if(void 0===n)return t;let r=Lt(n);if(void 0!==r)return Mne(t,r,e=>Lne(e.properties,1,!1));let i=Fne(n);if(void 0===i)return t;let o=function(e,t){return me(One(e,t),t=>{let n=e[t];if(void 0===n)return t;let r=Lt(n);return void 0!==r?Mne(t,r,e=>Lne(e.properties,1,!1)):q(Fne(n))?t:void 0}).join(" ")}(i,!1);return""===o?void 0:t+" { "+o+" }"}).join(" ")}function jne(e){return U(j(j(Je.object(e),e=>e.properties),Je.object),{})}function Une(e,t,n,r,i,o){let s,a=void 0!==r&&r,l=void 0!==i&&i,c=void 0!==o&&o,u=zne(jne(t)),d=a||c,f=["$first: Int","$after: String","$last: Int","$before: String"],h=["first: $first","after: $after","last: $last","before: $before"],p=$(sn(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 Bne(e,t){let n=Lne(jne(t),void 0,void 0),r=$(sn(t))?[", $includeRetired: Boolean",", includeRetired: $includeRetired"]:["",""],i=r[1],o=r[0],s=ln(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 $ne(e,t,n){return"Operator"===e?t:U(n,[])}function qne(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,$ne(t,e.commands,e.systemCommands)))}),e.stateChangeSlices.forEach(e=>{let n=$ne(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 Gne(e,t,n,r,i){let o=void 0!==i?i:b3,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 A7(s,t,0,n,o)}function Vne(e,t,n,r,s,a,l,c,u,d,f,h,p,m){let v,y=[],b=void 0!==s?s:[],_=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===b.length?[e]:b,N=Sne(A),T=Dne(e,N),R=qne(T,"Operator"),D=qne(T,"System"),I=(e,t,n)=>{let r={...e};return r.refFields=Rne(e,t,N,n),r},F=Gne(T,A,N,R,I),O=_.find(e=>e.id===T.id);if(void 0!==O){let e=Sne(_);v=Gne(O,_,e,qne(O,"Operator"),void 0)}else v=F;let P={};v.filter(w7).forEach(e=>{P[e.viewName]=U(Xe(P,e.viewName),[]).concat([y3(e.action)])});let B=L(p,[],e=>SO(e,T,_,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=>tO(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===y3(e)))}(function(e,t,n){let r=void 0!==n?n:b3;return me(U(j(e,e=>e.rowActions),[]),e=>_3(e,t,r))}(t,A,I),function(e,t){return N7(e,t).filter(w7).map(e=>e.action)}(F,e),U(j(t,e=>e.suppressRowActions),[]))},J=(e,t,n,r,o,s)=>{let a=0===an(l=e.schema).length&&q(ln(l));var l;let c=a?e.queryField+"ByIds":void 0,u=a?function(e,t){let n=zne(jne(t)),r=$(sn(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(jne(e));return t.includes("updatedAt")?"updatedAt":t.includes("createdAt")?"createdAt":void 0}(e.schema),f=cn(e.schema),h=e.name,g=Ue(_l(K,h)),m=Xe(E,h),v=n+h,y=MK(T.name,h,e.sortIndex,j(p,e=>tO(e,h)),C&&$(e.ownerField)),b={fragmentId:v,title:h,menuEntry:y,requiredAccess:m,url:g},_=H(h),x=K+"."+h;return G.push(Be(xl(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(eW,{definition:b,children:(l=a[0],h=a[1],i(m8,{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:_,archiveOffered:!C,ownerScoped:C&&$(e.ownerField)},x))});var l,h})),function(e,t,n,r){e[function(e,t){return e+"."+t}(t,n)]=Ue(r)}(V,K,h,_l(K,h)),b},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=SW(e.schema);if(""===e.queryDocument){let o={...e};return o.systemCommands=n,o.commands=t,o.queryDocument=Une(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=SW(e.schema),o=Une(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 PF().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=>tO(t,e.name)),i=U(j(r,e=>e.canvas),n.label),l=j(r,e=>e.role);if(void 0!==l)return l===v4?a(o,i,e):l===y4?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,eO),n=(r=tO(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)jK(e.name);else{if(void 0!==r){let e=function(e,t){return e+"_"+t+"EventHistory"}(r,n);return{queryField:e,queryDocument:LK(e),displayName:n}}jK(e.name)}}(e,n),t=>{let n=Xe(E,e.name);return e=>i(B7,{binding:t,entityId:e,requiredAccess:n})})},te=e=>{let t=U(p,eO);if(U(j(tO(t,e.name),e=>e.presence),!1))return t=>i(mne,{readModel:e.name,entityId:t})},ne={...T};ne.readModels=X.concat(Q);let re=e=>{let t=U(p,eO);return(n=AW(ne,e.name),s=tO(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(jee,{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(vW(Z,n),e=>{let t=Xe(E,e.readModel.name);return n=>i(Ote,{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=Bne(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(Iee,{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=Bne(t,e.schema),r=H(e.name),o=Xe(w,e.name),s=void 0!==o?o:(t,n,o)=>i(Iee,{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(zee,{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));$(jF("autoui.inferenceReport"))&&nne(T.id,Kte(le,F),p,B),M(m,e=>e(tne(T.id,Kte(le,F),p,B)));let ce,fe=le.map(e=>[e,rr(e.schema,void 0,void 0)]),he=me(PF(),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=>tO(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=MK(T.name,r,900,void 0,void 0),a=nW(E,t.map(e=>e.name)),l=Ue(_l(K,r)),c={fragmentId:o,title:r,menuEntry:s,requiredAccess:a,url:l};return G.push(Be(xl(K,r),e=>i(eW,{definition:c,children:i(Q7,{pluginId:K,mode:n,canvasName:r,readModels:t,uiHints:p,viewAccess:E})}))),c}):[],ve=W("scheduler")?me(PF(),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=>tO(t,e.name)),i=U(j(t,e=>e.canvas),n.label),a=j(t,e=>e.role);if(void 0!==a)return a===v4?s(r,i,e):a===y4?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(v4,1),c=a(y4,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=MK(T.name,r,910,void 0,void 0),h=tW(E,a.name),g=Ue(_l(K,r)),m={fragmentId:d,title:r,menuEntry:f,requiredAccess:h,url:g};return G.push(Be(xl(K,r),e=>i(eW,{definition:m,children:i(Gte,{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}),be=X.concat(Q).flatMap(e=>function(e,t){let n=rr(e,t,void 0).semantics;return me(Mn(e),e=>{let t=e[0];return j(Xe(n,t),e=>{if(bn(e.semantic).includes("Measure"))return t})})}(e.schema,j(p,t=>nO(t,e.name))).map(t=>({view:e.name,field:t,aggregate:"sum"}))),_e=U(j(p,e=>e.dashboard),[]),xe=_e.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=_e.concat(we).concat(be.filter(e=>Se(Ee,e)));if(0!==ke.length&&W("dashboard")){let e="Dashboard",t=X.concat(Q),n=T.id+".dashboard",r=MK(T.name,e,-100,void 0,void 0),o=nW(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(_l(K,e))};G.push(Be(xl(K,e),e=>i(eW,{definition:s,children:i(_7,{pluginId:K,metrics:ke,readModels:t,uiHints:p,viewAccess:E})}))),ce=[s]}else ce=[];let Ce,Ae=fte(X.concat(Q));if(0!==Ae.length&&W("lifecycles")){let e="Lifecycles",t={fragmentId:T.id+".lifecycles",title:e,menuEntry:MK(T.name,e,-50,void 0,void 0),requiredAccess:void 0,url:Ue(_l(K,e))};G.push(Be(xl(K,e),e=>i(gte,{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 Kne(e){return PP(FP(e))}function Wne(e){return FP(e).errors.some(e=>!!vt(e.code,"FORBIDDEN")||vt(e.errorType,"Unauthorized"))}let Hne=new Map;async function Jne(t,n,r){!function(t,n){let r=Hne.get(t);if(void 0===r||r!==n)e.registerRemotes([{name:t,entry:n,type:"module"}]),Hne.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 Xne=l(null),Qne={didCatch:!1,error:null};class Yne extends x{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Qne}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(Qne)}}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(Qne))}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(Xne.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Zne(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 ere(e,t){console.error("Fragment crashed:",e)}let tre=function(e){let t=e.fallbackComponent;return c(Yne,{FallbackComponent:void 0!==t?t:Zne,onError:ere,children:e.children})};let nre=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 Jne(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(tre,{children:c(u._0,e.panelProps)}):i("div",{children:"Panel error: "+u._0,style:{color:"#a00",padding:"0.75rem"}})};function rre(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function ire(e){return"object"===rre(e)}function ore(e,t){return e.length<124?e:t}var sre,are;function lre(e){if(!ire(e))throw new Error(`Message is expected to be an object, but got ${rre(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 ${rre(e.type)}`);switch(e.type){case are.ConnectionInit:case are.ConnectionAck:case are.Ping:case are.Pong:if(null!=e.payload&&!ire(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 are.Subscribe:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${rre(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!ire(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${rre(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 ${rre(e.payload.query)}`);if(null!=e.payload.variables&&!ire(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 ${rre(e.payload.variables)}`);if(null!=e.payload.operationName&&"string"!==rre(e.payload.operationName))throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${rre(e.payload.operationName)}`);if(null!=e.payload.extensions&&!ire(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 ${rre(e.payload.extensions)}`);break;case are.Next:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${rre(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!ire(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${rre(e.payload)}`);break;case are.Error:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${rre(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 are.Complete:if("string"!=typeof e.id)throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${rre(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 cre(e,t){return lre(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"}(sre||(sre={})),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"}(are||(are={}));var ure=function(e){return this instanceof ure?(this.v=e,this):new ure(e)},dre=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 ure?Promise.resolve(e.value.v).then(l,c):u(o[0][2],e)}(i[e](t))}catch(iB){u(o[0][3],iB)}}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 fre(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=pre,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(b=p)&&"constructor"in b&&"CLOSED"in b&&"CLOSING"in b&&"CONNECTING"in b&&"OPEN"in b))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 b;if(!y)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const _=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 _("function"==typeof t?await t():t,"graphql-transport-ws");let o,c;function d(){isFinite(s)&&s>0&&(clearTimeout(c),c=setTimeout(()=>{i.readyState===_.OPEN&&(i.send(cre({type:are.Ping})),x.emit("ping",!1,void 0))},s))}S(e=>{w=void 0,clearTimeout(o),clearTimeout(c),r(e),e instanceof hre&&(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!==_.OPEN)return;i.send(cre(e?{type:are.ConnectionInit,payload:e}:{type:are.ConnectionInit},m)),isFinite(l)&&l>0&&(o=setTimeout(()=>{i.close(sre.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),d()}catch(e){x.emit("error",e),i.close(sre.InternalClientError,ore(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 lre("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(cre(n.payload?{type:are.Pong,payload:n.payload}:{type:are.Pong})),x.emit("pong",!1,n.payload)));if(f)return;if(n.type!==are.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(sre.BadResponse,ore(n instanceof Error?n.message:new Error(n).message,"Bad response"))}}})()));e.readyState===_.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===_.OPEN&&t()},o):t()}}),r])]}function R(e){if(pre(e)&&(function(e){return![1e3,1001,1006,1005,1012,1013,1014].includes(e)&&(e>=1e3&&e<=1999)}(e.code)||[sre.InternalServerError,sre.InternalClientError,sre.BadRequest,sre.BadResponse,sre.Unauthorized,sre.SubprotocolNotAcceptable,sre.SubscriberAlreadyExists,sre.TooManyInitialisationRequests].includes(e.code)))throw e;if(N)return!1;if(pre(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 are.Next:return void t.next(e.payload);case are.Error:return i=!0,r=!0,t.error(e.payload),void o();case are.Complete:return r=!0,void o()}});return s.send(cre({id:n,type:are.Subscribe,payload:e},m)),o=()=>{r||s.readyState!==_.OPEN||s.send(cre({id:n,type:are.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 dre(this,arguments,function*(){for(;;){for(t.length||(yield ure(new Promise(e=>n.resolve=e)));t.length;)yield yield ure(t.shift());if(n.error)throw n.error;if(n.done)return yield ure(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 hre)}}}class hre extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function pre(e){return ire(e)&&"code"in e&&"reason"in e}function gre(e,t){return j(e[t],Je.string)}function mre(e,t){return U(gre(e,t),"")}function vre(e,t){return z(j(e[t],Je.float),e=>0|e)}function yre(e,t){return me(U(j(e[t],Je.array),[]),Je.string)}function bre(e){let t=Je.object(e);return void 0!==t?{label:mre(t,"label"),icon:gre(t,"icon"),group:gre(t,"group"),sortOrder:U(vre(t,"sortOrder"),0)}:{label:"",icon:void 0,group:void 0,sortOrder:0}}function _re(e){return z(Je.object(e),e=>({fragmentId:mre(e,"fragmentId"),title:mre(e,"title"),description:mre(e,"description"),positions:yre(e,"positions"),requiredAccess:gre(e,"requiredAccess")}))}function xre(e){return z(Je.object(e),e=>({fragmentId:mre(e,"fragmentId"),title:mre(e,"title"),menuEntry:U(z(e.menuEntry,bre),{label:mre(e,"title"),icon:void 0,group:void 0,sortOrder:0}),requiredAccess:gre(e,"requiredAccess")}))}function Sre(e){return z(Je.object(e),e=>({pluginId:mre(e,"pluginId"),remoteEntryUrl:mre(e,"remoteEntryUrl"),panels:me(U(j(e.panels,Je.array),[]),_re),pages:me(U(j(e.pages,Je.array),[]),xre),registeredAt:mre(e,"registeredAt"),updatedAt:mre(e,"updatedAt")}))}let wre=["message","body","text","title","content"],Ere=["userId","recipientId","recipient","user","targetUserId"],kre=["createdAt","sentAt","notifiedAt","at","timestamp"],Cre=["read","isRead","seen","acknowledged"];function Are(e,t){return t.some(t=>t.toLowerCase()===e.toLowerCase())}function Nre(e){return me(Mn(e),e=>{if(Un(e[1]))return e[0]})}function Tre(e,t){return Nre(e).find(e=>Are(e,t))}function Rre(e){return me(Mn(e),e=>{if(vt(zn(e[1]),"boolean"))return e[0]}).find(e=>Are(e,Cre))}function Dre(e,t){return me(Nre(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 Ire=["markread","marknotificationread","readnotification","acknowledge","dismiss","markseen"];function Fre(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=>Ire.some(t=>e.name.toLowerCase().startsWith(t)))}let Ore={contents:[]};function Pre(e,t,n){if(!Ore.contents.includes(e))return Ore.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 Mre(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=Tre(t.schema,wre),r=function(e){let t=Tre(e,Ere);if(void 0!==t)return t;let n=rr(e,void 0,void 0);return Mn(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(Mn(i),e=>{if(Bn(e[1]))return e[0]}).find(e=>Are(e,kre))),readField:Rre(t.schema),refFields:Dre(t.schema,r),markReadCommand:Fre(t,e)}:void Pre(t.name,"recipient",Ere):void Pre(t.name,"message",wre);var i})[0]}function Lre(e,t){return j(Xe(e,t),dt)}function zre(e,t){return j(j(t.timestampField,t=>Lre(e,t)),jc)}function jre(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=zre(e,t);return void 0===i||void 0!==n&&i<=n}function Ure(e,t,n,r){return me(t,t=>{let r=U(ht(t),{});if(function(e,t,n){let r=Lre(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=zre(t,e),i=zre(n,e);return void 0!==r?void 0!==i?i-r:-1:void 0!==i?1:0}).map((t,n)=>({id:U(Lre(t,"id"),"#"+n.toString()),message:U(Lre(t,e.messageField),""),timestamp:j(e.timestampField,e=>Lre(t,e)),read:jre(t,e,r),refs:me(e.refFields,e=>z(Lre(t,e.field),t=>[e.stem,t]))}))}let Bre=l([]),$re=l(e=>{}),qre=Bre.Provider,Gre=$re.Provider;let Vre=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(Gre,{value:o,children:c(qre,{value:r[0],children:e.children})})};function Kre(e,t){return e+"/"+t}function Wre(e,t,n){return e.map(e=>{let r=function(e,t,n){return e.get(Kre(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(nre,{pluginId:t,fragmentId:e.fragmentId,remoteEntryUrl:r,panelProps:n}),requiredAccess:e.requiredAccess,minWidth:e.minWidth}:e})}function Hre(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 Jre={contents:[]};function Xre(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 Qre(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(Kre(e.pluginId,r.fragmentId),n)}),void e.panels.forEach(r=>{t.set(Kre(e.pluginId,r.fragmentId),n)})}),t}(t),c=function(e,t,n){return"Lock"===e?[n,RO(t,n),DO(t,n)]:[TO(t,n),{},{}]}(i,r,e),u=c[2],d=c[1],f=dP(o,s,c[0]);a="object"!=typeof o&&"Unknown"!==o;let h=Ine.buildRegistry(f),p=me(f,e=>z(Mre(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=>Hre(t.fragmentId,e)),n.panels.map(t=>Hre(t.fragmentId,e))]:[[],[]]}(r.id,t),o=Vne(r,0,0,0,f,e,i[0],i[1],0,d,u,a,n[r.id],void 0),s=Wre(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 Yre="Admin";function Zre(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 "+Yre+" 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 eie(e,t,n,r){if(void 0!==e.manifestUrl&&("object"!=typeof t||!n.includes(Yre)))return function(e,t){return B(j(t,t=>e.journeyManifestUrls[t]),e.manifestUrl)}(e,r)}function tie(e,t){return"/"===t||e.some(e=>t===e||t.startsWith(e+"/"))}function nie(e){if(null==sessionStorage.getItem(Qq)||(sessionStorage.removeItem(Qq),0))return;let t=Jre.contents;if(tie(t,"/"+Se(Y(void 0).path).join("/")))return;let n=P(j(z(e.home,e=>e.trim()),e=>""===e?void 0:e),e=>tie(t,e));J(U(B(n,t[0]),"/"))}function rie(e){return"ManifestUnreadable"===e.TAG?"Component manifest could not be loaded":"Nothing here for the role you are acting as"}function iie(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=Qre(o,s,a,l,c,u,d);r(f.entities),i(f.notificationBindings),M(e,e=>e.setPluginPages(f.pages)),Jre.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=eie(e,u,f,h);if(void 0!==g)return RP(g).then(e=>{if("Ok"!==e.TAG)return{TAG:"ManifestUnreadable",_0:e._0};p(e._0,[])});let m=Xre(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=Xre(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=Wne(i)||Wne(r),s=o||Kne(i)||Kne(r);var a;if(p((a=i,U(z(j(j(j(Je.object(a),e=>e.data),Je.object),e=>e.Platform_ComponentDefinitions),kP),[])),function(e){return me(U(j(j(j(j(Je.object(e),e=>e.data),Je.object),e=>e.Platform_UIFragments),Je.array),[]),Sre)}(r)),s)return function(e,t){return!e&&t.includes(Yre)}(o,f)?void n():{TAG:"NoSurfacesForCaller",_0:Zre(h,e.hostShellUrl)}})}function oie(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("+bt.surfaceSubtle+")",border:"1px solid var("+bt.borderSubtle+")",color:"var("+bt.error+")",margin:"1rem",padding:"1rem 1.25rem",borderRadius:"0.375rem"}})}let sie=function(e){let t=e.uiHints,n=e.config,r=void 0!==t?t:{},o=d(WG),l=d(JV),c=fK(),u=d(dl),f=d($re),h=mG(),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=cP(n.elevatedGroups,g),b=L(j(h,e=>e.identity),"",e=>e.userId),_=s(()=>{}),x=_[1],S=_[0];return a(()=>{iie(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,b,g,m).then(e=>{M(e,e=>{console.error("[Shell] "+e._0)}),x(t=>e),nie(n)})},[p,r]),a(()=>{if(function(e,t,n,r){return q(eie(e,t,n,r))}(n,y,g,m))try{let e=function(e,t){return fre({url:e,connectionParams:void 0!==t?{Authorization:"Bearer "+t}:void 0,lazy:!0,retryAttempts:5})}(n.platformApiSubscriptionEndpoint,p),t=()=>{iie(n,p,()=>M(h,e=>e.logout()),o,l,c,u,f,r,v,y,b,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(oie,{message:S._0,title:rie(S)}):null};async function aie(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 RP(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(Qre(n._0,[],i,[a].concat(e.accessTiers),e.deniedSurfaces,cP(e.elevatedGroups,[a]),o).pages,e=>e.url);tie(l,r)&&s.push(a)}),s}let lie={display:"flex",padding:"2rem",alignItems:"flex-start",flexDirection:"column",gap:"var("+_t.sm+")"},cie={fontSize:"var("+xt.sizeLg+")",fontWeight:"var("+xt.weightMedium+")",margin:"0"},uie={color:"var("+bt.textSecondary+")",margin:"0"},die={background:"var("+bt.surface+")",border:"1px solid var("+bt.borderSubtle+")",color:"var("+bt.textPrimary+")",cursor:"pointer",padding:"0.4rem 0.9rem",borderRadius:"0.375rem"},fie={color:"var("+bt.error+")",margin:"0"};let hie=function(e){let t,n=e.uiHints,l=e.config,c=mG(),u=le(),d=j(c,e=>e.identity),f=L(c,!1,e=>e.canSwitchRoles),h=L(d,[],e=>LG(f,e)),p=j(d,e=>e.activeRole),g=L(d,"",e=>e.userId),m=s(()=>[]),v=m[1],y=m[0],b=s(()=>!1),_=b[1],x=b[0],S=s(()=>{}),w=S[1],E=S[0];if(a(()=>{let e={contents:!0};return aie(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:uie}),y.map(e=>i("button",{children:"Act as "+e,style:die,disabled:x,onClick:t=>M(c,t=>{_(e=>!0),w(e=>{}),t.switchRole(e).then(e=>{if(_(e=>!1),"object"!=typeof e)return;let t=e._0;w(e=>t)})})},e)),void 0!==E?i("p",{children:E,style:fie}):null]})}else t=null;return r("div",{children:[i("h1",{children:"404 — Page not found",style:cie}),t],style:lie})};function pie(e){return"var("+e+")"}let gie=Ls([ps("relative"),qo("inlineBlock")]),mie=Ls([ps("relative"),qo("inlineFlex"),jo("center"),Jo("center"),zo("background","none"),zo("border","none"),zo("border-radius",pie(St.md)),zo("cursor","pointer"),zo("color",pie(bt.textSecondary)),zo("padding","6px"),Cs([zo("background",pie(bt.surfaceSubtle)),zo("color",pie(bt.textPrimary))])]),vie=Ls([ps("absolute"),vs(Ts(0)),gs(Ts(0)),qo("inlineFlex"),jo("center"),Jo("center"),zo("min-width","16px"),zo("height","16px"),zo("padding","0 4px"),zo("border-radius",pie(St.full)),zo("background",pie(bt.brand)),zo("color",pie(bt.textOnBrand)),zo("font-family",pie(xt.fontFamily)),zo("font-size","10px"),zo("font-weight",pie(xt.weightBold)),zo("line-height","1")]),yie=Ls([ps("absolute"),gs(Ts(0)),vs({NAME:"percent",VAL:100}),rs(Ts(4)),zo("width","320px"),zo("background",pie(bt.surfaceElevated)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",pie(St.md)),zo("box-shadow",pie(Et)),zo("z-index","200"),zo("overflow","hidden"),zo("font-family",pie(xt.fontFamily))]),bie=Ls([qo("flex"),jo("center"),Jo("spaceBetween"),zo("padding","var("+_t.sm+") var("+_t.md+")"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),zo("color",pie(bt.textSecondary)),zo("font-size",pie(xt.sizeSm)),zo("font-weight",pie(xt.weightMedium)),zo("text-transform","uppercase"),zo("letter-spacing","0.04em")]),_ie=Ls([zo("background","none"),zo("border","none"),zo("color",pie(bt.brand)),zo("font-size",pie(xt.sizeXs)),zo("text-transform","none"),zo("letter-spacing","0"),$o("pointer"),Cs([zo("text-decoration","underline")])]),xie=Ls([zo("max-height","360px"),zo("overflow-y","auto")]);function Sie(e){return Ls([qo("flex"),jo("flexStart"),zo("gap",pie(_t.sm)),zo("width","100%"),zo("background","none"),zo("border","none"),zo("border-bottom","1px solid var("+bt.borderSubtle+")"),zo("text-align","left"),zo("padding","var("+_t.sm+") var("+_t.md+")"),$o(e?"pointer":"default"),Cs(e?[zo("background",pie(bt.surfaceSubtle))]:[])])}function wie(e){return Ls([zo("width","8px"),zo("height","8px"),zo("border-radius",pie(St.full)),zo("margin-top","5px"),zo("flex-shrink","0"),zo("background",e?"transparent":pie(bt.brand))])}let Eie=Ls([qo("flex"),Go("column"),zo("gap","2px"),zo("min-width","0")]);function kie(e){return Ls([zo("color",pie(bt.textPrimary)),zo("font-size",pie(xt.sizeSm)),zo("font-weight",pie(e?xt.weightNormal:xt.weightMedium)),zo("line-height",pie(xt.lineHeightNormal)),zo("word-break","break-word")])}let Cie=Ls([zo("color",pie(bt.textDisabled)),zo("font-size",pie(xt.sizeXs))]),Aie=Ls([zo("color",pie(bt.textDisabled)),zo("font-size",pie(xt.sizeSm)),zo("padding",pie(_t.md)),zo("text-align","center")]);function Nie(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 Tie=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(Nie,{}),y>0?i("span",{children:y>99?"99+":y.toString(),className:vie}):null],"aria-label":y>0?"Notifications ("+y.toString()+" unread)":"Notifications",className:mie,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:_ie,type:"button",onClick:e=>c()}):null],className:bie}),0===d.length?i("div",{children:f,className:Aie}):i("div",{children:d.map(e=>{let t=e.timestamp;return r("button",{children:[i("span",{className:wie(e.read)}),r("span",{children:[i("span",{children:e.message,className:kie(e.read)}),void 0!==t?i("span",{children:PZ(p,t),className:Cie}):null],className:Eie})],className:Sie($(u)),type:"button",onClick:t=>{M(u,t=>t(e)),m(e=>!1)}},e.id)}),className:xie})],className:yie,onClick:e=>{e.stopPropagation()}}):null],className:gie})};function Rie(e){return"autoui.notifications.seen."+e}function Die(e){let t=e.onData,n=G4(e.binding.readModel,void 0);return a(()=>{t({rows:n.rows,refetch:n.refetch})},[n.rows]),null}let Iie=function(e){let t=d(Bre),n=mG(),a=sF(),l=f2(),c=gl(),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 Ure(e.binding,t,m,function(e){let t=localStorage.getItem(Rie(e));if(null!=t)return qt(t)}(e.pluginId)).map(t=>({key:e.pluginId+":"+t.id,appBinding:e,entry:t}))}).toSorted((e,t)=>{let n=j(e.entry.timestamp,jc),r=j(t.entry.timestamp,jc);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())},b=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(yl(c,e[0]),e=>[e,t])}),e=>{let t=e[0];u(Sl(t.pluginId,t.name,e[1],[]))})}),_=$(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=zre(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(Rie(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(Die,{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(Tie,{notifications:w,onOpen:b,onMarkAllRead:_?x:void 0,onPanelOpen:S})]})};let Fie=function(e){let t,n=e.onChange,r=oP();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 Oie(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 Pie(e){return"var("+e+")"}let Mie=Ls([qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap","6px"),zo("padding",Pie(_t.lg)),zo("border","2px dashed var("+bt.border+")"),zo("border-radius",Pie(St.md)),zo("color",Pie(bt.textSecondary)),zo("font-family",Pie(xt.fontFamily)),zo("font-size",Pie(xt.sizeSm)),$o("pointer"),zo("transition","border-color 120ms, background 120ms"),ms("center")]),Lie=Ls([zo("border-color",Pie(bt.brand)),zo("background",Pie(bt.brandSubtle))]),zie=Ls([zo("font-size",Pie(xt.sizeXs))]),jie=Ls([qo("flex"),jo("center"),zo("gap","8px"),zo("padding",Pie(_t.xs)+" 0"),zo("font-family",Pie(xt.fontFamily)),zo("font-size",Pie(xt.sizeSm)),zo("color",Pie(bt.textPrimary))]),Uie=Ls([zo("flex","1"),zo("min-width","0"),zo("overflow","hidden"),zo("text-overflow","ellipsis"),zo("white-space","nowrap")]),Bie=Ls([zo("color",Pie(bt.textSecondary)),zo("font-size",Pie(xt.sizeXs)),zo("white-space","nowrap")]),$ie=Ls([zo("color",Pie(bt.success))]),qie=Ls([zo("color",Pie(bt.error))]),Gie=Ls([zo("width","120px")]),Vie=Ls([zo("flex","0 0 auto"),zo("border","none"),zo("background","transparent"),zo("padding","0 4px"),zo("color",Pie(bt.textSecondary)),zo("font-size",Pie(xt.sizeMd)),Qo({NAME:"abs",VAL:1}),$o("pointer")]),Kie=Ls([zo("width","40px"),zo("height","40px"),zo("flex","0 0 auto"),zo("object-fit","cover"),zo("border-radius",Pie(St.sm)),zo("border","1px solid var("+bt.border+")")]);let Wie=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],b=h(null),_=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;_.current=_.current+1|0;let o,s=_.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]?Mie+" "+Lie:Mie;return r("div",{children:[r("div",{children:[i("span",{children:f}),void 0!==c?i("span",{children:"Accepted: "+c,className:zie}):null],className:A,role:"button",onClick:e=>M(R(b.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(b),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(uu,{value:o._0,showValue:!1}),className:Gie});break;case"Done":t=i("span",{children:"Uploaded",className:$ie});break;case"Rejected":t=i("span",{children:"Rejected",className:qie,title:o._0});break;case"Failed":t=i("span",{children:"Failed",className:qie,title:o._0})}return r("div",{children:[void 0!==n?i("img",{className:Kie,alt:e.name,src:n}):null,i("span",{children:e.name,className:Uie,title:e.name}),i("span",{children:Oie(e.size),className:Bie}),t,i("button",{children:"×","aria-label":"Remove "+e.name,className:Vie,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:jie},e.key)})]})};function Hie(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 Jie(e,t){let n=nr(e,t);if(void 0!==n&&"Image"===n.semantic)return"image/*"}function Xie(e){return vt(j(j(ht(Bt(e)),e=>Xe(e,"type")),dt),"array")}function Qie(e){let t=e=>j(en(e).storeTarget,Gt);return B(t(e),j($t(e),t))}function Yie(e,t,n){return U(function(e,t,n){return B(j(Qie(e),n),t)}(e,t,n),(r=Qie(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 Zie(e){let t=e.onChange,n=e.value,r=e.multiple,o=e.adapter,s=h(r?Hie(n):""===n?[]:[n]),l=h([]),c=d(u6),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(Wie,{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 eoe(e,t,n,r){if(r&&0===Hie(n).length)return"Required"}var toe={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"},noe=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 roe(e){return function(){return e}}var ioe=function(){};ioe.thatReturns=roe,ioe.thatReturnsFalse=roe(!1),ioe.thatReturnsTrue=roe(!0),ioe.thatReturnsNull=roe(null),ioe.thatReturnsThis=function(){return this},ioe.thatReturnsArgument=function(e){return e};var ooe=toe,soe=noe;function aoe(e){var t=e;return"function"==typeof t?t=t():t.default&&(t=t.default),t}function loe(e){var t=aoe(e);return"object"==typeof t&&null!==t&&t.kind===ooe.FRAGMENT}function coe(e){var t=aoe(e);return"object"==typeof t&&null!==t&&t.kind===ooe.REQUEST}function uoe(e){var t=aoe(e);return"object"==typeof t&&null!==t&&t.kind===ooe.INLINE_DATA_FRAGMENT}function doe(e){var t=aoe(e);return loe(t)||soe(!1),t}var foe,hoe={getFragment:doe,getNode:aoe,getPaginationFragment:function(e){var t,n=doe(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=doe(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=aoe(e);return coe(t)||soe(!1),t},getUpdatableQuery:function(e){var t=aoe(e);return!function(e){var t=aoe(e);return"object"==typeof t&&null!==t&&t.kind===ooe.UPDATABLE_QUERY}(t)&&soe(!1),t},getInlineDataFragment:function(e){var t=aoe(e);return uoe(t)||soe(!1),t},graphql:function(e){soe(!1)},isFragment:loe,isRequest:coe,isInlineDataFragment:uoe},poe={exports:{}};(foe=poe).exports=function(e){return e&&e.__esModule?e:{default:e}},foe.exports.__esModule=!0,foe.exports.default=foe.exports;var goe=poe.exports,moe={exports:{}},voe={exports:{}},yoe={exports:{}},boe={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}(boe);var _oe=boe.exports,xoe={exports:{}};!function(e){var t=_oe.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}(xoe);var Soe=xoe.exports;!function(e){var t=_oe.default,n=Soe;e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(yoe);var woe=yoe.exports;!function(e){var t=woe;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}(voe);var Eoe=voe.exports;!function(e){var t=Eoe;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}(moe);var koe=moe.exports,Coe={exports:{}},Aoe={exports:{}},Noe={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}(Noe);var Toe=Noe.exports;!function(e){var t=Toe;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}(Aoe);var Roe=Aoe.exports;!function(e){var t=Roe;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}(Coe);var Doe=Coe.exports,Ioe=goe.default,Foe=Ioe(koe),Ooe=Ioe(Doe),Poe=noe;function Moe(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 Loe={handlePotentialSnapshotErrors:function(e,t,n){null!=t&&function(e,t,n){var r,i=(0,Ooe.default)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.relayFieldLogger((0,Foe.default)((0,Foe.default)({},o),{},{uiContext:n}))}}catch(c){i.e(c)}finally{i.f()}var s,a=(0,Ooe.default)(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;if(Moe(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,Poe(!1)}}}catch(c){a.e(c)}finally{a.f()}}(e,t,n)},eventShouldThrow:Moe},zoe={exports:{}},joe={exports:{}};!function(e){var t=Toe;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(joe);var Uoe=joe.exports,Boe={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}(Boe);var $oe=Boe.exports,qoe={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}(qoe);var Goe=qoe.exports;!function(e){var t=Uoe,n=$oe,r=Roe,i=Goe;e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(zoe);var Voe=zoe.exports,Koe={DEFAULT_HANDLE_KEY:""},Woe=Koe.DEFAULT_HANDLE_KEY,Hoe=noe;var Joe=function(e,t,n){return t&&t!==Woe?"__".concat(t,"_").concat(e):(null==n&&Hoe(!1),"__".concat(n,"_").concat(e))},Xoe={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 Qoe={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)})}},Yoe=(0,goe.default)(Voe),Zoe=Joe,ese=Xoe,tse=Qoe.stableCopy,nse=noe,rse=toe.VARIABLE,ise=toe.LITERAL,ose=toe.OBJECT_VALUE,sse=toe.LIST_VALUE;function ase(e,t){if(e.kind===rse)return function(e,t){return t.hasOwnProperty(e)||nse(!1),tse(t[e])}(e.variableName,t);if(e.kind===ise)return e.value;if(e.kind===ose){var n={};return e.fields.forEach(function(e){n[e.name]=ase(e,t)}),n}if(e.kind===sse){var r=[];return e.items.forEach(function(e){null!=e&&r.push(ase(e,t))}),r}}function lse(e,t,n){var r={};return n&&(r[dse.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),e&&e.forEach(function(e){r[e.name]=ase(e,t)}),r}function cse(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?use(r,lse(n,t)):r}function use(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 dse={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:lse,getHandleStorageKey:function(e,t){var n=e.dynamicKey,r=e.handle,i=e.key,o=e.name,s=e.args,a=e.filters,l=Zoe(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,Yoe.default)(c)):[n]),null===c?l:use(l,lse(c,t))},getStorageKey:cse,getReadTimeResolverStorageKey:function(e,t){var n=cse(e,t);return ese.ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX?"$r:"+n:n},getStableStorageKey:function(e,t){return use(e,tse(t))},getModuleComponentKey:function(e){return"".concat("__module_component_").concat(e)},getModuleOperationKey:function(e){return"".concat("__module_operation_").concat(e)}},fse=dse,hse=(0,goe.default)(koe),pse=fse.getArgumentValues,gse=noe;var mse={getLocalVariables:function(e,t,n){if(null==t)return e;var r=(0,hse.default)({},e),i=n?pse(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,hse.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:gse(!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}},vse=[],yse=[];function bse(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(!bse(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(!bse(e[l[c]],t[l[c]],n,r))return!1}return n.pop(),r.pop(),!0}var _se=
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=vse.length?vse.pop():[],r=yse.length?yse.pop():[],i=bse(e,t,n,r);return n.length=0,r.length=0,vse.push(n),yse.push(r),i},xse=mse.getFragmentVariables,Sse=fse,wse=Sse.CLIENT_EDGE_TRAVERSAL_PATH,Ese=Sse.FRAGMENT_OWNER_KEY,kse=Sse.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT,Cse=Sse.FRAGMENTS_KEY,Ase=Sse.ID_KEY,Nse=_se,Tse=noe;function Rse(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Tse(!1);var n=t[Ase],r=t[Cse],i=t[Ese],o=t[wse];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 jse(e,n,xse(e,s.variables,l),s,!0===l[kse],a)}return null}function Dse(e,t){var n=null;return t.forEach(function(t,r){var i=null!=t?Rse(e,t):null;null!=i&&(n=n||[]).push(i)}),null==n?null:{kind:"PluralReaderSelector",selectors:n}}function Ise(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Tse(!1),Dse(e,t)):(Array.isArray(t)&&Tse(!1),Rse(e,t))}function Fse(e,t){return null==t?t:e.metadata&&!0===e.metadata.plural?(Array.isArray(t)||Tse(!1),function(e,t){var n=null;return t.forEach(function(t){var r=null!=t?Ose(e,t):null;null!=r&&(n=n||[]).push(r)}),n}(e,t)):(Array.isArray(t)&&Tse(!1),Ose(e,t))}function Ose(e,t){("object"!=typeof t||null===t||Array.isArray(t))&&Tse(!1);var n=t[Ase];return"string"==typeof n?n:null}function Pse(e,t){var n;return null==t?{}:!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)?(Array.isArray(t)||Tse(!1),Lse(e,t)):(Array.isArray(t)&&Tse(!1),Mse(e,t)||{})}function Mse(e,t){var n=Rse(e,t);return n?n.variables:null}function Lse(e,t){var n={};return t.forEach(function(t,r){if(null!=t){var i=Mse(e,t);null!=i&&Object.assign(n,i)}}),n}function zse(e,t){return e.dataID===t.dataID&&e.node===t.node&&Nse(e.variables,t.variables)&&(n=e.owner,r=t.owner,n===r||n.identifier===r.identifier&&Nse(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 jse(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 Use={areEqualSelectors:function(e,t){return e===t||(null==e?null==t:null==t?null==e:"SingularReaderSelector"===e.kind&&"SingularReaderSelector"===t.kind?zse(e,t):"PluralReaderSelector"===e.kind&&"PluralReaderSelector"===t.kind&&(e.selectors.length===t.selectors.length&&e.selectors.every(function(e,n){return zse(e,t.selectors[n])})))},createReaderSelector:jse,createNormalizationSelector:function(e,t,n){return{dataID:t,node:e,variables:n}},getDataIDsFromFragment:Fse,getDataIDsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=Fse(i,o)}return n},getSingularSelector:Rse,getPluralSelector:Dse,getSelector:Ise,getSelectorsFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r],o=t[r];n[r]=Ise(i,o)}return n},getVariablesFromSingularFragment:Mse,getVariablesFromPluralFragment:Lse,getVariablesFromFragment:Pse,getVariablesFromObject:function(e,t){var n={};for(var r in e)if(e.hasOwnProperty(r)){var i=Pse(e[r],t[r]);Object.assign(n,i)}return n}},Bse=hoe.getFragment,$se=Loe.eventShouldThrow,qse=Use.getSelector,Gse=noe,Vse=[];var Kse={},Wse={readFragment:function(e,t){if(!Vse.length)throw new Error("readFragment should be called only from within a Relay Resolver function.");var n=Vse[Vse.length-1],r=Bse(e),i=qse(r,t);null==i&&Gse(!1),"SingularReaderSelector"!==i.kind&&Gse(!1);var o=n.getDataForResolverFragment(i,t),s=o.data,a=o.isMissingData,l=o.fieldErrors;if(a||null!=l&&l.some($se))throw Kse;return s},withResolverContext:function(e,t){Vse.push(e);try{return t()}finally{Vse.pop()}},RESOLVER_FRAGMENT_ERRORED_SENTINEL:Kse},Hse={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}(Hse);var Jse=Hse.exports;var Xse=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.then},Qse=Xse,Yse=function(e,t){},Zse=function(){function e(e){this._source=e}e.create=function(t){return new e(t)},e.onUnhandledError=function(e){Yse=e},e.from=function(e){return function(e){return"object"==typeof e&&null!==e&&"function"==typeof e.subscribe}(e)?function(e){return e instanceof Zse?e:Zse.create(function(t){return e.subscribe(t)})}(e):Qse(e)?(t=e,Zse.create(function(e){t.then(function(t){e.next(t),e.complete()},e.error)})):function(e){return Zse.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(fie){Yse(fie,!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(fie){Yse(fie,!0)}n=void 0}}var s=i({unsubscribe:function(){if(!r){r=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(fie){Yse(fie,!0)}finally{o()}}}});try{t.start&&t.start(s)}catch(fie){Yse(fie,!0)}if(r)return s;var a=i({next:function(e){if(!r&&t.next)try{t.next(e)}catch(fie){Yse(fie,!0)}},error:function(e,n){if(r||!t.error)r=!0,Yse(e,n||!1),o();else{r=!0;try{t.error(e)}catch(i){Yse(i,!0)}finally{o()}}},complete:function(){if(!r){r=!0;try{t.complete&&t.complete()}catch(fie){Yse(fie,!0)}finally{o()}}}});try{n=e(a)}catch(fie){a.error(fie,!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(fie){e.error(fie,!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(fie){r.error(fie,!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 eae=Zse,tae=goe.default,nae=tae(Doe),rae=tae(Eoe),iae=eae,oae=noe,sae=function(){function e(){var e=this;(0,rae.default)(this,"_complete",!1),(0,rae.default)(this,"_events",[]),(0,rae.default)(this,"_sinks",new Set),(0,rae.default)(this,"_subscription",[]),this._observable=iae.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,oae(!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,nae.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}(),aae=sae,lae=eae,cae=aae,uae=noe,dae="function"==typeof WeakMap?new WeakMap:new Map;function fae(e,t,n){return lae.create(function(r){var i=pae(e),o=i.get(t);return o||n().finally(function(){return i.delete(t)}).subscribe({start:function(e){o={identifier:t,subject:new cae,subjectForInFlightStatus:new cae,subscription:e,promise:null},i.set(t,o)},next:function(e){var n=gae(i,t);n.subject.next(e),n.subjectForInFlightStatus.next(e)},error:function(e){var n=gae(i,t);n.subject.error(e),n.subjectForInFlightStatus.error(e)},complete:function(){var e=gae(i,t);e.subject.complete(),e.subjectForInFlightStatus.complete()},unsubscribe:function(e){var n=gae(i,t);n.subject.unsubscribe(),n.subjectForInFlightStatus.unsubscribe()}}),null==o&&uae(!1),function(e,t){return lae.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 hae(e,t,n){return lae.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 pae(e){var t=dae.get(e);if(null!=t)return t;var n=new Map;return dae.set(e,n),n}function gae(e,t){var n=e.get(t);return null==n&&uae(!1),n}var mae={fetchQuery:function(e,t){return fae(e,t.request.identifier,function(){return e.execute({operation:t})})},fetchQueryDeduped:fae,getPromiseForActiveRequest:function(e,t){var n=pae(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;hae(e,0,r).subscribe({complete:t,error:n,next:function(e){i&&t(e)}}),i=!0});return i},getObservableForActiveRequest:function(e,t){var n=pae(e),r=n.get(t.identifier);return r&&e.isRequestActive(r.identifier)?hae(e,0,r):null}},vae=goe.default;Jse.default;vae(Doe);var yae=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},bae=Qoe.stableCopy,_ae=noe;var xae=function(e,t){var n=null!=e.cacheID?e.cacheID:e.id;return null==n&&_ae(!1),n+JSON.stringify(bae(t))},Sae=xae,wae=Xoe,Eae=Qoe.hasCycle,kae=mse.getOperationVariables,Cae=Use.createNormalizationSelector,Aae=Use.createReaderSelector,Nae=fse.ROOT_ID,Tae=noe;function Rae(e,t,n){return{identifier:Sae(e.params,t),node:e,variables:t,cacheConfig:n}}var Dae={createOperationDescriptor:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nae,i=e.operation,o=kae(i,e.params.providedVariables,t);wae.ENABLE_CYLE_DETECTION_IN_VARIABLES&&Eae(o)&&Tae(!1);var s=Rae(e,o,n);return{fragment:Aae(e.fragment,r,o,s),request:s,root:Cae(i,r,o)}},createRequestDescriptor:Rae};(0,goe.default)(Eoe);Jse.default;var Iae=new Map,Fae=1,Oae=function(){for(var e=new Set,t=0;t<10;++t)e.add(t.toString());return e}();var Pae={intern:function(e,t){if(null==t||e.length<t)return function(e){return"\t"===e[0]&&Oae.has(e[1])||"\v"===e[0]?"\v"+e:e}(e);var n=Iae.get(e);return null!=n||(n="\t"+Fae++,Iae.set(e,n)),n}},Mae=Xoe,Lae=Pae.intern,zae="client:";var jae=0;var Uae={generateClientID:function(e,t,n){var r=(Mae.STRING_INTERN_LEVEL<=0?e:Lae(e,Mae.MAX_DATA_ID_LENGTH))+":"+t;return null!=n&&(r+=":"+n),0!==r.indexOf(zae)&&(r=zae+r),r},generateClientObjectClientID:function(e,t,n){var r="".concat(zae).concat(e,":").concat(t);return null!=n&&(r+=":"+n),r},generateUniqueClientID:function(){return"".concat(zae,"local:").concat(jae++)},isClientID:function(e){return 0===e.indexOf(zae)}},Bae={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},$ae={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"},qae={inject:function(e){$ae=e},get:function(){return $ae},isConnectionCall:function(e){return Bae.hasOwnProperty(e.name)}},Gae=Uae.generateClientID,Vae=fse.getStableStorageKey,Kae=Joe,Wae=qae,Hae=noe,Jae="connection",Xae="__connection_next_edge_index";function Qae(e,t,n){if(null==n)return n;var r=Wae.get().EDGES,i=t.getValue(Xae);"number"!=typeof i&&Hae(!1);var o=Gae(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,Xae),s}function Yae(e,t,n){for(var r=Wae.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 Zae={buildConnectionEdge:Qae,createEdge:function(e,t,n,r){var i=Wae.get().NODE,o=Gae(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=Wae.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=Kae(Jae,t,null);return e.getLinkedRecord(r,n)},getConnectionID:function(e,t,n){var r=Kae(Jae,t,null),i=Vae(r,n);return Gae(e,i)},insertEdgeAfter:function(e,t,n){var r=Wae.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=Wae.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=Wae.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=Gae(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 Qae(e,v,t)}));var b=v.getLinkedRecords(i),_=v.getLinkedRecord(l);v.copyFieldsFrom(d),b&&v.setLinkedRecords(b,i),_&&v.setLinkedRecord(_,l);var x=[],S=t.args;if(b&&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;Yae(b,x,C),Yae(y,x,C)}else if(null!=S.before){if(!m||S.before!==m.getValue(u))return;var A=new Set;Yae(y,x,A),Yae(b,x,A)}else x=y;else x=y||b;if(null!=x&&x!==b&&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,Xae),R.copyFieldsFrom(d);var D=d.getLinkedRecords(i);D&&(D=D.map(function(t){return Qae(e,R,t)}),R.setLinkedRecords(D,i)),n.setLinkedRecord(R,t.handleKey),(m=e.create(Gae(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))}}},ele=(0,goe.default)(Doe),tle=Zae,nle=qae,rle=noe,ile={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)})}}},ole={update:function(e,t){var n=e.get(t.dataID);if(null!=n){var r=t.handleArgs.connections;null==r&&rle(!1);var i=n.getValue(t.fieldKey);(Array.isArray(i)?i:[i]).forEach(function(t){if("string"==typeof t){var n,i=(0,ele.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=e.get(o);null!=s&&tle.deleteNode(s,t)}}catch(a){i.e(a)}finally{i.f()}}})}}},sle={update:ule(tle.insertEdgeAfter)},ale={update:ule(tle.insertEdgeBefore)},lle={update:dle(tle.insertEdgeAfter)},cle={update:dle(tle.insertEdgeBefore)};function ule(e){return function(t,n){var r,i=t.get(n.dataID);if(null!=i){var o,s,a=n.handleArgs.connections;null==a&&rle(!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=nle.get(),u=c.NODE,d=c.EDGES,f=null!==(r=s)&&void 0!==r?r:[o],h=(0,ele.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,ele.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=tle.buildConnectionEdge(t,f,n);null==h&&rle(!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 dle(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&&rle(!1),null==c&&rle(!1);try{o=i.getLinkedRecord(n.fieldKey)}catch(y){}if(!o)try{s=i.getLinkedRecords(n.fieldKey)}catch(b){}if(null!=o||null!=s){var u,d=nle.get(),f=d.NODE,h=d.EDGES,p=null!==(r=s)&&void 0!==r?r:[o],g=(0,ele.default)(p);try{var m=function(){var n=u.value;if(null==n)return"continue";var r,i=n.getDataID(),o=(0,ele.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=tle.createEdge(t,a,n,c);null==d&&rle(!1),e(a,d)}}}catch(p){o.e(p)}finally{o.f()}};for(g.s();!(u=g.n()).done;){var v;m()}}catch(_){g.e(_)}finally{g.f()}}}}}var fle=Zae,hle={AppendEdgeHandler:sle,DeleteRecordHandler:ile,PrependEdgeHandler:ale,AppendNodeHandler:lle,PrependNodeHandler:cle,DeleteEdgeHandler:ole},ple=noe;var gle=function(e){switch(e){case"connection":return fle;case"deleteRecord":return hle.DeleteRecordHandler;case"deleteEdge":return hle.DeleteEdgeHandler;case"appendEdge":return hle.AppendEdgeHandler;case"prependEdge":return hle.PrependEdgeHandler;case"appendNode":return hle.AppendNodeHandler;case"prependNode":return hle.PrependNodeHandler}ple(!1)};var mle=function(e){return Boolean(e&&e["@@RelayModernEnvironment"])},vle=(0,goe.default)(Doe),yle=Zae;function ble(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}var _le={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=ble(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=ble(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,vle.default)(r);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(c){var f=yle.getConnection(s,d.key,d.filters);if(f){var h=yle.buildConnectionEdge(e,f,c);if(h)switch(d.rangeBehavior){case"append":yle.insertEdgeAfter(f,h);break;case"prepend":yle.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=ble(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,vle.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,vle.default)(t);try{var u=function(){var e=l.value,t=yle.getConnection(s,e.key,e.filters);t&&i.forEach(function(e){yle.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)})}}}},xle=hoe.getRequest,Sle=mle,wle=Dae.createOperationDescriptor,Ele=_le,kle=noe;var Cle=function(e,t){Sle(e)||kle(!1);var n=xle(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=wle(n,s);return i&&(r=Ele.convert(i,n,r).optimisticUpdater),e.applyMutation({operation:a,response:o,updater:r})};var Ale=function(e,t){e.commitUpdate(t)};(0,goe.default)(koe);var Nle=(0,goe.default)(Voe),Tle=hoe.getRequest,Rle=Uae.generateUniqueClientID,Dle=mle,Ile=Dae.createOperationDescriptor,Fle=_le,Ole=noe;var Ple=function(e,t){Dle(e)||Ole(!1);var n=Tle(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=Ile(n,u,a,Rle());if("function"==typeof r&&(r=r()),s){var h=Fle.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,Nle.default)(e.errors))}):e.errors&&p.push.apply(p,(0,Nle.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}},Mle="function"==typeof WeakMap?new WeakMap:new Map;function Lle(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(Mle.has(r)){var o=Mle.get(r);n[e]=o}else Mle.set(r,i),n[e]=i}),n}return e}Lle.tests_only_resetDebugCache=void 0;var zle=eae;var jle={convertFetch:function(e){return function(t,n,r,i,o){var s=e(t,n,r,i,o);return s instanceof Error?zle.create(function(e){return e.error(s)}):zle.from(s)}}},Ule=Lle,Ble=jle.convertFetch,$le=noe;var qle={create:function(e,t){var n=Ble(e);return{execute:function(e,r,i,o,s){var a=Ule(r,e.providedVariables);if("subscription"===e.operationKind)return t||$le(!1),o&&$le(!1),t(e,a,i);var l=i.poll;return null!=l?(o&&$le(!1),n(e,a,{force:!0}).poll(l)):n(e,a,i,o,s)}}}};(0,goe.default)(koe);var Gle=(0,goe.default)(koe),Vle=eae,Kle=Dae.createOperationDescriptor,Wle=Loe.handlePotentialSnapshotErrors,Hle=mae,Jle=hoe.getRequest,Xle=noe;function Qle(e,t){return Hle.fetchQuery(e,t).map(function(){return e.lookup(t.fragment)})}var Yle=function(e,t,n,r){var i,o=Jle(t);"query"!==o.params.operationKind&&Xle(!1);var s=(0,Gle.default)({force:!0},null==r?void 0:r.networkCacheConfig),a=Kle(o,n,s),l=null!==(i=null==r?void 0:r.fetchPolicy)&&void 0!==i?i:"network-only";function c(t){return Wle(e,t.fieldErrors),t.data}switch(l){case"network-only":return Qle(e,a).map(c);case"store-or-network":return"available"===e.check(a).status?Vle.from(e.lookup(a.fragment)).map(c):Qle(e,a).map(c);default:throw new Error("fetchQuery: Invalid fetchPolicy "+l)}},Zle=Dae.createOperationDescriptor,ece=hoe.getRequest;var tce=function(e,t,n,r){var i=ece(t);if("query"!==i.params.operationKind)throw new Error("fetchQuery: Expected query operation");var o=Zle(i,n,r);return e.execute({operation:o}).map(function(){return e.lookup(o.fragment).data}).toPromise()},nce=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(iB){setTimeout(function(){throw iB},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}(),rce=new nce,ice=mae.getPromiseForActiveRequest;var oce=function(e,t,n){var r,i,o=[],s=ice(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 sce=function(e,t){return e===t&&(null===e||"object"!=typeof e)};function ace(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=ace(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=ace(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 lce=function(e,t){return ace(e,t,!0)},cce=goe.default,uce=cce(koe),dce=cce(Eoe),fce=oce,hce=Loe.handlePotentialSnapshotErrors,pce=sce,gce=lce,mce=Xoe,vce=Dae.createRequestDescriptor,yce=Use.areEqualSelectors,bce=Use.createReaderSelector,_ce=Use.getSelectorsFromObject,xce=_se,Sce=noe,wce=function(){function e(e,t,n,r,i){var o=this;(0,dce.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)&&Cce(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,uce.default)({},t))[n]=o)}else{var s=this._props[n],a=void 0!==s?s:null;!e&&pce(a,i)||((e=e||(0,uce.default)({},t))[n]=a)}}this._data=e||t,this._stale=!1}return this._data},t.setCallback=function(e,t){this._callback=t,!0===mce.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this.setProps(e)},t.setProps=function(e){this._props={};var t=_ce(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 kce(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof kce||Sce(!1),i.setSelector(r)):null==i?i=new Ece(this._context.environment,this._rootIsQueryRenderer,r,null!=this._callback,this._onChange):(i instanceof Ece||Sce(!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}(),Ece=function(){function e(e,t,n,r,i){var o=this;(0,dce.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===mce.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=fce(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 hce(this._environment,this._fieldErrors),this._data},t.setSelector=function(e){if(null==this._subscription||!yce(e,this._selector)){this.dispose();var t=this._environment.lookup(e);this._data=gce(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(!xce(e,this._selector.variables)){var n=vce(t,e),r=bce(this._selector.node,this._selector.dataID,e,n);this.setSelector(r)}},e}(),kce=function(){function e(e,t,n,r,i){var o=this;(0,dce.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(Cce)},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 Ece(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 Cce(e){e&&e.dispose()}var Ace=wce;var Nce,Tce,Rce=function(e,t,n,r,i,o){return new Ace(e,n,r,o,i)},Dce=noe;var Ice,Fce,Oce=function(e){return Nce||(Nce=e.createContext(null),Tce=e),e!==Tce&&Dce(!1),Nce},Pce=noe;var Mce=function(e){return Ice||(Ice=e.createContext(null),Fce=e),e!==Fce&&Pce(!1),Ice},Lce=Object.freeze({__LIVE_RESOLVER_SUSPENSE_SENTINEL:!0});var zce={isSuspenseSentinel:function(e){return e===Lce},suspenseSentinel:function(){return Lce}},jce={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}(jce);var Uce=jce.exports,Bce=goe.default,$ce=Bce(Eoe),qce=Bce(Uce),Gce=Bce(woe),Vce=Bce(koe),Kce=yae,Wce=Uae,Hce=Wce.generateClientObjectClientID,Jce=zce.isSuspenseSentinel,Xce=fse,Qce=Xce.ACTOR_IDENTIFIER_KEY,Yce=Xce.ERRORS_KEY,Zce=Xce.ID_KEY,eue=Xce.INVALIDATED_AT_KEY,tue=Xce.REF_KEY,nue=Xce.REFS_KEY,rue=Xce.RELAY_RESOLVER_VALUE_KEY;Xce.ROOT_ID;var iue=Xce.TYPENAME_KEY,oue=_se,sue=noe;function aue(e,t){var n=e[t];return n&&"object"==typeof n&&(n.hasOwnProperty(tue)||n.hasOwnProperty(nue))&&sue(!1),n}function lue(e,t,n){var r=e[Yce];if(null!=n&&n.length>0)null==r?e[Yce]=(0,$ce.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[Yce]}}function cue(e,t,n){e[t]=n}var uue={clone:function(e){return(0,Vce.default)({},e)},copyFields:function(e,t){for(var n in e)e.hasOwnProperty(n)&&n!==Zce&&n!==iue&&(t[n]=e[n])},create:function(e,t){var n={};return n[Zce]=e,n[iue]=t,n},freeze:function(e){Kce(e)},fromObject:function(e){return e},getDataID:function(e){return e[Zce]},getErrors:function(e,t){var n;return null===(n=e[Yce])||void 0===n?void 0:n[t]},getFields:function(e){return Yce in e?Object.keys(e).filter(function(e){return e!==Yce}):Object.keys(e)},getInvalidationEpoch:function(e){if(null==e)return null;var t=e[eue];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[tue]||sue(!1),r[tue]},getLinkedRecordIDs:function(e,t){var n=e[t];return null==n?n:("object"==typeof n&&Array.isArray(n[nue])||sue(!1),n[nue])},getType:function(e){return e[iue]},getValue:aue,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[tue])},hasLinkedRecordIDs:function(e,t){var n=e[t];return null!=n&&("object"==typeof n&&Array.isArray(n[nue])&&n[nue].every(function(e){return"string"==typeof e}))},merge:function(e,t){if(Yce in e||Yce in t){var n=e[Yce],r=(0,qce.default)(e,[Yce].map(Gce.default)),i=t[Yce],o=(0,qce.default)(t,[Yce].map(Gce.default)),s=(0,Vce.default)((0,Vce.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[Yce]=a;break}return s}return(0,Vce.default)((0,Vce.default)({},e),t)},setErrors:lue,setValue:cue,setLinkedRecordID:function(e,t,n){var r={};r[tue]=n,e[t]=r},setLinkedRecordIDs:function(e,t,n){var r={};r[nue]=n,e[t]=r},update:function(e,t){var n,r=e[Yce],i=t[Yce],o=null;if(null==r&&null==i){var s;for(var a in t)!o&&oue(e[a],t[a])||((o=null!==o?o:(0,Vce.default)({},e))[a]=t[a]);return null!==(s=o)&&void 0!==s?s:e}for(var l in t)if(l!==Yce){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(oue(d,c)&&oue(f,u))continue;o=(0,Vce.default)({},e),null!=r&&(o[Yce]=(0,Vce.default)({},r))}cue(o,l,c),lue(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[tue]||null==n[Qce])&&sue(!1),[n[Qce],n[tue]])},setActorLinkedRecordID:function(e,t,n,r){var i={};i[tue]=r,i[Qce]=n,e[t]=i},getResolverLinkedRecordID:function(e,t){var n=aue(e,rue);return null==n||Jce(n)?null:("object"==typeof n&&(n=n.id),"string"!=typeof n&&sue(!1),Hce(t,n))},getResolverLinkedRecordIDs:function(e,t){var n=aue(e,rue);return null==n||Jce(n)?null:(Array.isArray(n)||sue(!1),n.map(function(e){return null==e?null:("object"==typeof e&&(e=e.id),"string"!=typeof e&&sue(!1),Hce(t,e))}))},toJSON:function(e){return e}},due={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"},fue=(0,goe.default)(Doe),hue=uue,pue=due.EXISTENT,gue=due.NONEXISTENT,mue=due.UNKNOWN,vue=function(){function e(e){var t=this;this._records=new Map,null!=e&&Object.keys(e).forEach(function(n){var r=e[n],i=hue.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)?gue:pue:mue},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,fue.default)(this._records);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r[0],o=r[1];t[i]=hue.toJSON(o)}}catch(s){n.e(s)}finally{n.f()}return t},e}(),yue=vue,bue=noe,_ue="INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";var xue={assertInternalActorIdentifier:function(e){e!==_ue&&bue(!1)},getActorIdentifier:function(e){return e},INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE:_ue},Sue="actor_key",wue=xue.getActorIdentifier;var Eue={ACTOR_IDENTIFIER_FIELD_NAME:Sue,getActorIdentifierFromPayload:function(e){if(null!=e&&"object"==typeof e&&"string"==typeof e[Sue])return wue(e[Sue])}},kue=goe.default,Cue=kue(koe),Aue=kue(Uce),Nue=kue(Doe),Tue=kue(Voe),Rue=["path","locations"],Due=Symbol("$SELF");function Iue(e,t){var n,r=(0,Nue.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,Tue.default)(s)):Iue(s,t),o!==Due)for(var l=t.length,c=a;c<l;c++){var u=t[c];null==u.path?t[c]=(0,Cue.default)((0,Cue.default)({},u),{},{path:[o]}):u.path.unshift(o)}}}catch(d){r.e(d)}finally{r.f()}}var Fue={buildErrorTrie:function(e){if(null==e)return null;var t,n=new Map,r=(0,Nue.default)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=i.path,s=(i.locations,(0,Aue.default)(i,Rue));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(Due,f),c.set(d,h),c=h}}var p=o[l],g=c.get(p);g instanceof Map&&(g=(c=g).get(p),p=Due),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 Iue(n,r),r}};var Oue={generateTypeID:function(e){return"client:__type:"+e},TYPE_SCHEMA_TYPE:"__TypeSchema"},Pue=goe.default,Mue=Pue(Doe),Lue=Pue(Voe),zue=Eue,jue=zue.getActorIdentifierFromPayload,Uue=Xoe,Bue=Uae.generateClientID,$ue=Uae.isClientID,que=mse.getLocalVariables,Gue=Fue.buildErrorTrie,Vue=Fue.getErrorsByKey,Kue=Fue.getNestedErrorTrieByKey,Wue=uue,Hue=Use.createNormalizationSelector,Jue=fse,Xue=Jue.ROOT_ID,Que=Jue.TYPENAME_KEY,Yue=Jue.getArgumentValues,Zue=Jue.getHandleStorageKey,ede=Jue.getModuleComponentKey,tde=Jue.getModuleOperationKey,nde=Jue.getStorageKey,rde=Oue.TYPE_SCHEMA_TYPE,ide=Oue.generateTypeID,ode=noe;var sde=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,Lue.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||ode(!1),this._assignClientAbstractTypes(e),this._errorTrie=Gue(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,Mue.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=ide(a),c=this._recordSource.get(l);null==c&&(c=Wue.create(l,rde),this._recordSource.set(l,c)),Wue.setValue(c,o,!0)}}catch(u){s.e(u)}finally{s.f()}}},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||ode(!1),this._variables[e]},t._getRecordType=function(e){var t=e[Que];return null==t&&ode(!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=que(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){Wue.getType(t)===i.type&&this._traverseSelections(i,t,n)}else{var a=Object.prototype.hasOwnProperty.call(n,s),l=Wue.getType(t),c=ide(l),u=this._recordSource.get(c);null==u&&(u=Wue.create(c,rde),this._recordSource.set(c,u)),Wue.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=Wue.getType(t),p=ide(h),g=this._recordSource.get(p);null==g&&(g=Wue.create(p,rde),this._recordSource.set(p,g)),Wue.setValue(g,d,f);break;case"LinkedHandle":case"ScalarHandle":var m=i.args?Yue(i.args,this._variables):{},v=nde(i,this._variables),y=Zue(i,this._variables);this._handleFieldPayloads.push({args:m,dataID:Wue.getDataID(t),fieldKey:v,handle:i.handle,handleKey:y,handleArgs:i.handleArgs?Yue(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 b=this._isClientExtension;this._isClientExtension=!0,this._traverseSelections(i,t,n),this._isClientExtension=b;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:ode(!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,Lue.default)(this._path),selector:Hue(e,Wue.getDataID(t),this._variables),typeName:Wue.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,Lue.default)(this._path),parentID:Wue.getDataID(t),node:e,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeModuleImport=function(e,t,n){"object"==typeof n&&n||ode(!1);var r=Wue.getType(t),i=ede(e.documentName),o=e.componentModuleProvider||n[i];Wue.setValue(t,i,null!=o?o:null);var s=tde(e.documentName),a=e.operationModuleProvider||n[s];Wue.setValue(t,s,null!=a?a:null),null!=a&&this._followupPayloads.push({kind:"ModuleImportPayload",args:e.args,data:n,dataID:Wue.getDataID(t),operationReference:a,path:(0,Lue.default)(this._path),typeName:r,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeField=function(e,t,n){"object"==typeof n&&n||ode(!1);var r=e.alias||e.name,i=nde(e,this._variables),o=n[r],s=Uue.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?Wue.setLinkedRecordIDs(t,i,[]):Wue.setValue(t,i,[]):Wue.setValue(t,i,null);var a=this._errorTrie;if(null!=a){var l=Vue(a,r);null!=l&&Wue.setErrors(t,i,l)}}else if("ScalarField"===e.kind)this._validateConflictingFieldsWithIdenticalId(t,i,o),Wue.setValue(t,i,o);else if("LinkedField"===e.kind){this._path.push(r);var c=this._errorTrie;this._errorTrie=null==c?null:Kue(c,r),e.plural?this._normalizePluralLink(e,t,i,o):this._normalizeLink(e,t,i,o),this._errorTrie=c,this._path.pop()}else ode(!1)},t._normalizeActorChange=function(e,t,n){var r,i=e.linkedField;"object"==typeof n&&n||ode(!1);var o=i.alias||i.name,s=nde(i,this._variables),a=n[o];if(null!=a){var l=jue(a);if(null!=l){var c=null!==(r=i.concreteType)&&void 0!==r?r:this._getRecordType(a),u=this._getDataId(a,c)||Wue.getLinkedRecordID(t,s)||Bue(Wue.getDataID(t),s);"string"!=typeof u&&ode(!1),Wue.setActorLinkedRecordID(t,s,l,u),this._followupPayloads.push({kind:"ActorPayload",data:a,dataID:u,path:[].concat((0,Lue.default)(this._path),[o]),typeName:c,variables:this._variables,node:i,actorIdentifier:l})}else Wue.setValue(t,s,null)}else{if(void 0===a){if(this._isClientExtension||this._isUnmatchedAbstractType)return;if(!this._treatMissingFieldsAsNull)return}Wue.setValue(t,s,null)}},t._normalizeLink=function(e,t,n,r){var i;"object"==typeof r&&r||ode(!1);var o=this._getDataId(r,null!==(i=e.concreteType)&&void 0!==i?i:this._getRecordType(r))||Wue.getLinkedRecordID(t,n)||Bue(Wue.getDataID(t),n);"string"!=typeof o&&ode(!1),this._validateConflictingLinkedFieldsWithIdenticalId(Wue.getLinkedRecordID(t,n),o,n),Wue.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=Wue.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)||ode(!1);var o=Wue.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:Kue(c,a),"object"!=typeof r&&ode(!1);var u=i._getDataId(r,null!==(l=e.concreteType)&&void 0!==l?l:i._getRecordType(r))||o&&o[a]||Bue(Wue.getDataID(t),n,a);"string"!=typeof u&&ode(!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=Wue.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)}),Wue.setLinkedRecordIDs(t,n,s)},t._validateRecordType=function(e,t,n){if(Uue.ENABLE_STORE_ID_COLLISION_LOGGING){var r,i=null!==(r=t.concreteType)&&void 0!==r?r:this._getRecordType(n),o=Wue.getDataID(e);if(!($ue(o)&&o!==Xue||Wue.getType(e)===i)){var s={name:"idCollision.typename",previous_typename:Wue.getType(e),new_typename:i};null!=this._log&&this._log(s)}}},t._validateConflictingFieldsWithIdenticalId=function(e,t,n){},t._validateConflictingLinkedFieldsWithIdenticalId=function(e,t,n){},e}(),ade={normalize:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;return new sde(e,l,r,null!=o&&o).normalizeResponse(a,s,n,i)}},lde=goe.default,cde=lde(koe),ude=lde(uue),dde=lde(yue),fde=lde(ade);var hde=function(e,t,n,r,i){var o,s=e.data,a=e.errors,l=dde.default.create(),c=ude.default.create(t.dataID,n);l.set(t.dataID,c);var u=fde.default.normalize(l,t,s,r,a,i);return(0,cde.default)((0,cde.default)({},u),{},{isFinal:!0===(null===(o=e.extensions)||void 0===o?void 0:o.is_final)})},pde=hoe.getInlineDataFragment,gde=fse.FRAGMENTS_KEY,mde=noe;var vde=function(e,t){var n,r=pde(e);if(null==t)return t;"object"!=typeof t&&mde(!1);var i=null===(n=t[gde])||void 0===n?void 0:n[r.name];return null==i&&mde(!1),i},yde=1e5;var bde=function(){return yde++},_de=bde;var xde=function(e,t){return{execute:function(n,r,i,o,s,a,l,c){var u=_de(),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)}}},Sde=(0,goe.default)(Doe),wde=noe,Ede=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,Sde.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,Sde.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,Sde.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,Sde.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,Sde.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&&wde(!1);var s=Array.from(n.values());return this._ownersToPendingPromise.set(t,{promise:o,resolve:r,pendingOperations:s}),{promise:o,pendingOperations:s}},e}(),kde=Ede;var Cde=function(e){var t=void 0!==k?k:"undefined"!=typeof window?window:void 0,n=t&&t.__RELAY_DEVTOOLS_HOOK__;n&&n.registerEnvironment(e)},Ade={VIEWER_ID:(0,Uae.generateClientID)(fse.ROOT_ID,"viewer"),VIEWER_TYPE:"Viewer"},Nde=Ade.VIEWER_ID,Tde=Ade.VIEWER_TYPE;var Rde=function(e,t){return t===Tde&&null==e.id?Nde:e.id},Dde=function(e){},Ide=toe.REQUEST;var Fde=function(e){return e.kind===Ide?e.operation:e};function Ode(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 Pde,Mde,Lde={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 Ode.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 Ode.apply(void 0,["warn",e,t].concat(r))}},zde="undefined"!=typeof window&&"function"==typeof(null===(Pde=window)||void 0===Pde||null===(Mde=Pde.performance)||void 0===Mde?void 0:Mde.now);function jde(){return zde?window.performance.now():Date.now()}var Ude=function(e){var t=jde(),n=e();return[t,jde()-t,n]},Bde=goe.default,$de=Bde(Doe),qde=Bde(Voe),Gde=eae,Vde=bde,Kde=Fde,Wde=Lde,Hde=Xoe,Jde=Qoe.stableCopy,Xde=Ude,Qde=Uae.generateClientID,Yde=Uae.generateUniqueClientID,Zde=mse.getLocalVariables,efe=uue,tfe=Use.createNormalizationSelector,nfe=Use.createReaderSelector,rfe=yue,ife=fse,ofe=ife.ROOT_TYPE,sfe=ife.TYPENAME_KEY,afe=ife.getStorageKey,lfe=noe;var cfe=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,b=e.treatMissingFieldsAsNull,_=e.updater,x=e.log,S=e.normalizeResponse;this._actorIdentifier=o,this._getDataID=s,this._treatMissingFieldsAsNull=b,this._incrementalPayloadsPending=!1,this._incrementalResults=new Map,this._log=x,this._executeId=Vde(),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=_,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++;Hde.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(fie){v.error(fie)}},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})}}),Hde.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,lfe(!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++;Gde.create(function(n){var i=r.schedule(function(){try{e(),n.complete()}catch(fie){n.error(fie)}},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=Wde.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)})&&lfe(!1),!1;var n=e[0],r=!0===(null===(t=n.extensions)||void 0===t?void 0:t.isOptimistic);return r&&"started"!==this._state&&lfe(!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||lfe(!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=Yde();this._operation={request:this._operation.request,fragment:nfe(this._operation.fragment.node,u,this._operation.fragment.variables,this._operation.fragment.owner),root:tfe(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 rfe(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 b=this._runPublishQueue(l||c?this._operation:void 0);l&&this._incrementalPayloadsPending&&this._retainData(),this._updateOperationTracker(b),this._sink.next(e)}}},t._processOptimisticResponse=function(e,t,n){var r=this;if(null!==this._optimisticUpdates&&lfe(!1),null!=e||null!=t){var i=[];if(e){var o=this._normalizeResponse(e,this._operation.root,ofe,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[],shouldProcessClientComponents:this._shouldProcessClientComponents,treatMissingFieldsAsNull:n},this._useExecTimeResolvers);ufe(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:rfe.create(),isFinal:!1},updater:t});this._optimisticUpdates=i,i.forEach(function(e){return r._getPublishQueueAndSaveActor().applyUpdate(e)});var s=this._runPublishQueue();Hde.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,$de.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,qde.default)(a))}break;case"ActorPayload":break;default:lfe(!1)}}}catch(l){i.e(l)}finally{i.f()}}},t._normalizeFollowupPayload=function(e,t){var n;n="SplitOperation"===t.kind&&"ModuleImportPayload"===e.kind?Zde(e.variables,t.argumentDefinitions,e.args):e.variables;var r=tfe(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=Kde(e),r=[],i=this._normalizeFollowupPayload(t,n);return ufe(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,qde.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,ofe,{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,Kde(r));else{var i=this._nextSubscriptionId++;this._pendingModulePayloadsCount++;var o=function(){t._pendingModulePayloadsCount--,t._maybeCompleteSubscriptionOperationTracking()},s=Gde.from(new Promise(function(t,r){n.load(e.operationReference).then(t,r)}));Gde.create(function(n){var r,i=s.subscribe({next:function(i){if(null!=i){var o=function(){try{var r=Kde(i),o=Hde.BATCH_ASYNC_MODULE_UPDATES_FN,s=null!=o&&t._pendingModulePayloadsCount>1,a=Xde(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(fie){n.error(fie)}},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:lfe(!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:lfe(!1);var c,u,d=e.source.get(s),f=(null!==(n=e.fieldPayloads)&&void 0!==n?n:[]).filter(function(e){var t=Qde(e.dataID,e.fieldKey);return e.dataID===s||t===s});null==d&&lfe(!1);var h=this._source.get(s);if(null!=h){c=efe.update(h.record,d);var p=new Map,g=function(e){var t=function(e){var t;return null!==(t=JSON.stringify(Jde(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&&lfe(!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&&lfe(!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&&lfe(!1);var c=l.fieldPayloads;if(0!==c.length){var u,d={errors:null,fieldPayloads:c,incrementalPlaceholders:null,followupPayloads:null,source:rfe.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)&&lfe(!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,qde.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:rfe.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&&lfe(!1);var d=null!==(s=n.alias)&&void 0!==s?s:n.name,f=afe(n,r),h=this._source.get(t);null==h&&lfe(!1);var p=h.record,g=h.fieldPayloads,m=efe.getLinkedRecordIDs(p,f);null==m&&lfe(!1);var v=i[i.length-1],y=parseInt(v,10);y===v&&y>=0||lfe(!1);var b=null!==(a=n.concreteType)&&void 0!==a?a:u[sfe];"string"!=typeof b&&lfe(!1);var _=null!==(l=null!==(c=this._getDataID(u,b))&&void 0!==c?c:null==m?void 0:m[y])&&void 0!==l?l:Qde(t,f,y);"string"!=typeof _&&lfe(!1);var x=tfe(n,_,r),S=efe.clone(p),w=(0,qde.default)(m);return w[y]=_,efe.setLinkedRecordIDs(S,f,w),this._source.set(t,{record:S,fieldPayloads:g}),{fieldPayloads:g,itemID:_,itemIndex:y,prevIDs:m,relayPayload:this._normalizeResponse(e,x,b,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[].concat((0,qde.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,$de.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,$de.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,$de.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,$de.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||lfe(!1),e},e}();function ufe(e){var t=e.incrementalPlaceholders;null!=t&&0!==t.length&&lfe(!1)}var dfe={execute:function(e){return new cfe(e)}},ffe=Promise.resolve();function hfe(e){setTimeout(function(){throw e},0)}var pfe=function(e){ffe.then(e).catch(hfe)},gfe=uue,mfe=due.EXISTENT,vfe=noe,yfe=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:gfe.clone(t):null===n?null:null!=t?gfe.update(t,n):gfe.clone(n)},t._getSinkRecord=function(e){var t=this._sink.get(e);if(!t){var n=this._base.get(e);n||vfe(!1),t=gfe.create(e,gfe.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||vfe(!1);var i=this._getSinkRecord(t);r&&gfe.copyFields(r,i),n&&gfe.copyFields(n,i)},t.copyFieldsFromRecord=function(e,t){var n=this._getSinkRecord(t);gfe.copyFields(e,n)},t.create=function(e,t){(this._base.getStatus(e)===mfe||this._sink.getStatus(e)===mfe)&&vfe(!1);var n=gfe.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 gfe.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=gfe.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);gfe.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=gfe.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);gfe.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=gfe.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);gfe.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=gfe.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);gfe.setLinkedRecordIDs(r,t,n)},e}(),bfe=yfe,_fe=(0,goe.default)(Doe),xfe=fse.getArgumentValues,Sfe=["id","__id","__typename","js"];function wfe(e,t,n,r,i,o){var s,a,l=(0,_fe.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:Cfe(r,n,t,i,o),set:Efe(r,n,t,i)}):Object.defineProperty(e,null!==(d=r.alias)&&void 0!==d?d:r.name,{get:Afe(r,n,t,i,o),set:kfe(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=xfe(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,_fe.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:Sfe.includes(r.name)?void 0:function(e){var i,o=xfe(null!==(i=r.args)&&void 0!==i?i:[],n);t.setValue__UNSAFE(e,r.name,o)}});break;case"InlineFragment":t.getType()===r.type&&wfe(e,t,n,r.selections,i,o);break;case"ClientExtension":wfe(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 Efe(e,t,n,r){return function(i){var o,s=xfe(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 kfe(e,t,n,r){return function(i){var o,s=xfe(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 Cfe(e,t,n,r,i){return function(){var o,s=xfe(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,_fe.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 wfe(o,n,t,e.selections,r,i),o}return n}):a}}function Afe(e,t,n,r,i){return function(){var o,s=xfe(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,_fe.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 wfe(l,a,t,e.selections,r,i),l}return a}}var Nfe={createUpdatableProxy:function(e,t,n,r,i){var o={};return wfe(o,e,t,n,r,i),o}},Tfe=hoe.getFragment,Rfe=Use.getVariablesFromFragment,Dfe=fse.ID_KEY,Ife=Nfe.createUpdatableProxy,Ffe=noe;var Ofe={readUpdatableFragment:function(e,t,n,r){var i=Tfe(e),o=Rfe(i,t),s=t[Dfe],a=n.get(s);return null==a&&Ffe(!1),{updatableData:Ife(a,o,i.selections,n,r)}}},Pfe=hoe.getUpdatableQuery,Mfe=Nfe.createUpdatableProxy;var Lfe={readUpdatableQuery:function(e,t,n,r){var i=Pfe(e);return{updatableData:Mfe(n.getRoot(),t,i.fragment.selections,n,r)}}},zfe=Uae.generateClientID,jfe=fse.getStableStorageKey,Ufe=noe,Bfe=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&&Ufe(!1),e},t.getValue=function(e,t){var n=jfe(e,t);return this._mutator.getValue(this._dataID,n)},t.setValue=function(e,t,n,r){return $fe(e)||Ufe(!1),this.setValue__UNSAFE(e,t,n,r)},t.getErrors=function(e,t){var n=jfe(e,t);return this._mutator.getErrors(this._dataID,n)},t.setValue__UNSAFE=function(e,t,n,r){var i=jfe(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=jfe(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||Ufe(!1);var i=jfe(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=jfe(e,n),s=zfe(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=jfe(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)||Ufe(!1);var r=jfe(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 $fe(e){return null==e||"object"!=typeof e||Array.isArray(e)&&e.every($fe)}var qfe=Bfe,Gfe=uue,Vfe=due.EXISTENT,Kfe=due.NONEXISTENT,Wfe=fse,Hfe=Wfe.ROOT_ID,Jfe=Wfe.ROOT_TYPE,Xfe=Ofe.readUpdatableFragment,Qfe=Lfe.readUpdatableQuery,Yfe=qfe,Zfe=noe,ehe=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===Vfe){var i=e.get(t);i&&(n.__mutator.getStatus(t)!==Vfe&&n.create(t,Gfe.getType(i)),n.__mutator.copyFieldsFromRecord(i,t))}else r===Kfe&&n.delete(t)}),t&&t.length&&t.forEach(function(e){var t=n._handlerProvider&&n._handlerProvider(e.handle);t||Zfe(!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||Zfe(!1),n},t.delete=function(e){e===Hfe&&Zfe(!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===Vfe?new Yfe(this,this.__mutator,e):t===Kfe?null:void 0}return this._proxies[e]},t.getRoot=function(){var e=this.get(Hfe);return e||(e=this.create(Hfe,Jfe)),e&&e.getType()===Jfe||Zfe(!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 Qfe(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return Xfe(e,t,this,this._missingFieldHandlers)},e}(),the=ehe,nhe=toe.LINKED_FIELD,rhe=fse.getHandleStorageKey,ihe=_se,ohe=noe;var she=function(e,t,n){var r=t.find(function(t){return t.kind===nhe&&t.name===e.name&&t.alias===e.alias&&ihe(t.args,e.args)});r&&r.kind===nhe||ohe(!1);var i=rhe(e,n);return{kind:"LinkedField",alias:r.alias,name:i,storageKey:i,args:null,concreteType:r.concreteType,plural:r.plural,selections:r.selections}},ahe=toe.SCALAR_FIELD,lhe=fse.getHandleStorageKey,che=_se,uhe=noe;var dhe=function(e,t,n){var r=t.find(function(t){return t.kind===ahe&&t.name===e.name&&t.alias===e.alias&&che(t.args,e.args)});r&&r.kind===ahe||uhe(!1);var i=lhe(e,n);return{kind:"ScalarField",alias:r.alias,name:i,storageKey:i,args:null}},fhe=(0,goe.default)(Doe),hhe=bfe,phe=the,ghe=Fde,mhe=Uae.isClientID,vhe=she,yhe=dhe,bhe=mse.getLocalVariables,_he=uue,xhe=due.EXISTENT,She=due.UNKNOWN,whe=fse,Ehe=Oue.TYPE_SCHEMA_TYPE,khe=Oue.generateTypeID,Che=noe,Ahe=whe.getModuleOperationKey,Nhe=whe.getStorageKey,The=whe.getArgumentValues;var Rhe=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 hhe(this._getSourceForActor(e),n);t=[r,new phe(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)||Che(!1),this._variables[e]},t._handleMissing=function(){this._recordWasMissing=!0},t._handleMissingScalarField=function(e,t){if("id"!==e.name||null!=e.alias||!mhe(t)){var n,r=null!=e.args?The(e.args,this._variables):{},i=(0,fhe.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?The(e.args,this._variables):{},i=(0,fhe.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)===xhe))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?The(e.args,this._variables):{},o=(0,fhe.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)===xhe}))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===She&&this._handleMissing(),n===xhe){var r=this._source.get(t),i=_he.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&&Che(!1);var s=khe(o),a=n._mutator.getValue(s,i);!0===a?n._traverseSelections(r.selections,t):null==a&&n._handleMissing()}break;case"LinkedHandle":var l=vhe(r,e,n._variables);l.plural?n._checkPluralLink(l,t):n._checkLink(l,t);break;case"ScalarHandle":var c=yhe(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=bhe(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&&Che(!1);var p=khe(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:Che(!1)}})},t._checkResolver=function(e,t){e.fragment&&this._traverseSelections([e.fragment],t)},t._checkModuleImport=function(e,t){var n=this._operationLoader;null===n&&Che(!1);var r=Ahe(e.documentName),i=this._mutator.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=ghe(o),a=this._variables;this._variables=bhe(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=Nhe(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=Nhe(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=Nhe(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=Nhe(e,this._variables),r=this._source.get(t),i=null!=r?_he.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,fhe.default)(t[o]);try{for(s.s();!(i=s.n()).done;){var a=i.value,l=khe(a);null==this._source.get(l)&&this._mutator.create(l,Ehe),null==this._mutator.getValue(l,o)&&this._mutator.setValue(l,o,!0)}}catch(c){s.e(c)}finally{s.f()}}},e}(),Dhe={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 Rhe(e,t,n,f,i,o,s,a,l,c).check(d,u);return null!=l&&l({name:"store.datachecker.end",selector:r}),h}},Ihe=uue,Fhe=fse.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,Ohe=noe;var Phe=function(e){var t=Ihe.getValue(e,Fhe);return null==t?null:(t instanceof Set||Ohe(!1),t)};var Mhe=function(e){return null!=e&&"object"==typeof e&&"function"==typeof e.read&&"function"==typeof e.subscribe},Lhe=(0,goe.default)(Doe),zhe=lce,jhe=toe.RELAY_LIVE_RESOLVER,Uhe=Xoe,Bhe=function(e){"object"!=typeof e||null==e||!Array.isArray(e)&&e.constructor!==Object||Object.freeze(e)},$he=Uae.generateClientID,qhe=Uae.generateClientObjectClientID,Ghe=uue,Vhe=Use.createNormalizationSelector,Khe=yue,Whe=ade.normalize,Hhe=fse,Jhe=Hhe.RELAY_RESOLVER_ERROR_KEY,Xhe=Hhe.RELAY_RESOLVER_INVALIDATION_KEY,Qhe=Hhe.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,Yhe=Hhe.RELAY_RESOLVER_SNAPSHOT_KEY,Zhe=Hhe.RELAY_RESOLVER_VALUE_KEY,epe=Hhe.getReadTimeResolverStorageKey,tpe=Hhe.getStorageKey,npe=Phe,rpe=Mhe,ipe=zce.isSuspenseSentinel,ope=noe,spe="__resolverLiveStateSubscription",ape="__resolverLiveStateValue",lpe="__resolverLiveStateDirty",cpe="__RELAY_RESOLVER__";function upe(e,t,n){var r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}var dpe=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=vpe(s,e),l=epe(t,n),c=Ghe.getLinkedRecordID(a,l),u=null==c?null:s.get(c);if(null==u||this._isInvalid(u,i)){var d;null!=u&&mpe(u),c=null!==(d=c)&&void 0!==d?d:$he(e,l),u=Ghe.create(c,cpe);var f=r();if(Ghe.setValue(u,Yhe,f.snapshot),Ghe.setValue(u,Jhe,f.error),t.kind===jhe){if(null!=f.resolverResult){null!=f.error&&ope(!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=vpe(s,e),g=Ghe.clone(p);if(Ghe.setLinkedRecordID(g,l,c),s.set(e,g),null!=t.fragment){var m,v=tpe(t.fragment,n),y=$he(e,v);upe(this._resolverIDToRecordIDs,y,c),upe(this._recordIDToResolverIDs,e,y);var b=null===(m=f.snapshot)||void 0===m?void 0:m.seenRecords;if(null!=b){var _,x=(0,Lhe.default)(b);try{for(x.s();!(_=x.n()).done;){var S=_.value;upe(this._recordIDToResolverIDs,S,y)}}catch(R){x.e(R)}finally{x.f()}}}}else if(t.kind===jhe&&Ghe.getValue(u,lpe)){var w;c=null!==(w=c)&&void 0!==w?w:$he(e,l),u=Ghe.clone(u);var E=Ghe.getValue(u,ape);rpe(E)||ope(!1),o=this._setLiveResolverValue(u,E,t,n),Ghe.setValue(u,lpe,!1),s.set(c,u)}var k,C=this._getResolverValue(u),A=Ghe.getValue(u,Yhe),N=Ghe.getValue(u,Jhe),T=null;ipe(C)&&(T=null!==(k=c)&&void 0!==k?k:$he(e,l));return[C,c,N,A,T,o]},t.getLiveResolverPromise=function(e){var t=this._getRecordSource().get(e);null==t&&ope(!1);var n=Ghe.getValue(t,ape);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);Ghe.setValue(e,ape,n);var a=this._setLiveResolverValue(e,n,r,i);return Ghe.setValue(e,lpe,!1),Ghe.setValue(e,spe,s),a},t._makeLiveStateHandler=function(e){var t=this;return function(){var n=t._getRecordSource().get(e);if(n&&Ghe.hasValue(n,ape)){var r=Ghe.clone(n);Ghe.setValue(r,lpe,!0),t._setLiveResolverUpdate(e,r)}}},t._setLiveResolverUpdate=function(e,t){if(this._handlingBatch)null==this._liveResolverBatchRecordSource&&(this._liveResolverBatchRecordSource=Khe.create()),this._liveResolverBatchRecordSource.set(e,t);else{var n=Khe.create();n.set(e,t),this._store.publish(n),this._store.notify()}},t.batchLiveStateUpdates=function(e){this._handlingBatch&&ope(!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(iB){o=iB}return Ghe.setValue(e,Jhe,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||ipe(t))Bhe(t),Ghe.setValue(e,Zhe,t);else{var s,a=npe(e),l=new Set,c=this._getRecordSource();if(i.plural){Array.isArray(t)||ope(!1),s=[];for(var u=Khe.create(),d=0;d<t.length;d++){var f=t[d];if(null!=f){"object"!=typeof f&&ope(!1);var h,p=ype(i,f),g=qhe(p,Ghe.getDataID(e),d),m=this._normalizeOutputTypeValue(g,f,r,i,[n.path,String(d)],p),v=(0,Lhe.default)(m.getRecordIDs());try{for(v.s();!(h=v.n()).done;){var y=h.value;u.set(y,vpe(m,y)),l.add(y)}}catch(k){v.e(k)}finally{v.f()}s.push(g)}}o=fpe(c,u,a)}else{"object"!=typeof t&&ope(!1);var b,_=ype(i,t),x=qhe(_,Ghe.getDataID(e)),S=this._normalizeOutputTypeValue(x,t,r,i,[n.path],_),w=(0,Lhe.default)(S.getRecordIDs());try{for(w.s();!(b=w.n()).done;){var E=b.value;l.add(E)}}catch(k){w.e(k)}finally{w.f()}s=x,o=fpe(c,S,a)}Ghe.setValue(e,Qhe,l),Bhe(s),Ghe.setValue(e,Zhe,s)}return o},t.notifyUpdatedSubscribers=function(e){this._store.__notifyUpdatedSubscribers(e)},t._getResolverValue=function(e){return Ghe.getValue(e,Zhe)},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,Lhe.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,Lhe.default)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;hpe(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(!Ghe.getValue(e,Xhe))return!1;var n=Ghe.getValue(e,Yhe),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(zhe(r,o)!==r)return!0;if(Uhe.MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD){var s=Ghe.clone(e);Ghe.setValue(s,Xhe,!1),this._getRecordSource().set(Ghe.getDataID(e),s)}return!1},t._normalizeOutputTypeValue=function(e,t,n,r,i,o){var s=Khe.create();switch(r.kind){case"OutputType":var a=Ghe.create(e,o);s.set(e,a);var l=Vhe(r.normalizationNode,e,n),c=this._store.__getNormalizationOptions(i);return Whe(s,l,t,c,void 0,!1).source;case"WeakModel":var u=Ghe.create(e,o);return Ghe.setValue(u,"__relay_model_instance",t),s.set(e,u),s;default:r.kind,ope(!1)}},t.ensureClientRecord=function(e,t){var n=qhe(t,e),r=this._getRecordSource();if(!r.has(n)){var i=Ghe.create(n,t);Ghe.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,Lhe.default)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e.get(i);null!=o&&gpe(o)&&mpe(o)}}catch(s){r.e(s)}finally{r.f()}}(this._getRecordSource(),e)},t.invalidateResolverRecords=function(e){if(0!==e.size){var t,n=(0,Lhe.default)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=this._getRecordSource().get(r);null!=i&&gpe(i)&&this._getRecordSource().delete(r)}}catch(o){n.e(o)}finally{n.f()}}},e}();function fpe(e,t,n){var r=new Set;if(null!=n){var i,o=(0,Lhe.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,Lhe.default)(t.getRecordIDs());try{for(l.s();!(a=l.n()).done;){var c=a.value,u=vpe(t,c);if(e.has(c)){var d=vpe(e,c),f=Ghe.update(d,u);f!==d&&(r.add(c),e.set(c,f),ppe(d,e))}else e.set(c,u)}}catch(h){l.e(h)}finally{l.f()}return r}function hpe(e,t){var n=t.get(e);if(n){var r=Ghe.clone(n);Ghe.setValue(r,Xhe,!0),t.set(e,r)}}function ppe(e,t){var n,r=function(e){var t=new Set;return Ghe.getFields(e).forEach(function(n){if(Ghe.hasLinkedRecordID(e,n)){var r=Ghe.getLinkedRecordID(e,n);null!=r&&t.add(r)}else if(Ghe.hasLinkedRecordIDs(e,n)){var i;null===(i=Ghe.getLinkedRecordIDs(e,n))||void 0===i||i.forEach(function(e){null!=e&&t.add(e)})}}),t}(e),i=(0,Lhe.default)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value,s=t.get(o);null!=s&&gpe(s)&&hpe(o,t)}}catch(a){i.e(a)}finally{i.f()}}function gpe(e){return Ghe.getType(e)===cpe}function mpe(e){var t=Ghe.getValue(e,spe);null!=t&&t()}function vpe(e,t){var n=e.get(t);return null==n&&ope(!1),n}function ype(e,t){var n,r=null!==(n=e.concreteType)&&void 0!==n?n:t.__typename;return null==r&&ope(!1),r}var bpe={LiveResolverCache:dpe,getUpdatedDataIDs:function(e){return e},RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY:spe},_pe=(0,goe.default)(koe),xpe=uue,Spe=yue,wpe=noe,Epe=xpe.fromObject(Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0})),kpe=function(){function e(e){this._base=e,this._sink=Spe.create()}var t=e.prototype;return t.has=function(e){return this._sink.has(e)?this._sink.get(e)!==Epe:this._base.has(e)},t.get=function(e){if(this._sink.has(e)){var t=this._sink.get(e);return t===Epe?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=Spe.create(),this._sink.clear()},t.delete=function(e){this._sink.delete(e)},t.remove=function(e){this._sink.set(e,Epe)},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,_pe.default)({},this._base.toJSON());return this._sink.getRecordIDs().forEach(function(n){var r=e.get(n);void 0===r?delete t[n]:t[n]=xpe.toJSON(r)}),t},t.getOptimisticRecordIDs=function(){return new Set(this._sink.getRecordIDs())},e}();var Cpe={create:function(e){return new kpe(e)},getOptimisticRecordIDs:function(e){return e instanceof kpe||wpe(!1),e.getOptimisticRecordIDs()}},Ape=toe.RELAY_LIVE_RESOLVER,Npe=noe,Tpe=function(){function e(){}var t=e.prototype;return t.readFromCacheOrEvaluate=function(e,t,n,r,i){t.kind===Ape&&Npe(!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){Npe(!1)},t.notifyUpdatedSubscribers=function(e){},e}(),Rpe={NoopResolverCache:Tpe},Dpe=goe.default,Ipe=Dpe(koe),Fpe=Dpe(Eoe),Ope=Dpe(Uce),Ppe=Dpe(Voe),Mpe=["message"],Lpe=Xoe,zpe=zce.isSuspenseSentinel,jpe=mse,Upe=uue,Bpe=fse,$pe=Bpe.CLIENT_EDGE_TRAVERSAL_PATH,qpe=Bpe.FRAGMENT_OWNER_KEY,Gpe=Bpe.FRAGMENT_PROP_NAME_KEY,Vpe=Bpe.FRAGMENTS_KEY,Kpe=Bpe.ID_KEY,Wpe=Bpe.MODULE_COMPONENT_KEY,Hpe=Bpe.ROOT_ID,Jpe=Bpe.getArgumentValues,Xpe=Bpe.getModuleComponentKey,Qpe=Bpe.getStorageKey,Ype=Rpe.NoopResolverCache,Zpe=Wse.RESOLVER_FRAGMENT_ERRORED_SENTINEL,ege=Wse.withResolverContext,tge=Oue.generateTypeID,nge=noe;function rge(e,t,n,r){return new ige(e,t,null!=n?n:new Ype,r).read()}var ige=function(){function e(e,t,n,r){var i,o,s,a;this._clientEdgeTraversalPath=null!==(i=t.clientEdgeTraversalPath)&&void 0!==i&&i.length?(0,Ppe.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=Upe.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)||nge(!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(oge(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,Ope.default)(t,Mpe);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,nge(!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&&nge(!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:nge(!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,nge(!1)}},t._readResolverField=function(e,t,n){var r,i=Upe.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=rge(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,Fpe.default)({},i.name,i.args?Jpe(i.args,r._variables):{})};return r._clientEdgeTraversalPath.length>0&&null!==r._clientEdgeTraversalPath[r._clientEdgeTraversalPath.length-1]&&(s[$pe]=(0,Ppe.default)(r._clientEdgeTraversalPath)),ege({getDataForResolverFragment:o},function(){var t=sge(e,r._variables,s,r._resolverContext),i=t[0],o=t[1];return{resolverResult:i,snapshot:n,error:o}})}var a=sge(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(oge(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&&nge(!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||zpe(l))return n[s]=l,l;if(e.linkedField.plural){var c;Array.isArray(l)||nge(!1),"ClientEdgeToClientObject"!==e.kind&&nge(!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&&nge(!1);var s=age(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&&nge(!1),null!=i._readResolverFieldImpl(c,a)?a:null}return a}):l.map(function(e){return age(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=age(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&&nge(!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&&nge(!1);var v=m[g];if(void 0===v&&nge(!1),null==this._readResolverFieldImpl(v,f))return n[s]=null,null}this._clientEdgeTraversalPath.push(h);var y=n[s];null!=y&&"object"!=typeof y&&nge(!1);var b=this._fieldErrors;this._fieldErrors=null;var _=this._traverse(e.linkedField,f,y);return this._prependPreviousErrors(b,s),this._clientEdgeTraversalPath.pop(),n[s]=_,_},t._readScalar=function(e,t,n){var r,i=null!==(r=e.alias)&&void 0!==r?r:e.name,o=Qpe(e,this._variables),s=Upe.getValue(t,o);return null===s||Lpe.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=Qpe(e,this._variables),s=Upe.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&&nge(!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=Qpe(e,this._variables),s=Upe.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,Upe.fromObject({__id:l}),c),n[i]={__fragmentRef:c,__viewer:a},n[i]},t._readPluralLink=function(e,t,n){var r=Qpe(e,this._variables),i=Upe.getLinkedRecordIDs(t,r);return(null===i||Lpe.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)||nge(!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&&nge(!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=Xpe(e.documentName),i=Upe.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[Gpe]=e.fragmentPropName,n[Wpe]=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=Upe.getType(e);return null!=n&&n===t||Upe.getDataID(e)===Hpe},t._createFragmentPointer=function(e,t,n){var r=n[Vpe];null==r&&(r=n[Vpe]={}),("object"!=typeof r||null==r)&&nge(!1),null==n[Kpe]&&(n[Kpe]=Upe.getDataID(t)),r[e.name]=Jpe(e.args,this._variables,this._isWithinUnmatchedTypeRefinement),n[qpe]=this._owner,this._clientEdgeTraversalPath.length>0&&null!==this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1]&&(n[$pe]=(0,Ppe.default)(this._clientEdgeTraversalPath))},t._createInlineDataOrResolverFragmentPointer=function(e,t,n){var r=n[Vpe];null==r&&(r=n[Vpe]={}),("object"!=typeof r||null==r)&&nge(!1),null==n[Kpe]&&(n[Kpe]=Upe.getDataID(t));var i={},o=this._fragmentName;this._fragmentName=e.name;var s=this._variables,a=e.args?Jpe(e.args,this._variables):{};this._variables=jpe.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=Upe.getType(e),r=this._recordSource.get(tge(n)),i=null!=r?Upe.getValue(r,t):null;return null==i&&this._markDataAsMissing("<abstract-type-hint>"),i},e}();function oge(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,Ipe.default)((0,Ipe.default)({},e),{},{handled:!0});case"missing_expected_data.log":case"missing_required_field.log":return e;default:e.kind,nge(!1)}}function sge(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?Jpe(e.args,t):void 0;a.push(l),a.push(r),o=i.apply(null,a)}catch(iB){o=null,iB!==Zpe&&(s=iB)}return[o,s]}function age(e,t,n){return"string"==typeof e?e:"object"==typeof e&&null!=e&&"string"==typeof e.id?e.id:void nge(!1)}var lge={read:rge},cge=(0,goe.default)(Doe),uge=Fde,dge=she,fge=Phe,hge=mse.getLocalVariables,pge=uue,gge=fse,mge=Oue.generateTypeID,vge=noe,yge=gge.getReadTimeResolverStorageKey,bge=gge.getStorageKey,_ge=gge.getModuleOperationKey;var xge=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)||vge(!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=pge.getType(t);(null!=i&&i===r.type||i===gge.ROOT_TYPE)&&n._traverseSelections(r.selections,t)}else{var o=pge.getType(t),s=mge(o);n._references.add(s),n._traverseSelections(r.selections,t)}break;case"FragmentSpread":var a=n._variables;n._variables=hge(n._variables,r.fragment.argumentDefinitions,r.args),n._traverseSelections(r.fragment.selections,t),n._variables=a;break;case"LinkedHandle":var l=dge(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=pge.getType(t),u=mge(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:vge(!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=fge(r);if(null!=i){var o,s=(0,cge.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=pge.getResolverLinkedRecordIDs(r,c);if(null!=u){var d,f=(0,cge.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=pge.getResolverLinkedRecordID(r,c);null!=p&&this._traverse(l,p)}}}}},t._traverseResolverField=function(e,t){if(!this._useExecTimeResolvers){var n=yge(e,this._variables),r=pge.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&&vge(!1);var r=_ge(e.documentName),i=pge.getValue(t,r);if(null!=i){var o=n.get(i);if(null!=o){var s=uge(o),a=this._variables;this._variables=hge(this._variables,s.argumentDefinitions,e.args),this._traverseSelections(s.selections,t),this._variables=a}}},t._traverseLink=function(e,t){var n=bge(e,this._variables),r=pge.getLinkedRecordID(t,n);null!=r&&this._traverse(e,r)},t._traversePluralLink=function(e,t){var n=this,r=bge(e,this._variables),i=pge.getLinkedRecordIDs(t,r);null!=i&&i.forEach(function(t){null!=t&&n._traverse(e,t)})},e}(),Sge={mark:function(e,t,n,r,i,o){var s=t.dataID,a=t.node,l=t.variables;new xge(e,l,n,r,i,o).mark(a,s)}},wge=Symbol.iterator;var Ege=function(e,t){for(var n=e[wge](),r=n.next();!r.done;){var i=r.value;if(t.has(i))return!0;r=n.next()}return!1},kge=fse.ROOT_ID,Cge=Ade.VIEWER_ID,Age=Symbol.iterator;var Nge=function(e,t){for(var n=e[Age](),r=n.next();!r.done;){var i=r.value;if(t.has(i)&&i!==kge&&i!==Cge)return!0;r=n.next()}return!1},Tge=lce,Rge=Xoe,Dge=Ege,Ige=Nge,Fge=lge,Oge=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=Fge.read(e,r.selector,t._resolverCache,t._resolverContext),o=Tge(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&&Dge(a.seenRecords,n);if(l||c){var u=c||!o?Fge.read(e,a.selector,this._resolverCache,this._resolverContext):o;return u={data:Tge(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&&Rge.ENABLE_NOTIFY_SUBSCRIPTION&&this.__log({name:"store.notify.subscription",sourceOperation:i,snapshot:a,nextSnapshot:u}),s(u),a.selector.owner):Rge.ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION&&(l||Ige(a.seenRecords,n))?a.selector.owner:void 0}},t.size=function(){return this._subscriptions.size},e}(),Pge=Oge,Mge=goe.default,Lge=Mge(Doe),zge=Mge(Eoe),jge=xue.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,Uge=xue.assertInternalActorIdentifier,Bge=pfe,$ge=Dhe,qge=Rde,Gge=bpe.LiveResolverCache,Vge=bpe.RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY,Kge=bpe.getUpdatedDataIDs,Wge=uue,Hge=Cpe,Jge=lge,Xge=Sge,Qge=Pge,Yge=fse,Zge=fse,eme=Zge.ROOT_ID,tme=Zge.ROOT_TYPE,nme=noe,rme=function(){function e(e,t){var n,r,i,o,s,a,l,c,u=this;(0,zge.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:Bge,this._getDataID=null!==(o=null==t?void 0:t.getDataID)&&void 0!==o?o:qge,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 Gge(function(){return u._getMutableRecordSource()},this),this._resolverContext=null==t?void 0:t.resolverContext,this._storeSubscriptions=new Qge(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(eme)){var t=Wge.create(eme,tme);e.set(eme,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 Uge(e),u},v=null!==(a=null==t?void 0:t.getTargetForActor)&&void 0!==a?a:function(e){return Uge(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}}($ge.check(m,v,null!==(l=null==t?void 0:t.defaultActorIdentifier)&&void 0!==l?l:jge,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=Jge.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?Wge.clone(s):null!=a?Wge.clone(a):null)&&(Wge.setValue(i,Yge.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=Wge.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=Wge.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,Lge.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&&nme(!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=Hge.create(this.getSource())},t.restore=function(){var e=this._optimisticSource;e||nme(!1);var t=this.__log;null!=t&&t({name:"store.restore"});var n=Hge.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,Lge.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&&nme(!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(Xge.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 b=v[y];if(!r.has(b)){var _=this._recordSource.get(b);if(null!=_){var x=Wge.getValue(_,Vge);null!=x&&x()}this._recordSource.remove(b),this._shouldRetainWithinTTL_EXPERIMENTAL&&this._roots.delete(b)}}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=Kge(e),n=this._updatedRecordIDs;this._updatedRecordIDs=t,this.notify(),this._updatedRecordIDs=n},e}();var ime,ome,sme=rme,ame=fse,lme=ame.ROOT_TYPE,cme=ame.getStorageKey,ume=Ofe.readUpdatableFragment,dme=Lfe.readUpdatableQuery,fme=noe,hme=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,lme)),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||fme(!1),r.plural!==n&&fme(!1),r},t.getRootField=function(e){var t=this._getRootField(this._readSelector,e,!1),n=cme(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecord(n)},t.getPluralRootField=function(e){var t=this._getRootField(this._readSelector,e,!0),n=cme(t,this._readSelector.variables);return this.getOperationRoot().getLinkedRecords(n)},t.invalidateStore=function(){this.__recordSource.invalidateStore()},t.readUpdatableQuery=function(e,t){return dme(e,t,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(e,t){return ume(e,t,this,this._missingFieldHandlers)},e}(),pme=bfe,gme=the,mme=hme,vme=Xoe,yme=lge,bme=yue,_me=noe,xme=void 0!==k?k:"undefined"!=typeof window?window:void 0,Sme=null!==(ime=null==xme||null===(ome=xme.ErrorUtils)||void 0===ome?void 0:ome.applyWithGuard)&&void 0!==ime?ime:function(e,t,n,r,i){return e.apply(t,n)},wme=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))&&_me(!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(vme.DISALLOW_NESTED_UPDATES&&!0===this._isRunning&&_me(!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 pme(this._store.getSource(),o),l=new gme(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||_me(!1),n.update(l,e)}),i){var c=r.fragment;null==c&&_me(!1),i(new mme(a,l,c,this._missingFieldHandlers),Eme(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=bme.create(),a=new pme(e._store.getSource(),s),l=new gme(a,e._getDataID,e._handlerProvider,e._missingFieldHandlers,e._log);Sme(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=bme.create(),n=new pme(this._store.getSource(),t),r=new gme(n,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log),i=function(t){if(t.storeUpdater){var i=t.storeUpdater;Sme(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=Eme(l,o.fragment));var d=new mme(n,r,o.fragment,e._missingFieldHandlers);Sme(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 Eme(e,t){return yme.read(e,t).data}var kme=wme,Cme=(0,goe.default)(koe),Ame=gle,Nme=xue.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,Tme=xue.assertInternalActorIdentifier,Rme=eae,Dme=xde,Ime=kde,Fme=Cde,Ome=Rde,Pme=Dde,Mme=hde,Lme=dfe,zme=sme,jme=kme,Ume=yue,Bme=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 zme(new Ume,{log:e.log,operationLoader:e.operationLoader,getDataID:e.getDataID,shouldProcessClientComponents:e.shouldProcessClientComponents});this.__log=null!==(n=e.log)&&void 0!==n?n:$me,this.relayFieldLogger=null!==(r=e.relayFieldLogger)&&void 0!==r?r:Pme,this._defaultRenderPolicy=null!==(i=e.UNSTABLE_defaultRenderPolicy)&&void 0!==i?i:"partial",this._operationLoader=h,this._operationExecutions=new Map,this._network=Dme(this,e.network),this._getDataID=null!==(o=e.getDataID)&&void 0!==o?o:Ome,this._missingFieldHandlers=null!==(s=e.missingFieldHandlers)&&void 0!==s?s:[],this._publishQueue=new jme(p,null!==(a=e.handlerProvider)&&void 0!==a?a:Ame,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:Mme,this.__setNet=function(e){return f._network=Dme(f,e)},this._operationTracker=null!==(d=e.operationTracker)&&void 0!==d?d:new Ime,this._shouldProcessClientComponents=e.shouldProcessClientComponents,Fme(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 Rme.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 Rme.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=Ume.create(),i=this._store.getSource(),o=this._store.check(e,{handlers:t,defaultActorIdentifier:Nme,getSourceForActor:function(e){return Tme(e),i},getTargetForActor:function(e){return Tme(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,Cme.default)((0,Cme.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 Rme.create(function(e){var c=Lme.execute({actorIdentifier:Nme,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 Tme(e),a},scheduler:t._scheduler,shouldProcessClientComponents:t._shouldProcessClientComponents,sink:e,source:n(),getStore:function(e){return Tme(e),l},treatMissingFieldsAsNull:t._treatMissingFieldsAsNull,updater:s,normalizeResponse:t._normalizeResponse});return function(){return c.cancel()}})},e}();function $me(){}Bme.prototype["@@RelayModernEnvironment"]=!0;var qme=Bme,Gme=_le,Vme=hoe.getRequest,Kme=Dae.createOperationDescriptor,Wme=Use.createReaderSelector;var Hme=function(e,t){var n=Vme(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=Kme(n,a,l),u=(r?Gme.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=Wme(a.node,n,a.variables,a.owner));var l=e.lookup(a).data;s(l)}},error:o,complete:i});return{dispose:d.unsubscribe}};(0,goe.default)(koe);var Jme=fse;Jme.getModuleComponentKey,Jme.getModuleOperationKey;var Xme=Object.prototype.hasOwnProperty;var Qme=Use.getDataIDsFromFragment,Yme=Use.getSelector,Zme=Use.getVariablesFromFragment,eve=function(e){for(var t in e)if(Xme.call(e,t))return!1;return!0},tve=Xoe,nve=Qoe.stableCopy,rve=Pae.intern;var ive=function(e,t){var n=Yme(e,t),r=null==n?"null":"SingularReaderSelector"===n.kind?n.owner.identifier:"["+n.selectors.map(function(e){return e.owner.identifier}).join(",")+"]",i=Zme(e,t),o=Qme(e,t);if(tve.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION){var s=void 0===o?"missing":null==o?"null":Array.isArray(o)?"["+o.join(",")+"]":o;return s=tve.STRING_INTERN_LEVEL<=1?s:rve(s,tve.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+(null==i||eve(i)?"{}":JSON.stringify(nve(i)))+"/"+s}var a,l=null!==(a=JSON.stringify(o))&&void 0!==a?a:"missing";return l=tve.STRING_INTERN_LEVEL<=1?l:rve(l,tve.MAX_DATA_ID_LENGTH),r+"/"+e.name+"/"+JSON.stringify(nve(i))+"/"+l},ove=noe;var sve=function(e,t){var n,r;!0===(null===(n=e.metadata)||void 0===n?void 0:n.plural)&&ove(!1);var i=null===(r=e.metadata)||void 0===r?void 0:r.refetch;null==i&&ove(!1);var o=i.operation.default?i.operation.default:i.operation,s=i.fragmentPathInResult;"string"==typeof o&&ove(!1);var a=i.identifierInfo;return null!=a&&(null!=a.identifierField&&"string"!=typeof a.identifierField&&ove(!1),null!=a.identifierQueryVariableName&&"string"!=typeof a.identifierQueryVariableName&&ove(!1)),{fragmentRefPathInResponse:s,identifierInfo:a,refetchableRequest:o,refetchMetadata:i}},ave=sve,lve=noe;var cve=function(e,t){var n,r,i=ave(e),o=i.refetchableRequest,s=i.refetchMetadata,a=s.connection;null==a&&lve(!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&&lve(!1);var u=s.identifierInfo;return null!=(null==u?void 0:u.identifierField)&&"string"!=typeof u.identifierField&&lve(!1),{connectionPathInFragmentData:l,identifierField:null==u?void 0:u.identifierField,paginationRequest:o,paginationMetadata:a,stream:!0===c.stream}},uve=goe.default,dve=uve(Eoe),fve=uve(koe),hve=noe;var pve=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)&&hve(!1);var u=(0,fve.default)((0,fve.default)((0,fve.default)({},r),i),{},(c={},(0,dve.default)(c,a.cursor,n),(0,dve.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)&&hve(!1);var d=(0,fve.default)((0,fve.default)((0,fve.default)({},r),i),{},(s={},(0,dve.default)(s,l.cursor,n),(0,dve.default)(s,l.count,t),s));return a&&a.cursor&&(d[a.cursor]=null),a&&a.count&&(d[a.count]=null),d},gve=(0,goe.default)(Doe),mve=noe;var vve=function(e,t){var n,r=e,i=(0,gve.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)||mve(!1),r=r[o]):(("object"!=typeof r||Array.isArray(r))&&mve(!1),r=r[o])}}catch(s){i.e(s)}finally{i.f()}return r},yve=Zae,bve=qae,_ve=Cle,xve=Ale,Sve=Ple,wve=_le,Eve=Yle,kve=tce,Cve=mae,Ave=hoe,Nve=rce,Tve=Oce,Rve=Mce,Dve=mle,Ive=vde,Fve=mse,Ove=Use,Pve=fse,Mve=Wse,Lve=Ade,zve=Hme,jve=yae,Uve=ive,Bve=cve,$ve=pve,qve=oce,Gve=sve,Vve=xae,Kve=vve,Wve=Loe.handlePotentialSnapshotErrors,Hve=Xse,Jve=sce,Xve=lce,Qve=Koe,Yve=Xoe,Zve={Environment:qme,Network:qle,Observable:eae,RecordSource:yue,ReplaySubject:aae,Store:sme,areEqualSelectors:Ove.areEqualSelectors,createFragmentSpecResolver:Rce,createNormalizationSelector:Ove.createNormalizationSelector,createOperationDescriptor:Dae.createOperationDescriptor,createReaderSelector:Ove.createReaderSelector,createRequestDescriptor:Dae.createRequestDescriptor,getArgumentValues:Pve.getArgumentValues,getDataIDsFromFragment:Ove.getDataIDsFromFragment,getDataIDsFromObject:Ove.getDataIDsFromObject,getNode:Ave.getNode,getFragment:Ave.getFragment,getInlineDataFragment:Ave.getInlineDataFragment,getModuleComponentKey:Pve.getModuleComponentKey,getModuleOperationKey:Pve.getModuleOperationKey,getPaginationFragment:Ave.getPaginationFragment,getPluralSelector:Ove.getPluralSelector,getRefetchableFragment:Ave.getRefetchableFragment,getRequest:Ave.getRequest,getRequestIdentifier:Vve,getSelector:Ove.getSelector,getSelectorsFromObject:Ove.getSelectorsFromObject,getSingularSelector:Ove.getSingularSelector,getStorageKey:Pve.getStorageKey,getVariablesFromFragment:Ove.getVariablesFromFragment,getVariablesFromObject:Ove.getVariablesFromObject,getVariablesFromPluralFragment:Ove.getVariablesFromPluralFragment,getVariablesFromSingularFragment:Ove.getVariablesFromSingularFragment,handlePotentialSnapshotErrors:Wve,graphql:Ave.graphql,isFragment:Ave.isFragment,isInlineDataFragment:Ave.isInlineDataFragment,isRequest:Ave.isRequest,readInlineData:Ive,readFragment:Mve.readFragment,MutationTypes:wve.MutationTypes,RangeOperations:wve.RangeOperations,ConnectionHandler:yve,VIEWER_ID:Lve.VIEWER_ID,VIEWER_TYPE:Lve.VIEWER_TYPE,applyOptimisticMutation:_ve,commitLocalUpdate:xve,commitMutation:Sve,fetchQuery:Eve,fetchQuery_DEPRECATED:kve,isRelayModernEnvironment:Dve,requestSubscription:zve,ConnectionInterface:bve,PreloadableQueryRegistry:Nve,RelayFeatureFlags:Yve,DEFAULT_HANDLE_KEY:Qve.DEFAULT_HANDLE_KEY,FRAGMENTS_KEY:Pve.FRAGMENTS_KEY,FRAGMENT_OWNER_KEY:Pve.FRAGMENT_OWNER_KEY,ID_KEY:Pve.ID_KEY,REF_KEY:Pve.REF_KEY,REFS_KEY:Pve.REFS_KEY,ROOT_ID:Pve.ROOT_ID,ROOT_TYPE:Pve.ROOT_TYPE,TYPENAME_KEY:Pve.TYPENAME_KEY,deepFreeze:jve,isPromise:Hve,isScalarAndEqual:Jve,recycleNodesInto:Xve,getFragmentIdentifier:Uve,getRefetchMetadata:Gve,getPaginationMetadata:Bve,getPaginationVariables:$ve,getPendingOperationsForFragment:qve,getValueAtPath:Kve,__internal:{createRelayContext:Tve,createRelayLoggingContext:Rve,getOperationVariables:Fve.getOperationVariables,getLocalVariables:Fve.getLocalVariables,fetchQuery:Cve.fetchQuery,fetchQueryDeduped:Cve.fetchQueryDeduped,getPromiseForActiveRequest:Cve.getPromiseForActiveRequest,getObservableForActiveRequest:Cve.getObservableForActiveRequest}},eye=sme;const tye=C(eye),nye=N({__proto__:null,default:tye},[eye]);let rye={kind:"linked",handle:(e,t,n,r)=>{let i=e.name,o=n.id;return null==t||"node"!==i||t.getType()!==Zve.ROOT_TYPE?void 0:o}};let iye={make:function(e,t,n){return new Zve.Store(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},makeLiveStore:function(e,t,n){return new tye(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})},_makeLiveStoreCjs:function(e,t,n){return new nye(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:n})}};function oye(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 sye={make:function(e,t,n,r,i,o,s){return new Zve.Environment({network:e,store:t,getDataID:n,treatMissingFieldsAsNull:r,missingFieldHandlers:void 0!==i?i.concat([rye]):[rye],relayFieldLogger:o,isServer:s})},findAllConnectionIds:oye,invalidateAllOfConnection:function(e,t,n,r){let i=void 0!==r?r:[];Zve.commitLocalUpdate(e,r=>{oye(e,t,n).forEach(e=>{if(!i.includes(e))return M(R(r.get(e)),e=>{e.invalidateRecord()})})})}};var aye=A,lye=(0,Zve.__internal.createRelayContext)(aye),cye={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}(cye);var uye=cye.exports,dye={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}(dye);var fye=dye.exports,hye={exports:{}},pye={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}(pye);var gye=pye.exports;!function(e){var t=gye;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}(hye);var mye=hye.exports,vye=noe;var yye=function(e,t){for(var n in t&&"object"==typeof t||vye(!1),t)if(t.hasOwnProperty(n)){var r=t[n];(!r||"object"!=typeof r&&"function"!=typeof r)&&vye(!1)}};function bye(e){return e.displayName||e.name||"Component"}var _ye={getComponentName:bye,getContainerName:function(e){return"Relay("+bye(e)+")"}},xye=A.createContext({rootIsQueryRenderer:!1}),Sye=(0,goe.default)(uye),wye=yye,Eye=_ye.getComponentName,kye=_ye.getContainerName,Cye=lye,Aye=xye,Nye=noe,Tye=A,Rye=Zve.getFragment,Dye=Tye.useContext;var Iye=function(e,t,n){var r=kye(e);wye(Eye(e),t);var i={};for(var o in t)i[o]=Rye(t[o]);var s=n(e,i);function a(e,t){var n,r=Dye(Cye);null==r&&Nye(!1);var i=Dye(Aye);return Tye.createElement(s,(0,Sye.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,Tye.forwardRef(a)};var Fye=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},Oye=noe;var Pye={assertRelayContext:function(e){return!function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Fye(e.environment)}(e)&&Oye(!1),e}},Mye=goe.default,Lye=Mye(uye),zye=Mye(Uce),jye=Mye(fye),Uye=Mye(mye),Bye=Mye(Eoe),$ye=["componentRef","__relayContext","__rootIsQueryRenderer"],qye=Iye,Gye=_ye.getContainerName,Vye=Pye.assertRelayContext,Kye=_se,Wye=A,Hye=Zve,Jye=Hye.createFragmentSpecResolver,Xye=Hye.getDataIDsFromObject,Qye=Hye.isScalarAndEqual;function Yye(e,t){var n,r=Gye(e);return n=function(n){function i(e){var i,o;o=n.call(this,e)||this,(0,Bye.default)((0,jye.default)(o),"_handleFragmentDataUpdate",function(){var e=o.state.resolver;o.setState(function(t){return e===t.resolver?{data:t.resolver.resolve(),relayProp:Zye(t.relayProp.environment)}:null})});var s=Vye(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=Jye(s,r,t,e,a);return o.state={data:l.resolve(),prevProps:e,prevPropsContext:s,relayProp:Zye(s.environment),resolver:l},o}(0,Uye.default)(i,n),i.getDerivedStateFromProps=function(e,n){var i,o=n.prevProps,s=Vye(e.__relayContext),a=null!==(i=e.__rootIsQueryRenderer)&&void 0!==i&&i,l=Xye(t,o),c=Xye(t,e),u=n.resolver;if(n.prevPropsContext.environment!==s.environment||!Kye(l,c))return{data:(u=Jye(s,r,t,e,a)).resolve(),prevPropsContext:s,prevProps:e,relayProp:Zye(s.environment),resolver:u};u.setProps(e);var d=u.resolve();return d!==n.data?{data:d,prevProps:e,prevPropsContext:s,relayProp:Zye(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)&&!Qye(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,zye.default)(t,$ye);return Wye.createElement(e,(0,Lye.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp}))},i}(Wye.Component),(0,Bye.default)(n,"displayName",r),n}function Zye(e){return{environment:e}}var ebe={createContainer:function(e,t){return qye(e,t,Yye)}},tbe=A,nbe=Zve;nbe.createOperationDescriptor,nbe.deepFreeze,nbe.getRequest,tbe.useLayoutEffect,tbe.useState,tbe.useRef,tbe.useMemo;var rbe=(0,goe.default)(koe),ibe=Zve.getSelector;var obe=function(e,t){var n={};return Object.keys(e).forEach(function(r){var i,o,s,a=e[r],l=t[r],c=ibe(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,rbe.default)((0,rbe.default)({},n),u)}),n},sbe=(0,goe.default)(Eoe),abe=noe,lbe=Zve,cbe=lbe.__internal.fetchQuery,ube=lbe.createOperationDescriptor,dbe=lbe.isRelayModernEnvironment,fbe=function(){function e(e){(0,sbe.default)(this,"_selectionReferences",[]),(0,sbe.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 dbe(n)?cbe(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||abe(!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?ube(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||abe(!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||abe(!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}(),hbe=fbe,pbe=goe.default,gbe=pbe(uye),mbe=pbe(Uce),vbe=pbe(fye),ybe=pbe(mye),bbe=pbe(Eoe),_be=pbe(koe),xbe=["componentRef"],Sbe=["componentRef","__relayContext","__rootIsQueryRenderer"],wbe=["componentRef","__relayContext","__rootIsQueryRenderer"],Ebe=Iye,kbe=obe,Cbe=_ye.getComponentName,Abe=_ye.getContainerName,Nbe=lye,Tbe=hbe,Rbe=Pye.assertRelayContext,Dbe=_se,Ibe=noe,Fbe=A,Obe=Zve,Pbe=Obe.ConnectionInterface,Mbe=Obe.Observable,Lbe=Obe.RelayFeatureFlags,zbe=Obe.createFragmentSpecResolver,jbe=Obe.createOperationDescriptor,Ube=Obe.getDataIDsFromObject,Bbe=Obe.getRequest,$be=Obe.getVariablesFromObject,qbe=Obe.isScalarAndEqual,Gbe="forward";function Vbe(e){return"function"==typeof e?{error:e,complete:e,unsubscribe:function(t){"function"==typeof e&&e()}}:e||{}}function Kbe(e,t,n){var r;Cbe(e);var i=Abe(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&&Ibe(!1),t&&Ibe(!1),t=(0,_be.default)((0,_be.default)({},o[0]),{},{fragmentName:r}))}return n&&null===t&&Ibe(!1),t||{}}(t),s=n.getConnectionFromProps||function(e){var t=e.path;return t||Ibe(!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||Ibe(!1);var l=n.getFragmentVariables||function(e){var t=e.count;return t||Ibe(!1),function(e,n){return(0,_be.default)((0,_be.default)({},e),{},(0,bbe.default)({},t,n))}}(o);return r=function(r){function o(e){var n,o;o=r.call(this,e)||this,(0,bbe.default)((0,vbe.default)(o),"_handleFragmentDataUpdate",function(){o.setState({data:o._resolver.resolve()})}),(0,bbe.default)((0,vbe.default)(o),"_hasMore",function(){var e=o._getConnectionData();return!!(e&&e.hasMore&&e.cursor)}),(0,bbe.default)((0,vbe.default)(o),"_isLoading",function(){return!!o._refetchSubscription}),(0,bbe.default)((0,vbe.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,Vbe(t),{force:!0}).unsubscribe}}),(0,bbe.default)((0,vbe.default)(o),"_loadMore",function(e,t,n){if(!o._canFetchPage("loadMore"))return{dispose:function(){}};var r=Vbe(t),i=o._getConnectionData();if(!i)return Mbe.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=Pbe.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=Rbe(e.__relayContext),a=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n;return o._isARequestInFlight=!1,o._refetchSubscription=null,o._refetchVariables=null,!0===Lbe.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?o._resolver=zbe(s,i,t,e,a):o._resolver=zbe(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,ybe.default)(o,r);var c=o.prototype;return c.componentDidMount=function(){this._isUnmounted=!1,!0===Lbe.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},c.componentDidUpdate=function(e,t){!0===Lbe.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT&&(t.resolverGeneration!==this.state.resolverGeneration?this._subscribeToNewResolverAndRerenderIfStoreHasChanged():this._rerenderIfStoreHasChanged())},c.UNSAFE_componentWillReceiveProps=function(e){var n,r=this,o=Rbe(e.__relayContext),s=null!==(n=e.__rootIsQueryRenderer)&&void 0!==n&&n,a=Ube(t,this.props),l=Ube(t,e),c=kbe(t,this.props),u=kbe(t,e);o.environment===this.state.prevContext.environment&&Dbe(c,u)&&Dbe(a,l)?this._hasFetched||this._resolver.setProps(e):(this._cleanup(),!0===Lbe.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT?this._resolver=zbe(o,i,t,e,s):this._resolver=zbe(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)&&!qbe(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,mbe.default)(e,xbe),n=(0,_be.default)((0,_be.default)({},t),this.state.data),r=s(n);if(null==r)return null;var i=Pbe.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&&Ibe(!1);var h=r[o],p=r[l];if(null==h||null==p)return null;Array.isArray(h)||Ibe(!1),"object"!=typeof p&&Ibe(!1);var g=a===Gbe?p[c]:p[u],m=a===Gbe?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 Tbe),this._queryFetcher},c._canFetchPage=function(e){return!this._isUnmounted},c._fetchPage=function(e,r,i){var o=this,s=Rbe(this.props.__relayContext).environment,a=this.props;a.componentRef,a.__relayContext,a.__rootIsQueryRenderer;var c,u=(0,mbe.default)(a,Sbe),d=(0,_be.default)((0,_be.default)({},u),this.state.data),f=kbe(t,u);c=$be(t,u),c=(0,_be.default)((0,_be.default)((0,_be.default)({},f),c),this._refetchVariables);var h=n.getVariables(d,{count:e.count,cursor:e.cursor},c);("object"!=typeof h||null===h)&&Ibe(!1),h=(0,_be.default)((0,_be.default)({},h),this._refetchVariables),c=(0,_be.default)((0,_be.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=Bbe(n.query),m=jbe(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 Mbe.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();Dbe(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,mbe.default)(t,wbe);return Fbe.createElement(Nbe.Provider,{value:this.state.contextForChildren},Fbe.createElement(e,(0,gbe.default)({},r,this.state.data,{ref:n,relay:this.state.relayProp})))},o}(Fbe.Component),(0,bbe.default)(r,"displayName",i),r}var Wbe={createContainer:function(e,t,n){return Ebe(e,t,function(e,t){return Kbe(e,t,n)})}},Hbe=goe.default,Jbe=(Hbe(koe),Hbe(fye),Hbe(mye),Hbe(Eoe),A),Xbe=Zve;Xbe.createOperationDescriptor;Xbe.deepFreeze;Xbe.getRequest;Jbe.Component;var Qbe=goe.default,Ybe=Qbe(uye),Zbe=Qbe(Uce),e_e=Qbe(koe),t_e=Qbe(fye),n_e=Qbe(mye),r_e=Qbe(Eoe),i_e=["componentRef","__relayContext","__rootIsQueryRenderer"],o_e=Iye,s_e=obe,a_e=_ye.getContainerName,l_e=lye,c_e=hbe,u_e=Pye.assertRelayContext,d_e=_se,f_e=A,h_e=Zve,p_e=h_e.Observable,g_e=h_e.createFragmentSpecResolver,m_e=h_e.createOperationDescriptor,v_e=h_e.getDataIDsFromObject,y_e=h_e.getRequest,b_e=h_e.getVariablesFromObject,__e=h_e.isScalarAndEqual;function x_e(e,t){return{environment:e,refetch:t}}var S_e={createContainer:function(e,t,n){return o_e(e,t,function(e,t){return function(e,t,n){var r,i=a_e(e);return r=function(r){function o(e){var o,s;s=r.call(this,e)||this,(0,r_e.default)((0,t_e.default)(s),"_handleFragmentDataUpdate",function(){var e=s.state.resolver;s.setState(function(t){return e===t.resolver?{data:t.resolver.resolve()}:null})}),(0,r_e.default)((0,t_e.default)(s),"_refetch",function(e,r,i,o){if(s._isUnmounted)return{dispose:function(){}};var a=u_e(s.props.__relayContext).environment,l=s_e(t,s.props),c="function"==typeof e?e(s._getFragmentVariables()):e;c=(0,e_e.default)((0,e_e.default)({},l),c);var u=r?(0,e_e.default)((0,e_e.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=y_e(n),g=m_e(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),p_e.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,e_e.default)((0,e_e.default)({},h),{},{start:function(e){s._refetchSubscription=f=e,h.start&&h.start(e)}})),{dispose:function(){f&&f.unsubscribe()}})});var a=u_e(e.__relayContext),l=null!==(o=e.__rootIsQueryRenderer)&&void 0!==o&&o;s._refetchSubscription=null;var c=g_e(a,i,t,e,l);return s.state={data:c.resolve(),localVariables:null,prevProps:e,prevPropsContext:a,contextForChildren:a,relayProp:x_e(a.environment,s._refetch),resolver:c},s._isUnmounted=!1,s}(0,n_e.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=u_e(e.__relayContext),a=null!==(r=e.__rootIsQueryRenderer)&&void 0!==r&&r,l=v_e(t,o),c=v_e(t,e),u=s_e(t,o),d=s_e(t,e),f=n.resolver;if(n.prevPropsContext.environment!==s.environment||!d_e(u,d)||!d_e(l,c))return{data:(f=g_e(s,i,t,e,a)).resolve(),localVariables:null,prevProps:e,prevPropsContext:s,contextForChildren:s,relayProp:x_e(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)&&!__e(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 b_e(t,this.props)},s._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new c_e),this._queryFetcher},s.render=function(){var t=this.props,n=t.componentRef;t.__relayContext,t.__rootIsQueryRenderer;var r=(0,Zbe.default)(t,i_e),i=this.state,o=i.relayProp,s=i.contextForChildren;return f_e.createElement(l_e.Provider,{value:s},f_e.createElement(e,(0,Ybe.default)({},r,this.state.data,{ref:n,relay:o})))},o}(f_e.Component),(0,r_e.default)(r,"displayName",i),r}(e,t,n)})}};A.createContext({wrapPrepareQueryResource:function(e){return e()}});var w_e=lye,E_e=noe,k_e=A.useContext;var C_e=function(){var e=k_e(w_e);return null==e&&E_e(!1),e.environment},A_e=A;A_e.useContext,A_e.useEffect;(0,goe.default)(koe);var N_e=Zve;N_e.__internal.fetchQueryDeduped,N_e.Observable,N_e.PreloadableQueryRegistry,N_e.ReplaySubject,N_e.createOperationDescriptor,N_e.getRequest,N_e.getRequestIdentifier;A.useMemo;var T_e=noe,R_e=function(){function e(e){this._capacity=e,this._capacity>0||T_e(!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 D_e={create:function(e){return new R_e(e)}},I_e=(0,goe.default)(Eoe),F_e=function(){function e(e){var t=this;(0,I_e.default)(this,"_retainCount",0),(0,I_e.default)(this,"_retainDisposable",null),(0,I_e.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}(),O_e=goe.default,P_e=O_e(koe),M_e=O_e(Eoe),L_e=D_e,z_e=F_e,j_e=noe,U_e=Zve.isPromise,B_e="store-or-network",$_e="store-and-network",q_e="function"==typeof WeakMap;function G_e(e){return void 0!==e.request.node.params.metadata.live}function V_e(e,t,n,r,i){var o=null!=n?n:G_e(t)?$_e:B_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 K_e(e,t){var n={__id:e.fragment.dataID,__fragments:(0,M_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 W_e=2e5;function H_e(e,t,n,r,i,o){var s=G_e(t),a=r,l=i,c=new z_e(function(e){var n=e.retain(t);return{dispose:function(){s&&null!=l&&l.unsubscribe(),n.dispose(),o(u)}}}),u={cacheIdentifier:e,id:W_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 J_e=function(){function e(e){var t=this;(0,M_e.default)(this,"_clearCacheEntry",function(e){t._cache.delete(e.cacheIdentifier)}),this._environment=e,this._cache=L_e.create(1e3)}var t=e.prototype;return t.prepare=function(e,t,n,r,i,o,s){var a=V_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:G_e(t)?$_e:B_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,P_e.default)((0,P_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(U_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=V_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=H_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=K_e(t,e),v=H_e(e,t,d,m,null,this._clearCacheEntry);this._cache.set(e,v)}if(a){var y,b=K_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,P_e.default)((0,P_e.default)({},n),{},{unsubscribe:function(){G_e(t)&&n.unsubscribe()}}))},next:function(){var n=c._getOrCreateCacheEntry(e,t,d,b,y);n.processedPayloadsCount+=1,n.setValue(b),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 _=this._cache.get(e);if(!_){var x=new Promise(function(e){g=e});x.displayName="Relay("+t.fragment.node.name+")",_=H_e(e,t,d,x,y,this._clearCacheEntry),this._cache.set(e,_)}}else{var S=null==s?void 0:s.complete;S&&S()}var w=this._cache.get(e);return null==w&&j_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 X_e=q_e?new WeakMap:new Map;var Q_e={getQueryResourceForEnvironment:function(e){var t=X_e.get(e);if(t)return t;var n=function(e){return new J_e(e)}(e);return X_e.set(e,n),n},getQueryCacheIdentifier:V_e};A.useMemo;var Y_e=A;Y_e.useCallback,Y_e.useEffect;var Z_e=A,exe=(0,Zve.__internal.createRelayLoggingContext)(Z_e),txe=A.useContext;var nxe=function(){return txe(exe)},rxe=goe.default,ixe=rxe(koe),oxe=rxe(Doe),sxe=rxe(Voe),axe=Q_e.getQueryResourceForEnvironment,lxe=C_e,cxe=nxe,uxe=noe,dxe=A;dxe.useDebugValue;var fxe=dxe.useEffect,hxe=dxe.useMemo,pxe=dxe.useRef,gxe=dxe.useState,mxe=Zve,vxe=mxe.__internal,yxe=vxe.fetchQuery,bxe=vxe.getPromiseForActiveRequest,_xe=mxe.RelayFeatureFlags,xxe=mxe.areEqualSelectors,Sxe=mxe.createOperationDescriptor,wxe=mxe.getPendingOperationsForFragment,Exe=mxe.getSelector,kxe=mxe.getVariablesFromFragment,Cxe=mxe.handlePotentialSnapshotErrors,Axe=mxe.recycleNodesInto;function Nxe(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=Axe(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=Axe(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&&uxe(!1),[s,{kind:"plural",snapshots:a,epoch:n}]}function Txe(e,t,n,r,i){var o=kxe(t,n),s=(0,ixe.default)((0,ixe.default)({},o),{},{id:r.clientEdgeDestinationID}),a=Sxe(r.request,s,null==i?void 0:i.networkCacheConfig);return[axe(e).prepare(a,yxe(e,a),null==i?void 0:i.fetchPolicy),bxe(e,a.request)]}function Rxe(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 Dxe=function(e,t,n,r){var i,o,s=hxe(function(){return Exe(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)||uxe(!1):Array.isArray(t)&&uxe(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||uxe(!1);var l,c=lxe();_xe.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=cxe());var u=gxe(function(){return Rxe(c,s)}),d=u[0],f=u[1],h=d,p=gxe(h),g=p[0],m=p[1],v=g,y=gxe(s),b=y[0],_=y[1],x=gxe(c),S=x[0],w=x[1];if(!xxe(s,b)||c!==S){_(s),w(c);var E=Rxe(c,s);f(E),m(E),h=E,v=E}var k=pxe(!1);if(fxe(function(){k.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||_xe.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var C=hxe(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,oxe.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,oxe.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,oxe.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=Txe(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);fxe(function(){var e=axe(c);if(null!=A&&A.length){var t,n=[],r=(0,oxe.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,oxe.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,oxe.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(_xe.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==S||!k.current||!xxe(k.current,s)){null==s&&uxe(!1);var R="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,D=wxe(c,e,R);if(D)throw D.promise}}!function(e,t,n){if("singular"===t.kind)Cxe(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,oxe.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;Cxe(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var I,F=pxe(!1);if(fxe(function(){var e=v,t=Nxe(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=Nxe(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=Nxe(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,sxe.default)(n.snapshots);return c[i]=t,r.current=!0,{kind:"plural",snapshots:c,epoch:e.getStore().getEpoch()}})})});return function(){var e,t=(0,oxe.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=Nxe(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=hxe(function(){return"bailout"===h.kind?L?null:[]:("plural"!==h.kind&&uxe(!1),h.snapshots.map(function(e){return e.data}))},[h,L])}else"bailout"===h.kind?I=null:("singular"!==h.kind&&uxe(!1),I=h.snapshot.data);return _xe.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},Ixe=goe.default,Fxe=Ixe(koe),Oxe=Ixe(Doe),Pxe=Ixe(Voe),Mxe=Q_e.getQueryResourceForEnvironment,Lxe=C_e,zxe=nxe,jxe=noe,Uxe=A;Uxe.useDebugValue;var Bxe=Uxe.useEffect,$xe=Uxe.useMemo,qxe=Uxe.useRef,Gxe=Uxe.useState,Vxe=Zve,Kxe=Vxe.__internal,Wxe=Kxe.fetchQuery,Hxe=Kxe.getPromiseForActiveRequest,Jxe=Vxe.RelayFeatureFlags,Xxe=Vxe.areEqualSelectors,Qxe=Vxe.createOperationDescriptor,Yxe=Vxe.getPendingOperationsForFragment,Zxe=Vxe.getSelector,eSe=Vxe.getVariablesFromFragment,tSe=Vxe.handlePotentialSnapshotErrors,nSe=Vxe.recycleNodesInto;function rSe(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=nSe(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=nSe(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&&jxe(!1),[s,{kind:"plural",snapshots:a,epoch:n,selector:t.selector,environment:t.environment}]}function iSe(e,t,n,r,i){var o=eSe(t,n),s=(0,Fxe.default)((0,Fxe.default)({},o),{},{id:r.clientEdgeDestinationID}),a=Qxe(r.request,s,null==i?void 0:i.networkCacheConfig),l=Mxe(e).prepare(a,Wxe(e,a),null==i?void 0:i.fetchPolicy),c=Hxe(e,a.request);return null!=c&&null==c.displayName&&(c.displayName=r.request.params.name),[l,c]}function oSe(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=rSe(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=rSe(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,Pxe.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,Oxe.default)(i);try{for(t.s();!(e=t.n()).done;){e.value.dispose()}}catch(n){t.e(n)}finally{t.f()}}}function sSe(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 aSe=function(e,t,n,r){var i,o,s=$xe(function(){return Zxe(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)||jxe(!1):Array.isArray(t)&&jxe(!1),null==t||a&&Array.isArray(t)&&0===t.length||null!=s||jxe(!1);var l,c=Lxe();Jxe.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(l=zxe());var u=Gxe(function(){return sSe(c,s)}),d=u[0],f=u[1],h=d,p=h.environment;if(!Xxe(s,h.selector)||c!==h.environment){var g=sSe(c,s);f(g),h=g}var m=qxe(!1);if(Bxe(function(){m.current=s},[s]),!0===(null===(o=e.metadata)||void 0===o?void 0:o.hasClientEdges)||Jxe.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var v=$xe(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,Oxe.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,Oxe.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,Oxe.default)(i);try{for(a.s();!(s=a.n()).done;){var l=s.value,u=iSe(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],b=v[1];if(b.length){var _=Promise.all(b);throw _.displayName="RelayClientEdge(".concat(b.map(function(e){return e.displayName}).join(","),")"),_}Bxe(function(){var e=Mxe(c);if(null!=y&&y.length){var t,n=[],r=(0,Oxe.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,Oxe.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,Oxe.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(Jxe.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||c!==p||!m.current||!Xxe(m.current,s)){null==s&&jxe(!1);var w="PluralReaderSelector"===s.kind?s.selectors[0].owner:s.owner,E=Yxe(c,e,w);if(E)throw E.promise}}!function(e,t,n){if("singular"===t.kind)tSe(e,t.snapshot.fieldErrors,n);else if("plural"===t.kind){var r,i=(0,Oxe.default)(t.snapshots);try{for(i.s();!(r=i.n()).done;){var o=r.value;tSe(e,o.fieldErrors,n)}}catch(s){i.e(s)}finally{i.f()}}}(c,h,l);var k,C=qxe(null);if(Bxe(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=rSe(h.environment,h);if(null!==n){var r=n[0],i=n[1];if(r)return void f(i);t=i}var o=oSe(h.environment,t,f);C.current={dispose:o,selector:h.selector,environment:h.environment}}},[h]),Bxe(function(){if(null==C.current&&"bailout"!==h.kind){var e=oSe(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=$xe(function(){return"bailout"===h.kind?A?null:[]:("plural"!==h.kind&&jxe(!1),h.snapshots.map(function(e){return e.data}))},[h,A])}else"bailout"===h.kind?k=null:("singular"!==h.kind&&jxe(!1),k=h.snapshot.data);return Jxe.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},lSe=goe.default;lSe(Dxe),lSe(aSe);var cSe=A;cSe.useContext,cSe.useEffect,cSe.useState,cSe.useRef,A.useState;var uSe=A,dSe=Zve;dSe.createOperationDescriptor,dSe.getRequest,uSe.useMemo,Zve.__internal.fetchQuery,(0,goe.default)(koe);var fSe=A;fSe.useEffect,fSe.useRef,(0,goe.default)(Doe);var hSe=A;hSe.useCallback,hSe.useEffect,hSe.useRef,hSe.useState,A.useDebugValue,Zve.getFragment,(0,goe.default)(koe);var pSe=A;Zve.commitMutation,pSe.useState,pSe.useEffect,pSe.useRef,pSe.useCallback;var gSe=Zve;gSe.ConnectionInterface,gSe.getValueAtPath;var mSe=A,vSe=Zve;vSe.__internal.getObservableForActiveRequest,vSe.getSelector,mSe.useEffect,mSe.useState,mSe.useMemo,(0,goe.default)(koe);var ySe=A;ySe.useCallback,ySe.useRef,ySe.useState;var bSe=Zve;bSe.__internal.fetchQuery,bSe.createOperationDescriptor,bSe.getPaginationVariables,bSe.getRefetchMetadata,bSe.getSelector,(0,goe.default)(koe);var _Se=A;_Se.useCallback,_Se.useEffect,_Se.useState;var xSe=Zve;xSe.__internal.fetchQuery,xSe.RelayFeatureFlags,xSe.createOperationDescriptor,xSe.getPaginationVariables,xSe.getRefetchMetadata,xSe.getSelector;var SSe=goe.default;SSe(koe),SSe(Doe);var wSe=Zve;wSe.__internal.fetchQuery,wSe.RelayFeatureFlags,wSe.createOperationDescriptor,wSe.getPendingOperationsForFragment,wSe.getSelector,wSe.getVariablesFromFragment,wSe.handlePotentialSnapshotErrors,(0,goe.default)(Doe);var ESe=A;ESe.useCallback,ESe.useEffect,ESe.useInsertionEffect,ESe.useRef,ESe.useState,Zve.getRequest,(0,goe.default)(Doe);var kSe=A;kSe.useCallback,kSe.useEffect,kSe.useRef,kSe.useState;var CSe=Zve;CSe.RelayFeatureFlags,CSe.getRequest,(0,goe.default)(koe);var ASe=A;ASe.useCallback,ASe.useContext,ASe.useReducer;var NSe=Zve;NSe.__internal.fetchQuery,NSe.createOperationDescriptor,NSe.getFragmentIdentifier,NSe.getRefetchMetadata,NSe.getSelector,NSe.getValueAtPath,(0,goe.default)(koe);var TSe=A;TSe.useCallback,TSe.useDebugValue,TSe.useState;var RSe=Zve;RSe.RelayFeatureFlags,RSe.getFragment,RSe.getFragmentIdentifier,RSe.getPaginationMetadata,(0,goe.default)(koe);var DSe=A;DSe.useCallback,DSe.useDebugValue,DSe.useEffect,DSe.useLayoutEffect,DSe.useMemo,DSe.useRef,DSe.useState;var ISe=Zve;ISe.getFragment,ISe.getFragmentIdentifier,ISe.getPaginationMetadata;var FSe=Zve;FSe.ConnectionInterface,FSe.RelayFeatureFlags,FSe.getSelector,FSe.getValueAtPath,A.useDebugValue;var OSe=Zve.__internal;OSe.fetchQueryDeduped,OSe.fetchQuery,A.useDebugValue,Zve.getFragment;var PSe=A;PSe.useEffect,PSe.useRef,A.useEffect,Zve.requestSubscription;var MSe=lye,LSe=ebe,zSe=Wbe,jSe=S_e,USe=Zve,BSe={ConnectionHandler:USe.ConnectionHandler,MutationTypes:USe.MutationTypes,RangeOperations:USe.RangeOperations,ReactRelayContext:MSe,applyOptimisticMutation:USe.applyOptimisticMutation,commitLocalUpdate:USe.commitLocalUpdate,commitMutation:USe.commitMutation,createFragmentContainer:LSe.createContainer,createPaginationContainer:zSe.createContainer,createRefetchContainer:jSe.createContainer,fetchQuery_DEPRECATED:USe.fetchQuery_DEPRECATED,graphql:USe.graphql,readInlineData:USe.readInlineData,requestSubscription:USe.requestSubscription,fetchQuery:USe.fetchQuery};let $Se={make:function(e){let t=BSe.ReactRelayContext.Provider;return c(t,{value:{environment:e.environment},children:e.children})}},qSe=$Se;let GSe=function(e){let t=e.config,n=mG(),r=p(()=>function(e,t,n){return sye.make(Zve.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 Kne(f)&&n(),f}),iye.make(new Zve.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(qSe.make,{environment:r,children:e.children})};function VSe(e){return"var("+e+")"}let KSe=Ls([zo("background",VSe(bt.surfaceElevated)),zo("border","1px solid var("+bt.border+")"),zo("border-radius",VSe(St.md)),zo("padding",VSe(_t.lg)),qo("flex"),Go("column"),jo("center"),Jo("center"),zo("gap",VSe(_t.sm)),zo("min-height","160px"),ms("center"),bs({NAME:"percent",VAL:100}),zo("box-sizing","border-box")]),WSe=Ls([zo("font-size","32px"),zo("line-height","1"),is(Ts(4))]),HSe=Ls([zo("color",VSe(bt.textPrimary)),zo("font-size",VSe(xt.sizeMd)),zo("font-weight",VSe(xt.weightMedium)),is(Ts(4))]),JSe=Ls([zo("color",VSe(bt.textSecondary)),zo("font-size",VSe(xt.sizeSm)),zo("line-height",VSe(xt.lineHeightNormal))]),XSe=Ls([zo("color",VSe(bt.textDisabled)),zo("font-size",VSe(xt.sizeXs)),zo("font-family",VSe(xt.fontFamilyMono)),rs(Ts(8))]);let QSe=function(e){let t=e.definition;return r("div",{children:[i("div",{children:"[locked]",className:WSe}),i("div",{children:t.title,className:HSe}),i("div",{children:t.description,className:JSe}),i("div",{children:t.extensionPackage,className:XSe})],className:KSe})},YSe=Ls([qo("flex"),jo("center"),Jo("center"),zo("min-height","160px"),zo("color","var("+bt.textSecondary+")"),zo("font-size","var("+xt.sizeSm+")")]);function ZSe(e){return i("div",{children:"Loading…",className:YSe})}Ls([qo("flex"),jo("center"),Jo("center"),zo("min-height","160px"),zo("color","var("+bt.error+")"),zo("font-size","var("+xt.sizeSm+")")]);let ewe=function(e){let t=eV(),n=function(e){let t=d(JV);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(ZSe,{})}):i(QSe,{definition:n})};let twe=function(e){let t=function(e){let t=d(JV);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(ewe,{fragmentId:e.fragmentId,props:n},e.fragmentId)),style:{display:"flex",flexDirection:"column",gap:"1rem"}}):null};let nwe=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(twe,{name:"platform-summary"})],style:{display:"flex",fontFamily:"system-ui",padding:"1.5rem",flexDirection:"column",gap:"1.5rem"}})},rwe={fragmentId:"host.home",title:"Home",menuEntry:{label:"Home",icon:void 0,group:void 0,sortOrder:0},requiredAccess:void 0,url:"/"};let iwe=function(e){let t=e.config,n=d(WG),r=fK(),o=XG(),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([rwe])),M(r,e=>e.register([Be(ze(e=>e),i(nwe,{}))],{})))},[]),a(()=>{if((""===s||"/"===s)&&0!==o.length)if(void 0!==l)J(l);else if(t.autoRedirectFirstPage){let e=o.find(e=>!!$(e.url)&&QG(e));if(void 0!==e){let t=e.url;void 0!==t&&J(t)}}},[o.length,s]),null};function owe(e,t){return j(j(ht(e),e=>Xe(e,t)),ht)}function swe(e){let t=owe(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 awe(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(owe(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(swe),e=>Promise.resolve({TAG:"Error",_0:"Release request failed"}))}}let lwe={pages:[],panels:[],routes:[]};function cwe(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 uwe(e){return i("div",{children:"Loading…",style:{fontFamily:"system-ui",padding:"2rem"}})}function dwe(e){let t=e.extensions,n=d(WG),r=d(JV),i=fK();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 fwe(e){let t=e.uiHints,n=e.config,s=function(){let e=d(rK).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(iK),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(Iie,{}),i(kK,{}),i(zG,{})]});return a(()=>{document.title=c},[c]),r(o,{children:[i(iwe,{config:n}),i(sie,{config:n,uiHints:t}),i(dwe,{extensions:e.extensions}),i(HV,{appName:c,logoUrl:n.logoUrl,router:s,headerSlot:u,fallback:i(hie,{config:n,uiHints:t}),routesReady:l,loading:i(uwe,{})})]})}function hwe(e){let t=e.discoverPlatforms,n=ZV(se(void 0));if(void 0===n)return void 0!==t?i(OK,{discover:t}):i(cwe,{message:"config.json sets mode = fleet but the app supplied no discoverPlatforms adapter to ShellApp"});let r=n[0];return i(tK,{scope:r,children:i(ne,{value:{prefix:YV(r),path:n[1]},children:i(fwe,{config:e.config,extensions:e.extensions,uiHints:e.uiHints})})})}function pwe(e){let t=e.access;return i(tV,{access:t,children:i(JG,{children:i(QV,{access:t,children:i(dK,{children:i(pl,{children:i(AF.Provider.make,{children:i(Vre,{children:e.children})})})})})})})}function gwe(e){let t,n=e.uiHints,r=e.extensions,o=e.config,s=mG();if("Single"===o.mode){let e=o.environment,s=o.platformName;t=void 0!==e&&void 0!==s?i(tK,{scope:{environment:e,platformName:s},children:i(fwe,{config:o,extensions:r,uiHints:n})}):i(fwe,{config:o,extensions:r,uiHints:n})}else t=i(hwe,{config:o,extensions:r,uiHints:n,discoverPlatforms:e.discoverPlatforms});if("Anonymous"===o.authMode)return i(pwe,{access:o.accessTiers,children:t});if(void 0===s)return i(GG,{});let a=s.identity;return void 0!==a&&s.isAuthenticated?i(pwe,{access:a.groups.concat(o.accessTiers),children:t}):i(GG,{})}function mwe(e){let t=e.config,n=mG();!function(e){We.contents=e}(t.assetOrigins);let o,s=se(void 0),l=t.mode;o="Single"===l?void 0:z(ZV(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=FP(e);return PP(t)&&r(),Promise.resolve(t)})}}(t.apiEndpoint,t.platformApiEndpoint,()=>j(n,e=>e.getToken()),()=>M(n,e=>e.logout())),r=void 0!==o?(i=RK(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[MP(r),r]},[t,n,c]),d=u[0],f=h(d);f.current=d,nF.contents=d,a(()=>{let e={};!function(e,t,n){let r=void 0!==e?e:e=>{},o=(e,o,s,a,l,c,u)=>i(Zie,{adapter:Yie(o,void 0,r),accept:B(t,Jie(e,o)),multiple:U(n,Xie(o)),value:s,onChange:a}),s=e=>{let t={...U(BD(e),{cell:(e,t,n)=>{},detail:(e,t,n)=>{}})};UD(e,(t.validateInput=eoe,t.input=o,t))};s("File"),s("Image")}(t=>(t=>{let n=e[t];if(void 0!==n)return n;let r=awe(()=>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(oF,{execute:d,executeResult:u[1],children:i(GSe,{config:t,children:r(lP,{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(Fie,{config:t,onChange:e.reloadUiHints}),i(GO,{initialPreset:g,children:i(gwe,{config:t,extensions:e.extensions,uiHints:e.uiHints,discoverPlatforms:e.discoverPlatforms})})]})})},m)}function vwe(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(gO):(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 ywe(e){let t=e.extensions,n=e.config,r=vwe(n,t),o=r[0];return i(gG,{authMode:n.authMode,apiEndpoint:n.apiEndpoint,cognitoClientId:n.identityProviderClientId,cognitoUserPoolId:n.identityProviderId,region:n.region,children:void 0!==o?i(mwe,{config:n,extensions:t,uiHints:o,reloadUiHints:r[1],discoverPlatforms:e.discoverPlatforms}):i(uwe,{})})}let bwe=function(e){let t=e.registerModes,n=e.extensions,r=void 0!==n?n:lwe,o=s(()=>"LoadingConfig"),l=o[1],c=o[0];return a(()=>{ce(fetch("/config.json").then(e=>e.ok?e.json().then(TP):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(uwe,{}):"Ready"===c.TAG?i(ywe,{config:c._0,extensions:r,discoverPlatforms:e.discoverPlatforms}):i(cwe,{message:c._0})},_we=document.querySelector("#root");if(null!=_we){n(_we).render(i(bwe,{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-DCY-ySmR.js"),__vite__mapDeps([1,2])).then(e=>e.init);r(n.graphLayout,void 0);let i=await t(()=>import("./StateMachineDiagram.res-C7eML_uK.js"),__vite__mapDeps([3,2])).then(e=>e.init);return i();case"map":let o=await t(()=>import("./MapMode.res-Bdm4mDHW.js"),__vite__mapDeps([4])).then(e=>e.init),s=await t(()=>import("./Geocoder.res-CDDxpwqX.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,sY as C,fe as D,bt as E,_t as F,xt as G,Pn as H,ht as I,R as J,$ as K,ft as L,UD as M,vI as N,nF as O,hM as P,dM as Q,St as R,oY as S,aY as T,Bee as a,Xe as b,YQ as c,ge as d,me as e,M as f,U as g,lt as h,en as i,II as j,FI as k,Mn as l,dt as m,j as n,W0 as o,q0 as p,pt as q,FF as r,QQ as s,K0 as t,L as u,G0 as v,zF as w,Ze as x,UO as y,T as z};