@oktis-works/admin 0.15.0 → 0.16.0
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.
- package/dist/client/_astro/{ActivityWidget.CedrZ3yN.js → ActivityWidget.ChzmikZu.js} +1 -1
- package/dist/client/_astro/{AdminBar.CkfSUzJJ.js → AdminBar.BJWCyHKH.js} +1 -1
- package/dist/client/_astro/{ApiKeysManager.ChCtr3J2.js → ApiKeysManager.BhT6maqs.js} +1 -1
- package/dist/client/_astro/{AtGlanceWidget.DMrAc7qb.js → AtGlanceWidget.DxzCpOV6.js} +1 -1
- package/dist/client/_astro/{CommentsManager.CtiI8mwU.js → CommentsManager.ENdf74ep.js} +1 -1
- package/dist/client/_astro/ContentEditor.D0k_DlIU.js +1 -0
- package/dist/client/_astro/{ContentEditor.Bl295osh.js → ContentEditor.D5ceM2cx.js} +1 -1
- package/dist/client/_astro/{ContentTypeWorkspace.xZAsn-ok.js → ContentTypeWorkspace.Pt26MjgI.js} +1 -1
- package/dist/client/_astro/{DashboardHome.B7PYDcS1.js → DashboardHome.CFRpf5gq.js} +1 -1
- package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.BFY8jBwE.js → DashboardLayout.astro_astro_type_script_index_0_lang.K2BlxaxN.js} +1 -1
- package/dist/client/_astro/{FieldGroupEditor.BsV0u51p.js → FieldGroupEditor.CJrN1zwx.js} +1 -1
- package/dist/client/_astro/{FieldGroupList.CXyFKdsR.js → FieldGroupList.BwV0WQKr.js} +1 -1
- package/dist/client/_astro/{Footer.BKD9_ctB.js → Footer.GKAEli7Z.js} +1 -1
- package/dist/client/_astro/{GeneralSettings.Di8ILdOl.js → GeneralSettings.CVL2OygA.js} +1 -1
- package/dist/client/_astro/{LogsManager.WBGR0Ci2.js → LogsManager.CFLnd9ZB.js} +1 -1
- package/dist/client/_astro/{MediaLibrary.B5ozN2R7.js → MediaLibrary.7dkXH_rK.js} +1 -1
- package/dist/client/_astro/{MenuManager.9UORktNs.js → MenuManager.DR4WuUgm.js} +1 -1
- package/dist/client/_astro/{Modal.CPaZJlDP.js → Modal.C6l3xeBc.js} +1 -1
- package/dist/client/_astro/{PluginManager._RYLLtJI.js → PluginManager.DGS7ULAQ.js} +1 -1
- package/dist/client/_astro/{PostTypesManager.B6dDnCOy.js → PostTypesManager.CFYtUiMC.js} +1 -1
- package/dist/client/_astro/{QuickDraftWidget.DCVYrBPm.js → QuickDraftWidget.6BO0a_eK.js} +1 -1
- package/dist/client/_astro/ReadingSettings.DPXWhZzQ.js +1 -0
- package/dist/client/_astro/{ResourceHubs.Cd0KB4Rx.js → ResourceHubs.BkQbEmJj.js} +1 -1
- package/dist/client/_astro/{TaxonomiesManager.9I03xqrR.js → TaxonomiesManager.C_5zrayU.js} +1 -1
- package/dist/client/_astro/{TaxonomyTermsManager.btLVdHr-.js → TaxonomyTermsManager.j3RcgMUq.js} +1 -1
- package/dist/client/_astro/{ThemeCustomizer.CXg9hm9t.js → ThemeCustomizer.CA-V4vrP.js} +1 -1
- package/dist/client/_astro/{ThemeManager.BfQh8JJa.js → ThemeManager.BRbihPtF.js} +1 -1
- package/dist/client/_astro/{UserCreateForm.BAd11jYs.js → UserCreateForm.Zz8aGR3k.js} +1 -1
- package/dist/client/_astro/{UsersManager.gkehfvoP.js → UsersManager.BrtySwDC.js} +1 -1
- package/dist/client/_astro/{WebhooksManager.BCilUaGs.js → WebhooksManager.UOfDFaV5.js} +1 -1
- package/dist/client/_astro/{i18n.LMZI7jyc.js → i18n.DeOz3HxE.js} +1 -1
- package/dist/client/_astro/{pt-BR.CfJP86YC.js → pt-BR.C-EQC0-7.js} +1 -1
- package/dist/server/chunks/{404_CIlW8Cz9.mjs → 404_DSq1z3nq.mjs} +1 -1
- package/dist/server/chunks/{BaseLayout_DdN9Gl3i.mjs → BaseLayout_BfJCf1zO.mjs} +1 -1
- package/dist/server/chunks/{ContentEditor_GenRIOIJ.mjs → ContentEditor_Bm8Txfp0.mjs} +3 -3
- package/dist/server/chunks/{DashboardLayout_BY4AqWC6.mjs → DashboardLayout_Bgig4Bzt.mjs} +2 -2
- package/dist/server/chunks/{FieldRenderer_pM3Tq7vY.mjs → FieldRenderer_CDx8Zaxh.mjs} +2 -2
- package/dist/server/chunks/{MediaLibrary_woj8kWSK.mjs → MediaLibrary_D5Q4ofCd.mjs} +2 -2
- package/dist/server/chunks/{Modal_BQZlVP1o.mjs → Modal_B8BarHWg.mjs} +1 -1
- package/dist/server/chunks/{_id__CIrIQBGk.mjs → _id__BlTMZrdv.mjs} +2 -2
- package/dist/server/chunks/{_slug__DP5cppSD.mjs → _slug__Dj-IRSFr.mjs} +1 -1
- package/dist/server/chunks/{access_Cr1RkoC8.mjs → access_CNiloHkT.mjs} +3 -3
- package/dist/server/chunks/{api-keys_DxCfUQiR.mjs → api-keys_GqT5bD0q.mjs} +3 -3
- package/dist/server/chunks/{comments_CDCO_DTQ.mjs → comments_BXNvPafa.mjs} +2 -2
- package/dist/server/chunks/{custom-fields_DUby1Cd7.mjs → custom-fields_CO1IKHOz.mjs} +2 -2
- package/dist/server/chunks/{customize_DITLWxTB.mjs → customize_Byc8itgW.mjs} +2 -2
- package/dist/server/chunks/{edit_6xBPrb1J.mjs → edit_D0rn3HA1.mjs} +2 -2
- package/dist/server/chunks/{general_CA6aT6cZ.mjs → general_B0fNmZbu.mjs} +2 -2
- package/dist/server/chunks/{i18n_BBVOgA0q.mjs → i18n_ie92fcXF.mjs} +2 -2
- package/dist/server/chunks/{index_CO2SvpwW.mjs → index_7b0VyAS9.mjs} +2 -2
- package/dist/server/chunks/{index_Cn92C8CO.mjs → index_CV9dE_yu.mjs} +2 -2
- package/dist/server/chunks/{index_1C4PfYEy.mjs → index_DhgdylFA.mjs} +2 -2
- package/dist/server/chunks/{index_D2ypKpAG.mjs → index_M4NDX1QC.mjs} +3 -3
- package/dist/server/chunks/{index_D_AiNQGl.mjs → index_i8ebBGvR.mjs} +2 -2
- package/dist/server/chunks/{login_vyj4WhBt.mjs → login_D50phFgs.mjs} +1 -1
- package/dist/server/chunks/{logs_BjuW-do3.mjs → logs_BRNxhbeo.mjs} +2 -2
- package/dist/server/chunks/{menus_CPi_m-b8.mjs → menus_B-GjEx8-.mjs} +2 -2
- package/dist/server/chunks/{new_BlENJv6A.mjs → new_Bi2kaUnl.mjs} +2 -2
- package/dist/server/chunks/{new_D_pNdD5e.mjs → new_CK6-d0l3.mjs} +2 -2
- package/dist/server/chunks/{plugins_sYgOSowJ.mjs → plugins_D7EHhXUJ.mjs} +2 -2
- package/dist/server/chunks/{post-types_Bm8olePm.mjs → post-types_BBn7Tk48.mjs} +2 -2
- package/dist/server/chunks/{pt-BR_DYDMLZu_.mjs → pt-BR_CQWainBO.mjs} +1 -1
- package/dist/server/chunks/reading_BGq2c5HM.mjs +197 -0
- package/dist/server/chunks/{taxonomies_DbsqX_QZ.mjs → taxonomies_D5-WJMXM.mjs} +2 -2
- package/dist/server/chunks/{taxonomy_ByKdjp9j.mjs → taxonomy__yis5-wJ.mjs} +3 -3
- package/dist/server/chunks/{themes_BKAM_crI.mjs → themes_Dpg-ee2S.mjs} +2 -2
- package/dist/server/chunks/{upload_CE4Lbc1u.mjs → upload_BPY5ZFIb.mjs} +2 -2
- package/dist/server/chunks/{webhooks_CpruP30e.mjs → webhooks_DFrRhSdU.mjs} +2 -2
- package/dist/server/entry.mjs +66 -35
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +1 -1
- package/dist/client/_astro/ContentEditor.BQTSumnU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,h as t,l as n,p as r,r as i}from"./solid.Ck4Vtfe4.js";import{_ as a,l as o,o as s,p as c,u as l}from"./web.DD6VKaIp.js";import{n as u}from"./i18n.
|
|
1
|
+
import{S as e,h as t,l as n,p as r,r as i}from"./solid.Ck4Vtfe4.js";import{_ as a,l as o,o as s,p as c,u as l}from"./web.DD6VKaIp.js";import{n as u}from"./i18n.DeOz3HxE.js";import{n as d}from"./api.B03e8F6d.js";var f=a(`<div class=activity-widget data-widget-panel=activity style="grid-column:span 2"><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><div class=styles-container><style>
|
|
2
2
|
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
3
3
|
.activity-item {
|
|
4
4
|
display: flex; gap: 0.75rem; padding: 0.75rem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,a as o,f as s,i as c,l,o as u,p as d,s as f}from"./web.DD6VKaIp.js";import{a as p,i as m,n as h,o as g}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,a as o,f as s,i as c,l,o as u,p as d,s as f}from"./web.DD6VKaIp.js";import{a as p,i as m,n as h,o as g}from"./i18n.DeOz3HxE.js";import{n as _}from"./api.B03e8F6d.js";var v=a(`<style>
|
|
2
2
|
#admin-bar {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.DeOz3HxE.js";import{n as g}from"./api.B03e8F6d.js";import{t as _}from"./Modal.C6l3xeBc.js";var v=o(`<div class="notice notice--error">`),y=o(`<div class="notice notice--success">`),b=o(`<section class=card><h3></h3><form class=resource-form><label><!$><!/><input class=input required type=text></label><label><!$><!/><select class=input></select></label><label><!$><!/><input class=input type=datetime-local></label><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted></p><div><button class="btn btn-primary"type=submit></button> <button class=btn type=button>`),x=o(`<div class=table-scroll><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),S=o(`<div class=modal-body><div class="notice notice--error"></div><label><!$><!/><input class=input readonly type=text data-testid=api-key-plaintext></label><p class=muted></p><pre class=api-key-sample><code></code></pre><div><button class="btn btn-primary"type=button></button> <button class=btn type=button>`),C=o(`<div class="resource-hub api-keys-manager"><!$><!/><!$><!/><div class=card-header-row><div><h3></h3><p class=muted></p></div><button class="btn btn-primary"type=button></button></div><!$><!/><section class=card></section><!$><!/><style>.api-key-sample{background:var(--color-surface-muted,#f5f5f5);border:1px solid var(--color-border,#dcdcde);border-radius:4px;padding:.6rem;overflow:auto;font-size:.8rem;white-space:pre-wrap;word-break:break-all}.api-keys-manager .modal-body{display:grid;gap:.75rem;padding:1rem}`),w=o(`<option value>`),T=o(`<option><!$><!/> (<!$><!/>)`),E=o(`<p>`),D=o(`<span>`),O=o(`<button class="btn btn-danger"type=button>`),k=o(`<tr><td></td><td></td><td><code>okcms_<!$><!/>_…</code></td><td></td><td></td><td>`),A=o(`<span class="notice notice--error">`),j=e=>({name:``,userId:e,oneTime:!1,expiresAt:``});function M(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}function N(){let{t:o}=h(),[s,N]=n([]),[P,F]=n([]),[I,L]=n(null),[R,z]=n(null),[B,V]=n(``),[H,U]=n(``),[W,G]=n(!0),[K,q]=n(!1),J=async()=>{G(!0);try{let e=await g.getApiKeys();N(e)}catch(e){V(e instanceof Error?e.message:String(e))}finally{G(!1)}};e(()=>{J(),g.listUsers({limit:100,status:`ACTIVE`}).then(e=>F(e.data??[])).catch(()=>F([]))});let Y=()=>{V(``),U(``),L(j(P()[0]?.id??``))},ee=async e=>{e.preventDefault();let t=I();if(t){if(!t.name.trim()){V(o(`apiKeys.errors.nameRequired`));return}try{let e={name:t.name.trim(),oneTime:t.oneTime};t.userId&&(e.userId=t.userId),t.expiresAt&&(e.expiresAt=new Date(t.expiresAt).toISOString());let n=await g.createApiKey(e);L(null),z(n),q(!1),await J()}catch(e){V(e instanceof Error?e.message:String(e))}}},te=async e=>{if(e.id){V(``);try{await g.deleteApiKey(e.id),U(o(`apiKeys.revoked`)),await J()}catch(e){V(e instanceof Error?e.message:String(e))}}},ne=async()=>{let e=R()?.plaintext;if(e)try{await navigator.clipboard.writeText(e),q(!0)}catch{q(!1)}},X=()=>{z(null),q(!1)},re=e=>{let t=P().find(t=>t.id===e.user_id);return t?t.name:e.user_id??`—`};return(()=>{var e=d(C),n=e.firstChild,[h,g]=p(n.nextSibling),j=h.nextSibling,[N,F]=p(j.nextSibling),z=N.nextSibling,V=z.firstChild,U=V.firstChild,G=U.nextSibling,q=V.nextSibling,J=z.nextSibling,[Z,ie]=p(J.nextSibling),Q=Z.nextSibling,ae=Q.nextSibling,[$,oe]=p(ae.nextSibling);return $.nextSibling,l(e,r(t,{get when(){return B()},get children(){var e=d(v);return l(e,B),e}}),h,g),l(e,r(t,{get when(){return H()},get children(){var e=d(y);return l(e,H),e}}),N,F),l(U,()=>o(`apiKeys.listTitle`)),l(G,()=>o(`apiKeys.howItWorks`)),q.$$click=Y,l(q,()=>o(`apiKeys.new`)),l(e,r(t,{get when(){return I()},get children(){var e=d(b),n=e.firstChild,s=n.nextSibling,m=s.firstChild,h=m.firstChild,[g,_]=p(h.nextSibling),v=g.nextSibling,y=m.nextSibling,x=y.firstChild,[S,C]=p(x.nextSibling),E=S.nextSibling,D=y.nextSibling,O=D.firstChild,[k,A]=p(O.nextSibling),j=k.nextSibling,M=D.nextSibling,N=M.firstChild,F=N.nextSibling.nextSibling,[R,z]=p(F.nextSibling),B=M.nextSibling,V=B.nextSibling.firstChild,H=V.nextSibling.nextSibling;return l(n,()=>o(`apiKeys.create`)),s.addEventListener(`submit`,ee),l(m,()=>o(`apiKeys.form.name`),g,_),v.$$input=e=>I()&&L({...I(),name:e.currentTarget.value}),l(y,()=>o(`apiKeys.form.user`),S,C),E.addEventListener(`change`,e=>I()&&L({...I(),userId:e.currentTarget.value})),l(E,r(t,{get when(){return P().length>0},get fallback(){return(()=>{var e=d(w);return l(e,()=>o(`apiKeys.form.currentUser`)),e})()},get children(){return r(a,{get each(){return P()},children:e=>(()=>{var t=d(T),n=t.firstChild,[r,a]=p(n.nextSibling),o=r.nextSibling.nextSibling,[s,c]=p(o.nextSibling);return s.nextSibling,l(t,()=>e.name,r,a),l(t,()=>e.email,s,c),i(()=>u(t,`value`,e.id)),t})()})}})),l(D,()=>o(`apiKeys.form.expiresAt`),k,A),j.$$input=e=>I()&&L({...I(),expiresAt:e.currentTarget.value}),N.addEventListener(`change`,e=>I()&&L({...I(),oneTime:e.currentTarget.checked})),l(M,()=>o(`apiKeys.form.oneTime`),R,z),l(B,()=>o(`apiKeys.form.oneTimeHint`)),l(V,()=>o(`apiKeys.createSubmit`)),H.$$click=()=>L(null),l(H,()=>o(`common.cancel`)),i(()=>f(v,`placeholder`,o(`apiKeys.form.namePlaceholder`))),i(()=>u(v,`value`,I()?.name??``)),i(()=>u(E,`value`,I()?.userId??``)),i(()=>u(j,`value`,I()?.expiresAt??``)),i(()=>u(N,`checked`,I()?.oneTime??!1)),c(),e}}),Z,ie),l(Q,r(t,{get when(){return!W()},get fallback(){return(()=>{var e=d(E);return l(e,()=>o(`apiKeys.loading`)),e})()},get children(){return r(t,{get when(){return s().length>0},get fallback(){return(()=>{var e=d(E);return l(e,()=>o(`apiKeys.empty`)),e})()},get children(){var e=d(x),n=e.firstChild.firstChild,i=n.firstChild.firstChild,u=i.nextSibling,f=u.nextSibling,h=f.nextSibling,g=h.nextSibling,_=g.nextSibling,v=n.nextSibling;return l(i,()=>o(`apiKeys.form.name`)),l(u,()=>o(`apiKeys.form.user`)),l(f,()=>o(`apiKeys.prefix`)),l(h,()=>o(`apiKeys.lastUsed`)),l(g,()=>o(`apiKeys.status`)),l(_,()=>o(`common.actions`)),l(v,r(a,{get each(){return s()},children:e=>(()=>{var n=d(k),i=n.firstChild,a=i.nextSibling,s=a.nextSibling,u=s.firstChild,f=u.firstChild.nextSibling,[h,g]=p(f.nextSibling);h.nextSibling;var _=s.nextSibling,v=_.nextSibling,y=v.nextSibling;return l(i,()=>e.name),l(a,()=>re(e)),l(u,()=>e.key_prefix,h,g),l(_,(()=>{var t=m(()=>!!e.last_used_at);return()=>t()?M(e.last_used_at):o(`apiKeys.neverUsed`)})()),l(v,r(t,{get when(){return!e.revoked_at},get fallback(){return(()=>{var e=d(A);return l(e,()=>o(`apiKeys.status.revoked`)),e})()},get children(){return r(t,{get when(){return m(()=>!!e.expires_at)()&&new Date(e.expires_at).getTime()<=Date.now()},get fallback(){return(()=>{var t=d(D);return l(t,(()=>{var t=m(()=>!!e.one_time);return()=>t()?o(`apiKeys.status.oneTime`):o(`apiKeys.status.active`)})()),t})()},get children(){var e=d(D);return l(e,()=>o(`apiKeys.status.expired`)),e}})}})),l(y,r(t,{get when(){return!e.revoked_at},get children(){var t=d(O);return t.$$click=()=>void te(e),l(t,()=>o(`apiKeys.revoke`)),c(),t}})),n})()})),e}})}})),l(e,r(_,{get open(){return!!R()},onClose:X,get title(){return o(`apiKeys.created.title`)},get children(){var e=d(S),t=e.firstChild,n=t.nextSibling,r=n.firstChild,[a,s]=p(r.nextSibling),f=a.nextSibling,h=n.nextSibling,g=h.nextSibling,_=g.firstChild,v=g.nextSibling.firstChild,y=v.nextSibling.nextSibling;return l(t,()=>o(`apiKeys.created.warning`)),l(n,()=>o(`apiKeys.created.value`),a,s),f.addEventListener(`focus`,e=>e.currentTarget.select()),l(h,()=>o(`apiKeys.created.howToUse`)),l(_,()=>`POST /api/v1/auth/api-key-login\n{ "apiKey": "${R()?.plaintext??``}" }`),v.$$click=()=>void ne(),l(v,(()=>{var e=m(()=>!!K());return()=>e()?o(`apiKeys.created.copied`):o(`apiKeys.created.copy`)})()),y.$$click=X,l(y,()=>o(`common.close`)),i(()=>u(f,`value`,R()?.plaintext??``)),c(),e}}),$,oe),c(),e})()}s([`click`,`input`]);export{N as ApiKeysManager};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,g as o,i as s,l as c,o as l,p as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,g as o,i as s,l as c,o as l,p as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.DeOz3HxE.js";import{n as f}from"./api.B03e8F6d.js";var p=a(`<div><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><style>
|
|
2
2
|
.dashboard-widget {
|
|
3
3
|
background: var(--color-surface);
|
|
4
4
|
border: 1px solid var(--color-border);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p}from"./web.DD6VKaIp.js";import{n as m}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p}from"./web.DD6VKaIp.js";import{n as m}from"./i18n.DeOz3HxE.js";import{n as h}from"./api.B03e8F6d.js";var g=o(`<div class="notice notice--error">`),_=o(`<div class=card><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),v=o(`<div class=comments-manager><!$><!/><div class=comments-tabs role=tablist><!$><!/><button type=button class="btn btn-secondary btn-sm comments-reload"></button></div><!$><!/><style>
|
|
2
2
|
.comments-tabs { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
|
|
3
3
|
.comments-tab {
|
|
4
4
|
display: inline-flex; align-items: center; gap: 0.4rem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ContentEditor.D5ceM2cx.js";export{e as ContentEditor};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h}from"./web.DD6VKaIp.js";import{n as g}from"./i18n.
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h}from"./web.DD6VKaIp.js";import{n as g}from"./i18n.DeOz3HxE.js";import{n as _}from"./api.B03e8F6d.js";import{n as v,t as ee}from"./FieldRenderer.2TxRD88c.js";import{c as y,n as b,o as x,t as S}from"./store.DJjOMYcw.js";var C=new Set(`a.abbr.b.blockquote.br.code.dd.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.li.ol.p.pre.q.s.span.strong.sub.sup.u.ul`.split(`.`)),w=new Set([`br`,`hr`,`img`]),T=new Set([`script`,`style`,`iframe`,`object`,`embed`,`svg`,`math`,`textarea`,`title`,`noscript`,`template`]),E=new Set([`class`,`title`,`alt`,`width`,`height`,`href`,`src`,`target`,`rel`]),D=new Set([`http`,`https`,`mailto`,`tel`]),O=new Set([`http`,`https`]),k={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,tab:` `,newline:`
|
|
2
2
|
`,sol:`/`,lpar:`(`,rpar:`)`,num:`#`,period:`.`,excl:`!`,comma:`,`};function A(e){return e.replace(/&#x([0-9a-fA-F]+);?/g,(e,t)=>j(parseInt(t,16))).replace(/&#(\d+);?/g,(e,t)=>j(parseInt(t,10))).replace(/&([a-zA-Z][a-zA-Z0-9]{1,30});?/g,(e,t)=>k[t in k?t:t.toLowerCase()]??e)}function j(e){if(!Number.isFinite(e)||e<0||e>1114111)return``;try{return String.fromCodePoint(e)}catch{return``}}function M(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function N(e){return e.replace(/&(?![a-zA-Z][a-zA-Z0-9]{1,30};|#[0-9]{1,7};|#[xX][0-9a-fA-F]{1,6};)|[<>]/g,e=>e===`&`?`&`:e===`<`?`<`:`>`)}function P(e,t){let n=A(e).replace(/[\t\n\r]/g,``).trim(),r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(n);return!r||t.has(r[1].toLowerCase())}function F(e){return M(A(e))}function I(e){let t=[],n=e.length,r=0,i=e=>e===` `||e===` `||e===`
|
|
3
3
|
`||e===`\r`||e===`\f`;for(;r<n;){for(;r<n&&(i(e.charAt(r))||e.charAt(r)===`/`);)r++;if(r>=n)break;let a=``;for(;r<n&&!i(e.charAt(r))&&e.charAt(r)!==`=`&&e.charAt(r)!==`>`&&e.charAt(r)!==`/`&&e.charAt(r)!==`<`;)a+=e.charAt(r),r++;if(!a){r++;continue}let o=``,s=r;for(;s<n&&i(e.charAt(s));)s++;if(s<n&&e.charAt(s)===`=`){for(s++;s<n&&i(e.charAt(s));)s++;if(s<n&&(e.charAt(s)===`"`||e.charAt(s)===`'`)){let t=e.charAt(s);s++;let r=s;for(;s<n&&e.charAt(s)!==t;)s++;o=e.slice(r,s),s++}else{let t=s;for(;s<n&&!i(e.charAt(s))&&e.charAt(s)!==`>`;)s++;o=e.slice(t,s)}r=s}t.push([a.toLowerCase(),o])}return t}function L(e,t){let n=[],r=new Set,i=!1;for(let[e,a]of t)if(E.has(e)&&!r.has(e)&&(e!==`href`||P(a,D))&&(e!==`src`||P(a,O))){if(e===`target`){if(F(a)!==`_blank`)continue;i=!0;continue}e!==`rel`&&(r.add(e),n.push(`${e}="${F(a)}"`))}return e===`a`&&i&&(n.push(`target="_blank"`),n.push(`rel="noopener noreferrer"`)),n.length>0?` ${n.join(` `)}`:``}function te(e){if(typeof e!=`string`||e.length===0)return``;let t=e.toLowerCase(),n=e.length,r=[],i=``,a=0;for(;a<n;){let o=e.indexOf(`<`,a);if(o===-1){i+=N(e.slice(a));break}if(o>a&&(i+=N(e.slice(a,o))),e.startsWith(`<!--`,o)){let t=e.indexOf(`-->`,o+4);a=t===-1?n:t+3;continue}if(e.charAt(o+1)===`!`||e.charAt(o+1)===`?`){let t=e.indexOf(`>`,o+2);a=t===-1?n:t+1;continue}let s=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)(?=[\s/>])/.exec(e.slice(o,Math.min(o+64,n)));if(!s){i+=`<`,a=o+1;continue}let c=s[1]===`/`,l=s[2].toLowerCase(),u=o+s[0].length,d=``;for(;u<n;){let t=e[u];if(d)t===d&&(d=``);else if(t===`"`||t===`'`)d=t;else if(t===`>`)break;u++}if(u>=n)break;let f=e.slice(o+s[0].length,u);if(a=u+1,!c&&T.has(l)){let r=t.indexOf(`</${l}`,a);if(r===-1)break;let i=e.indexOf(`>`,r);a=i===-1?n:i+1;continue}if(c){let e=r.lastIndexOf(l);if(e!==-1){for(let t=r.length-1;t>=e;t--)i+=`</${r[t]}>`;r.length=e}continue}if(!C.has(l))continue;let p=L(l,I(f));w.has(l)?i+=`<${l}${p} />`:(i+=`<${l}${p}>`,r.push(l))}for(let e=r.length-1;e>=0;e--)i+=`</${r[e]}>`;return i}var ne=s(`<div class="notice notice--success">`),re=s(`<input class=classic-editor__title required>`),ie=s(`<div class=classic-editor__toolbar role=toolbar><button type=button><strong>B</strong></button><button type=button><em>I</em></button><button type=button><u>U</u></button><span class=classic-editor__toolbar-divider></span><button type=button>❝</button><button type=button>• List</button><button type=button>1. List</button><button type=button>Link`),ae=s(`<div class=classic-editor__body data-classic-editor role=textbox aria-multiline=true>`),oe=s(`<div class="plugin-editor plugin-editor--below">`),se=s(`<label class=classic-editor__excerpt><span></span><textarea class=input rows=4>`),ce=s(`<section class="card custom-fields"><h3></h3><!$><!/>`),le=s(`<section class="card classic-editor__panel"><h3></h3><input class=input><p class=muted>`),ue=s(`<section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value></option><!$><!/>`),de=s(`<form class="content-editor classic-editor"><!$><!/><!$><!/><div class=classic-editor__topbar><div><span class=classic-editor__eyebrow></span><h2></h2></div><div class=classic-editor__actions><a class="btn btn-secondary"></a><button type=submit class="btn btn-primary"></button></div></div><div class=classic-editor__columns><main class=classic-editor__main><section class="card classic-editor__canvas-card"><!$><!/><div class=classic-editor__permalink><span><!$><!/>:</span><input class=input></div><!$><!/><!$><!/><!$><!/></section><!$><!/><!$><!/></main><aside class=classic-editor__sidebar><section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value=DRAFT></option><option value=PUBLISHED></option><option value=ARCHIVED></option></select></label><button type=submit class="btn btn-primary classic-editor__full-button"></button></section><!$><!/><!$><!/><!$><!/></aside></div><!$><!/>`),fe=s(`<div class="notice notice--error">`),pe=s(`<div class=plugin-editor>`),me=s(`<option>`);function R(s){let{t:c}=g(),[C,w]=r([]),[T,E]=r([]),[D,O]=r([]),[k,A]=r({}),[j,M]=r([]),[N,P]=r(!1),[F,I]=r(``),[L,R]=r(S()),[z,B]=r({type:s.initialType||`post`,title:``,status:`DRAFT`}),V=()=>new Set(C().find(e=>e.slug===z().type)?.supports??[`title`,`editor`]),H=e=>V().has(e),U=n(()=>{let e=z().type;return(L().editors??[]).filter(t=>t.screens.includes(`*`)||t.screens.includes(e)).sort((e,t)=>(e.priority??0)-(t.priority??0))[0]??null}),he=()=>({editorId:U().id,contentType:z().type,contentId:z().id??``,body:G(),setBody:e=>A({...k(),content:e}),disabled:N()}),ge=(e,t)=>t||e[0]?.slug||`post`,_e=()=>{let e=new Set;for(let t of D())for(let n of t.manifest?.provides?.layouts??[])e.add(n);return[...e].sort()},W=async e=>{try{let t=typeof e==`string`?{type:e}:e,n=await _.getFieldGroups(t.type?t:void 0),r=await Promise.all(n.filter(e=>e.active).map(async e=>(await _.getFieldGroup(e.id)).fields??[]));E(v(r.flat()))}catch(e){M([e instanceof Error?e.message:String(e)])}};e(async()=>{b().then(R);let e=[];try{let[t,n]=await Promise.all([_.getContentTypes(),_.getThemes().catch(()=>[])]);e=t,w(t),O(n)}catch(e){M([e instanceof Error?e.message:String(e)])}let t=new URLSearchParams(window.location.search).get(`id`);if(t||s.singleton)try{let e=t?await _.getContentById(t):await _.getSingletonContent(z().type);if(!e){await W({type:z().type,status:z().status});return}let n=e;B({id:e.id,type:e.type,title:e.title,slug:e.slug,excerpt:e.excerpt,featuredImageId:n.featuredImageId??n.featured_image_id,status:e.status,layout:e.layout}),A(e.body??{})}catch(e){M([e instanceof Error?e.message:String(e)])}else e.some(e=>e.slug===z().type)||B({...z(),type:ge(e,s.initialType)});await W({type:z().type,slug:z().slug,status:z().status})});let G=()=>{let e=k().content;return typeof e==`string`?e:``},ve=e=>{A({...k(),content:e.innerHTML})},K=(e,t)=>{document.execCommand(e,!1,t);let n=document.querySelector(`[data-classic-editor]`);n&&ve(n)},ye=async e=>{e.preventDefault(),I(``),M([]),P(!0);try{let e={...z(),layout:z().layout||null,body:{...k(),content:te(G())},...H(`excerpt`)?{}:{excerpt:void 0},...H(`thumbnail`)?{}:{featuredImageId:void 0}},t=z().id?await _.updateContent(z().id,e):await _.createContent(e);B({...z(),id:t.id}),I(c(`content.editor.saved`))}catch(e){M([e instanceof Error?e.message:String(e)])}finally{P(!1)}};return(()=>{var e=f(de),n=e.firstChild,[r,s]=m(n.nextSibling),g=r.nextSibling,[_,v]=m(g.nextSibling),b=_.nextSibling,S=b.firstChild,w=S.firstChild,E=w.nextSibling,D=S.nextSibling.firstChild,O=D.nextSibling,M=b.nextSibling,P=M.firstChild,I=P.firstChild,R=I.firstChild,[V,ge]=m(R.nextSibling),W=V.nextSibling,q=W.firstChild,be=q.firstChild,[xe,Se]=m(be.nextSibling);xe.nextSibling;var J=q.nextSibling,Ce=W.nextSibling,[we,Te]=m(Ce.nextSibling),Ee=we.nextSibling,[De,Oe]=m(Ee.nextSibling),ke=De.nextSibling,[Ae,je]=m(ke.nextSibling),Me=I.nextSibling,[Ne,Pe]=m(Me.nextSibling),Fe=Ne.nextSibling,[Ie,Le]=m(Fe.nextSibling),Y=P.nextSibling,Re=Y.firstChild,ze=Re.firstChild,X=ze.nextSibling,Be=X.firstChild,[Ve,He]=m(Be.nextSibling),Z=Ve.nextSibling,Q=Z.firstChild,Ue=Q.nextSibling,We=Ue.nextSibling,Ge=X.nextSibling,Ke=Re.nextSibling,[qe,Je]=m(Ke.nextSibling),Ye=qe.nextSibling,[$,Xe]=m(Ye.nextSibling),Ze=$.nextSibling,[Qe,$e]=m(Ze.nextSibling),et=M.nextSibling,[tt,nt]=m(et.nextSibling);return e.addEventListener(`submit`,ye),u(e,i(t,{get when(){return j().length>0},get children(){return i(o,{get each(){return j()},children:e=>(()=>{var t=f(fe);return u(t,e),t})()})}}),r,s),u(e,i(t,{get when(){return F()},get children(){var e=f(ne);return u(e,F),e}}),_,v),u(w,()=>C().find(e=>e.slug===z().type)?.singularLabel||z().type),u(E,(()=>{var e=h(()=>!!z().id);return()=>e()?c(`content.editor.editing`):c(`content.editor.adding`)})()),u(D,()=>c(`content.editor.backToList`)),u(O,(()=>{var e=h(()=>!!N());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(I,i(t,{get when(){return H(`title`)},get children(){var e=f(re);return e.$$input=e=>B({...z(),title:e.currentTarget.value}),a(t=>{var n=c(`content.editor.title`),r=c(`content.editor.titlePlaceholder`);return n!==t.e&&p(e,`aria-label`,t.e=n),r!==t.t&&p(e,`placeholder`,t.t=r),t},{e:void 0,t:void 0}),a(()=>d(e,`value`,z().title)),l(),e}}),V,ge),u(q,()=>c(`content.editor.slug`),xe,Se),J.$$input=e=>B({...z(),slug:e.currentTarget.value}),u(I,i(t,{get when(){return H(`editor`)},get children(){return i(t,{get when(){return U()?.mode!==`replace-body`},get fallback(){return(()=>{var e=f(pe);return u(e,i(y,{get componentId(){return U().componentId},get extraProps(){return he()}})),a(()=>p(e,`data-plugin-editor`,U().id)),e})()},get children(){return[(()=>{var e=f(ie),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling.nextSibling,o=i.nextSibling,s=o.nextSibling,u=s.nextSibling;return t.$$click=()=>K(`bold`),n.$$click=()=>K(`italic`),r.$$click=()=>K(`underline`),i.$$click=()=>K(`formatBlock`,`blockquote`),o.$$click=()=>K(`insertUnorderedList`),s.$$click=()=>K(`insertOrderedList`),u.$$click=()=>K(`createLink`,window.prompt(c(`content.editor.linkPrompt`))||``),a(()=>p(e,`aria-label`,c(`content.editor.toolbar`))),l(),e})(),(()=>{var e=f(ae);return e.$$input=e=>ve(e.currentTarget),p(e,`contenteditable`,!0),a(t=>{var n=c(`content.editor.bodyPlaceholder`),r=te(G());return n!==t.e&&p(e,`data-placeholder`,t.e=n),r!==t.t&&d(e,`innerHTML`,t.t=r),t},{e:void 0,t:void 0}),l(),e})()]}})}}),we,Te),u(I,i(t,{get when(){return U()?.mode===`below`},get children(){var e=f(oe);return u(e,i(y,{get componentId(){return U().componentId},get extraProps(){return he()}})),a(()=>p(e,`data-plugin-editor`,U().id)),e}}),De,Oe),u(I,i(t,{get when(){return H(`excerpt`)},get children(){var e=f(se),t=e.firstChild,n=t.nextSibling;return u(t,()=>c(`content.editor.excerpt`)),n.$$input=e=>B({...z(),excerpt:e.currentTarget.value}),a(()=>d(n,`value`,z().excerpt??``)),l(),e}}),Ae,je),u(P,i(t,{get when(){return T().length>0},get children(){var e=f(ce),t=e.firstChild,n=t.nextSibling,[r,a]=m(n.nextSibling);return u(t,()=>c(`content.editor.customFields`)),u(e,i(o,{get each(){return T()},children:e=>i(ee,{field:e,get values(){return k()},onChange:(e,t)=>A({...k(),[e]:t}),t:c})}),r,a),e}}),Ne,Pe),u(P,i(x,{get extensions(){return L()},get screen(){return z().type},context:`normal`}),Ie,Le),u(ze,()=>c(`content.editor.publishPanel`)),u(X,()=>c(`content.editor.status`),Ve,He),Z.addEventListener(`change`,e=>B({...z(),status:e.currentTarget.value})),u(Q,()=>c(`content.editor.statusOptions.draft`)),u(Ue,()=>c(`content.editor.statusOptions.published`)),u(We,()=>c(`content.editor.statusOptions.archived`)),u(Ge,(()=>{var e=h(()=>!!N());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(Y,i(t,{get when(){return H(`thumbnail`)},get children(){var e=f(le),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return u(t,()=>c(`content.editor.featuredImage`)),n.$$input=e=>B({...z(),featuredImageId:e.currentTarget.value}),u(r,()=>c(`content.editor.featuredImageHint`)),a(()=>p(n,`placeholder`,c(`content.editor.mediaIdPlaceholder`))),a(()=>d(n,`value`,z().featuredImageId??``)),l(),e}}),qe,Je),u(Y,i(t,{get when(){return _e().length>0},get children(){var e=f(ue),t=e.firstChild,n=t.nextSibling,r=n.firstChild,[s,l]=m(r.nextSibling),p=s.nextSibling,h=p.firstChild,g=h.nextSibling,[_,v]=m(g.nextSibling);return u(t,()=>c(`content.editor.pageAttributes`)),u(n,()=>c(`content.editor.layout`),s,l),p.addEventListener(`change`,e=>B({...z(),layout:e.currentTarget.value||null})),u(h,()=>c(`content.editor.layoutAuto`)),u(p,i(o,{get each(){return _e()},children:e=>(()=>{var t=f(me);return d(t,`value`,e),u(t,e),t})()}),_,v),a(()=>d(p,`value`,z().layout??``)),e}}),$,Xe),u(Y,i(x,{get extensions(){return L()},get screen(){return z().type},context:`side`}),Qe,$e),u(e,i(x,{get extensions(){return L()},get screen(){return z().type},context:`advanced`}),tt,nt),a(e=>{var t=`/content/${encodeURIComponent(z().type)}`,n=N(),r=c(`content.editor.slugPlaceholder`),i=N();return t!==e.e&&p(D,`href`,e.e=t),n!==e.t&&d(O,`disabled`,e.t=n),r!==e.a&&p(J,`placeholder`,e.a=r),i!==e.o&&d(Ge,`disabled`,e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a(()=>d(J,`value`,z().slug??``)),a(()=>d(Z,`value`,z().status)),l(),e})()}c([`input`,`click`]);export{R as t};
|
package/dist/client/_astro/{ContentTypeWorkspace.xZAsn-ok.js → ContentTypeWorkspace.Pt26MjgI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,f as n,h as r,l as i,p as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u,u as d}from"./web.DD6VKaIp.js";import{n as f}from"./i18n.
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u,u as d}from"./web.DD6VKaIp.js";import{n as f}from"./i18n.DeOz3HxE.js";import{n as p}from"./api.B03e8F6d.js";import{c as m,i as h,n as g,o as _,r as v,s as ee,t as y}from"./src.CYKGYEyR.js";import{t as b}from"./ContentEditor.D5ceM2cx.js";import{c as x,n as S,r as te,t as C}from"./store.DJjOMYcw.js";var w=o(`<span class=muted>—`),T=o(`<span class=muted>`),E=o(`<span>`),D=o(`<div class=users-table__actions><a class="btn btn-secondary btn-sm"></a><!$><!/><!$><!/>`),ne=o(`<div class="notice notice--error">`),re=o(`<div class=notice>`),ie=o(`<div class=content-list><div class=content-list__heading><div><h2></h2><p class=muted></p></div><a class="btn btn-primary"></a></div><!$><!/><!$><!/><div class=toolbar><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);function O(e){return e}function k(e){let t=O(e).updated_at??O(e).updatedAt??O(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function A(o){let{t:d}=f(),[b,A]=r([]),[j,M]=r([]),[N,P]=r(0),[F,I]=r(1),[L,R]=r(``),[z]=r(o.contentType),[B,V]=r(``),[H,U]=r(``),[W,G]=r(``),[K,q]=r(``),[J,Y]=r(C()),X=async()=>{try{let e=await p.getContent({page:F(),limit:20,type:z()||void 0,status:B()||void 0,search:L()||void 0});A(e.data??[]),P(e.total??0)}catch(e){U(e instanceof Error?e.message:String(e))}};e(async()=>{S().then(Y);let e=new URLSearchParams(window.location.search);V(e.get(`status`)??``),R(e.get(`search`)??``),await X();try{M(await p.getContentTypes())}catch{}});let Z=n(()=>j().find(e=>e.slug===z())),ae=n(()=>Z()?.pluralLabel||d(`content.list.title`)),oe=n(()=>`/content/${encodeURIComponent(z())}/new`),Q=async()=>{I(1),await X()},$=async e=>{let t=O(e).status===`PUBLISHED`;q(e.id),U(``),G(``);try{await p.publishToggle(e.id,t),G(d(t?`content.list.toasts.unpublished`:`content.list.toasts.published`)),await X()}catch(e){U(e instanceof Error?e.message:String(e))}finally{q(``)}},se=async e=>{let t=String(O(e).title??e.id);if(confirm(d(`content.list.confirmDelete`,{title:t})))try{await p.deleteContent(e.id),await X()}catch(e){U(e instanceof Error?e.message:String(e))}},ce=n(()=>{let e=J().columns[z()]??[],t=J().columnRenderers[z()]??{},n=e=>({key:e.key,label:e.label,render:(n,r)=>{let a=t[e.key];if(a){let e=a.split(`:`)[0]??``;return i(x,{componentId:a,plugin:e,extraProps:{row:r}})}let o=r[e.key];return o==null?c(w):typeof o==`object`?(()=>{var e=c(T);return s(e,()=>JSON.stringify(o)),e})():(()=>{var e=c(E);return s(e,()=>String(o)),e})()}}),r=e.filter(e=>e.position===`before_title`).map(n),o=e.filter(e=>e.position===`after_title`).map(n),f=e.filter(e=>!e.position).map(n),p=e.filter(e=>e.position===`end`).map(n),m=[{key:`title`,label:d(`content.list.columns.title`)},{key:`type`,label:d(`content.list.columns.type`)},{key:`status`,label:d(`content.list.columns.status`),render:(e,t)=>{let n=String(t.status??``);return i(y,{variant:n===`PUBLISHED`?`success`:n===`ARCHIVED`?`warning`:`secondary`,children:n})}},{key:`updated_at`,label:d(`content.list.columns.updated`),render:(e,t)=>(()=>{var e=c(T);return s(e,()=>k(t)),e})()},{key:`actions`,label:``,render:(e,t)=>{let n=t,r=O(n).status===`PUBLISHED`;return(()=>{var e=c(D),t=e.firstChild,o=t.nextSibling,[f,p]=u(o.nextSibling),m=f.nextSibling,[h,_]=u(m.nextSibling);return s(t,()=>d(`content.list.actions.edit`)),s(e,i(g,{variant:r?`secondary`:`primary`,size:`sm`,get loading(){return K()===n.id},onClick:()=>void $(n),get children(){return d(r?`content.list.actions.unpublish`:`content.list.actions.publish`)}}),f,p),s(e,i(g,{variant:`danger`,size:`sm`,onClick:()=>void se(n),get children(){return d(`content.list.actions.delete`)}}),h,_),a(()=>l(t,`href`,`/content/${encodeURIComponent(n.type||z())}/edit?id=${encodeURIComponent(n.id)}`)),e})()}}];return[...r,m[0],...o,m[1],m[2],m[3],...f,m[4],...p]});return(()=>{var e=c(ie),n=e.firstChild,r=n.firstChild,o=r.firstChild,f=o.nextSibling,p=r.nextSibling,y=n.nextSibling,[x,S]=u(y.nextSibling),C=x.nextSibling,[w,T]=u(C.nextSibling),E=w.nextSibling,D=E.firstChild,[O,k]=u(D.nextSibling),A=O.nextSibling,[j,M]=u(A.nextSibling),P=j.nextSibling,[z,U]=u(P.nextSibling),G=E.nextSibling,[K,q]=u(G.nextSibling),Y=K.nextSibling,[Z,$]=u(Y.nextSibling);return s(o,ae),s(f,()=>d(`content.list.description`)),s(p,()=>d(`content.list.buttons.addNew`)),s(e,i(t,{get when(){return H()},get children(){var e=c(ne);return s(e,H),e}}),x,S),s(e,i(t,{get when(){return W()},get children(){var e=c(re);return s(e,W),e}}),w,T),s(E,i(h,{name:`search`,get placeholder(){return d(`content.list.filters.search`)},get value(){return L()},onInput:e=>{R(e),Q()}}),O,k),s(E,i(ee,{name:`status`,get placeholder(){return d(`content.list.filters.allStatus`)},get value(){return B()},get options(){return[{value:`DRAFT`,label:d(`content.list.statuses.draft`)},{value:`PUBLISHED`,label:d(`content.list.statuses.published`)},{value:`ARCHIVED`,label:d(`content.list.statuses.archived`)}]},onChange:e=>{V(e),Q()}}),j,M),s(E,i(g,{variant:`secondary`,onClick:()=>void Q(),get children(){return d(`content.list.buttons.search`)}}),z,U),s(e,i(te,{get extensions(){return J()}}),K,q),s(e,i(v,{get children(){return[i(m,{get columns(){return ce()},get data(){return b()},get emptyMessage(){return d(`content.list.empty`)}}),i(_,{get page(){return F()},limit:20,get total(){return N()},onPageChange:e=>{I(e),X()}})]}}),Z,$),a(()=>l(p,`href`,oe())),e})()}var j=o(`<div class="notice notice--error">`),M=o(`<div class=card>`);function N(n){let{t:a}=f(),[o,l]=r(null),[u,m]=r(``);return e(async()=>{try{let e=(await p.getContentTypes()).find(e=>e.slug===n.contentType);if(!e){m(a(`content.list.typeNotFound`));return}l(e)}catch(e){m(e instanceof Error?e.message:String(e))}}),i(t,{get when(){return o()},get fallback(){return d(()=>!!u())()?(()=>{var e=c(j);return s(e,u),e})():(()=>{var e=c(M);return s(e,()=>a(`common.loading`)),e})()},children:e=>i(t,{get when(){return e().singleton},get fallback(){return i(A,{get contentType(){return e().slug}})},get children(){return i(b,{get initialType(){return e().slug},singleton:!0})}})})}export{N as ContentTypeWorkspace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.DeOz3HxE.js";import{n as f}from"./api.B03e8F6d.js";var p=o(`<div class="notice notice--error">`),m=o(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),h=o(`<div class=dashboard-home><!$><!/><div class=stats-grid><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div></div><div class=card><div class=card-header><h3></h3><a href=/content/post class="btn btn-secondary btn-sm"></a></div><!$><!/>`),g=o(`<p class=muted>`),_=o(`<tr><td><a></a></td><td></td><td></td><td class=muted>`);function v(e){return e}function y(e){let t=v(e).updated_at??v(e).updatedAt??v(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function b(){let{t:o}=d(),[b,x]=n({total:`—`,published:`—`,drafts:`—`,media:`—`,users:`—`}),[S,C]=n([]),[w,T]=n(``);return e(async()=>{let[e,t,n,r,i,a]=await Promise.allSettled([f.getContent({limit:1}),f.getContent({limit:1,status:`PUBLISHED`}),f.getContent({limit:1,status:`DRAFT`}),f.listMedia({limit:1}),f.listUsers({limit:1}),f.getContent({limit:5})]),o=e=>e.status===`fulfilled`?String(e.value.total):`?`;x({total:o(e),published:o(t),drafts:o(n),media:o(r),users:o(i)}),a.status===`fulfilled`?C(a.value.data??[]):T(a.reason instanceof Error?a.reason.message:String(a.reason))}),(()=>{var e=c(h),n=e.firstChild,[d,f]=u(n.nextSibling),x=d.nextSibling,C=x.firstChild,T=C.firstChild,E=T.nextSibling,D=C.nextSibling,O=D.firstChild,k=O.nextSibling,A=D.nextSibling,j=A.firstChild,M=j.nextSibling,N=A.nextSibling,P=N.firstChild,F=P.nextSibling,I=N.nextSibling.firstChild,L=I.nextSibling,R=x.nextSibling,z=R.firstChild,B=z.firstChild,V=B.nextSibling,H=z.nextSibling,[U,W]=u(H.nextSibling);return s(e,r(t,{get when(){return w()},get children(){var e=c(p);return s(e,w),e}}),d,f),s(T,()=>o(`dashboard.stats.totalContent`)),s(E,()=>b().total),s(O,()=>o(`dashboard.stats.published`)),s(k,()=>b().published),s(j,()=>o(`dashboard.stats.drafts`)),s(M,()=>b().drafts),s(P,()=>o(`dashboard.stats.mediaFiles`)),s(F,()=>b().media),s(I,()=>o(`dashboard.stats.users`)),s(L,()=>b().users),s(B,()=>o(`dashboard.recent.title`)),s(V,()=>o(`dashboard.recent.viewAll`)),s(R,r(t,{get when(){return S().length>0},get fallback(){return(()=>{var e=c(g);return s(e,()=>o(`dashboard.recent.empty`)),e})()},get children(){var e=c(m),t=e.firstChild,n=t.firstChild.firstChild,u=n.nextSibling,d=u.nextSibling,f=d.nextSibling,p=t.nextSibling;return s(n,()=>o(`dashboard.recent.columns.title`)),s(u,()=>o(`dashboard.recent.columns.type`)),s(d,()=>o(`dashboard.recent.columns.status`)),s(f,()=>o(`dashboard.recent.columns.updated`)),s(p,r(a,{get each(){return S()},children:e=>(()=>{var t=c(_),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.nextSibling,u=o.nextSibling;return s(r,()=>String(v(e).title??`—`)),s(a,()=>String(v(e).type??`—`)),s(o,()=>String(v(e).status??`—`)),s(u,()=>y(e)),i(()=>l(r,`href`,`/content/${encodeURIComponent(String(v(e).type??`post`))}/edit?id=${encodeURIComponent(String(v(e).id??``))}`)),t})()})),e}}),U,W),e})()}export{b as DashboardHome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./i18n.
|
|
1
|
+
import{t as e}from"./i18n.DeOz3HxE.js";import{n as t,t as n}from"./api.B03e8F6d.js";import{t as r}from"./lucide.s17cczpi.js";import{t as i}from"./iconsAndAliases.ujTnkhnl.js";(async()=>{let e=document.querySelector(`.layout`)?.dataset.sessionState??`unavailable`;if(e!==`authenticated`){if(e===`anonymous`){window.location.replace(`/login`);return}await t.checkSession()===`unauthenticated`&&window.location.replace(`/login`)}})(),t.installProactiveRefresh(),t.ensureFreshSession();var a=null,o=null,s=e=>{a||(a=document.createElement(`div`),a.className=`okcms-rate-limit-notice`,a.setAttribute(`role`,`status`),a.setAttribute(`aria-live`,`polite`),document.body.append(a)),o&&(a.textContent=e?o(`rateLimit.noticeRetry`,{seconds:e}):o(`rateLimit.notice`)),a.classList.add(`visible`),setTimeout(()=>a?.classList.remove(`visible`),Math.min(1e4,(e??5)*1e3+4e3))};window.addEventListener(n,e=>{s(e.detail?.retryAfter??null)}),(async()=>{try{let t=document.documentElement.lang||`en`;o=await e(t)}catch{}})();try{localStorage.getItem(`sidebar-collapsed`)===`true`&&document.body.classList.add(`sidebar-collapsed`)}catch{}var c=()=>{document.querySelectorAll(`[data-nav-group]`).forEach(e=>{let t=e.querySelector(`:scope > .nav-group-header .nav-group-toggle`);t&&t.dataset.bound!==`true`&&(t.dataset.bound=`true`,t.addEventListener(`click`,()=>{let n=!e.classList.contains(`open`);e.classList.toggle(`open`,n),t.setAttribute(`aria-expanded`,String(n))}))})},l=(e,t,n=`nav-item`,r)=>{let i=document.createElement(`a`);return i.className=n,i.href=t,i.textContent=e,r&&(i.dataset.sidebarI18n=r),i},u=async()=>{let e=document.querySelector(`[data-post-types-menu]`);if(e)try{let[n,a]=await Promise.all([t.getContentTypes(),t.getTaxonomies().catch(()=>[])]);e.replaceChildren();let o=new URLSearchParams(window.location.search);for(let t of n){let n=document.createElement(`div`);n.className=`nav-type-entry`;let r=document.createElement(`div`);r.className=`nav-type-row`;let i=l(t.pluralLabel||t.name,`/content/${encodeURIComponent(t.slug)}`,`nav-item nav-type-link`);i.classList.toggle(`active`,window.location.pathname.startsWith(`/content/${t.slug}`));let s=document.createElement(`i`);s.dataset.lucide=t.menuIcon||`box`,s.className=`nav-type-icon`,s.setAttribute(`aria-hidden`,`true`),i.prepend(s),r.append(i);let c=a.filter(e=>e.attachTo?.includes(t.slug));if(n.append(r),c.length>0){let e=document.createElement(`div`);e.className=`nav-taxonomy-menu`;let r=o.get(`type`)===t.slug||window.location.pathname.startsWith(`/content/${t.slug}`),a=document.createElement(`span`);a.className=`nav-type-caret`,a.setAttribute(`aria-hidden`,`true`),a.textContent=`▾`,i.classList.add(`has-taxonomies`),i.append(a);let s=t=>{e.classList.toggle(`open`,t),i.classList.toggle(`is-expanded`,t)};s(r),i.addEventListener(`click`,()=>s(!0));for(let n of c){let r=l(n.labels?.plural_name??n.labels?.name??n.name,`/content/${encodeURIComponent(t.slug)}/taxonomy?taxonomy=${encodeURIComponent(n.slug)}`,`nav-subitem nav-taxonomy-item`),i=new URL(r.href,window.location.origin);r.classList.toggle(`active`,window.location.pathname===i.pathname&&o.get(`taxonomy`)===n.slug),e.append(r)}n.append(e)}e.append(n)}r({icons:i})}catch{}};c();{let e=document.querySelector(`[data-nav-group="settings"]`);(e?.querySelector(`:scope > .nav-group-header a.nav-item`))?.addEventListener(`click`,()=>e?.classList.add(`open`))}r({icons:i}),u(),window.addEventListener(`okcms:content-models-changed`,()=>void u());var d=async t=>{let n=await e(t);document.querySelectorAll(`[data-sidebar-i18n]`).forEach(e=>{let t=e.dataset.sidebarI18n;t&&(e.textContent=n(t))})};window.addEventListener(`okcms:locale-changed`,e=>{let t=e.detail?.locale;t&&d(t)});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,p as u,r as d,u as f,x as p}from"./solid.Ck4Vtfe4.js";import{_ as m,a as h,f as g,i as _,l as v,m as y,o as b,p as x,r as S,s as C,u as w,v as T}from"./web.DD6VKaIp.js";import{n as E}from"./i18n.LMZI7jyc.js";import{t as D}from"./preload-helper.oCYlU9a4.js";import{n as O}from"./api.B03e8F6d.js";import{t as k}from"./FloatingPanel.BetdW5N2.js";import{t as A}from"./lucide.s17cczpi.js";import{t as ee}from"./iconsAndAliases.ujTnkhnl.js";import{t as te}from"./FbIcon.Bn4e_qFb.js";var ne=m(`<div class=fb-tabs><div class=fb-tabs__list role=tablist></div><div class=fb-tabs__panel role=tabpanel>`),re=m(`<span class=fb-tabs__badge>`),ie=m(`<button type=button role=tab class=fb-tabs__tab><span></span><!$><!/>`);function ae(e){return(()=>{var t=b(ne),n=t.firstChild,i=n.nextSibling;return v(n,l(d,{get each(){return e.tabs},children:t=>(()=>{var n=b(ie),i=n.firstChild,a=i.nextSibling,[o,s]=C(a.nextSibling);return n.$$click=()=>e.onChange(t.id),v(i,()=>t.label),v(n,l(r,{get when(){return t.badge},get children(){var e=b(re);return v(e,()=>t.badge),e}}),o,s),u(r=>{var i=e.active===t.id,a=!!t.disabled,o=e.active===t.id,s=t.disabled;return i!==r.e&&n.classList.toggle(`is-active`,r.e=i),a!==r.t&&n.classList.toggle(`is-disabled`,r.t=a),o!==r.a&&x(n,`aria-selected`,r.a=o),s!==r.o&&y(n,`disabled`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),g(),n})()})),v(i,()=>e.children),u(()=>x(n,`aria-label`,e.ariaLabel)),t})()}h([`click`]);var oe=Symbol.for(`preact-signals`);function se(){if(F>1){F--;return}let e,t=!1;for((function(){let e=le;for(le=void 0;e!==void 0;){let t=e.S;if(t.v===e.v)for(let n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();N!==void 0;){let n=N;for(N=void 0,ue++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ge(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ue=0,F--,t)throw e}function j(e){if(F>0)return e();fe=++de,F++;try{return e()}finally{se()}}var M,ce,N;function P(e){let t=M,n=ce;M=void 0,ce=void 0;try{return e()}finally{M=t,ce=n}}var le,F=0,ue=0,de=0,fe=0,pe=0;function me(e){if(M===void 0)return;let t=e.n;if(t===void 0||t.t!==M)return t={i:0,S:e,p:M.s,n:void 0,t:M,e:void 0,x:void 0,r:t},M.s!==void 0&&(M.s.n=t),M.s=t,e.n=t,32&M.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=M.s,t.n=void 0,M.s.n=t,M.s=t),t}function I(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}I.prototype.brand=oe,I.prototype.h=function(){return!0},I.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?P(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},I.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&P(()=>{var e;(e=this.Z)==null||e.call(this)}))}},I.prototype.subscribe=function(e){return Te(()=>{let t=this.value;P(()=>e(t))},{name:`sub`})},I.prototype.valueOf=function(){return this.value},I.prototype.toString=function(){return this.value+``},I.prototype.toJSON=function(){return this.value},I.prototype.peek=function(){return P(()=>this.value)},Object.defineProperty(I.prototype,"value",{get(){let e=me(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ue>100)throw Error(`Cycle detected`);(function(e){F!==0&&ue===0&&e.l!==fe&&(e.l=fe,le={S:e,v:e.v,i:e.i,o:le})})(this),this.v=e,this.i++,pe++,F++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{se()}}}});function he(e,t){return new I(e,t)}function ge(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function _e(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ve(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function ye(e,t){I.call(this,void 0,t),this.x=e,this.s=void 0,this.g=pe-1,this.f=4}ye.prototype=new I,ye.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===pe))return!0;if(this.g=pe,this.f|=1,this.i>0&&!ge(this))return this.f&=-2,!0;let e=M;try{_e(this),M=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return M=e,ve(this),this.f&=-2,!0},ye.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}I.prototype.S.call(this,e)},ye.prototype.U=function(e){if(this.t!==void 0&&(I.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ye.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(ye.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=me(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function be(e,t){return new ye(e,t)}function xe(e){let t=e.m;if(e.m=void 0,typeof t==`function`){F++;let n=M;M=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Se(e),t}finally{M=n,se()}}}function Se(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,xe(e)}function Ce(e){if(M!==this)throw Error(`Out-of-order effect`);ve(this),M=e,this.f&=-2,8&this.f&&Se(this),se()}function we(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ce&&ce.push(this)}we.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},we.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,xe(this),_e(this),F++;let e=M;return M=this,Ce.bind(this,e)},we.prototype.N=function(){2&this.f||(this.f|=2,this.u=N,N=this)},we.prototype.d=function(){this.f|=8,1&this.f||Se(this)},we.prototype.dispose=function(){this.d()};function Te(e,t){let n=new we(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ee=Object.create,De=Object.defineProperty,Oe=Object.defineProperties,ke=Object.getOwnPropertyDescriptor,Ae=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,Pe=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Fe=e=>{throw TypeError(e)},Ie=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Le=(e,t)=>{for(var n in t||={})Me.call(t,n)&&Ie(e,n,t[n]);if(je)for(var n of je(t))Ne.call(t,n)&&Ie(e,n,t[n]);return e},Re=(e,t)=>Oe(e,Ae(t)),ze=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Be=e=>[,,,Ee(e?.[Pe(`metadata`)]??null)],Ve=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],He=e=>e!==void 0&&typeof e!=`function`?Fe(`Function expected`):e,Ue=(e,t,n,r,i)=>({kind:Ve[e],name:t,metadata:r,addInitializer:e=>n._?Fe(`Already initialized`):i.push(He(e||null))}),We=(e,t)=>Ie(t,Pe(`metadata`),e[3]),Ge=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Ke=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=Ve[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&ke(d<4?i:{get[n](){return Ye(this,a)},set[n](e){return Ze(this,a,e)}},n));d?p&&d<4&&ze(a,(d>2?`set `:d>1?`get `:``)+n):ze(i,n);for(var y=r.length-1;y>=0;y--)l=Ue(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Je(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Ye:Qe)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Ze(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?He(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Fe(`Object expected`):(He(o=s.get)&&(v.get=o),He(o=s.set)&&(v.set=o),He(o=s.init)&&g.unshift(o));return d||We(e,i),v&&De(i,n,v),p?d^4?a:v:i},qe=(e,t,n)=>t.has(e)||Fe(`Cannot `+n),Je=(e,t)=>Object(t)===t?e.has(t):Fe(`Cannot use the "in" operator on this value`),Ye=(e,t,n)=>(qe(e,t,`read from private field`),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?Fe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,r)=>(qe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(qe(e,t,`access private method`),n);function $e(e,t){if(t){let n;return be(()=>{let r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return be(e)}function et(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e==`function`&&typeof t==`function`)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((e,n)=>!et(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(n=>!et(e[n],t[n]))}return!1}function L({get:e},t){return{init(e){return he(e)},get(){return e.call(this).value},set(t){let n=e.call(this);n.peek()!==t&&(n.value=t)}}}function R(e,t){let n=new WeakMap;return function(){let t=n.get(this);return t||(t=$e(e.bind(this)),n.set(this,t)),t.value}}function tt(e=!0){return function(t,n){n.addInitializer(function(){let t=n.kind===`field`||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,Re(Le({},r),{enumerable:e}))})}}function nt(...e){let t=e.map(e=>Te(e));return()=>t.forEach(e=>e())}var rt,it,at,ot,st,ct=[L],lt,ut,dt,ft,pt,z,mt,ht,gt,_t,vt,yt,bt,xt;st=[L],ot=[L],at=[tt()],it=[tt()],rt=[tt()];var St=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ge(lt,5,this),Xe(this,z),Xe(this,ut,Ge(lt,8,this)),Ge(lt,11,this),Xe(this,mt,Ge(lt,12,this)),Ge(lt,15,this),Xe(this,vt,Ge(lt,16,this)),Ge(lt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Ye(this,z,bt)}get initial(){return Ye(this,z,ft)}get previous(){return Ye(this,z,gt)}set current(e){let t=P(()=>Ye(this,z,bt));e&&t&&this.equals(t,e)||j(()=>{Ye(this,z,ft)||Ze(this,z,e,pt),Ze(this,z,t,_t),Ze(this,z,e,xt)})}reset(e=this.defaultValue){j(()=>{Ze(this,z,void 0,_t),Ze(this,z,e,pt),Ze(this,z,e,xt)})}};lt=Be(null),ut=new WeakMap,z=new WeakSet,mt=new WeakMap,vt=new WeakMap,dt=Ke(lt,20,`#initial`,ct,z,ut),ft=dt.get,pt=dt.set,ht=Ke(lt,20,`#previous`,st,z,mt),gt=ht.get,_t=ht.set,yt=Ke(lt,20,`#current`,ot,z,vt),bt=yt.get,xt=yt.set,Ke(lt,2,`current`,at,St),Ke(lt,2,`initial`,it,St),Ke(lt,2,`previous`,rt,St),We(lt,St);function Ct(e){return P(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var wt,Tt=class{constructor(){Xe(this,wt,new WeakMap)}get(e,t){return e?Ye(this,wt).get(e)?.get(t):void 0}set(e,t,n){if(e)return Ye(this,wt).has(e)||Ye(this,wt).set(e,new Map),Ye(this,wt).get(e)?.set(t,n)}clear(e){return e?Ye(this,wt).get(e)?.clear():void 0}};wt=new WeakMap;var Et=Object.create,Dt=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,kt=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Mt=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Nt=e=>{throw TypeError(e)},Pt=Math.pow,Ft=(e,t,n)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,It=(e,t)=>{for(var n in t||={})At.call(t,n)&&Ft(e,n,t[n]);if(kt)for(var n of kt(t))jt.call(t,n)&&Ft(e,n,t[n]);return e},Lt=(e,t)=>Dt(e,`name`,{value:t,configurable:!0}),Rt=e=>[,,,Et(e?.[Mt(`metadata`)]??null)],zt=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Bt=e=>e!==void 0&&typeof e!=`function`?Nt(`Function expected`):e,Vt=(e,t,n,r,i)=>({kind:zt[e],name:t,metadata:r,addInitializer:e=>n._?Nt(`Already initialized`):i.push(Bt(e||null))}),Ht=(e,t)=>Ft(t,Mt(`metadata`),e[3]),Ut=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Wt=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=zt[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Ot(d<4?i:{get[n](){return qt(this,a)},set[n](e){return Yt(this,a,e)}},n));d?p&&d<4&&Lt(a,(d>2?`set `:d>1?`get `:``)+n):Lt(i,n);for(var y=r.length-1;y>=0;y--)l=Vt(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Kt(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?qt:Xt)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Yt(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Bt(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Nt(`Object expected`):(Bt(o=s.get)&&(v.get=o),Bt(o=s.set)&&(v.set=o),Bt(o=s.init)&&g.unshift(o));return d||Ht(e,i),v&&Dt(i,n,v),p?d^4?a:v:i},Gt=(e,t,n)=>t.has(e)||Nt(`Cannot `+n),Kt=(e,t)=>Object(t)===t?e.has(t):Nt(`Cannot use the "in" operator on this value`),qt=(e,t,n)=>(Gt(e,t,`read from private field`),n?n.call(e):t.get(e)),Jt=(e,t,n)=>t.has(e)?Nt(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Yt=(e,t,n,r)=>(Gt(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Xt=(e,t,n)=>(Gt(e,t,`access private method`),n),Zt=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},Qt=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:r,left:i,width:a,height:o,scale:s}=this,c=new e(i+t,r+n,a,o);return c.scale=It({},s),c}get boundingRectangle(){let{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){let{left:e,top:t,right:n,bottom:r}=this;return new Zt((e+n)/2,(t+r)/2)}get area(){let{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;let{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){let{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?$t(this,t):0}intersectionRatio(e){let{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){let{top:e,height:t}=this;return e+t}get right(){let{left:e,width:t}=this;return e+t}get aspectRatio(){let{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:`center`,y:`center`}){let r=(e,t)=>{let r=n[t],i=t===`x`?e.left:e.top,a=t===`x`?e.width:e.height;return r==`start`?i:r==`end`?i+a:i+a/2};return Zt.delta({x:r(e,`x`),y:r(e,`y`)},{x:r(t,`x`),y:r(t,`y`)})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function $t(e,t){let 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),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;return r<i&&n<a?o*s:0}var en,tn,nn,rn,an,on=class extends (nn=St,tn=[R],en=[R],nn){constructor(e){let t=Zt.from(e);super(t,(e,t)=>Zt.equals(e,t)),Ut(an,5,this),Jt(this,rn,0),this.velocity={x:0,y:0}}get delta(){return Zt.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=Zt.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-qt(this,rn),o=e=>Math.round(e/a*100);j(()=>{Yt(this,rn,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(Zt.from(e)),this.velocity={x:0,y:0}}};an=Rt(nn),rn=new WeakMap,Wt(an,2,`delta`,tn,on),Wt(an,2,`direction`,en,on),Ht(an,on);function sn({x:e,y:t},n){let r=Math.abs(e),i=Math.abs(t);return typeof n==`number`?Math.sqrt(Pt(r,2)+Pt(i,2))>n:`x`in n&&`y`in n?r>n.x&&i>n.y:`x`in n?r>n.x:`y`in n&&i>n.y}var cn=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(cn||{}),ln=Object.values(cn),un=Object.create,dn=Object.defineProperty,fn=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,mn=Object.getOwnPropertyDescriptors,hn=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,vn=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),yn=e=>{throw TypeError(e)},bn=(e,t,n)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xn=(e,t)=>{for(var n in t||={})gn.call(t,n)&&bn(e,n,t[n]);if(hn)for(var n of hn(t))_n.call(t,n)&&bn(e,n,t[n]);return e},Sn=(e,t)=>fn(e,mn(t)),Cn=(e,t)=>dn(e,`name`,{value:t,configurable:!0}),wn=(e,t)=>{var n={};for(var r in e)gn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hn)for(var r of hn(e))t.indexOf(r)<0&&_n.call(e,r)&&(n[r]=e[r]);return n},Tn=e=>[,,,un(e?.[vn(`metadata`)]??null)],En=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Dn=e=>e!==void 0&&typeof e!=`function`?yn(`Function expected`):e,On=(e,t,n,r,i)=>({kind:En[e],name:t,metadata:r,addInitializer:e=>n._?yn(`Already initialized`):i.push(Dn(e||null))}),kn=(e,t)=>bn(t,vn(`metadata`),e[3]),B=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},V=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=En[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&pn(d<4?i:{get[n](){return H(this,a)},set[n](e){return Mn(this,a,e)}},n));d?p&&d<4&&Cn(a,(d>2?`set `:d>1?`get `:``)+n):Cn(i,n);for(var y=r.length-1;y>=0;y--)l=On(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>jn(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?H:Nn)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Mn(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Dn(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?yn(`Object expected`):(Dn(o=s.get)&&(v.get=o),Dn(o=s.set)&&(v.set=o),Dn(o=s.init)&&g.unshift(o));return d||kn(e,i),v&&dn(i,n,v),p?d^4?a:v:i},An=(e,t,n)=>t.has(e)||yn(`Cannot `+n),jn=(e,t)=>Object(t)===t?e.has(t):yn(`Cannot use the "in" operator on this value`),H=(e,t,n)=>(An(e,t,`read from private field`),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?yn(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Mn=(e,t,n,r)=>(An(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Nn=(e,t,n)=>(An(e,t,`access private method`),n);function Pn(e,t){return{plugin:e,options:t}}function Fn(e){return t=>Pn(e,t)}function In(e){return typeof e==`function`?{plugin:e,options:void 0}:e}var Ln=[L],Rn,zn,Bn,W=class{constructor(e,t){this.manager=e,this.options=t,U(this,zn,B(Rn,8,this,!1)),B(Rn,11,this),U(this,Bn,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return P(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=Te(e.bind(this));return H(this,Bn).add(t),t}destroy(){H(this,Bn).forEach(e=>e())}static configure(e){return Pn(this,e)}};Rn=Tn(null),zn=new WeakMap,Bn=new WeakMap,V(Rn,4,`disabled`,Ln,W,zn),kn(Rn,W);var Vn=class extends W{},Hn,Un=class{constructor(e){this.manager=e,this.instances=new Map,U(this,Hn,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(In).reduce((e,t)=>{let n=e.find(({plugin:e})=>e===t.plugin);return n?(n.options=t.options,e):[...e,t]},[]),n=t.map(({plugin:e})=>e);for(let e of H(this,Hn))if(!n.includes(e)){if(e.prototype instanceof Vn)continue;this.unregister(e)}for(let{plugin:e,options:n}of t)this.register(e,n);Mn(this,Hn,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Hn=new WeakMap;function Wn(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Gn=[],Kn,qn,Jn=class extends W{constructor(e){super(e),U(this,Kn),U(this,qn),this.computeCollisions=this.computeCollisions.bind(this),Mn(this,qn,he(Gn)),this.destroy=nt(()=>{let e=this.computeCollisions(),t=P(()=>this.manager.dragOperation.position.current);if(e!==Gn){let e=H(this,Kn);if(Mn(this,Kn,t),e&&t.x==e.x&&t.y==e.y)return}else Mn(this,Kn,void 0);H(this,qn).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){P(()=>{e?H(this,qn).value=this.computeCollisions():Mn(this,Kn,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:a,status:o}=r;if(!o.initialized||!a)return Gn;let s=[],c=[];for(let a of e??n.droppables){if(a.disabled||i&&!a.accepts(i))continue;let e=t??a.collisionDetector;if(!e)continue;c.push(a),a.shape;let n=P(()=>e({droppable:a,dragOperation:r}));n&&(a.collisionPriority!=null&&(n.priority=a.collisionPriority),s.push(n))}return c.length===0?Gn:(s.sort(Wn),s)}get collisions(){return H(this,qn).value}};Kn=new WeakMap,qn=new WeakMap;var Yn,Xn,Zn=[L],Qn,$n,er,tr,nr,rr,ir;Xn=[L],Yn=[L];var ar=class e{constructor(e,t){U(this,tr,B(er,8,this)),B(er,11,this),U(this,nr),U(this,rr,B(er,12,this)),B(er,15,this),U(this,ir,B(er,16,this)),B(er,19,this);let{effects:n,id:r,data:i={},disabled:a=!1,register:o=!0}=e,s=r;Mn(this,nr,he(r)),this.manager=t,this.data=i,this.disabled=a,this.effects=()=>[()=>{let{id:e,manager:t}=this;if(e!==s)return s=e,t?.registry.register(this),()=>t?.registry.unregister(this)},...n?.()??[]],this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&o&&queueMicrotask(this.register)}get id(){let t=H(this,nr).value;return e.pendingIdChanges?.get(this)??t}set id(t){t!==(e.pendingIdChanges?.get(this)??H(this,nr).peek())&&(e.pendingIdChanges||(e.pendingIdChanges=new Map,queueMicrotask(()=>{var t;return Nn(t=e,Qn,$n).call(t)})),e.pendingIdChanges.set(this,t))}register(){return this.manager?.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};er=Tn(null),Qn=new WeakSet,$n=function(){let e=ar.pendingIdChanges;ar.pendingIdChanges=null,e&&j(()=>{for(let[t,n]of e)H(t,nr).value=n})},tr=new WeakMap,nr=new WeakMap,rr=new WeakMap,ir=new WeakMap,V(er,4,`manager`,Zn,ar,tr),V(er,4,`data`,Xn,ar,rr),V(er,4,`disabled`,Yn,ar,ir),U(ar,Qn),kn(er,ar),ar.pendingIdChanges=null;var or=ar,sr=class{constructor(){this.map=he(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;r&&r.id===e&&(this.cleanupFunctions.get(r)?.(),this.cleanupFunctions.delete(r));let a=new Map(n);for(let[r,i]of n)if(i===t&&r!==e){a.delete(r);break}a.set(e,t),this.map.value=a;let o=nt(...t.effects());return this.cleanupFunctions.set(t,o),i},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;this.cleanupFunctions.get(t)?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this)this.cleanupFunctions.get(e)?.(),e.destroy();this.map.value=new Map}},cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr=class extends (mr=or,pr=[L],fr=[L],dr=[L],ur=[R],lr=[R],cr=[R],mr){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a,plugins:o,effects:s}=n,c=wn(n,[`modifiers`,`type`,`sensors`,`plugins`,`effects`]);super(Sn(xn({},c),{effects:()=>[...s?.()??[],()=>{let{manager:e,plugins:t}=this;if(e&&t)for(let n of t){let{plugin:t}=In(n);e.registry.plugins.register(t)}}]}),t),B(hr,5,this),U(this,gr,B(hr,8,this)),B(hr,11,this),U(this,_r,B(hr,12,this)),B(hr,15,this),U(this,vr,B(hr,16,this,this.isDragSource?`dragging`:`idle`)),B(hr,19,this),this.type=i,this.sensors=a,this.modifiers=r,this.alignment=c.alignment,this.plugins=o}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=In(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status===`dropping`&&this.isDragSource}get isDragging(){return this.status===`dragging`&&this.isDragSource}get isDragSource(){return this.manager?.dragOperation.source?.id===this.id}};hr=Tn(mr),gr=new WeakMap,_r=new WeakMap,vr=new WeakMap,V(hr,4,`type`,pr,yr,gr),V(hr,4,`modifiers`,fr,yr,_r),V(hr,4,`status`,dr,yr,vr),V(hr,2,`isDropping`,ur,yr),V(hr,2,`isDragging`,lr,yr),V(hr,2,`isDragSource`,cr,yr),kn(hr,yr);var br,xr,Sr,Cr,wr,Tr,Er,G,Dr,Or,kr,Ar,jr,Mr=class extends (Er=or,Tr=[L],wr=[L],Cr=[L],Sr=[L],xr=[L],br=[R],Er){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=wn(n,[`accept`,`collisionDetector`,`collisionPriority`,`type`]);super(s,t),B(G,5,this),U(this,Dr,B(G,8,this)),B(G,11,this),U(this,Or,B(G,12,this)),B(G,15,this),U(this,kr,B(G,16,this)),B(G,19,this),U(this,Ar,B(G,20,this)),B(G,23,this),U(this,jr,B(G,24,this)),B(G,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=a,this.type=o}accepts(e){let{accept:t}=this;return t?typeof t==`function`?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){return this.manager?.dragOperation.target?.id===this.id}};G=Tn(Er),Dr=new WeakMap,Or=new WeakMap,kr=new WeakMap,Ar=new WeakMap,jr=new WeakMap,V(G,4,`accept`,Tr,Mr,Dr),V(G,4,`type`,wr,Mr,Or),V(G,4,`collisionDetector`,Cr,Mr,kr),V(G,4,`collisionPriority`,Sr,Mr,Ar),V(G,4,`shape`,xr,Mr,jr),V(G,2,`isDropTarget`,br,Mr),kn(G,Mr);var Nr=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){let{registry:n}=this,r=n.get(e);if(r)for(let e of r)e(...t)}},Pr=class extends Nr{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function Fr(e,t=!0){let n=!1;return Sn(xn({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var Ir=class extends Vn{constructor(e){super(e);let t=(e,t)=>e.map(({id:e})=>e).join(``)===t.map(({id:e})=>e).join(``),n=[];this.destroy=nt(()=>{let{dragOperation:t,collisionObserver:r}=e;t.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:r,monitor:i}=e,{collisions:a}=r;if(r.isDisabled()||or.pendingIdChanges)return;let o=Fr({collisions:a});if(i.dispatch(`collision`,o),o.defaultPrevented||t(a,n))return;n=a;let[s]=a;P(()=>{s?.id!==e.dragOperation.target?.id&&(r.disable(),e.actions.setDropTarget(s?.id).then(()=>{r.enable()}))})})}},Lr=(e=>(e[e.Lowest=0]=`Lowest`,e[e.Low=1]=`Low`,e[e.Normal=2]=`Normal`,e[e.High=3]=`High`,e[e.Highest=4]=`Highest`,e))(Lr||{}),Rr=(e=>(e[e.Collision=0]=`Collision`,e[e.ShapeIntersection=1]=`ShapeIntersection`,e[e.PointerIntersection=2]=`PointerIntersection`,e))(Rr||{}),zr,Br,Vr,Hr,Ur,Wr,Gr=[L],Kr,qr;Wr=[R],Ur=[R],Hr=[R],Vr=[R],Br=[R],zr=[R];var Jr=class{constructor(){B(Kr,5,this),U(this,qr,B(Kr,8,this,`idle`)),B(Kr,11,this)}get current(){return this.value}get idle(){return this.value===`idle`}get initializing(){return this.value===`initializing`}get initialized(){let{value:e}=this;return e!==`idle`&&e!==`initialization-pending`}get dragging(){return this.value===`dragging`}get dropped(){return this.value===`dropped`}set(e){this.value=e}};Kr=Tn(null),qr=new WeakMap,V(Kr,4,`value`,Gr,Jr,qr),V(Kr,2,`current`,Wr,Jr),V(Kr,2,`idle`,Ur,Jr),V(Kr,2,`initializing`,Hr,Jr),V(Kr,2,`initialized`,Vr,Jr),V(Kr,2,`dragging`,Br,Jr),V(Kr,2,`dropped`,zr,Jr),kn(Kr,Jr);var Yr=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==`string`||typeof e==`number`?e:e.id}setDropTarget(e){return P(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let r=Fr({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch(`dragover`,r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return P(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw Error(`Cannot start a drag operation without a drag source`);if(!t.status.idle)throw Error(`Cannot start a drag operation while another is active`);let n=new AbortController,{event:r,coordinates:i}=e;j(()=>{t.status.set(`initialization-pending`),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(i)});let a=Fr({operation:t.snapshot()});return this.manager.monitor.dispatch(`beforedragstart`,a),a.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set(`initializing`),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;let{status:e}=t;e.current===`initializing`&&j(()=>{t.status.set(`dragging`),this.manager.monitor.dispatch(`dragstart`,{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),n)})}move(e){return P(()=>{let{dragOperation:t}=this.manager,{status:n,controller:r}=t;if(!n.dragging||!r||r.signal.aborted)return;let i=Fr({nativeEvent:e.event,operation:t.snapshot(),by:e.by,to:e.to},e.cancelable??!0);(e.propagate??!0)&&this.manager.monitor.dispatch(`dragmove`,i),queueMicrotask(()=>{if(i.defaultPrevented)return;let n=e.to??{x:t.position.current.x+(e.by?.x??0),y:t.position.current.y+(e.by?.y??0)};t.position.current=n})})}stop(e={}){return P(()=>{let{dragOperation:t}=this.manager,{controller:n}=t;if(!n||n.signal.aborted)return;let r,i=()=>{let e={resume:()=>{},abort:()=>{}};return r=new Promise((t,n)=>{e.resume=t,e.abort=n}),e};n.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{t.status.set(`dropped`);let e=P(()=>t.source?.status===`dropping`),r=()=>{t.controller===n&&(t.controller=void 0),t.reset()};if(e){let{source:e}=t,n=Te(()=>{e?.status===`idle`&&(n(),r())})}else this.manager.renderer.rendering.then(r)})};t.canceled=e.canceled??!1,this.manager.monitor.dispatch(`dragend`,{nativeEvent:e.event,operation:t.snapshot(),canceled:e.canceled??!1,suspend:i}),r?r.then(a).catch(()=>t.reset()):a()})}},Xr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Zr=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let t of e??[])t.controller=this}onEvent(e){if(!this.activated){if(this.constraints?.length)for(let t of this.constraints)t.onEvent(e);else this.activate(e)}}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Qr,$r=class{constructor(e){this.options=e,U(this,Qr)}set controller(e){Mn(this,Qr,e),e.signal.addEventListener(`abort`,()=>this.abort())}activate(e){var t;(t=H(this,Qr))==null||t.activate(e)}};Qr=new WeakMap;var ei=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},ti=class{constructor(e){this.draggables=new sr,this.droppables=new sr,this.plugins=new Un(e),this.sensors=new Un(e),this.modifiers=new Un(e)}register(e,t){if(e instanceof yr)return this.draggables.register(e.id,e);if(e instanceof Mr)return this.droppables.register(e.id,e);if(e.prototype instanceof ei)return this.modifiers.register(e,t);if(e.prototype instanceof Xr)return this.sensors.register(e,t);if(e.prototype instanceof W)return this.plugins.register(e,t);throw Error(`Invalid instance type`)}unregister(e){if(e instanceof or)return e instanceof yr?this.draggables.unregister(e.id,e):e instanceof Mr?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof ei)return this.modifiers.unregister(e);if(e.prototype instanceof Xr)return this.sensors.unregister(e);if(e.prototype instanceof W)return this.plugins.unregister(e);throw Error(`Invalid instance type`)}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},ni,ri,ii,ai,oi,si,ci,li,ui=[R],di,fi,pi,K,mi,hi,gi,_i,vi,yi;li=[L],ci=[L],si=[L],oi=[L],ai=[L],ii=[R],ri=[R],ni=[R];var bi=class{constructor(e){B(K,5,this),U(this,di),U(this,fi),U(this,pi,new St(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new Jr,U(this,mi,B(K,8,this,!1)),B(K,11,this),U(this,hi,B(K,12,this,null)),B(K,15,this),U(this,gi,B(K,16,this,null)),B(K,19,this),U(this,_i,B(K,20,this,null)),B(K,23,this),U(this,vi,B(K,24,this,[])),B(K,27,this),this.position=new on({x:0,y:0}),U(this,yi,{x:0,y:0}),Mn(this,di,e)}get shape(){let{current:e,initial:t,previous:n}=H(this,pi);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?H(this,pi).current=e:H(this,pi).reset()}get source(){let e=this.sourceIdentifier;if(e==null)return null;let t=H(this,di).registry.draggables.get(e);return t&&Mn(this,fi,t),t??H(this,fi)??null}get target(){let e=this.targetIdentifier;return e==null?null:H(this,di).registry.droppables.get(e)??null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let e of this.modifiers)n=e.apply(Sn(xn({},this.snapshot()),{transform:n}));return Mn(this,yi,n),n}snapshot(){return P(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:H(this,yi),shape:this.shape?Ct(this.shape):null,position:Ct(this.position),status:Ct(this.status),canceled:this.canceled}))}reset(){j(()=>{this.status.set(`idle`),this.sourceIdentifier=null,this.targetIdentifier=null,H(this,pi).reset(),this.position.reset({x:0,y:0}),Mn(this,yi,{x:0,y:0}),this.modifiers=[]})}};K=Tn(null),di=new WeakMap,fi=new WeakMap,pi=new WeakMap,mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,_i=new WeakMap,vi=new WeakMap,yi=new WeakMap,V(K,2,`shape`,ui,bi),V(K,4,`canceled`,li,bi,mi),V(K,4,`activatorEvent`,ci,bi,hi),V(K,4,`sourceIdentifier`,si,bi,gi),V(K,4,`targetIdentifier`,oi,bi,_i),V(K,4,`modifiers`,ai,bi,vi),V(K,2,`source`,ii,bi),V(K,2,`target`,ri,bi),V(K,2,`transform`,ni,bi),kn(K,bi);var xi={get rendering(){return Promise.resolve()}};function Si(e,t){return typeof e==`function`?e(t):e??t}var Ci=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};let t=e??{},n=Si(t.plugins,[]),r=Si(t.sensors,[]),i=Si(t.modifiers,[]),a=t.renderer??xi,o=new Pr(this),s=new ti(this);this.registry=s,this.monitor=o,this.renderer=a,this.actions=new Yr(this),this.dragOperation=new bi(this),this.collisionObserver=new Jn(this),this.plugins=[Ir,...n],this.modifiers=i,this.sensors=r;let{destroy:c}=this,l=nt(()=>{let e=P(()=>this.dragOperation.modifiers),t=this.modifiers;for(let n of e)t.includes(n)||n.destroy();this.dragOperation.modifiers=(this.dragOperation.source?.modifiers)?.map(e=>{let{plugin:t,options:n}=In(e);return new t(this,n)})??t});this.destroy=()=>{l(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},wi=e=>{throw TypeError(e)},Ti=(e,t,n)=>t.has(e)||wi(`Cannot `+n),q=(e,t,n)=>(Ti(e,t,`read from private field`),t.get(e)),Ei=(e,t,n)=>t.has(e)?wi(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Di=(e,t,n,r)=>(Ti(e,t,`write to private field`),t.set(e,n),n),Oi=(e,t,n)=>(Ti(e,t,`access private method`),n);function ki(e){return e?e instanceof KeyframeEffect||`getKeyframes`in e&&typeof e.getKeyframes==`function`:!1}function Ai(e,t){let n=e.getAnimations(),r=null;for(let e of n){if(e.playState!==`running`)continue;let{effect:n}=e,i=(ki(n)?n.getKeyframes():[]).filter(t);i.length>0&&(r=[i[i.length-1],e])}return r}function ji(e){let{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}function Mi(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ni(e){return`nodeType`in e}function Pi(e){return e?Mi(e)?e:Ni(e)?`defaultView`in e?e.defaultView??window:e.ownerDocument?.defaultView??window:window:window}function Fi(e){let{Document:t}=Pi(e);return e instanceof t||`nodeType`in e&&e.nodeType===Node.DOCUMENT_NODE}function Ii(e){return!e||Mi(e)?!1:e instanceof Pi(e).HTMLElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`html`)}function Li(e){return e instanceof Pi(e).SVGElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`svg`)}function Ri(e){return e?Mi(e)?e.document:Ni(e)?Fi(e)?e:Ii(e)||Li(e)?e.ownerDocument:document:document:document}function zi(e){let{documentElement:t}=Ri(e),n=Pi(e).visualViewport,r=n?.width??t.clientWidth,i=n?.height??t.clientHeight,a=n?.offsetTop??0,o=n?.offsetLeft??0;return{top:a,left:o,right:o+r,bottom:a+i,width:r,height:i}}function Bi(e,t){if(Vi(e)&&e.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n===`visible`&&r===`visible`&&i===`visible`}function Vi(e){return e.tagName===`DETAILS`}function Hi(e,t=e.getBoundingClientRect(),n=0){let r=t,{ownerDocument:i}=e,a=i.defaultView??window,o=e.parentElement;for(;o&&o!==i.documentElement;){if(!Bi(o)){let e=o.getBoundingClientRect(),t=n*(e.bottom-e.top),i=n*(e.right-e.left),a=n*(e.bottom-e.top),s=n*(e.right-e.left);r={top:Math.max(r.top,e.top-t),right:Math.min(r.right,e.right+i),bottom:Math.min(r.bottom,e.bottom+a),left:Math.max(r.left,e.left-s),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top}o=o.parentElement}let s=a.visualViewport,c=s?.offsetTop??0,l=s?.offsetLeft??0,u=s?.width??a.innerWidth,d=s?.height??a.innerHeight,f=n*d,p=n*u;return r={top:Math.max(r.top,c-f),right:Math.min(r.right,l+u+p),bottom:Math.min(r.bottom,c+d+f),left:Math.max(r.left,l-p),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top,r.width<0&&(r.width=0),r.height<0&&(r.height=0),r}function Ui(e){return{x:e.clientX,y:e.clientY}}var Wi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Gi(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let r of Array.from(e.querySelectorAll(`iframe, frame`)))try{let e=r.contentDocument;e&&!t.has(e)&&n.push(...Gi(e,t))}catch{}try{let r=e.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==e&&n.push(...Gi(i.document,t))}}catch{}return n}function Ki(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function qi(){let e=Ki()?window.visualViewport:null;return{x:e?.offsetLeft??0,y:e?.offsetTop??0}}function Ji(e){return!e||!Ni(e)?!1:e instanceof Pi(e).ShadowRoot}function Yi(e){if(e&&Ni(e)){let t=e.getRootNode();if(Ji(t)||t instanceof Document)return t}return Ri(e)}function Xi(e){return e.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Zi(e){let t=`input, textarea, select, canvas, [contenteditable]`,n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{let n=r[t];Qi(e)&&Qi(n)&&(e.type!==`file`&&(e.value=n.value),e.type===`radio`&&e.name&&(e.name=`Cloned__${e.name}`)),$i(e)&&$i(n)&&n.width>0&&n.height>0&&e.getContext(`2d`)?.drawImage(n,0,0)}),n}function Qi(e){return`value`in e}function $i(e){return e.tagName===`CANVAS`}function ea(e,{x:t,y:n}){let r=e.elementFromPoint(t,n);if(ta(r)){let{contentDocument:e}=r;if(e){let{left:i,top:a}=r.getBoundingClientRect();return ea(e,{x:t-i,y:n-a})}}return r}function ta(e){return e?.tagName===`IFRAME`}var na=new WeakMap;function ra(e){return e.closest(`
|
|
1
|
+
import{D as e,S as t,T as n,a as r,b as i,c as a,d as o,f as s,h as c,l,p as u,r as d,u as f,x as p}from"./solid.Ck4Vtfe4.js";import{_ as m,a as h,f as g,i as _,l as v,m as y,o as b,p as x,r as S,s as C,u as w,v as T}from"./web.DD6VKaIp.js";import{n as E}from"./i18n.DeOz3HxE.js";import{t as D}from"./preload-helper.oCYlU9a4.js";import{n as O}from"./api.B03e8F6d.js";import{t as k}from"./FloatingPanel.BetdW5N2.js";import{t as A}from"./lucide.s17cczpi.js";import{t as ee}from"./iconsAndAliases.ujTnkhnl.js";import{t as te}from"./FbIcon.Bn4e_qFb.js";var ne=m(`<div class=fb-tabs><div class=fb-tabs__list role=tablist></div><div class=fb-tabs__panel role=tabpanel>`),re=m(`<span class=fb-tabs__badge>`),ie=m(`<button type=button role=tab class=fb-tabs__tab><span></span><!$><!/>`);function ae(e){return(()=>{var t=b(ne),n=t.firstChild,i=n.nextSibling;return v(n,l(d,{get each(){return e.tabs},children:t=>(()=>{var n=b(ie),i=n.firstChild,a=i.nextSibling,[o,s]=C(a.nextSibling);return n.$$click=()=>e.onChange(t.id),v(i,()=>t.label),v(n,l(r,{get when(){return t.badge},get children(){var e=b(re);return v(e,()=>t.badge),e}}),o,s),u(r=>{var i=e.active===t.id,a=!!t.disabled,o=e.active===t.id,s=t.disabled;return i!==r.e&&n.classList.toggle(`is-active`,r.e=i),a!==r.t&&n.classList.toggle(`is-disabled`,r.t=a),o!==r.a&&x(n,`aria-selected`,r.a=o),s!==r.o&&y(n,`disabled`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),g(),n})()})),v(i,()=>e.children),u(()=>x(n,`aria-label`,e.ariaLabel)),t})()}h([`click`]);var oe=Symbol.for(`preact-signals`);function se(){if(F>1){F--;return}let e,t=!1;for((function(){let e=le;for(le=void 0;e!==void 0;){let t=e.S;if(t.v===e.v)for(let n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();N!==void 0;){let n=N;for(N=void 0,ue++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ge(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(ue=0,F--,t)throw e}function j(e){if(F>0)return e();fe=++de,F++;try{return e()}finally{se()}}var M,ce,N;function P(e){let t=M,n=ce;M=void 0,ce=void 0;try{return e()}finally{M=t,ce=n}}var le,F=0,ue=0,de=0,fe=0,pe=0;function me(e){if(M===void 0)return;let t=e.n;if(t===void 0||t.t!==M)return t={i:0,S:e,p:M.s,n:void 0,t:M,e:void 0,x:void 0,r:t},M.s!==void 0&&(M.s.n=t),M.s=t,e.n=t,32&M.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=M.s,t.n=void 0,M.s.n=t,M.s=t),t}function I(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}I.prototype.brand=oe,I.prototype.h=function(){return!0},I.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?P(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},I.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&P(()=>{var e;(e=this.Z)==null||e.call(this)}))}},I.prototype.subscribe=function(e){return Te(()=>{let t=this.value;P(()=>e(t))},{name:`sub`})},I.prototype.valueOf=function(){return this.value},I.prototype.toString=function(){return this.value+``},I.prototype.toJSON=function(){return this.value},I.prototype.peek=function(){return P(()=>this.value)},Object.defineProperty(I.prototype,"value",{get(){let e=me(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(ue>100)throw Error(`Cycle detected`);(function(e){F!==0&&ue===0&&e.l!==fe&&(e.l=fe,le={S:e,v:e.v,i:e.i,o:le})})(this),this.v=e,this.i++,pe++,F++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{se()}}}});function he(e,t){return new I(e,t)}function ge(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function _e(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ve(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function ye(e,t){I.call(this,void 0,t),this.x=e,this.s=void 0,this.g=pe-1,this.f=4}ye.prototype=new I,ye.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===pe))return!0;if(this.g=pe,this.f|=1,this.i>0&&!ge(this))return this.f&=-2,!0;let e=M;try{_e(this),M=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return M=e,ve(this),this.f&=-2,!0},ye.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}I.prototype.S.call(this,e)},ye.prototype.U=function(e){if(this.t!==void 0&&(I.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},ye.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(ye.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=me(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function be(e,t){return new ye(e,t)}function xe(e){let t=e.m;if(e.m=void 0,typeof t==`function`){F++;let n=M;M=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Se(e),t}finally{M=n,se()}}}function Se(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,xe(e)}function Ce(e){if(M!==this)throw Error(`Out-of-order effect`);ve(this),M=e,this.f&=-2,8&this.f&&Se(this),se()}function we(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ce&&ce.push(this)}we.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},we.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,xe(this),_e(this),F++;let e=M;return M=this,Ce.bind(this,e)},we.prototype.N=function(){2&this.f||(this.f|=2,this.u=N,N=this)},we.prototype.d=function(){this.f|=8,1&this.f||Se(this)},we.prototype.dispose=function(){this.d()};function Te(e,t){let n=new we(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Ee=Object.create,De=Object.defineProperty,Oe=Object.defineProperties,ke=Object.getOwnPropertyDescriptor,Ae=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,Pe=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Fe=e=>{throw TypeError(e)},Ie=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Le=(e,t)=>{for(var n in t||={})Me.call(t,n)&&Ie(e,n,t[n]);if(je)for(var n of je(t))Ne.call(t,n)&&Ie(e,n,t[n]);return e},Re=(e,t)=>Oe(e,Ae(t)),ze=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Be=e=>[,,,Ee(e?.[Pe(`metadata`)]??null)],Ve=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],He=e=>e!==void 0&&typeof e!=`function`?Fe(`Function expected`):e,Ue=(e,t,n,r,i)=>({kind:Ve[e],name:t,metadata:r,addInitializer:e=>n._?Fe(`Already initialized`):i.push(He(e||null))}),We=(e,t)=>Ie(t,Pe(`metadata`),e[3]),Ge=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Ke=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=Ve[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&ke(d<4?i:{get[n](){return Ye(this,a)},set[n](e){return Ze(this,a,e)}},n));d?p&&d<4&&ze(a,(d>2?`set `:d>1?`get `:``)+n):ze(i,n);for(var y=r.length-1;y>=0;y--)l=Ue(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Je(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Ye:Qe)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Ze(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?He(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Fe(`Object expected`):(He(o=s.get)&&(v.get=o),He(o=s.set)&&(v.set=o),He(o=s.init)&&g.unshift(o));return d||We(e,i),v&&De(i,n,v),p?d^4?a:v:i},qe=(e,t,n)=>t.has(e)||Fe(`Cannot `+n),Je=(e,t)=>Object(t)===t?e.has(t):Fe(`Cannot use the "in" operator on this value`),Ye=(e,t,n)=>(qe(e,t,`read from private field`),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?Fe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,r)=>(qe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Qe=(e,t,n)=>(qe(e,t,`access private method`),n);function $e(e,t){if(t){let n;return be(()=>{let r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return be(e)}function et(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e==`function`&&typeof t==`function`)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((e,n)=>!et(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&!n.some(n=>!et(e[n],t[n]))}return!1}function L({get:e},t){return{init(e){return he(e)},get(){return e.call(this).value},set(t){let n=e.call(this);n.peek()!==t&&(n.value=t)}}}function R(e,t){let n=new WeakMap;return function(){let t=n.get(this);return t||(t=$e(e.bind(this)),n.set(this,t)),t.value}}function tt(e=!0){return function(t,n){n.addInitializer(function(){let t=n.kind===`field`||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,Re(Le({},r),{enumerable:e}))})}}function nt(...e){let t=e.map(e=>Te(e));return()=>t.forEach(e=>e())}var rt,it,at,ot,st,ct=[L],lt,ut,dt,ft,pt,z,mt,ht,gt,_t,vt,yt,bt,xt;st=[L],ot=[L],at=[tt()],it=[tt()],rt=[tt()];var St=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ge(lt,5,this),Xe(this,z),Xe(this,ut,Ge(lt,8,this)),Ge(lt,11,this),Xe(this,mt,Ge(lt,12,this)),Ge(lt,15,this),Xe(this,vt,Ge(lt,16,this)),Ge(lt,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Ye(this,z,bt)}get initial(){return Ye(this,z,ft)}get previous(){return Ye(this,z,gt)}set current(e){let t=P(()=>Ye(this,z,bt));e&&t&&this.equals(t,e)||j(()=>{Ye(this,z,ft)||Ze(this,z,e,pt),Ze(this,z,t,_t),Ze(this,z,e,xt)})}reset(e=this.defaultValue){j(()=>{Ze(this,z,void 0,_t),Ze(this,z,e,pt),Ze(this,z,e,xt)})}};lt=Be(null),ut=new WeakMap,z=new WeakSet,mt=new WeakMap,vt=new WeakMap,dt=Ke(lt,20,`#initial`,ct,z,ut),ft=dt.get,pt=dt.set,ht=Ke(lt,20,`#previous`,st,z,mt),gt=ht.get,_t=ht.set,yt=Ke(lt,20,`#current`,ot,z,vt),bt=yt.get,xt=yt.set,Ke(lt,2,`current`,at,St),Ke(lt,2,`initial`,it,St),Ke(lt,2,`previous`,rt,St),We(lt,St);function Ct(e){return P(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var wt,Tt=class{constructor(){Xe(this,wt,new WeakMap)}get(e,t){return e?Ye(this,wt).get(e)?.get(t):void 0}set(e,t,n){if(e)return Ye(this,wt).has(e)||Ye(this,wt).set(e,new Map),Ye(this,wt).get(e)?.set(t,n)}clear(e){return e?Ye(this,wt).get(e)?.clear():void 0}};wt=new WeakMap;var Et=Object.create,Dt=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,kt=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Mt=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Nt=e=>{throw TypeError(e)},Pt=Math.pow,Ft=(e,t,n)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,It=(e,t)=>{for(var n in t||={})At.call(t,n)&&Ft(e,n,t[n]);if(kt)for(var n of kt(t))jt.call(t,n)&&Ft(e,n,t[n]);return e},Lt=(e,t)=>Dt(e,`name`,{value:t,configurable:!0}),Rt=e=>[,,,Et(e?.[Mt(`metadata`)]??null)],zt=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Bt=e=>e!==void 0&&typeof e!=`function`?Nt(`Function expected`):e,Vt=(e,t,n,r,i)=>({kind:zt[e],name:t,metadata:r,addInitializer:e=>n._?Nt(`Already initialized`):i.push(Bt(e||null))}),Ht=(e,t)=>Ft(t,Mt(`metadata`),e[3]),Ut=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Wt=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=zt[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Ot(d<4?i:{get[n](){return qt(this,a)},set[n](e){return Yt(this,a,e)}},n));d?p&&d<4&&Lt(a,(d>2?`set `:d>1?`get `:``)+n):Lt(i,n);for(var y=r.length-1;y>=0;y--)l=Vt(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Kt(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?qt:Xt)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Yt(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Bt(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Nt(`Object expected`):(Bt(o=s.get)&&(v.get=o),Bt(o=s.set)&&(v.set=o),Bt(o=s.init)&&g.unshift(o));return d||Ht(e,i),v&&Dt(i,n,v),p?d^4?a:v:i},Gt=(e,t,n)=>t.has(e)||Nt(`Cannot `+n),Kt=(e,t)=>Object(t)===t?e.has(t):Nt(`Cannot use the "in" operator on this value`),qt=(e,t,n)=>(Gt(e,t,`read from private field`),n?n.call(e):t.get(e)),Jt=(e,t,n)=>t.has(e)?Nt(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Yt=(e,t,n,r)=>(Gt(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Xt=(e,t,n)=>(Gt(e,t,`access private method`),n),Zt=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},Qt=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:r,left:i,width:a,height:o,scale:s}=this,c=new e(i+t,r+n,a,o);return c.scale=It({},s),c}get boundingRectangle(){let{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){let{left:e,top:t,right:n,bottom:r}=this;return new Zt((e+n)/2,(t+r)/2)}get area(){let{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;let{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){let{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?$t(this,t):0}intersectionRatio(e){let{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){let{top:e,height:t}=this;return e+t}get right(){let{left:e,width:t}=this;return e+t}get aspectRatio(){let{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:`center`,y:`center`}){let r=(e,t)=>{let r=n[t],i=t===`x`?e.left:e.top,a=t===`x`?e.width:e.height;return r==`start`?i:r==`end`?i+a:i+a/2};return Zt.delta({x:r(e,`x`),y:r(e,`y`)},{x:r(t,`x`),y:r(t,`y`)})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function $t(e,t){let 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),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;return r<i&&n<a?o*s:0}var en,tn,nn,rn,an,on=class extends (nn=St,tn=[R],en=[R],nn){constructor(e){let t=Zt.from(e);super(t,(e,t)=>Zt.equals(e,t)),Ut(an,5,this),Jt(this,rn,0),this.velocity={x:0,y:0}}get delta(){return Zt.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=Zt.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-qt(this,rn),o=e=>Math.round(e/a*100);j(()=>{Yt(this,rn,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(Zt.from(e)),this.velocity={x:0,y:0}}};an=Rt(nn),rn=new WeakMap,Wt(an,2,`delta`,tn,on),Wt(an,2,`direction`,en,on),Ht(an,on);function sn({x:e,y:t},n){let r=Math.abs(e),i=Math.abs(t);return typeof n==`number`?Math.sqrt(Pt(r,2)+Pt(i,2))>n:`x`in n&&`y`in n?r>n.x&&i>n.y:`x`in n?r>n.x:`y`in n&&i>n.y}var cn=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(cn||{}),ln=Object.values(cn),un=Object.create,dn=Object.defineProperty,fn=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,mn=Object.getOwnPropertyDescriptors,hn=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,vn=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),yn=e=>{throw TypeError(e)},bn=(e,t,n)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xn=(e,t)=>{for(var n in t||={})gn.call(t,n)&&bn(e,n,t[n]);if(hn)for(var n of hn(t))_n.call(t,n)&&bn(e,n,t[n]);return e},Sn=(e,t)=>fn(e,mn(t)),Cn=(e,t)=>dn(e,`name`,{value:t,configurable:!0}),wn=(e,t)=>{var n={};for(var r in e)gn.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hn)for(var r of hn(e))t.indexOf(r)<0&&_n.call(e,r)&&(n[r]=e[r]);return n},Tn=e=>[,,,un(e?.[vn(`metadata`)]??null)],En=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Dn=e=>e!==void 0&&typeof e!=`function`?yn(`Function expected`):e,On=(e,t,n,r,i)=>({kind:En[e],name:t,metadata:r,addInitializer:e=>n._?yn(`Already initialized`):i.push(Dn(e||null))}),kn=(e,t)=>bn(t,vn(`metadata`),e[3]),B=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},V=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=En[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&pn(d<4?i:{get[n](){return H(this,a)},set[n](e){return Mn(this,a,e)}},n));d?p&&d<4&&Cn(a,(d>2?`set `:d>1?`get `:``)+n):Cn(i,n);for(var y=r.length-1;y>=0;y--)l=On(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>jn(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?H:Nn)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Mn(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Dn(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?yn(`Object expected`):(Dn(o=s.get)&&(v.get=o),Dn(o=s.set)&&(v.set=o),Dn(o=s.init)&&g.unshift(o));return d||kn(e,i),v&&dn(i,n,v),p?d^4?a:v:i},An=(e,t,n)=>t.has(e)||yn(`Cannot `+n),jn=(e,t)=>Object(t)===t?e.has(t):yn(`Cannot use the "in" operator on this value`),H=(e,t,n)=>(An(e,t,`read from private field`),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?yn(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Mn=(e,t,n,r)=>(An(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Nn=(e,t,n)=>(An(e,t,`access private method`),n);function Pn(e,t){return{plugin:e,options:t}}function Fn(e){return t=>Pn(e,t)}function In(e){return typeof e==`function`?{plugin:e,options:void 0}:e}var Ln=[L],Rn,zn,Bn,W=class{constructor(e,t){this.manager=e,this.options=t,U(this,zn,B(Rn,8,this,!1)),B(Rn,11,this),U(this,Bn,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return P(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=Te(e.bind(this));return H(this,Bn).add(t),t}destroy(){H(this,Bn).forEach(e=>e())}static configure(e){return Pn(this,e)}};Rn=Tn(null),zn=new WeakMap,Bn=new WeakMap,V(Rn,4,`disabled`,Ln,W,zn),kn(Rn,W);var Vn=class extends W{},Hn,Un=class{constructor(e){this.manager=e,this.instances=new Map,U(this,Hn,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(In).reduce((e,t)=>{let n=e.find(({plugin:e})=>e===t.plugin);return n?(n.options=t.options,e):[...e,t]},[]),n=t.map(({plugin:e})=>e);for(let e of H(this,Hn))if(!n.includes(e)){if(e.prototype instanceof Vn)continue;this.unregister(e)}for(let{plugin:e,options:n}of t)this.register(e,n);Mn(this,Hn,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Hn=new WeakMap;function Wn(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Gn=[],Kn,qn,Jn=class extends W{constructor(e){super(e),U(this,Kn),U(this,qn),this.computeCollisions=this.computeCollisions.bind(this),Mn(this,qn,he(Gn)),this.destroy=nt(()=>{let e=this.computeCollisions(),t=P(()=>this.manager.dragOperation.position.current);if(e!==Gn){let e=H(this,Kn);if(Mn(this,Kn,t),e&&t.x==e.x&&t.y==e.y)return}else Mn(this,Kn,void 0);H(this,qn).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){P(()=>{e?H(this,qn).value=this.computeCollisions():Mn(this,Kn,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:a,status:o}=r;if(!o.initialized||!a)return Gn;let s=[],c=[];for(let a of e??n.droppables){if(a.disabled||i&&!a.accepts(i))continue;let e=t??a.collisionDetector;if(!e)continue;c.push(a),a.shape;let n=P(()=>e({droppable:a,dragOperation:r}));n&&(a.collisionPriority!=null&&(n.priority=a.collisionPriority),s.push(n))}return c.length===0?Gn:(s.sort(Wn),s)}get collisions(){return H(this,qn).value}};Kn=new WeakMap,qn=new WeakMap;var Yn,Xn,Zn=[L],Qn,$n,er,tr,nr,rr,ir;Xn=[L],Yn=[L];var ar=class e{constructor(e,t){U(this,tr,B(er,8,this)),B(er,11,this),U(this,nr),U(this,rr,B(er,12,this)),B(er,15,this),U(this,ir,B(er,16,this)),B(er,19,this);let{effects:n,id:r,data:i={},disabled:a=!1,register:o=!0}=e,s=r;Mn(this,nr,he(r)),this.manager=t,this.data=i,this.disabled=a,this.effects=()=>[()=>{let{id:e,manager:t}=this;if(e!==s)return s=e,t?.registry.register(this),()=>t?.registry.unregister(this)},...n?.()??[]],this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&o&&queueMicrotask(this.register)}get id(){let t=H(this,nr).value;return e.pendingIdChanges?.get(this)??t}set id(t){t!==(e.pendingIdChanges?.get(this)??H(this,nr).peek())&&(e.pendingIdChanges||(e.pendingIdChanges=new Map,queueMicrotask(()=>{var t;return Nn(t=e,Qn,$n).call(t)})),e.pendingIdChanges.set(this,t))}register(){return this.manager?.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};er=Tn(null),Qn=new WeakSet,$n=function(){let e=ar.pendingIdChanges;ar.pendingIdChanges=null,e&&j(()=>{for(let[t,n]of e)H(t,nr).value=n})},tr=new WeakMap,nr=new WeakMap,rr=new WeakMap,ir=new WeakMap,V(er,4,`manager`,Zn,ar,tr),V(er,4,`data`,Xn,ar,rr),V(er,4,`disabled`,Yn,ar,ir),U(ar,Qn),kn(er,ar),ar.pendingIdChanges=null;var or=ar,sr=class{constructor(){this.map=he(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;r&&r.id===e&&(this.cleanupFunctions.get(r)?.(),this.cleanupFunctions.delete(r));let a=new Map(n);for(let[r,i]of n)if(i===t&&r!==e){a.delete(r);break}a.set(e,t),this.map.value=a;let o=nt(...t.effects());return this.cleanupFunctions.set(t,o),i},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;this.cleanupFunctions.get(t)?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this)this.cleanupFunctions.get(e)?.(),e.destroy();this.map.value=new Map}},cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr=class extends (mr=or,pr=[L],fr=[L],dr=[L],ur=[R],lr=[R],cr=[R],mr){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a,plugins:o,effects:s}=n,c=wn(n,[`modifiers`,`type`,`sensors`,`plugins`,`effects`]);super(Sn(xn({},c),{effects:()=>[...s?.()??[],()=>{let{manager:e,plugins:t}=this;if(e&&t)for(let n of t){let{plugin:t}=In(n);e.registry.plugins.register(t)}}]}),t),B(hr,5,this),U(this,gr,B(hr,8,this)),B(hr,11,this),U(this,_r,B(hr,12,this)),B(hr,15,this),U(this,vr,B(hr,16,this,this.isDragSource?`dragging`:`idle`)),B(hr,19,this),this.type=i,this.sensors=a,this.modifiers=r,this.alignment=c.alignment,this.plugins=o}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=In(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status===`dropping`&&this.isDragSource}get isDragging(){return this.status===`dragging`&&this.isDragSource}get isDragSource(){return this.manager?.dragOperation.source?.id===this.id}};hr=Tn(mr),gr=new WeakMap,_r=new WeakMap,vr=new WeakMap,V(hr,4,`type`,pr,yr,gr),V(hr,4,`modifiers`,fr,yr,_r),V(hr,4,`status`,dr,yr,vr),V(hr,2,`isDropping`,ur,yr),V(hr,2,`isDragging`,lr,yr),V(hr,2,`isDragSource`,cr,yr),kn(hr,yr);var br,xr,Sr,Cr,wr,Tr,Er,G,Dr,Or,kr,Ar,jr,Mr=class extends (Er=or,Tr=[L],wr=[L],Cr=[L],Sr=[L],xr=[L],br=[R],Er){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=wn(n,[`accept`,`collisionDetector`,`collisionPriority`,`type`]);super(s,t),B(G,5,this),U(this,Dr,B(G,8,this)),B(G,11,this),U(this,Or,B(G,12,this)),B(G,15,this),U(this,kr,B(G,16,this)),B(G,19,this),U(this,Ar,B(G,20,this)),B(G,23,this),U(this,jr,B(G,24,this)),B(G,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=a,this.type=o}accepts(e){let{accept:t}=this;return t?typeof t==`function`?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){return this.manager?.dragOperation.target?.id===this.id}};G=Tn(Er),Dr=new WeakMap,Or=new WeakMap,kr=new WeakMap,Ar=new WeakMap,jr=new WeakMap,V(G,4,`accept`,Tr,Mr,Dr),V(G,4,`type`,wr,Mr,Or),V(G,4,`collisionDetector`,Cr,Mr,kr),V(G,4,`collisionPriority`,Sr,Mr,Ar),V(G,4,`shape`,xr,Mr,jr),V(G,2,`isDropTarget`,br,Mr),kn(G,Mr);var Nr=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){let{registry:n}=this,r=n.get(e);if(r)for(let e of r)e(...t)}},Pr=class extends Nr{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function Fr(e,t=!0){let n=!1;return Sn(xn({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var Ir=class extends Vn{constructor(e){super(e);let t=(e,t)=>e.map(({id:e})=>e).join(``)===t.map(({id:e})=>e).join(``),n=[];this.destroy=nt(()=>{let{dragOperation:t,collisionObserver:r}=e;t.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:r,monitor:i}=e,{collisions:a}=r;if(r.isDisabled()||or.pendingIdChanges)return;let o=Fr({collisions:a});if(i.dispatch(`collision`,o),o.defaultPrevented||t(a,n))return;n=a;let[s]=a;P(()=>{s?.id!==e.dragOperation.target?.id&&(r.disable(),e.actions.setDropTarget(s?.id).then(()=>{r.enable()}))})})}},Lr=(e=>(e[e.Lowest=0]=`Lowest`,e[e.Low=1]=`Low`,e[e.Normal=2]=`Normal`,e[e.High=3]=`High`,e[e.Highest=4]=`Highest`,e))(Lr||{}),Rr=(e=>(e[e.Collision=0]=`Collision`,e[e.ShapeIntersection=1]=`ShapeIntersection`,e[e.PointerIntersection=2]=`PointerIntersection`,e))(Rr||{}),zr,Br,Vr,Hr,Ur,Wr,Gr=[L],Kr,qr;Wr=[R],Ur=[R],Hr=[R],Vr=[R],Br=[R],zr=[R];var Jr=class{constructor(){B(Kr,5,this),U(this,qr,B(Kr,8,this,`idle`)),B(Kr,11,this)}get current(){return this.value}get idle(){return this.value===`idle`}get initializing(){return this.value===`initializing`}get initialized(){let{value:e}=this;return e!==`idle`&&e!==`initialization-pending`}get dragging(){return this.value===`dragging`}get dropped(){return this.value===`dropped`}set(e){this.value=e}};Kr=Tn(null),qr=new WeakMap,V(Kr,4,`value`,Gr,Jr,qr),V(Kr,2,`current`,Wr,Jr),V(Kr,2,`idle`,Ur,Jr),V(Kr,2,`initializing`,Hr,Jr),V(Kr,2,`initialized`,Vr,Jr),V(Kr,2,`dragging`,Br,Jr),V(Kr,2,`dropped`,zr,Jr),kn(Kr,Jr);var Yr=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==`string`||typeof e==`number`?e:e.id}setDropTarget(e){return P(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let r=Fr({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch(`dragover`,r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return P(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw Error(`Cannot start a drag operation without a drag source`);if(!t.status.idle)throw Error(`Cannot start a drag operation while another is active`);let n=new AbortController,{event:r,coordinates:i}=e;j(()=>{t.status.set(`initialization-pending`),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(i)});let a=Fr({operation:t.snapshot()});return this.manager.monitor.dispatch(`beforedragstart`,a),a.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set(`initializing`),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;let{status:e}=t;e.current===`initializing`&&j(()=>{t.status.set(`dragging`),this.manager.monitor.dispatch(`dragstart`,{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),n)})}move(e){return P(()=>{let{dragOperation:t}=this.manager,{status:n,controller:r}=t;if(!n.dragging||!r||r.signal.aborted)return;let i=Fr({nativeEvent:e.event,operation:t.snapshot(),by:e.by,to:e.to},e.cancelable??!0);(e.propagate??!0)&&this.manager.monitor.dispatch(`dragmove`,i),queueMicrotask(()=>{if(i.defaultPrevented)return;let n=e.to??{x:t.position.current.x+(e.by?.x??0),y:t.position.current.y+(e.by?.y??0)};t.position.current=n})})}stop(e={}){return P(()=>{let{dragOperation:t}=this.manager,{controller:n}=t;if(!n||n.signal.aborted)return;let r,i=()=>{let e={resume:()=>{},abort:()=>{}};return r=new Promise((t,n)=>{e.resume=t,e.abort=n}),e};n.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{t.status.set(`dropped`);let e=P(()=>t.source?.status===`dropping`),r=()=>{t.controller===n&&(t.controller=void 0),t.reset()};if(e){let{source:e}=t,n=Te(()=>{e?.status===`idle`&&(n(),r())})}else this.manager.renderer.rendering.then(r)})};t.canceled=e.canceled??!1,this.manager.monitor.dispatch(`dragend`,{nativeEvent:e.event,operation:t.snapshot(),canceled:e.canceled??!1,suspend:i}),r?r.then(a).catch(()=>t.reset()):a()})}},Xr=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Zr=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let t of e??[])t.controller=this}onEvent(e){if(!this.activated){if(this.constraints?.length)for(let t of this.constraints)t.onEvent(e);else this.activate(e)}}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Qr,$r=class{constructor(e){this.options=e,U(this,Qr)}set controller(e){Mn(this,Qr,e),e.signal.addEventListener(`abort`,()=>this.abort())}activate(e){var t;(t=H(this,Qr))==null||t.activate(e)}};Qr=new WeakMap;var ei=class extends W{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},ti=class{constructor(e){this.draggables=new sr,this.droppables=new sr,this.plugins=new Un(e),this.sensors=new Un(e),this.modifiers=new Un(e)}register(e,t){if(e instanceof yr)return this.draggables.register(e.id,e);if(e instanceof Mr)return this.droppables.register(e.id,e);if(e.prototype instanceof ei)return this.modifiers.register(e,t);if(e.prototype instanceof Xr)return this.sensors.register(e,t);if(e.prototype instanceof W)return this.plugins.register(e,t);throw Error(`Invalid instance type`)}unregister(e){if(e instanceof or)return e instanceof yr?this.draggables.unregister(e.id,e):e instanceof Mr?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof ei)return this.modifiers.unregister(e);if(e.prototype instanceof Xr)return this.sensors.unregister(e);if(e.prototype instanceof W)return this.plugins.unregister(e);throw Error(`Invalid instance type`)}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},ni,ri,ii,ai,oi,si,ci,li,ui=[R],di,fi,pi,K,mi,hi,gi,_i,vi,yi;li=[L],ci=[L],si=[L],oi=[L],ai=[L],ii=[R],ri=[R],ni=[R];var bi=class{constructor(e){B(K,5,this),U(this,di),U(this,fi),U(this,pi,new St(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new Jr,U(this,mi,B(K,8,this,!1)),B(K,11,this),U(this,hi,B(K,12,this,null)),B(K,15,this),U(this,gi,B(K,16,this,null)),B(K,19,this),U(this,_i,B(K,20,this,null)),B(K,23,this),U(this,vi,B(K,24,this,[])),B(K,27,this),this.position=new on({x:0,y:0}),U(this,yi,{x:0,y:0}),Mn(this,di,e)}get shape(){let{current:e,initial:t,previous:n}=H(this,pi);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?H(this,pi).current=e:H(this,pi).reset()}get source(){let e=this.sourceIdentifier;if(e==null)return null;let t=H(this,di).registry.draggables.get(e);return t&&Mn(this,fi,t),t??H(this,fi)??null}get target(){let e=this.targetIdentifier;return e==null?null:H(this,di).registry.droppables.get(e)??null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let e of this.modifiers)n=e.apply(Sn(xn({},this.snapshot()),{transform:n}));return Mn(this,yi,n),n}snapshot(){return P(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:H(this,yi),shape:this.shape?Ct(this.shape):null,position:Ct(this.position),status:Ct(this.status),canceled:this.canceled}))}reset(){j(()=>{this.status.set(`idle`),this.sourceIdentifier=null,this.targetIdentifier=null,H(this,pi).reset(),this.position.reset({x:0,y:0}),Mn(this,yi,{x:0,y:0}),this.modifiers=[]})}};K=Tn(null),di=new WeakMap,fi=new WeakMap,pi=new WeakMap,mi=new WeakMap,hi=new WeakMap,gi=new WeakMap,_i=new WeakMap,vi=new WeakMap,yi=new WeakMap,V(K,2,`shape`,ui,bi),V(K,4,`canceled`,li,bi,mi),V(K,4,`activatorEvent`,ci,bi,hi),V(K,4,`sourceIdentifier`,si,bi,gi),V(K,4,`targetIdentifier`,oi,bi,_i),V(K,4,`modifiers`,ai,bi,vi),V(K,2,`source`,ii,bi),V(K,2,`target`,ri,bi),V(K,2,`transform`,ni,bi),kn(K,bi);var xi={get rendering(){return Promise.resolve()}};function Si(e,t){return typeof e==`function`?e(t):e??t}var Ci=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};let t=e??{},n=Si(t.plugins,[]),r=Si(t.sensors,[]),i=Si(t.modifiers,[]),a=t.renderer??xi,o=new Pr(this),s=new ti(this);this.registry=s,this.monitor=o,this.renderer=a,this.actions=new Yr(this),this.dragOperation=new bi(this),this.collisionObserver=new Jn(this),this.plugins=[Ir,...n],this.modifiers=i,this.sensors=r;let{destroy:c}=this,l=nt(()=>{let e=P(()=>this.dragOperation.modifiers),t=this.modifiers;for(let n of e)t.includes(n)||n.destroy();this.dragOperation.modifiers=(this.dragOperation.source?.modifiers)?.map(e=>{let{plugin:t,options:n}=In(e);return new t(this,n)})??t});this.destroy=()=>{l(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},wi=e=>{throw TypeError(e)},Ti=(e,t,n)=>t.has(e)||wi(`Cannot `+n),q=(e,t,n)=>(Ti(e,t,`read from private field`),t.get(e)),Ei=(e,t,n)=>t.has(e)?wi(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Di=(e,t,n,r)=>(Ti(e,t,`write to private field`),t.set(e,n),n),Oi=(e,t,n)=>(Ti(e,t,`access private method`),n);function ki(e){return e?e instanceof KeyframeEffect||`getKeyframes`in e&&typeof e.getKeyframes==`function`:!1}function Ai(e,t){let n=e.getAnimations(),r=null;for(let e of n){if(e.playState!==`running`)continue;let{effect:n}=e,i=(ki(n)?n.getKeyframes():[]).filter(t);i.length>0&&(r=[i[i.length-1],e])}return r}function ji(e){let{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}function Mi(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ni(e){return`nodeType`in e}function Pi(e){return e?Mi(e)?e:Ni(e)?`defaultView`in e?e.defaultView??window:e.ownerDocument?.defaultView??window:window:window}function Fi(e){let{Document:t}=Pi(e);return e instanceof t||`nodeType`in e&&e.nodeType===Node.DOCUMENT_NODE}function Ii(e){return!e||Mi(e)?!1:e instanceof Pi(e).HTMLElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`html`)}function Li(e){return e instanceof Pi(e).SVGElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`svg`)}function Ri(e){return e?Mi(e)?e.document:Ni(e)?Fi(e)?e:Ii(e)||Li(e)?e.ownerDocument:document:document:document}function zi(e){let{documentElement:t}=Ri(e),n=Pi(e).visualViewport,r=n?.width??t.clientWidth,i=n?.height??t.clientHeight,a=n?.offsetTop??0,o=n?.offsetLeft??0;return{top:a,left:o,right:o+r,bottom:a+i,width:r,height:i}}function Bi(e,t){if(Vi(e)&&e.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n===`visible`&&r===`visible`&&i===`visible`}function Vi(e){return e.tagName===`DETAILS`}function Hi(e,t=e.getBoundingClientRect(),n=0){let r=t,{ownerDocument:i}=e,a=i.defaultView??window,o=e.parentElement;for(;o&&o!==i.documentElement;){if(!Bi(o)){let e=o.getBoundingClientRect(),t=n*(e.bottom-e.top),i=n*(e.right-e.left),a=n*(e.bottom-e.top),s=n*(e.right-e.left);r={top:Math.max(r.top,e.top-t),right:Math.min(r.right,e.right+i),bottom:Math.min(r.bottom,e.bottom+a),left:Math.max(r.left,e.left-s),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top}o=o.parentElement}let s=a.visualViewport,c=s?.offsetTop??0,l=s?.offsetLeft??0,u=s?.width??a.innerWidth,d=s?.height??a.innerHeight,f=n*d,p=n*u;return r={top:Math.max(r.top,c-f),right:Math.min(r.right,l+u+p),bottom:Math.min(r.bottom,c+d+f),left:Math.max(r.left,l-p),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top,r.width<0&&(r.width=0),r.height<0&&(r.height=0),r}function Ui(e){return{x:e.clientX,y:e.clientY}}var Wi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Gi(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let r of Array.from(e.querySelectorAll(`iframe, frame`)))try{let e=r.contentDocument;e&&!t.has(e)&&n.push(...Gi(e,t))}catch{}try{let r=e.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==e&&n.push(...Gi(i.document,t))}}catch{}return n}function Ki(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function qi(){let e=Ki()?window.visualViewport:null;return{x:e?.offsetLeft??0,y:e?.offsetTop??0}}function Ji(e){return!e||!Ni(e)?!1:e instanceof Pi(e).ShadowRoot}function Yi(e){if(e&&Ni(e)){let t=e.getRootNode();if(Ji(t)||t instanceof Document)return t}return Ri(e)}function Xi(e){return e.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Zi(e){let t=`input, textarea, select, canvas, [contenteditable]`,n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{let n=r[t];Qi(e)&&Qi(n)&&(e.type!==`file`&&(e.value=n.value),e.type===`radio`&&e.name&&(e.name=`Cloned__${e.name}`)),$i(e)&&$i(n)&&n.width>0&&n.height>0&&e.getContext(`2d`)?.drawImage(n,0,0)}),n}function Qi(e){return`value`in e}function $i(e){return e.tagName===`CANVAS`}function ea(e,{x:t,y:n}){let r=e.elementFromPoint(t,n);if(ta(r)){let{contentDocument:e}=r;if(e){let{left:i,top:a}=r.getBoundingClientRect();return ea(e,{x:t-i,y:n-a})}}return r}function ta(e){return e?.tagName===`IFRAME`}var na=new WeakMap;function ra(e){return e.closest(`
|
|
2
2
|
input:not([disabled]),
|
|
3
3
|
select:not([disabled]),
|
|
4
4
|
textarea:not([disabled]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h}from"./web.DD6VKaIp.js";import{n as g}from"./i18n.
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h}from"./web.DD6VKaIp.js";import{n as g}from"./i18n.DeOz3HxE.js";import{n as _}from"./api.B03e8F6d.js";import{t as v}from"./FbIcon.Bn4e_qFb.js";var y=s(`<div class="notice notice--error">`),b=s(`<div class=fb-list__toolbar><label class=fb-list__filter><span></span><select class=input><option value></option><!$><!/></select></label><input class="input fb-list__search"type=search>`),x=s(`<div class=fb-groups-table__head><span></span><span></span><span></span><span></span><span></span><span>`),S=s(`<section class="card fb-groups-table">`),ee=s(`<p class="muted fb-import-hint">`),te=s(`<div class=fb-modal-backdrop><div class=fb-modal><div class=fb-modal__header><h3></h3><button type=button class=fb-modal__close></button></div><div class=fb-modal__body><p class=muted></p><label class=fb-import-dropzone><input id=import-file-input type=file accept=.json hidden><!$><!/><span></span></label><!$><!/></div><div class=fb-modal__footer><button type=button class="btn btn-secondary"></button><button type=button class="btn btn-primary">`),C=s(`<div class=fb-list><!$><!/><div class=fb-list__header><div><span class=fb-eyebrow></span><h2></h2><p class=muted></p></div><div class=fb-list__header-actions><label class=fb-import-btn><input type=file accept=.json hidden><button type=button class="btn btn-secondary"><!$><!/> <!$><!/></button></label><a class="btn btn-primary"href=/settings/custom-fields/new>+ <!$><!/></a></div></div><!$><!/><!$><!/>`),w=s(`<p class=muted>`),T=s(`<option><!$><!/> (<!$><!/>)`),E=s(`<div class=fb-empty-groups><!$><!/><h4></h4><p class=muted></p><a class="btn btn-primary"href=/settings/custom-fields/new>`),D=s(`<div class=fb-groups-table__row role=button tabindex=0><div class=fb-groups-table__title><strong></strong><code></code></div><span class="fb-groups-table__desc muted"></span><span class=fb-groups-table__location></span><span class=fb-groups-table__count></span><span><span class=badge></span></span><div class=fb-groups-table__actions><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class=fb-row-action></button><button type=button class="fb-row-action is-danger">`);function O(){let{t:s}=g(),[c,O]=r([]),[k,A]=r([]),[j,M]=r(``),[N,ne]=r(``),[P,F]=r(!0),[I,L]=r(``);e(async()=>{try{let[e,t]=await Promise.all([_.getContentTypes(),_.getFieldGroups()]);A(e),O(t),e[0]&&M(e[0].slug)}catch(e){L(e instanceof Error?e.message:String(e))}finally{F(!1)}});let R=e=>[...new Set((e.locationRules??[]).flat().filter(e=>e.param===`content_type`&&e.operator===`eq`&&e.value).map(e=>e.value))],re=e=>{let t=R(e);return t.length===0?s(`settings.customFields.groups.allContentTypes`):t.map(e=>k().find(t=>t.slug===e)?.pluralLabel??e).join(`, `)},z=n(()=>{let e=N().trim().toLowerCase();return c().filter(e=>!e.key.startsWith(`core-fields-`)).filter(t=>{let n=R(t);return(!j()||n.length===0||n.includes(j()))&&(!e||t.title.toLowerCase().includes(e)||t.key.toLowerCase().includes(e))})}),B=e=>{window.location.href=`/settings/custom-fields/${e}`},V=async e=>{try{let t=await _.getFieldGroup(e.id);await _.createFieldGroup({...t,id:void 0,key:`${t.key}-copy-${Date.now().toString(36)}`,title:`${t.title} ${s(`settings.customFields.form.copySuffix`)}`}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ie=async e=>{try{let t=await _.getFieldGroup(e.id);await _.updateFieldGroup(e.id,{...t,active:!e.active}),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},ae=async e=>{if(window.confirm(s(`settings.customFields.actions.confirmDelete`)))try{await _.deleteFieldGroup(e.id),await H()}catch(e){L(e instanceof Error?e.message:String(e))}},H=async()=>{let e=await _.getFieldGroups();O(e)},[oe,U]=r(!1),[W,G]=r(null),[K,q]=r(!1),se=async e=>{try{let t=await _.exportFieldGroup(e.id),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e.key}.json`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(n)}catch(e){L(e instanceof Error?e.message:String(e))}},J=e=>{let t=e.currentTarget;t.files&&t.files[0]&&G(t.files[0])},ce=async()=>{let e=W();if(e){q(!0);try{let t=await e.text(),n=JSON.parse(t),r=(await _.importFieldGroups(n)).results.filter(e=>!e.success);r.length>0?L(r.map(e=>`${e.key}: ${e.error}`).join(`; `)):L(``),U(!1),G(null),await H()}catch(e){L(e instanceof Error?e.message:String(e))}finally{q(!1)}}},Y=e=>s(`settings.customFields.actions.${e}`),X=e=>s(`settings.customFields.groups.${e}`);return(()=>{var e=f(C),n=e.firstChild,[r,c]=m(n.nextSibling),g=r.nextSibling,_=g.firstChild,O=_.firstChild,A=O.nextSibling,F=A.nextSibling,L=_.nextSibling.firstChild,R=L.firstChild,H=R.nextSibling,q=H.firstChild,[Z,le]=m(q.nextSibling),ue=Z.nextSibling.nextSibling,[de,fe]=m(ue.nextSibling),Q=L.nextSibling,pe=Q.firstChild.nextSibling,[me,he]=m(pe.nextSibling),ge=g.nextSibling,[$,_e]=m(ge.nextSibling),ve=$.nextSibling,[ye,be]=m(ve.nextSibling);return u(e,i(t,{get when(){return I()},get children(){var e=f(y);return u(e,I),e}}),r,c),u(O,()=>s(`settings.customFields.listEyebrow`)),u(A,()=>X(`title`)),u(F,()=>s(`settings.customFields.description`)),R.addEventListener(`change`,J),H.$$click=()=>U(!0),u(H,i(v,{name:`upload`,class:`fb-btn-icon`}),Z,le),u(H,()=>Y(`import`),de,fe),u(Q,()=>X(`new`),me,he),u(e,i(t,{get when(){return!P()},get fallback(){return(()=>{var e=f(w);return u(e,()=>s(`settings.customFields.loading`)),e})()},get children(){return[(()=>{var e=f(b),t=e.firstChild,n=t.firstChild,r=n.nextSibling,c=r.firstChild,h=c.nextSibling,[g,_]=m(h.nextSibling),v=t.nextSibling;return u(n,()=>s(`settings.customFields.contentType`)),r.addEventListener(`change`,e=>M(e.currentTarget.value)),u(c,()=>X(`allContentTypes`)),u(r,i(o,{get each(){return k()},children:e=>(()=>{var t=f(T),n=t.firstChild,[r,i]=m(n.nextSibling),o=r.nextSibling.nextSibling,[s,c]=m(o.nextSibling);return s.nextSibling,u(t,()=>e.pluralLabel,r,i),u(t,()=>e.slug,s,c),a(()=>d(t,`value`,e.slug)),t})()}),g,_),v.$$input=e=>ne(e.currentTarget.value),a(()=>p(v,`placeholder`,X(`search`))),a(()=>d(r,`value`,j())),a(()=>d(v,`value`,N())),l(),e})(),(()=>{var e=f(S);return u(e,i(t,{get when(){return z().length>0},get fallback(){return(()=>{var e=f(E),t=e.firstChild,[n,r]=m(t.nextSibling),a=n.nextSibling,o=a.nextSibling,s=o.nextSibling;return u(e,i(v,{name:`columns-3`,class:`fb-empty-icon`}),n,r),u(a,()=>X(`empty`)),u(o,()=>X(`emptyHint`)),u(s,()=>X(`new`)),e})()},get children(){return[(()=>{var e=f(x),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling;return u(t,()=>X(`groupName`)),u(n,()=>s(`settings.customFields.form.description`)),u(r,()=>X(`appliesTo`)),u(i,()=>X(`fields`)),u(a,()=>X(`status`)),e})(),i(o,{get each(){return z()},children:e=>(()=>{var t=f(D),n=t.firstChild,r=n.firstChild,i=r.nextSibling,o=n.nextSibling,s=o.nextSibling,c=s.nextSibling,d=c.nextSibling,p=d.firstChild,m=d.nextSibling,g=m.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.nextSibling,b=y.nextSibling;return t.$$keydown=t=>{t.key===`Enter`&&B(e.id)},t.$$click=()=>B(e.id),u(r,()=>e.title),u(i,()=>e.key),u(o,()=>String(e.metadata?.description??`—`)),u(s,()=>re(e)),u(c,()=>e.fieldCount),u(p,(()=>{var t=h(()=>!!e.active);return()=>t()?X(`active`):X(`inactive`)})()),m.$$click=e=>e.stopPropagation(),g.$$click=()=>B(e.id),u(g,()=>Y(`edit`)),_.$$click=()=>void se(e),u(_,()=>Y(`export`)),v.$$click=()=>void V(e),u(v,()=>Y(`duplicate`)),y.$$click=()=>void ie(e),u(y,(()=>{var t=h(()=>!!e.active);return()=>t()?Y(`deactivate`):Y(`activate`)})()),b.$$click=()=>void ae(e),u(b,()=>Y(`delete`)),a(t=>{var n=!!e.active,r=!e.active;return n!==t.e&&p.classList.toggle(`badge-success`,t.e=n),r!==t.t&&p.classList.toggle(`badge-secondary`,t.t=r),t},{e:void 0,t:void 0}),l(),t})()})]}})),e})()]}}),$,_e),u(e,i(t,{get when(){return oe()},get children(){var e=f(te),n=e.firstChild,r=n.firstChild,o=r.firstChild,c=o.nextSibling,g=r.nextSibling,_=g.firstChild,y=_.nextSibling,b=y.firstChild,x=b.nextSibling,[S,C]=m(x.nextSibling),w=S.nextSibling,T=y.nextSibling,[E,D]=m(T.nextSibling),O=g.nextSibling.firstChild,k=O.nextSibling;return e.$$click=()=>{U(!1),G(null)},n.$$click=e=>e.stopPropagation(),u(o,()=>Y(`import`)),c.$$click=()=>{U(!1),G(null)},u(c,i(v,{name:`x`})),u(_,()=>s(`settings.customFields.import.description`)),y.$$click=()=>document.getElementById(`import-file-input`)?.click(),b.addEventListener(`change`,J),u(y,i(v,{name:`upload`,class:`fb-dropzone-icon`}),S,C),u(w,(()=>{var e=h(()=>!!W());return()=>e()?W().name:s(`settings.customFields.import.dropzone`)})()),u(g,i(t,{get when(){return W()},get children(){var e=f(ee);return u(e,()=>s(`settings.customFields.import.hint`)),e}}),E,D),O.$$click=()=>{U(!1),G(null)},u(O,()=>s(`common.cancel`)),k.$$click=ce,u(k,(()=>{var e=h(()=>!!K());return()=>e()?s(`common.loading`):Y(`import`)})()),a(e=>{var t=s(`common.close`),n=!W()||K();return t!==e.e&&p(c,`aria-label`,e.e=t),n!==e.t&&d(k,`disabled`,e.t=n),e},{e:void 0,t:void 0}),l(),e}}),ye,be),l(),e})()}c([`click`,`input`,`keydown`]);export{O as FieldGroupList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e}from"./solid.Ck4Vtfe4.js";import{_ as t,l as n,o as r,p as i}from"./web.DD6VKaIp.js";import{n as a}from"./i18n.
|
|
1
|
+
import{p as e}from"./solid.Ck4Vtfe4.js";import{_ as t,l as n,o as r,p as i}from"./web.DD6VKaIp.js";import{n as a}from"./i18n.DeOz3HxE.js";var o=t(`<footer class=admin-footer role=contentinfo><div class=footer-content><div class=footer-left><p class=footer-version><span class=product-name>OkCMS</span></p></div><nav class=footer-links><a href=https://oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://github.com/oktis-works/cms target=_blank rel="noopener noreferrer"></a><a href=https://docs.oktisworks.com target=_blank rel="noopener noreferrer"></a><a href=https://oktisworks.com/community target=_blank rel="noopener noreferrer"></a></nav><div class=footer-right><p class=footer-powered></p></div></div><style>
|
|
2
2
|
.admin-footer {
|
|
3
3
|
position: static;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h,v as g}from"./web.DD6VKaIp.js";import{a as _,i as v,n as y,o as b,r as x,s as S}from"./i18n.
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h,v as g}from"./web.DD6VKaIp.js";import{a as _,i as v,n as y,o as b,r as x,s as S}from"./i18n.DeOz3HxE.js";import{n as C}from"./api.B03e8F6d.js";import{i as w,n as T,r as E,s as D}from"./src.CYKGYEyR.js";import{t as O}from"./FloatingPanel.BetdW5N2.js";var k=s(`<input type=search class="input tz-select__search">`),A=s(`<div class=tz-select__options>`),j=s(`<div class=tz-select><button type=button class="input tz-select__trigger"aria-haspopup=listbox><span class=tz-select__value></span><span aria-hidden=true></span></button><!$><!/>`),M=s(`<p class=tz-select__empty>—`),N=s(`<button type=button role=option class=tz-select__option>`),P=new Map;function F(e){let t=P.get(e);t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}),P.set(e,t));let n=(t.formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`).match(/GMT([+-])(\d{2}):(\d{2})/);if(!n)return{label:`UTC+00:00`,minutes:0};let r=(n[1]===`-`?-1:1)*(Number(n[2])*60+Number(n[3]));return{label:`UTC${n[1]}${n[2]}:${n[3]}`,minutes:r}}function I(){let e=Intl,t=(typeof e.supportedValuesOf==`function`?e.supportedValuesOf(`timeZone`):[`UTC`]).map(e=>{let{label:t,minutes:n}=F(e);return{tz:e,label:`(UTC${t.slice(3)}) ${e}`,minutes:n}});return t.sort((e,t)=>e.minutes-t.minutes||e.tz.localeCompare(t.tz)),[{tz:`UTC`,label:`(UTC+00:00) UTC`,minutes:0},...t]}var L=e=>e.toLowerCase().replace(/[/_\-]/g,` `);function R(e){let[s,c]=r(!1),[h,_]=r(``),v,[y,b]=r(void 0),x=n(()=>I()),S=n(()=>x().find(t=>t.tz===e.value)),C=n(()=>{let e=L(h().trim());return e?x().filter(t=>L(t.label).includes(e)):x()});return(()=>{var n=f(j),r=n.firstChild,x=r.firstChild,w=x.nextSibling,T=r.nextSibling,[E,D]=m(T.nextSibling),P=v;return typeof P==`function`?g(P,n):v=n,r.$$click=()=>c(!s()),g(b,r),u(x,()=>S()?.label??e.placeholder??``),u(w,()=>s()?`▴`:`▾`),u(n,i(O,{get open(){return s()},get trigger(){return y()},onClose:()=>{c(!1),_(``)},class:`tz-select__panel`,role:`listbox`,minWidth:320,get children(){return[(()=>{var t=f(k);return g(e=>queueMicrotask(()=>e.focus()),t),t.$$input=e=>_(e.currentTarget.value),a(()=>p(t,`placeholder`,e.searchPlaceholder??e.placeholder??``)),a(()=>d(t,`value`,h())),l(),t})(),(()=>{var n=f(A);return u(n,i(t,{get when(){return C().length>0},get fallback(){return f(M)},get children(){return i(o,{get each(){return C()},children:t=>(()=>{var n=f(N);return n.$$click=()=>{e.onChange(t.tz),c(!1),_(``)},u(n,()=>t.label),a(r=>{var i=e.value===t.tz,a=e.value===t.tz;return i!==r.e&&p(n,`aria-selected`,r.e=i),a!==r.t&&n.classList.toggle(`is-selected`,r.t=a),r},{e:void 0,t:void 0}),l(),n})()})}})),n})()]}}),E,D),a(()=>p(r,`aria-expanded`,s())),l(),n})()}c([`click`,`input`]);var z=s(`<div class="notice notice--error">`),B=s(`<div class=notice>`),V=s(`<form><div class=form-grid></div><div class=media-details__actions>`),H=s(`<div class=general-settings><!$><!/><!$><!/><!$><!/>`),U=s(`<p class=muted>`),W=s(`<label class=general-settings__tz><!$><!/><!$><!/>`);function G(){let{t:a}=y(),[o,s]=r({}),[c,l]=r(``),[d,p]=r(!1),[g,O]=r(``),[k,A]=r(``),[j,M]=r(!1),N=n(()=>b.map(e=>({value:e,label:`${v[e]} ${_[e]}`}))),P=n(()=>[{key:`siteTitle`,label:a(`settings.general.fields.siteTitle`),type:`text`,placeholder:a(`settings.general.fields.siteTitlePlaceholder`)},{key:`siteDescription`,label:a(`settings.general.fields.siteDescription`),type:`text`,placeholder:a(`settings.general.fields.siteDescriptionPlaceholder`)},{key:`language`,label:a(`settings.general.fields.language`),type:`select`,options:N()},{key:`timezone`,label:a(`settings.general.fields.timezone`),type:`timezone`,placeholder:a(`settings.general.fields.timezonePlaceholder`)}]);e(async()=>{try{let e=await C.getSettings(`general`),t={};for(let n of e)t[n.key]=typeof n.value==`string`?n.value:JSON.stringify(n.value??``);for(let e of P())t[e.key]===void 0&&(t[e.key]=``);if(!t.timezone)try{t.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`}catch{t.timezone=`UTC`}l(t.language??``),s(t),p(!0)}catch(e){O(e instanceof Error?e.message:String(e))}});let F=async e=>{e.preventDefault(),O(``),A(``),M(!0);try{let e=await C.getSettings(`general`),t=new Map(e.map(e=>[e.key,e]));await C.updateSettings(P().map(e=>{let n=t.get(e.key);return{key:e.key,value:o()[e.key]??``,group:n?.group??`general`,type:n?.type??`string`}}));let n=o().language??``;if(S(n)&&n!==c()){x(n),window.location.reload();return}A(a(`settings.general.saved`))}catch(e){O(e instanceof Error?e.message:String(e))}finally{M(!1)}};return(()=>{var e=f(H),n=e.firstChild,[r,c]=m(n.nextSibling),l=r.nextSibling,[p,_]=m(l.nextSibling),v=p.nextSibling,[y,b]=m(v.nextSibling);return u(e,i(t,{get when(){return g()},get children(){var e=f(z);return u(e,g),e}}),r,c),u(e,i(t,{get when(){return k()},get children(){var e=f(B);return u(e,k),e}}),p,_),u(e,i(t,{get when(){return d()},get fallback(){return(()=>{var e=f(U);return u(e,()=>a(`settings.general.loading`)),e})()},get children(){return i(E,{get children(){var e=f(V),t=e.firstChild,n=t.nextSibling;return e.addEventListener(`submit`,F),u(t,()=>P().map(e=>e.type===`select`?i(D,{get name(){return e.key},get label(){return e.label},get value(){return o()[e.key]??``},get options(){return e.options??[]},onChange:t=>s({...o(),[e.key]:t})}):e.type===`timezone`?(()=>{var t=f(W),n=t.firstChild,[r,a]=m(n.nextSibling),c=r.nextSibling,[l,d]=m(c.nextSibling);return u(t,()=>e.label,r,a),u(t,i(R,{get value(){return o()[e.key]??``},get placeholder(){return e.placeholder??``},get searchPlaceholder(){return e.placeholder??``},onChange:t=>s({...o(),[e.key]:t})}),l,d),t})():i(w,{get name(){return e.key},get label(){return e.label},get placeholder(){return h(()=>`placeholder`in e)()?e.placeholder:``},get value(){return o()[e.key]??``},onInput:t=>s({...o(),[e.key]:t})}))),u(n,i(T,{variant:`primary`,type:`submit`,get disabled(){return j()},get loading(){return j()},get children(){return a(`settings.general.save`)}})),e}})}}),y,b),e})()}export{G as GeneralSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.DeOz3HxE.js";import{n as g}from"./api.B03e8F6d.js";var _=o(`<div class="notice notice--error">`),v=o(`<div class="notice notice--success">`),y=o(`<div class=table-scroll><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),b=o(`<div class="resource-hub logs-manager"><!$><!/><!$><!/><section class=card><div class=card-header-row><div><h3></h3><p></p></div></div><form class="resource-form logs-retention-form"><label><!$><!/><input class=input type=number min=1 max=3650 required></label><button class="btn btn-primary"type=submit></button></form></section><section class=card><div class=card-header-row><h3></h3><button class=btn type=button></button></div><div class=logs-filters><input class=input><input class=input><button class=btn type=button></button></div><!$><!/>`),x=o(`<p>`),S=o(`<tr><td></td><td><code></code></td><td><!$><!/><!$><!/></td><td></td><td></td><td>`);function C(){let{t:o}=h(),[s,C]=n([]),[w,T]=n(90),[E,D]=n(``),[O,k]=n(``),[A,j]=n(``),[M,N]=n(``),[P,F]=n(!0),I=async()=>{F(!0),j(``);try{let[e,t]=await Promise.all([g.getAuditLogConfig(),g.listAuditLogs({limit:500,action:E()||void 0,resourceType:O()||void 0})]);T(e.retentionDays),C(t.data)}catch(e){j(e instanceof Error?e.message:String(e))}finally{F(!1)}};e(I);let L=async e=>{e.preventDefault();try{let e=await g.updateAuditLogConfig(w());T(e.retentionDays),N(o(`logs.retentionSaved`)),await I()}catch(e){j(e instanceof Error?e.message:String(e))}};return(()=>{var e=d(b),n=e.firstChild,[h,g]=p(n.nextSibling),C=h.nextSibling,[j,N]=p(C.nextSibling),F=j.nextSibling,R=F.firstChild,z=R.firstChild.firstChild,B=z.nextSibling,V=R.nextSibling,H=V.firstChild,U=H.firstChild,[W,ee]=p(U.nextSibling),G=W.nextSibling,te=H.nextSibling,K=F.nextSibling,q=K.firstChild,J=q.firstChild,Y=J.nextSibling,X=q.nextSibling,Z=X.firstChild,Q=Z.nextSibling,$=Q.nextSibling,ne=X.nextSibling,[re,ie]=p(ne.nextSibling);return l(e,r(t,{get when(){return A()},get children(){var e=d(_);return l(e,A),e}}),h,g),l(e,r(t,{get when(){return M()},get children(){var e=d(v);return l(e,M),e}}),j,N),l(z,()=>o(`logs.retentionTitle`)),l(B,()=>o(`logs.retentionDescription`)),V.addEventListener(`submit`,L),l(H,()=>o(`logs.retentionDays`),W,ee),G.$$input=e=>T(Number(e.currentTarget.value)),l(te,()=>o(`common.save`)),l(J,()=>o(`logs.historyTitle`)),Y.$$click=()=>void I(),l(Y,()=>o(`common.refresh`)),Z.$$input=e=>D(e.currentTarget.value),Q.$$input=e=>k(e.currentTarget.value),$.$$click=()=>void I(),l($,()=>o(`common.filter`)),l(K,r(t,{get when(){return!P()},get fallback(){return(()=>{var e=d(x);return l(e,()=>o(`logs.loading`)),e})()},get children(){return r(t,{get when(){return s().length>0},get fallback(){return(()=>{var e=d(x);return l(e,()=>o(`logs.empty`)),e})()},get children(){var e=d(y),t=e.firstChild.firstChild,n=t.firstChild.firstChild,i=n.nextSibling,c=i.nextSibling,u=c.nextSibling,f=u.nextSibling,h=f.nextSibling,g=t.nextSibling;return l(n,()=>o(`logs.columns.date`)),l(i,()=>o(`logs.columns.action`)),l(c,()=>o(`logs.columns.resource`)),l(u,()=>o(`logs.columns.user`)),l(f,()=>o(`logs.columns.status`)),l(h,()=>o(`logs.columns.ip`)),l(g,r(a,{get each(){return s()},children:e=>(()=>{var t=d(S),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling,s=a.firstChild,[c,u]=p(s.nextSibling),f=c.nextSibling,[h,g]=p(f.nextSibling),_=a.nextSibling,v=_.nextSibling,y=v.nextSibling;return l(n,(()=>{var t=m(()=>!!e.created_at);return()=>t()?new Date(e.created_at).toLocaleString():`—`})()),l(i,()=>e.action),l(a,()=>e.resourceType,c,u),l(a,(()=>{var t=m(()=>!!e.resourceId);return()=>t()?`:${e.resourceId}`:``})(),h,g),l(_,()=>e.userId??o(`logs.system`)),l(v,()=>String(e.changes?.status??`—`)),l(y,()=>e.ipAddress??`—`),t})()})),e}})}}),re,ie),i(e=>{var t=o(`logs.actionFilter`),n=o(`logs.resourceFilter`);return t!==e.e&&f(Z,`placeholder`,e.e=t),n!==e.t&&f(Q,`placeholder`,e.t=n),e},{e:void 0,t:void 0}),i(()=>u(G,`value`,w())),i(()=>u(Z,`value`,E())),i(()=>u(Q,`value`,O())),c(),e})()}s([`input`,`click`]);export{C as LogsManager};
|