2026-05-15 17:07:12 +03:00
var uP = Object . defineProperty ; var hP = ( i , e , t ) => e in i ? uP ( i , e , { enumerable : ! 0 , configurable : ! 0 , writable : ! 0 , value : t } ) : i [ e ] = t ; var Qh = ( i , e , t ) => ( hP ( i , typeof e != "symbol" ? e + "" : e , t ) , t ) ; function U ( ) { } const fP = i => i ; function Ps ( i , e ) { for ( const t in e ) i [ t ] = e [ t ] ; return i } function Yw ( i ) { return i ( ) } function Jp ( ) { return Object . create ( null ) } function ht ( i ) { i . forEach ( Yw ) } function nh ( i ) { return typeof i == "function" } function re ( i , e ) { return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function" } let qa ; function ad ( i , e ) { return i === e ? ! 0 : ( qa || ( qa = document . createElement ( "a" ) ) , qa . href = e , i === qa . href ) } function dP ( i ) { return Object . keys ( i ) . length === 0 } function Hl ( i , e , t , n ) { if ( i ) { const r = zw ( i , e , t , n ) ; return i [ 0 ] ( r ) } } function zw ( i , e , t , n ) { return i [ 1 ] && n ? Ps ( t . ctx . slice ( ) , i [ 1 ] ( n ( e ) ) ) : t . ctx } function Kl ( i , e , t , n ) { if ( i [ 2 ] && n ) { const r = i [ 2 ] ( n ( t ) ) ; if ( e . dirty === void 0 ) return r ; if ( typeof r == "object" ) { const s = [ ] , o = Math . max ( e . dirty . length , r . length ) ; for ( let l = 0 ; l < o ; l += 1 ) s [ l ] = e . dirty [ l ] | r [ l ] ; return s } return e . dirty | r } return e . dirty } function Jl ( i , e , t , n , r , s ) { if ( r ) { const o = zw ( e , t , n , s ) ; i . p ( o , r ) } } function ea ( i ) { if ( i . ctx . length > 32 ) { const e = [ ] , t = i . ctx . length / 32 ; for ( let n = 0 ; n < t ; n ++ ) e [ n ] = - 1 ; return e } return - 1 } function mP ( i ) { return i && nh ( i . destroy ) ? i . destroy : U } function eg ( i ) { const e = typeof i == "string" && i . match ( /^\s*(-?[\d.]+)([^\s]*)\s*$/ ) ; return e ? [ parseFloat ( e [ 1 ] ) , e [ 2 ] || "px" ] : [ i , "px" ] } const Vw = typeof window < "u" ; let pP = Vw ? ( ) => window . performance . now ( ) : ( ) => Date . now ( ) , Xm = Vw ? i => requestAnimationFrame ( i ) : U ; const lo = new Set ; function Uw ( i ) { lo . forEach ( e => { e . c ( i ) || ( lo . delete ( e ) , e . f ( ) ) } ) , lo . size !== 0 && Xm ( Uw ) } function gP ( i ) { let e ; return lo . size === 0 && Xm ( Uw ) , { promise : new Promise ( t => { lo . add ( e = { c : i , f : t } ) } ) , abort ( ) { lo . delete ( e ) } } } const OP = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : global ; function b ( i , e ) { i . appendChild ( e ) } function jw ( i ) { if ( ! i ) return document ; const e = i . getRootNode ? i . getRootNode ( ) : i . ownerDocument ; return e && e . host ? e : i . ownerDocument } function bP ( i ) { const e = y ( "style" ) ; return e . textContent = "/* empty */" , vP ( jw ( i ) , e ) , e . sheet } function vP ( i , e ) { return b ( i . head || i , e ) , e . sheet } function x ( i , e , t ) { i . insertBefore ( e , t || null ) } function P ( i ) { i . parentNode && i . parentNode . removeChild ( i ) } function Ot ( i , e ) { for ( let t = 0 ; t < i . length ; t += 1 ) i [ t ] && i [ t ] . d ( e ) } function y ( i ) { return document . createElement ( i ) } function wP ( i ) { return document . createElementNS ( "http://www.w3.org/2000/svg" , i ) } function W ( i ) { return document . createTextNode ( i ) } function D ( ) { return W ( " " ) } function Ie ( ) { return W ( "" ) } function G ( i , e , t , n ) { return i . addEventListener ( e , t , n ) , ( ) => i . removeEventListener ( e , t , n ) } function Ln ( i ) { return function ( e ) { return e . preventDefault ( ) , i . call ( this , e ) } } function O ( i , e , t ) { t == null ? i . removeAttribute ( e ) : i . getAttribute ( e ) !== t && i . setAttribute ( e , t ) } function Jo ( i , e , t ) { const n = e . toLowerCase ( ) ; n in i ? i [ n ] = typeof i [ n ] == "boolean" && t === "" ? ! 0 : t : e in i ? i [ e ] = typeof i [ e ] == "boolean" && t === "" ? ! 0 : t : O ( i , e , t ) } function qw ( i ) { let e ; return { p ( ... t ) { e = t , e . forEach ( n => i . push ( n ) ) } , r ( ) { e . forEach ( t => i . splice ( i . indexOf ( t ) , 1 ) ) } } } function Gw ( i ) { return i === "" ? null : + i } function yP ( i ) { return Array . from ( i . childNodes ) } function K ( i , e ) { e = "" + e , i . data !== e && ( i . data = e ) } function Le ( i , e ) { i . value = e ? ? "" } function le ( i , e , t , n ) { t == null ? i . style . removeProperty ( e ) : i . style . setProperty ( e , t , "" ) } function tg ( i , e , t ) { for ( let n = 0 ; n < i . options . length ; n += 1 ) { const r = i . options [ n ] ; if ( r . _ _value === e ) { r . selected = ! 0 ; return } } ( ! t || e !== void 0 ) && ( i . selectedIndex = - 1 ) } function kP ( i ) { const e = i . querySelector ( ":checked" ) ; return e && e . _ _value } function Ae ( i , e , t ) { i . classList . toggle ( e , ! ! t ) } function Hw ( i , e , { bubbles : t = ! 1 , cancelable : n = ! 1 } = { } ) { return new CustomEvent ( i , { detail : e , bubbles : t , cancelable : n } ) } function Xr ( i , e ) { return new i ( e ) } const su = new Map ; let ou = 0 ; function SP ( i ) { let e = 5381 , t = i . length ; for ( ; t -- ; ) e = ( e << 5 ) - e ^ i . charCodeAt ( t ) ; return e >>> 0 } function _P ( i , e ) { const t = { stylesheet : bP ( e ) , rules : { } } ; return su . set ( i , t ) , t } function ng ( i , e , t , n , r , s , o , l = 0 ) { const a = 16.666 / n ; let c = ` {
` ; for ( let g = 0 ; g <= 1 ; g += a ) { const v = e + ( t - e ) * s ( g ) ; c += g * 100 + ` %{ ${ o ( v , 1 - v ) } }
2026-05-08 17:55:22 +03:00
` } const u = c + ` 100% { ${ o ( t , 1 - t ) } }
2026-05-15 17:07:12 +03:00
} ` , h = ` __svelte_ ${ SP ( u ) } _ ${ l } ` , f = jw ( i ) , { stylesheet : d , rules : m } = su . get ( f ) || _P ( f , i ) ; m [ h ] || ( m [ h ] = ! 0 , d . insertRule ( ` @keyframes ${ h } ${ u } ` , d . cssRules . length ) ) ; const p = i . style . animation || "" ; return i . style . animation = ` ${ p ? ` ${ p } , ` : "" } ${ h } ${ n } ms linear ${ r } ms 1 both ` , ou += 1 , h } function CP ( i , e ) { const t = ( i . style . animation || "" ) . split ( ", " ) , n = t . filter ( e ? s => s . indexOf ( e ) < 0 : s => s . indexOf ( "__svelte" ) === - 1 ) , r = t . length - n . length ; r && ( i . style . animation = n . join ( ", " ) , ou -= r , ou || PP ( ) ) } function PP ( ) { Xm ( ( ) => { ou || ( su . forEach ( i => { const { ownerNode : e } = i . stylesheet ; e && P ( e ) } ) , su . clear ( ) ) } ) } let ta ; function Tl ( i ) { ta = i } function Bo ( ) { if ( ! ta ) throw new Error ( "Function called outside component initialization" ) ; return ta } function xi ( i ) { Bo ( ) . $$ . on _mount . push ( i ) } function Kw ( i ) { Bo ( ) . $$ . after _update . push ( i ) } function Jw ( i ) { Bo ( ) . $$ . on _destroy . push ( i ) } function nn ( ) { const i = Bo ( ) ; return ( e , t , { cancelable : n = ! 1 } = { } ) => { const r = i . $$ . callbacks [ e ] ; if ( r ) { const s = Hw ( e , t , { cancelable : n } ) ; return r . slice ( ) . forEach ( o => { o . call ( i , s ) } ) , ! s . defaultPrevented } return ! 0 } } function Ql ( i , e ) { return Bo ( ) . $$ . context . set ( i , e ) , e } function Ue ( i ) { return Bo ( ) . $$ . context . get ( i ) } function vs ( i , e ) { const t = i . $$ . callbacks [ e . type ] ; t && t . slice ( ) . forEach ( n => n . call ( this , e ) ) } const Hs = [ ] , Ce = [ ] ; let ao = [ ] ; const cd = [ ] , AP = Promise . resolve ( ) ; let ud = ! 1 ; function xP ( ) { ud || ( ud = ! 0 , AP . then ( ey ) ) } function As ( i ) { ao . push ( i ) } function st ( i ) { cd . push ( i ) } const Mh = new Set ; let Vs = 0 ; function ey ( ) { if ( Vs !== 0 ) return ; const i = ta ; do { try { for ( ; Vs < Hs . length ; ) { const e = Hs [ Vs ] ; Vs ++ , Tl ( e ) , TP ( e . $$ ) } } catch ( e ) { throw Hs . length = 0 , Vs = 0 , e } for ( Tl ( null ) , Hs . length = 0 , Vs = 0 ; Ce . length ; ) Ce . pop ( ) ( ) ; for ( let e = 0 ; e < ao . length ; e += 1 ) { const t = ao [ e ] ; Mh . has ( t ) || ( Mh . add ( t ) , t ( ) ) } ao . length = 0 } while ( Hs . length ) ; for ( ; cd . length ; ) cd . pop ( ) ( ) ; ud = ! 1 , Mh . clear ( ) , Tl ( i ) } function TP ( i ) { if ( i . fragment !== null ) { i . update ( ) , ht ( i . before _update ) ; const e = i . dirty ; i . dirty = [ - 1 ] , i . fragment && i . fragment . p ( i . ctx , e ) , i . after _update . forEach ( As ) } } function QP ( i ) { const e = [ ] , t = [ ] ; ao . forEach ( n => i . indexOf ( n ) === - 1 ? e . push ( n ) : t . push ( n ) ) , t . forEach ( n => n ( ) ) , ao = e } let el ; function MP ( ) { return el || ( el = Promise . resolve ( ) , el . then ( ( ) => { el = null } ) ) , el } function Eh ( i , e , t ) { i . dispatchEvent ( Hw ( ` ${ e ? "intro" : "outro" } ${ t } ` ) ) } const Lc = new Set ; let sr ; function Oe ( ) { sr = { r : 0 , c : [ ] , p : sr } } function be ( ) { sr . r || ht ( sr . c ) , sr = sr . p } function T ( i , e ) { i && i . i && ( Lc . delete ( i ) , i . i ( e ) ) } function R ( i , e , t , n ) { if ( i && i . o ) { if ( Lc . has ( i ) ) return ; Lc . add ( i ) , sr . c . push ( ( ) => { Lc . delete ( i ) , n && ( t && i . d ( 1 ) , n ( ) ) } ) , i . o ( e ) } else n && n ( ) } const EP = { duration : 0 } ; function lu ( i , e , t , n ) { let s = e ( i , t , { direction : "both" } ) , o = n ? 0 : 1 , l = null , a = null , c = null , u ; function h ( ) { c && CP ( i , c ) } function f ( m , p ) { const g = m . b - o ; return p *= Math . abs ( g ) , { a : o , b : m . b , d : g , duration : p , start : m . start , end : m . start + p , group : m . group } } function d ( m ) { const { delay : p = 0 , duration : g = 300 , easing : v = fP , tick : w = U , css : S } = s || EP , _ = { start : pP ( ) + p , b : m } ; m || ( _ . group = sr , sr . r += 1 ) , "inert" in i && ( m ? u !== void 0 && ( i . inert = u ) : ( u = i . inert , i . inert = ! 0 ) ) , l || a ? a = _ : ( S && ( h ( ) , c = ng ( i , o , m , g , p , v , S ) ) , m && w ( 0 , 1 ) , l = f ( _ , g ) , As ( ( ) => Eh ( i , m , "start" ) ) , gP ( k => { if ( a && k > a . start && ( l = f ( a , g ) , a = null , Eh ( i , l . b , "start" ) , S && ( h ( ) , c = ng ( i , o , l . b , l . duration , 0 , v , s . css ) ) ) , l ) { if ( k >= l . end ) w ( o = l . b , 1 - o ) , Eh ( i , l . b , "end" ) , a || ( l . b ? h ( ) : -- l . group . r || ht ( l . group . c ) ) , l = null ; else if ( k >= l . start ) { const A = k - l . start ; o = l . a + l . d * v ( A / l . duration ) , w ( o , 1 - o ) } } return ! ! ( l || a ) } ) ) } return { run ( m ) { nh ( s ) ? MP ( ) . then ( ( ) => { s = s ( { direction : m ? "in" : "out" } ) , d ( m ) } ) : d ( m ) } , end ( ) { h ( ) , l = a = null } } } function fe ( i ) { return ( i == null ? void 0 : i . length ) !== void 0 ? i : Array . from ( i ) } function Fm ( i , e ) { i . d ( 1 ) , e . delete ( i . key ) } function Jr ( i , e ) { R ( i , 1 , 1 , ( ) => { e . delete ( i . key ) } ) } function Ti ( i , e , t , n , r , s , o , l , a , c , u , h ) { let f = i . length , d = s . length , m = f ; const p = { } ; for ( ; m -- ; ) p [ i [ m ] . key ] = m ; const g = [ ] , v = new Map , w = new Map , S = [ ] ; for ( m = d ; m -- ; ) { const C = h ( r , s , m ) , Q = t ( C ) ; let M = o . get ( Q ) ; M ? S . push ( ( ) => M . p ( C , e ) ) : ( M = c ( Q , C ) , M . c ( ) ) , v . set ( Q , g [ m ] = M ) , Q in p && w . set ( Q , Math . abs ( m - p [ Q ] ) ) } const _ = new Set , k = new Set ; function A ( C ) { T ( C , 1 ) , C . m ( l , u ) , o . set ( C . key , C ) , u = C . first , d -- } for ( ; f && d ; ) { const C = g [ d - 1 ] , Q = i [ f - 1 ] , M = C . key , L = Q . key ; C === Q ? ( u = C . first , f -- , d -- ) : v . has ( L ) ? ! o . has ( M ) || _ . has ( M ) ? A ( C ) : k . has ( L ) ? f -- : w . get ( M ) > w . get ( L ) ? ( k . add ( M ) , A ( C ) ) : ( _ . add ( L ) , f -- ) : ( a ( Q , o ) , f -- ) } for ( ; f -- ; ) { const C = i [ f ] ; v . has ( C . key ) || a ( C , o ) } for ( ; d ; ) A ( g [ d - 1 ] ) ; return ht (
< img alt = "indicator" id = "indicator" class = "htmx-indicator" src = "/img/spinner.svg" / > ` ,O(t,"class","mb-5"),O(u,"for","emailaddress"),O(u,"class","form-label"),O(f,"type","email"),O(f,"class","form-control"),O(f,"id","emailaddress"),f.required=!0,O(c,"class","mt-5 mb-3"),O(m,"class","bt bt-primary"),O(e,"class","form")},m(v,w){x(v,e,w),b(e,t),b(e,n),b(e,r),b(r,s),b(r,o),b(r,l),b(r,a),b(r,c),b(c,u),b(c,h),b(c,f),Le(f,i[0]),b(r,d),b(r,m),p||(g=[G(f,"input",i[3]),G(r,"submit",i[2])],p=!0)},p(v,w){w&1&&f.value!==v[0]&&Le(f,v[0])},d(v){v&&P(e),p=!1,ht(g)}}}function sx(i){let e,t,n,r,s,o,l,a;return{c(){e=y("div"),t=y("p"),n=W("You will receive an email with a login link at "),r=y("b"),s=W(i[0]),o=W("."),l=D(),a=y("p"),a.textContent="Check your spam folder",O(e,"class","alert alert-info"),O(e,"role","alert")},m(c,u){x(c,e,u),b(e,t),b(t,n),b(t,r),b(r,s),b(t,o),b(e,l),b(e,a)},p(c,u){u&1&&K(s,c[0])},d(c){c&&P(e)}}}function ox(i){let e,t,n,r;function s(a,c){return a[1]?sx:rx}let o=s(i),l=o(i);return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),l.c(),O(t,"class","bg-image"),O(r,"class","login-form"),O(e,"class","scope-login")},m(a,c){x(a,e,c),b(e,t),b(e,n),b(e,r),l.m(r,null)},p(a,[c]){o===(o=s(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(r,null)))},i:U,o:U,d(a){a&&P(e),l.d()}}}function lx(i,e,t){const n=Ue("channel");let r="",s=!1;function o(a){a.preventDefault(),Jn(n.lucentUrl+"/login",{email:r}).then(()=>{t(1,s=!0)}).catch(()=>{})}function l(){r=this.value,t(0,r)}return[r,s,o,l]}class ax extends oe{constructor(e){super(),se(this,e,lx,ox,re,{})}}function cx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w;return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),s=y("div"),o=y("h2"),o.textContent="Welcome to Lucent",l=D(),a=y("form"),c=y("button"),u=W("Enter as "),h=W(i[0]),f=D(),d=y("img"),p=D(),g=y("div"),O(t,"class","bg-image"),O(o,"class","mb-5"),O(d,"alt","indicator"),O(d,"id","indicator"),O(d,"class","htmx-indicator"),ad(d.src,m="/img/spinner.svg")||O(d,"src",m),O(c,"class","bt bt-primary"),O(g,"class","form-errors"),O(s,"class","form"),O(r,"class","login-form"),O(e,"class","scope-login")},m(S,_){x(S,e,_),b(e,t),b(e,n),b(e,r),b(r,s),b(s,o),b(s,l),b(s,a),b(a,c),b(c,u),b(c,h),b(c,f),b(c,d),b(s,p),b(s,g),v||(w=G(a,"submit",i[1]),v=!0)},p(S,[_]){_&1&&K(h,S[0])},i:U,o:U,d(S){S&&P(e),v=!1,w()}}}function ux(i,e,t){const n=Ue("channel");let{email:r}=e,{token:s}=e;function o(l){l.preventDefault(),Jn(n.lucentUrl+"/verify",{email:r,token:s}).then(a=>{window.location=n.lucentUrl}).catch(a=>{})}return i. $ $ set=l=>{"email"in l&&t(0,r=l.email),"token"in l&&t(2,s=l.token)},[r,o,s]}class hx extends oe{constructor(e){super(),se(this,e,ux,cx,re,{email:0,token:2})}}function fx(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[2]),O(t,"class","avatar__letters"),O(e,"class","avatar"),O(e,"title",i[0]),le(e,"background-color",i[3][i[4]]),le(e,"height",i[1]+"px"),le(e,"width",i[1]+"px"),le(e,"font-size",i[1]/2+"px")},m(r,s){x(r,e,s),b(e,t),b(t,n)},p(r,[s]){s&4&&K(n,r[2]),s&1&&O(e,"title",r[0]),s&2&&le(e,"height",r[1]+"px"),s&2&&le(e,"width",r[1]+"px"),s&2&&le(e,"font-size",r[1]/2+"px")},i:U,o:U,d(r){r&&P(e)}}}function dx(i,e,t){let{name:n}=e,{side:r=48}=e;const s=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let o="";n.split(" ").length>1?o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[1].charAt(0).toUpperCase():o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[0].charAt(1).toUpperCase();let a=(n.charCodeAt(1)+n.length)%19;return i. $ $ set=c=>{"name"in c&&t(0,n=c.name),"side"in c&&t(1,r=c.side)},[n,r,o,s,a]}class _i extends oe{constructor(e){super(),se(this,e,dx,fx,re,{name:0,side:1})}}function mx(i){const e=i-1;return e*e*e+1}function hu(i,{delay:e=0,duration:t=400,easing:n=mx,x:r=0,y:s=0,opacity:o=0}={}){const l=getComputedStyle(i),a=+l.opacity,c=l.transform==="none"?"":l.transform,u=a*(1-o),[h,f]=eg(r),[d,m]=eg(s);return{delay:e,duration:t,easing:n,css:(p,g)=> `
2026-05-08 17:55:22 +03:00
transform : $ { c } translate ( $ { ( 1 - p ) * h } $ { f } , $ { ( 1 - p ) * d } $ { m } ) ;
2026-05-15 17:07:12 +03:00
opacity : $ { a - u * g } ` }}function dg(i){let e,t,n,r,s,o,l;return{c(){e=y("div"),t=y("div"),t.textContent="Success",n=D(),r=y("div"),s=W(i[1]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-success"),O(e,"role","alert")},m(a,c){x(a,e,c),b(e,t),b(e,n),b(e,r),b(r,s),l=!0},p(a,c){(!l||c&2)&&K(s,a[1])},i(a){l||(a&&As(()=>{l&&(o||(o=lu(e,hu,{duration:500},!0)),o.run(1))}),l=!0)},o(a){a&&(o||(o=lu(e,hu,{duration:500},!1)),o.run(0)),l=!1},d(a){a&&P(e),a&&o&&o.end()}}}function px(i){let e,t=i[0]&&dg(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&T(t,1)):(t=dg(n),t.c(),T(t,1),t.m(e.parentNode,e)):t&&(Oe(),R(t,1,1,()=>{t=null}),be())},i(n){T(t)},o(n){R(t)},d(n){n&&P(e),t&&t.d(n)}}}function gx(i,e,t){let n,r;function s(o="Saved"){t(1,n=o),t(0,r=!0),setTimeout(function(){t(0,r=!1)},2e3)}return t(1,n="Saved"),t(0,r=!1),[r,n,s]}class ay extends oe{constructor(e){super(),se(this,e,gx,px,re,{show:2})}get show(){return this. $ $ .ctx[2]}}function Ox(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M,L;t=new Ma({props:{message:i[2]}});let N={};return r=new ay({props:N}),i[8](r),l=new _i({props:{name:i[4].name}}),d=new uu({props:{label:"Update Name"}}),S=new uu({props:{label:"Update Email"}}),{c(){e=y("div"),V(t. $ $ .fragment),n=D(),V(r. $ $ .fragment),s=D(),o=y("h3"),V(l. $ $ .fragment),a=D(),c=y("form"),u=y("div"),h=y("input"),f=D(),V(d. $ $ .fragment),m=D(),p=y("form"),g=y("div"),v=y("input"),w=D(),V(S. $ $ .fragment),_=D(),k=y("div"),A=y("a"),C=W("Logout from this device"),O(o,"class","header-small mb-5"),O(h,"type","text"),O(h,"class","form-control mb-3"),O(h,"placeholder","Name"),h.required=!0,O(u,"class","input-group mb-5"),O(v,"type","email"),O(v,"class","form-control mb-3"),O(v,"placeholder","Email"),v.required=!0,O(g,"class","input-group mb-5"),O(A,"class","list-group-item list-group-item-action"),O(A,"href",i[5].lucentUrl+"/logout"),O(k,"class","list-group"),O(e,"class","wrapper-tiny")},m(B,J){x(B,e,J),Y(t,e,null),b(e,n),Y(r,e,null),b(e,s),b(e,o),Y(l,o,null),b(e,a),b(e,c),b(c,u),b(u,h),Le(h,i[0]),b(u,f),Y(d,u,null),b(e,m),b(e,p),b(p,g),b(g,v),Le(v,i[1]),b(g,w),Y(S,g,null),b(e,_),b(e,k),b(k,A),b(A,C),Q=!0,M||(L=[G(h,"input",i[9]),G(c,"submit",i[6]),G(v,"input",i[10]),G(p,"submit",i[7])],M=!0)},p(B,[J]){const te={};J&4&&(te.message=B[2]),t. $ set(te);const ie={};r. $ set(ie),J&1&&h.value!==B[0]&&Le(h,B[0]),J&2&&v.value!==B[1]&&Le(v,B[1])},i(B){Q||(T(t. $ $ .fragment,B),T(r. $ $ .fragment,B),T(l. $ $ .fragment,B),T(d. $ $ .fragment,B),T(S. $ $ .fragment,B),Q=!0)},o(B){R(t. $ $ .fragment,B),R(r. $ $ .fragment,B),R(l. $ $ .fragment,B),R(d. $ $ .fragment,B),R(S. $ $ .fragment,B),Q=!1},d(B){B&&P(e),z(t),i[8](null),z(r),z(l),z(d),z(S),M=!1,ht(L)}}}function bx(i,e,t){const n=Ue("user"),r=Ue("channel");let s=n.name,o=n.email,l="",a;function c(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-name",{name:s}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function u(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-email",{email:o}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function h(m){Ce[m?"unshift":"push"](()=>{a=m,t(3,a)})}function f(){s=this.value,t(0,s)}function d(){o=this.value,t(1,o)}return[s,o,l,a,n,r,c,u,h,f,d]}class vx extends oe{constructor(e){super(),se(this,e,bx,Ox,re,{})}}function wx(i){let e,t,n;const r=[{channel:i[3]},{title:i[0]},i[2]];var s=i[4][i[1]];function o(l,a){let c={};for(let u=0;u<r.length;u+=1)c=Ps(c,r[u]);return a!==void 0&&a&13&&(c=Ps(c,_o(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&Co(l[2])]))),{props:c}}return s&&(t=Xr(s,o(i))),{c(){e=y("div"),t&&V(t. $ $ .fragment)},m(l,a){x(l,e,a),t&&Y(t,e,null),n=!0},p(l,[a]){if(a&2&&s!==(s=l[4][l[1]])){if(t){Oe();const c=t;R(c. $ $ .fragment,1,0,()=>{z(c,1)}),be()}s?(t=Xr(s,o(l,a)),V(t. $ $ .fragment),T(t. $ $ .fragment,1),Y(t,e,null)):t=null}else if(s){const c=a&13?_o(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&Co(l[2])]):{};t. $ set(c)}},i(l){n||(t&&T(t. $ $ .fragment,l),n=!0)},o(l){t&&R(t. $ $
Save ` , O ( e , "type" , "button" ) , O ( e , "class" , "button primary ms-2 btn btn-primary btn-spinner" ) } , m ( r , s ) { x ( r , e , s ) , t || ( n = G ( e , "click" , i [ 10 ] ) , t = ! 0 ) } , p : U , d ( r ) { r && P ( e ) , t = ! 1 , n ( ) } } } function gT ( i ) { let e , t , n ; return { c ( ) { e = y ( "button" ) , e . innerHTML = ` <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create ` , O ( e , "class" , "button primary btn-spinner" ) } , m ( r , s ) { x ( r , e , s ) , t || ( n = G ( e , "click" , i [ 10 ] ) , t = ! 0 ) } , p : U , d ( r ) { r && P ( e ) , t = ! 1 , n ( ) } } } function qg ( i ) { let e , t , n , r ; function s ( a ) { i [ 14 ] ( a ) } function o ( a ) { i [ 15 ] ( a ) } let l = { field : i [ 24 ] , schema : i [ 2 ] , record : i [ 0 ] , validationErrors : i [ 4 ] , isCreateMode : i [ 3 ] } ; return i [ 0 ] . data !== void 0 && ( l . data = i [ 0 ] . data ) , i [ 1 ] !== void 0 && ( l . graph = i [ 1 ] ) , e = new aP ( { props : l } ) , Ce . push ( ( ) => nt ( e , "data" , s ) ) , Ce . push ( ( ) => nt ( e , "graph" , o ) ) , { c ( ) { V ( e . $$ . fragment ) } , m ( a , c ) { Y ( e , a , c ) , r = ! 0 } , p ( a , c ) { const u = { } ; c & 4 && ( u . schema = a [ 2 ] ) , c & 1 && ( u . record = a [ 0 ] ) , c & 16 && ( u . validationErrors = a [ 4 ] ) , c & 8 && ( u . isCreateMode = a [ 3 ] ) , ! t && c & 1 && ( t = ! 0 , u . data = a [ 0 ] . data , st ( ( ) => t = ! 1 ) ) , ! n && c & 2 && ( n = ! 0 , u . graph = a [ 1 ] , st ( ( ) => n = ! 1 ) ) , e . $set ( u ) } , i ( a ) { r || ( T ( e . $$ . fragment , a ) , r = ! 0 ) } , o ( a ) { R ( e . $$ . fragment , a ) , r = ! 1 } , d ( a ) { z ( e , a ) } } } function Gg ( i , e ) { let t , n , r , s = e [ 5 ] === e [ 24 ] . group && qg ( e ) ; return { key : i , first : null , c ( ) { t = Ie ( ) , s && s . c ( ) , n = Ie ( ) , this . first = t } , m ( o , l ) { x ( o , t , l ) , s && s . m ( o , l ) , x ( o , n , l ) , r = ! 0 } , p ( o , l ) { e = o , e [ 5 ] === e [ 24 ] . group ? s ? ( s . p ( e , l ) , l & 32 && T ( s , 1 ) ) : ( s = qg ( e ) , s . c ( ) , T ( s , 1 ) , s . m ( n . parentNode , n ) ) : s && ( Oe ( ) , R ( s , 1 , 1 , ( ) => { s = null } ) , be ( ) ) } , i ( o ) { r || ( T ( s ) , r = ! 0 ) } , o ( o ) { R ( s ) , r = ! 1 } , d ( o ) { o && ( P ( t ) , P ( n ) ) , s && s . d ( o ) } } } function OT ( i ) { let e , t , n , r , s , o , l , a , c , u , h , f , d , m , p , g , v , w = [ ] , S = new Map , _ , k , A ; function C ( X ) { i [ 11 ] ( X ) } function Q ( X ) { i [ 12 ] ( X ) } let M = { schema : i [ 2 ] , isCreateMode : i [ 3 ] } ; i [ 0 ] !== void 0 && ( M . record = i [ 0 ] ) , i [ 5 ] !== void 0 && ( M . activeContentTab = i [ 5 ] ) , n = new cy ( { props : M } ) , Ce . push ( ( ) => nt ( n , "record" , C ) ) , Ce . push ( ( ) => nt ( n , "activeContentTab" , Q ) ) ; function L ( X , ee ) { if ( X [ 3 ] ) return gT ; if ( X [ 6 ] ) return pT } let N = L ( i ) , B = N && N ( i ) ; a = new _y ( { props : { schema : i [ 2 ] , record : i [ 0 ] , isCreateMode : i [ 3 ] } } ) , u = new Ma ( { props : { message : i [ 7 ] } } ) ; function J ( X ) { i [ 13 ] ( X ) } let te = { schema : i [ 2 ] , isCreateMode : i [ 3 ] } ; i [ 5 ] !== void 0 && ( te . active = i [ 5 ] ) , d = new uy ( { props : te } ) , Ce . push ( ( ) => nt ( d , "active" , J ) ) , g = new uT ( { props : { record : i [ 0 ] , schema : i [ 2 ] } } ) ; let ie = fe ( i [ 8 ] ) ; const ae = X => X [ 24 ] . name ; for ( let X = 0 ; X < ie . length ; X += 1 ) { let ee = jg ( i , ie , X ) , Te = ae ( ee ) ; S . set ( Te , w [ X ] = Gg ( Te , ee ) ) } return { c ( ) { e = y ( "div" ) , t = y ( "div" ) , V ( n . $$ . fragment ) , o = D ( ) , B && B . c ( ) , l = D ( ) , V ( a . $$ . fragment ) , c = D ( ) , V ( u . $$ . fragment ) , h = D ( ) , f = y ( "div" ) , V ( d . $$ . fragment ) , p = D ( ) , V ( g . $$ . fragment ) , v = D ( ) ; for ( let X = 0 ; X < w . length ; X += 1 ) w [ X ] . c ( ) ; O ( t , "class" , "tools-header" ) , O ( f , "class" , "mt-4" ) , le ( f , "margin-bottom" , "150px" ) , le ( f , "position" , "relative" ) , O ( e , "class" , "inline-edit record-edit" ) } , m ( X , ee ) { x ( X , e , ee ) , b ( e , t ) , Y ( n , t , null ) , b ( t , o ) , B && B . m ( t , null ) , b ( e , l ) , Y ( a , e , null ) , b ( e , c ) , Y ( u , e , null ) , b ( e , h ) , b ( e , f ) , Y ( d , f , null ) , b ( f , p ) , Y ( g , f , null ) , b ( f , v ) ; for ( let Te = 0 ; Te < w . length ; Te += 1 ) w [ Te ] && w [ Te ] . m ( f , null ) ; _ = ! 0 , k || ( A = G ( window , "beforeunload" , i [ 9 ] ) , k = ! 0 ) } , p ( X , [ ee ] ) { const Te = { } ; ee & 4 && ( Te . schema = X [ 2 ] ) , ee & 8 && ( Te . isCreateMode = X [ 3 ] ) , ! r && ee & 1 && ( r = ! 0 , Te . record = X [ 0 ] , st ( ( ) => r = ! 1 ) ) , ! s && ee & 32 && ( s = ! 0 , Te . activeContentTab = X [ 5 ] , st ( ( ) => s = ! 1 ) ) , n . $set ( Te ) , N === ( N = L ( X ) ) && B ? B . p ( X , ee ) : ( B && B . d ( 1 ) , B = N && N ( X ) , B && ( B . c ( ) , B . m ( t , null ) ) ) ; const ve = { } ; ee & 4 && ( ve . schema = X [ 2 ] ) , ee & 1 && ( ve . record = X [ 0 ] ) , ee & 8 && ( ve . isCreateMode = X [ 3 ] ) , a . $set ( ve ) ; const je = { } ; ee & 128 && ( je . message = X [ 7 ] ) , u . $set ( je ) ; const ne = { } ; ee & 4 && ( ne . schema = X [ 2 ] ) , ee & 8 && ( ne . isCreateMode = X [ 3 ] ) , ! m && ee & 32 && ( m = ! 0 , ne . active = X [ 5 ] , st ( ( ) => m = ! 1 ) ) , d . $set ( ne ) ; const Ee = { } ; ee & 1 && ( Ee . record = X [ 0 ] ) , ee & 4 && ( Ee . schema = X [ 2 ] ) , g . $set ( Ee ) , ee & 319 && ( ie = fe ( X [ 8 ] ) , Oe ( ) , w = Ti ( w , ee , ae , 1 , X , ie , S , f , Jr , Gg , null , jg ) , be ( ) ) } , i ( X ) { if ( ! _ ) { T ( n . $$ . fragment , X ) , T ( a . $$ . fragment , X ) , T ( u . $$ . fragment , X ) , T ( d . $$ . fragment , X ) , T ( g . $$ . fragment , X ) ; for ( let ee = 0 ; ee < ie . length ; ee += 1 ) T ( w [ ee ] ) ; _ = ! 0 } } , o ( X ) { R ( n . $$ . fragment , X ) , R ( a . $$ . fragment , X ) , R ( u . $$ . fragment , X ) , R ( d . $$ . fragment , X ) , R ( g . $$ . fragment , X ) ; for ( let ee = 0 ; ee < w . length ; ee += 1 ) R ( w [ ee ] ) ; _ = ! 1 } , d ( X ) { X && P ( e ) , z ( n ) , B && B . d ( ) , z ( a ) , z ( u ) , z ( d ) , z ( g ) ; for ( let ee = 0 ; ee < w . length ; ee += 1 ) w [ ee ] . d ( ) ; k = ! 1 , A ( ) } } } function bT ( i , e , t ) { let n , r ; const s = Ue ( "channel" ) , o = nn ( ) ; let { schema : l } = e , { record : a } = e , { graph : c = { records : [ ] , edges : [ ] } } = e , { isCreateMode : u } = e , h , f = "" , d = ! 1 , m = l . fields . filter ( M => M . name !== "id" ) , p = "_default" ; l . fields . reduce ( ( M , L ) => L . ui === "tab" ? ( p = L . name , M ) : ( M [ p ] = [ ... M [ p ] ? ? [ ] , L . name ] , M ) , [ ] ) , xi ( ( ) => { g ( ) } ) ; function g ( ) { h = { data : JSON . parse ( JSON . stringify ( a . data ) ) , schema : a . schema , status : a . status , edges : JSON . parse ( JSON . stringify ( c . edges ) ) } } Kw ( ( ) => { t ( 6 , d = w ( ) ) } ) ; function
Back ` ),r=D();for(let h=0;h<u.length;h+=1)u[h].c();s=Ie(),O(e,"class","dropdown-item button")},m(h,f){x(h,e,f),Y(t,e,null),b(e,n),x(h,r,f);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(h,f);x(h,s,f),o=!0,l||(a=G(e,"click",i[23]),l=!0)},p(h,f){if(f[0]&2560){c=fe(h[9]);let d;for(d=0;d<c.length;d+=1){const m=iO(h,c,d);u[d]?u[d].p(m,f):(u[d]=sO(m),u[d].c(),u[d].m(s.parentNode,s))}for(;d<u.length;d+=1)u[d].d(1);u.length=c.length}},i(h){o||(T(t. $ $ .fragment,h),o=!0)},o(h){R(t. $ $ .fragment,h),o=!1},d(h){h&&(P(e),P(r),P(s)),z(t),Ot(u,h),l=!1,a()}}}function sO(i){let e,t,n;function r(...s){return i[24](i[39],...s)}return{c(){e=y("button"),e.textContent= ` $ { i [ 39 ] . label } ` ,O(e,"class","dropdown-item button")},m(s,o){x(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function oO(i){let e,t,n,r,s,o,l=i[3].label+"",a,c,u,h,f,d;t=new ut({props:{icon:"arrow-left"}});let m=fe(i[7]),p=[];for(let g=0;g<m.length;g+=1)p[g]=lO(nO(i,m,g));return{c(){e=y("button"),V(t. $ $ .fragment),n=W( `
Back ` ),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D();for(let g=0;g<p.length;g+=1)p[g].c();u=Ie(),O(e,"class","dropdown-item button"),O(s,"class","selected-filter")},m(g,v){x(g,e,v),Y(t,e,null),b(e,n),x(g,r,v),x(g,s,v),b(s,o),b(s,a),x(g,c,v);for(let w=0;w<p.length;w+=1)p[w]&&p[w].m(g,v);x(g,u,v),h=!0,f||(d=G(e,"click",i[25]),f=!0)},p(g,v){if((!h||v[0]&8)&&l!==(l=g[3].label+"")&&K(a,l),v[0]&8320){m=fe(g[7]);let w;for(w=0;w<m.length;w+=1){const S=nO(g,m,w);p[w]?p[w].p(S,v):(p[w]=lO(S),p[w].c(),p[w].m(u.parentNode,u))}for(;w<p.length;w+=1)p[w].d(1);p.length=m.length}},i(g){h||(T(t. $ $ .fragment,g),h=!0)},o(g){R(t. $ $ .fragment,g),h=!1},d(g){g&&(P(e),P(r),P(s),P(c),P(u)),z(t),Ot(p,g),f=!1,d()}}}function lO(i){let e,t=i[42].label+"",n,r,s,o;function l(...a){return i[26](i[42],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","dropdown-item button")},m(a,c){x(a,e,c),b(e,n),b(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c[0]&128&&t!==(t=i[42].label+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function aO(i){let e,t,n,r,s,o,l=i[3].label+"",a,c,u=i[5].label+"",h,f,d,m,p,g,v,w,S;return t=new ut({props:{icon:"arrow-left"}}),{c(){e=y("button"),V(t. $ $ .fragment),n=W( `
Back ` ),r=D(),s=y("div"),o=W("field: "),a=W(l),c=W(" operator: "),h=W(u),f=D(),d=y("div"),m=y("input"),p=D(),g=y("button"),g.textContent="Add filter",O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(m,"type","text"),O(m,"class","form-control"),O(d,"class","filter-input"),O(g,"class","button applied-filter"),O(g,"type","button")},m(_,k){x(_,e,k),Y(t,e,null),b(e,n),x(_,r,k),x(_,s,k),b(s,o),b(s,a),b(s,c),b(s,h),x(_,f,k),x(_,d,k),b(d,m),Le(m,i[2]),x(_,p,k),x(_,g,k),v=!0,w||(S=[G(e,"click",i[27]),G(m,"input",i[28]),G(g,"click",i[14])],w=!0)},p(_,k){(!v||k[0]&8)&&l!==(l=_[3].label+"")&&K(a,l),(!v||k[0]&32)&&u!==(u=_[5].label+"")&&K(h,u),k[0]&4&&m.value!==_[2]&&Le(m,_[2])},i(_){v||(T(t. $ $ .fragment,_),v=!0)},o(_){R(t. $ $ .fragment,_),v=!1},d(_){_&&(P(e),P(r),P(s),P(f),P(d),P(p),P(g)),z(t),w=!1,ht(S)}}}function cO(i){let e,t,n,r,s,o,l,a;t=new ut({props:{icon:"arrow-left"}});let c=fe(i[10]),u=[];for(let h=0;h<c.length;h+=1)u[h]=uO(tO(i,c,h));return{c(){e=y("button"),V(t. $ $ .fragment),n=W( `
Back ` ),r=D();for(let h=0;h<u.length;h+=1)u[h].c();s=Ie(),O(e,"class","dropdown-item button")},m(h,f){x(h,e,f),Y(t,e,null),b(e,n),x(h,r,f);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(h,f);x(h,s,f),o=!0,l||(a=G(e,"click",i[29]),l=!0)},p(h,f){if(f[0]&5120){c=fe(h[10]);let d;for(d=0;d<c.length;d+=1){const m=tO(h,c,d);u[d]?u[d].p(m,f):(u[d]=uO(m),u[d].c(),u[d].m(s.parentNode,s))}for(;d<u.length;d+=1)u[d].d(1);u.length=c.length}},i(h){o||(T(t. $ $ .fragment,h),o=!0)},o(h){R(t. $ $ .fragment,h),o=!1},d(h){h&&(P(e),P(r),P(s)),z(t),Ot(u,h),l=!1,a()}}}function uO(i){let e,t,n;function r(...s){return i[30](i[39],...s)}return{c(){e=y("button"),e.textContent= ` $ { i [ 39 ] . label } ` ,O(e,"class","dropdown-item button")},m(s,o){x(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function hO(i){let e,t,n,r,s,o,l=i[4].label+"",a,c,u,h,f,d,m,p;t=new ut({props:{icon:"arrow-left"}});function g(w){i[32](w)}let v={field:i[4]};return i[2]!==void 0&&(v.value=i[2]),h=new kT({props:v}),Ce.push(()=>nt(h,"value",g)),h. $ on("addFilter",i[14]),{c(){e=y("button"),V(t. $ $ .fragment),n=W( `
Back ` ),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D(),u=y("div"),V(h. $ $ .fragment),O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(u,"class","mt-2")},m(w,S){x(w,e,S),Y(t,e,null),b(e,n),x(w,r,S),x(w,s,S),b(s,o),b(s,a),x(w,c,S),x(w,u,S),Y(h,u,null),d=!0,m||(p=G(e,"click",i[31]),m=!0)},p(w,S){(!d||S[0]&16)&&l!==(l=w[4].label+"")&&K(a,l);const _={};S[0]&16&&(_.field=w[4]),!f&&S[0]&4&&(f=!0,_.value=w[2],st(()=>f=!1)),h. $ set(_)},i(w){d||(T(t. $ $ .fragment,w),T(h. $ $ .fragment,w),d=!0)},o(w){R(t. $ $ .fragment,w),R(h. $ $ .fragment,w),d=!1},d(w){w&&(P(e),P(r),P(s),P(c),P(u)),z(t),z(h),m=!1,p()}}}function ST(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M,L,N=!i[3]&&rO(i),B=i[3]&&!i[5]&&oO(i),J=i[3]&&i[5]&&aO(i),te=!i[4]&&cO(i),ie=i[4]&&hO(i);return v=new ut({props:{icon:"arrow-left"}}),{c(){e=y("div"),t=y("button"),t.textContent="Filter by field",n=D(),r=y("button"),r.textContent="Filter by Reference",s=D(),o=y("button"),o.textContent="Advanced filter",l=D(),a=y("div"),N&&N.c(),c=D(),B&&B.c(),u=D(),J&&J.c(),h=D(),f=y("div"),te&&te.c(),d=D(),ie&&ie.c(),m=D(),p=y("div"),g=y("button"),V(v. $ $ .fragment),w=W( `
Back ` ),S=D(),_=y("form"),k=y("input"),A=D(),C=y("button"),C.textContent="Submit",O(t,"class","dropdown-item button"),O(r,"class","dropdown-item button"),O(o,"class","dropdown-item button"),Ae(e,"hide",i[6]!=="main"),Ae(a,"hide",i[6]!=="byField"),Ae(f,"hide",i[6]!=="byReference"),O(g,"class","dropdown-item button"),O(k,"type","search"),O(k,"class","mb-2 mt-2"),O(k,"placeholder","Advanced filters"),k.required=!0,O(C,"class","button applied-filter"),Ae(p,"hide",i[6]!=="advanced")},m(ae,X){x(ae,e,X),b(e,t),b(e,n),b(e,r),b(e,s),b(e,o),x(ae,l,X),x(ae,a,X),N&&N.m(a,null),b(a,c),B&&B.m(a,null),b(a,u),J&&J.m(a,null),x(ae,h,X),x(ae,f,X),te&&te.m(f,null),b(f,d),ie&&ie.m(f,null),x(ae,m,X),x(ae,p,X),b(p,g),Y(v,g,null),b(g,w),b(p,S),b(p,_),b(_,k),Le(k,i[1]),b(_,A),b(_,C),Q=!0,M||(L=[G(t,"click",i[20]),G(r,"click",i[21]),G(o,"click",i[22]),G(g,"click",i[33]),G(k,"input",i[34]),G(_,"submit",i[8])],M=!0)},p(ae,X){(!Q||X[0]&64)&&Ae(e,"hide",ae[6]!=="main"),ae[3]?N&&(Oe(),R(N,1,1,()=>{N=null}),be()):N?(N.p(ae,X),X[0]&8&&T(N,1)):(N=rO(ae),N.c(),T(N,1),N.m(a,c)),ae[3]&&!ae[5]?B?(B.p(ae,X),X[0]&40&&T(B,1)):(B=oO(ae),B.c(),T(B,1),B.m(a,u)):B&&(Oe(),R(B,1,1,()=>{B=null}),be()),ae[3]&&ae[5]?J?(J.p(ae,X),X[0]&40&&T(J,1)):(J=aO(ae),J.c(),T(J,1),J.m(a,null)):J&&(Oe(),R(J,1,1,()=>{J=null}),be()),(!Q||X[0]&64)&&Ae(a,"hide",ae[6]!=="byField"),ae[4]?te&&(Oe(),R(te,1,1,()=>{te=null}),be()):te?(te.p(ae,X),X[0]&16&&T(te,1)):(te=cO(ae),te.c(),T(te,1),te.m(f,d)),ae[4]?ie?(ie.p(ae,X),X[0]&16&&T(ie,1)):(ie=hO(ae),ie.c(),T(ie,1),ie.m(f,null)):ie&&(Oe(),R(ie,1,1,()=>{ie=null}),be()),(!Q||X[0]&64)&&Ae(f,"hide",ae[6]!=="byReference"),X[0]&2&&k.value!==ae[1]&&Le(k,ae[1]),(!Q||X[0]&64)&&Ae(p,"hide",ae[6]!=="advanced")},i(ae){Q||(T(N),T(B),T(J),T(te),T(ie),T(v. $ $ .fragment,ae),Q=!0)},o(ae){R(N),R(B),R(J),R(te),R(ie),R(v. $ $ .fragment,ae),Q=!1},d(ae){ae&&(P(e),P(l),P(a),P(h),P(f),P(m),P(p)),N&&N.d(),B&&B.d(),J&&J.d(),te&&te.d(),ie&&ie.d(),z(v),M=!1,ht(L)}}}function _T(i){let e,t,n,r,s;return t=new ut({props:{icon:"filter"}}),{c(){e=y("div"),V(t. $ $ .fragment),n=D(),r=y("span"),r.textContent="Filter",O(r,"class","ms-1"),O(e,"slot","button")},m(o,l){x(o,e,l),Y(t,e,null),b(e,n),b(e,r),s=!0},p:U,i(o){s||(T(t. $ $ .fragment,o),s=!0)},o(o){R(t. $ $ .fragment,o),s=!1},d(o){o&&P(e),z(t)}}}function CT(i){let e,t,n,r={ $ $ slots:{button:[_T],default:[ST]}, $ $ scope:{ctx:i}};return t=new ur({props:r}),i[35](t),{c(){e=y("div"),V(t. $ $ .fragment)},m(s,o){x(s,e,o),Y(t,e,null),n=!0},p(s,o){const l={};o[0]&254|o[1]&65536&&(l. $ $ scope={dirty:o,ctx:s}),t. $ set(l)},i(s){n||(T(t. $ $ .fragment,s),n=!0)},o(s){R(t. $ $ .fragment,s),n=!1},d(s){s&&P(e),i[35](null),z(t)}}}function PT(i,e,t){const n=nn();let{schema:r}=e,{systemFields:s=[]}=e,{operators:o}=e,{inModal:l}=e,{modalUrl:a}=e,c,u="",h=s;r.type==="collection"&&(h=s.filter(H=>H.files===!1));function f(H){H.preventDefault();let Pe=u.split("=")[0]??"";if(!Pe)return;let Ye= ` filter [ $ { Pe } ] ` ,Tt=u.split("=")[1]??"";if(!Tt)return;const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,Tt),l?n("refresh",yt):window.location.replace(yt),M()}let d=null,m=null,p=null,g=null,v="main",w=null,S=[...r.fields,...h].filter(H=>{var Pe;return!["file","json","reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)}),_=[...r.fields].filter(H=>{var Pe;return["reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)});function k(H,Pe){t(3,m=Pe),t(7,w=o.filter(Ye=>{var Tt;return Ye.uis.includes((Tt=m==null?void 0:m.info)==null?void 0:Tt.name)||Ye.uis[0]==="*"}))}function A(H,Pe){t(4,p=Pe),t(5,g=o.find(Ye=>Ye.name==="eq"))}function C(H,Pe){t(5,g=Pe),Pe.hasValue||Q(H)}function Q(H){H.preventDefault();let Pe="",Ye,Tt=m??p;r.fields.find(wt=>wt.name===Tt.name)&&(Tt.info.name==="reference"&&g.name==="eq"?(Pe="children."+Tt.name+".id",Ye= ` filter [ $ { Pe } ] ` ):(Pe="data.",Ye= ` filter [ $ { Pe + Tt . name } _$ { g . name } ] ` ));const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,d),l?(n("refresh",yt),c.close()):window.location.href=yt.toString(),M()}function M(){t(3,m=null),t(5,g=null),t(6,v="main"),t(
` ) , n = y ( "button" ) , V ( r . $$ . fragment ) , O ( n , "type" , "button" ) , O ( n , "class" , "button-text" ) , O ( n , "aria-label" , "Close" ) , O ( e , "class" , "applied-filter" ) } , m ( a , c ) { x ( a , e , c ) , b ( e , t ) , b ( e , n ) , Y ( r , n , null ) , s = ! 0 , o || ( l = G ( n , "click" , Ln ( i [ 4 ] ) ) , o = ! 0 ) } , p : U , i ( a ) { s || ( T ( r . $$ . fragment , a ) , s = ! 0 ) } , o ( a ) { R ( r . $$ . fragment , a ) , s = ! 1 } , d ( a ) { a && P ( e ) , z ( r ) , o = ! 1 , l ( ) } } } function FT ( i ) { let e = i [ 0 ] . searchParams . get ( "notlinked" ) , t , n , r = e && XT ( i ) ; return { c ( ) { r && r . c ( ) , t = Ie ( ) } , m ( s , o ) { r && r . m ( s , o ) , x ( s , t , o ) , n = ! 0 } , p ( s , [ o ] ) { e && r . p ( s , o ) } , i ( s ) { n || ( T ( r ) , n = ! 0 ) } , o ( s ) { R ( r ) , n = ! 1 } , d ( s ) { s && P ( t ) , r && r . d ( s ) } } } function YT ( i , e , t ) { Ue ( "channel" ) ; const n = nn ( ) ; let { inModal : r } = e , { modalUrl : s } = e ; const o = new URL ( s ? ? window . location . href ) ; function l ( c ) { const u = new URL ( s ? ? window . location . href ) ; u . searchParams . set ( "skip" , "0" ) , u . searchParams . delete ( "notlinked" ) , r ? n ( "refresh" , u ) : window . location . replace ( u ) } const a = ( ) => l ( ) ; return i . $$set = c => { "inModal" in c && t ( 2 , r = c . inModal ) , "modalUrl" in c && t ( 3 , s = c . modalUrl ) } , [ o , l , r , s , a ] } class zT extends oe { constructor ( e ) { super ( ) , se ( this , e , YT , FT , re , { inModal : 2 , modalUrl : 3 } ) } } function gO ( i , e , t ) { const n = i . slice ( ) ; return n [ 21 ] = e [ t ] [ 0 ] , n [ 22 ] = e [ t ] [ 1 ] , n } function OO ( i ) { let e , t , n ; return { c ( ) { e = y ( "a" ) , t = W ( "New Record" ) , O ( e , "href" , n = i [ 10 ] . lucentUrl + "/records/new?schema=" + i [ 0 ] . name ) , O ( e , "class" , "button" ) } , m ( r , s ) { x ( r , e , s ) , b ( e , t ) } , p ( r , s ) { s & 1 && n !== ( n = r [ 10 ] . lucentUrl + "/records/new?schema=" + r [ 0 ] . name ) && O ( e , "href" , n ) } , d ( r ) { r && P ( e ) } } } function bO ( i ) { let e , t ; return e = new ur ( { props : { orientation : "right" , $$slots : { button : [ qT ] , default : [ jT ] } , $$scope : { ctx : i } } } ) , { c ( ) { V ( e . $$ . fragment ) } , m ( n , r ) { Y ( e , n , r ) , t = ! 0 } , p ( n , r ) { const s = { } ; r & 33554577 && ( s . $$scope = { dirty : r , ctx : n } ) , e . $set ( s ) } , i ( n ) { t || ( T ( e . $$ . fragment , n ) , t = ! 0 ) } , o ( n ) { R ( e . $$ . fragment , n ) , t = ! 1 } , d ( n ) { z ( e , n ) } } } function VT ( i ) { let e , t , n , r , s , o , l , a , c , u ; return { c ( ) { e = y ( "a" ) , t = W ( "Export to CSV" ) , n = D ( ) , r = y ( "a" ) , s = W ( "View trashed records" ) , l = D ( ) , a = y ( "a" ) , c = W ( "View unlinked records" ) , O ( e , "class" , "dropdown-item" ) , O ( e , "href" , i [ 11 ] ) , O ( r , "class" , "dropdown-item" ) , O ( r , "href" , o = i [ 10 ] . lucentUrl + "/content/" + i [ 0 ] . name + "?filter[status_in]=trashed" ) , O ( a , "class" , "dropdown-item" ) , O ( a , "href" , u = i [ 10 ] . lucentUrl + "/content/" + i [ 0 ] . name + "?notlinked=*" ) } , m ( h , f ) { x ( h , e , f ) , b ( e , t ) , x ( h , n , f ) , x ( h , r , f ) , b ( r , s ) , x ( h , l , f ) , x ( h , a , f ) , b ( a , c ) } , p ( h , f ) { f & 1 && o !== ( o = h [ 10 ] . lucentUrl + "/content/" + h [ 0 ] . name + "?filter[status_in]=trashed" ) && O ( r , "href" , o ) , f & 1 && u !== ( u = h [ 10 ] . lucentUrl + "/content/" + h [ 0 ] . name + "?notlinked=*" ) && O ( a , "href" , u ) } , d ( h ) { h && ( P ( e ) , P ( n ) , P ( r ) , P ( l ) , P ( a ) ) } } } function UT ( i ) { let e , t = i [ 7 ] && vO ( i ) ; return { c ( ) { t && t . c ( ) , e = Ie ( ) } , m ( n , r ) { t && t . m ( n , r ) , x ( n , e , r ) } , p ( n , r ) { n [ 7 ] ? t ? t . p ( n , r ) : ( t = vO ( n ) , t . c ( ) , t . m ( e . parentNode , e ) ) : t && ( t . d ( 1 ) , t = null ) } , d ( n ) { n && P ( e ) , t && t . d ( n ) } } } function vO ( i ) { let e , t , n ; return { c ( ) { e = y ( "a" ) , t = W ( "Empty trash" ) , O ( e , "class" , "dropdown-item" ) , O ( e , "href" , n = i [ 10 ] . lucentUrl + "/content/" + i [ 0 ] . name + "/emptyTrash" ) } , m ( r , s ) { x ( r , e , s ) , b ( e , t ) } , p ( r , s ) { s & 1 && n !== ( n = r [ 10 ] . lucentUrl + "/content/" + r [ 0 ] . name + "/emptyTrash" ) && O ( e , "href" , n ) } , d ( r ) { r && P ( e ) } } } function jT ( i ) { let e ; function t ( s , o ) { return s [ 4 ] . status _in === "trashed" ? UT : VT } let n = t ( i ) , r = n ( i ) ; return { c ( ) { r . c ( ) , e = Ie ( ) } , m ( s , o ) { r . m ( s , o ) , x ( s , e , o ) } , p ( s , o ) { n === ( n = t ( s ) ) && r ? r . p ( s , o ) : ( r . d ( 1 ) , r = n ( s ) , r && ( r . c ( ) , r . m ( e . parentNode , e ) ) ) } , d ( s ) { s && P ( e ) , r . d ( s ) } } } function qT ( i ) { let e , t , n ; return t = new ut ( { props : { icon : "ellipsis-vertical" } } ) , { c ( ) { e = y ( "div" ) , V ( t . $$ . fragment ) , O ( e , "slot" , "button" ) } , m ( r , s ) { x ( r , e , s ) , Y ( t , e , null ) , n = ! 0 } , p : U , i ( r ) { n || ( T ( t . $$ . fragment , r ) , n = ! 0 ) } , o ( r ) { R ( t . $$ . fragment , r ) , n = ! 1 } , d ( r ) { r && P ( e ) , z ( t ) } } } function wO ( i ) { let e , t , n = fe ( Object . entries ( i [ 4 ] ) ) , r = [ ] ; for ( let o = 0 ; o < n . length ; o += 1 ) r [ o ] = yO ( gO ( i , n , o ) ) ; const s = o => R ( r [ o ] , 1 , 1 , ( ) => { r [ o ] = null } ) ; return { c ( ) { for ( let o = 0 ; o < r . length ; o += 1 ) r [ o ] . c ( ) ; e = Ie ( ) } , m ( o , l ) { for ( let a = 0 ; a < r . length ; a += 1 ) r [ a ] && r [ a ] . m ( o , l ) ; x ( o , e , l ) , t = ! 0 } , p ( o , l ) { if ( l & 377 ) { n = fe ( Object . entries ( o [ 4 ] ) ) ; let a ; for ( a = 0 ; a < n . length ; a += 1 ) { const c = gO ( o , n , a ) ; r [ a ] ? ( r [ a ] . p ( c , l ) , T ( r [ a ] , 1 ) ) : ( r [ a ] = yO ( c ) , r [ a ] . c ( ) , T ( r [ a ] , 1 ) , r [ a ] . m ( e . parentNode , e ) ) } for ( Oe ( ) , a = n . length ; a < r . length ; a += 1 ) s ( a ) ; be ( ) } } , i ( o ) { if ( ! t ) { for ( let l = 0 ; l < n . length ; l += 1 ) T ( r [ l ] ) ; t = ! 0 } } , o ( o ) { r = r . filter ( Boolean ) ; for ( let l = 0 ; l < r . length ; l += 1 ) R ( r [ l ] ) ; t = ! 1 } , d ( o ) { o && P ( e ) , Ot ( r , o ) } } } function yO ( i ) { let e , t ; return e = new WT ( { props : { schema : i [ 0 ] , operators
2026-05-08 17:55:22 +03:00
` ),o=y("span"),a=W(l),c=W( `
to
` ),u=y("span"),f=W(h),d=W( `
of
` ),m=y("span"),p=W(i[4]),g=W( `
2026-05-15 17:07:12 +03:00
total ` ),O(t,"class","pagination"),O(o,"class","font-medium"),O(u,"class","font-medium"),O(m,"class","font-medium"),le(r,"display","flex"),le(r,"justify-content","center"),le(r,"gap","4px")},m(S,_){x(S,e,_),b(e,t),w&&w.m(t,null),x(S,n,_),x(S,r,_),b(r,s),b(r,o),b(o,a),b(r,c),b(r,u),b(u,f),b(r,d),b(r,m),b(m,p),b(r,g),v=!0},p(S,[_]){S[5]>1?w?(w.p(S,_),_&32&&T(w,1)):(w=_O(S),w.c(),T(w,1),w.m(t,null)):w&&(Oe(),R(w,1,1,()=>{w=null}),be()),(!v||_&8)&&l!==(l=+S[3]+1+"")&&K(a,l),(!v||_&28)&&h!==(h=(+S[3]+S[2]>S[4]?S[4]:+S[3]+S[2])+"")&&K(f,h),(!v||_&16)&&K(p,S[4])},i(S){v||(T(w),v=!0)},o(S){R(w),v=!1},d(S){S&&(P(e),P(n),P(r)),w&&w.d()}}}function sQ(i,e,t){let n,r,s;const o=nn();let{inModal:l}=e,{modalUrl:a}=e,{limit:c}=e,{skip:u}=e,{total:h}=e;const f=(v,w,S=1)=>Array.from({length:Math.ceil((w-v)/S)},(_,k)=>v+k*S);function d(v){v.preventDefault(),p(n)}function m(v){v.preventDefault(),p(1)}function p(v){const w=new URL(a??window.location.href);let S=v*c-c;w.searchParams.set("skip",S),l?o("refresh",w):window.location=w}function g(v){vs.call(this,i,v)}return i. $ $ set=v=>{"inModal"in v&&t(0,l=v.inModal),"modalUrl"in v&&t(1,a=v.modalUrl),"limit"in v&&t(2,c=v.limit),"skip"in v&&t(3,u=v.skip),"total"in v&&t(4,h=v.total)},i. $ $ .update=()=>{i. $ $ .dirty&20&&t(5,n=Math.ceil(h/c)),i. $ $ .dirty&12&&t(6,r=Math.ceil((u-1)/c)+1),i. $ $ .dirty&96&&t(7,s=f(r-3,r+4).filter(v=>v>0&&v<=n))},[l,a,c,u,h,n,r,s,d,m,g]}class oQ extends oe{constructor(e){super(),se(this,e,sQ,rQ,re,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function lQ(i){let e,t,n;return{c(){e=y("button"),e.textContent="Move to trash",O(e,"type","button"),O(e,"class","button")},m(r,s){x(r,e,s),t||(n=G(e,"click",Ln(i[9])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function aQ(i){let e,t,n,r,s,o,l=i[1].hasDrafts&&CO(i);return{c(){e=y("button"),e.textContent="Publish",t=D(),l&&l.c(),n=D(),r=y("button"),r.textContent="Delete forever",O(e,"type","button"),O(e,"class","button"),O(r,"type","button"),O(r,"class","button")},m(a,c){x(a,e,c),x(a,t,c),l&&l.m(a,c),x(a,n,c),x(a,r,c),s||(o=[G(e,"click",Ln(i[7])),G(r,"click",Ln(i[3]))],s=!0)},p(a,c){a[1].hasDrafts?l?l.p(a,c):(l=CO(a),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(a){a&&(P(e),P(t),P(n),P(r)),l&&l.d(a),s=!1,ht(o)}}}function CO(i){let e,t,n;return{c(){e=y("button"),e.textContent="Make Draft",O(e,"type","button"),O(e,"class","button")},m(r,s){x(r,e,s),t||(n=G(e,"click",Ln(i[8])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function cQ(i){let e,t,n=i[0].length+"",r,s,o,l,a,c,u,h,f;function d(g,v){return g[2].status_in==="trashed"?aQ:lQ}let m=d(i),p=m(i);return{c(){e=y("div"),t=y("span"),r=W(n),s=W(" records selected"),o=D(),l=y("button"),l.textContent="Publish",a=D(),c=y("button"),c.textContent="Make Draft",u=D(),p.c(),O(t,"class","me-2"),O(l,"type","button"),O(l,"class","button"),O(c,"type","button"),O(c,"class","button"),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","8px")},m(g,v){x(g,e,v),b(e,t),b(t,r),b(t,s),b(e,o),b(e,l),b(e,a),b(e,c),b(e,u),p.m(e,null),h||(f=[G(l,"click",Ln(i[5])),G(c,"click",Ln(i[6]))],h=!0)},p(g,[v]){v&1&&n!==(n=g[0].length+"")&&K(r,n),m===(m=d(g))&&p?p.p(g,v):(p.d(1),p=m(g),p&&(p.c(),p.m(e,null)))},i:U,o:U,d(g){g&&P(e),p.d(),h=!1,ht(f)}}}function uQ(i,e,t){const n=Ue("channel");let{selected:r}=e,{schema:s}=e,{filter:o}=e;function l(m){m.preventDefault(),Jn(n.lucentUrl+"/records/delete",{ids:r.map(p=>p.id)}).then(p=>{window.location.reload()}).catch(p=>{console.log(p)})}function a(m,p){Jn(n.lucentUrl+"/records/status/"+p,{schemaName:s.name,records:r}).then(g=>{window.location.reload()}).catch(g=>{console.log(g)})}const c=m=>a(m,"published"),u=m=>a(m,"draft"),h=m=>a(m,"published"),f=m=>a(m,"draft"),d=m=>a(m,"trashed");return i. $ $ set=m=>{"selected"in m&&t(0,r=m.selected),"schema"in m&&t(1,s=m.schema),"filter"in m&&t(2,o=m.filter)},[r,s,o,l,a,c,u,h,f,d]}class hQ extends oe{constructor(e){super(),se(this,e,uQ,cQ,re,{selected:0,schema:1,filter:2})}}function fQ(i){let e;return{c(){e=W(i[0])},m(t,n){x(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function dQ(i,e,t){let{value:n}=e;return i. $ $ set=r=>{"value"in r&&t(
2026-05-08 17:55:22 +03:00
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
2026-05-15 17:07:12 +03:00
*/function t1(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Hi(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?t1(Object(t),!0).forEach(function(n){TM(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):t1(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Nc(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nc=function(e){return typeof e}:Nc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nc(i)}function TM(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function fr(){return fr=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},fr.apply(this,arguments)}function QM(i,e){if(i==null)return{};var t={},n=Object.keys(i),r,s;for(s=0;s<n.length;s++)r=n[s],!(e.indexOf(r)>=0)&&(t[r]=i[r]);return t}function MM(i,e){if(i==null)return{};var t=QM(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r<s.length;r++)n=s[r],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var EM="1.15.2";function lr(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var pr=lr(/(?:Trident.*rv[ :]?11 \. |msie|iemobile|Windows Phone)/i),Ea=lr(/Edge/i),n1=lr(/firefox/i),Ml=lr(/safari/i)&&!lr(/chrome/i)&&!lr(/android/i),xy=lr(/iP(ad|od|hone)/i),Ty=lr(/chrome/i)&&lr(/android/i),Qy={capture:!1,passive:!1};function mt(i,e,t){i.addEventListener(e,t,!pr&&Qy)}function lt(i,e,t){i.removeEventListener(e,t,!pr&&Qy)}function du(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function RM(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function ki(i,e,t,n){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&du(i,e):du(i,e))||n&&i===t)return i;if(i===t)break}while(i=RM(i))}return null}var i1=/ \s +/g;function Fn(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var n=(" "+i.className+" ").replace(i1," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(i1," ")}}function De(i,e,t){var n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function co(i,e){var t="";if(typeof i=="string")t=i;else do{var n=De(i,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(i=i.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function My(i,e,t){if(i){var n=i.getElementsByTagName(e),r=0,s=n.length;if(t)for(;r<s;r++)t(n[r],r);return n}return[]}function Ui(){var i=document.scrollingElement;return i||document.documentElement}function Gt(i,e,t,n,r){if(!(!i.getBoundingClientRect&&i!==window)){var s,o,l,a,c,u,h;if(i!==window&&i.parentNode&&i!==Ui()?(s=i.getBoundingClientRect(),o=s.top,l=s.left,a=s.bottom,c=s.right,u=s.height,h=s.width):(o=0,l=0,a=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(e||t)&&i!==window&&(r=r||i.parentNode,!pr))do if(r&&r.getBoundingClientRect&&(De(r,"transform")!=="none"||t&&De(r,"position")!=="static")){var f=r.getBoundingClientRect();o-=f.top+parseInt(De(r,"border-top-width")),l-=f.left+parseInt(De(r,"border-left-width")),a=o+s.height,c=l+s.width;break}while(r=r.parentNode);if(n&&i!==window){var d=co(r||i),
2026-05-08 17:55:22 +03:00
<span class='flatpickr-weekday'>
2026-05-15 17:07:12 +03:00
` + $ . join ( "</span><span class='flatpickr-weekday'>" ) + `
2026-05-08 17:55:22 +03:00
</span>
2026-05-15 17:07:12 +03:00
` } } function ve ( ) { t . calendarContainer . classList . add ( "hasWeeks" ) ; var E = dt ( "div" , "flatpickr-weekwrapper" ) ; E . appendChild ( dt ( "span" , "flatpickr-weekday" , t . l10n . weekAbbreviation ) ) ; var $ = dt ( "div" , "flatpickr-weeks" ) ; return E . appendChild ( $ ) , { weekWrapper : E , weekNumbers : $ } } function je ( E , $ ) { $ === void 0 && ( $ = ! 0 ) ; var F = $ ? E : E - t . currentMonth ; F < 0 && t . _hidePrevMonthArrow === ! 0 || F > 0 && t . _hideNextMonthArrow === ! 0 || ( t . currentMonth += F , ( t . currentMonth < 0 || t . currentMonth > 11 ) && ( t . currentYear += t . currentMonth > 11 ? 1 : - 1 , t . currentMonth = ( t . currentMonth + 12 ) % 12 , pt ( "onYearChange" ) , J ( ) ) , B ( ) , pt ( "onMonthChange" ) , er ( ) ) } function ne ( E , $ ) { if ( E === void 0 && ( E = ! 0 ) , $ === void 0 && ( $ = ! 0 ) , t . input . value = "" , t . altInput !== void 0 && ( t . altInput . value = "" ) , t . mobileInput !== void 0 && ( t . mobileInput . value = "" ) , t . selectedDates = [ ] , t . latestSelectedDateObj = void 0 , $ === ! 0 && ( t . currentYear = t . _initialDate . getFullYear ( ) , t . currentMonth = t . _initialDate . getMonth ( ) ) , t . config . enableTime === ! 0 ) { var F = qh ( t . config ) , j = F . hours , ce = F . minutes , ge = F . seconds ; d ( j , ce , ge ) } t . redraw ( ) , E && pt ( "onChange" ) } function Ee ( ) { t . isOpen = ! 1 , t . isMobile || ( t . calendarContainer !== void 0 && t . calendarContainer . classList . remove ( "open" ) , t . _input !== void 0 && t . _input . classList . remove ( "active" ) ) , pt ( "onClose" ) } function Re ( ) { t . config !== void 0 && pt ( "onDestroy" ) ; for ( var E = t . _handlers . length ; E -- ; ) t . _handlers [ E ] . remove ( ) ; if ( t . _handlers = [ ] , t . mobileInput ) t . mobileInput . parentNode && t . mobileInput . parentNode . removeChild ( t . mobileInput ) , t . mobileInput = void 0 ; else if ( t . calendarContainer && t . calendarContainer . parentNode ) if ( t . config . static && t . calendarContainer . parentNode ) { var $ = t . calendarContainer . parentNode ; if ( $ . lastChild && $ . removeChild ( $ . lastChild ) , $ . parentNode ) { for ( ; $ . firstChild ; ) $ . parentNode . insertBefore ( $ . firstChild , $ ) ; $ . parentNode . removeChild ( $ ) } } else t . calendarContainer . parentNode . removeChild ( t . calendarContainer ) ; t . altInput && ( t . input . type = "text" , t . altInput . parentNode && t . altInput . parentNode . removeChild ( t . altInput ) , delete t . altInput ) , t . input && ( t . input . type = t . input . _type , t . input . classList . remove ( "flatpickr-input" ) , t . input . removeAttribute ( "readonly" ) ) , [ "_showTimeInput" , "latestSelectedDateObj" , "_hideNextMonthArrow" , "_hidePrevMonthArrow" , "__hideNextMonthArrow" , "__hidePrevMonthArrow" , "isMobile" , "isOpen" , "selectedDateElem" , "minDateHasTime" , "maxDateHasTime" , "days" , "daysContainer" , "_input" , "_positionElement" , "innerContainer" , "rContainer" , "monthNav" , "todayDateElem" , "calendarContainer" , "weekdayContainer" , "prevMonthNav" , "nextMonthNav" , "monthsDropdownContainer" , "currentMonthElement" , "currentYearElement" , "navigationCurrentMonth" , "selectedDateElem" , "config" ] . forEach ( function ( F ) { try { delete t [ F ] } catch { } } ) } function xt ( E ) { return t . calendarContainer . contains ( E ) } function H ( E ) { if ( t . isOpen && ! t . config . inline ) { var $ = Zn ( E ) , F = xt ( $ ) , j = $ === t . input || $ === t . altInput || t . element . contains ( $ ) || E . path && E . path . indexOf && ( ~ E . path . indexOf ( t . input ) || ~ E . path . indexOf ( t . altInput ) ) , ce = ! j && ! F && ! xt ( E . relatedTarget ) , ge = ! t . config . ignoredFocusElements . some ( function ( We ) { return We . contains ( $ ) } ) ; ce && ge && ( t . config . allowInput && t . setDate ( t . _input . value , ! 1 , t . config . altInput ? t . config . altFormat : t . config . dateFormat ) , t . timeContainer !== void 0 && t . minuteElement !== void 0 && t . hourElement !== void 0 && t . input . value !== "" && t . input . value !== void 0 && a ( ) , t . close ( ) , t . config && t . config . mode === "range" && t . selectedDates . length === 1 && t . clear ( ! 1 ) ) } } function Pe ( E ) { if ( ! ( ! E || t . config . minDate && E < t . config . minDate . getFullYear ( ) || t . config . maxDate && E > t . config . maxDate . getFullYear ( ) ) ) { var $ = E , F = t . currentYear !== $ ; t . currentYear = $ || t . currentYear , t . config . maxDate && t . currentYear === t . config . maxDate . getFullYear ( ) ? t . currentMonth = Math . min ( t . config . maxDate . getMonth ( ) , t . currentMonth ) : t . config . minDate && t . currentYear === t . config . minDate . getFullYear ( ) && ( t . currentMonth = Math . max ( t . config . minDate . getMonth ( ) , t . currentMonth ) ) , F && ( t . redraw ( ) , pt ( "onYearChange" ) , J ( ) ) } } function Ye ( E , $ ) { var F ; $ === void 0 && ( $ = ! 0 ) ; var j = t . parseDate ( E , void 0 , $ ) ; if ( t . config . minDate && j && Yn ( j , t . config . minDate , $ !== void 0 ? $ : ! t . minDateHasTime ) < 0 || t . config . maxDate && j && Yn ( j , t . config . maxDate , $ !== void 0 ? $ : ! t . maxDateHasTime ) > 0 ) return ! 1 ; if ( ! t . config . enable && t . config . disable . length === 0 ) return ! 0 ; if ( j === void 0 ) retur
2026-05-08 17:55:22 +03:00
Upload file
2026-05-15 17:07:12 +03:00
` ),l=y("input"),O(s,"class","spinner-border spinner-border-sm"),O(s,"role","status"),O(s,"aria-hidden","true"),O(l,"class","form-control"),O(l,"type","file"),O(l,"id","formFile"),l.multiple=!0,O(l,"accept",qE),l.disabled=i[0],l.hidden=!0,O(t,"class","button primary btn-spinner"),O(e,"class","upload-button"),e.disabled=i[0]},m(h,f){x(h,e,f),b(e,t),Y(n,t,null),b(t,r),b(t,s),b(t,o),b(t,l),a=!0,c||(u=G(l,"input",i[1]),c=!0)},p(h,[f]){(!a||f&1)&&(l.disabled=h[0]),(!a||f&1)&&(e.disabled=h[0])},i(h){a||(T(n. $ $ .fragment,h),a=!0)},o(h){R(n. $ $ .fragment,h),a=!1},d(h){h&&P(e),z(n),c=!1,u()}}}let qE="";function GE(i,e,t){const n=nn(),r=Ue("channel");let{recordId:s}=e,o=[],l=!1;function a(c){t(0,l=!0),o=c.target.files?[...c.target.files]:[];let u=new FormData;u.append("recordId",s),Array.from(o).forEach(function(h){u.append("files[]",h)}),n("beforeUpload",o),fetch(r.lucentUrl+"/files/upload",{method:"POST",body:u,headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content}}).then(h=>h.json()).then(h=>{h.error?n("uploadError",h.error):n("uploadComplete",h),t(0,l=!1)})}return i. $ $ set=c=>{"recordId"in c&&t(2,s=c.recordId)},[l,a,s]}class jy extends oe{constructor(e){super(),se(this,e,GE,jE,re,{recordId:2})}}function D1(i,e,t){const n=i.slice();return n[11]=e[t],n}function $ 1(i){let e,t;return e=new Xy({props:{sortableClass:"mt-3", $ $ slots:{default:[HE]}, $ $ scope:{ctx:i}}}),e. $ on("update",i[4]),{c(){V(e. $ $ .fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&16385&&(s. $ $ scope={dirty:r,ctx:n}),e. $ set(s)},i(n){t||(T(e. $ $ .fragment,n),t=!0)},o(n){R(e. $ $ .fragment,n),t=!1},d(n){z(e,n)}}}function L1(i,e){let t,n,r,s;return n=new Vy({props:{file:e[11],hasDelete:!0}}),n. $ on("remove_file",e[3]),{key:i,first:null,c(){t=y("div"),V(n. $ $ .fragment),r=D(),this.first=t},m(o,l){x(o,t,l),Y(n,t,null),b(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.file=e[11]),n. $ set(a)},i(o){s||(T(n. $ $ .fragment,o),s=!0)},o(o){R(n. $ $ .fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function HE(i){let e=[],t=new Map,n,r,s=fe(i[0]??[]);const o=l=>l[11].id;for(let l=0;l<s.length;l+=1){let a=D1(i,s,l),c=o(a);t.set(c,e[l]=L1(c,a))}return{c(){for(let l=0;l<e.length;l+=1)e[l].c();n=Ie()},m(l,a){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(l,a);x(l,n,a),r=!0},p(l,a){a&9&&(s=fe(l[0]??[]),Oe(),e=Ti(e,a,o,1,l,s,t,n.parentNode,Jr,L1,n,D1),be())},i(l){if(!r){for(let a=0;a<s.length;a+=1)T(e[a]);r=!0}},o(l){for(let a=0;a<e.length;a+=1)R(e[a]);r=!1},d(l){l&&P(n);for(let a=0;a<e.length;a+=1)e[a].d(l)}}}function KE(i){let e,t,n,r,s,o,l,a,c,u,h,f;n=new ut({props:{icon:"photo-film"}}),o=new jy({props:{recordId:i[1].id}}),o. $ on("uploadComplete",i[7]);let d=i[0].length>0&& $ 1(i),m={};return c=new Uy({props:m}),i[10](c),c. $ on("insert_files",i[5]),c. $ on("replace_files",i[6]),{c(){e=y("div"),t=y("button"),V(n. $ $ .fragment),r=W(" Browse"),s=D(),V(o. $ $ .fragment),l=D(),d&&d.c(),a=D(),V(c. $ $ .fragment),O(t,"class","button"),O(e,"class","mb-0"),le(e,"display","flex"),le(e,"align-items","start"),le(e,"justify-content","start"),le(e,"gap","6px")},m(p,g){x(p,e,g),b(e,t),Y(n,t,null),b(t,r),b(e,s),Y(o,e,null),x(p,l,g),d&&d.m(p,g),x(p,a,g),Y(c,p,g),u=!0,h||(f=G(t,"click",i[8]),h=!0)},p(p,[g]){const v={};g&2&&(v.recordId=p[1].id),o. $ set(v),p[0].length>0?d?(d.p(p,g),g&1&&T(d,1)):(d= $ 1(p),d.c(),T(d,1),d.m(a.parentNode,a)):d&&(Oe(),R(d,1,1,()=>{d=null}),be());const w={};c. $ set(w)},i(p){u||(T(n. $ $ .fragment,p),T(o. $ $ .fragment,p),T(d),T(c. $ $ .fragment,p),u=!0)},o(p){R(n. $ $ .fragment,p),R(o. $ $ .fragment,p),R(d),R(c. $ $ .fragment,p),u=!1},d(p){p&&(P(e),P(l),P(a)),z(n),z(o),d&&d.d(p),i[10](null),z(c,p),h=!1,f()}}}function JE(i,e,t){let{field:n}=e,{record:r}=e,{value:s=[]}=e,o;function l(m){m.preventDefault(),t(0,s=s.filter(p=>p.id!==m.detail))}async function a(m){t(0,s=await Sy(s,m.detail.source,m.detail.target))}function c(m){m.preventDefault(),o.close(),t(0,s=[...s??[],...m.detail.files??[]])}function u(m){m.preventDefault(),o.close(),t(0,s=m.detail??[])}function h(m){t(0,s=[...s,...m.detail])}function f(m){m.preventDefault(),o.open(r.id)}function d(m){Ce[m?"unshift":"push"](()=>{o=m,t(2,o)})}return i. $ $ set=m=>{"field"
` } , xs = { bold : { tagName : "strong" , inheritable : ! 0 , parser ( i ) { const e = window . getComputedStyle ( i ) ; return e . fontWeight === "bold" || e . fontWeight >= 600 } } , italic : { tagName : "em" , inheritable : ! 0 , parser : i => window . getComputedStyle ( i ) . fontStyle === "italic" } , href : { groupTagName : "a" , parser ( i ) { const e = "a:not(" . concat ( _s , ")" ) , t = i . closest ( e ) ; if ( t ) return t . getAttribute ( "href" ) } } , strike : { tagName : "del" , inheritable : ! 0 } , frozen : { style : { backgroundColor : "highlight" } } } , ik = { getDefaultHTML : ( ) => ` <div class="trix-button-row">
2026-05-08 17:55:22 +03:00
<span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title=" ` . concat ( Ve . bold , '" tabindex="-1">' ) . concat ( Ve . bold , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-italic" data-trix-attribute="italic" data-trix-key="i" title=" ` ) . concat ( Ve . italic , '" tabindex="-1">' ) . concat ( Ve . italic , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-strike" data-trix-attribute="strike" title=" ` ) . concat ( Ve . strike , '" tabindex="-1">' ) . concat ( Ve . strike , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-link" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title=" ` ) . concat ( Ve . link , '" tabindex="-1">' ) . concat ( Ve . link , ` </button>
</span>
<span class="trix-button-group trix-button-group--block-tools" data-trix-button-group="block-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-heading-1" data-trix-attribute="heading1" title=" ` ) . concat ( Ve . heading1 , '" tabindex="-1">' ) . concat ( Ve . heading1 , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-quote" data-trix-attribute="quote" title=" ` ) . concat ( Ve . quote , '" tabindex="-1">' ) . concat ( Ve . quote , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-code" data-trix-attribute="code" title=" ` ) . concat ( Ve . code , '" tabindex="-1">' ) . concat ( Ve . code , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-bullet-list" data-trix-attribute="bullet" title=" ` ) . concat ( Ve . bullets , '" tabindex="-1">' ) . concat ( Ve . bullets , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-number-list" data-trix-attribute="number" title=" ` ) . concat ( Ve . numbers , '" tabindex="-1">' ) . concat ( Ve . numbers , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title=" ` ) . concat ( Ve . outdent , '" tabindex="-1">' ) . concat ( Ve . outdent , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title=" ` ) . concat ( Ve . indent , '" tabindex="-1">' ) . concat ( Ve . indent , ` </button>
</span>
<span class="trix-button-group trix-button-group--file-tools" data-trix-button-group="file-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-attach" data-trix-action="attachFiles" title=" ` ) . concat ( Ve . attachFiles , '" tabindex="-1">' ) . concat ( Ve . attachFiles , ` </button>
</span>
<span class="trix-button-group-spacer"></span>
<span class="trix-button-group trix-button-group--history-tools" data-trix-button-group="history-tools">
<button type="button" class="trix-button trix-button--icon trix-button--icon-undo" data-trix-action="undo" data-trix-key="z" title=" ` ) . concat ( Ve . undo , '" tabindex="-1">' ) . concat ( Ve . undo , ` </button>
<button type="button" class="trix-button trix-button--icon trix-button--icon-redo" data-trix-action="redo" data-trix-key="shift+z" title=" ` ) . concat ( Ve . redo , '" tabindex="-1">' ) . concat ( Ve . redo , ` </button>
</span>
</div>
<div class="trix-dialogs" data-trix-dialogs>
<div class="trix-dialog trix-dialog--link" data-trix-dialog="href" data-trix-dialog-attribute="href">
<div class="trix-dialog__link-fields">
<input type="url" name="href" class="trix-input trix-input--dialog" placeholder=" ` ) . concat ( Ve . urlPlaceholder , '" aria-label="' ) . concat ( Ve . url , ` " data-trix-validate-href required data-trix-input>
<div class="trix-button-group">
<input type="button" class="trix-button trix-button--dialog" value=" ` ) . concat ( Ve . link , ` " data-trix-method="setAttribute">
<input type="button" class="trix-button trix-button--dialog" value=" ` ) . concat ( Ve . unlink , ` " data-trix-method="removeAttribute">
</div>
</div>
</div>
2026-05-15 17:07:12 +03:00
</div> ` ) } ; const Sd = { interval : 5e3 } ; var $a = Object . freeze ( { _ _proto _ _ : null , attachments : jm , blockAttributes : Sn , browser : Da , css : { attachment : "attachment" , attachmentCaption : "attachment__caption" , attachmentCaptionEditor : "attachment__caption-editor" , attachmentMetadata : "attachment__metadata" , attachmentMetadataContainer : "attachment__metadata-container" , attachmentName : "attachment__name" , attachmentProgress : "attachment__progress" , attachmentSize : "attachment__size" , attachmentToolbar : "attachment__toolbar" , attachmentGallery : "attachment-gallery" } , dompurify : Hy , fileSize : Ky , input : Hm , keyNames : { 8 : "backspace" , 9 : "tab" , 13 : "return" , 27 : "escape" , 37 : "left" , 39 : "right" , 46 : "delete" , 68 : "d" , 72 : "h" , 79 : "o" } , lang : Ve , parser : Fc , textAttributes : xs , toolbar : ik , undo : Sd } ) ; class Kt { static proxyMethod ( e ) { const { name : t , toMethod : n , toProperty : r , optional : s } = dR ( e ) ; this . prototype [ t ] = function ( ) { let o , l ; var a , c ; return n ? l = s ? ( a = this [ n ] ) === null || a === void 0 ? void 0 : a . call ( this ) : this [ n ] ( ) : r && ( l = this [ r ] ) , s ? ( o = ( c = l ) === null || c === void 0 ? void 0 : c [ t ] , o ? W1 . call ( o , l , arguments ) : void 0 ) : ( o = l [ t ] , W1 . call ( o , l , arguments ) ) } } } const dR = function ( i ) { const e = i . match ( mR ) ; if ( ! e ) throw new Error ( "can't parse @proxyMethod expression: " . concat ( i ) ) ; const t = { name : e [ 4 ] } ; return e [ 2 ] != null ? t . toMethod = e [ 1 ] : t . toProperty = e [ 1 ] , e [ 3 ] != null && ( t . optional = ! 0 ) , t } , { apply : W1 } = Function . prototype , mR = new RegExp ( "^(.+?)(\\(\\))?(\\?)?\\.(.+?)$" ) ; var ef , tf , nf ; class sa extends Kt { static box ( ) { let e = arguments . length > 0 && arguments [ 0 ] !== void 0 ? arguments [ 0 ] : "" ; return e instanceof this ? e : this . fromUCS2String ( e == null ? void 0 : e . toString ( ) ) } static fromUCS2String ( e ) { return new this ( e , _d ( e ) ) } static fromCodepoints ( e ) { return new this ( Cd ( e ) , e ) } constructor ( e , t ) { super ( ... arguments ) , this . ucs2String = e , this . codepoints = t , this . length = this . codepoints . length , this . ucs2Length = this . ucs2String . length } offsetToUCS2Offset ( e ) { return Cd ( this . codepoints . slice ( 0 , Math . max ( 0 , e ) ) ) . length } offsetFromUCS2Offset ( e ) { return _d ( this . ucs2String . slice ( 0 , Math . max ( 0 , e ) ) ) . length } slice ( ) { return this . constructor . fromCodepoints ( this . codepoints . slice ( ... arguments ) ) } charAt ( e ) { return this . slice ( e , e + 1 ) } isEqualTo ( e ) { return this . constructor . box ( e ) . ucs2String === this . ucs2String } toJSON ( ) { return this . ucs2String } getCacheKey ( ) { return this . ucs2String } toString ( ) { return this . ucs2String } } const pR = ( ( ef = Array . from ) === null || ef === void 0 ? void 0 : ef . call ( Array , "👼" ) . length ) === 1 , gR = ( ( tf = " " . codePointAt ) === null || tf === void 0 ? void 0 : tf . call ( " " , 0 ) ) != null , OR = ( ( nf = String . fromCodePoint ) === null || nf === void 0 ? void 0 : nf . call ( String , 32 , 128124 ) ) === " 👼" ; let _d , Cd ; _d = pR && gR ? i => Array . from ( i ) . map ( e => e . codePointAt ( 0 ) ) : function ( i ) { const e = [ ] ; let t = 0 ; const { length : n } = i ; for ( ; t < n ; ) { let r = i . charCodeAt ( t ++ ) ; if ( 55296 <= r && r <= 56319 && t < n ) { const s = i . charCodeAt ( t ++ ) ; ( 64512 & s ) == 56320 ? r = ( ( 1023 & r ) << 10 ) + ( 1023 & s ) + 65536 : t -- } e . push ( r ) } return e } , Cd = OR ? i => String . fromCodePoint ( ... Array . from ( i || [ ] ) ) : function ( i ) { return ( ( ) => { const e = [ ] ; return Array . from ( i ) . forEach ( t => { let n = "" ; t > 65535 && ( t -= 65536 , n += String . fromCharCode ( t >>> 10 & 1023 | 55296 ) , t = 56320 | 1023 & t ) , e . push ( n + String . fromCharCode ( t ) ) } ) , e } ) ( ) . join ( "" ) } ; let bR = 0 ; class Ns extends Kt { static fromJSONString ( e ) { return this . fromJSON ( JSON . parse ( e ) ) } constructor ( ) { super ( ... arguments ) , this . id = ++ bR } hasSameConstructorAs ( e ) { return this . constructor === ( e == null ? void 0 : e . constructor ) } isEqualTo ( e ) { return this === e } inspect ( ) { const e = [ ] , t = this . contentsForInspection ( ) || { } ; for ( const n in t ) { const r = t [ n ] ; e . push ( "" . concat ( n , "=" ) . concat ( r ) ) } return "#<" . concat ( this . constructor . name , ":" ) . concat ( this . id ) . concat ( e . length ? " " . concat ( e . join ( ", " ) ) : "" , ">" ) } contentsForInspection ( ) { } toJSONString ( ) { return JSON . stringify ( this ) } toUTF16String ( ) { return sa . box ( this ) } getCacheKey ( ) { return this . id . toString ( ) } } const Ts = function ( ) { let i = arguments . length > 0 && arguments [ 0 ] !== void 0 ? arguments [ 0 ] : [ ] , e = arguments . length > 1 && arguments [ 1 ] !== void 0 ? arguments [ 1 ] : [ ] ; if ( i . length !== e . length ) return ! 1 ; for ( let t = 0 ; t < i . length ; t ++ ) if ( i [ t ] !== e [ t ] ) return ! 1 ; return ! 0 } , Km = function ( i ) { const e = i . slice ( 0 ) ; for ( var t = arguments . length , n = new Array ( t > 1 ? t - 1 : 0 ) , r = 1 ; r < t ; r ++ ) n [ r - 1 ] = arguments [ r ] ; return e . splice ( ... n ) , e } , vR = / [ \ u 0 5 B E \ u 0 5 C 0 \ u 0 5 C 3 \ u 0 5 D 0 - \ u 0 5 E A \ u 0 5 F 0 - \ u 0 5 F 4 \ u 0 6 1 B \ u 0
` +Sr),He&&sc([J,te,ie],bi=>{Sr=ol(Sr,bi," ")}),k&&Ri?k.createHTML(Sr):Sr},t.setConfig=function(){ce(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),qe=!0},t.clearConfig=function(){ $ =null,qe=!1},t.isValidAttribute=function(Z,_e,me){ $ ||ce({});const Ke=E(Z),ot=E(_e);return tr(Ke,ot,me)},t.addHook=function(Z,_e){typeof _e=="function"&&sl(B[Z],_e)},t.removeHook=function(Z,_e){if(_e!==void 0){const me= $ R(B[Z],_e);return me===-1?void 0:LR(B[Z],me,1)[0]}return q1(B[Z])},t.removeHooks=function(Z){B[Z]=[]},t.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},t}();Ao.addHook("uponSanitizeAttribute",function(i,e){if(e.attrName==="data-trix-serialized-attributes")return void(e.keepAttr=!1);/^data-trix-/.test(e.attrName)&&(e.forceKeepAttr=!0)});const n4="style href src width height language class".split(" "),i4="javascript:".split(" "),r4="script iframe form noscript".split(" ");class lh extends Kt{static setHTML(e,t,n){const r=new this(t,n).sanitize(),s=r.getHTML?r.getHTML():r.outerHTML;e.innerHTML=s}static sanitize(e,t){const n=new this(e,t);return n.sanitize(),n}constructor(e){let{allowedAttributes:t,forbiddenProtocols:n,forbiddenElements:r,purifyOptions:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=t||n4,this.forbiddenProtocols=n||i4,this.forbiddenElements=r||r4,this.purifyOptions=s||{},this.body=s4(e)}sanitize(){this.sanitizeElements(),this.normalizeListElementNesting();const e=Object.assign({},Hy,this.purifyOptions);return Ao.setConfig(e),this.body=Ao.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const e=vu(this.body),t=[];for(;e.nextNode();){const n=e.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?t.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:t.push(n)}}return t.forEach(n=>zr(n)),this.body}sanitizeElement(e){return e.hasAttribute("href")&&this.forbiddenProtocols.includes(e.protocol)&&e.removeAttribute("href"),Array.from(e.attributes).forEach(t=>{let{name:n}=t;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||e.removeAttribute(n)}),e}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(e=>{const t=e.previousElementSibling;t&&kn(t)==="li"&&t.appendChild(e)}),this.body}elementIsRemovable(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(e)||this.elementIsntSerializable(e)}elementIsForbidden(e){return this.forbiddenElements.includes(kn(e))}elementIsntSerializable(e){return e.getAttribute("data-trix-serialize")==="false"&&!Cs(e)}}const s4=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/< \/ html[^>]*>[^]* $ /i,"</html>");const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=i,Array.from(e.head.querySelectorAll("style")).forEach(t=>{e.body.appendChild(t)}),e.body},{css:Cr}= $ a;class ip extends Zs{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let e;const t=e=Ge({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(e=Ge({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),t.appendChild(e)),this.attachment.hasContent()?lh.setHTML(e,this.attachment.getContent()):this.createContentNodes().forEach(r=>{e.appendChild(r)}),e.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=Ge({tagName:"progress",attributes:{class:Cr.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),t.appendChild(this.progressElement)),[n0("left"),t,n0("right")]}createCaptionEle
` ) ; for ( let r = 0 ; r < n . length ; r ++ ) { const s = n [ r ] ; if ( r > 0 ) { const o = Ge ( "br" ) ; t . push ( o ) } if ( s . length ) { const o = document . createTextNode ( this . preserveSpaces ( s ) ) ; t . push ( o ) } } return t } } createElement ( ) { let e , t , n ; const r = { } ; for ( t in this . attributes ) { n = this . attributes [ t ] ; const o = Ad ( t ) ; if ( o ) { if ( o . tagName ) { var s ; const l = Ge ( o . tagName ) ; s ? ( s . appendChild ( l ) , s = l ) : e = s = l } if ( o . styleProperty && ( r [ o . styleProperty ] = n ) , o . style ) for ( t in o . style ) n = o . style [ t ] , r [ t ] = n } } if ( Object . keys ( r ) . length ) for ( t in e || ( e = Ge ( "span" ) ) , r ) n = r [ t ] , e . style [ t ] = n ; return e } createContainerElement ( ) { for ( const e in this . attributes ) { const t = this . attributes [ e ] , n = Ad ( e ) ; if ( n && n . groupTagName ) { const r = { } ; return r [ e ] = t , Ge ( n . groupTagName , r ) } } } preserveSpaces ( e ) { return this . context . isLast && ( e = e . replace ( /\ $/ , Rr ) ) , e = e . replace ( /(\S)\ {3}(\S)/g , "$1 " . concat ( Rr , " $2" ) ) . replace ( /\ {2}/g , "" . concat ( Rr , " " ) ) . replace ( /\ {2}/g , " " . concat ( Rr ) ) , ( this . context . isFirst || this . context . followsWhitespace ) && ( e = e . replace ( /^\ / , Rr ) ) , e } } class Ok extends Zs { constructor ( ) { super ( ... arguments ) , this . text = this . object , this . textConfig = this . options . textConfig } createNodes ( ) { const e = [ ] , t = np . groupObjects ( this . getPieces ( ) ) , n = t . length - 1 ; for ( let s = 0 ; s < t . length ; s ++ ) { const o = t [ s ] , l = { } ; s === 0 && ( l . isFirst = ! 0 ) , s === n && ( l . isLast = ! 0 ) , l4 ( r ) && ( l . followsWhitespace = ! 0 ) ; const a = this . findOrCreateCachedChildView ( gk , o , { textConfig : this . textConfig , context : l } ) ; e . push ( ... Array . from ( a . getNodes ( ) || [ ] ) ) ; var r = o } return e } getPieces ( ) { return Array . from ( this . text . getPieces ( ) ) . filter ( e => ! e . hasAttribute ( "blockBreak" ) ) } } const l4 = i => / \ s$ / . test ( i == null ? void 0 : i . toString ( ) ) , { css : i0 } = $a ; class bk extends Zs { constructor ( ) { super ( ... arguments ) , this . block = this . object , this . attributes = this . block . getAttributes ( ) } createNodes ( ) { const e = [ document . createComment ( "block" ) ] ; if ( this . block . isEmpty ( ) ) e . push ( Ge ( "br" ) ) ; else { var t ; const n = ( t = zt ( this . block . getLastAttribute ( ) ) ) === null || t === void 0 ? void 0 : t . text , r = this . findOrCreateCachedChildView ( Ok , this . block . text , { textConfig : n } ) ; e . push ( ... Array . from ( r . getNodes ( ) || [ ] ) ) , this . shouldAddExtraNewlineElement ( ) && e . push ( Ge ( "br" ) ) } if ( this . attributes . length ) return e ; { let n ; const { tagName : r } = Sn . default ; this . block . isRTL ( ) && ( n = { dir : "rtl" } ) ; const s = Ge ( { tagName : r , attributes : n } ) ; return e . forEach ( o => s . appendChild ( o ) ) , [ s ] } } createContainerElement ( e ) { const t = { } ; let n ; const r = this . attributes [ e ] , { tagName : s , htmlAttributes : o = [ ] } = zt ( r ) ; if ( e === 0 && this . block . isRTL ( ) && Object . assign ( t , { dir : "rtl" } ) , r === "attachmentGallery" ) { const l = this . block . getBlockBreakPosition ( ) ; n = "" . concat ( i0 . attachmentGallery , " " ) . concat ( i0 . attachmentGallery , "--" ) . concat ( l ) } return Object . entries ( this . block . htmlAttributes ) . forEach ( l => { let [ a , c ] = l ; o . includes ( a ) && ( t [ a ] = c ) } ) , Ge ( { tagName : s , className : n , attributes : t } ) } shouldAddExtraNewlineElement ( ) { return /\n\n$/ . test ( this . block . toString ( ) ) } } class ah extends Zs { static render ( e ) { const t = Ge ( "div" ) , n = new this ( e , { element : t } ) ; return n . render ( ) , n . sync ( ) , t } constructor ( ) { super ( ... arguments ) , this . element = this . options . element , this . elementStore = new QR , this . setDocument ( this . object ) } setDocument ( e ) { e . isEqualTo ( this . document ) || ( this . document = this . object = e ) } render ( ) { if ( this . childViews = [ ] , this . shadowElement = Ge ( "div" ) , ! this . document . isEmpty ( ) ) { const e = np . groupObjects ( this . document . getBlocks ( ) , { asTree : ! 0 } ) ; Array . from ( e ) . forEach ( t => { const n = this . findOrCreateCachedChildView ( bk , t ) ; Array . from ( n . getNodes ( ) ) . map ( r => this . shadowElement . appendChild ( r ) ) } ) } } isSynced ( ) { return a4 ( this . shadowElement , this . element ) } sync ( ) { const e = ek ( "trix-before-render" , { cancelable : ! 1 , attributes : { render : ( n , r ) => { for ( ; n . lastChild ; ) n . removeChild ( n . lastChild ) ; n . appendChild ( r ) } } } ) ; this . element . dispatchEvent ( e ) ; const t = this . createDocumentFragmentForSync ( ) ; return e . render ( this . element , t ) , this . didSync ( ) } didSync ( ) { return this . elementStore . reset ( r0 ( this . element ) ) , Jm ( ( ) => this . garbageCollectCachedViews ( ) ) } createDocumentFragmentForSync ( ) { const e = document . createDocumentFragment ( ) ; return Array . from ( this . shadowElement . childNodes ) . forEach ( t => { e . appendChild ( t . cloneNode ( ! 0 ) ) } ) , Array . from ( r0 ( e ) ) . forEach ( t => { const n = this . elementStore . remove ( t ) ; n && t . parentNode . replaceChild ( n , t ) } ) , e } } const r0 = i => i . querySelectorAll ( "[data-trix-sto
2026-05-08 17:55:22 +03:00
`))(e),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===`
2026-05-15 17:07:12 +03:00
`&&this.getAttribute(" blockBreak ")===!0}toJSON(){const e=super.toJSON(...arguments);return e.string=this.string,e}canBeConsolidatedWith(e){return e&&this.hasSameConstructorAs(e)&&this.hasSameAttributesAsPiece(e)}consolidateWith(e){return new this.constructor(this.toString()+e.toString(),this.attributes)}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.length?(t=this,n=null):(t=new this.constructor(this.string.slice(0,e),this.attributes),n=new this.constructor(this.string.slice(e),this.attributes)),[t,n]}toConsole(){let{string:e}=this;return e.length>15&&(e=e.slice(0,14)+" … "),JSON.stringify(e.toString())}}Bs.registerType(" string ",rp);class ku extends Ns{static box(e){return e instanceof this?e:new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=e.slice(0),this.length=this.objects.length}indexOf(e){return this.objects.indexOf(e)}splice(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this.constructor(Km(this.objects,...t))}eachObject(e){return this.objects.map((t,n)=>e(t,n))}insertObjectAtIndex(e,t){return this.splice(t,0,e)}insertSplittableListAtIndex(e,t){return this.splice(t,0,...e.objects)}insertSplittableListAtPosition(e,t){const[n,r]=this.splitObjectAtPosition(t);return new this.constructor(n).insertSplittableListAtIndex(e,r)}editObjectAtIndex(e,t){return this.replaceObjectAtIndex(t(this.objects[e]),e)}replaceObjectAtIndex(e,t){return this.splice(t,1,e)}removeObjectAtIndex(e){return this.splice(e,1)}getObjectAtIndex(e){return this.objects[e]}getSplittableListInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t.slice(n,r+1))}selectSplittableList(e){const t=this.objects.filter(n=>e(n));return new this.constructor(t)}removeObjectsInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t).splice(n,r-n+1)}transformObjectsInRange(e,t){const[n,r,s]=this.splitObjectsAtRange(e),o=n.map((l,a)=>r<=a&&a<=s?t(l):l);return new this.constructor(o)}splitObjectsAtRange(e){let t,[n,r,s]=this.splitObjectAtPosition(d4(e));return[n,t]=new this.constructor(n).splitObjectAtPosition(m4(e)+s),[n,r,t-1]}getObjectAtPosition(e){const{index:t}=this.findIndexAndOffsetAtPosition(e);return this.objects[t]}splitObjectAtPosition(e){let t,n;const{index:r,offset:s}=this.findIndexAndOffsetAtPosition(e),o=this.objects.slice(0);if(r!=null)if(s===0)t=r,n=0;else{const l=this.getObjectAtIndex(r),[a,c]=l.splitAtOffset(s);o.splice(r,1,a,c),t=r+1,n=a.getLength()-s}else t=o.length,n=0;return[o,t,n]}consolidate(){const e=[];let t=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,s;(r=(s=t).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(s,n)?t=t.consolidateWith(n):(e.push(t),t=n)}),t&&e.push(t),new this.constructor(e)}consolidateFromIndexToIndex(e,t){const n=this.objects.slice(0).slice(e,t+1),r=new this.constructor(n).consolidate().toArray();return this.splice(e,n.length,...r)}findIndexAndOffsetAtPosition(e){let t,n=0;for(t=0;t<this.objects.length;t++){const r=n+this.objects[t].getLength();if(n<=e&&e<r)return{index:t,offset:e-n};n=r}return{index:null,offset:null}}findPositionAtIndexAndOffset(e,t){let n=0;for(let r=0;r<this.objects.length;r++){const s=this.objects[r];if(r<e)n+=s.getLength();else if(r===e){n+=t;break}}return n}getEndPosition(){return this.endPosition==null&&(this.endPosition=0,this.objects.forEach(e=>this.endPosition+=e.getLength())),this.endPosition}toString(){return this.objects.join(" ")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(e){return super.isEqualTo(...arguments)||f4(this.objects,e==null?void 0:e.objects)}contentsForInspection(){return{objects:" [ ".concat(this.objects.map(e=>e.inspect()).join(" , ")," ] ")}}}const f4=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;let t=!0;for(let n=0;n<i.length;n++){const r=i[n];t&&!r.isEqualTo(e[n])&&(t=!1)}return t},d4=i=>i[0],m4=i=>i[1];class Si extends Ns{static textForAttachmentWithAttributes(e,t){return new this([new xo(
2026-05-08 17:55:22 +03:00
`,t);break;case" backward ":r=n.slice(0,t).lastIndexOf(`
2026-05-15 17:07:12 +03:00
`)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(e){return!this.hasAttributes()&&!e.hasAttributes()&&this.getDirection()===e.getDirection()}consolidateWith(e){const t=Si.textForStringWithAttributes(`
`),n=this.getTextWithoutBlockBreak().appendText(t);return this.copyWithText(n.appendText(e.text))}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.getLength()?(t=this,n=null):(t=this.copyWithText(this.text.getTextAtRange([0,e])),n=this.copyWithText(this.text.getTextAtRange([e,this.getLength()]))),[t,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return kk(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(e){return this.attributes[e]}canBeGroupedWith(e,t){const n=e.getAttributes(),r=n[t],s=this.attributes[t];return s===r&&!(zt(s).group===!1&&!(()=>{if(!rc){rc=[];for(const o in Sn){const{listAttribute:l}=Sn[o];l!=null&&rc.push(l)}}return rc})().includes(n[t+1]))&&(this.getDirection()===e.getDirection()||e.isEmpty())}}const p4=function(i){return i=g4(i),i=b4(i)},g4=function(i){let e=!1;const t=i.getPieces();let n=t.slice(0,t.length-1);const r=t[t.length-1];return r?(n=n.map(s=>s.isBlockBreak()?(e=!0,v4(s)):s),e?new Si([...n,r]):i):i},O4=Si.textForStringWithAttributes(`
`,{blockBreak:!0}),b4=function(i){return kk(i)?i:i.appendText(O4)},kk=function(i){const e=i.getLength();return e===0?!1:i.getTextAtRange([e-1,e]).isBlockBreak()},v4=i=>i.copyWithoutAttribute(" blockBreak "),o0=function(i){const{listAttribute:e}=zt(i);return e?[e,i]:[i]},l0=i=>i.slice(-1)[0],a0=function(i,e){const t=i.lastIndexOf(e);return t===-1?i:Km(i,t,1)};class si extends Ns{static fromJSON(e){return new this(Array.from(e).map(t=>Xi.fromJSON(t)))}static fromString(e,t){const n=Si.textForStringWithAttributes(e,t);return new this([new Xi(n)])}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),e.length===0&&(e=[new Xi]),this.blockList=ku.box(e)}isEmpty(){const e=this.getBlockAtIndex(0);return this.blockList.length===1&&e.isEmpty()&&!e.hasAttributes()}copy(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(e)}copyUsingObjectsFromDocument(e){const t=new TR(e.getObjects());return this.copyUsingObjectMap(t)}copyUsingObjectMap(e){const t=this.getBlocks().map(n=>e.find(n)||n.copyUsingObjectMap(e));return new this.constructor(t)}copyWithBaseBlockAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const t=this.getBlocks().map(n=>{const r=e.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(t)}replaceBlock(e,t){const n=this.blockList.indexOf(e);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(t,n))}insertDocumentAtRange(e,t){const{blockList:n}=e;t=bt(t);let[r]=t;const{index:s,offset:o}=this.locationFromPosition(r);let l=this;const a=this.getBlockAtPosition(r);return or(t)&&a.isEmpty()&&!a.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):a.getBlockBreakPosition()===o&&r++,l=l.removeTextAtRange(t),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(e,t){let n,r;t=bt(t);const[s]=t,o=this.locationFromPosition(s),l=this.getBlockAtIndex(o.index).getAttributes(),a=e.getBaseBlockAttributes(),c=l.slice(-a.length);if(Ts(a,c)){const f=l.slice(0,-a.length);n=e.copyWithBaseBlockAttributes(f)}else n=e.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);const u=n.getBlockCount(),h=n.getBlockAtIndex(0);if(Ts(l,h.getAttributes())){const f=h.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(f,t),u>1){n=new this.constructor(n.getBlocks().slice(1));const d=s+f.getLength();r=r.insertDocumentAtRange(n,d)}}else r=this.insertDocumentAtRange(n,t);return r}insertTextAtRange(e,t){t=bt(t);const[n]=t,{index:r,offset:s}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return new this.constructor(o.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(e,s))))}removeTextAtRange(e){let t;e=bt(e);const[n,r]=e;if(or(e))return this;const[s,o]=Array.from(this.locationRangeFromRange(e)),l=s.index,a=s.offset,c=this.getBlockAtIndex(l),u=o.index,h=o.offset,f=this.getBlockAtIndex(u);if(r-n==1&&c.getBlockBreakPosition()===a&&f.getBlockBreakPosition()!==h&&f.text.getStringAtPosition(h)===`
`)t=this.blockList.editObjectAtIndex(u,d=>d.copyWithText(d.text.removeTextAtRange([h,h+1])));else{let d;const m=c.text.getTextAtRange([0,a]),p=f.text.getTextAtRange([h,f.getLength()]),g=m.appendText(p);d=l!==u&&a===0&&c.getAttributeLevel()>=f.getAttributeLevel()?f.copyWithText(g):c.copyWithText(g);const v=u+1-l;t=this.blockList.splice(l,v,d)}return new this.constructor(t)}moveTextFromRangeToPosition(e,t){let n;e=bt(e);const[r,s]=e;if(r<=t&&t<=s)return this;let o=this.getDocumentAtRange(e),l=this.removeTextAtRange(e);const a=r<t;a&&(t-=o.getLength());const[c,...u]=o.getBlocks();return u.length===0?(n=c.getTextWithoutBlockBreak(),a&&(t+=1)):n=c.text,l=l.insertTextAtRange(n,t),u.length===0?l:(o=new this.constructor(u),t+=n.getLength(),l.insertDocumentAtRange(o,t))}addAttributeAtRange(e,t,n){let{blockList:r}=this;return this.eachBlockAtRange(n,(s,o,l)=>r=r.editObjectAtIndex(l,function(){return zt(e)?s.addAttribute(e,t):o[0]===o[1]?s:s.copyWithText(s.text.addAttributeAtRange(e,t,o))})),new this.constructor(r)}addAttribute(e,t){let{blockList:n}=this;return this.eachBlock((r,s)=>n=n.editObjectAtIndex(s,()=>r.addAttribute(e,t))),new this.constructor(n)}removeAttributeAtRange(e,t){let{blockList:n}=this;return this.eachBlockAtRange(t,function(r,s,o){zt(e)?n=n.editObjectAtIndex(o,()=>r.removeAttribute(e)):s[0]!==s[1]&&(n=n.editObjectAtIndex(o,()=>r.copyWithText(r.text.removeAttributeAtRange(e,s))))}),new this.constructor(n)}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t),[r]=Array.from(n),{index:s}=this.locationFromPosition(r),o=this.getTextAtIndex(s);return new this.constructor(this.blockList.editObjectAtIndex(s,l=>l.copyWithText(o.updateAttributesForAttachment(e,t))))}removeAttributeForAttachment(e,t){const n=this.getRangeOfAttachment(t);return this.removeAttributeAtRange(e,n)}setHTMLAttributeAtPosition(e,t,n){const r=this.getBlockAtPosition(e),s=r.addHTMLAttribute(t,n);return this.replaceBlock(r,s)}insertBlockBreakAtRange(e){let t;e=bt(e);const[n]=e,{offset:r}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return r===0&&(t=[new Xi]),new this.constructor(s.blockList.insertSplittableListAtPosition(new ku(t),n))}applyBlockAttributeAtRange(e,t,n){const r=this.expandRangeToLineBreaksAndSplitBlocks(n);let s=r.document;n=r.range;const o=zt(e);if(o.listAttribute){s=s.removeLastListAttributeAtRange(n,{exceptAttributeName:e});const l=s.convertLineBreaksToBlockBreaksInRange(n);s=l.document,n=l.range}else s=o.exclusive?s.removeBlockAttributesAtRange(n):o.terminal?s.removeLastTerminalAttributeAtRange(n):s.consolidateBlocksAtRange(n);return s.addAttributeAtRange(e,t,n)}removeLastListAttributeAtRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(e,function(r,s,o){const l=r.getLastAttribute();l&&zt(l).listAttribute&&l!==t.exceptAttributeName&&(n=n.editObjectAtIndex(o,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){const o=n.getLastAttribute();o&&zt(o).terminal&&(t=t.editObjectAtIndex(s,()=>n.removeAttribute(o)))}),new this.constructor(t)}removeBlockAttributesAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){n.hasAttributes()&&(t=t.editObjectAtIndex(s,()=>n.copyWithoutAttributes()))}),new this.constructor(t)}expandRangeToLineBreaksAndSplitBlocks(e){let t;e=bt(e);let[n,r]=e;const s=this.locationFromPosition(n),o=this.locationFromPosition(r);let l=this;const a=l.getBlockAtIndex(s.index);if(s.offset=a.findLineBreakInDirectionFromPosition(" backward ",s.offset),s.offset!=null&&(t=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([t,t+1]),o.index+=1,o.offset-=l.getBlockAtIndex(s.index).getLength(),s.index+=1),s.offset=0,o.offset===0&&o.index>s.index)o.index-=1,o.offset=l.getBlockAtIndex(o.index).getBlockBreakPosition();else{const c=l.getBlockAtIndex(o.index);c.text.getStringAtRange([o.offset-1,o.offset])===`
`?o.offset-=1:o.offset=c.findLineBreakInDirectionFromPosition(" forward ",o.offset),o.offset!==c.getBlockBreakPosition()&&(t=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([t,t+1]))}return n=l.positionFromLocation(s),r=l.positionFromLocation(o),{document:l,range:e=bt([n,r])}}convertLineBreaksToBlockBreaksInRange(e){e=bt(e);let[t]=e;const n=this.getStringAtRange(e).slice(0,-1);let r=this;return n.replace(/.*?\n/g,function(s){t+=s.length,r=r.insertBlockBreakAtRange([t-1,t])}),{document:r,range:e}}consolidateBlocksAtRange(e){e=bt(e);const[t,n]=e,r=this.locationFromPosition(t).index,s=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,s))}getDocumentAtRange(e){e=bt(e);const t=this.blockList.getSplittableListInRange(e).toArray();return new this.constructor(t)}getStringAtRange(e){let t;const n=e=bt(e);return n[n.length-1]!==this.getLength()&&(t=-1),this.getDocumentAtRange(e).toString().slice(0,t)}getBlockAtIndex(e){return this.blockList.getObjectAtIndex(e)}getBlockAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getBlockAtIndex(t)}getTextAtIndex(e){var t;return(t=this.getBlockAtIndex(e))===null||t===void 0?void 0:t.text}getTextAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getTextAtIndex(t)}getPieceAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getPieceAtPosition(n)}getCharacterAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(e){return this.blockList.eachObject(e)}eachBlockAtRange(e,t){let n,r;e=bt(e);const[s,o]=e,l=this.locationFromPosition(s),a=this.locationFromPosition(o);if(l.index===a.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,a.offset],t(n,r,l.index);for(let c=l.index;c<=a.index;c++)if(n=this.getBlockAtIndex(c),n){switch(c){case l.index:r=[l.offset,n.text.getLength()];break;case a.index:r=[0,a.offset];break;default:r=[0,n.text.getLength()]}t(n,r,c)}}getCommonAttributesAtRange(e){e=bt(e);const[t]=e;if(or(e))return this.getCommonAttributesAtPosition(t);{const n=[],r=[];return this.eachBlockAtRange(e,function(s,o){if(o[0]!==o[1])return n.push(s.text.getCommonAttributesAtRange(o)),r.push(c0(s))}),Kn.fromCommonAttributesOfObjects(n).merge(Kn.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(e){let t,n;const{index:r,offset:s}=this.locationFromPosition(e),o=this.getBlockAtIndex(r);if(!o)return{};const l=c0(o),a=o.text.getAttributesAtPosition(s),c=o.text.getAttributesAtPosition(s-1),u=Object.keys(xs).filter(h=>xs[h].inheritable);for(t in c)n=c[t],(n===a[t]||u.includes(t))&&(l[t]=n);return l}getRangeOfCommonAttributeAtPosition(e,t){const{index:n,offset:r}=this.locationFromPosition(t),s=this.getTextAtIndex(n),[o,l]=Array.from(s.getExpandedRangeForAttributeAtOffset(e,r)),a=this.positionFromLocation({index:n,offset:o}),c=this.positionFromLocation({index:n,offset:l});return bt([a,c])}getBaseBlockAttributes(){let e=this.getBlockAtIndex(0).getAttributes();for(let t=1;t<this.getBlockCount();t++){const n=this.getBlockAtIndex(t).getAttributes(),r=Math.min(e.length,n.length);e=(()=>{const s=[];for(let o=0;o<r&&n[o]===e[o];o++)s.push(n[o]);return s})()}return e}getAttachmentById(e){for(const t of this.getAttachments())if(t.id===e)return t}getAttachmentPieces(){let e=[];return this.blockList.eachObject(t=>{let{text:n}=t;return e=e.concat(n.getAttachmentPieces())}),e}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getRangeOfAttachment(e){let t=0;const n=this.blockList.toArray();for(let r=0;r<n.length;r++){const{text:s}=n[r],o=s.getRangeOfAttachment(e);if(o)return bt([t+o[0],t+o[1]]);t+=s.getLength()}}getLocationRangeOfAttachment(e){const t=this.getRangeOfAttachment(e);return this.locationRangeFromRange(t)}getAttachmentPieceForAttachment(e){for(const t of this.getAttachm
`);if(t===this.containerElement||this.isBlockElement(t)){var n;const r=this.getBlockAttributes(t),s=this.getBlockHTMLAttributes(t);Ts(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,t,s),this.currentBlockElement=t)}}appendBlockForElement(e){const t=this.isBlockElement(e),n=ws(this.currentBlockElement,e);if(t&&!this.isBlockElement(e.firstChild)){if(!this.isInsignificantTextNode(e.firstChild)||!this.isBlockElement(e.firstElementChild)){const r=this.getBlockAttributes(e),s=this.getBlockHTMLAttributes(e);if(e.firstChild){if(n&&Ts(r,this.currentBlock.attributes))return this.appendStringWithAttributes(`
`);this.currentBlock=this.appendBlockForAttributesWithElement(r,e,s),this.currentBlockElement=e}}}else if(this.currentBlockElement&&!n&&!t){const r=this.findParentBlockElement(e);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(e){let{parentElement:t}=e;for(;t&&t!==this.containerElement;){if(this.isBlockElement(t)&&this.blockElements.includes(t))return t;t=t.parentElement}return null}processTextNode(e){let t=e.data;var n;return h0(e.parentNode)||(t=tp(t),Sk((n=e.previousSibling)===null||n===void 0?void 0:n.textContent)&&(t=k4(t))),this.appendStringWithAttributes(t,this.getTextAttributes(e.parentNode))}processElement(e){let t;if(Cs(e)){if(t=u0(e," attachment "),Object.keys(t).length){const n=this.getTextAttributes(e);this.appendAttachmentWithAttributes(t,n),e.innerHTML=" "}return this.processedElements.push(e)}switch(kn(e)){case" br ":return this.isExtraBR(e)||this.isBlockElement(e.nextSibling)||this.appendStringWithAttributes(`
`,this.getTextAttributes(e)),this.processedElements.push(e);case" img ":t={url:e.getAttribute(" src "),contentType:" image "};const n=(r=>{const s=r.getAttribute(" width "),o=r.getAttribute(" height "),l={};return s&&(l.width=parseInt(s,10)),o&&(l.height=parseInt(o,10)),l})(e);for(const r in n){const s=n[r];t[r]=s}return this.appendAttachmentWithAttributes(t,this.getTextAttributes(e)),this.processedElements.push(e);case" tr ":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableRowSeparator);break;case" td ":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableCellSeparator)}}appendBlockForAttributesWithElement(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(t);const r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(e,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(e,t){return this.appendPiece(mf(e,t))}appendAttachmentWithAttributes(e,t){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:" attachment "}}(e,t))}appendPiece(e){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(e)}appendStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[n.length-1];if((r==null?void 0:r.type)!==" string ")return n.push(mf(e));r.string+=e}prependStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[0];if((r==null?void 0:r.type)!==" string ")return n.unshift(mf(e));r.string=e+r.string}getTextAttributes(e){let t;const n={};for(const r in xs){const s=xs[r];if(s.tagName&&Yr(e,{matchingSelector:s.tagName,untilNode:this.containerElement}))n[r]=!0;else if(s.parser){if(t=s.parser(e),t){let o=!1;for(const l of this.findBlockElementAncestors(e))if(s.parser(l)===t){o=!0;break}o||(n[r]=t)}}else s.styleProperty&&(t=e.style[s.styleProperty],t&&(n[r]=t))}if(Cs(e)){const r=u0(e," attributes ");for(const s in r)t=r[s],n[s]=t}return n}getBlockAttributes(e){const t=[];for(;e&&e!==this.containerElement;){for(const r in Sn){const s=Sn[r];var n;s.parse!==!1&&kn(e)===s.tagName&&((n=s.test)!==null&&n!==void 0&&n.call(s,e)||!s.test)&&(t.push(r),s.listAttribute&&t.push(s.listAttribute))}e=e.parentNode}return t.reverse()}getBlockHTMLAttributes(e){const t={},n=Object.values(Sn).find(r=>r.tagName===kn(e));return((n==null?void 0:n.htmlAttributes)||[]).forEach(r=>{e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}),t}findBlockElementAncestors(e){const t=[];for(;e&&e!==this.containerElement;){const n=kn(e);Nl().includes(n)&&t.push(e),e=e.parentNode}return t}isBlockElement(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE&&!Cs(e)&&!Yr(e,{matchingSelector:" td ",untilNode:this.containerElement}))return Nl().includes(kn(e))||window.getComputedStyle(e).display===" block "}isInsignificantTextNode(e){if((e==null?void 0:e.nodeType)!==Node.TEXT_NODE||!S4(e.data))return;const{parentNode:t,previousSibling:n,nextSibling:r}=e;return w4(t.previousSibling)&&!this.isBlockElement(t.previousSibling)||h0(t)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(e){return kn(e)===" br "&&this.isBlockElement(e.parentNode)&&e.parentNode.lastChild===e}needsTableSeparator(e){if(Fc.removeBlankTableCells){var t;const n=(t=e.previousSibling)===null||t===void 0?void 0:t.textContent;return n&&/\S/.test(n)}return e.previousSibling}translateBlockElementMarginsToNewlines(){const e=this.getMarginOfDefaultBlockElement();for(let t=0;t<this.blocks.length;t++){const n=this.getMarginOfBlockElementAtIndex(t);n&&(n.top>2*e.top&&this.prependStringToTextAtIndex(`
2026-05-08 17:55:22 +03:00
`,t),n.bottom>2*e.bottom&&this.appendStringToTextAtIndex(`
2026-05-15 17:07:12 +03:00
`,t))}}getMarginOfBlockElementAtIndex(e){const t=this.blockElements[e];if(t&&t.textContent&&!Nl().includes(kn(t))&&!this.processedElements.includes(t))return f0(t)}getMarginOfDefaultBlockElement(){const e=Ge(Sn.default.tagName);return this.containerElement.appendChild(e),f0(e)}}const h0=function(i){const{whiteSpace:e}=window.getComputedStyle(i);return[" pre "," pre - wrap "," pre - line "].includes(e)},w4=i=>i&&!Sk(i.textContent),f0=function(i){const e=window.getComputedStyle(i);if(e.display===" block ")return{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}},y4=function(i){return kn(i)===" style "?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},k4=i=>i.replace(new RegExp(" ^ ".concat(ep.source," + "))," "),S4=i=>new RegExp(" ^ ".concat(ep.source," * $ ")).test(i),Sk=i=>/\s$/.test(i),_4=[" contenteditable "," data - trix - id "," data - trix - store - key "," data - trix - mutable "," data - trix - placeholder "," tabindex "],Md=" data - trix - serialized - attributes ",C4=" [ ".concat(Md," ] "),P4=new RegExp(" <!-- block -- > "," g "),A4={" application / json ":function(i){let e;if(i instanceof si)e=i;else{if(!(i instanceof HTMLElement))throw new Error(" unserializable object ");e=oa.parse(i.innerHTML).getDocument()}return e.toSerializableDocument().toJSONString()}," text / html ":function(i){let e;if(i instanceof si)e=ah.render(i);else{if(!(i instanceof HTMLElement))throw new Error(" unserializable object ");e=i.cloneNode(!0)}return Array.from(e.querySelectorAll(" [ data - trix - serialize = false ] ")).forEach(t=>{zr(t)}),_4.forEach(t=>{Array.from(e.querySelectorAll(" [ ".concat(t," ] "))).forEach(n=>{n.removeAttribute(t)})}),Array.from(e.querySelectorAll(C4)).forEach(t=>{try{const n=JSON.parse(t.getAttribute(Md));t.removeAttribute(Md);for(const r in n){const s=n[r];t.setAttribute(r,s)}}catch{}}),e.innerHTML.replace(P4," ")}};var x4=Object.freeze({__proto__:null});class Nt extends Kt{constructor(e,t){super(...arguments),this.attachmentManager=e,this.attachment=t,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}Nt.proxyMethod(" attachment . getAttribute "),Nt.proxyMethod(" attachment . hasAttribute "),Nt.proxyMethod(" attachment . setAttribute "),Nt.proxyMethod(" attachment . getAttributes "),Nt.proxyMethod(" attachment . setAttributes "),Nt.proxyMethod(" attachment . isPending "),Nt.proxyMethod(" attachment . isPreviewable "),Nt.proxyMethod(" attachment . getURL "),Nt.proxyMethod(" attachment . getPreviewURL "),Nt.proxyMethod(" attachment . setPreviewURL "),Nt.proxyMethod(" attachment . getHref "),Nt.proxyMethod(" attachment . getFilename "),Nt.proxyMethod(" attachment . getFilesize "),Nt.proxyMethod(" attachment . getFormattedFilesize "),Nt.proxyMethod(" attachment . getExtension "),Nt.proxyMethod(" attachment . getContentType "),Nt.proxyMethod(" attachment . getFile "),Nt.proxyMethod(" attachment . setFile "),Nt.proxyMethod(" attachment . releaseFile "),Nt.proxyMethod(" attachment . getUploadProgress "),Nt.proxyMethod(" attachment . setUploadProgress ");class _k extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(e).forEach(t=>{this.manageAttachment(t)})}getAttachments(){const e=[];for(const t in this.managedAttachments){const n=this.managedAttachments[t];e.push(n)}return e}manageAttachment(e){return this.managedAttachments[e.id]||(this.managedAttachments[e.id]=new Nt(this,e)),this.managedAttachments[e.id]}attachmentIsManaged(e){return e.id in this.managedAttachments}requestRemovalOfAttachment(e){var t,n;if(this.attachmentIsManaged(e))return(t=this.delegate)===null||t===void 0||(n=t.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}unmanageAttachment(e){const t=this.managedAttachments[e.id];return delete this.managedAttachments[e.id],t}}class Ck{constructor(e){this.composition=e,this.document=this.composition.document;const t=this.composition.getSelectedRange();this.startPosition=t[0],this.endPosition=t[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this
2026-05-08 17:55:22 +03:00
`}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===`
`||this.previousCharacter===`
2026-05-15 17:07:12 +03:00
`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}}class Tr extends Kt{constructor(){super(...arguments),this.document=new si,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(e){var t,n;if(!e.isEqualTo(this.document))return this.document=e,this.refreshAttachments(),this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(t,e)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(e){var t,n,r,s;let{document:o,selectedRange:l}=e;return(t=this.delegate)===null||t===void 0||(n=t.compositionWillLoadSnapshot)===null||n===void 0||n.call(t),this.setDocument(o??new si),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(s=r.compositionDidLoadSnapshot)===null||s===void 0?void 0:s.call(r)}insertText(e){let{updatePosition:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(e,n));const r=n[0],s=r+e.getLength();return t&&this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}insertBlock(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Xi;const t=new si([e]);return this.insertDocument(t)}insertDocument(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new si;const t=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(e,t));const n=t[0],r=n+e.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(e,t){const n=this.getCurrentTextAttributes(),r=Si.textForStringWithAttributes(e,n);return this.insertText(r,t)}insertBlockBreak(){const e=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(e));const t=e[0],n=t+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([t,n])}insertLineBreak(){const e=new Ck(this);if(e.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(e.startPosition);if(e.shouldPrependListItem()){const t=new si([e.block.copyWithoutText()]);return this.insertDocument(t)}return e.shouldInsertBlockBreak()?this.insertBlockBreak():e.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():e.shouldBreakFormattedBlock()?this.breakFormattedBlock(e):this.insertString(`
`)}insertHTML(e){const t=oa.parse(e,{purifyOptions:{SAFE_FOR_XML:!0}}).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(t,n));const r=n[0],s=r+t.getLength()-1;return this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}replaceHTML(e){const t=oa.parse(e).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(t),this.setSelection(r)}insertFile(e){return this.insertFiles([e])}insertFiles(e){const t=[];return Array.from(e).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){const s=Yo.attachmentForFile(n);t.push(s)}}),this.insertAttachments(t)}insertAttachment(e){return this.insertAttachments([e])}insertAttachments(e){let t=new Si;return Array.from(e).forEach(n=>{var r;const s=n.getType(),o=(r=jm[s])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();o&&(l.presentation=o);const a=Si.textForAttachmentWithAttributes(n,l);t=t.appendText(a)}),this.insertText(t)}shouldManageDeletingInDirection(e){const t=this.getLocationRange();if(or(t)){if(e===" backward "&&t[0].offset===0||this.shouldManageMovingCursorInDirection(e))return!0}else if(t[0].index!==t[1].index)return!0;return!1}deleteInDirection(e){let t,n,r,{length:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getLocationRange();let l=this.getSelectedRange();const a=or(l);if(a?n=e===" backward "&&o[0].offset===0:r=o[0].index!==o[1].index,n&&this.canDecreaseBlockAttributeLevel()){const c=this.getBlock();if(c.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),c.isEmpty())return!1}return a&&(l=this.getExpandedRangeInDirection(e,{length:s}),e===" backward "&&(t=this.getAttachmentAtRange(l))),t?(this.editAttachment(t),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(e){const[t]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(e,t)),this.setSelection(t)}removeAttachment(e){const t=this.document.getRangeOfAttachment(e);if(t)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(t)),this.setSelection(t[0])}removeLastBlockAttribute(){const[e,t]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(t);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(e)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(e){const t=this.currentAttributes[e];return t!=null&&t!==!1}toggleCurrentAttribute(e){const t=!this.currentAttributes[e];return t?this.setCurrentAttribute(e,t):this.removeCurrentAttribute(e)}canSetCurrentAttribute(e){return zt(e)?this.canSetCurrentBlockAttribute(e):this.canSetCurrentTextAttribute(e)}canSetCurrentTextAttribute(e){const t=this.getSelectedDocument();if(t){for(const n of Array.from(t.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(e){const t=this.getBlock();if(t)return!t.isTerminalBlock()}setCurrentAttribute(e,t){return zt(e)?this.setBlockAttribute(e,t):(this.setTextAttribute(e,t),this.currentAttributes[e]=t,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(e,t,n){var r;const s=this.document.getBlockAtPosition(e),o=(r=zt(s.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(s&&o!=null&&o.includes(t)){const l=this.document.setHTMLAttributeAtPosition(e,t,n);this.setDocument(l)}}setTextAttribute(e,t){const n=this.getSelectedRange();if(!n)return;const[r,s]=Array.from(n);if(r!==s)return this.setDocument(this.document.addAttributeAtRange(e,t,n));if(e===" href "){const o=Si.textForStringWithAttributes(t,{href:t});return this.insertText(o)}}setBlockAttribute(e,t){con
2026-05-08 17:55:22 +03:00
`?r+=1:t=t.removeTextAtRange(s),s=[r,r]):e.nextCharacter===`
`?e.previousCharacter===`
`?s=[r-1,r+1]:(s=[r,r+1],r+=1):e.startLocation.offset-1!=0&&(r+=1);const o=new si([n.removeLastAttribute().copyWithoutText()]);return this.setDocument(t.insertDocumentAtRange(o,s)),this.setSelection(r)}getPreviousBlock(){const e=this.getLocationRange();if(e){const{index:t}=e[0];if(t>0)return this.document.getBlockAtIndex(t-1)}}getBlock(){const e=this.getLocationRange();if(e)return this.document.getBlockAtIndex(e[0].index)}getAttachmentAtRange(e){const t=this.document.getDocumentAtRange(e);if(t.toString()===" ".concat("  ",`
2026-05-15 17:07:12 +03:00
`))return t.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.compositionDidChangeCurrentAttributes)===null||t===void 0?void 0:t.call(e,this.currentAttributes)}notifyDelegateOfInsertionAtRange(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(t,e)}translateUTF16PositionFromOffset(e,t){const n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(e);return n.offsetToUCS2Offset(r+t)}}Tr.proxyMethod(" getSelectionManager ( ) . getPointRange "),Tr.proxyMethod(" getSelectionManager ( ) . setLocationRangeFromPointRange "),Tr.proxyMethod(" getSelectionManager ( ) . createLocationRangeFromDOMRange "),Tr.proxyMethod(" getSelectionManager ( ) . locationIsCursorTarget "),Tr.proxyMethod(" getSelectionManager ( ) . selectionIsExpanded "),Tr.proxyMethod(" delegate ? . getSelectionManager ");class Ed extends Kt{constructor(e){super(...arguments),this.composition=e,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.undoEntries.slice(-1)[0];if(!n||!T4(r,e,t)){const s=this.createEntry({description:e,context:t});this.undoEntries.push(s),this.redoEntries=[]}}undo(){const e=this.undoEntries.pop();if(e){const t=this.createEntry(e);return this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}redo(){const e=this.redoEntries.pop();if(e){const t=this.createEntry(e);return this.undoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:e,context:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:e==null?void 0:e.toString(),context:JSON.stringify(t),snapshot:this.composition.getSnapshot()}}}const T4=(i,e,t)=>(i==null?void 0:i.description)===(e==null?void 0:e.toString())&&(i==null?void 0:i.context)===JSON.stringify(t),pf=" attachmentGallery ";class Pk{constructor(e){this.document=e.document,this.selectedRange=e.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(e=>this.document=this.document.removeAttributeAtRange(pf,e))}applyBlockAttribute(){let e=0;this.findRangesOfPieces().forEach(t=>{t[1]-t[0]>1&&(t[0]+=e,t[1]+=e,this.document.getCharacterAtPosition(t[1])!==`
2026-05-08 17:55:22 +03:00
`&&(this.document=this.document.insertBlockBreakAtRange(t[1]),t[1]<this.selectedRange[1]&&this.moveSelectedRangeForward(),t[1]++,e++),t[0]!==0&&this.document.getCharacterAtPosition(t[0]-1)!==`
2026-05-15 17:07:12 +03:00
`&&(this.document=this.document.insertBlockBreakAtRange(t[0]),t[0]<this.selectedRange[0]&&this.moveSelectedRangeForward(),t[0]++,e++),this.document=this.document.applyBlockAttributeAtRange(pf,!0,t))})}findRangesOfBlocks(){return this.document.findRangesForBlockAttribute(pf)}findRangesOfPieces(){return this.document.findRangesForTextAttribute(" presentation ",{withValue:" gallery "})}moveSelectedRangeForward(){this.selectedRange[0]+=1,this.selectedRange[1]+=1}}const Ak=function(i){const e=new Pk(i);return e.perform(),e.getSnapshot()},Q4=[Ak];class xk{constructor(e,t,n){this.insertFiles=this.insertFiles.bind(this),this.composition=e,this.selectionManager=t,this.element=n,this.undoManager=new Ed(this.composition),this.filters=Q4.slice(0)}loadDocument(e){return this.loadSnapshot({document:e,selectedRange:[0,0]})}loadHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ";const t=oa.parse(e,{referenceElement:this.element}).getDocument();return this.loadDocument(t)}loadJSON(e){let{document:t,selectedRange:n}=e;return t=si.fromJSON(t),this.loadSnapshot({document:t,selectedRange:n})}loadSnapshot(e){return this.undoManager=new Ed(this.composition),this.composition.loadSnapshot(e)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(e){return this.composition.deleteInDirection(e)}insertAttachment(e){return this.composition.insertAttachment(e)}insertAttachments(e){return this.composition.insertAttachments(e)}insertDocument(e){return this.composition.insertDocument(e)}insertFile(e){return this.composition.insertFile(e)}insertFiles(e){return this.composition.insertFiles(e)}insertHTML(e){return this.composition.insertHTML(e)}insertString(e){return this.composition.insertString(e)}insertText(e){return this.composition.insertText(e)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(e){const t=this.getDocument().locationRangeFromRange([e,e+1]);return this.selectionManager.getClientRectAtLocationRange(t)}expandSelectionInDirection(e){return this.composition.expandSelectionInDirection(e)}moveCursorInDirection(e){return this.composition.moveCursorInDirection(e)}setSelectedRange(e){return this.composition.setSelectedRange(e)}activateAttribute(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(e,t)}attributeIsActive(e){return this.composition.hasCurrentAttribute(e)}canActivateAttribute(e){return this.composition.canSetCurrentAttribute(e)}deactivateAttribute(e){return this.composition.removeCurrentAttribute(e)}setHTMLAtributeAtPosition(e,t,n){this.composition.setHTMLAtributeAtPosition(e,t,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(e,{context:t,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class Tk{constructor(e){this.element=e}findLocationFromContainerAndOffset(e,t){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,s=!1;const o={index:0,offset:0},l=this.findAttachmentElementParentForNode(e);l&&(e=l.parentNode,t=Hh(l));const a=vu(this.element,{usingFilter:Qk});for(;a.nextNode();){const c=a.currentNode;if(c===e&&Zl(e)){mo(c)||(o.offset+=t);break}if(c.parentNode===e){if(r++===t){!n&&Jh(c,{strict:n})&&
`]):(e=Rd(n),t=Rd(r));const s=e.filter((l,a)=>l!==t[a]).map(kl),o=t.filter((l,a)=>l!==e[a]).map(kl);return{additions:s,deletions:o}}getTextChangesFromCharacterData(){let e,t;const n=this.getMutationsByType(" characterData ");if(n.length){const r=n[0],s=n[n.length-1],o=function(l,a){let c,u;return l=sa.box(l),(a=sa.box(a)).length<l.length?[u,c]=V1(l,a):[c,u]=V1(a,l),{added:c,removed:u}}(kl(r.oldValue),kl(s.target.data));e=o.added,t=o.removed}return{additions:e?[e]:[],deletions:t?[t]:[]}}}const Rd=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const t of Array.from(i))switch(t.nodeType){case Node.TEXT_NODE:e.push(t.data);break;case Node.ELEMENT_NODE:kn(t)===" br "?e.push(`
`):e.push(...Array.from(Rd(t.childNodes)||[]))}return e};class Nk extends yu{constructor(e){super(...arguments),this.file=e}perform(e){const t=new FileReader;return t.onerror=()=>e(!1),t.onload=()=>{t.onerror=null;try{t.abort()}catch{}return e(!0,this.file)},t.readAsArrayBuffer(this.file)}}class I4{constructor(e){this.element=e}shouldIgnore(e){return!!Da.samsungAndroid&&(this.previousEvent=this.event,this.event=e,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&N4(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!==" insertText "&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var e;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((e=this.event.data)===null||e===void 0?void 0:e.length)>50}isBeforeInputInsertText(){return this.event.type===" beforeinput "&&this.event.inputType===" insertText "}previousEventWasUnidentifiedKeydown(){var e,t;return((e=this.previousEvent)===null||e===void 0?void 0:e.type)===" keydown "&&((t=this.previousEvent)===null||t===void 0?void 0:t.key)===" Unidentified "}}const N4=(i,e)=>d0(i)===d0(e),Z4=new RegExp(" ( ".concat("  "," | ").concat(oh," | ").concat(Rr," | \ \ s ) + ")," g "),d0=i=>i.replace(Z4," ").trim();class ch extends Kt{constructor(e){super(...arguments),this.element=e,this.mutationObserver=new Ik(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new I4(this.element);for(const t in this.constructor.events)Zt(t,{onElement:this.element,withCallback:this.handlerFor(t)})}elementDidMutate(e){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestRender)===null||t===void 0?void 0:t.call(e)}requestReparse(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestReparse)===null||t===void 0||t.call(e),this.requestRender()}attachFiles(e){const t=Array.from(e).map(n=>new Nk(n));return Promise.all(t).then(n=>{this.handleInput(function(){var r,s;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(s=this.responder)===null||s===void 0||s.insertFiles(n),this.requestRender()})})}handlerFor(e){return t=>{t.defaultPrevented||this.handleInput(()=>{if(!Gm(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(t))return;this.eventName=e,this.constructor.events[e].call(this,t)}})}}handleInput(e){try{var t;(t=this.delegate)===null||t===void 0||t.inputControllerWillHandleInput(),e.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(e,t){const n=document.createElement(" a ");return n.href=e,n.textContent=t||e,n.outerHTML}}var vf;gn(ch," events ",{});const{browser:B4,keyNames:Zk}=$a;let W4=0;class ir extends ch{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const t in e){const n=e[t];this.inputSummary[t]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Qs.reset()}elementDidMutate(e){var t,n;return this.isComposing()?(t=this.delegate)===null||t===void 0||(n=t.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(t):this.handleInput(function(){return this.mutationIsSignificant(e)&&(this.mutationIsExpected(e)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(e){let{textAdded:t,textDeleted:n}=e;if(this.inputSummary.preferDocument)return!0;const r=t!=null?t===this.inputSummary.textAdded:!this.inputSummary.textAdded,s=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,o=[`
2026-05-08 17:55:22 +03:00
`,`
`].includes(t)&&!r,l=n===`
2026-05-15 17:07:12 +03:00
`&&!s;if(o&&!l||l&&!o){const c=this.getSelectedRange();if(c){var a;const u=o?t.replace(/\n$/," ").length||-1:(t==null?void 0:t.length)||1;if((a=this.responder)!==null&&a!==void 0&&a.positionIsBlockBreak(c[1]+u))return!0}}return r&&s}mutationIsSignificant(e){var t;const n=Object.keys(e).length>0,r=((t=this.compositionInput)===null||t===void 0?void 0:t.getEndData())===" ";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new Ar(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(e,t){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(e))!==!1?this.setInputSummary({didDelete:!0}):t?(t.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(e){var t;if(!function(r){if(r==null||!r.setData)return!1;for(const s in F1){const o=F1[s];try{if(r.setData(s,o),!r.getData(s)===o)return!1}catch{return!1}}return!0}(e))return;const n=(t=this.responder)===null||t===void 0?void 0:t.getSelectedDocument().toSerializableDocument();return e.setData(" application / x - trix - document ",JSON.stringify(n)),e.setData(" text / html ",ah.render(n).innerHTML),e.setData(" text / plain ",n.toString().replace(/\n$/," ")),!0}canAcceptDataTransfer(e){const t={};return Array.from((e==null?void 0:e.types)||[]).forEach(n=>{t[n]=!0}),t.Files||t[" application / x - trix - document "]||t[" text / html "]||t[" text / plain "]}getPastedHTMLUsingHiddenElement(e){const t=this.getSelectedRange(),n={position:" absolute ",left:" ".concat(window.pageXOffset," px "),top:" ".concat(window.pageYOffset," px "),opacity:0},r=Ge({style:n,tagName:" div ",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{const s=r.innerHTML;return zr(r),this.setSelectedRange(t),e(s)})}}gn(ir," events ",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const e=Zk[i.keyCode];if(e){var t;let r=this.keys;[" ctrl "," alt "," shift "," meta "].forEach(s=>{var o;i[" ".concat(s," Key ")]&&(s===" ctrl "&&(s=" control "),r=(o=r)===null||o===void 0?void 0:o[s])}),((t=r)===null||t===void 0?void 0:t[e])!=null&&(this.setInputSummary({keyName:e}),Qs.reset(),r[e].call(this,i))}if(ok(i)){const r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;const s=[" alt "," shift "].map(o=>{if(i[" ".concat(o," Key ")])return o}).filter(o=>o);s.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(s)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;const e=Y4(i);var t,n;return e?((t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){const{data:e}=i,{textAdded:t}=this.inputSummary;if(t&&t!==e&&t.toUpperCase()===e){var n;const r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+t.length]),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var e,t;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidStartDrag)===null||t===void 0?void 0:t.call(e)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();const n={x:i.clientX,y:i.clientY};var e,t;if(!Fo(n,this.draggingPoint))return this.draggingPoint=n,(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidReceiveDragOverPoint)===null||t===void 0?void 0:t.call(e,this.draggingPoint)}},dragend(i){var e,t;(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidCancelDrag)===null||t===void 0||t.call(e),this.draggedRange=null,this.draggingPoint=null},drop(i){var e,t;i.preventDefault();const n=(e=i.dataTransfer)===null||e===void 0?void 0:e.files,r=i.dataTransfer.getData(" application / x - trix - document "),s={x:i.clientX,y:i.clientY};if((t=this.responder)===null||t===void
2026-05-08 17:55:22 +03:00
`,{updatePosition:!1}),this.requestRender()}},shift:{return(i){var e,t;(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(`
2026-05-15 17:07:12 +03:00
`),this.requestRender(),i.preventDefault()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canDecreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection(" backward ")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection(" forward ")}},alt:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}},meta:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}}}),ir.proxyMethod(" responder ? . getSelectedRange "),ir.proxyMethod(" responder ? . setSelectedRange "),ir.proxyMethod(" responder ? . expandSelectionInDirection "),ir.proxyMethod(" responder ? . selectionIsInCursorTarget "),ir.proxyMethod(" responder ? . selectionIsExpanded ");const X4=i=>{var e;return(e=i.type)===null||e===void 0||(e=e.match(/\/(\w+)$/))===null||e===void 0?void 0:e[1]},F4=!((vf=" ".codePointAt)===null||vf===void 0||!vf.call(" ",0)),Y4=function(i){if(i.key&&F4&&i.key.codePointAt(0)===i.keyCode)return i.key;{let e;if(i.which===null?e=i.keyCode:i.which!==0&&i.charCode!==0&&(e=i.charCode),e!=null&&Zk[e]!==" escape ")return sa.fromCodepoints([e]).toString()}},z4=function(i){const e=i.clipboardData;if(e){if(e.types.includes(" text / html ")){for(const t of e.types){const n=/^CorePasteboardFlavorType/.test(t),r=/^dyn\./.test(t)&&e.getData(t);if(n||r)return!0}return!1}{const t=e.types.includes(" com . apple . webarchive "),n=e.types.includes(" com . apple . flat - rtfd ");return t||n}}};class Ar extends Kt{constructor(e){super(...arguments),this.inputController=e,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(e){if(this.data.start=e,this.isSignificant()){var t,n;this.inputSummary.eventName===" keypress "&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection(" left ")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange()}}update(e){if(this.data.update=e,this.isSignificant()){const t=this.selectPlaceholder();t&&(this.forgetPlaceholder(),this.range=t)}}end(e){return this.data.end=e,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(s=this.responder)===null||s===void 0?void 0:s.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var t,n,r,s}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!B4.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var e,t;return((e=this.data.start)===null||e===void 0?void 0:e.length)===0&&((t=this.data.end)===null||t===void 0?void 0:t.length)>0&&this.range}}Ar.proxyMethod(" inputController . setInputSummary "),Ar.proxyMethod(" inputController . requestRender "),Ar.proxyMethod(" inputController . requestReparse "),Ar.proxyMethod(" responder ? . selectionIsExpanded "),Ar.proxyMethod(" responder ? . insertPlaceholder "),Ar.proxyMethod(" responder ? . selectPlaceholder "),Ar.proxyMethod(" responder ? . forgetPlaceholder ");class Xl extends ch{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidAllowUnhandledInput)===null||t===void 0?void 0:t.call(e):void 0:this.reparse();var e,t}scheduleRender(){return this.scheduledRender?this.schedul
`)},insertLink(){return this.activateAttributeIfSupported(" href ",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported(" number ")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){const i=this.event.dataTransfer.getData(" text / plain "),e=this.event.getTargetRanges()[0];this.withTargetDOMRange(e,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData(" text / plain ")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported(" bullet ")}});const V4=function(i){const e=document.createRange();return e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e},wf=i=>{var e;return Array.from(((e=i.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes(" Files ")},U4=i=>{var e;return((e=i.dataTransfer.files)===null||e===void 0?void 0:e[0])&&!Bk(i)&&!(t=>{let{dataTransfer:n}=t;return n.types.includes(" Files ")&&n.types.includes(" text / html ")&&n.getData(" text / html ").includes(" urn : schemas - microsoft - com : office : office ")})(i)},Bk=function(i){const e=i.clipboardData;if(e)return Array.from(e.types).filter(t=>t.match(/file/i)).length===e.types.length&&e.files.length>=1},j4=function(i){const e=i.clipboardData;if(e)return e.types.includes(" text / plain ")&&e.types.length===1},q4=function(i){const e=[];return i.altKey&&e.push(" alt "),i.shiftKey&&e.push(" shift "),e.push(i.key),e},yf=i=>({x:i.clientX,y:i.clientY}),Dd=" [ data - trix - attribute ] ",$d=" [ data - trix - action ] ",G4=" ".concat(Dd," , ").concat($d),uh=" [ data - trix - dialog ] ",H4=" ".concat(uh," [ data - trix - active ] "),K4=" ".concat(uh," [ data - trix - method ] "),m0=" ".concat(uh," [ data - trix - input ] "),p0=(i,e)=>(e||(e=Js(i)),i.querySelector(" [ data - trix - input ] [ name = '".concat(e,"' ] "))),g0=i=>i.getAttribute(" data - trix - action "),Js=i=>i.getAttribute(" data - trix - attribute ")||i.getAttribute(" data - trix - dialog - attribute ");class Wk extends Kt{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Zt(" mousedown ",{onElement:this.element,matchingSelector:$d,withCallback:this.didClickActionButton}),Zt(" mousedown ",{onElement:this.element,matchingSelector:Dd,withCallback:this.didClickAttributeButton}),Zt(" click ",{onElement:this.element,matchingSelector:G4,preventDefault:!0}),Zt(" click ",{onElement:this.element,matchingSelector:K4,withCallback:this.didClickDialogButton}),Zt(" keydown ",{onElement:this.element,matchingSelector:m0,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=g0(t);return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0?void 0:s.toolbarDidInvokeAction(r,t);var s}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=Js(t);var s;return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0||s.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(e,t){const n=Yr(t,{matchingSelector:uh});return this[t.getAttribute(" data - trix - method ")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();const n=t.getAttribute(" name "),r=this.getDialog(n);this.setAttribute(r)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.
2026-05-08 17:55:22 +03:00
display: block;
}
%t {
white-space: nowrap;
}
%t [data-trix-dialog] {
display: none;
}
%t [data-trix-dialog][data-trix-active] {
display: block;
}
%t [data-trix-dialog] [data-trix-validate]:invalid {
background-color: #ffdddd;
2026-05-15 17:07:12 +03:00
}`);class Xk extends HTMLElement{connectedCallback(){this.innerHTML===" "&&(this.innerHTML=ik.getDefaultHTML())}get editorElements(){if(this.id){var e;const t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll('trix-editor[toolbar=" '.concat(this.id,' "]'));return Array.from(t)}return[]}get editorElement(){const[e]=this.editorElements;return e}}let nD=0;const iD=function(i){if(!i.hasAttribute(" contenteditable "))return i.toggleAttribute(" contenteditable ",!i.disabled),function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.times=1,Zt(e,t)}(" focus ",{onElement:i,withCallback:()=>rD(i)})},rD=function(i){return sD(i),oD()},sD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t," enableObjectResizing "))return document.execCommand(" enableObjectResizing ",!1,!1),Zt(" mscontrolselect ",{onElement:i,preventDefault:!0})},oD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t," DefaultParagraphSeparator ")){const{tagName:n}=Sn.default;if([" div "," p "].includes(n))return document.execCommand(" DefaultParagraphSeparator ",!1,n)}},O0=Da.forcesObjectResizing?{display:" inline ",width:" auto "}:{display:" inline - block ",width:" 1 px "};rk(" trix - editor ",`%t {
2026-05-08 17:55:22 +03:00
display: block;
}
%t:empty::before {
content: attr(placeholder);
color: graytext;
cursor: text;
pointer-events: none;
white-space: pre-line;
}
%t a[contenteditable=false] {
cursor: text;
}
%t img {
max-width: 100%;
height: auto;
}
2026-05-15 17:07:12 +03:00
%t `.concat(_s,` figcaption textarea {
2026-05-08 17:55:22 +03:00
resize: none;
}
2026-05-15 17:07:12 +03:00
%t `).concat(_s,` figcaption textarea.trix-autoresize-clone {
2026-05-08 17:55:22 +03:00
position: absolute;
left: -9999px;
max-height: 0px;
}
2026-05-15 17:07:12 +03:00
%t `).concat(_s,` figcaption[data-trix-placeholder]:empty::before {
2026-05-08 17:55:22 +03:00
content: attr(data-trix-placeholder);
color: graytext;
}
%t [data-trix-cursor-target] {
2026-05-15 17:07:12 +03:00
display: `).concat(O0.display,` !important;
width: `).concat(O0.width,` !important;
2026-05-08 17:55:22 +03:00
padding: 0 !important;
margin: 0 !important;
border: none !important;
}
%t [data-trix-cursor-target=left] {
vertical-align: top !important;
margin-left: -1px !important;
}
%t [data-trix-cursor-target=right] {
vertical-align: bottom !important;
margin-right: -1px !important;
2026-05-15 17:07:12 +03:00
}`));var wi=new WeakMap,ac=new WeakMap,cl=new WeakSet;class lD{constructor(e){var t,n;wk(t=this,n=cl),n.add(t),gn(this," value "," "),po(this,wi,{writable:!0,value:void 0}),po(this,ac,{writable:!0,value:void 0}),this.element=e,Wl(this,wi,e.attachInternals()),Wl(this,ac,!1)}connectedCallback(){lc(this,cl,cc).call(this)}disconnectedCallback(){}get form(){return it(this,wi).form}get name(){return this.element.getAttribute(" name ")}set name(e){this.element.setAttribute(" name ",e)}get labels(){return it(this,wi).labels}get disabled(){return it(this,ac)||this.element.hasAttribute(" disabled ")}set disabled(e){this.element.toggleAttribute(" disabled ",e)}get required(){return this.element.hasAttribute(" required ")}set required(e){this.element.toggleAttribute(" required ",e),lc(this,cl,cc).call(this)}get validity(){return it(this,wi).validity}get validationMessage(){return it(this,wi).validationMessage}get willValidate(){return it(this,wi).willValidate}formDisabledCallback(e){Wl(this,ac,e)}setFormValue(e){this.value=e,lc(this,cl,cc).call(this),it(this,wi).setFormValue(this.element.disabled?void 0:this.value)}checkValidity(){return it(this,wi).checkValidity()}reportValidity(){return it(this,wi).reportValidity()}setCustomValidity(e){lc(this,cl,cc).call(this,e)}}function cc(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ";const{required:e,value:t}=this.element,n=e&&!t,r=!!i,s=Ge(" input ",{required:e}),o=i||s.validationMessage;it(this,wi).setValidity({valueMissing:n,customError:r},o)}var kf=new WeakMap,Sf=new WeakMap,_f=new WeakMap;class aD{constructor(e){po(this,kf,{writable:!0,value:void 0}),po(this,Sf,{writable:!0,value:t=>{t.defaultPrevented||t.target===this.element.form&&this.element.reset()}}),po(this,_f,{writable:!0,value:t=>{if(t.defaultPrevented||this.element.contains(t.target))return;const n=Yr(t.target,{matchingSelector:" label "});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=e}connectedCallback(){Wl(this,kf,function(e){if(e.hasAttribute(" aria - label ")||e.hasAttribute(" aria - labelledby "))return;const t=function(){const n=Array.from(e.labels).map(s=>{if(!s.contains(e))return s.textContent}).filter(s=>s),r=n.join(" ");return r?e.setAttribute(" aria - label ",r):e.removeAttribute(" aria - label ")};return t(),Zt(" focus ",{onElement:e,withCallback:t})}(this.element)),window.addEventListener(" reset ",it(this,Sf),!1),window.addEventListener(" click ",it(this,_f),!1)}disconnectedCallback(){var e;(e=it(this,kf))===null||e===void 0||e.destroy(),window.removeEventListener(" reset ",it(this,Sf),!1),window.removeEventListener(" click ",it(this,_f),!1)}get labels(){const e=[];this.element.id&&this.element.ownerDocument&&e.push(...Array.from(this.element.ownerDocument.querySelectorAll(" label [ for = '".concat(this.element.id,"' ] "))||[]));const t=Yr(this.element,{matchingSelector:" label "});return t&&[this.element,null].includes(t.control)&&e.push(t),e}get form(){return console.warn(" This browser does not support the . form property for trix - editor elements . "),null}get name(){return console.warn(" This browser does not support the . name property for trix - editor elements . "),null}set name(e){console.warn(" This browser does not support the . name property for trix - editor elements . ")}get disabled(){return console.warn(" This browser does not support the [ disabled ] attribute for trix - editor elements . "),!1}set disabled(e){console.warn(" This browser does not support the [ disabled ] attribute for trix - editor elements . ")}get required(){return console.warn(" This browser does not support the [ required ] attribute for trix - editor elements . "),!1}set required(e){console.warn(" This browser does not support the [ required ] attribute for trix - editor elements . ")}get validity(){return console.warn(" This browser does not support the validity property for trix - editor elements . "),null}get validationMessage(){return console.warn(" This browser does not support the validationMessage property for trix - editor elements . ")," "}get willValidate(){return console.warn(" This browser does not support the willValidate property for trix - editor elements . "),!1}formDisab
`){[e,t]=To(this,e,t);let r=" ";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new Ft(n,r)),n=[],r=-1);return r>-1&&t.push(new Ft(n,r)),t}}class Ni extends at{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let c=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?n.push(l):l.decompose(e-o,t-o,n,c)}o=a+1}}replace(e,t,n){if([e,t]=To(this,e,t),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,n),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new Ni(u,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
`){[e,t]=To(this,e,t);let r=" ";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ni))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],c=e.children[s];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let m of e)m.flatten(d);return new Ft(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function h(d){let m;if(d.lines>s&&d instanceof Ni)for(let p of d.children)h(p);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof Ft&&a&&(m=u[u.length-1])instanceof Ft&&d.lines+m.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new Ft(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>r&&f(),a+=d.lines,c+=d.length+1,u.push(d))}function f(){a!=0&&(l.push(u.length==1?u[0]:Ni.from(u,c)),c=-1,a=u.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Ni(l,t)}}at.empty=new Ft([" "],0);function mD(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Vc(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s<i.length&&r<=n;s++){let l=i[s],a=r+l.length;a>=t&&(a>n&&(l=l.slice(0,n-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function v0(i,e,t){return Vc(i,[" "],e,t)}class Yl{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=" ",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Ft?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Ft?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value=" ",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(r instanceof Ft){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ft?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Yk{constructor(e,t,n){this.value=" ",this.done=!1,this.cursor=new Yl(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=" ",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=" "}}class zk{constructor(e){this.inner=e,this.afterBreak=!0,this.value=" ",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=" ",this.afterBreak=!1):t?(this.done=!0,this.value=" "):n?this.afterBreak?this.value=" ":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<" u "&&(at.prototype[Symbol.iterator]=function(){return this.iter()},Yl.prototype[Symbol.iterator]=Yk.prototype[Symbol.iterator]=zk.prototype[Symbol.iterator]=function(){return this});let pD=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function To(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}let go=" lc , 34 , 7 n , 7 , 7 b , 19 , , , , 2 , , 2 , , , 20 , b , 1 c , l , g , , 2 t , 7 , 2 , 6 , 2 , 2 , , 4 , z , , u , r , 2 j , b , 1 m , 9 , 9 , , o , 4 , , 9 , , 3 , , 5 , 17 , 3 , 3 b , f , , w , 1 j , , , , 4 , 8 , 4 , , 3 , 7 , a , 2 , t , , 1 m , , , , 2 , 4 , 8 , , 9 , , a , 2 , q , , 2 , 2 , 1 l , , 4 , 2 , 4 , 2 , 2 , 3 , 3 , , u , 2 , 3 , , b , 2 , 1 l , , 4 , 5 , , 2 , 4 , , k , 2 , m , 6 , , , 1 m , , , 2 , , 4 , 8 , , 7 , 3 , a , 2 , u , , 1 n , , , , c , , 9 , , 14 , , 3 , , 1 l , 3 , 5 , 3 , , 4 , 7 , 2 , b , 2 , t , , 1 m , , 2 , , 2 , , 3 , , 5 , 2 , 7 , 2 , b , 2 , s , 2 , 1 l , 2 , , , 2 , 4 , 8 , , 9 , , a , 2 , t , , 20 , , 4 , , 2 , 3 , , , 8 , , 29 , , 2 , 7 , c , 8 , 2 q , , 2 , 9 , b , 6 , 22 , 2 , r , , , , , , 1 j , e , , 5 , , 2 , 5 , b , , 10 , 9 , , 2 u , 4 , , 6 , , 2 , 2 , 2 , p , 2 , 4 , 3 , g , 4 , d , , 2 , 2 , 6 , , f , , jj , 3 , qa , 3 , t , 3 , t , 2 , u , 2 , 1 s , 2 , , 7 , 8 , , 2 , b , 9 , , 19 , 3 , 3 b , 2 , y , , 3 a , 3 , 4 , 2 , 9 , , 6 , 3 , 63 , 2 , 2 , , 1 m , , , 7 , , , , , 2 , 8 , 6 , a , 2 , , 1 c , h , 1 r , 4 , 1 c , 7 , , , 5 , , 14 , 9 , c , 2 , w , 4 , 2 , 2 , , 3 , 1 k , , , 2 , 3 , , , 3 , 1 m , 8 , 2 , 2 , 48 , 3 , , d , , 7 , 4 , , 6 , , 3 , 2 , 5 i , 1 m , , 5 , ek , , 5 f , x , 2 da , 3 , 3 x , , 2 o , w , fe , 6 , 2 x , 2 , n9w , 4 , , a , w , 2 , 28 , 2 , 7 k , , 3 , , 4 , , p , 2 , 5 , , 47 , 2 , q , i , d , , 12 , 8 , p , b , 1 a , 3 , 1 c , , 2 , 4 , 2 , 2 , 13 , , 1 v , 6 , 2 , 2 , 2 , 2 , c , , 8 , , 1 b , , 1 f , , , 3 , 2 , 2 , 5 , 2 , , , 16 , 2 , 8 , , 6 m , , 2 , , 4 , , fn4 , , kh , g , g , g , a6 , 2 , gt , , 6 a , , 45 , 5 , 1 ae , 3 , , 2 , 5 , 4 , 14 , 3 , 4 , , 4 l , 2 , fx , 4 , ar , 2 , 49 , b , 4 w , , 1 i , f , 1 k , 3 , 1 d , 4 , 2 , 2 , 1 x , 3 , 10 , 5 , , 8 , 1 q , , c , 2 , 1 g , 9 , a , 4 , 2 , , 2 n , 3 , 2 , , , 2 , 6 , , 4 g , , 3 , 8 , l , 2 , 1 l , 2 , , , , , m , , e , 7 , 3 , 5 , 5 f , 8 , 2 , 3 , , , n , , 29 , , 2 , 6 , , , 2 , , , 2 , , 2 , 6 j , , 2 , 4 , 6 , 2 , , 2 , r , 2 , 2 d , 8 , 2 , , , 2 , 2 y , , , , 2 , 6 , , , 2 t , 3 , 2 , 4 , , 5 , 77 , 9 , , 2 , 6 t , , a , 2 , , , 4 , , 40 , 4 , 2 , 2 , 4 , , w , a , 14 , 6 , 2 , 4 , 8 , , 9 , 6 , 2 , 3 , 1 a , d , , 2 , ba , 7 , , 6 , , , 2 a , m , 2 , 7 , , 2 , , 2 , 3 e , 6 , 3 , , , 2 , , 7 , , , 20 , 2 , 3 , , , , 9 n , 2 , f0b , 5 , 1 n , 7 , t4 , , 1 r , 4 , 29 , , f5k , 2 , 43 q , , , 3 , 4 , 5 , 8 , 8 , 2 , 7 , u , 4 , 44 , 3 , 1 iz , 1 j , 4 , 1 e , 8 , , e , , m , 5 , , f , 11 s , 7 , , h , 2 , 7 , , 2 , , 5 , 79 , 7 , c5 , 4 , 15 s , 7 , 31 , 7 , 240 , 5 , gx7k , 2 o , 3 k , 6 o ".split(" , ").map(i=>i?parseInt(i,36):1);for(let i=1;i<go.length;i++)go[i]+=go[i-1];function gD(i){for(let e=1;e<go.length;e+=2)if(go[e]>i)return go[e-1]<=i;return!1}function w0(i){return i>=127462&&i<=127487}const y0=8205;function hn(i,e,t=!0,n=!0){return(t?Vk:OD)(i,e,n)}function Vk(i,e,t){if(e==i.length)return e;e&&Uk(i.charCodeAt(e))&&jk(i.charCodeAt(e-1))&&e--;let n=ln(i,e);for(e+=oi(n);e<i.length;){let r=ln(i,e);if(n==y0||r==y0||t&&gD(r))e+=oi(r),n=r;else if(w0(r)){let s=0,o=e-2;for(;o>=0&&w0(ln(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function OD(i,e,t){for(;e>0;){let n=Vk(i,e-2,t);if(n<e)return n;e--}return 0}function Uk(i){return i>=56320&&i<57344}function jk(i){return i>=55296&&i<56320}function ln(i,e){let t=i.charCodeAt(e);if(!jk(t)||e+1=
`}get readOnly(){return this.facet(iS)}phrase(e,...t){for(let n of this.facet(et.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r==" $ ")return" $ ";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(Kk))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return xD(this.languageDataAt(" wordChars ",e).join(" "))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=hn(t,o,!1);if(s(t.slice(a,o))!=$t.Word)break;o=a}for(;l<r;){let a=hn(t,l);if(s(t.slice(l,a))!=$t.Word)break;l=a}return o==l?null:q.range(o+n,l+n)}}et.allowMultipleSelections=Wd;et.tabSize=ye.define({combine:i=>i.length?i[0]:4});et.lineSeparator=Jk;et.readOnly=iS;et.phrases=ye.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});et.languageData=Kk;et.changeFilter=eS;et.transactionFilter=tS;et.transactionExtender=nS;Vr.reconfigure=Fe.define();function Qi(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](l,o);else throw new Error(" Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class Ms{eq(e){return this==e}range(e,t=e){return Yd.create(e,t,this)}}Ms.prototype.startSide=Ms.prototype.endSide=0;Ms.prototype.point=!1;Ms.prototype.mapMode=cn.TrackDel;let Yd=class oS{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new oS(e,t,n)}};function zd(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class ap{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,h=this.to[a]+e,f,d;if(u==h){let m=t.mapPos(u,c.startSide,c.mapMode);if(m==null||(f=d=m,c.startSide!=c.endSide&&(d=t.mapPos(u,c.endSide),d<f)))continue}else if(f=t.mapPos(u,c.startSide),d=t.mapPos(h,c.endSide),f>d||f==d&&c.startSide>0&&c.endSide<=0)continue;(d-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,d-f)),n.push(c),r.push(f-o),s.push(d-o))}return{mapped:n.length?new ap(r,s,n,l):null,pos:o}}}class tt{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new tt(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(zd)),this.isEmpty)return t.length?tt.of(t):this;let l=new lS(this,null,-1).goto(0),a=0,c=[],u=new Ur;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let h=t[a++];u.addInner(h.from,h.to,h.value)||c.push(h)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(Yd.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?tt.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r
`)}static newName(){let e=x0[A0]||1;return x0[A0]=e+1,jd+e.toString(36)}static mount(e,t,n){let r=e[qd],s=n&&n.nonce;r?s&&r.setNonce(s):r=new QD(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let T0=new Map;class QD{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=T0.get(n);if(s)return e[qd]=s;this.sheet=new r.CSSStyleSheet,T0.set(n,this)}else this.styleTag=n.createElement(" style "),t&&this.styleTag.setAttribute(" nonce ",t);this.modules=[],e[qd]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let c=0;c<l.rules.length;c++)n.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o=" ";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(" nonce ")!=e&&this.styleTag.setAttribute(" nonce ",e)}}var qr={8:" Backspace ",9:" Tab ",10:" Enter ",12:" NumLock ",13:" Enter ",16:" Shift ",17:" Control ",18:" Alt ",20:" CapsLock ",27:" Escape ",32:" ",33:" PageUp ",34:" PageDown ",35:" End ",36:" Home ",37:" ArrowLeft ",38:" ArrowUp ",39:" ArrowRight ",40:" ArrowDown ",44:" PrintScreen ",45:" Insert ",46:" Delete ",59:" ; ",61:" = ",91:" Meta ",92:" Meta ",106:" * ",107:" + ",108:" , ",109:" - ",110:" . ",111:" / ",144:" NumLock ",145:" ScrollLock ",160:" Shift ",161:" Shift ",162:" Control ",163:" Control ",164:" Alt ",165:" Alt ",173:" - ",186:" ; ",187:" = ",188:" , ",189:" - ",190:" . ",191:" / ",192:" ` ",219:"[",220:" \\ ",221:"]",222:"'"},ca={48:")",49:"!",50:"@",51:"#",52:" $ ",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},MD=typeof navigator<"u"&&/Mac/.test(navigator.platform),ED=typeof navigator<"u"&&/MSIE \d |Trident \/ (?:[7-9]| \d {2,}) \. .*rv:( \d +)/.exec(navigator.userAgent);for(var an=0;an<10;an++)qr[48+an]=qr[96+an]=String(an);for(var an=1;an<=24;an++)qr[an+111]="F"+an;for(var an=65;an<=90;an++)qr[an]=String.fromCharCode(an+32),ca[an]=String.fromCharCode(an);for(var Pf in qr)ca.hasOwnProperty(Pf)||(ca[Pf]=qr[Pf]);function RD(i){var e=MD&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||ED&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?ca:qr)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ua(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Gd(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function DD(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jc(i,e){if(!e.anchorNode)return!1;try{return Gd(i,e.anchorNode)}catch{return!1}}function ha(i){return i.nodeType==3?Rs(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Vl(i,e,t,n){return t?Q0(i,e,t,n,-1)||Q0(i,e,t,n,1):!1}function Es(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Pu(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H \d |SECTION|PRE) $ /.test(i.nodeName)}function Q0(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:dr(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Es(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?dr(i):0}else return!1}}function dr(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function hh(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function $ D(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function aS(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function LD(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let u=i,h=!1;u&&!h;)if(u.nodeType==1){let f,d=u==a.body,m=1,p=1;if(d)f= $ D(c);else{if(/^(fixed|sticky) $ /.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let w=u.getBoundingClientRect();({scaleX:m,scaleY:p}=aS(u,w)),f={left:w.left,right:w.left+u.clientWidth*m,top:w.top,bottom:w.top+u.clientHeight*p}}let g=0,v=0;if(r=="nearest")e.top<f.top?(v=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+v&&(v=e.bottom-f.bottom+v+o)):e.bottom>f.bottom&&(v=e.bottom-f.bottom+o,t<0&&e.top-v<f.top&&(v=-(f.top+v-e.top+o)));else{let w=e.bottom-e.top,S=f.bottom-f.top;v=(r=="center"&&w<=S?e.top+w/2-S/2:r=="start"||r=="center"&&t<0?e
` , r = i . state . doc . line ( r . number + ( t ? 1 : - 1 ) ) , s = i . bidiSpans ( r ) , c = i . visualLineSide ( r , ! t ) } if ( a ) { if ( ! a ( u ) ) return l } else { if ( ! n ) return c ; a = n ( u ) } l = c } } function g5 ( i , e , t ) { let n = i . state . charCategorizer ( e ) , r = n ( t ) ; return s => { let o = n ( s ) ; return r == $t . Space && ( r = o ) , r == o } } function O5 ( i , e , t , n ) { let r = e . head , s = t ? 1 : - 1 ; if ( r == ( t ? i . state . doc . length : 0 ) ) return q . cursor ( r , e . assoc ) ; let o = e . goalColumn , l , a = i . contentDOM . getBoundingClientRect ( ) , c = i . coordsAtPos ( r , e . assoc || - 1 ) , u = i . documentTop ; if ( c ) o == null && ( o = c . left - a . left ) , l = s < 0 ? c . top : c . bottom ; else { let d = i . viewState . lineBlockAt ( r ) ; o == null && ( o = Math . min ( a . right - a . left , i . defaultCharacterWidth * ( r - d . from ) ) ) , l = ( s < 0 ? d . top : d . bottom ) + u } let h = a . left + o , f = n ? ? i . viewState . heightOracle . textHeight >> 1 ; for ( let d = 0 ; ; d += 10 ) { let m = l + ( f + d ) * s , p = YS ( i , { x : h , y : m } , ! 1 , s ) ; if ( m < a . top || m > a . bottom || ( s < 0 ? p < r : p > r ) ) { let g = i . docView . coordsForChar ( p ) , v = ! g || m < g . top ? - 1 : 1 ; return q . cursor ( p , v , void 0 , o ) } } } function qc ( i , e , t ) { for ( ; ; ) { let n = 0 ; for ( let r of i ) r . between ( e - 1 , e + 1 , ( s , o , l ) => { if ( e > s && e < o ) { let a = n || t || ( e - s < o - e ? - 1 : 1 ) ; e = a < 0 ? s : o , n = a } } ) ; if ( ! n ) return e } } function Qf ( i , e , t ) { let n = qc ( i . state . facet ( fp ) . map ( r => r ( i ) ) , t . from , e . head > t . from ? - 1 : 1 ) ; return n == t . from ? t : q . cursor ( n , n < t . from ? 1 : - 1 ) } const Cl = "" ; class b5 { constructor ( e , t ) { this . points = e , this . text = "" , this . lineSeparator = t . facet ( et . lineSeparator ) } append ( e ) { this . text += e } lineBreak ( ) { this . text += Cl } readRange ( e , t ) { if ( ! e ) return this ; let n = e . parentNode ; for ( let r = e ; ; ) { this . findPointBefore ( n , r ) ; let s = this . text . length ; this . readNode ( r ) ; let o = r . nextSibling ; if ( o == t ) break ; let l = St . get ( r ) , a = St . get ( o ) ; ( l && a ? l . breakAfter : ( l ? l . breakAfter : Pu ( r ) ) || Pu ( o ) && ( r . nodeName != "BR" || r . cmIgnore ) && this . text . length > s ) && this . lineBreak ( ) , r = o } return this . findPointBefore ( n , t ) , this } readTextNode ( e ) { let t = e . nodeValue ; for ( let n of this . points ) n . node == e && ( n . pos = this . text . length + Math . min ( n . offset , t . length ) ) ; for ( let n = 0 , r = this . lineSeparator ? null : /\r\n?|\n/g ; ; ) { let s = - 1 , o = 1 , l ; if ( this . lineSeparator ? ( s = t . indexOf ( this . lineSeparator , n ) , o = this . lineSeparator . length ) : ( l = r . exec ( t ) ) && ( s = l . index , o = l [ 0 ] . length ) , this . append ( t . slice ( n , s < 0 ? t . length : s ) ) , s < 0 ) break ; if ( this . lineBreak ( ) , o > 1 ) for ( let a of this . points ) a . node == e && a . pos > this . text . length && ( a . pos -= o - 1 ) ; n = s + o } } readNode ( e ) { if ( e . cmIgnore ) return ; let t = St . get ( e ) , n = t && t . overrideDOMText ; if ( n != null ) { this . findPointInside ( e , n . length ) ; for ( let r = n . iter ( ) ; ! r . next ( ) . done ; ) r . lineBreak ? this . lineBreak ( ) : this . append ( r . value ) } else e . nodeType == 3 ? this . readTextNode ( e ) : e . nodeName == "BR" ? e . nextSibling && this . lineBreak ( ) : e . nodeType == 1 && this . readRange ( e . firstChild , null ) } findPointBefore ( e , t ) { for ( let n of this . points ) n . node == e && e . childNodes [ n . offset ] == t && ( n . pos = this . text . length ) } findPointInside ( e , t ) { for ( let n of this . points ) ( e . nodeType == 3 ? n . node == e : e . contains ( n . node ) ) && ( n . pos = this . text . length + ( v5 ( e , n . node , n . offset ) ? t : 0 ) ) } } function v5 ( i , e , t ) { for ( ; ; ) { if ( ! e || t < dr ( e ) ) return ! 1 ; if ( e == i ) return ! 0 ; t = Es ( e ) + 1 , e = e . parentNode } } class F0 { constructor ( e , t ) { this . node = e , this . offset = t , this . pos = - 1 } } class w5 { constructor ( e , t , n , r ) { this . typeOver = r , this . bounds = null , this . text = "" , this . domChanged = t > - 1 ; let { impreciseHead : s , impreciseAnchor : o } = e . docView ; if ( e . state . readOnly && t > - 1 ) this . newSel = null ; else if ( t > - 1 && ( this . bounds = e . docView . domBoundsAround ( t , n , 0 ) ) ) { let l = s || o ? [ ] : S5 ( e ) , a = new b5 ( l , e . state ) ; a . readRange ( this . bounds . startDOM , this . bounds . endDOM ) , this . text = a . text , this . newSel = _5 ( l , this . bounds . from ) } else { let l = e . observer . selectionRange , a = s && s . node == l . focusNode && s . offset == l . focusOffset || ! Gd ( e . contentDOM , l . focusNode ) ? e . state . selection . main . head : e . docView . posFromDOM ( l . focusNode , l . focusOffset ) , c = o && o . node == l . anchorNode && o . offset == l . anchorOffset || ! Gd ( e . contentDOM , l . anchorNode ) ? e . state . selection . main . anchor : e . docView . posFromDOM ( l . anchorNode , l . anchorOffset ) , u = e . viewport ; if ( ( ke . ios || ke . chrome ) && e . state . selection . main . empty && a != c && ( u . from > 0 || u . to < e . state . doc . length ) ) { let h = Math . min ( a , c ) , f = Math . max ( a , c ) , d = u . from - h , m = u . to - f ; ( d == 0 || d == 1 || h == 0 ) && ( m == 0 || m == - 1 || f == e . state . doc . length ) && ( a = 0 , c = e . state . doc . length ) } this . newSel = q . single ( c , a ) } } } function zS ( i , e ) { let t , { newSel : n } = e , r = i . state . selection . main , s = i . inputState . lastKeyTime > Date . now ( ) - 100 ? i . inputState . lastKeyCode : - 1 ; if ( e . bounds ) { let
` &&i.lineWrapping&&(n&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:at.of([" "])}),t)return dp(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function dp(i,e,t,n=-1){if(ke.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(ke.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&bo(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&bo(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&bo(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=y5(i,e,t));return i.state.facet(ES).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function y5(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",a=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),u,h=t&&FS(i,t.main.head);if(h){let m=e.insert.length-(e.to-e.from);u={from:h.from,to:h.to-m}}else u=i.state.doc.lineAt(s.head);let f=s.to-e.to,d=s.to-s.from;n=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:a||m.map(l)};let p=m.to-f,g=p-c.length;if(m.to-m.from!=d||i.state.sliceDoc(g,p)!=c||m.to>=u.from&&m.from<=u.to)return{range:m};let v=r.changes({from:g,to:p,insert:e.insert}),w=m.to-s.to;return{changes:v,range:a?q.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):m.map(v)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function k5(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function S5(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new F0(t,n)),(r!=t||s!=n)&&e.push(new F0(r,s))),e}function _5(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?q.single(t+e,n+e):null}class C5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ke.safari&&e.contentDOM.addEventListener("input",()=>null),ke.gecko&&W5(e.contentDOM.ownerDocument)}hand
` ) ) } ; s . from == this . from && r < this . from ? s . from = r : s . to == this . to && r > this . to && ( s . to = r ) , ! ( s . from == s . to && ! s . insert . length ) && ( this . pendingContextChange = s , e . state . readOnly || dp ( e , s , q . single ( this . toEditorPos ( n . selectionStart ) , this . toEditorPos ( n . selectionEnd ) ) ) , this . pendingContextChange && ( this . revertPending ( e . state ) , this . setSelection ( e . state ) ) ) } , this . handlers . characterboundsupdate = n => { let r = [ ] , s = null ; for ( let o = this . toEditorPos ( n . rangeStart ) , l = this . toEditorPos ( n . rangeEnd ) ; o < l ; o ++ ) { let a = e . coordsForChar ( o ) ; s = a && new DOMRect ( a . left , a . top , a . right - a . left , a . bottom - a . top ) || s || new DOMRect , r . push ( s ) } t . updateCharacterBounds ( n . rangeStart , r ) } , this . handlers . textformatupdate = n => { let r = [ ] ; for ( let s of n . getTextFormats ( ) ) { let o = s . underlineStyle , l = s . underlineThickness ; if ( o != "None" && l != "None" ) { let a = ` text-decoration: underline ${ o == "Dashed" ? "dashed " : o == "Squiggle" ? "wavy " : "" } ${ l == "Thin" ? 1 : 2 } px ` ; r . push ( Qe . mark ( { attributes : { style : a } } ) . range ( this . toEditorPos ( s . rangeStart ) , this . toEditorPos ( s . rangeEnd ) ) ) } } e . dispatch ( { effects : IS . of ( Qe . set ( r ) ) } ) } , this . handlers . compositionstart = ( ) => { e . inputState . composing < 0 && ( e . inputState . composing = 0 , e . inputState . compositionFirstChange = ! 0 ) } , this . handlers . compositionend = ( ) => { e . inputState . composing = - 1 , e . inputState . compositionFirstChange = null } ; for ( let n in this . handlers ) t . addEventListener ( n , this . handlers [ n ] ) ; this . measureReq = { read : n => { this . editContext . updateControlBounds ( n . contentDOM . getBoundingClientRect ( ) ) ; let r = ua ( n . root ) ; r && r . rangeCount && this . editContext . updateSelectionBounds ( r . getRangeAt ( 0 ) . getBoundingClientRect ( ) ) } } } applyEdits ( e ) { let t = 0 , n = ! 1 , r = this . pendingContextChange ; return e . changes . iterChanges ( ( s , o , l , a , c ) => { if ( n ) return ; let u = c . length - ( o - s ) ; if ( r && o >= r . to ) if ( r . from == s && r . to == o && r . insert . eq ( c ) ) { r = this . pendingContextChange = null , t += u , this . to += u ; return } else r = null , this . revertPending ( e . state ) ; if ( s += t , o += t , o <= this . from ) this . from += u , this . to += u ; else if ( s < this . to ) { if ( s < this . from || o > this . to || this . to - this . from + c . length > 3e4 ) { n = ! 0 ; return } this . editContext . updateText ( this . toContextPos ( s ) , this . toContextPos ( o ) , c . toString ( ) ) , this . to += u } t += u } ) , r && ! n && this . revertPending ( e . state ) , ! n } update ( e ) { let t = this . pendingContextChange ; ! this . applyEdits ( e ) || ! this . rangeIsValid ( e . state ) ? ( this . pendingContextChange = null , this . resetRange ( e . state ) , this . editContext . updateText ( 0 , this . editContext . text . length , e . state . doc . sliceString ( this . from , this . to ) ) , this . setSelection ( e . state ) ) : ( e . docChanged || e . selectionSet || t ) && this . setSelection ( e . state ) , ( e . geometryChanged || e . docChanged || e . selectionSet ) && e . view . requestMeasure ( this . measureReq ) } resetRange ( e ) { let { head : t } = e . selection . main ; this . from = Math . max ( 0 , t - 1e4 ) , this . to = Math . min ( e . doc . length , t + 1e4 ) } revertPending ( e ) { let t = this . pendingContextChange ; this . pendingContextChange = null , this . editContext . updateText ( this . toContextPos ( t . from ) , this . toContextPos ( t . from + t . insert . length ) , e . doc . sliceString ( t . from , t . to ) ) } setSelection ( e ) { let { main : t } = e . selection , n = this . toContextPos ( Math . max ( this . from , Math . min ( this . to , t . anchor ) ) ) , r = this . toContextPos ( t . head ) ; ( this . editContext . selectionStart != n || this . editContext . selectionEnd != r ) && this . editContext . updateSelection ( n , r ) } rangeIsValid ( e ) { let { head : t } = e . selection . main ; return ! ( this . from > 0 && t - this . from < 500 || this . to < e . doc . length && this . to - t < 500 || this . to - this . from > 1e4 * 3 ) } toEditorPos ( e ) { return e + this . from } toContextPos ( e ) { return e - this . from } destroy ( ) { for ( let e in this . handlers ) this . editContext . removeEventListener ( e , this . handlers [ e ] ) } } class pe { get state ( ) { return this . viewState . state } get viewport ( ) { return this . viewState . viewport } get visibleRanges ( ) { return this . viewState . visibleRanges } get inView ( ) { return this . viewState . inView } get composing ( ) { return this . inputState . composing > 0 } get compositionStarted ( ) { return this . inputState . composing >= 0 } get root ( ) { return this . _root } get win ( ) { return this . dom . ownerDocument . defaultView || window } constructor ( e = { } ) { var t ; this . plugins = [ ] , this . pluginMap = new Map , this . editorAttrs = { } , this . contentAttrs = { } , this . bidiCache = [ ] , this . destroyed = ! 1 , this . updateState = 2 , this . measureScheduled = - 1 , this . measureRequests = [ ] , this . contentDOM = document . createElement ( "div" ) , this . scrollDOM = document . createElement ( "div" ) , thi
- - \u2028\u2029 \uFEFF -  ] ` ,gm),S $ ={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Rf=null;function _ $ (){var i;if(Rf==null&&typeof document<"u"&&document.body){let e=document.body.style;Rf=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Rf||!1}const Kc=ye.define({combine(i){let e=Qi(i,{render:null,specialChars:k $ ,addSpecialChars:null});return(e.replaceTabs=!_ $ ())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,gm)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,gm)),e}});function C $ (i={}){return[Kc.of(i),P $ ()]}let fb=null;function P $ (){return fb||(fb=Vt.fromClass(class{constructor(i){this.view=i,this.decorations=Qe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Kc)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new y $ ({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=ln(e[0],0);if(s==9){let o=r.lineAt(n),l=t.state.tabSize,a=Ci(o.text,l,n-o.from);return Qe.replace({widget:new Q $ ((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Qe.replace({widget:new T $ (i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Kc);i.startState.facet(Kc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}const A $ ="•";function x $ (i){return i>=32?A $ :i==10?"":String.fromCharCode(9216+i)}class T $ extends br{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=x $ (this.code),n=e.state.phrase("Control character")+" "+(S $ [this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Q $ extends br{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function M $ (){return R $ }const E $ =Qe.line({class:"cm-activeLine"}),R $ =Vt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(E $ .range(r.from)),e=r.from)}return Qe.set(t)}},{decorations:i=>i.decorations}),Om=2e3;function D $ (i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>Om||t.off>Om||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=r;a++){let c=i.doc.line(a);c.length<=l&&s.push(q.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=r;a++){let c=i.doc.line(a),u=Ud(c.text,o,i.tabSize,!0);if(u<0)s.push(q.cursor(c.to));else{let h=Ud(c.text,l,i.tabSize);s.push(q.range(c.from+u,c.from+h))}}}return s}function $ $ (i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function db(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>Om?-1:r==n.length? $ $ (i,e.clientX):Ci(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function L $ (i,e){let t=db(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.sta
` : n == "r" ? "\r" : n == "t" ? " " : "\\" ) } eq ( e ) { return this . search == e . search && this . replace == e . replace && this . caseSensitive == e . caseSensitive && this . regexp == e . regexp && this . wholeWord == e . wholeWord } create ( ) { return this . regexp ? new z7 ( this ) : new F7 ( this ) } getCursor ( e , t = 0 , n ) { let r = e . doc ? e : et . create ( { doc : e } ) ; return n == null && ( n = r . doc . length ) , this . regexp ? to ( this , r , t , n ) : eo ( this , r , t , n ) } } class C _ { constructor ( e ) { this . spec = e } } function eo ( i , e , t , n ) { return new $o ( e . doc , i . unquoted , t , n , i . caseSensitive ? void 0 : r => r . toLowerCase ( ) , i . wholeWord ? X7 ( e . doc , e . charCategorizer ( e . selection . main . head ) ) : void 0 ) } function X7 ( i , e ) { return ( t , n , r , s ) => ( ( s > t || s + r . length < n ) && ( s = Math . max ( 0 , t - 2 ) , r = i . sliceString ( s , Math . min ( i . length , n + 2 ) ) ) , ( e ( Xu ( r , t - s ) ) != $t . Word || e ( Fu ( r , t - s ) ) != $t . Word ) && ( e ( Fu ( r , n - s ) ) != $t . Word || e ( Xu ( r , n - s ) ) != $t . Word ) ) } class F7 extends C _ { constructor ( e ) { super ( e ) } nextMatch ( e , t , n ) { let r = eo ( this . spec , e , n , e . doc . length ) . nextOverlapping ( ) ; return r . done && ( r = eo ( this . spec , e , 0 , t ) . nextOverlapping ( ) ) , r . done ? null : r . value } prevMatchInRange ( e , t , n ) { for ( let r = n ; ; ) { let s = Math . max ( t , r - 1e4 - this . spec . unquoted . length ) , o = eo ( this . spec , e , s , r ) , l = null ; for ( ; ! o . nextOverlapping ( ) . done ; ) l = o . value ; if ( l ) return l ; if ( s == t ) return null ; r -= 1e4 } } prevMatch ( e , t , n ) { return this . prevMatchInRange ( e , 0 , t ) || this . prevMatchInRange ( e , n , e . doc . length ) } getReplacement ( e ) { return this . spec . unquote ( this . spec . replace ) } matchAll ( e , t ) { let n = eo ( this . spec , e , 0 , e . doc . length ) , r = [ ] ; for ( ; ! n . next ( ) . done ; ) { if ( r . length >= t ) return null ; r . push ( n . value ) } return r } highlight ( e , t , n , r ) { let s = eo ( this . spec , e , Math . max ( 0 , t - this . spec . unquoted . length ) , Math . min ( n + this . spec . unquoted . length , e . doc . length ) ) ; for ( ; ! s . next ( ) . done ; ) r ( s . value . from , s . value . to ) } } function to ( i , e , t , n ) { return new k _ ( e . doc , i . search , { ignoreCase : ! i . caseSensitive , test : i . wholeWord ? Y7 ( e . charCategorizer ( e . selection . main . head ) ) : void 0 } , t , n ) } function Xu ( i , e ) { return i . slice ( hn ( i , e , ! 1 ) , e ) } function Fu ( i , e ) { return i . slice ( e , hn ( i , e ) ) } function Y7 ( i ) { return ( e , t , n ) => ! n [ 0 ] . length || ( i ( Xu ( n . input , n . index ) ) != $t . Word || i ( Fu ( n . input , n . index ) ) != $t . Word ) && ( i ( Fu ( n . input , n . index + n [ 0 ] . length ) ) != $t . Word || i ( Xu ( n . input , n . index + n [ 0 ] . length ) ) != $t . Word ) } class z7 extends C _ { nextMatch ( e , t , n ) { let r = to ( this . spec , e , n , e . doc . length ) . next ( ) ; return r . done && ( r = to ( this . spec , e , 0 , t ) . next ( ) ) , r . done ? null : r . value } prevMatchInRange ( e , t , n ) { for ( let r = 1 ; ; r ++ ) { let s = Math . max ( t , n - r * 1e4 ) , o = to ( this . spec , e , s , n ) , l = null ; for ( ; ! o . next ( ) . done ; ) l = o . value ; if ( l && ( s == t || l . from > s + 10 ) ) return l ; if ( s == t ) return null } } prevMatch ( e , t , n ) { return this . prevMatchInRange ( e , 0 , t ) || this . prevMatchInRange ( e , n , e . doc . length ) } getReplacement ( e ) { return this . spec . unquote ( this . spec . replace ) . replace ( /\$([$&\d+])/g , ( t , n ) => n == "$" ? "$" : n == "&" ? e . match [ 0 ] : n != "0" && + n < e . match . length ? e . match [ n ] : t ) } matchAll ( e , t ) { let n = to ( this . spec , e , 0 , e . doc . length ) , r = [ ] ; for ( ; ! n . next ( ) . done ; ) { if ( r . length >= t ) return null ; r . push ( n . value ) } return r } highlight ( e , t , n , r ) { let s = to ( this . spec , e , Math . max ( 0 , t - 250 ) , Math . min ( n + 250 , e . doc . length ) ) ; for ( ; ! s . next ( ) . done ; ) r ( s . value . from , s . value . to ) } } const wa = Fe . define ( ) , Qp = Fe . define ( ) , Br = Jt . define ( { create ( i ) { return new zf ( Qm ( i ) . create ( ) , null ) } , update ( i , e ) { for ( let t of e . effects ) t . is ( wa ) ? i = new zf ( t . value . create ( ) , i . panel ) : t . is ( Qp ) && ( i = new zf ( i . query , t . value ? Mp : null ) ) ; return i } , provide : i => pa . from ( i , e => e . panel ) } ) ; class zf { constructor ( e , t ) { this . query = e , this . panel = t } } const V7 = Qe . mark ( { class : "cm-searchMatch" } ) , U7 = Qe . mark ( { class : "cm-searchMatch cm-searchMatch-selected" } ) , j7 = Vt . fromClass ( class { constructor ( i ) { this . view = i , this . decorations = this . highlight ( i . state . field ( Br ) ) } update ( i ) { let e = i . state . field ( Br ) ; ( e != i . startState . field ( Br ) || i . docChanged || i . selectionSet || i . viewportChanged ) && ( this . decorations = this . highlight ( e ) ) } highlight ( { query : i , panel : e } ) { if ( ! e || ! i . spec . valid ) return Qe . none ; let { view : t } = this , n = new Ur ; for ( let r = 0 , s = t . visibleRanges , o = s . length ; r < o ; r ++ ) { let { from : l , to : a } = s [ r ] ; for ( ; r < o - 1 && a > s [ r + 1 ] . from - 2 * 250 ; ) a = s [ ++ r ] . to ; i . highlight ( t . state , l , a , ( c , u ) => { let h = t . state . selection . ranges . some ( f => f . from == c && f . to == u ) ; n . add ( c , u , h ? U7 : V7 ) } ) } return n . finish ( ) } } , { decorations : i => i . decorations } ) ; function Fa ( i ) { return e => { let t = e . state . field ( Br , ! 1 ) ; return t && t . query . spec . valid ? i ( e , t ) : x _ ( e ) } } const Yu = Fa (
` +t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&ql(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,rt(ue.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(OC(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(rt(ue.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(pC(e,ql(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=ql(e,this.pos),n=0;if(t>this.pos){let r=gC(e,t,this.start);if(r){let s=Gf(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Gf(e,this.pos)),n>0&&n<e.length?n:-1}else return Gf(e,this.pos)}}}function Gf(i,e){for(;e<i.length;e++){let t=i.charCodeAt(e);if(t==10)break;if(!mi(t))return-1}return e}class IN{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:sC(t),s=t.next;if(r<0)return!1;let o=rt(ue.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,rt(s==61?ue.SetextHeading1:ue.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const NN={LinkReference(i,e){return e.content.charCodeAt(0)==91?new LN(e):null},SetextHeading(){return new IN}},ZN=[(i,e)=>rC(e)>=0,(i,e)=>tC(e)>=0,(i,e)=>nC(e)>=0,(i,e)=>Yp(e,i,!0)>=0,(i,e)=>zp(e,i,!0)>=0,(i,e)=>Fp(e,i,!0)>=0,(i,e)=>aC(e,i,!0)>=0],BN={text:"",end:0};class WN{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new $ N,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=Ku.create(ue.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new zN(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new DN(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break e}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+= `
` +e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=bC(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=BN;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[r-1].to-n)+o,n=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+ue[r.type]);if(!s(r,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t== `
2026-05-08 17:55:22 +03:00
` ?"":t;else{let r=t.indexOf( `
2026-05-15 17:07:12 +03:00
` );n=r<0?t:t.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=Ku.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new gt(this.parser.nodeSet.types[e],Io,Io,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements( $ m(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?cC(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t= $ m(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(ue.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?rt(this.parser.getNodeType(e),t,n,r):new fC(e,t)}get buffer(){return new hC(this.parser.nodeSet)}}function cC(i,e,t,n,r){let s=i[e].to,o=[],l=[],a=t.from+n;function c(u,h){for(;h?u>=s:u>s;){let f=i[e+1].from-s;n+=f,u+=f,e++,s=i[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+n,!0);let h=u.from+n,f,d=r.get(u.tree);d?f=d:u.to+n>s?(f=cC(i,e,u,n,r),c(u.to+n,!1)):f=u.toTree(),o.push(f),l.push(h-a)}return c(t.to+n,!1),new gt(t.type,o,l,t.to+n-a,t.tree?t.tree.propValues:void 0)}class Ch extends wp{constructor(e,t,n,r,s,o,l,a,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,n){let r=new WN(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=Rm(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),h=this.wrappers;if(gl(t.defineNodes)){r=Object.assign({},r);let f=n.types.slice(),d;for(let m of t.defineNodes){let{name:p,block:g,composite:v,style:w}=typeof m=="string"?{name:m}:m;if(f.some(k=>k.name==p))continue;v&&(r[f.length]=(k,A,C)=>v(A,C,k.value));let S=f.length,_=v?["Block","BlockContext"]:g?S>=ue.ATXHeading1&&S<=ue.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(tn.define({id:S,name:p,props:_&&[[Ze.group,_]]})),w&&(d||(d={}),Array.isArray(w)||w instanceof jn?d[p]=w:Object.assign(d,w))}n=new Za(f),d&&(n=n.extend(Xs(d)))}if(gl(t.props)&&(n=n.extend(...t.props)),gl(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),m=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),m>-1&&(a[m]=void 0)}if(gl(t.parseBlock))for(let f of t.parseBlock){let d=l.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let m=f.before?Rc(l,f.before):f.after?Rc(l,f.after)+1:l.length-1;s.splice(m,0,f.parse),o.splice(m,0,f.leaf),l.splice(m,0,f.name)}f.endLeaf&&u.push(f.endLeaf)}if(gl(t.parseInline))for(let f of t.parseInline){let d=c.indexOf(f.name);if(d>-1)a[d]=f.parse;else{let m=f.before?Rc(c,f.before):f.after?Rc(c,f.after)+1:c.length-1;a.splice(m,0,f.parse),c.splice(m,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new Ch(n,s,o,l,u,r,a,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError( ` Unknown node type '${e}' ` );return t}parseInline(e,t){let n=new FN(this,e,t);e:for(let r=t;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.reso
` ; ) s -- ; this . fragmentEnd = s ? s - 1 : 0 } let n = this . cursor ; n || ( n = this . cursor = this . fragment . tree . cursor ( ) , n . firstChild ( ) ) ; let r = e + this . fragment . offset ; for ( ; n . to <= r ; ) if ( ! n . parent ( ) ) return ! 1 ; for ( ; ; ) { if ( n . from >= r ) return this . fragment . from <= t ; if ( ! n . childAfter ( r ) ) return ! 1 } } matches ( e ) { let t = this . cursor . tree ; return t && t . prop ( Ze . contextHash ) == e } takeNodes ( e ) { let t = this . cursor , n = this . fragment . offset , r = this . fragmentEnd - ( this . fragment . openEnd ? 1 : 0 ) , s = e . absoluteLineStart , o = s , l = e . block . children . length , a = o , c = l ; for ( ; ; ) { if ( t . to - n > r ) { if ( t . type . isAnonymous && t . firstChild ( ) ) continue ; break } let u = bC ( t . from - n , e . ranges ) ; if ( t . to - n <= e . ranges [ e . rangeI ] . to ) e . addNode ( t . tree , u ) ; else { let h = new gt ( e . parser . nodeSet . types [ ue . Paragraph ] , [ ] , [ ] , 0 , e . block . hashProp ) ; e . reusePlaceholders . set ( h , t . tree ) , e . addNode ( h , u ) } if ( t . type . is ( "Block" ) && ( YN . indexOf ( t . type . id ) < 0 ? ( o = t . to - n , l = e . block . children . length ) : ( o = a , l = c , a = t . to - n , c = e . block . children . length ) ) , ! t . nextSibling ( ) ) break } for ( ; e . block . children . length > l ; ) e . block . children . pop ( ) , e . block . positions . pop ( ) ; return o - s } } function bC ( i , e ) { let t = i ; for ( let n = 1 ; n < e . length ; n ++ ) { let r = e [ n - 1 ] . to , s = e [ n ] . from ; r < i && ( t -= s - r ) } return t } const VN = Xs ( { "Blockquote/..." : I . quote , HorizontalRule : I . contentSeparator , "ATXHeading1/... SetextHeading1/..." : I . heading1 , "ATXHeading2/... SetextHeading2/..." : I . heading2 , "ATXHeading3/..." : I . heading3 , "ATXHeading4/..." : I . heading4 , "ATXHeading5/..." : I . heading5 , "ATXHeading6/..." : I . heading6 , "Comment CommentBlock" : I . comment , Escape : I . escape , Entity : I . character , "Emphasis/..." : I . emphasis , "StrongEmphasis/..." : I . strong , "Link/... Image/..." : I . link , "OrderedList/... BulletList/..." : I . list , "BlockQuote/..." : I . quote , "InlineCode CodeText" : I . monospace , "URL Autolink" : I . url , "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark" : I . processingInstruction , "CodeInfo LinkLabel" : I . labelName , LinkTitle : I . string , Paragraph : I . content } ) , UN = new Ch ( new Za ( uC ) . extend ( VN ) , Object . keys ( Ec ) . map ( i => Ec [ i ] ) , Object . keys ( Ec ) . map ( i => NN [ i ] ) , Object . keys ( Ec ) , ZN , eC , Object . keys ( Hf ) . map ( i => Hf [ i ] ) , Object . keys ( Hf ) , [ ] ) ; function jN ( i , e , t ) { let n = [ ] ; for ( let r = i . firstChild , s = e ; ; r = r . nextSibling ) { let o = r ? r . from : t ; if ( o > s && n . push ( { from : s , to : o } ) , ! r ) break ; s = r . to } return n } function qN ( i ) { let { codeParser : e , htmlParser : t } = i ; return { wrap : k2 ( ( r , s ) => { let o = r . type . id ; if ( e && ( o == ue . CodeBlock || o == ue . FencedCode ) ) { let l = "" ; if ( o == ue . FencedCode ) { let c = r . node . getChild ( ue . CodeInfo ) ; c && ( l = s . read ( c . from , c . to ) ) } let a = e ( l ) ; if ( a ) return { parser : a , overlay : c => c . type . id == ue . CodeText } } else if ( t && ( o == ue . HTMLBlock || o == ue . HTMLTag ) ) return { parser : t , overlay : jN ( r . node , r . from , r . to ) } ; return null } ) } } const GN = { resolve : "Strikethrough" , mark : "StrikethroughMark" } , HN = { defineNodes : [ { name : "Strikethrough" , style : { "Strikethrough/..." : I . strikethrough } } , { name : "StrikethroughMark" , style : I . processingInstruction } ] , parseInline : [ { name : "Strikethrough" , parse ( i , e , t ) { if ( e != 126 || i . char ( t + 1 ) != 126 || i . char ( t + 2 ) == 126 ) return - 1 ; let n = i . slice ( t - 1 , t ) , r = i . slice ( t + 2 , t + 3 ) , s = /\s|^$/ . test ( n ) , o = /\s|^$/ . test ( r ) , l = Pa . test ( n ) , a = Pa . test ( r ) ; return i . addDelimiter ( GN , t , t + 2 , ! o && ( ! a || s || l ) , ! s && ( ! l || o || a ) ) } , after : "Emphasis" } ] } ; function Gl ( i , e , t = 0 , n , r = 0 ) { let s = 0 , o = ! 0 , l = - 1 , a = - 1 , c = ! 1 , u = ( ) => { n . push ( i . elt ( "TableCell" , r + l , r + a , i . parser . parseInline ( e . slice ( l , a ) , r + l ) ) ) } ; for ( let h = t ; h < e . length ; h ++ ) { let f = e . charCodeAt ( h ) ; f == 124 && ! c ? ( ( ! o || l > - 1 ) && s ++ , o = ! 1 , n && ( l > - 1 && u ( ) , n . push ( i . elt ( "TableDelimiter" , h + r , h + r + 1 ) ) ) , l = a = - 1 ) : ( c || f != 32 && f != 9 ) && ( l < 0 && ( l = h ) , a = h + 1 ) , c = ! c && f == 92 } return l > - 1 && ( s ++ , n && u ( ) ) , s } function wv ( i , e ) { for ( let t = e ; t < i . length ; t ++ ) { let n = i . charCodeAt ( t ) ; if ( n == 124 ) return ! 0 ; n == 92 && t ++ } return ! 1 } const vC = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/ ; class yv { constructor ( ) { this . rows = null } nextLine ( e , t , n ) { if ( this . rows == null ) { this . rows = ! 1 ; let r ; if ( ( t . next == 45 || t . next == 58 || t . next == 124 ) && vC . test ( r = t . text . slice ( t . pos ) ) ) { let s = [ ] ; Gl ( e , n . content , 0 , s , n . start ) == Gl ( e , r , t . pos ) && ( this . rows = [ e . elt ( "TableHeader" , n . start , n . start + n . content . length , s ) , e . elt ( "TableDelimiter" , e . lineStart + t . pos , e . lineStart + t . text . length ) ] ) } } else if ( this . rows ) { let r = [ ] ; Gl ( e , t . text , t . pos , r , e . lineStart ) , this . rows . push ( e . elt ( "TableRow" , e . lineStart + t . pos , e . lineStart + t . text . length , r ) ) } return ! 1 } finish ( e , t ) { return this
2026-05-08 17:55:22 +03:00
\ $ { }
} catch ( \ $ { error } ) {
\ $ { }
} ` ,{label:"try",detail:"/ catch block",type:"keyword"}),Qn("if ( ${ } ) { \n ${ } \n }",{label:"if",detail:"block",type:"keyword"}),Qn( ` if ( \ $ { } ) {
\ $ { }
} else {
\ $ { }
} ` ,{label:"if",detail:"/ else block",type:"keyword"}),Qn( ` class \ $ { name } {
constructor ( \ $ { params } ) {
\ $ { }
}
2026-05-15 17:07:12 +03:00
} ` ,{label:"class",detail:"definition",type:"keyword"}),Qn('import { ${ names } } from " ${ module } " \n ${ } ',{label:"import",detail:"named",type:"keyword"}),Qn('import ${ name } from " ${ module } " \n ${ } ',{label:"import",detail:"default",type:"keyword"})],U8=IC.concat([Qn("interface ${ name } { \n ${ } \n }",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${ name } = ${ type } ",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${ name } { \n ${ } \n }",{label:"enum",detail:"definition",type:"keyword"})]),Xv=new y2,NC=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ol(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const j8=["FunctionDeclaration"],q8={FunctionDeclaration:Ol("function"),ClassDeclaration:Ol("class"),ClassExpression:()=>!0,EnumDeclaration:Ol("constant"),TypeAliasDeclaration:Ol("type"),NamespaceDeclaration:Ol("namespace"),VariableDefinition(i,e){i.matchContext(j8)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function ZC(i,e){let t=Xv.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(Pt.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=q8[o.name];if(l&&l(o,s)||NC.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of ZC(i,o.node))n.push(l);return!1}}),Xv.set(e,n),n}const Fv=/^[ \w $ \x a1- \u ffff][ \w $ \d \x a1- \u ffff]* $ /,BC=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function G8(i){let e=At(i.state).resolveInner(i.pos,-1);if(BC.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Fv.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)NC.has(r.name)&&(n=n.concat(ZC(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Fv}}const qi= $ s.define({name:"javascript",parser:V8.configure({props:[zo.add({IfStatement:wo({except:/^ \s *({|else \b )/}),TryStatement:wo({except:/^ \s *({|catch \b |finally \b )/}),LabeledStatement:ZL,SwitchBody:i=>{let e=i.textAfter,t=/^ \s * \} /.test(e),n=/^ \s *(case|default) \b /.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:NL({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":wo({except:/^{/}),JSXElement(i){let e=/^ \s *< \/ /.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/ \s * \} /.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Fs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Cp,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"'," ` "]},commentTokens:{line:" //",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),WC={test:i=>/^JSX/.test(i.name),facet:yp({commentTokens:{block:{open:"{/*",close:"*/}"}}})},XC=qi.configure({dialect:"ts"},"typescript"),FC=qi.configure({dialect:"jsx",props:[kp.add(i=>i.isTop?[WC]:void 0)]}),YC=qi.configure({dialect:"jsx ts",props:[kp.add(i=>i.isTop?[WC]:void 0)]},"typescript");let zC=i=>({label:i,type:"keyword"});const VC="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(zC),H8=VC.concat(["declare","implements","private","protected","public"].map(zC));function K8(i={}){let e=i.jsx?i.typescript?YC:FC:i.typescript?XC:qi,t=i.typescript?U8.concat(H8):IC.concat(VC);return new Do(e,[qi.data.of({autocomplete:iI(BC,Q_(t))}),qi.data.of({autocomplete:G8}),i.jsx?tB:[]])}function J8(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function Yv(i,e,t=i.length){for(let n=e==null?void
` +w},""),d=r.state.selection.main.head,m=r.state.update({changes:{from:d,insert:f},selection:{anchor:d+1},scrollIntoView:!0});m&&r.dispatch(m)}xi(()=>{let c=new Vr,u=new Vr,h=et.create({doc:s,extensions:[ju,Ws.of([v_,...V_,...Bp]),c.of(Gv()),Gv(),W_(),u.of(et.tabSize.of(4)),ju,pe.editable.of(o),pe.updateListener.of(function(f){f.docChanged&&t(2,s=f.state.doc.toString())}),pe.lineWrapping,pe.contentAttributes.of({spellcheck:"true"})]});r=new pe({state:h,parent:n})}),Jw(()=>{r&&r.destroy()});function a(c){Ce[c?"unshift":"push"](()=>{n=c,t(1,n)})}return i. $ $ set=c=>{"value"in c&&t(2,s=c.value),"editable"in c&&t(0,o=c.editable)},[o,n,s,l,a]}class PB extends oe{constructor(e){super(),se(this,e,CB,_B,re,{value:2,editable:0,insertMedia:3})}get insertMedia(){return this. $ $ .ctx[3]}}function Hv(i){let e,t;return{c(){e=y("div"),t=W(i[6]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&64&&K(t,n[6])},d(n){n&&P(e)}}}function AB(i){let e,t,n,r,s,o,l;t=new Gy({props:{record:i[2],field:i[1],validationErrors:i[4],onFilesInserted:i[7]}});function a(h){i[9](h)}let c={editable:!i[1].readonly||i[3]};i[0]!==void 0&&(c.value=i[0]),r=new PB({props:c}),i[8](r),Ce.push(()=>nt(r,"value",a));let u=i[6]&&Hv(i);return{c(){e=y("div"),V(t. $ $ .fragment),n=D(),V(r. $ $ .fragment),o=D(),u&&u.c(),O(e,"class","mb-3")},m(h,f){x(h,e,f),Y(t,e,null),b(e,n),Y(r,e,null),b(e,o),u&&u.m(e,null),l=!0},p(h,[f]){const d={};f&4&&(d.record=h[2]),f&2&&(d.field=h[1]),f&16&&(d.validationErrors=h[4]),t. $ set(d);const m={};f&10&&(m.editable=!h[1].readonly||h[3]),!s&&f&1&&(s=!0,m.value=h[0],st(()=>s=!1)),r. $ set(m),h[6]?u?u.p(h,f):(u=Hv(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){l||(T(t. $ $ .fragment,h),T(r. $ $ .fragment,h),l=!0)},o(h){R(t. $ $ .fragment,h),R(r. $ $ .fragment,h),l=!1},d(h){h&&P(e),z(t),i[8](null),z(r),u&&u.d()}}}function xB(i,e,t){let n;const r=Ue("channel");let{value:s}=e,{field:o}=e,{record:l}=e,{isCreateMode:a}=e,{validationErrors:c}=e,u;function h(m){const p=m.detail.preset.path;u.insertMedia(r,m.detail.files,p)}function f(m){Ce[m?"unshift":"push"](()=>{u=m,t(5,u)})}function d(m){s=m,t(0,s)}return i. $ $ set=m=>{"value"in m&&t(0,s=m.value),"field"in m&&t(1,o=m.field),"record"in m&&t(2,l=m.record),"isCreateMode"in m&&t(3,a=m.isCreateMode),"validationErrors"in m&&t(4,c=m.validationErrors)},i. $ $ .update=()=>{i. $ $ .dirty&18&&t(6,n=In(c,o.name))},[s,o,l,a,c,u,n,h,f,d]}class lP extends oe{constructor(e){super(),se(this,e,xB,AB,re,{value:0,field:1,record:2,isCreateMode:3,validationErrors:4})}}function Kv(i){let e,t=i[0].help+"",n;return{c(){e=y("small"),n=W(t),O(e,"class","help-text light-text")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&1&&t!==(t=r[0].help+"")&&K(n,t)},d(r){r&&P(e)}}}function TB(i){let e,t,n,r,s=i[0].label+"",o,l,a,c,u,h=i[0].name+"",f,d=i[0].help&&Kv(i);return{c(){e=y("div"),t=y("div"),n=y("div"),r=y("label"),o=W(s),l=D(),d&&d.c(),a=D(),c=y("span"),u=y("code"),f=W(h),O(r,"for",i[1]),O(n,"class","label-and-help"),O(u,"class","field-id"),O(c,"tabindex","-1"),O(c,"class","text-decoration-none"),O(t,"class","labels"),O(e,"class","field-header")},m(m,p){x(m,e,p),b(e,t),b(t,n),b(n,r),b(r,o),b(n,l),d&&d.m(n,null),b(t,a),b(t,c),b(c,u),b(u,f)},p(m,[p]){p&1&&s!==(s=m[0].label+"")&&K(o,s),p&2&&O(r,"for",m[1]),m[0].help?d?d.p(m,p):(d=Kv(m),d.c(),d.m(n,null)):d&&(d.d(1),d=null),p&1&&h!==(h=m[0].name+"")&&K(f,h)},i:U,o:U,d(m){m&&P(e),d&&d.d()}}}function QB(i,e,t){let{field:n}=e,{id:r}=e;return i. $ $ set=s=>{"field"in s&&t(0,n=s.field),"id"in s&&t(1,r=s.id)},[n,r]}class MB extends oe{constructor(e){super(),se(this,e,QB,TB,re,{field:0,id:1})}}function Jv(i,e,t){const n=i.slice();return n[2]=e[t],n}function ew(i,e,t){const n=i.slice();return n[24]=e[t],n}function tw(i){let e,t;return{c(){e=y("div"),t=W(i[7]),O(e,"class","invalid-feedback d-block mb-3")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&128&&K(t,n[7])},d(n){n&&P(e)}}}function nw(i){let e=[],t=new Map,n,r=fe(i[5]);const s=l=>l[24].id;for(let l=0;l<r.length;l+=1){let a=ew(i,r,l),c=s(a);t.set(c,e[l]=rw(c,a))}let o=null;return r.length||(o=iw()),{c(){for(let l=0;l<e.length;l+=1)e[l].c();n=Ie(),o&&o.c()},m(l,a){for(let
versions ` ) , xt = D ( ) , H = y ( "div" ) , Ye . c ( ) , Tt = D ( ) , yt = y ( "div" ) , ct && ct . c ( ) , O ( s , "class" , "label text-end text-muted" ) , O ( f , "class" , "label text-end text-muted" ) , O ( w , "class" , "label text-end text-muted" ) , O ( L , "class" , "label text-end text-muted" ) , O ( n , "class" , "col-8" ) , O ( ee , "class" , "label d-block text-muted" ) , O ( X , "class" , "col-4" ) , O ( t , "class" , "row" ) , O ( e , "class" , "lx-card" ) , O ( H , "class" , "revisions" ) } , m ( qe , Mt ) { x ( qe , e , Mt ) , b ( e , t ) , b ( t , n ) , b ( n , r ) , b ( r , s ) , b ( r , o ) , b ( r , l ) , b ( l , c ) , b ( n , u ) , b ( n , h ) , b ( h , f ) , b ( h , d ) , b ( h , p ) , b ( n , g ) , b ( n , v ) , b ( v , w ) , b ( v , S ) , Y ( _ , v , null ) , b ( v , k ) , b ( v , C ) , b ( n , Q ) , b ( n , M ) , b ( M , L ) , b ( M , N ) , Y ( B , M , null ) , b ( M , J ) , b ( M , ie ) , b ( t , ae ) , b ( t , X ) , b ( X , ee ) , b ( X , Te ) , b ( X , ve ) , b ( ve , je ) , b ( ve , Ee ) , b ( ve , Re ) , x ( qe , xt , Mt ) , x ( qe , H , Mt ) , He [ Pe ] . m ( H , null ) , x ( qe , Tt , Mt ) , x ( qe , yt , Mt ) , ct && ct . m ( yt , null ) , i [ 13 ] ( yt ) , wt = ! 0 } , p ( qe , [ Mt ] ) { ( ! wt || Mt & 1 ) && a !== ( a = qe [ 0 ] . id + "" ) && K ( c , a ) , ( ! wt || Mt & 1 ) && m !== ( m = qe [ 0 ] . version + "" ) && K ( p , m ) ; const ei = { } ; Mt & 3 && ( ei . name = Dn ( qe [ 1 ] , qe [ 0 ] . createdBy ) ) , _ . $set ( ei ) , ( ! wt || Mt & 1 ) && A !== ( A = Bi ( qe [ 0 ] . createdAt ) + "" ) && K ( C , A ) ; const ti = { } ; Mt & 3 && ( ti . name = Dn ( qe [ 1 ] , qe [ 0 ] . updatedBy ) ) , B . $set ( ti ) , ( ! wt || Mt & 1 ) && te !== ( te = Bi ( qe [ 0 ] . updatedAt ) + "" ) && K ( ie , te ) , ( ! wt || Mt & 4 ) && ne !== ( ne = qe [ 2 ] . revisions + "" ) && K ( Ee , ne ) ; let Ri = Pe ; Pe = Ut ( qe ) , Pe === Ri ? He [ Pe ] . p ( qe , Mt ) : ( Oe ( ) , R ( He [ Ri ] , 1 , 1 , ( ) => { He [ Ri ] = null } ) , be ( ) , Ye = He [ Pe ] , Ye ? Ye . p ( qe , Mt ) : ( Ye = He [ Pe ] = Qt [ Pe ] ( qe ) , Ye . c ( ) ) , T ( Ye , 1 ) , Ye . m ( H , null ) ) , qe [ 5 ] ? ct ? ( ct . p ( qe , Mt ) , Mt & 32 && T ( ct , 1 ) ) : ( ct = Sw ( qe ) , ct . c ( ) , T ( ct , 1 ) , ct . m ( yt , null ) ) : ct && ( Oe ( ) , R ( ct , 1 , 1 , ( ) => { ct = null } ) , be ( ) ) } , i ( qe ) { wt || ( T ( _ . $$ . fragment , qe ) , T ( B . $$ . fragment , qe ) , T ( Ye ) , T ( ct ) , wt = ! 0 ) } , o ( qe ) { R ( _ . $$ . fragment , qe ) , R ( B . $$ . fragment , qe ) , R ( Ye ) , R ( ct ) , wt = ! 1 } , d ( qe ) { qe && ( P ( e ) , P ( xt ) , P ( H ) , P ( Tt ) , P ( yt ) ) , z ( _ ) , z ( B ) , He [ Pe ] . d ( ) , ct && ct . d ( ) , i [ 13 ] ( null ) } } } function uW ( i , e , t ) { let n , r , s , o ; const l = Ue ( "channel" ) ; let { record : a } = e , { graph : c } = e , { users : u } = e , { schema : h } = e , f , d = "" ; axios . get ( ` ${ l . lucentUrl } /records/ ${ a . id } /revisions ` ) . then ( S => { t ( 8 , n = S . data ) } ) . catch ( S => { console . log ( S ) } ) ; function m ( S , _ ) { t ( 7 , o = c . edges . filter ( k => k . depth === 1 ) . reduce ( ( k , A ) => ( k [ A . field ] || ( k [ A . field ] = { record : [ ] , revision : [ ] } ) , k [ A . field ] . record . push ( A ) , k ) , { } ) ) , t ( 7 , o = _ . _edges . reduce ( ( k , A ) => ( k [ A . field ] || ( k [ A . field ] = { record : [ ] , revision : [ ] } ) , k [ A . field ] . revision . push ( A ) , k ) , o ) ) } function p ( S , _ ) { S . preventDefault ( ) , t ( 5 , s = _ ) , t ( 6 , r = h . fields . filter ( k => ! ia ( s . data [ k . name ] , a . data [ k . name ] ) ) ) , m ( r , _ ) , f . scrollIntoView ( ) } function g ( S ) { S . preventDefault ( ) , t ( 4 , d = "" ) , axios . post ( ` ${ l . lucentUrl } /records/ ${ a . id } /rollback/ ${ s . version } ` ) . then ( _ => { window . location . reload ( ) } ) . catch ( _ => { const k = _ . response . data . error ; t ( 4 , d = k . fieldLabel + ": " + k . message ) } ) } const v = ( S , _ ) => p ( _ , S ) ; function w ( S ) { Ce [ S ? "unshift" : "push" ] ( ( ) => { f = S , t ( 3 , f ) } ) } return i . $$set = S => { "record" in S && t ( 0 , a = S . record ) , "graph" in S && t ( 11 , c = S . graph ) , "users" in S && t ( 1 , u = S . users ) , "schema" in S && t ( 2 , h = S . schema ) } , t ( 8 , n = [ ] ) , t ( 6 , r = [ ] ) , t ( 5 , s = null ) , t ( 7 , o = { } ) , [ a , u , h , f , d , s , r , o , n , p , g , c , v , w ] } class hW extends oe { constructor ( e ) { super ( ) , se ( this , e , uW , cW , re , { record : 0 , graph : 11 , users : 1 , schema : 2 } ) } } const { window : fW } = OP ; function Mw ( i , e , t ) { const n = i . slice ( ) ; return n [ 21 ] = e [ t ] , n } function dW ( i ) { let e , t , n ; return { c ( ) { e = y ( "button" ) , e . innerHTML = ` <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Save ` , O ( e , "type" , "button" ) , O ( e , "class" , "button primary ms-2 btn btn-primary btn-spinner" ) } , m ( r , s ) { x ( r , e , s ) , t || ( n = G ( e , "click" , i [ 11 ] ) , t = ! 0 ) } , p : U , d ( r ) { r && P ( e ) , t = ! 1 , n ( ) } } } function mW ( i ) { let e , t , n ; return { c ( ) { e = y ( "button" ) , e . innerHTML = ` <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Create ` , O ( e , "class" , "button primary btn-spinner" ) } , m ( r , s ) { x ( r , e , s ) , t || ( n = G ( e , "click" , i [ 11 ] ) , t = ! 0 ) } , p : U , d ( r ) { r && P ( e ) , t = ! 1 , n ( ) } } } function pW ( i ) { let e , t ; return e = new hW ( { props : { record : i [ 0 ] , graph : i [ 1 ] , users : i [ 4 ] , schema : i [ 2 ] } } ) , { c ( ) { V ( e . $$ . fragment ) } , m ( n , r ) { Y ( e , n , r ) , t = ! 0 } , p ( n , r ) { const s = { } ; r & 1 && ( s . record = n [ 0 ] ) , r & 2 && ( s . graph = n [ 1 ] ) , r & 16 && ( s . users = n [ 4 ] ) , r & 4 && ( s . schema = n [ 2 ] ) , e . $set ( s ) } , i ( n ) { t || ( T ( e . $$ . fragment , n ) , t = ! 0 ) } , o ( n ) { R ( e . $$ . fragment , n ) , t = ! 1 } , d ( n ) { z ( e , n ) } } } function gW ( i ) { let e , t ; return e = new qB ( { props : { graph : i [ 1 ] , record : i [ 0 ] } } ) , { c ( ) { V ( e . $$ . fragment ) } , m ( n , r ) { Y ( e , n , r ) , t = ! 0 } , p ( n , r ) { const s = { } ; r & 2 && ( s . graph = n [ 1 ] ) , r & 1 && ( s . record = n [ 0 ] ) , e . $set ( s ) } , i ( n ) { t || ( T ( e . $$ . fragment , n ) , t = ! 0 ) } , o ( n ) { R ( e . $$ . fragment , n ) , t = ! 1 } , d ( n ) { z ( e , n ) } } } function OW ( i ) { let e = [ ] , t = new Map , n , r , s = fe ( i [ 9 ] ) ; const o = l => l [ 21 ] . name ; for ( let l = 0 ; l < s . length ; l += 1 ) { let a = Mw ( i , s , l ) , c = o ( a ) ; t . set ( c , e [ l ] = Rw ( c , a ) ) } return { c ( ) { for ( let l = 0 ; l < e . length ; l += 1 ) e [ l ] . c ( ) ; n = Ie ( ) } , m ( l , a ) { for ( let c = 0 ; c < e . length ; c += 1 ) e [ c ] && e [ c ] . m ( l , a ) ; x ( l , n , a ) , r = ! 0 } , p ( l , a ) { a & 623 && ( s = fe ( l [ 9 ] ) , Oe ( ) , e = Ti ( e , a , o , 1 , l , s , t , n . parentNode , Jr , Rw , n , Mw ) , be ( ) ) } , i ( l ) { if ( ! r ) { for ( let a = 0 ; a < s . length ; a += 1 ) T ( e [ a ] ) ; r = ! 0 } } , o ( l ) { for ( let a = 0 ; a < e . length ; a += 1 ) R ( e [ a ] ) ; r = ! 1 } , d ( l ) { l && P ( n ) ; for ( let a = 0 ; a < e . length ; a += 1 ) e [ a ] . d ( l ) } } } function Ew ( i ) { let e , t , n , r ; function s ( a ) { i [ 15 ] ( a ) } function o ( a ) { i [ 16 ] ( a ) } let l = { field : i [ 21 ] , schema : i [ 2 ] , record : i [ 0 ] , validationErrors : i [ 5 ] , isCreateMode : i [ 3 ] } ; return i [ 0 ] . data !== void 0 && ( l . data = i [ 0 ] . data ) , i [ 1 ] !== void 0 && ( l . graph = i [ 1 ] ) , e = new aP ( { props : l } ) , Ce . push ( ( ) => nt ( e , "data" , s ) ) , Ce . push ( ( ) => nt ( e , "graph" , o ) ) , { c ( ) { V ( e . $$ . fragment ) } , m ( a , c ) { Y ( e , a , c ) , r = ! 0 } , p ( a , c ) { const u = { } ; c & 4 && ( u . schema = a [ 2 ] ) , c & 1 && ( u . record = a [ 0 ] ) , c & 32 && ( u . validationErrors = a [ 5 ] ) , c & 8 && ( u . isCreateMode = a [ 3 ] ) , ! t && c & 1 && ( t = ! 0 , u . data = a [ 0 ] . data , st ( ( ) => t = ! 1 ) ) , ! n && c & 2 && ( n = ! 0 , u . graph = a [ 1 ] , st ( ( ) => n = ! 1 ) ) , e . $set ( u ) } , i ( a ) { r || ( T ( e . $$ . fragment , a ) , r = ! 0 ) } , o ( a ) { R ( e . $$ . fragment , a ) , r = ! 1 } , d ( a ) { z ( e , a ) } } } function Rw ( i , e ) { let t , n , r , s = e [ 6 ] === e [ 21 ] . group && Ew ( e ) ; return { key : i , first : null , c ( ) { t = Ie ( ) , s && s . c ( ) , n = Ie ( ) , this . first = t } , m ( o , l ) { x ( o , t , l ) , s && s . m ( o , l ) , x ( o , n , l ) , r = ! 0 } , p ( o , l ) { e = o , e [ 6 ] === e [ 21 ] . group ? s ? ( s . p ( e , l ) , l & 64 && T ( s , 1 ) ) : ( s = Ew ( e ) , s . c ( ) , T ( s , 1 ) , s . m ( n . parentNode , n ) ) : s && ( Oe ( ) , R ( s , 1 , 1 , ( ) => { s = null } ) , be ( ) ) } , i ( o ) { r || ( T ( s ) , r = ! 0 ) } , o ( o ) { R ( s ) , r = ! 1 } , d ( o ) { o && ( P ( t ) , P ( n ) ) , s && s . d ( o ) } } } function bW ( i ) { let e , t , n , r , s , o , l , a , c , u , h , f , d , m , p , g , v , w , S , _ , k ; function A ( X ) { i [ 12 ] ( X ) } function C ( X ) { i [ 13 ] ( X ) } let Q = { schema : i [ 2 ] , isCreateMode : i [ 3 ] } ; i [ 0 ] !== void 0 && ( Q . record = i [ 0 ] ) , i [ 6 ] !== void 0 && ( Q . activeContentTab = i [ 6 ] ) , n = new cy ( { props : Q } ) , Ce . push ( ( ) => nt ( n , "record" , A ) ) , Ce . push ( ( ) => nt ( n , "activeContentTab" , C ) ) ; function M ( X , ee ) { if ( X [ 3 ] ) return mW ; if ( X [ 8 ] ) return dW } let L = M ( i ) , N = L && L ( i ) ; a = new _y ( { props : { schema : i [ 2 ] , record : i [ 0 ] , isCreateMode : i [ 3 ] } } ) , u = new Ma ( { props : { message : i [ 7 ] } } ) ; function B ( X ) { i [ 14 ] ( X ) } let J = { schema : i [ 2 ] , isCreateMode : i [ 3 ] } ; i [ 6 ] !== void 0 && ( J . active = i [ 6 ] ) , d = new uy ( { props : J } ) , Ce . push ( ( ) => nt ( d , "active" , B ) ) ; const te = [ OW , gW , pW ] , ie = [ ] ; function ae ( X , ee ) { return ee & 64 && ( g = null ) , g == null && ( g = ! [ "_graph" , "_info" ] . includes ( X [ 6 ] ) ) , g ? 0 : X [ 6 ] === "_graph" ? 1 : X [ 6 ] === "_info" ? 2 : - 1 } return ~ ( v = ae ( i , - 1 ) ) && ( w = ie [ v ] = te [ v ] ( i ) ) , { c ( ) { e = y ( "div" ) , t = y ( "div" ) , V ( n . $$ . fragment ) , o = D ( ) , N && N . c ( ) , l = D ( ) , V ( a . $$ . fragment ) , c = D ( ) , V ( u . $$ . fragment ) , h = D ( ) , f = y ( "div" ) , V ( d . $$ . fragment ) , p = D ( ) , w && w . c ( ) , O ( t , "class" , "tools-header" ) , O ( f , "class" , "mt-4" ) , le ( f , "margin-bottom" , "150px" ) , le ( f , "position" , "relative" ) , O ( e , "class" , "record-edit" ) } , m ( X , ee ) { x ( X , e , ee ) , b ( e , t ) , Y ( n , t , null ) , b ( t , o ) , N && N . m ( t , null ) , b ( e , l ) , Y ( a , e , null ) , b ( e , c ) , Y ( u , e , null ) , b ( e , h ) , b ( e , f ) , Y ( d , f , null ) , b ( f , p ) , ~ v && ie [ v ] . m ( f , null ) , S = ! 0 , _ || ( k = G ( fW , "beforeunload" , i [ 10 ] ) , _ = ! 0 ) } , p ( X , [ ee ] ) { const Te = { } ; ee & 4 && ( Te . schema = X [ 2 ] ) , ee & 8 && ( Te . isCreateMode = X [ 3 ] ) , ! r && ee & 1 && ( r = ! 0 , Te . record = X [ 0 ] , st ( ( ) => r = ! 1 ) ) , ! s && ee & 64 && ( s = ! 0 , Te . activeContentTab = X [ 6 ] , st ( ( ) => s = ! 1 ) ) , n . $set ( Te ) , L === ( L = M ( X ) ) && N ? N . p ( X , ee ) : ( N && N . d ( 1 ) , N = L && L ( X ) , N && ( N . c ( ) , N . m ( t , null ) ) ) ; const ve = { } ; ee & 4 && ( ve . schema = X [ 2 ] ) , ee & 1 && ( ve . record = X [ 0 ] ) , ee & 8 && ( ve . isCreateMode = X [ 3 ] ) , a . $set ( ve ) ; const je = { } ; ee & 128 && ( je . message = X [ 7 ] ) , u . $set ( je ) ; const ne = { } ; ee & 4 && ( ne . schema = X [ 2 ] ) , ee & 8 && ( ne . isCreateMode = X [ 3 ] ) , ! m && ee & 64 && ( m = ! 0 , ne . active = X [ 6 ] , st ( ( ) => m = ! 1 ) ) , d . $set ( ne ) ; let
2026-05-08 17:55:22 +03:00
` ),p=y("div"),p.textContent=" ",g=W( `
2026-05-15 17:07:12 +03:00
` ),O(n,"class","header-small mb-5"),O(o,"class","button primary mb-3"),o.disabled=i[2],O(c,"class","mb-3"),O(f,"class","logs svelte-16mig2w"),O(t,"class","lx-card mt-5"),O(e,"class","common-wrapper")},m(k,A){x(k,e,A),b(e,t),b(t,n),b(n,r),b(t,s),b(t,o),b(o,l),b(t,a),b(t,c),S&&S.m(c,null),b(c,u),_&&_.m(c,null),b(t,h),b(t,f),b(f,d),b(f,m),b(f,p),i[6](p),b(f,g),v||(w=G(o,"click",i[4]),v=!0)},p(k,[A]){A&1&&K(r,k[0]),A&4&&(o.disabled=k[2]),k[2]?S||(S=Bw(),S.c(),S.m(c,u)):S&&(S.d(1),S=null),!k[2]&&k[3]?_||(_=Ww(),_.c(),_.m(c,null)):_&&(_.d(1),_=null),A&8&&K(d,k[3])},i:U,o:U,d(k){k&&P(e),S&&S.d(),_&&_.d(),i[6](null),v=!1,w()}}}function RW(i,e,t){let n;const r=Ue("channel");let{title:s}=e,{command:o}=e,l,a=!1;function c(){const f=new EventSource(r.lucentUrl+"/command-report-source/"+o.signature);f.onmessage=function(d){t(2,a=!0);const m=JSON.parse(d.data);m.date,t(3,n=m.logs),l.scrollIntoView()},f.onerror=d=>{console.log(d),f.close(),t(2,a=!1)}}function u(f){f.preventDefault(),t(2,a=!0),Jn(r.lucentUrl+"/command/"+o.signature).then(d=>{c()})}xi(()=>{c()});function h(f){Ce[f?"unshift":"push"](()=>{l=f,t(1,l)})}return i. $ $ set=f=>{"title"in f&&t(0,s=f.title),"command"in f&&t(5,o=f.command)},t(3,n=""),[s,l,a,n,u,o,h]}class DW extends oe{constructor(e){super(),se(this,e,RW,EW,re,{title:0,command:5})}}function Xw(i,e,t){const n=i.slice();return n[2]=e[t],n}function $ W(i){let e;return{c(){e=y("a"),e.textContent="Store admin",O(e,"href","/lunar")},m(t,n){x(t,e,n)},p:U,d(t){t&&P(e)}}}function LW(i){let e,t;return{c(){e=y("a"),t=W("Members"),O(e,"class","top-nav-item"),O(e,"href",i[0].lucentUrl+"/members")},m(n,r){x(n,e,r),b(e,t)},p:U,d(n){n&&P(e)}}}function IW(i){let e,t;return e=new ur({props:{ $ $ slots:{button:[ZW],default:[NW]}, $ $ scope:{ctx:i}}}),{c(){V(e. $ $ .fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&32&&(s. $ $ scope={dirty:r,ctx:n}),e. $ set(s)},i(n){t||(T(e. $ $ .fragment,n),t=!0)},o(n){R(e. $ $ .fragment,n),t=!1},d(n){z(e,n)}}}function Fw(i){let e,t=i[2].name+"",n;return{c(){e=y("a"),n=W(t),O(e,"href",i[0].lucentUrl+"/command-report/"+i[2].signature),O(e,"class","top-nav-item")},m(r,s){x(r,e,s),b(e,n)},p:U,d(r){r&&P(e)}}}function NW(i){let e,t=fe(i[0].commands),n=[];for(let r=0;r<t.length;r+=1)n[r]=Fw(Xw(i,t,r));return{c(){for(let r=0;r<n.length;r+=1)n[r].c();e=Ie()},m(r,s){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(r,s);x(r,e,s)},p(r,s){if(s&1){t=fe(r[0].commands);let o;for(o=0;o<t.length;o+=1){const l=Xw(r,t,o);n[o]?n[o].p(l,s):(n[o]=Fw(l),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(r){r&&P(e),Ot(n,r)}}}function ZW(i){let e;return{c(){e=y("div"),e.textContent="Actions",O(e,"slot","button")},m(t,n){x(t,e,n)},p:U,d(t){t&&P(e)}}}function BW(i){let e,t;return e=new _i({props:{side:"28",name:i[1].name}}),{c(){V(e. $ $ .fragment)},m(n,r){Y(e,n,r),t=!0},p:U,i(n){t||(T(e. $ $ .fragment,n),t=!0)},o(n){R(e. $ $ .fragment,n),t=!1},d(n){z(e,n)}}}function WW(i){let e,t,n;return t=new _i({props:{side:"28",name:i[1].name}}),{c(){e=y("a"),V(t. $ $ .fragment),O(e,"href",i[0].lucentUrl+"/profile")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t. $ $ .fragment,r),n=!0)},o(r){R(t. $ $ .fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function XW(i){let e,t,n,r,s,o;function l(m,p){return m[0].auth=="lucent"?LW: $ W}let c=l(i)(i),u=i[0].commands.length>0&&IW(i);const h=[WW,BW],f=[];function d(m,p){return m[0].auth=="lucent"?0:1}return r=d(i),s=f[r]=h[r](i),{c(){e=y("div"),c.c(),t=D(),u&&u.c(),n=D(),s.c(),O(e,"class","top-nav")},m(m,p){x(m,e,p),c.m(e,null),b(e,t),u&&u.m(e,null),b(e,n),f[r].m(e,null),o=!0},p(m,[p]){c.p(m,p),m[0].commands.length>0&&u.p(m,p),s.p(m,p)},i(m){o||(T(u),T(s),o=!0)},o(m){R(u),R(s),o=!1},d(m){m&&P(e),c.d(),u&&u.d(),f[r].d()}}}function FW(i){const e=Ue("channel"),t=Ue("user");return[e,t]}class YW extends oe{constructor(e){super(),se(this,e,FW,XW,re,{})}}function zW(i){let e,t,n,r,s,o,l,a,c;n=new SW({props:{schema:i[2].schema}}),o=new YW({});const u=[{title:i[0]},i[2]];var h=i[3][i[1]];function f(d,m){let p={};for(let g=0;g<u.length;g+=1)p=Ps(p,u[g]);return m!==void 0&&m&5&&(p=Ps(p,_o(u,[m&1&&{title:d[0]},m&4&&Co