PageSourceSearch

https://plevako.ai/assets/index-C-mr_vaL.js

js plevako.ai collected 2026-10-05 12:24:00 UTC 3,138,171 bytes, 972 lines download raw bytes

vendor: 5,613 bytes, line 1
1(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var h0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Am(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cy={exports:{}},qp={};var h4;function oQ(){if(h4)return qp;h4=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,r,i){var o=null;if(i!==void 0&&(o=""+i),r.key!==void 0&&(o=""+r.key),"key"in r){i={};for(var c in r)c!=="key"&&(i[c]=r[c])}else i=r;return r=i.ref,{$$typeof:e,type:s,key:o,ref:r!==void 0?r:null,props:i}}return qp.Fragment=t,qp.jsx=n,qp.jsxs=n,qp}var m4;function aQ(){return m4||(m4=1,cy.exports=oQ()),cy.exports}var a=aQ(),uy={exports:{}},_t={};var g4;function lQ(){if(g4)return _t;g4=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),A=Symbol.iterator;function E(j){return j===null||typeof j!="object"?null:(j=A&&j[A]||j["@@iterator"],typeof j=="function"?j:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,I={};function v(j,q,G){this.props=j,this.context=q,this.refs=I,this.updater=G||x}v.prototype.isReactComponent={},v.prototype.setState=function(j,q){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,q,"setState")},v.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function S(){}S.prototype=v.prototype;function b(j,q,G){this.props=j,this.context=q,this.refs=I,this.updater=G||x}var w=b.prototype=new S;w.constructor=b,y(w,v.prototype),w.isPureReactComponent=!0;var _=Array.isArray;function N(){}var R={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function k(j,q,G){var $=G.ref;return{$$typeof:e,type:j,key:q,ref:$!==void 0?$:null,props:G}}function L(j,q){return k(j.type,q,j.props)}function O(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function P(j){var q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(G){return q[G]})}var B=/\/+/g;function F(j,q){return typeof j=="object"&&j!==null&&j.key!=null?P(""+j.key):q.toString(36)}function z(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(N,N):(j.status="pending",j.then(function(q){j.status==="pending"&&(j.status="fulfilled",j.value=q)},function(q){j.status==="pending"&&(j.status="rejected",j.reason=q)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function Q(j,q,G,$,J){var ne=typeof j;(ne==="undefined"||ne==="boolean")&&(j=null);var X=!1;if(j===null)X=!0;else switch(ne){case"bigint":case"string":case"number":X=!0;break;case"object":switch(j.$$typeof){case e:case t:X=!0;break;case p:return X=j._init,Q(X(j._payload),q,G,$,J)}}if(X)return J=J(j),X=$===""?"."+F(j,0):$,_(J)?(G="",X!=null&&(G=X.replace(B,"$&/")+"/"),Q(J,q,G,"",function(ee){return ee})):J!=null&&(O(J)&&(J=L(J,G+(J.key==null||j&&j.key===J.key?"":(""+J.key).replace(B,"$&/")+"/")+X)),q.push(J)),1;X=0;var oe=$===""?".":$+":";if(_(j))for(var ie=0;ie<j.length;ie++)$=j[ie],ne=oe+F($,ie),X+=Q($,q,G,ne,J);else if(ie=E(j),typeof ie=="function")for(j=ie.call(j),ie=0;!($=j.next()).done;)$=$.value,ne=oe+F($,ie++),X+=Q($,q,G,ne,J);else if(ne==="object"){if(typeof j.then=="function")return Q(z(j),q,G,$,J);throw q=String(j),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return X}function M(j,q,G){if(j==null)return j;var $=[],J=0;return Q(j,$,"","",function(ne){return q.call(G,ne,J++)}),$}function K(j){if(j._status===-1){var q=j._result;q=q(),q.then(function(G){(j._status===0||j._status===-1)&&(j._status=1,j._result=G)},function(G){(j._status===0||j._status===-1)&&(j._status=2,j._result=G)}),j._status===-1&&(j._status=0,j._result=q)}if(j._status===1)return j._result.default;throw j._result}var W=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)}
vendor: 15,723 bytes, lines 1-3
1,H={map:M,forEach:function(j,q,G){M(j,function(){q.apply(this,arguments)},G)},count:function(j){var q=0;return M(j,function(){q++}),q},toArray:function(j){return M(j,function(q){return q})||[]},only:function(j){if(!O(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return _t.Activity=g,_t.Children=H,_t.Component=v,_t.Fragment=n,_t.Profiler=r,_t.PureComponent=b,_t.StrictMode=s,_t.Suspense=u,_t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,_t.__COMPILER_RUNTIME={__proto__:null,c:function(j){return R.H.useMemoCache(j)}},_t.cache=function(j){return function(){return j.apply(null,arguments)}},_t.cacheSignal=function(){return null},_t.cloneElement=function(j,q,G){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var $=y({},j.props),J=j.key;if(q!=null)for(ne in q.key!==void 0&&(J=""+q.key),q)!D.call(q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&q.ref===void 0||($[ne]=q[ne]);var ne=arguments.length-2;if(ne===1)$.children=G;else if(1<ne){for(var X=Array(ne),oe=0;oe<ne;oe++)X[oe]=arguments[oe+2];$.children=X}return k(j.type,J,$)},_t.createContext=function(j){return j={$$typeof:o,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:i,_context:j},j},_t.createElement=function(j,q,G){var $,J={},ne=null;if(q!=null)for($ in q.key!==void 0&&(ne=""+q.key),q)D.call(q,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(J[$]=q[$]);var X=arguments.length-2;if(X===1)J.children=G;else if(1<X){for(var oe=Array(X),ie=0;ie<X;ie++)oe[ie]=arguments[ie+2];J.children=oe}if(j&&j.defaultProps)for($ in X=j.defaultProps,X)J[$]===void 0&&(J[$]=X[$]);return k(j,ne,J)},_t.createRef=function(){return{current:null}},_t.forwardRef=function(j){return{$$typeof:c,render:j}},_t.isValidElement=O,_t.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:K}},_t.memo=function(j,q){return{$$typeof:d,type:j,compare:q===void 0?null:q}},_t.startTransition=function(j){var q=R.T,G={};R.T=G;try{var $=j(),J=R.S;J!==null&&J(G,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(N,W)}catch(ne){W(ne)}finally{q!==null&&G.types!==null&&(q.types=G.types),R.T=q}},_t.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},_t.use=function(j){return R.H.use(j)},_t.useActionState=function(j,q,G){return R.H.useActionState(j,q,G)},_t.useCallback=function(j,q){return R.H.useCallback(j,q)},_t.useContext=function(j){return R.H.useContext(j)},_t.useDebugValue=function(){},_t.useDeferredValue=function(j,q){return R.H.useDeferredValue(j,q)},_t.useEffect=function(j,q){return R.H.useEffect(j,q)},_t.useEffectEvent=function(j){return R.H.useEffectEvent(j)},_t.useId=function(){return R.H.useId()},_t.useImperativeHandle=function(j,q,G){return R.H.useImperativeHandle(j,q,G)},_t.useInsertionEffect=function(j,q){return R.H.useInsertionEffect(j,q)},_t.useLayoutEffect=function(j,q){return R.H.useLayoutEffect(j,q)},_t.useMemo=function(j,q){return R.H.useMemo(j,q)},_t.useOptimistic=function(j,q){return R.H.useOptimistic(j,q)},_t.useReducer=function(j,q,G){return R.H.useReducer(j,q,G)},_t.useRef=function(j){return R.H.useRef(j)},_t.useState=function(j){return R.H.useState(j)},_t.useSyncExternalStore=function(j,q,G){return R.H.useSyncExternalStore(j,q,G)},_t.useTransition=function(){return R.H.useTransition()},_t.version="19.2.3",_t}var A4;function Ev(){return A4||(A4=1,uy.exports=lQ()),uy.exports}var l=Ev();const Oe=Am(l);var dy={exports:{}},Wp={},fy={exports:{}},py={};var E4;function cQ(){return E4||(E4=1,(function(e){function t(Q,M){var K=Q.length;Q.push(M);e:for(;0<K;){var W=K-1>>>1,H=Q[W];if(0<r(H,M))Q[W]=M,Q[K]=H,K=W;else break e}}function n(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var M=Q[0],K=Q.pop();if(K!==M){Q[0]=K;e:for(var W=0,H=Q.length,j=H>>>1;W<j;){var q=2*(W+1)-1,G=Q[q],$=q+1,J=Q[$];if(0>r(G,K))$<H&&0>r(J,G)?(Q[W]=J,Q[$]=K,W=$):(Q[W]=G,Q[q]=K,W=q);else if($<H&&0>r(J,K))Q[W]=J,Q[$]=K,W=$;else break e}}return M}function r(Q,M){var K=Q.sortIndex-M.sortIndex;return K!==0?K:Q.id-M.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var u=[],d=[],p=1,g=null,A=3,E=!1,x=!1,y=!1,I=!1,v=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function w(Q){for(var M=n(d);M!==null;){if(M.callback===null)s(d);else if(M.startTime<=Q)s(d),M.sortIndex=M.expirationTime,t(u,M);else break;M=n(d)}}function _(Q){if(y=!1,w(Q),!x)if(n(u)!==null)x=!0,N||(N=!0,P());else{var M=n(d);M!==null&&z(_,M.startTime-Q)}}var N=!1,R=-1,D=5,k=-1;function L(){return I?!0:!(e.unstable_now()-k<D)}function O(){if(I=!1,N){var Q=e.unstable_now();k=Q;var M=!0;try{e:{x=!1,y&&(y=!1,S(R),R=-1),E=!0;var K=A;try{t:{for(w(Q),g=n(u);g!==null&&!(g.expirationTime>Q&&L());){var W=g.callback;if(typeof W=="function"){g.callback=null,A=g.priorityLevel;var H=W(g.expirationTime<=Q);if(Q=e.unstable_now(),typeof H=="function"){g.callback=H,w(Q),M=!0;break t}g===n(u)&&s(u),w(Q)}else s(u);g=n(u)}if(g!==null)M=!0;else{var j=n(d);j!==null&&z(_,j.startTime-Q),M=!1}}break e}finally{g=null,A=K,E=!1}M=void 0}}finally{M?P():N=!1}}}var P;if(typeof b=="function")P=function(){b(O)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,F=B.port2;B.port1.onmessage=O,P=function(){F.postMessage(null)}}else P=function(){v(O,0)};function z(Q,M){R=v(function(){Q(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return A},e.unstable_next=function(Q){switch(A){case 1:case 2:case 3:var M=3;break;default:M=A}var K=A;A=M;try{return Q()}finally{A=K}},e.unstable_requestPaint=function(){I=!0},e.unstable_runWithPriority=function(Q,M){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var K=A;A=Q;try{return M()}finally{A=K}},e.unstable_scheduleCallback=function(Q,M,K){var W=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?W+K:W):K=W,Q){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=K+H,Q={id:p++,callback:M,priorityLevel:Q,startTime:K,expirationTime:H,sortIndex:-1},K>W?(Q.sortIndex=K,t(d,Q),n(u)===null&&Q===n(d)&&(y?(S(R),R=-1):y=!0,z(_,K-W))):(Q.sortIndex=H,t(u,Q),x||E||(x=!0,N||(N=!0,P()))),Q},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(Q){var M=A;return function(){var K=A;A=M;try{return Q.apply(this,arguments)}finally{A=K}}}})(py)),py}var x4;function uQ(){return x4||(x4=1,fy.exports=cQ()),fy.exports}var hy={exports:{}},ir={};var C4;function dQ(){if(C4)return ir;C4=1;var e=Ev();function t(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");function i(u,d,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:g==null?null:""+g,children:u,containerInfo:d,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ir.createPortal=function(u,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return i(u,d,null,p)},ir.flushSync=function(u){var d=o.T,p=s.p;try{if(o.T=null,s.p=2,u)return u()}finally{o.T=d,s.p=p,s.d.f()}},ir.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(u,d))},ir.prefetchDNS=function(u){typeof u=="string"&&s.d.D(u)},ir.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin),A=typeof d.integrity=="string"?d.integrity:void 0,E=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?s.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:A,fetchPriority:E}):p==="script"&&s.d.X(u,{crossOrigin:g,integrity:A,fetchPriority:E,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ir.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=c(d.as,d.crossOrigin);s.d.M(u,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(u)},ir.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,g=c(p,d.crossOrigin);s.d.L(u,p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ir.preloadModule=function(u,d){if(typeof u=="string")if(d){var p=c(d.as,d.crossOrigin);s.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(u)},ir.requestFormReset=function(u){s.d.r(u)},ir.unstable_batchedUpdates=function(u,d){return u(d)},ir.useFormState=function(u,d,p){return o.H.useFormState(u,d,p)},ir.useFormStatus=function(){return o.H.useHostTransitionStatus()},ir.version="19.2.3",ir}var y4;function vD(){if(y4)return hy.exports;y4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hy.exports=dQ(),hy.exports}var b4;function fQ(){if(b4)return Wp;b4=1;var e=uQ(),t=Ev(),n=vD();function s(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)m+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(f){return!(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)}function i(f){var m=f,C=f;if(f.alternate)for(;m.return;)m=m.return;else{f=m;do m=f,(m.flags&4098)!==0&&(C=m.return),f=m.return;while(f)}return m.tag===3?C:null}function o(f){if(f.tag===13){var m=f.memoizedState;if(m===null&&(f=f.alternate,f!==null&&(m=f.memoizedState)),m!==null)return m.dehydrated}return null}function c(f){if(f.tag===31){var m=f.memoizedState;if(m===null&&(f=f.alternate,f!==null&&(m=f.memoizedState)),m!==null)return m.dehydrated}return null}function u(f){if(i(f)!==f)throw Error(s(188))}function d(f){var m=f.alternate;if(!m){if(m=i(f),m===null)throw Error(s(188));return m!==f?null:f}for(var C=f,T=m;;){var U=C.return;if(U===null)break;var V=U.alternate;if(V===null){if(T=U.return,T!==null){C=T;continue}break}if(U.child===V.child){for(V=U.child;V;){if(V===C)return u(U),f;if(V===T)return u(U),m;V=V.sibling}throw Error(s(188))}if(C.return!==T.return)C=U,T=V;else{for(var Z=!1,ae=U.child;ae;){if(ae===C){Z=!0,C=U,T=V;break}if(ae===T){Z=!0,T=U,C=V;break}ae=ae.sibling}if(!Z){for(ae=V.child;ae;){if(ae===C){Z=!0,C=V,T=U;break}if(ae===T){Z=!0,T=V,C=U;break}ae=ae.sibling}if(!Z)throw Error(s(189))}}if(C.alternate!==T)throw Error(s(190))}if(C.tag!==3)throw Error(s(188));return C.stateNode.current===C?f:m}function p(f){var m=f.tag;if(m===5||m===26||m===27||m===6)return f;for(f=f.child;f!==null;){if(m=p(f),m!==null)return m;f=f.sibling}return null}var g=Object.assign,A=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),b=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),O=Symbol.iterator;function P(f){return f===null||typeof f!="object"?null:(f=O&&f[O]||f["@@iterator"],typeof f=="function"?f:null)}var B=Symbol.for("react.client.reference");function F(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===B?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case y:return"Fragment";case v:return"Profiler";case I:return"StrictMode";case _:return"Suspense";case N:return"SuspenseList";case k:return"Activity"}if(typeof f=="object")switch(f.$$typeof){case x:return"Portal";case b:return f.displayName||"Context";case S:return(f._context.displayName||"Context")+".Consumer";case w:var m=f.render;return f=f.displayName,f||(f=m.displayName||m.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case R:return m=f.displayName||null,m!==null?m:F(f.type)||"Memo";case D:m=f._payload,f=f._init;try{return F(f(m))}catch{}}return null}var z=Array.isArray,Q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},W=[],H=-1;function j(f){return{current:f}}function q(f){0>H||(f.current=W[H],W[H]=null,H--)}function G(f,m){H++,W[H]=f.current,f.current=m}var $=j(null),J=j(null),ne=j(null),X=j(null);function oe(f,m){switch(G(ne,m),G(J,f),G($,null),m.nodeType){case 9:case 11:f=(f=m.documentElement)&&(f=f.namespaceURI)?j3(f):0;break;default:if(f=m.tagName,m=m.namespaceURI)m=j3(m),f=B3(m,f);else switch(f){case"svg":f=1;break;case"math":f=2;break;default:f=0}}q($),G($,f)}function ie(){q($),q(J),q(ne)}function ee(f){f.memoizedState!==null&&G(X,f);var m=$.current,C=B3(m,f.type);m!==C&&(G(J,f),G($,C))}function te(f){J.current===f&&(q($),q(J)),X.current===f&&(q(X),Qp._currentValue=K)}var le,he;function fe(f){if(le===void 0)try{throw Error()}catch(C){var m=C.stack.trim().match(/\n( *(at )?)/);le=m&&m[1]||"",he=-1<C.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<C.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+le+f+he}var ue=!1;function ye(f,m){if(!f||ue)return"";ue=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var T={DetermineComponentFrameRoot:function(){try{if(m){var Qe=function(){throw Error()};if(Object.defineProperty(Qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Qe,[])}catch(ke){var De=ke}Reflect.construct(f,[],Qe)}else{try{Qe.call()}catch(ke){De=ke}f.call(Qe.prototype)}}else{try{throw Error()}catch(ke){De=ke}(Qe=f())&&typeof Qe.catch=="function"&&Qe.catch(function(){})}}
vendor: 4,352 bytes, lines 3-8
3catch(ke){if(ke&&De&&typeof ke.stack=="string")return[ke.stack,De.stack]}return[null,null]}};T.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var U=Object.getOwnPropertyDescriptor(T.DetermineComponentFrameRoot,"name");U&&U.configurable&&Object.defineProperty(T.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var V=T.DetermineComponentFrameRoot(),Z=V[0],ae=V[1];if(Z&&ae){var Ae=Z.split(`
4`),we=ae.split(`
5`);for(U=T=0;T<Ae.length&&!Ae[T].includes("DetermineComponentFrameRoot");)T++;for(;U<we.length&&!we[U].includes("DetermineComponentFrameRoot");)U++;if(T===Ae.length||U===we.length)for(T=Ae.length-1,U=we.length-1;1<=T&&0<=U&&Ae[T]!==we[U];)U--;for(;1<=T&&0<=U;T--,U--)if(Ae[T]!==we[U]){if(T!==1||U!==1)do if(T--,U--,0>U||Ae[T]!==we[U]){var je=`
6`+Ae[T].replace(" at new "," at ");return f.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",f.displayName)),je}while(1<=T&&0<=U);break}}}finally{ue=!1,Error.prepareStackTrace=C}return(C=f?f.displayName||f.name:"")?fe(C):""}function ce(f,m){switch(f.tag){case 26:case 27:case 5:return fe(f.type);case 16:return fe("Lazy");case 13:return f.child!==m&&m!==null?fe("Suspense Fallback"):fe("Suspense");case 19:return fe("SuspenseList");case 0:case 15:return ye(f.type,!1);case 11:return ye(f.type.render,!1);case 1:return ye(f.type,!0);case 31:return fe("Activity");default:return""}}function xe(f){try{var m="",C=null;do m+=ce(f,C),C=f,f=f.return;while(f);return m}catch(T){return`
7Error generating stack: `+T.message+`
8`+T.stack}}var re=Object.prototype.hasOwnProperty,pe=e.unstable_scheduleCallback,_e=e.unstable_cancelCallback,Le=e.unstable_shouldYield,Ee=e.unstable_requestPaint,se=e.unstable_now,me=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,ge=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Be=e.unstable_IdlePriority,nt=e.log,At=e.unstable_setDisableYieldValue,ht=null,dt=null;function Gt(f){if(typeof nt=="function"&&At(f),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(ht,f)}catch{}}var ft=Math.clz32?Math.clz32:wr,_n=Math.log,Cn=Math.LN2;function wr(f){return f>>>=0,f===0?32:31-(_n(f)/Cn|0)|0}var eo=256,Rr=262144,Zr=4194304;function ei(f){var m=f&42;if(m!==0)return m;switch(f&-f){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return f&261888;case 262144:case 524288:case 1048576:case 2097152:return f&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return f&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return f}}function Xn(f,m,C){var T=f.pendingLanes;if(T===0)return 0;var U=0,V=f.suspendedLanes,Z=f.pingedLanes;f=f.warmLanes;var ae=T&134217727;return ae!==0?(T=ae&~V,T!==0?U=ei(T):(Z&=ae,Z!==0?U=ei(Z):C||(C=ae&~f,C!==0&&(U=ei(C))))):(ae=T&~V,ae!==0?U=ei(ae):Z!==0?U=ei(Z):C||(C=T&~f,C!==0&&(U=ei(C)))),U===0?0:m!==0&&m!==U&&(m&V)===0&&(V=U&-U,C=m&-m,V>=C||V===32&&(C&4194048)!==0)?m:U}function $t(f,m){return(f.pendingLanes&~(f.suspendedLanes&~f.pingedLanes)&m)===0}function Gn(f,m){switch(f){case 1:case 2:case 4:case 8:case 64:return m+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dr(){var f=Zr;return Zr<<=1,(Zr&62914560)===0&&(Zr=4194304),f}function _i(f){for(var m=[],C=0;31>C;C++)m.push(f);return m}function kr(f,m){f.pendingLanes|=m,m!==268435456&&(f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0)}function tg(f,m,C,T,U,V){var Z=f.pendingLanes;f.pendingLanes=C,f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0,f.expiredLanes&=C,f.entangledLanes&=C,f.errorRecoveryDisabledLanes&=C,f.shellSuspendCounter=0;var ae=f.entanglements,Ae=f.expirationTimes,we=f.hiddenUpdates;for(C=Z&~C;0<C;){var je=31-ft(C),Qe=1<<je;ae[je]=0,Ae[je]=-1;var De=we[je];if(De!==null)for(we[je]=null,je=0;
vendor: 8,944 bytes, line 8
8je<De.length;je++){var ke=De[je];ke!==null&&(ke.lane&=-536870913)}C&=~Qe}T!==0&&xT(f,T,0),V!==0&&U===0&&f.tag!==0&&(f.suspendedLanes|=V&~(Z&~m))}function xT(f,m,C){f.pendingLanes|=m,f.suspendedLanes&=~m;var T=31-ft(m);f.entangledLanes|=m,f.entanglements[T]=f.entanglements[T]|1073741824|C&261930}function CT(f,m){var C=f.entangledLanes|=m;for(f=f.entanglements;C;){var T=31-ft(C),U=1<<T;U&m|f[T]&m&&(f[T]|=m),C&=~U}}function yT(f,m){var C=m&-m;return C=(C&42)!==0?1:JE(C),(C&(f.suspendedLanes|m))!==0?0:C}function JE(f){switch(f){case 2:f=1;break;case 8:f=4;break;case 32:f=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:f=128;break;case 268435456:f=134217728;break;default:f=0}return f}function ZE(f){return f&=-f,2<f?8<f?(f&134217727)!==0?32:268435456:8:2}function bT(){var f=M.p;return f!==0?f:(f=window.event,f===void 0?32:a4(f.type))}function IT(f,m){var C=M.p;try{return M.p=f,m()}finally{M.p=C}}var ml=Math.random().toString(36).slice(2),Ks="__reactFiber$"+ml,Or="__reactProps$"+ml,$u="__reactContainer$"+ml,ex="__reactEvents$"+ml,$F="__reactListeners$"+ml,YF="__reactHandles$"+ml,ST="__reactResources$"+ml,sp="__reactMarker$"+ml;function tx(f){delete f[Ks],delete f[Or],delete f[ex],delete f[$F],delete f[YF]}function Yu(f){var m=f[Ks];if(m)return m;for(var C=f.parentNode;C;){if(m=C[$u]||C[Ks]){if(C=m.alternate,m.child!==null||C!==null&&C.child!==null)for(f=G3(f);f!==null;){if(C=f[Ks])return C;f=G3(f)}return m}f=C,C=f.parentNode}return null}function Xu(f){if(f=f[Ks]||f[$u]){var m=f.tag;if(m===5||m===6||m===13||m===31||m===26||m===27||m===3)return f}return null}function rp(f){var m=f.tag;if(m===5||m===26||m===27||m===6)return f.stateNode;throw Error(s(33))}function Ju(f){var m=f[ST];return m||(m=f[ST]={hoistableStyles:new Map,hoistableScripts:new Map}),m}function Ms(f){f[sp]=!0}var vT=new Set,_T={};function yc(f,m){Zu(f,m),Zu(f+"Capture",m)}function Zu(f,m){for(_T[f]=m,f=0;f<m.length;f++)vT.add(m[f])}var XF=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),TT={},NT={};function JF(f){return re.call(NT,f)?!0:re.call(TT,f)?!1:XF.test(f)?NT[f]=!0:(TT[f]=!0,!1)}function ng(f,m,C){if(JF(m))if(C===null)f.removeAttribute(m);else{switch(typeof C){case"undefined":case"function":case"symbol":f.removeAttribute(m);return;case"boolean":var T=m.toLowerCase().slice(0,5);if(T!=="data-"&&T!=="aria-"){f.removeAttribute(m);return}}f.setAttribute(m,""+C)}}function sg(f,m,C){if(C===null)f.removeAttribute(m);else{switch(typeof C){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(m);return}f.setAttribute(m,""+C)}}function Ia(f,m,C,T){if(T===null)f.removeAttribute(C);else{switch(typeof T){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(C);return}f.setAttributeNS(m,C,""+T)}}function Ti(f){switch(typeof f){case"bigint":case"boolean":case"number":case"string":case"undefined":return f;case"object":return f;default:return""}}function wT(f){var m=f.type;return(f=f.nodeName)&&f.toLowerCase()==="input"&&(m==="checkbox"||m==="radio")}function ZF(f,m,C){var T=Object.getOwnPropertyDescriptor(f.constructor.prototype,m);if(!f.hasOwnProperty(m)&&typeof T<"u"&&typeof T.get=="function"&&typeof T.set=="function"){var U=T.get,V=T.set;return Object.defineProperty(f,m,{configurable:!0,get:function(){return U.call(this)},set:function(Z){C=""+Z,V.call(this,Z)}}),Object.defineProperty(f,m,{enumerable:T.enumerable}),{getValue:function(){return C},setValue:function(Z){C=""+Z},stopTracking:function(){f._valueTracker=null,delete f[m]}}}}function nx(f){if(!f._valueTracker){var m=wT(f)?"checked":"value";f._valueTracker=ZF(f,m,""+f[m])}}function RT(f){if(!f)return!1;var m=f._valueTracker;if(!m)return!0;var C=m.getValue(),T="";return f&&(T=wT(f)?f.checked?"true":"false":f.value),f=T,f!==C?(m.setValue(f),!0):!1}function rg(f){if(f=f||(typeof document<"u"?document:void 0),typeof f>"u")return null;try{return f.activeElement||f.body}catch{return f.body}}var eU=/[\n"\\]/g;function Ni(f){return f.replace(eU,function(m){return"\\"+m.charCodeAt(0).toString(16)+" "})}function sx(f,m,C,T,U,V,Z,ae){f.name="",Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?f.type=Z:f.removeAttribute("type"),m!=null?Z==="number"?(m===0&&f.value===""||f.value!=m)&&(f.value=""+Ti(m)):f.value!==""+Ti(m)&&(f.value=""+Ti(m)):Z!=="submit"&&Z!=="reset"||f.removeAttribute("value"),m!=null?rx(f,Z,Ti(m)):C!=null?rx(f,Z,Ti(C)):T!=null&&f.removeAttribute("value"),U==null&&V!=null&&(f.defaultChecked=!!V),U!=null&&(f.checked=U&&typeof U!="function"&&typeof U!="symbol"),ae!=null&&typeof ae!="function"&&typeof ae!="symbol"&&typeof ae!="boolean"?f.name=""+Ti(ae):f.removeAttribute("name")}function DT(f,m,C,T,U,V,Z,ae){if(V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(f.type=V),m!=null||C!=null){if(!(V!=="submit"&&V!=="reset"||m!=null)){nx(f);return}C=C!=null?""+Ti(C):"",m=m!=null?""+Ti(m):C,ae||m===f.value||(f.value=m),f.defaultValue=m}T=T??U,T=typeof T!="function"&&typeof T!="symbol"&&!!T,f.checked=ae?f.checked:!!T,f.defaultChecked=!!T,Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"&&(f.name=Z),nx(f)}function rx(f,m,C){m==="number"&&rg(f.ownerDocument)===f||f.defaultValue===""+C||(f.defaultValue=""+C)}function ed(f,m,C,T){if(f=f.options,m){m={};for(var U=0;U<C.length;U++)m["$"+C[U]]=!0;for(C=0;C<f.length;C++)U=m.hasOwnProperty("$"+f[C].value),f[C].selected!==U&&(f[C].selected=U),U&&T&&(f[C].defaultSelected=!0)}else{for(C=""+Ti(C),m=null,U=0;U<f.length;U++){if(f[U].value===C){f[U].selected=!0,T&&(f[U].defaultSelected=!0);return}m!==null||f[U].disabled||(m=f[U])}m!==null&&(m.selected=!0)}}function kT(f,m,C){if(m!=null&&(m=""+Ti(m),m!==f.value&&(f.value=m),C==null)){f.defaultValue!==m&&(f.defaultValue=m);return}f.defaultValue=C!=null?""+Ti(C):""}function OT(f,m,C,T){if(m==null){if(T!=null){if(C!=null)throw Error(s(92));if(z(T)){if(1<T.length)throw Error(s(93));T=T[0]}C=T}C==null&&(C=""),m=C}C=Ti(m),f.defaultValue=C,T=f.textContent,T===C&&T!==""&&T!==null&&(f.value=T),nx(f)}function td(f,m){if(m){var C=f.firstChild;if(C&&C===f.lastChild&&C.nodeType===3){C.nodeValue=m;return}}f.textContent=m}var tU=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function PT(f,m,C){var T=m.indexOf("--")===0;C==null||typeof C=="boolean"||C===""?T?f.setProperty(m,""):m==="float"?f.cssFloat="":f[m]="":T?f.setProperty(m,C):typeof C!="number"||C===0||tU.has(m)?m==="float"?f.cssFloat=C:f[m]=(""+C).trim():f[m]=C+"px"}function LT(f,m,C){if(m!=null&&typeof m!="object")throw Error(s(62));if(f=f.style,C!=null){for(var T in C)!C.hasOwnProperty(T)||m!=null&&m.hasOwnProperty(T)||(T.indexOf("--")===0?f.setProperty(T,""):T==="float"?f.cssFloat="":f[T]="");for(var U in m)T=m[U],m.hasOwnProperty(U)&&C[U]!==T&&PT(f,U,T)}else for(var V in m)m.hasOwnProperty(V)&&PT(f,V,m[V])}function ix(f){if(f.indexOf("-")===-1)return!1;switch(f){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nU=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
8dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),sU=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ig(f){return sU.test(""+f)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":f}function Sa(){}var ox=null;function ax(f){return f=f.target||f.srcElement||window,f.correspondingUseElement&&(f=f.correspondingUseElement),f.nodeType===3?f.parentNode:f}var nd=null,sd=null;function MT(f){var m=Xu(f);if(m&&(f=m.stateNode)){var C=f[Or]||null;e:switch(f=m.stateNode,m.type){case"input":if(sx(f,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name),m=C.name,C.type==="radio"&&m!=null){for(C=f;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll('input[name="'+Ni(""+m)+'"][type="radio"]'),m=0;m<C.length;m++){var T=C[m];if(T!==f&&T.form===f.form){var U=T[Or]||null;if(!U)throw Error(s(90));sx(T,U.value,U.defaultValue,U.defaultValue,U.checked,U.defaultChecked,U.type,U.name)}}for(m=0;m<C.length;m++)T=C[m],T.form===f.form&&RT(T)}break e;case"textarea":kT(f,C.value,C.defaultValue);break e;case"select":m=C.value,m!=null&&ed(f,!!C.multiple,m,!1)}}}var lx=!1;function jT(f,m,C){if(lx)return f(m,C);lx=!0;try{var T=f(m);return T}finally{if(lx=!1,(nd!==null||sd!==null)&&(qg(),nd&&(m=nd,f=sd,sd=nd=null,MT(m),f)))for(m=0;m<f.length;m++)MT(f[m])}}function ip(f,m){var C=f.stateNode;if(C===null)return null;var T=C[Or]||null;if(T===null)return null;C=T[m];e:switch(m){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(T=!T.disabled)||(f=f.type,T=!(f==="button"||f==="input"||f==="select"||f==="textarea")),f=!T;break e;default:f=!1}if(f)return null;if(C&&typeof C!="function")throw Error(s(231,m,typeof C));return C}var va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cx=!1;if(va)try{var op={};Object.defineProperty(op,"passive",{get:function(){cx=!0}}),window.addEventListener("test",op,op),window.removeEventListener("test",op,op)}catch{cx=!1}var gl=null,ux=null,og=null;function BT(){if(og)return og;var f,m=ux,C=m.length,T,U="value"in gl?gl.value:gl.textContent,V=U.length;for(f=0;f<C&&m[f]===U[f];f++);var Z=C-f;for(T=1;
vendor: 11,604 bytes, line 8
8T<=Z&&m[C-T]===U[V-T];T++);return og=U.slice(f,1<T?1-T:void 0)}function ag(f){var m=f.keyCode;return"charCode"in f?(f=f.charCode,f===0&&m===13&&(f=13)):f=m,f===10&&(f=13),32<=f||f===13?f:0}function lg(){return!0}function FT(){return!1}function Pr(f){function m(C,T,U,V,Z){this._reactName=C,this._targetInst=U,this.type=T,this.nativeEvent=V,this.target=Z,this.currentTarget=null;for(var ae in f)f.hasOwnProperty(ae)&&(C=f[ae],this[ae]=C?C(V):V[ae]);return this.isDefaultPrevented=(V.defaultPrevented!=null?V.defaultPrevented:V.returnValue===!1)?lg:FT,this.isPropagationStopped=FT,this}return g(m.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=lg)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=lg)},persist:function(){},isPersistent:lg}),m}var bc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cg=Pr(bc),ap=g({},bc,{view:0,detail:0}),rU=Pr(ap),dx,fx,lp,ug=g({},ap,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hx,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){return"movementX"in f?f.movementX:(f!==lp&&(lp&&f.type==="mousemove"?(dx=f.screenX-lp.screenX,fx=f.screenY-lp.screenY):fx=dx=0,lp=f),dx)},movementY:function(f){return"movementY"in f?f.movementY:fx}}),UT=Pr(ug),iU=g({},ug,{dataTransfer:0}),oU=Pr(iU),aU=g({},ap,{relatedTarget:0}),px=Pr(aU),lU=g({},bc,{animationName:0,elapsedTime:0,pseudoElement:0}),cU=Pr(lU),uU=g({},bc,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),dU=Pr(uU),fU=g({},bc,{data:0}),zT=Pr(fU),pU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hU={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gU(f){var m=this.nativeEvent;return m.getModifierState?m.getModifierState(f):(f=mU[f])?!!m[f]:!1}function hx(){return gU}var AU=g({},ap,{key:function(f){if(f.key){var m=pU[f.key]||f.key;if(m!=="Unidentified")return m}return f.type==="keypress"?(f=ag(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?hU[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hx,charCode:function(f){return f.type==="keypress"?ag(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?ag(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),EU=Pr(AU),xU=g({},ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),QT=Pr(xU),CU=g({},ap,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hx}),yU=Pr(CU),bU=g({},bc,{propertyName:0,elapsedTime:0,pseudoElement:0}),IU=Pr(bU),SU=g({},ug,{deltaX:function(f){return"deltaX"in f?f.deltaX:"wheelDeltaX"in f?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:"wheelDeltaY"in f?-f.wheelDeltaY:"wheelDelta"in f?-f.wheelDelta:0},deltaZ:0,deltaMode:0}),vU=Pr(SU),_U=g({},bc,{newState:0,oldState:0}),TU=Pr(_U),NU=[9,13,27,32],mx=va&&"CompositionEvent"in window,cp=null;va&&"documentMode"in document&&(cp=document.documentMode);var wU=va&&"TextEvent"in window&&!cp,HT=va&&(!mx||cp&&8<cp&&11>=cp),VT=" ",GT=!1;function qT(f,m){switch(f){case"keyup":return NU.indexOf(m.keyCode)!==-1;case"keydown":return m.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function WT(f){return f=f.detail,typeof f=="object"&&"data"in f?f.data:null}var rd=!1;function RU(f,m){switch(f){case"compositionend":return WT(m);case"keypress":return m.which!==32?null:(GT=!0,VT);case"textInput":return f=m.data,f===VT&&GT?null:f;default:return null}}function DU(f,m){if(rd)return f==="compositionend"||!mx&&qT(f,m)?(f=BT(),og=ux=gl=null,rd=!1,f):null;switch(f){case"paste":return null;case"keypress":if(!(m.ctrlKey||m.altKey||m.metaKey)||m.ctrlKey&&m.altKey){if(m.char&&1<m.char.length)return m.char;if(m.which)return String.fromCharCode(m.which)}return null;case"compositionend":return HT&&m.locale!=="ko"?null:m.data;default:return null}}var kU={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function KT(f){var m=f&&f.nodeName&&f.nodeName.toLowerCase();return m==="input"?!!kU[f.type]:m==="textarea"}function $T(f,m,C,T){nd?sd?sd.push(T):sd=[T]:nd=T,m=Zg(m,"onChange"),0<m.length&&(C=new cg("onChange","change",null,C,T),f.push({event:C,listeners:m}))}var up=null,dp=null;function OU(f){D3(f,0)}function dg(f){var m=rp(f);if(RT(m))return f}function YT(f,m){if(f==="change")return m}var XT=!1;if(va){var gx;if(va){var Ax="oninput"in document;if(!Ax){var JT=document.createElement("div");JT.setAttribute("oninput","return;"),Ax=typeof JT.oninput=="function"}gx=Ax}else gx=!1;XT=gx&&(!document.documentMode||9<document.documentMode)}function ZT(){up&&(up.detachEvent("onpropertychange",e5),dp=up=null)}function e5(f){if(f.propertyName==="value"&&dg(dp)){var m=[];$T(m,dp,f,ax(f)),jT(OU,m)}}function PU(f,m,C){f==="focusin"?(ZT(),up=m,dp=C,up.attachEvent("onpropertychange",e5)):f==="focusout"&&ZT()}function LU(f){if(f==="selectionchange"||f==="keyup"||f==="keydown")return dg(dp)}function MU(f,m){if(f==="click")return dg(m)}function jU(f,m){if(f==="input"||f==="change")return dg(m)}function BU(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var ti=typeof Object.is=="function"?Object.is:BU;function fp(f,m){if(ti(f,m))return!0;if(typeof f!="object"||f===null||typeof m!="object"||m===null)return!1;var C=Object.keys(f),T=Object.keys(m);if(C.length!==T.length)return!1;for(T=0;T<C.length;T++){var U=C[T];if(!re.call(m,U)||!ti(f[U],m[U]))return!1}return!0}function t5(f){for(;f&&f.firstChild;)f=f.firstChild;return f}function n5(f,m){var C=t5(f);f=0;for(var T;C;){if(C.nodeType===3){if(T=f+C.textContent.length,f<=m&&T>=m)return{node:C,offset:m-f};f=T}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=t5(C)}}function s5(f,m){return f&&m?f===m?!0:f&&f.nodeType===3?!1:m&&m.nodeType===3?s5(f,m.parentNode):"contains"in f?f.contains(m):f.compareDocumentPosition?!!(f.compareDocumentPosition(m)&16):!1:!1}function r5(f){f=f!=null&&f.ownerDocument!=null&&f.ownerDocument.defaultView!=null?f.ownerDocument.defaultView:window;for(var m=rg(f.document);m instanceof f.HTMLIFrameElement;){try{var C=typeof m.contentWindow.location.href=="string"}catch{C=!1}if(C)f=m.contentWindow;else break;m=rg(f.document)}return m}function Ex(f){var m=f&&f.nodeName&&f.nodeName.toLowerCase();return m&&(m==="input"&&(f.type==="text"||f.type==="search"||f.type==="tel"||f.type==="url"||f.type==="password")||m==="textarea"||f.contentEditable==="true")}var FU=va&&"documentMode"in document&&11>=document.documentMode,id=null,xx=null,pp=null,Cx=!1;function i5(f,m,C){var T=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;Cx||id==null||id!==rg(T)||(T=id,"selectionStart"in T&&Ex(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),pp&&fp(pp,T)||(pp=T,T=Zg(xx,"onSelect"),0<T.length&&(m=new cg("onSelect","select",null,m,C),f.push({event:m,listeners:T}),m.target=id)))}function Ic(f,m){var C={};return C[f.toLowerCase()]=m.toLowerCase(),C["Webkit"+f]="webkit"+m,C["Moz"+f]="moz"+m,C}var od={animationend:Ic("Animation","AnimationEnd"),animationiteration:Ic("Animation","AnimationIteration"),animationstart:Ic("Animation","AnimationStart"),transitionrun:Ic("Transition","TransitionRun"),transitionstart:Ic("Transition","TransitionStart"),transitioncancel:Ic("Transition","TransitionCancel"),transitionend:Ic("Transition","TransitionEnd")},yx={},o5={};va&&(o5=document.createElement("div").style,"AnimationEvent"in window||(delete od.animationend.animation,delete od.animationiteration.animation,delete od.animationstart.animation),"TransitionEvent"in window||delete od.transitionend.transition);function Sc(f){if(yx[f])return yx[f];if(!od[f])return f;var m=od[f],C;for(C in m)if(m.hasOwnProperty(C)&&C in o5)return yx[f]=m[C];return f}var a5=Sc("animationend"),l5=Sc("animationiteration"),c5=Sc("animationstart"),UU=Sc("transitionrun"),zU=Sc("transitionstart"),QU=Sc("transitioncancel"),u5=Sc("transitionend"),d5=new Map,bx="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");bx.push("scrollEnd");function to(f,m){d5.set(f,m),yc(m,[f])}var fg=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(m))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},wi=[],ad=0,Ix=0;function pg(){for(var f=ad,m=Ix=ad=0;m<f;){var C=wi[m];wi[m++]=null;var T=wi[m];wi[m++]=null;var U=wi[m];wi[m++]=null;var V=wi[m];if(wi[m++]=null,T!==null&&U!==null){var Z=T.pending;Z===null?U.next=U:(U.next=Z.next,Z.next=U),T.pending=U}V!==0&&f5(C,U,V)}}function hg(f,m,C,T){wi[ad++]=f,wi[ad++]=m,wi[ad++]=C,wi[ad++]=T,Ix|=T,f.lanes|=T,f=f.alternate,f!==null&&(f.lanes|=T)}function Sx(f,m,C,T){return hg(f,m,C,T),mg(f)}function vc(f,m){return hg(f,null,null,m),mg(f)}function f5(f,m,C){f.lanes|=C;var T=f.alternate;T!==null&&(T.lanes|=C);for(var U=!1,V=f.return;V!==null;)V.childLanes|=C,T=V.alternate,T!==null&&(T.childLanes|=C),V.tag===22&&(f=V.stateNode,f===null||f._visibility&1||(U=!0)),f=V,V=V.return;return f.tag===3?(V=f.stateNode,U&&m!==null&&(U=31-ft(C),f=V.hiddenUpdates,T=f[U],T===null?f[U]=[m]:T.push(m),m.lane=C|536870912),V):null}function mg(f){if(50<Lp)throw Lp=0,OC=null,Error(s(185));for(var m=f.return;m!==null;)f=m,m=f.return;return f.tag===3?f.stateNode:null}var ld={};function HU(f,m,C,T){this.tag=f,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 12,961 bytes, line 8
8ype=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(f,m,C,T){return new HU(f,m,C,T)}function vx(f){return f=f.prototype,!(!f||!f.isReactComponent)}function _a(f,m){var C=f.alternate;return C===null?(C=ni(f.tag,m,f.key,f.mode),C.elementType=f.elementType,C.type=f.type,C.stateNode=f.stateNode,C.alternate=f,f.alternate=C):(C.pendingProps=m,C.type=f.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=f.flags&65011712,C.childLanes=f.childLanes,C.lanes=f.lanes,C.child=f.child,C.memoizedProps=f.memoizedProps,C.memoizedState=f.memoizedState,C.updateQueue=f.updateQueue,m=f.dependencies,C.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},C.sibling=f.sibling,C.index=f.index,C.ref=f.ref,C.refCleanup=f.refCleanup,C}function p5(f,m){f.flags&=65011714;var C=f.alternate;return C===null?(f.childLanes=0,f.lanes=m,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=C.childLanes,f.lanes=C.lanes,f.child=C.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=C.memoizedProps,f.memoizedState=C.memoizedState,f.updateQueue=C.updateQueue,f.type=C.type,m=C.dependencies,f.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext}),f}function gg(f,m,C,T,U,V){var Z=0;if(T=f,typeof f=="function")vx(f)&&(Z=1);else if(typeof f=="string")Z=Kz(f,C,$.current)?26:f==="html"||f==="head"||f==="body"?27:5;else e:switch(f){case k:return f=ni(31,C,m,U),f.elementType=k,f.lanes=V,f;case y:return _c(C.children,U,V,m);case I:Z=8,U|=24;break;case v:return f=ni(12,C,m,U|2),f.elementType=v,f.lanes=V,f;case _:return f=ni(13,C,m,U),f.elementType=_,f.lanes=V,f;case N:return f=ni(19,C,m,U),f.elementType=N,f.lanes=V,f;default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case b:Z=10;break e;case S:Z=9;break e;case w:Z=11;break e;case R:Z=14;break e;case D:Z=16,T=null;break e}Z=29,C=Error(s(130,f===null?"null":typeof f,"")),T=null}return m=ni(Z,C,m,U),m.elementType=f,m.type=T,m.lanes=V,m}function _c(f,m,C,T){return f=ni(7,f,T,m),f.lanes=C,f}function _x(f,m,C){return f=ni(6,f,null,m),f.lanes=C,f}function h5(f){var m=ni(18,null,null,0);return m.stateNode=f,m}function Tx(f,m,C){return m=ni(4,f.children!==null?f.children:[],f.key,m),m.lanes=C,m.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},m}var m5=new WeakMap;function Ri(f,m){if(typeof f=="object"&&f!==null){var C=m5.get(f);return C!==void 0?C:(m={value:f,source:m,stack:xe(m)},m5.set(f,m),m)}return{value:f,source:m,stack:xe(m)}}var cd=[],ud=0,Ag=null,hp=0,Di=[],ki=0,Al=null,Oo=1,Po="";function Ta(f,m){cd[ud++]=hp,cd[ud++]=Ag,Ag=f,hp=m}function g5(f,m,C){Di[ki++]=Oo,Di[ki++]=Po,Di[ki++]=Al,Al=f;var T=Oo;f=Po;var U=32-ft(T)-1;T&=~(1<<U),C+=1;var V=32-ft(m)+U;if(30<V){var Z=U-U%5;V=(T&(1<<Z)-1).toString(32),T>>=Z,U-=Z,Oo=1<<32-ft(m)+U|C<<U|T,Po=V+f}else Oo=1<<V|C<<U|T,Po=f}function Nx(f){f.return!==null&&(Ta(f,1),g5(f,1,0))}function wx(f){for(;f===Ag;)Ag=cd[--ud],cd[ud]=null,hp=cd[--ud],cd[ud]=null;for(;f===Al;)Al=Di[--ki],Di[ki]=null,Po=Di[--ki],Di[ki]=null,Oo=Di[--ki],Di[ki]=null}function A5(f,m){Di[ki++]=Oo,Di[ki++]=Po,Di[ki++]=Al,Oo=m.id,Po=m.overflow,Al=f}var $s=null,Mn=null,Qt=!1,El=null,Oi=!1,Rx=Error(s(519));function xl(f){var m=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mp(Ri(m,f)),Rx}function E5(f){var m=f.stateNode,C=f.type,T=f.memoizedProps;switch(m[Ks]=f,m[Or]=T,C){case"dialog":Mt("cancel",m),Mt("close",m);break;case"iframe":case"object":case"embed":Mt("load",m);break;case"video":case"audio":for(C=0;C<jp.length;C++)Mt(jp[C],m);break;case"source":Mt("error",m);break;case"img":case"image":case"link":Mt("error",m),Mt("load",m);break;case"details":Mt("toggle",m);break;case"input":Mt("invalid",m),DT(m,T.value,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name,!0);break;case"select":Mt("invalid",m);break;case"textarea":Mt("invalid",m),OT(m,T.value,T.defaultValue,T.children)}C=T.children,typeof C!="string"&&typeof C!="number"&&typeof C!="bigint"||m.textContent===""+C||T.suppressHydrationWarning===!0||L3(m.textContent,C)?(T.popover!=null&&(Mt("beforetoggle",m),Mt("toggle",m)),T.onScroll!=null&&Mt("scroll",m),T.onScrollEnd!=null&&Mt("scrollend",m),T.onClick!=null&&(m.onclick=Sa),m=!0):m=!1,m||xl(f,!0)}function x5(f){for($s=f.return;$s;)switch($s.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:$s=$s.return}}function dd(f){if(f!==$s)return!1;if(!Qt)return x5(f),Qt=!0,!1;var m=f.tag,C;if((C=m!==3&&m!==27)&&((C=m===5)&&(C=f.type,C=!(C!=="form"&&C!=="button")||KC(f.type,f.memoizedProps)),C=!C),C&&Mn&&xl(f),x5(f),m===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));Mn=V3(f)}else if(m===31){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));Mn=V3(f)}else m===27?(m=Mn,Ol(f.type)?(f=ZC,ZC=null,Mn=f):Mn=m):Mn=$s?Li(f.stateNode.nextSibling):null;return!0}function Tc(){Mn=$s=null,Qt=!1}function Dx(){var f=El;return f!==null&&(Br===null?Br=f:Br.push.apply(Br,f),El=null),f}function mp(f){El===null?El=[f]:El.push(f)}var kx=j(null),Nc=null,Na=null;function Cl(f,m,C){G(kx,m._currentValue),m._currentValue=C}function wa(f){f._currentValue=kx.current,q(kx)}function Ox(f,m,C){for(;f!==null;){var T=f.alternate;if((f.childLanes&m)!==m?(f.childLanes|=m,T!==null&&(T.childLanes|=m)):T!==null&&(T.childLanes&m)!==m&&(T.childLanes|=m),f===C)break;f=f.return}}function Px(f,m,C,T){var U=f.child;for(U!==null&&(U.return=f);U!==null;){var V=U.dependencies;if(V!==null){var Z=U.child;V=V.firstContext;e:for(;V!==null;){var ae=V;V=U;for(var Ae=0;Ae<m.length;Ae++)if(ae.context===m[Ae]){V.lanes|=C,ae=V.alternate,ae!==null&&(ae.lanes|=C),Ox(V.return,C,f),T||(Z=null);break e}V=ae.next}}else if(U.tag===18){if(Z=U.return,Z===null)throw Error(s(341));Z.lanes|=C,V=Z.alternate,V!==null&&(V.lanes|=C),Ox(Z,C,f),Z=null}else Z=U.child;if(Z!==null)Z.return=U;else for(Z=U;Z!==null;){if(Z===f){Z=null;break}if(U=Z.sibling,U!==null){U.return=Z.return,Z=U;break}Z=Z.return}U=Z}}function fd(f,m,C,T){f=null;for(var U=m,V=!1;U!==null;){if(!V){if((U.flags&524288)!==0)V=!0;else if((U.flags&262144)!==0)break}if(U.tag===10){var Z=U.alternate;if(Z===null)throw Error(s(387));if(Z=Z.memoizedProps,Z!==null){var ae=U.type;ti(U.pendingProps.value,Z.value)||(f!==null?f.push(ae):f=[ae])}}else if(U===X.current){if(Z=U.alternate,Z===null)throw Error(s(387));Z.memoizedState.memoizedState!==U.memoizedState.memoizedState&&(f!==null?f.push(Qp):f=[Qp])}U=U.return}f!==null&&Px(m,f,C,T),m.flags|=262144}function Eg(f){for(f=f.firstContext;f!==null;){if(!ti(f.context._currentValue,f.memoizedValue))return!0;f=f.next}return!1}function wc(f){Nc=f,Na=null,f=f.dependencies,f!==null&&(f.firstContext=null)}function Ys(f){return C5(Nc,f)}function xg(f,m){return Nc===null&&wc(f),C5(f,m)}function C5(f,m){var C=m._currentValue;if(m={context:m,memoizedValue:C,next:null},Na===null){if(f===null)throw Error(s(308));Na=m,f.dependencies={lanes:0,firstContext:m},f.flags|=524288}else Na=Na.next=m;return C}var VU=typeof AbortController<"u"?AbortController:function(){var f=[],m=this.signal={aborted:!1,addEventListener:function(C,T){f.push(T)}};this.abort=function(){m.aborted=!0,f.forEach(function(C){return C()})}},GU=e.unstable_scheduleCallback,qU=e.unstable_NormalPriority,gs={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lx(){return{controller:new VU,data:new Map,refCount:0}}function gp(f){f.refCount--,f.refCount===0&&GU(qU,function(){f.controller.abort()})}var Ap=null,Mx=0,pd=0,hd=null;function WU(f,m){if(Ap===null){var C=Ap=[];Mx=0,pd=FC(),hd={status:"pending",value:void 0,then:function(T){C.push(T)}}}return Mx++,m.then(y5,y5),m}function y5(){if(--Mx===0&&Ap!==null){hd!==null&&(hd.status="fulfilled");var f=Ap;Ap=null,pd=0,hd=null;for(var m=0;m<f.length;m++)(0,f[m])()}}function KU(f,m){var C=[],T={status:"pending",value:null,reason:null,then:function(U){C.push(U)}};return f.then(function(){T.status="fulfilled",T.value=m;for(var U=0;U<C.length;U++)(0,C[U])(m)},function(U){for(T.status="rejected",T.reason=U,U=0;U<C.length;U++)(0,C[U])(void 0)}),T}var b5=Q.S;Q.S=function(f,m){i3=se(),typeof m=="object"&&m!==null&&typeof m.then=="function"&&WU(f,m),b5!==null&&b5(f,m)};var Rc=j(null);function jx(){var f=Rc.current;return f!==null?f:Tn.pooledCache}function Cg(f,m){m===null?G(Rc,Rc.current):G(Rc,m.pool)}function I5(){var f=jx();return f===null?null:{parent:gs._currentValue,pool:f}}var md=Error(s(460)),Bx=Error(s(474)),yg=Error(s(542)),bg={then:function(){}};function S5(f){return f=f.status,f==="fulfilled"||f==="rejected"}function v5(f,m,C){switch(C=f[C],C===void 0?f.push(m):C!==m&&(m.then(Sa,Sa),m=C),m.status){case"fulfilled":return m.value;case"rejected":throw f=m.reason,T5(f),f;default:if(typeof m.status=="string")m.then(Sa,Sa);else{if(f=Tn,f!==null&&100<f.shellSuspendCounter)throw Error(s(482));f=m,f.status="pending",f.then(function(T){if(m.status==="pending"){var U=m;U.status="fulfilled",U.value=T}},function(T){if(m.status==="pending"){var U=m;U.status="rejected",U.reason=T}})}switch(m.status){case"fulfilled":return m.value;case"rejected":throw f=m.reason,T5(f),f}throw kc=m,md}}function Dc(f){try{var m=f._init;return m(f._payload)}catch(C){throw C!==null&&typeof C=="object"&&typeof C.then=="function"?(kc=C,md):C}}var kc=null;function _5(){if(kc===null)throw Error(s(459));var f=kc;return kc=null,f}function T5(f){if(f===md||f===yg)throw Error(s(483))}var gd=null,Ep=0;function Ig(f){var m=Ep;return Ep+=1,gd===null&&(gd=[]),v5(gd,f,m)}function xp(f,m){m=m.props.ref,f.ref=m!==void 0?m:null}function Sg(f,m){throw m.$$typeof===A?Error(s(525)):(f=Object.prototype.toString.call(m),Error(s(31,f==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":f)))}function N5(f){function m(be,Ce){if(f){var Te=be.deletions;Te===null?(be.deletions=[Ce],be.flags|=16):Te.push(Ce)}}function C(be,Ce){if(!f)return null;for(;Ce!==null;)m(be,Ce),Ce=Ce.sibling;return null}function T(be){for(var Ce=new Map;be!==null;)be.key!==null?Ce.set(be.key,be):Ce.set(be.index,be),be=be.sibling;return Ce}function U(be,Ce){return be=_a(be,Ce),be.index=0,be.sibling=null,be}function V(be,Ce,Te){return be.index=Te,f?(Te=be.alternate,Te!==null?(Te=Te.index,Te<Ce?(be.flags|=67108866,Ce):Te):(be.flags|=67108866,Ce)):(be.flags|=1048576,Ce)}function Z(be){return f&&be.alternate===null&&(be.flags|=67108866),be}function ae(be,Ce,Te,ze){return Ce===null||Ce.tag!==6?(Ce=_x(Te,be.mode,ze),Ce.return=be,Ce):(Ce=U(Ce,Te),Ce.return=be,Ce)}function Ae(be,Ce,Te,ze){var gt=Te.type;return gt===y?je(be,Ce,Te.props.children,ze,Te.key):Ce!==null&&(Ce.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===D&&Dc(gt)===Ce.type)?(Ce=U(Ce,Te.props),xp(Ce,Te),Ce.return=be,Ce):(Ce=gg(Te.type,Te.key,Te.props,null,be.mode,ze),xp(Ce,Te),Ce.return=be,Ce)}function we(be,Ce,Te,ze){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==Te.containerInfo||Ce.stateNode.implementation!==Te.implementation?(Ce=Tx(Te,be.mode,ze),Ce.return=be,Ce):(Ce=U(Ce,Te.children||[]),Ce.return=be,Ce)}function je(be,Ce,Te,ze,gt){return Ce===null||Ce.tag!==7?(Ce=_c(Te,be.mode,ze,gt),Ce.return=be,Ce):(Ce=U(Ce,Te),Ce.return=be,Ce)}function Qe(be,Ce,Te){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return Ce=_x(""+Ce,be.mode,Te),Ce.return=be,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case E:return Te=gg(Ce.type,Ce.key,Ce.props,null,be.mode,Te),xp(Te,Ce),Te.return=be,Te;case x:return Ce=Tx(Ce,be.mode,Te),Ce.return=be,Ce;case D:return Ce=Dc(Ce),Qe(be,Ce,Te)}if(z(Ce)||P(Ce))return Ce=_c(Ce,be.mode,Te,null),Ce.return=be,Ce;if(typeof Ce.then=="function")return Qe(be,Ig(Ce),Te);if(Ce.$$typeof===b)return Qe(be,xg(be,Ce),Te);Sg(be,Ce)}return null}function De(be,Ce,Te,ze){var gt=Ce!==null?Ce.key:null;if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return gt!==null?null:ae(be,Ce,""+Te,ze);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case E:return Te.key===gt?Ae(be,Ce,Te,ze):null;case x:return Te.key===gt?we(be,Ce,Te,ze):null;case D:return Te=Dc(Te),De(be,Ce,Te,ze)}if(z(Te)||P(Te))return gt!==null?null:je(be,Ce,Te,ze,null);if(typeof Te.then=="function")return De(be,Ce,Ig(Te),ze);if(Te.$$typeof===b)return De(be,Ce,xg(be,Te),ze);Sg(be,Te)}return null}function ke(be,Ce,Te,ze,gt){if(typeof ze=="string"&&ze!==""||typeof ze=="number"||typeof ze=="bigint")return be=be.get(Te)||null,ae(Ce,be,""+ze,gt);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case E:return be=be.get(ze.key===null?Te:ze.key)||null,Ae(Ce,be,ze,gt);case x:return be=be.get(ze.key===null?Te:ze.key)||null,we(Ce,be,ze,gt);case D:return ze=Dc(ze),ke(be,Ce,Te,ze,gt)}
vendor: 4,268 bytes, line 8
8if(z(ze)||P(ze))return be=be.get(Te)||null,je(Ce,be,ze,gt,null);if(typeof ze.then=="function")return ke(be,Ce,Te,Ig(ze),gt);if(ze.$$typeof===b)return ke(be,Ce,Te,xg(Ce,ze),gt);Sg(Ce,ze)}return null}function ot(be,Ce,Te,ze){for(var gt=null,Jt=null,lt=Ce,Dt=Ce=0,Ft=null;lt!==null&&Dt<Te.length;Dt++){lt.index>Dt?(Ft=lt,lt=null):Ft=lt.sibling;var Zt=De(be,lt,Te[Dt],ze);if(Zt===null){lt===null&&(lt=Ft);break}f&&lt&&Zt.alternate===null&&m(be,lt),Ce=V(Zt,Ce,Dt),Jt===null?gt=Zt:Jt.sibling=Zt,Jt=Zt,lt=Ft}if(Dt===Te.length)return C(be,lt),Qt&&Ta(be,Dt),gt;if(lt===null){for(;Dt<Te.length;Dt++)lt=Qe(be,Te[Dt],ze),lt!==null&&(Ce=V(lt,Ce,Dt),Jt===null?gt=lt:Jt.sibling=lt,Jt=lt);return Qt&&Ta(be,Dt),gt}for(lt=T(lt);Dt<Te.length;Dt++)Ft=ke(lt,be,Dt,Te[Dt],ze),Ft!==null&&(f&&Ft.alternate!==null&&lt.delete(Ft.key===null?Dt:Ft.key),Ce=V(Ft,Ce,Dt),Jt===null?gt=Ft:Jt.sibling=Ft,Jt=Ft);return f&&lt.forEach(function(Bl){return m(be,Bl)}),Qt&&Ta(be,Dt),gt}function yt(be,Ce,Te,ze){if(Te==null)throw Error(s(151));for(var gt=null,Jt=null,lt=Ce,Dt=Ce=0,Ft=null,Zt=Te.next();lt!==null&&!Zt.done;Dt++,Zt=Te.next()){lt.index>Dt?(Ft=lt,lt=null):Ft=lt.sibling;var Bl=De(be,lt,Zt.value,ze);if(Bl===null){lt===null&&(lt=Ft);break}f&&lt&&Bl.alternate===null&&m(be,lt),Ce=V(Bl,Ce,Dt),Jt===null?gt=Bl:Jt.sibling=Bl,Jt=Bl,lt=Ft}if(Zt.done)return C(be,lt),Qt&&Ta(be,Dt),gt;if(lt===null){for(;!Zt.done;Dt++,Zt=Te.next())Zt=Qe(be,Zt.value,ze),Zt!==null&&(Ce=V(Zt,Ce,Dt),Jt===null?gt=Zt:Jt.sibling=Zt,Jt=Zt);return Qt&&Ta(be,Dt),gt}for(lt=T(lt);!Zt.done;Dt++,Zt=Te.next())Zt=ke(lt,be,Dt,Zt.value,ze),Zt!==null&&(f&&Zt.alternate!==null&&lt.delete(Zt.key===null?Dt:Zt.key),Ce=V(Zt,Ce,Dt),Jt===null?gt=Zt:Jt.sibling=Zt,Jt=Zt);return f&&lt.forEach(function(iQ){return m(be,iQ)}),Qt&&Ta(be,Dt),gt}function In(be,Ce,Te,ze){if(typeof Te=="object"&&Te!==null&&Te.type===y&&Te.key===null&&(Te=Te.props.children),typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case E:e:{for(var gt=Te.key;Ce!==null;){if(Ce.key===gt){if(gt=Te.type,gt===y){if(Ce.tag===7){C(be,Ce.sibling),ze=U(Ce,Te.props.children),ze.return=be,be=ze;break e}}else if(Ce.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===D&&Dc(gt)===Ce.type){C(be,Ce.sibling),ze=U(Ce,Te.props),xp(ze,Te),ze.return=be,be=ze;break e}C(be,Ce);break}else m(be,Ce);Ce=Ce.sibling}Te.type===y?(ze=_c(Te.props.children,be.mode,ze,Te.key),ze.return=be,be=ze):(ze=gg(Te.type,Te.key,Te.props,null,be.mode,ze),xp(ze,Te),ze.return=be,be=ze)}return Z(be);case x:e:{for(gt=Te.key;Ce!==null;){if(Ce.key===gt)if(Ce.tag===4&&Ce.stateNode.containerInfo===Te.containerInfo&&Ce.stateNode.implementation===Te.implementation){C(be,Ce.sibling),ze=U(Ce,Te.children||[]),ze.return=be,be=ze;break e}else{C(be,Ce);break}else m(be,Ce);Ce=Ce.sibling}ze=Tx(Te,be.mode,ze),ze.return=be,be=ze}return Z(be);case D:return Te=Dc(Te),In(be,Ce,Te,ze)}if(z(Te))return ot(be,Ce,Te,ze);if(P(Te)){if(gt=P(Te),typeof gt!="function")throw Error(s(150));return Te=gt.call(Te),yt(be,Ce,Te,ze)}if(typeof Te.then=="function")return In(be,Ce,Ig(Te),ze);if(Te.$$typeof===b)return In(be,Ce,xg(be,Te),ze);Sg(be,Te)}return typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint"?(Te=""+Te,Ce!==null&&Ce.tag===6?(C(be,Ce.sibling),ze=U(Ce,Te),ze.return=be,be=ze):(C(be,Ce),ze=_x(Te,be.mode,ze),ze.return=be,be=ze),Z(be)):C(be,Ce)}return function(be,Ce,Te,ze){try{Ep=0;var gt=In(be,Ce,Te,ze);return gd=null,gt}catch(lt){if(lt===md||lt===yg)throw lt;var Jt=ni(29,lt,null,be.mode);return Jt.lanes=ze,Jt.return=be,Jt}}}var Oc=N5(!0),w5=N5(!1),yl=!1;function Fx(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ux(f,m){f=f.updateQueue,m.updateQueue===f&&(m.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,callbacks:null})}function bl(f){return{lane:f,tag:0,payload:null,callback:null,next:null}}function Il(f,m,C){var T=f.updateQueue;if(T===null)return null;if(T=T.shared,(on&2)!==0){var U=T.pending;return U===null?m.next=m:(m.next=U.next,U.next=m),T.pending=m,m=mg(f),f5(f,null,C),m}return hg(f,T,m,C),mg(f)}function Cp(f,m,C){if(m=m.updateQueue,m!==null&&(m=m.shared,(C&4194048)!==0)){var T=m.lanes;
vendor: 4,576 bytes, line 8
8T&=f.pendingLanes,C|=T,m.lanes=C,CT(f,C)}}function zx(f,m){var C=f.updateQueue,T=f.alternate;if(T!==null&&(T=T.updateQueue,C===T)){var U=null,V=null;if(C=C.firstBaseUpdate,C!==null){do{var Z={lane:C.lane,tag:C.tag,payload:C.payload,callback:null,next:null};V===null?U=V=Z:V=V.next=Z,C=C.next}while(C!==null);V===null?U=V=m:V=V.next=m}else U=V=m;C={baseState:T.baseState,firstBaseUpdate:U,lastBaseUpdate:V,shared:T.shared,callbacks:T.callbacks},f.updateQueue=C;return}f=C.lastBaseUpdate,f===null?C.firstBaseUpdate=m:f.next=m,C.lastBaseUpdate=m}var Qx=!1;function yp(){if(Qx){var f=hd;if(f!==null)throw f}}function bp(f,m,C,T){Qx=!1;var U=f.updateQueue;yl=!1;var V=U.firstBaseUpdate,Z=U.lastBaseUpdate,ae=U.shared.pending;if(ae!==null){U.shared.pending=null;var Ae=ae,we=Ae.next;Ae.next=null,Z===null?V=we:Z.next=we,Z=Ae;var je=f.alternate;je!==null&&(je=je.updateQueue,ae=je.lastBaseUpdate,ae!==Z&&(ae===null?je.firstBaseUpdate=we:ae.next=we,je.lastBaseUpdate=Ae))}if(V!==null){var Qe=U.baseState;Z=0,je=we=Ae=null,ae=V;do{var De=ae.lane&-536870913,ke=De!==ae.lane;if(ke?(Bt&De)===De:(T&De)===De){De!==0&&De===pd&&(Qx=!0),je!==null&&(je=je.next={lane:0,tag:ae.tag,payload:ae.payload,callback:null,next:null});e:{var ot=f,yt=ae;De=m;var In=C;switch(yt.tag){case 1:if(ot=yt.payload,typeof ot=="function"){Qe=ot.call(In,Qe,De);break e}Qe=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=yt.payload,De=typeof ot=="function"?ot.call(In,Qe,De):ot,De==null)break e;Qe=g({},Qe,De);break e;case 2:yl=!0}}De=ae.callback,De!==null&&(f.flags|=64,ke&&(f.flags|=8192),ke=U.callbacks,ke===null?U.callbacks=[De]:ke.push(De))}else ke={lane:De,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},je===null?(we=je=ke,Ae=Qe):je=je.next=ke,Z|=De;if(ae=ae.next,ae===null){if(ae=U.shared.pending,ae===null)break;ke=ae,ae=ke.next,ke.next=null,U.lastBaseUpdate=ke,U.shared.pending=null}}while(!0);je===null&&(Ae=Qe),U.baseState=Ae,U.firstBaseUpdate=we,U.lastBaseUpdate=je,V===null&&(U.shared.lanes=0),Nl|=Z,f.lanes=Z,f.memoizedState=Qe}}function R5(f,m){if(typeof f!="function")throw Error(s(191,f));f.call(m)}function D5(f,m){var C=f.callbacks;if(C!==null)for(f.callbacks=null,f=0;f<C.length;f++)R5(C[f],m)}var Ad=j(null),vg=j(0);function k5(f,m){f=Ba,G(vg,f),G(Ad,m),Ba=f|m.baseLanes}function Hx(){G(vg,Ba),G(Ad,Ad.current)}function Vx(){Ba=vg.current,q(Ad),q(vg)}var si=j(null),Pi=null;function Sl(f){var m=f.alternate;G(cs,cs.current&1),G(si,f),Pi===null&&(m===null||Ad.current!==null||m.memoizedState!==null)&&(Pi=f)}function Gx(f){G(cs,cs.current),G(si,f),Pi===null&&(Pi=f)}function O5(f){f.tag===22?(G(cs,cs.current),G(si,f),Pi===null&&(Pi=f)):vl()}function vl(){G(cs,cs.current),G(si,si.current)}function ri(f){q(si),Pi===f&&(Pi=null),q(cs)}var cs=j(0);function _g(f){for(var m=f;m!==null;){if(m.tag===13){var C=m.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||XC(C)||JC(C)))return m}else if(m.tag===19&&(m.memoizedProps.revealOrder==="forwards"||m.memoizedProps.revealOrder==="backwards"||m.memoizedProps.revealOrder==="unstable_legacy-backwards"||m.memoizedProps.revealOrder==="together")){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===f)break;for(;m.sibling===null;){if(m.return===null||m.return===f)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var Ra=0,Rt=null,yn=null,As=null,Tg=!1,Ed=!1,Pc=!1,Ng=0,Ip=0,xd=null,$U=0;function Jn(){throw Error(s(321))}function qx(f,m){if(m===null)return!1;for(var C=0;C<m.length&&C<f.length;C++)if(!ti(f[C],m[C]))return!1;return!0}function Wx(f,m,C,T,U,V){return Ra=V,Rt=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Q.H=f===null||f.memoizedState===null?gN:lC,Pc=!1,V=C(T,U),Pc=!1,Ed&&(V=L5(m,C,T,U)),P5(f),V}function P5(f){Q.H=_p;var m=yn!==null&&yn.next!==null;if(Ra=0,As=yn=Rt=null,Tg=!1,Ip=0,xd=null,m)throw Error(s(300));f===null||Es||(f=f.dependencies,f!==null&&Eg(f)&&(Es=!0))}function L5(f,m,C,T){Rt=f;var U=0;do{if(Ed&&(xd=null),Ip=0,Ed=!1,25<=U)throw Error(s(301));if(U+=1,As=yn=null,f.updateQueue!=null){var V=f.updateQueue;V.lastEffect=null,V.events=null,V.stores=null,V.memoCache!=null&&(V.memoCache.index=0)}Q.H=AN,V=m(C,T)}while(Ed);return V}function YU(){var f=Q.H,m=f.useState()[0];return m=typeof m.then=="function"?Sp(m):m,f=f.useState()[0],(yn!==null?yn.memoizedState:null)!==f&&(Rt.flags|=1024),m}function Kx(){var f=Ng!==0;return Ng=0,f}function $x(f,m,C){m.updateQueue=f.updateQueue,m.flags&=-2053,f.lanes&=~C}function Yx(f){if(Tg){for(f=f.memoizedState;f!==null;){var m=f.queue;m!==null&&(m.pending=null),f=f.next}Tg=!1}
vendor: 4,628 bytes, line 8
8Ra=0,As=yn=Rt=null,Ed=!1,Ip=Ng=0,xd=null}function Cr(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return As===null?Rt.memoizedState=As=f:As=As.next=f,As}function us(){if(yn===null){var f=Rt.alternate;f=f!==null?f.memoizedState:null}else f=yn.next;var m=As===null?Rt.memoizedState:As.next;if(m!==null)As=m,yn=f;else{if(f===null)throw Rt.alternate===null?Error(s(467)):Error(s(310));yn=f,f={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},As===null?Rt.memoizedState=As=f:As=As.next=f}return As}function wg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sp(f){var m=Ip;return Ip+=1,xd===null&&(xd=[]),f=v5(xd,f,m),m=Rt,(As===null?m.memoizedState:As.next)===null&&(m=m.alternate,Q.H=m===null||m.memoizedState===null?gN:lC),f}function Rg(f){if(f!==null&&typeof f=="object"){if(typeof f.then=="function")return Sp(f);if(f.$$typeof===b)return Ys(f)}throw Error(s(438,String(f)))}function Xx(f){var m=null,C=Rt.updateQueue;if(C!==null&&(m=C.memoCache),m==null){var T=Rt.alternate;T!==null&&(T=T.updateQueue,T!==null&&(T=T.memoCache,T!=null&&(m={data:T.data.map(function(U){return U.slice()}),index:0})))}if(m==null&&(m={data:[],index:0}),C===null&&(C=wg(),Rt.updateQueue=C),C.memoCache=m,C=m.data[m.index],C===void 0)for(C=m.data[m.index]=Array(f),T=0;T<f;T++)C[T]=L;return m.index++,C}function Da(f,m){return typeof m=="function"?m(f):m}function Dg(f){var m=us();return Jx(m,yn,f)}function Jx(f,m,C){var T=f.queue;if(T===null)throw Error(s(311));T.lastRenderedReducer=C;var U=f.baseQueue,V=T.pending;if(V!==null){if(U!==null){var Z=U.next;U.next=V.next,V.next=Z}m.baseQueue=U=V,T.pending=null}if(V=f.baseState,U===null)f.memoizedState=V;else{m=U.next;var ae=Z=null,Ae=null,we=m,je=!1;do{var Qe=we.lane&-536870913;if(Qe!==we.lane?(Bt&Qe)===Qe:(Ra&Qe)===Qe){var De=we.revertLane;if(De===0)Ae!==null&&(Ae=Ae.next={lane:0,revertLane:0,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null}),Qe===pd&&(je=!0);else if((Ra&De)===De){we=we.next,De===pd&&(je=!0);continue}else Qe={lane:0,revertLane:we.revertLane,gesture:null,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},Ae===null?(ae=Ae=Qe,Z=V):Ae=Ae.next=Qe,Rt.lanes|=De,Nl|=De;Qe=we.action,Pc&&C(V,Qe),V=we.hasEagerState?we.eagerState:C(V,Qe)}else De={lane:Qe,revertLane:we.revertLane,gesture:we.gesture,action:we.action,hasEagerState:we.hasEagerState,eagerState:we.eagerState,next:null},Ae===null?(ae=Ae=De,Z=V):Ae=Ae.next=De,Rt.lanes|=Qe,Nl|=Qe;we=we.next}while(we!==null&&we!==m);if(Ae===null?Z=V:Ae.next=ae,!ti(V,f.memoizedState)&&(Es=!0,je&&(C=hd,C!==null)))throw C;f.memoizedState=V,f.baseState=Z,f.baseQueue=Ae,T.lastRenderedState=V}return U===null&&(T.lanes=0),[f.memoizedState,T.dispatch]}function Zx(f){var m=us(),C=m.queue;if(C===null)throw Error(s(311));C.lastRenderedReducer=f;var T=C.dispatch,U=C.pending,V=m.memoizedState;if(U!==null){C.pending=null;var Z=U=U.next;do V=f(V,Z.action),Z=Z.next;while(Z!==U);ti(V,m.memoizedState)||(Es=!0),m.memoizedState=V,m.baseQueue===null&&(m.baseState=V),C.lastRenderedState=V}return[V,T]}function M5(f,m,C){var T=Rt,U=us(),V=Qt;if(V){if(C===void 0)throw Error(s(407));C=C()}else C=m();var Z=!ti((yn||U).memoizedState,C);if(Z&&(U.memoizedState=C,Es=!0),U=U.queue,nC(F5.bind(null,T,U,f),[f]),U.getSnapshot!==m||Z||As!==null&&As.memoizedState.tag&1){if(T.flags|=2048,Cd(9,{destroy:void 0},B5.bind(null,T,U,C,m),null),Tn===null)throw Error(s(349));V||(Ra&127)!==0||j5(T,m,C)}return C}function j5(f,m,C){f.flags|=16384,f={getSnapshot:m,value:C},m=Rt.updateQueue,m===null?(m=wg(),Rt.updateQueue=m,m.stores=[f]):(C=m.stores,C===null?m.stores=[f]:C.push(f))}function B5(f,m,C,T){m.value=C,m.getSnapshot=T,U5(m)&&z5(f)}function F5(f,m,C){return C(function(){U5(m)&&z5(f)})}function U5(f){var m=f.getSnapshot;f=f.value;try{var C=m();return!ti(f,C)}catch{return!0}}function z5(f){var m=vc(f,2);m!==null&&Fr(m,f,2)}function eC(f){var m=Cr();if(typeof f=="function"){var C=f;if(f=C(),Pc){Gt(!0);try{C()}finally{Gt(!1)}}}return m.memoizedState=m.baseState=f,m.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:f},m}function Q5(f,m,C,T){return f.baseState=C,Jx(f,yn,typeof T=="function"?T:Da)}function XU(f,m,C,T,U){if(Pg(f))throw Error(s(485));if(f=m.action,f!==null){var V={payload:U,action:f,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Z){V.listeners.push(Z)}};Q.T!==null?C(!0):V.isTransition=!1,T(V),C=m.pending,C===null?(V.next=m.pending=V,H5(m,V)):(V.next=C.next,m.pen
vendor: 6,298 bytes, line 8
8ding=C.next=V)}}function H5(f,m){var C=m.action,T=m.payload,U=f.state;if(m.isTransition){var V=Q.T,Z={};Q.T=Z;try{var ae=C(U,T),Ae=Q.S;Ae!==null&&Ae(Z,ae),V5(f,m,ae)}catch(we){tC(f,m,we)}finally{V!==null&&Z.types!==null&&(V.types=Z.types),Q.T=V}}else try{V=C(U,T),V5(f,m,V)}catch(we){tC(f,m,we)}}function V5(f,m,C){C!==null&&typeof C=="object"&&typeof C.then=="function"?C.then(function(T){G5(f,m,T)},function(T){return tC(f,m,T)}):G5(f,m,C)}function G5(f,m,C){m.status="fulfilled",m.value=C,q5(m),f.state=C,m=f.pending,m!==null&&(C=m.next,C===m?f.pending=null:(C=C.next,m.next=C,H5(f,C)))}function tC(f,m,C){var T=f.pending;if(f.pending=null,T!==null){T=T.next;do m.status="rejected",m.reason=C,q5(m),m=m.next;while(m!==T)}f.action=null}function q5(f){f=f.listeners;for(var m=0;m<f.length;m++)(0,f[m])()}function W5(f,m){return m}function K5(f,m){if(Qt){var C=Tn.formState;if(C!==null){e:{var T=Rt;if(Qt){if(Mn){t:{for(var U=Mn,V=Oi;U.nodeType!==8;){if(!V){U=null;break t}if(U=Li(U.nextSibling),U===null){U=null;break t}}V=U.data,U=V==="F!"||V==="F"?U:null}if(U){Mn=Li(U.nextSibling),T=U.data==="F!";break e}}xl(T)}T=!1}T&&(m=C[0])}}return C=Cr(),C.memoizedState=C.baseState=m,T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:W5,lastRenderedState:m},C.queue=T,C=pN.bind(null,Rt,T),T.dispatch=C,T=eC(!1),V=aC.bind(null,Rt,!1,T.queue),T=Cr(),U={state:m,dispatch:null,action:f,pending:null},T.queue=U,C=XU.bind(null,Rt,U,V,C),U.dispatch=C,T.memoizedState=f,[m,C,!1]}function $5(f){var m=us();return Y5(m,yn,f)}function Y5(f,m,C){if(m=Jx(f,m,W5)[0],f=Dg(Da)[0],typeof m=="object"&&m!==null&&typeof m.then=="function")try{var T=Sp(m)}catch(Z){throw Z===md?yg:Z}else T=m;m=us();var U=m.queue,V=U.dispatch;return C!==m.memoizedState&&(Rt.flags|=2048,Cd(9,{destroy:void 0},JU.bind(null,U,C),null)),[T,V,f]}function JU(f,m){f.action=m}function X5(f){var m=us(),C=yn;if(C!==null)return Y5(m,C,f);us(),m=m.memoizedState,C=us();var T=C.queue.dispatch;return C.memoizedState=f,[m,T,!1]}function Cd(f,m,C,T){return f={tag:f,create:C,deps:T,inst:m,next:null},m=Rt.updateQueue,m===null&&(m=wg(),Rt.updateQueue=m),C=m.lastEffect,C===null?m.lastEffect=f.next=f:(T=C.next,C.next=f,f.next=T,m.lastEffect=f),f}function J5(){return us().memoizedState}function kg(f,m,C,T){var U=Cr();Rt.flags|=f,U.memoizedState=Cd(1|m,{destroy:void 0},C,T===void 0?null:T)}function Og(f,m,C,T){var U=us();T=T===void 0?null:T;var V=U.memoizedState.inst;yn!==null&&T!==null&&qx(T,yn.memoizedState.deps)?U.memoizedState=Cd(m,V,C,T):(Rt.flags|=f,U.memoizedState=Cd(1|m,V,C,T))}function Z5(f,m){kg(8390656,8,f,m)}function nC(f,m){Og(2048,8,f,m)}function ZU(f){Rt.flags|=4;var m=Rt.updateQueue;if(m===null)m=wg(),Rt.updateQueue=m,m.events=[f];else{var C=m.events;C===null?m.events=[f]:C.push(f)}}function eN(f){var m=us().memoizedState;return ZU({ref:m,nextImpl:f}),function(){if((on&2)!==0)throw Error(s(440));return m.impl.apply(void 0,arguments)}}function tN(f,m){return Og(4,2,f,m)}function nN(f,m){return Og(4,4,f,m)}function sN(f,m){if(typeof m=="function"){f=f();var C=m(f);return function(){typeof C=="function"?C():m(null)}}if(m!=null)return f=f(),m.current=f,function(){m.current=null}}function rN(f,m,C){C=C!=null?C.concat([f]):null,Og(4,4,sN.bind(null,m,f),C)}function sC(){}function iN(f,m){var C=us();m=m===void 0?null:m;var T=C.memoizedState;return m!==null&&qx(m,T[1])?T[0]:(C.memoizedState=[f,m],f)}function oN(f,m){var C=us();m=m===void 0?null:m;var T=C.memoizedState;if(m!==null&&qx(m,T[1]))return T[0];if(T=f(),Pc){Gt(!0);try{f()}finally{Gt(!1)}}return C.memoizedState=[T,m],T}function rC(f,m,C){return C===void 0||(Ra&1073741824)!==0&&(Bt&261930)===0?f.memoizedState=m:(f.memoizedState=C,f=a3(),Rt.lanes|=f,Nl|=f,C)}function aN(f,m,C,T){return ti(C,m)?C:Ad.current!==null?(f=rC(f,C,T),ti(f,m)||(Es=!0),f):(Ra&42)===0||(Ra&1073741824)!==0&&(Bt&261930)===0?(Es=!0,f.memoizedState=C):(f=a3(),Rt.lanes|=f,Nl|=f,m)}function lN(f,m,C,T,U){var V=M.p;M.p=V!==0&&8>V?V:8;var Z=Q.T,ae={};Q.T=ae,aC(f,!1,m,C);try{var Ae=U(),we=Q.S;if(we!==null&&we(ae,Ae),Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"){var je=KU(Ae,T);vp(f,m,je,ai(f))}else vp(f,m,T,ai(f))}catch(Qe){vp(f,m,{then:function(){},status:"rejected",reason:Qe},ai())}finally{M.p=V,Z!==null&&ae.types!==null&&(Z.types=ae.types),Q.T=Z}}function ez(){}function iC(f,m,C,T){if(f.tag!==5)throw Error(s(476));var U=cN(f).queue;lN(f,U,m,K,C===null?ez:function(){return uN(f),C(T)})}function cN(f){var m=f.memoizedState;if(m!==null)return m;m={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:K},next:null};var C={};return m.next={memoizedState:C,baseState:C,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:C},next:null},f.memoizedState=m,f=f.alternate,f!==null&&(f.memoizedState=m),m}function uN(f){var m=cN(f);m.next===null&&(m=f.alternate.memoizedState),vp(f,m.next.queue,{},ai())}function oC(){return Ys(Qp)}function dN(){return us().memoizedState}function fN(){return us().memoizedState}function tz(f){for(var m=f.return;m!==null;){switch(m.tag){case 24:case 3:var C=ai();f=bl(C);var T=Il(m,f,C);T!==null&&(Fr(T,m,C),Cp(T,m,C)),m={cache:Lx()},f.payload=m;return}m=m.return}}function nz(f,m,C){var T=ai();C={lane:T,revertLane:0,gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},Pg(f)?hN(m,C):(C=Sx(f,m,C,T),C!==null&&(Fr(C,f,T),mN(C,m,T)))}function pN(f,m,C){var T=ai();vp(f,m,C,T)}function vp(f,m,C,T){var U={lane:T,revertLane:0,gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null};if(Pg(f))hN(m,U);else{var V=f.alternate;if(f.lanes===0&&(V===null||V.lanes===0)&&(V=m.lastRenderedReducer,V!==null))try{var Z=m.lastRenderedState,ae=V(Z,C);if(U.hasEagerState=!0,U.eagerState=ae,ti(ae,Z))return hg(f,m,U,0),Tn===null&&pg(),!1}catch{}if(C=Sx(f,m,U,T),C!==null)return Fr(C,f,T),mN(C,m,T),!0}return!1}function aC(f,m,C,T){if(T={lane:2,revertLane:FC(),gesture:null,action:T,hasEagerState:!1,eagerState:null,next:null},Pg(f)){if(m)throw Error(s(479))}else m=Sx(f,C,T,2),m!==null&&Fr(m,f,2)}function Pg(f){var m=f.alternate;return f===Rt||m!==null&&m===Rt}function hN(f,m){Ed=Tg=!0;var C=f.pending;C===null?m.next=m:(m.next=C.next,C.next=m),f.pending=m}function mN(f,m,C){if((C&4194048)!==0){var T=m.lanes;
vendor: 4,988 bytes, line 8
8T&=f.pendingLanes,C|=T,m.lanes=C,CT(f,C)}}var _p={readContext:Ys,use:Rg,useCallback:Jn,useContext:Jn,useEffect:Jn,useImperativeHandle:Jn,useLayoutEffect:Jn,useInsertionEffect:Jn,useMemo:Jn,useReducer:Jn,useRef:Jn,useState:Jn,useDebugValue:Jn,useDeferredValue:Jn,useTransition:Jn,useSyncExternalStore:Jn,useId:Jn,useHostTransitionStatus:Jn,useFormState:Jn,useActionState:Jn,useOptimistic:Jn,useMemoCache:Jn,useCacheRefresh:Jn};_p.useEffectEvent=Jn;var gN={readContext:Ys,use:Rg,useCallback:function(f,m){return Cr().memoizedState=[f,m===void 0?null:m],f},useContext:Ys,useEffect:Z5,useImperativeHandle:function(f,m,C){C=C!=null?C.concat([f]):null,kg(4194308,4,sN.bind(null,m,f),C)},useLayoutEffect:function(f,m){return kg(4194308,4,f,m)},useInsertionEffect:function(f,m){kg(4,2,f,m)},useMemo:function(f,m){var C=Cr();m=m===void 0?null:m;var T=f();if(Pc){Gt(!0);try{f()}finally{Gt(!1)}}return C.memoizedState=[T,m],T},useReducer:function(f,m,C){var T=Cr();if(C!==void 0){var U=C(m);if(Pc){Gt(!0);try{C(m)}finally{Gt(!1)}}}else U=m;return T.memoizedState=T.baseState=U,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:U},T.queue=f,f=f.dispatch=nz.bind(null,Rt,f),[T.memoizedState,f]},useRef:function(f){var m=Cr();return f={current:f},m.memoizedState=f},useState:function(f){f=eC(f);var m=f.queue,C=pN.bind(null,Rt,m);return m.dispatch=C,[f.memoizedState,C]},useDebugValue:sC,useDeferredValue:function(f,m){var C=Cr();return rC(C,f,m)},useTransition:function(){var f=eC(!1);return f=lN.bind(null,Rt,f.queue,!0,!1),Cr().memoizedState=f,[!1,f]},useSyncExternalStore:function(f,m,C){var T=Rt,U=Cr();if(Qt){if(C===void 0)throw Error(s(407));C=C()}else{if(C=m(),Tn===null)throw Error(s(349));(Bt&127)!==0||j5(T,m,C)}U.memoizedState=C;var V={value:C,getSnapshot:m};return U.queue=V,Z5(F5.bind(null,T,V,f),[f]),T.flags|=2048,Cd(9,{destroy:void 0},B5.bind(null,T,V,C,m),null),C},useId:function(){var f=Cr(),m=Tn.identifierPrefix;if(Qt){var C=Po,T=Oo;C=(T&~(1<<32-ft(T)-1)).toString(32)+C,m="_"+m+"R_"+C,C=Ng++,0<C&&(m+="H"+C.toString(32)),m+="_"}else C=$U++,m="_"+m+"r_"+C.toString(32)+"_";return f.memoizedState=m},useHostTransitionStatus:oC,useFormState:K5,useActionState:K5,useOptimistic:function(f){var m=Cr();m.memoizedState=m.baseState=f;var C={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return m.queue=C,m=aC.bind(null,Rt,!0,C),C.dispatch=m,[f,m]},useMemoCache:Xx,useCacheRefresh:function(){return Cr().memoizedState=tz.bind(null,Rt)},useEffectEvent:function(f){var m=Cr(),C={impl:f};return m.memoizedState=C,function(){if((on&2)!==0)throw Error(s(440));return C.impl.apply(void 0,arguments)}}},lC={readContext:Ys,use:Rg,useCallback:iN,useContext:Ys,useEffect:nC,useImperativeHandle:rN,useInsertionEffect:tN,useLayoutEffect:nN,useMemo:oN,useReducer:Dg,useRef:J5,useState:function(){return Dg(Da)},useDebugValue:sC,useDeferredValue:function(f,m){var C=us();return aN(C,yn.memoizedState,f,m)},useTransition:function(){var f=Dg(Da)[0],m=us().memoizedState;return[typeof f=="boolean"?f:Sp(f),m]},useSyncExternalStore:M5,useId:dN,useHostTransitionStatus:oC,useFormState:$5,useActionState:$5,useOptimistic:function(f,m){var C=us();return Q5(C,yn,f,m)},useMemoCache:Xx,useCacheRefresh:fN};lC.useEffectEvent=eN;var AN={readContext:Ys,use:Rg,useCallback:iN,useContext:Ys,useEffect:nC,useImperativeHandle:rN,useInsertionEffect:tN,useLayoutEffect:nN,useMemo:oN,useReducer:Zx,useRef:J5,useState:function(){return Zx(Da)},useDebugValue:sC,useDeferredValue:function(f,m){var C=us();return yn===null?rC(C,f,m):aN(C,yn.memoizedState,f,m)},useTransition:function(){var f=Zx(Da)[0],m=us().memoizedState;return[typeof f=="boolean"?f:Sp(f),m]},useSyncExternalStore:M5,useId:dN,useHostTransitionStatus:oC,useFormState:X5,useActionState:X5,useOptimistic:function(f,m){var C=us();return yn!==null?Q5(C,yn,f,m):(C.baseState=f,[f,C.queue.dispatch])},useMemoCache:Xx,useCacheRefresh:fN};AN.useEffectEvent=eN;function cC(f,m,C,T){m=f.memoizedState,C=C(T,m),C=C==null?m:g({},m,C),f.memoizedState=C,f.lanes===0&&(f.updateQueue.baseState=C)}var uC={enqueueSetState:function(f,m,C){f=f._reactInternals;var T=ai(),U=bl(T);U.payload=m,C!=null&&(U.callback=C),m=Il(f,U,T),m!==null&&(Fr(m,f,T),Cp(m,f,T))},enqueueReplaceState:function(f,m,C){f=f._reactInternals;var T=ai(),U=bl(T);U.tag=1,U.payload=m,C!=null&&(U.callback=C),m=Il(f,U,T),m!==null&&(Fr(m,f,T),Cp(m,f,T))},enqueueForceUpdate:function(f,m){f=f._reactInternals;var C=ai(),T=bl(C);T.tag=2,m!=null&&(T.callback=m),m=Il(f,T,C),m!==null&&(Fr(m,f,C),Cp(m,f,C))}};function EN(f,m,C,T,U,V,Z){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(T,V,Z):m.prototype&&m.prototype.isPureReactComponent?!fp(C,T)||!fp(U,V):!0}function xN(f,m,C,T){f=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(C,T),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(C,T),m.state!==f&&uC.enqueueReplaceState(m,m.
vendor: 14,654 bytes, line 8
8state,null)}function Lc(f,m){var C=m;if("ref"in m){C={};for(var T in m)T!=="ref"&&(C[T]=m[T])}if(f=f.defaultProps){C===m&&(C=g({},C));for(var U in f)C[U]===void 0&&(C[U]=f[U])}return C}function CN(f){fg(f)}function yN(f){console.error(f)}function bN(f){fg(f)}function Lg(f,m){try{var C=f.onUncaughtError;C(m.value,{componentStack:m.stack})}catch(T){setTimeout(function(){throw T})}}function IN(f,m,C){try{var T=f.onCaughtError;T(C.value,{componentStack:C.stack,errorBoundary:m.tag===1?m.stateNode:null})}catch(U){setTimeout(function(){throw U})}}function dC(f,m,C){return C=bl(C),C.tag=3,C.payload={element:null},C.callback=function(){Lg(f,m)},C}function SN(f){return f=bl(f),f.tag=3,f}function vN(f,m,C,T){var U=C.type.getDerivedStateFromError;if(typeof U=="function"){var V=T.value;f.payload=function(){return U(V)},f.callback=function(){IN(m,C,T)}}var Z=C.stateNode;Z!==null&&typeof Z.componentDidCatch=="function"&&(f.callback=function(){IN(m,C,T),typeof U!="function"&&(wl===null?wl=new Set([this]):wl.add(this));var ae=T.stack;this.componentDidCatch(T.value,{componentStack:ae!==null?ae:""})})}function sz(f,m,C,T,U){if(C.flags|=32768,T!==null&&typeof T=="object"&&typeof T.then=="function"){if(m=C.alternate,m!==null&&fd(m,C,U,!0),C=si.current,C!==null){switch(C.tag){case 31:case 13:return Pi===null?Wg():C.alternate===null&&Zn===0&&(Zn=3),C.flags&=-257,C.flags|=65536,C.lanes=U,T===bg?C.flags|=16384:(m=C.updateQueue,m===null?C.updateQueue=new Set([T]):m.add(T),MC(f,T,U)),!1;case 22:return C.flags|=65536,T===bg?C.flags|=16384:(m=C.updateQueue,m===null?(m={transitions:null,markerInstances:null,retryQueue:new Set([T])},C.updateQueue=m):(C=m.retryQueue,C===null?m.retryQueue=new Set([T]):C.add(T)),MC(f,T,U)),!1}throw Error(s(435,C.tag))}return MC(f,T,U),Wg(),!1}if(Qt)return m=si.current,m!==null?((m.flags&65536)===0&&(m.flags|=256),m.flags|=65536,m.lanes=U,T!==Rx&&(f=Error(s(422),{cause:T}),mp(Ri(f,C)))):(T!==Rx&&(m=Error(s(423),{cause:T}),mp(Ri(m,C))),f=f.current.alternate,f.flags|=65536,U&=-U,f.lanes|=U,T=Ri(T,C),U=dC(f.stateNode,T,U),zx(f,U),Zn!==4&&(Zn=2)),!1;var V=Error(s(520),{cause:T});if(V=Ri(V,C),Pp===null?Pp=[V]:Pp.push(V),Zn!==4&&(Zn=2),m===null)return!0;T=Ri(T,C),C=m;do{switch(C.tag){case 3:return C.flags|=65536,f=U&-U,C.lanes|=f,f=dC(C.stateNode,T,f),zx(C,f),!1;case 1:if(m=C.type,V=C.stateNode,(C.flags&128)===0&&(typeof m.getDerivedStateFromError=="function"||V!==null&&typeof V.componentDidCatch=="function"&&(wl===null||!wl.has(V))))return C.flags|=65536,U&=-U,C.lanes|=U,U=SN(U),vN(U,f,C,T),zx(C,U),!1}C=C.return}while(C!==null);return!1}var fC=Error(s(461)),Es=!1;function Xs(f,m,C,T){m.child=f===null?w5(m,null,C,T):Oc(m,f.child,C,T)}function _N(f,m,C,T,U){C=C.render;var V=m.ref;if("ref"in T){var Z={};for(var ae in T)ae!=="ref"&&(Z[ae]=T[ae])}else Z=T;return wc(m),T=Wx(f,m,C,Z,V,U),ae=Kx(),f!==null&&!Es?($x(f,m,U),ka(f,m,U)):(Qt&&ae&&Nx(m),m.flags|=1,Xs(f,m,T,U),m.child)}function TN(f,m,C,T,U){if(f===null){var V=C.type;return typeof V=="function"&&!vx(V)&&V.defaultProps===void 0&&C.compare===null?(m.tag=15,m.type=V,NN(f,m,V,T,U)):(f=gg(C.type,null,T,m,m.mode,U),f.ref=m.ref,f.return=m,m.child=f)}if(V=f.child,!CC(f,U)){var Z=V.memoizedProps;if(C=C.compare,C=C!==null?C:fp,C(Z,T)&&f.ref===m.ref)return ka(f,m,U)}return m.flags|=1,f=_a(V,T),f.ref=m.ref,f.return=m,m.child=f}function NN(f,m,C,T,U){if(f!==null){var V=f.memoizedProps;if(fp(V,T)&&f.ref===m.ref)if(Es=!1,m.pendingProps=T=V,CC(f,U))(f.flags&131072)!==0&&(Es=!0);else return m.lanes=f.lanes,ka(f,m,U)}return pC(f,m,C,T,U)}function wN(f,m,C,T){var U=T.children,V=f!==null?f.memoizedState:null;if(f===null&&m.stateNode===null&&(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),T.mode==="hidden"){if((m.flags&128)!==0){if(V=V!==null?V.baseLanes|C:C,f!==null){for(T=m.child=f.child,U=0;T!==null;)U=U|T.lanes|T.childLanes,T=T.sibling;T=U&~V}else T=0,m.child=null;return RN(f,m,V,C,T)}if((C&536870912)!==0)m.memoizedState={baseLanes:0,cachePool:null},f!==null&&Cg(m,V!==null?V.cachePool:null),V!==null?k5(m,V):Hx(),O5(m);else return T=m.lanes=536870912,RN(f,m,V!==null?V.baseLanes|C:C,C,T)}else V!==null?(Cg(m,V.cachePool),k5(m,V),vl(),m.memoizedState=null):(f!==null&&Cg(m,null),Hx(),vl());return Xs(f,m,U,C),m.child}function Tp(f,m){return f!==null&&f.tag===22||m.stateNode!==null||(m.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.sibling}function RN(f,m,C,T,U){var V=jx();return V=V===null?null:{parent:gs._currentValue,pool:V},m.memoizedState={baseLanes:C,cachePool:V},f!==null&&Cg(m,null),Hx(),O5(m),f!==null&&fd(f,m,T,!0),m.childLanes=U,null}function Mg(f,m){return m=Bg({mode:m.mode,children:m.children},f.mode),m.ref=f.ref,f.child=m,m.return=f,m}function DN(f,m,C){return Oc(m,f.child,null,C),f=Mg(m,m.pendingProps),f.flags|=2,ri(m),m.memoizedState=null,f}function rz(f,m,C){var T=m.pendingProps,U=(m.flags&128)!==0;if(m.flags&=-129,f===null){if(Qt){if(T.mode==="hidden")return f=Mg(m,T),m.lanes=536870912,Tp(null,f);if(Gx(m),(f=Mn)?(f=H3(f,Oi),f=f!==null&&f.data==="&"?f:null,f!==null&&(m.memoizedState={dehydrated:f,treeContext:Al!==null?{id:Oo,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},C=h5(f),C.return=m,m.child=C,$s=m,Mn=null)):f=null,f===null)throw xl(m);return m.lanes=536870912,null}return Mg(m,T)}var V=f.memoizedState;if(V!==null){var Z=V.dehydrated;if(Gx(m),U)if(m.flags&256)m.flags&=-257,m=DN(f,m,C);else if(m.memoizedState!==null)m.child=f.child,m.flags|=128,m=null;else throw Error(s(558));else if(Es||fd(f,m,C,!1),U=(C&f.childLanes)!==0,Es||U){if(T=Tn,T!==null&&(Z=yT(T,C),Z!==0&&Z!==V.retryLane))throw V.retryLane=Z,vc(f,Z),Fr(T,f,Z),fC;Wg(),m=DN(f,m,C)}else f=V.treeContext,Mn=Li(Z.nextSibling),$s=m,Qt=!0,El=null,Oi=!1,f!==null&&A5(m,f),m=Mg(m,T),m.flags|=4096;return m}return f=_a(f.child,{mode:T.mode,children:T.children}),f.ref=m.ref,m.child=f,f.return=m,f}function jg(f,m){var C=m.ref;if(C===null)f!==null&&f.ref!==null&&(m.flags|=4194816);else{if(typeof C!="function"&&typeof C!="object")throw Error(s(284));(f===null||f.ref!==C)&&(m.flags|=4194816)}}function pC(f,m,C,T,U){return wc(m),C=Wx(f,m,C,T,void 0,U),T=Kx(),f!==null&&!Es?($x(f,m,U),ka(f,m,U)):(Qt&&T&&Nx(m),m.flags|=1,Xs(f,m,C,U),m.child)}function kN(f,m,C,T,U,V){return wc(m),m.updateQueue=null,C=L5(m,T,C,U),P5(f),T=Kx(),f!==null&&!Es?($x(f,m,V),ka(f,m,V)):(Qt&&T&&Nx(m),m.flags|=1,Xs(f,m,C,V),m.child)}function ON(f,m,C,T,U){if(wc(m),m.stateNode===null){var V=ld,Z=C.contextType;typeof Z=="object"&&Z!==null&&(V=Ys(Z)),V=new C(T,V),m.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,V.updater=uC,m.stateNode=V,V._reactInternals=m,V=m.stateNode,V.props=T,V.state=m.memoizedState,V.refs={},Fx(m),Z=C.contextType,V.context=typeof Z=="object"&&Z!==null?Ys(Z):ld,V.state=m.memoizedState,Z=C.getDerivedStateFromProps,typeof Z=="function"&&(cC(m,C,Z,T),V.state=m.memoizedState),typeof C.getDerivedStateFromProps=="function"||typeof V.getSnapshotBeforeUpdate=="function"||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(Z=V.state,typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount(),Z!==V.state&&uC.enqueueReplaceState(V,V.state,null),bp(m,T,V,U),yp(),V.state=m.memoizedState),typeof V.componentDidMount=="function"&&(m.flags|=4194308),T=!0}else if(f===null){V=m.stateNode;var ae=m.memoizedProps,Ae=Lc(C,ae);V.props=Ae;var we=V.context,je=C.contextType;Z=ld,typeof je=="object"&&je!==null&&(Z=Ys(je));var Qe=C.getDerivedStateFromProps;je=typeof Qe=="function"||typeof V.getSnapshotBeforeUpdate=="function",ae=m.pendingProps!==ae,je||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(ae||we!==Z)&&xN(m,V,T,Z),yl=!1;var De=m.memoizedState;V.state=De,bp(m,T,V,U),yp(),we=m.memoizedState,ae||De!==we||yl?(typeof Qe=="function"&&(cC(m,C,Qe,T),we=m.memoizedState),(Ae=yl||EN(m,C,Ae,T,De,we,Z))?(je||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(m.flags|=4194308)):(typeof V.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=T,m.memoizedState=we),V.props=T,V.state=we,V.context=Z,T=Ae):(typeof V.componentDidMount=="function"&&(m.flags|=4194308),T=!1)}else{V=m.stateNode,Ux(f,m),Z=m.memoizedProps,je=Lc(C,Z),V.props=je,Qe=m.pendingProps,De=V.context,we=C.contextType,Ae=ld,typeof we=="object"&&we!==null&&(Ae=Ys(we)),ae=C.getDerivedStateFromProps,(we=typeof ae=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Z!==Qe||De!==Ae)&&xN(m,V,T,Ae),yl=!1,De=m.memoizedState,V.state=De,bp(m,T,V,U),yp();var ke=m.memoizedState;Z!==Qe||De!==ke||yl||f!==null&&f.dependencies!==null&&Eg(f.dependencies)?(typeof ae=="function"&&(cC(m,C,ae,T),ke=m.memoizedState),(je=yl||EN(m,C,je,T,De,ke,Ae)||f!==null&&f.dependencies!==null&&Eg(f.dependencies))?(we||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(T,ke,Ae),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(T,ke,Ae)),typeof V.componentDidUpdate=="function"&&(m.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof V.componentDidUpdate!="function"||Z===f.memoizedProps&&De===f.memoizedState||(m.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Z===f.memoizedProps&&De===f.memoizedState||(m.flags|=1024),m.memoizedProps=T,m.memoizedState=ke),V.props=T,V.state=ke,V.context=Ae,T=je):(typeof V.componentDidUpdate!="function"||Z===f.memoizedProps&&De===f.memoizedState||(m.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Z===f.memoizedProps&&De===f.memoizedState||(m.flags|=1024),T=!1)}return V=T,jg(f,m),T=(m.flags&128)!==0,V||T?(V=m.stateNode,C=T&&typeof C.getDerivedStateFromError!="function"?null:V.render(),m.flags|=1,f!==null&&T?(m.child=Oc(m,f.child,null,U),m.child=Oc(m,null,C,U)):Xs(f,m,C,U),m.memoizedState=V.state,f=m.child):f=ka(f,m,U),f}function PN(f,m,C,T){return Tc(),m.flags|=256,Xs(f,m,C,T),m.child}var hC={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mC(f){return{baseLanes:f,cachePool:I5()}}function gC(f,m,C){return f=f!==null?f.childLanes&~C:0,m&&(f|=oi),f}function LN(f,m,C){var T=m.pendingProps,U=!1,V=(m.flags&128)!==0,Z;if((Z=V)||(Z=f!==null&&f.memoizedState===null?!1:(cs.current&2)!==0),Z&&(U=!0,m.flags&=-129),Z=(m.flags&32)!==0,m.flags&=-33,f===null){if(Qt){if(U?Sl(m):vl(),(f=Mn)?(f=H3(f,Oi),f=f!==null&&f.data!=="&"?f:null,f!==null&&(m.memoizedState={dehydrated:f,treeContext:Al!==null?{id:Oo,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},C=h5(f),C.return=m,m.child=C,$s=m,Mn=null)):f=null,f===null)throw xl(m);return JC(f)?m.lanes=32:m.lanes=536870912,null}var ae=T.children;return T=T.fallback,U?(vl(),U=m.mode,ae=Bg({mode:"hidden",children:ae},U),T=_c(T,U,C,null),ae.return=m,T.return=m,ae.sibling=T,m.child=ae,T=m.child,T.memoizedState=mC(C),T.childLanes=gC(f,Z,C),m.memoizedState=hC,Tp(null,T)):(Sl(m),AC(m,ae))}var Ae=f.memoizedState;if(Ae!==null&&(ae=Ae.dehydrated,ae!==null)){if(V)m.flags&256?(Sl(m),m.flags&=-257,m=EC(f,m,C)):m.memoizedState!==null?(vl(),m.child=f.child,m.flags|=128,m=null):(vl(),ae=T.fallback,U=m.mode,T=Bg({mode:"visible",children:T.children},U),ae=_c(ae,U,C,null),ae.flags|=2,T.return=m,ae.return=m,T.sibling=ae,m.child=T,Oc(m,f.child,null,C),T=m.child,T.memoizedState=mC(C),T.childLanes=gC(f,Z,C),m.memoizedState=hC,m=Tp(null,T));else if(Sl(m),JC(ae)){if(Z=ae.nextSibling&&ae.nextSibling.dataset,Z)var we=Z.dgst;Z=we,T=Error(s(419)),T.stack="",T.digest=Z,mp({value:T,source:null,stack:null}),m=EC(f,m,C)}else if(Es||fd(f,m,C,!1),Z=(C&f.childLanes)!==0,Es||Z){if(Z=Tn,Z!==null&&(T=yT(Z,C),T!==0&&T!==Ae.retryLane))throw Ae.retryLane=T,vc(f,T),Fr(Z,f,T),fC;XC(ae)||Wg(),m=EC(f,m,C)}else XC(ae)?(m.flags|=192,m.child=f.child,m=null):(f=Ae.treeContext,Mn=Li(ae.nextSibling),$s=m,Qt=!0,El=null,Oi=!1,f!==null&&A5(m,f),m=AC(m,T.children),m.flags|=4096);return m}return U?(vl(),ae=T.fallback,U=m.mode,Ae=f.child,we=Ae.sibling,T=_a(Ae,{mode:"hidden",children:T.children}),T.subtreeFlags=Ae.subtreeFlags&65011712,we!==null?ae=_a(we,ae):(ae=_c(ae,U,C,null),ae.flags|=2),ae.return=m,T.return=m,T.sibling=ae,m.child=T,Tp(null,T),T=m.child,ae=f.child.memoizedState,ae===null?ae=mC(C):(U=ae.cachePool,U!==null?(Ae=gs._currentValue,U=U.parent!==Ae?{parent:Ae,pool:Ae}:U):U=I5(),ae={baseLanes:ae.baseLanes|C,cachePool:U}),T.memoizedState=ae,T.childLanes=gC(f,Z,C),m.memoizedState=hC,Tp(f.child,T)):(Sl(m),C=f.child,f=C.sibling,C=_a(C,{mode:"visible",children:T.children}),C.return=m,C.sibling=null,f!==null&&(Z=m.deletions,Z===null?(m.deletions=[f],m.flags|=16):Z.push(f)),m.child=C,m.memoizedState=null,C)}function AC(f,m){return m=Bg({mode:"visible",children:m},f.mode),m.return=f,f.child=m}function Bg(f,m){return f=ni(22,f,null,m),f.lanes=0,f}function EC(f,m,C){return Oc(m,f.child,null,C),f=AC(m,m.pendingProps.children),f.flags|=2,m.memoizedState=null,f}function MN(f,m,C){f.lanes|=m;var T=f.alternate;T!==null&&(T.lanes|=m),Ox(f.return,m,C)}function xC(f,m,C,T,U,V){var Z=f.memoizedState;Z===null?f.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:T,tail:C,tailMode:U,treeForkCount:V}:(Z.isBackwards=m,Z.rendering=null,Z.renderingStartTime=0,Z.last=T,Z.tail=C,Z.tailMode=U,Z.treeForkCount=V)}function jN(f,m,C){var T=m.pendingProps,U=T.revealOrder,V=T.tail;T=T.children;var Z=cs.current,ae=(Z&2)!==0;if(ae?(Z=Z&1|2,m.flags|=128):Z&=1,G(cs,Z),Xs(f,m,T,C),T=Qt?hp:0,!ae&&f!==null&&(f.flags&128)!==0)e:for(f=m.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&MN(f,C,m);else if(f.tag===19)MN(f,C,m);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===m)break e;for(;f.sibling===null;){if(f.return===null||f.return===m)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}switch(U){case"forwards":for(C=m.child,U=null;C!==null;)f=C.alternate,f!==null&&_g(f)===null&&(U=C),C=C.sibling;C=U,C===null?(U=m.child,m.child=null):(U=C.sibling,C.sibling=null),xC(m,!1,U,C,V,T);break;case"backwards":case"unstable_legacy-backwards":for(C=null,U=m.child,m.child=null;U!==null;){if(f=U.alternate,f!==null&&_g(f)===null){m.child=U;break}f=U.sibling,U.sibling=C,C=U,U=f}xC(m,!0,C,null,V,T);break;case"together":xC(m,!1,null,null,void 0,T);break;default:m.memoizedState=null}return m.child}
vendor: 4,193 bytes, line 8
8function ka(f,m,C){if(f!==null&&(m.dependencies=f.dependencies),Nl|=m.lanes,(C&m.childLanes)===0)if(f!==null){if(fd(f,m,C,!1),(C&m.childLanes)===0)return null}else return null;if(f!==null&&m.child!==f.child)throw Error(s(153));if(m.child!==null){for(f=m.child,C=_a(f,f.pendingProps),m.child=C,C.return=m;f.sibling!==null;)f=f.sibling,C=C.sibling=_a(f,f.pendingProps),C.return=m;C.sibling=null}return m.child}function CC(f,m){return(f.lanes&m)!==0?!0:(f=f.dependencies,!!(f!==null&&Eg(f)))}function iz(f,m,C){switch(m.tag){case 3:oe(m,m.stateNode.containerInfo),Cl(m,gs,f.memoizedState.cache),Tc();break;case 27:case 5:ee(m);break;case 4:oe(m,m.stateNode.containerInfo);break;case 10:Cl(m,m.type,m.memoizedProps.value);break;case 31:if(m.memoizedState!==null)return m.flags|=128,Gx(m),null;break;case 13:var T=m.memoizedState;if(T!==null)return T.dehydrated!==null?(Sl(m),m.flags|=128,null):(C&m.child.childLanes)!==0?LN(f,m,C):(Sl(m),f=ka(f,m,C),f!==null?f.sibling:null);Sl(m);break;case 19:var U=(f.flags&128)!==0;if(T=(C&m.childLanes)!==0,T||(fd(f,m,C,!1),T=(C&m.childLanes)!==0),U){if(T)return jN(f,m,C);m.flags|=128}if(U=m.memoizedState,U!==null&&(U.rendering=null,U.tail=null,U.lastEffect=null),G(cs,cs.current),T)break;return null;case 22:return m.lanes=0,wN(f,m,C,m.pendingProps);case 24:Cl(m,gs,f.memoizedState.cache)}return ka(f,m,C)}function BN(f,m,C){if(f!==null)if(f.memoizedProps!==m.pendingProps)Es=!0;else{if(!CC(f,C)&&(m.flags&128)===0)return Es=!1,iz(f,m,C);Es=(f.flags&131072)!==0}else Es=!1,Qt&&(m.flags&1048576)!==0&&g5(m,hp,m.index);switch(m.lanes=0,m.tag){case 16:e:{var T=m.pendingProps;if(f=Dc(m.elementType),m.type=f,typeof f=="function")vx(f)?(T=Lc(f,T),m.tag=1,m=ON(null,m,f,T,C)):(m.tag=0,m=pC(null,m,f,T,C));else{if(f!=null){var U=f.$$typeof;if(U===w){m.tag=11,m=_N(null,m,f,T,C);break e}else if(U===R){m.tag=14,m=TN(null,m,f,T,C);break e}}throw m=F(f)||f,Error(s(306,m,""))}}return m;case 0:return pC(f,m,m.type,m.pendingProps,C);case 1:return T=m.type,U=Lc(T,m.pendingProps),ON(f,m,T,U,C);case 3:e:{if(oe(m,m.stateNode.containerInfo),f===null)throw Error(s(387));T=m.pendingProps;var V=m.memoizedState;U=V.element,Ux(f,m),bp(m,T,null,C);var Z=m.memoizedState;if(T=Z.cache,Cl(m,gs,T),T!==V.cache&&Px(m,[gs],C,!0),yp(),T=Z.element,V.isDehydrated)if(V={element:T,isDehydrated:!1,cache:Z.cache},m.updateQueue.baseState=V,m.memoizedState=V,m.flags&256){m=PN(f,m,T,C);break e}else if(T!==U){U=Ri(Error(s(424)),m),mp(U),m=PN(f,m,T,C);break e}else for(f=m.stateNode.containerInfo,f.nodeType===9?f=f.body:f=f.nodeName==="HTML"?f.ownerDocument.body:f,Mn=Li(f.firstChild),$s=m,Qt=!0,El=null,Oi=!0,C=w5(m,null,T,C),m.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Tc(),T===U){m=ka(f,m,C);break e}Xs(f,m,T,C)}m=m.child}return m;case 26:return jg(f,m),f===null?(C=$3(m.type,null,m.pendingProps,null))?m.memoizedState=C:Qt||(C=m.type,f=m.pendingProps,T=e0(ne.current).createElement(C),T[Ks]=m,T[Or]=f,Js(T,C,f),Ms(T),m.stateNode=T):m.memoizedState=$3(m.type,f.memoizedProps,m.pendingProps,f.memoizedState),null;case 27:return ee(m),f===null&&Qt&&(T=m.stateNode=q3(m.type,m.pendingProps,ne.current),$s=m,Oi=!0,U=Mn,Ol(m.type)?(ZC=U,Mn=Li(T.firstChild)):Mn=U),Xs(f,m,m.pendingProps.children,C),jg(f,m),f===null&&(m.flags|=4194304),m.child;case 5:return f===null&&Qt&&((U=T=Mn)&&(T=Lz(T,m.type,m.pendingProps,Oi),T!==null?(m.stateNode=T,$s=m,Mn=Li(T.firstChild),Oi=!1,U=!0):U=!1),U||xl(m)),ee(m),U=m.type,V=m.pendingProps,Z=f!==null?f.memoizedProps:null,T=V.children,KC(U,V)?T=null:Z!==null&&KC(U,Z)&&(m.flags|=32),m.memoizedState!==null&&(U=Wx(f,m,YU,null,null,C),Qp._currentValue=U),jg(f,m),Xs(f,m,T,C),m.child;case 6:return f===null&&Qt&&((f=C=Mn)&&(C=Mz(C,m.pendingProps,Oi),C!==null?(m.stateNode=C,$s=m,Mn=null,f=!0):f=!1),f||xl(m)),null;case 13:return LN(f,m,C);case 4:return oe(m,m.stateNode.containerInfo),T=m.pendingProps,f===null?m.child=Oc(m,null,T,C):Xs(f,m,T,C),m.child;case 11:return _N(f,m,m.type,m.pendingProps,C);case 7:return Xs(f,m,m.pendingProps,C),m.child;case 8:return Xs(f,m,m.pendingProps.children,C),m.child;case 12:return Xs(f,m,m.pendingProps.children,C),m.child;case 10:return T=m.pendingProps,Cl(m,m.type,T.value),Xs(f,m,T.children,C),m.child;
vendor: 4,738 bytes, line 8
8case 9:return U=m.type._context,T=m.pendingProps.children,wc(m),U=Ys(U),T=T(U),m.flags|=1,Xs(f,m,T,C),m.child;case 14:return TN(f,m,m.type,m.pendingProps,C);case 15:return NN(f,m,m.type,m.pendingProps,C);case 19:return jN(f,m,C);case 31:return rz(f,m,C);case 22:return wN(f,m,C,m.pendingProps);case 24:return wc(m),T=Ys(gs),f===null?(U=jx(),U===null&&(U=Tn,V=Lx(),U.pooledCache=V,V.refCount++,V!==null&&(U.pooledCacheLanes|=C),U=V),m.memoizedState={parent:T,cache:U},Fx(m),Cl(m,gs,U)):((f.lanes&C)!==0&&(Ux(f,m),bp(m,null,null,C),yp()),U=f.memoizedState,V=m.memoizedState,U.parent!==T?(U={parent:T,cache:T},m.memoizedState=U,m.lanes===0&&(m.memoizedState=m.updateQueue.baseState=U),Cl(m,gs,T)):(T=V.cache,Cl(m,gs,T),T!==U.cache&&Px(m,[gs],C,!0))),Xs(f,m,m.pendingProps.children,C),m.child;case 29:throw m.pendingProps}throw Error(s(156,m.tag))}function Oa(f){f.flags|=4}function yC(f,m,C,T,U){if((m=(f.mode&32)!==0)&&(m=!1),m){if(f.flags|=16777216,(U&335544128)===U)if(f.stateNode.complete)f.flags|=8192;else if(d3())f.flags|=8192;else throw kc=bg,Bx}else f.flags&=-16777217}function FN(f,m){if(m.type!=="stylesheet"||(m.state.loading&4)!==0)f.flags&=-16777217;else if(f.flags|=16777216,!e4(m))if(d3())f.flags|=8192;else throw kc=bg,Bx}function Fg(f,m){m!==null&&(f.flags|=4),f.flags&16384&&(m=f.tag!==22?Dr():536870912,f.lanes|=m,Sd|=m)}function Np(f,m){if(!Qt)switch(f.tailMode){case"hidden":m=f.tail;for(var C=null;m!==null;)m.alternate!==null&&(C=m),m=m.sibling;C===null?f.tail=null:C.sibling=null;break;case"collapsed":C=f.tail;for(var T=null;C!==null;)C.alternate!==null&&(T=C),C=C.sibling;T===null?m||f.tail===null?f.tail=null:f.tail.sibling=null:T.sibling=null}}function jn(f){var m=f.alternate!==null&&f.alternate.child===f.child,C=0,T=0;if(m)for(var U=f.child;U!==null;)C|=U.lanes|U.childLanes,T|=U.subtreeFlags&65011712,T|=U.flags&65011712,U.return=f,U=U.sibling;else for(U=f.child;U!==null;)C|=U.lanes|U.childLanes,T|=U.subtreeFlags,T|=U.flags,U.return=f,U=U.sibling;return f.subtreeFlags|=T,f.childLanes=C,m}function oz(f,m,C){var T=m.pendingProps;switch(wx(m),m.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jn(m),null;case 1:return jn(m),null;case 3:return C=m.stateNode,T=null,f!==null&&(T=f.memoizedState.cache),m.memoizedState.cache!==T&&(m.flags|=2048),wa(gs),ie(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(f===null||f.child===null)&&(dd(m)?Oa(m):f===null||f.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,Dx())),jn(m),null;case 26:var U=m.type,V=m.memoizedState;return f===null?(Oa(m),V!==null?(jn(m),FN(m,V)):(jn(m),yC(m,U,null,T,C))):V?V!==f.memoizedState?(Oa(m),jn(m),FN(m,V)):(jn(m),m.flags&=-16777217):(f=f.memoizedProps,f!==T&&Oa(m),jn(m),yC(m,U,f,T,C)),null;case 27:if(te(m),C=ne.current,U=m.type,f!==null&&m.stateNode!=null)f.memoizedProps!==T&&Oa(m);else{if(!T){if(m.stateNode===null)throw Error(s(166));return jn(m),null}f=$.current,dd(m)?E5(m):(f=q3(U,T,C),m.stateNode=f,Oa(m))}return jn(m),null;case 5:if(te(m),U=m.type,f!==null&&m.stateNode!=null)f.memoizedProps!==T&&Oa(m);else{if(!T){if(m.stateNode===null)throw Error(s(166));return jn(m),null}if(V=$.current,dd(m))E5(m);else{var Z=e0(ne.current);switch(V){case 1:V=Z.createElementNS("http://www.w3.org/2000/svg",U);break;case 2:V=Z.createElementNS("http://www.w3.org/1998/Math/MathML",U);break;default:switch(U){case"svg":V=Z.createElementNS("http://www.w3.org/2000/svg",U);break;case"math":V=Z.createElementNS("http://www.w3.org/1998/Math/MathML",U);break;case"script":V=Z.createElement("div"),V.innerHTML="<script><\/script>",V=V.removeChild(V.firstChild);break;case"select":V=typeof T.is=="string"?Z.createElement("select",{is:T.is}):Z.createElement("select"),T.multiple?V.multiple=!0:T.size&&(V.size=T.size);break;default:V=typeof T.is=="string"?Z.createElement(U,{is:T.is}):Z.createElement(U)}}V[Ks]=m,V[Or]=T;e:for(Z=m.child;Z!==null;){if(Z.tag===5||Z.tag===6)V.appendChild(Z.stateNode);else if(Z.tag!==4&&Z.tag!==27&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===m)break e;for(;Z.sibling===null;){if(Z.return===null||Z.return===m)break e;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}m.stateNode=V;e:switch(Js(V,U,T),U){case"button":case"input":case"select":case"textarea":T=!!T.autoFocus;break e;case"img":T=!0;break e;default:T=!1}T&&Oa(m)}}return jn(m),yC(m,m.type,f===null?null:f.memoizedProps,m.pendingProps,C),null;case 6:if(f&&m.stateNode!=null)f.memoizedProps!==T&&Oa(m);else{if(typeof T!="string"&&m.stateNode===null)throw Error(s(166));if(f=ne.current,dd(m)){if(f=m.stateNode,C=m.memoizedProps,T=null,U=$s,U!==null)switch(U.tag){case 27:case 5:T=U.memoizedProps}f[Ks]=m,f=!!(f.nodeValue===C||T!==null&&T.suppressHydrationWarning===!0||L3(f.no
vendor: 23,795 bytes, line 8
8deValue,C)),f||xl(m,!0)}else f=e0(f).createTextNode(T),f[Ks]=m,m.stateNode=f}return jn(m),null;case 31:if(C=m.memoizedState,f===null||f.memoizedState!==null){if(T=dd(m),C!==null){if(f===null){if(!T)throw Error(s(318));if(f=m.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(557));f[Ks]=m}else Tc(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;jn(m),f=!1}else C=Dx(),f!==null&&f.memoizedState!==null&&(f.memoizedState.hydrationErrors=C),f=!0;if(!f)return m.flags&256?(ri(m),m):(ri(m),null);if((m.flags&128)!==0)throw Error(s(558))}return jn(m),null;case 13:if(T=m.memoizedState,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(U=dd(m),T!==null&&T.dehydrated!==null){if(f===null){if(!U)throw Error(s(318));if(U=m.memoizedState,U=U!==null?U.dehydrated:null,!U)throw Error(s(317));U[Ks]=m}else Tc(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;jn(m),U=!1}else U=Dx(),f!==null&&f.memoizedState!==null&&(f.memoizedState.hydrationErrors=U),U=!0;if(!U)return m.flags&256?(ri(m),m):(ri(m),null)}return ri(m),(m.flags&128)!==0?(m.lanes=C,m):(C=T!==null,f=f!==null&&f.memoizedState!==null,C&&(T=m.child,U=null,T.alternate!==null&&T.alternate.memoizedState!==null&&T.alternate.memoizedState.cachePool!==null&&(U=T.alternate.memoizedState.cachePool.pool),V=null,T.memoizedState!==null&&T.memoizedState.cachePool!==null&&(V=T.memoizedState.cachePool.pool),V!==U&&(T.flags|=2048)),C!==f&&C&&(m.child.flags|=8192),Fg(m,m.updateQueue),jn(m),null);case 4:return ie(),f===null&&HC(m.stateNode.containerInfo),jn(m),null;case 10:return wa(m.type),jn(m),null;case 19:if(q(cs),T=m.memoizedState,T===null)return jn(m),null;if(U=(m.flags&128)!==0,V=T.rendering,V===null)if(U)Np(T,!1);else{if(Zn!==0||f!==null&&(f.flags&128)!==0)for(f=m.child;f!==null;){if(V=_g(f),V!==null){for(m.flags|=128,Np(T,!1),f=V.updateQueue,m.updateQueue=f,Fg(m,f),m.subtreeFlags=0,f=C,C=m.child;C!==null;)p5(C,f),C=C.sibling;return G(cs,cs.current&1|2),Qt&&Ta(m,T.treeForkCount),m.child}f=f.sibling}T.tail!==null&&se()>Vg&&(m.flags|=128,U=!0,Np(T,!1),m.lanes=4194304)}else{if(!U)if(f=_g(V),f!==null){if(m.flags|=128,U=!0,f=f.updateQueue,m.updateQueue=f,Fg(m,f),Np(T,!0),T.tail===null&&T.tailMode==="hidden"&&!V.alternate&&!Qt)return jn(m),null}else 2*se()-T.renderingStartTime>Vg&&C!==536870912&&(m.flags|=128,U=!0,Np(T,!1),m.lanes=4194304);T.isBackwards?(V.sibling=m.child,m.child=V):(f=T.last,f!==null?f.sibling=V:m.child=V,T.last=V)}return T.tail!==null?(f=T.tail,T.rendering=f,T.tail=f.sibling,T.renderingStartTime=se(),f.sibling=null,C=cs.current,G(cs,U?C&1|2:C&1),Qt&&Ta(m,T.treeForkCount),f):(jn(m),null);case 22:case 23:return ri(m),Vx(),T=m.memoizedState!==null,f!==null?f.memoizedState!==null!==T&&(m.flags|=8192):T&&(m.flags|=8192),T?(C&536870912)!==0&&(m.flags&128)===0&&(jn(m),m.subtreeFlags&6&&(m.flags|=8192)):jn(m),C=m.updateQueue,C!==null&&Fg(m,C.retryQueue),C=null,f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(C=f.memoizedState.cachePool.pool),T=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),T!==C&&(m.flags|=2048),f!==null&&q(Rc),null;case 24:return C=null,f!==null&&(C=f.memoizedState.cache),m.memoizedState.cache!==C&&(m.flags|=2048),wa(gs),jn(m),null;case 25:return null;case 30:return null}throw Error(s(156,m.tag))}function az(f,m){switch(wx(m),m.tag){case 1:return f=m.flags,f&65536?(m.flags=f&-65537|128,m):null;case 3:return wa(gs),ie(),f=m.flags,(f&65536)!==0&&(f&128)===0?(m.flags=f&-65537|128,m):null;case 26:case 27:case 5:return te(m),null;case 31:if(m.memoizedState!==null){if(ri(m),m.alternate===null)throw Error(s(340));Tc()}return f=m.flags,f&65536?(m.flags=f&-65537|128,m):null;case 13:if(ri(m),f=m.memoizedState,f!==null&&f.dehydrated!==null){if(m.alternate===null)throw Error(s(340));Tc()}return f=m.flags,f&65536?(m.flags=f&-65537|128,m):null;case 19:return q(cs),null;case 4:return ie(),null;case 10:return wa(m.type),null;case 22:case 23:return ri(m),Vx(),f!==null&&q(Rc),f=m.flags,f&65536?(m.flags=f&-65537|128,m):null;case 24:return wa(gs),null;case 25:return null;default:return null}}function UN(f,m){switch(wx(m),m.tag){case 3:wa(gs),ie();break;case 26:case 27:case 5:te(m);break;case 4:ie();break;case 31:m.memoizedState!==null&&ri(m);break;case 13:ri(m);break;case 19:q(cs);break;case 10:wa(m.type);break;case 22:case 23:ri(m),Vx(),f!==null&&q(Rc);break;case 24:wa(gs)}}function wp(f,m){try{var C=m.updateQueue,T=C!==null?C.lastEffect:null;if(T!==null){var U=T.next;C=U;do{if((C.tag&f)===f){T=void 0;var V=C.create,Z=C.inst;T=V(),Z.destroy=T}C=C.next}while(C!==U)}}catch(ae){gn(m,m.return,ae)}}function _l(f,m,C){try{var T=m.updateQueue,U=T!==null?T.lastEffect:null;if(U!==null){var V=U.next;T=V;do{if((T.tag&f)===f){var Z=T.inst,ae=Z.destroy;if(ae!==void 0){Z.destroy=void 0,U=m;var Ae=C,we=ae;try{we()}catch(je){gn(U,Ae,je)}}}T=T.next}while(T!==V)}}catch(je){gn(m,m.return,je)}}function zN(f){var m=f.updateQueue;if(m!==null){var C=f.stateNode;try{D5(m,C)}catch(T){gn(f,f.return,T)}}}function QN(f,m,C){C.props=Lc(f.type,f.memoizedProps),C.state=f.memoizedState;try{C.componentWillUnmount()}catch(T){gn(f,m,T)}}function Rp(f,m){try{var C=f.ref;if(C!==null){switch(f.tag){case 26:case 27:case 5:var T=f.stateNode;break;case 30:T=f.stateNode;break;default:T=f.stateNode}typeof C=="function"?f.refCleanup=C(T):C.current=T}}catch(U){gn(f,m,U)}}function Lo(f,m){var C=f.ref,T=f.refCleanup;if(C!==null)if(typeof T=="function")try{T()}catch(U){gn(f,m,U)}finally{f.refCleanup=null,f=f.alternate,f!=null&&(f.refCleanup=null)}else if(typeof C=="function")try{C(null)}catch(U){gn(f,m,U)}else C.current=null}function HN(f){var m=f.type,C=f.memoizedProps,T=f.stateNode;try{e:switch(m){case"button":case"input":case"select":case"textarea":C.autoFocus&&T.focus();break e;case"img":C.src?T.src=C.src:C.srcSet&&(T.srcset=C.srcSet)}}catch(U){gn(f,f.return,U)}}function bC(f,m,C){try{var T=f.stateNode;wz(T,f.type,C,m),T[Or]=m}catch(U){gn(f,f.return,U)}}function VN(f){return f.tag===5||f.tag===3||f.tag===26||f.tag===27&&Ol(f.type)||f.tag===4}function IC(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||VN(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.tag===27&&Ol(f.type)||f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function SC(f,m,C){var T=f.tag;if(T===5||T===6)f=f.stateNode,m?(C.nodeType===9?C.body:C.nodeName==="HTML"?C.ownerDocument.body:C).insertBefore(f,m):(m=C.nodeType===9?C.body:C.nodeName==="HTML"?C.ownerDocument.body:C,m.appendChild(f),C=C._reactRootContainer,C!=null||m.onclick!==null||(m.onclick=Sa));else if(T!==4&&(T===27&&Ol(f.type)&&(C=f.stateNode,m=null),f=f.child,f!==null))for(SC(f,m,C),f=f.sibling;f!==null;)SC(f,m,C),f=f.sibling}function Ug(f,m,C){var T=f.tag;if(T===5||T===6)f=f.stateNode,m?C.insertBefore(f,m):C.appendChild(f);else if(T!==4&&(T===27&&Ol(f.type)&&(C=f.stateNode),f=f.child,f!==null))for(Ug(f,m,C),f=f.sibling;f!==null;)Ug(f,m,C),f=f.sibling}function GN(f){var m=f.stateNode,C=f.memoizedProps;try{for(var T=f.type,U=m.attributes;U.length;)m.removeAttributeNode(U[0]);Js(m,T,C),m[Ks]=f,m[Or]=C}catch(V){gn(f,f.return,V)}}var Pa=!1,xs=!1,vC=!1,qN=typeof WeakSet=="function"?WeakSet:Set,js=null;function lz(f,m){if(f=f.containerInfo,qC=a0,f=r5(f),Ex(f)){if("selectionStart"in f)var C={start:f.selectionStart,end:f.selectionEnd};else e:{C=(C=f.ownerDocument)&&C.defaultView||window;var T=C.getSelection&&C.getSelection();if(T&&T.rangeCount!==0){C=T.anchorNode;var U=T.anchorOffset,V=T.focusNode;T=T.focusOffset;try{C.nodeType,V.nodeType}catch{C=null;break e}var Z=0,ae=-1,Ae=-1,we=0,je=0,Qe=f,De=null;t:for(;;){for(var ke;Qe!==C||U!==0&&Qe.nodeType!==3||(ae=Z+U),Qe!==V||T!==0&&Qe.nodeType!==3||(Ae=Z+T),Qe.nodeType===3&&(Z+=Qe.nodeValue.length),(ke=Qe.firstChild)!==null;)De=Qe,Qe=ke;for(;;){if(Qe===f)break t;if(De===C&&++we===U&&(ae=Z),De===V&&++je===T&&(Ae=Z),(ke=Qe.nextSibling)!==null)break;Qe=De,De=Qe.parentNode}Qe=ke}C=ae===-1||Ae===-1?null:{start:ae,end:Ae}}else C=null}C=C||{start:0,end:0}}else C=null;for(WC={focusedElem:f,selectionRange:C},a0=!1,js=m;js!==null;)if(m=js,f=m.child,(m.subtreeFlags&1028)!==0&&f!==null)f.return=m,js=f;else for(;js!==null;){switch(m=js,V=m.alternate,f=m.flags,m.tag){case 0:if((f&4)!==0&&(f=m.updateQueue,f=f!==null?f.events:null,f!==null))for(C=0;C<f.length;C++)U=f[C],U.ref.impl=U.nextImpl;break;case 11:case 15:break;case 1:if((f&1024)!==0&&V!==null){f=void 0,C=m,U=V.memoizedProps,V=V.memoizedState,T=C.stateNode;try{var ot=Lc(C.type,U);f=T.getSnapshotBeforeUpdate(ot,V),T.__reactInternalSnapshotBeforeUpdate=f}catch(yt){gn(C,C.return,yt)}}break;case 3:if((f&1024)!==0){if(f=m.stateNode.containerInfo,C=f.nodeType,C===9)YC(f);else if(C===1)switch(f.nodeName){case"HEAD":case"HTML":case"BODY":YC(f);break;default:f.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(s(163))}if(f=m.sibling,f!==null){f.return=m.return,js=f;break}js=m.return}}function WN(f,m,C){var T=C.flags;switch(C.tag){case 0:case 11:case 15:Ma(f,C),T&4&&wp(5,C);break;case 1:if(Ma(f,C),T&4)if(f=C.stateNode,m===null)try{f.componentDidMount()}catch(Z){gn(C,C.return,Z)}else{var U=Lc(C.type,m.memoizedProps);m=m.memoizedState;try{f.componentDidUpdate(U,m,f.__reactInternalSnapshotBeforeUpdate)}catch(Z){gn(C,C.return,Z)}}T&64&&zN(C),T&512&&Rp(C,C.return);break;case 3:if(Ma(f,C),T&64&&(f=C.updateQueue,f!==null)){if(m=null,C.child!==null)switch(C.child.tag){case 27:case 5:m=C.child.stateNode;break;case 1:m=C.child.stateNode}try{D5(f,m)}catch(Z){gn(C,C.return,Z)}}break;case 27:m===null&&T&4&&GN(C);case 26:case 5:Ma(f,C),m===null&&T&4&&HN(C),T&512&&Rp(C,C.return);break;case 12:Ma(f,C);break;case 31:Ma(f,C),T&4&&YN(f,C);break;case 13:Ma(f,C),T&4&&XN(f,C),T&64&&(f=C.memoizedState,f!==null&&(f=f.dehydrated,f!==null&&(C=Az.bind(null,C),jz(f,C))));break;case 22:if(T=C.memoizedState!==null||Pa,!T){m=m!==null&&m.memoizedState!==null||xs,U=Pa;var V=xs;Pa=T,(xs=m)&&!V?ja(f,C,(C.subtreeFlags&8772)!==0):Ma(f,C),Pa=U,xs=V}break;case 30:break;default:Ma(f,C)}}function KN(f){var m=f.alternate;m!==null&&(f.alternate=null,KN(m)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(m=f.stateNode,m!==null&&tx(m)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}var zn=null,Lr=!1;function La(f,m,C){for(C=C.child;C!==null;)$N(f,m,C),C=C.sibling}function $N(f,m,C){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(ht,C)}catch{}switch(C.tag){case 26:xs||Lo(C,m),La(f,m,C),C.memoizedState?C.memoizedState.count--:C.stateNode&&(C=C.stateNode,C.parentNode.removeChild(C));break;case 27:xs||Lo(C,m);var T=zn,U=Lr;Ol(C.type)&&(zn=C.stateNode,Lr=!1),La(f,m,C),Fp(C.stateNode),zn=T,Lr=U;break;case 5:xs||Lo(C,m);case 6:if(T=zn,U=Lr,zn=null,La(f,m,C),zn=T,Lr=U,zn!==null)if(Lr)try{(zn.nodeType===9?zn.body:zn.nodeName==="HTML"?zn.ownerDocument.body:zn).removeChild(C.stateNode)}catch(V){gn(C,m,V)}else try{zn.removeChild(C.stateNode)}catch(V){gn(C,m,V)}break;case 18:zn!==null&&(Lr?(f=zn,z3(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,C.stateNode),kd(f)):z3(zn,C.stateNode));break;case 4:T=zn,U=Lr,zn=C.stateNode.containerInfo,Lr=!0,La(f,m,C),zn=T,Lr=U;break;case 0:case 11:case 14:case 15:_l(2,C,m),xs||_l(4,C,m),La(f,m,C);break;case 1:xs||(Lo(C,m),T=C.stateNode,typeof T.componentWillUnmount=="function"&&QN(C,m,T)),La(f,m,C);break;case 21:La(f,m,C);break;case 22:xs=(T=xs)||C.memoizedState!==null,La(f,m,C),xs=T;break;default:La(f,m,C)}}function YN(f,m){if(m.memoizedState===null&&(f=m.alternate,f!==null&&(f=f.memoizedState,f!==null))){f=f.dehydrated;try{kd(f)}catch(C){gn(m,m.return,C)}}}function XN(f,m){if(m.memoizedState===null&&(f=m.alternate,f!==null&&(f=f.memoizedState,f!==null&&(f=f.dehydrated,f!==null))))try{kd(f)}catch(C){gn(m,m.return,C)}}function cz(f){switch(f.tag){case 31:case 13:case 19:var m=f.stateNode;return m===null&&(m=f.stateNode=new qN),m;case 22:return f=f.stateNode,m=f._retryCache,m===null&&(m=f._retryCache=new qN),m;default:throw Error(s(435,f.tag))}}function zg(f,m){var C=cz(f);m.forEach(function(T){if(!C.has(T)){C.add(T);var U=Ez.bind(null,f,T);T.then(U,U)}})}function Mr(f,m){var C=m.deletions;if(C!==null)for(var T=0;T<C.length;T++){var U=C[T],V=f,Z=m,ae=Z;e:for(;ae!==null;){switch(ae.tag){case 27:if(Ol(ae.type)){zn=ae.stateNode,Lr=!1;break e}break;case 5:zn=ae.stateNode,Lr=!1;break e;case 3:case 4:zn=ae.stateNode.containerInfo,Lr=!0;break e}ae=ae.return}if(zn===null)throw Error(s(160));$N(V,Z,U),zn=null,Lr=!1,V=U.alternate,V!==null&&(V.return=null),U.return=null}if(m.subtreeFlags&13886)for(m=m.child;m!==null;)JN(m,f),m=m.sibling}var no=null;function JN(f,m){var C=f.alternate,T=f.flags;switch(f.tag){case 0:case 11:case 14:case 15:Mr(m,f),jr(f),T&4&&(_l(3,f,f.return),wp(3,f),_l(5,f,f.return));break;case 1:Mr(m,f),jr(f),T&512&&(xs||C===null||Lo(C,C.return)),T&64&&Pa&&(f=f.updateQueue,f!==null&&(T=f.callbacks,T!==null&&(C=f.shared.hiddenCallbacks,f.shared.hiddenCallbacks=C===null?T:C.concat(T))));break;case 26:var U=no;if(Mr(m,f),jr(f),T&512&&(xs||C===null||Lo(C,C.return)),T&4){var V=C!==null?C.memoizedState:null;if(T=f.memoizedState,C===null)if(T===null)if(f.stateNode===null){e:{T=f.type,C=f.memoizedProps,U=U.ownerDocument||U;t:switch(T){case"title":V=U.getElementsByTagName("title")[0],(!V||V[sp]||V[Ks]||V.namespaceURI==="http://www.w3.org/2000/svg"||V.hasAttribute("itemprop"))&&(V=U.createElement(T),U.head.insertBefore(V,U.querySelector("head > title"))),Js(V,T,C),V[Ks]=f,Ms(V),T=V;break e;case"link":var Z=J3("link","href",U).get(T+(C.href||""));if(Z){for(var ae=0;ae<Z.length;ae++)if(V=Z[ae],V.getAttribute("href")===(C.href==null||C.href===""?null:C.href)&&V.getAttribute("rel")===(C.rel==null?null:C.rel)&&V.getAttribute("title")===(C.title==null?null:C.title)&&V.getAttribute("crossorigin")===(C.crossOrigin==null?null:C.crossOrigin)){Z.splice(ae,1);break t}}V=U.createElement(T),Js(V,T,C),U.head.appendChild(V);break;case"meta":if(Z=J3("meta","content",U).get(T+(C.content||""))){for(ae=0;ae<Z.length;ae++)if(V=Z[ae],V.getAttribute("content")===(C.content==null?null:""+C.content)&&V.getAttribute("name")===(C.name==null?null:C.name)&&V.getAttribute("property")===(C.property==null?null:C.property)&&V.getAttribute("http-equiv")===(C.httpEquiv==null?null:C.httpEquiv)&&V.getAttribute("charset")===(C.charSet==null?null:C.charSet)){Z.splice(ae,1);break t}}V=U.createElement(T),Js(V,T,C),U.head.appendChild(V);break;default:throw Error(s(468,T))}V[Ks]=f,Ms(V),T=V}f.stateNode=T}else Z3(U,f.type,f.stateNode);else f.stateNode=X3(U,T,f.memoizedProps);else V!==T?(V===null?C.stateNode!==null&&(C=C.stateNode,C.parentNode.removeChild(C)):V.count--,T===null?Z3(U,f.type,f.stateNode):X3(U,T,f.memoizedProps)):T===null&&f.stateNode!==null&&bC(f,f.memoizedProps,C.memoizedProps)}break;case 27:Mr(m,f),jr(f),T&512&&(xs||C===null||Lo(C,C.return)),C!==null&&T&4&&bC(f,f.memoizedProps,C.memoizedProps);break;case 5:if(Mr(m,f),jr(f),T&512&&(xs||C===null||Lo(C,C.return)),f.flags&32){U=f.stateNode;try{td(U,"")}catch(ot){gn(f,f.return,ot)}}T&4&&f.stateNode!=null&&(U=f.memoizedProps,bC(f,U,C!==null?C.memoizedProps:U)),T&1024&&(vC=!0);break;case 6:if(Mr(m,f),jr(f),T&4){if(f.stateNode===null)throw Error(s(162));T=f.memoizedProps,C=f.stateNode;try{C.nodeValue=T}catch(ot){gn(f,f.return,ot)}}break;case 3:if(s0=null,U=no,no=t0(m.containerInfo),Mr(m,f),no=U,jr(f),T&4&&C!==null&&C.memoizedState.isDehydrated)try{kd(m.containerInfo)}catch(ot){gn(f,f.return,ot)}vC&&(vC=!1,ZN(f));break;case 4:T=no,no=t0(f.stateNode.containerInfo),Mr(m,f),jr(f),no=T;break;case 12:Mr(m,f),jr(f);break;case 31:Mr(m,f),jr(f),T&4&&(T=f.updateQueue,T!==null&&(f.updateQueue=null,zg(f,T)));break;case 13:Mr(m,f),jr(f),f.child.flags&8192&&f.memoizedState!==null!=(C!==null&&C.memoizedState!==null)&&(Hg=se()),T&4&&(T=f.updateQueue,T!==null&&(f.updateQueue=null,zg(f,T)));break;case 22:U=f.memoizedState!==null;var Ae=C!==null&&C.memoizedState!==null,we=Pa,je=xs;if(Pa=we||U,xs=je||Ae,Mr(m,f),xs=je,Pa=we,jr(f),T&8192)e:for(m=f.stateNode,m._visibility=U?m._visibility&-2:m._visibility|1,U&&(C===null||Ae||Pa||xs||Mc(f)),C=null,m=f;;){if(m.tag===5||m.tag===26){if(C===null){Ae=C=m;try{if(V=Ae.stateNode,U)Z=V.style,typeof Z.setProperty=="function"?Z.setProperty("display","none","important"):Z.display="none";else{ae=Ae.stateNode;var Qe=Ae.memoizedProps.style,De=Qe!=null&&Qe.hasOwnProperty("display")?Qe.display:null;ae.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(ot){gn(Ae,Ae.return,ot)}}}else if(m.tag===6){if(C===null){Ae=m;try{Ae.stateNode.nodeValue=U?"":Ae.memoizedProps}catch(ot){gn(Ae,Ae.return,ot)}}}else if(m.tag===18){if(C===null){Ae=m;try{var ke=Ae.stateNode;U?Q3(ke,!0):Q3(Ae.stateNode,!1)}catch(ot){gn(Ae,Ae.return,ot)}}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===f)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===f)break e;for(;m.sibling===null;){if(m.return===null||m.return===f)break e;C===m&&(C=null),m=m.return}C===m&&(C=null),m.sibling.return=m.return,m=m.sibling}T&4&&(T=f.updateQueue,T!==null&&(C=T.retryQueue,C!==null&&(T.retryQueue=null,zg(f,C))));break;case 19:Mr(m,f),jr(f),T&4&&(T=f.updateQueue,T!==null&&(f.updateQueue=null,zg(f,T)));break;case 30:break;case 21:break;default:Mr(m,f),jr(f)}}function jr(f){var m=f.flags;if(m&2){try{for(var C,T=f.return;T!==null;){if(VN(T)){C=T;break}T=T.return}if(C==null)throw Error(s(160));switch(C.tag){case 27:var U=C.stateNode,V=IC(f);Ug(f,V,U);break;case 5:var Z=C.stateNode;C.flags&32&&(td(Z,""),C.flags&=-33);var ae=IC(f);Ug(f,ae,Z);break;case 3:case 4:var Ae=C.stateNode.containerInfo,we=IC(f);SC(f,we,Ae);break;default:throw Error(s(161))}}catch(je){gn(f,f.return,je)}f.flags&=-3}m&4096&&(f.flags&=-4097)}function ZN(f){if(f.subtreeFlags&1024)for(f=f.child;f!==null;){var m=f;ZN(m),m.tag===5&&m.flags&1024&&m.stateNode.reset(),f=f.sibling}}function Ma(f,m){if(m.subtreeFlags&8772)for(m=m.child;m!==null;)WN(f,m.alternate,m),m=m.sibling}function Mc(f){for(f=f.child;f!==null;){var m=f;switch(m.tag){case 0:case 11:case 14:case 15:_l(4,m,m.return),Mc(m);break;case 1:Lo(m,m.return);var C=m.stateNode;typeof C.componentWillUnmount=="function"&&QN(m,m.return,C),Mc(m);break;case 27:Fp(m.stateNode);case 26:case 5:Lo(m,m.return),Mc(m);break;case 22:m.memoizedState===null&&Mc(m);break;case 30:Mc(m);break;default:Mc(m)}f=f.sibling}}function ja(f,m,C){for(C=C&&(m.subtreeFlags&8772)!==0,m=m.child;m!==null;){var T=m.alternate,U=f,V=m,Z=V.flags;switch(V.tag){case 0:case 11:case 15:ja(U,V,C),wp(4,V);break;case 1:if(ja(U,V,C),T=V,U=T.stateNode,typeof U.componentDidMount=="function")try{U.componentDidMount()}catch(we){gn(T,T.return,we)}if(T=V,U=T.updateQueue,U!==null){var ae=T.stateNode;try{var Ae=U.shared.hiddenCallbacks;if(Ae!==null)for(U.shared.hiddenCallbacks=null,U=0;U<Ae.length;U++)R5(Ae[U],ae)}catch(we){gn(T,T.return,we)}}C&&Z&64&&zN(V),Rp(V,V.return);break;case 27:GN(V);case 26:case 5:ja(U,V,C),C&&T===null&&Z&4&&HN(V),Rp(V,V.return);break;case 12:ja(U,V,C);break;case 31:ja(U,V,C),C&&Z&4&&YN(U,V);break;case 13:ja(U,V,C),C&&Z&4&&XN(U,V);break;case 22:V.memoizedState===null&&ja(U,V,C),Rp(V,V.return);break;case 30:break;default:ja(U,V,C)}m=m.sibling}}function _C(f,m){var C=null;f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(C=f.memoizedState.cachePool.pool),f=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(f=m.memoizedState.cachePool.pool),f!==C&&(f!=null&&f.refCount++,C!=null&&gp(C))}function TC(f,m){f=null,m.alternate!==null&&(f=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==f&&(m.refCount++,f!=null&&gp(f))}function so(f,m,C,T){if(m.subtreeFlags&10256)for(m=m.child;m!==null;)e3(f,m,C,T),m=m.sibling}function e3(f,m,C,T){var U=m.flags;switch(m.tag){case 0:case 11:case 15:so(f,m,C,T),U&2048&&wp(9,m);break;case 1:so(f,m,C,T);break;case 3:so(f,m,C,T),U&2048&&(f=null,m.alternate!==null&&(f=m.alternate.memoizedState.cache),m=m.memoizedState.cache,m!==f&&(m.refCount++,f!=null&&gp(f)));break;case 12:if(U&2048){so(f,m,C,T),f=m.stateNode;try{var V=m.memoizedProps,Z=V.id,ae=V.onPostCommit;typeof ae=="function"&&ae(Z,m.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch(Ae){gn(m,m.return,Ae)}}else so(f,m,C,T);break;case 31:so(f,m,C,T);break;case 13:so(f,m,C,T);break;case 23:break;case 22:V=m.stateNode,Z=m.alternate,m.memoizedState!==null?V._visibility&2?so(f,m,C,T):Dp(f,m):V._visibility&2?so(f,m,C,T):(V._visibility|=2,yd(f,m,C,T,(m.subtreeFlags&10256)!==0||!1)),U&2048&&_C(Z,m);break;case 24:so(f,m,C,T),U&2048&&TC(m.alternate,m);break;default:so(f,m,C,T)}}function yd(f,m,C,T,U){for(U=U&&((m.subtreeFlags&10256)!==0||!1),m=m.child;m!==null;){var V=f,Z=m,ae=C,Ae=T,we=Z.flags;switch(Z.tag){case 0:case 11:case 15:yd(V,Z,ae,Ae,U),wp(8,Z);break;case 23:break;case 22:var je=Z.stateNode;Z.memoizedState!==null?je._visibility&2?yd(V,Z,ae,Ae,U):Dp(V,Z):(je._visibility|=2,yd(V,Z,ae,Ae,U)),U&&we&2048&&_C(Z.alternate,Z);break;case 24:yd(V,Z,ae,Ae,U),U&&we&2048&&TC(Z.alternate,Z);break;default:yd(V,Z,ae,Ae,U)}m=m.sibling}}function Dp(f,m){if(m.subtreeFlags&10256)for(m=m.child;m!==null;){var C=f,T=m,U=T.flags;switch(T.tag){case 22:Dp(C,T),U&2048&&_C(T.alternate,T);break;case 24:Dp(C,T),U&2048&&TC(T.alternate,T);break;default:Dp(C,T)}m=m.sibling}}var kp=8192;function bd(f,m,C){if(f.subtreeFlags&kp)for(f=f.child;f!==null;)t3(f,m,C),f=f.sibling}function t3(f,m,C){switch(f.tag){case 26:bd(f,m,C),f.flags&kp&&f.memoizedState!==null&&$z(C,no,f.memoizedState,f.memoizedProps);break;case 5:bd(f,m,C);break;case 3:case 4:var T=no;no=t0(f.stateNode.containerInfo),bd(f,m,C),no=T;break;case 22:f.memoizedState===null&&(T=f.alternate,T!==null&&T.memoizedState!==null?(T=kp,kp=16777216,bd(f,m,C),kp=T):bd(f,m,C));break;default:bd(f,m,C)}}function n3(f){var m=f.alternate;if(m!==null&&(f=m.child,f!==null)){m.child=null;do m=f.sibling,f.sibling=null,f=m;while(f!==null)}}function Op(f){var m=f.deletions;if((f.flags&16)!==0){if(m!==null)for(var C=0;C<m.length;C++){var T=m[C];js=T,r3(T,f)}n3(f)}if(f.subtreeFlags&10256)for(f=f.child;f!==null;)s3(f),f=f.sibling}function s3(f){switch(f.tag){case 0:case 11:case 15:Op(f),f.flags&2048&&_l(9,f,f.return);break;case 3:Op(f);break;case 12:Op(f);break;case 22:var m=f.stateNode;f.memoizedState!==null&&m._visibility&2&&(f.return===null||f.return.tag!==13)?(m._visibility&=-3,Qg(f)):Op(f);break;default:Op(f)}}function Qg(f){var m=f.deletions;if((f.flags&16)!==0){if(m!==null)for(var C=0;C<m.length;C++){var T=m[C];js=T,r3(T,f)}n3(f)}for(f=f.child;f!==null;){switch(m=f,m.tag){case 0:case 11:case 15:_l(8,m,m.return),Qg(m);break;case 22:C=m.stateNode,C._visibility&2&&(C._visibility&=-3,Qg(m));break;default:Qg(m)}f=f.sibling}}function r3(f,m){for(;js!==null;){var C=js;switch(C.tag){case 0:case 11:case 15:_l(8,C,m);break;case 23:case 22:if(C.memoizedState!==null&&C.memoizedState.cachePool!==null){var T=C.memoizedState.cachePool.pool;T!=null&&T.refCount++}break;case 24:gp(C.memoizedState.cache)}if(T=C.child,T!==null)T.return=C,js=T;else e:for(C=f;js!==null;){T=js;var U=T.sibling,V=T.return;if(KN(T),T===C){js=null;break e}if(U!==null){U.return=V,js=U;break e}js=V}}}var uz={getCacheForType:function(f){var m=Ys(gs),C=m.data.get(f);return C===void 0&&(C=f(),m.data.set(f,C)),C},cacheSignal:function(){return Ys(gs).controller.signal}},dz=typeof WeakMap=="function"?WeakMap:Map,on=0,Tn=null,Lt=null,Bt=0,mn=0,ii=null,Tl=!1,Id=!1,NC=!1,Ba=0,Zn=0,Nl=0,jc=0,wC=0,oi=0,Sd=0,Pp=null,Br=null,RC=!1,Hg=0,i3=0,Vg=1/0,Gg=null,wl=null,Ts=0,Rl=null,vd=null,Fa=0,DC=0,kC=null,o3=null,Lp=0,OC=null;function ai(){return(on&2)!==0&&Bt!==0?Bt&-Bt:Q.T!==null?FC():bT()}function a3(){if(oi===0)if((Bt&536870912)===0||Qt){var f=Rr;
vendor: 4,343 bytes, line 8
8Rr<<=1,(Rr&3932160)===0&&(Rr=262144),oi=f}else oi=536870912;return f=si.current,f!==null&&(f.flags|=32),oi}function Fr(f,m,C){(f===Tn&&(mn===2||mn===9)||f.cancelPendingCommit!==null)&&(_d(f,0),Dl(f,Bt,oi,!1)),kr(f,C),((on&2)===0||f!==Tn)&&(f===Tn&&((on&2)===0&&(jc|=C),Zn===4&&Dl(f,Bt,oi,!1)),Mo(f))}function l3(f,m,C){if((on&6)!==0)throw Error(s(327));var T=!C&&(m&127)===0&&(m&f.expiredLanes)===0||$t(f,m),U=T?hz(f,m):LC(f,m,!0),V=T;do{if(U===0){Id&&!T&&Dl(f,m,0,!1);break}else{if(C=f.current.alternate,V&&!fz(C)){U=LC(f,m,!1),V=!1;continue}if(U===2){if(V=m,f.errorRecoveryDisabledLanes&V)var Z=0;else Z=f.pendingLanes&-536870913,Z=Z!==0?Z:Z&536870912?536870912:0;if(Z!==0){m=Z;e:{var ae=f;U=Pp;var Ae=ae.current.memoizedState.isDehydrated;if(Ae&&(_d(ae,Z).flags|=256),Z=LC(ae,Z,!1),Z!==2){if(NC&&!Ae){ae.errorRecoveryDisabledLanes|=V,jc|=V,U=4;break e}V=Br,Br=U,V!==null&&(Br===null?Br=V:Br.push.apply(Br,V))}U=Z}if(V=!1,U!==2)continue}}if(U===1){_d(f,0),Dl(f,m,0,!0);break}e:{switch(T=f,V=U,V){case 0:case 1:throw Error(s(345));case 4:if((m&4194048)!==m)break;case 6:Dl(T,m,oi,!Tl);break e;case 2:Br=null;break;case 3:case 5:break;default:throw Error(s(329))}if((m&62914560)===m&&(U=Hg+300-se(),10<U)){if(Dl(T,m,oi,!Tl),Xn(T,0,!0)!==0)break e;Fa=m,T.timeoutHandle=F3(c3.bind(null,T,C,Br,Gg,RC,m,oi,jc,Sd,Tl,V,"Throttled",-0,0),U);break e}c3(T,C,Br,Gg,RC,m,oi,jc,Sd,Tl,V,null,-0,0)}}break}while(!0);Mo(f)}function c3(f,m,C,T,U,V,Z,ae,Ae,we,je,Qe,De,ke){if(f.timeoutHandle=-1,Qe=m.subtreeFlags,Qe&8192||(Qe&16785408)===16785408){Qe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sa},t3(m,V,Qe);var ot=(V&62914560)===V?Hg-se():(V&4194048)===V?i3-se():0;if(ot=Yz(Qe,ot),ot!==null){Fa=V,f.cancelPendingCommit=ot(A3.bind(null,f,m,V,C,T,U,Z,ae,Ae,je,Qe,null,De,ke)),Dl(f,V,Z,!we);return}}A3(f,m,V,C,T,U,Z,ae,Ae)}function fz(f){for(var m=f;;){var C=m.tag;if((C===0||C===11||C===15)&&m.flags&16384&&(C=m.updateQueue,C!==null&&(C=C.stores,C!==null)))for(var T=0;T<C.length;T++){var U=C[T],V=U.getSnapshot;U=U.value;try{if(!ti(V(),U))return!1}catch{return!1}}if(C=m.child,m.subtreeFlags&16384&&C!==null)C.return=m,m=C;else{if(m===f)break;for(;m.sibling===null;){if(m.return===null||m.return===f)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function Dl(f,m,C,T){m&=~wC,m&=~jc,f.suspendedLanes|=m,f.pingedLanes&=~m,T&&(f.warmLanes|=m),T=f.expirationTimes;for(var U=m;0<U;){var V=31-ft(U),Z=1<<V;T[V]=-1,U&=~Z}C!==0&&xT(f,C,m)}function qg(){return(on&6)===0?(Mp(0),!1):!0}function PC(){if(Lt!==null){if(mn===0)var f=Lt.return;else f=Lt,Na=Nc=null,Yx(f),gd=null,Ep=0,f=Lt;for(;f!==null;)UN(f.alternate,f),f=f.return;Lt=null}}function _d(f,m){var C=f.timeoutHandle;C!==-1&&(f.timeoutHandle=-1,kz(C)),C=f.cancelPendingCommit,C!==null&&(f.cancelPendingCommit=null,C()),Fa=0,PC(),Tn=f,Lt=C=_a(f.current,null),Bt=m,mn=0,ii=null,Tl=!1,Id=$t(f,m),NC=!1,Sd=oi=wC=jc=Nl=Zn=0,Br=Pp=null,RC=!1,(m&8)!==0&&(m|=m&32);var T=f.entangledLanes;if(T!==0)for(f=f.entanglements,T&=m;0<T;){var U=31-ft(T),V=1<<U;m|=f[U],T&=~V}return Ba=m,pg(),C}function u3(f,m){Rt=null,Q.H=_p,m===md||m===yg?(m=_5(),mn=3):m===Bx?(m=_5(),mn=4):mn=m===fC?8:m!==null&&typeof m=="object"&&typeof m.then=="function"?6:1,ii=m,Lt===null&&(Zn=1,Lg(f,Ri(m,f.current)))}function d3(){var f=si.current;return f===null?!0:(Bt&4194048)===Bt?Pi===null:(Bt&62914560)===Bt||(Bt&536870912)!==0?f===Pi:!1}function f3(){var f=Q.H;return Q.H=_p,f===null?_p:f}function p3(){var f=Q.A;return Q.A=uz,f}function Wg(){Zn=4,Tl||(Bt&4194048)!==Bt&&si.current!==null||(Id=!0),(Nl&134217727)===0&&(jc&134217727)===0||Tn===null||Dl(Tn,Bt,oi,!1)}function LC(f,m,C){var T=on;on|=2;var U=f3(),V=p3();(Tn!==f||Bt!==m)&&(Gg=null,_d(f,m)),m=!1;var Z=Zn;e:do try{if(mn!==0&&Lt!==null){var ae=Lt,Ae=ii;switch(mn){case 8:PC(),Z=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(m=!0);var we=mn;if(mn=0,ii=null,Td(f,ae,Ae,we),C&&Id){Z=0;break e}break;default:we=mn,mn=0,ii=null,Td(f,ae,Ae,we)}}pz(),Z=Zn;break}catch(je){u3(f,je)}while(!0);return m&&f.shellSuspendCounter++,Na=Nc=null,on=T,Q.H=U,Q.A=V,Lt===null&&(Tn=null,Bt=0,pg()),Z}function pz(){for(;Lt!==null;)h3(Lt)}function hz(f,m){var C=on;on|=2;var T=f3(),U=p3();Tn!==f||Bt!==m?(Gg=null,Vg=se()+500,_d(f,m)):Id=$t(f,m);e:do try{if(mn!==0&&Lt!==null){m=Lt;var V=ii;
vendor: 4,135 bytes, line 8
8t:switch(mn){case 1:mn=0,ii=null,Td(f,m,V,1);break;case 2:case 9:if(S5(V)){mn=0,ii=null,m3(m);break}m=function(){mn!==2&&mn!==9||Tn!==f||(mn=7),Mo(f)},V.then(m,m);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:S5(V)?(mn=0,ii=null,m3(m)):(mn=0,ii=null,Td(f,m,V,7));break;case 5:var Z=null;switch(Lt.tag){case 26:Z=Lt.memoizedState;case 5:case 27:var ae=Lt;if(Z?e4(Z):ae.stateNode.complete){mn=0,ii=null;var Ae=ae.sibling;if(Ae!==null)Lt=Ae;else{var we=ae.return;we!==null?(Lt=we,Kg(we)):Lt=null}break t}}mn=0,ii=null,Td(f,m,V,5);break;case 6:mn=0,ii=null,Td(f,m,V,6);break;case 8:PC(),Zn=6;break e;default:throw Error(s(462))}}mz();break}catch(je){u3(f,je)}while(!0);return Na=Nc=null,Q.H=T,Q.A=U,on=C,Lt!==null?0:(Tn=null,Bt=0,pg(),Zn)}function mz(){for(;Lt!==null&&!Le();)h3(Lt)}function h3(f){var m=BN(f.alternate,f,Ba);f.memoizedProps=f.pendingProps,m===null?Kg(f):Lt=m}function m3(f){var m=f,C=m.alternate;switch(m.tag){case 15:case 0:m=kN(C,m,m.pendingProps,m.type,void 0,Bt);break;case 11:m=kN(C,m,m.pendingProps,m.type.render,m.ref,Bt);break;case 5:Yx(m);default:UN(C,m),m=Lt=p5(m,Ba),m=BN(C,m,Ba)}f.memoizedProps=f.pendingProps,m===null?Kg(f):Lt=m}function Td(f,m,C,T){Na=Nc=null,Yx(m),gd=null,Ep=0;var U=m.return;try{if(sz(f,U,m,C,Bt)){Zn=1,Lg(f,Ri(C,f.current)),Lt=null;return}}catch(V){if(U!==null)throw Lt=U,V;Zn=1,Lg(f,Ri(C,f.current)),Lt=null;return}m.flags&32768?(Qt||T===1?f=!0:Id||(Bt&536870912)!==0?f=!1:(Tl=f=!0,(T===2||T===9||T===3||T===6)&&(T=si.current,T!==null&&T.tag===13&&(T.flags|=16384))),g3(m,f)):Kg(m)}function Kg(f){var m=f;do{if((m.flags&32768)!==0){g3(m,Tl);return}f=m.return;var C=oz(m.alternate,m,Ba);if(C!==null){Lt=C;return}if(m=m.sibling,m!==null){Lt=m;return}Lt=m=f}while(m!==null);Zn===0&&(Zn=5)}function g3(f,m){do{var C=az(f.alternate,f);if(C!==null){C.flags&=32767,Lt=C;return}if(C=f.return,C!==null&&(C.flags|=32768,C.subtreeFlags=0,C.deletions=null),!m&&(f=f.sibling,f!==null)){Lt=f;return}Lt=f=C}while(f!==null);Zn=6,Lt=null}function A3(f,m,C,T,U,V,Z,ae,Ae){f.cancelPendingCommit=null;do $g();while(Ts!==0);if((on&6)!==0)throw Error(s(327));if(m!==null){if(m===f.current)throw Error(s(177));if(V=m.lanes|m.childLanes,V|=Ix,tg(f,C,V,Z,ae,Ae),f===Tn&&(Lt=Tn=null,Bt=0),vd=m,Rl=f,Fa=C,DC=V,kC=U,o3=T,(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?(f.callbackNode=null,f.callbackPriority=0,xz(Pe,function(){return b3(),null})):(f.callbackNode=null,f.callbackPriority=0),T=(m.flags&13878)!==0,(m.subtreeFlags&13878)!==0||T){T=Q.T,Q.T=null,U=M.p,M.p=2,Z=on,on|=4;try{lz(f,m,C)}finally{on=Z,M.p=U,Q.T=T}}Ts=1,E3(),x3(),C3()}}function E3(){if(Ts===1){Ts=0;var f=Rl,m=vd,C=(m.flags&13878)!==0;if((m.subtreeFlags&13878)!==0||C){C=Q.T,Q.T=null;var T=M.p;M.p=2;var U=on;on|=4;try{JN(m,f);var V=WC,Z=r5(f.containerInfo),ae=V.focusedElem,Ae=V.selectionRange;if(Z!==ae&&ae&&ae.ownerDocument&&s5(ae.ownerDocument.documentElement,ae)){if(Ae!==null&&Ex(ae)){var we=Ae.start,je=Ae.end;if(je===void 0&&(je=we),"selectionStart"in ae)ae.selectionStart=we,ae.selectionEnd=Math.min(je,ae.value.length);else{var Qe=ae.ownerDocument||document,De=Qe&&Qe.defaultView||window;if(De.getSelection){var ke=De.getSelection(),ot=ae.textContent.length,yt=Math.min(Ae.start,ot),In=Ae.end===void 0?yt:Math.min(Ae.end,ot);!ke.extend&&yt>In&&(Z=In,In=yt,yt=Z);var be=n5(ae,yt),Ce=n5(ae,In);if(be&&Ce&&(ke.rangeCount!==1||ke.anchorNode!==be.node||ke.anchorOffset!==be.offset||ke.focusNode!==Ce.node||ke.focusOffset!==Ce.offset)){var Te=Qe.createRange();Te.setStart(be.node,be.offset),ke.removeAllRanges(),yt>In?(ke.addRange(Te),ke.extend(Ce.node,Ce.offset)):(Te.setEnd(Ce.node,Ce.offset),ke.addRange(Te))}}}}for(Qe=[],ke=ae;ke=ke.parentNode;)ke.nodeType===1&&Qe.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof ae.focus=="function"&&ae.focus(),ae=0;ae<Qe.length;ae++){var ze=Qe[ae];ze.element.scrollLeft=ze.left,ze.element.scrollTop=ze.top}}a0=!!qC,WC=qC=null}finally{on=U,M.p=T,Q.T=C}}f.current=m,Ts=2}}function x3(){if(Ts===2){Ts=0;var f=Rl,m=vd,C=(m.flags&8772)!==0;if((m.subtreeFlags&8772)!==0||C){C=Q.T,Q.T=null;var T=M.p;M.p=2;var U=on;on|=4;try{WN(f,m.alternate,m)}finally{on=U,M.p=T,Q.T=C}}Ts=3}}
vendor: 6,155 bytes, line 8
8function C3(){if(Ts===4||Ts===3){Ts=0,Ee();var f=Rl,m=vd,C=Fa,T=o3;(m.subtreeFlags&10256)!==0||(m.flags&10256)!==0?Ts=5:(Ts=0,vd=Rl=null,y3(f,f.pendingLanes));var U=f.pendingLanes;if(U===0&&(wl=null),ZE(C),m=m.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(ht,m,void 0,(m.current.flags&128)===128)}catch{}if(T!==null){m=Q.T,U=M.p,M.p=2,Q.T=null;try{for(var V=f.onRecoverableError,Z=0;Z<T.length;Z++){var ae=T[Z];V(ae.value,{componentStack:ae.stack})}}finally{Q.T=m,M.p=U}}(Fa&3)!==0&&$g(),Mo(f),U=f.pendingLanes,(C&261930)!==0&&(U&42)!==0?f===OC?Lp++:(Lp=0,OC=f):Lp=0,Mp(0)}}function y3(f,m){(f.pooledCacheLanes&=m)===0&&(m=f.pooledCache,m!=null&&(f.pooledCache=null,gp(m)))}function $g(){return E3(),x3(),C3(),b3()}function b3(){if(Ts!==5)return!1;var f=Rl,m=DC;DC=0;var C=ZE(Fa),T=Q.T,U=M.p;try{M.p=32>C?32:C,Q.T=null,C=kC,kC=null;var V=Rl,Z=Fa;if(Ts=0,vd=Rl=null,Fa=0,(on&6)!==0)throw Error(s(331));var ae=on;if(on|=4,s3(V.current),e3(V,V.current,Z,C),on=ae,Mp(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(ht,V)}catch{}return!0}finally{M.p=U,Q.T=T,y3(f,m)}}function I3(f,m,C){m=Ri(C,m),m=dC(f.stateNode,m,2),f=Il(f,m,2),f!==null&&(kr(f,2),Mo(f))}function gn(f,m,C){if(f.tag===3)I3(f,f,C);else for(;m!==null;){if(m.tag===3){I3(m,f,C);break}else if(m.tag===1){var T=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(wl===null||!wl.has(T))){f=Ri(C,f),C=SN(2),T=Il(m,C,2),T!==null&&(vN(C,T,m,f),kr(T,2),Mo(T));break}}m=m.return}}function MC(f,m,C){var T=f.pingCache;if(T===null){T=f.pingCache=new dz;var U=new Set;T.set(m,U)}else U=T.get(m),U===void 0&&(U=new Set,T.set(m,U));U.has(C)||(NC=!0,U.add(C),f=gz.bind(null,f,m,C),m.then(f,f))}function gz(f,m,C){var T=f.pingCache;T!==null&&T.delete(m),f.pingedLanes|=f.suspendedLanes&C,f.warmLanes&=~C,Tn===f&&(Bt&C)===C&&(Zn===4||Zn===3&&(Bt&62914560)===Bt&&300>se()-Hg?(on&2)===0&&_d(f,0):wC|=C,Sd===Bt&&(Sd=0)),Mo(f)}function S3(f,m){m===0&&(m=Dr()),f=vc(f,m),f!==null&&(kr(f,m),Mo(f))}function Az(f){var m=f.memoizedState,C=0;m!==null&&(C=m.retryLane),S3(f,C)}function Ez(f,m){var C=0;switch(f.tag){case 31:case 13:var T=f.stateNode,U=f.memoizedState;U!==null&&(C=U.retryLane);break;case 19:T=f.stateNode;break;case 22:T=f.stateNode._retryCache;break;default:throw Error(s(314))}T!==null&&T.delete(m),S3(f,C)}function xz(f,m){return pe(f,m)}var Yg=null,Nd=null,jC=!1,Xg=!1,BC=!1,kl=0;function Mo(f){f!==Nd&&f.next===null&&(Nd===null?Yg=Nd=f:Nd=Nd.next=f),Xg=!0,jC||(jC=!0,yz())}function Mp(f,m){if(!BC&&Xg){BC=!0;do for(var C=!1,T=Yg;T!==null;){if(f!==0){var U=T.pendingLanes;if(U===0)var V=0;else{var Z=T.suspendedLanes,ae=T.pingedLanes;V=(1<<31-ft(42|f)+1)-1,V&=U&~(Z&~ae),V=V&201326741?V&201326741|1:V?V|2:0}V!==0&&(C=!0,N3(T,V))}else V=Bt,V=Xn(T,T===Tn?V:0,T.cancelPendingCommit!==null||T.timeoutHandle!==-1),(V&3)===0||$t(T,V)||(C=!0,N3(T,V));T=T.next}while(C);BC=!1}}function Cz(){v3()}function v3(){Xg=jC=!1;var f=0;kl!==0&&Dz()&&(f=kl);for(var m=se(),C=null,T=Yg;T!==null;){var U=T.next,V=_3(T,m);V===0?(T.next=null,C===null?Yg=U:C.next=U,U===null&&(Nd=C)):(C=T,(f!==0||(V&3)!==0)&&(Xg=!0)),T=U}Ts!==0&&Ts!==5||Mp(f),kl!==0&&(kl=0)}function _3(f,m){for(var C=f.suspendedLanes,T=f.pingedLanes,U=f.expirationTimes,V=f.pendingLanes&-62914561;0<V;){var Z=31-ft(V),ae=1<<Z,Ae=U[Z];Ae===-1?((ae&C)===0||(ae&T)!==0)&&(U[Z]=Gn(ae,m)):Ae<=m&&(f.expiredLanes|=ae),V&=~ae}if(m=Tn,C=Bt,C=Xn(f,f===m?C:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),T=f.callbackNode,C===0||f===m&&(mn===2||mn===9)||f.cancelPendingCommit!==null)return T!==null&&T!==null&&_e(T),f.callbackNode=null,f.callbackPriority=0;if((C&3)===0||$t(f,C)){if(m=C&-C,m===f.callbackPriority)return m;switch(T!==null&&_e(T),ZE(C)){case 2:case 8:C=ge;break;case 32:C=Pe;break;case 268435456:C=Be;break;default:C=Pe}return T=T3.bind(null,f),C=pe(C,T),f.callbackPriority=m,f.callbackNode=C,m}return T!==null&&T!==null&&_e(T),f.callbackPriority=2,f.callbackNode=null,2}function T3(f,m){if(Ts!==0&&Ts!==5)return f.callbackNode=null,f.callbackPriority=0,null;var C=f.callbackNode;if($g()&&f.callbackNode!==C)return null;var T=Bt;return T=Xn(f,f===Tn?T:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),T===0?null:(l3(f,T,m),_3(f,se()),f.callbackNode!=null&&f.callbackNode===C?T3.bind(null,f):null)}function N3(f,m){if($g())return null;l3(f,m,!0)}function yz(){Oz(function(){(on&6)!==0?pe(de,Cz):v3()})}function FC(){if(kl===0){var f=pd;f===0&&(f=eo,eo<<=1,(eo&261888)===0&&(eo=256)),kl=f}return kl}function w3(f){return f==null||typeof f=="symbol"||typeof f=="boolean"?null:typeof f=="function"?f:ig(""+f)}function R3(f,m){var C=m.ownerDocument.createElement("input");return C.name=m.name,C.value=m.value,f.id&&C.setAttribute("form",f.id),m.parentNode.insertBefore(C,m),f=new FormData(f),C.parentNode.removeChild(C),f}function bz(f,m,C,T,U){if(m==="submit"&&C&&C.stateNode===U){var V=w3((U[Or]||null).action),Z=T.submitter;Z&&(m=(m=Z[Or]||null)?w3(m.formAction):Z.getAttribute("formAction"),m!==null&&(V=m,Z=null));var ae=new cg("action","action",null,T,U);f.push({event:ae,listeners:[{instance:null,listener:function(){if(T.defaultPrevented){if(kl!==0){var Ae=Z?R3(U,Z):new FormData(U);iC(C,{pending:!0,data:Ae,method:U.method,action:V},null,Ae)}}else typeof V=="function"&&(ae.preventDefault(),Ae=Z?R3(U,Z):new FormData(U),iC(C,{pending:!0,data:Ae,method:U.method,action:V},V,Ae))},currentTarget:U}]})}}for(var UC=0;UC<bx.length;UC++){var zC=bx[UC],Iz=zC.toLowerCase(),Sz=zC[0].toUpperCase()+zC.slice(1);to(Iz,"on"+Sz)}to(a5,"onAnimationEnd"),to(l5,"onAnimationIteration"),to(c5,"onAnimationStart"),to("dblclick","onDoubleClick"),to("focusin","onFocus"),to("focusout","onBlur"),to(UU,"onTransitionRun"),to(zU,"onTransitionStart"),to(QU,"onTransitionCancel"),to(u5,"onTransitionEnd"),Zu("onMouseEnter",["mouseout","mouseover"]),Zu("onMouseLeave",["mouseout","mouseover"]),Zu("onPointerEnter",["pointerout","pointerover"]),Zu("onPointerLeave",["pointerout","pointerover"]),yc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yc("onSelect","focusout contextmenu dragend focu
8sin keydown keyup mousedown mouseup selectionchange".split(" ")),yc("onBeforeInput",["compositionend","keypress","textInput","paste"]),yc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jp="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),vz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jp));function D3(f,m){m=(m&4)!==0;for(var C=0;C<f.length;C++){var T=f[C],U=T.event;T=T.listeners;e:{var V=void 0;if(m)for(var Z=T.length-1;0<=Z;Z--){var ae=T[Z],Ae=ae.instance,we=ae.currentTarget;if(ae=ae.listener,Ae!==V&&U.isPropagationStopped())break e;V=ae,U.currentTarget=we;try{V(U)}catch(je){fg(je)}U.currentTarget=null,V=Ae}else for(Z=0;Z<T.length;Z++){if(ae=T[Z],Ae=ae.instance,we=ae.currentTarget,ae=ae.listener,Ae!==V&&U.isPropagationStopped())break e;V=ae,U.currentTarget=we;try{V(U)}catch(je){fg(je)}U.currentTarget=null,V=Ae}}}}function Mt(f,m){var C=m[ex];C===void 0&&(C=m[ex]=new Set);var T=f+"__bubble";C.has(T)||(k3(m,f,2,!1),C.add(T))}function QC(f,m,C){var T=0;m&&(T|=4),k3(C,f,T,m)}var Jg="_reactListening"+Math.random().toString(36).slice(2);function HC(f){if(!f[Jg]){f[Jg]=!0,vT.forEach(function(C){C!=="selectionchange"&&(vz.has(C)||QC(C,!1,f),QC(C,!0,f))});var m=f.nodeType===9?f:f.ownerDocument;m===null||m[Jg]||(m[Jg]=!0,QC("selectionchange",!1,m))}}function k3(f,m,C,T){switch(a4(m)){case 2:var U=Zz;break;case 8:U=eQ;break;default:U=ry}C=U.bind(null,m,C,f),U=void 0,!cx||m!=="touchstart"&&m!=="touchmove"&&m!=="wheel"||(U=!0),T?U!==void 0?f.addEventListener(m,C,{capture:!0,passive:U}):f.addEventListener(m,C,!0):U!==void 0?f.addEventListener(m,C,{passive:U}):f.addEventListener(m,C,!1)}function VC(f,m,C,T,U){var V=T;if((m&1)===0&&(m&2)===0&&T!==null)e:for(;;){if(T===null)return;var Z=T.tag;if(Z===3||Z===4){var ae=T.stateNode.containerInfo;if(ae===U)break;if(Z===4)for(Z=T.return;Z!==null;){var Ae=Z.tag;if((Ae===3||Ae===4)&&Z.stateNode.containerInfo===U)return;Z=Z.return}for(;ae!==null;){if(Z=Yu(ae),Z===null)return;if(Ae=Z.tag,Ae===5||Ae===6||Ae===26||Ae===27){T=V=Z;continue e}ae=ae.parentNode}}T=T.return}jT(function(){var we=V,je=ax(C),Qe=[];e:{var De=d5.get(f);if(De!==void 0){var ke=cg,ot=f;switch(f){case"keypress":if(ag(C)===0)break e;case"keydown":case"keyup":ke=EU;break;case"focusin":ot="focus",ke=px;break;case"focusout":ot="blur",ke=px;break;case"beforeblur":case"afterblur":ke=px;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=UT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=oU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=yU;break;case a5:case l5:case c5:ke=cU;break;case u5:ke=IU;break;case"scroll":case"scrollend":ke=rU;break;case"wheel":ke=vU;break;case"copy":case"cut":case"paste":ke=dU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=QT;break;case"toggle":case"beforetoggle":ke=TU}var yt=(m&4)!==0,In=!yt&&(f==="scroll"||f==="scrollend"),be=yt?De!==null?De+"Capture":null:De;yt=[];for(var Ce=we,Te;Ce!==null;){var ze=Ce;if(Te=ze.stateNode,ze=ze.tag,ze!==5&&ze!==26&&ze!==27||Te===null||be===null||(ze=ip(Ce,be),ze!=null&&yt.push(Bp(Ce,ze,Te))),In)break;Ce=Ce.return}0<yt.length&&(De=new ke(De,ot,null,C,je),Qe.push({event:De,listeners:yt}))}}if((m&7)===0){e:{if(De=f==="mouseover"||f==="pointerover",ke=f==="mouseout"||f==="pointerout",De&&C!==ox&&(ot=C.relatedTarget||C.fromElement)&&(Yu(ot)||ot[$u]))break e;if((ke||De)&&(De=je.window===je?je:(De=je.ownerDocument)?De.defaultView||De.parentWindow:window,ke?(ot=C.relatedTarget||C.toElement,ke=we,ot=ot?Yu(ot):null,ot!==null&&(In=i(ot),yt=ot.tag,ot!==In||yt!==5&&yt!==27&&yt!==6)&&(ot=null)):(ke=null,ot=we),ke!==ot)){if(yt=UT,ze="onMouseLeave",be="onMouseEnter",Ce="mouse",(f==="pointerout"||f==="pointerover")&&(yt=QT,ze="onPointerLeave",be="onPointerEnter",Ce="pointer"),In=ke==null?De:rp(ke),Te=ot==null?De:rp(ot),De=new yt(ze,Ce+"leave",ke,C,je),De.target=In,De.relatedTarget=Te,ze=null,Yu(je)===we&&(yt=new yt(be,Ce+"enter",ot,C,je),yt.target=Te,yt.relatedTarget=In,ze=yt),In=ze,ke&&ot)t:{for(yt=_z,be=ke,Ce=ot,Te=0,ze=be;ze;ze=yt(ze))Te++;ze=0;for(var gt=Ce;gt;gt=yt(gt))ze++;for(;0<Te-ze;)be=yt(be),Te--;for(;0<ze-Te;)Ce=yt(Ce),ze--;for(;Te--;){if(be===Ce||Ce!==null&&be===Ce.alternate){yt=be;break t}be=yt(be),Ce=yt(Ce)}yt=null}else yt=null;ke!==null&&O3(Qe,De,ke,yt,!1),ot!==null&&In!==null&&O3(Qe,In,ot,yt,!0)}}
vendor: 5,258 bytes, lines 8-9
8e:{if(De=we?rp(we):window,ke=De.nodeName&&De.nodeName.toLowerCase(),ke==="select"||ke==="input"&&De.type==="file")var Jt=YT;else if(KT(De))if(XT)Jt=jU;else{Jt=LU;var lt=PU}else ke=De.nodeName,!ke||ke.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?we&&ix(we.elementType)&&(Jt=YT):Jt=MU;if(Jt&&(Jt=Jt(f,we))){$T(Qe,Jt,C,je);break e}lt&&lt(f,De,we),f==="focusout"&&we&&De.type==="number"&&we.memoizedProps.value!=null&&rx(De,"number",De.value)}switch(lt=we?rp(we):window,f){case"focusin":(KT(lt)||lt.contentEditable==="true")&&(id=lt,xx=we,pp=null);break;case"focusout":pp=xx=id=null;break;case"mousedown":Cx=!0;break;case"contextmenu":case"mouseup":case"dragend":Cx=!1,i5(Qe,C,je);break;case"selectionchange":if(FU)break;case"keydown":case"keyup":i5(Qe,C,je)}var Dt;if(mx)e:{switch(f){case"compositionstart":var Ft="onCompositionStart";break e;case"compositionend":Ft="onCompositionEnd";break e;case"compositionupdate":Ft="onCompositionUpdate";break e}Ft=void 0}else rd?qT(f,C)&&(Ft="onCompositionEnd"):f==="keydown"&&C.keyCode===229&&(Ft="onCompositionStart");Ft&&(HT&&C.locale!=="ko"&&(rd||Ft!=="onCompositionStart"?Ft==="onCompositionEnd"&&rd&&(Dt=BT()):(gl=je,ux="value"in gl?gl.value:gl.textContent,rd=!0)),lt=Zg(we,Ft),0<lt.length&&(Ft=new zT(Ft,f,null,C,je),Qe.push({event:Ft,listeners:lt}),Dt?Ft.data=Dt:(Dt=WT(C),Dt!==null&&(Ft.data=Dt)))),(Dt=wU?RU(f,C):DU(f,C))&&(Ft=Zg(we,"onBeforeInput"),0<Ft.length&&(lt=new zT("onBeforeInput","beforeinput",null,C,je),Qe.push({event:lt,listeners:Ft}),lt.data=Dt)),bz(Qe,f,we,C,je)}D3(Qe,m)})}function Bp(f,m,C){return{instance:f,listener:m,currentTarget:C}}function Zg(f,m){for(var C=m+"Capture",T=[];f!==null;){var U=f,V=U.stateNode;if(U=U.tag,U!==5&&U!==26&&U!==27||V===null||(U=ip(f,C),U!=null&&T.unshift(Bp(f,U,V)),U=ip(f,m),U!=null&&T.push(Bp(f,U,V))),f.tag===3)return T;f=f.return}return[]}function _z(f){if(f===null)return null;do f=f.return;while(f&&f.tag!==5&&f.tag!==27);return f||null}function O3(f,m,C,T,U){for(var V=m._reactName,Z=[];C!==null&&C!==T;){var ae=C,Ae=ae.alternate,we=ae.stateNode;if(ae=ae.tag,Ae!==null&&Ae===T)break;ae!==5&&ae!==26&&ae!==27||we===null||(Ae=we,U?(we=ip(C,V),we!=null&&Z.unshift(Bp(C,we,Ae))):U||(we=ip(C,V),we!=null&&Z.push(Bp(C,we,Ae)))),C=C.return}Z.length!==0&&f.push({event:m,listeners:Z})}var Tz=/\r\n?/g,Nz=/\u0000|\uFFFD/g;function P3(f){return(typeof f=="string"?f:""+f).replace(Tz,`
9`).replace(Nz,"")}function L3(f,m){return m=P3(m),P3(f)===m}function bn(f,m,C,T,U,V){switch(C){case"children":typeof T=="string"?m==="body"||m==="textarea"&&T===""||td(f,T):(typeof T=="number"||typeof T=="bigint")&&m!=="body"&&td(f,""+T);break;case"className":sg(f,"class",T);break;case"tabIndex":sg(f,"tabindex",T);break;case"dir":case"role":case"viewBox":case"width":case"height":sg(f,C,T);break;case"style":LT(f,T,V);break;case"data":if(m!=="object"){sg(f,"data",T);break}case"src":case"href":if(T===""&&(m!=="a"||C!=="href")){f.removeAttribute(C);break}if(T==null||typeof T=="function"||typeof T=="symbol"||typeof T=="boolean"){f.removeAttribute(C);break}T=ig(""+T),f.setAttribute(C,T);break;case"action":case"formAction":if(typeof T=="function"){f.setAttribute(C,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof V=="function"&&(C==="formAction"?(m!=="input"&&bn(f,m,"name",U.name,U,null),bn(f,m,"formEncType",U.formEncType,U,null),bn(f,m,"formMethod",U.formMethod,U,null),bn(f,m,"formTarget",U.formTarget,U,null)):(bn(f,m,"encType",U.encType,U,null),bn(f,m,"method",U.method,U,null),bn(f,m,"target",U.target,U,null)));if(T==null||typeof T=="symbol"||typeof T=="boolean"){f.removeAttribute(C);break}T=ig(""+T),f.setAttribute(C,T);break;case"onClick":T!=null&&(f.onclick=Sa);break;case"onScroll":T!=null&&Mt("scroll",f);break;case"onScrollEnd":T!=null&&Mt("scrollend",f);break;case"dangerouslySetInnerHTML":if(T!=null){if(typeof T!="object"||!("__html"in T))throw Error(s(61));if(C=T.__html,C!=null){if(U.children!=null)throw Error(s(60));f.innerHTML=C}}break;case"multiple":f.multiple=T&&typeof T!="function"&&typeof T!="symbol";break;case"muted":f.muted=T&&typeof T!="function"&&typeof T!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(T==null||typeof T=="function"||typeof T=="boolean"||typeof T=="symbol"){f.removeAttribute("xlink:href");break}C=ig(""+T),f.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",C);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":T!=null&&typeof T!="function"&&typeof T!="symbol"?f.setAttribute(C,""+T):f.removeAttribute(C);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
9ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":T&&typeof T!="function"&&typeof T!="symbol"?f.setAttribute(C,""):f.removeAttribute(C);break;case"capture":case"download":T===!0?f.setAttribute(C,""):T!==!1&&T!=null&&typeof T!="function"&&typeof T!="symbol"?f.setAttribute(C,T):f.removeAttribute(C);break;case"cols":case"rows":case"size":case"span":T!=null&&typeof T!="function"&&typeof T!="symbol"&&!isNaN(T)&&1<=T?f.setAttribute(C,T):f.removeAttribute(C);break;case"rowSpan":case"start":T==null||typeof T=="function"||typeof T=="symbol"||isNaN(T)?f.removeAttribute(C):f.setAttribute(C,T);break;case"popover":Mt("beforetoggle",f),Mt("toggle",f),ng(f,"popover",T);break;case"xlinkActuate":Ia(f,"http://www.w3.org/1999/xlink","xlink:actuate",T);break;case"xlinkArcrole":Ia(f,"http://www.w3.org/1999/xlink","xlink:arcrole",T);break;case"xlinkRole":Ia(f,"http://www.w3.org/1999/xlink","xlink:role",T);break;case"xlinkShow":Ia(f,"http://www.w3.org/1999/xlink","xlink:show",T);break;case"xlinkTitle":Ia(f,"http://www.w3.org/1999/xlink","xlink:title",T);break;case"xlinkType":Ia(f,"http://www.w3.org/1999/xlink","xlink:type",T);break;case"xmlBase":Ia(f,"http://www.w3.org/XML/1998/namespace","xml:base",T);break;case"xmlLang":Ia(f,"http://www.w3.org/XML/1998/namespace","xml:lang",T);break;case"xmlSpace":Ia(f,"http://www.w3.org/XML/1998/namespace","xml:space",T);break;case"is":ng(f,"is",T);break;case"innerText":case"textContent":break;default:(!(2<C.length)||C[0]!=="o"&&C[0]!=="O"||C[1]!=="n"&&C[1]!=="N")&&(C=nU.get(C)||C,ng(f,C,T))}}function GC(f,m,C,T,U,V){switch(C){case"style":LT(f,T,V);break;case"dangerouslySetInnerHTML":if(T!=null){if(typeof T!="object"||!("__html"in T))throw Error(s(61));if(C=T.__html,C!=null){if(U.children!=null)throw Error(s(60));f.innerHTML=C}}break;case"children":typeof T=="string"?td(f,T):(typeof T=="number"||typeof T=="bigint")&&td(f,""+T);break;case"onScroll":T!=null&&Mt("scroll",f);break;case"onScrollEnd":T!=null&&Mt("scrollend",f);break;case"onClick":T!=null&&(f.onclick=Sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_T.hasOwnProperty(C))e:{if(C[0]==="o"&&C[1]==="n"&&(U=C.endsWith("Capture"),m=C.slice(2,U?C.length-7:void 0),V=f[Or]||null,V=V!=null?V[C]:null,typeof V=="function"&&f.removeEventListener(m,V,U),typeof T=="function")){typeof V!="function"&&V!==null&&(C in f?f[C]=null:f.hasAttribute(C)&&f.removeAttribute(C)),f.addEventListener(m,T,U);break e}C in f?f[C]=T:T===!0?f.setAttribute(C,""):ng(f,C,T)}}}function Js(f,m,C){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",f),Mt("load",f);var T=!1,U=!1,V;for(V in C)if(C.hasOwnProperty(V)){var Z=C[V];if(Z!=null)switch(V){case"src":T=!0;break;case"srcSet":U=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,m));default:bn(f,m,V,Z,C,null)}}U&&bn(f,m,"srcSet",C.srcSet,C,null),T&&bn(f,m,"src",C.src,C,null);return;case"input":Mt("invalid",f);var ae=V=Z=U=null,Ae=null,we=null;for(T in C)if(C.hasOwnProperty(T)){var je=C[T];if(je!=null)switch(T){case"name":U=je;break;case"type":Z=je;break;case"checked":Ae=je;break;case"defaultChecked":we=je;break;case"value":V=je;break;case"defaultValue":ae=je;break;case"children":case"dangerouslySetInnerHTML":if(je!=null)throw Error(s(137,m));break;default:bn(f,m,T,je,C,null)}}DT(f,V,ae,Ae,we,Z,U,!1);return;case"select":Mt("invalid",f),T=Z=V=null;for(U in C)if(C.hasOwnProperty(U)&&(ae=C[U],ae!=null))switch(U){case"value":V=ae;break;case"defaultValue":Z=ae;break;case"multiple":T=ae;default:bn(f,m,U,ae,C,null)}m=V,C=Z,f.multiple=!!T,m!=null?ed(f,!!T,m,!1):C!=null&&ed(f,!!T,C,!0);return;case"textarea":Mt("invalid",f),V=U=T=null;for(Z in C)if(C.hasOwnProperty(Z)&&(ae=C[Z],ae!=null))switch(Z){case"value":T=ae;break;case"defaultValue":U=ae;break;case"children":V=ae;break;case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(91));break;default:bn(f,m,Z,ae,C,null)}OT(f,T,U,V);return;case"option":for(Ae in C)C.hasOwnProperty(Ae)&&(T=C[Ae],T!=null)&&(Ae==="selected"?f.selected=T&&typeof T!="function"&&typeof T!="symbol":bn(f,m,Ae,T,C,null));return;case"dialog":Mt("beforetoggle",f),Mt("toggle",f),Mt("cancel",f),Mt("close",f);break;case"iframe":case"object":Mt("load",f);break;case"video":case"audio":for(T=0;T<jp.length;T++)Mt(jp[T],f);break;case"image":Mt("error",f),Mt("load",f);break;case"details":Mt("toggle",f);break;case"embed":case"source":case"link":Mt("error",f),Mt("load",f);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(we in C)if(C.hasOwnProperty(we)&&(T=C[we],T!=null))switch(we){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,m));default:bn(f,m,we,T,C,null)}return;default:if(ix(m)){for(je in C)C.hasOwnProperty(je)&&(T=C[je],T!==void 0&&GC(f,m,je,T,C,void 0));return}}for(ae in C)C.hasOwnProperty(ae)&&(T=C[ae],T!=null&&bn(f,m,ae,T,C,null))}function wz(f,m,C,T){switch(m){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var U=null,V=null,Z=null,ae=null,Ae=null,we=null,je=null;for(ke in C){var Qe=C[ke];if(C.hasOwnProperty(ke)&&Qe!=null)switch(ke){case"checked":break;case"value":break;case"defaultValue":Ae=Qe;default:T.hasOwnProperty(ke)||bn(f,m,ke,null,T,Qe)}}for(var De in T){var ke=T[De];if(Qe=C[De],T.hasOwnProperty(De)&&(ke!=null||Qe!=null))switch(De){case"type":V=ke;break;case"name":U=ke;break;case"checked":we=ke;break;case"defaultChecked":je=ke;break;case"value":Z=ke;break;case"defaultValue":ae=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(s(137,m));break;default:ke!==Qe&&bn(f,m,De,ke,T,Qe)}}sx(f,Z,ae,Ae,we,je,V,U);return;case"select":ke=Z=ae=De=null;for(V in C)if(Ae=C[V],C.hasOwnProperty(V)&&Ae!=null)switch(V){case"value":break;case"multiple":ke=Ae;default:T.hasOwnProperty(V)||bn(f,m,V,null,T,Ae)}for(U in T)if(V=T[U],Ae=C[U],T.hasOwnProperty(U)&&(V!=null||Ae!=null))switch(U){case"value":De=V;break;case"defaultValue":ae=V;break;case"multiple":Z=V;default:V!==Ae&&bn(f,m,U,V,T,Ae)}m=ae,C=Z,T=ke,De!=null?ed(f,!!C,De,!1):!!T!=!!C&&(m!=null?ed(f,!!C,m,!0):ed(f,!!C,C?[]:"",!1));return;case"textarea":ke=De=null;for(ae in C)if(U=C[ae],C.hasOwnProperty(ae)&&U!=null&&!T.hasOwnProperty(ae))switch(ae){case"value":break;case"children":break;default:bn(f,m,ae,null,T,U)}for(Z in T)if(U=T[Z],V=C[Z],T.hasOwnProperty(Z)&&(U!=null||V!=null))switch(Z){case"value":De=U;break;case"defaultValue":ke=U;break;case"children":break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:U!==V&&bn(f,m,Z,U,T,V)}kT(f,De,ke);return;case"option":for(var ot in C)De=C[ot],C.hasOwnProperty(ot)&&De!=null&&!T.hasOwnProperty(ot)&&(ot==="selected"?f.selected=!1:bn(f,m,ot,null,T,De));for(Ae in T)De=T[Ae],ke=C[Ae],T.hasOwnProperty(Ae)&&De!==ke&&(De!=null||ke!=null)&&(Ae==="selected"?f.selected=De&&typeof De!="function"&&typeof De!="symbol":bn(f,m,Ae,De,T,ke));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var yt in C)De=C[yt],C.hasOwnProperty(yt)&&De!=null&&!T.hasOwnProperty(yt)&&bn(f,m,yt,null,T,De);for(we in T)if(De=T[we],ke=C[we],T.hasOwnProperty(we)&&De!==ke&&(De!=null||ke!=null))switch(we){case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(s(137,m));break;default:bn(f,m,we,De,T,ke)}return;default:if(ix(m)){for(var In in C)De=C[In],C.hasOwnProperty(In)&&De!==void 0&&!T.hasOwnProperty(In)&&GC(f,m,In,void 0,T,De);for(je in T)De=T[je],ke=C[je],!T.hasOwnProperty(je)||De===ke||De===void 0&&ke===void 0||GC(f,m,je,De,T,ke);return}}for(var be in C)De=C[be],C.hasOwnProperty(be)&&De!=null&&!T.hasOwnProperty(be)&&bn(f,m,be,null,T,De);for(Qe in T)De=T[Qe],ke=C[Qe],!T.hasOwnProperty(Qe)||De===ke||De==null&&ke==null||bn(f,m,Qe,De,T,ke)}function M3(f){switch(f){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rz(){if(typeof performance.getEntriesByType=="function"){for(var f=0,m=0,C=performance.getEntriesByType("resource"),T=0;T<C.length;T++){var U=C[T],V=U.transferSize,Z=U.initiatorType,ae=U.duration;if(V&&ae&&M3(Z)){for(Z=0,ae=U.responseEnd,T+=1;T<C.length;T++){var Ae=C[T],we=Ae.startTime;if(we>ae)break;var je=Ae.transferSize,Qe=Ae.initiatorType;je&&M3(Qe)&&(Ae=Ae.responseEnd,Z+=je*(Ae<ae?1:(ae-we)/(Ae-we)))}if(--T,m+=8*(V+Z)/(U.duration/1e3),f++,10<f)break}}if(0<f)return m/f/1e6}return navigator.connection&&(f=navigator.connection.downlink,typeof f=="number")?f:5}var qC=null,WC=null;function e0(f){return f.nodeType===9?f:f.ownerDocument}function j3(f){switch(f){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function B3(f,m){if(f===0)switch(m){case"svg":return 1;case"math":return 2;default:return 0}return f===1&&m==="foreignObject"?0:f}function KC(f,m){return f==="textarea"||f==="noscript"||typeof m.children=="string"||typeof m.children=="number"||typeof m.children=="bigint"||typeof m.dangerouslySetInnerHTML=="object"&&m.dangerouslySetInnerHTML!==null&&m.dangerouslySetInnerHTML.__html!=null}var $C=null;function Dz(){var f=window.event;return f&&f.type==="popstate"?f===$C?!1:($C=f,!0):($C=null,!1)}var F3=typeof setTimeout=="function"?setTimeout:void 0,kz=typeof clearTimeout=="function"?clearTimeout:void 0,U3=typeof Promise=="function"?Promise:void 0,Oz=typeof queueMicrotask=="function"?queueMicrotask:typeof U3<"u"?function(f){return U3.resolve(null).then(f).catch(Pz)}:F3;function Pz(f){setTimeout(function(){throw f})}function Ol(f){return f==="head"}function z3(f,m){var C=m,T=0;do{var U=C.nextSibling;if(f.removeChild(C),U&&U.nodeType===8)if(C=U.data,C==="/$"||C==="/&"){if(T===0){f.removeChild(U),kd(m);return}T--}else if(C==="$"||C==="$?"||C==="$~"||C==="$!"||C==="&")T++;else if(C==="html")Fp(f.ownerDocument.documentElement);else if(C==="head"){C=f.ownerDocument.head,Fp(C);for(var V=C.firstChild;V;){var Z=V.nextSibling,ae=V.nodeName;V[sp]||ae==="SCRIPT"||ae==="STYLE"||ae==="LINK"&&V.rel.toLowerCase()==="stylesheet"||C.removeChild(V),V=Z}}else C==="body"&&Fp(f.ownerDocument.body);C=U}while(C);kd(m)}function Q3(f,m){var C=f;f=0;do{var T=C.nextSibling;if(C.nodeType===1?m?(C._stashedDisplay=C.style.display,C.style.display="none"):(C.style.display=C._stashedDisplay||"",C.getAttribute("style")===""&&C.removeAttribute("style")):C.nodeType===3&&(m?(C._stashedText=C.nodeValue,C.nodeValue=""):C.nodeValue=C._stashedText||""),T&&T.nodeType===8)if(C=T.data,C==="/$"){if(f===0)break;f--}else C!=="$"&&C!=="$?"&&C!=="$~"&&C!=="$!"||f++;C=T}while(C)}function YC(f){var m=f.firstChild;for(m&&m.nodeType===10&&(m=m.nextSibling);m;){var C=m;switch(m=m.nextSibling,C.nodeName){case"HTML":case"HEAD":case"BODY":YC(C),tx(C);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(C.rel.toLowerCase()==="stylesheet")continue}f.removeChild(C)}}function Lz(f,m,C,T){for(;f.nodeType===1;){var U=C;if(f.nodeName.toLowerCase()!==m.toLowerCase()){if(!T&&(f.nodeName!=="INPUT"||f.type!=="hidden"))break}else if(T){if(!f[sp])switch(m){case"meta":if(!f.hasAttribute("itemprop"))break;return f;case"link":if(V=f.getAttribute("rel"),V==="stylesheet"&&f.hasAttribute("data-precedence"))break;if(V!==U.rel||f.getAttribute("href")!==(U.href==null||U.href===""?null:U.href)||f.getAttribute("crossorigin")!==(U.crossOrigin==null?null:U.crossOrigin)||f.getAttribute("title")!==(U.title==null?null:U.title))break;return f;case"style":if(f.hasAttribute("data-precedence"))break;return f;case"script":if(V=f.getAttribute("src"),(V!==(U.src==null?null:U.src)||f.getAttribute("type")!==(U.type==null?null:U.type)||f.getAttribute("crossorigin")!==(U.crossOrigin==null?null:U.crossOrigin))&&V&&f.hasAttribute("async")&&!f.hasAttribute("itemprop"))break;return f;default:return f}}else if(m==="input"&&f.type==="hidden"){var V=U.name==null?null:""+U.name;if(U.type==="hidden"&&f.getAttribute("name")===V)return f}else return f;if(f=Li(f.nextSibling),f===null)break}return null}function Mz(f,m,C){if(m==="")return null;for(;f.nodeType!==3;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!C||(f=Li(f.nextSibling),f===null))return null;return f}function H3(f,m){for(;f.nodeType!==8;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!m||(f=Li(f.nextSibling),f===null))return null;return f}function XC(f){return f.data==="$?"||f.data==="$~"}function JC(f){return f.data==="$!"||f.data==="$?"&&f.ownerDocument.readyState!=="loading"}function jz(f,m){var C=f.ownerDocument;if(f.data==="$~")f._reactRetry=m;else if(f.data!=="$?"||C.readyState!=="loading")m();else{var T=function(){m(),C.removeEventListener("DOMContentLoaded",T)};C.addEventListener("DOMContentLoaded",T),f._reactRetry=T}}function Li(f){for(;f!=null;f=f.nextSibling){var m=f.nodeType;if(m===1||m===3)break;if(m===8){if(m=f.data,m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"||m==="F!"||m==="F")break;
vendor: 5,080 bytes, line 9
9if(m==="/$"||m==="/&")return null}}return f}var ZC=null;function V3(f){f=f.nextSibling;for(var m=0;f;){if(f.nodeType===8){var C=f.data;if(C==="/$"||C==="/&"){if(m===0)return Li(f.nextSibling);m--}else C!=="$"&&C!=="$!"&&C!=="$?"&&C!=="$~"&&C!=="&"||m++}f=f.nextSibling}return null}function G3(f){f=f.previousSibling;for(var m=0;f;){if(f.nodeType===8){var C=f.data;if(C==="$"||C==="$!"||C==="$?"||C==="$~"||C==="&"){if(m===0)return f;m--}else C!=="/$"&&C!=="/&"||m++}f=f.previousSibling}return null}function q3(f,m,C){switch(m=e0(C),f){case"html":if(f=m.documentElement,!f)throw Error(s(452));return f;case"head":if(f=m.head,!f)throw Error(s(453));return f;case"body":if(f=m.body,!f)throw Error(s(454));return f;default:throw Error(s(451))}}function Fp(f){for(var m=f.attributes;m.length;)f.removeAttributeNode(m[0]);tx(f)}var Mi=new Map,W3=new Set;function t0(f){return typeof f.getRootNode=="function"?f.getRootNode():f.nodeType===9?f:f.ownerDocument}var Ua=M.d;M.d={f:Bz,r:Fz,D:Uz,C:zz,L:Qz,m:Hz,X:Gz,S:Vz,M:qz};function Bz(){var f=Ua.f(),m=qg();return f||m}function Fz(f){var m=Xu(f);m!==null&&m.tag===5&&m.type==="form"?uN(m):Ua.r(f)}var wd=typeof document>"u"?null:document;function K3(f,m,C){var T=wd;if(T&&typeof m=="string"&&m){var U=Ni(m);U='link[rel="'+f+'"][href="'+U+'"]',typeof C=="string"&&(U+='[crossorigin="'+C+'"]'),W3.has(U)||(W3.add(U),f={rel:f,crossOrigin:C,href:m},T.querySelector(U)===null&&(m=T.createElement("link"),Js(m,"link",f),Ms(m),T.head.appendChild(m)))}}function Uz(f){Ua.D(f),K3("dns-prefetch",f,null)}function zz(f,m){Ua.C(f,m),K3("preconnect",f,m)}function Qz(f,m,C){Ua.L(f,m,C);var T=wd;if(T&&f&&m){var U='link[rel="preload"][as="'+Ni(m)+'"]';m==="image"&&C&&C.imageSrcSet?(U+='[imagesrcset="'+Ni(C.imageSrcSet)+'"]',typeof C.imageSizes=="string"&&(U+='[imagesizes="'+Ni(C.imageSizes)+'"]')):U+='[href="'+Ni(f)+'"]';var V=U;switch(m){case"style":V=Rd(f);break;case"script":V=Dd(f)}Mi.has(V)||(f=g({rel:"preload",href:m==="image"&&C&&C.imageSrcSet?void 0:f,as:m},C),Mi.set(V,f),T.querySelector(U)!==null||m==="style"&&T.querySelector(Up(V))||m==="script"&&T.querySelector(zp(V))||(m=T.createElement("link"),Js(m,"link",f),Ms(m),T.head.appendChild(m)))}}function Hz(f,m){Ua.m(f,m);var C=wd;if(C&&f){var T=m&&typeof m.as=="string"?m.as:"script",U='link[rel="modulepreload"][as="'+Ni(T)+'"][href="'+Ni(f)+'"]',V=U;switch(T){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":V=Dd(f)}if(!Mi.has(V)&&(f=g({rel:"modulepreload",href:f},m),Mi.set(V,f),C.querySelector(U)===null)){switch(T){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(C.querySelector(zp(V)))return}T=C.createElement("link"),Js(T,"link",f),Ms(T),C.head.appendChild(T)}}}function Vz(f,m,C){Ua.S(f,m,C);var T=wd;if(T&&f){var U=Ju(T).hoistableStyles,V=Rd(f);m=m||"default";var Z=U.get(V);if(!Z){var ae={loading:0,preload:null};if(Z=T.querySelector(Up(V)))ae.loading=5;else{f=g({rel:"stylesheet",href:f,"data-precedence":m},C),(C=Mi.get(V))&&ey(f,C);var Ae=Z=T.createElement("link");Ms(Ae),Js(Ae,"link",f),Ae._p=new Promise(function(we,je){Ae.onload=we,Ae.onerror=je}),Ae.addEventListener("load",function(){ae.loading|=1}),Ae.addEventListener("error",function(){ae.loading|=2}),ae.loading|=4,n0(Z,m,T)}Z={type:"stylesheet",instance:Z,count:1,state:ae},U.set(V,Z)}}}function Gz(f,m){Ua.X(f,m);var C=wd;if(C&&f){var T=Ju(C).hoistableScripts,U=Dd(f),V=T.get(U);V||(V=C.querySelector(zp(U)),V||(f=g({src:f,async:!0},m),(m=Mi.get(U))&&ty(f,m),V=C.createElement("script"),Ms(V),Js(V,"link",f),C.head.appendChild(V)),V={type:"script",instance:V,count:1,state:null},T.set(U,V))}}function qz(f,m){Ua.M(f,m);var C=wd;if(C&&f){var T=Ju(C).hoistableScripts,U=Dd(f),V=T.get(U);V||(V=C.querySelector(zp(U)),V||(f=g({src:f,async:!0,type:"module"},m),(m=Mi.get(U))&&ty(f,m),V=C.createElement("script"),Ms(V),Js(V,"link",f),C.head.appendChild(V)),V={type:"script",instance:V,count:1,state:null},T.set(U,V))}}function $3(f,m,C,T){var U=(U=ne.current)?t0(U):null;if(!U)throw Error(s(446));switch(f){case"meta":case"title":return null;case"style":return typeof C.precedence=="string"&&typeof C.href=="string"?(m=Rd(C.href),C=Ju(U).hoistableStyles,T=C.get(m),T||(T={type:"style",instance:null,count:0,state:null},C.set(m,T)),T):{type:"void",instance:null,count:0,state:null};case"link":if(C.rel==="stylesheet"&&typeof C.href=="string"&&typeof C.precedence=="string"){f=Rd(C.href);var V=Ju(U).hoistableStyles,Z=V.get(f);if(Z||(U=U.ownerDocument||U,Z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},V.set(f,Z),(V=U.querySelector(Up(f)))&&!V._p&&(Z.instance=V,Z.state.loading=5),Mi.has(f)||(C={rel:"preload",as:"style",href:C.href,crossOrigin:C.crossOrigin,integrity:C.integrity,media:C.media,hrefLang:C.hrefLang,referrerPolicy:C.referrerPolicy},Mi.set(f,C),V||Wz(U,f,C,Z.state))),m&&T===null)throw Error(s(528,""));return Z}if(m&&T!==null)throw Error(s(529,""));return null;case"script":return m=C.async,C=C.src,typeof C=="string"&&m&&typeof m!="function"&&typeof m!="symbol"?
vendor: 5,374 bytes, line 9
9(m=Dd(C),C=Ju(U).hoistableScripts,T=C.get(m),T||(T={type:"script",instance:null,count:0,state:null},C.set(m,T)),T):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,f))}}function Rd(f){return'href="'+Ni(f)+'"'}function Up(f){return'link[rel="stylesheet"]['+f+"]"}function Y3(f){return g({},f,{"data-precedence":f.precedence,precedence:null})}function Wz(f,m,C,T){f.querySelector('link[rel="preload"][as="style"]['+m+"]")?T.loading=1:(m=f.createElement("link"),T.preload=m,m.addEventListener("load",function(){return T.loading|=1}),m.addEventListener("error",function(){return T.loading|=2}),Js(m,"link",C),Ms(m),f.head.appendChild(m))}function Dd(f){return'[src="'+Ni(f)+'"]'}function zp(f){return"script[async]"+f}function X3(f,m,C){if(m.count++,m.instance===null)switch(m.type){case"style":var T=f.querySelector('style[data-href~="'+Ni(C.href)+'"]');if(T)return m.instance=T,Ms(T),T;var U=g({},C,{"data-href":C.href,"data-precedence":C.precedence,href:null,precedence:null});return T=(f.ownerDocument||f).createElement("style"),Ms(T),Js(T,"style",U),n0(T,C.precedence,f),m.instance=T;case"stylesheet":U=Rd(C.href);var V=f.querySelector(Up(U));if(V)return m.state.loading|=4,m.instance=V,Ms(V),V;T=Y3(C),(U=Mi.get(U))&&ey(T,U),V=(f.ownerDocument||f).createElement("link"),Ms(V);var Z=V;return Z._p=new Promise(function(ae,Ae){Z.onload=ae,Z.onerror=Ae}),Js(V,"link",T),m.state.loading|=4,n0(V,C.precedence,f),m.instance=V;case"script":return V=Dd(C.src),(U=f.querySelector(zp(V)))?(m.instance=U,Ms(U),U):(T=C,(U=Mi.get(V))&&(T=g({},C),ty(T,U)),f=f.ownerDocument||f,U=f.createElement("script"),Ms(U),Js(U,"link",T),f.head.appendChild(U),m.instance=U);case"void":return null;default:throw Error(s(443,m.type))}else m.type==="stylesheet"&&(m.state.loading&4)===0&&(T=m.instance,m.state.loading|=4,n0(T,C.precedence,f));return m.instance}function n0(f,m,C){for(var T=C.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),U=T.length?T[T.length-1]:null,V=U,Z=0;Z<T.length;Z++){var ae=T[Z];if(ae.dataset.precedence===m)V=ae;else if(V!==U)break}V?V.parentNode.insertBefore(f,V.nextSibling):(m=C.nodeType===9?C.head:C,m.insertBefore(f,m.firstChild))}function ey(f,m){f.crossOrigin==null&&(f.crossOrigin=m.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=m.referrerPolicy),f.title==null&&(f.title=m.title)}function ty(f,m){f.crossOrigin==null&&(f.crossOrigin=m.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=m.referrerPolicy),f.integrity==null&&(f.integrity=m.integrity)}var s0=null;function J3(f,m,C){if(s0===null){var T=new Map,U=s0=new Map;U.set(C,T)}else U=s0,T=U.get(C),T||(T=new Map,U.set(C,T));if(T.has(f))return T;for(T.set(f,null),C=C.getElementsByTagName(f),U=0;U<C.length;U++){var V=C[U];if(!(V[sp]||V[Ks]||f==="link"&&V.getAttribute("rel")==="stylesheet")&&V.namespaceURI!=="http://www.w3.org/2000/svg"){var Z=V.getAttribute(m)||"";Z=f+Z;var ae=T.get(Z);ae?ae.push(V):T.set(Z,[V])}}return T}function Z3(f,m,C){f=f.ownerDocument||f,f.head.insertBefore(C,m==="title"?f.querySelector("head > title"):null)}function Kz(f,m,C){if(C===1||m.itemProp!=null)return!1;switch(f){case"meta":case"title":return!0;case"style":if(typeof m.precedence!="string"||typeof m.href!="string"||m.href==="")break;return!0;case"link":if(typeof m.rel!="string"||typeof m.href!="string"||m.href===""||m.onLoad||m.onError)break;return m.rel==="stylesheet"?(f=m.disabled,typeof m.precedence=="string"&&f==null):!0;case"script":if(m.async&&typeof m.async!="function"&&typeof m.async!="symbol"&&!m.onLoad&&!m.onError&&m.src&&typeof m.src=="string")return!0}return!1}function e4(f){return!(f.type==="stylesheet"&&(f.state.loading&3)===0)}function $z(f,m,C,T){if(C.type==="stylesheet"&&(typeof T.media!="string"||matchMedia(T.media).matches!==!1)&&(C.state.loading&4)===0){if(C.instance===null){var U=Rd(T.href),V=m.querySelector(Up(U));if(V){m=V._p,m!==null&&typeof m=="object"&&typeof m.then=="function"&&(f.count++,f=r0.bind(f),m.then(f,f)),C.state.loading|=4,C.instance=V,Ms(V);return}V=m.ownerDocument||m,T=Y3(T),(U=Mi.get(U))&&ey(T,U),V=V.createElement("link"),Ms(V);var Z=V;Z._p=new Promise(function(ae,Ae){Z.onload=ae,Z.onerror=Ae}),Js(V,"link",T),C.instance=V}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(C,m),(m=C.state.preload)&&(C.state.loading&3)===0&&(f.count++,C=r0.bind(f),m.addEventListener("load",C),m.addEventListener("error",C))}}var ny=0;function Yz(f,m){return f.stylesheets&&f.count===0&&o0(f,f.stylesheets),0<f.count||0<f.imgCount?function(C){var T=setTimeout(function(){if(f.stylesheets&&o0(f,f.stylesheets),f.unsuspend){var V=f.unsuspend;f.unsuspend=null,V()}},6e4+m);0<f.imgBytes&&ny===0&&(ny=62500*Rz());var U=setTimeout(function(){if(f.waitingForImages=!1,f.count===0&&(f.stylesheets&&o0(f,f.stylesheets),f.unsuspend)){var V=f.unsuspend;f.unsuspend=null,V()}},(f.imgBytes>ny?50:800)+m);return f.unsuspend=C,function(){f.unsuspend=null,clearTimeout(T),clearTimeout(U)}}:null}function r0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)o0(this,this.stylesheets);else if(this.unsuspend){var f=this.unsuspend;this.unsuspend=null,f()}}}var i0=null;function o0(f,m){f.stylesheets=null,f.unsuspend!==null&&(f.count++,i0=new Map,m.forEach(Xz,f),i0=null,r0.call(f))}function Xz(f,m){if(!(m.state.loading&4)){var C=i0.get(f);if(C)var T=C.get(null);
vendor: 10,968 bytes, line 9
9else{C=new Map,i0.set(f,C);for(var U=f.querySelectorAll("link[data-precedence],style[data-precedence]"),V=0;V<U.length;V++){var Z=U[V];(Z.nodeName==="LINK"||Z.getAttribute("media")!=="not all")&&(C.set(Z.dataset.precedence,Z),T=Z)}T&&C.set(null,T)}U=m.instance,Z=U.getAttribute("data-precedence"),V=C.get(Z)||T,V===T&&C.set(null,U),C.set(Z,U),this.count++,T=r0.bind(this),U.addEventListener("load",T),U.addEventListener("error",T),V?V.parentNode.insertBefore(U,V.nextSibling):(f=f.nodeType===9?f.head:f,f.insertBefore(U,f.firstChild)),m.state.loading|=4}}var Qp={$$typeof:b,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Jz(f,m,C,T,U,V,Z,ae,Ae){this.tag=1,this.containerInfo=f,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_i(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_i(0),this.hiddenUpdates=_i(null),this.identifierPrefix=T,this.onUncaughtError=U,this.onCaughtError=V,this.onRecoverableError=Z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ae,this.incompleteTransitions=new Map}function t4(f,m,C,T,U,V,Z,ae,Ae,we,je,Qe){return f=new Jz(f,m,C,Z,Ae,we,je,Qe,ae),m=1,V===!0&&(m|=24),V=ni(3,null,null,m),f.current=V,V.stateNode=f,m=Lx(),m.refCount++,f.pooledCache=m,m.refCount++,V.memoizedState={element:T,isDehydrated:C,cache:m},Fx(V),f}function n4(f){return f?(f=ld,f):ld}function s4(f,m,C,T,U,V){U=n4(U),T.context===null?T.context=U:T.pendingContext=U,T=bl(m),T.payload={element:C},V=V===void 0?null:V,V!==null&&(T.callback=V),C=Il(f,T,m),C!==null&&(Fr(C,f,m),Cp(C,f,m))}function r4(f,m){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var C=f.retryLane;f.retryLane=C!==0&&C<m?C:m}}function sy(f,m){r4(f,m),(f=f.alternate)&&r4(f,m)}function i4(f){if(f.tag===13||f.tag===31){var m=vc(f,67108864);m!==null&&Fr(m,f,67108864),sy(f,67108864)}}function o4(f){if(f.tag===13||f.tag===31){var m=ai();m=JE(m);var C=vc(f,m);C!==null&&Fr(C,f,m),sy(f,m)}}var a0=!0;function Zz(f,m,C,T){var U=Q.T;Q.T=null;var V=M.p;try{M.p=2,ry(f,m,C,T)}finally{M.p=V,Q.T=U}}function eQ(f,m,C,T){var U=Q.T;Q.T=null;var V=M.p;try{M.p=8,ry(f,m,C,T)}finally{M.p=V,Q.T=U}}function ry(f,m,C,T){if(a0){var U=iy(T);if(U===null)VC(f,m,T,l0,C),l4(f,T);else if(nQ(U,f,m,C,T))T.stopPropagation();else if(l4(f,T),m&4&&-1<tQ.indexOf(f)){for(;U!==null;){var V=Xu(U);if(V!==null)switch(V.tag){case 3:if(V=V.stateNode,V.current.memoizedState.isDehydrated){var Z=ei(V.pendingLanes);if(Z!==0){var ae=V;for(ae.pendingLanes|=2,ae.entangledLanes|=2;Z;){var Ae=1<<31-ft(Z);ae.entanglements[1]|=Ae,Z&=~Ae}Mo(V),(on&6)===0&&(Vg=se()+500,Mp(0))}}break;case 31:case 13:ae=vc(V,2),ae!==null&&Fr(ae,V,2),qg(),sy(V,2)}if(V=iy(T),V===null&&VC(f,m,T,l0,C),V===U)break;U=V}U!==null&&T.stopPropagation()}else VC(f,m,T,null,C)}}function iy(f){return f=ax(f),oy(f)}var l0=null;function oy(f){if(l0=null,f=Yu(f),f!==null){var m=i(f);if(m===null)f=null;else{var C=m.tag;if(C===13){if(f=o(m),f!==null)return f;f=null}else if(C===31){if(f=c(m),f!==null)return f;f=null}else if(C===3){if(m.stateNode.current.memoizedState.isDehydrated)return m.tag===3?m.stateNode.containerInfo:null;f=null}else m!==f&&(f=null)}}return l0=f,null}function a4(f){switch(f){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(me()){case de:return 2;case ge:return 8;case Pe:case Ue:return 32;case Be:return 268435456;default:return 32}default:return 32}}var ay=!1,Pl=null,Ll=null,Ml=null,Hp=new Map,Vp=new Map,jl=[],tQ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function l4(f,m){switch(f){case"focusin":case"focusout":Pl=null;break;case"dragenter":case"dragleave":Ll=null;break;case"mouseover":case"mouseout":Ml=null;break;case"pointerover":case"pointerout":Hp.delete(m.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vp.delete(m.pointerId)}}function Gp(f,m,C,T,U,V){return f===null||f.nativeEvent!==V?(f={blockedOn:m,domEventName:C,eventSystemFlags:T,nativeEvent:V,targetContainers:[U]},m!==null&&(m=Xu(m),m!==null&&i4(m)),f):(f.eventSystemFlags|=T,m=f.targetContainers,U!==null&&m.indexOf(U)===-1&&m.push(U),f)}function nQ(f,m,C,T,U){switch(m){case"focusin":return Pl=Gp(Pl,f,m,C,T,U),!0;case"dragenter":return Ll=Gp(Ll,f,m,C,T,U),!0;case"mouseover":return Ml=Gp(Ml,f,m,C,T,U),!0;case"pointerover":var V=U.pointerId;return Hp.set(V,Gp(Hp.get(V)||null,f,m,C,T,U)),!0;case"gotpointercapture":return V=U.pointerId,Vp.set(V,Gp(Vp.get(V)||null,f,m,C,T,U)),!0}return!1}function c4(f){var m=Yu(f.target);if(m!==null){var C=i(m);if(C!==null){if(m=C.tag,m===13){if(m=o(C),m!==null){f.blockedOn=m,IT(f.priority,function(){o4(C)});return}}else if(m===31){if(m=c(C),m!==null){f.blockedOn=m,IT(f.priority,function(){o4(C)});return}}else if(m===3&&C.stateNode.current.memoizedState.isDehydrated){f.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}f.blockedOn=null}function c0(f){if(f.blockedOn!==null)return!1;for(var m=f.targetContainers;0<m.length;){var C=iy(f.nativeEvent);if(C===null){C=f.nativeEvent;var T=new C.constructor(C.type,C);ox=T,C.target.dispatchEvent(T),ox=null}else return m=Xu(C),m!==null&&i4(m),f.blockedOn=C,!1;m.shift()}return!0}function u4(f,m,C){c0(f)&&C.delete(m)}function sQ(){ay=!1,Pl!==null&&c0(Pl)&&(Pl=null),Ll!==null&&c0(Ll)&&(Ll=null),Ml!==null&&c0(Ml)&&(Ml=null),Hp.forEach(u4),Vp.forEach(u4)}function u0(f,m){f.blockedOn===m&&(f.blockedOn=null,ay||(ay=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sQ)))}var d0=null;function d4(f){d0!==f&&(d0=f,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){d0===f&&(d0=null);for(var m=0;m<f.length;m+=3){var C=f[m],T=f[m+1],U=f[m+2];if(typeof T!="function"){if(oy(T||C)===null)continue;break}var V=Xu(C);V!==null&&(f.splice(m,3),m-=3,iC(V,{pending:!0,data:U,method:C.method,action:T},T,U))}}))}function kd(f){function m(Ae){return u0(Ae,f)}Pl!==null&&u0(Pl,f),Ll!==null&&u0(Ll,f),Ml!==null&&u0(Ml,f),Hp.forEach(m),Vp.forEach(m);for(var C=0;C<jl.length;C++){var T=jl[C];T.blockedOn===f&&(T.blockedOn=null)}for(;0<jl.length&&(C=jl[0],C.blockedOn===null);)c4(C),C.blockedOn===null&&jl.shift();if(C=(f.ownerDocument||f).$$reactFormReplay,C!=null)for(T=0;T<C.length;T+=3){var U=C[T],V=C[T+1],Z=U[Or]||null;if(typeof V=="function")Z||d4(C);else if(Z){var ae=null;if(V&&V.hasAttribute("formAction")){if(U=V,Z=V[Or]||null)ae=Z.formAction;else if(oy(U)!==null)continue}else ae=Z.action;typeof ae=="function"?C[T+1]=ae:(C.splice(T,3),T-=3),d4(C)}}}function f4(){function f(V){V.canIntercept&&V.info==="react-transition"&&V.intercept({handler:function(){return new Promise(function(Z){return U=Z})},focusReset:"manual",scroll:"manual"})}function m(){U!==null&&(U(),U=null),T||setTimeout(C,20)}function C(){if(!T&&!navigation.transition){var V=navigation.currentEntry;V&&V.url!=null&&navigation.navigate(V.url,{state:V.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var T=!1,U=null;return navigation.addEventListener("navigate",f),navigation.addEventListener("navigatesuccess",m),navigation.addEventListener("navigateerror",m),setTimeout(C,100),function(){T=!0,navigation.removeEventListener("navigate",f),navigation.removeEventListener("navigatesuccess",m),navigation.removeEventListener("navigateerror",m),U!==null&&(U(),U=null)}}}function ly(f){this._internalRoot=f}f0.prototype.render=ly.prototype.render=function(f){var m=this._internalRoot;if(m===null)throw Error(s(409));var C=m.current,T=ai();s4(C,T,f,m,null,null)},f0.prototype.unmount=ly.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var m=f.containerInfo;s4(f.current,2,null,f,null,null),qg(),m[$u]=null}};function f0(f){this._internalRoot=f}f0.prototype.unstable_scheduleHydration=function(f){if(f){var m=bT();f={blockedOn:null,target:f,priority:m};for(var C=0;C<jl.length&&m!==0&&m<jl[C].priority;C++);jl.splice(C,0,f),C===0&&c4(f)}};var p4=t.version;if(p4!=="19.2.3")throw Error(s(527,p4,"19.2.3"));M.findDOMNode=function(f){var m=f._reactInternals;if(m===void 0)throw typeof f.render=="function"?Error(s(188)):(f=Object.keys(f).join(","),Error(s(268,f)));return f=d(m),f=f!==null?p(f):null,f=f===null?null:f.stateNode,f};var rQ={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var p0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p0.isDisabled&&p0.supportsFiber)try{ht=p0.inject(rQ),dt=p0}catch{}}return Wp.createRoot=function(f,m){if(!r(f))throw Error(s(299));var C=!1,T="",U=CN,V=yN,Z=bN;return m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(T=m.identifierPrefix),m.onUncaughtError!==void 0&&(U=m.onUncaughtError),m.onCaughtError!==void 0&&(V=m.onCaughtError),m.onRecoverableError!==void 0&&(Z=m.onRecoverableError)),m=t4(f,1,!1,null,null,C,T,null,U,V,Z,f4),f[$u]=m.current,HC(f),new ly(m)},Wp.hydrateRoot=function(f,m,C){if(!r(f))throw Error(s(299));var T=!1,U="",V=CN,Z=yN,ae=bN,Ae=null;return C!=null&&(C.unstable_strictMode===!0&&(T=!0),C.identifierPrefix!==void 0&&(U=C.identifierPrefix),C.onUncaughtError!==void 0&&(V=C.onUncaughtError),C.onCaughtError!==void 0&&(Z=C.onCaughtError),C.onRecoverableError!==void 0&&(ae=C.onRecoverableError),C.formState!==void 0&&(Ae=C.formState)),m=t4(f,1,!0,m,C??null,T,U,Ae,V,Z,ae,f4),m.context=n4(null),C=m.current,T=ai(),T=JE(T),U=bl(T),U.callback=null,Il(C,U,T),C=T,m.current.lanes=C,kr(m,C),Mo(m),f[$u]=m.current,HC(f),new f0(m)},Wp.version="19.2.3",Wp}var I4;
vendor: 17,900 bytes, line 9
9function pQ(){if(I4)return dy.exports;I4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dy.exports=fQ(),dy.exports}var hQ=pQ(),Ou=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mQ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gQ=class{#t=mQ;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},Jc=new gQ;function AQ(e){setTimeout(e,0)}var du=typeof window>"u"||"Deno"in globalThis;function dr(){}function EQ(e,t){return typeof e=="function"?e(t):e}function oI(e){return typeof e=="number"&&e>=0&&e!==1/0}function _D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xl(e,t){return typeof e=="function"?e(t):e}function Fi(e,t){return typeof e=="function"?e(t):e}function S4(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:o,stale:c}=e;if(o){if(s){if(t.queryHash!==xv(o,t.options))return!1}else if(!zh(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||r&&r!==t.state.fetchStatus||i&&!i(t))}function v4(e,t){const{exact:n,status:s,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(fu(t.options.mutationKey)!==fu(i))return!1}else if(!zh(t.options.mutationKey,i))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function xv(e,t){return(t?.queryKeyHashFn||fu)(e)}function fu(e){return JSON.stringify(e,(t,n)=>aI(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function zh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>zh(e[n],t[n])):!1}var xQ=Object.prototype.hasOwnProperty;function Cv(e,t){if(e===t)return e;const n=_4(e)&&_4(t);if(!n&&!(aI(e)&&aI(t)))return t;const r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),o=i.length,c=n?new Array(o):{};let u=0;for(let d=0;d<o;d++){const p=n?d:i[d],g=e[p],A=t[p];if(g===A){c[p]=g,(n?d<r:xQ.call(e,p))&&u++;continue}if(g===null||A===null||typeof g!="object"||typeof A!="object"){c[p]=A;continue}const E=Cv(g,A);c[p]=E,E===g&&u++}return r===o&&u===r?e:c}function Qh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _4(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aI(e){if(!T4(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!T4(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function T4(e){return Object.prototype.toString.call(e)==="[object Object]"}function CQ(e){return new Promise(t=>{Jc.setTimeout(t,e)})}function lI(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Cv(e,t):t}function yQ(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function bQ(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var yv=Symbol();function TD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===yv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function bv(e,t){return typeof e=="function"?e(...t):!!e}function IQ(e,t,n){let s=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}var SQ=class extends Ou{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!du&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Iv=new SQ;function cI(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},n.reject=r=>{s({status:"rejected",reason:r}),t(r)},n}var vQ=AQ;function _Q(){let e=[],t=0,n=c=>{c()},s=c=>{c()},r=vQ;const i=c=>{t?e.push(c):r(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&r(()=>{s(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||o()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{s=c},setScheduler:c=>{r=c}}}var rs=_Q(),TQ=class extends Ou{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!du&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},DA=new TQ;function NQ(e){return Math.min(1e3*2**e,3e4)}function ND(e){return(e??"online")==="online"?DA.isOnline():!0}var uI=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wD(e){let t=!1,n=0,s;const r=cI(),i=()=>r.status!=="pending",o=y=>{if(!i()){const I=new uI(y);A(I),e.onCancel?.(I)}},c=()=>{t=!0},u=()=>{t=!1},d=()=>Iv.isFocused()&&(e.networkMode==="always"||DA.isOnline())&&e.canRun(),p=()=>ND(e.networkMode)&&e.canRun(),g=y=>{i()||(s?.(),r.resolve(y))},A=y=>{i()||(s?.(),r.reject(y))},E=()=>new Promise(y=>{s=I=>{(i()||d())&&y(I)},e.onPause?.()}).then(()=>{s=void 0,i()||e.onContinue?.()}),x=()=>{if(i())return;let y;const I=n===0?e.initialPromise:void 0;try{y=I??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(g).catch(v=>{if(i())return;const S=e.retry??(du?0:3),b=e.retryDelay??NQ,w=typeof b=="function"?b(n,v):b,_=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,v);if(t||!_){A(v);return}n++,e.onFail?.(n,v),CQ(w).then(()=>d()?void 0:E()).then(()=>{t?A(v):x()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(s?.(),r),cancelRetry:c,continueRetry:u,canStart:p,start:()=>(p()?x():E().then(x),r)}}var RD=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oI(this.gcTime)&&(this.#t=Jc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(du?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Jc.clearTimeout(this.#t),this.#t=void 0)}},wQ=class extends RD{#t;#e;#n;#r;#s;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=w4(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=w4(this.options);t.data!==void 0&&(this.setState(N4(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=lI(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(dr).catch(dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Fi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_D(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,s=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const c=TD(this.options,t),d=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return s(p),p})();return this.#a=!1,this.options.persister?this.options.persister(c,d,this):c(d)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:r};return s(c),c})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#o({type:"fetch",meta:o.fetchOptions?.meta}),this.#s=wD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof uI&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,u)=>{this.#o({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#s.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof uI){if(c.silent)return this.#s.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#o({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...DD(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...N4(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?s:void 0,s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),rs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function DD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ND(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function N4(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function w4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var L1=class extends Ou{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#a=cI(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#r=void 0;#s;#i;#a;#o;#p;#d;#f;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),R4(this.#e,this.options)?this.#h():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dI(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dI(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#C(),this.#y(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fi(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#e.setOptions(this.options),t._defaulted&&!Qh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&D4(this.#e,n,this.options,t)&&this.#h(),this.updateResult(),s&&(this.#e!==n||Fi(this.options.enabled,this.#e)!==Fi(t.enabled,this.#e)||Xl(this.options.staleTime,this.#e)!==Xl(t.staleTime,this.#e))&&this.#g();const r=this.#A();s&&(this.#e!==n||Fi(this.options.enabled,this.#e)!==Fi(t.enabled,this.#e)||r!==this.#l)&&this.#E(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return DQ(this,n)&&(this.#r=n,this.#i=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#b();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(dr)),t}#g(){this.#C();const e=Xl(this.options.staleTime,this.#e);if(du||this.#r.isStale||!oI(e))return;const n=_D(this.#r.dataUpdatedAt,e)+1;this.#c=Jc.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#A(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#E(e){this.#y(),this.#l=e,!(du||Fi(this.options.enabled,this.#e)===!1||!oI(this.#l)||this.#l===0)&&(this.#u=Jc.setInterval(()=>{(this.options.refetchIntervalInBackground||Iv.isFocused())&&this.#h()},this.#l))}#x(){this.#g(),this.#E(this.#A())}#C(){this.#c&&(Jc.clearTimeout(this.#c),this.#c=void 0)}#y(){this.#u&&(Jc.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,s=this.options,r=this.#r,i=this.#s,o=this.#i,u=e!==n?e.state:this.#n,{state:d}=e;let p={...d},g=!1,A;if(t._optimisticResults){const D=this.hasListeners(),k=!D&&R4(e,t),L=D&&D4(e,n,t,s);(k||L)&&(p={...p,...DD(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:E,errorUpdatedAt:x,status:y}=p;A=p.data;let I=!1;if(t.placeholderData!==void 0&&A===void 0&&y==="pending"){let D;r?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(D=r.data,I=!0):D=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,D!==void 0&&(y="success",A=lI(r?.data,D,t),g=!0)}if(t.select&&A!==void 0&&!I)if(r&&A===i?.data&&t.select===this.#p)A=this.#d;else try{this.#p=t.select,A=t.select(A),A=lI(r?.data,A,t),this.#d=A,this.#o=null}catch(D){this.#o=D}this.#o&&(E=this.#o,A=this.#d,x=Date.now(),y="error");const v=p.fetchStatus==="fetching",S=y==="pending",b=y==="error",w=S&&v,_=A!==void 0,R={status:y,fetchStatus:p.fetchStatus,isPending:S,isSuccess:y==="success",isError:b,isInitialLoading:w,isLoading:w,data:A,dataUpdatedAt:p.dataUpdatedAt,error:E,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdate
9Count:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!S,isLoadingError:b&&!_,isPaused:p.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:b&&_,isStale:Sv(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Fi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=O=>{R.status==="error"?O.reject(R.error):R.data!==void 0&&O.resolve(R.data)},k=()=>{const O=this.#a=R.promise=cI();D(O)},L=this.#a;switch(L.status){case"pending":e.queryHash===n.queryHash&&D(L);break;case"fulfilled":(R.status==="error"||R.data!==L.value)&&k();break;case"rejected":(R.status!=="error"||R.error!==L.reason)&&k();break}}return R}updateResult(){const e=this.#r,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#i=this.options,this.#s.data!==void 0&&(this.#f=this.#e),Qh(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,r=typeof s=="function"?s():s;if(r==="all"||!r&&!this.#m.size)return!0;const i=new Set(r??this.#m);return this.options.throwOnError&&i.add("error"),Object.keys(this.#r).some(o=>{const c=o;return this.#r[c]!==e[c]&&i.has(c)})};this.#I({listeners:n()})}#b(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#I(e){rs.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function RQ(e,t){return Fi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function R4(e,t){return RQ(e,t)||e.state.data!==void 0&&dI(e,t,t.refetchOnMount)}function dI(e,t,n){if(Fi(t.enabled,e)!==!1&&Xl(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&Sv(e,t)}return!1}function D4(e,t,n,s){return(e!==t||Fi(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Sv(e,n)}function Sv(e,t){return Fi(t.enabled,e)!==!1&&e.isStaleByTime(Xl(t.staleTime,e))}function DQ(e,t){return!Qh(e.getCurrentResult(),t)}function kA(e){return{onFetch:(t,n)=>{const s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},u=0;const d=async()=>{let p=!1;const g=x=>{IQ(x,()=>t.signal,()=>p=!0)},A=TD(t.options,t.fetchOptions),E=async(x,y,I)=>{if(p)return Promise.reject();if(y==null&&x.pages.length)return Promise.resolve(x);const S=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:y,direction:I?"backward":"forward",meta:t.options.meta};return g(N),N})(),b=await A(S),{maxPages:w}=t.options,_=I?bQ:yQ;return{pages:_(x.pages,b,w),pageParams:_(x.pageParams,y,w)}};if(r&&i.length){const x=r==="backward",y=x?kD:fI,I={pages:i,pageParams:o},v=y(s,I);c=await E(I,v,x)}else{const x=e??i.length;do{const y=u===0?o[0]??s.initialPageParam:fI(s,c);if(u>0&&y==null)break;c=await E(c,y),u++}while(u<x)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function fI(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function kD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function kQ(e,t){return t?fI(e,t)!=null:!1}function OQ(e,t){return!t||!e.getPreviousPageParam?!1:kD(e,t)!=null}var PQ=class extends L1{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:kA()})}getOptimisticResult(e){return e.behavior=kA(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}
vendor: 4,754 bytes, line 9
9fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,s=super.createResult(e,t),{isFetching:r,isRefetching:i,isError:o,isRefetchError:c}=s,u=n.fetchMeta?.fetchMore?.direction,d=o&&u==="forward",p=r&&u==="forward",g=o&&u==="backward",A=r&&u==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:kQ(t,n.data),hasPreviousPage:OQ(t,n.data),isFetchNextPageError:d,isFetchingNextPage:p,isFetchPreviousPageError:g,isFetchingPreviousPage:A,isRefetchError:c&&!d&&!g,isRefetching:i&&!p&&!A}}},LQ=class extends RD{#t;#e;#n;#r;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||OD(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=wD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#s({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",r=!this.#r.canStart();try{if(s)t();else{this.#s({type:"pending",variables:e,isPaused:r}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#s({type:"pending",context:o,variables:e,isPaused:r})}const i=await this.#r.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#s({type:"success",data:i}),i}catch(i){try{await this.#n.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#s({type:"error",error:i}),i}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),rs.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function OD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var MQ=class extends Ou{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const s=new LQ({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#t.add(e);const t=m0(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=m0(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=m0(e);if(typeof t=="string"){const s=this.#e.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=m0(e);return typeof t=="string"?this.#e.get(t)?.find(s=>
9s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){rs.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>v4(t,n))}findAll(e={}){return this.getAll().filter(t=>v4(e,t))}notify(e){rs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return rs.batch(()=>Promise.all(e.map(t=>t.continue().catch(dr))))}};function m0(e){return e.options.scope?.id}var jQ=class extends Ou{#t;#e=void 0;#n;#r;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),Qh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&fu(n.mutationKey)!==fu(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#i(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??OD();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){rs.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#e.variables,s=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,s,r)}catch(i){Promise.reject(i)}
9try{this.#r.onSettled?.(t.data,null,n,s,r)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,s,r)}catch(i){Promise.reject(i)}try{this.#r.onSettled?.(void 0,t.error,n,s,r)}catch(i){Promise.reject(i)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function k4(e,t){const n=new Set(t);return e.filter(s=>!n.has(s))}function BQ(e,t,n){const s=e.slice(0);return s[t]=n,s}var FQ=class extends Ou{#t;#e;#n;#r;#s;#i;#a;#o;#p=[];constructor(e,t,n){super(),this.#t=e,this.#r=n,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#u(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,rs.batch(()=>{const n=this.#s,s=this.#c(this.#n);s.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const r=s.map(p=>p.observer),i=r.map(p=>p.getCurrentResult()),o=n.length!==r.length,c=r.some((p,g)=>p!==n[g]),u=o||c,d=u?!0:i.some((p,g)=>{const A=this.#e[g];return!A||!Qh(p,A)});!u&&!d||(u&&(this.#p=s,this.#s=r),this.#e=i,this.hasListeners()&&(u&&(k4(n,r).forEach(p=>{p.destroy()}),k4(r,n).forEach(p=>{p.subscribe(g=>{this.#u(p,g)})})),this.#l()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const n=this.#c(e),s=n.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#f(r??s,t),()=>this.#d(s,n)]}#d(e,t){return t.map((n,s)=>{const r=e[s];return n.defaultedQueryOptions.notifyOnChangeProps?r:n.observer.trackResult(r,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#f(e,t){return t?((!this.#i||this.#e!==this.#o||t!==this.#a)&&(this.#a=t,this.#o=this.#e,this.#i=Cv(this.#i,t(e))),this.#i):e}#c(e){const t=new Map;this.#s.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=t.get(r);i?i.push(s):t.set(r,[s])});const n=[];return e.forEach(s=>{const r=this.#t.defaultQueryOptions(s),o=t.get(r.queryHash)?.shift()??new L1(this.#t,r);n.push({defaultedQueryOptions:r,observer:o})}),n}#u(e,t){const n=this.#s.indexOf(e);n!==-1&&(this.#e=BQ(this.#e,n,t),this.#l())}#l(){if(this.hasListeners()){const e=this.#i,t=this.#d(this.#e,this.#p),n=this.#f(t,this.#r?.combine);e!==n&&rs.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},UQ=class extends Ou{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const s=t.queryKey,r=t.queryHash??xv(s,t);let i=this.get(r);return i||(i=new wQ({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(i)),i}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){rs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>S4(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>S4(e,n)):t}notify(e){rs.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zQ=class{#t;#e;#n;#r;#s;#i;#a;#o;constructor(e={}){this.#t=e.queryCache||new UQ,this.#e=e.mutationCache||new MQ,this.#n=e.defaultOptions||{},this.#r=new Map,this.#s=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Iv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=DA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),i=this.#t.get(s.queryHash)?.state.data,o=EQ(t,i);if(o!==void 0)return this.#t.build(this,s).setData(o,{...n,manual:!0})}
9setQueriesData(e,t,n){return rs.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;rs.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return rs.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=rs.batch(()=>this.#t.findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(dr).catch(dr)}invalidateQueries(e,t={}){return rs.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=rs.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(dr)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(dr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Xl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(dr).catch(dr)}fetchInfiniteQuery(e){return e.behavior=kA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(dr).catch(dr)}ensureInfiniteQueryData(e){return e.behavior=kA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return DA.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(fu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{zh(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(fu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{zh(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=xv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yv&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},PD=l.createContext(void 0),bt=e=>{const t=l.useContext(PD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QQ=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(PD.Provider,{value:e,children:t})),LD=l.createContext(!1),MD=()=>l.useContext(LD);LD.Provider;function HQ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var VQ=l.createContext(HQ()),jD=()=>l.useContext(VQ),BD=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?bv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},FD=e=>{l.useEffect(()=>{e.clearReset()},[e])},UD=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||bv(n,[e.error,s])),zD=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QD=(e,t)=>e.isLoading&&e.isFetching&&!t,pI=(e,t)=>e?.suspense&&t.isPending,OA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function GQ({queries:e,...t},n){const s=bt(),r=MD(),i=jD(),o=l.useMemo(()=>e.map(y=>{const I=s.defaultQueryOptions(y);return I._optimisticResults=r?"isRestoring":"optimistic",I}),[e,s,r]);o.forEach(y=>{zD(y);const I=s.getQueryCache().get(y.queryHash);BD(y,i,I)}),FD(i);const[c]=l.useState(()=>new FQ(s,o,t)),[u,d,p]=c.getOptimisticResult(o,t.combine),g=!r&&t.subscribed!==!1;l.useSyncExternalStore(l.useCallback(y=>g?c.subscribe(rs.batchCalls(y)):dr,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),l.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const E=u.some((y,I)=>pI(o[I],y))?u.flatMap((y,I)=>{const v=o[I];if(v){const S=new L1(s,v);if(pI(v,y))return OA(v,S,i);QD(y,r)&&OA(v,S,i)}return[]}):[];if(E.length>0)throw Promise.all(E);const x=u.find((y,I)=>{const v=o[I];return v&&UD({result:y,errorResetBoundary:i,throwOnError:v.throwOnError,query:s.getQueryCache().get(v.queryHash),suspense:v.suspense})});if(x?.error)throw x.error;return d(p())}
9function HD(e,t,n){const s=MD(),r=jD(),i=bt(),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=i.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",zD(o),BD(o,r,c),FD(r);const u=!i.getQueryCache().get(o.queryHash),[d]=l.useState(()=>new t(i,o)),p=d.getOptimisticResult(o),g=!s&&e.subscribed!==!1;if(l.useSyncExternalStore(l.useCallback(A=>{const E=g?d.subscribe(rs.batchCalls(A)):dr;return d.updateResult(),E},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),l.useEffect(()=>{d.setOptions(o)},[o,d]),pI(o,p))throw OA(o,d,r);if(UD({result:p,errorResetBoundary:r,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!du&&QD(p,s)&&(u?OA(o,d,r):c?.promise)?.catch(dr).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?p:d.trackResult(p)}function Vt(e,t){return HD(e,L1)}function tt(e,t){const n=bt(),[s]=l.useState(()=>new jQ(n,e));l.useEffect(()=>{s.setOptions(e)},[s,e]);const r=l.useSyncExternalStore(l.useCallback(o=>s.subscribe(rs.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=l.useCallback((o,c)=>{s.mutate(o,c).catch(dr)},[s]);if(r.error&&bv(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:i,mutateAsync:r.mutate}}function fa(e,t){return HD(e,PQ)}function hI(e,t={},n){for(const s in e){const r=e[s],i=n?`${n}:${s}`:s;typeof r=="object"&&r!==null?hI(r,t,i):typeof r=="function"&&(t[i]=r)}return t}const VD=(()=>{if(console.createTask)return console.createTask;const e={run:t=>t()};return()=>e})();function GD(e,t,n,s){for(let r=n;r<e.length;r+=1)try{const i=s?s.run(()=>e[r](...t)):e[r](...t);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>GD(e,t,r+1,s))}catch(i){return Promise.reject(i)}}function qQ(e,t,n){if(e.length>0)return GD(e,t,0,VD(n))}function WQ(e,t,n){if(e.length>0){const s=VD(n);return Promise.all(e.map(r=>s.run(()=>r(...t))))}}function my(e,t){for(const n of[...e])n(t)}var KQ=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!="function")return()=>{};const s=e;let r;for(;this._deprecatedHooks[e];)r=this._deprecatedHooks[e],e=r.to;if(r&&!n.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let n,s=(...r)=>(typeof n=="function"&&n(),n=void 0,s=void 0,t(...r));return n=this.hook(e,s),n}removeHook(e,t){const n=this._hooks[e];if(n){const s=n.indexOf(t);s!==-1&&n.splice(s,1),n.length===0&&(this._hooks[e]=void 0)}}clearHook(e){this._hooks[e]=void 0}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const n=this._hooks[e]||[];this._hooks[e]=void 0;for(const s of n)this.hook(e,s)}deprecateHooks(e){for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=hI(e),n=Object.keys(t).map(s=>this.hook(s,t[s]));return()=>{for(const s of n)s();n.length=0}}removeHooks(e){const t=hI(e);for(const n in t)this.removeHook(n,t[n])}removeAllHooks(){this._hooks={}}callHook(e,...t){return this.callHookWith(qQ,e,t)}callHookParallel(e,...t){return this.callHookWith(WQ,e,t)}callHookWith(e,t,n){const s=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&my(this._before,s);const r=e(this._hooks[t]?[...this._hooks[t]]:[],n,t);return r instanceof Promise?r.finally(()=>{this._after&&s&&my(this._after,s)}):(this._after&&s&&my(this._after,s),r)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function $Q(){return new KQ}const YQ=new Set(["link","style","script","noscript"]),XQ=new Set(["title","titleTemplate","script","style","noscript"]),mI=new Set(["base","meta","link","style","script","noscript"]),JQ=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),ZQ=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),eH=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),tH=new Set(["templateParams","htmlAttrs","bodyAttrs"]),nH=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]),sH=["name","property","http-equiv"],rH=new Set(["viewport","description","keywords","robots"]);function qD(e){const t=e.split(":");return t.length?nH.has(t[1]):!1}function gI(e){const{props:t,tag:n}=e;if(ZQ.has(n))return n;if(n==="link"&&t.rel==="canonical")return"canonical";if(n==="link"&&t.rel==="alternate"){const s=t.hreflang||t.type;if(s)return`alternate:${s}`}if(t.charset)return"charset";if(e.tag==="meta"){for(const s of sH)if(t[s]!==void 0){const r=t[s],i=r&&typeof r=="string"&&r.includes(":"),o=r&&rH.has(r),u=!(i||o)&&e.key?`:key:${e.key}`:"";return`${n}:${r}${u}`}}if(e.key)return`${n}:key:${e.key}`;if(t.id)return`${n}:id:${t.id}`;if(n==="link"&&t.rel==="alternate")return`alternate:${t.href||""}`;if(XQ.has(n)){const s=e.textContent||e.innerHTML;if(s)return`${n}:content:${s}`}}function WD(e){const t=e._h||e._d;if(t)return t;const n=e.textContent||e.innerHTML;return n||`${e.tag}:${Object.entries(e.props).map(([s,r])=>`${s}:${String(r)}`).join(",")}`}function AI(e,t,n){typeof e==="function"&&(!n||n!=="titleTemplate"&&!(n[0]==="o"&&n[1]==="n"))&&(e=e());const r=t?t(n,e):e;if(Array.isArray(r))return r.map(i=>AI(i,t));if(r?.constructor===Object){const i={};for(const o of Object.keys(r))i[o]=AI(r[o],t,o);return i}return r}function iH(e,t){const n=e==="style"?new Map:new Set;function s(r){if(r==null||r===void 0)return;const i=String(r).trim();if(i)if(e==="style"){const[o,...c]=i.split(":").map(u=>u?u.trim():"");o&&c.length&&n.set(o,c.join(":"))}
9else i.split(" ").filter(Boolean).forEach(o=>n.add(o))}return typeof t=="string"?e==="style"?t.split(";").forEach(s):s(t):Array.isArray(t)?t.forEach(r=>s(r)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,i])=>{i&&i!=="false"&&(e==="style"?n.set(String(r).trim(),String(i)):s(r))}),n}function KD(e,t){if(e.props=e.props||{},!t)return e;if(e.tag==="templateParams")return e.props=t,e;const n=mI.has(e.tag)||e.tag==="htmlAttrs"||e.tag==="bodyAttrs";return Object.entries(t).forEach(([s,r])=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;if(r===null){e.props[s]=null;return}if(s==="class"||s==="style"){e.props[s]=iH(s,r);return}if(eH.has(s)){if((s==="textContent"||s==="innerHTML")&&typeof r=="object"){let d=t.type;if(t.type||(d="application/json"),!d?.endsWith("json")&&d!=="speculationrules")return;t.type=d,e.props.type=d,e[s]=JSON.stringify(r)}else e[s]=r;return}const i=s.startsWith("data-"),o=n&&!i?s.toLowerCase():s,c=String(r),u=e.tag==="meta"&&o==="content";c==="true"||c===""?e.props[o]=i||u?c:!0:!r&&i&&c==="false"?e.props[o]="false":r!==void 0&&(e.props[o]=r)}),e}function oH(e,t){const n=typeof t=="object"&&typeof t!="function"?t:{[e==="script"||e==="noscript"||e==="style"?"innerHTML":"textContent"]:t},s=KD({tag:e,props:{}},n);return s.key&&YQ.has(s.tag)&&(s.props["data-hid"]=s._h=s.key),s.tag==="script"&&typeof s.innerHTML=="object"&&(s.innerHTML=JSON.stringify(s.innerHTML),s.props.type=s.props.type||"application/json"),Array.isArray(s.props.content)?s.props.content.map(r=>({...s,props:{...s.props,content:r}})):s}function aH(e,t){if(!e)return[];typeof e=="function"&&(e=e());const n=(r,i)=>{for(let o=0;o<t.length;o++)i=t[o](r,i);return i};e=n(void 0,e);const s=[];return e=AI(e,n),Object.entries(e||{}).forEach(([r,i])=>{if(i!==void 0)for(const o of Array.isArray(i)?i:[i])s.push(oH(r,o))}),s.flat()}const O4=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,P4={base:-10,title:10},lH={critical:-8,high:-1,low:2},L4={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},cH=/@import/,Kp=e=>e===""||e===!0;function uH(e,t){if(typeof t.tagPriority=="number")return t.tagPriority;let n=100;const s=lH[t.tagPriority]||0,r=e.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:L4;if(t.tag in P4)n=P4[t.tag];else if(t.tag==="meta"){const i=t.props["http-equiv"]==="content-security-policy"?"content-security-policy":t.props.charset?"charset":t.props.name==="viewport"?"viewport":null;i&&(n=L4.meta[i])}else if(t.tag==="link"&&t.props.rel)n=r.link[t.props.rel];else if(t.tag==="script"){const i=String(t.props.type);Kp(t.props.async)?n=r.script.async:t.props.src&&!Kp(t.props.defer)&&!Kp(t.props.async)&&i!=="module"&&!i.endsWith("json")||t.innerHTML&&!i.endsWith("json")?n=r.script.sync:(Kp(t.props.defer)&&t.props.src&&!Kp(t.props.async)||i==="module")&&(n=r.script.defer)}else t.tag==="style"&&(n=t.innerHTML&&cH.test(t.innerHTML)?r.style.imported:r.style.sync);return(n||100)+s}function M4(e,t){const n=typeof t=="function"?t(e):t,s=n.key||String(e.plugins.size+1);e.plugins.get(s)||(e.plugins.set(s,n),e.hooks.addHooks(n.hooks||{}))}function dH(e={}){const t=$Q();t.addHooks(e.hooks||{});const n=!e.document,s=new Map,r=new Map,i=new Set,o={_entryCount:1,plugins:r,dirty:!1,resolvedOptions:e,hooks:t,ssr:n,entries:s,headEntries(){return[...s.values()]},use:c=>M4(o,c),push(c,u){const d={...u||{}};delete d.head;const p=d._index??o._entryCount++,g={_i:p,input:c,options:d},A={_poll(E=!1){o.dirty=!0,!E&&i.add(p),t.callHook("entries:updated",o)},dispose(){s.delete(p)&&o.invalidate()},patch(E){(!d.mode||d.mode==="server"&&n||d.mode==="client"&&!n)&&(g.input=E,s.set(p,g),A._poll())}};return A.patch(c),A},async resolveTags(){const c={tagMap:new Map,tags:[],entries:[...o.entries.values()]};for(await t.callHook("entries:resolve",c);i.size;){const A=i.values().next().value;i.delete(A);const E=s.get(A);if(E){const x={tags:aH(E.input,e.propResolvers||[]).map(y=>Object.assign(y,E.options)),entry:E};await t.callHook("entries:normalize",x),E._tags=x.tags.map((y,I)=>(y._w=uH(o,y),y._p=(E._i<<10)+I,y._d=gI(y),y._d||(y._h=WD(y)),y))}}let u=!1;c.entries.flatMap(A=>(A._tags||[]).map(E=>({...E,props:{...E.props}}))).sort(O4).reduce((A,E)=>{const x=E._d||E._h;
9if(!A.has(x))return A.set(x,E);const y=A.get(x);if((E?.tagDuplicateStrategy||(tH.has(E.tag)?"merge":null)||(E.key&&E.key===y.key?"merge":null))==="merge"){const v={...y.props};Object.entries(E.props).forEach(([S,b])=>v[S]=S==="style"?new Map([...y.props.style||new Map,...b]):S==="class"?new Set([...y.props.class||new Set,...b]):b),A.set(x,{...E,props:v})}else E._p>>10===y._p>>10&&E.tag==="meta"&&qD(x)?(A.set(x,Object.assign([...Array.isArray(y)?y:[y],E],E)),u=!0):(E._w===y._w?E._p>y._p:E?._w<y?._w)&&A.set(x,E);return A},c.tagMap);const d=c.tagMap.get("title"),p=c.tagMap.get("titleTemplate");if(o._title=d?.textContent,p){const A=p?.textContent;if(o._titleTemplate=A,A){let E=typeof A=="function"?A(d?.textContent):A;typeof E=="string"&&!o.plugins.has("template-params")&&(E=E.replace("%s",d?.textContent||"")),d?E===null?c.tagMap.delete("title"):c.tagMap.set("title",{...d,textContent:E}):(p.tag="title",p.textContent=E)}}c.tags=Array.from(c.tagMap.values()),u&&(c.tags=c.tags.flat().sort(O4)),await t.callHook("tags:beforeResolve",c),await t.callHook("tags:resolve",c),await t.callHook("tags:afterResolve",c);const g=[];for(const A of c.tags){const{innerHTML:E,tag:x,props:y}=A;if(JQ.has(x)&&!(Object.keys(y).length===0&&!A.innerHTML&&!A.textContent)&&!(x==="meta"&&!y.content&&!y["http-equiv"]&&!y.charset)){if(x==="script"&&E){if(String(y.type).endsWith("json")){const I=typeof E=="string"?E:JSON.stringify(E);A.innerHTML=I.replace(/</g,"\\u003C")}else typeof E=="string"&&(A.innerHTML=E.replace(new RegExp(`</${x}`,"g"),`<\\/${x}`));A._d=gI(A)}g.push(A)}}return g},invalidate(){for(const c of s.values())i.add(c._i);o.dirty=!0,t.callHook("entries:updated",o)}};return(e?.plugins||[]).forEach(c=>M4(o,c)),o.hooks.callHook("init",o),e.init?.forEach(c=>c&&o.push(c)),o}async function $D(e,t={}){const n=t.document||e.resolvedOptions.document;if(!n||!e.dirty)return;const s={shouldRender:!0,tags:[]};if(await e.hooks.callHook("dom:beforeRender",s),!!s.shouldRender)return e._domUpdatePromise||(e._domUpdatePromise=new Promise(async r=>{const i=new Map,o=new Promise(E=>{e.resolveTags().then(x=>{E(x.map(y=>{const I=i.get(y._d)||0,v={tag:y,id:(I?`${y._d}:${I}`:y._d)||y._h,shouldRender:!0};return y._d&&qD(y._d)&&i.set(y._d,I+1),v}))})});let c=e._dom;if(!c){c={title:n.title,elMap:new Map().set("htmlAttrs",n.documentElement).set("bodyAttrs",n.body)};for(const E of["body","head"]){const x=n[E]?.children;for(const y of x){const I=y.tagName.toLowerCase();if(!mI.has(I))continue;const v=KD({tag:I,props:{}},{innerHTML:y.innerHTML,...y.getAttributeNames().reduce((S,b)=>(S[b]=y.getAttribute(b),S),{})||{}});if(v.key=y.getAttribute("data-hid")||void 0,v._d=gI(v)||WD(v),c.elMap.has(v._d)){let S=1,b=v._d;for(;c.elMap.has(b);)b=`${v._d}:${S++}`;c.elMap.set(b,y)}else c.elMap.set(v._d,y)}}}c.pendingSideEffects={...c.sideEffects},c.sideEffects={};function u(E,x,y){const I=`${E}:${x}`;c.sideEffects[I]=y,delete c.pendingSideEffects[I]}function d({id:E,$el:x,tag:y}){const I=y.tag.endsWith("Attrs");c.elMap.set(E,x),I||(y.textContent&&y.textContent!==x.textContent&&(x.textContent=y.textContent),y.innerHTML&&y.innerHTML!==x.innerHTML&&(x.innerHTML=y.innerHTML),u(E,"el",()=>{x?.remove(),c.elMap.delete(E)}));for(const v in y.props){if(!Object.prototype.hasOwnProperty.call(y.props,v))continue;const S=y.props[v];if(v.startsWith("on")&&typeof S=="function"){const w=x?.dataset;if(w&&w[`${v}fired`]){const _=v.slice(0,-5);S.call(x,new Event(_.substring(2)))}x.getAttribute(`data-${v}`)!==""&&((y.tag==="bodyAttrs"?n.defaultView:x).addEventListener(v.substring(2),S.bind(x)),x.setAttribute(`data-${v}`,""));continue}const b=`attr:${v}`;if(v==="class"){if(!S)continue;for(const w of S)I&&u(E,`${b}:${w}`,()=>x.classList.remove(w)),!x.classList.contains(w)&&x.classList.add(w)}else if(v==="style"){if(!S)continue;for(const[w,_]of S)u(E,`${b}:${w}`,()=>{x.style.removeProperty(w)}),x.style.setProperty(w,_)}else S!==!1&&S!==null&&(x.getAttribute(v)!==S&&x.setAttribute(v,S===!0?"":String(S)),I&&u(E,b,()=>x.removeAttribute(v)))}}const p=[],g={bodyClose:void 0,bodyOpen:void 0,head:void 0},A=await o;for(const E of A){const{tag:x,shouldRender:y,id:I}=E;if(y){if(x.tag==="title"){n.title=x.textContent,u("title","",()=>n.title=c.title);continue}E.$el=E.$el||c.elMap.get(I),E.$el?d(E):mI.has(x.tag)&&p.push(E)}}for(const E of p){const x=E.tag.tagPosition||"head";E.$el=n.createElement(E.tag.tag),d(E),g[x]=g[x]||n.createDocumentFragment(),g[x].appendChild(E.$el)}for(const E of A)await e.hooks.callHook("dom:renderTag",E,n,u);g.head&&n.head.appendChild(g.head),g.bodyOpen&&n.body.insertBefore(g.bodyOpen,n.body.firstChild),g.bodyClose&&n.body.appendChild(g.bodyClose);for(const E in c.pendingSideEffects)c.pendingSideEffects[E]();e._dom=c,await e.hooks.callHook("dom:rendered",{renders:A}),r()}).finally(()=>{e._domUpdatePromise=void 0,e.dirty=!1})),e._domUpdatePromise}function fH(e={}){const t=e.domOptions?.render||$D;e.document=e.document||(typeof window<"u"?document:void 0);const n=e.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return dH({...e,plugins:[...e.plugins||[],{key:"client",hooks:{"entries:updated":t}}],init:[n?JSON.parse(n):!1,...e.init||[]]})}function pH(e,t){let n=0;return()=>{const s=++n;t(()=>{n===s&&e()})}}const YD=l.createContext(null);function XD(e={}){const t=fH({domOptions:{render:pH(()=>$D(t),n=>setTimeout(n,0))},...e});return t}function hH({children:e,head:t}){return l.createElement(YD.Provider,{value:t||XD()},e)}function mH(e,t,n={}){return e.push(t||{},n)}function gH(){const e=l.useContext(YD);if(!e)throw new Error("useHead() was called without provide context.");return e}function AH(e,t,n){const s=t.head||gH(),r=l.useRef(null),i=l.useRef(e);if(i.current=e,s.ssr&&!r.current&&(r.current=n(s,e,t)),l.useEffect(()=>{const c=n(s,i.current,t);return r.current=c,()=>{c.dispose(),r.current=null}},[s]),l.useEffect(()=>{r.current?.patch(e)},[e]),s.ssr)return r.current;const o=l.useRef(null);return o.current||(o.current={patch:c=>{r.current?.patch(c)},dispose:()=>{r.current?.dispose(),r.current=null},_poll:c=>{r.current?._poll(c)}}),o.current}function vv(e={},t={}){return AH(e,t,mH)}var j4="popstate";function B4(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function EH(e={}){function t(s,r){let i=r.state?.masked,{pathname:o,search:c,hash:u}=i||s.location;return EI("",{pathname:o,search:c,hash:u},r.state&&r.state.usr||null,r.state&&r.state.key||"default",i?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,r){return typeof r=="string"?r:Hh(r)}
9return CH(t,n,null,e)}function Bn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $i(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xH(){return Math.random().toString(36).substring(2,10)}function F4(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function EI(e,t,n=null,s,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Pf(t):t,state:n,key:t&&t.key||s||xH(),mask:r}}function Hh({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Pf(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function CH(e,t,n,s={}){let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,c="POP",u=null,d=p();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function p(){return(o.state||{idx:null}).idx}function g(){c="POP";let I=p(),v=I==null?null:I-d;d=I,u&&u({action:c,location:y.location,delta:v})}function A(I,v){c="PUSH";let S=B4(I)?I:EI(y.location,I,v);d=p()+1;let b=F4(S,d),w=y.createHref(S.mask||S);try{o.pushState(b,"",w)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;r.location.assign(w)}i&&u&&u({action:c,location:y.location,delta:1})}function E(I,v){c="REPLACE";let S=B4(I)?I:EI(y.location,I,v);d=p();let b=F4(S,d),w=y.createHref(S.mask||S);o.replaceState(b,"",w),i&&u&&u({action:c,location:y.location,delta:0})}function x(I){return yH(r,I)}let y={get action(){return c},get location(){return e(r,o)},listen(I){if(u)throw new Error("A history only accepts one active listener");return r.addEventListener(j4,g),u=I,()=>{r.removeEventListener(j4,g),u=null}},createHref(I){return t(r,I)},createURL:x,encodeLocation(I){let v=x(I);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:A,replace:E,go(I){return o.go(I)}};return y}function yH(e,t,n=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),Bn(s,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:Hh(t);return r=r.replace(/ $/,"%20"),!n&&r.startsWith("//")&&(r=s+r),new URL(r,s)}function JD(e,t,n="/"){return bH(e,t,n,!1)}function bH(e,t,n,s,r){let i=typeof t=="string"?Pf(t):t,o=sl(i.pathname||"/",n);if(o==null)return null;let c=IH(e),u=null,d=tk(o);for(let p=0;u==null&&p<c.length;++p)u=OH(c[p],d,s);return u}function IH(e){let t=ZD(e);return SH(t),t}function ZD(e,t=[],n=[],s="",r=!1){let i=(o,c,u=r,d)=>{let p={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(s)&&u)return;Bn(p.relativePath.startsWith(s),`Absolute route path "${p.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(s.length)}let g=po([s,p.relativePath]),A=n.concat(p);o.children&&o.children.length>0&&(Bn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),ZD(o.children,t,A,g,u)),!(o.path==null&&!o.index)&&t.push({path:g,score:DH(g,o.index),routesMeta:A})};return e.forEach((o,c)=>{if(o.path===""||!o.path?.includes("?"))i(o,c);else for(let u of ek(o.path))i(o,c,!0,u)}),t}function ek(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=ek(s.join("/")),c=[];return c.push(...o.map(u=>u===""?i:[i,u].join("/"))),r&&c.push(...o),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function SH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kH(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var vH=/^:[\w-]+$/,_H=3,TH=2,NH=1,wH=10,RH=-2,U4=e=>e==="*";function DH(e,t){let n=e.split("/"),s=n.length;return n.some(U4)&&(s+=RH),t&&(s+=TH),n.filter(r=>!U4(r)).reduce((r,i)=>r+(vH.test(i)?_H:i===""?NH:wH),s)}function kH(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function OH(e,t,n=!1){let{routesMeta:s}=e,r={},i="/",o=[];for(let c=0;c<s.length;++c){let u=s[c],d=c===s.length-1,p=i==="/"?t:t.slice(i.length)||"/",g=qs({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),A=u.route;if(!g&&d&&n&&!s[s.length-1].route.index&&(g=qs({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!g)return null;
9Object.assign(r,g.params),o.push({params:r,pathname:po([i,g.pathname]),pathnameBase:BH(po([i,g.pathnameBase])),route:A}),g.pathnameBase!=="/"&&(i=po([i,g.pathnameBase]))}return o}function qs(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=PH(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:s.reduce((d,{paramName:p,isOptional:g},A)=>{if(p==="*"){let x=c[A]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const E=c[A];return g&&!E?d[p]=void 0:d[p]=(E||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function PH(e,t=!1,n=!0){$i(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,u,d,p)=>{if(s.push({paramName:c,isOptional:u!=null}),u){let g=p.charAt(d+o.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function tk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $i(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function sl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var LH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function MH(e,t="/"){let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?Pf(e):e,i;return n?(n=nk(n),n.startsWith("/")?i=z4(n.substring(1),"/"):i=z4(n,t)):i=t,{pathname:i,search:FH(s),hash:UH(r)}}function z4(e,t){let n=PA(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function gy(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _v(e){let t=jH(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function M1(e,t,n,s=!1){let r;typeof e=="string"?r=Pf(e):(r={...e},Bn(!r.pathname||!r.pathname.includes("?"),gy("?","pathname","search",r)),Bn(!r.pathname||!r.pathname.includes("#"),gy("#","pathname","hash",r)),Bn(!r.search||!r.search.includes("#"),gy("#","search","hash",r)));let i=e===""||r.pathname==="",o=i?"/":r.pathname,c;if(o==null)c=n;else{let g=t.length-1;if(!s&&o.startsWith("..")){let A=o.split("/");for(;A[0]==="..";)A.shift(),g-=1;r.pathname=A.join("/")}c=g>=0?t[g]:"/"}let u=MH(r,c),d=o&&o!=="/"&&o.endsWith("/"),p=(i||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}var nk=e=>e.replace(/\/\/+/g,"/"),po=e=>nk(e.join("/")),PA=e=>e.replace(/\/+$/,""),BH=e=>PA(e).replace(/^\/*/,"/"),FH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zH=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function QH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function HH(e){let t=e.map(n=>n.route.path).filter(Boolean);return po(t)||"/"}var sk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rk(e,t){let n=e;if(typeof n!="string"||!LH.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(sk)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),c=sl(o.pathname,t);
9o.origin===i.origin&&c!=null?n=c+o.search+o.hash:r=!0}catch{$i(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ik=["POST","PUT","PATCH","DELETE"];new Set(ik);var VH=["GET",...ik];new Set(VH);var Lf=l.createContext(null);Lf.displayName="DataRouter";var j1=l.createContext(null);j1.displayName="DataRouterState";var ok=l.createContext(!1);function GH(){return l.useContext(ok)}var ak=l.createContext({isTransitioning:!1});ak.displayName="ViewTransition";var qH=l.createContext(new Map);qH.displayName="Fetchers";var WH=l.createContext(null);WH.displayName="Await";var bi=l.createContext(null);bi.displayName="Navigation";var Mf=l.createContext(null);Mf.displayName="Location";var Yi=l.createContext({outlet:null,matches:[],isDataRoute:!1});Yi.displayName="Route";var Tv=l.createContext(null);Tv.displayName="RouteError";var lk="REACT_ROUTER_ERROR",KH="REDIRECT",$H="ROUTE_ERROR_RESPONSE";function YH(e){if(e.startsWith(`${lk}:${KH}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function XH(e){if(e.startsWith(`${lk}:${$H}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new zH(t.status,t.statusText,t.data)}catch{}}function JH(e,{relative:t}={}){Bn(Pu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=l.useContext(bi),{hash:r,pathname:i,search:o}=Em(e,{relative:t}),c=i;return n!=="/"&&(c=i==="/"?n:po([n,i])),s.createHref({pathname:c,search:o,hash:r})}function Pu(){return l.useContext(Mf)!=null}function Fe(){return Bn(Pu(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(Mf).location}function ck(){return l.useContext(Mf).navigationType}function Ct(e){Bn(Pu(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Fe();return l.useMemo(()=>qs(e,tk(t)),[t,e])}var uk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dk(e){l.useContext(bi).static||l.useLayoutEffect(e)}function at(){let{isDataRoute:e}=l.useContext(Yi);return e?fV():ZH()}function ZH(){Bn(Pu(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(Lf),{basename:t,navigator:n}=l.useContext(bi),{matches:s}=l.useContext(Yi),{pathname:r}=Fe(),i=JSON.stringify(_v(s)),o=l.useRef(!1);return dk(()=>{o.current=!0}),l.useCallback((u,d={})=>{if($i(o.current,uk),!o.current)return;if(typeof u=="number"){n.go(u);return}let p=M1(u,JSON.parse(i),r,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:po([t,p.pathname])),(d.replace?n.replace:n.push)(p,d.state,d)},[t,n,i,r,e])}var fk=l.createContext(null);function zt(){return l.useContext(fk)}function eV(e){let t=l.useContext(Yi).outlet;return l.useMemo(()=>t&&l.createElement(fk.Provider,{value:e},t),[t,e])}function st(){let{matches:e}=l.useContext(Yi);return e[e.length-1]?.params??{}}function Em(e,{relative:t}={}){let{matches:n}=l.useContext(Yi),{pathname:s}=Fe(),r=JSON.stringify(_v(n));return l.useMemo(()=>M1(e,JSON.parse(r),s,t==="path"),[e,r,s,t])}function tV(e,t){return pk(e,t)}function pk(e,t,n){Bn(Pu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=l.useContext(bi),{matches:r}=l.useContext(Yi),i=r[r.length-1],o=i?i.params:{},c=i?i.pathname:"/",u=i?i.pathnameBase:"/",d=i&&i.route;{let I=d&&d.path||"";mk(c,!d||I.endsWith("*")||I.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${I}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
11Please change the parent <Route path="${I}"> to <Route path="${I==="/"?"*":`${I}/*`}">.`)}let p=Fe(),g;if(t){let I=typeof t=="string"?Pf(t):t;Bn(u==="/"||I.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${I.pathname}" was given in the \`location\` prop.`),g=I}else g=p;let A=g.pathname||"/",E=A;if(u!=="/"){let I=u.replace(/^\//,"").split("/");E="/"+A.replace(/^\//,"").split("/").slice(I.length).join("/")}let x=n&&n.state.matches.length?n.state.matches.map(I=>Object.assign(I,{route:n.manifest[I.route.id]||I.route})):JD(e,{pathname:E});$i(d||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),$i(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=oV(x&&x.map(I=>Object.assign({},I,{params:Object.assign({},o,I.params),pathname:po([u,s.encodeLocation?s.encodeLocation(I.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?u:po([u,s.encodeLocation?s.encodeLocation(I.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:I.pathnameBase])})),r,n);return t&&y?l.createElement(Mf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},y):y}function nV(){let e=dV(),t=QH(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:i},"ErrorBoundary")," or"," ",l.createElement("code",{style:i},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application 
11Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),n?l.createElement("pre",{style:r},n):null,o)}var sV=l.createElement(nV,null),hk=class extends l.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=XH(e.digest);n&&(e=n)}let t=e!==void 0?l.createElement(Yi.Provider,{value:this.props.routeContext},l.createElement(Tv.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(rV,{error:e},t):t}};hk.contextType=ok;var Ay=new WeakMap;function rV({children:e,error:t}){let{basename:n}=l.useContext(bi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=YH(t.digest);if(s){let r=Ay.get(t);if(r)throw r;let i=rk(s.location,n);if(sk&&!Ay.get(t))if(i.isExternal||s.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:s.replace}));throw Ay.set(t,o),o}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function iV({routeContext:e,match:t,children:n}){let s=l.useContext(Lf);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(Yi.Provider,{value:e},n)}function oV(e,t=[],n){let s=n?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let r=e,i=s?.errors;if(i!=null){let p=r.findIndex(g=>g.route.id&&i?.[g.route.id]!==void 0);Bn(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),r=r.slice(0,Math.min(r.length,p+1))}let o=!1,c=-1;if(n&&s){o=s.renderFallback;for(let p=0;p<r.length;p++){let g=r[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=p),g.route.id){let{loaderData:A,errors:E}=s,x=g.route.loader&&!A.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.route.lazy||x){n.isStatic&&(o=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let u=n?.onError,d=s&&u?(p,g)=>{u(p,{location:s.location,params:s.matches?.[0]?.params??{},pattern:HH(s.matches),errorInfo:g})}:void 0;return r.reduceRight((p,g,A)=>{let E,x=!1,y=null,I=null;s&&(E=i&&g.route.id?i[g.route.id]:void 0,y=g.route.errorElement||sV,o&&(c<0&&A===0?(mk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,I=null):c===A&&(x=!0,I=g.route.hydrateFallbackElement||null)));let v=t.concat(r.slice(0,A+1)),S=()=>{let b;return E?b=y:x?b=I:g.route.Component?b=l.createElement(g.route.Component,null):g.route.element?b=g.route.element:b=p,l.createElement(iV,{match:g,routeContext:{outlet:p,matches:v,isDataRoute:s!=null},children:b})};return s&&(g.route.ErrorBoundary||g.route.errorElement||A===0)?l.createElement(hk,{location:s.location,revalidation:s.revalidation,component:y,error:E,children:S(),routeC
11ontext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):S()},null)}function Nv(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function aV(e){let t=l.useContext(Lf);return Bn(t,Nv(e)),t}function lV(e){let t=l.useContext(j1);return Bn(t,Nv(e)),t}function cV(e){let t=l.useContext(Yi);return Bn(t,Nv(e)),t}function wv(e){let t=cV(e),n=t.matches[t.matches.length-1];return Bn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function uV(){return wv("useRouteId")}function dV(){let e=l.useContext(Tv),t=lV("useRouteError"),n=wv("useRouteError");return e!==void 0?e:t.errors?.[n]}function fV(){let{router:e}=aV("useNavigate"),t=wv("useNavigate"),n=l.useRef(!1);return dk(()=>{n.current=!0}),l.useCallback(async(r,i={})=>{$i(n.current,uk),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Q4={};function mk(e,t,n){!t&&!Q4[e]&&(Q4[e]=!0,$i(!1,n))}l.memo(pV);function pV({routes:e,manifest:t,future:n,state:s,isStatic:r,onError:i}){return pk(e,void 0,{manifest:t,state:s,isStatic:r,onError:i})}function Qn({to:e,replace:t,state:n,relative:s}){Bn(Pu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=l.useContext(bi);$i(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=l.useContext(Yi),{pathname:o}=Fe(),c=at(),u=M1(e,_v(i),o,s==="path"),d=JSON.stringify(u);return l.useEffect(()=>{c(JSON.parse(d),{replace:t,state:n,relative:s})},[c,d,s,t,n]),null}function Xi(e){return eV(e.context)}function Re(e){Bn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function hV({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:r,static:i=!1,useTransitions:o}){Bn(!Pu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=l.useMemo(()=>({basename:c,navigator:r,static:i,useTransitions:o,future:{}}),[c,r,i,o]);typeof n=="string"&&(n=Pf(n));let{pathname:d="/",search:p="",hash:g="",state:A=null,key:E="default",mask:x}=n,y=l.useMemo(()=>{let I=sl(d,c);return I==null?null:{location:{pathname:I,search:p,hash:g,state:A,key:E,mask:x},navigationType:s}},[c,d,p,g,A,E,s,x]);return $i(y!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:l.createElement(bi.Provider,{value:u},l.createElement(Mf.Provider,{children:t,value:y}))}function Ur({children:e,location:t}){return tV(xI(e),t)}function xI(e,t=[]){let n=[];return l.Children.forEach(e,(s,r)=>{if(!l.isValidElement(s))return;let i=[...t,r];if(s.type===l.Fragment){n.push.apply(n,xI(s.props.children,i));return}Bn(s.type===Re,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Bn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=xI(s.props.children,i)),n.push(o)}),n}var iA="get",oA="application/x-www-form-urlencoded";function B1(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function mV(e){return B1(e)&&e.tagName.toLowerCase()==="button"}function gV(e){return B1(e)&&e.tagName.toLowerCase()==="form"}function AV(e){return B1(e)&&e.tagName.toLowerCase()==="input"}function EV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xV(e,t){return e.button===0&&(!t||t==="_self")&&!EV(e)}function CI(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(r=>[n,r]):[[n,s]])},[]))}function CV(e,t){let n=CI(e);return t&&t.forEach((s,r)=>{n.has(r)||t.getAll(r).forEach(i=>
11{n.append(r,i)})}),n}var g0=null;function yV(){if(g0===null)try{new FormData(document.createElement("form"),0),g0=!1}catch{g0=!0}return g0}var bV=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ey(e){return e!=null&&!bV.has(e)?($i(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${oA}"`),null):e}function IV(e,t){let n,s,r,i,o;if(gV(e)){let c=e.getAttribute("action");s=c?sl(c,t):null,n=e.getAttribute("method")||iA,r=Ey(e.getAttribute("enctype"))||oA,i=new FormData(e)}else if(mV(e)||AV(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(s=u?sl(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||iA,r=Ey(e.getAttribute("formenctype"))||Ey(c.getAttribute("enctype"))||oA,i=new FormData(c,e),!yV()){let{name:d,type:p,value:g}=e;if(p==="image"){let A=d?`${d}.`:"";i.append(`${A}x`,"0"),i.append(`${A}y`,"0")}else d&&i.append(d,g)}}else{if(B1(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=iA,s=null,r=oA,o=e}return i&&r==="text/plain"&&(o=i,i=void 0),{action:s,method:n.toLowerCase(),encType:r,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Rv(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gk(e,t,n,s){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${s}`:r.pathname=`${r.pathname}.${s}`:r.pathname==="/"?r.pathname=`_root.${s}`:t&&sl(r.pathname,t)==="/"?r.pathname=`${PA(t)}/_root.${s}`:r.pathname=`${PA(r.pathname)}.${s}`,r}async function SV(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vV(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function _V(e,t,n){let s=await Promise.all(e.map(async r=>{let i=t.routes[r.route.id];if(i){let o=await SV(i,n);return o.links?o.links():[]}return[]}));return RV(s.flat(1).filter(vV).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function H4(e,t,n,s,r,i){let o=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,c=(u,d)=>n[d].pathname!==u.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==u.params["*"];return i==="assets"?t.filter((u,d)=>o(u,d)||c(u,d)):i==="data"?t.filter((u,d)=>{let p=s.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(o(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function TV(e,t,{includeHydrateFallback:n}={}){return NV(e.map(s=>{let r=t.routes[s.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function NV(e){return[...new Set(e)]}function wV(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function RV(e,t){let n=new Set;return new Set(t),e.reduce((s,r)=>{let i=JSON.stringify(wV(r));return n.has(i)||(n.add(i),s.push({key:i,link:r})),s},[])}function Dv(){let e=l.useContext(Lf);return Rv(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function DV(){let e=l.useContext(j1);return Rv(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var kv=l.createContext(void 0);kv.displayName="FrameworkContext";function Ov(){let e=l.useContext(kv);return Rv(e,"You must render this element inside a <HydratedRouter> element"),e}function kV(e,t){let n=l.useContext(kv),[s,r]=l.useState(!1),[i,o]=l.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:g}=t,A=l.useRef(null);l.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let y=v=>{v.forEach(S=>{o(S.isIntersecting)})},I=new IntersectionObserver(y,{threshold:.5});return A.current&&I.observe(A.current),()=>{I.disconnect()}}},[e]),l.useEffect(()=>{if(s){let y=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(y)}}},[s]);let E=()=>{r(!0)},x=()=>{r(!1),o(!1)};return n?e!=="intent"?[i,A,{}]:[i,A,{onFocus:$p(c,E),onBlur:$p(u,x),onMouseEnter:$p(d,E),onMouseLeave:$p(p,x),onTouchStart:$p(g,E)}]:[!1,A,{}
11]}function $p(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function OV({page:e,...t}){let n=GH(),{router:s}=Dv(),r=l.useMemo(()=>JD(s.routes,e,s.basename),[s.routes,e,s.basename]);return r?n?l.createElement(LV,{page:e,matches:r,...t}):l.createElement(MV,{page:e,matches:r,...t}):null}function PV(e){let{manifest:t,routeModules:n}=Ov(),[s,r]=l.useState([]);return l.useEffect(()=>{let i=!1;return _V(e,t,n).then(o=>{i||r(o)}),()=>{i=!0}},[e,t,n]),s}function LV({page:e,matches:t,...n}){let s=Fe(),{future:r}=Ov(),{basename:i}=Dv(),o=l.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let c=gk(e,i,r.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?u=!0:d.push(p.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[i,r.v8_trailingSlashAwareDataRequests,e,s,t]);return l.createElement(l.Fragment,null,o.map(c=>l.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...n})))}function MV({page:e,matches:t,...n}){let s=Fe(),{future:r,manifest:i,routeModules:o}=Ov(),{basename:c}=Dv(),{loaderData:u,matches:d}=DV(),p=l.useMemo(()=>H4(e,t,d,i,s,"data"),[e,t,d,i,s]),g=l.useMemo(()=>H4(e,t,d,i,s,"assets"),[e,t,d,i,s]),A=l.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let y=new Set,I=!1;if(t.forEach(S=>{let b=i.routes[S.route.id];!b||!b.hasLoader||(!p.some(w=>w.route.id===S.route.id)&&S.route.id in u&&o[S.route.id]?.shouldRevalidate||b.hasClientLoader?I=!0:y.add(S.route.id))}),y.size===0)return[];let v=gk(e,c,r.v8_trailingSlashAwareDataRequests,"data");return I&&y.size>0&&v.searchParams.set("_routes",t.filter(S=>y.has(S.route.id)).map(S=>S.route.id).join(",")),[v.pathname+v.search]},[c,r.v8_trailingSlashAwareDataRequests,u,s,i,p,t,e,o]),E=l.useMemo(()=>TV(g,i),[g,i]),x=PV(g);return l.createElement(l.Fragment,null,A.map(y=>l.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),E.map(y=>l.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),x.map(({key:y,link:I})=>l.createElement("link",{key:y,nonce:n.nonce,...I,crossOrigin:I.crossOrigin??n.crossOrigin})))}function jV(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var BV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BV&&(window.__reactRouterVersion="7.17.0")}catch{}function FV({basename:e,children:t,useTransitions:n,window:s}){let r=l.useRef();r.current==null&&(r.current=EH({window:s,v5Compat:!0}));let i=r.current,[o,c]=l.useState({action:i.action,location:i.location}),u=l.useCallback(d=>{n===!1?c(d):l.startTransition(()=>c(d))},[n]);return l.useLayoutEffect(()=>i.listen(u),[i,u]),l.createElement(hV,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i,useTransitions:n})}var Ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hs=l.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:r,reloadDocument:i,replace:o,mask:c,state:u,target:d,to:p,preventScrollReset:g,viewTransition:A,defaultShouldRevalidate:E,...x},y){let{basename:I,navigator:v,useTransitions:S}=l.useContext(bi),b=typeof p=="string"&&Ak.test(p),w=rk(p,I);p=w.to;let _=JH(p,{relative:r}),N=Fe(),R=null;if(c){let z=M1(c,[],N.mask?N.mask.pathname:"/",!0);I!=="/"&&(z.pathname=z.pathname==="/"?I:po([I,z.pathname])),R=v.createHref(z)}let[D,k,L]=kV(s,x),O=QV(p,{replace:o,mask:c,state:u,target:d,preventScrollReset:g,relative:r,viewTransition:A,defaultShouldRevalidate:E,useTransitions:S});function P(z){t&&t(z),z.defaultPrevented||O(z)}let B=!(w.isExternal||i),F=l.createElement("a",{...x,...L,href:(B?R:void 0)||w.absoluteURL||_,onClick:B?P:t,ref:jV(y,k),target:d,"data-discover":!b&&n==="render"?"true":void 0});return D&&!b?l.createElement(l.Fragment,null,F,l.createElement(OV,{page:_})):F});Hs.displayName="Link";var Je=l.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:r=!1,style:i,to:o,viewTransition:c,children:u,...d},p){let g=Em(o,{relative:d.relative}),A=Fe(),E=l.useContext(j1),{navigator:x,basename:y}=l.useContext(bi),I=E!=null&&WV(g)&&c===!0,v=x.encodeLocation?x.encodeLocation(g).pathname:g.pathname,S=A.pathname,b=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(S=S.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&y&&(b=sl(b,y)||b);const w=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let _=S===v||!r&&S.startsWith(v)&&S.charAt(w)==="/",N=b!=null&&(b===v||!r&&b.startsWith(v)&&b.charAt(v.length)==="/"),R={isActive:_,isPending:N,isTransitioning:I},D=_?t:void 0,k;typeof s=="function"?k=s(R):k=[s,_?"active":null,N?"pending":null,I?"transitioning":null].filter(
11Boolean).join(" ");let L=typeof i=="function"?i(R):i;return l.createElement(Hs,{...d,"aria-current":D,className:k,ref:p,style:L,to:o,viewTransition:c},typeof u=="function"?u(R):u)});Je.displayName="NavLink";var UV=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:r,state:i,method:o=iA,action:c,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:A,...E},x)=>{let{useTransitions:y}=l.useContext(bi),I=GV(),v=qV(c,{relative:d}),S=o.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&Ak.test(c),w=_=>{if(u&&u(_),_.defaultPrevented)return;_.preventDefault();let N=_.nativeEvent.submitter,R=N?.getAttribute("formmethod")||o,D=()=>I(N||_.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:r,state:i,relative:d,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:A});y&&n!==!1?l.startTransition(()=>D()):D()};return l.createElement("form",{ref:x,method:S,action:v,onSubmit:s?u:w,...E,"data-discover":!b&&e==="render"?"true":void 0})});UV.displayName="Form";function zV(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ek(e){let t=l.useContext(Lf);return Bn(t,zV(e)),t}function QV(e,{target:t,replace:n,mask:s,state:r,preventScrollReset:i,relative:o,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let p=at(),g=Fe(),A=Em(e,{relative:o});return l.useCallback(E=>{if(xV(E,t)){E.preventDefault();let x=n!==void 0?n:Hh(g)===Hh(A),y=()=>p(e,{replace:x,mask:s,state:r,preventScrollReset:i,relative:o,viewTransition:c,defaultShouldRevalidate:u});d?l.startTransition(()=>y()):y()}},[g,p,A,n,s,r,t,e,i,o,c,u,d])}function F1(e){$i(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l.useRef(CI(e)),n=l.useRef(!1),s=Fe(),r=l.useMemo(()=>CV(s.search,n.current?null:t.current),[s.search]),i=at(),o=l.useCallback((c,u)=>{const d=CI(typeof c=="function"?c(new URLSearchParams(r)):c);n.current=!0,i("?"+d,u)},[i,r]);return[r,o]}var HV=0,VV=()=>`__${String(++HV)}__`;function GV(){let{router:e}=Ek("useSubmit"),{basename:t}=l.useContext(bi),n=uV(),s=e.fetch,r=e.navigate;return l.useCallback(async(i,o={})=>{let{action:c,method:u,encType:d,formData:p,body:g}=IV(i,t);if(o.navigate===!1){let A=o.fetcherKey||VV();await s(A,n,o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await r(o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:g,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[s,r,t,n])}function qV(e,{relative:t}={}){let{basename:n}=l.useContext(bi),s=l.useContext(Yi);Bn(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),i={...Em(e||".",{relative:t})},o=Fe();if(e==null){i.search=o.search;let c=new URLSearchParams(i.search),u=c.getAll("index");if(u.some(p=>p==="")){c.delete("index"),u.filter(g=>g).forEach(g=>c.append("index",g));let p=c.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&r.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:po([n,i.pathname])),Hh(i)}function WV(e,{relative:t}={}){let n=l.useContext(ak);Bn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Ek("useViewTransitionState"),r=Em(e,{relative:t});if(!n.isTransitioning)return!1;let i=sl(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=sl(n.nextLocation.pathname,s)||n.nextLocation.pathname;return qs(r.pathname,o)!=null||qs(r.pathname,i)!=null}var Wn=vD();const V4=e=>{let t;const n=new Set,s=(d,p)=>{const g=typeof d=="function"?d(t):d;if(!Object.is(g,t)){const A=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({}
11,t,g),n.forEach(E=>E(t,A))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(s,r,c);return c},KV=(e=>e?V4(e):V4),$V=e=>e;function YV(e,t=$V){const n=Oe.useSyncExternalStore(e.subscribe,Oe.useCallback(()=>t(e.getState()),[e,t]),Oe.useCallback(()=>t(e.getInitialState()),[e,t]));return Oe.useDebugValue(n),n}const G4=e=>{const t=KV(e),n=s=>YV(t,s);return Object.assign(n,t),n},$n=(e=>e?G4(e):G4);function XV(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const o=u=>u===null?null:JSON.parse(u,void 0),c=(i=n.getItem(r))!=null?i:null;return c instanceof Promise?c.then(o):o(c)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const yI=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(s){return yI(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return yI(s)(n)}}}},JV=(e,t)=>(n,s,r)=>{let i={storage:XV(()=>localStorage),partialize:I=>I,version:0,merge:(I,v)=>({...v,...I}),...t},o=!1,c=0;const u=new Set,d=new Set;let p=i.storage;if(!p)return e((...I)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...I)},s,r);const g=()=>{const I=i.partialize({...s()});return p.setItem(i.name,{state:I,version:i.version})},A=r.setState;r.setState=(I,v)=>(A(I,v),g());const E=e((...I)=>(n(...I),g()),s,r);r.getInitialState=()=>E;let x;const y=()=>{var I,v;if(!p)return;const S=++c;o=!1,u.forEach(w=>{var _;return w((_=s())!=null?_:E)});const b=((v=i.onRehydrateStorage)==null?void 0:v.call(i,(I=s())!=null?I:E))||void 0;return yI(p.getItem.bind(p))(i.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==i.version){if(i.migrate){const _=i.migrate(w.state,w.version);return _ instanceof Promise?_.then(N=>[!0,N]):[!0,_]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var _;if(S!==c)return;const[N,R]=w;if(x=i.merge(R,(_=s())!=null?_:E),n(x,!0),N)return g()}).then(()=>{S===c&&(b?.(x,void 0),x=s(),o=!0,d.forEach(w=>w(x)))}).catch(w=>{S===c&&b?.(void 0,w)})};return r.persist={setOptions:I=>{i={...i,...I},I.storage&&(p=I.storage)},clearStorage:()=>{p?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:I=>(u.add(I),()=>{u.delete(I)}),onFinishHydration:I=>(d.add(I),()=>{d.delete(I)})},i.skipHydration||y(),x||E},xk=JV,ZV=["pickAuthLogCallSite","appendAuthLog","authorization.ts","authLog/"],eG=({line:e})=>{const t=e.trim();return t.startsWith("at ")?t.slice(3):null},tG=()=>{const e=new Error().stack;if(!e)return null;const t=e.split(`
12`).slice(1),n=[];for(const s of t){const r=eG({line:s});if(!(!r||ZV.some(o=>!!r.includes(o)))&&(n.push(r),n.length>=3))break}return n.length===0?null:n.join(" <- ")},nG={hasAccessToken:!1,accessTokenTail:null,userId:null,isAppReady:!1,isUserLoadResolved:!1,clearReason:null,path:null},bI={current:null},sG=({provider:e})=>{bI.current=e},rG=()=>bI.current?bI.current():nG,q4=400,Ck=$n()(e=>({entries:[],appendEntry:t=>e(n=>{const s=[...n.entries,t];return s.length<=q4?{entries:s}:{entries:s.slice(s.length-q4)}}),clearEntries:()=>e({entries:[]})})),iG=()=>{const e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();const t=Date.now().toString(36),n=Math.random().toString(36).slice(2,10);return`${t}-${n}`},Rn=({stage:e,message:t=null,details:n=null,callSite:s})=>{try{const r=s??tG(),i=rG();Ck.getState().appendEntry({id:iG(),timestamp:new Date().toISOString(),stage:e,message:t,details:n,callSite:r,snapshot:i})}catch{}};var Ao=(e=>(e.REFRESH_FAILED="REFRESH_FAILED",e.SIGN_OUT="SIGN_OUT",e.SIGN_IN_ATTEMPT_FAILED="SIGN_IN_ATTEMPT_FAILED",e))(Ao||{});const Se=$n()(xk(e=>({isAppReady:!1,isUserLoadResolved:!1,accessToken:null,browserClientId:null,user:null,emailConfirmSmsState:{requiresSms:!1,passToken:null,cooldownSeconds:null,smsSent:!1,phone:null,smsCode:null},tokenRedeemSmsState:{requiresSms:!1,passToken:null,cooldownSeconds:null,smsSent:!1,phone:null,smsCode:null},emailConfirmationStatus:null,tokenRedeemStatus:null,clearReason:null,setAccessToken:t=>e(n=>{const s=typeof t=="function"?t(n.accessToken):t;return Rn({stage:"SET_ACCESS_TOKEN",details:{hadToken:!!n.accessToken,hasToken:!!s}}),{accessToken:s}}),setBrowserClientId:t=>e(n=>({browserClientId:typeof t=="function"?t(n.browserClientId):t})),setEmailConfirmSmsState:t=>e(n=>({emailConfirmSmsState:typeof t=="function"?t(n.emailConfirmSmsState):t})),setTokenRedeemSmsState:t=>e(n=>
12({tokenRedeemSmsState:typeof t=="function"?t(n.tokenRedeemSmsState):t})),setUser:t=>e(n=>{const s=typeof t=="function"?t(n.user):t;return Rn({stage:"SET_USER",details:{previousUserId:n.user?.id??null,nextUserId:s?.id??null}}),{user:s}}),setIsAppReady:t=>e(n=>{const s=typeof t=="function"?t(n.isAppReady):t;return Rn({stage:"SET_IS_APP_READY",details:{previous:n.isAppReady,next:s}}),{isAppReady:s}}),setIsUserLoadResolved:t=>e(n=>{const s=typeof t=="function"?t(n.isUserLoadResolved):t;return Rn({stage:"SET_IS_USER_LOAD_RESOLVED",details:{previous:n.isUserLoadResolved,next:s}}),{isUserLoadResolved:s}}),setEmailConfirmationStatus:t=>e({emailConfirmationStatus:t}),setTokenRedeemStatus:t=>e({tokenRedeemStatus:t}),clearAccessToken:()=>{Rn({stage:"CLEAR_ACCESS_TOKEN",details:{hadToken:!!Se.getState().accessToken}}),e({accessToken:null})},clearUser:({reason:t})=>{Rn({stage:"CLEAR_USER",details:{reason:t,previousUserId:Se.getState().user?.id??null}}),e({user:null,clearReason:t})}}),{name:"authorization",partialize:e=>({accessToken:e.accessToken,browserClientId:e.browserClientId}),onRehydrateStorage:()=>e=>{Rn({stage:"PERSIST_REHYDRATE",details:{hasAccessToken:!!e?.accessToken,hasBrowserClientId:!!e?.browserClientId}})}})),rl=$n(e=>({runtimeConfig:null,setRuntimeConfig:t=>e(n=>({runtimeConfig:typeof t=="function"?t(n.runtimeConfig):t}))}));function oG(){const t=rl.getState().runtimeConfig;return t?t.REMOTE_API_URL?t.API_URL:`${t.API_URL_HTTP==="true"?"http":"https"}://${t.API_URL}`:""}function Ke(e){const t=oG(),n=e.startsWith("/")?e:`/${e}`;return t?`${t}${n}`:n}function yk(){const t=rl.getState().runtimeConfig;return t?t.HIDE_REGISTRATION==="true":!1}function U1(){const t=rl.getState().runtimeConfig;return t?t.SHOW_DEMO_PLACEHOLDER==="true":!1}function Pv(){const t=rl.getState().runtimeConfig;return t?t.HIDE_DEFENSE_LINES==="true":!1}function bk(){const t=rl.getState().runtimeConfig;return t?t.HIDE_DOCUMENTS==="true":!1}const Lv=({user:e})=>!(e?.access?.hasFullAccess||e?.access?.isPaidActive||e?.access?.isTrialActive),Zs=({element:e,access:t="public"})=>{const n=Fe(),s=n.pathname.replace(/\/+$/,"")||"/",i=n.state?.redirectUrl,o=U1(),{user:c,emailConfirmationStatus:u,tokenRedeemStatus:d,isAppReady:p,clearReason:g}=Se(y=>y),A=l.useMemo(()=>!!c?.phone,[c?.phone]),E=l.useMemo(()=>Lv({user:c}),[c]),x=l.useMemo(()=>E?"/profile/subscription":"/clients",[E]);if(o)return a.jsx(Qn,{to:"/",replace:!0});if(p){if(s==="/confirm-email"){if(u==="success")return a.jsx(Qn,{to:x,replace:!0});if(u==="failed")return a.jsx(Qn,{to:"/sign-in",replace:!0})}if(s==="/setup-new-password"){if(d==="success")return a.jsx(Qn,{to:"/profile/change-password",replace:!0});if(d==="failed")return a.jsx(Qn,{to:"/sign-in",replace:!0})}if(s!=="/confirm-email"&&s!=="/setup-new-password"){if(["/sign-in","/sign-in/phone","/sign-in/sms"].includes(s)&&c?.id&&i)return a.jsx(Qn,{to:i,replace:!0});if(["/sign-up","/sign-up/sms"].includes(s)&&c?.id&&i)return a.jsx(Qn,{to:i,replace:!0});if(t==="guestOnly"&&c?.id)return a.jsx(Qn,{to:x,replace:!0});if(t==="authOnly"&&!c?.id){const v=[Ao.REFRESH_FAILED,Ao.SIGN_IN_ATTEMPT_FAILED],S=!g||v.includes(g);return a.jsx(Qn,{to:"/sign-in",replace:!0,state:S?{redirectUrl:n.pathname}:null})}if(t==="authOnly"&&c?.id&&E&&A){const S=["/profile","/profile/subscription","/profile/payment-history","/profile/change-phone","/profile/change-phone/check-email","/profile/change-email","/profile/change-password"].includes(s),b=/^\/profile\/payment\/[\w-]+$/.test(s);if(!(S||b))return a.jsx(Qn,{to:"/profile/subscription",replace:!0})}}if(s==="/")return a.jsx(Qn,{to:x,replace:!0})}return e},W4=2592e5,Ik="thumbmark",Sk="https://api.thumbmarkjs.com",vk={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,property_name_factory:e=>`${Ik}_${e}`},aG={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}
12],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}]},K4=typeof window<"u"?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function lG(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function $4(e,t,n){let s=[];for(let i=0;i<e[0].data.length;i++){let o=[];for(let c=0;c<e.length;c++)o.push(e[c].data[i]);s.push(cG(o))}const r=new Uint8ClampedArray(s);return new ImageData(r,t,n)}function cG(e){if(e.length===0)return 0;const t={};for(const s of e)t[s]=(t[s]||0)+1;let n=e[0];for(const s in t)t[s]>t[n]&&(n=parseInt(s,10));return n}function A0(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),(e^=e>>>16)>>>0}const or=new Uint32Array([597399067,2869860233,951274213,2716044179]);function ji(e,t){return e<<t|e>>>32-t}function Bi(e,t=0){if(t=t?0|t:0,typeof e=="string"&&(e=(function(r){if(typeof TextEncoder<"u")return new TextEncoder().encode(r).buffer;const i=[];for(let o=0;o<r.length;o++){let c=r.charCodeAt(o);c<128?i.push(c):c<2048?i.push(192|c>>6,128|63&c):c<55296||c>=57344?i.push(224|c>>12,128|c>>6&63,128|63&c):(o++,c=65536+((1023&c)<<10|1023&r.charCodeAt(o)),i.push(240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c))}return new Uint8Array(i).buffer})(e)),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");const n=new Uint32Array([t,t,t,t]);(function(r,i){const o=r.byteLength/16|0,c=new Uint32Array(r,0,4*o);for(let u=0;u<o;u++){const d=c.subarray(4*u,4*(u+1));d[0]=Math.imul(d[0],or[0]),d[0]=ji(d[0],15),d[0]=Math.imul(d[0],or[1]),i[0]=i[0]^d[0],i[0]=ji(i[0],19),i[0]=i[0]+i[1],i[0]=Math.imul(i[0],5)+1444728091,d[1]=Math.imul(d[1],or[1]),d[1]=ji(d[1],16),d[1]=Math.imul(d[1],or[2]),i[1]=i[1]^d[1],i[1]=ji(i[1],17),i[1]=i[1]+i[2],i[1]=Math.imul(i[1],5)+197830471,d[2]=Math.imul(d[2],or[2]),d[2]=ji(d[2],17),d[2]=Math.imul(d[2],or[3]),i[2]=i[2]^d[2],i[2]=ji(i[2],15),i[2]=i[2]+i[3],i[2]=Math.imul(i[2],5)+2530024501,d[3]=Math.imul(d[3],or[3]),d[3]=ji(d[3],18),d[3]=Math.imul(d[3],or[0]),i[3]=i[3]^d[3],i[3]=ji(i[3],13),i[3]=i[3]+i[0],i[3]=Math.imul(i[3],5)+850148119}})(e,n),(function(r,i){const o=r.byteLength/16|0,c=r.byteLength%16,u=new Uint32Array(4),d=new Uint8Array(r,16*o,c);switch(c){case 15:u[3]=u[3]^d[14]<<16;case 14:u[3]=u[3]^d[13]<<8;case 13:u[3]=u[3]^d[12],u[3]=Math.imul(u[3],or[3]),u[3]=ji(u[3],18),u[3]=Math.imul(u[3],or[0]),i[3]=i[3]^u[3];case 12:u[2]=u[2]^d[11]<<24;case 11:u[2]=u[2]^d[10]<<16;case 10:u[2]=u[2]^d[9]<<8;case 9:u[2]=u[2]^d[8],u[2]=Math.imul(u[2],or[2]),u[2]=ji(u[2],17),u[2]=Math.imul(u[2],or[3]),i[2]=i[2]^u[2];case 8:u[1]=u[1]^d[7]<<24;case 7:u[1]=u[1]^d[6]<<16;case 6:u[1]=u[1]^d[5]<<8;case 5:u[1]=u[1]^d[4],u[1]=Math.imul(u[1],or[1]),u[1]=ji(u[1],16),u[1]=Math.imul(u[1],or[2]),i[1]=i[1]^u[1];case 4:u[0]=u[0]^d[3]<<24;case 3:u[0]=u[0]^d[2]<<16;case 2:u[0]=u[0]^d[1]<<8;case 1:u[0]=u[0]^d[0],u[0]=Math.imul(u[0],or[0]),u[0]=ji(u[0],15),u[0]=Math.imul(u[0],or[1]),i[0]=i[0]^u[0]}})(e,n),(function(r,i){i[0]=i[0]^r.byteLength,i[1]=i[1]^r.byteLength,i[2]=i[2]^r.byteLength,i[3]=i[3]^r.byteLength,i[0]=i[0]+i[1]|0,i[0]=i[0]+i[2]|0,i[0]=i[0]+i[3]|0,i[1]=i[1]+i[0]|0,i[2]=i[2]+i[0]|0,i[3]=i[3]+i[0]|0,i[0]=A0(i[0]),i[1]=A0(i[1]),i[2]=A0(i[2]),i[3]=A0(i[3]),i[0]=i[0]+i[1]|0,i[0]=i[0]+i[2]|0,i[0]=i[0]+i[3]|0,i[1]=i[1]+i[0]|0,i[2]=i[2]+i[0]|0,i[3]=i[3]+i[0]|0})(e,n);const s=new Uint8Array(n.buffer);return Array.from(s).map((r=>r.toString(16).padStart(2,"0"))).join("")}const Y4=280;async function _k(e){for(var t;!document.body;)await uG(50);const n=document.createElement("iframe");n.setAttribute("frameBorder","0");const s=n.style;s.setProperty("position","fixed"),s.setProperty("display","block","important"),s.setProperty("visibility","visible"),s.setProperty("border","0"),s.setProperty("opacity","0"),n.src="about:blank",document.body.appendChild(n);const r=n.contentDocument||((t=n.contentWindow)===null||t===void 0?void 0:t.document);if(!r)throw new Error("Iframe document is not accessible");e({iframe:r}),setTimeout((()=>{document.body.removeChild(n)}),0)}function uG(e,t){return new Promise((n=>setTimeout(n,e,t)))}const dG=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],fG=["monospace","sans-serif","serif"];function X4(e,t){return e.font=`72px ${t}`,e.measureText("WwMmLli0Oo").width}function pG(){var e;const t=document.createElement("canvas"),n=(e=t.getContext("webgl"))!==null&&e!==void 0?e:t.getContext("experimental-webgl");
12if(n&&"getParameter"in n)try{const s=(n.getParameter(n.VENDOR)||"").toString(),r=(n.getParameter(n.RENDERER)||"").toString();let i={vendor:s,renderer:r,version:(n.getParameter(n.VERSION)||"").toString(),shadingLanguageVersion:(n.getParameter(n.SHADING_LANGUAGE_VERSION)||"").toString()};if(!r.length||!s.length){const o=n.getExtension("WEBGL_debug_renderer_info");if(o){const c=(n.getParameter(o.UNMASKED_VENDOR_WEBGL)||"").toString(),u=(n.getParameter(o.UNMASKED_RENDERER_WEBGL)||"").toString();c&&(i.vendorUnmasked=c),u&&(i.rendererUnmasked=u)}}return i}catch{}return"undefined"}function hG(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}const E0=(e,t,n,s)=>{const r=(n-t)/s;let i=0;for(let o=0;o<s;o++)i+=e(t+(o+.5)*r);return i*r};function mG(e,t){const n={};return t.forEach((s=>{const r=(function(i){if(i.length===0)return null;const o={};i.forEach((d=>{const p=String(d);o[p]=(o[p]||0)+1}));let c=i[0],u=1;return Object.keys(o).forEach((d=>{o[d]>u&&(c=d,u=o[d])})),c})(e.map((i=>s in i?i[s]:void 0)).filter((i=>i!==void 0)));r&&(n[s]=r)})),n}const gG=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"];function Mv(){var e,t,n,s,r,i;if(typeof navigator>"u")return{name:"unknown",version:"unknown"};const o=navigator.userAgent,c=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Brave)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],u={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi",brave:"Brave"};for(const d of c){const p=o.match(d);if(p){let g=(e=p.groups)===null||e===void 0?void 0:e.name,A=((t=p.groups)===null||t===void 0?void 0:t.version)||((n=p.groups)===null||n===void 0?void 0:n.version1)||((s=p.groups)===null||s===void 0?void 0:s.version2);if(g||!(!((r=p.groups)===null||r===void 0)&&r.version1)&&!(!((i=p.groups)===null||i===void 0)&&i.version2)||(g="Safari"),!g&&d.source.includes("Opera Mini")&&(g="Opera Mini"),!g&&d.source.includes("Opera Mobi")&&(g="Opera Mobi"),!g&&d.source.includes("Opera")&&(g="Opera"),!g&&p[1]&&(g=p[1]),!A&&p[2]&&(A=p[2]),g)return{name:u[g.toLowerCase()]||g,version:A||"unknown"}}}return{name:"unknown",version:"unknown"}}function J4(){if(typeof navigator>"u"||!navigator.userAgent)return!1;const e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function AG(){let e=[];const t={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(t).forEach((n=>{t[n].forEach((s=>{matchMedia(`(${n}: ${s})`).matches&&e.push(`${n}: ${s}`)}))})),e}function EG(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{const e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}const xG=Mv().name!=="SamsungBrowser"?1:3;let ar,Et=null;function Fo(e){const t=[];return(function n(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s===void 0)return;if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);let r,i;if(Array.isArray(s)){for(i="[",r=0;r<s.length;r++)r&&(i+=","),i+=n(s[r])||"null";return i+"]"}if(s===null)return"null";if(t.indexOf(s)!==-1)throw new TypeError("Converting circular structure to JSON");const o=t.push(s)-1,c=Object.keys(s).sort();for(i="",r=0;r<c.length;r++){const u=c[r],d=n(s[u]);d&&(i&&(i+=","),i+=JSON.stringify(u)+":"+d)}return t.splice(o,1),"{"+i+"}"})(e)||""}const Tk=["𝔄","𝔅","ℭ","𝔇","𝔈","𝔉","𝔸","𝔹","ℂ","𝔻","𝔼","𝔽"],Nk=["β","ψ","λ","ε","ζ","α","ξ","μ","ρ","φ","κ","τ","η","σ","ι","ω","γ","ν","χ","δ","θ","π","υ","ο"];function Ih(e,t){return`<math><mrow>${t}</mrow></math>`}function CG(){let e="<mo>∏</mo>";
12return Tk.forEach(((t,n)=>{const s=2*n,r=Nk.slice(s,s+2);r.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${r[1]}</mi><mprescripts></mprescripts><mi>${r[0]}</mi><none/></mmultiscripts>`)})),Ih(0,`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function yG(){const e=[];return Tk.forEach(((t,n)=>{const s=2*n,r=Nk.slice(s,s+2);r.length===2&&e.push(Ih(0,`<mmultiscripts><mi>${t}</mi><none/><mi>${r[1]}</mi><mprescripts></mprescripts><mi>${r[0]}</mi><none/></mmultiscripts>`))})),e}const bG={audio:async function(){return K4?(async function(){return new Promise(((e,t)=>{try{const n=new K4(1,5e3,44100),s=n.createBufferSource(),r=n.createOscillator();r.frequency.value=1e3;const i=n.createDynamicsCompressor();let o;i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.2,r.connect(i),i.connect(n.destination),r.start(),n.oncomplete=c=>{o=c.renderedBuffer.getChannelData(0),e({sampleHash:lG(o),maxChannels:n.destination.maxChannelCount,channelCountMode:s.channelCountMode})},n.startRendering()}catch(n){console.error("Error creating audio fingerprint:",n),t(n)}}))})():null},canvas:async function(){return new Promise((e=>{const t=Array.from({length:3},(()=>(function(){const n=document.createElement("canvas"),s=n.getContext("2d");if(!s)return null;n.width=Y4,n.height=20;const r=s.createLinearGradient(0,0,n.width,n.height);r.addColorStop(0,"red"),r.addColorStop(.16666666666666666,"orange"),r.addColorStop(.3333333333333333,"yellow"),r.addColorStop(.5,"green"),r.addColorStop(.6666666666666666,"blue"),r.addColorStop(.8333333333333334,"indigo"),r.addColorStop(1,"violet"),s.fillStyle=r,s.fillRect(0,0,n.width,n.height);const i="Random Text WMwmil10Oo";return s.font="23.123px Arial",s.fillStyle="black",s.fillText(i,-5,15),s.fillStyle="rgba(0, 0, 255, 0.5)",s.fillText(i,-3.3,17.7),s.beginPath(),s.moveTo(0,0),s.lineTo(2*n.width/7,n.height),s.strokeStyle="white",s.lineWidth=2,s.stroke(),s.getImageData(0,0,n.width,n.height)})())).filter((n=>n!==null));t.length!==0?e({commonPixelsHash:Bi($4(t,Y4,20).data.toString()).toString()}):e(null)}))},fonts:async function(e){return new Promise((t=>{try{_k((async({iframe:n})=>{const s=n.createElement("canvas").getContext("2d");if(!s)return void t(null);const r=fG.map((o=>X4(s,o)));let i={};dG.forEach((o=>{const c=X4(s,o);r.includes(c)||(i[o]=c)})),t(i)}))}catch{t(null)}}))},hardware:function(){return new Promise(((e,t)=>{const n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,s=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:pG(),architecture:hG(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:s.jsHeapSizeLimit||0})}))},locales:function(){return new Promise((e=>{e({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}))},math:function(){return new Promise((e=>{e({acos:Math.acos(.5),asin:E0(Math.asin,-1,1,97),cos:E0(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:E0(Math.sin,-Math.PI,Math.PI,97),tan:E0(Math.tan,0,2*Math.PI,97)})}))},permissions:async function(e){const t=e?.permissions_to_check||gG;return mG(await Promise.all(Array.from({length:3},(()=>(async function(n){const s={};for(const r of n)try{const i=await navigator.permissions.query({name:r});s[r]=i.state.toString()}catch{}return s})(t)))),t)},plugins:async function(){const e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){const n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join("|"))}return new Promise((t=>{t({plugins:e})}))},screen:function(){return new Promise((e=>{if(typeof matchMedia>"u"||typeof screen>"u")return void e(null);const t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:AG()};J4()&&navigator.maxTouchPoints>0&&(t.resolution=(function(){const n=window.screen.width,s=window.screen.height,r=Math.max(n,s).toString(),i=Math.min(n,s).toString();return`${r}x${i}`})()),e(t)}))},system:function(){return new Promise((e=>{const t=Mv();e({platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:J4(),applePayVersion:EG(),cookieEnabled:window.navigator.cookieEnabled})}
vendor: 3,901 bytes, lines 12-22
12))},webgl:async function(){typeof document<"u"&&(ar=document.createElement("canvas"),ar.width=200,ar.height=100,Et=ar.getContext("webgl"));try{if(!Et)throw new Error("WebGL not supported");const e=Array.from({length:xG},(()=>(function(){try{if(!Et)throw new Error("WebGL not supported");const t=`
13          attribute vec2 position;
14          void main() {
15              gl_Position = vec4(position, 0.0, 1.0);
16          }
17      `,n=`
18          precision mediump float;
19          void main() {
20              gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
21          }
22      `,s=Et.createShader(Et.VERTEX_SHADER),r=Et.createShader(Et.FRAGMENT_SHADER);if(!s||!r)throw new Error("Failed to create shaders");if(Et.shaderSource(s,t),Et.shaderSource(r,n),Et.compileShader(s),!Et.getShaderParameter(s,Et.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+Et.getShaderInfoLog(s));if(Et.compileShader(r),!Et.getShaderParameter(r,Et.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+Et.getShaderInfoLog(r));const i=Et.createProgram();if(!i)throw new Error("Failed to create shader program");if(Et.attachShader(i,s),Et.attachShader(i,r),Et.linkProgram(i),!Et.getProgramParameter(i,Et.LINK_STATUS))throw new Error("Shader program linking failed: "+Et.getProgramInfoLog(i));Et.useProgram(i);const o=137,c=new Float32Array(4*o),u=2*Math.PI/o;for(let A=0;A<o;A++){const E=A*u;c[4*A]=0,c[4*A+1]=0,c[4*A+2]=Math.cos(E)*(ar.width/2),c[4*A+3]=Math.sin(E)*(ar.height/2)}const d=Et.createBuffer();Et.bindBuffer(Et.ARRAY_BUFFER,d),Et.bufferData(Et.ARRAY_BUFFER,c,Et.STATIC_DRAW);const p=Et.getAttribLocation(i,"position");Et.enableVertexAttribArray(p),Et.vertexAttribPointer(p,2,Et.FLOAT,!1,0,0),Et.viewport(0,0,ar.width,ar.height),Et.clearColor(0,0,0,1),Et.clear(Et.COLOR_BUFFER_BIT),Et.drawArrays(Et.LINES,0,2*o);const g=new Uint8ClampedArray(ar.width*ar.height*4);return Et.readPixels(0,0,ar.width,ar.height,Et.RGBA,Et.UNSIGNED_BYTE,g),new ImageData(g,ar.width,ar.height)}catch{return new ImageData(1,1)}finally{Et&&(Et.bindBuffer(Et.ARRAY_BUFFER,null),Et.useProgram(null),Et.viewport(0,0,Et.drawingBufferWidth,Et.drawingBufferHeight),Et.clearColor(0,0,0,0))}})()));return{commonPixelsHash:Bi($4(e,ar.width,ar.height).data.toString()).toString()}}catch{return{webgl:"unsupported"}}}},IG={webrtc:async function(){return new Promise((e=>{try{const t=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!t)return void e({supported:!1,error:"WebRTC not supported"});const n=new t({iceCandidatePoolSize:1,iceServers:[]});n.createDataChannel(""),(async()=>{try{const s={offerToReceiveAudio:!0,offerToReceiveVideo:!0},r=await n.createOffer(s);await n.setLocalDescription(r);const i=r.sdp||"",o=[...new Set((i.match(/extmap:\d+ [^\n\r]+/g)||[]).map((E=>E.replace(/extmap:\d+ /,""))))].sort(),c=E=>{const x=i.match(new RegExp(`m=${E} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return x?x[1].split(" "):[]},u=(E,x)=>x.map((y=>{const I=new RegExp(`(rtpmap|fmtp|rtcp-fb):${y} (.+)`,"g"),v=[...i.matchAll(I)];if(!v.length)return null;const S={};return v.forEach((b=>{const[w,_,N]=b,R=N.split("/");_==="rtpmap"?(S.mimeType=`${E}/${R[0]}`,S.clockRate=+R[1],E==="audio"&&(S.channels=+R[2]||1)):_==="rtcp-fb"?(S.feedbackSupport=S.feedbackSupport||[],S.feedbackSupport.push(N)):_==="fmtp"&&(S.sdpFmtpLine=N)})),S})).filter(Boolean),d=u("audio",c("audio")),p=u("video",c("video")),g={audio:{count:d.length,hash:Bi(Fo(d))},video:{count:p.length,hash:Bi(Fo(p))},extensionsHash:Bi(Fo(o))},A=await new Promise((E=>{const x=setTimeout((()=>{n.removeEventListener("icecandidate",y),n.close(),E({supported:!0,...g,timeout:!0})}),3e3),y=I=>{const v=I.candidate;v&&v.candidate&&(clearTimeout(x),n.removeEventListener("icecandidate",y),n.close(),E({supported:!0,...g,candidateType:v.type||""}))};n.addEventListener("icecandidate",y)}));e({details:A,hash:Bi(Fo(A))})}
22catch(s){n.close(),e({supported:!0,error:`WebRTC offer failed: ${s.message}`})}})()}catch(t){e({supported:!1,error:`WebRTC error: ${t.message}`})}}))},mathml:async function(){return new Promise((e=>{try{_k((async({iframe:t})=>{try{if(!(function(o){try{const c=o.createElement("math");c.innerHTML="<mrow><mi>x</mi></mrow>",c.style.position="absolute",c.style.visibility="hidden",o.body.appendChild(c);const u=c.getBoundingClientRect();return o.body.removeChild(c),u.width>0&&u.height>0}catch{return!1}})(t))return void e({supported:!1,error:"MathML not supported"});const n=[Ih("integral","<msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>"),Ih("fraction","<mfrac><mrow><mi>π</mi><mo>×</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>σ</mi></mrow></mfrac>"),Ih("matrix","<mo>[</mo><mtable><mtr><mtd><mi>α</mi></mtd><mtd><mi>β</mi></mtd></mtr><mtr><mtd><mi>γ</mi></mtd><mtd><mi>δ</mi></mtd></mtr></mtable><mo>]</mo>"),CG(),...yG()],s=[];let r="";n.forEach(((o,c)=>{const u=(function(d,p){try{const g=p.createElement("math");g.innerHTML=d.replace(/<\/?math>/g,""),g.style.whiteSpace="nowrap",g.style.position="absolute",g.style.visibility="hidden",g.style.top="-9999px",p.body.appendChild(g);const A=g.getBoundingClientRect(),E=(p.defaultView||window).getComputedStyle(g),x={dimensions:{width:A.width,height:A.height},fontInfo:{fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontStyle:E.fontStyle,lineHeight:E.lineHeight,fontVariant:E.fontVariant||"normal",fontStretch:E.fontStretch||"normal",fontSizeAdjust:E.fontSizeAdjust||"none",textRendering:E.textRendering||"auto",fontFeatureSettings:E.fontFeatureSettings||"normal",fontVariantNumeric:E.fontVariantNumeric||"normal",fontKerning:E.fontKerning||"auto"}};return p.body.removeChild(g),x}catch(g){return{error:g.message}}})(o,t);s.push({width:u.dimensions.width,height:u.dimensions.height}),c===0&&u.fontInfo&&(r=Bi(Fo(u.fontInfo)))}));const i={fontStyleHash:r,dimensions:s};e({details:i,hash:Bi(Fo(i))})}catch(n){e({supported:!1,error:`MathML error: ${n.message}`})}}))}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}}))},speech:async function(){return new Promise((e=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function")return void e({supported:!1,error:"Speech Synthesis API not supported"});let t=!1,n=null;const s=o=>{if(!t){t=!0,n&&clearTimeout(n);try{const c=o.map((d=>{const p=g=>g.replace(/\\/g,"\\\\").replace(/,/g,"\\,");return[p(d.voiceURI||""),p(d.name||""),p(d.lang||""),d.localService?"1":"0",d.default?"1":"0"].join(",")}));c.sort();const u={voiceCount:o.length,voicesHash:Bi(Fo(c))};e({details:u,hash:Bi(Fo(u))})}catch(c){e({supported:!0,error:`Voice processing failed: ${c.message}`})}}},r=window.speechSynthesis.getVoices();if(r.length>0)return void s(r);n=setTimeout((()=>{const o=window.speechSynthesis.getVoices();s(o)}),800);const i=()=>{window.speechSynthesis.removeEventListener("voiceschanged",i);const o=window.speechSynthesis.getVoices();s(o)};window.speechSynthesis.addEventListener("voiceschanged",i)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}}))}},wk={},SG={timeout:"true"},vG=(e,t,n)=>{wk[e]=t};function Rk(e,t){var n;let s=Mv();if(s.name==="unknown"&&e.system&&typeof e.system=="object"&&!Array.isArray(e.system)){const p=e.system.browser;if(p&&typeof p=="object"&&!Array.isArray(p)){const g=p;s={name:g.name||"unknown",version:g.version||"unknown"}}}const r=s.name.toLowerCase(),i=s.version.split(".")[0]||"0",o=parseInt(i,10),c=[...t?.exclude||[]],u=t?.stabilize||[],d=t?.include||[];for(const p of u){const g=aG[p];if(g)for(const A of g){const E=!("browsers"in A),x=!E&&((n=A.browsers)===null||n===void 0?void 0:n.some((y=>{const I=y.match(/(.+?)(>=)(\d+)/);if(I){const[,v,,S]=I,b=parseInt(S,10);return r===v&&o>=b}return r===y})));(E||x)&&c.push(...A.exclude)}}return(function p(g,A=""){const E={};for(const[x,y]of Object.entries(g)){const I=A?`${A}.${x}`:x;if(typeof y!="object"||Array.isArray(y)||y===null){const v=c.some((b=>I.startsWith(b))),S=d.some((b=>I.startsWith(b)));v&&!S||(E[x]=y)}else{const v=p(y,I);Object.keys(v).length>0&&(E[x]=v)}}return E})(e)}const Dk="visitor_id";function kk(e){return e.storage_property_name?e.storage_property_name:e.property_name_factory(Dk)}const Z4=`${Ik}_${Dk}`;function e6(e,t){try{localStorage.setItem(kk(t),e)}catch{}}const Ok="cache";function xy(e){try{const t=localStorage.getItem(e.property_name_factory(Ok));return JSON.parse(t)||{}}catch{}return{}}function _G(e){return e.cache_lifetime_in_ms>W4?Date.now()+W4:Date.now()+e.cache_lifetime_in_ms}let Od=null,Cy=null;const TG=(e,t)=>
22{if(e.cache_api_call){if(Cy)return Promise.resolve(Cy);const u=(function(d){const p=xy(d);if(p&&p.apiResponse&&p.apiResponseExpiry&&Date.now()<=p.apiResponseExpiry)return p.apiResponse})(e);if(u)return Promise.resolve(u);if(Od)return Od}const n=`${e.api_endpoint||Sk}/thumbmark`,s=(function(u){try{const d=kk(u);let p=localStorage.getItem(d);return p||d===Z4||(p=localStorage.getItem(Z4),p&&e6(p,u)),p}catch{return null}})(e),r={components:t,options:e,clientHash:Bi(Fo(t)),version:"1.6.3"};s&&(r.visitorId=s);const i=fetch(n,{method:"POST",headers:{"x-api-key":e.api_key,Authorization:"custom-authorized","Content-Type":"application/json"},body:JSON.stringify(r)}).then((u=>{if(!u.ok)throw u.status===403?new Error("INVALID_API_KEY"):new Error(`HTTP error! status: ${u.status}`);return u.json()})).then((u=>(u.visitorId&&u.visitorId!==s&&e6(u.visitorId,e),Cy=u,(function(d,p){!d.cache_api_call||!d.cache_lifetime_in_ms||(function(g,A){const E={...xy(g),...A};try{localStorage.setItem(g.property_name_factory(Ok),JSON.stringify(E))}catch{}})(d,{apiResponseExpiry:_G(d),apiResponse:p})})(e,u),Od=null,u))).catch((u=>{if(console.error("Error fetching pro data",u),Od=null,u.message==="INVALID_API_KEY")throw u;return null})),o=e.timeout||5e3,c=new Promise((u=>{setTimeout((()=>{const d=xy(e);d&&d.apiResponse?u(d.apiResponse):u({info:{timed_out:!0},...s&&{visitorId:s}})}),o)}));return Od=Promise.race([i,c]),Od};async function NG(e){var t;if(typeof document>"u"||typeof window>"u")return{thumbmark:"",components:{},info:{},version:"1.6.3",error:"Browser environment required"};const n={...vk,...e},s=n.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,r={...bG,...wk},{elapsed:i,resolvedComponents:o}=await t6(r,n);let c={},u={};if(s||n.experimental){const{elapsed:v,resolvedComponents:S}=await t6(IG,n);c=S,u=v}const d=n.api_key?TG(n,o):null;let p=null;if(d)try{p=await d}catch(v){if(v instanceof Error&&v.message==="INVALID_API_KEY")return{error:"Invalid API key or quota exceeded",components:{},info:{},version:"1.6.3",thumbmark:""};throw v}const g={...i,...u},A=n.performance?{elapsed:g}:{},E=Rk(p?.components||{},n),x={...o,...E},y=p?.info||{uniqueness:{score:"api only"}},I=(t=p?.thumbmark)!==null&&t!==void 0?t:Bi(Fo(x));return s&&(async function(v,S,b,w={}){var _;const N=`${Sk}/log`,R={thumbmark:v,components:S,experimental:w,version:"1.6.3",options:b,path:(_=window?.location)===null||_===void 0?void 0:_.pathname};sessionStorage.setItem("_tmjs_l","1");try{await fetch(N,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})}catch{}})(I,x,n,c).catch((()=>{})),{...p?.visitorId&&{visitorId:p.visitorId},thumbmark:I,components:x,info:y,version:"1.6.3",...A,...Object.keys(c).length>0&&n.experimental&&{experimental:c},...p?.requestId&&{requestId:p.requestId}}}async function t6(e,t){const n={...vk,...t},s=Object.entries(e).filter((([p])=>{var g;return!(!((g=n?.exclude)===null||g===void 0)&&g.includes(p))})).filter((([p])=>{var g,A,E,x;return!((g=n?.include)===null||g===void 0)&&g.some((y=>y.includes(".")))?(A=n?.include)===null||A===void 0?void 0:A.some((y=>y.startsWith(p))):((E=n?.include)===null||E===void 0?void 0:E.length)===0||((x=n?.include)===null||x===void 0?void 0:x.includes(p))})),r=s.map((([p])=>p)),i=s.map((([p,g])=>g(t))),o=await(function(p,g,A){return Promise.all(p.map((E=>{const x=performance.now();return Promise.race([E.then((v=>({value:v,elapsed:performance.now()-x}))),(y=g,I=A,new Promise((v=>{setTimeout((()=>v(I)),y)}))).then((v=>({value:v,elapsed:performance.now()-x})))]);var y,I})))})(i,n?.timeout||5e3,SG),c={},u={};o.forEach(((p,g)=>{var A;p.value!=null&&(u[r[g]]=p.value,c[r[g]]=(A=p.elapsed)!==null&&A!==void 0?A:0)}));const d=Rk(u,n);return{elapsed:c,resolvedComponents:d}}function pt(e){return!(e===null||typeof e!="object"||Array.isArray(e))}const n6=({record:e,key:t})=>{const n=e[t];return typeof n=="string"?n:null},wG=({record:e,key:t})=>{const n=e[t];return typeof n=="number"?n:null},RG=({error:e})=>pt(e.errorData)?e.errorData:e,LA=({error:e})=>{if(typeof e=="string")return{code:null,httpCode:null,message:e};if(!pt(e))return{code:null,httpCode:null,message:null};const t=RG({error:e});return{code:n6({record:t,key:"code"}),httpCode:wG({record:e,key:"httpCode"}),message:n6({record:t,key:"message"})}},DG=3e4,kG=()=>{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e&&e.length>0?e:"UTC"},Pk=()=>({status:"error",error:{code:"NETWORK_TIMEOUT",message:"Request timed out or failed due to network issues"}}),qe=async(e,t={})=>{const{timeout:n=DG,...s}=t,r=new AbortController,i=setTimeout(()=>r.abort(),n);t.signal?.addEventListener("abort",()=>r.abort()),s.signal=r.signal;const o=new Headers(s.headers);o.set("X-Timezone",kG()),s.headers=o;try{const c=await fetch(e,s);return clearTimeout(i),c}catch{return clearTimeout(i),Pk()}},He=e=>{if(e===null||typeof e!="object")return!1;const t=e;return t.status==="error"&&t.error?.code==="NETWORK_TIMEOUT"},Ye=async e=>{if(He(e))return e;try{const t=await e.json();return!e.ok||t.status==="error",t}catch{return Pk()}};let s6=!1;function OG(){s6||(s6=!0,vG("client",async()=>{const e=PG();if(e)return{clientId:e};const t=LG();return Se.getState().setBrowserClientId(t),{clientId:t}}))}function PG(){const e=Se.getState().browserClientId;return e&&e.length>0?e:null}function LG(){const e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID();if(e?.getRandomValues){const s=new Uint8Array(16);e.getRandomValues(s);const r=o=>o.toString(16).padStart(2,"0"),i=Array.from(s).map(r).join("");return[i.slice(0,8),i.slice(8,12),i.slice(12,16),i.slice(16,20),i.slice(20,32)].join("-")}const t=Date.now().toString(36),n=Math.random().toString(36).slice(2,12);return`${t}-${n}`}async function ps(){OG();const{thumbmark:e}=await NG({include:["client"]});return e}let Pd=null;async function Lk(){if(Pd)return Rn({stage:"REFRESH_START",message:"reuse in-flight refresh promise"}),Pd;Rn({stage:"REFRESH_START",message:"new refresh request"}),Pd=MG();let e;try{e=await Pd}catch(t){throw Pd=null,Rn({stage:"REFRESH_ERROR",details:LA({error:t})}),t}return Pd=null,Rn({stage:"REFRESH_SUCCESS"}),e}async function MG(){const e=await ps(),t=await qe(Ke("/accounts/token/refresh/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:e})});if(He(t))throw t.error;const n=await t.json();
22if(!t.ok||n.status==="error")throw n.error??{code:"REFRESH_FAILED",message:"Refresh failed"};if(!n.data?.accessToken)throw{code:"REFRESH_TOKEN_ERROR"};return Se.getState().setAccessToken(n.data.accessToken),n.data}async function jG({email:e,phone:t,password:n}){Rn({stage:"SIGN_IN_REQUEST",details:{hasEmail:!!e,hasPhone:!!t}});const s=await ps(),r=await qe(Ke("/accounts/sign-in/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,phone:t,password:n,fingerprint:s})}),i=await Ye(r);if(He(i))throw i.error;if(i.status==="error")throw{...i.error,data:i.data};return Rn({stage:"SIGN_IN_SUCCESS",details:{requiresSms:!!i.data?.requiresSms,hasAccessToken:!!i.data?.accessToken}}),i.data}async function BG({email:e,phone:t,password:n,isEmailMarketingConsent:s}){const r=await ps(),i=await qe(Ke("/accounts/sign-up/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,phone:t,password:n,fingerprint:r,isEmailMarketingConsent:s})}),o=await Ye(i);if(He(o))throw o.error;if(o.status==="error")throw{...o.error,data:o.data};return o.data}async function FG({name:e,phone:t,email:n,isMarketingConsent:s}){const r=await qe(Ke("/accounts/book-demo/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,phone:t,email:n,isMarketingConsent:s})}),i=await Ye(r);if(He(i))throw i.error;if(i.status==="error")throw{...i.error,data:i.data};return i.data}async function UG({passToken:e,smsCode:t}){const n=await ps(),s=await qe(Ke("/accounts/sign-up/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data}async function zG({passToken:e,smsCode:t}){const n=await ps(),s=await qe(Ke("/accounts/sign-in/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data}async function Mk({passToken:e,phone:t}){const n=await ps(),s=await qe(Ke("/accounts/sign-in/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:n,phone:t})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data}async function QG({passToken:e}){const t=await ps(),n=await qe(Ke("/accounts/sign-up/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data}async function z1(){const e=Se.getState().accessToken;Rn({stage:"SIGN_OUT_REQUEST",details:{hasAccessToken:!!e}});const t=await qe(Ke("/accounts/sign-out/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}),n=await Ye(t);if(He(n))throw Rn({stage:"SIGN_OUT_ERROR",details:{kind:"network",...LA({error:n.error})}}),n.error;if(n.status==="error")throw Rn({stage:"SIGN_OUT_ERROR",details:{kind:"api",...LA({error:n.error})}}),{...n.error,data:n.data};return Rn({stage:"SIGN_OUT_SUCCESS"}),n.data}async function HG({token:e}){const t=await ps(),n=Se.getState().accessToken,s={"Content-Type":"application/json"};n&&(s.Authorization=`Bearer ${n}`);const r=await qe(Ke("/accounts/email/confirm/"),{method:"POST",credentials:"include",headers:s,body:JSON.stringify({confirmationToken:e,fingerprint:t})}),i=await Ye(r);if(He(i))throw i.error;if(i.status==="error")throw{...i.error,data:i.data};return i.data}async function VG({passToken:e}){const t=await ps(),n=await qe(Ke("/accounts/email/confirm/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data}async function GG({token:e}){const t=await ps(),n=await qe(Ke("/accounts/token/redeem/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmationToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data}async function qG({passToken:e,smsCode:t}){const n=await ps(),s=await qe(Ke("/accounts/email/confirm/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data}async function WG({passToken:e,smsCode:t}){const n=await ps(),s=await qe(Ke("/accounts/token/redeem/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data}async function KG({passToken:e}){const t=await ps(),n=await qe(Ke("/accounts/token/redeem/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data}const jk=rt(async function({password:t}){const n=Se.getState().accessToken,s=await ps(),r=await qe(Ke("/accounts/phone/change/initiate/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({password:t,fingerprint:s})}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:{...i.error,data:i.data}};return i.data}),$G=async({confirmationToken:e})=>{const t=await ps(),n=await qe(Ke("/accounts/phone/change/redeem/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmationToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data},YG=async({passToken:e,phone:t})=>{const n=await ps(),s=await qe(Ke("/accounts/phone/change/send-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,phone:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data},XG=async({passToken:e,smsCode:t})=>{const n=await ps(),s=await qe(Ke("/accounts/phone/change/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data},JG=async({passToken:e})=>{const t=await ps(),n=await qe(Ke("/accounts/phone/change/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data},ZG=rt(async function({newEmail:t}){const n=Se.getState().accessToken,s=await ps(),r=await qe(Ke("/accounts/email/change/initiate/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({newEmail:t,fingerprint:s})}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:{...i.error,data:i.data}};return i.data}),eq=async({passToken:e,smsCode:t})=>{const n=await ps(),s=await qe(Ke("/accounts/email/change/confirm-by-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,smsCode:t,fingerprint:n})}),r=await Ye(s);if(He(r))throw r.error;if(r.status==="error")throw{...r.error,data:r.data};return r.data},tq=async({passToken:e})=>{const t=await ps(),n=await qe(Ke("/accounts/email/change/resend-sms/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({passToken:e,fingerprint:t})}),s=await Ye(n);if(He(s))throw s.error;if(s.status==="error")throw{...s.error,data:s.data};return s.data},nq=rt(async function(){const t=Se.getState().accessToken,n=await qe(Ke("/accounts/email/resend-confirmation/"),{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),s=await Ye(n);if(He(s))throw{httpCode:503,errorData:s.error};if(s.status==="error")throw{httpCode:n.status,errorData:{...s.error,data:s.data}};return s.data});async function Bk({email:e}){const t=await qe(Ke("/accounts/password/reset/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),n=await Ye(t);if(He(n))throw n.error;if(n.status==="error")throw{...n.error,data:n.data};return n.data}function rt(e){return async(...t)=>{try{return await e(...t)}catch(n){const s=n;
22if([401,403].includes(s.httpCode)){Rn({stage:"AUTO_REFRESH_RETRY",details:{httpCode:s.httpCode,errorCode:s.errorData?.code??null}});try{return await Lk(),Rn({stage:"AUTO_REFRESH_RETRY",message:"retrying request after refresh"}),await e(...t)}catch(r){throw Rn({stage:"AUTO_REFRESH_CLEAR_SESSION",details:{httpCode:s.httpCode,refreshError:LA({error:r})}}),Se.getState().clearAccessToken(),Se.getState().clearUser({reason:Ao.REFRESH_FAILED}),Se.getState().setIsUserLoadResolved(!1),r}}throw s.errorData}}}const dc=rt(async function(){Rn({stage:"GET_ME_REQUEST"});const t=Se.getState().accessToken,n=await qe(Ke("/accounts/me/"),{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),s=await Ye(n);if(He(s))throw{httpCode:503,errorData:s.error};if(s.status==="error"){const r=n.status;throw Rn({stage:"GET_ME_ERROR",details:{httpCode:r,errorCode:s.error?.code??null}}),{httpCode:r,errorData:{...s.error,data:s.data}}}return Rn({stage:"GET_ME_SUCCESS",details:{userId:s.data?.id??null}}),s.data}),II=rt(async function({email:t,phone:n}){const s=await qe(Ke("/accounts/email/status/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,phone:n})}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:{...r.error,data:r.data}};return r.data}),sq=rt(async function({password:t}){const n=Se.getState().accessToken,s=await qe(Ke("/accounts/password/set/"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({password:t})}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:{...r.error,data:r.data}};return r.data}),rq=rt(async function({isCookiesConsent:t,lastName:n,firstName:s,middleName:r,lawyerRegistrationNumber:i,lawyerPracticeForm:o,officialName:c}){const u=Se.getState().accessToken,d=await qe(Ke("/accounts/me/"),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({isCookiesConsent:t,lastName:n,firstName:s,middleName:r,lawyerRegistrationNumber:i,lawyerPracticeForm:o,officialName:c})}),p=await Ye(d);if(He(p))throw{httpCode:503,errorData:p.error};if(p.status==="error")throw{httpCode:d.status,errorData:{...p.error,data:p.data}};return p.data});function Fk(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Fk(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Y(){for(var e,t,n=0,s="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Fk(e))&&(s&&(s+=" "),s+=t);return s}var xm=e=>typeof e=="number"&&!isNaN(e),pu=e=>typeof e=="string",il=e=>typeof e=="function",iq=e=>pu(e)||xm(e),SI=e=>pu(e)||il(e)?e:null,oq=(e,t)=>e===!1||xm(e)&&e>0?e:t,vI=e=>l.isValidElement(e)||pu(e)||il(e)||xm(e);function aq(e,t,n=300){let{scrollHeight:s,style:r}=e;requestAnimationFrame(()=>{r.minHeight="initial",r.height=s+"px",r.transition=`all ${n}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,n)})})}function Uk({enter:e,exit:t,appendPosition:n=!1,collapse:s=!0,collapseDuration:r=300}){return function({children:i,position:o,preventExitTransition:c,done:u,nodeRef:d,isIn:p,playToast:g}){let A=n?`${e}--${o}`:e,E=n?`${t}--${o}`:t,x=l.useRef(0);return l.useLayoutEffect(()=>{let y=d.current,I=A.split(" "),v=S=>{S.target===d.current&&(g(),y.removeEventListener("animationend",v),y.removeEventListener("animationcancel",v),x.current===0&&S.type!=="animationcancel"&&y.classList.remove(...I))};y.classList.add(...I),y.addEventListener("animationend",v),y.addEventListener("animationcancel",v)},[]),l.useEffect(()=>{let y=d.current,I=()=>{y.removeEventListener("animationend",I),s?aq(y,u,r):u()};p||(c?I():(x.current=1,y.className+=` ${E}`,y.addEventListener("animationend",I)))},[p]),Oe.createElement(Oe.Fragment,null,i)}}function r6(e,t){return{content:zk(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function zk(e,t,n=!1){return l.isValidElement(e)&&!pu(e.type)?l.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):il(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:n}):e}function lq({closeToast:e,theme:t,ariaLabel:n="close"}){return Oe.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:s=>{s.stopPropagation(),e(!0)},"aria-label":n},Oe.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Oe.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function cq({delay:e,isRunning:t,closeToast:n,type:s="default",hide:r,className:i,controlledProgress:o,progress:c,rtl:u,isIn:d,theme:p}){let g=r||o&&c===0,A={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};o&&(A.transform=`scaleX(${c})`);let E=Y("Toastify__progress-bar",o?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":u}),x=il(i)?i({rtl:u,type:s,defaultClassName:E}):Y(E,i),y={[o&&c>=1?"onTransitionEnd":"onAnimationEnd"]:o&&c<1?null:()=>{d&&n()}};return Oe.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},Oe.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${s}`}),Oe.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer","aria-valuenow":o?Math.round(c*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:x,style:A,...y}))}var uq=1,Qk=()=>`${uq++}`;function dq(e,t,n){let s=1,r=0,i=[],o=[],c=t,u=new Map,d=new Set,p=S=>(d.add(S),()=>d.delete(S)),g=()=>{o=Array.from(u.values()),d.forEach(S=>S())},A=({containerId:S,toastId:b,updateId:w})=>{let _=S?S!==e:e!==1,N=u.has(b)&&w==null;return _||N},E=(S,b)=>{u.forEach(w=>{var _;(b==null||b===w.props.toastId)&&((_=w.toggle)==null||_.call(w,S))})},x=S=>{var b,w;S.isActive&&((w=(b=S.props)==null?void 0:b.onClose)==null||w.call(b,S.removalReason),S.isActive=!1,n(r6(S,"removed")))},y=S=>{if(S==null)u.forEach(x);else{let b=u.get(S);b&&x(b)}g()},I=()=>{r-=i.length,i=[]},v=S=>{var b,w;let{toastId:_,updateId:N}=S.props,R=N==null;S.staleId&&u.delete(S.staleId),S.isActive=!0,u.set(_,S),g(),n(r6(S,R?"added":"updated")),R&&((w=(b=S.props).onOpen)==null||w.call(b))};return{id:e,props:c,observe:p,toggle:E,removeToast:y,toasts:u,clearQueue:I,buildToast:(S,b)=>{if(A(b))return;let{toastId:w,updateId:_,data:N,staleId:R,delay:D}=b,k=_==null;k&&r++;let L={...c,style:c.toastStyle,key:s++,...Object.fromEntries(Object.entries(b).filter(([P,B])=>B!=null)),toastId:w,updateId:_,data:N,isIn:!1,className:SI(b.className||c.toastClassName),progressClassName:SI(b.progressClassName||c.progressClassName),autoClose:b.isLoading?!1:oq(b.autoClose,c.autoClose),closeToast(P){let B=u.get(w);B&&(B.removalReason=P,y(w))},deleteToast(){if(u.get(w)!=null){if(u.delete(w),r--,r<0&&(r=0),i.length>0){v(i.shift());return}g()}}};L.closeButton=c.closeButton,b.closeButton===!1||vI(b.closeButton)?L.closeButton=b.closeButton:b.closeButton===!0&&(L.closeButton=vI(c.closeButton)?c.closeButton:!0);let O={content:S,props:L,staleId:R};c.limit&&c.limit>0&&r>c.limit&&k?i.push(O):xm(D)?setTimeout(()=>{v(O)},D):v(O)},setProps(S){c=S},setToggle:(S,b)=>{let w=u.get(S);w&&(w.toggle=b)},isToastActive:S=>{var b;return(b=u.get(S))==null?void 0:b.isActive},getSnapshot:()=>o}}var vr=new Map,Vh=[],_I=new Set,fq=e=>_I.forEach(t=>t(e)),Hk=()=>vr.size>0;
vendor: 1,543 bytes, line 22
22function pq(){Vh.forEach(e=>Gk(e.content,e.options)),Vh=[]}var hq=(e,{containerId:t})=>{var n;return(n=vr.get(t||1))==null?void 0:n.toasts.get(e)};function Vk(e,t){var n;if(t)return!!((n=vr.get(t))!=null&&n.isToastActive(e));let s=!1;return vr.forEach(r=>{r.isToastActive(e)&&(s=!0)}),s}function mq(e){if(!Hk()){Vh=Vh.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||iq(e))vr.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=vr.get(e.containerId);t?t.removeToast(e.id):vr.forEach(n=>{n.removeToast(e.id)})}}var gq=(e={})=>{vr.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function Gk(e,t){vI(e)&&(Hk()||Vh.push({content:e,options:t}),vr.forEach(n=>{n.buildToast(e,t)}))}function Aq(e){var t;(t=vr.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function qk(e,t){vr.forEach(n=>{(t==null||!(t!=null&&t.containerId)||t?.containerId===n.id)&&n.toggle(e,t?.id)})}function Eq(e){let t=e.containerId||1;return{subscribe(n){let s=dq(t,e,fq);vr.set(t,s);let r=s.observe(n);return pq(),()=>{r(),vr.delete(t)}},setProps(n){var s;(s=vr.get(t))==null||s.setProps(n)},getSnapshot(){var n;return(n=vr.get(t))==null?void 0:n.getSnapshot()}}}function xq(e){return _I.add(e),()=>{_I.delete(e)}}function Cq(e){return e&&(pu(e.toastId)||xm(e.toastId))?e.toastId:Qk()}function Cm(e,t){return Gk(e,t),t.toastId}function Q1(e,t){return{...t,type:t&&t.type||e,toastId:Cq(t)}}function H1(e){return(t,n)=>Cm(t,Q1(e,n))}function en(e,t){return Cm(e,Q1("default",t))}en.loading=(e,t)=>
vendor: 6,952 bytes, line 22
22Cm(e,Q1("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t}));function yq(e,{pending:t,error:n,success:s},r){let i;t&&(i=pu(t)?en.loading(t,r):en.loading(t.render,{...r,...t}));let o={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(d,p,g)=>{if(p==null){en.dismiss(i);return}let A={type:d,...o,...r,data:g},E=pu(p)?{render:p}:p;return i?en.update(i,{...A,...E}):en(E.render,{...A,...E}),g},u=il(e)?e():e;return u.then(d=>c("success",s,d)).catch(d=>c("error",n,d)),u}en.promise=yq;en.success=H1("success");en.info=H1("info");en.error=H1("error");en.warning=H1("warning");en.warn=en.warning;en.dark=(e,t)=>Cm(e,Q1("default",{theme:"dark",...t}));function bq(e){mq(e)}en.dismiss=bq;en.clearWaitingQueue=gq;en.isActive=Vk;en.update=(e,t={})=>{let n=hq(e,t);if(n){let{props:s,content:r}=n,i={delay:100,...s,...t,toastId:t.toastId||e,updateId:Qk()};i.toastId!==e&&(i.staleId=e);let o=i.render||r;delete i.render,Cm(o,i)}};en.done=e=>{en.update(e,{progress:1})};en.onChange=xq;en.play=e=>qk(!0,e);en.pause=e=>qk(!1,e);function Iq(e){var t;let{subscribe:n,getSnapshot:s,setProps:r}=l.useRef(Eq(e)).current;r(e);let i=(t=l.useSyncExternalStore(n,s,s))==null?void 0:t.slice();function o(c){if(!i)return[];let u=new Map;return e.newestOnTop&&i.reverse(),i.forEach(d=>{let{position:p}=d.props;u.has(p)||u.set(p,[]),u.get(p).push(d)}),Array.from(u,d=>c(d[0],d[1]))}return{getToastToRender:o,isToastActive:Vk,count:i?.length}}function Sq(e){let[t,n]=l.useState(!1),[s,r]=l.useState(!1),i=l.useRef(null),o=l.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:d,onClick:p,closeOnClick:g}=e;Aq({id:e.toastId,containerId:e.containerId,fn:n}),l.useEffect(()=>{if(e.pauseOnFocusLoss)return A(),()=>{E()}},[e.pauseOnFocusLoss]);function A(){document.hasFocus()||v(),window.addEventListener("focus",I),window.addEventListener("blur",v)}function E(){window.removeEventListener("focus",I),window.removeEventListener("blur",v)}function x(R){if(e.draggable===!0||e.draggable===R.pointerType){S();let D=i.current;o.canCloseOnClick=!0,o.canDrag=!0,D.style.transition="none",e.draggableDirection==="x"?(o.start=R.clientX,o.removalDistance=D.offsetWidth*(e.draggablePercent/100)):(o.start=R.clientY,o.removalDistance=D.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function y(R){let{top:D,bottom:k,left:L,right:O}=i.current.getBoundingClientRect();R.pointerType==="mouse"&&e.pauseOnHover&&R.clientX>=L&&R.clientX<=O&&R.clientY>=D&&R.clientY<=k?v():I()}function I(){n(!0)}function v(){n(!1)}function S(){o.didMove=!1,document.addEventListener("pointermove",w),document.addEventListener("pointerup",_)}function b(){document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",_)}function w(R){let D=i.current;if(o.canDrag&&D){o.didMove=!0,t&&v(),e.draggableDirection==="x"?o.delta=R.clientX-o.start:o.delta=R.clientY-o.start,o.start!==R.clientX&&(o.canCloseOnClick=!1);let k=e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`;D.style.transform=`translate3d(${k},0)`,D.style.opacity=`${1-Math.abs(o.delta/o.removalDistance)}`}}function _(){b();let R=i.current;if(o.canDrag&&o.didMove&&R){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance){r(!0),e.closeToast(!0),e.collapseAll();return}R.style.transition="transform 0.2s, opacity 0.2s",R.style.removeProperty("transform"),R.style.removeProperty("opacity")}}let N={onPointerDown:x,onPointerUp:y};return c&&u&&(N.onMouseEnter=v,e.stacked||(N.onMouseLeave=I)),g&&(N.onClick=R=>{p&&p(R),o.canCloseOnClick&&d(!0)}),{playToast:I,pauseToast:v,isRunning:t,preventExitTransition:s,toastRef:i,eventHandlers:N}}var Wk=typeof window<"u"?l.useLayoutEffect:l.useEffect,V1=({theme:e,type:t,isLoading:n,...s})=>Oe.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`,...s});function vq(e){return Oe.createElement(V1,{...e},Oe.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function _q(e){return Oe.createElement(V1,{...e},Oe.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function Tq(e){return Oe.createElement(V1,{...e},Oe.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function Nq(e){return Oe.createElement(V1,{...e},Oe.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function wq(){return Oe.createElement("div",{className:"Toastify__spinner"})}var TI={info:_q,warning:vq,success:Tq,error:Nq,spinner:wq},Rq=e=>e in TI;function Dq({theme:e,type:t,isLoading:n,icon:s}){let r=null,i={theme:e,type:t};return s===!1||(il(s)?r=s({...i,isLoading:n}):l.isValidElement(s)?r=l.cloneElement(s,i):n?r=TI.spinner():Rq(t)&&(r=TI[t](i))),r}var kq=e=>{let{isRunning:t,preventExitTransition:n,toastRef:s,eventHandlers:r,playToast:i}=Sq(e),{closeButton:o,children:c,autoClose:u,onClick:d,type:p,hideProgressBar:g,closeToast:A,transition:E,position:x,className:y,style:I,progressClassName:v,updateId:S,role:b,progress:w,rtl:_,toastId:N,deleteToast:R,isIn:D,isLoading:k,closeOnClick:L,theme:O,ariaLabel:P}=e,B=Y("Toastify__toast",`Toastify__toast-theme--${O}`,`Toastify__toast--${p}`,{"Toastify__toast--rtl":_},{"Toastify__toast--close-on-click":L}),F=il(y)?y({rtl:_,position:x,type:p,defaultClassName:B}):Y(B,y),z=Dq(e),Q=!!w||!u,M={closeToast:A,type:p,theme:O},K=null;return o===!1||(il(o)?K=o(M):l.isValidElement(o)?K=l.cloneElement(o,M):K=lq(M)),Oe.createElement(E,{isIn:D,done:R,position:x,preventExitTransition:n,nodeRef:s,playToast:i},Oe.createElement("div",{id:N,tabIndex:0,onClick:d,"data-in":D,className:F,...r,style:I,ref:s,...D&&{role:b,"aria-label":P}},z!=null&&Oe.createElement("div",{className:Y("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter"
22:!k})},z),zk(c,e,!t),K,!e.customProgressBar&&Oe.createElement(cq,{...S&&!Q?{key:`p-${S}`}:{},rtl:_,theme:O,delay:u,isRunning:t,isIn:D,closeToast:A,hide:g,type:p,className:v,controlledProgress:Q,progress:w||0})))},Kk=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),Oq=Uk(Kk("bounce",!0)),Pq=Uk(Kk("slide",!0)),Lq={position:"top-right",transition:Oq,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function Mq(e){let t={...Lq,...e},n=e.stacked,[s,r]=l.useState(!0),i=l.useRef(null),{getToastToRender:o,isToastActive:c,count:u}=Iq(t),{className:d,style:p,rtl:g,containerId:A,hotKeys:E}=t;function x(I){let v=Y("Toastify__toast-container",`Toastify__toast-container--${I}`,{"Toastify__toast-container--rtl":g});return il(d)?d({position:I,rtl:g,defaultClassName:v}):Y(v,SI(d))}function y(){n&&(r(!0),en.play())}return Wk(()=>{var I;if(n){let v=i.current.querySelectorAll('[data-in="true"]'),S=12,b=(I=t.position)==null?void 0:I.includes("top"),w=0,_=0;Array.from(v).reverse().forEach((N,R)=>{let D=N;D.classList.add("Toastify__toast--stacked"),R>0&&(D.dataset.collapsed=`${s}`),D.dataset.pos||(D.dataset.pos=b?"top":"bot");let k=w*(s?.2:1)+(s?0:S*R),L=Math.max(.5,1-(s?_:0));D.style.setProperty("--y",`${b?k:k*-1}px`),D.style.setProperty("--g",`${S}`),D.style.setProperty("--s",`${L}`),w+=D.offsetHeight,_+=.025})}},[s,u,n]),l.useEffect(()=>{function I(v){var S;let b=i.current;E(v)&&((S=b?.querySelector('[tabIndex="0"]'))==null||S.focus(),r(!1),en.pause()),v.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(r(!0),en.play())}return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[E]),Oe.createElement("section",{ref:i,className:"Toastify",id:A,onMouseEnter:()=>{n&&(r(!1),en.pause())},onMouseLeave:y,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},o((I,v)=>{let S=v.length?{...p}:{...p,pointerEvents:"none"};return Oe.createElement("div",{tabIndex:-1,className:x(I),"data-stacked":n,style:S,key:`c-${I}`},v.map(({content:b,props:w})=>Oe.createElement(kq,{...w,stacked:n,collapseAll:y,isIn:c(w.toastId,w.containerId),key:`t-${w.key}`},b)))}))}var jq
vendor: 17,403 bytes, lines 22-828
22=`:root {
23  --toastify-color-light: #fff;
24  --toastify-color-dark: #121212;
25  --toastify-color-info: #3498db;
26  --toastify-color-success: #07bc0c;
27  --toastify-color-warning: #f1c40f;
28  --toastify-color-error: hsl(6, 78%, 57%);
29  --toastify-color-transparent: rgba(255, 255, 255, 0.7);
30
31  --toastify-icon-color-info: var(--toastify-color-info);
32  --toastify-icon-color-success: var(--toastify-color-success);
33  --toastify-icon-color-warning: var(--toastify-color-warning);
34  --toastify-icon-color-error: var(--toastify-color-error);
35
36  --toastify-container-width: fit-content;
37  --toastify-toast-width: 320px;
38  --toastify-toast-offset: 16px;
39  --toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));
40  --toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));
41  --toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));
42  --toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));
43  --toastify-toast-background: #fff;
44  --toastify-toast-padding: 14px;
45  --toastify-toast-min-height: 64px;
46  --toastify-toast-max-height: 800px;
47  --toastify-toast-bd-radius: 6px;
48  --toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
49  --toastify-font-family: sans-serif;
50  --toastify-z-index: 9999;
51  --toastify-text-color-light: #757575;
52  --toastify-text-color-dark: #fff;
53
54  /* Used only for colored theme */
55  --toastify-text-color-info: #fff;
56  --toastify-text-color-success: #fff;
57  --toastify-text-color-warning: #fff;
58  --toastify-text-color-error: #fff;
59
60  --toastify-spinner-color: #616161;
61  --toastify-spinner-color-empty-area: #e0e0e0;
62  --toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);
63  --toastify-color-progress-dark: #bb86fc;
64  --toastify-color-progress-info: var(--toastify-color-info);
65  --toastify-color-progress-success: var(--toastify-color-success);
66  --toastify-color-progress-warning: var(--toastify-color-warning);
67  --toastify-color-progress-error: var(--toastify-color-error);
68  /* used to control the opacity of the progress trail */
69  --toastify-color-progress-bgo: 0.2;
70}
71
72.Toastify__toast-container {
73  z-index: var(--toastify-z-index);
74  -webkit-transform: translate3d(0, 0, var(--toastify-z-index));
75  position: fixed;
76  width: var(--toastify-container-width);
77  box-sizing: border-box;
78  color: #fff;
79  display: flex;
80  flex-direction: column;
81}
82
83.Toastify__toast-container--top-left {
84  top: var(--toastify-toast-top);
85  left: var(--toastify-toast-left);
86}
87.Toastify__toast-container--top-center {
88  top: var(--toastify-toast-top);
89  left: 50%;
90  transform: translateX(-50%);
91  align-items: center;
92}
93.Toastify__toast-container--top-right {
94  top: var(--toastify-toast-top);
95  right: var(--toastify-toast-right);
96  align-items: end;
97}
98.Toastify__toast-container--bottom-left {
99  bottom: var(--toastify-toast-bottom);
100  left: var(--toastify-toast-left);
101}
102.Toastify__toast-container--bottom-center {
103  bottom: var(--toastify-toast-bottom);
104  left: 50%;
105  transform: translateX(-50%);
106  align-items: center;
107}
108.Toastify__toast-container--bottom-right {
109  bottom: var(--toastify-toast-bottom);
110  right: var(--toastify-toast-right);
111  align-items: end;
112}
113
114.Toastify__toast {
115  --y: 0px;
116  position: relative;
117  touch-action: none;
118  width: var(--toastify-toast-width);
119  min-height: var(--toastify-toast-min-height);
120  box-sizing: border-box;
121  margin-bottom: 1rem;
122  padding: var(--toastify-toast-padding);
123  border-radius: var(--toastify-toast-bd-radius);
124  box-shadow: var(--toastify-toast-shadow);
125  max-height: var(--toastify-toast-max-height);
126  font-family: var(--toastify-font-family);
127  /* webkit only issue #791 */
128  z-index: 0;
129  /* inner swag */
130  display: flex;
131  flex: 1 auto;
132  align-items: center;
133  word-break: break-word;
134}
135
136@media only screen and (max-width: 480px) {
137  .Toastify__toast-container {
138    width: 100vw;
139    left: env(safe-area-inset-left);
140    margin: 0;
141  }
142  .Toastify__toast-container--top-left,
143  .Toastify__toast-container--top-center,
144  .Toastify__toast-container--top-right {
145    top: env(safe-area-inset-top);
146    transform: translateX(0);
147  }
148  .Toastify__toast-container--bottom-left,
149  .Toastify__toast-container--bottom-center,
150  .Toastify__toast-container--bottom-right {
151    bottom: env(safe-area-inset-bottom);
152    transform: translateX(0);
153  }
154  .Toastify__toast-container--rtl {
155    right: env(safe-area-inset-right);
156    left: initial;
157  }
158  .Toastify__toast {
159    --toastify-toast-width: 100%;
160    margin-bottom: 0;
161    border-radius: 0;
162  }
163}
164
165.Toastify__toast-container[data-stacked='true'] {
166  width: var(--toastify-toast-width);
167}
168
169@media only screen and (max-width: 480px) {
170  .Toastify__toast-container[data-stacked='true'] {
171    width: 100vw;
172  }
173}
174
175.Toastify__toast--stacked {
176  position: absolute;
177  width: 100%;
178  transform: translate3d(0, var(--y), 0) scale(var(--s));
179  transition: transform 0.3s;
180}
181
182.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,
183.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {
184  transition: opacity 0.1s;
185}
186
187.Toastify__toast--stacked[data-collapsed='false'] {
188  overflow: visible;
189}
190
191.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {
192  opacity: 0;
193}
194
195.Toastify__toast--stacked:after {
196  content: '';
197  position: absolute;
198  left: 0;
199  right: 0;
200  height: calc(var(--g) * 1px);
201  bottom: 100%;
202}
203
204.Toastify__toast--stacked[data-pos='top'] {
205  top: 0;
206}
207
208.Toastify__toast--stacked[data-pos='bot'] {
209  bottom: 0;
210}
211
212.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {
213  transform-origin: top;
214}
215
216.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {
217  transform-origin: bottom;
218}
219
220.Toastify__toast--stacked:before {
221  content: '';
222  position: absolute;
223  left: 0;
224  right: 0;
225  bottom: 0;
226  height: 100%;
227  transform: scaleY(3);
228  z-index: -1;
229}
230
231.Toastify__toast--rtl {
232  direction: rtl;
233}
234
235.Toastify__toast--close-on-click {
236  cursor: pointer;
237}
238
239.Toastify__toast-icon {
240  margin-inline-end: 10px;
241  width: 22px;
242  flex-shrink: 0;
243  display: flex;
244}
245
246.Toastify--animate {
247  animation-fill-mode: both;
248  animation-duration: 0.5s;
249}
250
251.Toastify--animate-icon {
252  animation-fill-mode: both;
253  animation-duration: 0.3s;
254}
255
256.Toastify__toast-theme--dark {
257  background: var(--toastify-color-dark);
258  color: var(--toastify-text-color-dark);
259}
260
261.Toastify__toast-theme--light {
262  background: var(--toastify-color-light);
263  color: var(--toastify-text-color-light);
264}
265
266.Toastify__toast-theme--colored.Toastify__toast--default {
267  background: var(--toastify-color-light);
268  color: var(--toastify-text-color-light);
269}
270
271.Toastify__toast-theme--colored.Toastify__toast--info {
272  color: var(--toastify-text-color-info);
273  background: var(--toastify-color-info);
274}
275
276.Toastify__toast-theme--colored.Toastify__toast--success {
277  color: var(--toastify-text-color-success);
278  background: var(--toastify-color-success);
279}
280
281.Toastify__toast-theme--colored.Toastify__toast--warning {
282  color: var(--toastify-text-color-warning);
283  background: var(--toastify-color-warning);
284}
285
286.Toastify__toast-theme--colored.Toastify__toast--error {
287  color: var(--toastify-text-color-error);
288  background: var(--toastify-color-error);
289}
290
291.Toastify__progress-bar-theme--light {
292  background: var(--toastify-color-progress-light);
293}
294
295.Toastify__progress-bar-theme--dark {
296  background: var(--toastify-color-progress-dark);
297}
298
299.Toastify__progress-bar--info {
300  background: var(--toastify-color-progress-info);
301}
302
303.Toastify__progress-bar--success {
304  background: var(--toastify-color-progress-success);
305}
306
307.Toastify__progress-bar--warning {
308  background: var(--toastify-color-progress-warning);
309}
310
311.Toastify__progress-bar--error {
312  background: var(--toastify-color-progress-error);
313}
314
315.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,
316.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,
317.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,
318.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {
319  background: var(--toastify-color-transparent);
320}
321
322.Toastify__close-button {
323  color: #fff;
324  position: absolute;
325  top: 6px;
326  right: 6px;
327  background: transparent;
328  outline: none;
329  border: none;
330  padding: 0;
331  cursor: pointer;
332  opacity: 0.7;
333  transition: 0.3s ease;
334  z-index: 1;
335}
336
337.Toastify__toast--rtl .Toastify__close-button {
338  left: 6px;
339  right: unset;
340}
341
342.Toastify__close-button--light {
343  color: #000;
344  opacity: 0.3;
345}
346
347.Toastify__close-button > svg {
348  fill: currentColor;
349  height: 16px;
350  width: 14px;
351}
352
353.Toastify__close-button:hover,
354.Toastify__close-button:focus {
355  opacity: 1;
356}
357
358@keyframes Toastify__trackProgress {
359  0% {
360    transform: scaleX(1);
361  }
362  100% {
363    transform: scaleX(0);
364  }
365}
366
367.Toastify__progress-bar {
368  position: absolute;
369  bottom: 0;
370  left: 0;
371  width: 100%;
372  height: 100%;
373  z-index: 1;
374  opacity: 0.7;
375  transform-origin: left;
376}
377
378.Toastify__progress-bar--animated {
379  animation: Toastify__trackProgress linear 1 forwards;
380}
381
382.Toastify__progress-bar--controlled {
383  transition: transform 0.2s;
384}
385
386.Toastify__progress-bar--rtl {
387  right: 0;
388  left: initial;
389  transform-origin: right;
390  border-bottom-left-radius: initial;
391}
392
393.Toastify__progress-bar--wrp {
394  position: absolute;
395  overflow: hidden;
396  bottom: 0;
397  left: 0;
398  width: 100%;
399  height: 5px;
400  border-bottom-left-radius: var(--toastify-toast-bd-radius);
401  border-bottom-right-radius: var(--toastify-toast-bd-radius);
402}
403
404.Toastify__progress-bar--wrp[data-hidden='true'] {
405  opacity: 0;
406}
407
408.Toastify__progress-bar--bg {
409  opacity: var(--toastify-color-progress-bgo);
410  width: 100%;
411  height: 100%;
412}
413
414.Toastify__spinner {
415  width: 20px;
416  height: 20px;
417  box-sizing: border-box;
418  border: 2px solid;
419  border-radius: 100%;
420  border-color: var(--toastify-spinner-color-empty-area);
421  border-right-color: var(--toastify-spinner-color);
422  animation: Toastify__spin 0.65s linear infinite;
423}
424
425@keyframes Toastify__bounceInRight {
426  from,
427  60%,
428  75%,
429  90%,
430  to {
431    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
432  }
433  from {
434    opacity: 0;
435    transform: translate3d(3000px, 0, 0);
436  }
437  60% {
438    opacity: 1;
439    transform: translate3d(-25px, 0, 0);
440  }
441  75% {
442    transform: translate3d(10px, 0, 0);
443  }
444  90% {
445    transform: translate3d(-5px, 0, 0);
446  }
447  to {
448    transform: none;
449  }
450}
451
452@keyframes Toastify__bounceOutRight {
453  20% {
454    opacity: 1;
455    transform: translate3d(-20px, var(--y), 0);
456  }
457  to {
458    opacity: 0;
459    transform: translate3d(2000px, var(--y), 0);
460  }
461}
462
463@keyframes Toastify__bounceInLeft {
464  from,
465  60%,
466  75%,
467  90%,
468  to {
469    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
470  }
471  0% {
472    opacity: 0;
473    transform: translate3d(-3000px, 0, 0);
474  }
475  60% {
476    opacity: 1;
477    transform: translate3d(25px, 0, 0);
478  }
479  75% {
480    transform: translate3d(-10px, 0, 0);
481  }
482  90% {
483    transform: translate3d(5px, 0, 0);
484  }
485  to {
486    transform: none;
487  }
488}
489
490@keyframes Toastify__bounceOutLeft {
491  20% {
492    opacity: 1;
493    transform: translate3d(20px, var(--y), 0);
494  }
495  to {
496    opacity: 0;
497    transform: translate3d(-2000px, var(--y), 0);
498  }
499}
500
501@keyframes Toastify__bounceInUp {
502  from,
503  60%,
504  75%,
505  90%,
506  to {
507    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
508  }
509  from {
510    opacity: 0;
511    transform: translate3d(0, 3000px, 0);
512  }
513  60% {
514    opacity: 1;
515    transform: translate3d(0, -20px, 0);
516  }
517  75% {
518    transform: translate3d(0, 10px, 0);
519  }
520  90% {
521    transform: translate3d(0, -5px, 0);
522  }
523  to {
524    transform: translate3d(0, 0, 0);
525  }
526}
527
528@keyframes Toastify__bounceOutUp {
529  20% {
530    transform: translate3d(0, calc(var(--y) - 10px), 0);
531  }
532  40%,
533  45% {
534    opacity: 1;
535    transform: translate3d(0, calc(var(--y) + 20px), 0);
536  }
537  to {
538    opacity: 0;
539    transform: translate3d(0, -2000px, 0);
540  }
541}
542
543@keyframes Toastify__bounceInDown {
544  from,
545  60%,
546  75%,
547  90%,
548  to {
549    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
550  }
551  0% {
552    opacity: 0;
553    transform: translate3d(0, -3000px, 0);
554  }
555  60% {
556    opacity: 1;
557    transform: translate3d(0, 25px, 0);
558  }
559  75% {
560    transform: translate3d(0, -10px, 0);
561  }
562  90% {
563    transform: translate3d(0, 5px, 0);
564  }
565  to {
566    transform: none;
567  }
568}
569
570@keyframes Toastify__bounceOutDown {
571  20% {
572    transform: translate3d(0, calc(var(--y) - 10px), 0);
573  }
574  40%,
575  45% {
576    opacity: 1;
577    transform: translate3d(0, calc(var(--y) + 20px), 0);
578  }
579  to {
580    opacity: 0;
581    transform: translate3d(0, 2000px, 0);
582  }
583}
584
585.Toastify__bounce-enter--top-left,
586.Toastify__bounce-enter--bottom-left {
587  animation-name: Toastify__bounceInLeft;
588}
589
590.Toastify__bounce-enter--top-right,
591.Toastify__bounce-enter--bottom-right {
592  animation-name: Toastify__bounceInRight;
593}
594
595.Toastify__bounce-enter--top-center {
596  animation-name: Toastify__bounceInDown;
597}
598
599.Toastify__bounce-enter--bottom-center {
600  animation-name: Toastify__bounceInUp;
601}
602
603.Toastify__bounce-exit--top-left,
604.Toastify__bounce-exit--bottom-left {
605  animation-name: Toastify__bounceOutLeft;
606}
607
608.Toastify__bounce-exit--top-right,
609.Toastify__bounce-exit--bottom-right {
610  animation-name: Toastify__bounceOutRight;
611}
612
613.Toastify__bounce-exit--top-center {
614  animation-name: Toastify__bounceOutUp;
615}
616
617.Toastify__bounce-exit--bottom-center {
618  animation-name: Toastify__bounceOutDown;
619}
620
621@keyframes Toastify__zoomIn {
622  from {
623    opacity: 0;
624    transform: scale3d(0.3, 0.3, 0.3);
625  }
626  50% {
627    opacity: 1;
628  }
629}
630
631@keyframes Toastify__zoomOut {
632  from {
633    opacity: 1;
634  }
635  50% {
636    opacity: 0;
637    transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);
638  }
639  to {
640    opacity: 0;
641  }
642}
643
644.Toastify__zoom-enter {
645  animation-name: Toastify__zoomIn;
646}
647
648.Toastify__zoom-exit {
649  animation-name: Toastify__zoomOut;
650}
651
652@keyframes Toastify__flipIn {
653  from {
654    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
655    animation-timing-function: ease-in;
656    opacity: 0;
657  }
658  40% {
659    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
660    animation-timing-function: ease-in;
661  }
662  60% {
663    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
664    opacity: 1;
665  }
666  80% {
667    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
668  }
669  to {
670    transform: perspective(400px);
671  }
672}
673
674@keyframes Toastify__flipOut {
675  from {
676    transform: translate3d(0, var(--y), 0) perspective(400px);
677  }
678  30% {
679    transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);
680    opacity: 1;
681  }
682  to {
683    transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);
684    opacity: 0;
685  }
686}
687
688.Toastify__flip-enter {
689  animation-name: Toastify__flipIn;
690}
691
692.Toastify__flip-exit {
693  animation-name: Toastify__flipOut;
694}
695
696@keyframes Toastify__slideInRight {
697  from {
698    transform: translate3d(110%, 0, 0);
699    visibility: visible;
700  }
701  to {
702    transform: translate3d(0, var(--y), 0);
703  }
704}
705
706@keyframes Toastify__slideInLeft {
707  from {
708    transform: translate3d(-110%, 0, 0);
709    visibility: visible;
710  }
711  to {
712    transform: translate3d(0, var(--y), 0);
713  }
714}
715
716@keyframes Toastify__slideInUp {
717  from {
718    transform: translate3d(0, 110%, 0);
719    visibility: visible;
720  }
721  to {
722    transform: translate3d(0, var(--y), 0);
723  }
724}
725
726@keyframes Toastify__slideInDown {
727  from {
728    transform: translate3d(0, -110%, 0);
729    visibility: visible;
730  }
731  to {
732    transform: translate3d(0, var(--y), 0);
733  }
734}
735
736@keyframes Toastify__slideOutRight {
737  from {
738    transform: translate3d(0, var(--y), 0);
739  }
740  to {
741    visibility: hidden;
742    transform: translate3d(110%, var(--y), 0);
743  }
744}
745
746@keyframes Toastify__slideOutLeft {
747  from {
748    transform: translate3d(0, var(--y), 0);
749  }
750  to {
751    visibility: hidden;
752    transform: translate3d(-110%, var(--y), 0);
753  }
754}
755
756@keyframes Toastify__slideOutDown {
757  from {
758    transform: translate3d(0, var(--y), 0);
759  }
760  to {
761    visibility: hidden;
762    transform: translate3d(0, 500px, 0);
763  }
764}
765
766@keyframes Toastify__slideOutUp {
767  from {
768    transform: translate3d(0, var(--y), 0);
769  }
770  to {
771    visibility: hidden;
772    transform: translate3d(0, -500px, 0);
773  }
774}
775
776.Toastify__slide-enter--top-left,
777.Toastify__slide-enter--bottom-left {
778  animation-name: Toastify__slideInLeft;
779}
780
781.Toastify__slide-enter--top-right,
782.Toastify__slide-enter--bottom-right {
783  animation-name: Toastify__slideInRight;
784}
785
786.Toastify__slide-enter--top-center {
787  animation-name: Toastify__slideInDown;
788}
789
790.Toastify__slide-enter--bottom-center {
791  animation-name: Toastify__slideInUp;
792}
793
794.Toastify__slide-exit--top-left,
795.Toastify__slide-exit--bottom-left {
796  animation-name: Toastify__slideOutLeft;
797  animation-timing-function: ease-in;
798  animation-duration: 0.3s;
799}
800
801.Toastify__slide-exit--top-right,
802.Toastify__slide-exit--bottom-right {
803  animation-name: Toastify__slideOutRight;
804  animation-timing-function: ease-in;
805  animation-duration: 0.3s;
806}
807
808.Toastify__slide-exit--top-center {
809  animation-name: Toastify__slideOutUp;
810  animation-timing-function: ease-in;
811  animation-duration: 0.3s;
812}
813
814.Toastify__slide-exit--bottom-center {
815  animation-name: Toastify__slideOutDown;
816  animation-timing-function: ease-in;
817  animation-duration: 0.3s;
818}
819
820@keyframes Toastify__spin {
821  from {
822    transform: rotate(0deg);
823  }
824  to {
825    transform: rotate(360deg);
826  }
827}
828`
828,i6=new Map,Bq=(e,t)=>{Wk(()=>{if(typeof document>"u")return;let n=document,s=i6.get(n);if(s){t&&s.setAttribute("nonce",t);return}let r=n.createElement("style");r.textContent=e,t&&r.setAttribute("nonce",t),n.head.appendChild(r),i6.set(n,r)},[t])};function Fq(e){return Bq(jq,e.nonce),Oe.createElement(Mq,{...e})}const Uq=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"#4ADE80"}),l.createElement("path",{d:"M16.8834 8.95829L11.8571 15.6103C11.6724 15.8544 11.3625 16 11.0272 16C10.7306 16 10.4497 15.8858 10.2571 15.6864L7.16552 12.4947C6.91867 12.2397 6.95137 11.8652 7.24059 11.642C7.52152 11.4244 7.99358 11.4203 8.28096 11.6333L10.9079 13.5792L15.6091 8.25502C15.8431 7.99021 16.328 7.91871 16.6596 8.10181C17.0041 8.2921 17.1027 8.66851 16.8834 8.95829Z",fill:"white"})),zq=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"#F87171"}),l.createElement("path",{d:"M12 7V13",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.9922 17H12.0012",stroke:"white",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})),$k=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"#FBBF24"}),l.createElement("path",{d:"M12 7V13",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.9922 17H12.0012",stroke:"white",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})),Qq=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"#38BDF8"}),l.createElement("path",{d:"M11.9932 17L11.9932 11",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.001 7L11.992 7",stroke:"white",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})),Hq=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M8.06982 10.2474C7.19331 10.6745 6.20612 10.8201 5.24365 10.664C4.28117 10.5079 3.39054 10.0579 2.69391 9.37571C1.99728 8.69348 1.52877 7.81245 1.35264 6.85344C1.1765 5.89443 1.30137 4.90442 1.71011 4.01918C2.11885 3.13394 2.79145 2.39683 3.63566 1.90895C4.47987 1.42106 5.45434 1.2063 6.42543 1.29411C7.39651 1.38192 8.31665 1.768 9.05965 2.39941C9.80265 3.03081 10.3321 3.87662 10.5
828754 4.82082",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function Vq({type:e,message:t,buttons:n,closeOnClick:s}){const r=l.useMemo(()=>e==="success"?a.jsx(Uq,{}):e==="failed"?a.jsx(zq,{}):e==="warning"?a.jsx($k,{}):e==="info"?a.jsx(Qq,{}):e==="pending"?a.jsx("div",{className:"w-6 h-6 flex items-center justify-center",children:a.jsx("div",{className:"w-5 h-5 animate-spin rounded-full bg-sky-400 flex items-center justify-center",children:a.jsx(Hq,{className:"size-3.5 block"})})}):null,[e]);return a.jsxs("div",{className:Y("h-auto","bp48:h-10","flex","flex-col","gap-3","bp48:gap-6","bp48:flex-row","items-center","pt-2",!n?.length&&"pr-2",!!n?.length&&"pr-2 bp48:pr-1","pb-2","pl-2","rounded-xl","text-[14px]","leading-[16px]","text-white","bg-black/80",!!s&&"cursor-pointer"),style:{boxShadow:"0px 15px 6px rgba(0, 0, 0, 0.01), 0px 9px 5px rgba(0, 0, 0, 0.03), 0px 4px 4px rgba(0, 0, 0, 0.04), 0px 1px 2px rgba(0, 0, 0, 0.05)"},children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-6 h-6 mr-1.5 flex-shrink-0 self-start bp48:self-center",children:r}),a.jsx("div",{className:"flex-1",children:t})]}),!!n?.length&&a.jsx("div",{className:"w-full flex items-center gap-1",children:n?.map((i,o)=>a.jsx("div",{onClick:i.onClick,className:Y("h-8","w-full","flex","items-center","justify-center","roboto-flex-25-700-1",!i.isDark&&"bg-zinc-200",!i.isDark&&"hover:bg-zinc-300",!!i.isDark&&"bg-[#F4F4F514]",!!i.isDark&&"hover:bg-[#F4F4F50A]",!i.isDark&&"text-zinc-950",!i.isDark&&"hover:text-zinc-800",!!i.isDark&&"text-zinc-100",!!i.isDark&&"hover:text-zinc-100","uppercase","cursor-pointer","px-3","rounded-full"),children:i.text},o))})]})}const Gq=800,Yk=new Set,NI=new Map,tf=new Map,Gh=new Map;let o6=null;const qq=e=>{const t=NI.get(e);return t==="added"||t==="updated"},Wq=e=>tf.has(e),Kq=e=>{const t=Gh.get(e);t&&(Gh.delete(e),en(t.renderToast,t.toastOptions))},$q=e=>{const t=tf.get(e);t!==void 0&&window.clearTimeout(t);const n=window.setTimeout(()=>{tf.delete(e),Kq(e)},Gq);tf.set(e,n)},Yq=()=>{o6||(o6=en.onChange(e=>{const t=e.id;if(typeof t!="string"&&typeof t!="number")return;const n=String(t);if(!Yk.has(n))return;const s=n,r=e.status;if(r==="added"||r==="updated"){NI.set(s,r);const i=tf.get(s);i!==void 0&&(window.clearTimeout(i),tf.delete(s)),Gh.delete(s);return}r==="removed"&&(NI.set(s,"removed"),$q(s))}))},ve=({type:e,message:t,buttons:n,duration:s=3e3,key:r,closeOnClick:i})=>{if(!t)return;Yq(),r&&Yk.add(r);const o={autoClose:s||!1,closeOnClick:i??!0,toastId:r},c=()=>a.jsx(Vq,{type:e,message:t,buttons:n,closeOnClick:i});if(r&&qq(r)){en.update(r,{render:c,autoClose:o.autoClose,closeOnClick:o.closeOnClick});return}if(r&&Wq(r)){Gh.set(r,{renderToast:c,toastOptions:o});return}en(c,o)},Ze=e=>{Gh.delete(e),en.dismiss(e)},Xq=()=>{const e=Fe(),t=l.useRef(e),n=l.useRef(!1),s=Se(y=>y.user),r=Se(y=>y.isUserLoadResolved),i=Se(y=>y.setUser),o=Se(y=>y.clearUser),c=Se(y=>y.setIsAppReady),u=Se(y=>y.setIsUserLoadResolved),d=Se(y=>y.clearAccessToken),p=bt(),{data:g,error:A,refetch:E}=Vt({queryKey:["me"],queryFn:dc,enabled:!1,retry:!1});l.useEffect(()=>{t.current=e},[e]),l.useEffect(()=>{const y=t.current.pathname.replace(/\/+$/,"")||"/";if(y!=="/confirm-email"&&y!=="/setup-new-password"&&!(y==="/setup-new-phone"||y==="/setup-new-phone/sms")){if(A){Rn({stage:"AUTH_SYNC_GET_ME_ERROR",details:{errorCode:A.code??null}}),p.resetQueries({queryKey:["me"],exact:!0}),p.resetQueries({queryKey:["clientsList"],exact:!0}),d(),o({reason:Ao.SIGN_IN_ATTEMPT_FAILED}),c(!0),u(!0),Ze("SIGN_UP_TRYING");return}g&&(Rn({stage:"AUTH_SYNC_USER_SET",details:{userId:g.id??null}}),i(g),c(!0),u(!0),Ze("SIGN_UP_TRYING"))}},[p,g,A,i,c,u,o,d]);const x=l.useCallback(()=>{n.current||(n.current=!0,Rn({stage:"AUTH_SYNC_INIT_ME"}),p.resetQueries({queryKey:["me"],exact:!0}),p.resetQueries({queryKey:["clientsList"],exact:!0}),E().finally(()=>{n.current=!1}))},[E,p]);l.useEffect(()=>{const y=t.current.pathname.replace(/\/+$/,"")||"/";if(y!=="/confirm-email"&&y!=="/setup-new-password"&&!(y==="/setup-new-phone"||y==="/setup-new-phone/sms")&&!r){if(s){Rn({stage:"AUTH_SYNC_USER_ALREADY_SET",details:{userId:s.id??null}}),c(!0),u(!0);return}x()}},[r,s,x,c,u])},Jq={signIn:{errors:{VALIDATION_ERROR:"Некоторые поля заполнены неверно",ACCOUNT_NOT_FOUND:"Неправильный логин или пароль",INVALID_CREDENTIALS:"Неправильный логин или пароль",UNKNOW_ERROR:"Произошла ошибка при авторизации"},fieldsErrors:{email:{VALUE_ERROR:"Неверный формат телефона или эл. почты"},phone:{VALUE_ERROR:"Неверный формат телефона или эл. почты"},password:{VALUE_ERROR:"Неверный формат пароля"}},placeholders:{PHONE_OR_EMAIL:"Телефон или эл. почта",PASSWORD:"Пароль"},titles:{SIGN_IN:"Вход"},buttons:{SIGN_IN:"Войти"},enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на
828 номер",SUFFIX:"введите код, чтобы войти в аккаунт"},errors:{resendSmsFailed:{PREFIX:"Код не отправлен. Повторная отправка возможна через ",SUFFIX:"."},smsNotSent:{PREFIX:"Авторизация временно заблокирована. Попробуйте повторить через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"},INVALID_CODE:"Неверный код. Осталось",attemptsLeft:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",PASS_TOKEN_EXPIRED:"Отправленный код устарел. Попробуйте отправить код повторно.",UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу."}},phoneForm:{titles:{TITLE_1:"Добавьте номер телефона",TITLE_2:"для защиты аккаунта"},description:{TEXT:"Чтобы усилить защиту ваших данных в Plevako.ai, добавьте свой номер телефона. Мы будем отправлять одноразовый код при каждом входе. Рассылок не будет."},placeholders:{PHONE:"Телефон"},buttons:{CONFIRM:"Подтвердить номер"},errors:{PASS_TOKEN_EXPIRED:"Срок действия запроса истек. Попробуйте авторизоваться заново.",PHONE_ALREADY_REGISTERED:"Телефон уже привязан к другому аккаунту",ACCOUNT_DATA_CONFLICT:"Телефон уже привязан к другому аккаунту",PHONE_NOT_CONFIRMED:"Аккаунт уже содержит номер телефона. Попробуйте авторизоваться заново.",VALIDATION_ERROR:"Некоторые поля заполнены неверно",UNKNOW_ERROR:"Произошла ошибка при добавлении номера телефона"},fieldsErrors:{PHONE_REQUIRED:"Поле обязательно для заполнения",VALUE_ERROR:"Неверный формат телефона"},notifications:{smsNotSent:{PREFIX:"Добавление телефона временно заблокировано. Попробуйте повторить через ",SUFFIX:"."}}},links:{NO_ACCOUNT_PROMPT:"Нет аккаунта? ",SIGN_UP:"Зарегистрируйтесь",FORGOT_PASSWORD:"Забыли пароль?"},notifications:{AUTHORIZATION_SUCCESS:"Вы авторизованы",SENDING:"Код отправляется",SENT:"Код отправлен",smsDisabledDev:{PREFIX:"На dev-площадке отправка SMS отключена. Ваш код: "}}},signOut:{errors:{SIGN_OUT_ERROR:"Ошибка при попытке выхода"}},signUp:{errors:{VALIDATION_ERROR:"Некоторые поля заполнены неверно",ACCOUNT_ALREADY_EXISTS:"Пользователь уже зарегистрирован",UNKNOW_ERROR:"Произошла ошибка при попытке регистрации пользователя",EMAIL_ALREADY_REGISTERED:"Эл. почта уже подтверждена в другом аккаунте",PHONE_ALREADY_REGISTERED:"Телефон уже подтверждён в другом аккаунте",ACCOUNT_DATA_CONFLICT:"Указанные телефон и почта принадлежат разным аккаунтам"},fieldsErrors:{email:{VALUE_ERROR:"Неверный формат эл. почты"},phone:{VALUE_ERROR:"Неверный формат телефона"},password:{VALUE_ERROR:"Пароль должен содержать не менее 8 символов, включая хотя бы одну заглавную, одну строчную букву и одну цифру"}},placeholders:{PHONE:"Телефон",EMAIL:"Эл. почта",PASSWORD:"Пароль"},buttons:{SIGN_UP:"Зарегистрироваться"},links:{ALREADY_HAVE_ACCOUNT:"Уже есть аккаунт? ",SIGN_IN:"Войти"},titles:{SIGN_UP:"Регистрация",FREE_TRIAL:"Попробуйте бесплатно"},enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на
828 номер",SUFFIX:"введите код для подтверждения номера"},errors:{resendSmsFailed:{PREFIX:"Код не отправлен. Повторная отправка возможна через ",SUFFIX:"."},smsNotSent:{PREFIX:"Регистрация временно заблокирована. Попробуйте повторить через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"},INVALID_CODE:"Неверный код. Осталось",attemptsLeft:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",PHONE_ALREADY_CONFIRMED:"Номер телефона уже подтверждён. Попробуйте авторизоваться.",PASS_TOKEN_EXPIRED:"Отправленный код устарел. Попробуйте отправить код повторно.",UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу."}},notifications:{SENDING:"Код отправляется",SENT:"Код отправлен",AUTHORIZATION_ATTEMPT:"Попытка авторизации"},agreements:{publicOffer:{PREFIX:"Соглашаюсь с условиями",PUBLIC_OFFER:"публичной оферты"},dataProcessing:{PREFIX:"Даю согласие",DATA_PROCESSING:"на обработку персональных данных"},marketingCommunications:{PREFIX:"Даю согласие",MARKETING_COMMUNICATIONS_CONSENT:"на получение экспертных материалов и персональных предложений",SUFFIX_EMAIL_AND_PHONE:"по эл. почте и телефону"},ERROR_REQUIRED_TO_SIGN_UP:"Примите условия, чтобы зарегистрироваться"}},confirmEmail:{errors:{CONFIRM_EMAIL_FAIL:"Ссылка устарела или уже использована"},enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на номер",SUFFIX:"введите код для подтверждения эл. почты"},errors:{resendSmsFailed:{PREFIX:"Код не отправлен. Повторная отправка возможна через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"},INVALID_CODE:"Неверный код. Осталось",attemptsLeft:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",PASS_TOKEN_EXPIRED:"Отправленный код устарел. Попробуйте отправить код повторно.",UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу."}},notifications:{CONFIRM_EMAIL_SUCCESS:"Эл. почта подтверждена",SENDING:"Код отправляется",SENT:"Код отправлен"}},passwordReset:{errors:{ACCOUNT_NOT_FOUND:"Пользователь не найден",PHONE_NOT_CONFIRMED:"Номер телефона не подтверждён. Подтвердите номер в настройках профиля.",VALIDATION_ERROR:"Неверный формат эл. почты",UNKNOW_ERROR:"Произошла ошибка при попытке сброса пароля"},fieldsErrors:{email:{VALUE_ERROR:"Неверный формат эл. почты"}},notifications:{SENDING:"Отправляем",SENT:"Отправлено"},titles:{VERIFY_EMAIL:"Проверьте email",ENTER_EMAIL:"Введите эл. почту, указанную при регистрации, для получения ссылки на восстановление пароля",PASSWORD_CHANGING:"Изменение пароля",PASSWORD_RESTORE:"Восстановление пароля"},placeholders:{EMAIL:"Эл. почта"},buttons:{RESTORE_PASSWORD:"Получить ссылку"},links:{REMEMBER_PASSWORD:"Вспомнили пароль? ",SIGN_IN:"Войти",EMAIL_SENT_PREFIX:"Отправили ссылку для восстановления пароля на адрес",EMAIL_SENT_SUFFIX:", перейдите по ссылке из письма, чтобы восстановить пароль",RESEND_EMAIL_PREFIX:"Не получили письмо? ",RESEND_EMAIL:"Отправить повторно {time}"}},setupNewPhone:{errors:{TOKEN_REDEEM_FAIL:"Ссылка устарела или уже использована",PHONE_INVALID:"Укажите номер в формате +7 XXX XXX XX XX"}},setupNewPassword:{enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на
828 номер",SUFFIX:"введите код для продолжения сброса пароля"},notifications:{SENDING:"Код отправляется",SENT:"Код отправлен"},errors:{INVALID_CODE:"Неверный код. Осталось",ATTEMPTS_LEFT:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",PASS_TOKEN_INVALID:"Отправленный код устарел или недействителен. Попробуйте перейти по ссылке из письма заново.",UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу.",resendSmsFailed:{PREFIX:"Код не отправлен. Повторная отправка возможна через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"}}},errors:{TOKEN_REDEEM_FAIL:"Ссылка устарела или уже использована",VALIDATION_ERROR:"Не удалось сохранить пароль",UNKNOW_ERROR:"Произошла ошибка при попытке установки нового пароля"},fieldsErrors:{password:{VALUE_ERROR:"Пароль должен содержать не менее 8 символов, включая хотя бы одну заглавную, одну строчную букву и одну цифру"}},titles:{CREATE_NEW_PASSWORD:"Придумайте новый пароль"},placeholders:{PASSWORD:"Пароль"},buttons:{SAVE_PASSWORD:"Сохранить пароль"},notifications:{SAVED:"Пароль сохранен"}},changePhone:{checkEmail:{description:{PART1:"Отправили ссылку для смены номера телефона на адрес",PART2:"перейдите по ссылке из письма и введите новый номер"},links:{RESEND_PREFIX:"Не получили письмо? ",RESEND:"Отправить повторно {time}"},notifications:{SENDING:"Отправляем",SENT:"Отправлено"},errors:{UNKNOWN:"Произошла ошибка при отправке письма"}},newPhoneNumber:{TITLE:"Новый номер телефона",DESCRIPTION:"Отправим код подтверждения на этот номер",placeholders:{PHONE:"Номер телефона"},buttons:{CONFIRM:"Подтвердить номер"},errors:{SAME_PHONE_ERROR:"Новый номер совпадает с текущим",PHONE_ALREADY_TAKEN:"Номер занят другим аккаунтом"}},enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на номер",SUFFIX:"введите код для подтверждения номера"},notifications:{PHONE_CHANGED:"Номер телефона успешно изменён"},errors:{INVALID_CODE:"Неверный код. Осталось",ATTEMPTS_LEFT:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",resendSmsFailed:{PREFIX:"Повторная отправка будет доступна через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"},UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу.",RESEND_SMS_FAILED:"Не удалось отправить SMS"}},confirmPassword:{TITLE:"Подтвердите, что это вы",DESCRIPTION:"Дл
828я безопасности введите пароль. Отправим ссылку для смены номера телефона на вашу электронную почту.",placeholders:{PASSWORD:"Пароль"},buttons:{CANCEL:"Отмена",CONTINUE:"Продолжить"},errors:{INVALID_PASSWORD:"Неверный пароль. Попробуйте ещё раз."}}},changeEmail:{enterNewEmail:{TITLE:"Введите новую электронную почту",DESCRIPTION:{PART1:"Мы отправим код подтверждения",PART2:"на ваш текущий номер телефона"},placeholders:{EMAIL:"Эл. почта"},buttons:{CANCEL:"Отмена",CONTINUE:"Продолжить"},errors:{EMAIL_EMPTY_ERROR:"Введите адрес электронной почты",PHONE_NOT_CONFIRMED:"Номер телефона не подтверждён. Подтвердите номер в настройках профиля.",SAME_EMAIL_ERROR:"Новый адрес совпадает с текущим",EMAIL_ALREADY_TAKEN:"Эл. почта уже используется другим аккаунтом",VALIDATION_ERROR:"Неверный формат эл. почты"}},enterSmsCode:{TITLE:"Введите код из SMS",description:{PREFIX:"Отправили код на номер",SUFFIX:"введите код для подтверждения смены адреса электронной почты"},notifications:{EMAIL_CHANGE_SENT:"Проверьте новую электронную почту",SENDING:"Код отправляется",SENT:"Код отправлен"},errors:{INVALID_CODE:"Неверный код. Осталось",ATTEMPTS_LEFT:{ZERO:"попыток",ONE:"попытка",MANY:"попытки"},ATTEMPTS_EXCEEDED:"Превышен лимит попыток. Попробуйте отправить код повторно.",PASS_TOKEN_INVALID:"Отправленный код устарел или недействителен. Попробуйте отправить код повторно.",UNKNOW_ERROR:"Произошла ошибка. Попробуйте перезагрузить страницу.",resendSmsFailed:{PREFIX:"Код не отправлен. Повторная отправка возможна через ",SUFFIX:"."},minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"}}},checkEmail:{TITLE:"Проверьте электронную почту",description:{PART1:"Отправили ссылку для смены адреса электронной почты на ",PART2:"перейдите по ссылке из письма и введите новый"},links:{RESEND_PREFIX:"Не получили письмо? ",RESEND:"Отправить повторно {time}"}}}},Zq={titles:{TITLE:"Профиль",DESCRIPTION:"Описание",PERSONAL_DATA:"Личная информация",CRIMINAL_INFORMATION:"Сведения о судимостях"},tooltips:{TITLE:"Заполните профиль подробно. Это поможет сделать поиск по фабуле точнее. Суды принимают во внимание сведения о личности доверителя (пол, наличие судимости) при принятии решений."},fields:{FULL_NAME:"ФИО",LAST_NAME:"Фамилия",FIRST_NAME:"Имя",MIDDLE_NAME:"Отчество",GENDER:"Пол обвиняемого",CITIZENSHIP:"Гражданство",DATE_OF_BIRTH:"Дата рождения",AGE_STATUS:"Возрастная категория на момент преступления",AGE_STATUS_GROUP:"Возрастная группа",MARITAL_STATUS:"Семейное положение",CHILDREN:"Наличие несовершеннолетних детей",EDUCATION:"Место учебы",IS_MILITARY:"Является ли военнообязанным",IS_ACTIVE_MILITARY:"Является ли военнослужащим",OCCUPATION:"Род занятий",MENTAL_HEALTH:"Психическое состояние",PHYSICAL_HEALTH:"Физическое состояние",CRIMINAL_STATUS:"Криминальный статус",characteristics:{TITLE:"Характеристики",CHARACTERISTICS_DESCRIPTION:"Тип характеристики",CHARACTERISTICS_SOURCE:"Источник характеристики"},specialSubject:{TITLE:"Специальный субъект",IS_SPECIAL_SUBJECT:"Является ли спецсубъектом",SPECIAL_SUBJECT_TYPE:"Тип спецсубъекта",DESCRIPTION:"Описание спецсубъекта"},pleaStatus:{TITLE:"Признание",PLEA_STATUS:"Статус признания",PLEA_DETAILS:"Подробности признания"},contacts:{TITLE:"Контакты",CONTACT:"Контакт",PHONE:"Телефон",EMAIL:"Эл. почта",ADDRESS:"Адрес",COMMENT:"Комментарий",ADD:"Добавить контакт",DELETE_ALL:"Удалить все контакты",DELETE:"Удалить",DUPLICATE:"Дублировать"},criminalInformation:{TITLE:"Сведения о судимостях",CRIMINAL_RECORD:"Судимость",ADD:"Добавить судимость",DELETE_ALL:"Удалить все судимости",DELET
828E:"Удалить",DUPLICATE:"Дублировать",criminalRecord:{ARTICLE:"Статья УК РФ",DESCRIPTION:"Описание правонарушения",IS_CLEARED:"Снята ли судимость",IS_RECIDIVISM:"Рецидив"}},placeholders:{LAST_NAME:"Введите фамилию",FIRST_NAME:"Введите имя",MIDDLE_NAME:"Введите отчество",GENDER:"Выберите пол",CITIZENSHIP:"Введите гражданство",DATE_OF_BIRTH:"Введите дату рождения",AGE_STATUS:"Введите возрастную категорию",AGE_STATUS_GROUP:"Введите возрастную группу",MARITAL_STATUS:"Введите семейное положение",CHILDREN:"Укажите наличие несовершеннолетних детей",EDUCATION:"Введите место учебы",IS_MILITARY:"Укажите является ли военнообязанным",IS_ACTIVE_MILITARY:"Укажите является ли военнослужащим",OCCUPATION:"Введите род занятий",MENTAL_HEALTH:"Введите психическое состояние",PHYSICAL_HEALTH:"Введите физическое состояние",CRIMINAL_STATUS:"Введите криминальный статус",characteristics:{CHARACTERISTICS_DESCRIPTION:"Введите тип характеристики",CHARACTERISTICS_SOURCE:"Введите источник характеристики"},specialSubject:{IS_SPECIAL_SUBJECT:"Укажите является ли спецсубъектом",SPECIAL_SUBJECT_TYPE:"Введите тип спецсубъекта",DESCRIPTION:"Введите описание спецсубъекта"},pleaStatus:{PLEA_STATUS:"Введите статус признания",PLEA_DETAILS:"Введите подробности признания"},criminalInformation:{criminalRecord:{ARTICLE:"Выберите одну или несколько статей УК РФ",DESCRIPTION:"Введите описание правонарушения",IS_CLEARED:"Укажите снята ли судимость",IS_RECIDIVISM:"Укажите является ли рецидивом"}},contacts:{PHONE:"Введите телефон",EMAIL:"Введите эл. почту",ADDRESS:"Введите адрес",COMMENT:"Введите комментарий"}}},documents:{PAGE_TITLE:"Документы",NEW_DOCUMENT:"Новый документ",LIST_LOAD_FAILED:"Не удалось загрузить документы",CHOOSE_TEMPLATE:"Выбрать шаблон",EMPTY_TITLE:"Начните работу с документами",EMPTY_DESCRIPTION:"Создайте новый документ или воспользуйтесь шаблоном, чтобы сэкономить время",DATE_TODAY:"Сегодня",DATE_YESTERDAY:"Вчера",documentMenu:{DOWNLOAD:"Скачать",PRINT:"Распечатать",SHARE:"Поделиться",OPEN:"Открыть",RENAME:"Переименовать",OPEN_IN_NEW_TAB:"Открыть в новой вкладке",MAKE_TEMPLATE:"Сделать шаблон",DELETE:"Удалить"},confirmDelete:{TITLE:"Удалить документ",DESCRIPTION:"Документ «{name}» будет удалён без возможности восстановления",CANCEL:"Отмена",CONFIRM:"Удалить"},autosave:{SAVING:"Сохранение…",ERROR:"Не удалось сохранить документ",VERSION_CONFLICT:"Документ изменён в другом окне. Данные обновлены с сервера."}},defenseLines:{empty:{TITLE:"Линии защиты не заполнены",DESCRIPTION:"Добавьте линии защиты — это поможет подбирать практику и выстраивать стратегию"},titles:{LEFT_SECTION:"Линии защиты",RIGHT_SECTION_TITLE:"Линия",LIST_ITEM:"Линия {order}"},fields:{DEFENSE_LINE:"Линия защиты",THESIS:"Тезис",EPISODE:"Эпизод",EVIDENCE:"Доказательства",NORMATIVE:"Нормативка",COMMENT:"Комментарий"},placeholders:{THESIS:"Опишите тезис",COMMENT:"Добавьте примечание",DEFENSE_LINE:"Выберите линию защиты",DEFENSE_LINE_SEARCHING:"Ищем практику",EPISODE:"Выберите эпизод",NORMATIVE:"Зависит от линии защиты и определяется автоматически"},kebab:{ADD:"Добавить линию защиты",DELETE_ONE:"Удалить линию защиты",DELETE_ALL:"Удалить все линии защиты"},buttons:{ADD:"Добавить",ADD_EVIDENCE:"Добавить докаÐ
828·Ð°Ñ‚ельство",SAVE:"Сохранить"},echo:{EVIDENCE_UPDATED:"Обновил привязанные доказательства."},practice:{LINK:"Практика по линии защиты",TITLE:"Практика по линии защиты",EMPTY_TITLE:"Практика не найдена",EMPTY_DESCRIPTION:"Мы не нашли судебной практики с похожими параметрами",BACK:"Назад",ANALYZING_TITLE:"Анализируем ваше дело",ANALYZING_DESCRIPTION:"Подбираем подходящую практику, это может занять несколько минут",NO_LEAF_WARNING:"Линия защиты не выбрана, поэтому показана вся практика",NONE:"Нет практики",SIMILAR_CASES_ZERO:"похожих дел",SIMILAR_CASES_ONE:"похожее дело",SIMILAR_CASES_MANY:"похожих дела"}},circumstances:{empty:{TITLE:"Обстоятельства не заполнены",DESCRIPTION:"Добавьте обстоятельства дела — это поможет находить похожие кейсы и усиливать стратегию защиты"},titles:{LEFT_SECTION:"Обстоятельства",DETAIL:"Обстоятельства",RIGHT_SECTION_TITLE:"Обстоятельство",LIST_ITEM:"Обстоятельство {order}"},fields:{DESCRIPTION:"Описание",ARTICLE:"Статья",TYPE:"Тип",CATEGORY:"Категория",REVIEW_RESULT:"Результат рассмотрения",DOCUMENTS:"Документы"},placeholders:{DESCRIPTION:"Опишите обстоятельство",ARTICLE:"Выберите статью",TYPE:"Выберите тип",CATEGORY:"Выберите категорию",REVIEW_RESULT:"Выберите результат рассмотрения"},circumstanceTypes:{MITIGATING:"Смягчающее",AGGRAVATING:"Отягчающее"},reviewResults:{ACCEPTED_ACCOUNTED:"Обстоятельство учтено судом, принято",NOT_ACCOUNTED:"Обстоятельство не учтено судом",EXCLUDED_ACCOUNTED:"Обстоятельство учтено судом, исключено"},kebab:{ADD:"Добавить обстоятельство",DELETE_ALL:"Удалить все обстоятельства",DELETE_ONE:"Удалить обстоятельство"},buttons:{ADD:"Добавить обстоятельство",UPLOAD_FILE:"Загрузить файл",REMOVE_DOCUMENT:"Удалить документ"}},evidence:{empty:{TITLE:"Доказательства не заполнены",DESCRIPTION:"Система подбирает похожие кейсы по доказательствам — добавьте их для точного результата"},titles:{LEFT_SECTION:"Доказательства",DETAIL:"Доказательства",RIGHT_SECTION_TITLE:"Доказательство",LIST_ITEM:"Доказательство {order}"},fields:{DESCRIPTION:"Описание",ARTICLE:"Статья",TYPE:"Тип",USED_BY:"Кто использовал",REVIEW_RESULT:"Результат рассмотрения",DOCUMENTS:"Документы",COMMENT:"Комментарий"},placeholders:{DESCRIPTION:"Опишите доказательство",ARTICLE:"Выберите статью",TYPE:"Выберите тип",USED_BY:"Выберите сторону",REVIEW_RESULT:"Выберите результат рассмотрения",COMMENT:"Введите комментарий"},kebab:{ADD:"Добавить доказательство",DELETE_ALL:"Удалить все доказательства",DELETE_ONE:"Удалить доказательство"},buttons:{ADD:"Добавить доказательство",UPLOAD_FILE:"Загрузить файл",REMOVE_DOCUMENT:"Удалить документ"}},quotes:{LEFT_TITLE:"Цитаты",DELETE_QUOTE:"Удалить цитату",DELETE_ALL_QUOTES_FOR_CASE:"Удалить цитаты",DELETE_ALL_QUOTES_ALL_CASES:"Удалить все цитаты",DELETE_COUNTDOWN:"Удаление через {count} сек",CANCEL_DELETE:"Отменить",EMPTY_CASES:"Нет сохранённых цитат",EMPTY_CASES_DESCRIPTION:"Сохраняйте ключевые моменты из практики — они отобразятся в этом разделе",NO_QUOTES_FOR_CASE:"Нет цитат по этому делу",CRIMINAL_CASE_TITLE:"Уголовное дело",QUOTES_COUNT:{ZERO:"{count} цитат",ONE:"{count} цитата",MANY:"{count} цитаты"},SEARCH_PLACEHOLDER:"Найти",EXPORT_QUOTES_TOOLTIP:"Скачать цитаты",EXPORT_FAILED:"Не удалось сформировать файл. Попробуйте повторить позже."},navigation:{CLIENT:"Доверитель",OVERVIEW:"Дело",FABULA:"Фабула",STAGE:"Стадия",PARTICIPANTS:"Участники",WITNESSES:"Свидетели",VICTIMS:"Потерпевшие",CI
828RCUMSTANCES:"Обстоятельства",EVIDENCE:"Доказательства",DEFENSE_LINES:"Линии защиты",CASES:"Практика",ALL_CASES:"Всё",SAVED_CASES:"Сохраненные",DEFENSE_STRATEGY:"Стратегия защиты",QUOTES:"Цитаты",DOCUMENTS:"Документы"}},eW={titles:{NEW_CLIENT:"Новый доверитель"},fields:{LAST_NAME_REQUIRED:"Фамилия/псевдоним *",FIRST_NAME:"Имя",MIDDLE_NAME:"Отчество",PROMPT:"Опишите фабулу дела в свободной форме"},fieldsErrors:{lastName:{REQUIRED:"Поле не может быть пустым"}},buttons:{ANALYZE:"Анализировать",CANCEL:"Отменить",HELP_BUTTON:"Помощь по разделу"},errors:{VALIDATION_ERROR:"Некоторые поля заполнены неверно",UNKNOWN_ERROR:"Произошла ошибка при создании доверителя"}},tW={titles:{TITLE:"Фабула",EPISODE:"Эпизод"},buttons:{ADD_EPISODE_WITH_AI:"Добавить эпизод с помощью ИИ",ADD:"Добавить эпизод",DELETE:"Удалить эпизод",FABULIZER_HISTORY:"История фабулайзера"},emptyPage:{messages:{WELCOME:"Фабула не заполнена",DESCRIPTION_PART1:"Проанализируйте описание с помощью фабулайзера",DESCRIPTION_PART2:"или добавьте и опишите эпизоды вручную "},buttons:{ADD_EPISODE:"Добавить эпизод",TO_FABULIZER:"Фабулайзер"},inProcessRotations:[{ICON:"🔍",WELCOME:"Анализируем объективную и субъективную сторону преступления",DESCRIPTION_PART1:"Анализ судебной практики по вашему делу займёт 3–5 минут.",DESCRIPTION_PART2:"Мы ищем решения по делам с похожей логикой и аргументацией."},{ICON:"📚",WELCOME:"Подбираем судебные решения с похожей логикой",DESCRIPTION_PART1:"Анализ судебной практики по вашему делу займёт 3–5 минут.",DESCRIPTION_PART2:"Мы ищем решения по делам с похожей логикой и аргументацией."},{ICON:"🤝",WELCOME:"Ищем практику с успешными запросами защиты и положительным результатом",DESCRIPTION_PART1:"Анализ судебной практики по вашему делу займёт 3–5 минут.",DESCRIPTION_PART2:"Мы ищем решения по делам с похожей логикой и аргументацией."},{ICON:"💬",WELCOME:"Формируем структуру аргументов защиты",DESCRIPTION_PART1:"Анализ судебной практики по вашему делу займёт 3–5 минут.",DESCRIPTION_PART2:"Мы ищем решения по делам с похожей логикой и аргументацией."}]},fields:{DESCRIPTION:"Описание события",LOCATION:"Место",DATE:"Дата",METHOD:"Способ",SUBJECTIVE_SIDE:"Субъективная сторона",CLIENT_ROLE:"Роль доверителя в преступлении",PLEA_STATUS:"Статус признания",COMMENT:"Комментарий",PRELIMINARY_QUALIFICATION:"Предварительная квалификация",placeholders:{DESCRIPTION:"Введите описание",LOCATION:"Введите место",DATE:"Введите дату",METHOD:"Введите способ",SUBJECTIVE_SIDE:"Введите субъективную сторону",CLIENT_ROLE:"Выберите роль доверителя",PLEA_STATUS:"Выберите статус признания",COMMENT:"Добавьте примечание",PRELIMINARY_QUALIFICATION:"Выберите предварительную квалификацию",PRELIMINARY_QUALIFICATION_HINT:"Влияет на точность подбора похожей практики",PRELIMINARY_QUALIFICATION_EMPTY:"Статья не выбрана",EMPTY_ARTICLE:"Статья не выбрана"},validationErrors:{PRELIMINARY_QUALIFICATION_REQUIRED:"Выберите предварительную квалификацию"}}
828,infoCards:{TITLE:"Эпизод"},fabulizerHistory:{EMPTY_TITLE:"Фабулайзер не использовался",EMPTY_DESCRIPTION:"Изменения появятся здесь после работы с фабулайзером",TODAY:"Сегодня",ENTERED_FABULA:"Введена фабула",ADDED:"Добавлено",NO_EPISODES_ADDED:"Эпизодов не было добавлено",ANALYSIS_ERROR:"Ошибка анализа",ANALYSIS_ERROR_BUTTON:"Повторить",CANCELLED_LABEL:"Отменено",EPISODE_DELETED:"Эпизод удалён",EPISODE_DELETED_DESCRIPTION:"Удалено",EVENT_MANUAL_EDITED:"Изменено",LOAD_ERROR:"Не удалось загрузить историю"}},nW={titles:{TITLE:"Участники",WITNESSES:"Свидетели",VICTIMS:"Потерпевшие"},placeholders:{NAME_NOT_SPECIFIED:"Имя не указано"},buttons:{ADD_WITNESS:"Добавить свидетеля",ADD_VICTIM:"Добавить потерпевшего",ADD_CONTACT:"Добавить контакт",DELETE_WITNESS:"Удалить свидетеля",DELETE_VICTIM:"Удалить потерпевшего",DELETE_CONTACT:"Удалить контакт",DUPLICATE_CONTACT:"Дублировать контакт",DELETE_ALL_CONTACTS:"Удалить все контакты"},witnesses:{placeholders:{NEW_WITNESS:"Новый свидетель"},fields:{LAST_NAME:"Фамилия",FIRST_NAME:"Имя",MIDDLE_NAME:"Отчество",DATE_OF_BIRTH:"Дата рождения",GENDER:"Пол",AGE_STATUS:"Возрастной статус",RELATION_TO_CLIENT:"Отношение к обвиняемому",TESTIMONY_STAGE:"На какой стадии давал показания",contacts:{TITLE:"Контакты",CONTACT:"Контакт",PHONE:"Телефон",EMAIL:"Эл. почта",ADDRESS:"Адрес",COMMENT:"Комментарий"},placeholders:{LAST_NAME:"Введите фамилию",FIRST_NAME:"Введите имя",MIDDLE_NAME:"Введите отчество",DATE_OF_BIRTH:"Введите дату рождения",GENDER:"Выберите пол",AGE_STATUS:"Выберите возрастной статус",RELATION_TO_CLIENT:"Введите отношение к обвиняемому",TESTIMONY_STAGE:"Укажите, на какой стадии давал показания",contacts:{PHONE:"Введите телефон",EMAIL:"Введите эл. почту",ADDRESS:"Введите адрес",COMMENT:"Введите комментарий"}}}},victims:{placeholders:{NEW_VICTIM:"Новый потерпевший"},fields:{LAST_NAME:"Фамилия",FIRST_NAME:"Имя",MIDDLE_NAME:"Отчество",DATE_OF_BIRTH:"Дата рождения",GENDER:"Пол",AGE_STATUS:"Возрастной статус",RELATION_TO_CLIENT:"Отношение к обвиняемому",contacts:{TITLE:"Контакты",CONTACT:"Контакт",PHONE:"Телефон",EMAIL:"Эл. почта",ADDRESS:"Адрес",COMMENT:"Комментарий"},placeholders:{LAST_NAME:"Введите фамилию",FIRST_NAME:"Введите имя",MIDDLE_NAME:"Введите отчество",DATE_OF_BIRTH:"Введите дату рождения",GENDER:"Выберите пол",AGE_STATUS:"Выберите возрастной статус",RELATION_TO_CLIENT:"Введите отношение к обвиняемому",contacts:{PHONE:"Введите телефон",EMAIL:"Введите эл. почту",ADDRESS:"Введите адрес",COMMENT:"Введите комментарий"}}}}},sW={titles:{TITLE:"Стадия"},buttons:{MANAGE_STAGES:"Управлять стадиями"},emptyPage:{TITLE:"Нет активных стадий",DESCRIPTION:"Начните с доследственной проверки или выберите другую стадию в разделе управления",BUTTON:"Начать"},stages:{PRE_INVESTIGATION_CHECK:"Доследственная проверка",INQUIRY:"Дознание",PRELIMINARY_INVESTIGATION:"Предварительное следствие",COURT_FIRST_INSTANCE:"Суд первой инстанции",COURT_SECOND_INSTANCE:"Суд апелляционной инстанции",COURT_THIRD_INSTANCE:"Суд кассационной инстанции",COURT_FINAL_INSTANCE:"Верховный суд"},phasesManagement:{titles:{TITLE:"Управление стадиями"},messages:{SAVE_FAILED:"Произошла ошибка при сохранении. Попробуйте повторить попытку позднее."},statuses:{FINISHED:"Завершена",NOT_STARTED:"Не начата",SKIPPED:"Пропущена"},buttons:{CANCEL:"Отмена",SAVE:"Сохранить",COMPLETE:"Завершить",SKIP:"Пропустить",NEXT_STAGE:"Следующая стадия",RESUME:"Возобновить"},labels:{CURRENT_TIME:"Настоящее время",START:"Не задано"},confirmCancel:{TITLE:"Отменить изменения?",DESCRIPTION:"Внесённые изменения будут потеряны",YES:"Да",NO:"Нет"}},preInvestigationCheck:{titles:{APPLICANT:"Заявитель",INVESTIGATOR_DATA:"Данные следователя"},fields:{CRIME_REPORT_REGISTRY_NUMBER:"Номер КРСоП",ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата оÐ
828ºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Дата возбуждения уголовного дела",APPLICANT_LAST_NAME:"Фамилия",APPLICANT_FIRST_NAME:"Имя",APPLICANT_MIDDLE_NAME:"Отчество",APPLICANT_PHONE:"Телефон",APPLICANT_EMAIL:"Эл. почта",APPLICANT_ADDRESS:"Адрес",APPLICANT_GENDER:"Пол",APPLICANT_DATE_OF_BIRTH:"Дата рождения",APPLICANT_AGE_STATUS:"Возрастная категория на момент преступления",APPLICANT_RELATION_TO_CLIENT:"Отношение к обвиняемому",INVESTIGATOR_LAST_NAME:"Фамилия",INVESTIGATOR_FIRST_NAME:"Имя",INVESTIGATOR_MIDDLE_NAME:"Отчество",INVESTIGATOR_POSITION:"Должность",INVESTIGATOR_RANK:"Звание",INVESTIGATOR_DEPARTMENT:"Наименование следственного отдела",RESULT:"Результат",placeholder:{CRIME_REPORT_REGISTRY_NUMBER:"Введите номер КРСоП",ARTICLES:"Список статей из фабулы",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Выберите дату возбуждения уголовного дела",APPLICANT_LAST_NAME:"Введите фамилию",APPLICANT_FIRST_NAME:"Введите имя",APPLICANT_MIDDLE_NAME:"Введите отчество",APPLICANT_PHONE:"Введите номер телефона",APPLICANT_EMAIL:"Введите эл. почту",APPLICANT_ADDRESS:"Введите адрес",APPLICANT_GENDER:"Выберите пол",APPLICANT_DATE_OF_BIRTH:"Выберите дату рождения",APPLICANT_AGE_STATUS:"Выберите возрастную категорию",APPLICANT_RELATION_TO_CLIENT:"Введите отношение к обвиняемому",INVESTIGATOR_LAST_NAME:"Введите фамилию",INVESTIGATOR_FIRST_NAME:"Введите имя",INVESTIGATOR_MIDDLE_NAME:"Введите отчество",INVESTIGATOR_POSITION:"Введите должность",INVESTIGATOR_RANK:"Введите звание",INVESTIGATOR_DEPARTMENT:"Введите наименование следственного отдела",RESULT:"Выберите результат"}}},inquiry:{titles:{INVESTIGATOR_DATA:"Данные дознавателя"},fields:{CASE_NUMBER:"Номер дела",ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Дата возбуждения уголовного дела",INVESTIGATOR_LAST_NAME:"Фамилия",INVESTIGATOR_FIRST_NAME:"Имя",INVESTIGATOR_MIDDLE_NAME:"Отчество",INVESTIGATOR_POSITION:"Должность",INVESTIGATOR_RANK:"Звание",INVESTIGATOR_DEPARTMENT:"Наименование следственного отдела",RESULT:"Результат",placeholder:{CASE_NUMBER:"Введите номер дела",ARTICLES:"Список статей",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Выберите дату возбуждения уголовного дела",INVESTIGATOR_LAST_NAME:"Введите фамилию",INVESTIGATOR_FIRST_NAME:"Введите имя",INVESTIGATOR_MIDDLE_NAME:"Введите отчество",INVESTIGATOR_POSITION:"Введите должность",INVESTIGATOR_RANK:"Введите звание",INVESTIGATOR_DEPARTMENT:"Введите наименование следственного отдела",RESULT:"Выберите результат"}}},preliminaryInvestigation:{titles:{PRELIMINARY_INVESTIGATION:"Предварительное следствие",INVESTIGATOR_DATA:"Данные следователя"},fields:{CASE_NUMBER:"Номер дела",ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Дата возбуждения уголовного дела (ВУД)",INVESTIGATOR_LAST_NAME:"Фамилия",INVESTIGATOR_FIRST_NAME:"Имя",INVESTIGATOR_MIDDLE_NAME:"Отчество",INVESTIGATOR_POSITION:"Должность",INVESTIGATOR_RANK:"Звание",INVESTIGATOR_DEPARTMENT:"Наименование следственного отдела",RESULT:"Результат",placeholder:{CASE_NUMBER:"Введите номер дела",ARTICLES:"Список статей из фабул
828ы",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CRIMINAL_CASE_OPENING_DATE:"Выберите дату возбуждения уголовного дела",INVESTIGATOR_LAST_NAME:"Введите фамилию",INVESTIGATOR_FIRST_NAME:"Введите имя",INVESTIGATOR_MIDDLE_NAME:"Введите отчество",INVESTIGATOR_POSITION:"Введите должность",INVESTIGATOR_RANK:"Введите звание",INVESTIGATOR_DEPARTMENT:"Введите наименование следственного отдела",RESULT:"Выберите результат"}}},courtFirstInstance:{titles:{COURT_FIRST_INSTANCE:"Суд первой инстанции",PUNISHMENT:"Наказание"},fields:{CASE_NUMBER:"Номер дела",ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",COURT_NAME:"Название суда",JUDGE_FIRST_NAME:"Имя судьи",JUDGE_MIDDLE_NAME:"Отчество судьи",JUDGE_LAST_NAME:"Фамилия судьи",PROSECUTOR_FIRST_NAME:"Имя прокурора",PROSECUTOR_MIDDLE_NAME:"Отчество прокурора",PROSECUTOR_LAST_NAME:"Фамилия прокурора",CONCLUSION_DESCRIPTION:"Назначенное наказание",PUNISHMENT_TYPE:"Вид наказания",PUNISHMENT_DURATION:"Срок наказания, проведенный под ограничениями",MEASURE_START_DATE:"Дата начала меры",MEASURE_END_DATE:"Дата окончания меры",REMAINING_SENTENCE:"Оставшийся срок наказания",PENITENTIARY_TYPE:"Тип исправительного учреждения",placeholder:{CASE_NUMBER:"Введите номер дела",ARTICLES:"Список статей из фабулы",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",COURT_NAME:"Введите название суда",JUDGE_FIRST_NAME:"Введите имя судьи",JUDGE_MIDDLE_NAME:"Введите отчество судьи",JUDGE_LAST_NAME:"Введите фамилию судьи",PROSECUTOR_FIRST_NAME:"Введите имя прокурора",PROSECUTOR_MIDDLE_NAME:"Введите отчество прокурора",PROSECUTOR_LAST_NAME:"Введите фамилию прокурора",CONCLUSION_DESCRIPTION:"Введите назначенное наказание",PUNISHMENT_TYPE:"Выберите вид наказания",PUNISHMENT_DURATION:"Введите срок наказания, проведенный под ограничениями, дней",MEASURE_START_DATE:"Выберите дату начала меры",MEASURE_END_DATE:"Выберите дату окончания меры",REMAINING_SENTENCE:"Будет рассчитан автоматически",PENITENTIARY_TYPE:"Выберите тип исправительного учреждения"}},preTrialMeasure:{titles:{PRE_TRIAL_MEASURES:"Досудебные меры пресечения",PRE_TRIAL_MEASURE:"Досудебная мера пресечения"},buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить досудебную меру пресечения",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{PRE_TRIAL_MEASURE_TYPE:"Тип меры пресечения",START_DATE:"Дата начала меры",END_DATE:"Дата окончания меры",CONDITIONS:"Условия меры",placeholder:{PRE_TRIAL_MEASURE_TYPE:"Выберите тип меры пресечения",START_DATE:"Выберите дату начала меры",END_DATE:"Выберите дату окончания меры",CONDITIONS:"Введите условия меры"}}},felony:{titles:{FELONIES:"Решения суда",FELONY:"Решение суда"},buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить решение суда",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{ARTICLE:"Статья",DESCRIPTION:"Описание",IS_GUILTY:"Признан ли обвиняемый виновным по данной статье",placeholder:{ARTICLE:"Выберите статью",DESCRIPTION:"Описание выбранной статьи",IS_GUILTY:"Выберите признан ли обвиняемый виновным по данной статье"}}},session:{titles:{SESSIONS:"Заседания",SESSION:"Заседание"}
828,buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить заседание",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{SESSION_DATE:"Дата заседания",SESSION_STATUS:"Статус",DELAY_REASON:"Причина переноса заседания",placeholder:{SESSION_DATE:"Выберите дату заседания",SESSION_STATUS:"Выберите статус",DELAY_REASON:"Введите причину переноса заседания"}}}},courtSecondInstance:{titles:{COURT_SECOND_INSTANCE:"Суд апелляционной инстанции",APPEAL_REQUEST:"Апелляционный запрос заявителя",OPPOSITE_REQUEST:"Противоположные запросы",CONCLUSIONS:"Выводы"},fields:{ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",APPEAL_COURT_NAME:"Название суда, в котором проходила апелляция",JUDGE_LAST_NAME:"Фамилия судьи",JUDGE_FIRST_NAME:"Имя судьи",JUDGE_MIDDLE_NAME:"Отчество судьи",APPLICANT_LAST_NAME:"Фамилия апеллянта",APPLICANT_FIRST_NAME:"Имя апеллянта",APPLICANT_MIDDLE_NAME:"Отчество апеллянта",APPLICANT_CATEGORY:"Категория апеллянта",APPLICATION_DATE:"Дата подачи апелляции",APPEAL_GOAL:"Цель апелляции",APPEAL_PLEA_STATUS:"Статус признания",APPEAL_PLEA_DETAILS:"Подробности признания",APPEAL_APPEAL_DOCUMENTS:"Документы, на которых основывается апелляция",APPEAL_APPEAL_GROUNDS:"Основания для подачи апелляции",REQUEST_GOAL:"Цель запроса",REQUEST_RESULT:"Результат запроса",REQUEST_ARGUMENT_DESCRIPTION:"Описание аргумента",REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Статус подтверждения аргумента",REQUEST_ARGUMENT_LEGAL_BASIS:"Правовое обоснование",REQUEST_ARGUMENT_GOAL:"Цель аргумента заявителя",REQUEST_ARGUMENT_RESULT:"Результат аргумента",OPPOSITE_REQUEST_GOAL:"Цель запроса",OPPOSITE_REQUEST_RESULT:"Результат запроса",OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION:"Описание аргумента",OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Статус подтверждения аргумента",OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS:"Правовое обоснование",OPPOSITE_REQUEST_ARGUMENT_GOAL:"Цель аргумента противоположной стороны",OPPOSITE_REQUEST_ARGUMENT_RESULT:"Результат аргумента",IS_CONVICTED:"Был ли обвиняемый признан виновным по итогам всего рассмотрения",PUNISHMENT_DESCRIPTION:"Назначенное наказание",PUNISHMENT_TYPE:"Вид наказания",PUNISHMENT_APPEAL_DATE:"Дата замены или назначения наказания",IS_FINAL_SENTENCING:"Является ли наказание финальным по всему приговору",PUNISHMENT_DURATION:"Срок наказания, проведенный под ограничениями",MEASURE_START_DATE:"Дата начала меры",MEASURE_END_DATE:"Дата окончания меры",REMAINING_SENTENCE:"Оставшийся срок наказания",PENITENTIARY_TYPE:"Тип исправительного учреждения",placeholder:{ARTICLES:"Список статей из фабулы",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",APPEAL_COURT_NAME:"Введите название суда, в котором проходила апелляция",JUDGE_LAST_NAME:"Введите фамилию судьи",JUDGE_FIRST_NAME:"Введите имя судьи",JUDGE_MIDDLE_NAME:"Введите отчество судьи",APPLICANT_LAST_NAME:"Введите фамилию апеллянта",APPLICANT_FIRST_NAME:"Введите имя апеллянта",APPLICANT_MIDDLE_NAME:"Введите отчество апеллянта",APPLICANT_CATEGORY:"Выберите категорию апеллянта",APPLICATION_DATE:"Выберите дату подачи апелляции",APPEAL_GOAL:"Выберите цель апелляции",APPEAL_PLEA_STATUS:"Выберите статус признания",APPEAL_PLEA_DETAILS:"Введите подробности признания",APPEAL_APPEAL_DOCUMENTS:"Введите док
828ументы, на которых основывается апелляция",APPEAL_APPEAL_GROUNDS:"Введите основания для подачи апелляции",REQUEST_GOAL:"Выберите цель запроса",REQUEST_RESULT:"Выберите результат запроса",REQUEST_ARGUMENT_DESCRIPTION:"Введите описание аргумента",REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Выберите статус подтверждения аргумента",REQUEST_ARGUMENT_LEGAL_BASIS:"Введите правовое обоснование",REQUEST_ARGUMENT_GOAL:"Введите цель аргумента заявителя",REQUEST_ARGUMENT_RESULT:"Введите результат аргумента",OPPOSITE_REQUEST_GOAL:"Выберите цель запроса",OPPOSITE_REQUEST_RESULT:"Выберите результат запроса",OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION:"Введите описание аргумента",OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Выберите статус подтверждения аргумента",OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS:"Введите правовое обоснование",OPPOSITE_REQUEST_ARGUMENT_GOAL:"Введите цель аргумента",OPPOSITE_REQUEST_ARGUMENT_RESULT:"Введите результат аргумента",IS_CONVICTED:"Выберите признан ли обвиняемый виновным по итогам всего рассмотрения",PUNISHMENT_DESCRIPTION:"Введите назначенное наказание",PUNISHMENT_TYPE:"Выберите вид наказания",PUNISHMENT_APPEAL_DATE:"Выберите дату замены или назначения наказания",IS_FINAL_SENTENCING:"Выберите является ли наказание финальным по всему приговору",PUNISHMENT_DURATION:"Введите срок наказания, проведенный под ограничениями, дней",MEASURE_START_DATE:"Выберите дату начала меры",MEASURE_END_DATE:"Выберите дату окончания меры",REMAINING_SENTENCE:"Будет рассчитан автоматически",PENITENTIARY_TYPE:"Выберите тип исправительного учреждения"}},felony:{titles:{FELONIES:"Решения суда",FELONY:"Решение суда"},buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить решение суда",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{ARTICLE:"Статья",DESCRIPTION:"Описание",IS_GUILTY:"Признан ли обвиняемый виновным по данной статье",placeholder:{ARTICLE:"Выберите статью",DESCRIPTION:"Описание выбранной статьи",IS_GUILTY:"Выберите признан ли обвиняемый виновным по данной статье"}}},session:{titles:{SESSIONS:"Заседания",SESSION:"Заседание"},buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить заседание",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{SESSION_DATE:"Дата заседания",SESSION_STATUS:"Статус",DELAY_REASON:"Причина переноса заседания",placeholder:{SESSION_DATE:"Выберите дату заседания",SESSION_STATUS:"Выберите статус",DELAY_REASON:"Введите причину переноса заседания"}}}},courtThirdInstance:{titles:{COURT_THIRD_INSTANCE:"Суд кассационной инстанции",CASSATION_REQUEST:"Кассационный запрос заявителя",OPPOSITE_REQUEST:"Противоположные запросы",RESULTS:"Результаты суда кассационной инстанции"},fields:{ARTICLES:"Статьи",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CASSATION_COURT_NAME:"Название суда кассационной инстанции",JUDGE_LAST_NAME:"Фамилия судьи",JUDGE_FIRST_NAME:"Имя судьи",JUDGE_MIDDLE_NAME:"Отчество судьи",APPLICANT_LAST_NAME:"Фамилия заявителя кассации",APPLICANT_FIRST_NAME:"Имя заявителя кассации",APPLICANT_MIDDLE_NAME:"Отчество заявителя кассации",APPLICANT_CATEGORY:"Категория заявителя кассации",APPLICATION_DATE:"Дата подачи кассационной жалобы",CASSATION_GOAL:"Цель кассации",CASSATION_PLEA_STATUS:"Статус признания",CASSATION_PLEA_DETAILS:"Подробности признания",CASSATION_DOCUMENTS:"Документы, на которых основывается кассация",CASSATION_GROUNDS:"Основания для подачи кассации",REQUEST_GOAL:"Цель запроса",REQUEST_RESULT:"Результат запроса",REQUEST_ARGUMENT_DESCRIPTION:"Описание аргумента",REQUEST_ARGUMENT_CONFIRMATION_
828STATUS:"Статус подтверждения аргумента",REQUEST_ARGUMENT_LEGAL_BASIS:"Правовое обоснование",REQUEST_ARGUMENT_GOAL:"Цель аргумента заявителя",REQUEST_ARGUMENT_RESULT:"Результат аргумента",OPPOSITE_REQUEST_GOAL:"Цель запроса",OPPOSITE_REQUEST_RESULT:"Результат запроса",OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION:"Описание аргумента",OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Статус подтверждения аргумента",OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS:"Правовое обоснование",OPPOSITE_REQUEST_ARGUMENT_GOAL:"Цель аргумента противоположной стороны",OPPOSITE_REQUEST_ARGUMENT_RESULT:"Результат аргумента",CASSATION_SATISFACTION_STATUS:"Удовлетворена ли кассация",CASSATION_RESULT:"Результат рассмотрения",CASSATION_RESULT_MOTIVES:"Мотивы принятого решения",CASSATION_DESCRIPTION:"Описание принятого решения по кассации",placeholder:{ARTICLES:"Список статей из фабулы",START_DATE:"Дата начала",END_DATE:"Дата окончания",DURATION:"Продолжительность",CASSATION_COURT_NAME:"Введите название суда кассационной инстанции",JUDGE_LAST_NAME:"Введите фамилию судьи",JUDGE_FIRST_NAME:"Введите имя судьи",JUDGE_MIDDLE_NAME:"Введите отчество судьи",APPLICANT_LAST_NAME:"Введите фамилию заявителя кассации",APPLICANT_FIRST_NAME:"Введите имя заявителя кассации",APPLICANT_MIDDLE_NAME:"Введите отчество заявителя кассации",APPLICANT_CATEGORY:"Введите категорию заявителя кассации",APPLICATION_DATE:"Введите дату подачи кассационной жалобы",CASSATION_GOAL:"Введите цель кассации",CASSATION_PLEA_STATUS:"Введите статус признания",CASSATION_PLEA_DETAILS:"Введите подробности признания",CASSATION_DOCUMENTS:"Введите документы, на которых основывается кассация",CASSATION_GROUNDS:"Введите основания для подачи кассации",REQUEST_GOAL:"Введите цель запроса",REQUEST_RESULT:"Введите результат запроса",REQUEST_ARGUMENT_DESCRIPTION:"Введите описание аргумента",REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Введите статус подтверждения аргумента",REQUEST_ARGUMENT_LEGAL_BASIS:"Введите правовое обоснование",REQUEST_ARGUMENT_GOAL:"Введите цель аргумента заявителя",REQUEST_ARGUMENT_RESULT:"Введите результат аргумента",OPPOSITE_REQUEST_GOAL:"Введите цель запроса",OPPOSITE_REQUEST_RESULT:"Введите результат запроса",OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION:"Введите описание аргумента",OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS:"Введите статус подтверждения аргумента",OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS:"Введите правовое обоснование",OPPOSITE_REQUEST_ARGUMENT_GOAL:"Введите цель аргумента",OPPOSITE_REQUEST_ARGUMENT_RESULT:"Введите результат аргумента",CASSATION_SATISFACTION_STATUS:"Выберите удовлетворена ли кассация",CASSATION_RESULT:"Введите результат рассмотрения",CASSATION_RESULT_MOTIVES:"Введите мотивы принятого решения",CASSATION_DESCRIPTION:"Введите описание принятого решения по кассации"}},felony:{titles:{FELONIES:"Решения суда",FELONY:"Решение суда"}
828,buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить решение суда",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{ARTICLE:"Статья",DESCRIPTION:"Описание",IS_GUILTY:"Признан ли обвиняемый виновным по данной статье",placeholder:{ARTICLE:"Выберите статью",DESCRIPTION:"Описание выбранной статьи",IS_GUILTY:"Выберите признан ли обвиняемый виновным по данной статье"}}},session:{titles:{SESSIONS:"Заседания",SESSION:"Заседание"},buttons:{DELETE_ALL:"Удалить все",ADD:"Добавить заседание",DELETE:"Удалить",DUPLICATE:"Дублировать"},fields:{SESSION_DATE:"Дата заседания",SESSION_STATUS:"Статус",DELAY_REASON:"Причина переноса заседания",placeholder:{SESSION_DATE:"Выберите дату заседания",SESSION_STATUS:"Выберите статус",DELAY_REASON:"Введите причину переноса заседания"}}}},courtFinalInstance:{titles:{COURT_FINAL_INSTANCE:"Верховный суд"}}},rW={errors:{START_FAILED:"Не удалось запустить фабулайзер",CANCEL_FAILED:"Не удалось закрыть фабулайзер",COMMIT_FAILED:"Не удалось сохранить изменения",TEXT_REQUIRED:"Введите текст для анализа"},buttons:{ANALYZE:"Анализировать",DONE:"Закрыть",CANCEL:"Отменить",HIDE:"Отменить",RETRY:"Повторить",COMMIT:"Сохранить",FILL_WITH_AI:"Заполнить с помощью ИИ",MANAGE_STAGE:"Управлять стадиями"},messages:{ANALYZE_FAILED:"Ошибка анализа",ANALYZE_STARTED:"Анализирую",ANALYZE_COMPLETED:"Проанализировал",AVAILABLE:"доступно",CHANGES_ZERO:"изменений",CHANGES_MANY:"изменения",CHANGES_ONE:"изменение"}},iW={titles:{CASE_CARD_TITLE:"Уголовное дело"},tooltips:{CASE:"Мы подобрали этот судебный акт в связи с высокой степенью соответствия фабуле дела вашего доверителя."},fields:{PLEA_STATUS:"Статус признания",APPEAL_REVIEW_RESULT:"Результат рассмотрения апелляций",FINAL_SENTENCING_RESULT:"Решение суда",VERDICT_STATUS:"Решение суда по преступлению",COURT_NAME:"Название суда",FELONY_PUNISHMENT:"Наказание по преступлению",FINAL_SENTENCING_PUNISHMENT:"Общее наказание"},placeholders:{NOT_SPECIFIED_MASCULINE:"Не указан",NOT_SPECIFIED:"Не указано",NOT_SPECIFIED_LOWERCASE:"не указан",GO_TO_CASE_CARD:"Перейти в карточку дела",SAVE_CASE:"Сохранить дело",UNSAVE_CASE:"Убрать из сохраненных дел",COPY_CUI:"Копировать номер уголовного дела"},links:{CASE:"Дело",SOURCE:"Источник",SOURCE_WARNING_FIRST_LINE:"ИИ определил цитату неточно.",SOURCE_WARNING_SECOND_LINE:"При открытии вы перейдете в начало документа.",ALL_FELONIES:"Все статьи"},messages:{SOURCE_FILE_NOT_AVAILABLE:"Файл источника недоступен. Попробуйте повторить позже.",EVERYTHING_SHOWN:"Больше нет дел для отображения",COPY_CUI_SUCCESS:"Номер уголовного дела успешно скопирован",SAVE_CASE_FAILED:"Не удалось сохранить дело",FORMING_DOCUMENT:"Формируем документ"},caseSource:{search:{PLACEHOLDER:"Найти"},messages:{NO_EXACT_MATCH_TOAST:"Точное совпадение не найдено. Открыто начало документа."},tooltips:{DOWNLOAD_VERDICT:"Скачать приговор"},quotes:{SAVE_BUTTON:"Сохранить в цитаты",SAVE_PENDING_TOAST:"Сохраняем цитату",SAVE_SUCCESS_TOAST:"Выбранный текст сохранён в цитаты",SAVE_FAILED_TOAST:"Не удалось сохранить текст в цитаты"}},aggregations:{regions:{PLACEHOLDER:"Все регионы"},courts:{PLACEHOLDER:"Все суды"},plea:{PLACEHOLDER:"По признанию"},punishment:{PLACEHOLDER:"По наказанию",SUSPENDED:"Условный срок"},articles:{PLACEHOLDER:"По квалификации"},events:{PLACEHOLDER:"По фабуле",TITLE:"Событие",ITEM_TITLE:"Эпизод"},genders:{PLACEHOLDER:"По полу субъекта"},criminalStatuses:{PLACEHOLDER:"По судимости субъекта"}},emptyPage:{messages:{FABULA_ANALYZING:"Анализирую фабул
828у",FABULA_ANALYZING_DESCRIPTION_PART1:"Просмотр релевантной судебной практики",FABULA_ANALYZING_DESCRIPTION_PART2:"будет доступен после завершения",FABULA_PROMPT:"Заполните фабулу",FABULA_PROMPT_DESCRIPTION:"для просмотра релевантной судебной практики",SAVED_PROMPT:"Сохраненные дела",SAVED_PROMPT_DESCRIPTION:"Здесь будут отображаться все сохраненные дела",NOT_FOUND:"Ничего не найдено",NOT_FOUND_DESCRIPTION:"Нет подходящей практики. Измените условия поиска."},buttons:{TO_FABULA:"Фабула",TO_FABULIZER:"Фабулайзер",RESET_FILTERS:"Сбросить фильтры"}}},oW={titles:{CASE_CARD_TITLE:"Уголовное дело"},fields:{PLEA_STATUS:"Статус признания",FINAL_SENTENCING_RESULT:"Решение суда",COURT_NAME:"Название суда",FELONY_PUNISHMENT:"Наказание по преступлению",FINAL_SENTENCING_PUNISHMENT:"Общее наказание"},links:{CASE:"Дело",ALL_FELONIES:"Все статьи"},messages:{EVERYTHING_SHOWN:"Больше нет дел для отображения",COPY_CUI_SUCCESS:"Номер уголовного дела успешно скопирован"},aggregations:{regions:{LABEL:"Регион",PLACEHOLDER:"Все регионы"},courts:{LABEL:"Суд",PLACEHOLDER:"Все суды"},plea:{PLACEHOLDER:"По признанию"},punishment:{PLACEHOLDER:"По наказанию"},articles:{PLACEHOLDER:"По квалификации"},events:{PLACEHOLDER:"По фабуле",TITLE:"Событие",ITEM_TITLE:"Эпизод"}},emptyPage:{messages:{FABULA_ANALYZING:"Анализирую фабулу",FABULA_ANALYZING_DESCRIPTION_PART1:"Просмотр релевантной судебной практики",FABULA_ANALYZING_DESCRIPTION_PART2:"будет доступен после завершения",FABULA_PROMPT:"Заполните фабулу",FABULA_PROMPT_DESCRIPTION:"для просмотра релевантной судебной практики",SAVED_PROMPT:"Сохраненные дела",SAVED_PROMPT_DESCRIPTION:"Здесь будут отображаться все сохраненные дела",NOT_FOUND:"Ничего не найдено",NOT_FOUND_DESCRIPTION:"Нет подходящей практики. Измените условия поиска."},buttons:{TO_FABULA:"Фабула",TO_FABULIZER:"Фабулайзер",RESET_FILTERS:"Сбросить фильтры"}}},aW={titles:{RECORDS_TITLE:"Сведения о судимостях",CRIMINAL_RECORD:"Судимость",CHARACTERISTICS:"Характеристики",SPECIAL_SUBJECT:"Специальный субъект",PREVENTIVE_MEASURE:"Досудебные и судебные меры пресечения"},fields:{NAME:"Имя подсудимого",GENDER:"Пол",CITIZENSHIP:"Гражданство",ADDRESS:"Адрес",AGE_GROUP:"Возрастная категория",EDUCATION:"Образование",MARITAL_STATUS:"Семейное положение",CHILDREN:"Наличие несовершеннолетних детей",WORKPLACE:"Место работы",EDUCATIONAL_INSTITUTION:"Место учебы",IS_MILITARY:"Является военнообязанным",MILITARY_STATUS:"Является военнослужащим",OCCUPATION:"Род занятий",MENTAL_HEALTH:"Психическое состояние",PHYSICAL_HEALTH:"Физическое состояние",CRIMINAL_RECORDS_STATUS:"Статус судимости",ARTICLE:"Статья УК РФ",DESCRIPTION:"Описание правонарушения",IS_RECIDIVISM:"Рецидив",IS_LAW_REMOVED:"Утратила ли статья силу",CRIME_STAGE_IS_ARTICLE_30_APPLIED:"Применение статьи 30 УК РФ",CRIME_STAGE_ARTICLE_30_PART:"Примененная часть статьи 30 УК РФ",PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED:"Применение статьи 33 УК РФ",PARTICIPANT_ROLE_ARTICLE_33_PART:"Примененная часть статьи 33 УК РФ",CHARACTERISTICS_TYPE:"Тип характеристики",CHARACTERISTICS_SOURCE:"Источник характеристики",CHARACTERISTICS_QUOTE:"Цитата",SPECIAL_SUBJECT_IS_SPECIAL:"Является ли спецсубъектом",SPECIAL_SUBJECT_TYPE:"Тип спецсубъекта",SPECIAL_SUBJECT_DESCRIPTION:"Описание спецсубъекта",PREVENTIVE_MEASURE_TYPE:"Мера",PREVENTIVE_MEASURE_START_DATE:"Дата начала меры",PREVENTIVE_MEASURE_END_DATE:"Дата оÐ
828ºÐ¾Ð½Ñ‡Ð°Ð½Ð¸Ñ меры",PREVENTIVE_MEASURE_CONDITIONS:"Условия меры"},placeholders:{NOT_SPECIFIED:"Не указано"}},lW={fields:{REGION:"Регион",CUI:"Идентификатор дела",CASE_NUMBER:"Номер дела",COURT_NAME:"Название суда",JUDGES:"Имя судьи",PROSECUTORS:"Имя прокурора",DEFENSE_LAWYERS:"Имя адвоката",HAS_PRETRIAL_COOP_AGREEMENT:"Было ли досудебное соглашение о сотрудничестве"},placeholders:{NOT_SPECIFIED:"Не указано"}},cW={titles:{VICTIMS:"Потерпевшие"},fields:{NAME:"Имя потерпевшего",AGE_STATUS:"Возрастная категория",GENDER:"Пол",RELATION_TO_ACCUSED:"Отношение к подсудимому",ADDRESS:"Адрес потерпевшего"},placeholders:{NOT_SPECIFIED:"Не указано"}},uW={titles:{WITNESSES:"Свидетели"},fields:{NAME:"Имя свидетеля",AGE_STATUS:"Возрастная категория",GENDER:"Пол свидетеля",RELATION_TO_ACCUSED:"Отношение к подсудимому",ADDRESS:"Адрес"},placeholders:{NOT_SPECIFIED:"Не указано"}},dW={titles:{SECTION:"Информация"},items:{GENERAL:"Общие сведения",ACCUSED:"Подсудимые",WITNESSES:"Свидетели",VICTIMS:"Потерпевшие"}},fW={fields:{IS_SPECIAL_ORDER:"Рассматривается ли дело в особом порядке",IS_JURY_TRIAL:"Проходил ли суд с участием присяжных заседателей"},placeholders:{NOT_SPECIFIED:"Не указано"}},pW={titles:{SECTION:"Информация"},items:{GENERAL:"Общие сведения",DEFENDANTS:"Подсудимые",WITNESSES:"Свидетели",VICTIMS:"Потерпевшие"}},hW={titles:{SECTION:"Фабула"},items:{EVENT:"Событие"}},mW={titles:{OBJECTS:"Объекты",PRIMARY_OBJECT:"Основной объект",OBJECTIVE_PART:"Объективная часть",SECONDARY_OBJECTS:"Вторичные объекты",SECONDARY_OBJECT:"Вторичный объект",ACTION:"Действие",HARM:"Нанесённый вред",SUBJECTIVE_PARTS:"Субъективные части"},fields:{EVENT_DESCRIPTION:"Описание события",SEVERITY:"Степень тяжести преступления",EVENT_TYPE:"Тип события",LAW_ARTICLE:"Статья УК РФ",LAW_IS_REMOVED:"Утратила ли статья силу",RELATED_LAW_DESCRIPTION:"Описание закона",OBJECT_DESCRIPTION:"Описание",OBJECTIVE_PART_ITEM:"Объективная часть",SECONDARY_OBJECT_DESCRIPTION:"Описание",ACTION_DESCRIPTION:"Описание",ACTION_METHOD:"Метод",ACCUSED_NAMES:"Имя подсудимого",SUBJECT_ROLE:"Роль субъекта в преступлении",INTENT_TYPE:"Тип умысла",INTENTS:"Умысел",MOTIVES:"Мотив",GOALS:"Цель",EMOTIONS:"Эмоции",MENTAL_STATES:"Психическое состояние",VICTIM_NAME:"Имя потерпевшего",INJURIES:"Описание травм",PHYSICAL_HARM:"Физический вред",EMOTIONAL_HARM:"Эмоциональное воздействие",MATERIAL_HARM:"Материальный ущерб",WITNESSES_NAMES:"Имена свидетелей"},values:{CONTEXT:"Контекстное"},hints:{CONTEXT_EVENT:"Данное событие является контекстным и не содержит преступлений"},placeholders:{NOT_SPECIFIED:"Не указано"},link:{fields:{PATH:"Путь",SHORT_DESCRIPTION:"Краткое описание события преступления",DATE:"Дата события",LOCATION:"Место события"}}},gW={titles:{SECTION:"Обстоятельства",EMPTY:"Обстоятельства не найдены"},items:{CIRCUMSTANCE:"Обстоятельство"}},AW={titles:{QUOTES:"Цитаты"},fields:{ACCUSED_NAME:"Подсудимый",FELONY_IDS:"Статья",CIRCUMSTANCE:"Обстоятельство",TYPE:"Тип",CATEGORY:"Категория",CONSIDERATION_RESULT:"Результат рассмотрения",QUOTE:"Цитата"},values:{MITIGATING:"Смягчающее",AGGRAVATING:"Отягчающее"},placeholders:{NOT_SPECIFIED:"Не указано"}},EW={titles:{SECTION:"Доказательства",EMPTY:"Доказательства не найдены"},items:{EVIDENCE:"Доказательство"}},xW={titles:{EVIDENCE:"Доказательство",QUOTES:"Цитаты",USAGE_IN_FELONIES:"Использование в преступлениях",FELONY:"Преступление",LINKS:"Ссылки"},fields:{ACCUSED_NAME:"Подсудимый",TITLE:"Заголовок",DESCRIPTION:"Описание",TYPE:"Тип",CATEGORY:"Категория",SUBCATEGORY:"Подкатегория",RESULT:"Результат рассмотрения",ADMISSIBILITY:"Допустимо в суде",INADMISSIBILITY_REASON:"Причина недопустимости",QUOTE:"Цитата",LAW_ARTICLE:"Статья УК РФ",PURPOSE:"Цель использования",USED_BY:"Кто использовал",TESTIMONY_PERSON_NAME:"Имя лица, предоставившего показание"},placeholders:{NOT_SPECIFIED:"Не указано"}},CW={titles:{SECTION:"Запрос защиты"},items:{REQUEST:"Запрос",REQUEST_SUCCESSFUL:"Принят",REQUEST_FAILED:"Отклонён"},filters:{ONLY_ACCEPTED:"Только принятые",ALL:"Все"}},yW={titles:{LEGAL_BASIS_GROUP:"Нормы права, на которых основывается запрос",ARGUMENT:"Аргумент",LINKED_ITEMS:"Ссылки",POSSIBLE_LEGAL_BASIS:"Возможные правовые обоснования запроса"},fields:{GOAL:"Цель запроса из приговора",ACCUSED_NAME:"Обвиняемый",GOAL_DESCRIPTION:"Описание цели запроса",RESULT:"Результат запроса",LEGAL_BASIS:"Правовое обоснование",ARGUMENT_DESCRIPTION:"Описание",ARGUMENT_RESULT:"Результат аргумента",ARGUMENT_RELATED_EVIDENCE_IDS:"Идентификатор докаÐ
828·Ð°Ñ‚ельства",ARGUMENT_RELATED_TESTIMONY_IDS:"Идентификатор показания",ARGUMENT_RELATED_CIRCUMSTANCE_IDS:"Идентификатор обстоятельства",ARGUMENT_LINK_DESCRIPTION:"Взаимодействие аргумента с фабулой"},placeholders:{NOT_SPECIFIED:"Не указано"}},bW={titles:{SECTION:"Решение"}},IW={titles:{VERDICT:"Вердикт",PUNISHMENT:"Наказание по вердикту",ADDITIONAL_PUNISHMENT:"Дополнительное наказание",PLEA:"Признание",ARTICLE_15_CONSIDERATION:"Применение части 6 статьи 15 УК РФ",FINAL_SENTENCING:"Результирующее заключение",FINAL_PUNISHMENT:"Наказание",SUSPENDED_SENTENCE:"Условное осуждение",CANCEL_DETAILS:"Детали",POSTPONEMENT_INFO:"Информация об отсрочке",MEDICAL_MEASURE:"Мера медицинского воздействия",EDUCATIONAL_MEASURES:"Образовательные меры",RECLASSIFICATION:"Переквалификация"},fields:{VERDICT_STATUS:"Решение суда по преступлению",VERDICT_DESCRIPTION:"Описание статуса приговора",ACQUITTAL_GROUND:"Основание по которому был оправдан подсудимый",TERMINATION_REASON:"Причина прекращения уголовного дела",PUNISHMENT_DESCRIPTION:"Назначенное наказание",PUNISHMENT_TYPE:"Вид наказания",IS_ARTICLE_64_APPLIED:"Применение статьи 64 УК РФ",ADDITIONAL_PUNISHMENT_TYPE:"Тип меры",ADDITIONAL_PUNISHMENT_DURATION:"Срок меры",ADDITIONAL_PUNISHMENT_CONDITIONS:"Условия меры",PLEA_STATUS:"Статус признания",PLEA_DETAILS:"Подробности признания",PLEA_RELATED_TESTIMONY:"Ссылка на показание",ARTICLE_15_IS_APPLIED:"Применена ли",ARTICLE_15_OLD_CATEGORY:"Старая категория преступления",ARTICLE_15_NEW_CATEGORY:"Новая категория преступления",FINAL_SENTENCING_RESULT:"Результат по всему приговору",FINAL_SENTENCING_RESULT_DESCRIPTION:"Описание результирующего заключения",FINAL_SENTENCING_ACQUITTAL_GROUNDS:"Основания для оправдания подсудимого",FINAL_SENTENCING_TERMINATION_REASON:"Причина прекращения уголовного дела",FINAL_PUNISHMENT_DESCRIPTION:"Результирующее назначенное наказание",FINAL_PUNISHMENT_TYPE:"Вид наказания",FINAL_PUNISHMENT_PENITENTIARY_TYPE:"Тип исправительного учреждения",IS_ARTICLE_70_APPLIED:"Применение статьи 70 УК РФ",SUSPENDED_SENTENCE_IS_APPLIED:"Условное осуждение",SUSPENDED_SENTENCE_REASON:"Основание",SUSPENDED_SENTENCE_DURATION:"Продолжительность",SUSPENDED_SENTENCE_CONDITIONS:"Условия прохождения",CANCEL_DETAILS_IS_CANCELED:"Освобожден ли от наказания",CANCEL_DETAILS_REASON:"Причина освобождения",POSTPONEMENT_IS_APPLIED:"Отсрочка",POSTPONEMENT_REASON:"Основания для применения",MEDICAL_MEASURE_TYPE:"Тип медучреждения",MEDICAL_MEASURE_DESCRIPTION:"Описание меры медицинского воздействия",EDUCATIONAL_MEASURE_TYPE:"Тип меры воспитательного воздействия",EDUCATIONAL_MEASURE_DESCRIPTION:"Описание меры воспитательного воздействия",RECLASSIFICATION_REASON:"Основание переквалификации"},statusValues:{OTHER:"Другое",ACQUITTED:"Оправдан",TERMINATED:"Дело прекращено"},common:{YES:"Да",NO:"Нет"},placeholders:{NOT_SPECIFIED:"Не указано"}},SW={titles:{SECTION:"Запрос обвинения"},items:{REQUEST:"Запрос",REQUEST_SUCCESSFUL:"Принят",REQUEST_FAILED:"Отклонён"}},vW={titles:{ARGUMENT:"Аргумент",LINKED_ITEMS:"Ссылки",REQUEST:"Запрос"},fields:{ACCUSED_NAME:"Обвиняемый",GOAL:"Цель запроса",RESULT:"Результат запроса",ARGUMENT_DESCRIPTION:"Описание",ARGUMENT_RESULT:"Результат аргумента",ARGUMENT_LINK_DESCRIPTION:"Описание взаимодействие аргумента с фабулой дела",ARGUMENT_RELATED_EVIDENCE_IDS:"Идентификатор докаÐ
828·Ð°Ñ‚ельства",ARGUMENT_RELATED_TESTIMONY_IDS:"Идентификатор показания",ARGUMENT_RELATED_CIRCUMSTANCE_IDS:"Идентификатор обстоятельства"},placeholders:{NOT_SPECIFIED:"Не указано"}},_W={titles:{CASE:"Дело №",FABULA:"Фабула",EVIDENCE_AND_CIRCUMSTANCES:"Доказательства и обстоятельства",COURT_DECISION:"Решение суда"},fields:{COURT:"Суд",JUDGE_ONE:"Судья",JUDGE_MANY:"Судьи",REGION:"Регион",ARTICLES:"Статьи",ACCUSED:"Подсудимый",GUILT_POSITION:"Позиция по вине"},placeholders:{NOT_SPECIFIED:"Не указан",NOT_SPECIFIED_PLURAL:"Не указаны"}},TW={titles:{RECORDS_TITLE:"Сведения о судимостях",CRIMINAL_RECORD:"Судимость",CHARACTERISTICS:"Характеристики",SPECIAL_SUBJECT:"Специальный субъект",PLEA:"Признание",PREVENTIVE_MEASURE:"Досудебные и судебные меры пресечения",PROCEDURAL_HISTORY:"История процессуальных решений"},fields:{STATUS:"Статус субъекта",NAME:"Имя",GENDER:"Пол",CITIZENSHIP:"Гражданство",AGE_GROUP:"Возрастная группа",EDUCATION:"Образование",MARITAL_STATUS:"Семейное положение",CHILDREN:"Наличие несовершеннолетних детей",WORKPLACE:"Место работы",EDUCATIONAL_INSTITUTION:"Место учебы",IS_MILITARY:"Является военнообязанным",MILITARY_STATUS:"Является военнослужащим",OCCUPATION:"Род занятий",MENTAL_HEALTH:"Психическое состояние",PHYSICAL_HEALTH:"Физическое состояние",CRIMINAL_RECORDS_STATUS:"Статус судимости",ARTICLE:"Статья УК РФ",DESCRIPTION:"Описание правонарушения",IS_RECIDIVISM:"Рецидив",IS_LAW_REMOVED:"Утратила ли статья силу",CRIME_STAGE_IS_ARTICLE_30_APPLIED:"Применение статьи 30 УК РФ",CRIME_STAGE_ARTICLE_30_PART:"Примененная часть статьи 30 УК РФ",PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED:"Применение статьи 33 УК РФ",PARTICIPANT_ROLE_ARTICLE_33_PART:"Примененная часть статьи 33 УК РФ",CHARACTERISTICS_TYPE:"Тип характеристики",CHARACTERISTICS_SOURCE:"Источник характеристики",CHARACTERISTICS_QUOTE:"Цитата",SPECIAL_SUBJECT_IS_SPECIAL:"Является ли спецсубъектом",SPECIAL_SUBJECT_TYPE:"Тип спецсубъекта",SPECIAL_SUBJECT_DESCRIPTION:"Описание спецсубъекта",PLEA_STATUS:"Статус признания",PLEA_DETAILS:"Подробности признания",PREVENTIVE_MEASURE_TYPE:"Мера",PREVENTIVE_MEASURE_CONDITIONS:"Условия меры",PROCEDURAL_HISTORY_INSTANCE_LEVEL:"Уровень инстанции",PROCEDURAL_HISTORY_COURT_NAME:"Название суда",PROCEDURAL_HISTORY_DOCUMENT_DATE:"Дата вынесения документа",PROCEDURAL_HISTORY_DOCUMENT_TYPE:"Тип документа",PROCEDURAL_HISTORY_DESCRIPTION:"Описание документа",PROCEDURAL_HISTORY_RESULT:"Резолютивная часть"},placeholders:{NOT_SPECIFIED:"Не указано",NO_DATA:"Нет данных"}},NW={fields:{CASE_NUMBER:"Номер дела",APPEAL_COURT_NAME:"Название суда",JUDGES:"Имя судьи",PROSECUTORS:"Имя прокурора",DEFENSE_LAWYERS:"Имя адвоката"},placeholders:{NOT_SPECIFIED:"Не указано"}},wW={titles:{VICTIMS:"Потерпевшие"},fields:{NAME:"Имя потерпевшего",AGE_STATUS:"Возрастная категория",GENDER:"Пол",RELATION_TO_ACCUSED:"Отношение к подсудимому",ADDRESS:"Адрес потерпевшего"},placeholders:{NOT_SPECIFIED:"Не указано"}},RW={titles:{WITNESSES:"Свидетели"},fields:{NAME:"Имя свидетеля",AGE_STATUS:"Возрастная категория",GENDER:"Пол свидетеля",RELATION_TO_ACCUSED:"Отношение к подсудимому",ADDRESS:"Адрес"},placeholders:{NOT_SPECIFIED:"Не указано"}},DW={titles:{SECTION:"Информация"},items:{GENERAL:"Общие сведения",SUBJECTS:"Субъекты",WITNESSES:"Свидетели",VICTIMS:"Потерпевшие"}},kW={titles:{SECTION:"Обстоятельства"},items:{CIRCUMSTANCE:"Обстоятельство"}}
828,OW={titles:{QUOTES:"Цитаты"},fields:{ACCUSED_NAME:"Подсудимый",FELONY_IDS:"Статья",CIRCUMSTANCE:"Обстоятельство",TYPE:"Тип",CATEGORY:"Категория",CONSIDERATION_RESULT:"Результат рассмотрения",QUOTE:"Цитата"},values:{MITIGATING:"Смягчающее",AGGRAVATING:"Отягчающее"},placeholders:{NOT_SPECIFIED:"Не указано",NO_DATA:"Нет данных"}},PW={titles:{SECTION:"Доказательства"},items:{EVIDENCE:"Доказательство"}},LW={titles:{EVIDENCE:"Доказательство",NEW:"Новое",QUOTES:"Цитаты",USAGE_BY_SIDES:"Использование сторонами",COURT_EVALUATION:"Судебная оценка"},fields:{TITLE:"Название доказательства",DESCRIPTION:"Описание",TYPE:"Тип",IS_NEW_EVIDENCE:"Является ли новым доказательством",USAGE_SIDE:"Кто использовал",USAGE_PURPOSE:"Цель использования",QUOTE:"Цитата",COURT_EVALUATION_RESULT:"Итоговое решение по доказательству",COURT_EVALUATION_ADMISSIBILITY:"Допустимо в суде",COURT_EVALUATION_RELEVANCE:"Статус относимости",COURT_EVALUATION_RELIABILITY:"Статус достоверности"},placeholders:{NOT_SPECIFIED:"Не указано",NO_DATA:"Нет данных"}},MW={titles:{SECTION:"Фабула"},items:{EVENT:"Событие"}},jW={titles:{OBJECTS:"Объекты",PRIMARY_OBJECT:"Основной объект",OBJECTIVE_PART:"Объективная часть",SECONDARY_OBJECTS:"Вторичные объекты",SECONDARY_OBJECT:"Вторичный объект",ACTION:"Действие",HARM:"Нанесённый вред",SUBJECTIVE_PARTS:"Субъективные части"},fields:{EVENT_DESCRIPTION:"Описание события",SEVERITY:"Степень тяжести преступления",EVENT_TYPE:"Тип события",LAW_ARTICLE:"Статья УК РФ",LAW_IS_REMOVED:"Утратила ли статья силу",RELATED_LAW_DESCRIPTION:"Описание закона",OBJECT_DESCRIPTION:"Описание",OBJECTIVE_PART_ITEM:"Объективная часть",SECONDARY_OBJECT_DESCRIPTION:"Описание",ACTION_DESCRIPTION:"Описание",ACTION_METHOD:"Метод",ACCUSED_NAMES:"Имя подсудимого",SUBJECT_ROLE:"Роль субъекта в преступлении",INTENT_TYPE:"Тип умысла",INTENTS:"Умысел",MOTIVES:"Мотив",GOALS:"Цель",EMOTIONS:"Эмоции",MENTAL_STATES:"Психическое состояние",VICTIM_NAME:"Имя потерпевшего",INJURIES:"Описание травм",PHYSICAL_HARM:"Физический вред",EMOTIONAL_HARM:"Эмоциональное воздействие",MATERIAL_HARM:"Материальный ущерб",WITNESSES_NAMES:"Имена свидетелей"},values:{CONTEXT:"Контекстное"},hints:{CONTEXT_EVENT:"Данное событие является контекстным и не содержит преступлений"},placeholders:{NOT_SPECIFIED:"Не указано"},link:{fields:{PATH:"Путь",SHORT_DESCRIPTION:"Краткое описание события преступления",DATE:"Дата события",LOCATION:"Место события"}}},BW={titles:{SECTION:"Жалоба/представление"}},FW={titles:{APPEAL_INFORMATION:"Информация об апелляции",APPEAL_RESULT:"Результат по апелляционной жалобе",APPEAL_REQUESTS:"Запросы со стороны апеллянта",OPPOSING_REQUESTS:"Запрос противоборствующей стороны",COURT_ARGUMENTS:"Аргументация суда",ARGUMENT:"Аргумент",LINKED_ITEMS:"Ссылки"},fields:{LAW_ARTICLE:"Статья УК РФ",APPLICANT_NAME:"Имя апеллянта",APPLICANT_CATEGORY:"Категория апеллянта",APPLICATION_DATE:"Дата подачи апелляции",APPEAL_GOAL:"Цель апелляции",APPEAL_GOAL_DESCRIPTION:"Описание цели апелляции",APPEAL_GROUNDS:"Основание",APPEAL_DOCUMENTS:"Документы, на которых основывается апелляция",APPEAL_RESULT:"Результат по апелляции",APPEAL_SATISFACTION:"Удовлетворена ли апелляция",APPEAL_MOTIVES:"Мотивы принятого решения",APPEAL_DESCRIPTION:"Описание принятого решения",REQUEST_APP
828LICANT_CATEGORY:"Лицо, выдвигающее запрос",REQUEST_GOAL:"Цель запроса",REQUEST_GOAL_DESCRIPTION:"Описание цели запроса",REQUEST_LAW:"Правовое обоснование",REQUEST_LAW_IS_REMOVED:"Утратила ли статья силу",REQUEST_IS_SUCCESSFUL:"Была ли достигнута цель запроса",ARGUMENT_DESCRIPTION:"Описание аргумента",ARGUMENT_QUOTE:"Цитата из документа",ARGUMENT_RESULT:"Результат аргумента",ARGUMENT_LAW:"Правовое обоснование"},placeholders:{NOT_SPECIFIED:"Не указано",NO_DATA:"Нет данных"}},UW={titles:{SECTION:"Решение"},toggles:{ONLY_CHANGES:"Только изменения между инстанциями"},NO_CHANGES:"Изменений нет",APPEAL_CHANGES_NOT_AFFECTING_FIRST_INSTANCE:"По решению апелляционного суда присутствуют изменения, не повлиявшие на решение суда первой инстанции"},zW={titles:{VERDICT:"Вердикт",PUNISHMENT:"Наказание по вердикту",ADDITIONAL_PUNISHMENT:"Дополнительное наказание",PLEA:"Признание",ARTICLE_15_CONSIDERATION:"Применение части 6 статьи 15 УК РФ",FINAL_SENTENCING:"Результирующее заключение",FINAL_PUNISHMENT:"Наказание",SUSPENDED_SENTENCE:"Условное осуждение",CANCEL_DETAILS:"Детали",POSTPONEMENT_INFO:"Информация об отсрочке",MEDICAL_MEASURE:"Мера медицинского воздействия",PREVENTIVE_MEASURE_DECISION:"Профилактическая мера решения",OTHER_MEASURES:"Другие меры",EDUCATIONAL_MEASURES:"Образовательные меры",RECLASSIFICATION:"Переквалификация"},fields:{VERDICT_STATUS:"Статус приговора",VERDICT_WAS_ADDED:"Был ли этот конкретный вердикт (эпизод) добавлен апелляционной инстанцией",VERDICT_WAS_DELETED:"Был ли этот конкретный вердикт (эпизод) полностью отменен апелляцией",VERDICT_DESCRIPTION:"Описание статуса приговора",HAS_CIVIL_CLAIMS:"Выдвигались ли гражданские иски",ACQUITTAL_GROUND:"Основание по которому был оправдан подсудимый",TERMINATION_REASON:"Причина прекращения уголовного дела",PUNISHMENT_DESCRIPTION:"Назначенное наказание",PUNISHMENT_TYPE:"Вид наказания",IS_ARTICLE_64_APPLIED:"Применение статьи 64 УК РФ",ADDITIONAL_PUNISHMENT_TYPE:"Тип меры",ADDITIONAL_PUNISHMENT_DURATION:"Срок меры",ADDITIONAL_PUNISHMENT_CONDITIONS:"Условия меры",ADDITIONAL_PUNISHMENT_WAS_ADDED:"Указывает, добавлено ли это дополнительное наказание апелляционным судом",ADDITIONAL_PUNISHMENT_WAS_DELETED:"Указывает, было ли это доп. наказание из первой инстанции отменено апелляцией",PLEA_STATUS:"Статус признания",PLEA_DETAILS:"Подробности признания",PLEA_RELATED_TESTIMONY:"Ссылка на показание",ARTICLE_15_IS_APPLIED:"Применена ли",ARTICLE_15_OLD_CATEGORY:"Старая категория преступления",ARTICLE_15_NEW_CATEGORY:"Новая категория преступления",APPEAL_COURT_DECISION:"Решение апелляционного суда",FINAL_SENTENCING_RESULT:"Результат по всему приговору",FINAL_SENTENCING_RESULT_DESCRIPTION:"Описание результирующего заключения",FINAL_SENTENCING_ACQUITTAL_GROUNDS:"Основания для оправдания подсудимого",FINAL_SENTENCING_TERMINATION_REASON:"Причина прекращения уголовного дела",FINAL_PUNISHMENT_DESCRIPTION:"Результирующее назначенное наказание",FINAL_PUNISHMENT_TYPE:"Вид наказания",FINAL_PUNISHMENT_PENITENTIARY_TYPE:"Тип исправительного учреждения",IS_ARTICLE_70_APPLIED:"Применение статьи 70 УК РФ",SUSPENDED_SENTENCE_IS_APPLIED:"Условное осуждение",SUSPENDED_SENTENCE_REASON:"Основание",SUSPENDED_SENTENCE_DURATION:"Продолжительность",SUSPENDED_SENTENCE_CONDITIONS:"Условия прохождения",CANCEL_DETAILS_IS_CA
828NCELED:"Освобожден ли от наказания",CANCEL_DETAILS_REASON:"Причина освобождения",POSTPONEMENT_IS_APPLIED:"Отсрочка",POSTPONEMENT_REASON:"Основания для применения",HAS_COURT_ORDERED_TREATMENT:"Применено",PREVENTIVE_MEASURE_DECISION_DECISION:"Описание",PREVENTIVE_MEASURE_DECISION_TYPE:"Тип меры",PREVENTIVE_MEASURE_DECISION_DURATION:"Срок действия меры",PREVENTIVE_MEASURE_DECISION_CONDITIONS:"Условия меры",OTHER_MEASURES_TYPE:"Тип",OTHER_MEASURES_DESCRIPTION:"Описание",OTHER_MEASURES_LAWS:"Правовое обоснование",OTHER_MEASURES_WAS_ADDED:"Указывает, было ли это решение (например, конфискация) добавлено в апелляции",OTHER_MEASURES_WAS_DELETED:"Указывает, было ли это дополнительное решение из первой инстанции отменено",MEDICAL_MEASURE_TYPE:"Тип медучреждения",MEDICAL_MEASURE_DESCRIPTION:"Описание меры медицинского воздействия",EDUCATIONAL_MEASURE_TYPE:"Тип меры воспитательного воздействия",EDUCATIONAL_MEASURE_DESCRIPTION:"Описание меры воспитательного воздействия",RECLASSIFICATION_REASON:"Основание переквалификации"},statusValues:{OTHER:"Другое",ACQUITTED:"Оправдан",TERMINATED:"Дело прекращено"},common:{YES:"Да",NO:"Нет"},placeholders:{NOT_SPECIFIED:"Не указано"}},QW={labels:{CREATED:"Создан",UPDATED:"Изменен"},messages:{NOT_READY_YET:"Мобильная версия данного раздела пока недоступна"},emptyPage:{messages:{NOT_FOUND:"Доверители не найдены",ARCHIVED_EMPTY:"В архиве пока пусто",ACTIVE_EMPTY:"Нет активных доверителей",WELCOME_PART1:"Добро пожаловать,",WELCOME_PART2:"сделаем первый шаг",ADD_PROMPT_PART1:"Добавьте первого доверителя,",ADD_PROMPT_PART2:"чтобы начать анализ"},buttons:{ADD_FIRST_CLIENT:"Новый доверитель"}},layout:{nav:{CLIENTS:"Доверители",ARCHIVED:"Архив"},search:{PLACEHOLDER:"Найти доверителя"},buttons:{NEW_CLIENT:"Новый доверитель",LEGAL_BASE:"Правовая база",MORE_SECTIONS:"Ещё разделы"}},legalBase:{titles:{PAGE:"Правовая база"},search:{PLACEHOLDER:"Номер статьи, название, ключевые слова...",ARTICLE_PLACEHOLDER:"Найти",NO_RESULTS_TITLE:"По запросу «{query}» ничего не найдено",NO_RESULTS_HINT:"Попробуйте изменить формулировку или использовать другой запрос"},article:{LOAD_ERROR:"Не удалось загрузить статью",READ_FULL:"Читать полностью"},categories:{UPK:{SEARCH_PLACEHOLDER:"Поиск по Уголовно-процессуальному кодексу"},UK:{SEARCH_PLACEHOLDER:"Поиск по Уголовному кодексу"},KS:{SEARCH_PLACEHOLDER:"Поиск по определениям КС"},VS:{SEARCH_PLACEHOLDER:"Поиск по определениям ВС"},VS_PLENUMS:{SEARCH_PLACEHOLDER:"Поиск по постановлениям Пленума Верховного Суда РФ"},FZ:{SEARCH_PLACEHOLDER:"Поиск по федеральным законам"},OTHER:{SEARCH_PLACEHOLDER:"Поиск по документам"}}},eventsFeloniesArticleText:{CLAUSE:"п.",PART:"ч.",NUMBER:"ст.",RCC:"УК РФ"},clientStatuses:{NOT_STARTED:"Не начата",PRE_INVESTIGATION_CHECK:"Доследственная проверка",INQUIRY:"Дознание",PRELIMINARY_INVESTIGATION:"Предварительное следствие",COURT_FIRST_INSTANCE:"Суд первой инстанции",COURT_SECOND_INSTANCE:"Суд апелляционной инстанции",COURT_THIRD_INSTANCE:"Суд кассационной инстанции",COURT_FINAL_INSTANCE:"Верховный суд"},navigation:{OVERVIEW:"Дело"}},HW={header:{SIGN_IN:"Войти",SIGN_UP:"Зарегистрироваться"},intro:{TITLE:["ИИ-партнер","адвоката"],SUBTITLE:["Система ведения дел, ","анализа и поиска уголовной практики ","на основе искусственного ","интеллекта"],STEP_1:["Введите","информацию о деле","в удобном виде"],STEP_2:["Получите подходящую","практику, анализ шансов","и стратегию защиты"],STEP_3:["Готовьте качественные","док
828ументы за минуты","вместо часов"],callToAction:{DEMO:"Записаться на демо"}},features:{items:[{TITLE:"Стратегия защиты",elements:[{TITLE:"Визуальная аналитика",DESCRIPTION:"Анализируйте исходы дел с помощью наглядной статистики и интерактивных инструментов"},{TITLE:"Опора на практику",DESCRIPTION:"Оценивайте успех запросов защиты на основе статистики реальных дел"},{TITLE:"Убедительная позиция",DESCRIPTION:"Выбирайте аргументы, которые работают в суде"}]},{TITLE:"Практика",elements:[{TITLE:"Большая база уголовных дел",DESCRIPTION:"Сотни тысяч обработанных ИИ судебных актов — и регулярно добавляются новые"},{TITLE:"Связь с первоисточником",DESCRIPTION:"Дает возможность проверить данные в оригинале"},{TITLE:"Умные фильтры",DESCRIPTION:"Поиск по фабуле, квалификации, признанию, исходам и наказанию поможет найти нужную практику за минуты"},{TITLE:"Структурированные карточки дел",DESCRIPTION:"Наглядные карточки помогают быстро найти нужную информацию в судебном акте"}]},{TITLE:"Фабулайзер",elements:[{TITLE:"Лёгкий старт",DESCRIPTION:"Введите информацию о фабуле дела в удобном виде: это может быть и короткое описание ситуации, и процессуальный документ"},{TITLE:"Быстрый результат",DESCRIPTION:"ИИ за несколько секунд проведет анализ, сам выделит ключевую информацию, заполнит карточку дела и найдет похожую практику"}]}]},news:{HEADER:"О нас в СМИ",controls:{READ_MORE:"Продолжение",TO_NEWS:"К новости"},items:[{TITLE:"Инновации в адвокатуре: как ИИ меняет практику",DESCRIPTION:"Насколько далеко можно зайти в интеграции технологий, не потеряв сути профессии? Своим видением в авторской колонке делится сооснователь Plevako.ai, адвокат, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов",TEXT:"Комментарий Ильхама Гусейнова, председателя коллегии адвокатов «Бастион» и сооснователя Plevako.ai, был опубликован в издании «Сфера» в рамках материала «Развод по алгоритму: расторжением браков займётся нейросеть». В комментарии он отметил, что технологии искусственного интеллекта не заменяют адвоката, а усиливают его профессиональные возможности, позволяя сосредоточиться на творческих и стратегических задачах."},{TITLE:"Plevako.ai представил обновления: поиск практики стал точнее",DESCRIPTION:"Мы улучшили алгоритмы сопоставления дел: теперь поиск учитывает больше контекстных факторов и даёт релевантные результаты быстрее",TEXT:"Команда Plevako.ai обновила ядро поиска практики: улучшено ранжирование по фабуле и квалификации, добавлены сигналы по исходам и видам наказаний. В результате пользователи получают более точную и воспроизводимую выборку дел для подготовки позиции."},{TITLE:"Новый релиз: карточка дела стала ещё информативнее",DESCRIPTION:"Добавили блоки ключевых обстоятельств и быстрых ссылок на первоисточники — подготовка к заседанию занимает меньше времени",TEXT:"В карточке дела появились автоизвлечённые обстоятельства, сгруппированные по тематике, а также быстрые переходы к местам в судебных актах. Это ускоряет проверку фактов и формирование аргументации."}]},testimonials:{HEADER:"Отзывы",controls:{READ_MORE:"Продолжение"}},plans:{HEADER:"Тарифы",hints:{CLIENTS_PER_YEAR:"До 100 доверителей в год",STORAGE_PER_CLIENT:"До 50 GB файлов доверителя"},callToAction:{DEMO:"Записаться на демо",TRY_FOR_FREE:"Попробовать бесплатно",DISCOUNT_GROUPS:"Скидка для групп, коллегий и бюро"},details:{PER_MONTH_PREFIX:"в месяц, при оплате",TOTAL_SUM_PREFIX:"общая сумма"}},footer:{EMAIL:"[email protected]",COMPANY_NAME:"© ООО «Интеллектуальные юридические системы»",COMPANY_NAME_SHORT:"© «Интеллектуальные юридические системы»",INN:"ИНН 9727092829",OGRN:"ОГРН 1247700761990",links:{DATA_PROCESSING_POLICY:"Политика обработки персональных данных",OFFER:"Оферта"}},demoRestricted:{TITLE:"Демо-версия закрыта",SUBTITLE:"Plevako.ai переехал на основную платформу с расширенной функциональностью и стабильной работой сервиса",DESCRIPTION_LINES:["Чтобы продолжить работу и получить доступ","к пробному периоду, перейдите на основной сайт"],CTA:"Открыть Plevako.ai"}},VW={menu:{titles:{DEFENSE_REQUESTS:"Запросы защиты",EVIDENCE:"Доказательства",CIRCUMSTANCES:"Обстоятельства"},tooltips:{DEFENSE_REQUESTS:"Вы можете увидеть какие успешные запросы защиты были в выбранных вами делах и как они были рассмотрены Судом. Нажмите на заголовок запроса, чтобы увидеть карточку с аргументами, на которых был основан запрос.",EVIDENCE:"Вы можете увидеть какие докаÐ
828·Ð°Ñ‚ельства были в выбранных вами делах, и как они были рассмотрены Судом. Справа в списке вы можете найти список похожих доказательств. Слева – карточку судебного акта и ссылку на текст этого акта.",CIRCUMSTANCES:"Вы можете увидеть какие смягчающие и отягчающие обстоятельства были в выбранных вами делах, и как они были рассмотрены Судом. Справа в списке вы можете найти список похожих обстоятельств. Слева – карточку судебного акта и ссылку на текст этого акта."}},aggregations:{events:{PLACEHOLDER:"По фабуле"},articles:{PLACEHOLDER:"По квалификации"},instances:{PLACEHOLDER:"По инстанции"},regions:{PLACEHOLDER:"По региону"},genders:{PLACEHOLDER:"По полу субъекта"},criminalStatuses:{PLACEHOLDER:"По судимости субъекта"},firstInstanceVerdictResult:{LABEL:"Решение 1-ой инстанции",DESCRIPTION:"Выберите решения первой инстанции, чтобы система нашла апелляции, поданные на аналогичные акты, и показала результаты их рассмотрения"},applicantCategory:{LABEL:"Категория апеллянта",DESCRIPTION:"Выберите категорию апеллянтов, чтобы система нашла все апелляции данной стороны и помогла вам выявить устойчивые тренды в их аргументации и результатах рассмотрения"},defenseRequests:{PLACEHOLDER:"Все нормы права"},argumentResults:{PLACEHOLDER:"Все результаты"},tooltips:{TITLE:"Используйте фильтры для точного подбора дел по заданным критериям, чтобы ограничить выдачу только актуальными для вас делами."}},messages:{TITLE:"Уже скоро",DESCRIPTION_PART1:"Страница в разработке",DESCRIPTION_PART2:"и будет доступна в конце сентября",NO_RESULTS_BY_FILTERS:"Нет данных по выбранным фильтрам"},buttons:{BACK:"Вернуться назад"},filters:{clearButtons:{RESET:"Сбросить",RESET_ALL:"Сбросить все",SELECT_HINT:"Выберите исход для фильтрации",POSITION:"Позиция",SELECT_HINT_APPEAL_GOALS:"Выберите запрос для фильтрации",SATISFIED_NOT_SATISFIED:"Удовлетворено / Не удовлетворено"},results:{TITLE:"Успешные запросы защиты",SECTION_TITLE:"Цели запросов апелляционных жалоб/представлений",CASES_WITH_ARGUMENTS_TITLE:"Дела с аргументами из запросов"},casesWithArgumentsItem:{FINAL_SENTENCING_DIFF_TITLE:"Изменения в итоговом решении дела по результатам апелляции:",APPEAL_CHANGES_TITLE:"Изменение решений по отдельным преступлениям:",REQUEST_GOAL_TITLE:"Цель запроса:",REQUEST_ARGUMENTS_TITLE:"Аргументация запроса:"},circle:{TITLE:"Результат рассмотрения апелляций",VERDICT_RESULT_CHANGED:"Изменено",VERDICT_RESULT_CANCELED:"Отменено",VERDICT_RESULT_UNCHANGED:"Оставлено без изменений",VERDICT_CANCELED:"Приговор отменён",VERDICT_CHANGED:"Приговор изменён",VERDICT_UNCHANGED:"Приговор оставлен без изменений",APPEALS_LABEL:"апелляций",CASES_IN_ZERO_BEFORE:"в",CASES_IN_ZERO_AFTER:"делах",CASES_IN_ONE_BEFORE:"в",CASES_IN_ONE_AFTER:"деле",CASES_IN_MANY_BEFORE:"в",CASES_IN_MANY_AFTER:"делах",FELONIES_ZERO:"похожих преступлений",FELONIES_ONE:"похожее преступление",FELONIES_MANY:"похожих преступлений",PLEA_ADMITTED:"Признал",PLEA_PARTIALLY_ADMITTED:"Частично признал",PLEA_NOT_ADMITTED:"Не признал"},tooltips:{POSITION:"Выберите нужную позицию (признал, частично признал, не признал), чтобы отфильтровать диапазон решений. Итог рассмотрения дела Судом зависит от позиции доверителя по делу.",SELECT_HINT:"Вы можете выбрать результаты только по актуальным для вас исходам.",RESULTS_TITLE:"Вы можете выбрать выдачу дел, в которых Суд удовлетворил интересующие вас запросы защиты."}},defenseRequest:{SUCCESS_PERCENT_ZERO:"удовлетворено",SUCCESS_PERCENT_ONE:"удовлетворен",SUCCESS_PERCENT_MANY:"удовлетворено",FELONIES_ZERO:"преступлений",FELONIES_ONE:"преступление",FELONIES_MANY:"преступления",RIGHTS_ZERO:"норм права",RIGHTS_ONE:"норма права",RIGHTS_MANY:"нормы права",RIGHTS_ABSENT:"Правовое обоснование аргументов отсутствует",ARGUMENTS_ZERO:"аргументов",ARGUMENTS_ONE:"аргумент",ARGUMENTS_MANY:"аргумента"},defenseRequestDataBlock:{EMPTY_TITLE:"Нет аргументов для отображения",EMPTY_DESCRIPTION:"Измените параметры запроса или снимите фильтры, чтобы увидеть результаты",CASE_ARGUMENTS_TITLE_PREFIX:"Аргументация запроса из дела",SOURCE:"Источник",EVERYTHING_SHOWN:"Все аргументы показаны",ARG_RESULT_CONSIDERED:"Учтён и принят во внимание",ARG_RESULT_IGNORED:"Учтён и не принят во внимание",ARG_RESULT_NOT_CONSIDERED:"Не учтён",ARG_RESULT_UNKNOWN:"Не указано"},evidence:{SOURCE:"Источник",CASE_NUMBER_PREFIX:"Дело",SIMILAR_TITLE:"Похожие докаÐ
828·Ð°Ñ‚ельства",SIMILAR_TITLE_COUNT:"похожих доказательств",SIMILAR_EVIDENCE_ZERO:"похожих доказательств",SIMILAR_EVIDENCE_ONE:"похожее доказательство",SIMILAR_EVIDENCE_MANY:"похожих доказательства",SIMILAR_COUNT_SUFFIX_ZERO:"похожих",SIMILAR_COUNT_SUFFIX_ONE:"похожее",SIMILAR_COUNT_SUFFIX_MANY:"похожих",usedBy:{DEFENSE:"Защитник",PROSECUTION:"Обвинитель"},status:{CONSIDERED:"Учтено",NOT_CONSIDERED:"Не учтено"},buttons:{ONLY_CONSIDERED:"Только учтённые",ALL:"Все доказательства"},tabs:{DEFENSE:"Защита",PROSECUTION:"Обвинение"},messages:{EVERYTHING_SHOWN:"Все доказательства показаны"},tooltips:{CRIMINAL_CASE_FELONIES:"Преступления уголовного дела"}},circumstances:{SOURCE:"Источник",CASE_NUMBER_PREFIX:"Дело",tabs:{MITIGATING:"Смягчающие",AGGRAVATING:"Отягчающие"},status:{CONSIDERED:"Учтено",NOT_CONSIDERED:"Не учтено"},tooltips:{CRIMINAL_CASE_OFFENSES:"Преступления уголовного дела"},SIMILAR_TITLE:"Похожие обстоятельства",SIMILAR_CIRCUMSTANCES_ZERO:"похожих обстоятельств",SIMILAR_CIRCUMSTANCES_ONE:"похожее обстоятельство",SIMILAR_CIRCUMSTANCES_MANY:"похожих обстоятельства",SIMILAR_COUNT_SUFFIX_ZERO:"похожих",SIMILAR_COUNT_SUFFIX_ONE:"похожее",SIMILAR_COUNT_SUFFIX_MANY:"похожих",messages:{EVERYTHING_SHOWN:"Все обстоятельства показаны"},buttons:{ONLY_CONSIDERED:"Только учтённые",ALL:"Все обстоятельства"}},tooltips:{DEFENSE_REQUEST:"Вы можете увидеть аргументы из дел, в которых был успешный запрос стороны защиты"}},GW={errors:{NETWORK_TIMEOUT:"Ошибка сети. Проверьте соединение.",NETWORK_SLOW:"Медленное соединение. Загрузка..."}},qW={TITLE:"Страница не найдена",BUTTON:"Вернуться на главную",CLIENT_NOT_FOUND:{TITLE:"Доверитель не найден",BUTTON:"Доверители"},DOCUMENT_NOT_FOUND:{TITLE:"Документ не найден",BUTTON:"К документам"},LEGAL_BASE_NOT_FOUND:{TITLE:"Страница не найдена",BUTTON:"К правовой базе"},PRACTICE_NOT_FOUND:{TITLE:"Страница не найдена",BUTTON:"Вернуться к практике"},TARIFF_NOT_FOUND:{TITLE:"Страница не найдена",BUTTON:"Вернуться к оплате"}},WW={PROFILE:"Профиль",SIGN_OUT:"Выйти",DOWNLOAD_INSTRUCTION:"Скачать инструкцию",trial:{TITLE:"Демо-доступ закончится",DESCRIPTION_FIRST_LINE:"Оформите подписку,",DESCRIPTION_SECOND_LINE:"чтобы работать дальше",BUTTON:"Оформить"},paid:{TITLE_PREFIX:"Тариф «",TITLE_SUFFIX:"»",ACTIVE_UNTIL:"Активен до"},emailConfirm:{DESCRIPTION:"Перейдите по ссылке из письма для подтверждения электронной почты",RESEND:"Отправить повторно",SUCCESS:"Письмо для подтверждения отправлено",errors:{ACCOUNT_ALREADY_CONFIRMED:"Электронная почта уже подтверждена",UNKNOWN:"Не удалось отправить письмо для подтверждения"}}},KW={genders:{MALE:"Мужской",FEMALE:"Женский",UNKNOWN:"Не указан"},ageStatuses:{MINOR:"Несовершеннолетний",ADULT:"Совершеннолетний"},ageStatusGroups:{UNDER_14:"До 14 лет",FROM_14_TO_16:"От 14 до 16 лет",FROM_16_TO_18:"От 16 до 18 лет"},maritalStatuses:{SINGLE:"Не женат",MARRIED:"Женат",DIVORCED:"Разведён",WIDOWED:"Вдовец"},mentalHealths:{HEALTHY:"Здоров",DISORDER:"Нездоров",UNKNOWN:"Не указан"},physicalHealths:{HEALTHY:"Здоров",DISABLED:"Нездоров",UNKNOWN:"Не указан"},criminalStatuses:{SUSPECT:"Подозреваемый",ACCUSED:"Обвиняемый",CONVICTED:"Приговорённый",ACQUITTED:"Оправданный"},characteristicDescriptions:{POSITIVE:"Положительная",NEGATIVE:"Отрицательная",NEUTRAL:"Нейтральная",MIXED:"Смешанная",SATISFACTORY:"Удовлетворительная"},specialSubjectTypes:{LAWYER:"Юрист",JUDGE:"Судья",PROSECUTOR:"Прокурор",INVESTIGATOR:"Следователь",DEPUTY:"Депутат",OTHER:"Другое"},pleaStatuses:{GUILTY:"Признал вину полностью",NOT_GUILTY:"Не признал вину",PARTIALLY_GUILTY:"Признал вину частично"},clientRoles:{EXECUTOR:"Исполнитель",ORGANIZER:"Организатор",INSTIGATOR:"Подстрекатель",ACCOMPLICE:"Пособник"},testimonyStages:{INVESTIGATION:"Предварительное следствие",TRIAL:"Суд первой инстанции",APPEAL:"Суд апелляционной инстанции"},preInvestigationResults:{INITIATED:"Постановление о возбуждении уголовного дела",REFUSED:"Постановление об отказе возбуждения уголовного дела"},inquiryResults:{DISMISSED:"Прекращено",REFERRED_TO_COURT:"Передано в суд"},preliminaryInvestigationResults:{DISMISSED:"Прекращено",REFERRED_TO_COURT:"Передано в суд"},preTrialMeasureTypes:{DETENTION:"Заключение под стражу",HOUSE_ARREST:"Домашний арест",BAIL:"Залог",TRAVEL_RESTRICTIONS:"Подписка о невыезде",PERSONAL_SURETY:"Личное поручительство",MILITARY_COMMAND_SUPERVISION:"Наблюдение командования воинской части",MINOR_DEFENDANT_SUPERVISION:"Присмотр за несовершеннолетним обвиняемым",PROHIBITION_OF_CERTAIN_ACTIONS:"Запрет определенных действий"},punishmentTypes:{FINE:"Штраф",DEPRIVATION_OF_RIGHT_TO_HOLD_POSITIONS:"Лишение права занимать определенные должности или заниматься определенной деятельностью",DEPRIVATION_OF_SPECIAL_MILITARY_HONORARY_TITLE:"Лишение специального, воинского или почетного звания, классного чина и государственных наград",MANDATORY_WORK:"Обязательные работы",CORRECTIONAL_WORK:"Исправительные работы",MILITARY_SERVICE_RESTRICTION:"Ограничение по военной службе",FREEDOM_RESTRICTION:"Ограничение свободы",CONDITIONAL_IMPRISONMENT:"Условное лишение свободы",FORCED_LABOR:"Принудительные работы",ARREST:"Арест",MILITARY_DISCIPLINARY_UNIT_DETENTION:"Содержание в дисциплинарной воинской части",IMPRISONMENT_FOR_FIXED_TERM:"Лишение свободы на определенный срок",LIFE_IMPRISONMENT:"Пожизненное лишение свободы",DEATH_PENALTY:"Смертная казнь"},penitentiaryTypes:{COLONY_SETTLEMENT:"Колония-поселение",GENERAL:"Общий режим",STRICT:"Строгий режим",SPECIAL:"Особый режим",PRISON:"Тюрьма",EDUCATIONAL_COLONY:"Воспитательные колонии",ISOLATION_CENTER:"Следственный изолятор",CORRECTIONAL_COLONY:"Исправительные колонии",MEDICAL_CORRECTIONAL:"Лечебные исправительные учреждения"},courtSessionStatuses:{CONDUCTED:"Проведено",APPOINTED:"Назначено",POSTPONED:"Отложено"},applicantCategories:{CONVICTED:"Осужденный",ACQUITTED:"Оправданный",DEFENSE_ATTORNEY:"Защитник",LEGAL_REPRESENTATIVE:"Законный представитель",PROSECUTOR:"Государственный обвинитель и (или) вышестоящий прокурор",VICTIM:"Потерпевший"},appealGoals:{ACQUITTAL_INSTEAD_OF_CONVICTION:"Отмена обвинительного приговора и вынесение оправдательного приговора",CONVICTION_INSTEAD_OF_CONVICTION:"Отмена обвинительного приговора и вынесение обвинительного приговора",REVERSE_AND_REND_TO_FIRST_INSTANCE:"Отмена приговора и направление дела в суд первой инстанции на новое судебное разбирательство",REVERSE_RULING_AND_REND:"Отмена определения и направление дела в суд первой инстанции на новое судебное разбирательство",REVERSE_DECREE_AND_REND:"Отмена постановления и направление дела в суд первой инстанции на новое судебное разбирательство",REVERSE_RULING_AND_ACQUITTAL_OR_OTHER:"Отмена определения и вынесение оправдательного приговора либо иного судебного решения",REVERSE_DECREE_AND_ACQUITTAL_OR_OTHER:"Отмена постановления и вынесение оправдательного приговора либо иного судебного решения",REVERSE_AND_RETURN_TO_PROSECUTOR:"Отмена приговора и возвращение дела прокурору",REVERSE_RULING_AND_RETURN_TO_PROSECUTOR:"Отмена определения и возвращение дела прокурору",REVERSE_DECREE_AND_RETURN_TO_PROSECUTOR:"Отмена постановления и возвращение дела прокурору",REVERSE_AND_TERMINATE_CASE:"Отмена приговора и прекращение уголовного дела",REVERSE_RULING_AND_TERMINATE_CASE:"Отмена определения и прекращение уголовного дела",REVERSE_DECREE_AND_TERMINATE_CASE:"Отмена постановления и прекращение уголовного дела",MODIFY_JUDGMENT_OR_DECISION:"Изменение приговора или иного обжалуемого судебного решения",OTHER:"Другое"},appealPleaStatuses:{FULLY_ADMITTED:"Признал(-а) вину полностью",PARTIALLY_ADMITTED:"Признал(-а) вину частично",NOT_ADMITTED:"Не признал(-а) вину"},appealDocuments:{FIRST_INSTANCE_JUDGMENT:"Приговор суда первой инстанции",FIRST_INSTANCE_RULING:"Определение суда первой инстанции",FIRST_INSTANCE_ORDER:"Постановление суда первой инстанции",APPELLATE_RULING:"Определение суда апелляционной инстанции",APPELLATE_ORDER:"Постановление суда апелляционной инстанции",CASSATION_RULING:"Определение суда кассационной инстанции",CASSATION_ORDER:"Постановление суда кассационной инстанции"},appealGrounds:{FACTUAL_INCONSISTENCY:"Несоответствие выводов суда, изложенных в приговоре, фактическим обстоятельствам уголовного дела, установленным судом первой инстанции",PROCEDURAL_VIOLATION:"Существенное нарушение уголовно-процессуального закона",INCORRECT_LAW_APPLICATION:"Неправильное применение уголовного закона",UNJUST_SENTENCE:"Несправедливость приговора",COOPERATION_AGREEMENT_VIOLATION:"Выявление данных, свидетельствующих о несоблюдении лицом условий и невыполнении им обязательств, предусмотренных досудебным соглашением о сотрудничестве",ARTICLE_237_NEW_CIRCUMSTANCES:"Выявление обстоятельств, указанных в части первой и пункте 1 части первой.2 статьи 237 настоящего Кодекса",DISAGREEMENT_WITH_COURT_DECISION:"Несогласие с решением суда"},requestGoals:{FACTUAL_INCONSISTENCY:"Указать суду на несоответствие выводов суда, изложенных в приговоре, фактическим обстоятельствам уголовного дела, установленным судом первой инстанции",PROCEDURAL_VIOLATION:"Указать суду на существенное нарушение уголовно-процессуального закона",PROCEDURAL_LAW_VIOLATION:"Указать суду на существенное нарушение уголовно-процессуального закона",CRIMINAL_LAW_MISAPPLICATION:"Указать суду на неправильное применение уголовного закона",INCORRECT_LAW_APPLICATION:"Указать суду на неправильное применение уголовного закона",UNJUST_SENTENCE:"Указать суду на несправедливость приговора",COOPERATION_AGREEMENT_VIOLATION:"Доказать несоблюдение условий досудебного соглашения о сотрудничестве",CHARGING_DOCUMENT_VIOLATIONS:"Доказать нарушения при составлении обвинительных документов",INDICTMENT_COPY_NOT_SERVED:"Указать суду на невручение обвиняемому копии обвинительного заключения, акта или постановления",RIGHTS_NOT_EXPLAINED:"Указать суду на неразъяснение обвиняемому его прав при ознакомлении с материалами дела",OTHER:"Другое"},requestResults:{ACQUITTAL:"Оправдание (признание невиновным(-ой))",SUSPENDED_SENTENCE_GRANTED:"Назначение условного срока",SUSPENDED_SENTENCE_DENIED:"Отказ в назначении условного срока",CASE_DISMISSAL:"Прекращение уголовного дела",CASE_DISMISSAL_DENIED:"Отказ в прекращении уголовного дела",PARTIAL_CASE_DISMISSAL:"Частичное прекращение уголовного дела",PARTIAL_CASE_DISMISSAL_DENIED:"Отказ в частичном прекращении уголовного дела",RECLASSIFICATION_TO_LESSER_CRIME:"Переквалификация на менее тяжкое преступление",RECLASSIFICATION_DENIED:"Отказ в переквалификации на менее тяжкое преступление",CRIME_SEVERITY_REDUCTION:"Снижение категории тяжести преступления в рамках одной статьи",CRIME_SEVERITY_REDUCTION_DENIED:"Отказ в снижении категории тяжести преступления в рамках одной статьи",ADDITIONAL_PUNISHMENT_APPLIED:"Применение дополнительного наказания",ADDITIONAL_PUNISHMENT_CANCELLED:"Отмена примененного дополнительного наказания",LESS_STRICT_CORRECTIONAL_FACILITY:"Назначение менее строгого вида исправительного учреждения",LESS_STRICT_CORRECTIONAL_FACILITY_DENIED:"Отказ в назначении менее строгого вида исправительного учреждения",BELOW_MIN
828IMUM_SENTENCE:"Назначение ниже низшего наказания, предусмотренного санкцией вмененной статьи",BELOW_MINIMUM_SENTENCE_DENIED:"Отказ в назначении ниже низшего наказания, предусмотренного санкцией вмененной статьи",CIVIL_CLAIM_SATISFIED:"Удовлетворение гражданского иска",CIVIL_CLAIM_DENIED:"Отказ в удовлетворении гражданского иска",CIVIL_CLAIM_PARTIALLY_SATISFIED:"Частичное удовлетворение гражданского иска",PUNISHMENT_EXEMPTION:"Освобождение от наказания",PUNISHMENT_EXEMPTION_DENIED:"Отказ в освобождении от наказания",PUNISHMENT_TYPE_CHANGED:"Изменение типа наказания",SENTENCE_TERM_REDUCED:"Уменьшение срока наказания",DECISION_UNCHANGED:"Оставление решения без изменений",CASE_RETURNED_TO_FIRST_INSTANCE:"Возвращение дела в суд первой инстанции",OTHER:"Другое"},requestArgumentConfirmationStatuses:{SUPPORTS_PROSECUTION:"Подтверждает позицию обвинения",REFUTES_PROSECUTION:"Опровергает позицию обвинения",PARTIALLY_SUPPORTS_PROSECUTION:"Частично подтверждает позицию обвинения"},requestArgumentResults:{NOT_CONSIDERED_BY_COURT:"Не учтено судом",CONSIDERED_AND_ACCEPTED:"Учтено судом, принято во внимание",CONSIDERED_BUT_NOT_ACCEPTED:"Учтено судом, не принято во внимание",CONSIDERED_AND_PARTIALLY_ACCEPTED:"Учтено судом, частично принято во внимание"},cassationApplicantCategories:{CONVICTED:"Осужденный",ACQUITTED:"Оправданный",DEFENSE_ATTORNEY_CONVICTED:"Защитник осужденного",DEFENSE_ATTORNEY_ACQUITTED:"Защитник оправданного",LEGAL_REPRESENTATIVE_CONVICTED:"Законный представитель осужденного",LEGAL_REPRESENTATIVE_ACQUITTED:"Законный представитель оправданного",VICTIM:"Потерпевший",PRIVATE_PROSECUTOR:"Частный обвинитель",LEGAL_REPRESENTATIVE_PRIVATE_PROSECUTOR:"Законный представитель частного обвинителя",REPRESENTATIVE_PRIVATE_PROSECUTOR:"Представитель частного обвинителя",CIVIL_PLAINTIFF:"Гражданский истец",CIVIL_DEFENDANT:"Гражданский ответчик",PROSECUTOR:"Прокурор"},cassationGoals:{VERDICT_OVERTURNED_CASE_DISMISSED:"Отмена приговора и всех последующих судебных решений и прекращение производства по уголовному делу",RULING_OVERTURNED_CASE_DISMISSED:"Отмена определения и всех последующих судебных решений и прекращение производства по уголовному делу",RESOLUTION_OVERTURNED_CASE_DISMISSED:"Отмена постановления и всех последующих судебных решений и прекращение производства по уголовному делу",VERDICT_OVERTURNED_NEW_TRIAL:"Отмена приговора и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",RULING_OVERTURNED_NEW_TRIAL:"Отмена определения и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",RESOLUTION_OVERTURNED_NEW_TRIAL:"Отмена постановления и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",VERDICT_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена приговора и всех последующих судебных решений и возвращение дела прокурору",RULING_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена определения и всех последующих судебных решений и возвращение дела прокурору",RESOLUTION_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена постановления и всех последующих судебных решений и возвращение дела прокурору",APPELLATE_VERDICT_OVERTURNED_NEW_APPELLATE_REVIEW:"Отмена приговора суда апелляционной инстанции и передача уголовного дела на новое апелляционное рассмотрение",CASSATION_DECISION_OVERTURNED_NEW_CASSATION_REVIEW:"Отмена решения суда кассационной инстанции и передача уголовного дела на новое кассационное рассмотрение",CASSATION_DECISION_OVERTURNED_VERDICT_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление приговора без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_VERDICT_MODIFIED:"Отмена решения суда кассационной инстанции и изменение приговора и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RULING_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление определения без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RULING_MODIFIED:"Отмена решения суда кассационной инстанции и изменение определения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RESOLUTION_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление постановления без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RESOLUTION_MODIFIED:"Отмена решения суда кассационной инстанции и изменение постановления и (или) последующих судебных решений",VERDICT_MODIFIED:"Внесение изменений в приговор и (или) последующие судебные решения",RULING_MODIFIED:"Внесение изменений в определение и (или) последующие судебные решения",RESOLUTION_MODIFIED:"Внесение изменений в постановление и (или) последующие судебные решения"},cassationPleaStatuses:{FULLY_ADMITTED:"Признал(-а) вину полностью",PARTIALLY_ADMITTED:"Признал(-а) вину частично",NOT_ADMITTED:"Не признал(-а) вину"},cassationDocuments:{VERDICT:"Приговор",RULING:"Определение",RESOLUTION:"Постановление",OTHER_FINAL_DECISION:"Иное итоговое решение",INTERIM_COURT_DECISION:"Промежуточное судебное решение"},cassationGrounds:{FACTUAL_INCONSISTENCY:"Несоответствие выводов суда, изложенных в приговоре, фактическим обстоятельствам уголовного дела, установленным судом первой инстанции",PROCEDURAL_VIOLATION:"Существенное нарушение уголовно-процессуального закона",INCORRECT_LAW_APPLICATION:"Неправильное применение уголовного закона",UNJUST_SENTENCE:"Несправедливость приговора",COOPERATION_AGREEMENT_VIOLATION:"Выявление данных, свидетельствующих о несоблюдении лицом условий и невыполнении им обязательств, предусмотренных досудебным соглашением о сотрудничестве",ARTICLE_237_NEW_CIRCUMSTANCES:"Выявление обстоятельств, указанных в части первой и пункте 1 части первой.2 статьи 237 настоящего Кодекса"},cassationRequestResults:{CASSATION_COMPLAINT_DENIED:"Оставление кассационной жалобы без удовлетворения",CASSATION_PETITION_DENIED:"Оставление кассационного представления без удовлетворения",VERDICT_OVERTURNED_CASE_DISMISSED:"Отмена приговора и всех последующих судебных решений и прекращение производства по данному уголовному делу",RULING_OVERTURNED_CASE_DISMISSED:"Отмена определения суда и всех последующих судебных решений и прекращение производства по данному уголовному делу",RESOLUTION_OVERTURNED_CASE_DISMISSED:"Отмена постановления и всех последующих судебных решений и прекращение производства по данному уголовному делу",VER
828DICT_OVERTURNED_NEW_TRIAL:"Отмена приговора и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",RULING_OVERTURNED_NEW_TRIAL:"Отмена определения и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",RESOLUTION_OVERTURNED_NEW_TRIAL:"Отмена постановления и всех последующих судебных решений и передача уголовного дела на новое судебное рассмотрение",VERDICT_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена приговора и всех последующих судебных решений и возвращение дела прокурору",RULING_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена определения и всех последующих судебных решений и возвращение дела прокурору",RESOLUTION_OVERTURNED_RETURNED_TO_PROSECUTOR:"Отмена постановления и всех последующих судебных решений и возвращение дела прокурору",APPELLATE_VERDICT_OVERTURNED_NEW_APPELLATE_REVIEW:"Отмена приговора суда апелляционной инстанции и передача уголовного дела на новое апелляционное рассмотрение",CASSATION_DECISION_OVERTURNED_NEW_CASSATION_REVIEW:"Отмена решения суда кассационной инстанции и передача уголовного дела на новое кассационное рассмотрение",CASSATION_DECISION_OVERTURNED_VERDICT_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление приговора без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_VERDICT_MODIFIED:"Отмена решения суда кассационной инстанции и изменение приговора и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RULING_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление определения без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RULING_MODIFIED:"Отмена решения суда кассационной инстанции и изменение определения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RESOLUTION_UNCHANGED:"Отмена решения суда кассационной инстанции и оставление постановления без изменения и (или) последующих судебных решений",CASSATION_DECISION_OVERTURNED_RESOLUTION_MODIFIED:"Отмена решения суда кассационной инстанции и изменение постановления и (или) последующих судебных решений",VERDICT_MODIFIED:"Внесение изменений в приговор и (или) последующие судебные решения",RULING_MODIFIED:"Внесение изменений в определение и (или) последующие судебные решения",RESOLUTION_MODIFIED:"Внесение изменений в постановление и (или) последующие судебные решения",OTHER:"Другое"},satisfactionStatuses:{FULLY_SATISFIED:"Полностью удовлетворена",PARTIALLY_SATISFIED:"Частично удовлетворена",REJECTED:"Отклонена"},intentTypes:{DIRECT_INTENT:"Прямой умысел",INDIRECT_INT
828ENT:"Косвенный умысел",RECKLESSNESS:"Легкомысленная неосторожность",NEGLIGENCE:"Небрежность"},lawyerPracticeForms:{CABINET:"Адвокатский кабинет",BUREAU:"Адвокатское бюро",COLLEGIUM:"Коллегия адвокатов",CONSULTATION:"Юридическая консультация"},circumstanceTypes:{MITIGATING:"Смягчающее",AGGRAVATING:"Отягчающее"},circumstanceReviewResults:{ACCEPTED_ACCOUNTED:"Обстоятельство учтено судом, принято",NOT_ACCOUNTED:"Обстоятельство не учтено судом",EXCLUDED_ACCOUNTED:"Обстоятельство учтено судом, исключено"},circumstanceMitigatingCategories:{},circumstanceAggravatingCategories:{},evidenceTypes:{DIRECT:"Прямое",INDIRECT:"Косвенное"},evidenceSides:{DEFENSE:"Сторона защиты",PROSECUTION:"Сторона обвинения"},evidenceReviewResults:{ACCEPTED_ACCOUNTED:"Доказательство учтено судом, принято",NOT_ACCOUNTED:"Доказательство не учтено судом",EXCLUDED_ACCOUNTED:"Доказательство учтено судом, исключено"}},$W={yesNo:{YES:"Да",NO:"Нет"},dropdownWithSearch:{NO_MATCHES:"Нет совпадений",ALL:"Все",APPLY:"Применить",CLEAR:"Очистить"},validationErrors:{EMPTY_REQUIRED:"Поле обязательно для заполнения",INVALID_PHONE:"Неверный формат номера телефона",INVALID_EMAIL:"Неверный формат электронной почты",INVALID_DAYS:"Используйте только цифры",MAX_LENGTH_EXCEEDED:"Превышена допустимая длина значения",SAVE_FAILED:"Произошла ошибка при сохранении данных"},notifications:{SAVE_CHANGES_FAILED:"Не удалось сохранить изменения",FILE_UPLOAD_FAILED:"Не удалось загрузить файл",FILE_UPLOAD_ALREADY_ATTACHED:"Этот файл уже добавлен",FILE_UPLOAD_MAX_SIZE_50_MB:"Максимальный размер файла — 50 МБ.",FILE_DOWNLOAD_PENDING_ZERO:"Готовим {count} файлов к скачиванию…",FILE_DOWNLOAD_PENDING_ONE:"Готовим файл к скачиванию…",FILE_DOWNLOAD_PENDING_MANY:"Готовим {count} файла к скачиванию…",FILE_DOWNLOAD_FAILED:"Не удалось скачать файл"}},YW={DAY_ONE:"день",DAY_FEW:"дня",DAY_MANY:"дней",MONTH_ONE:"месяц",MONTH_FEW:"месяца",MONTH_MANY:"месяцев",MONTH_SHORT:"мес.",YEAR_SUFFIX:"г.",AT_TIME:"в",WEEKDAYS_SHORT:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"]},XW={consent:{COOKIES_ANALYTICS:"Используем cookie для аналитики.",COOKIES_ANALYTICS_DETAILS:"Подробнее — ",LINK_TEXT:"в пользовательском соглашении",ACCEPT:"Принять"}},JW={updates:{AVAILABLE_MESSAGE:"Доступно обновление — воспользуйтесь актуальной версией сервиса",UPDATE_BUTTON:"Обновить"}},ZW={titles:{TITLE:"Активация демо-доступа"},description:{newRegistration:{DESCRIPTION:"Добро пожаловать в систему Plevako.ai! Вы получаете полный доступ ко всем функциям на 5 дней.",INSTRUCTION:"Для активации введите свой номер телефона."},oldRegistration:{DESCRIPTION:"Вы можете получить бесплатный доступ ко всем функциям еще на 5 дней.",INSTRUCTION:"Для этого введите свой номер телефона."}},inputs:{phone:{PLACEHOLDER:"Номер телефона"}},buttons:{TARIFFS:"Тарифы",ACTIVATE:"Активировать"},errors:{REQUIRED_PHONE:"Поле обязательно для заполнения",INVALID_PHONE:"Неверный формат номера телефона",SAVE_FAILED:"Не удалось сохранить номер телефона",ACTIVATE_FAILED:"Не удалось активировать демо-доступ"},success:{ACTIVATE_SUCCESS:"Демо-доступ успешно активирован"}},eK={titles:{BOOK_DEMO:"Запись на демо",SHOW_SYSTEM:"Покажем систему в действии"},placeholders:{FULL_NAME:"ФИО",PHONE:"Телефон",EMAIL:"Эл. почта"},agreements:{dataProcessing:{PREFIX:"Даю согласие",DATA_PROCESSING:"на обработку персональных данных"},marketing:{TEXT:"Даю согласие на получение экспертных материалов и персональных предложений по эл. почте и телефону"},ERROR_REQUIRED:"Примите условия, чтобы записаться"},buttons:{SUBMIT:"Записаться",BACK_TO_SITE:"Вернуться на сайт",REGIST
828ER:"Зарегистрироваться"},success:{TITLE:"Запись на демо оформлена",description:{PREFIX:"Свяжемся с вами по номеру",SUFFIX:"в ближайшее время для демонстрации возможностей платформы",WAITING_HINT:"А пока ждёте звонка, можете попробовать самостоятельно."}},errors:{VALIDATION_ERROR:"Некоторые поля заполнены неверно",UNKNOW_ERROR:"Произошла ошибка при попытке записи на демо"},fieldsErrors:{name:{REQUIRED:"Укажите имя",VALUE_ERROR:"Неверный формат имени"},email:{REQUIRED:"Укажите эл. почту",VALUE_ERROR:"Неверный формат эл. почты"},phone:{REQUIRED:"Укажите телефон",VALUE_ERROR:"Неверный формат телефона"}}},tK={buttons:{CHANGE:"Изменить"},titles:{PROFILE:"Профиль",SUBSCRIPTION:"Подписка",PAYMENT_HISTORY:"История платежей"},subscription:{messages:{SUBSCRIPTION_EXPIRED:"Срок вашей подписки истек. Оформите новую, чтобы продолжить пользоваться сервисом."},buttons:{CONNECT:"Подключить",ACTIVATE:"Активировать"},labels:{ACTIVE_UNTIL:"Активен",ACTIVE_UNTIL_SUFFIX:"до",VALID_UNTIL:"Успейте воспользоваться",VALID_UNTIL_SUFFIX:"до"},actions:{DISABLE_AUTORENEW:"Отключить автопродление"},notifications:{DISABLE_AUTORENEW_SUCCESS:"Автопродление отключено",DISABLE_AUTORENEW_ERROR:"Не удалось отключить автопродление. Попробуйте позже.",ACTIVATE_TRIAL_SUCCESS:"Демо-доступ успешно активирован",ACTIVATE_TRIAL_ERROR:"Не удалось активировать демо-доступ"},trial:{TITLE:"Демо-доступ",FREE_DAYS:"5 дней бесплатно"},hints:{PER_MONTH_PREFIX:"в месяц, при оплате",PER_MONTH_SUFFIX:",",TOTAL_SUM_PREFIX:"общая сумма"}},payment:{titles:{SUBSCRIPTION_SETUP:"Оформление подписки"},labels:{PROMO_CODE:"Промокод, если есть"},errors:{BILLING_REQUEST_FAILED:"Не удалось создать платеж. Попробуйте позже."},promoCodeSuccess:{PREFIX:"Скидка ",SUFFIX:" ₽ применена."},promoCodeErrors:{NOT_FOUND:"Промокод не найден",PROMO_RESERVED_LINE1:"Промокод заблокирован. Если процесс оплаты был прерван, то промокод разблокируется в течение часа.",PROMO_RESERVED_LINE2:"Нужна помощь — пишите ",PROMO_RESERVED_EMAIL:"[email protected]",PROMO_RESERVED_SUFFIX:".",VALIDATION_ERROR:"Промокод не найден",PROMO_NOT_FOUND:"Промокод не найден",PROMO_ALREADY_USED:"Промокод не найден",PROMO_EXPIRED:"Промокод не найден",TARIFF_NOT_FOUND:"Промокод не найден",PROMO_VALIDATION_ERROR:"Промокод не найден"},buttons:{PAY_PARTIAL:"Оплатить частями",payWithAmount:{PREFIX:"Оплатить ",SUFFIX:" ₽"}},texts:{PER_MONTH:"₽/мес — вы получаете",PARTIAL_BADGE:"Оплата частями",partialToday:{PREFIX:"от ",SUFFIX:" ₽ сегодня"},CASHBOX_VPN_NOTICE:"Для работы кассы отключите VPN"},toggles:{AUTO_RENEW:"Продлевать подписку автоматически"},tooltips:{AUTO_RENEW:"Включите — чтобы не потерять доступ к Plevako.ai в неподходящий момент, можно отключить в личном кабинете.",PARTIAL_PAYMENT:"Разделите оплату на части — первая спишется сразу, остальные через каждый месяц или 2 недели"},links:{TERMS:"Условия",TARIFF_DESCRIPTION:"Описание тарифов",OFFER:"Оферта"}},paymentHistory:{columns:{DATE:"Дата и время платежа",AMOUNT:"Сумма, ₽",DESCRIPTION:"Описание",STATUS:"Статус",PAYMENT_ID:"ID транзакции"},descriptions:{TRIAL:"Бесплатный демо-доступ 5 дней",TARIFF_LABEL_PREFIX:"Тариф «",TARIFF_LABEL_SUFFIX:"»"},statuses:{PENDING:"В обработке",WAITING_FOR_CAPTURE:"В обработке",SUCCEEDED_ACTIVATED:"Активирован",SUCCEEDED_PAID:"Оплачено",CANCELED:"Отменено"},messages:{COPY_PAYMENT_ID_SUCCESS:"ID транзакции скопирован",EMPTY_STATE_HINT:"После первой оплаты вы увидите здесь историю платежей"},placeholders:{COPY_PAYMENT_ID:"Скопировать ID транзакции"}}
828,layout:{footer:{TITLE_LINE_ONE:"Скидки для коллегий и бюро,",TITLE_LINE_TWO:"отдельные условия для амбассадоров",CONTACT_US:"Свяжитесь с нами чтобы уточнить условия",CALLS:"Для звонков",TELEGRAM:"Telegram",WHATSAPP:"WhatsApp",EMAIL:"Эл. почта"}},fields:{FULL_NAME:"ФИО",LAST_NAME:"Фамилия",FIRST_NAME:"Имя",MIDDLE_NAME:"Отчество",CONTACTS:"Контакты",EMAIL:"Электронная почта",PHONE:"Номер телефона",LAWYER_DETAILS:"Реквизиты адвоката",LAWYER_REGISTRATION_NUMBER:"Регистрационный номер адвоката",LAWYER_PRACTICE_FORM:"Форма объединения",OFFICIAL_NAME:"Официальное название"},placeholders:{LAST_NAME:"Введите фамилию",FIRST_NAME:"Введите имя",MIDDLE_NAME:"Введите отчество",LAWYER_REGISTRATION_NUMBER:"Введите регистрационный номер",OFFICIAL_NAME:"Введите официальное название",LAWYER_PRACTICE_FORM:"Выберите форму объединения",EMAIL_NOT_SPECIFIED:"Эл. почта не указана",PHONE_NOT_SPECIFIED:"Номер телефона не указан"}},nK={checkEmailTemplate:{TITLE:"Проверьте электронную почту",DID_NOT_RECEIVE_CODE:"Не получили код",RESEND_CODE:"Отправить повторно"},enterSmsCodeTemplate:{DID_NOT_RECEIVE_CODE:"Не получили код",RESEND_CODE:"Отправить повторно",accessIsTemporarilyRestricted:{TITLE:"Доступ временно ограничен",DESCRIPTION:"Вы ввели неверный код три раза. Попробуйте снова через {time} {minutes}.",minutes:{ZERO:"минут",ONE:"минуту",MANY:"минуты"}}},editor:{HEADER_BLOCK:"Добавить шапку",SIGNATORY_BLOCK:"Добавить подписанта",SIGNATORY_BLOCK_DELETE:"Удалить подписанта",HEADER:"Добавить изображение",UPLOAD_IMAGE:"Загрузите изображение",IMAGE_HINT:"PNG или JPG, рекомендуемый размер 720×96",IMAGE_REMOVE:"Удалить изображение",IMAGE_REPLACE:"Выбрать другое изображение",IMAGE_ALT:"Изображение шапки",IMAGE_UPLOAD_FAILED:"Не удалось загрузить изображение",IMAGE_TOO_LARGE:"Максимальный размер изображения — 10 МБ",IMAGE_WRONG_TYPE:"Поддерживаются PNG, JPG и WebP",COMMENT_PLACEHOLDER:"Комментарий",COMMENT_INDEX_OF:"из",DRAG_BLOCK:"Переместить блок",EVIDENCE_POPUP_TITLE:"Привязка докаÐ
828·Ð°Ñ‚ельства к линии защиты",EVIDENCE_POPUP_SELECT_HINT:"Выберите доказательства",EVIDENCE_POPUP_SELECTED_COUNT:"Выбрано доказательств: {count}",EVIDENCE_POPUP_ADD:"Добавить",SELECT_TEXT_FOR_COMMENT:"Выделите текст, чтобы оставить комментарий",textStyleDropdown:{TEXT:"Текст",TITLE:"Заголовок",SUBTITLE:"Подзаголовок",HEADING_3:"Заголовок 3",HEADING_4:"Заголовок 4",HEADING_5:"Заголовок 5"},layoutDropdown:{LEFT:"По левому краю",CENTER:"По центру",RIGHT:"По правому краю",JUSTIFY:"По ширине",DECREASE_INDENT:"Уменьшить отступ",INCREASE_INDENT:"Увеличить отступ"},toolbarDropdownPlaceholders:{TEXT_STYLE:"Стиль",FONT:"Шрифт",LAYOUT:"Выравнивание"},tooltips:{UNDO:"Отменить",REDO:"Повторить",BOLD:"Жирный",ITALIC:"Курсив",UNDERLINE:"Подчёркнутый",BULLET_LIST:"Маркированный список",NUMBERED_LIST:"Нумерованный список",COMMENTS:"Комментарии",CLEAR_STYLES:"Очистить форматирование",HIGHLIGHT:"Выделение цветом",ADD_COMMENT:"Добавить комментарий",ADD_COPILOT_PILL:"Прикрепить фрагмент к сообщению копилоту"}},chat:{RESOURCE_RING_DAY_LABEL:"{percent}% на день",RESOURCE_RING_MONTH_LABEL:"{percent}% на месяц",RESOURCE_RING_DAY_TOOLTIP_TITLE:"Ресурс помощника на сегодня",RESOURCE_RING_MONTH_TOOLTIP_TITLE:"Ресурс помощника на месяц",RESOURCE_RING_TOOLTIP_SUBTITLE_RESET_AT:"Обновится {resetAt}",RESOURCE_RING_WINDOW_NOT_STARTED:"Окно ещё не начато",COMPOSER_PLACEHOLDER:"Напишите запрос или выберите действие...",PILL_DOCUMENT_REF_FALLBACK:"Фрагмент документа",PILL_FILE_ATTACHMENT_FALLBACK:"Файл",PILL_FILE_ATTACHMENT_UNAVAILABLE:"Файл недоступен",PILL_REMOVE:"Убрать",ATTACH_TOOLTIP_FIRST_LINE:"Прикрепить файл",ATTACH_TOOLTIP_SECOND_LINE:"до {maxKilobytes} КБ",ATTACH_MAX_SIZE_EXCEEDED:"Максимальный размер файла — 100 КБ.",ATTACH_INVALID_FILE_TYPE:"Можно прикрепить только файл DOCX.",FILE_DROP_OVERLAY_TITLE:"Добавить файлы",FILE_DROP_OVERLAY_SUBTITLE:"Перетащите сюда файлы для анализа информации",ANALYZING:"Анализирую…",ANALYZING_AUTO_INIT:"Подготавливаю данные…",TOOL_CALL_STARTING:"Запускаю инструмент {name}…",ERROR_GENERIC:"Что-то пошло не так при обработке",ERROR_STREAM_CLOSED_WITHOUT_DONE:"Соединение прервано до завершения ответа",ERROR_QUOTA_EXCEEDED:"Лимит запросов к помощнику исчерпан",ERROR_INVALID_FILE_PILL:"Файл недоступен, прикрепите снова",RETRY:"Повторить",HISTORY_LOAD_ERROR:"Не удалось загрузить историю",USER_MESSAGE_EXPAND:"Развернуть",USER_MESSAGE_COLLAPSE:"Свернуть"}},sK={title:"Создание доверителя",sections:[{title:"ФИО доверителя",content:[["Введите фамилию доверителя (или псевдоним), чтобы вы могли отличить дела между собой. Вся информация хранится в безопасном информационном контуре и не передается третьим лицам (",{type:"link",text:"ПДн",to:"/documents/privacy-policy.pdf"},", ",{type:"link",text:"Оферта",to:"/documents/offer.pdf"},")"]]},{title:"Фабула",content:["Описание фабулы должно содержать объективную и субъективную стороны преступления. Чем подробнее и точнее описана фабула, тем точнее пройдет поиск похожих дел.","Фабула дела может быть введена как своими словами, так и скопирована из процессуального доÐ
828ºÑƒÐ¼ÐµÐ½Ñ‚а (постановления о возбуждении, приговора первой инстанции и т.д.).",{type:"card",title:"Пример фабулы из текста приговора первой инстанции",content:["ДД.ММ.ГГГГ не позднее 17 часов 15 минут, Фамилия И.О. находясь на лестничной площадке, расположенной между первым и вторым этажом в подъезде № <адрес> по адресу: <адрес>, имея умысел, направленный на тайное хищение денежных средств с банковского счета Потерпевший№ 3., умышленно, из корыстных побуждений, с целью незаконного материального обогащения, убедившись, что за ее действиями никто не наблюдает и они остаются тайными, взяла, оставленный Потерпевший№ 3. на подоконнике, мобильный телефон с установленным в нем мобильным приложением банка АО «Тинькофф», ДД.ММ.ГГГГ в 17 часов 15 минут, осуществила финансовую операцию по переводу денежных средств в сумме 3 500 рублей, с банковского счета №, открытого на имя Потерпевший№ 3. в отделении банка АО «Тинькофф» по адресу: <адрес>, на банковский счет №, открытый, на имя неосведомлённого о преступных намерениях ФИО1, в банке АО «Тинькофф Банк» по адресу: <адрес>, который находился в пользовании Затонской К.С., тем самым похитила денежные средства с банковского счета.","После чего похищенные денежные средства Фамилия И.О. обратила в свою пользу и распорядилась ими по своему усмотрению, причинив своими действиями Потерпевший№ 3 П.А. имущественный ущерб на сумму 3 500 рублей.","Она же, ДД.ММ.ГГГГ, не позднее 18 часов 19 минут, находясь в помещении цветочного магазина, принадлежащего ИП «Потерпевший№ 1», расположенного по адресу: <адрес> имея умысел на извлечение преступного дохода и личное обогащение, действуя с целью противоправного и безвозмездного изъятия имущества, решила совершить грабеж, то есть открытое хищение чужого имущества, принадлежащего ИП «Потерпевший№ 1» и Потерпевший№ 2","Реализуя преступный умысел, направленный на открытое хищение имущества цветочного магазина ИП «Потерпевший№ 1» и Потерпевший№ 2, она (Фамилия И.О.), ДД.ММ.ГГГГ, примерно в 18 часов 19 минут, находясь в помещении цветочного магазина по вышеуказанному адресу, действуя умышленно, из корыстных побуждений, воспользовавшись тем, что продавец магазина Потерпевший№ 2 зашла в холодильную камеру, заперла последнюю в указанной холодильной камере и открыто похитила наличные денежные средства, находящиеся в ящике стола, расположенного в помещении цветочного магазина по вышеуказанному адресу, в сумме 1 080 рублей принадлежащие ИП «Потерпевший№ 1»."]}
828,{type:"card",title:"Пример той же фабулы своими словами",content:["В тот день Фамилия И.О. находилась в подъезде дома и заметила на подоконнике чужой телефон. Понимая, что за её действиями никто не наблюдает, она решила воспользоваться ситуацией и, действуя из корыстных побуждений, через банковское приложение перевела 3 500 рублей с банковского счёта владельца телефона на счёт, который фактически контролировала. Полученными деньгами она распорядилась по своему усмотрению, причинив потерпевшему материальный ущерб.","Позднее в тот же день Фамилия И.О. зашла в цветочный магазин. Осознавая противоправность своих действий и желая получить деньги, она дождалась, пока продавец зайдёт в холодильную камеру, заперла её там и открыто взяла из ящика стола наличные денежные средства в сумме 1 080 рублей, принадлежащие владельцу магазина."]}]},{title:"Анализ фабулы",content:["Нажмите кнопку «Анализировать». ИИ начнет анализ обстоятельств дела и подбор практики. Этот процесс может занять несколько минут. По завершении вам придет уведомление на эл. почту."]}]},rK="/assets/casesFilters-9n3yTuj_.webp",iK="/assets/casesCard-D8Z7D-84.webp",oK={title:"Практика",sections:[{title:"Как происходит поиск?",content:["На странице «Практика» представлены судебные дела из нашей базы, максимально похожие на ваше.","Поиск похожих дел в Plevako.ai — это не просто поиск по ключевым словам. Процесс происходит в три этапа:",{type:"list-decimal",content:["Распознавание вашего дела: Система берет информацию из загруженных вами документов и карточки дела, которую она автоматически сформировала (распознала). Вы всегда можете посмотреть и отредактировать карточку на странице Дело/Фабула","Смысловое сравнение: Алгоритм сравнивает данные вашего дела с сотнями тысяч документов в нашей базе. Мы сопоставляем: Описание событий из фабулы, объетивную, субъетивную части и их составляющие элементы","Приоритетность выдачи: Наиболее похожие дела (где совпадает максимальное количество параметров) отображаются в самом верху списка. Процент сходства в карточке подскажет, насколько ситуация в найденном деле дублирует вашу. Если в фабуле дела вашего доверителя несколько преступлений, то выше в выдаче будут также дела с несколькими преступлениями."]},{type:"card",title:"Важно",content:["По умолчанию мы ищем практику по сути происшествия, не ограничиваясь конкретной статьей. Это помогает найти релевантные примеры, даже если следствие применило иную квалификацию."]}]},{title:"Фильтры",content:["Фильтрация на странице Практика поможет сузить выборку и найти наиболее релевантные кейсы.",[{type:"bold",text:"«По фабуле»"}," — позволяет сфокусировать поиск на конкретных эпизодах вашего дела. В выпадающем списке фильтра отображаются все События и Эпизоды, которые были распознаны или введены вами в разделе «Дело/Фабула
828»."],"Вы можете отметить галочками конкретные статьи, относящиеся к определенному событию. После нажатия кнопки «Применить», система оставит в выдаче только те дела из базы, которые максимально соответствуют обстоятельствам выбранных вами эпизодов. Если вы ничего не выбрали, то по-умолчанию поиск включает всю введенную фабулу.",[{type:"bold",text:"«По квалификации»"}," — поможет сузить поиск практики до конкретной статьи."],[{type:"bold",text:"«По признанию»"}," — оставит в выдаче дела с заданной позицией защиты."],[{type:"bold",text:"«По наказанию»"}," — покажет дела с выбранным решением суда."],{type:"image",src:rK}]},{title:"Карточка дела",content:["Каждая карточка в списке — это и есть краткая сводка дела.",{type:"list-decimal",content:["Переход в полное дело — нажмите на заголовок (номер дела), чтобы открыть детальную страницу. Там вы сможете изучить все подробности процесса: от состава суда до развернутой аргументации решения.","Навигация по судебным инстанциям — в верхней части карточки расположен горизонтальный переключатель, который позволяет отслеживать движение дела по иерархии судебной системы (Если дело рассматривалось только в суде первой инстанции и не обжаловалось, остальные вкладки будут скрыты. При переключении между вкладками данные в основной части карточки обновляются в соответствии с решениями, принятыми на соответствующем этапе производства.","Навигация по преступлениям дела — в левой части карточки представлен список всех преступлений в рамках данного дела, по каждому из которых можно переключиться для просмотра детальной информации. Рядом с каждой статьей указан процент схожести, отражающий степень соответствия конкретного эпизода делу вашего доверителя.","Кнопка «Источник» — если вам нужен оригинальный текст судебного акта, нажмите «Источник». Система сохранит документ на ваше устройство, чтобы вы могли использовать цитаты из него в своих ходатайствах или жалобах","Иконка «Сохранить» — при нажатии на иконку, карточка дела добавляется в раздел «Сохраненные» для более быстрого доступа к ним в будущем."]},{type:"image",src:iK}]}]},aK={...Jq,service:JW,client:{...Zq,fabula:tW,participants:nW,stage:sW,fabulizer:rW,strategies:oW,cases:iW,newClient:eW,case:{firstInstance:{overview:_W,information:{menu:dW,accused:aW,general:lW,victims:cW,witnesses:uW},cases:{menu:pW,general:fW},fabula:{menu:hW,event:mW},circumstances:{menu:gW,circumstance:AW},evidence:{menu:EW,item:xW},defenseRequest:{menu:CW,item:yW},accusationRequest:{menu:SW,item:vW},conclusions:{menu:bW,item:IW}},secondInstance:{information:{menu:DW,subjects:TW,general:NW,victims:wW,witnesses:RW},complaintsAndSubmissions:{menu:BW,item:FW},fabula:{menu:MW,event:jW},circumstances:{menu:kW,circumstance:OW},evidence:{menu:PW,item:LW},conclusions:{menu:UW,item:zW}}},defenseStrategy:VW},clients:QW,main:HW,trialActivation:ZW,bookDemo:eK,network:GW,page404:qW,userMenu:WW,enums:KW,inputs:$W,dateTime:YW,cookies:XW,profile:tK,molecules:nK,structuredPages:{newClient:{help:sK},cases:{help:oK}}},h=aK,lK=()=>{const e=Se(i=>i.user),t=l.useRef(!1),{refetch:n}=Vt({queryKey:["cookiesConsent"],queryFn:()=>rq({isCookiesConsent:!0}),enabled:!1,retry:!1}),s=l.useCallback(i=>{i.stopPropagation()},[]),r=l.useCallback(i=>{i.stopPropagation(),Ze("COOKIES_CONSENT"),n()},[n]);return l.useEffect(()=>{e&&(t.current||(t.current=!0,!e.isCookiesConsent&&ve({type:"info",message:a.jsxs(a.Fragment,{children:[h.cookies.consent.COOKIES_ANALYTICS," ",a.jsx("br",{className:"block bp48:hidden"}),h.cookies.consent.COOKIES_ANALYTICS_DETAILS,a.jsx(Je,{to:"/documents/privacy-policy.pdf",target:"_blank",onClick:s,className:"underline decoration-solid underline-offset-[25%] decoration-[3%] decoration-white hover:text-zinc-100",children:h.cookies.consent.LINK_TEXT}),"."]}),buttons:[{text:h.cookies.consent.ACCEPT,onClick:r}],duration:0,key:"COOKIES_CONSENT",closeOnClick:!1})))},[e,s,r]),{}},cK="/version.json";async function uK(){const e=`${cK}?ts=${Date.now()}
828`,t=await qe(e,{method:"GET",cache:"no-store",credentials:"include"});if(He(t)||!t.ok)return null;try{const n=await t.json();if(n===null||typeof n!="object")return null;const s=n;return!s.version||typeof s.version!="string"?null:{version:s.version,commitShort:s.commitShort,commit:s.commit,builtAt:s.builtAt}}catch{return null}}const dK=()=>{const e=l.useRef(null),t=l.useRef(null),n=Se(i=>i.user),s=l.useCallback(i=>{i.stopPropagation(),Ze("UPDATE_VERSION"),window.location.reload()},[]),{data:r}=Vt({queryKey:["versionJson"],queryFn:uK,refetchInterval:6e4,refetchIntervalInBackground:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchOnMount:!0,staleTime:0,retry:!1});return l.useEffect(()=>{if(!r)return;const i=r.version;if(e.current==null){e.current=i;return}if(i!==e.current){if(!n){window.location.reload();return}t.current!==i&&(t.current=i,ve({type:"info",message:h.service.updates.AVAILABLE_MESSAGE,buttons:[{text:h.service.updates.UPDATE_BUTTON,onClick:s}],duration:0,key:"UPDATE_VERSION",closeOnClick:!1}))}},[r,n,s]),{}},fK=()=>{const e=Fe(),t=U1();l.useEffect(()=>{if(t)return;const n=e.pathname==="/";return n&&document.documentElement.classList.add("main-page"),n||document.documentElement.classList.remove("main-page"),()=>{document.documentElement.classList.remove("main-page")}},[e.pathname,t])};var yy,a6;function pK(){if(a6)return yy;a6=1;var e="Expected a function",t=NaN,n="[object Symbol]",s=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt,u=typeof h0=="object"&&h0&&h0.Object===Object&&h0,d=typeof self=="object"&&self&&self.Object===Object&&self,p=u||d||Function("return this")(),g=Object.prototype,A=g.toString,E=Math.max,x=Math.min,y=function(){return p.Date.now()};function I(_,N,R){var D,k,L,O,P,B,F=0,z=!1,Q=!1,M=!0;if(typeof _!="function")throw new TypeError(e);N=w(N)||0,v(R)&&(z=!!R.leading,Q="maxWait"in R,L=Q?E(w(R.maxWait)||0,N):L,M="trailing"in R?!!R.trailing:M);function K(X){var oe=D,ie=k;return D=k=void 0,F=X,O=_.apply(ie,oe),O}function W(X){return F=X,P=setTimeout(q,N),z?K(X):O}function H(X){var oe=X-B,ie=X-F,ee=N-oe;return Q?x(ee,L-ie):ee}function j(X){var oe=X-B,ie=X-F;return B===void 0||oe>=N||oe<0||Q&&ie>=L}function q(){var X=y();if(j(X))return G(X);P=setTimeout(q,H(X))}function G(X){return P=void 0,M&&D?K(X):(D=k=void 0,O)}function $(){P!==void 0&&clearTimeout(P),F=0,D=B=k=P=void 0}function J(){return P===void 0?O:G(y())}function ne(){var X=y(),oe=j(X);if(D=arguments,k=this,B=X,oe){if(P===void 0)return W(B);if(Q)return P=setTimeout(q,N),K(B)}return P===void 0&&(P=setTimeout(q,N)),O}return ne.cancel=$,ne.flush=J,ne}function v(_){var N=typeof _;return!!_&&(N=="object"||N=="function")}function S(_){return!!_&&typeof _=="object"}function b(_){return typeof _=="symbol"||S(_)&&A.call(_)==n}function w(_){if(typeof _=="number")return _;if(b(_))return t;if(v(_)){var N=typeof _.valueOf=="function"?_.valueOf():_;_=v(N)?N+"":N}if(typeof _!="string")return _===0?_:+_;_=_.replace(s,"");var R=i.test(_);return R||o.test(_)?c(_.slice(2),R?2:8):r.test(_)?t:+_}return yy=I,yy}var hK=pK();const ol=Am(hK),mK=()=>{const e=l.useRef(0),t=120,n=l.useRef(null);l.useEffect(()=>{document.documentElement.classList.add("vh-stable-pending");const s=()=>{const c=window.innerHeight,u=c*.01;return document.documentElement.style.setProperty("--vh",`${u}px`),{heightPx:c,vhPx:u}},i=ol(()=>{const c=window.innerHeight,u=c*.01;if(e.current===0){e.current=c,document.documentElement.style.setProperty("--vh-stable",`${u}px`),n.current!==null&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>{document.documentElement.classList.remove("vh-stable-pending"),document.documentElement.classList.add("vh-stable-ready"),n.current=null},500);return}Math.abs(c-e.current)<t||(e.current=c,document.documentElement.style.setProperty("--vh-stable",`${u}px`))},400),o=()=>{s(),i()};return window.addEventListener("resize",o),o(),()=>{window.removeEventListener("resize",o),i.cancel(),n.current!==null&&(window.clearTimeout(n.current),n.current=null)}},[])},gK=rt(async function(){const t=Se.getState().accessToken,n=Ke("/catalogues/enums/"),s=await qe(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};if(!r.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return r.data}),AK=rt(async function(){const t=Se.getState().accessToken,n=Ke("/catalogues/articles/"),s=await qe(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};if(!r.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return r.data?.articles??[]}),EK=rt(async function(){const t=Se.getState().accessToken,n=Ke("/catalogues/regions/"),s=await qe(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};if(!r.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return r.data?.regions??[]}),kn=$n(e=>({isCataloguesEnumsReady:!1,isCataloguesArticlesReady:!1,isCataloguesRegionsReady:!1,catalogues:null,setIsCataloguesEnumsReady:t=>e(n=>({isCataloguesEnumsReady:typeof t=="function"?t(n.isCataloguesEnumsReady):t})),setIsCataloguesArticlesReady:t=>e(n=>({isCataloguesArticlesReady:typeof t=="function"?t(n.isCataloguesArticlesReady):t})),setIsCataloguesRegionsReady:t=>e(n=>({isCataloguesRegionsReady:typeof t=="function"?t(n.isCataloguesRegionsReady):t})),setCatalogues:t=>e(n=>({catalogues:typeof t=="function"?t(n.catalogues):t}))})),xK=()=>{const e=l.useRef(!1),t=Se(p=>p.accessToken),n=kn(p=>p.setIsCataloguesEnumsReady),s=kn(p=>p.setIsCataloguesArticlesReady),r=kn(p=>p.setIsCataloguesRegionsReady),i=kn(p=>p.catalogues),o=kn(p=>p.setCatalogues),{mutate:c}=tt({mutationFn:gK,onSuccess(p){o(g=>({...g,enums:p})),n(!0)},onError(){e.current=!1}}),{mutate:u}=tt({mutationFn:AK,onSuccess(p){o(g=>({...g,articles:p})),s(!0)},onError(){e.current=!1}}),{mutate:d}=tt({mutationFn:EK,onSuccess(p){o(g=>({...g,regions:p})),r(!0)},onError(){e.current=!1}});l.useEffect(()=>{t&&(i?.articles&&i?.enums&&i?.regions||e.current||(e.current=!0,
828c(),u(),d()))},[t,i,c,u,d])},CK=600*1e3;function jv({value:e}){return e.startsWith(" ")?e.slice(1):e}function yK({lines:e}){for(const t of e)if(t.startsWith("event:"))return jv({value:t.slice(6)});return"message"}function bK({lines:e}){for(const t of e)if(t.startsWith("id:"))return jv({value:t.slice(3)})}function IK({lines:e}){const t=[];for(const n of e)n.startsWith(":")||n.startsWith("event:")||n.startsWith("data:")&&t.push(jv({value:n.slice(5)}));return t}function l6({block:e}){const t=e.split(`
829`),n=IK({lines:t});if(n.length===0)return null;const s={type:yK({lines:t}),data:n.join(`
830`)},r=bK({lines:t});return r!==void 0&&(s.id=r),s}function by({record:e,key:t}){const n=e[t];if(typeof n=="string")return n}async function SK({response:e}){try{const t=await e.json();if(!pt(t))return;if(pt(t.error))return{code:by({record:t.error,key:"code"}),message:by({record:t.error,key:"message"})};const n=by({record:t,key:"message"});return n!==void 0?{message:n}:void 0}catch{return}}async function c6({options:e}){const{url:t,method:n="POST",body:s,getAccessToken:r,signal:i,timeout:o=CK,extraHeaders:c}=e,u={...c};u.Accept="text/event-stream",u.Authorization=`Bearer ${r()}`,s!==void 0&&(u["Content-Type"]="application/json");const d=await qe(t,{method:n,credentials:"include",signal:i,timeout:o,headers:u,body:s});if(!He(d))return d;throw{httpCode:503,errorData:d.error}}async function vK({options:e}){const t=await c6({options:e});return t.status!==401&&t.status!==403?t:(await Lk(),c6({options:e}))}async function Xk(e){const t=await vK({options:e});if(!t.ok)throw{httpCode:t.status,errorData:await SK({response:t})};if(t.body)return t.body;throw{httpCode:500,errorData:{code:"EMPTY_STREAM_BODY",message:"SSE response has no body"}}}function _K({buffer:e}){const t=e.split(`
831
832`),n=t.slice(0,-1),s=t[t.length-1]??"";return{events:n,rest:s}}async function*Jk({reader:e,decoder:t,buffer:n,signal:s,onActivity:r}){if(s?.aborted)throw new DOMException("Aborted","AbortError");const{done:i,value:o}=await e.read();if(i){const p=(n+t.decode()).replace(/\r\n/g,`
833`);if(p.trim().length===0)return;const g=l6({block:p});g&&(yield g);return}r?.();const c=(n+t.decode(o,{stream:!0})).replace(/\r\n/g,`
834`),{events:u,rest:d}=_K({buffer:c});for(const p of u){const g=l6({block:p});g&&(yield g)}yield*Jk({reader:e,decoder:t,buffer:d,signal:s,onActivity:r})}async function*Zk({body:e,signal:t,onActivity:n}){const s=e.getReader(),r=new TextDecoder("utf-8"),i=()=>{s.cancel().catch(()=>{})};t?.addEventListener("abort",i,{once:!0});try{yield*Jk({reader:s,decoder:r,buffer:"",signal:t,onActivity:n})}finally{t?.removeEventListener("abort",i),s.releaseLock()}}const TK={promptTokens:0,completionTokens:0,totalTokens:0,cachedTokens:0,thoughtsTokens:0};function pa(){const e=Se.getState().accessToken;if(e)return e;throw{httpCode:401,errorData:{code:"UNAUTHORIZED",message:"Access token is missing"}}}function fc({clientId:e}){return`/clients/${e}/copilot`}function ur({record:e,key:t}){const n=e[t];return typeof n!="string"?"":n}function Iy({record:e,key:t}){const n=e[t];if(n!==null&&typeof n=="string"&&n.trim()!=="")return n}function uo({record:e,key:t}){const n=e[t];return typeof n!="number"||Number.isNaN(n)?0:n}function u6({record:e,key:t}){const n=e[t];if(typeof n=="number"&&!Number.isNaN(n))return n}function x0({record:e,key:t}){const n=e[t];return n===null||typeof n!="string"||n.trim()===""?null:n}function Bv({record:e}){const t=u6({record:e,key:"dayUsagePercent"});if(t===void 0)return;const n=u6({record:e,key:"monthUsagePercent"});if(n!==void 0)return{dayUsagePercent:t,dayUsed:uo({record:e,key:"dayUsed"}),dayLimit:uo({record:e,key:"dayLimit"}),dayWindowStartedAt:x0({record:e,key:"dayWindowStartedAt"}),dayWindowResetsAt:x0({record:e,key:"dayWindowResetsAt"}),monthUsagePercent:n,monthUsed:uo({record:e,key:"monthUsed"}),monthLimit:uo({record:e,key:"monthLimit"}),monthWindowStartedAt:x0({record:e,key:"monthWindowStartedAt"}),monthWindowResetsAt:x0({record:e,key:"monthWindowResetsAt"})}}function NK({record:e}){return Bv({record:e})}function wK({record:e}){if(pt(e.quota))return NK({record:e.quota})}function eO({record:e}){const t={promptTokens:uo({record:e,key:"promptTokens"}),completionTokens:uo({record:e,key:"completionTokens"}),totalTokens:uo({record:e,key:"totalTokens"}),cachedTokens:uo({record:e,key:"cachedTokens"}),thoughtsTokens:uo({record:e,key:"thoughtsTokens"})},n=wK({record:e});return n===void 0?t:{...t,quota:n}}function RK({value:e}){return Array.isArray(e)?e:[]}function DK({value:e}){return e==="block"?"block":"document"}function kK({raw:e}){return pt(e.args)?e.args:{}}function OK({raw:e}){return pt(e.response)?e.response:{}}function PK({raw:e}){return pt(e.usage)?eO({record:e.usage}):TK}function LK({rawValue:e}){if(!pt(e))return;const t=e.type;if(typeof t=="string")return{type:t,params:MK({rawValue:e.params})}}function MK({rawValue:e}){return pt(e)?e:{}}function jK({rawValue:e}){return pt(e)?e.type!=="file_attachment"?e:!pt(e.payload)||ur({record:e.payload,key:"fileId"})===""?null:e:null}function tO({rawValue:e}){if(!Array.isArray(e)||e.length===0)return;const t=[];for(const n of e){const s=jK({rawValue:n});s!==null&&t.push(s)}if(t.length!==0)return t}function BK({rawValue:e}){return tO({rawValue:e})}function FK({rawValue:e}){if(!pt(e))return null;const t={label:ur({record:e,key:"label"}),pillText:ur({record:e,key:"pillText"}),isBack:e.isBack===!0};pt(e.pillPayload)&&(t.pillPayload=e.pillPayload);const n=BK({rawValue:e.extraPills});n!==void 0&&(t.extraPills=n);const s=LK({rawValue:e.link});return s!==void 0&&(t.link=s),t}function nO({rawValue:e}){if(!Array.isArray(e))return[];const t=[];for(const n of e){const s=FK({rawValue:n});s!==null&&t.push(s)}return t}function UK({rawValue:e}){const t={};if(!pt(e))return t;
834for(const[n,s]of Object.entries(e))pt(s)&&(t[n]=eO({record:s}));return t}function zK({raw:e,errorMessage:t}){try{return JSON.parse(e)}catch{throw{httpCode:500,errorData:{code:"INVALID_SSE_PAYLOAD",message:t}}}}function QK({eventType:e,data:t}){const n=zK({raw:t,errorMessage:`Failed to parse SSE payload for event "${e}"`});if(pt(n))return n;throw{httpCode:500,errorData:{code:"INVALID_SSE_PAYLOAD",message:`SSE payload for event "${e}" must be an object`}}}function HK({value:e}){return typeof e=="string"?`"${e}"`:typeof e=="number"?`${e}`:typeof e=="boolean"?`${e}`:Array.isArray(e)?JSON.stringify(e):e===null?"null":""}function VK({prefix:e,key:t}){return e===""?t:`${e}.${t}`}function Fv({payload:e,prefix:t=""}){const n=[];for(const[s,r]of Object.entries(e)){const i=VK({prefix:t,key:s});if(pt(r)){n.push(...Fv({payload:r,prefix:i}));continue}n.push({key:i,value:HK({value:r})})}return n}function GK({eventType:e,data:t}){if(e==="text")return{type:"text",text:t};const n=QK({eventType:e,data:t});return e==="session"?{type:"session",sessionId:ur({record:n,key:"sessionId"})}:e==="document_patch"?{type:"document_patch",documentId:ur({record:n,key:"documentId"}),documentVersion:uo({record:n,key:"documentVersion"}),patch:RK({value:n.patch}),scope:DK({value:n.scope})}:e==="document_meta_update"?{type:"document_meta_update",documentId:ur({record:n,key:"documentId"}),documentVersion:uo({record:n,key:"documentVersion"}),documentType:ur({record:n,key:"documentType"}),documentName:Iy({record:n,key:"documentName"})}:e==="chat_choice"?{type:"chat_choice",multi:n.multi===!0,options:nO({rawValue:n.options})}:e==="tool_call"?{type:"tool_call",author:ur({record:n,key:"author"}),id:ur({record:n,key:"id"}),name:ur({record:n,key:"name"}),args:kK({raw:n}),displayText:Iy({record:n,key:"displayText"})}:e==="tool_result"?{type:"tool_result",author:ur({record:n,key:"author"}),id:ur({record:n,key:"id"}),name:ur({record:n,key:"name"}),response:OK({raw:n}),displayText:Iy({record:n,key:"displayText"})}:e==="error"?{type:"error",code:ur({record:n,key:"code"}),message:ur({record:n,key:"message"})}:e==="log"?{type:"log",lines:Fv({payload:n})}:e==="done"?{type:"done",author:ur({record:n,key:"author"}),usage:PK({raw:n}),usageByAuthor:UK({rawValue:n.usageByAuthor})}:null}async function*sO({body:e,signal:t}){for await(const n of Zk({body:e,signal:t})){const s=GK({eventType:n.type,data:n.data});s!==null&&(yield s)}}function qK({body:e}){if(e!==void 0)return JSON.stringify(e)}async function rO({clientId:e,path:t,method:n="POST",body:s,signal:r}){const i=Ke(`${fc({clientId:e})}${t}`);return Xk({url:i,method:n,body:qK({body:s}),getAccessToken:pa,signal:r})}function WK({query:e}){return e.length===0?"":`?${e}`}const KK=rt(async function({signal:t}){const n=pa(),s=Ke("/copilot/block-menu/"),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`},signal:t});if(He(r))throw{httpCode:503,errorData:r.error};const i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};return $K({data:i.data})});function $K({data:e}){return Array.isArray(e)?e:pt(e)?Array.isArray(e.items)?e.items:[]:[]}const YK=rt(async function({clientId:t,signal:n}){const s=pa(),r=Ke(`${fc({clientId:t})}/sessions/`),i=await qe(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n});if(He(i))throw{httpCode:503,errorData:i.error};const o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data??[]}),XK=rt(async function({clientId:t,sessionId:n,numRecentEvents:s,afterTimestamp:r,signal:i}){const o=pa(),c=new URLSearchParams;s!==void 0&&c.set("numRecentEvents",String(s)),r!==void 0&&c.set("afterTimestamp",String(r));const u=WK({query:c.toString()}),d=Ke(`${fc({clientId:t})}/sessions/${n}/history/${u}`),p=await qe(d,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${o}`},signal:i});if(He(p))throw{httpCode:503,errorData:p.error};const g=await Ye(p);if(He(g))throw{httpCode:503,errorData:g.error};if(g.status==="error")throw{httpCode:p.status,errorData:g.error};if(g.data)return ZK({history:g.data});throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR",message:"Copilot session history response is empty"}}});function JK({rawEvent:e}){const t=tO({rawValue:e.pills});return t===void 0?e:{...e,pills:t}}function ZK({history:e}){const t=e.chatChoices,n=[];if(Array.isArray(t))for(const c of t)pt(c)&&typeof c.timestamp=="number"&&n.push({multi:c.multi===!0,timestamp:c.timestamp,options:nO({rawValue:c.options})});const s=e.logs,r=[];if(Array.isArray(s))for(const c of s){if(!pt(c))continue;const u=c.timestamp;if(typeof u!="number")continue;const d=Object.fromEntries(Object.entries(c).filter(([p])=>p!=="timestamp"));
834r.push({timestamp:u,lines:Fv({payload:d})})}const i=e.events.map(c=>JK({rawEvent:c})),o=(()=>{if(e.quota===null||!pt(e.quota))return null;const c=Bv({record:e.quota});return c===void 0?null:c})();return{...e,chatChoices:n,logs:r,events:i,quota:o}}async function*C0({clientId:e,body:t,signal:n}){const s=await rO({clientId:e,path:"/stream/",body:t,signal:n});yield*sO({body:s,signal:n})}async function*e$({clientId:e,sessionId:t,signal:n}){const s=await rO({clientId:e,path:`/sessions/${t}/stream/`,method:"GET",signal:n});yield*sO({body:s,signal:n})}const t$=rt(async function({clientId:t,documentId:n,file:s,signal:r}){const i=pa(),o=new FormData;o.append("file",s),o.append("documentId",n);const c=Ke(`${fc({clientId:t})}/uploads/`),u=await qe(c,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${i}`},body:o,signal:r});if(He(u))throw{httpCode:503,errorData:u.error};const d=await Ye(u);if(He(d))throw{httpCode:503,errorData:d.error};if(d.status==="error")throw{httpCode:u.status,errorData:d.error};if(!d.data?.id)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return d.data.id}),n$=rt(async function({signal:t}){const n=pa(),s=Ke("/copilot/quota/"),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`},signal:t});if(He(r))throw{httpCode:503,errorData:r.error};const i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!pt(i.data))throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};const o=Bv({record:i.data});if(o===void 0)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR",message:"Copilot quota response is invalid"}};return o}),s$=rt(async function({clientId:t,uploadId:n,signal:s}){const r=pa(),i=Ke(`${fc({clientId:t})}/uploads/${n}/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s});if(He(o))throw{httpCode:503,errorData:o.error};const c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data});function iO({error:e}){if(!pt(e)||!pt(e.errorData))return;const t=e.errorData.code;if(typeof t=="string")return t}function Sy({error:e}){const t=iO({error:e});return t==="COPILOT_INVALID_FILE_PILL"?h.molecules.chat.ERROR_INVALID_FILE_PILL:t==="COPILOT_QUOTA_EXCEEDED"?h.molecules.chat.ERROR_QUOTA_EXCEEDED:h.molecules.chat.ERROR_GENERIC}const MA=$n(e=>({blockMenu:void 0,isBlockMenuReady:!1,isBlockMenuError:!1,setBlockMenu:t=>e({blockMenu:t}),setIsBlockMenuReady:t=>e({isBlockMenuReady:t}),setIsBlockMenuError:t=>e({isBlockMenuError:t})})),vy={isInFlight:!1};async function oO(){if(vy.isInFlight)return;vy.isInFlight=!0;const{setBlockMenu:e,setIsBlockMenuReady:t,setIsBlockMenuError:n}=MA.getState();try{const s=await KK({});e(s),n(!1),t(!0)}catch{n(!0)}finally{vy.isInFlight=!1}}const r$=()=>{const e=Se(n=>n.accessToken),t=MA(n=>n.isBlockMenuReady);l.useEffect(()=>{e&&(t||oO())},[e,t])},i$=rt(async function({signal:t}){const n=Se.getState().accessToken,s=Ke("/defense-tree/"),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`},signal:t}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data}),Uv=rt(async function({clientId:t,defenseLineId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/defense-lines/${n}/defense-tree/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),o$=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/defense-lines/`),i=await qe(r,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data}),nf=$n(e=>({defenseTree:void 0,isDefenseTreeReady:!1,setDefenseTree:t=>e({defenseTree:t}),setIsDefenseTreeReady:t=>e({isDefenseTreeReady:t})})),a$=()=>{const e=Se(o=>o.accessToken),t=nf(o=>o.isDefenseTreeReady),n=nf(o=>o.setDefenseTree),s=nf(o=>o.setIsDefenseTreeReady),r=l.useRef(!1),{mutate:i}=tt({mutationFn:()=>i$({}),onSuccess(o){n(o),s(!0)},onError(){r.current=!1}});l.useEffect(()=>{e&&(t||r.current||(r.current=!0,i()))},[e,t,i])},l$=()=>{const e=Fe(),t=l.useRef(e.state?.isPreventScrollToTop??!1);l.useEffect(()=>{t.current=e.state?.isPreventScrollToTop??!1},[e.state]),l.useEffect(()=>{t.current||window.scrollTo({top:0,left:0})},[e.pathname,t])},jA={counterId:"3693405",scriptIdentifier:"tmr-code",scriptSource:"https://top-fwz1.mail.ru/js/code.js"},Sh={counterId:104671557,scriptSource:"https://mc.yandex.ru/metrika/tag.js",initializationOptions:{ssr:!0,webvisor:!0,clickmap:!0,ecommerce:"dataLayer",accurateTrackBounce
834:!0,trackLinks:!0}},aA=()=>typeof window<"u"&&typeof document<"u",aO=({scriptElement:e})=>{const t=document.getElementsByTagName("script");if(t.length===0){document.head.appendChild(e);return}const n=t.item(0);if(!n){document.head.appendChild(e);return}if(!n.parentNode){document.head.appendChild(e);return}n.parentNode.insertBefore(e,n)},c$=({counterId:e,scriptIdentifier:t,scriptSource:n})=>{window._tmr||(window._tmr=[]);const s=window.location.href,r=document.referrer;window._tmr.push({id:e,type:"pageView",start:Date.now(),url:s,ref:r});const i=document.getElementById(t);if(i)return i;const o=document.createElement("script");return o.id=t,o.type="text/javascript",o.async=!0,o.src=n,aO({scriptElement:o}),o},u$=({scriptIdentifier:e})=>{const t=document.getElementById(e);t?.parentNode&&t.parentNode.removeChild(t),window._tmr=void 0},d$=({counterId:e,scriptSource:t,initializationOptions:n})=>{if(!window.ym){const c=[],u=(...d)=>{c.push(d)};u.a=c,u.l=Date.now(),window.ym=u}const s=`${t}?id=${e}`,r=document.querySelector(`script[src="${s}"]`),i=window.ym;if(!i)return r;if(r)return i(e,"init",n),r;const o=document.createElement("script");return o.type="text/javascript",o.async=!0,o.src=s,aO({scriptElement:o}),i(e,"init",n),o},f$=({counterId:e,scriptSource:t})=>{window.ym&&window.ym(e,"destruct");const n=`${t}?id=${e}`;document.querySelectorAll(`script[src="${n}"]`).forEach(r=>{r.parentNode?.removeChild(r)}),window.ym=void 0},p$=({counterId:e,pageUrl:t,referrer:n})=>{window._tmr&&window._tmr.push({id:e,type:"pageView",start:Date.now(),url:t,ref:n??document.referrer})},h$=({counterId:e,goalId:t})=>{window._tmr&&window._tmr.push({id:e,type:"reachGoal",start:Date.now(),goal:t})},m$=({counterId:e,pageUrl:t})=>{const n=window.ym;n&&n(e,"hit",t)},g$=({counterId:e,goalId:t})=>{const n=window.ym;n&&n(e,"reachGoal",t)},A$=({pageUrl:e,referrer:t})=>{p$({counterId:jA.counterId,pageUrl:e,referrer:t}),m$({counterId:Sh.counterId,pageUrl:e})},E$=["/","/forgot-password","/forgot-password/sent","/sign-in","/sign-in/phone","/sign-in/sms","/sign-up","/sign-up/sms","/confirm-email","/setup-new-password","/setup-new-phone","/setup-new-phone/sms"],x$=e=>{const t=e.replace(/\/+$/,"");return t===""?"/":t},C$=()=>{const e=Se(u=>u.user),t=Se(u=>u.isUserLoadResolved),n=Fe(),s=l.useRef(!1),r=l.useRef(null),i=l.useMemo(()=>!!e?.id,[e?.id]),o=l.useMemo(()=>{const u=x$(n.pathname);return!!E$.some(p=>p===u)},[n.pathname]),c=()=>{u$({scriptIdentifier:jA.scriptIdentifier}),f$({counterId:Sh.counterId,scriptSource:Sh.scriptSource}),s.current=!1,r.current=null};return l.useEffect(()=>{aA()&&t&&(s.current||o&&(i||(c$(jA),d$(Sh),r.current=window.location.href,s.current=!0)))},[o,i,t]),l.useEffect(()=>{!aA()||!t||o&&!i||s.current&&c()},[o,i,t]),l.useEffect(()=>{if(!aA()||!t||!s.current||!o||i)return;const u=window.location.href;r.current!==u&&(A$({pageUrl:u,referrer:r.current}),r.current=u)},[o,i,t,n.pathname,n.search,n.hash]),{}},pf=({goalId:e})=>{aA()&&e&&(g$({counterId:Sh.counterId,goalId:e}),h$({counterId:jA.counterId,goalId:e}))},hs=e=>l.createElement("svg",{width:109,height:108,viewBox:"0 0 109 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.8819 12.8381C24.8163 17.7555 20.0174 25.4038 16.8838 30.5953C15.3551 33.128 13.81 35.6307 12.6403 38.4032C12.2584 39.3083 11.8255 40.1813 11.4334 41.0801C11.2838 41.4229 10.7162 42.0646 11.0441 42.1398C11.3371 42.2069 11.492 41.6865 11.7156 41.4594C13.3359 39.8135 15 38.2244 16.6502 36.6185C21.443 31.9544 26.2483 27.3156 31.1716 22.8321C35.7653 18.6488 40.2597 14.1208 45.0896 10.295C46.704 9.01617 48.2906 7.70137 49.9463 6.49143C51.9474 5.02901 49.5232 7.25493 49.1287 7.68491C39.0506 18.6684 30.9058 31.5444 21.7502 43.4671C18.0036 48.3461 13.7703 52.9194 10.4796 58.235C9.53459 59.7615 8.69501 61.3678 7.75437 62.8974C7.3974 63.4779 6.79227 64.121 6.50856 64.7713C6.4351 64.9397 6.85447 64.7792 6.99521 64.6821C9.50213 62.9521 11.8496 60.7913 14.217 58.8374C24.4162 50.4192 34.4683 41.7707 44.5445 33.1608C53.0512 25.8919 61.2773 18.0982 70.0251 11.2096C72.0083 9.6479 78.1738 5.34646 76.079 6.70336C75.6094 7.00751 74.5988 7.92026 74.3855 8.10877C71.472 10.6829 68.5728 13.2837 65.6843 15.8943C57.0588 23.6898 49.1122 32.1917 41.3035 41.0355C33.78 49.5564 26.0574 57.8783 18.6746 66.556C18.4835 66.7806 18.3074 66.9825 18.1588 67.2475C18.0764 67.3943 18.0004 67.4848 17.896 67.6044C17.1707 68.4357 19.6875 66.4587 20.5725 65.8644C41.8029 51.6079 62.9455 37.1306 82.9114 20.6348C83.0736 20.5008 83.2952 20.4296 83.3981 20.2332C83.8392 19.3907 82.0181 21.4033 81.3736 22.0513C75.3242 28.1344 69.483 34.4669 63.7572 40.9463C56.9992 48.5937 50.389 56.4273 43.4837 63.9013C41.076 66.5072 38.4677 68.824 36.038 71.3857C34.6341 72.8659 33.4756 74.6495 32.0476 76.0815C29.8207 78.3145 27.728 80.7167 25.5071 82.9524C24.2829 84.1848 22.9645 85.3111 21.5847 86.3098C21.0563 86.6923 20.5252 87.0758 20.0372 87.5256C19.7328 87.8062 18.7856 88.2949 19.1613 88.4179C19.4694 88.5188 19.772 88.185 20.0567 88.0163C23.6117 85.9101 27.0843 83.5573 30.5584 81.2905C42.1302 73.7399 53.7249 66.1637 65.0809 58.1904C70.6075 54.31 76.0673 50.2837 81.5196 46.2668C82.6189 45.4569 83.7166 44.5495 84.8775 43.8463C84.9862 43.7805 85.1052 43.7744 85.1695 43.6456C85.7493 42.4826 87.1717 41.5772 88.1088 40.8347C88.7181 40.3519 89.1758 39.9204 89.6855 39.2955C90.2976 38.5451 92.6573 36.0817 89.851 38.7043C79.978 47.9308 70.4379 57.5899 61.1877 67.6267C53.1354 76.364 45.0278 84.9601 36.5247 93.1249C33.9401 95.6067 31.3142 98.0331 28.7579 100.553C28.3196 100.986 27.0088 102.242 27.5315 101.959C29.5344 100.874 31.5543 99.1789 33.3712 97.8319C39.2311 93.4876 45.0095 89.0012 50.8125 84.5586C62.6372 75.506 74.4404 66.369 86.7656 58.2239C91.8769 54.8461 97.0566 51.6147 102.153 48.2076C103.759 47.1341 99.3459 51.0017 97.9195 52.368C88.8783 61.0286 80.0428 70.0175 71.7965 79.6731C67.6843 84.4882 63.9129 89.8298 59.3579 94.1288C58.309 95.1187 61.7604 92.6716 62.9396 91.898C69.4573 87.6222 75.9183 83.2367 82.308 78.7139C88.6034 74.2578 94.9713 69.792 100.985 64.8382C102.399 63.6739 98.3632 67.4633 97.0435 68.7645C92.0792 73.6592 87.5586 79.0111 82.8725 84.2463C79.0388 88.5292 75.1949 92.8081 71.2904 97.0065C70.1374 98.2463 69.0137 99.6203 67.7769 100.754C65.0512 103.253 73.5582 96.2698 76.4294 93.9949C79.4938 91.5668 82.5742 89.1761 85.7145 86.8786C86.329 86.429 86.9384 85.9696 87.5637 85.5401C87.9281 85.2899 88.7812 84.5851 88.7706 85.0717C88.7513 85.9571 87.7868 87.3539 87.4177 88.061C86.6884 89.4583 85.9541 90.8366 85.3252 92.2995C85.1806 92.6359 83.8212 95.4167 84.1183 95.7573",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("path",{d:"M43.9435 85.1499C46.3165 86.887 51.4108 88.8219 58.8355 83.6981C66.2601 78.5742 70.9965 67.7847 71.7645 65.8368C73.0446 66.2321 76.0827 66.2772 77.9944 63.2961C79.906 60.3149 79.2175 58.2428 78.6344 57.5794M44.4982 73.0195C44.4982 73.0195 48.5092 74.6408 52.5245 72.3521M43.9435 65.6674H36.9883C36.1612 65.6674 36.4662 65.1544 37.287 63.2961C38.9899 59.4405 42.3043 53.5343 42.6532 48.1786M42.6532 48.1786C42.6532 47.1069 41.6066 44.1538 37.0707 44.675C32.5349 45.1961 32.7096 54.4028 35.1518 55.9663C36.6626 56.9334 39.862 57.3559 41.3478 53.9535M42.6532 48.1786H46.8024M46.8024 48.1786C45.407 51.1023 45.0565 57.2968 48.5092 58.3982C55.3879 60.5924 59.1984 49.2448 54.6528 46.4742M46.8024 48.1786C48.0601 45.5435 51.6871 45.0224 54.6528 46.4742M54.6528 46.4742H70.7831M70.7831 46.4742C70.7831 49.216 71.8072 50.1266 73.7274 50.1266M70.7831 46.4742C71.3947 44.3887 72.251 39.5147 70.7831 36.7029C68.9483 33.1882 64.8081 28.5707 58.0774 28.5707C50.3289 28.5707 49.4566 34.947 41.3478 34.947C32.1862 34.947 29.6093 27.4405 35.1517 24.3507C40.4754 21.3829 49.4581 20.8763 51.1146 24.8716",stroke:"black",strokeWidth:4})),y$=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_14370_78964)"},l.createElement("path",{d:"M7.41524 1.0875C7.75171 0.743175 8.1536 0.469576 8.5973 0.282779C9.04101 0.0959817 9.51757 -0.000244141 9.99899 -0.000244141C10.48
83404 -0.000244141 10.957 0.0959817 11.4007 0.282779C11.8444 0.469576 12.2463 0.743175 12.5827 1.0875L13.3602 1.885L14.4727 1.87125C14.9543 1.86555 15.4321 1.9562 15.8782 2.13786C16.3242 2.31952 16.7294 2.58853 17.0699 2.92907C17.4105 3.26961 17.6795 3.67481 17.8611 4.12083C18.0428 4.56685 18.1334 5.04469 18.1277 5.52625L18.1152 6.63875L18.9102 7.41625C19.2546 7.75271 19.5282 8.15461 19.715 8.59831C19.9018 9.04201 19.998 9.51858 19.998 10C19.998 10.4814 19.9018 10.958 19.715 11.4017C19.5282 11.8454 19.2546 12.2473 18.9102 12.5838L18.114 13.3613L18.1277 14.4738C18.1334 14.9553 18.0428 15.4332 17.8611 15.8792C17.6795 16.3252 17.4105 16.7304 17.0699 17.0709C16.7294 17.4115 16.3242 17.6805 15.8782 17.8621C15.4321 18.0438 14.9543 18.1345 14.4727 18.1288L13.3602 18.1163L12.5827 18.9113C12.2463 19.2556 11.8444 19.5292 11.4007 19.716C10.957 19.9028 10.4804 19.999 9.99899 19.999C9.51757 19.999 9.04101 19.9028 8.5973 19.716C8.1536 19.5292 7.75171 19.2556 7.41524 18.9113L6.63774 18.115L5.52524 18.1288C5.04368 18.1345 4.56584 18.0438 4.11982 17.8621C3.6738 17.6805 3.26861 17.4115 2.92807 17.0709C2.58753 16.7304 2.31852 16.3252 2.13685 15.8792C1.95519 15.4332 1.86454 14.9553 1.87024 14.4738L1.88274 13.3613L1.08774 12.5838C0.743419 12.2473 0.46982 11.8454 0.283023 11.4017C0.0962258 10.958 0 10.4814 0 10C0 9.51858 0.0962258 9.04201 0.283023 8.59831C0.46982 8.15461 0.743419 7.75271 1.08774 7.41625L1.88399 6.63875L1.87024 5.52625C1.86454 5.04469 1.95519 4.56685 2.13685 4.12083C2.31852 3.67481 2.58753 3.26961 2.92807 2.92907C3.26861 2.58853 3.6738 2.31952 4.11982 2.13786C4.56584 1.9562 5.04368 1.86555 5.52524 1.87125L6.63774 1.88375L7.41524 1.0875ZM8.75149 13.75C8.75149 13.9142 8.78383 14.0767 8.84664 14.2284C8.90946 14.38 9.00154 14.5178 9.11761 14.6339C9.23368 14.75 9.37148 14.842 9.52314 14.9049C9.6748 14.9677 9.83734 15 10.0015 15C10.1656 15 10.3282 14.9677 10.4798 14.9049C10.6315 14.842 10.7693 14.75 10.8854 14.6339C11.0014 14.5178 11.0935 14.38 11.1563 14.2284C11.2192 14.0767 11.2515 13.9142 11.2515 13.75C11.2515 13.4185 11.1198 13.1005 10.8854 12.8661C10.651 12.6317 10.333 12.5 10.0015 12.5C9.66997 12.5 9.35203 12.6317 9.11761 12.8661C8.88319 13.1005 8.75149 13.4185 8.75149 13.75ZM10.754 11.2163C10.804 10.5488 11.0015 10.1975 11.8115 9.64125C12.654 9.0475 13.124 8.27875 13.124 7.15875C13.124 5.5025 11.974 4.375 10.2965 4.375C9.02149 4.375 8.05649 4.99 7.67149 5.9875C7.55447 6.25982 7.49571 6.55362 7.49899 6.85C7.49899 7.34125 7.75274 7.65 8.18024 7.65C8.52024 7.65 8.74899 7.46625 8.88524 7.0125C9.08274 6.2725 9.54149 5.86875 10.2277 5.86875C10.9902 5.86875 11.5152 6.42625 11.5152 7.22375C11.5152 7.9275 11.2552 8.33 10.4877 8.88C9.71399 9.42125 9.33024 10.0225 9.33024 10.93V11.0688C9.33024 11.6038 9.59024 12 10.0615 12C10.4815 12 10.6915 11.7 10.754 11.2163Z",fill:"currentColor"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_14370_78964"},l.createElement("rect",{width:20,height:20,fill:"white"})))),b$=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19628_5020)"},l.createElement("path",{d:"M0 3.66667C0 2.5621 0.89543 1.66667 2 1.66667H5.16667C7.37581 1.66667 9.16667 3.45753 9.16667 5.66667V18.3333H2C0.895432 18.3333 0 17.4379 0 16.3333V3.66667Z",fill:"currentColor"}),l.createElement("path",{d:"M10.8359 5.66667C10.8359 3.45753 12.62
83468 1.66667 14.8359 1.66667H18.0026C19.1072 1.66667 20.0026 2.5621 20.0026 3.66667V16.3333C20.0026 17.4379 19.1072 18.3333 18.0026 18.3333H10.8359V5.66667Z",fill:"currentColor"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19628_5020"},l.createElement("rect",{width:20,height:20,fill:"white"})))),zv=({iconVariant:e="help",onClick:t,label:n,className:s,...r})=>{const[i,o]=l.useState(!1),[c,u]=l.useState(!1),d=i&&c;l.useEffect(()=>{const E=window.matchMedia("(hover: hover)");o(E.matches);const x=y=>{o(y.matches)};return E.addEventListener("change",x),()=>{E.removeEventListener("change",x)}},[]);const p=l.useCallback(()=>{u(!0)},[]),g=l.useCallback(()=>{u(!1)},[]),A=l.useMemo(()=>e==="help"?a.jsx(y$,{className:"size-5 shrink-0"}):e==="legalBase"?a.jsx(b$,{className:"size-5 shrink-0"}):null,[e]);return a.jsxs("button",{type:"button",onClick:t,onMouseEnter:p,onMouseLeave:g,className:Y("flex items-center overflow-hidden rounded-full cursor-pointer text-[#556FD5] roboto-flex-100-600-1 bg-white shadow-[0px_4px_8px_0px_#0000000F,0px_0px_4px_0px_#0000000A]","py-[14px] pl-[14px]",i&&"transition-[padding-right] duration-300 ease-in-out",!!d&&"pr-[18px]",!d&&"pr-[14px]",s),...r,children:[A,a.jsx("span",{className:Y("overflow-hidden whitespace-nowrap text-[14px] leading-[20px]",i&&"transition-[max-width,margin,opacity] duration-300 ease-in-out",!!d&&"max-w-[200px] ml-2 opacity-100",!d&&"max-w-0 ml-0 opacity-0"),children:n})]})},pc=e=>!(typeof e!="object"||e===null),lO=e=>pc(e)?e:{},nc=({value:e})=>typeof e=="string"?e:"",G1=({value:e})=>
834{if(typeof e=="string")return e},I$=({state:e})=>pc(e)?{returnToPath:G1({value:e.returnToPath}),returnToSearch:nc({value:e.returnToSearch}),returnToHash:nc({value:e.returnToHash}),returnToState:e.returnToState}:{},S$=({path:e})=>!!(e==="/clients"||e.startsWith("/clients/")),v$=({pathname:e,search:t,hash:n,state:s})=>({...lO(s),returnToPath:e,returnToSearch:t,returnToHash:n,returnToState:s,isPreventScrollToTop:!0}),sf=({state:e})=>pc(e)?{returnToPath:G1({value:e.returnToPath}),returnToSearch:nc({value:e.returnToSearch}),returnToHash:nc({value:e.returnToHash}),returnToState:e.returnToState,isPreventScrollToTop:!0}:{isPreventScrollToTop:!0},q1=({state:e})=>{if(pc(e))return G1({value:e.legalBaseArticleReturnPath})},cO=({state:e})=>{if(!pc(e))return;const t=e.legalBaseGlobalSearchQuery;if(typeof t=="string"&&t.trim())return t},uO=({state:e})=>{if(!pc(e))return;const t=e.legalBaseCategorySearchQuery;if(typeof t=="string"&&t.trim())return t},dO=({state:e,returnPath:t,searchQuery:n})=>{const s={...sf({state:e}),legalBaseArticleReturnPath:t};return n?.trim()&&(t==="/legal-base"&&(s.legalBaseGlobalSearchQuery=n.trim()),t.startsWith("/legal-base/")&&(s.legalBaseCategorySearchQuery=n.trim())),s},_$=({pathname:e})=>{const t=e.split("/").filter(Boolean);return t[0]!=="legal-base"?"/legal-base":t.length>=2?`/legal-base/${t[1]}`:"/legal-base"},Qv=({pathname:e,state:t})=>{const n=q1({state:t});if(n?.startsWith("/legal-base/")){const r=n.split("/").filter(Boolean);return r.length!==2||r[0]!=="legal-base"?void 0:n}const s=e.split("/").filter(Boolean);if(s.length===3&&s[0]==="legal-base")return`/legal-base/${s[1]}`},T$=({pathname:e,state:t})=>{if(!e.startsWith("/legal-base/"))return!1;const n=e.split("/").filter(Boolean);return!(n.length!==3||n[0]!=="legal-base"||!Qv({pathname:e,state:t}))},N$=({pathname:e,state:t})=>{if(e==="/legal-base"||!e.startsWith("/legal-base/"))return!1;const n=e.split("/").filter(Boolean);return!(n.length!==3||n[0]!=="legal-base"||q1({state:t})!=="/legal-base")},w$=({search:e,hash:t,state:n,key:s})=>({pathname:"/legal-base",search:e,hash:t,state:{...Hv({state:n}),legalBaseIsGlobalSearchArticleOpen:!0},key:s}),R$=({returnPath:e,search:t,hash:n,state:s,key:r})=>({pathname:e,search:t,hash:n,state:{...Hv({state:s}),legalBaseIsCategoryArticleOpen:!0},key:r}),Hv=({state:e})=>{if(!pc(e))return{isPreventScrollToTop:!0};const t={returnToPath:G1({value:e.returnToPath}),returnToSearch:nc({value:e.returnToSearch}),returnToHash:nc({value:e.returnToHash}),returnToState:e.returnToState,isPreventScrollToTop:!0},n=q1({state:e}),s=cO({state:e}),r=uO({state:e});return n==="/legal-base"&&s&&(t.legalBaseGlobalSearchQuery=s),n?.startsWith("/legal-base/")&&r&&(t.legalBaseCategorySearchQuery=r),t},D$=({baseId:e,state:t})=>{if(e)return{to:"/legal-base",state:sf({state:t})};if(!pc(t))return{to:"/clients",state:{isPreventScrollToTop:!0}};const n=t.returnToPath;if(typeof n=="string"&&S$({path:n})){const s=t.returnToState,r=lO(s),i=nc({value:t.returnToSearch}),o=nc({value:t.returnToHash});return{to:`${n}${i}${o}`,state:{...r,isPreventScrollToTop:!0}}}return{to:"/clients",state:{isPreventScrollToTop:!0}}},k$=()=>{const e=at(),t=Fe(),n=l.useCallback(()=>{e("/legal-base",{state:v$({pathname:t.pathname,search:t.search,hash:t.hash,state:t.state})})},[t.pathname,t.search,t.hash,t.state,e]);return a.jsx("div",{className:"fixed bottom-4 left-4 z-22",children:a.jsx(zv,{label:h.clients.layout.buttons.LEGAL_BASE,iconVariant:"legalBase",onClick:n})})},d6=/^\/legal-base(\/.*)?\/?$/,O$=({children:e})=>{mK(),fK(),Xq(),dK(),lK(),xK(),r$(),a$(),l$(),C$();const t=Fe(),n=Se(i=>i.user),s=l.useMemo(()=>d6.test(t.pathname)?!0:/^\/clients\/archived\/?$/.test(t.pathname)||/^\/clients\/[^/]+\/?$/.test(t.pathname)?!1:!!/^\/clients\/[^/]+\/.+/.test(t.pathname),[t.pathname]),r=l.useMemo(()=>!(!n?.id||Lv({user:n})||d6.test(t.pathname)),[n,t.pathname]);return a.jsxs(a.Fragment,{children:[!!s&&a.jsx("div",{className:"block bp48:hidden h-screen",children:a.jsxs("div",{className:Y("flex flex-1 bp48:flex-0 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-center mx-4 bp48:mx-0 h-full flex-1"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3.5 text-center",children:h.clients.messages.NOT_READY_YET})]})}),a.jsxs("div",{className:Y(!!s&&"hidden bp48:block"),children:[e,r&&a.jsx(k$,{})]})]})},wI=({lines:e,brClassName:t,brClassNamesList:n})=>a.jsx(a.Fragment,{children:e.map((s,r)=>{const i=Y(t,n?.[r]);return a.jsxs(Oe.Fragment,{children:[s,r<e.length-1&&a.jsxs(a.Fragment,{children:[a.jsx("br",{className:i})," "]})]},r)})}),P$=()=>a.jsx("div",{"data-requires-vh-stable":!0,className:Y("relative","h-auto","pt-[376px]","bp50:h-[583.2px]","bp50:pt-[61.2px]","bp62_5:h-[729px]","bp62_5:pt-[76.5px]","bp81_5:h-[972px]","bp81_5:pt-[102px]"),children:a.jsxs("div",{className:Y("flex","flex-col","text-center","[@media(max-height:41.5rem)]:translate-y-0","[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:translate-y-[calc(var(--vh-stable)*50-332px)]","bp34_375:[@media(min-height:56.25rem)]:translate-y-0","[@media(min-height:56.3125rem)]:translate-y-0","bp50:text-left","bp50:translate-y-0","bp50:[@media(max-height:41.5rem)]:translate-y-0","bp50:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:[@supports(height:100dvh)]:translate-y-0","bp50:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:translate-y-0","bp62_5:text-left","bp62_5:translate-y-0","bp62_5:[@media(max-height:41.5rem)]:translate-y-0","bp62_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:[@supports(height:100dvh)]:translate-y-0","bp62_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:translate-y-0","bp81_5:text-left","bp81_5:translate-y-0","bp81_5:[@media(max-height:41.5rem)]:translate-y-0","bp81_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:[@supports(height:100dvh)]:translate-y-0","bp81_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:translate-y-0"),children:[a.jsx("div",{className:Y("w-full","text-[48px]","leading-[44px]","roboto-flex-64-600-0","text-neutral-50","uppercase","bp50:w-[445.2px]","bp50:text-[76.8px]","bp50:leading-[69.6px]","bp62_5:w-[556.5px]","bp62_5:text-[96px]","bp62_5:leading-[87px]","bp81_5:w-[742px]","bp81_5:text-[128px]","bp81_5:leading-[116px]"),children:a.jsx(wI,{lines:h.main.intro.TITLE})}),a.jsx("div",{className:Y("w-full","mt-4","text-[18px]","leading-[22px]","roboto-flex-112-500-0","text-zinc-500","bp50:w-[420px]","bp50:mt-[12.6p
834x]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:text-zinc-100","bp62_5:w-[525px]","bp62_5:mt-[15.75px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:text-zinc-100","bp81_5:w-[700px]","bp81_5:mt-5.25","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:text-zinc-100"),children:a.jsx(wI,{lines:h.main.intro.SUBTITLE,brClassNamesList:["block","block bp50:hidden","block bp50:hidden"]})}),a.jsx(Je,{to:"/book-demo",onClick:()=>{pf({goalId:"button_book_demo_intro"})},className:Y("cursor-pointer","max-w-[312px]","flex","items-center","justify-center","rounded-full","bg-[#556FD5]","hover:bg-[#708DFE]","min-h-12","w-full","mt-4","roboto-flex-112-600-0","text-white","text-[14px]","leading-[18px]","bp34_375:max-w-none","bp34_375:w-[328px]","bp34_375: mx-auto","bp50:mx-0","bp50:mt-7","bp50:w-[252px]","bp50:min-h-[45.6px]","bp62_5:mt-9","bp62_5:min-h-[57px]","bp62_5:text-[18px]","bp62_5:leading-[21px]","bp81_5:w-[333px]","bp81_5:min-h-19","bp81_5:text-[24px]","bp81_5:leading-[28px]"),children:h.main.intro.callToAction.DEMO})]})});function L$({computeValue:e,subscribe:t,isEnabled:n=!0,waitMilliseconds:s=150}){const[r,i]=l.useState(null),o=l.useRef(!1),c=l.useMemo(()=>ol(()=>{if(!o.current)return;const d=e();i(d)},s),[e,s]);return l.useEffect(()=>{if(o.current=!0,!n)return()=>{o.current=!1,c.cancel()};c();const u=t?t(c):void 0;return()=>{o.current=!1,c.cancel(),u&&u()}},[n,t,c]),r}function fO({waitMilliseconds:e=150}={}){const t=l.useMemo(()=>()=>typeof window<"u"?window.innerWidth:null,[]),n=l.useMemo(()=>r=>{if(!(typeof window<"u"))return()=>{};const o=()=>{r()};return window.addEventListener("resize",o,{passive:!0}),()=>{window.removeEventListener("resize",o)}},[]);return L$({computeValue:t,subscribe:n,isEnabled:!0,waitMilliseconds:e})}const M$=8e3,j$=600,jo=600,f6=400,y0="cubic-bezier(0, 0, 0.2, 1)",B$=24,F$=2e4,U$=2e3,z$=({title:e,elements:t})=>{const n=fO({waitMilliseconds:250}),s=l.useRef([]),r=l.useRef([]),[i,o]=l.useState(0),[c,u]=l.useState(null),d=l.useRef(0),p=l.useRef(null),[g,A]=l.useState(!0),E=l.useRef(!0),x=l.useRef(null),y=l.useRef(!1),I=l.useRef(null),v=l.useRef(null),S=l.useRef(!1),b=l.useRef(!1),w=l.useRef([]),_=l.useRef([]),N=l.useCallback(()=>{r.current.forEach(P=>{P&&(P.style.height="0%",P.classList.remove("visible"),P.classList.add("invisible"))})},[]),R=l.useCallback((P,B)=>{const F=w.current[P];if(!F)return Promise.resolve();_.current[P]?.cancel();const z=F.scrollHeight;F.style.height="0px";const Q=F.animate([{height:"0px"},{height:`${z}px`}],{duration:B??jo,easing:y0,fill:"forwards"});return _.current[P]=Q,Q.finished.then(()=>{F.style.height="auto"}).catch(()=>{})},[]),D=l.useCallback((P,B)=>{const F=w.current[P];if(!F)return Promise.resolve();_.current[P]?.cancel();const z=F.offsetHeight;F.style.height=`${z}px`;const Q=F.animate([{height:`${z}px`},{height:"0px"}],{duration:B??jo,easing:y0,fill:"forwards"});return _.current[P]=Q,Q.finished.then(()=>{F.style.height="0px"}).catch(()=>{})},[]),k=l.useCallback((P,B,F)=>{const z=s.current[P],Q=r.current[P];if(!z||!Q||z.clientHeight===0)return;p.current?.cancel(),N(),u(P),Q.style.transformOrigin="top";const W=window.getComputedStyle(Q).minHeight,H=Number.parseFloat(W),j=Number.isNaN(H)?B$:H;Q.style.minHeight=`${j}px`,Q.style.height="0%";const q=Q.animate([{height:"0%"},{height:"100%"}],{duration:B??M$,easing:F??y0,fill:"forwards"});p.current=q,q.finished.then(()=>{if(!E.current){Q.style.height="100%";return}u(null);const G=P+1;if(!(G<t.length)){d.current=0,o(0);const J=P,ne=0;J!==ne&&(D(J,jo),R(ne,jo)),k(0);return}D(P,jo),R(G,jo),o(G),k(G)}).catch(()=>{})},[t.length,N,D,R]),L=l.useCallback(P=>{if(I.current=Date.now(),v.current!==null&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{const F=d.current??0,z=F+1<t.length?F+1:0;A(!0),E.current=!0,o(z),D(F,jo),R(z,jo),k(z)},F$),P===d.current){A(!1),E.current=!1;return}p.current?.cancel(),A(!1),E.current=!1;const B=d.current;B!==P&&D(B,f6),R(P,f6),o(P),k(P,j$,y0)},[D,R,k,t.length]);l.useEffect(()=>{d.current=i},[i]),l.useEffect(()=>{E.current=g},[g]),l.useEffect(()=>{if(n===null)return;N();const P=()=>{const B=x.current;if(!B)return;const F=B.getBoundingClientRect(),z=window.innerHeight||document.documentElement.clientHeight,Q=F.top+F.height/2,M=Q>=0&&Q<=z;if(F.bottom<=0||F.top>=z){if(!y.current||S.current)return;S.current=!0;const W=d.current??0;p.current?.cancel(),A(!1),E.current=!1;const H=w.current[W];H&&(_.current[W]?.cancel(),H.style.height="auto");const j=r.current[W];j&&(j.style.height="100%"),u(null),b.current=!0,v.current!==null&&(window.clearTimeout(v.current),v.current=null);return}if(S.current=!1,!y.current&&M){A(!0),E.current=!0,o(0);const W=w.current[0];W&&(W.style.height="auto"),k(0),p.current&&(y.current=!0);return}if(M&&b.current){b.current=!1;const W=d.current??0,H=W+1<t.length?W+1:0;v.current!==null&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{A(!0),E.current=!0,o(H),D(W,jo),R(H,jo),k(H)},U$)}};return window.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P),P(),()=>{window.removeEventListener("scroll",P),window.removeEventListener("resize",P),p.current?.cancel(),v.current!==null&&(window.clearTimeout(v.current),v.current=null)}}
834,[t.length,N,k,D,R,n]);const O=l.useMemo(()=>t.map((P,B)=>({element:P,elementIndex:B,isActive:i===B,isAnimating:c===B})),[i,c,t]);return a.jsxs("div",{className:Y("flex","items-start","justify-between","gap-23.5","h-213","bp50:gap-[56.4px]","bp50:h-[511.2px]","bp62_5:gap-[70.5px]","bp62_5:h-[639px]","bp81_5:gap-23.5","bp81_5:h-213"),children:[a.jsx("div",{ref:P=>{x.current=P},className:Y("relative","overflow-hidden","bp50:h-[352.8px]","bp50:w-[352.8px]","bp62_5:h-[441px]","bp62_5:w-[441px]","bp81_5:h-147","bp81_5:w-147"),children:O.map(({element:P,elementIndex:B,isActive:F})=>a.jsx("div",{className:Y("absolute","inset-0","transition-opacity","duration-500","pointer-events-none","rounded-[48px]",!!F&&"opacity-100 delay-0",!F&&"opacity-0 delay-[50ms]"),style:{backgroundImage:`url(${P.imageUrl})`,backgroundRepeat:"no-repeat",backgroundSize:"contain",backgroundPosition:"left top"}},B))}),a.jsxs("div",{className:Y("flex-1","w-full","h-213","pt-2.5","bp50:h-[511.2px]","bp50:pt-[6px]","bp62_5:h-[639px]","bp62_5:pt-[7.5px]","bp81_5:h-213","bp81_5:pt-2.5"),children:[a.jsx("div",{className:Y("roboto-flex-64-600-0","uppercase","text-zinc-100","text-[96px]","leading-[96px]","bp50:text-[57.6px]","bp50:leading-[57.6px]","bp62_5:text-[72px]","bp62_5:leading-[72px]","bp81_5:text-[96px]","bp81_5:leading-[96px]"),children:e}),a.jsx("div",{className:Y("mt-12.75"),children:O.map(({element:P,elementIndex:B,isActive:F,isAnimating:z})=>a.jsxs("div",{className:Y("relative","group","first:pt-0","cursor-pointer","pb-6","pt-6","pl-9","bp50:pb-[14.4px]","bp50:pt-[14.4px]","bp50:pl-[16.2px]","bp62_5:pb-4.5","bp62_5:pt-4.5","bp62_5:pl-6.75","bp81_5:pb-6","bp81_5:pt-6","bp81_5:pl-9"),onClick:()=>{L(B)},children:[a.jsx("div",{ref:Q=>{s.current[B]=Q},className:Y("absolute","rounded-full","bg-zinc-700","left-0","w-1","group-first:top-1.5","top-7.5","bottom-7.5","bp50:w-[2.4px]","bp50:group-first:top-[3.6px]","bp50:top-[18px]","bp50:bottom-[18px]","bp62_5:w-0.75","bp62_5:group-first:top-[4.5px]","bp62_5:top-[22.5px]","bp62_5:bottom-[22.5px]","bp81_5:w-1","bp81_5:group-first:top-1.5","bp81_5:top-7.5","bp81_5:bottom-7.5"),children:a.jsx("div",{ref:Q=>{r.current[B]=Q},className:Y("absolute","top-0","left-0","bg-zinc-100","rounded-full","invisible","group-hover:visible","min-h-6",!!F&&"visible",!!z&&"visible","bp50:w-[2.4px]","bp50:min-h-[14.4px]","bp62_5:w-0.75","bp62_5:m
834in-h-4.5","bp81_5:w-1","bp81_5:min-h-6"),style:{height:"0%"}})}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-50","text-[32px]","leading-[36px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:P.title}),a.jsx("div",{className:"overflow-hidden",style:{height:B===0?"auto":"0px"},ref:Q=>{w.current[B]=Q},children:a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","mt-6","text-[32px]","leading-[36px]","bp50:mt-[14.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:mt-4.5","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:mt-6","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:P.description})})]},B))})]})]})},RI=new Map;function Q$({url:e,onLoad:t}){if(!e)return;if(RI.get(e)){t();return}const n=new Image;n.decoding="async",n.onload=()=>{RI.set(e,!0),t()},n.onerror=()=>{},n.src=e}function pO({url:e}){const[t,n]=l.useState(e),s=l.useRef(e),r=l.useRef(!0);return l.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),l.useEffect(()=>{if(e){if(s.current=e,RI.get(e)){t!==e&&n(e);return}Q$({url:e,onLoad:()=>{r.current&&s.current===e&&n(e)}})}},[e,t]),t}const H$=({title:e,imageUrl:t,description:n})=>{const s=pO({url:t});return a.jsxs("div",{className:Y("flex","flex-col","overflow-hidden","bg-zinc-900","w-[312px]","h-[520px]","rounded-[24px]"),children:[a.jsx("div",{className:Y("pointer-events-none","w-[312px]","h-[312px]","min-w-[312px]","min-h-[312px]","rounded-[24px]"),style:{backgroundImage:`url(${s})`,backgroundRepeat:"no-repeat",backgroundSize:"contain",backgroundPosition:"left top"}}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-100","mt-6","mx-4","text-[18px]","leading-[22px]"),children:e}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","flex-1","mt-3","mx-4","text-[18px]","leading-[22px]"),children:n})]})},V$=({centerIndex:e,elements:t,targetCount:n})=>l.useMemo(()=>{if(t.length===0)return[];const r=Math.floor(n/2),i=t.length,o=c=>{const u=c-r,d=((e+u)%i+i)%i;return t[d]};return Array.from({length:n}).map((c,u)=>o(u))},[t,e,n]),Vv=({onSettled:e,onStarted:t,stableEpsilonPx:n=.5,stableQuietMs:s=600,isEnabled:r=!0,elementRef:i,autoAttachListeners:o=!0})=>{const c=l.useRef(null),u=l.useRef(0),d=l.useRef(0),p=l.useRef(!1),g=l.useRef(!0),A=l.useRef(t),E=l.useRef(0);A.current=t;const x=l.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),y=l.useCallback(()=>{if(!r)return;const b=()=>{const _=i?i.current:null;if(!_)return;const N=performance.now(),R=_.scrollLeft,D=_.scrollTop,k=Math.abs(R-u.current),L=Math.abs(D-d.current);if(Math.max(k,L)>n&&(E.current=N),u.current=R,d.current=D,E.current===0&&(E.current=N),N-E.current>=s&&!p.current&&!g.current){g.current=!0,x(),e();return}c.current=requestAnimationFrame(b)};if(c.current!==null)return;const w=i?i.current:null;w&&(u.current=w.scrollLeft,d.current=w.scrollTop,E.current=performance.now(),c.current=requestAnimationFrame(b))},[x,r,e,i,n,s]),I=l.useCallback(()=>{r&&(g.current&&A.current&&A.current(),g.current=!1,E.current=performance.now(),y())},[r,y]),v=l.useCallback(()=>{r&&(p.current=!0,g.current&&A.current&&A.current(),g.current=!1,E.current=performance.now(),x())},[x,r]),S=l.useCallback(()=>{r&&(p.current=!1,y())},[r,y]);l.useEffect(()=>()=>{x()},[x]),l.useEffect(()=>{if(!o||!r)return;const b=i?i.current:null;if(!b)return;const w=()=>{v()},_=()=>{S()},N=()=>{v()},R=()=>{v()},D=()=>{v()},k=()=>{S()},L=()=>{S()},O=()=>{v()},P=()=>{I()};return b.addEventListener("pointerdown",w,{passive:!0}),b.addEventListener("pointerup",_,{passive:!0}),b.addEventListener("pointercancel",N,{passive:!0}),b.addEventListener("touchstart",R,{passive:!0}),b.addEventListener("mousedown",D,{passive:!0}),b.addEventListener("touchcancel",O,{passive:!0}),window.addEventListener("mouseup",k,{passive:!0}),window.addEventListener("touchend",L,{passive:!0}),b.addEventListener("scroll",P,{passive:!0}),()=>{b.removeEventListener("pointerdown",w),b.removeEventListener("pointerup",_),b.removeEventListener("pointercancel",N),b.removeEventListener("touchstart",R),b.removeEventListener("mousedown",D),b.removeEventListener("touchcancel",O),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",L),b.removeEventListener("scroll",P)}},[o,i,v,S,I,r])},_y=21,G$=.5,p6=300,q$=({stableViewportClientWidth:e,title:t,elements:n})=>{const[s,r]=l.useState(0),[i,o]=l.useState(null),[c,u]=l.useState(null),[d,p]=l.useState(null),[g,A]=l.useState(null),E=l.useRef(null),x=l.useRef(null),y=l.useRef(null),I=l.useRef(!1),v=l.useRef(0),S=l.useRef(null),b=l.useMemo(()=>e===null||!Number.isFinite(e)?null:g===null||e<=g?0:(e-g)/2,[e,g]),w=V$({centerIndex:s,elements:n,targetCount:_y}),_=l.useMemo(()=>
834{if(b===null||i===null||c===null||d===null)return 0;const k=b+d,L=Math.ceil(k/(i+c));return k-L*(i+c)},[b,i,c,d]),N=l.useCallback(()=>{if(b===null||!E.current||i===null||c===null)return;const k=Math.ceil(b/(i+c)),L=(_y-1)/2;E.current.scrollLeft=(L-k)*(i+c)},[b,i,c]),R=l.useCallback(()=>{if(I.current=!1,v.current>0){v.current=v.current-1;return}const k=E.current,L=n.length;if(!k||L===0||b===null||i===null||c===null)return;const O=Math.ceil(b/(i+c)),P=Math.round(k.scrollLeft/(i+c)),B=O+P,F=-((_y-1)/2-B);F&&(Wn.flushSync(()=>{r(z=>((F+z)%L+L)%L)}),v.current=2,S.current&&(clearTimeout(S.current),S.current=null),S.current=window.setTimeout(()=>{S.current=null,v.current=0},p6*3),N())},[N,b,n.length,i,c]),D=l.useCallback(()=>{I.current=!0},[]);return l.useEffect(()=>()=>{S.current&&(clearTimeout(S.current),S.current=null)},[]),Vv({onSettled:R,onStarted:D,stableEpsilonPx:G$,stableQuietMs:p6,isEnabled:!0,elementRef:E,autoAttachListeners:!0}),l.useEffect(()=>{const k=x.current;if(!k)return;const L=window.getComputedStyle(k),O=Number.parseFloat(L.width),P=(L.gap||L.columnGap||"0px").trim(),B=Number.parseFloat(P),F=Number.parseFloat((L.marginLeft||"0px").trim());Number.isNaN(O)||o(O),Number.isNaN(B)||u(B),Number.isNaN(F)||p(F)},[e]),l.useEffect(()=>{const k=y.current;if(!k)return;const L=window.getComputedStyle(k),O=(L.maxWidth||"0px").trim(),P=Number.parseFloat(O);if(!Number.isNaN(P)){A(P);return}const B=Number.parseFloat((L.width||"0px").trim());Number.isNaN(B)||A(B)},[e]),l.useEffect(()=>{N()},[N]),a.jsxs("div",{className:"relative mb-24",children:[a.jsx("div",{ref:x,className:Y("flex","h-0","mx-0","gap-3","w-[312px]")}),a.jsx("div",{ref:y,className:Y("w-full","mx-auto","max-w-[312px]","px-0"),children:a.jsx("div",{className:Y("roboto-flex-64-600-0","text-zinc-100","uppercase","text-[40px]","leading-[40px]"),children:t})}),a.jsx("div",{className:Y("relative","h-[520px]","mt-10"),style:{marginLeft:_,marginRight:_},children:b!==null&&a.jsx("div",{ref:E,className:Y("flex","gap-3","overflow-x-auto","overflow-y-hidden","[overscroll-behavior-x:contain]","snap-x","snap-mandatory","[-webkit-overflow-scrolling:touch]","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden","scroll-pl-[324px]"),children:w.map((k,L)=>a.jsx("div",{"data-index":L+1,className:"shrink-0 snap-start",children:a.jsx(H$,{...k},k.title)},L))})})]})},W$="/assets/defenseStrategy-1-CsU9MwST.webp",K$="/assets/defenseStrategy-2-B3SJ0HYL.webp",$$="/assets/defenseStrategy-3-D5SsfdM-.webp",Y$="/assets/fabulizer-1-CslOugwQ.webp",X$="/assets/fabulizer-2-BPRVNTHI.webp",J$="/assets/practice-1-CkkY2JN8.webp",Z$="/assets/practice-2-Cecy2w39.webp",eY="/assets/practice-3-CaDlpbId.webp",tY="/assets/practice-4-DO2JEOaa.webp",nY=()=>l.useMemo(()=>[{title:h.main.features.items[0].TITLE,elements:[{title:h.main.features.items[0].elements[0].TITLE,description:h.main.features.items[0].elements[0].DESCRIPTION,imageUrl:W$},{title:h.main.features.items[0].elements[1].TITLE,description:h.main.features.items[0].elements[1].DESCRIPTION,imageUrl:K$},{title:h.main.features.items[0].elements[2].TITLE,description:h.main.features.items[0].elements[2].DESCRIPTION,imageUrl:$$}]},{title:h.main.features.items[1].TITLE,elements:[{title:h.main.features.items[1].elements[0].TITLE,description:h.main.features.items[1].elements[0].DESCRIPTION,imageUrl:J$},{title:h.main.features.items[1].elements[1].TITLE,description:h.main.features.items[1].elements[1].DESCRIPTION,imageUrl:Z$},{title:h.main.features.items[1].elements[2].TITLE,description:h.main.features.items[1].elements[2].DESCRIPTION,imageUrl:eY},{title:h.main.features.items[1].elements[3].TITLE,description:h.main.features.items[1].elements[3].DESCRIPTION,imageUrl:tY}]},{title:h.main.features.items[2].TITLE,elements:[{title:h.main.features.items[2].elements[0].TITLE,description:h.main.features.items[2].elements[0].DESCRIPTION,imageUrl:Y$},{title:h.main.features.items[2].elements[1].TITLE,description:h.main.features.items[2].elements[1].DESCRIPTION,imageUrl:X$}]}],[]),sY=({stableViewportClientWidth:e})=>{const t=nY();return e?e<800?a.jsx("div",{"data-requires-vh-stable":!0,className:Y("mt-[198px]","[@media(max-height:41.5rem)]:mt-24","[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:mt-[calc(var(--vh-stable)*100-546px)]","[@media(min-height:56.3125rem)]:mt-24","overflow-hidden"),children:t.map((n,s)=>a.jsx(q$,{...n,stableViewportClientWidth:e},s))}):a.jsx("div",{className:Y("mt-64","bp50:mt-[98.4px]","bp62_5:mt-[123px]","bp81_5:mt-41"),children:t.map((n,s)=>a.jsx(z$,{...n},s))}):a.jsx("div",{className:Y("mt-[198px]","[@media(max-height:41.5rem)]:mt-24","[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:mt-[calc(var(--vh)*100-546px)]","[@media(min-height:56.3125rem)]:mt-24","h-[2128px]","bp50:mt-[98.4px]","bp50:h-[1533.59px]","bp50:[@media(max-height:41.5rem)]:mt-[98.4px]","bp50:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:mt-[98.4px]","bp50:[@media(min-height:56.3125rem)]:mt-[98.4px]","bp62_5:mt-[123px]","bp62_5:h-[1917px]","bp62_5:[@media(max-height:41.5rem)]:mt-[
834123px]","bp62_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:mt-[123px]","bp62_5:[@media(min-height:56.3125rem)]:mt-[123px]","bp81_5:mt-41","bp81_5:h-[2555.990px]","bp81_5:[@media(max-height:41.5rem)]:mt-41","bp81_5:[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:mt-41","bp81_5:[@media(min-height:56.3125rem)]:mt-41")})},hO=6048e5,rY=864e5,W1=6e4,K1=36e5,iY=1e3,h6=Symbol.for("constructDateFrom");function Un(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&h6 in e?e[h6](t):e instanceof Date?new e.constructor(t):new Date(t)}function cn(e,t){return Un(t||e,e)}function Wa(e,t,n){const s=cn(e,n?.in);return isNaN(t)?Un(n?.in||e,NaN):(t&&s.setDate(s.getDate()+t),s)}function oY(e,t,n){const s=cn(e,n?.in);if(isNaN(t))return Un(e,NaN);if(!t)return s;const r=s.getDate(),i=Un(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(s.setFullYear(i.getFullYear(),i.getMonth(),r),s)}function Yp(e,t,n){const{years:s=0,months:r=0,weeks:i=0,days:o=0,hours:c=0,minutes:u=0,seconds:d=0}=t,p=cn(e,n?.in),g=r||s?oY(p,r+s*12):p,A=o||i?Wa(g,o+i*7):g,E=u+c*60,y=(d+E*60)*1e3;return Un(e,+A+y)}let aY={};function Lu(){return aY}
834function na(e,t){const n=Lu(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=cn(e,t?.in),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function hf(e,t){return na(e,{...t,weekStartsOn:1})}function mO(e,t){const n=cn(e,t?.in),s=n.getFullYear(),r=Un(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const i=hf(r),o=Un(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const c=hf(o);return n.getTime()>=i.getTime()?s+1:n.getTime()>=c.getTime()?s:s-1}function BA(e){const t=cn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ha(e,...t){const n=Un.bind(null,e||t.find(s=>typeof s=="object"));return t.map(n)}function tu(e,t){const n=cn(e,t?.in);return n.setHours(0,0,0,0),n}function gO(e,t,n){const[s,r]=ha(n?.in,e,t),i=tu(s),o=tu(r),c=+i-BA(i),u=+o-BA(o);return Math.round((c-u)/rY)}function lY(e,t){const n=mO(e,t),s=Un(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),hf(s)}function vh(e,t){const n=+cn(e)-+cn(t);return n<0?-1:n>0?1:n}function AO(e){return Un(e,Date.now())}function Gv(e,t,n){const[s,r]=ha(n?.in,e,t);return+tu(s)==+tu(r)}function cY(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mu(e){return!(!cY(e)&&typeof e!="number"||isNaN(+cn(e)))}function uY(e,t,n){const[s,r]=ha(n?.in,e,t),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function dY(e,t,n){const[s,r]=ha(n?.in,e,t);return s.getFullYear()-r.getFullYear()}function fY(e,t,n){const[s,r]=ha(n?.in,e,t),i=m6(s,r),o=Math.abs(gO(s,r));s.setDate(s.getDate()-i*o);const c=+(m6(s,r)===-i),u=i*(o-c);return u===0?0:u}function m6(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function qv(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function pY(e,t,n){const[s,r]=ha(n?.in,e,t),i=(+s-+r)/K1;return qv(n?.roundingMethod)(i)}function EO(e,t){return+cn(e)-+cn(t)}function hY(e,t,n){const s=EO(e,t)/W1;return qv(n?.roundingMethod)(s)}function mY(e,t){const n=cn(e,t?.in);return n.setHours(23,59,59,999),n}function gY(e,t){const n=cn(e,t?.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function AY(e,t){const n=cn(e,t?.in);return+mY(n,t)==+gY(n,t)}function EY(e,t,n){const[s,r,i]=ha(n?.in,e,e,t),o=vh(r,i),c=Math.abs(uY(r,i));if(c<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*c);let u=vh(r,i)===-o;AY(s)&&c===1&&vh(s,i)===1&&(u=!1);const d=o*(c-+u);return d===0?0:d}function xY(e,t,n){const s=EO(e,t)/1e3;return qv(n?.roundingMethod)(s)}function CY(e,t,n){const[s,r]=ha(n?.in,e,t),i=vh(s,r),o=Math.abs(dY(s,r));s.setFullYear(1584),r.setFullYear(1584);const c=vh(s,r)===-i,u=i*(o-+c);return u===0?0:u}function yY(e,t){const[n,s]=ha(e,t.start,t.end);return{start:n,end:s}}function bY(e,t){const n=cn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const IY={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},SY=(e,t,n)=>{let s;const r=IY[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function rf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_Y={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},NY={date:rf({formats:vY,defaultWidth:"full"}),time:rf({formats:_Y,defaultWidth:"full"}),dateTime:rf({formats:TY,defaultWidth:"full"})},wY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},RY=(e,t,n,s)=>wY[e];function Vo(e){return(t,n)=>{const s=n?.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):o;r=e.formattingValues[c]||e.formattingValues[o]}else{const o=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return r[i]}}const DY={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kY={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OY={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},PY={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
834ay","Saturday"]},LY={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},MY={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jY=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},BY={ordinalNumber:jY,era:Vo({values:DY,defaultWidth:"wide"}),quarter:Vo({values:kY,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vo({values:OY,defaultWidth:"wide"}),day:Vo({values:PY,defaultWidth:"wide"}),dayPeriod:Vo({values:LY,defaultWidth:"wide",formattingValues:MY,defaultFormattingWidth:"wide"})};function Go(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const o=i[0],c=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?UY(c,g=>g.test(o)):FY(c,g=>g.test(o));let d;d=e.valueCallback?e.valueCallback(u):u,d=n.valueCallback?n.valueCallback(d):d;const p=t.slice(o.length);return{value:d,rest:p}}}function FY(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function UY(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function xO(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const c=t.slice(r.length);return{value:o,rest:c}}}const zY=/^(\d+)(th|st|nd|rd)?/i,QY=/\d+/i,HY={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},VY={any:[/^b/i,/^(a|c)/i]},GY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qY={any:[/1/i,/2/i,/3/i,/4/i]},WY={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},KY={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$Y={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},YY={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},XY={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},JY={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ZY={ordinalNumber:xO({matchPattern:zY,parsePattern:QY,valueCallback:e=>parseInt(e,10)}),era:Go({matchPatterns:HY,defaultMatchWidth:"wide",parsePatterns:VY,defaultParseWidth:"any"}),quarter:Go({matchPatterns:GY,defaultMatchWidth:"wide",parsePatterns:qY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Go({matchPatterns:WY,defaultMatchWidth:"wide",parsePatterns:KY,defaultParseWidth:"any"}),day:Go({matchPatterns:$Y,defaultMatchWidth:"wide",parsePatterns:YY,defaultParseWidth:"any"}),dayPeriod:Go({matchPatterns:XY,defaultMatchWidth:"any",parsePatterns:JY,defaultParseWidth:"any"})},$1={code:"en-US",formatDistance:SY,formatLong:NY,formatRelative:RY,localize:BY,match:ZY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function eX(e,t){const n=cn(e,t?.in);return gO(n,bY(n))+1}function CO(e,t){const n=cn(e,t?.in),s=+hf(n)-+lY(n);return Math.round(s/hO)+1}function Wv(e,t){const n=cn(e,t?.in),s=n.getFullYear(),r=Lu(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=Un(t?.in||e,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const c=na(o,t),u=Un(t?.in||e,0);u.setFullYear(s,0,i),u.setHours(0,0,0,0);const d=na(u,t);return+n>=+c?s+1:+n>=+d?s:s-1}function tX(e,t){const n=Lu(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Wv(e,t),i=Un(t?.in||e,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),na(i,t)}function yO(e,t){const n=cn(e,t?.in),s=+na(n,t)-+tX(n,t);return Math.round(s/hO)+1}function En(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Fl={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return En(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):En(n+1,2)},d(e,t){return En(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return En(e.getHours()%12||12,t.length)},H(e,t){return En(e.getHours(),t.length)},m(e,t){return En(e.getMinutes(),t.length)},s(e,t){return En(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return En(r,t.length)}},Ld={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},g6={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>
vendor: 8,580 bytes, line 834
8340?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Fl.y(e,t)},Y:function(e,t,n,s){const r=Wv(e,s),i=r>0?r:1-r;if(t==="YY"){const o=i%100;return En(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):En(i,t.length)},R:function(e,t){const n=mO(e);return En(n,t.length)},u:function(e,t){const n=e.getFullYear();return En(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return En(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return En(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Fl.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return En(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=yO(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):En(r,t.length)},I:function(e,t,n){const s=CO(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):En(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fl.d(e,t)},D:function(e,t,n){const s=eX(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):En(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return En(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return En(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return En(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=Ld.noon:s===0?r=Ld.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=Ld.evening:s>=12?r=Ld.afternoon:s>=4?r=Ld.morning:r=Ld.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Fl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fl.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):En(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):En(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fl.s(e,t)},S:function(e,t){return Fl.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return E6(s);case"XXXX":case"XX":return Gc(s);default:return Gc(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return E6(s);case"xxxx":case"xx":return Gc(s);default:return Gc(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+A6(s,":");default:return"GMT"+Gc(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+A6(s,":");default:return"GMT"+Gc(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return En(s,t.length)},T:function(e,t,n){return En(+e,t.length)}};function A6(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+t+En(i,2)}function E6(e,t){return e%60===0?(e>0?"-":"+")+En(Math.abs(e)/60,2):Gc(e,t)}function Gc(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=En(Math.trunc(s/60),2),i=En(s%60,2);return n+r+t+i}const x6=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},bO=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},nX=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return x6(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",x6(s,t)).replace("{{time}}",bO(r,t))},DI={p:bO,P:nX},sX=/^D+$/,rX=/^Y+$/,iX=["D","DD","YY","YYYY"];function IO(e){return sX.test(e)}function SO(e){return rX.test(e)}function kI(e,t,n){const s=oX(e,t,n);if(console.warn(s),iX.includes(e))throw new RangeError(s)}function oX(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const aX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cX=/^'([^]*?)'?$/,uX=/''/g,dX=/[a-zA-Z]/;function is(e,t,n){const s=Lu(),r=n?.locale??s.locale??$1,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=cn(e,n?.in);if(!Mu(c))throw new RangeError("Invalid time value");let u=t.match(lX).map(p=>{const g=p[0];if(g==="p"||g==="P"){const A=DI[g];return A(p,r.formatLong)}return p}).join("").match(aX).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:fX(p)};if(g6[g])return{isToken:!0,value:p};
834if(g.match(dX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(u=r.localize.preprocessor(c,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return u.map(p=>{if(!p.isToken)return p.value;const g=p.value;(!n?.useAdditionalWeekYearTokens&&SO(g)||!n?.useAdditionalDayOfYearTokens&&IO(g))&&kI(g,t,String(e));const A=g6[g[0]];return A(c,g,r.localize,d)}).join("")}function fX(e){const t=e.match(cX);return t?t[1].replace(uX,"'"):e}const pX=["years","months","weeks","days","hours","minutes","seconds"];function vO(e,t){const n=Lu(),s=t?.locale??n.locale??$1,r=t?.format??pX,i=t?.zero??!1,o=t?.delimiter??" ";return s.formatDistance?r.reduce((u,d)=>{const p=`x${d.replace(/(^.)/,A=>A.toUpperCase())}`,g=e[d];return g!==void 0&&(i||e[d])?u.concat(s.formatDistance(p,g)):u},[]).join(o):""}function hX(){return Object.assign({},Lu())}function mX(e,t){const n=cn(e,t?.in).getDay();return n===0?7:n}function gX(e,t){const{start:n,end:s}=yY(t?.in,e),r={},i=CY(s,n);i&&(r.years=i);const o=Yp(n,{years:r.years}),c=EY(s,o);c&&(r.months=c);const u=Yp(o,{months:r.months}),d=fY(s,u);d&&(r.days=d);const p=Yp(u,{days:r.days}),g=pY(s,p);g&&(r.hours=g);const A=Yp(p,{hours:r.hours}),E=hY(s,A);E&&(r.minutes=E);const x=Yp(A,{minutes:r.minutes}),y=xY(s,x);return y&&(r.seconds=y),r}function AX(e,t){const n=EX(t)?new t(0):Un(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function EX(e){return typeof e=="function"&&e.prototype?.constructor===e}const xX=10;class _O{subPriority=0;validate(t,n){return!0}}class CX extends _O{constructor(t,n,s,r,i){super(),this.value=t,this.validateValue=n,this.setValue=s,this.priority=r,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,s){return this.setValue(t,n,this.value,s)}}class yX extends _O{priority=xX;subPriority=-1;constructor(t,n){super(),this.context=t||(s=>Un(n,s))}set(t,n){return n.timestampIsSet?t:Un(t,AX(t,this.context))}}class un{run(t,n,s,r){const i=this.parse(t,n,s,r);return i?{setter:new CX(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,s){return!0}}class bX extends un{priority=140;parse(t,n,s){switch(n){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,n,s){return n.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const ds={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},qo={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function fs(e,t){return e&&{value:t(e.value),rest:e.rest}}function qn(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Wo(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const s=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:s*(r*K1+i*W1+o*iY),rest:t.slice(n[0].length)}}function TO(e){return qn(ds.anyDigitsSigned,e)}function ls(e,t){switch(e){case 1:return qn(ds.singleDigit,t);case 2:return qn(ds.twoDigits,t);case 3:return qn(ds.threeDigits,t);case 4:return qn(ds.fourDigits,t);default:return qn(new RegExp("^\\d{1,"+e+"}"),t)}}function FA(e,t){switch(e){case 1:return qn(ds.singleDigitSigned,t);case 2:return qn(ds.twoDigitsSigned,t);case 3:return qn(ds.threeDigitsSigned,t);case 4:return qn(ds.fourDigitsSigned,t);default:return qn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Kv(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function NO(e,t){const n=t>0,s=n?t:1-t;let r;if(s<=50)r=e||100;else{const i=s+50,o=Math.trunc(i/100)*100,c=e>=i%100;r=e+o-(c?100:0)}return n?r:1-r}function wO(e){return e%400===0||e%4===0&&e%100!==0}class IX extends un{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,s){const r=i=>({year:i,isTwoDigitYear:n==="yy"});switch(n){case"y":return fs(ls(4,t),r);case"yo":return fs(s.ordinalNumber(t,{unit:"year"}),r);default:return fs(ls(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s){const r=t.getFullYear();if(s.isTwoDigitYear){const o=NO(s.year,r);return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}const i=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}}class SX extends un{priority=130;parse(t,n,s){const r=i=>({year:i,isTwoDigitYear:n==="YY"});switch(n){case"Y":return fs(ls(4,t),r);case"Yo":return fs(s.ordinalNumber(t,{unit:"year"}),r);default:return fs(ls(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,s,r){const i=Wv(t,r);
834if(s.isTwoDigitYear){const c=NO(s.year,i);return t.setFullYear(c,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),na(t,r)}const o=!("era"in n)||n.era===1?s.year:1-s.year;return t.setFullYear(o,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),na(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class vX extends un{priority=130;parse(t,n){return FA(n==="R"?4:n.length,t)}set(t,n,s){const r=Un(t,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),hf(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class _X extends un{priority=130;parse(t,n){return FA(n==="u"?4:n.length,t)}set(t,n,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class TX extends un{priority=120;parse(t,n,s){switch(n){case"Q":case"QQ":return ls(n.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class NX extends un{priority=120;parse(t,n,s){switch(n){case"q":case"qq":return ls(n.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class wX extends un{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,s){const r=i=>i-1;switch(n){case"M":return fs(qn(ds.month,t),r);case"MM":return fs(ls(2,t),r);case"Mo":return fs(s.ordinalNumber(t,{unit:"month"}),r);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class RX extends un{priority=110;parse(t,n,s){const r=i=>i-1;switch(n){case"L":return fs(qn(ds.month,t),r);case"LL":return fs(ls(2,t),r);case"Lo":return fs(s.ordinalNumber(t,{unit:"month"}),r);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function DX(e,t,n){const s=cn(e,n?.in),r=yO(s,n)-t;return s.setDate(s.getDate()-r*7),cn(s,n?.in)}class kX extends un{priority=100;parse(t,n,s){switch(n){case"w":return qn(ds.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return ls(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s,r){return na(DX(t,s,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function OX(e,t,n){const s=cn(e,n?.in),r=CO(s,n)-t;return s.setDate(s.getDate()-r*7),s}class PX extends un{priority=100;parse(t,n,s){switch(n){case"I":return qn(ds.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return ls(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,s){return hf(OX(t,s))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const LX=[31,28,31,30,31,30,31,31,30,31,30,31],MX=[31,29,31,30,31,30,31,31,30,31,30,31];
834class jX extends un{priority=90;subPriority=1;parse(t,n,s){switch(n){case"d":return qn(ds.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return ls(n.length,t)}}validate(t,n){const s=t.getFullYear(),r=wO(s),i=t.getMonth();return r?n>=1&&n<=MX[i]:n>=1&&n<=LX[i]}set(t,n,s){return t.setDate(s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class BX extends un{priority=90;subpriority=1;parse(t,n,s){switch(n){case"D":case"DD":return qn(ds.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return ls(n.length,t)}}validate(t,n){const s=t.getFullYear();return wO(s)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function $v(e,t,n){const s=Lu(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=cn(e,n?.in),o=i.getDay(),u=(t%7+7)%7,d=7-r,p=t<0||t>6?t-(o+d)%7:(u+d)%7-(o+d)%7;return Wa(i,p,n)}class FX extends un{priority=90;parse(t,n,s){switch(n){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,r){return t=$v(t,s,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class UX extends un{priority=90;parse(t,n,s,r){const i=o=>{const c=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return fs(ls(n.length,t),i);case"eo":return fs(s.ordinalNumber(t,{unit:"day"}),i);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,r){return t=$v(t,s,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class zX extends un{priority=90;parse(t,n,s,r){const i=o=>{const c=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return fs(ls(n.length,t),i);case"co":return fs(s.ordinalNumber(t,{unit:"day"}),i);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,s,r){return t=$v(t,s,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function QX(e,t,n){const s=cn(e,n?.in),r=mX(s,n),i=t-r;return Wa(s,i,n)}class HX extends un{priority=90;parse(t,n,s){const r=i=>i===0?7:i;switch(n){case"i":case"ii":return ls(n.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return fs(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return fs(s.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return fs(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r);default:return fs(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,s){return t=QX(t,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class VX extends un{priority=80;parse(t,n,s){switch(n){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Kv(s),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class GX extends un{priority=80;
834parse(t,n,s){switch(n){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Kv(s),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class qX extends un{priority=80;parse(t,n,s){switch(n){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,s){return t.setHours(Kv(s),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class WX extends un{priority=70;parse(t,n,s){switch(n){case"h":return qn(ds.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return ls(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,s){const r=t.getHours()>=12;return r&&s<12?t.setHours(s+12,0,0,0):!r&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class KX extends un{priority=70;parse(t,n,s){switch(n){case"H":return qn(ds.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return ls(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,s){return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class $X extends un{priority=70;parse(t,n,s){switch(n){case"K":return qn(ds.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return ls(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class YX extends un{priority=70;parse(t,n,s){switch(n){case"k":return qn(ds.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return ls(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,s){const r=s<=24?s%24:s;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class XX extends un{priority=60;parse(t,n,s){switch(n){case"m":return qn(ds.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return ls(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setMinutes(s,0,0),t}incompatibleTokens=["t","T"]}class JX extends un{priority=50;parse(t,n,s){switch(n){case"s":return qn(ds.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return ls(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,s){return t.setSeconds(s,0),t}incompatibleTokens=["t","T"]}class ZX extends un{priority=30;parse(t,n){const s=r=>Math.trunc(r*Math.pow(10,-n.length+3));return fs(ls(n.length,t),s)}set(t,n,s){return t.setMilliseconds(s),t}incompatibleTokens=["t","T"]}class eJ extends un{priority=10;parse(t,n){switch(n){case"X":return Wo(qo.basicOptionalMinutes,t);case"XX":return Wo(qo.basic,t);case"XXXX":return Wo(qo.basicOptionalSeconds,t);case"XXXXX":return Wo(qo.extendedOptionalSeconds,t);default:return Wo(qo.extended,t)}}set(t,n,s){return n.timestampIsSet?t:Un(t,t.getTime()-BA(t)-s)}incompatibleTokens=["t","T","x"]}class tJ extends un{priority=10;parse(t,n){switch(n){case"x":return Wo(qo.basicOptionalMinutes,t);case"xx":return Wo(qo.basic,t);case"xxxx":return Wo(qo.basicOptionalSeconds,t);case"xxxxx":return Wo(qo.extendedOptionalSeconds,t);default:return Wo(qo.extended,t)}}set(t,n,s){return n.timestampIsSet?t:Un(t,t.getTime()-BA(t)-s)}incompatibleTokens=["t","T","X"]}class nJ extends un{priority=40;parse(t){return TO(t)}set(t,n,s){return[Un(t,s*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class sJ extends un{priority=20;parse(t){return TO(t)}set(t,n,s){return[Un(t,s),{timestampIsSet:!0}]}incompatibleTokens="*"}const rJ={G:new bX,y:new IX,Y:new SX,R:new vX,u:new _X,Q:new TX,q:new NX,M:new wX,L:new RX,w:new kX,I:new PX,d:new jX,D:new BX,E:new FX,e:new UX,c:new zX,i:new HX,a:new VX,b:new GX,B:new qX,h:new WX,H:new KX,K:new $X,k:new YX,m:new XX,s:new JX,S:new ZX,X:new eJ,x:new tJ,t:new nJ,T:new sJ},iJ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oJ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aJ=/^'([^]*?)'?$/,lJ=/''/g,cJ=/\S/,uJ=/[a-zA-Z]/;function Fs(e,t,n,s){const r=()=>Un(s?.in||n,NaN),i=hX(),o=s?.locale??i.locale??$1,c=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,u=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0;if(!t)return e?r():cn(n,s?.in);const d={firstWeekContainsDate:c,weekStartsOn:u,locale:o},p=[new yX(s?.in,n)],g=t.match(oJ).map(I=>{const v=I[0];if(v in DI){const S=DI[v];return S(I,o.formatLong)}return I}).join("").match(iJ),A=[];for(let I of g){!s?.useAdditionalWeekYearTokens&&SO(I)&&kI(I,t,e),!s?.useAdditionalDayOfYearTokens&&IO(I)&&kI(I,t,e);const v=I[0],S=rJ[v];if(S){const{incompatibleTokens:b}=S;if(Array.isArray(b)){const _=A.find(N=>b.includes(N.token)||N.token===v);
834if(_)throw new RangeError(`The format string mustn't contain \`${_.fullToken}\` and \`${I}\` at the same time`)}else if(S.incompatibleTokens==="*"&&A.length>0)throw new RangeError(`The format string mustn't contain \`${I}\` and any other token at the same time`);A.push({token:v,fullToken:I});const w=S.run(e,I,o.match,d);if(!w)return r();p.push(w.setter),e=w.rest}else{if(v.match(uJ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");if(I==="''"?I="'":v==="'"&&(I=dJ(I)),e.indexOf(I)===0)e=e.slice(I.length);else return r()}}if(e.length>0&&cJ.test(e))return r();const E=p.map(I=>I.priority).sort((I,v)=>v-I).filter((I,v,S)=>S.indexOf(I)===v).map(I=>p.filter(v=>v.priority===I).sort((v,S)=>S.subPriority-v.subPriority)).map(I=>I[0]);let x=cn(n,s?.in);if(isNaN(+x))return r();const y={};for(const I of E){if(!I.validate(x,d))return r();const v=I.set(x,y,d);Array.isArray(v)?(x=v[0],Object.assign(y,v[1])):x=v}return x}function dJ(e){return e.match(aJ)[1].replace(lJ,"'")}function C6(e,t,n){const[s,r]=ha(n?.in,e,t);return+na(s,n)==+na(r,n)}function fJ(e,t){return Gv(Un(e,e),AO(e))}function RO(e,t,n){return Wa(e,-t,n)}function pJ(e,t){return Gv(Un(e,e),RO(AO(e),1))}function hJ(e,t){const n=()=>Un(t?.in,NaN),r=EJ(e);let i;if(r.date){const d=xJ(r.date,2);i=CJ(d.restDateString,d.year)}if(!i||isNaN(+i))return n();const o=+i;let c=0,u;if(r.time&&(c=yJ(r.time),isNaN(c)))return n();if(r.timezone){if(u=bJ(r.timezone),isNaN(u))return n()}else{const d=new Date(o+c),p=cn(0,t?.in);return p.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),p.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),p}return cn(o+c+u,t?.in)}const b0={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mJ=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,gJ=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,AJ=/^([+-])(\d{2})(?::?(\d{2}))?$/;function EJ(e){const t={},n=e.split(b0.dateTimeDelimiter);let s;if(n.length>2)return t;if(/:/.test(n[0])?s=n[0]:(t.date=n[0],s=n[1],b0.timeZoneDelimiter.test(t.date)&&(t.date=e.split(b0.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){const r=b0.timezone.exec(s);r?(t.time=s.replace(r[1],""),t.timezone=r[1]):t.time=s}return t}function xJ(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=e.match(n);if(!s)return{year:NaN,restDateString:""};const r=s[1]?parseInt(s[1]):null,i=s[2]?parseInt(s[2]):null;return{year:i===null?r:i*100,restDateString:e.slice((s[1]||s[2]).length)}}function CJ(e,t){if(t===null)return new Date(NaN);const n=e.match(mJ);if(!n)return new Date(NaN);const s=!!n[4],r=Xp(n[1]),i=Xp(n[2])-1,o=Xp(n[3]),c=Xp(n[4]),u=Xp(n[5])-1;if(s)return TJ(t,c,u)?IJ(t,c,u):new Date(NaN);{const d=new Date(0);return!vJ(t,i,o)||!_J(t,r)?new Date(NaN):(d.setUTCFullYear(t,i,Math.max(r,o)),d)}}function Xp(e){return e?parseInt(e):1}function yJ(e){const t=e.match(gJ);if(!t)return NaN;const n=Ty(t[1]),s=Ty(t[2]),r=Ty(t[3]);return NJ(n,s,r)?n*K1+s*W1+r*1e3:NaN}function Ty(e){return e&&parseFloat(e.replace(",","."))||0}function bJ(e){if(e==="Z")return 0;const t=e.match(AJ);if(!t)return 0;const n=t[1]==="+"?-1:1,s=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return wJ(s,r)?n*(s*K1+r*W1):NaN}function IJ(e,t,n){const s=new Date(0);s.setUTCFullYear(e,0,4);const r=s.getUTCDay()||7,i=(t-1)*7+n+1-r;return s.setUTCDate(s.getUTCDate()+i),s}const SJ=[31,null,31,30,31,30,31,31,30,31,30,31];function DO(e){return e%400===0||e%4===0&&e%100!==0}function vJ(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(SJ[t]||(DO(e)?29:28))}function _J(e,t){return t>=1&&t<=(DO(e)?366:365)}function TJ(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function NJ(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function wJ(e,t){return t>=0&&t<=59}function Jp(e,t){if(e.one!==void 0&&t===1)return e.one;const n=t%10,s=t%100;return n===1&&s!==11?e.singularNominative.replace("{{count}}",String(t)):n>=2&&n<=4&&(s<10||s>20)?e.singularGenitive.replace("{{count}}",String(t)):e.pluralGenitive.replace("{{count}}",String(t))}function yr(e){return(t,n)=>n?.addSuffix?n.comparison&&n.comparison>0?e.future?Jp(e.future,t):"через "+Jp(e.regular,t):e.past?Jp(e.past,t):Jp(e.regular,t)+" назад":Jp(e.regular,t)}const RJ={lessThanXSeconds:yr({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:yr({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(e,t)=>
834t?.addSuffix?t.comparison&&t.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:yr({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:yr({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:yr({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:yr({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:yr({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:yr({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:yr({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:yr({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:yr({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:yr({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:yr({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:yr({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:yr({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}}
834)},DJ=(e,t,n)=>RJ[e](t,n),kJ={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},OJ={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},PJ={any:"{{date}}, {{time}}"},LJ={date:rf({formats:kJ,defaultWidth:"full"}),time:rf({formats:OJ,defaultWidth:"full"}),dateTime:rf({formats:PJ,defaultWidth:"any"})},Yv=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function MJ(e){const t=Yv[e];switch(e){case 0:return"'в прошлое "+t+" в' p";case 1:case 2:case 4:return"'в прошлый "+t+" в' p";case 3:case 5:case 6:return"'в прошлую "+t+" в' p"}}function y6(e){const t=Yv[e];return e===2?"'во "+t+" в' p":"'в "+t+" в' p"}function jJ(e){const t=Yv[e];switch(e){case 0:return"'в следующее "+t+" в' p";case 1:case 2:case 4:return"'в следующий "+t+" в' p";case 3:case 5:case 6:return"'в следующую "+t+" в' p"}}const BJ={lastWeek:(e,t,n)=>{const s=e.getDay();return C6(e,t,n)?y6(s):MJ(s)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(e,t,n)=>{const s=e.getDay();return C6(e,t,n)?y6(s):jJ(s)},other:"P"},FJ=(e,t,n,s)=>{const r=BJ[e];return typeof r=="function"?r(t,n,s):r},UJ={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},zJ={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},QJ={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},HJ={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},VJ={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},GJ={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},qJ={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},WJ=(e,t)=>{const n=Number(e),s=t?.unit;let r;return s==="date"?r="-е":s==="week"||s==="minute"||s==="second"?r="-я":r="-й",n+r},KJ={ordinalNumber:WJ,era:Vo({values:UJ,defaultWidth:"wide"}),quarter:Vo({values:zJ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vo({values:QJ,defaultWidth:"wide",formattingValues:HJ,defaultFormattingWidth:"wide"}),day:Vo({values:VJ,defaultWidth:"wide"}),dayPeriod:Vo({values:GJ,defaultWidth:"any",formattingValues:qJ,defaultFormattingWidth:"wide"})},$J=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,YJ=/\d+/i,XJ={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},JJ={any:[/^д/i,/^н/i]},ZJ={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},eZ={any:[/1/i,/2/i,/3/i,/4/i]},tZ={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|оÐ
834ºÑ‚|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},nZ={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},sZ={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},rZ={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},iZ={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},oZ={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},aZ={ordinalNumber:xO({matchPattern:$J,parsePattern:YJ,valueCallback:e=>parseInt(e,10)}),era:Go({matchPatterns:XJ,defaultMatchWidth:"wide",parsePatterns:JJ,defaultParseWidth:"any"}),quarter:Go({matchPatterns:ZJ,defaultMatchWidth:"wide",parsePatterns:eZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Go({matchPatterns:tZ,defaultMatchWidth:"wide",parsePatterns:nZ,defaultParseWidth:"any"}),day:Go({matchPatterns:sZ,defaultMatchWidth:"wide",parsePatterns:rZ,defaultParseWidth:"any"}),dayPeriod:Go({matchPatterns:iZ,defaultMatchWidth:"wide",parsePatterns:oZ,defaultParseWidth:"any"})},jf={code:"ru",formatDistance:DJ,formatLong:LJ,formatRelative:FJ,localize:KJ,match:aZ,options:{weekStartsOn:1,firstWeekContainsDate:1}};function _r({dateString:e,isWithTime:t=!0}){if(!e)return"";const n=new Date(e);return Mu(n)?is(n,t?"dd.MM.yyyy, HH:mm":"dd.MM.yyyy"):""}function Kt({dateString:e,isWithTime:t=!0,isShortMonth:n=!0,isCommaSeparator:s=!1}){if(!e)return"";const r=new Date(e);if(!Mu(r))return"";const i=t?s?", HH:mm":` '${h.dateTime.AT_TIME}' HH:mm`:"",o=`d ${n?"MMM":"MMMM"} yyyy '${h.dateTime.YEAR_SUFFIX}'${i}`;return is(r,o,{locale:jf})}function ln(e){const t=e?.behavior??"auto";if(e?.ref?.current){e.ref.current.scrollTo({top:0,behavior:t});return}window.scrollTo({top:0,behavior:t})}function mf(e){const t=e?.behavior??"auto",n=e?.ref?.current??null,s=e?.elementRef?.current??null,r=e?.offset??0;if(!s)return;if(n){const o=n.getBoundingClientRect(),u=s.getBoundingClientRect().top-o.top+n.scrollTop-r;n.scrollTo({top:u,behavior:t});return}const i=s.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:i,behavior:t})}const hu=/^([A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z0-9]{2,}(?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?$/;function et({clause:e,part:t,number:n,codeType:s}){const r=(()=>{const c=(()=>{if(Array.isArray(e))return e.map(g=>{const A=String(g??"").trim();return!A||A==="null"?"":A}).filter(g=>!!g);const p=String(e??"").trim();return!p||p==="null"?[]:[p]})();if(!c.length)return"";const u=h.clients.eventsFeloniesArticleText.CLAUSE,d=c.map(p=>`«${p}»`).join(", ");return c.length>1?`${u} ${u} ${d} `:`${u} ${d} `})(),i=(()=>{const c=s&&s!=="null"?s:"",u=typeof c=="string"?c.trim():"";return u||h.clients.eventsFeloniesArticleText.RCC})(),o=(()=>{const c=t&&t!=="null"?t:"",u=typeof c=="string"?c.trim():"";return u?`${h.clients.eventsFeloniesArticleText.PART} ${u} `:""})();return`${r}${o}${h.clients.eventsFeloniesArticleText.NUMBER} ${n} ${i}`}function Vn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Y1(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function ho(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function UA(e){return e.replace(/-([a-z])/g,(t,n)=>`_${n}`).toUpperCase()}function b6(e){return e.replace(/-([a-z])/g,(t,n)=>`_${n}`).toLowerCase()}function sa({startDate:e,endDate:t,isShort:n=!1,durationInDaysToSubtract:s=0}){const r=t?new Date(t):new Date,i=new Date(e),o=i>=r?r:i,c=s>0?RO(r,s):r,u=c<o?o:c,d=gX({start:o,end:u}),p=vO(d,{locale:jf,format:["years","months","days"]});if(!p)return`0 ${h.dateTime.DAY_MANY}`;if(n){const g=new RegExp(`${h.dateTime.MONTH_MANY}|${h.dateTime.MONTH_FEW}|${h.dateTime.MONTH_ONE}`,"g");return p.replace(g,h.dateTime.MONTH_SHORT)}return p}const Yo=(e,t)=>`${e}:::${t}`;function lA({value:e}){return e?e.split(",").map(s=>s.trim().replace(/\s+/g," ")).join(", "):""}function On(e,t,n){if(!t)return n;const s=t.toUpperCase();return e[s]??n}function mu({value:e}){return e?e.replace(/(\d{1})(\d{3})(\d{3})(\d{2})(\d{2})/,"$1 $2 $3-$4-$5"):""}function of({value:e}){if(!e)return"";const t=e.replace(/\D+/g,"");if(!t)return"";if(t.length===11){const n=t.startsWith("79"),s=t.startsWith("89");return n?`+7${t.slice(1)}`:s?`+7${t.slice(1)}`:""}return t.length===10?t[0]==="9"?`+7${t}`:"":t.length===9?`+79${t}`:""}function Ny({value:e}){return e?e.toLowerCase().trim():""}function lo({value:e}){if(!e)return"";const t=e.trim(),n=[t,t.replace(/[^0-9]+/g,"."),t.replace(/[^0-9]+/g,"/"),t.replace(/[^0-9]+/g,"-"),t.replace(/\s+/g,"")],s=Array.from(new Set(n)),r=["dd.MM.yy","d.M.yy","dd/MM/yy","d/M/yy","dd-MM-yy","d-M-yy","ddMMyy","dd.MM.yyyy","d.M.yyyy","dd/MM/yyyy","d/M/yyyy","dd-MM-yyyy","d-M-yyyy","ddMMyyyy","yyyy-MM-dd","yyyy/M/d","yyyy.M.d","yy-MM-dd","yy/M/d","yy.M.d","yyyyMMdd","yyMMdd","d MMM yy","dd MMM yy","d MMMM yy","dd MMMM yy","d MMM yyyy","dd MMM yyyy","d MMMM yyyy","dd MMMM yyyy","MMM d yy","MMMM d yy","MMM d yyyy","MMMM d yyyy","yy MMM d","yy MMMM d","yyyy MMM d","yyyy MMMM d"],i=["d","dd"],o=["M","MM","MMM","MMMM"],c=["yy","yyyy"],u=[".","/","-"],d=[(x,y,I,v)=>`${x}${v}${y}${v}${I}`,(x,y,I,v)=>`${I}${v}${y}${v}${x}`],p=[];for(const x of d)for(const y of u)for(const I of i)for(const v of o)for(const S of c)p.push(x(I,v,S,y));const g=new Set,A=[];for(const x of r)g.has(x)||(A.push(x),g.add(x));for(const x of p)g.has(x)||(A.push(x),g.add(x));const E=[jf,$1];for(const x of s)for(const y of A)for(const I of E){const v=Fs(x,y,new Date,{locale:I});if(Mu(v))return is(v,"dd.MM.yyyy")}return""}function I0({value:e}){if(!e)return"";const t=lo({value:e});if(!t)return"";const n=Fs(t,"dd.MM.yyyy",new Date);return Mu(n)?is(n,"yyyy-MM-dd"):""}function Ka({value:e}){return e?e.replace(/[\u00A0\u202F]/g," ").replace(/\s+/g," ").toLowerCase().trim():""}function qh({text:e,target:t}){if(!e)return e;const n="`qwertyuiop[]asdfghjkl;'zxcvbnm,./",s="ёйцукенгшщзхъфывапролджэячсмитьбю.",[r,i]=t==="ru"?[n,s]:[s,n],o=r.split("").reduce((c,u,d)=>{const p={...c};return p[u]=i[d],p},{});return e.split("").map(c=>{const u=c.toLowerCase(),d=Object.prototype.hasOwnProperty.call(o,u)?o[u]:u;return c===u?d:d.toUpperCase()}).join("")}function I6({value:e}){if(e==null||e==="")return"";const t=(()=>{const s=typeof e=="string"?Number(e):e,r=isNaN(s)?0:s;return Math.abs(Math.floor(r))})(),n=vO({days:t},{locale:jf,format:["days"]});return n||`0 ${h.dateTime.DAY_MANY}`}function S6({value:e,isShort:t=!1}){if(e===null||e===void 0||e==="")return"";const n=(()=>
834{if(typeof e=="number")return Math.max(0,Math.floor(Math.abs(e)));const i=Number(e),o=isNaN(i)?0:i;return Math.max(0,Math.floor(Math.abs(o)))})(),s=new Date(0).toISOString(),r=new Date(0+n*24*60*60*1e3).toISOString();return sa({startDate:s,endDate:r,isShort:t})}function lZ(e){const{CHANGES_ZERO:t,CHANGES_ONE:n,CHANGES_MANY:s}=h.client.fabulizer.messages;return e%100>=11&&e%100<=14?t:e%10===1?n:e%10>=2&&e%10<=4?s:t}function Eo({data:e,path:t}){if(e===null||e===void 0||!t)return;if(!t.length)return e;if(typeof e!="object")return;const[n,...s]=t;if(n in e)return Eo({data:e[n],path:s})}function ul({data:e,path:t,value:n}){if(t===void 0||e===null||typeof e!="object")return e;const[s,...r]=t,i=e;if(!r.length)return{...i,[s]:n};const o=i[s],c=ul({data:o,path:r,value:n});return{...i,[s]:c}}function za(e){return e==null}function Ut(e){return typeof e=="number"?!!isNaN(e):e==null||e===""||e.trim()===""}function Qd(e){return e==="all"?!0:!e}function xo({lastName:e,firstName:t,middleName:n,placeholder:s,isShort:r=!0}){if(!e)return s??"";const i=t?r?t?.slice(0,1)+".":t:void 0,o=n?r?n?.slice(0,1)+".":n:void 0,c=[e];return i&&(o||!r)&&c.push(i),(i||!r)&&o&&c.push(o),c.join(" ")}const gi=e=>e.replace(/\s+/g,"").split(".").filter(s=>!!s).map(s=>{const r=s.match(/^([a-zA-Z0-9_]+)/),i=(r?r[1]:"").toLowerCase(),o=[],c=/\[(\d+)\]/g;let u;for(;(u=c.exec(s))!==null;)o.push(Number(u[1]));return{name:i,indices:o}});function fn({value:e}){if(e===null)return"0";if(e===void 0)return"";if(e==="")return"0";const t=(()=>{if(typeof e=="number")return e;const o=e.replace(/\s+/g,"").replace(",",".");return Number(o)})();if(!Number.isFinite(t))return"0";const n=Math.floor(t),s=n<0,i=Math.abs(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g," ");return s?`-${i}`:i}function cZ({count:e}){const{CASES_IN_ZERO_BEFORE:t,CASES_IN_ZERO_AFTER:n,CASES_IN_ONE_BEFORE:s,CASES_IN_ONE_AFTER:r,CASES_IN_MANY_BEFORE:i,CASES_IN_MANY_AFTER:o}=h.client.defenseStrategy.filters.circle;return e%100>=11&&e%100<=14?{before:t,after:n}:e%10===1?{before:s,after:r}:e%10>=2&&e%10<=4?{before:i,after:o}:{before:t,after:n}}function qt({count:e,zero:t,one:n,many:s}){return e%100>=11&&e%100<=14?t:e%10===1?n:e%10>=2&&e%10<=4?s:t}function uZ({text:e,preserveLineBreaks:t}){return t?e.replace(/[^\S\n]+/g," ").replace(/ *\n */g,`
835`).replace(/\n{3,}/g,`
836
837`).trim():e.replace(/\s+/g," ").trim()}function ju({text:e,maxLength:t,preserveLineBreaks:n=!1}){const s=/[\s.,!?;:…—\-"'«»()]/u,r=/[.,!?;:…—\-"'«»()]+$/u,i=String(e??""),o=uZ({text:i,preserveLineBreaks:n});if(o===""||t<=0)return"";if(o.length<=t)return o;if(!s.test(o)){const E=o.slice(0,t).replace(r,"");return E===""?"…":`${E}…`}const c=o.slice(0,t),d=[...c].reverse().findIndex(A=>s.test(A)),g=(d===-1?c:c.slice(0,c.length-d-1)).replace(r,"").trimEnd();return g===""?"…":`${g}…`}const sr=e=>(e??[]).map(t=>t.trim()).filter(t=>t.length>0),X1=e=>e==null||!Array.isArray(e)?!0:e.filter(t=>!!t).length===0;function Xv({count:e}){if(e===void 0||!Number.isFinite(e))return"";const t=Math.abs(Math.floor(e));if(!t)return"";const n=(()=>{const s=t%100;if(s>=11&&s<=14)return h.dateTime.MONTH_MANY;const r=t%10;return r===1?h.dateTime.MONTH_ONE:r>=2&&r<=4?h.dateTime.MONTH_FEW:h.dateTime.MONTH_MANY})();return`${t} ${n}`}function kO({count:e,prefix:t=""}){if(e===void 0||!Number.isFinite(e))return"";const n=Math.abs(Math.floor(e));if(!n)return"";const s=(()=>{const i=n%100;if(i>=11&&i<=14)return h.dateTime.DAY_MANY;const o=n%10;return o===1?h.dateTime.DAY_ONE:o>=2&&o<=4?h.dateTime.DAY_FEW:h.dateTime.DAY_MANY})(),r=`${n} ${s}`;return t?`${t}${r}`:r}const Jv=({strategies:e,itemId:t,felonyId:n})=>{if(!t||!n)return;const s=e.find(c=>c?._id===t);if(!s)return;const i=(s?.inner_hits?.felony_hit?.hits?.hits??[]).find(c=>c?._source?.felony_id===n);if(!i)return;const o=i?._score;if(typeof o=="number")return Math.round(o*100)},OO=e=>l.createElement("svg",{width:28,height:28,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M15.167 12.8333L24.7337 3.2666",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M25.6664 7.9335V2.3335H20.0664",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}
837),l.createElement("path",{d:"M12.833 2.3335H10.4997C4.66634 2.3335 2.33301 4.66683 2.33301 10.5002V17.5002C2.33301 23.3335 4.66634 25.6668 10.4997 25.6668H17.4997C23.333 25.6668 25.6663 23.3335 25.6663 17.5002V15.1668",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),dZ=({date:e,title:t,description:n,link:s,text:r,imageUrl:i,stableViewportClientWidth:o})=>{const c=at(),u=pO({url:i}),d=l.useRef(null),[p,g]=l.useState(5),A=l.useRef(null),[E,x]=l.useState(!0);l.useLayoutEffect(()=>{const v=(()=>{const R=o;if(R!=null){if(R<800)return 22;if(R<1e3)return 21.6;if(R<1304)return 27}return 36})(),S=o!=null&&o<800?13:5,b=d.current?.clientHeight??0,w=b>0?Math.max(1,Math.round(b/v)):1,_=Math.max(0,w-1),N=Math.max(0,S-_);g(R=>R===N?R:N)},[t,o]),l.useLayoutEffect(()=>{const v=A.current;if(!v){x(b=>b===!0?b:!0);return}const S=v.scrollHeight<=v.clientHeight+1;x(b=>b===S?b:S)},[n,p]);const y=l.useCallback(v=>{v.stopPropagation()},[]),I=l.useCallback(()=>{E||c("/",{state:{isPreventScrollToTop:!0,newsItem:{date:e,title:t,text:r,link:s,imageUrl:i}}})},[e,t,r,s,i,c,E]);return a.jsxs("div",{onClick:I,className:Y("flex","flex-col","overflow-hidden","bg-zinc-900","group","select-none",!E&&"cursor-pointer","rounded-[24px]","w-[312px]","h-[624px]","bp50:flex-row","bp50:rounded-[28.8px]","bp50:w-[763.2px]","bp50:h-[258px]","bp62_5:flex-row","bp62_5:rounded-[36px]","bp62_5:w-[954px]","bp62_5:h-[322px]","bp81_5:flex-row","bp81_5:rounded-[48px]","bp81_5:w-[1272px]","bp81_5:h-[430px]"),children:[a.jsx("div",{className:Y("pointer-events-none","w-[312px]","h-[178px]","min-w-[312px]","min-h-[176px]","rounded-[24px]","bp50:w-[374.4px]","bp50:h-[258px]","bp50:min-w-[374.4px]","bp50:min-h-[258px]","bp50:rounded-[28.8px]","bp62_5:w-[468px]","bp62_5:h-[322px]","bp62_5:m
837in-w-[468px]","bp62_5:min-h-[322px]","bp62_5:rounded-[36px]","bp81_5:w-[624px]","bp81_5:h-[430px]","bp81_5:min-w-[624px]","bp81_5:min-h-[430px]","bp81_5:rounded-[48px]"),style:{backgroundImage:`url(${u})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center center"}}),a.jsxs("div",{className:Y("flex","flex-col","pl-4","pr-4","pt-5","pb-8.5","h-[448px]","bp50:pl-[28.8px]","bp50:pr-6","bp50:pt-[21.6px]","bp50:pb-6","bp50:h-[258px]","bp62_5:pl-9","bp62_5:pr-7.5","bp62_5:pt-6.75","bp62_5:pb-7.5","bp62_5:h-[322.5px]","bp81_5:pl-12","bp81_5:pr-10","bp81_5:pt-9","bp81_5:pb-10","bp81_5:h-[430px]"),children:[a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:_r({dateString:e,isWithTime:!1})}),a.jsx("div",{ref:d,className:Y("roboto-flex-112-500-0","text-zinc-100","mt-3","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:mt-[14.4px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:mt-[18px]","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:mt-6"),children:t}),a.jsx("div",{ref:A,className:Y("roboto-flex-112-500-0","text-zinc-500","overflow-hidden","flex-1","mt-3","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:mt-[14.4px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:mt-[18px]","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:mt-6",p===12&&"line-clamp-12",p===11&&"line-clamp-11",p===10&&"line-clamp-10",p===9&&"line-clamp-9",p===8&&"line-clamp-8",p===7&&"line-clamp-7",p===6&&"line-clamp-6",p===5&&"line-clamp-5",p===4&&"line-clamp-4",p===3&&"line-clamp-3",p===2&&"line-clamp-2",p===1&&"line-clamp-1"),children:n}),a.jsxs("div",{className:Y("flex","items-center",!!E&&"justify-end",!E&&"justify-between","mt-3.5","bp50:mt-3","bp62_5:mt-[15px]","bp81_5:mt-5"),children:[!E&&a.jsx("div",{className:Y("roboto-flex-112-500-0","group-hover:text-zinc-500","text-zinc-600","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:h.main.news.controls.READ_MORE}),a.jsxs(Hs,{to:s,target:"_blank",className:Y("group/newsLink","roboto-flex-112-500-0","text-[#556FD5]","hover:text-[#708DFE]","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),onClick:y,children:[h.main.news.controls.TO_NEWS,a.jsx(OO,{className:Y("inline-block","translate-y-[-1px]","text-[#556FD5]","group-hover/newsLink:text-[#708DFE]","ml-2","w-4","h-4","bp50:ml-[4.8px]","bp50:w-[16.8px]","bp50:h-[16.8px]","bp62_5:ml-1.5","bp62_5:w-[21px]","bp62_5:h-[21px]","bp81_5:ml-2","bp81_5:w-7","bp81_5:h-7")})]})]})]})]})},PO=e=>l.createElement("svg",{width:17,height:34,viewBox:"0 0 17 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{opacity:.6,d:"M0.5 34L10.837 17L0.5 0H6.44235L16.5 17L6.40244 34H0.5Z",fill:"currentColor"})),LO=e=>l.createElement("svg",{width:17,height:34,viewBox:"0 0 17 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{opacity:.6,d:"M16.5 34L6.16297 17L16.5 0H10.5577L0.5 17L10.5976 34H16.5Z",fill:"currentColor"})),fZ="/assets/1-BP1i1j3l.jpg",pZ="/assets/2-DVvoDJt_.jpg",hZ="/assets/3-otdrd73a.jpg",mZ="/assets/4-B_pa_ue7.jpg",gZ="/assets/5-CZb4Z1NQ.jpg",AZ="/assets/6-CJdzJkKn.jpg",EZ="/assets/7-DcuxElBH.jpg",xZ="/assets/8-B6zj4whV.jpg",CZ="/assets/9-Dy1e6Bfj.jpg",yZ="/assets/10-D1_4I6uP.jpg",bZ="/assets/11-CayvEw8D.jpg",IZ="/assets/12-d-4IGRQN.jpg",SZ="/assets/13-DiF8E8uN.jpg",vZ="/assets/14-lXLq7Gh2.jpg",_Z="/assets/15-BmdHGjb_.jpg",TZ=()=>[{date:"2025-10-20",title:"Регулирование ИИ: нужны ли законы и стандарты для развития искусственного интеллекта в России",description:"Сегодня системы на базе ИИ участвуют в решениях, кому выдать кредит, как лечить пациентов и кого пригласить на собеседование. О том, как ИИ может работать с «черным ящиком» без четко определенных правил? Нужны правила и нормы, которые будут понятны и юристам, и людям. Об этом и других моментах рассказывают сооснователи Plevako.ai Егор Тайков и Игорь Гуняшов.",text:"Сегодня системы на базе ИИ участвуют в решениях, кому выдать кредит, как лечить пациентов и кого пригласить на собеседование. О том, как ИИ может работать с «черным ящиком» без четко определенных правил? Нужны правила и нормы, которые будут понятны и юристам, и людям. Об этом и других моментах рассказывают сооснователи Plevako.ai Егор Тайков и Игорь Гуняшов.",link:"https://www.comnews.ru/digital-economy/content/241860/2025-10-20/2025-w43/1016/regulirovanie-ii-nuzhny-li-zakony-i-standarty-dlya-razvitiya-iskusstvennogo-intellekta-rossii",imageUrl:EZ},{date:"2025-09-16",title:"Когда алгоритмы встречаются с правосудием",description:"Это вопрос уже не из области фантазий — по всему миру активно тестируются и внедряются инструменты искусственного интеллекта (ИИ) в законодательных процессах. Может ли машина писать законы? Как ИИ меняет подход к правосудию и что это означает для государства и граждан, причём не только в уголовных, но также в арбитражных и гражданских делах. Закрепить эти полномочиÑ
837 ведомства предложило за адвокатами, фактически профессионалами, прошедшими дополнительный отбор.",text:"Это вопрос уже не из области фантазий — по всему миру активно тестируются и внедряются инструменты искусственного интеллекта (ИИ) в законодательных процессах. Может ли машина писать законы? Как ИИ меняет подход к правосудию и что это означает для государства и граждан, причём не только в уголовных, но также в арбитражных и гражданских делах. Закрепить эти полномочия ведомства предложило за адвокатами, фактически профессионалами, прошедшими дополнительный отбор.",link:"https://www.if24.ru/kogda-algoritmy-vstrechayutsya-s-pravosudiem/",imageUrl:_Z},{date:"2025-08-05",title:"Комментарий на «Ленте.ру» Ильхама Гусейнова",description:"Россиянам станет сложнее судиться. Почему услуги адвокатов в стране подорожают в разы? Минюст разработал законопроект об адвокатской монополии, в котором предложил лишить юристов значительной части выполняемых ими задач. Речь идет о возможности представлять в судах интересы бизнеса и граждан, причём не только в уголовных, но также в арбитражных и гражданских делах. Закрепить эти полномочия ведомство предложило за адвокатами, фактически профессионалами, прошедшими дополнительный отбор.",text:"Россиянам станет сложнее судиться. Почему услуги адвокатов в стране подорожают в разы? Минюст разработал законопроект об адвокатской монополии, в котором предложил лишить юристов значительной части выполняемых ими задач. Речь идет о возможности представлять в судах интересы бизнеса и граждан, причём не только в уголовных, но также в арбитражных и гражданских делах. Закрепить эти полномочия ведомство предложило за адвокатами, фактически профессионалами, прошедшими дополнительный отбор.",link:"https://lenta.ru/articles/2025/08/05/advokat/",imageUrl:bZ},{date:"2025-07-09",title:"ИИ в суде: как алгоритмы помогают адвокатам строить стратегии",description:"Подробнее рассказывают сооснователи компании «Интеллектуальные юридические системы», разработавшей программный продукт Plevako.ai: член АП Республики Крым, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов, сооснователь Plevako.ai Евгений Гусев, генеральный директор компании «Интеллектуальные юридические системы» Егор Тайков.",text:"Подробнее рассказывают сооснователи компании «Интеллектуальные юридические системы», разработавшей программный продукт Plevako.ai: член АП Республики Крым, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов, сооснователь Plevako.ai Евгений Гусев, генеральный директор компании «Интеллектуальные юридические системы» Егор Тайков.",link:"https://legalacademy.ru/sphere/post/ii-v-sude-kak-algoritmy-pomogayut-advokatam-stroit-strategii",imageUrl:xZ},{date:"2025-07-04",title:"Главное — чтобы вы ответили на все жизненные вызовы и вопросы",description:"Интерактивный тренинг провели сооснователи компании «Интеллектуальные юридические системы», разработавшей программный продукт Plevako.ai: член АП Республики Крым, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов, сооснователь Plevako.ai Евгений Гусев.",text:"Интерактивный тренинг провели сооснователи компании «Интеллектуальные юридические системы», разработавшей программный продукт Plevako.ai: член АП Республики Крым, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов, сооснователь Plevako.ai Евгений Гусев.",link:"https://fparf.ru/news/fpa/glavnoe-chtoby-vy-otvetili-na-vse-zhiznennye-vyzovy-i-voprosy/",imageUrl:CZ},{date:"2025-07-02",title:"Прогнозируем ход дела: как ИИ помогает адвокатам оценивать риски и выигрывать суды",description:"ДÐ
837»Ñ юристов это не просто автоматизация рутинных задач — это мощный инструмент, который превращает интуитивные предположения в обоснованные оценки успеха. О том, как ИИ может стать настоящим партнёром в работе правозащитников, в авторской колонке рассказывает сооснователь Plevako.ai Игорь Гуняшов.",text:"Для юристов это не просто автоматизация рутинных задач — это мощный инструмент, который превращает интуитивные предположения в обоснованные оценки успеха. О том, как ИИ может стать настоящим партнёром в работе правозащитников, в авторской колонке рассказывает сооснователь Plevako.ai Игорь Гуняшов.",link:"https://legalacademy.ru/sphere/post/prognoziruem-hod-dela-kak-ii-pomogaet-advokatam-ocenivat-riski-i-vyigryvat-sudy",imageUrl:mZ},{date:"2025-06-23",title:"Баланс алгоритмов и разума",description:"В российской практике, как отмечает Игорь Гуняшов, сооснователь Plevako.ai (развивает технологию применения ИИ в адвокатуре), наиболее активно ИИ внедряется в банковском секторе, телекоммуникациях и ритейле.",text:"В российской практике, как отмечает Игорь Гуняшов, сооснователь Plevako.ai (развивает технологию применения ИИ в адвокатуре), наиболее активно ИИ внедряется в банковском секторе, телекоммуникациях и ритейле.",link:"https://perm.bezformata.com/listnews/algoritmov/147690587/",imageUrl:fZ},{date:"2025-06-06",title:"Право и новая реальность",description:"Продолжили дискуссию основатели Plevako.ai, председатель коллегии адвокатов Республики Крым «Бастион» Ильхам Гусейнов и сооснователь Plevako.ai, директор по продукту Plevako.ai Евгений Гусев.",text:"Продолжили дискуссию основатели Plevako.ai, председатель коллегии адвокатов Республики Крым «Бастион» Ильхам Гусейнов и сооснователь Plevako.ai, директор по продукту Plevako.ai Евгений Гусев.",link:"https://fparf.ru/news/fpa/pravo-i-novaya-realnost/",imageUrl:AZ},{date:"2025-06-05",title:"Искусственный законодатель: сможет ли нейросеть создавать нормативные акты",description:"Евгений Гусев, директор по продукту Plevako.ai, считает, что для внедрения ИИ в законодательный процесс нужна единая цифровая платформа с доступом к базам законов, судебной практики и регулирующих документов.",text:"Евгений Гусев, директор по продукту Plevako.ai, считает, что для внедрения ИИ в законодательный процесс нужна единая цифровая платформа с доступом к базам законов, судебной практики и регулирующих документов.",link:"https://legalacademy.ru/sphere/post/iskusstvennyi-zakonodatel-smozhet-li-neiroset-sozdavat-normativnye-akty",imageUrl:IZ},{date:"2025-05-30",title:"Эксперт рассказал, когда нейросети внедрят в систему правосудия",description:"Людям, которые должны принимать сложнейшие решения, приходится работать с бесконечными томами доÐ
837ºÑƒÐ¼ÐµÐ½Ñ‚ов. Об этом РИАМО сообщил основатель проекта Plevako.ai Егор Тайков. Ранее стало известно, что дела о разводах в России хотят отдать искусственному интеллекту.",text:"Людям, которые должны принимать сложнейшие решения, приходится работать с бесконечными томами документов. Об этом РИАМО сообщил основатель проекта Plevako.ai Егор Тайков. Ранее стало известно, что дела о разводах в России хотят отдать искусственному интеллекту.",link:"https://riamo.ru/news/obschestvo/ekspert-rasskazal-kogda-nejroseti-vnedrjat-v-sistemu-pravosudija/",imageUrl:pZ},{date:"2025-05-29",title:"Конфликт как возможность: новая парадигма взаимодействия человека и ИИ",description:"Это уже не фантастика, а реальность, с которой нам предстоит научиться жить и сотрудничать. Как именно может работать союз человека и ИИ, размышляют сооснователи Plevako.ai Игорь Гуняшов и Егор Тайков.",text:"Это уже не фантастика, а реальность, с которой нам предстоит научиться жить и сотрудничать. Как именно может работать союз человека и ИИ, размышляют сооснователи Plevako.ai Игорь Гуняшов и Егор Тайков.",link:"https://itspeaker.ru/news/konflikt-kak-vozmozhnost-novaya-paradigma-vzaimodeystviya-cheloveka-i-ii/",imageUrl:vZ},{date:"2025-05-19",title:"«Хочешь ускорить хаос — автоматизируй его»",description:"Игорь Гуняшов, сооснователь стартапа Plevako.ai, по внедрению ИИ в адвокатуре отмечает, что интересная ситуация по автоматизации складывается в консервативных сферах, где традиционно преобладал ручной интеллектуальный труд.",text:"Игорь Гуняшов, сооснователь стартапа Plevako.ai, по внедрению ИИ в адвокатуре отмечает, что интересная ситуация по автоматизации складывается в консервативных сферах, где традиционно преобладал ручной интеллектуальный труд.",link:"https://www.kommersant.ru/doc/7734505",imageUrl:gZ},{date:"2025-04-22",title:"Комментарий на портале «Сфера»",description:"Комментарий Ильхама Гусейнова, председателя коллегии адвокатов «Бастион» и сооснователя Plevako.ai, был опубликован в издании «Сфера» в рамках материала «Развод по алгоритму: расторжением браков займётся нейросеть». В комментарии он отметил, что технологии искусственного интеллекта не заменяют адвоката, а усиливают его профессиональные возможности, позволяя сосредоточиться на творческих и стратегических задачах.",text:"Комментарий Ильхама Гусейнова, председателя коллегии адвокатов «Бастион» и сооснователя Plevako.ai, был опубликован в издании «Сфера» в рамках материала «Развод по алгоритму: расторжением браков займётся нейросеть». В комментарии он отметил, что технологии искусственного интеллекта не заменяют адвоката, а усиливают его профессиональные возможности, позволяя сосредоточиться на творческих и стратегических задачах.",link:"https://legalacademy.ru/sphere/post/razvod-po-algoritmu-rastorzheniem-brakov-zaimetsya-neiroset",imageUrl:SZ},{date:"2025-03-22",title:"Инновации в адвокатуре: как ИИ меняет практику",description:"Насколько далеко можно зайти в интеграции технологий, не потеряв сути профессии? Своим видением в авторской колонке делится сооснователь Plevako.ai, адвокат, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов",text:"Насколько далеко можно зайти в интеграции технологий, не потеряв сути профессии? Своим видением в авторской колонке делится сооснователь Plevako.ai, адвокат, председатель коллегии адвокатов «Бастион» Ильхам Гусейнов",link:"https://legalacademy.ru/sphere/post/innovacii-v-advokature-kak-ii-menyaet-praktiku",imageUrl:yZ},{date:"2025-03-14",title:"Выступление на конференции АПМО",description:"На конференции АПМО выступили сооснователи проекта Егор Тайков и Ильхам Гусейнов. Обсудили применение искусственного интеллекта в адвокатуре и представили программу «Plevako.ai», предназначенную для автоматизации поиска судебной практики и подготовки юридических документов.",text:"На конференции АПМО выступили сооснователи проекта Егор Тайков и Ильхам Гусейнов. Обсудили применение искусственного интеллекта в адвокатуре и представили программу «Plevako.ai», предназначенную для автоматизации поиска судебной практики и подготовки юридических документов.",link:"https://t.me/apmoru/1636",imageUrl:hZ}],NZ=({centerIndex:e,newsContent:t,targetCount:n})=>l.useMemo(()=>
837{if(t.length===0)return[];const r=Math.floor(n/2),i=t.length,o=c=>{const u=c-r,d=((e+u)%i+i)%i;return t[d]};return Array.from({length:n}).map((c,u)=>o(u))},[t,e,n]),MO=({scrollContainerRef:e,cardWidthPx:t,gapPx:n,itemsPerArrow:s})=>{const r=Oe.useRef(!1),i=Oe.useRef(null),o=Oe.useCallback(p=>{const g=e.current;if(!g||t===null||n===null)return;r.current=!0;const A=p==="right"?1:-1;g.scrollTo({left:g.scrollLeft+A*(t+n)*s,behavior:"smooth"})},[t,n,s,e]),c=Oe.useCallback(p=>{if(r.current){i.current=p;return}o(p)},[o]),u=Oe.useCallback(()=>{const p=i.current;p&&(i.current=null,o(p))},[o]),d=Oe.useCallback(()=>i.current!==null,[]);return{isScrollInProgressRef:r,handleNavigationClick:c,flushPendingNavigation:u,hasPendingNavigation:d}},wy=21,wZ=.5,v6=300,RZ=1,DZ=({stableViewportClientWidth:e})=>{const[t,n]=l.useState(0),[s,r]=l.useState(null),[i,o]=l.useState(null),[c,u]=l.useState(null),[d,p]=l.useState(null),g=l.useRef(null),A=l.useRef(null),E=l.useRef(null),x=l.useRef(0),y=l.useRef(null),I=l.useMemo(()=>e===null||!Number.isFinite(e)?null:d===null||e<=d?0:(e-d)/2,[e,d]),v=TZ(),S=NZ({centerIndex:t,newsContent:v,targetCount:wy}),b=l.useMemo(()=>{if(I===null||s===null||i===null||c===null)return 0;const B=I+c,F=Math.ceil(B/(s+i));return B-F*(s+i)},[I,s,i,c]),w=l.useCallback(()=>{if(I===null||!g.current||s===null||i===null)return;const B=Math.ceil(I/(s+i)),F=(wy-1)/2;g.current.scrollLeft=(F-B)*(s+i)},[I,s,i]),{isScrollInProgressRef:_,handleNavigationClick:N,flushPendingNavigation:R,hasPendingNavigation:D}=MO({scrollContainerRef:g,cardWidthPx:s,gapPx:i,itemsPerArrow:RZ}),k=l.useCallback(()=>{if(_.current=!1,x.current>0){x.current=x.current-1;return}const B=g.current,F=v.length;if(!B||F===0||I===null||s===null||i===null)return;const z=Math.ceil(I/(s+i)),Q=Math.round(B.scrollLeft/(s+i)),M=z+Q,K=-((wy-1)/2-M);K&&(Wn.flushSync(()=>{n(W=>((K+W)%F+F)%F)}),x.current=D()?1:2,y.current&&(clearTimeout(y.current),y.current=null),y.current=window.setTimeout(()=>{y.current=null,x.current=0},v6*3),w(),R())},[_,D,R,w,I,v.length,s,i]),L=l.useCallback(()=>{_.current=!0},[_]);l.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),Vv({onSettled:k,onStarted:L,stableEpsilonPx:wZ,stableQuietMs:v6,isEnabled:!0,elementRef:g,autoAttachListeners:!0});const O=l.useCallback(()=>{N("right")},[N]),P=l.useCallback(()=>{N("left")},[N]);return l.useEffect(()=>{const B=A.current;if(!B)return;const F=window.getComputedStyle(B),z=Number.parseFloat(F.width),Q=(F.gap||F.columnGap||"0px").trim(),M=Number.parseFloat(Q),K=Number.parseFloat((F.marginLeft||"0px").trim());Number.isNaN(z)||r(z),Number.isNaN(M)||o(M),Number.isNaN(K)||u(K)},[e]),l.useEffect(()=>{const B=E.current;if(!B)return;const F=window.getComputedStyle(B),z=(F.maxWidth||"0px").trim(),Q=Number.parseFloat(z);if(!Number.isNaN(Q)){p(Q);return}const M=Number.parseFloat((F.width||"0px").trim());Number.isNaN(M)||p(M)},[e]),l.useEffect(()=>{w()},[w]),a.jsxs("div",{className:Y("relative","mb-[96px]","bp50:mb-[158.4px]","bp62_5:mb-[198px]","bp81_5:mb-[264px]"),children:[a.jsx("div",{ref:A,className:Y("flex","h-0","mx-0","gap-3","w-[312px]","bp50:w-[763.2px]","bp50:gap-[14.4px]","bp50:mx-[9.6px]","bp62_5:w-[954px]","bp62_5:gap-4.5","bp62_5:mx-3","bp81_5:w-[1272px]","bp81_5:gap-6","bp81_5:mx-4")}),a.jsx("div",{ref:E,className:Y("w-full","mx-auto","max-w-[312px]","px-0","bp50:max-w-[782.4px]","bp50:px-[9.6px]","bp62_5:max-w-[978px]","bp62_5:px-3","bp81_5:max-w-[1304px]","bp81_5:px-4"),children:a.jsx("div",{className:Y("roboto-flex-64-600-0","text-zinc-100","uppercase","text-[40px]","leading-[32px]","bp50:text-[57.6px]","bp50:leading-[46px]","bp62_5:text-[72px]","bp62_5:leading-[56px]","bp81_5:text-[96px]","bp81_5:leading-[74px]"),children:h.main.news.HEADER})}),a.jsx("div",{className:Y("relative","h-[624px]","mt-10","bp50:h-[258px]","bp50:mt-[57.6px]","bp62_5:h-[322px]","bp62_5:mt-18","bp81_5:h-[430px]","bp81_5:mt-24"),style:{marginLeft:b,marginRight:b},children:I!==null&&a.jsx("div",{ref:g,className:Y("flex","overflow-x-auto","overflow-y-hidden","[overscroll-behavior-x:contain]","snap-x","snap-mandatory","[-webkit-overflow-scrolling:touch]","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden","scroll-pl-[324px]","gap-3","bp50:scroll-pl-[777.6px]","bp50:gap-[14.4px]","bp62_5:scroll-pl-[972px]","bp62_5:gap-4.5","bp81_5:scroll-pl-[1296px]","bp81_5:gap-6"),children:S.map((B,F)=>a.jsx("div",{"data-index":F+1,className:"shrink-0 snap-start",children:a.jsx(dZ,{stableViewportClientWidth:e,...B},B.title)},F))})}),a.jsx("div",{className:Y("absolute","hidden","items-center","justify-center","rounded-full","bg-zinc-950","cursor-pointer","group","top-[359px]","right-6","w-12","h-24","bp50:flex","bp50:top-[215.4px]","bp50:right-[14.4px]","bp50:w-[28.8px]","bp50:h-[57.6px]","bp62_5:flex","bp62_5:top-[269px]","bp62_5:right-4.5","bp62_5:w-9","bp62_5:h-18","bp81_5:flex","bp81_5:top-[359px]","bp81_5:right-6","bp81_5:w-12","bp81_5:h-24"),onClick:O,children:a.jsx(PO,{className:"text-zinc-200 group-hover:text-white"})}),a.jsx("div",{className:Y("absolute","hidden","items-center","justify-center","rounded-full","bg-zinc-950","cursor-pointer","group","top-[359px]","left-6","w-12","h-24","bp50:flex","bp50:top-[215.4px]","bp50:left-[14.4px]","bp50:w-[28.8px]","bp50:h-[57.6px]","bp62_5:flex","bp62_5:top-[269px]","bp62_5:left-4.5","bp62_5:w-9","bp62_5:h-18","bp81_5:flex","bp81_5:top-[359px]","bp81_5:left-6","bp81_5:w-12","bp81_5:h-24"),onClick:P,children:a.jsx(LO,{className:"text-zinc-200 group-hover:text-white"})})]})},jO=e=>l.createElement("svg",{width:28,height:28,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M8.72656 21.4079L12.3432 24.2079C12.8099 24.6746 13.8599 24.9079 14.5599 24.9079H18.9932C20.3932 24.9079 21.9099 23.85
83779 22.2599 22.4579L25.0599 13.9412C25.6432 12.3079 24.5932 10.9079 22.8432 10.9079H18.1766C17.4766 10.9079 16.8932 10.3246 17.0099 9.50789L17.5932 5.77456C17.8266 4.72456 17.1266 3.55789 16.0766 3.20789C15.1432 2.85789 13.9766 3.32456 13.5099 4.02456L8.72656 11.1412",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10}),l.createElement("path",{d:"M2.77637 21.4088V9.97546C2.77637 8.34212 3.47637 7.75879 5.1097 7.75879H6.27637C7.9097 7.75879 8.6097 8.34212 8.6097 9.97546V21.4088C8.6097 23.0421 7.9097 23.6255 6.27637 23.6255H5.1097C3.47637 23.6255 2.77637 23.0421 2.77637 21.4088Z",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"})),kZ=({summary:e,name:t,description:n,text:s,stableViewportClientWidth:r})=>{const i=at(),o=l.useRef(null),[c,u]=l.useState(9),d=l.useRef(null),[p,g]=l.useState(!0);l.useLayoutEffect(()=>{const E=(()=>{const b=r;if(b!=null){if(b<800)return 22;if(b<1e3)return 21.6;if(b<1304)return 27}return 36})(),x=r!=null&&r<800?10:9,y=o.current?.clientHeight??0,I=y>0?Math.max(1,Math.round(y/E)):1,v=Math.max(0,I-1),S=Math.max(0,x-v);u(b=>b===S?b:S)},[t,r]),l.useLayoutEffect(()=>{const E=d.current;if(!E){g(y=>y===!0?y:!0);return}const x=E.scrollHeight<=E.clientHeight+1;g(y=>y===x?y:x)},[n,c]);const A=l.useCallback(()=>{p||i("/",{state:{isPreventScrollToTop:!0,testimonialItem:{summary:e,name:t,text:s}}})},[e,t,s,p,i]);return a.jsxs("div",{onClick:A,className:Y("flex","flex-col","overflow-hidden","bg-zinc-900","group","w-[312px]","h-[394px]","pb-[34px]","rounded-[24px]","bp50:w-[374.4px]","bp50:h-[357.6px]","bp50:pb-[28.8px]","bp50:rounded-[28.8px]","bp62_5:w-[468px]","bp62_5:h-[447px]","bp62_5:pb-9","bp62_5:rounded-[36px]","bp81_5:w-[624px]","bp81_5:h-[596px]","bp81_5:pb-12","bp81_5:rounded-[48px]",!p&&"select-none",!p&&"cursor-pointer"),children:[a.jsxs("div",{className:Y("roboto-flex-112-500-0","text-[#556FD5]","mt-8","mx-4","text-[18px]","leading-[22px]","bp50:mt-[19.2px]","bp50:mx-[19.2px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:mt-6","bp62_5:mx-6","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:mt-8","bp81_5:mx-8","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:[a.jsx(jO,{className:Y("inline-block","translate-y-[-1px]","text-[#556FD5]","mr-3","w-4","h-4","bp50:mr-[7.2px]","bp50:w-[16.8px]","bp50:h-[16.8px]","bp62_5:mr-[9px]","bp62_5:w-[21px]","bp62_5:h-[21px]","bp81_5:mr-3","bp81_5:w-7","bp81_5:h-7")}),e]}),a.jsx("div",{ref:o,className:Y("roboto-flex-112-500-0","text-zinc-100","mt-3","mx-4","text-[18px]","leading-[22px]","bp50:mt-[14.4px]","bp50:mx-[19.2px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:mt-[18px]","bp62_5:mx-6","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:mt-6","bp81_5:mx-8","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:t}),a.jsx("div",{ref:d,className:Y("roboto-flex-112-500-0","text-zinc-500","overflow-hidden","flex-1","mt-3","mx-4","text-[18px]","leading-[22px]","bp50:mt-[14.4px]","bp50:mx-[19.2px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:mt-[18px]","bp62_5:mx-6","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:mt-6","bp81_5:mx-8","bp81_5:text-[32px]","bp81_5:leading-[36px]",c===10&&"line-clamp-10",c===9&&"line-clamp-9",c===8&&"line-clamp-8",c===7&&"line-clamp-7",c===6&&"line-clamp-6",c===5&&"line-clamp-5",c===4&&"line-clamp-4",c===3&&"line-clamp-3",c===2&&"line-clamp-2",c===1&&"line-clamp-1"),children:n}),a.jsx("div",{className:Y("flex","items-center","justify-between","h-[22px]","mt-3.5","mx-4","bp50:h-[21.6px]","bp50:mt-[15.6px]","bp50:mx-[19.2px]","bp62_5:h-[27px]","bp62_5:mt-[19.5px]","bp62_5:mx-6","bp81_5:h-9","bp81_5:mt-[26px]","bp81_5:mx-8"),children:!p&&a.jsx("div",{className:Y("roboto-flex-112-500-0","group-hover:text-zinc-500","text-zinc-600","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:h.main.testimonials.controls.READ_MORE})})]})},OZ=()=>[],PZ=({centerIndex:e,testimonialsContent:t,targetCount:n})=>l.useMemo(()=>{if(t.length===0)return[];const r=Math.floor(n/2),i=t.length,o=c=>{const u=c-r,d=((e+u)%i+i)%i;return t[d]};return Array.from({length:n}).map((c,u)=>o(u))},[t,e,n]),Ry=21,LZ=.5,_6=300,MZ=2,jZ=({stableViewportClientWidth:e})=>{const[t,n]=l.useState(0),[s,r]=l.useState(null),[i,o]=l.useState(null),[c,u]=l.useState(null),[d,p]=l.useState(null),g=l.useRef(null),A=l.useRef(null),E=l.useRef(null),x=l.useRef(0),y=l.useRef(null),I=l.useMemo(()=>e===null||!Number.isFinite(e)?null:d===null||e<=d?0:(e-d)/2,[e,d]),v=OZ(),S=PZ({centerIndex:t,testimonialsContent:v,targetCount:Ry}),b=l.useMemo(()=>
837{if(I===null||s===null||i===null||c===null)return 0;const B=I+c,F=Math.ceil(B/(s+i));return B-F*(s+i)},[I,s,i,c]),w=l.useCallback(()=>{if(I===null||!g.current||s===null||i===null)return;const B=Math.ceil(I/(s+i)),F=(Ry-1)/2;g.current.scrollLeft=(F-B)*(s+i)},[I,s,i]),{isScrollInProgressRef:_,handleNavigationClick:N,flushPendingNavigation:R,hasPendingNavigation:D}=MO({scrollContainerRef:g,cardWidthPx:s,gapPx:i,itemsPerArrow:MZ}),k=l.useCallback(()=>{if(_.current=!1,x.current>0){x.current=x.current-1;return}const B=g.current,F=v.length;if(!B||F===0||I===null||s===null||i===null)return;const z=Math.ceil(I/(s+i)),Q=Math.round(B.scrollLeft/(s+i)),M=z+Q,K=-((Ry-1)/2-M);K&&(Wn.flushSync(()=>{n(W=>((K+W)%F+F)%F)}),x.current=D()?1:2,y.current&&(clearTimeout(y.current),y.current=null),y.current=window.setTimeout(()=>{y.current=null,x.current=0},_6*3),w(),R())},[_,D,R,w,I,v.length,s,i]),L=l.useCallback(()=>{_.current=!0},[_]);l.useEffect(()=>()=>{y.current&&(clearTimeout(y.current),y.current=null)},[]),Vv({onSettled:k,onStarted:L,stableEpsilonPx:LZ,stableQuietMs:_6,isEnabled:!0,elementRef:g,autoAttachListeners:!0});const O=l.useCallback(()=>{N("right")},[N]),P=l.useCallback(()=>{N("left")},[N]);return l.useEffect(()=>{const B=A.current;if(!B)return;const F=window.getComputedStyle(B),z=Number.parseFloat(F.width),Q=(F.gap||F.columnGap||"0px").trim(),M=Number.parseFloat(Q),K=Number.parseFloat((F.marginLeft||"0px").trim());Number.isNaN(z)||r(z),Number.isNaN(M)||o(M),Number.isNaN(K)||u(K)},[e]),l.useEffect(()=>{const B=E.current;if(!B)return;const F=window.getComputedStyle(B),z=(F.maxWidth||"0px").trim(),Q=Number.parseFloat(z);if(!Number.isNaN(Q)){p(Q);return}const M=Number.parseFloat((F.width||"0px").trim());Number.isNaN(M)||p(M)},[e]),l.useEffect(()=>{w()},[w]),S?.length?a.jsxs("div",{className:Y("relative","mb-[96px]","bp50:mb-[158.4px]","bp62_5:mb-[198px]","bp81_5:mb-[264px]"),children:[a.jsx("div",{ref:A,className:Y("flex","h-0","mx-0","gap-3","w-[312px]","bp50:w-[374.4px]","bp50:gap-[14.4px]","bp50:mx-[9.6px]","bp62_5:w-[468px]","bp62_5:gap-4.5","bp62_5:mx-3","bp81_5:w-[624px]","bp81_5:gap-6","bp81_5:mx-4")}),a.jsx("div",{ref:E,className:Y("w-full","mx-auto","max-w-[312px]","px-0","bp50:max-w-[782.4px]","bp50:px-[9.6px]","bp62_5:max-w-[978px]","bp62_5:px-3","bp81_5:max-w-[1304px]","bp81_5:px-4"),children:a.jsx("div",{className:Y("roboto-flex-64-600-0","text-zinc-100","uppercase","text-[40px]","leading-[32px]","bp50:text-[57.6px]","bp50:leading-[46px]","bp62_5:text-[72px]","bp62_5:leading-[56px]","bp81_5:text-[96px]","bp81_5:leading-[74px]"),children:h.main.testimonials.HEADER})}),a.jsx("div",{className:Y("relative","h-[394px]","mt-10","bp50:h-[357.6px]","bp50:mt-[57.6px]","bp62_5:h-[447px]","bp62_5:mt-18","bp81_5:h-[596px]","bp81_5:mt-24"),style:{marginLeft:b,marginRight:b},children:I!==null&&a.jsx("div",{ref:g,className:Y("flex","gap-3","overflow-x-auto","overflow-y-hidden","[overscroll-behavior-x:contain]","snap-x","snap-mandatory","[-webkit-overflow-scrolling:touch]","[scrollbar-width:none]","[&::-webkit-scrollbar]:hidden","scroll-pl-[324px]","bp50:gap-[14.4px]","bp50:scroll-pl-[388.8px]","bp62_5:gap-4.5","bp62_5:scroll-pl-[486px]","bp81_5:gap-6","bp81_5:scroll-pl-[648px]"),children:S.map((B,F)=>a.jsx("div",{"data-index":F+1,className:"shrink-0 snap-start",children:a.jsx(kZ,{...B,stableViewportClientWidth:e},B.description)},F))})}),a.jsx("div",{className:Y("absolute","hidden","items-center","justify-center","rounded-full","bg-zinc-950","cursor-pointer","group","top-[442px]","right-6","w-12","h-24","bp50:flex","bp50:top-[265.2px]","bp50:right-[14.4px]","bp50:w-[28.8px]","bp50:h-[57.6px]","bp62_5:flex","bp62_5:top-[331.5px]","bp62_5:right-4.5","bp62_5:w-9","bp62_5:h-18","bp81_5:flex","bp81_5:top-[442px]","bp81_5:right-6","bp81_5:w-12","bp81_5:h-24"),onClick:O,children:a.jsx(PO,{className:"text-zinc-200 group-hover:text-white"})}),a.jsx("div",{className:Y("absolute","hidden","items-center","justify-center","rounded-full","bg-zinc-950","cursor-pointer","group","top-[442px]","left-6","w-12","h-24","bp50:flex","bp50:top-[265.2px]","bp50:left-[14.4px]","bp50:w-[28.8px]","bp50:h-[57.6px]","bp62_5:flex","bp62_5:top-[331.5px]","bp62_5:left-4.5","bp62_5:w-9","bp62_5:h-18","bp81_5:flex","bp81_5:top-[442px]","bp81_5:left-6","bp81_5:w-12","bp81_5:h-24"),onClick:P,children:a.jsx(LO,{className:"text-zinc-200 group-hover:text-white"})})]}):null},BZ=e=>l.createElement("svg",{width:28,height:28,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M23.2985 11.6665H4.63184V20.9998C4.63184 24.4998 5.7985 25.6665 9.2985 25.6665H18.6318C22.1318 25.6665 23.2985 24.4998 23.2985 20.9998V11.6665Z",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"}
837),l.createElement("path",{d:"M25.0837 8.16683V9.3335C25.0837 10.6168 24.4653 11.6668 22.7503 11.6668H5.25033C3.46533 11.6668 2.91699 10.6168 2.91699 9.3335V8.16683C2.91699 6.8835 3.46533 5.8335 5.25033 5.8335H22.7503C24.4653 5.8335 25.0837 6.8835 25.0837 8.16683Z",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M13.5796 5.83351H7.13959C6.74292 5.40184 6.75459 4.73684 7.17459 4.31684L8.83125 2.66018C9.26292 2.22851 9.97459 2.22851 10.4063 2.66018L13.5796 5.83351Z",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M20.8482 5.83351H14.4082L17.5815 2.66018C18.0132 2.22851 18.7249 2.22851 19.1565 2.66018L20.8132 4.31684C21.2332 4.73684 21.2449 5.40184 20.8482 5.83351Z",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10.4297 11.6665V17.6632C10.4297 18.5965 11.4564 19.1448 12.238 18.6432L13.3347 17.9198C13.7314 17.6632 14.233 17.6632 14.618 17.9198L15.6564 18.6198C16.4264 19.1332 17.4647 18.5848 17.4647 17.6515V11.6665H10.4297Z",stroke:"currentColor",strokeWidth:3,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round"})),FZ=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M9 2C6.38 2 4.25 4.13 4.25 6.75C4.25 9.32 6.26 11.4 8.88 11.49C8.96 11.48 9.04 11.48 9.1 11.49C9.12 11.49 9.13 11.49 9.15 11.49C9.16 11.49 9.16 11.49 9.17 11.49C11.73 11.4 13.74 9.32 13.75 6.75C13.75 4.13 11.62 2 9 2Z",fill:"currentColor"}),l.createElement("path",{d:"M14.08 14.1499C11.29 12.2899 6.73996 12.2899 3.92996 14.1499C2.65996 14.9999 1.95996 16.1499 1.95996 17.3799C1.95996 18.6099 2.65996 19.7499 3.91996 20.5899C5.31996 21.5299 7.15996 21.9999 8.99996 21.9999C10.84 21.9999 12.68 21.5299 14.08 20.5899C15.34 19.7399 16.04 18.5999 16.04 17.3599C16.03 16.1299 15.34 14.9899 14.08 14.1499Z",fill:"currentColor"}),l.createElement("path",{d:"M19.9904 7.3401C20.1504 9.2801 18.7704 10.9801 16.8604 11.2101C16.8504 11.2101 16.8504 11.2101 16.8404 11.2101H16.8104C16.7504 11.2101 16.6904 11.2101 16.6404 11.2301C15.6704 11.2801 14.7804 10.9701 14.1104 10.4001C15.1404 9.4801 15.7304 8.1001 15.6104 6.6001C15.5404 5.7901 15.2604 5.0501 14.8404 4.4201C15.2204 4.2301 15.6604 4.1101 16.1104 4.0701C18.0704 3.9001 19.8204 5.3601 19.9904 7.3401Z",fill:"currentColor"}),l.createElement("path",{d:"M21.9902 16.5899C21.9102 17.5599 21.2902 18.3999 20.2502 18.9699C19.2502 19.5199 17.9902 19.7799 16.7402 19.7499C17.4602 19.0999 17.8802 18.2899 17.9602 17.4299C18.0602 16.1899 17.4702 14.9999 16.2902 14.0499C15.6202 13.5199 14.8402 13.0999 13.9902 12.7899C16.2002 12.1499 18.9802 12.5799 20.6902 13.9599C21.6102 14.6999 22.0802 15.6299 21.9902 16.5899Z",fill:"currentColor"})),UZ="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDA4IiBoZWlnaHQ9IjM0OSIgdmlld0JveD0iMCAwIDQwOCAzNDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8Zm9yZWlnbk9iamVjdCB4PSItNDgiIHk9Ii00OCIgd2lkdGg9IjUwNCIgaGVpZ2h0PSI0NDUiPgogICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiCiAgICAgICAgICAgIHN0eWxlPSJiYWNrZHJvcC1maWx0ZXI6Ymx1cigyNHB4KTtjbGlwLXBhdGg6dXJsKCNiZ2JsdXJfMF8xXzQwNV9jbGlwX3BhdGgpO2hlaWdodDoxMDAlO3dpZHRoOjEwMCUiPjwvZGl2PgogICAgPC9mb3JlaWduT2JqZWN0PgogICAgPGcgZGF0YS1maWdtYS1iZy1ibHVyLXJhZGl1cz0iNDgiPgogICAgICAgIDxyZWN0IHdpZHRoPSI0MDgiIGhlaWdodD0iMzQ5IiByeD0iMjQiIGZpbGw9InVybCgjcGFpbnQwX3JhZGlhbF8xXzQwNSkiIC8+CiAgICAgICAgPHJlY3Qgd2lkdGg9IjQwOCIgaGVpZ2h0PSIzNDkiIHJ4PSIyNCIgZmlsbD0idXJsKCNwYWludDFfcmFkaWFsXzFfNDA1KSIgLz4KICAgIDwvZz4KICAgIDxkZWZzPgogICAgICAgIDxjbGlwUGF0aCBpZD0iYmdibHVyXzBfMV80MDVfY2xpcF9wYXRoIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0OCA0OCkiPgogICAgICAgICAgICA8cmVjdCB3aWR0aD0iNDA4IiBoZWlnaHQ9IjM0OSIgcng9IjI0IiAvPgogICAgICAgIDwvY2xpcFBhdGg+CiAgICAgICAgPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDBfcmFkaWFsXzFfNDA1IiBjeD0iMCIgY3k9IjAiIHI9IjEiCiAgICAgICAgICAgIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMTA0LjQ4OCA0NzEuNzk2IC01NTEuNTU2IDM2Ni4zOTQgMjc0LjI4IC0yOS4wODMzKSIKICAgICAgICAgICAgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjMTgxODFCIiBzdG9wLW9wYWNpdHk9IjAiIC8+CiAgICAgICAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzU1NkZENSIgLz4KICAgICAgICA8L3JhZGlhbEdyYWRpZW50PgogICAgICAgIDxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQxX3JhZGlhbF8xXzQwNSIgY3g9IjAiIGN5PSIwIiByPSIxIgogICAgICAgICAgICBncmFkaWVudFRyYW5zZm9ybT0ibWF0cml4KC0xNzguNSA3MzMuNTQ2IC04NTcu
837NTU2IC02MjUuOTIzIDEwNi4zNTQgLTEyNy4xMDUpIgogICAgICAgICAgICBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiMxODE4MUIiIHN0b3Atb3BhY2l0eT0iMCIgLz4KICAgICAgICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNTU2RkQ1IiAvPgogICAgICAgIDwvcmFkaWFsR3JhZGllbnQ+CiAgICA8L2RlZnM+Cjwvc3ZnPgogICAg",zZ=()=>{const[e,t]=l.useState(null),n=Se(i=>i.user),s=l.useMemo(()=>n?.id?"/profile/subscription":"/sign-up",[n?.id]),r=l.useMemo(()=>[{id:"plan-3m",durationMonths:3,bonusDays:14,priceRub:24e3,priceRubPerMonth:6923},{id:"plan-6m",durationMonths:6,bonusDays:30,priceRub:38500,priceRubPerMonth:5500},{id:"plan-12m",durationMonths:12,bonusDays:60,priceRub:61600,priceRubPerMonth:4400}],[]);return a.jsxs("div",{children:[a.jsxs("div",{className:Y("flex","items-end","justify-between"),children:[a.jsx("div",{className:Y("roboto-flex-64-600-0","text-zinc-100","uppercase","text-[40px]","leading-[28px]","w-full","mx-auto","max-w-[312px]","bp50:w-auto","bp50:mx-0","bp50:max-w-none","bp50:text-[57.6px]","bp50:leading-[40.8px]","bp62_5:w-auto","bp62_5:mx-0","bp62_5:max-w-none","bp62_5:text-[72px]","bp62_5:leading-[51px]","bp81_5:w-auto","bp81_5:mx-0","bp81_5:max-w-none","bp81_5:text-[96px]","bp81_5:leading-[68px]"),children:h.main.plans.HEADER}),a.jsxs("div",{className:Y("hidden","roboto-flex-112-500-0","text-zinc-400","text-right","text-[20px]","leading-[24px]","bp50:block","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:block","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:block","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:[a.jsx("div",{children:h.main.plans.hints.CLIENTS_PER_YEAR}),a.jsx("div",{children:h.main.plans.hints.STORAGE_PER_CLIENT})]})]}),a.jsx("div",{className:Y("flex","flex-col","items-center","justify-between","gap-3","h-auto","mt-9","bp50:flex-row","bp50:gap-[14.4px]","bp50:h-[209.4px]","bp50:mt-18","bp62_5:flex-row","bp62_5:gap-4.5","bp62_5:h-[261.75px]","bp62_5:mt-24","bp81_5:flex-row","bp81_5:gap-6","bp81_5:h-[349px]","bp81_5:mt-32"),children:r.map(i=>a.jsxs(Je,{to:s,onTouchStart:o=>{o.currentTarget.focus({preventScroll:!0}),t(i.id)},onTouchEnd:()=>{t(null)},onTouchCancel:()=>{t(null)},className:Y("relative","group","touch-manipulation","outline-none","overflow-hidden","flex-1","flex","flex-col","items-center","justify-center","bg-zinc-900","h-[206px]","min-h-[206px]","mx-auto","w-[312px]","max-w-[312px]","rounded-[24px]","bp50:w-auto","bp50:mx-0","bp50:max-w-none","bp50:h-[230px]","bp50:min-h-[230px]","bp50:rounded-[14.4px]","bp62_5:w-auto","bp62_5:mx-0","bp62_5:max-w-none","bp62_5:h-[316px]","bp62_5:m
837in-h-[316px]","bp62_5:rounded-[18px]","bp81_5:w-auto","bp81_5:mx-0","bp81_5:max-w-none","bp81_5:h-[421px]","bp81_5:min-h-[421px]","bp81_5:rounded-[24px]","bp81_5:pb-3"),children:[a.jsx("div",{className:Y("pointer-events-none","absolute","inset-0","transition-opacity","duration-200",e===i.id&&"opacity-100",e!==i.id&&Y("opacity-0","supports-hover:group-hover:opacity-100","group-focus-visible:opacity-100"),"rounded-[24px]","backdrop-blur-xl","bp50:rounded-[14.4px]","bp50:backdrop-blur-[14.4px]","bp62_5:rounded-[18px]","bp62_5:backdrop-blur-[18px]","bp81_5:rounded-[24px]","bp81_5:backdrop-blur-xl"),style:{backgroundImage:`url(${UZ})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center"}}),a.jsx("div",{className:Y("relative","roboto-flex-112-500-0","text-zinc-100","text-center","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:Xv({count:i.durationMonths})}),a.jsxs("div",{className:Y("relative","flex","items-center","justify-center","roboto-flex-112-500-0","text-[#556FD5]","text-center","mt-1","gap-0.75","text-[18px]","leading-[22px]","bp50:mt-[7.2px]","bp50:gap-[2.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:mt-[9px]","bp62_5:gap-[3px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:mt-3","bp81_5:gap-1","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:[a.jsx(BZ,{className:Y("w-4","h-4","bp50:w-[16.8px]","bp50:h-[16.8px]","bp62_5:w-[21px]","bp62_5:h-[21px]","bp81_5:w-7","bp81_5:h-7")}),kO({count:i.bonusDays,prefix:"+"})]}),a.jsx("div",{className:Y("relative","roboto-flex-64-600-0","text-zinc-100","text-center","uppercase","mt-6","text-[48px]","leading-[48px]","bp50:mt-[57.6px]","bp50:text-[48px]","bp50:leading-[36px]","bp62_5:mt-18","bp62_5:text-[60px]","bp62_5:leading-[45px]","bp81_5:mt-24","bp81_5:text-[80px]","bp81_5:leading-[60px]"),children:`${fn({value:i.priceRubPerMonth})} ₽`}),a.jsxs("div",{className:Y("relative","roboto-flex-112-500-0","text-zinc-400","text-center","mt-1.5","text-[12px]","leading-[14px]","bp50:mt-[7.2px]","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:mt-4","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:mt-6","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:[`${h.main.plans.details.PER_MONTH_PREFIX} ${i.durationMonths} ${h.dateTime.MONTH_MANY}`,a.jsx("br",{}),`${h.main.plans.details.TOTAL_SUM_PREFIX} ${fn({value:i.priceRub})} ₽`]})]},i.id))}),a.jsxs("div",{className:Y("flex","flex-col","justify-center","mt-9","items-center","roboto-flex-112-500-0","text-zinc-400","text-[12px]","leading-[14px]","bp50:hidden","bp62_5:hidden","bp81_5:hidden"),children:[a.jsx("div",{children:h.main.plans.hints.CLIENTS_PER_YEAR}),a.jsx("div",{children:h.main.plans.hints.STORAGE_PER_CLIENT})]}),a.jsxs("div",{className:Y("flex","flex-col","items-center","justify-center","gap-4","mt-9","mx-auto","w-full","max-w-[312px]","bp50:w-auto","bp50:mx-0","bp50:max-w-none","bp50:gap-[14.4px]","bp50:mt-[57.6px]","bp62_5:w-auto","bp62_5:mx-0","bp62_5:max-w-none","bp62_5:gap-4.5","bp62_5:mt-25","bp81_5:w-auto","bp81_5:mx-0","bp81_5:max-w-none","bp81_5:gap-6","bp81_5:mt-32"),children:[a.jsxs("div",{className:"flex bp50:flex-row flex-col gap-3 w-full justify-center",children:[a.jsx(Je,{to:"/book-demo",onClick:()=>{pf({goalId:"button_book_demo_bottom"})},className:Y("cursor-pointer","flex","items-center","justify-center","rounded-full","bg-[#556FD5]","hover:bg-[#708DFE]","min-h-12","w-full","px-0","roboto-flex-112-600-0","text-white","text-[14px]","leading-[18px]","bp50:w-auto","bp50:min-h-[45.6px]","bp50:px-[36px]","bp50:text-[14.4px]","bp50:leading-[16.8px]","bp62_5:w-auto","bp62_5:min-h-[57px]","bp62_5:px-12","bp62_5:text-[18px]","bp62_5:leading-[21px]","bp81_5:w-auto","bp81_5:min-h-19","bp81_5:text-[24px]","bp81_5:leading-[28px]"),children:h.main.plans.callToAction.DEMO}),a.jsx(Je,{to:s,onClick:()=>{pf({goalId:"button_try"})},className:Y("cursor-pointer","flex","items-center","justify-center","rounded-full","bg-white","hover:bg-zinc-200","min-h-12","w-full","px-0","roboto-flex-112-600-0","text-zinc-950","text-[14px]","leading-[18px]","bp50:w-auto","bp50:min-h-[45.
8376px]","bp50:px-[36px]","bp50:text-[14.4px]","bp50:leading-[16.8px]","bp62_5:w-auto","bp62_5:min-h-[57px]","bp62_5:px-12","bp62_5:text-[18px]","bp62_5:leading-[21px]","bp81_5:w-auto","bp81_5:min-h-19","bp81_5:text-[24px]","bp81_5:leading-[28px]"),children:h.main.plans.callToAction.TRY_FOR_FREE})]}),a.jsxs("div",{className:Y("flex","items-center","justify-center","roboto-flex-112-500-0","text-zinc-400","text-right","gap-3","text-[12px]","leading-[14px]","bp50:gap-[7.2px]","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:gap-[9px]","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:gap-3","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:[a.jsx(FZ,{className:Y("w-6","h-6","bp50:w-[14.4px]","bp50:h-[14.4px]","bp62_5:w-[18px]","bp62_5:h-[18px]","bp81_5:w-6","bp81_5:h-6")}),h.main.plans.callToAction.DISCOUNT_GROUPS]})]})]})},BO=e=>l.createElement("svg",{width:284,height:76,viewBox:"0 0 284 76",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{opacity:.64,filter:"url(#filter0_f_5829_20313)"},l.createElement("path",{d:"M11 37.2154C11 28.0391 11 23.451 12.648 19.9462C14.0976 16.8632 16.4106 14.3567 19.2556 12.7858C22.4899 11 26.7238 11 35.1917 11H35.9477C38.773 11 39.2369 11 41.2397 11.0663V20.2163H25.5528C23.4359 20.2163 22.3774 20.2163 21.5688 20.6628C20.8576 21.0555 20.2793 21.6821 19.9169 22.4529C19.5049 23.3291 19.5049 24.4761 19.5049 26.7702V48.4798C19.5049 50.7739 19.5049 51.9209 19.9169 52.7971C20.2793 53.5679 20.8576 54.1945 21.5688 54.5872C22.3774 55.0337 23.4359 55.0337 25.5528 55.0337H45.5866C47.7036 55.0337 48.7621 55.0337 49.5707 54.5872C50.2819 54.1945 50.8602 53.5679 51.2226 52.7971C51.6345 51.9209 51.6345 50.7739 51.6345 48.4798V31.4808H60.0782C60.1394 33.651 60.1394 34.1538 60.1394 37.2154V38.0346C60.1394 47.2109 60.1394 51.799 58.4915 55.3038C57.0419 58.3868 54.7289 60.8933 51.8839 62.4642C48.6496 64.25 44.4156 64.25 35.9477 64.25H35.1917C26.7238 64.25 22.4899 64.25 19.2556 62.4642C16.4106 60.8933 14.0976 58.3868 12.648 55.3038C11 51.799 11 47.2109 11 38.0346V37.2154Z",fill:"url(#paint0_radial_5829_20313)"}),l.createElement("path",{d:"M11 37.2154C11 28.0391 11 23.451 12.648 19.9462C14.0976 16.8632 16.4106 14.3567 19.2556 12.7858C22.4899 11 26.7238 11 35.1917 11H35.9477C38.773 11 39.2369 11 41.2397 11.0663V20.2163H25.5528C23.4359 20.2163 22.3774 20.2163 21.5688 20.6628C20.8576 21.0555 20.2793 21.6821 19.9169 22.4529C19.5049 23.3291 19.5049 24.4761 19.5049 26.7702V48.4798C19.5049 50.7739 19.5049 51.9209 19.9169 52.7971C20.2793 53.5679 20.8576 54.1945 21.5688 54.5872C22.3774 55.0337 23.4359 55.0337 25.5528 55.0337H45.5866C47.7036 55.0337 48.7621 55.0337 49.5707 54.5872C50.2819 54.1945 50.8602 53.5679 51.2226 52.7971C51.6345 51.9209 51.6345 50.7739 51.6345 48.4798V31.4808H60.0782C60.1394 33.651 60.1394 34.1538 60.1394 37.2154V38.0346C60.1394 47.2109 60.1394 51.799 58.4915 55.3038C57.0419 58.3868 54.7289 60.8933 51.8839 62.4642C48.6496 64.25 44.4156 64.25 35.9477 64.25H35.1917C26.7238 64.25 22.4899 64.25 19.2556 62.4642C16.4106 60.8933 14.0976 58.3868 12.648 55.3038C11 51.799 11 47.2109 11 38.0346V37.2154Z",fill:"url(#paint1_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M11 37.2154C11 28.0391 11 23.451 12.648 19.9462C14.0976 16.8632 16.4106 14.3567 19.2556 12.7858C22.4899 11 26.7238 11 35.1917 11H35.9477C38.773 11 39.2369 11 41.2397 11.0663V20.2163H25.5528C23.4359 20.2163 22.3774 20.2163 21.5688 20.6628C20.8576 21.0555 20.2793 21.6821 19.9169 22.4529C19.5049 23.3291 19.5049 24.4761 19.5049 26.7702V48.4798C19.5049 50.7739 19.5049 51.9209 19.9169 52.7971C20.2793 53.5679 20.8576 54.1945 21.5688 54.5872C22.3774 55.0337 23.4359 55.0337 25.5528 55.0337H45.5866C47.7036 55.0337 48.7621 55.0337 49.5707 54.5872C50.2819 54.1945 50.8602 53.5679 51.2226 52.7971C51.6345 51.9209 51.6345 50.7739 51.6345 48.4798V31.4808H60.0782C60.1394 33.651 60.1394 34.1538 60.1394 37.2154V38.0346C60.1394 47.2109 60.1394 51.799 58.4915 55.3038C57.0419 58.3868 54.7289 60.8933 51.8839 62.4642C48.6496 64.25 44.4156 64.25 35.9477 64.25H35.1917C26.7238 64.25 22.4899 64.25 19.2556 62.4642C16.4106 60.8933 14.0976 58.3868 12.648 55.3038C11 51.799 11 47.2109 
83711 38.0346V37.2154Z",fill:"url(#paint2_radial_5829_20313)"}),l.createElement("path",{d:"M11 37.2154C11 28.0391 11 23.451 12.648 19.9462C14.0976 16.8632 16.4106 14.3567 19.2556 12.7858C22.4899 11 26.7238 11 35.1917 11H35.9477C38.773 11 39.2369 11 41.2397 11.0663V20.2163H25.5528C23.4359 20.2163 22.3774 20.2163 21.5688 20.6628C20.8576 21.0555 20.2793 21.6821 19.9169 22.4529C19.5049 23.3291 19.5049 24.4761 19.5049 26.7702V48.4798C19.5049 50.7739 19.5049 51.9209 19.9169 52.7971C20.2793 53.5679 20.8576 54.1945 21.5688 54.5872C22.3774 55.0337 23.4359 55.0337 25.5528 55.0337H45.5866C47.7036 55.0337 48.7621 55.0337 49.5707 54.5872C50.2819 54.1945 50.8602 53.5679 51.2226 52.7971C51.6345 51.9209 51.6345 50.7739 51.6345 48.4798V31.4808H60.0782C60.1394 33.651 60.1394 34.1538 60.1394 37.2154V38.0346C60.1394 47.2109 60.1394 51.799 58.4915 55.3038C57.0419 58.3868 54.7289 60.8933 51.8839 62.4642C48.6496 64.25 44.4156 64.25 35.9477 64.25H35.1917C26.7238 64.25 22.4899 64.25 19.2556 62.4642C16.4106 60.8933 14.0976 58.3868 12.648 55.3038C11 51.799 11 47.2109 11 38.0346V37.2154Z",fill:"url(#paint3_radial_5829_20313)"}),l.createElement("path",{d:"M11 37.2154C11 28.0391 11 23.451 12.648 19.9462C14.0976 16.8632 16.4106 14.3567 19.2556 12.7858C22.4899 11 26.7238 11 35.1917 11H35.9477C38.773 11 39.2369 11 41.2397 11.0663V20.2163H25.5528C23.4359 20.2163 22.3774 20.2163 21.5688 20.6628C20.8576 21.0555 20.2793 21.6821 19.9169 22.4529C19.5049 23.3291 19.5049 24.4761 19.5049 26.7702V48.4798C19.5049 50.7739 19.5049 51.9209 19.9169 52.7971C20.2793 53.5679 20.8576 54.1945 21.5688 54.5872C22.3774 55.0337 23.4359 55.0337 25.5528 55.0337H45.5866C47.7036 55.0337 48.7621 55.0337 49.5707 54.5872C50.2819 54.1945 50.8602 53.5679 51.2226 52.7971C51.6345 51.9209 51.6345 50.7739 51.6345 48.4798V31.4808H60.0782C60.1394 33.651 60.1394 34.1538 60.1394 37.2154V38.0346C60.1394 47.2109 60.1394 51.799 58.4915 55.3038C57.0419 58.3868 54.7289 60.8933 51.8839 62.4642C48.6496 64.25 44.4156 64.25 35.9477 64.25H35.1917C26.7238 64.25 22.4899 64.25 19.2556 62.4642C16.4106 60.8933 14.0976 58.3868 12.648 55.3038C11 51.799 11 47.2109 11 38.0346V37.2154Z",fill:"url(#paint4_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M41.2397 20.2163H51.6345V31.4808H41.2397V20.2163Z",fill:"url(#paint5_radial_5829_20313)"}),l.createElement("path",{d:"M41.2397 20.2163H51.6345V31.4808H41.2397V20.2163Z",fill:"url(#paint6_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M41.2397 20.2163H51.6345V31.4808H41.2397V20.2163Z",fill:"url(#paint7_radial_5829_20313)"}),l.createElement("path",{d:"M41.2397 20.2163H51.6345V31.4808H41.2397V20.2163Z",fill:"url(#paint8_radial_5829_20313)"}),l.createElement("path",{d:"M41.2397 20.2163H51.6345V31.4808H41.2397V20.2163Z",fill:"url(#paint9_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M76.5028 55.951V19.4914H86.9036C90.1154 19.4914 92.5693 20.468 94.2653 22.4212C95.9762 24.3577 96.8317 27.3459 96.8317 31.3858C96.8317 35.4091 95.9687 38.4056 94.2428 40.3755C92.5318 42.3454 90.0704 43.3304 86.8586 43.3304H83.2116V55.951H76.5028ZM83.2116 37.6711H86.2282C87.654 37.6711 88.6596 37.1703 89.2449 36.1687C89.8453 35.1503 90.1454 33.5644 90.1454 31.4109C90.1454 29.3241 89.8453 27.7716 89.2449 26.7533C88.6596 25.7349 87.654 25.2258 86.2282 25.2258H83.2116V37.6711Z",fill:"url(#paint10_radial_5829_20313)"}),l.createElement("path",{d:"M76.5028 55.951V19.4914H86.9036C90.1154 19.4914 92.5693 20.468 94.2653 22.4212C95.9762 24.3577 96.8317 27.3459 96.8317 31.3858C96.8317 35.4091 95.9687 38.4056 94.2428 40.3755C92.5318 42.3454 90.0704 43.3304 86.8586 43.3304H83.2116V55.951H76.5028ZM83.2116 37.6711H86.2282C87.654 37.6711 88.6596 37.1703 89.2449 36.1687C89.8453 35.1503 90.1454 33.5644 90.1454 31.4109C90.1454 29.3241 89.8453 27.7716 89.2449 26.7533C88.6596 25.7349 87.654 25.2258 86.2282 25.2258H83.2116V37.6711Z",fill:"url(#paint11_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M76.5028 55.951V19.4914H86.9036C90.1154 19.4914 92.5693 20.468 94.2653 22.4212C95.9762 24.3577 96.8317 27.3459 96.8317 31.3858C96.8317 35.4091 95.9687 38.4056 94.2428 40.3755C92.5318 42.3454 90.0704 43.3304 86.8586 43.3304H83.2116V55.951H76.5028ZM83.2116 37.6711H86.2282C87.654 37.6711 88.6596 37.1703 89.2449 36.1687C89.8453 35.1503 90.1454 33.5644 90.1454 31.4109C90.1454 29.3241 89.8453 27.7716 89.2449 26.7533C88.6596 25.7349 87.654 25.2258 86.2282 25.2258H83.2116V37.6711Z",fill:"url(#paint12_radial_5829_20313)"}),l.createElement("path",{d:"M76.5028 55.951V19.4914H86.9036C90.1154 19.4914 92.5693 20.468 94.2653 22.4212C95.9762 24.3577 96.8317 27.3459 96.8317 31.3858C96.8317 35.4091 95.9687 38.4056 94.2428 40.3755C92.5318 42.3454 90.0704 43.3304 86.8586 43.3304H83.2116V55.951H76.5028ZM83.2116 37.6711H86.2282C87.654 37.6711 88.6596 37.1703 89.2449 36.1687C89.8453 35.1503 90.1454 33.5644 90.1454 31.4109C90.1454 29.3241 89.8453 27.7716 89.2449 26.7533C88.6596 25.7349 87.654 25.2258 86.2282 25.2258H83.2116V37.6711Z",fill:"url(#paint13_radial_5829_20313)"}),l.createElement("path",{d:"M76.5028 55.951V19.4914H86.9036C90.1154 19.4914 92.5693 20.468 94.2653 22.4212C95.9762 24.3577 96.8317 27.3459 96.8317 31.3858C96.8317 35.4091 95.9687 38.4056 94.2428 40.3755C92.5318 42.3454 90.0704 43.3304 86.8586 43.3304H83.2116V55.951H76.5028ZM83.2116 37.6711H86.2282C87.654 37.6711 88.6596 37.1703 89.2449 36.1687C89.8453 35.1503 90.1454 33.5644 90.1454 31.4109C90.1454 29.3241 89.8453 27.7716 89.2449 26.7533C88.6596 25.7349 87.654 25.2258 86.2282 25.2258H83.2116V37.6711Z",fill:"url(#paint14_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M99.5575 55.951V19.4914H106.266V50.0664H117.05V55.951H99.5575Z",fill:"url(#paint15_radial_5829_20313)"}),l.createElement("path",{d:"M99.5575 55.951V19.4914H106.266V50.0664H117.05V55.951H99.5575Z",fill:"url(#paint16_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M99.5575 55.951V19.4914H106.266V50.0664H117.05V55.951H99.5575Z",fill:"url(#paint17_radial_5829_20313)"}),l.createElement("path",{d:"M99.5575 55.951V19.4914H106.266V50.0664H117.05V55.951H99.5575Z",fill:"url(#paint18_radial_5829_20313)"}),l.createElement("path",{d:"M99.5575 55.951V19.4914H106.266V50.0664H117.05V55.951H99.5575Z",fill:"url(#paint19_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M118.74 55.951V19.4914H136.84V25.376H125.359V34.2906H134.994V40.1251H125.359V50.0914H137.065V55.951H118.74Z",fill:"url(#paint20_radial_5829_20313)"}),l.createElement("path",{d:"M118.74 55.951V19.4914H136.84V25.376H125.359V34.2906H134.994V40.1251H125.359V50.0914H137.065V55.951H118.74Z",fill:"url(#paint21_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M118.74 55.951V19.4914H136.84V25.376H125.359V34.2906H134.994V40.1251H125.359V50.0914H137.065V55.951H118.74Z",fill:"url(#paint22_radial_5829_20313)"}),l.createElement("path",{d:"M118.74 55.951V19.4914H136.84V25.376H125.359V34.2906H134.994V40.1251H125.359V50.0914H137.065V55.951H118.74Z",fill:"url(#paint23_radial_5829_20313)"}),l.createElement("path",{d:"M118.74 55.951V19.4914H136.84V25.376H125.359V34.2906H134.994V40.1251H125.359V50.0914H137.065V55.951H118.74Z",fill:"url(#paint24_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M138.146 19.4914H145.17L149.875 43.9063C149.965 44.3403 150.048 44.7994 150.123 45.2836C150.198 45.7677 150.265 46.2852 150.325 46.8361H150.46C150.505 46.2852 150.565 45.7677 150.641 45.2836C150.731 44.7827 150.813 44.3237 150.888 43.9063L155.751 19.4914H162.167L153.635 56.0762H146.723L138.146 19.4914Z",fill:"url(#paint25_radial_5829_20313)"}),l.createElement("path",{d:"M138.146 19.4914H145.17L149.875 43.9063C149.965 44.3403 150.048 44.7994 150.123 45.2836C150.198 45.7677 150.265 46.2852 150.325 46.8361H150.46C150.505 46.2852 150.565 45.7677 150.641 45.2836C150.731 44.7827 150.813 44.3237 150.888 43.9063L155.751 19.4914H162.167L153.635 56.0762H146.723L138.146 19.4914Z",fill:"url(#paint26_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M138.146 19.4914H145.17L149.875 43.9063C149.965 44.3403 150.048 44.7994 150.123 45.2836C150.198 45.7677 150.265 46.2852 150.325 46.8361H150.46C150.505 46.2852 150.565 45.7677 150.641 45.2836C150.731 44.7827 150.813 44.3237 150.888 43.9063L155.751 19.4914H162.167L153.635 56.0762H146.723L138.146 19.4914Z",fill:"url(#paint27_radial_5829_20313)"}),l.createElement("path",{d:"M138.146 19.4914H145.17L149.875 43.9063C149.965 44.3403 150.048 44.7994 150.123 45.2836C150.198 45.7677 150.265 46.2852 150.325 46.8361H150.46C150.505 46.2852 150.565 45.7677 150.641 45.2836C150.731 44.7827 150.813 44.3237 150.888 43.9063L155.751 19.4914H162.167L153.635 56.0762H146.723L138.146 19.4914Z",fill:"url(#paint28_radial_5829_20313)"}),l.createElement("path",{d:"M138.146 19.4914H145.17L149.875 43.9063C149.965 44.3403 150.048 44.7994 150.123 45.2836C150.198 45.7677 150.265 46.2852 150.325 46.8361H150.46C150.505 46.2852 150.565 45.7677 150.641 45.2836C150.731 44.7827 150.813 44.3237 150.888 43.9063L155.751 19.4914H162.167L153.635 56.0762H146.723L138.146 19.4914Z",fill:"url(#paint29_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M158.422 55.951L166.932 19.3411H174.226L182.826 55.951H175.757L170.849 32.0369C170.744 31.4526 170.646 30.6847 170.556 29.7331C170.466 28.7816 170.384 28.0721 170.308 27.
8376046H170.173C170.098 28.0721 170.008 28.7816 169.903 29.7331C169.813 30.6847 169.708 31.4526 169.588 32.0369L164.658 55.951H158.422ZM163.442 47.9629L164.613 42.3788H176.252L177.445 47.9629H163.442Z",fill:"url(#paint30_radial_5829_20313)"}),l.createElement("path",{d:"M158.422 55.951L166.932 19.3411H174.226L182.826 55.951H175.757L170.849 32.0369C170.744 31.4526 170.646 30.6847 170.556 29.7331C170.466 28.7816 170.384 28.0721 170.308 27.6046H170.173C170.098 28.0721 170.008 28.7816 169.903 29.7331C169.813 30.6847 169.708 31.4526 169.588 32.0369L164.658 55.951H158.422ZM163.442 47.9629L164.613 42.3788H176.252L177.445 47.9629H163.442Z",fill:"url(#paint31_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M158.422 55.951L166.932 19.3411H174.226L182.826 55.951H175.757L170.849 32.0369C170.744 31.4526 170.646 30.6847 170.556 29.7331C170.466 28.7816 170.384 28.0721 170.308 27.6046H170.173C170.098 28.0721 170.008 28.7816 169.903 29.7331C169.813 30.6847 169.708 31.4526 169.588 32.0369L164.658 55.951H158.422ZM163.442 47.9629L164.613 42.3788H176.252L177.445 47.9629H163.442Z",fill:"url(#paint32_radial_5829_20313)"}),l.createElement("path",{d:"M158.422 55.951L166.932 19.3411H174.226L182.826 55.951H175.757L170.849 32.0369C170.744 31.4526 170.646 30.6847 170.556 29.7331C170.466 28.7816 170.384 28.0721 170.308 27.6046H170.173C170.098 28.0721 170.008 28.7816 169.903 29.7331C169.813 30.6847 169.708 31.4526 169.588 32.0369L164.658 55.951H158.422ZM163.442 47.9629L164.613 42.3788H176.252L177.445 47.9629H163.442Z",fill:"url(#paint33_radial_5829_20313)"}),l.createElement("path",{d:"M158.422 55.951L166.932 19.3411H174.226L182.826 55.951H175.757L170.849 32.0369C170.744 31.4526 170.646 30.6847 170.556 29.7331C170.466 28.7816 170.384 28.0721 170.308 27.6046H170.173C170.098 28.0721 170.008 28.7816 169.903 29.7331C169.813 30.6847 169.708 31.4526 169.588 32.0369L164.658 55.951H158.422ZM163.442 47.9629L164.613 42.3788H176.252L177.445 47.9629H163.442Z",fill:"url(#paint34_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M183.908 55.951V19.4914H190.617V33.0135L199.217 19.4914H206.24L190.617 43.3304V55.951H183.908ZM199.374 55.951L190.774 38.5976L194.579 32.3875L206.848 55.951H199.374Z",fill:"url(#paint35_radial_5829_20313)"}),l.createElement("path",{d:"M183.908 55.951V19.4914H190.617V33.0135L199.217 19.4914H206.24L190.617 43.3304V55.951H183.908ZM199.374 55.951L190.774 38.5976L194.579 32.3875L206.848 55.951H199.374Z",fill:"url(#paint36_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M183.908 55.951V19.4914H190.617V33.0135L199.217 19.4914H206.24L190.617 43.3304V55.951H183.908ZM199.374 55.951L190.774 38.5976L194.579 32.3875L206.848 55.951H199.374Z",fill:"url(#paint37_radial_5829_20313)"}),l.createElement("path",{d:"M183.908 55.951V19.4914H190.617V33.0135L199.217 19.4914H206.24L190.617 43.3304V55.951H183.908ZM199.374 55.951L190.774 38.5976L194.579 32.3875L206.848 55.951H199.374Z",fill:"url(#paint38_radial_5829_20313)"}),l.createElement("path",{d:"M183.908 55.951V19.4914H190.617V33.0135L199.217 19.4914H206.24L190.617 43.3304V55.951H183.908ZM199.374 55.951L190.774 38.5976L194.579 32.3875L206.848 55.951H199.374Z",fill:"url(#paint39_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M206.4 39.7495V35.6178C206.4 29.9752 207.488 25.76 209.664 22.9721C211.855 20.1842 214.745 18.7902 218.332 18.7902C221.919 18.7902 224.808 20.1842 226.999 22.9721C229.205 25.76 230.308 29.9752 230.308 35.6178V39.7495C230.308 45.4088 229.205 49.6407 226.999 52.4453C224.793 55.2499 221.904 56.6521 218.332 56.6521C214.745 56.6521 211.855 55.2499 209.664 52.4453C207.488 49.6407 206.4 45.4088 206.4 39.7495ZM213.289 41.3521C213.289 44.5741 213.716 46.9613 214.572 48.5138C215.442 50.0497 216.696 50.8176 218.332 50.8176C219.982 50.8176 221.236 50.0497 222.091 48.5138C222.962 46.9613 223.397 44.5741 223.397 41.3521V34.0903C223.397 30.885 222.962 28.5145 222.091 26.9786C221.236 25.4261 219.982 24.6498 218.332 24.6498C216.696 24.6498 215.442 25.4261 214.572 26.9786C213.716 28.5145 213.289 30.885 213.289 34.0903V41.3521Z",fill:"url(#paint40_radial_5829_20313)"}),l.createElement("path",{d:"M206.4 39.7495V35.6178C206.4 29.9752 207.488 25.76 209.664 22.9721C211.855 20.1842 214.745 18.7902 218.332 18.7902C221.919 18.7902 224.808 20.1842 226.999 22.9721C229.205 25.76 230.308 29.9752 230.308 35.6178V39.7495C230.308 45.4088 229.205 49.6407 226.999 52.4453C224.793 55.2499 221.904 56.6521 218.332 56.
8376521C214.745 56.6521 211.855 55.2499 209.664 52.4453C207.488 49.6407 206.4 45.4088 206.4 39.7495ZM213.289 41.3521C213.289 44.5741 213.716 46.9613 214.572 48.5138C215.442 50.0497 216.696 50.8176 218.332 50.8176C219.982 50.8176 221.236 50.0497 222.091 48.5138C222.962 46.9613 223.397 44.5741 223.397 41.3521V34.0903C223.397 30.885 222.962 28.5145 222.091 26.9786C221.236 25.4261 219.982 24.6498 218.332 24.6498C216.696 24.6498 215.442 25.4261 214.572 26.9786C213.716 28.5145 213.289 30.885 213.289 34.0903V41.3521Z",fill:"url(#paint41_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M206.4 39.7495V35.6178C206.4 29.9752 207.488 25.76 209.664 22.9721C211.855 20.1842 214.745 18.7902 218.332 18.7902C221.919 18.7902 224.808 20.1842 226.999 22.9721C229.205 25.76 230.308 29.9752 230.308 35.6178V39.7495C230.308 45.4088 229.205 49.6407 226.999 52.4453C224.793 55.2499 221.904 56.6521 218.332 56.6521C214.745 56.6521 211.855 55.2499 209.664 52.4453C207.488 49.6407 206.4 45.4088 206.4 39.7495ZM213.289 41.3521C213.289 44.5741 213.716 46.9613 214.572 48.5138C215.442 50.0497 216.696 50.8176 218.332 50.8176C219.982 50.8176 221.236 50.0497 222.091 48.5138C222.962 46.9613 223.397 44.5741 223.397 41.3521V34.0903C223.397 30.885 222.962 28.5145 222.091 26.9786C221.236 25.4261 219.982 24.6498 218.332 24.6498C216.696 24.6498 215.442 25.4261 214.572 26.9786C213.716 28.5145 213.289 30.885 213.289 34.0903V41.3521Z",fill:"url(#paint42_radial_5829_20313)"}),l.createElement("path",{d:"M206.4 39.7495V35.6178C206.4 29.9752 207.488 25.76 209.664 22.9721C211.855 20.1842 214.745 18.7902 218.332 18.7902C221.919 18.7902 224.808 20.1842 226.999 22.9721C229.205 25.76 230.308 29.9752 230.308 35.6178V39.7495C230.308 45.4088 229.205 49.6407 226.999 52.4453C224.793 55.2499 221.904 56.6521 218.332 56.6521C214.745 56.6521 211.855 55.2499 209.664 52.4453C207.488 49.6407 206.4 45.4088 206.4 39.7495ZM213.289 41.3521C213.289 44.5741 213.716 46.9613 214.572 48.5138C215.442 50.0497 216.696 50.8176 218.332 50.8176C219.982 50.8176 221.236 50.0497 222.091 48.5138C222.962 46.9613 223.397 44.5741 223.397 41.3521V34.0903C223.397 30.885 222.962 28.5145 222.091 26.9786C221.236 25.4261 219.982 24.6498 218.332 24.6498C216.696 24.6498 215.442 25.4261 214.572 26.9786C213.716 28.5145 213.289 30.885 213.289 34.0903V41.3521Z",fill:"url(#paint43_radial_5829_20313)"}),l.createElement("path",{d:"M206.4 39.7495V35.6178C206.4 29.9752 207.488 25.76 209.664 22.9721C211.855 20.1842 214.745 18.7902 218.332 18.7902C221.919 18.7902 224.808 20.1842 226.999 22.9721C229.205 25.76 230.308 29.9752 230.308 35.6178V39.7495C230.308 45.4088 229.205 49.6407 226.999 52.4453C224.793 55.2499 221.904 56.6521 218.332 56.6521C214.745 56.6521 211.855 55.2499 209.664 52.4453C207.488 49.6407 206.4 45.4088 206.4 39.7495ZM213.289 41.3521C213.289 44.5741 213.716 46.9613 214.572 48.5138C215.442 50.0497 216.696 50.8176 218.332 50.8176C219.982 50.8176 221.236 50.0497 222.091 48.5138C222.962 46.9613 223.397 44.5741 223.397 41.3521V34.0903C223.397 30.885 222.962 28.5145 222.091 26.9786C221.236 25.4261 219.982 24.6498 218.332 24.6498C216.696 24.6498 215.442 25.4261 214.572 26.9786C213.716 28.5145 213.289 30.885 213.289 34.0903V41.3521Z",fill:"url(#paint44_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M231.391 52.0696C231.391 50.8677 231.743 49.841 232.449 48.9896C233.169 48.1382 234.197 47.7125 235.533 47.7125C236.869 47.7125 237.889 48.1382 238.595 48.9896C239.3 49.841 239.653 50.876 239.653 52.0947C239.653 53.3134 239.3 54.3484 238.595 55.1998C237.889 56.0512 236.861 56.4769 235.51 56.4769C234.19 56.4769 233.169 56.0512 232.449 55.1998C231.743 54.3317 231.391 53.2883 231.391 52.0696Z",fill:"url(#paint45_radial_5829_20313)"}),l.createElement("path",{d:"M231.391 52.0696C231.391 50.8677 231.743 49.841 232.449 48.9896C233.169 48.1382 234.197 47.7125 235.533 47.7125C236.869 47.7125 237.889 48.1382 238.595 48.9896C239.3 49.841 239.653 50.876 239.653 52.0947C239.653 53.3134 239.3 54.3484 238.595 55.1998C237.889 56.0512 236.861 56.4769 235.51 56.4769C234.19 56.4769 233.169 56.0512 232.449 55.1998C231.743 54.3317 231.391 53.2883 231.391 52.0696Z",fill:"url(#paint46_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M231.391 52.0696C231.391 50.8677 231.743 49.841 232.449 48.9896C233.169 48.1382 234.197 47.7125 235.533 47.7125C236.869 47.7125 237.889 48.1382 238.595 48.9896C239.3 49.841 239.653 50.876 239.653 52.0947C239.653 53.3134 239.3 54.3484 238.595 55.1998C237.889 56.0512 236.861 56.4769 235.51 56.4769C234.19 56.4769 233.169 56.0512 232.449 55.1998C231.743 54.3317 231.391 53.2883 231.391 52.0696Z",fill:"url(#paint47_radial_5829_20313)"}),l.createElement("path",{d:"M231.391 52.0696C231.391 50.8677 231.743 49.841 232.449 48.9896C233.169 48.1382 234.197 47.7125 235.533 47.7125C236.869 47.7125 237.889 48.1382 238.595 48.9896C239.3 49.841 239.653 50.876 239.653 52.0947C239.653 53.3134 239.3 54.3484 238.595 55.1998C237.889 56.0512 236.861 56.4769 235.51 56.4769C234.19 56.4769 233.169 56.0512 232.449 55.1998C231.743 54.3317 231.391 53.2883 231.391 52.0696Z",fill:"url(#paint48_radial_5829_20313)"}),l.createElement("path",{d:"M231.391 52.0696C231.391 50.8677 231.743 49.841 232.449 48.9896C233.169 48.1382 234.197 47.7125 235.533 47.7125C236.869 47.7125 237.889 48.1382 238.595 48.9896C239.3 49.841 239.653 50.876 239.653 52.0947C239.653 53.3134 239.3 54.3484 238.595 55.1998C237.889 56.0512 236.861 56.4769 235.51 56.4769C234.19 56.4769 233.169 56.0512 232.449 55.1998C231.743 54.3317 231.391 53.2883 231.391 52.0696Z",fill:"url(#paint49_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M240.51 55.951L249.02 19.3411H256.314L264.914 55.951H257.845L252.937 32.0369C252.832 31.4526 252.734 30.6847 252.644 29.7331C252.554 28.7816 252.472 28.0721 252.397 27.6046H252.262C252.187 28.0721 252.097 28.7816 251.992 29.7331C251.902 30.6847 251.796 31.4526 251.676 32.0369L246.746 55.951H240.51ZM245.53 47.9629L246.701 42.3788H258.34L259.533 47.9629H245.53Z",fill:"url(#paint50_radial_5829_20313)"}),l.createElement("path",{d:"M240.51 55.951L249.02 19.3411H256.314L264.914 55.951H257.845L252.937 32.0369C252.832 31.4526 252.734 30.6847 252.644 29.7331C252.554 28.7816 252.472 28.0721 252.397 27.6046H252.262C252.187 28.0721 252.097 28.7816 251.992 29.7331C251.902 30.6847 251.796 31.4526 251.676 32.0369L246.746 55.951H240.51ZM245.53 47.9629L246.701 42.3788H258.34L259.533 47.9629H245.53Z",fill:"url(#paint51_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M240.51 55.951L249.02 19.3411H256.314L264.914 55.951H257.845L252.937 32.0369C252.832 31.4526 252.734 30.6847 252.644 29.7331C252.554 28.7816 252.472 28.0721 252.397 27.6046H252.262C252.187 28.0721 252.097 28.7816 251.992 29.7331C251.902 30.6847 251.796 31.4526 251.676 32.0369L246.746 55.951H240.51ZM245.53 47.9629L246.701 42.3788H258.34L259.533 47.9629H245.53Z",fill:"url(#paint52_radial_5829_20313)"}),l.createElement("path",{d:"M240.51 55.951L249.02 19.3411H256.314L264.914 55.951H257.845L252.937 32.0369C252.832 31.4526 252.734 30.6847 252.644 29.7331C252.554 28.7816 252.472 28.0721 252.397 27.6046H252.262C252.187 28.0721 252.097 28.7816 251.992 29.7331C251.902 30.6847 251.796 31.4526 251.676 32.0369L246.746 55.951H240.51ZM245.53 47.9629L246.701 42.3788H258.34L259.533 47.9629H245.53Z",fill:"url(#paint53_radial_5829_20313)"}),l.createElement("path",{d:"M240.51 55.951L249.02 19.3411H256.314L264.914 55.951H257.845L252.937 32.0369C252.832 31.4526 252.734 30.6847 252.644 29.7331C252.554 28.7816 252.472 28.0721 252.397 27.6046H252.262C252.187 28.0721 252.097 28.7816 251.992 29.7331C251.902 30.6847 251.796 31.4526 251.676 32.0369L246.746 55.951H240.51ZM245.53 47.9629L246.701 42.3788H258.34L259.533 47.9629H245.53Z",fill:"url(#paint54_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}}),l.createElement("path",{d:"M266.041 55.951V19.4914H272.75V55.951H266.041Z",fill:"url(#paint55_radial_5829_20313)"}),l.createElement("path",{d:"M266.041 55.951V19.4914H272.75V55.951H266.041Z",fill:"url(#paint56_radial_5829_20313)",style:{mixBlendMode:"color-dodge"}}),l.createElement("path",{d:"M266.041 55.951V19.4914H272.75V55.951H266.041Z",fill:"url(#paint57_radial_5829_20313)"}),l.createElement("path",{d:"M266.041 55.951V19.4914H272.75V55.951H266.041Z",fill:"url(#paint58_radial_5829_20313)"}),l.createElement("path",{d:"M266.041 55.951V19.4914H272.75V55.951H266.041Z",fill:"url(#paint59_radial_5829_20313)",fillOpacity:.3,style:{mixBlendMode:"overlay"}})),l.createElement("path",{d:"M14 37.3101C14 29.2582 14 25.2323 15.6084 22.1569C17.0233 19.4517 19.2808 17.2523 22.0576 15.8739C25.2143 14.3069 29.3467 14.3069 37.6115 14.3069H38.3493C41.1068 14.3069 41.5596 14.3069 43.5143 14.3651V22.3939H28.2038C26.1376 22.3939 25.1045 22.3939 24.3153 22.7857C23.6211 23.1303 23.0567 23.6801 22.703 24.3564C22.3009 25.1253 22.3009 26.1318 22.3009 28.1447V47.1943C22.3009 49.2072 22.3009 50.2137 22.703 50.9826C23.0567 51.6589 23.6211 52.2087 24.3153 52.5533C25.1045 52.9451 26.1376 52.9451 28.2038 52.9451H47.757C49.8232 52.9451 50.8563 52.9451 51.6455 52.5533C52.3397 52.2087 52.9041 51.6589 53.2578 50.9826C53.6599 50.2137 53.6599 49.2072 53.6599 47.1943V32.2781H61.9011C61.9608 34.1825 61.9608 34.6236 61.9608 37.3101V38.0289C61.9608 46.0808 61.9608 50.1067 60.3524 53.1821C58.9375 55.8873 56.68 58.0867 53.9032 59.4651C50.7465 61.0321 46.6141 61.0321 38.3493 61.0321H37.6115C29.3467 61.0321 25.2143 61.0321 22.0576 59.4651C19.2808 58.0867 17.0233 55.8873 15.6084 53.1821C14 50.1067 14 46.0808 14 38.0289V37.3101Z",fill:"white"}),l.createElement("path",{d:"M43.5143 22.3939H53.6599V32.2781H43.5143V22.3939Z",fill:"white"}),l.createElement("path",{d:"M77.9316 53.75V21.7578H88.083C91.2178 21.7578 93.6128 22.6147 95.2681 24.3286C96.938 26.0278 97.7729 28.6499 97.7729 32.1948C97.7729 35.7251 96.9307 38.3545 95.2461 40.083C93.5762 41.8115 91.1738 42.6758 88.0391 42.6758H84.4795V53.75H77.9316ZM84.4795 37.71H87.4238C88.8154 37.71 89.7969 37.2705 90.3682 36.3916C90.9541 35.498 91.2471 34.1064 91.2471 32.2168C91.2471 30.3857 90.9541 29.0234 90.3682 28.1299C89.7969 27.2363 88.8154 26.7895 87.4238 26.7895H84.4795V37.71Z",fill:"white"}),l.createElement("path",{d:"M100.433 53.75V21.7578H106.981V48.5864H117.506V53.75H100.433Z",fill:"white"}
837),l.createElement("path",{d:"M119.156 53.75V21.7578H136.822V26.9214H125.616V34.7437H135.02V39.8633H125.616V48.6084H137.042V53.75H119.156Z",fill:"white"}),l.createElement("path",{d:"M138.096 21.7578H144.952L149.544 43.1812C149.632 43.562 149.712 43.9648 149.786 44.3896C149.859 44.8145 149.925 45.2686 149.984 45.752H150.115C150.159 45.2686 150.218 44.8145 150.291 44.3896C150.379 43.9502 150.46 43.5474 150.533 43.1812L155.279 21.7578H161.541L153.213 53.8599H146.468L138.096 21.7578Z",fill:"white"}),l.createElement("path",{d:"M157.886 53.75L166.191 21.626H173.311L181.704 53.75H174.805L170.015 32.7661C169.912 32.2534 169.817 31.5796 169.729 30.7446C169.641 29.9097 169.561 29.2871 169.487 28.877H169.355C169.282 29.2871 169.194 29.9097 169.092 30.7446C169.004 31.5796 168.901 32.2534 168.784 32.7661L163.972 53.75H157.886ZM162.786 46.7407L163.928 41.8408H175.288L176.453 46.7407H162.786Z",fill:"white"}),l.createElement("path",{d:"M182.761 53.75V21.7578H189.308V33.623L197.702 21.7578H204.557L189.308 42.6758V53.75H182.761ZM197.856 53.75L189.462 38.5229L193.176 33.0737L205.151 53.75H197.856Z",fill:"white"}),l.createElement("path",{d:"M204.713 39.5337V35.9082C204.713 30.957 205.775 27.2583 207.899 24.812C210.038 22.3657 212.858 21.1426 216.359 21.1426C219.859 21.1426 222.679 22.3657 224.818 24.812C226.971 27.2583 228.048 30.957 228.048 35.9082V39.5337C228.048 44.4995 226.971 48.2129 224.818 50.6738C222.665 53.1348 219.845 54.3652 216.359 54.3652C212.858 54.3652 210.038 53.1348 207.899 50.6738C205.775 48.2129 204.713 44.4995 204.713 39.5337ZM211.437 40.9399C211.437 43.7671 211.854 45.8618 212.689 47.2241C213.539 48.5718 214.762 49.2456 216.359 49.2456C217.97 49.2456 219.193 48.5718 220.028 47.2241C220.878 45.8618 221.302 43.7671 221.302 40.9399V34.5679C221.302 31.7554 220.878 29.6753 220.028 28.3276C219.193 26.9653 217.97 26.2842 216.359 26.2842C214.762 26.2842 213.539 26.9653 212.689 28.3276C211.854 29.6753 211.437 31.7554 211.437 34.5679V40.9399Z",fill:"white"}),l.createElement("path",{d:"M229.104 50.3442C229.104 49.2895 229.449 48.3887 230.137 47.6416C230.84 46.8945 231.844 46.521 233.147 46.521C234.451 46.521 235.447 46.8945 236.136 47.6416C236.824 48.3887 237.168 49.2969 237.168 50.3662C237.168 51.4355 236.824 52.3437 236.136 53.0908C235.447 53.8379 234.444 54.2114 233.125 54.2114C231.836 54.2114 230.84 53.8379 230.137 53.0908C229.449 52.3291 229.104 51.4136 229.104 50.3442Z",fill:"white"}),l.createElement("path",{d:"M238.005 53.75L246.311 21.626H253.43L261.823 53.75H254.924L250.134 32.7661C250.031 32.2534 249.936 31.5796 249.848 30.7446C249.76 29.9097 249.68 29.2871 249.607 28.877H249.475C249.402 29.2871 249.314 29.9097 249.211 30.7446C249.123 31.5796 249.021 32.2534 248.904 32.7661L244.092 53.75H238.005ZM242.905 46.7407L244.048 41.8408H255.407L256.572 46.7407H242.905Z",fill:"white"}),l.createElement("path",{d:"M262.924 53.75V21.7578H269.472V53.75H262.924Z",fill:"white"}),l.createElement("defs",null,l.createElement("filter",{id:"filter0_f_5829_20313",x:.102041,y:.102041,width:283.546,height:75.0459,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},l.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),l.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),l.createElement("feGaussianBlur",{stdDeviation:5.44898,result:"effect1_foregroundBlur_5829_20313"})),l.createElement("radialGradient",{id:"paint0_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint1_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint2_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint3_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint4_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint5_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3
837033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint6_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint7_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint8_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint9_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint10_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint11_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint12_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint13_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint14_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint15_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint16_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint17_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint18_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint19_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint20_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3
837033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint21_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint22_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint23_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint24_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint25_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint26_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint27_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint28_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint29_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint30_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint31_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint32_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint33_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint34_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint35_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3
837033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint36_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint37_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint38_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint39_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint40_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint41_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint42_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint43_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint44_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint45_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint46_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint47_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint48_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint49_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint50_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3
837033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint51_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint52_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint53_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint54_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})),l.createElement("radialGradient",{id:"paint55_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 64.25) rotate(-11.4992) scale(133.556 73.3033)"},l.createElement("stop",{stopColor:"#E81D72"}),l.createElement("stop",{offset:1,stopColor:"#FF0000",stopOpacity:0})),l.createElement("radialGradient",{id:"paint56_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 11) rotate(11.4992) scale(133.556 30.934)"},l.createElement("stop",{stopColor:"#FF8D6C"}),l.createElement("stop",{offset:1,stopColor:"#FF5C00",stopOpacity:.6})),l.createElement("radialGradient",{id:"paint57_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 11) rotate(168.501) scale(133.556 81.2545)"},l.createElement("stop",{stopColor:"#00A7FF"}),l.createElement("stop",{offset:1,stopColor:"#00A6FE",stopOpacity:.12})),l.createElement("radialGradient",{id:"paint58_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(272.75 64.25) rotate(-168.501) scale(133.556 52.1811)"},l.createElement("stop",{offset:.10272,stopColor:"#520AEB"}),l.createElement("stop",{offset:1,stopColor:"#9F73FF",stopOpacity:0})),l.createElement("radialGradient",{id:"paint59_radial_5829_20313",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(141.875 11) rotate(90) scale(31.1611 51.0077)"},l.createElement("stop",{stopColor:"#F9C43C"}),l.createElement("stop",{offset:1,stopColor:"#E7A601",stopOpacity:0})))),QZ=e=>l.createElement("svg",{width:73,height:54,viewBox:"0 0 73 54",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},l.createElement("rect",{x:.5,width:72,height:54,fill:"url(#pattern0_5829_20251)"}),l.createElement("defs",null,l.createElement("pattern",{id:"pattern0_5829_20251",patternContentUnits:"objectBoundingBox",width:1,height:1},l.createElement("use",{xlinkHref:"#image0_5829_20251",transform:"matrix(0.0025 0 0 0.00333333 -0.0025 0)"})),l.createElement("image",{id:"image0_5829_20251",width:402,height:300,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAAEsCAYAAADpQjX/AAAACXBIWXMAAC4jAAAuIwF4pT92AAAgAElEQVR4nO3d/1UcOdbGcWnP/L9MBIYIBkcARGAcgSECQwSYCMARgCMAR0A7AtoRuCcC90agPcK37HK7f1RJqipd6fs5x2dm33cwTdFdT0lXurKmYs65PWPM4coV2Jc/bUtjzHzNlZpba5c1X0MAKD5InHPHrXD4xxjThMde4m81l8BZGGP+lX8uCBsApSsqSJxzPiCOJTAO14w2ptKEyhcJHB8ui0xe20/OOR+2Z5m8nMbMWjvL46UAWOcvzVdFpqZOjTFH8s/Uo4xUmhHRceu1+yCZSbjMMgkW/xqvMngdqwgSIGPqgqQVHm/kn1o1T/9n8nPN5Yb5yVq7rh4DAFlSEyRS63iX4dRLKs1U3IWMVh4JFQAa/Cfn1+hHH865M+fcN2PMU8EhssqPVi6MMc/OuWe5BrlO2wGoXJZBIgHywRjjA+RuzXLcmhzKNfjmnLuTgjgAZCOrIFkJkKuMi+dT2JMRGYECICvZBImfvvFTOQRIJwQKgGxMHiR+74dz7okprCBNoNxQQwEwlUmDRKaxntv7KxDkQgKllsUIADIySZDIKOQ5081vWvkRiZ/qemK6C8CYRg8SeWp+yqh9SWmOZdnwRe0XAsA4Rg0SXxyWWgjz+cPy19fXTR6onQAY2ihBIst6nyvaUJiLU6mdMPoDMJjBg0RuYkxlTWdPproIcQCDGDRICJGs+EL8Te0XAUB6gwVJK0SYo8/HhdSpACCZQYKEEMnaGUV4ACklDxJCRAVfhH8iTACkkDRIZCMcIaKDD/yH2i8CgHjJgkSebh8IEVWOqZkAiJVyRHLH6iyVzggTADGSHLUrzRc1n59eOx8mX4wxi9ovBID+okckzrlTmi8W4Y4uzABCRAWJ1EWYFikHDwQAeosdkdCAEQAqFxwk0ruJuggAVC4oSGRKi75NAIDgEckNU1oAABMSJM65Y84VAQA0QkYkrOwBAPzUK0hkNMJeAwDAT31HJIxGAAC/6dwipdDRyNIYMzfGNO1BXlqEWGtnm75ArkNjX/68kn8esggBQG369NoqZTTyKMExs9bO+37xtpAxv1rp+0A5kuClkSWAonUKEjmsSvNoxI80Phpj7q21yyG/kbW2Gdn4wGr23PiNm++oLwEoUdcayXulP7sfPZxYaw+stbdDh8g6/ntaa32AnRhjDowxtzKlBgBF2Bkk8kStbd/IQgLkZNdU1Jj8aMVaeymBck2gAChBlxGJtn5a1zICySZAVskoxZ/h8rqZAgMArboEiZZpLT8KeS03aBVkhPLWGPOW0QkArbYGSWsFUu7mEiK9V2HlwFr7KKMTla8fQN12jUg0TGvdSz1E9RO9rPY6kZ8HANTYtfz3TeY/iN8Lcp7B60hCwvDcOWdojAlAi40jElmtlfO+h7nUFooj4cjIBIAK26a2cg4R/+T+Vvt01g6X1EwAaLAtSI4yfv3XUlMoloTkCau5AORuW5DkulrL10VuM3gdg5MwKXL6DkA5NE5tXWfwGkYjGyurCE4AOq0NEmnSmKNZzjvWB0Q7FQDZ2rT8N9cg+ZTBaxidn+Jyzvni+11lP7pKK2fWaLPUurEX09kUJPuZ/k6q7UvlOwg7564y/t3gR4h8UH52zzmrBdHXphrJPxleyVnhy327qKo+pI1z7kx7iPgHlgxeB5TZFCQ5Hhdb/VOSfMiLXvaslYSI5qnHS0IEoTYFSY7TJ//L4DXk4GPtFyA3UhPRHCL3tSypxzA0BUmNq7XW4akxI7LC8UHxj3BfUr86TKPrUbvIhNSJCJMMSIg8ZToV3EVRTU8xHYJEp8+1X4CpSVPTB8UhUmzTU4xPU5BoXpuflByEVfsKtslIiDwpXoo9L+EMH+RDU5D8N4PXkBNqRhNohYiGk0PXqaFzNka262CrnDAi+Z1fvfU18d/5igO1drpTHiInpXfOxvg0BcmhfxrkSeoH6TmWdFQiy1gJkg2cc3dKjp9epwmR6vdjIT1txXatH2IoJyGiOWTPCREMRVuQvM/gNaAysmtde4hU26cOw9sUJLkWcg+Vd1aFMgW0PqF/FgancR/JTQavARUoIETuCRGMYVOQfMn46h9Kq25gMLJrXfNDC61PMJpNQZL78sArprgwlAJanxAiGNWmINGwuuMh4yOBoZRzbl95iPjP7mUGrwMVWRskskww9/0aLzuMCROkUkj/LFqfYHTbiu0aWnA0Yc
837ImOkQpoPXJghDBVLYFSc4F9zZ/A7hzzj3IzQAIQf8sIJD2EUmb3/X+zTl3kc9Lggaya117/yx2rWMyG4NE3pjamrv5EcmNc+4b013oooDWJ4QIJrdrQ6LWVuX7Mt313Tl3IytxgN/IfiT6ZwGRdgWJ9pP4/AjlQqa8nv20F6EC82vX+pXii0HrE2Rja5BIo7dSzi5odio3oeJHKqcU6OtTQOuTa0IEOenSa6vErqGHMlLxewa+t4LljBFL2aQjgvb+WbQIQla6HGz1UW66JTtsr9pxzhmpD/n553/ln3OWV+omm1cfFP8QtD5BlnYGiT+W0zk3q/Co2+PVn9k5t2xCxRjzPwmbJQXP/BXQP2tOiCBXXY/a/ciZ6S/2VgLmpVgrI5iF/CFkMlNK65MMXgewVqcg8UV359xCltVivX35sytkmqmyhR/tcS2H1Wp9ovW9S/8sZK/riMS7Vl6knNJqyLxo1WIWEjAzajHpFNA/i9YnUKFzkPjlhs65K0YlybXDpRnFNLWYL/LPGTeTICW0PmHUiuz1GZEYOedA86oXLVZrMUamFmcSLjNuMNtJ65PTnF/jFvTPgiq9zmyXDYpa26Zoty/tPO5kU6X/c8emyj8V0D/rkhCBJr2CRHD6Wh6aYGk2VT7IhsqqQ0W6P2vvn8WudajSO0jkSemaX3N2TmW00oSK1mmdYNL65EbpyzeECLQKGZEYadHA0Dtfp3KmvQ+VDzW0fSmgf9Y9IQKtgoJEsMs2f3uyEqyppxQZKLJrXfNIhNYnUC04SGSKi3qJHmclBkoBrU8eCRFoFzMi8WFy65+meBeo0gTKB+2F+RL6ZzGyRwmigkRcUi9RyU95PWstyksI3mnvn8VGU5QgOkjkg3BCmKi0L0X5O02jk0JanxAiKEaKEUkTJufyAYE+Z8puzIQIkJEkQWJ+Fd9PCBO1VKx8kl3r2kOE0TuKkixIDGGCgRXQ+uQtIYISJQ0S8ytMDqiZICV/pn4BrU/oU4ciJQ8S83sBng8Oosmu9QvFV5LWJyiaHfqHkydJzTcBTGuuuCbi3Vpr2biLog0eJOZHmJwqX/MPhKD1CaowSpCYH2GyL2Fy3OE/B7QjRFCN0YKkIedFXDE6QcH8ufuv+QWjFoMU27eR/lwH9OhCoZol8EA1Rg8SI6u6ZNjPyi6UhP5ZqNLoU1vryPLOK+n9BGjErnVUK4sgaUigvFe+3BP1IURQtayCpOGcO5ZAqe7ccahDiKB6WQZJQ5YMN4HCtBdyxK51VC/rIGmTTY1vJFRYOowcXMoqRKBqaoKkjVBBJvx562/5ZaB2KoOkTeopb2THPEV6jO2Err6onfogaZMjWP0o5R+CBSNZWGsPuNioWVFBskqC5VBC5Uj+nakwpHZtrf3AVUWtig6SdVbC5ZWsBqORJGL4JcCvrbULriJqVF2QbCJLjZtQ+a+EzT7LjtERhXdUiyDpwDnXTIk1/zySr2IkgzYK76gSQRKpNVXWjF6OGMlUi8I7qkSQDKQVMIeyiuyQVWRVoPCO6hAkI5JwaVaQsTy5TBTeUR2CZEKtfS9vaFBZFArvqApBkolWqLyjiF8ECu+oBkGSIVmK7A/6Oqv9Wii2kCkuTktE8SY5ahfb+fl1OYr4b862V8s/DFzUfhFQB0YkCsgI5Y4pL5UOKLyjdIxIFJARyok//6L2a6HQXe0XAOVjRKKM7LJ/ovmkKm+ttY+1XwSUiyBRiDBRh8I7isbUlkLW2rlfXiqb35A/Cu8oGiMSxeTI4Yfar4MiFN5RJEYkism8O3PvelB4R5EYkSgnO+K/US9Rg8I7isOIRDkp4LJpUY8bCX+gGARJGT7WfgEUadrfAMVgaqsQzrln2tKr8lpW3wHqMSIpB51mdbmp/QKgHARJOb7UfgGUOXbO0d0ZRfg5tSVv6lzPGfe9pigobyG73Z+zfYFYZyl7S9hYCtXaQXKX8fkXPkgOMngdWXPOudqvgTFmLn+0PO3fWmtpxgnV2lNb/2b8g+Q6UkJeltI65lJR+5gLGU0CaqmpkTjnOIsD2yzleNulTBVpesqn8A7V2kGSew8gggSbNCHyczmt1NS0rGSj8A7VNAXJmwxeQ7bkFMVanW/Yk6FqVMKOd2ilKUgOK79Z7lLrtTnf1LtKwuV6/JcUZI8d79DqZ5AoaW99msFryFWNBdvzDsvCbxU8JDUuqAVCo9Vie+5zyu8zeA25+qeyn/e2y94iCu/A8FaDJPcnt32KkhvV9CR732fvhUx9aSm8+ylcTlOEKqtB8lXBi2ceeYXsQ6ilRuJD5Dzg60K+ZipXFN6hyWqQaOhGyqjkT7VM+c0DQ6SpAWoqvDPFBTX+aCOvpM0GPYqErGT7lsWLGda82XAY812cc98Ujd78z0tXZ2Rv3c52DaOSPc6//qmGqb4kISI0TXExKoEK64JEyxPQae1TXLJUtPRrsJRlvklGn/KEr+XMdArvUGFdkGg61+Ku1oZ3UoytYVT2cYCTBDU1daTwjuz9ESSbdgln7KnSMHmgK3IYKbxrOeeewjuyt6n7r6Yw2astTOTsGHZAR7DWflBSD/TO2PGOnG0Kks/KfmvVhEnmB5Bpo2nHO4tLkK0SRiQNHybPpRbg/Ty5c+6ZEElHCu9ajnD2+6c+ZPA6gD+sDRJZIaMxTIwU4B9KKlA6505lrwgn6aWnqfD+ng7YyNG2ExI/Kf6Nvdx45Qaslr9p+FCUwjordwYgD03seAcibAwSWb2leee4/9D5kcmTtkKlBMidjEJonT8wa+2tosL7KYV35GbXme1a5o+3OZZC/FPuIxS/WKAVINRCxkXhHQi0K0i0rLXv4lhGKH7K60Muc80y+riQHlAU0ycihfdbJS+Xwjuy8kfTxlWFLzedS0uYz2M1x5MA80XzI5m2oni63bXs+RicLND4pqQe5aedXys52RSF6xIkh/KkXIO5/PlXAmYZ2p5DbkrNOSH7Ehz7BEdvowWJ+fF7O1M0dfRorX2bwetA5XYGifnx4XpiJ/XL6ZFdnv5qv06pjRokRt/7nVbzmNxfHV/ANTdIRhMVuVQ0Cvf7pl5zNg+mtKvY/kLZDmAgikxnqim8G2NoNY9JdQoSoWXTFpDCdcepzBxcseMdU+ocJMrOvAaiyFQRe0uADvqMSIwM91luiCpIdwcthexj7S2BoFevIJGnNE1nXgOxVJ3xzmmKmELfEYm2HcBAFGVTuhTeMYneQSI0FSKBWJqmdCm8Y3RBQSJTXOyoRRUUTulSeMeoQkckzVp7TatagGAypavlsDcK7xhVcJCYX+c4sFERtdB0miKFd4wmKkjEpaJDgYBgUnjXcrQChXeMJjpIZP74hOI7aiANJDUV3jnnH4NLMSJpF99pHIcaqNpbksFrQOGSBIn5VXw/IUxQOmVNTI/ljBVgMMmCxBAmqAuFd0AkDRJDmKASMp2rZce7D5GrDF4HCpU8SAxhohkLJnqQ5e9aVixeUHjHUAYJEvMrTA5YGqzGPQ05g2jalEvhHYMYLEjM70uDtewIrtW5tZYQCaCsiSmFdwxi0CAxEibW2rccipUlP5Xlz/umO0GcawrvqNngQdKQjVzUTfLxKCHC1GMkZacpUnhHcqMFifk1DXDAVNekXm56fpQoN0AkIKM6LacpUnhHUqMGifl9qoud8OObySiEg8mGwRnvqNLoQdKQ87AP6B48ipcWNtbaE2k8iAHINKGWkD50ztHUEUlMFiTm1+jkXGonWqYFtPGF4AMJbgxP0+mhVxTekcKkQdLwtRP/tCz7GHhiTuNeAuQDtZDxKCy8s7cE0bIIkoYvWFprDwiUKE2AnDONNQ0Z/WkZYZ85544zeB1QLKsgabQC5S1TXp0RIHmh1TyqkWWQNPyTnUx5vZYbJVM0v1vInPzfBEhe5HehZRMuhXdEyTpIGn41jBTlm2mv2gvH97IKixpI3m4pvKMGKoKkIau87mUfyt+Vhcqj/LzN6KP2MM2eBLyWKS4K7wimKkja2qFirbVST9HU1nuXRTPykPB4Kz8vow9FpJuDltCn8I4gf5Vy2eQJ/eUDK0N0/4HwbSCO5N9zt5AQ/OIXGEzUA2uZ4eKGEuo+l/LEr8ExC1zQl63lijnn9iVY/J9/5IM9VcDM5Qb5VT60c0YaALSqJki2aQ3n9+WP96r1722HG54uV5/ilhIURoLD/+8FK6sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1Y59yeMeYi4mI9WmvnY1xs59yxMeY48MvvrbWLxC8JAGB+3KCfXbiHsS5ixOv8LoEJABjoBn0WESTe/tC/GP89Il7fzdCvDwCq55z7lvON2n+PiNc3eNABQPUiRyWDTx1FBN1oU28AUL3IUcnZUNfPOXca8bpCi/MAgA7+s/KffIy4aO8HvOBvAr9uYa2dJX4tAIBN/PSUTFNl8/QvrynUYKMkAMAPv41IrLXLyFHJuwGu62ng1y2ttfeJXwsAYJcEo5KkK6Scc0+Br+MDv2wAGN5qjaQZlcQ8ySebTpJQCt7Jnup1AAB6itz89z3V9fajisDXcMfvHAAm5m/GEWGSZFQSsRyZJb8AMLXIUclT7Mv3YRD4vZ958wDAeP6okTSkU25oncGHwGHkTxG6Aixm1RkAoCe77T+XMAh9wvdt289DfyFSa+nbdsUv+f079HvWZM3030JTm31pydN+WFH1+oGSbA0SI8tvI1ZO/S2rwHqRGktIwfzaWsuyXyE322O54R4ZY/blzy4L+ePPmflqjJlNeZOWB5rTHj+D72bg33df5LWPcl4OUKsuQeJvRKE1j6AbuzRaDNmIuDa4JJh6TZVZa08Cvn/7e96sPDEP/j1b3/tUft7QzZzr+JvxJxlp9n446Kt14Nq7juG3zUJe+23Eg80Qm22TWvf+CahXfkqxkTfwml3u
837Cn15qOjbbXzn37tL6Hugy2d6qGs10Pdd1f39ErEp8FvADxda5N84gglZRtz3dae4Zgm+51lk480uvsv1HKTbs2yIjTkyYJug1x6xDH1UG157X0lG9IHXbOfMR+AinKhVnDGbtKe8Vju+Z+wZVK59z91YbF8RWsDel6fjPkKfoqstskv4Psl04NBnr/ib8JWvnaVeZi3vlW+RRz9v07x2H7ZDfQ+U5yagXputiNJB22818E5BYq19lOmBEH27Aod0Ea52Hry1IGLsvTM+sJ4S7hnyb+yHkT6w/nv4Uc8DRzBjG3lYKqb56xAhYnqMSLzrwG963LX/ltwUQ56oPwV8jXpyvZ4mflq6Cxh1/iTTBg8TfVhPJQwJE2xyVcqVGSpETJ8gkYJK6Kik6y8jpPCzqLHLbyYh0riLaNZ5k3hRQF+HhAnWkRtvEV0yhgwR03NEYiJGJacdP6ghT6VVjkbkTZHLzW8v5MlNVrblMG0QshIIBZP7VRHviaFDxPQNEnnyD1n6ubfrqVOmR0JujLcBX6OarKyJ7RyQ2lmfUYn8vnMqeJ/FTNGhOFclFNjlPT1oiJiAEYmJWB2164k1ZFprlD0NOZEnpSGPNY7R6Uac8dMeoxI008bqV/XJzzF4iHh/BfzFt3Ij65vWfonq8boz1OXGEvI0WOOS34uIJyW/su2z7Pxe5zhyA+BRxxHiRYJlykv5edpi57P9e/SMkzWrp/6BIlENtXObq95B4kcAzrmPgasZ3m+4iYXMk9e65DdkNOJvuueyjHsb/7v5IHssQj5MO8MhwYhqJh0T1oahLNe8igiVqzXNSjcF7y6vAt7bM2ntggmUUGAfO0RM4IjEyFNnSJD4ovv+mr5NIdNa1Y1GIupIJ31C11p7K5ty+4ZJl7pNzIhqZ8sdCZiZ7EsJeUDxo5LD9vVq/s6+f1HgHoQv9IubhjzkqF7uO0WImMAaSexxvL89jUqBtm/heNHh6bpEIQX265CRmw+TwIUVu4T29unVt00+CKHvkez7amEQKaZcJzNViJjQIBGhS4FXn9BCpjlqbYdyFPA1MYGbdOpQRlQhH9RZ4FP6ZcDXmFL2DqA7eaBVOxqZMkRMTJBEHHy1t9JWo2+
837RPWY0pF3vN0lkHSn1XH1IEJrQh5aI92huS6sxvNjVTZNJFCKzmPOjQmskjevAeWg/CrkPfEJ9rG3Jb8uy51x97Igi9Ma/SciT/mxTYb2jzyHv0dU6Ccol9yGVo9BEIeLf529jXkdUkPgnPufcLOCXcCiFyDcB3zZ0Sq2XTUuVp5TqvJIu5A2a7MO15kTDrj5HfuvQ3yEtU+qhcrlvwhA5iX04jx2RGLmxh9xw3gdMa415Ul+VNxK54Z8NMF8cOl0UtahClquHPHzUemzvUaIzSVKPZgchP6vGAvthgt33SULEpAgS/9QeOCrJfQPiu9ibWM5aI4Tm6NojeVMOVR8I+XuXKR4cWE7by3Etiw2kwJ5rl4hdYkdRyULEJBqRmIhRSR9jL/k9LWGeXKYQm4D4R/59ihtFyJMTNQoMqagDq3pIGiImVZDIqGQ+8GqXmNpI6AXz7cV7beZrnTU++sofmTM9ldHFYWYfkn8CvqbWRRUYmDxg9ZkVmcv7sYTR2mXqBUupRiRGpp2GWkK3nGg/xJ4cKfsoRd+FTLf8/Ptax80eyg189A6yspz6febLVkNC7esArwMwAfeqy4IOufLnB73ObkRipMW8c+5qoMJVVJdfGTHFfP/TdkBE/l3JyAjkhg10QHfSS67Pfepe7iGlBMm+3DeC942sitnZvs5QS3NTFNmLKpzLKOSJEAG6C+intRxry8HIzlY2hkdJGiSRx/Fu8phoyW/sfoRstE48Y68D0E/fAvvHEbccjO1GZjWipR6RmAGOvk2y5FdCTv0qIKnJDN3OoWlDw7kcKEZAN+ZF4UvH96ReEv1AOkSQpOwau0i8uzzZnOAU5Bf+MNC3bhY0+Gt0IH13/s37igC99N17ofp+0dFhikUEKVdtvYg8+GpV0rlJv9rKOXeuuEFbzFkebQsZnX2VFiKLgofv6GeRaHp6P6cd4zId3GcaJ7bHmyYXzrkvMfv0kgeJCD2Oty12ye9asrpsIU/2amoMiU4W/DRym5m2kO/53+FeDjb4lGI6R1qP5LLKaa+C0chcPmOh2w/8FNc89N4wxNRW7MFXjaglv9vIk8aBjHiG+B7zARYdnEXsDvebKv2f+wlHHiHTZLRzRwp9e1JdKxuhv3zGJfxC72dR0+ZDjUiMFMkvIr9+MBJSH+SM8jPZTHgcOBxfyBP/12aVmXPuKfHQPqRTcmwrhFeBX7dOyAczyYgxsAnhlKGLtPo8kCxlRkWL3z7jMnUfGgi+K/uNtbb3gXCDBYncTO8DzysZ9UMsK7peRlAr7c437dFYNivARpxHDdkvch45qksZhCG/T//G3kswMg2ZYplV3AG4ZsnbhwzojwdFX+eIuO8aqZd87ntfG3JEYiJaXKReQtyZ/FKai5hFsU26lPY1S9BwMlmQRHQXOI2ZJg28dqjTTB4qNdg223AZMbviPTjnDvoE6iA1kpZ3AV9T02qJrkLeEFHH5MoNOPVNOOT3GvIeagsqPvIerJKmHewbR07yf49ZLNC7XjJYkMjmn5Bi6WSjEfwmWfuElpBwO241xuwloB1Gg/b19bkv6eFBfpaYWs9xn9pi5yDps/sxYuPcQtHQslgJlhpvErqcO/QQn9DzJniYqctSpoOKIkXzmIeiq64PcX1GJL4I87DrL448R7jE5mhTidmDMciBP1KzCS2699pEKh1eQ0dVxZ6MibWuFRXY+4rdD9OphUrfqa1TOezpu/9g+6GPXzrrw0X+3Y9CngOntDQVusYWcvMNqg1E3oC7CF3W7d9nT7ve1P7/L+/D0FFMqiah0MHPgmha7tuLPLzFjLb2u3QCCV21tTfAzYbRyAaylLrvl+37cO+6S7lVT4jZ+9PFfcAGsYYfDX9rHzQmbW+aJdtvIjZuNgbdv4TsFN9Pywelc+5NxJET/tjxi22BO/Sqra4eWSWzU8j18XOcW5/M5Qn+TEaSQ4dIs6Ik5mbdPMQ8yOmVPmG/y3RqbC8y3od1qen3HbPr3exqOZ9DkMQuVatF6HJeX9vyT/H+jXAq05BnranIbzJ0TbLUt+O+jZQdolMpsuCKrar5fct0bezP+7BpajmHING0k3RKMfWjfXlaf5An9zuZXjodoKi+M0gSrHMfgrb+SohT3e9batAxC0n2N9Uepw6Sewrs3cibXsMwvNPIRlpW51LkfCy54Io/LJT100opdopr7RG9UwZJ7GqCGo19vUJC/qjrfyjr3Kd+kJgztVqdamdBEs0G/FEvmSpIlpFdaaskS/nGWt12HlgUP+2zeVVOYpwqTGa8D6sziznAqQQJZgP+OKJ3iiAhRCLIct4hb7xL6Rp8L8HV9/e0J3uN+obJ2FMNt3JGC+/DujAL8sN1ZHfr347oHTtI5nIeOL2MIgz4FN90FG3/3SFPb4eyJLczmeY6GaF1+0J+Rm4o9bnl3vNDoikuvyL0ZePzmEFyy0gkHQmTt4mW0S5lFcvrNR+0zyP+TH7a4SDB09I6CxlpHbBXpEpLNj3/Tj4HsdfET3Ht267/tfTYehewo30mN6mqPrxSjOq1tDbkGskU0oX8bvruBVlIg8LbTQG/ctBXL7G/c1kd0uzIDVmm3Jz7/3mKefHAa7dIuSw1oHNyku8feAzBfNeDZsT7cRk7GhnqM+i5E+sAAABNSURBVD3UteoqtLt2y6JzkDTkF3ksq3MO5U/74i7kzxeOKx2XvNGP5YjcdR+2pRw2tpCio5rfjfxsh/KBe7Xlg/elOcGSkQcwAmPM/wEIKaFQMmweTwAAAABJRU5ErkJggg=="}))),HZ=e=>l.createElement("svg",{width:100,height:48,viewBox:"0 0 100 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},l.createElement("g",{clipPath:"url(#clip0_13640_55684)"},l.createElement("g",{style:{mixBlendMode:"luminosity"}},l.createElement("rect",{x:.737305,width:98.5263,height:48,fill:"url(#pattern0_13640_55684)"}))),l.createElement("defs",null,l.createElement("pattern",{id:"pattern0_13640_55684",patternContentUnits:"objectBoundingBox",width:1,height:1},l.createElement("use",{xlinkHref:"#image0_13640_55684",transform:"matrix(0.0042735 0 0 0.00877193 -0.213675 -0.333333)"})),l.createElement("clipPath",{id:"clip0_13640_55684"},l.createElement("rect",{width:100,height:48,fill:"white"})),l.createElement("image",{id:"image0_13640_55684",width:334,height:190,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,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"}))),VZ=e=>l.createElement("svg",{width:100,height:48,viewBox:"0 0 100 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M38.1253 1.62843L17.6567 45.5684C17.4164 46.0016 17.8969 46.531 18.3774 46.3385L82.5701 22.9487C82.8103 22.9006 82.9545 22.66 82.9545 22.4193V1.86907C82.9545 1.53218 82.6662 1.33967 82.4259 1.33967H38.6538C38.4136 1.29154 38.2694 1.3878 38.1253 1.62843Z",fill:"white"}),l.createElement("path",{d:"M41.1034 4.8527H40.0944V2.39822H39.2295V8.02909H40.0944V5.62274H41.1034V8.07722H41.9683V2.39822H41.1034V4.8527ZM78.5811 2.39822H77.7163V8.02909H78.5811V2.39822ZM43.5058 2.39822L42.5929 8.02909H43.4097L43.5538 6.9703H44.659L44.8031 8.02909H45.668L44.707 2.39822H43.5058ZM43.6499 6.29652L44.0824 3.40889L44.5148 6.29652H43.6499ZM51.1455 4.70832L50.8092 5.95963V2.39822H50.0404V8.02909H51.0014L51.7221 5.43023L52.1065 4.03454V8.02909H52.8752V2.39822H51.8662L51.1455 4.70832ZM65.2717 6.68153L65.3678 3.26451H66.1366V8.12534H67.0015V2.39822H64.4549L64.3108 6.63341C64.3108 7.1628 64.1666 7.25906 63.7822 7.25906V8.07722H63.8783C64.8873 8.07722 65.2237 7.64407 65.2717 6.68153ZM77.2358 6.68153V5.95963C77.2358 5.09334 76.8034 4.56394 75.8904 4.56394H75.458V2.39822H74.5931V8.02909H75.9385C76.7553 8.07722 77.2358 7.59595 77.2358 6.68153ZM75.458 5.33398H75.8904C76.1787 5.33398 76.3229 5.43023 76.3229 5.86337V6.68153C76.3229 7.06655 76.1787 7.21093 75.8904 7.21093H75.458V5.33398ZM70.4129 6.68153V5.95963C70.4129 5.09334 69.9805 4.56394 69.0676 4.56394H68.6351V2.39822H67.7703V8.02909H69.1156C69.9805 8.07722 70.4129 7.59595 70.4129 6.68153ZM68.6832 5.33398H69.1156C69.4039 5.33398 69.548 5.43023 69.548 5.86337V6.68153C69.548 7.06655 69.4039 7.21093 69.1156 7.21093H68.6832V5.33398ZM71.9024 5.67086H72.9114V8.12534H73.7763V2.39822H72.9114V4.8527H71.9024V2.39822H71.0375V8.02909H71.9024V5.67086ZM49.0794 2.39822H48.2145V7.25906H47.2055V2.39822H46.3407V8.02909H48.647V8.79912H49.5119V7.25906H49.1275V2.39822H49.0794ZM62.4849 8.07722H63.3498L62.4849 2.39822H61.1396L60.2747 8.02909H61.0915L61.2357 6.9703H62.3408L62.4849 8.07722ZM61.3798 6.29652L61.8122 3.40889L62.2447 6.29652H61.3798ZM81.7523 3.21638V2.39822H79.3019V8.02909H81.7523V7.21093H80.2148V5.57461H81.416V4.70832H80.2148V3.12013H81.7523V3.21638ZM54.9413 2.3501C54.0765 2.3501 53.596 2.83137 53.596 3.79391V6.72966C53.596 7.59595 54.0765 8.17347 54.9413 8.17347C55.8062 8.17347 56.2867 7.6922 56.2867 6.72966V3.79391C56.2386 2.83137 55.7581 2.3501 54.9413 2.3501ZM55.3738 6.77779C55.3738 7.1628 55.2296 7.30718 54.9413 7.30718C54.653 7.30718 54.5089 7.1628 54.5089 6.77779V3.74578C54.5089 3.36077 54.653 3.21638 54.9413 3.21638C55.2296 3.21638 55.3738 3.36077 55.3738 3.74578V6.77779ZM57.7762 5.67086H58.7852V8.12534H59.6501V2.39822H58.7852V4.8527H57.7762V2.39822H56.9113V8.02909H57.7762V5.67086ZM70.2688 10.0504V9.23227H67.8183V14.8631H70.2688V14.045H68.7312V12.4087H69.9324V11.5905H68.7312V10.0023H70.2688V10.0504ZM72.9114 14.8631H73.8724L72.6712 11.7349L73.8724 9.18414H73.0075L71.8544 11.6867V9.18414H70.9414V14.815H71.8063V13.0824L72.0946 12.6012L72.9114 14.8631ZM76.1307 14.8631V10.0023H77.0916V9.18414H74.3048V10.0023H75.2658V14.8631H76.1307ZM80.2628 13.4674V12.7455C80.2628 11.8793 79.8304 11.3499 78.9175 11.3499H78.485V9.23227H77.6202V14.8631H78.9655C79.8304 14.8631 80.2628 14.3819 80.2628 13.4674ZM78.485 12.1199H78.9175C79.2058 12.1199 79.3499 12.2161 79.3499 12.6493V13.4674C79.3499 13.8525 79.2058 13.9968 78.9175 13.9968H78.485V12.1199ZM63.9264 11.3499V10.628C63.9264 9.76166 63.4939 9.23227 62.581 9.23227H61.2357V14.8631H62.1005V12.7455H62.533C63.4939 12.7455 63.9264 12.2643 63.9264 11.3499ZM62.1966 10.0504H62.6291C62.9174 10.0504 63.0615 10.1467 63.0615 10.5798V11.398C63.0615 11.783 62.9174 11.9274 62.6291 11.9274H62.1966V10.0504ZM57.7762 14.8631H58.6411V10.0023H59.6501V14.8631H60.5149V9.18414H57.6801V14.815H57.7762V14.8631ZM80.7433 14.8631H81.6082V9.18414H80.7433V14.8631ZM65.8483 9.13601C64.9834 9.13601 64.503 9.61728 64.503 10.5798V13.5156C64.503 14.3819 64.9834 14.9594 65.8483 14.9594C66.7132 14.9594 67.1937 14.4781 67.1937 13.5156V10.5798C67.1937 9.66541 66.6651 9.13601 65.8483 9.13601ZM66.2808 13.5637C66.2808 13.9487 66.1366 14.0931 65.8483 14.0931C65.56 14.0931 65.4159 13.9487 65.4159 13.5637V10.5317C65.4159 10.1467 65.56 10.0023 65.8483 10.0023C66.1366 10.0023 66.2808 10.1467 66.2808 10.5317V13.5637ZM79.9265 18.3283L79.5902 19.5796V15.9701H78.8214V21.6009H79.7823L80.5031 19.0021L80.8875 17.6064V21.6009H81.6562V16.0182H80.6472L79.9265 18.3283ZM66.7612 15.9701C65.8964 15.9701 65.4159 16.4513 65.4159 17.4139V20.3496C65.4159 21.2159 65.8964 21.7934 66.7612 21.7934C67.6261 21.7934 68.1066 21.3122 68.1066 20.3496V17.4139C68.1546 16.4513 67.6742 15.9701 66.7612 15.9701ZM67.2898 20.3496C67.2898 20.7346 67.1456 20.879 66.8573 20.879C66.569 20.879 66.4249 20.7346 66.4249 20.3496V17.3176C66.4249 16.9326 66.569 16.7882 66.8573 16.7882C67.1456 16.7882 67.2898 16.9326 67.2898 17.3176V20.3496ZM63.59 16.
8370182H62.2447V21.649H63.1096V19.5315H63.542C64.4069 19.5315 64.8873 19.0502 64.8873 18.1358V17.4139C64.8873 16.4995 64.4549 16.0182 63.59 16.0182ZM64.0225 18.232C64.0225 18.617 63.8783 18.7614 63.59 18.7614H63.1576V16.8363H63.59C63.8783 16.8363 64.0225 16.9326 64.0225 17.3657V18.232ZM70.0766 15.9701C69.2117 15.9701 68.7312 16.4513 68.7312 17.4139V20.3496C68.7312 21.2159 69.1637 21.7934 70.0766 21.7934C70.9895 21.7934 71.4219 21.3122 71.4219 20.3496V19.5796H70.6051V20.3977C70.6051 20.7828 70.461 20.9271 70.1727 20.9271C69.8844 20.9271 69.7402 20.7828 69.7402 20.3977V17.3657C69.7402 16.9807 69.8844 16.8363 70.1727 16.8363C70.461 16.8363 70.6051 16.9807 70.6051 17.3657V17.9914H71.4219V17.462C71.4219 16.4513 70.9895 15.9701 70.0766 15.9701ZM73.3439 15.9701C72.479 15.9701 71.9985 16.4513 71.9985 17.4139V20.3496C71.9985 21.2159 72.4309 21.7934 73.3439 21.7934C74.2087 21.7934 74.6892 21.3122 74.6892 20.3496V19.5796H73.8243V20.3977C73.8243 20.7828 73.6802 20.9271 73.3919 20.9271C73.1036 20.9271 72.9595 20.7828 72.9595 20.3977V17.3657C72.9595 16.9807 73.1036 16.8363 73.3919 16.8363C73.6802 16.8363 73.8243 16.9807 73.8243 17.3657V17.9914H74.6412V17.462C74.6892 16.4513 74.1607 15.9701 73.3439 15.9701ZM76.3709 18.3283L76.0346 19.5796V15.9701H75.2658V21.6009H76.2268L76.9475 19.0021L77.3319 17.6064V21.6009H78.1007V16.0182H77.0916L76.3709 18.3283Z",fill:"black"})),GZ=e=>l.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("rect",{width:44,height:44,rx:22,fill:"currentColor"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5093 21.7318C17.9385 19.7913 20.8919 18.5121 22.3697 17.894C26.5891 16.1293 27.4658 15.8227 28.0373 15.8126C28.163 15.8104 28.444 15.8417 28.62
8376 15.9902C28.7797 16.1156 28.822 16.2851 28.8423 16.404C28.8625 16.5229 28.8877 16.7938 28.8677 17.0054C28.639 19.4212 27.6497 25.2836 27.1463 27.9894C26.9333 29.1342 26.514 29.5181 26.108 29.5557C25.2257 29.6373 24.5557 28.9694 23.7012 28.4061C22.3639 27.5246 21.6085 26.9759 20.3105 26.1158C18.8104 25.1218 19.7829 24.5755 20.6377 23.6827C20.8615 23.449 24.7489 19.8934 24.8242 19.5708C24.8336 19.5305 24.8423 19.3801 24.7535 19.3007C24.6646 19.2213 24.5335 19.2485 24.4389 19.2701C24.3048 19.3007 22.1686 20.7205 18.0303 23.5295C17.4239 23.9482 16.8747 24.1522 16.3826 24.1415C15.8401 24.1297 14.7966 23.8331 14.0209 23.5795C13.0694 23.2685 12.3131 23.104 12.379 22.5759C12.4133 22.3007 12.7901 22.0194 13.5093 21.7318Z",fill:"white"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5093 21.7318C17.9385 19.7913 20.8919 18.5121 22.3697 17.894C26.5891 16.1293 27.4658 15.8227 28.0373 15.8126C28.163 15.8104 28.444 15.8417 28.626 15.9902C28.7797 16.1156 28.822 16.2851 28.8423 16.404C28.8625 16.5229 28.8877 16.7938 28.8677 17.0054C28.639 19.4212 27.6497 25.2836 27.1463 27.9894C26.9333 29.1342 26.514 29.5181 26.108 29.5557C25.2257 29.6373 24.5557 28.9694 23.7012 28.4061C22.3639 27.5246 21.6085 26.9759 20.3105 26.1158C18.8104 25.1218 19.7829 24.5755 20.6377 23.6827C20.8615 23.449 24.7489 19.8934 24.8242 19.5708C24.8336 19.5305 24.8423 19.3801 24.7535 19.3007C24.6646 19.2213 24.5335 19.2485 24.4389 19.2701C24.3048 19.3007 22.1686 20.7205 18.0303 23.5295C17.4239 23.9482 16.8747 24.1522 16.3826 24.1415C15.8401 24.1297 14.7966 23.8331 14.0209 23.5795C13.0694 23.2685 12.3131 23.104 12.379 22.5759C12.4133 22.3007 12.7901 22.0194 13.5093 21.7318Z",fill:"white"})),qZ=e=>l.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22Z",fill:"currentColor"}),l.createElement("path",{d:"M22.5159 28.5312C15.9389 28.5312 12.1876 24.144 12.0312 16.8438H15.3258C15.434 22.202 17.8627 24.4716 19.7865 24.9396V16.8438H22.8887V21.4649C24.7885 21.266 26.7842 19.1602 27.4575 16.8438H30.5597C30.0427 19.6984 27.8784 21.8042 26.3394 22.67C27.8784 23.3719 30.3434 25.2087 31.2812 28.5312H27.8664C27.1329 26.3084 25.3055 24.5886 22.8887 24.3546V28.5312H22.5159Z",fill:"white"})),WZ=()=>{const e=new Date().getFullYear();return a.jsxs("footer",{className:Y("flex","justify-between","gap-10","w-full","flex-col","pt-[32px]","pb-[84px]","mt-[82px]","max-w-full","mx-auto","bp34_375:max-w-[312px]","bp50:flex-row","bp50:pt-[50.4px]","bp50:pb-[57.6px]","bp50:mt-[158.4px]","bp50:max-w-none","bp50:mx-0","bp62_5:flex-row","bp62_5:pt-[63px]","bp62_5:pb-[72px]","bp62_5:mt-[198px]","bp62_5:max-w-none","bp62_5:mx-0","bp81_5:flex-row","bp81_5:pt-[84px]","bp81_5:pb-[96px]","bp81_5:mt-[264px]","bp81_5:max-w-none","bp81_5:mx-0","border-t-2","border-neutral-800"),children:[a.jsxs("div",{className:Y("flex","flex-col","gap-8","bp50:gap-0","bp62_5:gap-0","bp81_5:gap-0"),children:[a.jsx("div",{className:Y("flex","items-center","h-[36px]","bp50:h-[54px]","bp62_5:h-[67.5px]","bp81_5:h-[90px]"),children:a.jsx(Je,{to:"/",className:Y("block","-ml-[6px]","mr-3","bp50:-ml-[8.4px]","bp50:mr-[20.4px]","bp62_5:-ml-[10.5px]","bp62_5:mr-[25.5px]","bp81_5:-ml-[14px]","bp81_5:mr-8.5"),children:a.jsx(BO,{className:Y("w-[142px]","h-[44px]","bp50:w-[172.2px]","bp50:h-[54px]","bp62_5:w-[215.25px]","bp62_5:h-[67.5px]","bp81_5:w-[287px]","bp81_5:h-[90px]")})})}),a.jsxs("div",{className:Y("flex","flex-col","gap-3","bp50:mt-[34.8px]","bp50:gap-2.4","bp62_5:mt-[43.5px]","bp62_5:gap-3","bp81_5:mt-[58px]","bp81_5:gap-4"),children:[a.jsxs("a",{target:"_blank",href:"https://navigator.sk.ru/orn/1126876",className:Y("flex","items-center","justify-start","gap-3","bp50:gap-[14.4px]","bp62_5:gap-[18px]","bp81_5:gap-[24px]"),children:[a.jsx("div",{className:Y("flex","items-center","justify-center","bg-[rgba(255,255,255,0.02)]","w-[74px]","h-[42px]","bp50:rounded-[14.4px]","bp50:backdrop-blur-[14.4px]","bp50:w-[79.2px]","bp50:h-[43.2px]","bp62_5:rounded-[18px]","bp62_5:backdrop-blur-[18px]","bp62_5:w-[99px]","bp62_5:h-[54px]","bp81_5:rounded-[24px]","bp81_5:backdrop-blur-[24px]","bp81_5:w-[132px]","bp81_5:h-[72px]"),children:a.jsx(QZ,{className:Y("w-[29px]","h-[22px]","bp50:w-[36px]","bp50:h-[26.4px]","bp62_5:w-[45px]","bp62_5:h-[33px]","bp81_5:w-[60px]","bp81_5:h-[44px]")})}),a.jsxs("div",{className:Y("roboto-flex-112-500-0","text-zinc-50","text-[12px]","leading-[14px]","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:["Резидент",a.jsx("br",{}),"«Сколково»"]})]}),a.jsxs("a",{target:"_blank",href:"https://fasie.ru/",className:Y("flex","items-center","justify-start","gap-3","bp50:gap-[14.4px]","bp62_5:gap-[18px]","bp81_5:gap-[24px]"),children:[a.jsx("div",{className:Y("flex","items-center","justify-center","bg-[rgba(255,255,255,0.02)]","w-[74px]","h-[42px]","bp50:rounded-[14.4px]","bp50:backdrop-blur-[14.4px]","bp50:w-[79.2px]","bp50:h-[43.2px]","bp62_5:rounded-[18px]","bp62_5:backdrop-blur-[18px]","bp62_5:w-[99px]","bp62_5:h-[54px]","bp81_5:rounded-[24px]","bp81_5:backdrop-blur-[24px]","bp81_5:w-[132px]","bp81_5:h-[72px]"),children:a.jsx(HZ,{className:Y("filter","grayscale","w-[50px]","h-[24px]","filter","grayscale","bp50:w-[60px]","bp50:h-[28.8px]","bp62_5:w-[75px]","bp62_5:h-[36px]","bp81_5:w-[100px]","bp81_5:h-[48px]")})}),a.jsxs("div",{className:Y("roboto-flex-112-500-0","text-zinc-50","text-[12px]","leading-[14px]","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:["При поддержке Фонда",a.jsx("br",{}),"содействия инновациям"]})]}),a.jsxs("div",{className:Y("flex","items-center","justify-start","gap-3","bp50:gap-[14.4px]","bp62_5:gap-[18px]","bp81_5:gap-[24px]"),children:[a.jsx("div",{className:Y("flex","items-center","justify-center","bg-[rgba(255,255,255,0.02)]","w-[74px]","h-[42px]","bp50:rounded-[14.4px]","bp50:backdrop-blur-[14.4px]","bp50:w-[79.2px]","bp50:h-[43.2px]","bp62_5:rounded-[18px]","bp62_5:backdrop-blur-[18px]","bp62_5:w-[99px]","bp62_5:h-[54px]","bp81_5:rounded-[24px]","bp81_5:backdrop-blur-[24px]","bp81_5:w-[132px]","bp81_5:h-[72px]"),children:a.jsx(VZ,{
837className:Y("filter","grayscale","w-[50px]","h-[24px]","filter","grayscale","bp50:w-[60px]","bp50:h-[28.8px]","bp62_5:w-[75px]","bp62_5:h-[36px]","bp81_5:w-[100px]","bp81_5:h-[48px]")})}),a.jsxs("div",{className:Y("roboto-flex-112-500-0","text-zinc-50","text-[12px]","leading-[14px]","bp50:text-[12px]","bp50:leading-[14.4px]","bp62_5:text-[15px]","bp62_5:leading-[18px]","bp81_5:text-[20px]","bp81_5:leading-[24px]"),children:["Федеральный проект",a.jsx("br",{}),"«Отечественные решения»"]})]})]})]}),a.jsxs("div",{className:Y("flex","flex-col","gap-9","bp50:gap-0","bp62_5:gap-0","bp81_5:gap-0"),children:[a.jsxs("div",{className:Y("flex","flex-row-reverse","items-center","justify-between","w-full","h-[36px]","mt-0","w-auto","bp50:flex-row","bp50:h-[54px]","bp50:mt-[0px]","bp50:w-[381.6px]","bp62_5:flex-row","bp62_5:mt-[0px]","bp62_5:h-[67.5px]","bp62_5:w-[477px]","bp81_5:flex-row","bp81_5:mt-[0px]","bp81_5:h-[90px]","bp81_5:w-[636px]","bp81_5:pt-[2px]"),children:[a.jsx("a",{href:"mailto:[email protected]",className:Y("block","roboto-flex-112-500-0","text-neutral-50","hover:text-neutral-300","underline","underline-offset-[25%]","decoration-solid","decoration-[6%]","text-[12px]","leading-[14px]","bp50:text-[14.4px]","bp50:leading-[16.8px]","bp62_5:text-[18px]","bp62_5:leading-[21px]","bp81_5:text-[24px]","bp81_5:leading-[28px]"),children:h.main.footer.EMAIL}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Je,{to:"https://t.me/plevakoai",target:"_blank",className:"group",children:a.jsx(GZ,{className:Y("text-zinc-900","group-hover:text-zinc-800","w-9","h-9","bp50:w-[38.4px]","bp50:h-[38.4px]","bp62_5:w-[48px]","bp62_5:h-[48px]","bp81_5:w-[64px]","bp81_5:h-[64px]")})}),a.jsx(Je,{to:"https://vk.com/plevakoai",target:"_blank",className:"group",children:a.jsx(qZ,{className:Y("text-zinc-900","group-hover:text-zinc-800","w-9","h-9","bp50:w-[38.4px]","bp50:h-[38.4px]","bp62_5:w-[48px]","bp62_5:h-[48px]","bp81_5:w-[64px]","bp81_5:h-[64px]")})})]})]}),a.jsxs("div",{className:Y("flex","flex-col","w-auto","bp50:w-[381.6px]","bp50:mt-[30px]","bp62_5:w-[477px]","bp62_5:mt-[37.5px]","bp81_5:w-[636px]","bp81_5:mt-[50px]"),children:[a.jsx(Je,{to:"/documents/privacy-policy.pdf",target:"_blank",rel:"noopener noreferrer",className:Y("block","roboto-flex-112-500-0","hover:text-neutral-300","text-[12px]","leading-[20px]","text-zinc-500","bp50:leading-[24px]","bp50:text-zinc-400","bp62_5:text-[15px]","bp62_5:leading-[30px]","bp62_5:text-zinc-400","bp81_5:text-[20px]","bp81_5:leading-[40px]","bp81_5:text-zinc-400"),children:h.main.footer.links.DATA_PROCESSING_POLICY}),a.jsx(Je,{to:"/documents/offer.pdf",target:"_blank",rel:"noopener noreferrer",className:Y("block","roboto-flex-112-500-0","hover:text-neutral-300","text-[12px]","leading-[20px]","text-zinc-500","bp50:leading-[24px]","bp50:text-zinc-400","bp62_5:text-[15px]","bp62_5:leading-[30px]","bp62_5:text-zinc-400","bp81_5:text-[20px]","bp81_5:leading-[40px]","bp81_5:text-zinc-400"),children:h.main.footer.links.OFFER}),a.jsxs("div",{className:Y("roboto-flex-100-500-0","text-[12px]","leading-[20px]","text-zinc-500","mt-[24px]","bp50:text-[12px]","bp50:leading-[24px]","bp50:mt-[46.8px]","bp62_5:text-[15px]","bp62_5:leading-[30px]","bp62_5:text-zinc-400","bp62_5:mt-[58.5px]","bp81_5:text-[20px]","bp81_5:leading-[40px]","bp81_5:text-zinc-400","bp81_5:mt-[78px]"),children:[a.jsxs("span",{className:"hidden bp50:inline",children:[h.main.footer.COMPANY_NAME,","]}),a.jsxs("span",{className:"inline bp50:hidden",children:[h.main.footer.COMPANY_NAME_SHORT,","]})," ",e]}),a.jsxs("div",{className:Y("flex","gap-4","bp50:flex","bp50:gap-3","bp62_5:flex","bp62_5:gap-3.75","bp81_5:flex","bp81_5:gap-5"),children:[a.jsx("div",{className:Y("roboto-flex-112-500-0","text-[12px]","leading-[20px]","text-zinc-500","bp50:text-[12px]","bp50:leading-[24px]","bp62_5:text-[15px]","bp62_5:leading-[30px]","bp62_5:text-zinc-400","bp81_5:text-[20px]","bp81_5:leading-[40px]","bp81_5:text-zinc-400"),children:h.main.footer.INN}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-[12px]","leading-[20px]","text-zinc-500","bp50:text-[12px]","bp50:leading-[24px]","bp62_5:text-[15px]","bp62_5:leading-[30px]","bp62_5:text-zinc-400","bp81_5:text-[20px]","bp81_5:leading-[40px]","bp81_5:text-zinc-400"),children:h.main.footer.OGRN}
837)]})]})]})]})},KZ=()=>{const e=fO({waitMilliseconds:150});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Y("w-full","mx-auto","max-w-[1304px]","bp50:max-w-[763.2px]","bp62_5:max-w-[954px]","bp81_5:max-w-[1272px]"),children:[a.jsx(P$,{}),a.jsx(sY,{stableViewportClientWidth:e})]}),a.jsx("div",{className:"overflow-hidden",children:a.jsxs("div",{className:"w-full",children:[a.jsx(DZ,{stableViewportClientWidth:e}),a.jsx(jZ,{stableViewportClientWidth:e})]})}),a.jsxs("div",{className:Y("w-full","mx-auto","px-4","max-w-[1304px]","bp50:max-w-[763.2px]","bp62_5:max-w-[954px]","bp81_5:max-w-[1272px]"),children:[a.jsx(zZ,{}),a.jsx(WZ,{})]})]})},Co=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M21 12C21 13.78 20.4722 15.5201 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89472 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17293 13.7558C2.82567 12.01 3.00389 10.2004 3.68508 8.55586C4.36627 6.91132 5.51982 5.50571 6.99986 4.51678C8.4799 3.52785 10.22 3 12 3",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),$Z=({step:e,positions:t,baseColors:n})=>{const{background:s,animationDelay:r}=l.useMemo(()=>({background:t.map((o,c)=>{const u=(c-e+n.length)%n.length,[d,p,g]=n[u],A=`rgba(${d}, ${p}, ${g}, 1) 0%`,E=`rgba(${d}, ${p}, ${g}, 0) 100%`;return`radial-gradient(${o}, ${A}, ${E})`}).join(", "),animationDelay:`calc(${e/t.length} * var(--glow-duration))`}),[e,t,n]);return a.jsx("div",{className:"glow-element absolute -left-[0.76%] -right-[0.76%] -top-[3.33%] -bottom-[3.33%] rounded-full blur-[8px] [background-blend-mode:overlay,normal,normal,color-dodge,normal]",style:{background:s,animationDelay:r}})},T6=["50% 58.52% at 25% 0%","50% 58.52% at 75% 0%","50% 58.52% at 100% 25%","50% 58.52% at 100% 75%","50% 58.52% at 75% 100%","50% 58.52% at 25% 100%","50% 58.52% at 0% 75%","50% 58.52% at 0% 25%"],YZ=[[63,94,251],[0,219,222],[0,255,128],[253,187,45],[255,97,0],[252,70,107],[255,0,183],[114,0,255]],XZ=({children:e,className:t})=>{const n=l.useMemo(()=>Array.from({length:T6.length},(s,r)=>a.jsx($Z,{step:r,positions:T6,baseColors:YZ},r)),[]);return a.jsxs("div",{className:Y("glow-wrapper group relative inline-block",t),children:[a.jsx("div",{className:"opacity-60 group-hover:opacity-100",children:n}),e]})},ut=({variant:e="default",isGlow:t=!1,glowClassName:n,isPending:s=!1,asChild:r=!1,children:i,disabled:o,type:c,onClick:u,isFullWidth:d=!1,className:p,dataAttributes:g})=>{const A=l.useMemo(()=>Y(Y("inline-flex items-center justify-center whitespace-nowrap","relative","rounded-full"),Y("cursor-pointer","disabled:pointer-events-none disabled:opacity-50"),Y("transition-[color,box-shadow]","focus-visible:ring-4 focus-visible:outline-1"),!!d&&"w-full",e==="default"&&Y("px-4 py-2","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white"),e==="h8"&&Y("h-8","flex items-center justify-center","px-3 py-2","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white"),e==="h8inverse"&&Y("h-8","flex items-center justify-center","px-3 py-2","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-100 text-zinc-950","hover:bg-zinc-200"),e==="h12"&&Y("h-12","flex items-center justify-center","px-8","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white"),e==="h12inverse"&&Y("h-12","flex items-center justify-center","px-8","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-100 text-zinc-950","hover:bg-zinc-200"),e==="h12indigoInverse"&&Y("h-12","flex items-center justify-center","px-8","roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase","bg-zinc-100 text-[#556FD5]","hover:bg-zinc-200"),e==="h12link"&&Y("h-12","flex items-center justify-center","roboto-flex-25-600-1 text-[14px] leading-[16px] uppercase","underline decoration-solid decoration-[4%] underline-offset-[24%]","bg-transparent text-zinc-500 hover:text-zinc-600"),e==="h12linkWhite"&&Y("h-12","flex items-center justify-center","roboto-flex-25-600-1 text-[14px] leading-[16
837px] uppercase","underline decoration-solid decoration-[4%] underline-offset-[24%]","bg-transparent text-white hover:opacity-80"),e==="h14"&&Y("h-14","flex items-center justify-center","roboto-flex-25-700-1 text-[16px] leading-[16px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white"),e==="h14inverse"&&Y("h-14","flex items-center justify-center","roboto-flex-25-700-1 text-[16px] leading-[16px] uppercase","bg-zinc-100 text-zinc-950","hover:bg-zinc-200"),e==="h15"&&Y("h-12 bp81_5:h-15","px-8","roboto-flex-112-600-0 text-[14px] bp81_5:text-[20px] leading-[24px]","bg-[rgba(113,113,122,0.36)] backdrop-blur-[5.65px] text-zinc-100","hover:bg-[rgba(113,113,122,0.56)]"),e==="h15inverse"&&Y("h-12 bp81_5:h-15","px-8","roboto-flex-112-600-0 text-[14px] bp81_5:text-[20px] leading-[24px]","bg-white backdrop-blur-[5.65px] text-neutral-900"),e==="h15MainPage"&&Y("h-12","bp50:h-[28.8px]","bp62_5:h-9","bp81_5:h-15","px-8","bp50:px-[19.2px]","bp62_5:px-6","bp81_5:px-8","roboto-flex-112-600-0","text-[14px]","bp50:text-[12px]","bp62_5:text-[15px]","bp81_5:text-[20px]","leading-[24px]","bp50:leading-[14.4px]","bp62_5:leading-[18px]","bp81_5:leading-[24px]","bg-[rgba(113,113,122,0.36)]","backdrop-blur-[5.65px]","text-zinc-100","hover:bg-[rgba(113,113,122,0.56)]"),e==="h15inverseMainPage"&&Y("h-12","bp50:h-[28.8px]","bp62_5:h-9","bp81_5:h-15","px-8","bp50:px-[19.2px]","bp62_5:px-6","bp81_5:px-8","roboto-flex-112-600-0","text-[14px]","bp50:text-[12px]","bp62_5:text-[15px]","bp81_5:text-[20px]","leading-[24px]","bp50:leading-[14.4px]","bp62_5:leading-[18px]","bp81_5:leading-[24px]","bg-white","backdrop-blur-[5.65px]","text-neutral-900"),e==="h16"&&Y("h-14 bp48:h-16","flex flex-col items-center justify-center","py-2.5 px-8","roboto-flex-25-700-1 text-[16px] bp48:text-[20px] leading-[16px] bp48:leading-[32px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white"),e==="h16inverse"&&Y("h-14 bp48:h-16","flex flex-col items-center justify-center","py-2.5 px-8","roboto-flex-25-700-1 text-[16px] bp48:text-[20px] leading-[16px] bp48:leading-[32px] uppercase","bg-zinc-100 text-zinc-950","hover:bg-zinc-200"),p),[e,d,p]),E=l.useMemo(()=>r&&Oe.isValidElement(i)?i.props.children:i,[i,r]),x=l.useMemo(()=>s?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"invisible",children:E}),a.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(Co,{className:Y("size-5 animate-spin stroke-current",!!["h8inverse","h12inverse","h15inverse","h15inverseMainPage"].includes(e)&&"text-zinc-400",!["h8inverse","h12inverse","h15inverse","h15inverseMainPage"].includes(e)&&"text-zinc-500")})})]}):E,[E,s,e]),y=l.useMemo(()=>r&&Oe.isValidElement(i)?Oe.cloneElement(i,{...g,className:A,children:x,onClick:u}):a.jsx("button",{disabled:!!s||!!o,type:c??"button","aria-busy":s,className:A,onClick:u,...g,children:x}),[r,i,s,o,A,x,c,u,g]);return t?a.jsx(XZ,{className:n,children:y}):y},JZ=()=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Y("flex","justify-end","px-4","pt-2","h-12","z-10","w-full","mx-auto","bp50:pt-[1.8px]","bp50:h-[64.8px]","bp62_5:pt-[2.25px]","bp62_5:h-[81px]","bp81_5:pt-[3px]","bp81_5:h-[108px]","bp81_5:max-w-[81.5rem]","bp120:px-8","bp120:max-w-none"),children:a.jsx("div",{className:Y("w-full","h-[44px]","flex","justify-center","items-center","bp50:h-[63px]","bp50:justify-start","bp62_5:h-[78.75px]","bp81_5:h-[105px]","bp81_5:justify-start"),children:a.jsx(Je,{to:"/",className:Y("block","ml-[0px]","bp50:-ml-[6.4px]","bp62_5:-ml-[8px]","bp81_5:-ml-[14px]"),children:a.jsx(BO,{className:Y("w-[142px]","h-[38px]","bp50:w-[115.2px]","bp50:h-[31.2px]","bp62_5:w-[192px]","bp62_5:h-[52px]","bp81_5:w-[286px]","bp81_5:h-[77px]")})})})}),a.jsx("div",{className:Y("fixed","top-auto","bottom-0","z-10","flex","justify-end","px-4","pointer-events-none","pt-2","pb-4","h-auto","mt-0","w-full","min-w-[var(--breakpoint-bp23_25)]","bp50:sticky","bp50:top-0","bp50:bottom-auto","bp50:pt-[1.8px]","bp50:pb-[2.4px]","bp50:h-[64.8px]","bp50:-mt-[64.8px]","bp62_5:pt-[2.25px]","bp62_5:pb-3","bp62_5:h-[81px]","bp62_5:-mt-[81px]","bp81_5:sticky","bp81_5:top-0","bp81_5:bottom-auto","bp81_5:pt-0.75","bp81_5:pb-4","bp81_5:h-[108px]","bp81_5:-mt-[108px]","bp120:px-8"),children:a.jsx("div",{className:Y("w-full","h-full","flex","flex-col","items-center","justify-end","bp50:h-[63px]","bp50:flex-row","bp62_5:h-[78.75px]","bp81_5:h-[105px]","bp81_5:flex-row"),children:a.jsxs("div",{className:Y("flex","pointer-events-auto","w-full","justify-between","bp34_375:w-auto","bp34_375:justify-start"),children:[a.jsx(ut,{variant:"h15MainPage",asChild:!0,className:Y("flex-1","mr-2.5","bp34_375:flex-initial"),children:a.jsx(Je,{to:"/sign-in",children:h.main.header.SIGN_IN}
837)}),a.jsx(ut,{variant:"h15inverseMainPage",isGlow:!0,asChild:!0,isFullWidth:!0,glowClassName:Y("flex-2","bp34_375:flex-initial"),children:a.jsx(Je,{to:"/sign-up",onClick:()=>{pf({goalId:"button_reg"})},children:h.main.header.SIGN_UP})})]})})})]}),ZZ="/assets/headerBackground-BwRPxjp2.jpg",eee="/assets/headerMarble-DVAyPrIk.webp",tee="/assets/headerMarbleWrapped-xnKQ0bf4.webp",nee="/assets/footerBackground-DOKCLmuw.webp",see=e=>l.createElement("svg",{width:112,height:24,viewBox:"0 0 112 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M0 11.8462C0 8.39968 0 6.67644 0.670729 5.36006C1.26072 4.20214 2.20214 3.26072 3.36006 2.67073C4.67644 2 6.39968 2 9.84615 2H10.1538C11.3037 2 11.4926 2 12.3077 2.02491V5.46154H5.92308C5.06146 5.46154 4.63065 5.46154 4.30155 5.62922C4.01207 5.77672 3.77672 6.01207 3.62922 6.30155C3.46154 6.63065 3.46154 7.06146 3.46154 7.92308V16.0769C3.46154 16.9385 3.46154 17.3694 3.62922 17.6984C3.77672 17.9879 4.01207 18.2233 4.30155 18.3708C4.63065 18.5385 5.06146 18.5385 5.92308 18.5385H14.0769C14.9385 18.5385 15.3694 18.5385 15.6984 18.3708C15.9879 18.2233 16.2233 17.9879 16.3708 17.6984C16.5385 17.3694 16.5385 16.9385 16.5385 16.0769V9.69231H19.9751C20 10.5074 20 10.6963 20 11.8462V12.1538C20 15.6003 20 17.3236 19.3293 18.6399C18.7393 19.7979 17.7979 20.7393 16.6399 21.3293C15.3236 22 13.6003 22 10.1538 22H9.84616C6.39968 22 4.67644 22 3.36006 21.3293C2.20214 20.7393 1.26072 19.7979 0.670729 18.6399C0 17.3236 0 15.6003 0 12.1538V11.8462Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M12.3077 5.46154H16.5385V9.69231H12.3077V5.46154Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M25.3477 19V4.78125H29.8594C31.2526 4.78125 32.3171 5.16211 33.0527 5.92383C33.7949 6.67904 34.166 7.8444 34.166 9.41992C34.166 10.9889 33.7917 12.1576 33.043 12.9258C32.3008 13.694 31.2331 14.0781 29.8398 14.0781H28.2578V19H25.3477ZM28.2578 11.8711H29.5664C30.1849 11.8711 30.6211 11.6758 30.875 11.2852C31.1354 10.888 31.2656 10.2695 31.2656 9.42969C31.2656 8.61589 31.1354 8.01042 30.875 7.61328C30.6211 7.21615 30.1849 7.01758 29.5664 7.01758H28.2578V11.8711Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M35.1484 19V4.78125H38.0586V16.7051H42.7363V19H35.1484Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M43.4695 19V4.78125H51.3211V7.07617H46.3406V10.5527H50.5203V12.8281H46.3406V16.7148H51.4188V19H43.4695Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M51.6875 4.78125H54.7344L56.7754 14.3027C56.8145 14.472 56.8503 14.651 56.8828 14.8398C56.9154 15.0286 56.9447 15.2305 56.9707 15.4453H57.0293C57.0488 15.2305 57.0749 15.0286 57.1074 14.8398C57.1465 14.6445 57.1823 14.4655 57.2148 14.3027L59.3242 4.78125H62.1074L58.4062 19.0488H55.4082L51.6875 4.78125Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M60.6828 19L64.3742 4.72266H67.5383L71.2687 19H68.2023L66.0734 9.67383C66.0279 9.44596 65.9855 9.14648 65.9465 8.77539C65.9074 8.4043 65.8716 8.1276 65.8391 7.94531H65.7805C65.7479 8.1276 65.7089 8.4043 65.6633 8.77539C65.6242 9.14648 65.5786 9.44596 65.5266 9.67383L63.3879 19H60.6828ZM62.8605 15.8848L63.3684 13.707H68.4172L68.9348 15.8848H62.8605Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M71.7383 19V4.78125H74.6484V10.0547L78.3789 4.78125H81.4258L74.6484 14.0781V19H71.7383ZM78.4473 19L74.7168 12.2324L76.3672 9.81055L81.6895 19H78.4473Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M81.4949 12.6816V11.0703C81.4949 8.86979 81.9669 7.22591 82.9109 6.13867C83.8615 5.05143 85.1147 4.50781 86.6707 4.50781C88.2267 4.50781 89.4799 5.05143 90.4305 6.13867C91.3875 7.22591 91.866 8.86979 91.866 11.0703V12.6816C91.866 14.8887 91.3875 16.5391 90.4305 17.6328C89.4734 18.7266 88.2202 19.2734 86.6707 19.2734C85.1147 19.2734 83.8615 18.7266 82.9109 17.6328C81.9669 16.5391 81.4949 14.8887 81.4949 12.6816ZM84.4832 13.3066C84.4832 14.5632 84.6688 15.4941 85.0398 16.0996C85.4174 16.6986 85.9611 16.998 86.6707 16.998C87.3868 16.998 87.9305 16.6986 88.3016 16.0996C88.6792 15.4941 88.868 14.5632 88.868 13.3066V10.4746C88.868 9.22461 88.6792 8.30013 88.3016 7.70117C87.9305 7.0957 87.3868 6.79297 86.6707 6.79297C85.9611 6.79297 85.4174 7.0957 85.0398 7.70117C84.6688 8.30013 84.4832 9.22461 84.4832 10.4746V13.3066Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M92.3355 17.4863C92.3355 17.0176 92.4885 16.6172 92.7945 16.2852C93.107 15.9531 93.553 15.7871 94.1324 15.7871C94.7119 15.7871 95.1546 15.9531 95.4605 16.2852C95.7665 16.6172 95.9195 17.0208 95.9195 17.4961C95.9195 17.9714 95.7665 18.375 95.4605 18.707C95.1546 19.0391 94.7086 19.2051 94.1227 19.2051C93.5497 19.2051 93.107 19.0391 92.7945 18.707C92.4885 18.3685 92.3355 17.9616 92.3355 17.4863Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M96.8914 19L100.583 4.72266H103.747L107.477 19H104.411L102.282 9.67383C102.236 9.44596 102.194 9.14648 102.155 8.77539C102.116 8.4043 102.08 8.1276 102.048 7.94531H101.989C101.957 8.1276 101.917 8.4043 101.872 8.77539C101.833 9.14648 101.787 9.44596 101.735 9.67383L99.5965 19H96.8914ZM99.0691 15.8848L99.577 13.707H104.626L105.143 15.8848H99.0691Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M107.966 19V4.78125H110.877V19H107.966Z",fill:"#0A0A0A"})),ree=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M0 9.8462C0 6.39968 0 4.67644 0.670729 3.36006C1.26072 2.20214 2.20214 1.26072 3.36006 0.670729C4.67644 0 6.39968 0 9.84615 0H10.1538C11.3037 0 11.4926 0 12.3077 0.02491V3.46154H5.92308C5.06146 3.46154 4.63065 3.46154 4.30155 3.62922C4.01207 3.77672 3.77672 4.01207 3.62922 4.30155C3.46154 4.63065 3.46154 5.06146 3.46154 5.92308V14.0769C3.46154 14.9385 3.46154 15.3694 3.62922 15.6984C3.77672 15.9879 4.01207 16.2233 4.3
8370155 16.3708C4.63065 16.5385 5.06146 16.5385 5.92308 16.5385H14.0769C14.9385 16.5385 15.3694 16.5385 15.6984 16.3708C15.9879 16.2233 16.2233 15.9879 16.3708 15.6984C16.5385 15.3694 16.5385 14.9385 16.5385 14.0769V7.69231H19.9751C20 8.5074 20 8.6963 20 9.8462V10.1538C20 13.6003 20 15.3236 19.3293 16.6399C18.7393 17.7979 17.7979 18.7393 16.6399 19.3293C15.3236 20 13.6003 20 10.1538 20H9.84616C6.39968 20 4.67644 20 3.36006 19.3293C2.20214 18.7393 1.26072 17.7979 0.670729 16.6399C0 15.3236 0 13.6003 0 10.1538V9.8462Z",fill:"currentColor"}),l.createElement("path",{d:"M12.3077 3.46154H16.5385V7.69231H12.3077V3.46154Z",fill:"currentColor"})),iee=({to:e,variant:t="115x24",displayClassNames:n="flex"})=>{const s=Se(c=>c.user),r=l.useMemo(()=>s?.access?.hasFullAccess||s?.access?.isPaidActive||s?.access?.isTrialActive?"/clients":"/profile/subscription",[s?.access?.hasFullAccess,s?.access?.isPaidActive,s?.access?.isTrialActive]),i=l.useMemo(()=>e||(s?r:"/sign-in"),[s,r,e]),o=l.useMemo(()=>t==="115x24"?"w-[112px] h-[24px]":"w-[163px] h-[36px]",[t]);return a.jsxs(Hs,{to:i,className:Y("group items-center h-full px-4",n),children:[a.jsx(ree,{className:"block size-7 text-zinc-950 group-hover:text-zinc-800 bp62_5:hidden"}),a.jsx(see,{className:Y("hidden bp62_5:block text-zinc-950 group-hover:text-zinc-800",o)})]})},FO="px-2 roboto-flex-25-700-1 font-bold text-[20px] leading-6 tracking-[-0.04em] uppercase",Zv=({link:e,pathname:t})=>e.activePathBase?!!t.startsWith(e.activePathBase):!!qs({path:e.to,end:e.end,caseSensitive:!1},t),N6=({link:e,pathname:t})=>Zv({link:e,pathname:t})?e.activePathBase?e.activePathBase.length:e.to.length:-1,oee=({navLinks:e,pathname:t})=>e.reduce((n,s,r)=>{const i=N6({link:s,pathname:t});if(i<0)return n;if(n<0)return r;const o=N6({link:e[n],pathname:t});return i<=o?n:r},-1),w6=({to:e,end:t,redirectTo:n,activePathBase:s,linkId:r,isClientPage:i=!1,children:o})=>{const c=Fe(),u=c.state?.clientData,d=n||e,p=r==="client",g=Zv({link:{to:e,end:t,activePathBase:s},pathname:c.pathname});return a.jsx(Je,{to:d,end:t,className:Y("h-full flex items-center relative top-px",!!i&&!!p&&Y("roboto-flex-25-700-1 text-[12px] leading-[14px] text-zinc-950 pl-0 uppercase tracking-normal justify-start text-left","bp41_5:px-2 bp41_5:pl-4 bp41_5:text-[20px] bp41_5:leading-[24px] bp41_5:uppercase bp41_5:tracking-[-0.04em] bp41_5:text-center","bp41_5:shrink-0",!!g&&"bp41_5:text-zinc-950",!g&&"bp41_5:text-zinc-400 bp41_5:hover:text-zinc-500"),!(i&&p)&&Y(FO,"text-center shrink-0",!!g&&"text-zinc-950",!g&&"text-zinc-400 hover:text-zinc-500")),state:{clientData:u},children:a.jsx("span",{className:Y("whitespace-nowrap truncate",!!i&&!!p&&"max-w-[132px]"),children:o})})},gf=Math.min,ci=Math.max,zA=Math.round,S0=Math.floor,Xo=e=>({x:e,y:e}),aee={left:"right",right:"left",bottom:"top",top:"bottom"};function R6(e,t,n){return ci(e,gf(t,n))}function ym(e,t){return typeof e=="function"?e(t):e}function sc(e){return e.split("-")[0]}function bm(e){return e.split("-")[1]}function UO(e){return e==="x"?"y":"x"}function zO(e){return e==="y"?"height":"width"}function Xa(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function QO(e){return UO(Xa(e))}function lee(e,t,n){n===void 0&&(n=!1);const s=bm(e),r=QO(e),i=zO(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=QA(o)),[o,QA(o)]}function cee(e){const t=QA(e);return[OI(e),t,OI(t)]}function OI(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const D6=["left","right"],k6=["right","left"],uee=["top","bottom"],dee=["bottom","top"];function fee(e,t,n){switch(e){case"top":case"bottom":return n?t?k6:D6:t?D6:k6;case"left":case"right":return t?uee:dee;default:return[]}}function pee(e,t,n,s){const r=bm(e);let i=fee(sc(e),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),t&&(i=i.concat(i.map(OI)))),i}function QA(e){const t=sc(e);return aee[t]+e.slice(t.length)}function hee(e){return{top:0,right:0,bottom:0,left:0,...e}}function mee(e){return typeof e!="number"?hee(e):{top:e,right:e,bottom:e,left:e}}function HA(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}
vendor: 4,116 bytes, line 837
837function O6(e,t,n){let{reference:s,floating:r}=e;const i=Xa(t),o=QO(t),c=zO(o),u=sc(t),d=i==="y",p=s.x+s.width/2-r.width/2,g=s.y+s.height/2-r.height/2,A=s[c]/2-r[c]/2;let E;switch(u){case"top":E={x:p,y:s.y-r.height};break;case"bottom":E={x:p,y:s.y+s.height};break;case"right":E={x:s.x+s.width,y:g};break;case"left":E={x:s.x-r.width,y:g};break;default:E={x:s.x,y:s.y}}switch(bm(t)){case"start":E[o]-=A*(n&&d?-1:1);break;case"end":E[o]+=A*(n&&d?-1:1);break}return E}async function gee(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:i,rects:o,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:A=!1,padding:E=0}=ym(t,e),x=mee(E),I=c[A?g==="floating"?"reference":"floating":g],v=HA(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(I)))==null||n?I:I.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:d,rootBoundary:p,strategy:u})),S=g==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},_=HA(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:b,strategy:u}):S);return{top:(v.top-_.top+x.top)/w.y,bottom:(_.bottom-v.bottom+x.bottom)/w.y,left:(v.left-_.left+x.left)/w.x,right:(_.right-v.right+x.right)/w.x}}const Aee=50,Eee=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,c=o.detectOverflow?o:{...o,detectOverflow:gee},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:g}=O6(d,s,u),A=s,E=0;const x={};for(let y=0;y<i.length;y++){const I=i[y];if(!I)continue;const{name:v,fn:S}=I,{x:b,y:w,data:_,reset:N}=await S({x:p,y:g,initialPlacement:s,placement:A,strategy:r,middlewareData:x,rects:d,platform:c,elements:{reference:e,floating:t}});p=b??p,g=w??g,x[v]={...x[v],..._},N&&E<Aee&&(E++,typeof N=="object"&&(N.placement&&(A=N.placement),N.rects&&(d=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:p,y:g}=O6(d,A,u)),y=-1)}return{x:p,y:g,placement:A,strategy:r,middlewareData:x}},xee=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:A,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...I}=ym(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=sc(r),S=Xa(c),b=sc(c)===c,w=await(u.isRTL==null?void 0:u.isRTL(d.floating)),_=A||(b||!y?[QA(c)]:cee(c)),N=x!=="none";!A&&N&&_.push(...pee(c,y,x,w));const R=[c,..._],D=await u.detectOverflow(t,I),k=[];let L=((s=i.flip)==null?void 0:s.overflows)||[];if(p&&k.push(D[v]),g){const F=lee(r,o,w);k.push(D[F[0]],D[F[1]])}if(L=[...L,{placement:r,overflows:k}],!k.every(F=>F<=0)){var O,P;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,z=R[F];if(z&&(!(g==="alignment"?S!==Xa(z):!1)||L.every(K=>Xa(K.placement)===S?K.overflows[0]>0:!0)))return{data:{index:F,overflows:L},reset:{placement:z}};let Q=(P=L.filter(M=>M.overflows[0]<=0).sort((M,K)=>M.overflows[1]-K.overflows[1])[0])==null?void 0:P.placement;if(!Q)switch(E){case"bestFit":{var B;const M=(B=L.filter(K=>{if(N){const W=Xa(K.placement);return W===S||W==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(W=>W>0).reduce((W,H)=>W+H,0)]).sort((K,W)=>K[1]-W[1])[0])==null?void 0:B[0];M&&(Q=M);break}case"initialPlacement":Q=c;break}if(r!==Q)return{reset:{placement:Q}}}return{}}}},Cee=new Set(["left","top"]);async function yee(e,t){const{placement:n,platform:s,elements:r}=e,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=sc(n),c=bm(n),u=Xa(n)==="y",d=Cee.has(o)?-1:1,p=i&&u?-1:1,g=ym(t,e);let{mainAxis:A,crossAxis:E,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}
837:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof x=="number"&&(E=c==="end"?x*-1:x),u?{x:E*p,y:A*d}:{x:A*d,y:E*p}}const bee=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:i,placement:o,middlewareData:c}=t,u=await yee(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(s=c.arrow)!=null&&s.alignmentOffset?{}:{x:r+u.x,y:i+u.y,data:{...u,placement:o}}}}},Iee=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:v=>{let{x:S,y:b}=v;return{x:S,y:b}}},...d}=ym(e,t),p={x:n,y:s},g=await i.detectOverflow(t,d),A=Xa(sc(r)),E=UO(A);let x=p[E],y=p[A];if(o){const v=E==="y"?"top":"left",S=E==="y"?"bottom":"right",b=x+g[v],w=x-g[S];x=R6(b,x,w)}if(c){const v=A==="y"?"top":"left",S=A==="y"?"bottom":"right",b=y+g[v],w=y-g[S];y=R6(b,y,w)}const I=u.fn({...t,[E]:x,[A]:y});return{...I,data:{x:I.x-n,y:I.y-s,enabled:{[E]:o,[A]:c}}}}}},See=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:r,rects:i,platform:o,elements:c}=t,{apply:u=()=>{},...d}=ym(e,t),p=await o.detectOverflow(t,d),g=sc(r),A=bm(r),E=Xa(r)==="y",{width:x,height:y}=i.floating;let I,v;g==="top"||g==="bottom"?(I=g,v=A===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(v=g,I=A==="end"?"top":"bottom");const S=y-p.top-p.bottom,b=x-p.left-p.right,w=gf(y-p[I],S),_=gf(x-p[v],b),N=!t.middlewareData.shift;let R=w,D=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=b),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(R=S),N&&!A){const L=ci(p.left,0),O=ci(p.right,0),P=ci(p.top,0),B=ci(p.bottom,0);E?D=x-2*(L!==0||O!==0?L+O:ci(p.left,p.right)):R=y-2*(P!==0||B!==0?P+B:ci(p.top,p.bottom))}await u({...t,availableWidth:D,availableHeight:R});const k=await o.getDimensions(c.floating);return x!==k.width||y!==k.height?{reset:{rects:!0}}:{}}}};function J1(){return typeof window<"u"}function Bf(e){return HO(e)?(e.nodeName||"").toLowerCase():"#document"}function pi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ma(e){var t;return(t=(HO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HO(e){return J1()?e instanceof Node||e instanceof pi(e).Node:!1}function yo(e){return J1()?e instanceof Element||e instanceof pi(e).Element:!1}function dl(e){return J1()?e instanceof HTMLElement||e instanceof pi(e).HTMLElement:!1}function P6(e){return!J1()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pi(e).ShadowRoot}function Im(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=bo(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&r!=="inline"&&r!=="contents"}function vee(e){return/^(table|td|th)$/.test(Bf(e))}function Z1(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const _ee=/transform|translate|scale|rotate|perspective|filter/,Tee=/paint|layout|strict|content/,Bc=e=>!!e&&e!=="none";let Dy;function e2(e){const t=yo(e)?bo(e):e;return Bc(t.transform)||Bc(t.translate)||Bc(t.scale)||Bc(t.rotate)||Bc(t.perspective)||!t2()&&(Bc(t.backdropFilter)||Bc(t.filter))||_ee.test(t.willChange||"")||Tee.test(t.contain||"")}function Nee(e){let t=rc(e);for(;dl(t)&&!Af(t);){if(e2(t))return t;if(Z1(t))return null;t=rc(t)}return null}function t2(){return Dy==null&&(Dy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Dy}function Af(e){return/^(html|body|#document)$/.test(Bf(e))}function bo(e){return pi(e).getComputedStyle(e)}function eE(e){return yo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rc(e){if(Bf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||P6(e)&&e.host||ma(e);return P6(t)?t.host:t}function VO(e){const t=rc(e);return Af(t)?e.ownerDocument?e.ownerDocument.body:e.body:dl(t)&&Im(t)?t:VO(t)}function Wh(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=VO(e),i=r===((s=e.ownerDocument)==null?void 0:s.body),o=pi(r);if(i){const c=PI(o);
vendor: 9,068 bytes, line 837
837return t.concat(o,o.visualViewport||[],Im(r)?r:[],c&&n?Wh(c):[])}else return t.concat(r,Wh(r,[],n))}function PI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function GO(e){const t=bo(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=dl(e),i=r?e.offsetWidth:n,o=r?e.offsetHeight:s,c=zA(n)!==i||zA(s)!==o;return c&&(n=i,s=o),{width:n,height:s,$:c}}function n2(e){return yo(e)?e:e.contextElement}function af(e){const t=n2(e);if(!dl(t))return Xo(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:i}=GO(t);let o=(i?zA(n.width):n.width)/s,c=(i?zA(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const wee=Xo(0);function qO(e){const t=pi(e);return!t2()||!t.visualViewport?wee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ree(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pi(e)?!1:t}function gu(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=n2(e);let o=Xo(1);t&&(s?yo(s)&&(o=af(s)):o=af(e));const c=Ree(i,n,s)?qO(i):Xo(0);let u=(r.left+c.x)/o.x,d=(r.top+c.y)/o.y,p=r.width/o.x,g=r.height/o.y;if(i){const A=pi(i),E=s&&yo(s)?pi(s):s;let x=A,y=PI(x);for(;y&&s&&E!==x;){const I=af(y),v=y.getBoundingClientRect(),S=bo(y),b=v.left+(y.clientLeft+parseFloat(S.paddingLeft))*I.x,w=v.top+(y.clientTop+parseFloat(S.paddingTop))*I.y;u*=I.x,d*=I.y,p*=I.x,g*=I.y,u+=b,d+=w,x=pi(y),y=PI(x)}}return HA({width:p,height:g,x:u,y:d})}function tE(e,t){const n=eE(e).scrollLeft;return t?t.left+n:gu(ma(e)).left+n}function WO(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-tE(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function Dee(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const i=r==="fixed",o=ma(s),c=t?Z1(t.floating):!1;if(s===o||c&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Xo(1);const p=Xo(0),g=dl(s);if((g||!g&&!i)&&((Bf(s)!=="body"||Im(o))&&(u=eE(s)),g)){const E=gu(s);d=af(s),p.x=E.x+s.clientLeft,p.y=E.y+s.clientTop}const A=o&&!g&&!i?WO(o,u):Xo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+p.x+A.x,y:n.y*d.y-u.scrollTop*d.y+p.y+A.y}}function kee(e){return Array.from(e.getClientRects())}function Oee(e){const t=ma(e),n=eE(e),s=e.ownerDocument.body,r=ci(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=ci(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-n.scrollLeft+tE(e);const c=-n.scrollTop;return bo(s).direction==="rtl"&&(o+=ci(t.clientWidth,s.clientWidth)-r),{width:r,height:i,x:o,y:c}}const L6=25;function Pee(e,t){const n=pi(e),s=ma(e),r=n.visualViewport;let i=s.clientWidth,o=s.clientHeight,c=0,u=0;if(r){i=r.width,o=r.height;const p=t2();(!p||p&&t==="fixed")&&(c=r.offsetLeft,u=r.offsetTop)}const d=tE(s);if(d<=0){const p=s.ownerDocument,g=p.body,A=getComputedStyle(g),E=p.compatMode==="CSS1Compat"&&parseFloat(A.marginLeft)+parseFloat(A.marginRight)||0,x=Math.abs(s.clientWidth-g.clientWidth-E);x<=L6&&(i-=x)}else d<=L6&&(i+=d);return{width:i,height:o,x:c,y:u}}function Lee(e,t){const n=gu(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,i=dl(e)?af(e):Xo(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,u=r*i.x,d=s*i.y;return{width:o,height:c,x:u,y:d}}function M6(e,t,n){let s;if(t==="viewport")s=Pee(e,n);else if(t==="document")s=Oee(ma(e));else if(yo(t))s=Lee(t,n);else{const r=qO(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return HA(s)}function KO(e,t){const n=rc(e);return n===t||!yo(n)||Af(n)?!1:bo(n).position==="fixed"||KO(n,t)}function Mee(e,t){const n=t.get(e);if(n)return n;let s=Wh(e,[],!1).filter(c=>yo(c)&&Bf(c)!=="body"),r=null;const i=bo(e).position==="fixed";let o=i?rc(e):e;for(;yo(o)&&!Af(o);){const c=bo(o),u=e2(o);!u&&c.position==="fixed"&&(r=null),(i?!u&&!r:!u&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Im(o)&&!u&&KO(e,o))?s=s.filter(p=>p!==o):r=c,o=rc(o)}return t.set(e,s),s}function jee(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const o=[...n==="clippingAncestors"?Z1(t)?[]:Mee(t,this._c):[].concat(n),s],c=M6(t,o[0],r);let u=c.top,d=c.right,p=c.bottom,g=c.left;for(let A=1;A<o.length;A++){const E=M6(t,o[A],r);u=ci(E.top,u),d=gf(E.right,d),p=gf(E.bottom,p),g=ci(E.left,g)}return{width:d-g,height:p-u,x:g,y:u}}function Bee(e){const{width:t,height:n}=GO(e);return{width:t,height:n}}function Fee(e,t,n){const s=dl(t),r=ma(t),i=n==="fixed",o=gu(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Xo(0);function d(){u.x=tE(r)}if(s||!s&&!i)if((Bf(t)!=="body"||Im(r))&&(c=eE(t)),s){const E=gu(t,!0,i,t);u.x=E.x+t.clientLeft,u.y=E.y+t.clientTop}else r&&d();i&&!s&&r&&d();const p=r&&!s&&!i?WO(r,c):Xo(0),g=o.left+c.scrollLeft-u.x-p.x,A=o.top+c.scrollTop-u.y-p.y;return{x:g,y:A,width:o.width,height:o.height}}function ky(e){return bo(e).position==="static"}function j6(e,t){if(!dl(e)||bo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ma(e)===n&&(n=n.ownerDocument.body),n}function $O(e,t){const n=pi(e);if(Z1(e))return n;if(!dl(e)){let r=rc(e);for(;r&&!Af(r);){if(yo(r)&&!ky(r))return r;r=rc(r)}return n}let s=j6(e,t);for(;s&&vee(s)&&ky(s);)s=j6(s,t);return s&&Af(s)&&ky(s)&&!e2(s)?n:s||Nee(e)||n}const Uee=async function(e){const t=this.getOffsetParent||$O,n=this.getDimensions,s=await n(e.floating);return{reference:Fee(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function zee(e){return bo(e).direction==="rtl"}const Qee={convertOffsetParentRelativeRectToViewportRelativeRect:Dee,getDocumentElement:ma,getClippingRect:jee,getOffsetParent:$O,getElementRects:Uee,getClientRects:kee,getDimensions:Bee,getScale:af,isElement:yo,isRTL:zee};function YO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hee(e,t){let n=null,s;const r=ma(e);function i(){var c;clearTimeout(s),(c=n)==null||c.disconnect(),n=null}function o(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),i();const d=e.getBoundingClientRect(),{left:p,top:g,width:A,height:E}=d;if(c||t(),!A||!E)return;const x=S0(g),y=S0(r.clientWidth-(p+A)),I=S0(r.clientHeight-(g+E)),v=S0(p),b={rootMargin:-x+"px "+-y+"px "+-I+"px "+-v+"px",threshold:ci(0,gf(1,u))||1};let w=!0;function _(N){const R=N[0].intersectionRatio;if(R!==u){if(!w)return o();R?o(!1,R):s=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!YO(d,e.getBoundingClientRect())&&o(),w=!1}try{n=new IntersectionObserver(_,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(_,b)}n.observe(e)}return o(!0),i}function Ji(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=s,d=n2(e),p=r||i?[...d?Wh(d):[],...t?Wh(t):[]]:[];p.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const g=d&&c?Hee(d,n):null;let A=-1,E=null;o&&(E=new ResizeObserver(v=>{let[S]=v;S&&S.target===d&&E&&t&&(E.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var b;(b=E)==null||b.observe(t)})),n()}),d&&!u&&E.observe(d),t&&E.observe(t));let x,y=u?gu(e):null;u&&I();function I(){const v=gu(e);y&&!YO(y,v)&&n(),y=v,x=requestAnimationFrame(I)}return n(),()=>{var v;p.forEach(S=>{r&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),g?.(),(v=E)==null||v.disconnect(),E=null,u&&cancelAnimationFrame(x)}}const _o=bee,Ai=Iee,s2=xee,LI=See,Ei=(e,t,n)=>{const s=new Map,r={platform:Qee,...n},i={...r.platform,_c:s};return Eee(e,t,{...r,platform:i})},Vee=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M4.16669 10.8334C4.62692 10.8334 5.00002 10.4603 5.00002 10C5.00002 9.53978 4.62692 9.16669 4.16669 9.16669C3.70645 9.16669 3.33335 9.53978 3.33335 10C3.33335 10.4603 3.70645 10.8334 4.16669 10.8334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 10.8334C10.4603 10.8334 10.8334 10.4603 10.8334 10C10.8334 9.53978 10.4603 9.16669 10 9.16669C9.53978 9.16669 9.16669 9.53978 9.16669 10C9.16669 10.4603 9.53978 10.8334 10 10.8334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M15.8334 10.8334C16.2936 10.8334 16.6667 10.4603 16.6667 10C16.6667 9.53978 16.2936 9.16669 15.8334 9.16669C15.3731 9.16669 15 9.53978 15 10C15 10.4603 15.3731 10.8334 15.8334 10.8334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Gee=({items:e})=>{const[t,n]=l.useState(!1),s=Fe(),r=l.useRef(null),i=l.useRef(null),o=s.state?.clientData,c=l.useCallback(g=>{const A=r.current,E=g.target;A&&E instanceof Node&&(A.contains(E)||n(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}),[c]),l.useEffect(()=>{if(!t)return;const g=r.current,A=i.current;if(!g||!A)return;const E=Ji(g,A,async()=>{const x=await Ei(g,A,{placement:"bottom-end",strategy:"absolute",middleware:[s2({fallbackPlacements:["top-end","bottom-start","to
837p-start"]}),Ai({padding:16})]});Object.assign(A.style,{left:`${x.x}px`,top:`${x.y}px`})});return()=>{Object.assign(A.style,{left:"",top:""}),E()}},[t]),l.useEffect(()=>{n(!1)},[s.pathname]);const u=l.useCallback(()=>{n(g=>!g)},[]),d=l.useCallback(g=>Zv({link:g,pathname:s.pathname}),[s.pathname]),p=l.useCallback(g=>g.redirectTo?g.redirectTo:g.to,[]);return e.length===0?null:a.jsxs("div",{ref:r,className:"relative h-full flex items-center shrink-0 select-none",children:[a.jsx("button",{type:"button",onClick:u,"aria-label":h.clients.layout.buttons.MORE_SECTIONS,"aria-expanded":t,className:Y("h-full flex items-center justify-center pl-[21px] pr-[2px] text-zinc-400 hover:text-zinc-500 cursor-pointer",!!t&&"text-zinc-500"),children:a.jsx(Vee,{className:"size-6"})}),!!t&&a.jsx("div",{ref:i,className:"absolute -ml-[0px] -mt-[6px] z-50 flex flex-col max-h-82 w-max min-w-[220px] bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)]",children:a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:e.map(g=>{const A=p(g);return a.jsx(Je,{to:A,end:g.end,state:{clientData:o},onClick:()=>n(!1),className:"pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer block",children:a.jsx("div",{className:Y("flex items-start justify-between px-3 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 group-hover:bg-zinc-50 rounded-[6px]",!!d(g)&&"bg-zinc-50"),children:a.jsx("span",{className:"whitespace-nowrap",children:g.name})})},`${g.id}-${g.name}-${g.to}`)})})})})]})},nE=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M14 16L2 7.98938L14 0L10.7527 7.98938L14 16Z",fill:"currentColor"})),ga=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_6486_6893)"},l.createElement("path",{d:"M18.001 6L6.00101 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}
837),l.createElement("path",{d:"M5.99902 6L17.999 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_6486_6893"},l.createElement("rect",{width:24,height:24,fill:"white"})))),XO=.5,B6=40,F6=({element:e})=>e?e.getBoundingClientRect().width:0,JO=({widths:e})=>e.reduce((t,n)=>t+n,0),qee=({widths:e,index:t})=>{const n=e[t];return n===void 0?0:n},Wee=({visibleCount:e,totalCount:t,overflowButtonWidth:n})=>e>=t?0:n,Kee=({widths:e,availableWidth:t,overflowButtonWidth:n})=>{const s=r=>r<=0?0:JO({widths:e.slice(0,r)})+Wee({visibleCount:r,totalCount:e.length,overflowButtonWidth:n})<=t+XO?r:s(r-1);return s(e.length)},$ee=({capacity:e,activeIndex:t,widths:n,availableWidth:s,overflowButtonWidth:r})=>{const i=o=>o<=1?1:s<=0||JO({widths:n.slice(0,o-1)})+qee({widths:n,index:t})+r<=s+XO?o:i(o-1);return i(e)},Yee=({backLink:e,isClientPage:t,linksTree:n})=>{const s=Fe(),r=l.useRef(null),i=l.useRef(null),o=l.useRef(null),c=l.useRef(null),u=l.useRef(null),d=l.useRef(null),p=l.useRef([]),g=l.useRef(B6),A=l.useRef(0),[E,x]=l.useState(null),y=l.useMemo(()=>{const w=n?.[0]?.children;return w||[]},[n]),I=l.useMemo(()=>y.find(w=>w.id==="client"),[y]),v=l.useMemo(()=>y.filter(w=>w.id!=="client"),[y]);l.useLayoutEffect(()=>{const w=r.current,_=u.current;if(!w||!_)return;const N=()=>{const L=d.current;return L?L.getBoundingClientRect().width:B6},R=()=>{const L=i.current;if(!L)return 0;const O=Number.parseFloat(window.getComputedStyle(L).paddingRight);return Number.isNaN(O)?0:O},D=()=>{const L=w.clientWidth;if(L<=0)return;const O=Array.from(_.querySelectorAll("[data-nav-measure-item]")),P=N(),B=F6({element:o.current}),F=F6({element:c.current}),z=Math.max(0,L-B-F-R());if(z<=0||O.length===0)return;const Q=O.map(K=>K.getBoundingClientRect().width);if(Q.some(K=>K<=0))return;p.current=Q,g.current=P,A.current=z;const M=Kee({widths:Q,availableWidth:z,overflowButtonWidth:P});x(K=>K===M?K:M)};D();const k=new ResizeObserver(()=>{D()});return k.observe(w),k.observe(_),o.current&&k.observe(o.current),c.current&&k.observe(c.current),window.addEventListener("resize",D),document.fonts?.ready?.then(()=>{D()}),()=>{k.disconnect(),window.removeEventListener("resize",D)}},[v]);const{visibleNavLinks:S,overflowNavLinks:b}=l.useMemo(()=>{const w=E===null?v.length:E,_=oee({navLinks:v,pathname:s.pathname}),N=p.current,R=g.current,D=A.current;if(w<=0)return{visibleNavLinks:[],overflowNavLinks:v};if(w>=v.length)return{visibleNavLinks:v,overflowNavLinks:[]};if(_>=w){const k=$ee({capacity:w,activeIndex:_,widths:N,availableWidth:D,overflowButtonWidth:R}),L=[...Array.from({length:k-1},(B,F)=>F),_],O=new Set(L),P=v.map((B,F)=>F).filter(B=>!O.has(B));return{visibleNavLinks:L.map(B=>v[B]),overflowNavLinks:P.map(B=>v[B])}}return{visibleNavLinks:v.slice(0,w),overflowNavLinks:v.slice(w)}},[v,E,s.pathname]);return!e||!n?null:a.jsx("div",{ref:r,className:"flex-1 flex items-center justify-start bp41_5:justify-center h-full w-full min-w-0",children:a.jsxs("div",{ref:i,className:Y("relative","flex","items-center","h-full","w-full","bp41_5:w-auto","bp41_5:max-w-full","min-w-0","pr-[9px] bp62_5:pr-[101px]",!!t&&"flex-row-reverse bp41_5:flex-row"),children:[a.jsxs(Je,{ref:o,to:e.to,state:{isPreventScrollToTop:!0},className:"flex relative items-center justify-center h-full bp41_5:px-4 px-1 group shrink-0",children:[a.jsx(ga,{className:"block bp41_5:hidden text-zinc-400 group-hover:text-zinc-500"}),a.jsx(nE,{className:"hidden bp41_5:block text-zinc-400 group-hover:text-zinc-500"})]}),a.jsxs("div",{className:"flex h-full min-w-0 items-center w-full",children:[!!I&&a.jsx("div",{ref:c,className:"h-full shrink-0",children:a.jsx(w6,{to:I.to,end:I.end,redirectTo:I.redirectTo,activePathBase:I.activePathBase,linkId:I.id,isClientPage:t,children:I.name})}),a.jsxs("div",{className:"hidden h-full min-w-0 items-center bp41_5:flex",children:[S.map((w,_)=>a.jsx(w6,{to:w.to,end:w.end,redirectTo:w.redirectTo,activePathBase:w.activePathBase,linkId:w.id,isClientPage:t,children:w.name},`visible-${w.id}-${w.name}-${w.to}-${_}`)),b.length>0&&a.jsx(Gee,{items:b})]})]}
837),a.jsxs("div",{ref:u,"aria-hidden":!0,className:"pointer-events-none fixed top-0 left-[-10000px] flex h-14 items-center opacity-0",children:[v.map(w=>a.jsx("div",{"data-nav-measure-item":"",className:Y(FO,"flex h-full shrink-0 items-center whitespace-nowrap"),children:w.name},`measure-${w.id}-${w.name}-${w.to}`)),a.jsx("div",{ref:d,className:"flex h-full shrink-0 items-center px-2",children:a.jsx("div",{className:"size-5"})})]})]})})},ZO=rt(async function({signal:t}={}){const n=Se.getState().accessToken,s=Ke("/legal-bases/"),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`},signal:t}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw He(r)?{httpCode:503,errorData:i.error}:{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data.bases}),Xee=rt(async function({queryText:t,baseIds:n,limit:s=20,searchAfter:r,signal:i}){const o=Se.getState().accessToken,c=Ke("/legal-bases/search/"),u={queryText:t,limit:s};n?.length&&(u.baseIds=n),r&&(u.searchAfter=r);const d=await qe(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(u),signal:i}),p=await Ye(d);if(He(p))throw{httpCode:503,errorData:p.error};if(p.status==="error")throw He(d)?{httpCode:503,errorData:p.error}:{httpCode:d.status,errorData:p.error};if(!p.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return p.data}),r2=rt(async function({baseId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/legal-bases/${t}/`),i=await qe(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw He(i)?{httpCode:503,errorData:o.error}:{httpCode:i.status,errorData:o.error};if(!o.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return o.data}),e7=rt(async function({baseId:t,articleId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/legal-bases/${t}/articles/${n}/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw He(o)?{httpCode:503,errorData:c.error}:{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),Jee="/legal-base",t7=/^\d+([.-]\d+)*$/,Zee=({baseId:e})=>e.replace(/_/g,"-"),ete=({baseIdSlug:e})=>e.replace(/-/g,"_"),tte=({baseId:e,articleId:t})=>{const n=t.indexOf(":");if(n===-1||t.slice(0,n)!==e)return t;const r=t.slice(n+1);return t7.test(r)?r:t},nte=({baseId:e,articleSlug:t})=>t7.test(t)?`${e}:${t}`:t,Ef=({baseId:e})=>`${Jee}/${Zee({baseId:e})}`,i2=({baseId:e,articleId:t})=>{const n=Ef({baseId:e}),s=tte({baseId:e,articleId:t});return`${n}/${s}`},n7=({baseIdSlug:e,articleSlug:t})=>{if(!e)return{baseId:void 0,articleId:void 0};const n=ete({baseIdSlug:e});if(!t)return{baseId:n,articleId:void 0};const s=nte({baseId:n,articleSlug:t});return{baseId:n,articleId:s}},o2=({pathname:e})=>{const t=e.split("/").filter(Boolean);return t[0]!=="legal-base"?{baseId:void 0,articleId:void 0}:n7({baseIdSlug:t[1],articleSlug:t[2]})},ste=({path:e})=>e==="/legal-base"?!0:!!e.startsWith("/legal-base/"),rte=({baseId:e,pathname:t,state:n})=>{const s=Hv({state:n}),r=q1({state:n});if(r&&ste({path:r}))return{to:r,state:s};const i=Qv({pathname:t,state:n});return i?{to:i,state:s}:e?{to:Ef({baseId:e}),state:s}:{to:"/legal-base",state:s}},U6=1e3*60*5,ite=()=>{const e=at(),t=Fe(),{baseId:n}=o2({pathname:t.pathname}),{data:s,isFetched:r}=Vt({queryKey:["legalBase",n],queryFn:()=>{if(!n)throw new Error("Missing base id");return r2({baseId:n})},enabled:!!n,staleTime:U6}),{data:i,isFetched:o}=Vt({queryKey:["legalBases"],queryFn:()=>ZO(),enabled:!!n&&!s?.name,staleTime:U6}),c=l.useMemo(()=>{if(n)return s?.name??i?.find(p=>p.id===n)?.name},[n,s?.name,i]),u=l.useMemo(()=>!n||c?!1:!r||!s?.name&&!o,[n,c,r,s?.name,o]),d=l.useCallback(()=>{const p=D$({baseId:n,state:t.state});e(p.to,{state:p.state})},[n,t.state,e]);return u||n&&!c?null:a.jsx("div",{className:"flex-1 flex items-center justify-start bp48:justify-center h-full w-full bp48:w-auto min-w-0",children:a.jsxs("div",{className:"relative flex items-center h-full w-full bp48:w-auto bp62_5:pr-11 min-w-0",children:[a.jsx("button",{type:"button",onClick:d,className:"flex relative items-center justify-center h-full bp48:p
837x-4 px-1 group cursor-pointer",children:a.jsx(nE,{className:"text-zinc-400 group-hover:text-zinc-500"})}),a.jsx("div",{className:"pl-2 roboto-flex-25-700-1 font-bold text-[20px] leading-[24px] tracking-[-0.04em] uppercase text-zinc-950 relative top-px h-full flex items-center min-w-0",children:a.jsxs("span",{className:"whitespace-nowrap truncate",children:[h.clients.legalBase.titles.PAGE,!!c&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:" · "}),c]})]})})]})})},z6=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M2.19996 11.4C2.86663 9.79998 4.13329 8.59998 5.66663 7.99998C4.79996 7.33331 4.26663 6.26665 4.26663 5.13331C4.26663 2.99998 5.93329 1.33331 7.99996 1.33331C10.0666 1.33331 11.7333 2.99998 11.7333 5.06665C11.7333 6.19998 11.2 7.26665 10.3333 7.93331C11.8666 8.53331 13.1333 9.73331 13.8 11.3333C14.0666 12 14 12.8 13.6 13.4C13.2 14.0666 12.4666 14.4 11.6666 14.4H4.26663C3.46663 14.4 2.79996 14 2.33329 13.4C1.93329 12.8 1.86663 12.0666 2.19996 11.4Z",fill:"currentColor"})),nu=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor"}),l.createElement("path",{d:"M12 7V13",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.9922 17H12.0012",stroke:"white",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round"})),ote=({user:e})=>{const t=l.useMemo(()=>e?.isEmailConfirmed===!1,[e?.isEmailConfirmed]),n=l.useMemo(()=>!!e?.access?.isTrialActive&&!!e?.trial,[e]),s=l.useMemo(()=>!n||!e?.trial?.secondsLeft?null:e?.trial?.secondsLeft,[n,e]),r=l.useMemo(()=>{if(s===null)return!1;const i=3600*24;return s<i},[s]);return t?a.jsx(nu,{className:"size-4 text-amber-400"}):n?r?a.jsx(nu,{className:"size-4 text-amber-400"}):a.jsx(nu,{className:"size-4 text-sky-400 rotate-180"}):null},ate=({size:e="40",isClientPage:t})=>{const[n,s]=l.useState(!1),r=l.useRef(null),i=Se(L=>L.clearUser),o=Se(L=>L.user),c=Se(L=>L.clearAccessToken),u=bt(),d=l.useMemo(()=>!!o?.access?.isTrialActive&&!!o?.trial,[o]),p=l.useMemo(()=>!d||!o?.trial?.expiresAt?null:o?.trial?.expiresAt,[d,o]),g=l.useMemo(()=>!d||!o?.trial?.secondsLeft?null:o?.trial?.secondsLeft,[d,o]),A=l.useMemo(()=>{if(g===null)return!1;const L=3600*24;return g<L},[g]),E=l.useMemo(()=>!!o?.access?.isPaidActive&&!!o?.paid,[o]),x=l.useMemo(()=>!E||!o?.paid?null:o?.paid,[E,o]),y=l.useMemo(()=>!E||!o?.paid?.expiresAt?null:o?.paid?.expiresAt,[E,o]),I=l.useCallback(()=>{s(L=>!L)},[]);l.useEffect(()=>{const L=O=>{r.current&&(r.current.contains(O.target)||s(!1))};return document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}},[]);const{mutate:v}=tt({mutationFn:z1,onError:()=>{ve({type:"failed",message:h.signOut.errors.SIGN_OUT_ERROR})},onSuccess:async()=>{u.removeQueries({predicate:()=>!0}),i({reason:Ao.SIGN_OUT}),c()}}),{mutate:S}=tt({mutationFn:nq,onSuccess:()=>{ve({type:"success",message:h.userMenu.emailConfirm.SUCCESS})},onError:L=>{const O=L.code,P=h.userMenu.emailConfirm.errors[O]??h.userMenu.emailConfirm.errors.UNKNOWN;ve({type:"failed",message:P})}}),b=l.useCallback(()=>{S()},[S]),w=o?.lastName?.trim()??"",_=o?.firstName?.trim()??"",N=o?.middleName?.trim()??"",R=[w,_,N].filter(L=>L.length>0).join(" "),D=mu({value:o?.phone??""}),k=o?.email??"";return a.jsx("div",{className:Y("items-center","justify-end","w-auto","relative","mx-4",!t&&"flex",!!t&&"hidden bp41_5:flex"),children:a.jsxs("div",{ref:r,onClick:I,className:Y("roboto-flex-25-500-1 rounded-full flex items-center justify-center font-medium text-[20px] leading-[20px] text-center tracking-[-0.04em] text-zinc-500 cursor-pointer relative",e==="40"&&"w-10 h-10",e==="60"&&"w-15 h-15",!!n&&"bg-zinc-200",!n&&"bg-zinc-100 hover:bg-zinc-200"),children:[a.jsx("div",{className:Y("absolute -top-0.25 -right-0.25"),children:a.jsx(ote,{user:o})}),a.jsx(z6,{className:Y("block","text-zinc-400",e==="40"&&"w-4 h-4",e==="60"&&"w-6 h-6")}),!!n&&a.jsxs("div",{className:"absolute right-0 top-full mt-1.5 bg-white rounded-lg flex flex-col w-72 z-30 shadow-[0px_0.27px_2.06px_0px_rgba(0,0,0,0.0323),0px_0.89px_6.92px_0px_rgba(0,0,0,0.0477),0px_4px_31px_0px_rgba(0,0,0,0.08)]",children:[a.jsxs("div",{className:"flex flex-col justify-center items-center w-full pt-4 cursor-auto",onClick:L=>{L.stopPropagation()},children:[a.jsx("div",{className:"flex items-center justify-center size-14 bg-zinc-100 rounded-full mb-2",children:a.jsx(z6,{className:Y("block","text-zinc-400","size-4")})}),!!R&&a.jsx("div",{className:"mb-3 px-2 roboto-flex-100-400-1 text-[14px] leading-[16
837px] text-zinc-950 wrap-anywhere-with-fallback",children:R}),!!D&&a.jsx("div",{className:Y("roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",R?"mb-1":"mb-3"),children:D}),!!k&&a.jsx("div",{className:"mb-4 px-2 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 wrap-anywhere-with-fallback",children:k})]}),a.jsx("div",{className:"px-2.5 w-full mb-1",children:a.jsx("figure",{className:"w-full h-px bg-zinc-100"})}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx(Je,{to:"/profile",className:Y("group px-1 py-0.5 first:pt-1 last:pb-1 bg-white rounded-md flex items-center cursor-pointer text-zinc-950"),children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] px-3 py-1.5 group-hover:bg-zinc-50 w-full flex justify-start rounded-md",children:h.userMenu.PROFILE})}),a.jsx(Hs,{to:"/documents/user-guide-quick-start.pdf",target:"_blank",rel:"noopener noreferrer",className:"group px-1 py-0.5 first:pt-1 last:pb-1 bg-white rounded-md flex items-center cursor-pointer",children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 px-3 py-1.5 group-hover:bg-zinc-50 w-full flex justify-start rounded-md",children:h.userMenu.DOWNLOAD_INSTRUCTION})}),a.jsx("button",{onClick:()=>v(),className:"group px-1 py-0.5 first:pt-1 last:pb-1 bg-white rounded-md flex items-center cursor-pointer",children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 px-3 py-1.5 group-hover:bg-zinc-50 w-full flex justify-start rounded-md",children:h.userMenu.SIGN_OUT})}),!!d&&a.jsxs(Je,{to:"/profile/subscription",className:Y("mb-1 mt-0.5 mx-1 px-3 py-2 flex flex-col items-start justify-start text-left rounded-[6px]",!A&&"bg-sky-50",!!A&&"bg-amber-50"),children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:[h.userMenu.trial.TITLE,a.jsx("br",{}),Kt({dateString:p??"",isWithTime:!0,isShortMonth:!1})]}),a.jsxs("div",{className:"mt-2 mb-3 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",children:[h.userMenu.trial.DESCRIPTION_FIRST_LINE,a.jsx("br",{}),h.userMenu.trial.DESCRIPTION_SECOND_LINE]}),a.jsx(ut,{variant:"h8",children:h.userMenu.trial.BUTTON})]}),!!E&&a.jsxs(Je,{to:"/profile/subscription",className:Y("mb-1 mt-0.5 mx-1 px-3 py-2 flex flex-col items-start justify-start text-left rounded-[6px] bg-zinc-50"),children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:[h.userMenu.paid.TITLE_PREFIX,x?.tariff?.name,h.userMenu.paid.TITLE_SUFFIX]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",children:[h.userMenu.paid.ACTIVE_UNTIL," ",Kt({dateString:y??"",isWithTime:!0,isShortMonth:!1,isCommaSeparator:!0})]})]}),!o?.isEmailConfirmed&&a.jsxs("div",{onClick:b,className:"mb-1 mt-0.5 mx-1 px-3 py-2 flex flex-col items-start justify-start text-left rounded-[6px] bg-amber-100",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:o?.email}),a.jsx("div",{className:"mt-1.5 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",children:h.userMenu.emailConfirm.DESCRIPTION}),a.jsx("div",{className:"mt-4 roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase text-zinc-800 hover:text-zinc-950 underline underline-offset-[25%] decoration-[3%] decoration-solid",children:h.userMenu.emailConfirm.RESEND})]})]})]})]})})},Is=$n(e=>({initializedKeys:new Set,addInitializedKey:t=>e(n=>(n.initializedKeys.add(t),{initializedKeys:new Set(n.initializedKeys)})),removeInitializedKey:t=>e(n=>(n.initializedKeys.delete(t),{initializedKeys:new Set(n.initializedKeys)})),isGridSourcePathVisible:!1,setIsGridSourcePathVisible:t=>e({isGridSourcePathVisible:t}),isModalDebugInfoVisible:!1,modalDebugInfoBottomSheetCount:0,registerModalDebugInfoBottomSheet:()=>e(t=>{const n=t.modalDebugInfoBottomSheetCount+1;return{modalDebugInfoBottomSheetCount:n,isModalDebugInfoVisible:n>0}}),unregisterModalDebugInfoBottomSheet:()=>e(t=>{const n=Math.max(0,t.modalDebugInfoBottomSheetCount-1);return{modalDebugInfoBottomSheetCount:n,isModalDebugInfoVisible:n>0}})})),Sm=()=>Is(e=>e.addInitializedKey),lte=()=>Is(e=>e.removeInitializedKey);function sE({user:e}){return e?e.environment?!0:e.opensearchBases?e.opensearchBases.length>0:!1:!1}const a2=({variant:e="header"})=>{const t=Se(E=>E.user),n=Is(E=>E.isGridSourcePathVisible),s=Is(E=>E.setIsGridSourcePathVisible),i=(typeof window>"u"?"":window.location.hostname).split(".")[0]??"",o=t?.environment??"",c=t?.o
837pensearchBases?.join(", ")??"",u=t?.email??"",d=t?.phone??"",p=sE({user:t}),g=e==="modal",A=l.useCallback(()=>{s(!n)},[n,s]);return p?a.jsxs("div",{className:Y("pointer-events-auto roboto-flex-100-400-1 text-[12px] leading-[12px] wrap-break-word max-w-md absolute bottom-0 left-4.25 z-10 items-center gap-3 whitespace-nowrap hidden bp48:flex",!!g&&"text-white",!g&&"text-zinc-500"),children:[a.jsxs("button",{type:"button",onClick:A,className:Y("hidden cursor-pointer bp48:inline-block min-w-14 text-left transition-colors",!!g&&"text-sky-300",!g&&"text-sky-600"),children:[n&&"hide paths",!n&&"show paths"]}),a.jsxs("span",{className:"hidden bp48:inline",children:["f: ",i||"—"]}),a.jsxs("span",{className:"bp48:hidden",children:[o||"—",", ",c||"—"]}),a.jsxs("span",{className:"hidden bp48:inline",children:["b: ",o||"—",", ",c||"—"]}),a.jsxs("span",{className:"hidden bp48:inline",children:["u: ",u||"—",", ",d||"—"]})]}):null},Kh=({logoLink:e,backLink:t,linksTree:n,isClientPage:s})=>{const r=Se(u=>u.user),o=Fe().pathname.startsWith("/legal-base"),c=l.useMemo(()=>!!(s||o),[s,o]);return a.jsx("header",{className:Y("sticky top-0 bg-white z-15"),children:a.jsxs("div",{className:Y("relative","flex","items-center","w-full","h-14",!c&&"justify-between px-0",!!c&&"justify-start bp41_5:justify-between px-4 bp41_5:px-0"),children:[a.jsx(iee,{to:e,displayClassNames:Y(!c&&"flex",!!c&&"hidden bp41_5:flex")}),a.jsx(a2,{}),!!o&&a.jsx(ite,{}),!!t&&!!n&&!o&&a.jsx(Yee,{backLink:t,linksTree:n,isClientPage:s}),!!r&&a.jsx(ate,{isClientPage:c})]})})},cte=()=>{const e=h.main.demoRestricted;return a.jsxs("div",{className:"min-h-screen-dynamic relative flex flex-col justify-between",children:[a.jsx(Kh,{logoLink:"https://plevako.ai"}),a.jsxs("div",{className:Y("flex flex-1 pb-20 flex-col items-center justify-center mx-0"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:e.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:e.SUBTITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 mt-6 text-center",children:e.DESCRIPTION_LINES.map(t=>a.jsx("div",{children:t},t))}),a.jsx("div",{className:"mt-4",children:a.jsx(ut,{variant:"h16",asChild:!0,children:a.jsx(Je,{to:"https://plevako.ai",children:e.CTA})})})]})]})]})},ute=()=>U1()?a.jsx(cte,{}):a.jsx("div",{id:"landing",className:Y("relative","bg-neutral-950","bg-no-repeat","main-page-layout","[background-position:calc(50%_+_13px)_-663px]","[background-size:2203px_1730px]","bp50:[background-position:calc(50%_+_7.8px)_-397.8px]","bp50:[background-size:1321.8px_1038px]","bp62_5:[background-position:calc(50%_+_9.75px)_-497.25px]","bp62_5:[background-size:1652.25px_1297.5px]","bp81_5:[background-position:calc(50%_+_20.25rem)_top]","bp81_5:[background-size:4191px_3289px]"),style:{backgroundImage:`linear-gradient(180deg, #0a0a0a00, #0a0a0a), url(${ZZ})`},children:a.jsx("div",{className:Y("relative","w-full","bg-no-repeat","[background-position:50%_100%]","[background-size:auto_350px]","bp50:[background-size:100%_auto]","bp62_5:[background-size:100%_auto]","bp81_5:[background-size:3284px_1384px]","bp205_25:[background-size:100%_auto]"),style:{backgroundImage:`url(${nee})`},children:a.jsx("div",{"data-requires-vh-stable":!0,className:Y("relative","w-full","bg-no-repeat","[background-position:0px_0px]","[background-size:0px_0px]","bp50:[background-position:calc(100%_-_9.6px)_28.8px]","bp50:[background-size:590.4px_590.4px]","bp62_5:[background-position:calc(100%_-_12px)_36px]","bp62_5:[background-size:738px_738px]","bp81_5:[background-position:calc(100%_-_16px)_48px]","bp81_5:[background-size:984px_984px]","bp100:[background-position:calc(50%+301px)_48px]"),style:{backgroundImage:`url(${eee})`},children:a.jsx("div",{"data-requires-vh-stable-bg":!0,className:Y("relative","w-full","bg-no-repeat","[background-position:50%_56px]","[background-size:auto_360px]","[@media(max-height:41.5rem)]:[background-position:50%_56px]","[@media(min-height:41.5625rem)_and_(max-height:56.25rem)]:[background-position:50%_calc(var(--vh-stable)*50-276px)]","bp34_375:[@media(min-height:56.25rem)]:[background-position:50%_56px]","[@media(min-height:56.3125rem)]:[background-position:50%_56px]","bp50:[background-position:0px_0px]","bp50:[background-size:0px_0px]","bp62_5:[background-position:0px_0px]","bp62_5:[background-size:0px_0px]","bp81_5:[background-position:0px_0px]","bp81_5:[background-size:0px_0px]"),style:{backgroundImage:`url(${tee})`},children:a.jsxs("main",{className:Y("relative","w-full","flex","flex-col","justify-start"),children:[a.jsx(JZ,{}),a.jsx("div",{className:Y("flex","flex-col","-mt-9","bp50:mt-0","bp62_5:mt-0","-mt-12","bp81_5:mt-0"),children:a.jsx(Xi,{})})]})})})})}),l2=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_4176_1205)"},l.createElement("circle",{cx:7.91667,cy:7.91667,r:7.91667,transform:"matrix(-1 0 0 1 17.5 1.66669)",stroke:"currentColor",strokeWidth:2}),l.createElement("path",{d:"M18.3335 18.3334L15.4168 15.4167",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_4176_1205"},l.createElement("rect",{width:20,height:20,fill:"white"})))),c2=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_4540_2730)"},l.createElement("path",{d:"M18.0005 6L6.00053 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.99951 6L17.9995 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_4540_2730"},l.createElement("rect",{width:24,height:24,fill:"white"})))),dte=({isLoading:e,handleChange:t,...n})=>{const s=l.useRef(null),r=l.useCallback(()=>{e||s.current&&t&&(t(""),s.current.focus())},[e,t]),i=l.useMemo(()=>({...n,disabled:!!e||!!n.disabled}),[e,n]),o=l.useCallback(c=>{t&&t(c.target.value)},[t]);return a.jsx(a.Fragment,{children:a.jsxs("div",{className:"relative w-full group",children:[a.jsx("div",{className:Y("relative w-full border-0 border-b-2 border-black h-8",!n.value&&"group-focus-within:opacity-100 opacity-0 group-hover:opacity-100 transition-opacity duration-0 bp34_375:duration-100 delay-0 bp34_375:delay-100 group-hover:duration-0 group-hover:delay-0"),children:a.jsx("input",{ref:s,"data-slot":"input",className:"file:text-foreground placeholder:text-muted-foreground flex min-w-0 bg-transparent transition-[color,box-shadow] outline-none focus:ring-0 focus:shadow-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 password-clean border-0 pl-3 pr-8 text-sm h-8 text-zinc-950 roboto-flex-100-400-1 w-full",onCh
837ange:o,...i})}),a.jsx("div",{className:Y("absolute inset-y-0 right-0 flex h-8 [&>div]:w-8 [&>div]:h-8 [&>div]:flex [&>div]:items-center [&>div]:justify-center items-center justify-right text-zinc-400 hover:text-zinc-500",!n.value&&"pointer-events-none"),children:a.jsx("div",{className:Y(!!(e||!n.value)&&"pointer-events-none",!!(!e&&n.value)&&"cursor-pointer select-none"),onClick:r,children:e?a.jsx(Co,{className:"size-5 animate-spin text-zinc-400"}):n.value?a.jsx(c2,{className:"w-5 h-5"}):a.jsx(l2,{className:"w-5 h-5"})})})]})})},fte=rt(async function(t){const n=Se.getState().accessToken,s=new URLSearchParams;t?.isArchived!==void 0&&s.append("isArchived",String(t.isArchived));const r=s.toString(),i=Ke(`/clients/${r?`?${r}`:""}`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`}}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data?.entities??[]}),s7=rt(async function(t){const n=Se.getState().accessToken,s=Ke(`/clients/${t?.id}/`),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`}}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data}),pte=rt(async function({isArchived:t,lastName:n,firstName:s,middleName:r,signal:i}){const o=Se.getState().accessToken,c=Ke("/clients/"),u=await qe(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify({isArchived:t,clientInfo:{lastName:n,firstName:s,middleName:r}}),signal:i}),d=await Ye(u);if(He(d))throw{httpCode:503,errorData:d.error};if(d.status==="error")throw{httpCode:u.status,errorData:d.error};if(!d.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return d.data}),r7=rt(async function({path:t,body:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/${t}`),o=await qe(i,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(n),signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),hte=rt(async function({file:t,signal:n}){const s=Se.getState().accessToken,r=new FormData;r.append("file",t);const i=await qe(Ke("/images/"),{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${s}`},body:r,signal:n});if(He(i))throw{httpCode:503,errorData:i.error};const o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};if(!o.data?.url||!o.data?.id)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return o.data}),mte=rt(async function({file:t,signal:n}){const s=Se.getState().accessToken,r=new FormData;r.append("file",t);const i=await qe(Ke("/uploads/"),{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${s}`},body:r,signal:n});if(He(i))throw{httpCode:503,errorData:i.error};const o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};if(!o.data?.id)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return o.data.id}),gte=rt(async function({uploadId:t,signal:n}){const s=Se.getState().accessToken,r=await qe(Ke(`/uploads/${t}/`),{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n});if(He(r))throw{httpCode:503,errorData:r.error};const i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data}),u2=rt(async function({path:t,body:n}){const s=Se.getState().accessToken,r=Ke(`/${t}`),i=await qe(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(n)}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data}),Ff=rt(async function({path:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/${t}`),i=await qe(r,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data}),Ate=rt(async function({id:t,isArchived:n}){const s=Se.getState().accessToken,r=await qe(Ke(`/clients/${t}/`),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({isArchived:n})}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};return i.data}),Ete=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/quotes/`),i=await qe(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};if(!o.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return o.data}),xte=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/quotes/export/`),i={fileType:"docx"},o=await qe(r,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},body:JSON.stringify(i),signal:n,timeout:3e5}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),Cte=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/quotes/`),i=await qe(r,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data}),yte=rt(async function({clientId:t,quoteId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/quotes/${n}/`),o=await qe(i,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),bte=rt(async function({clientId:t,caseId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/quotes/cases/${n}/`),o=await qe(i,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),Ite=({archivedClientsList:e,isClientPage:t,isAddClientPage:n})=>{const s=Fe(),r=at(),[i]=F1(),[o,c]=l.useState(i.get("search")??""),[u,d]=l.useState(!1);l.useEffect(()=>{t||n||r(o?`${s.pathname}?search=${o}`:s.pathname,{replace:!0,state:{isPreventScrollToTop:!0}})},[o,t,n,r,s.pathname]);const p=l.useCallback((y="")=>{c(y)},[]),g=l.useCallback(()=>{d(!0)},[]),A=l.useCallback(()=>{d(!1)},[]),E=l.useMemo(()=>!!(u||o.trim()),[u,o]),x=l.useMemo(()=>
837{if(!o.trim())return e;const y=o.trim().toLowerCase();return e.filter(I=>{const v=I?.episodesArticles?I.episodesArticles.map(({part:N,number:R,clause:D})=>et({clause:D,part:N,number:R})).sort((N,R)=>N.localeCompare(R)).join(", "):"",S=xo({lastName:I.clientInfo.lastName,firstName:I.clientInfo.firstName,middleName:I.clientInfo.middleName,isShort:!1}).toLowerCase(),b=`${h.clients.labels.CREATED}: ${_r({dateString:I.createdAt,isWithTime:!0})}`.toLowerCase(),w=`${h.clients.labels.UPDATED}: ${_r({dateString:I.updatedAt,isWithTime:!0})}`.toLowerCase(),_=h.clients.clientStatuses?.[Y1(I.status)]?.toLowerCase()??"";return!!(S.includes(y)||v.includes(y)||_.includes(y)||_r({dateString:I.createdAt,isWithTime:!0}).toLowerCase().includes(y)||_r({dateString:I.updatedAt,isWithTime:!0}).toLowerCase().includes(y)||b.includes(y)||w.includes(y))})},[e,o]);return{searchText:o,isSearchTextActive:E,searchedArchivedClientsList:x,handleSearchTextChange:p,handleSearchTextFocus:g,handleSearchTextBlur:A}},Ste=e=>l.createElement("svg",{className:"loader",viewBox:"204 184 264 32",...e},l.createElement("style",null,`
838        @keyframes gooey {
839        to { transform: translate3d(230px, 0, 0); }
840        }
841
842        @keyframes fade-in {
843        from { opacity: 0; }
844        to { opacity: 1; }
845        }
846
847        .loader { animation: fade-in 200ms ease-out; }
848
849        .ellipse:nth-child(1) {
850        animation: gooey 0.9s cubic-bezier(0.59, 0.8, 0.29, 0.1) infinite both alternate-reverse;
851        animation-delay: 0s;
852        }
853    `),l.createElement("defs",null,l.createElement("filter",{id:"gooey",colorInterpolationFilters:"sRGB"},l.createElement("feGaussianBlur",{in:"SourceGraphic",stdDeviation:7,result:"blur"}),l.createElement("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7",result:"gooey"}),l.createElement("feBlend",{in:"SourceGraphic",in2:"gooey"}))),l.createElement("g",{className:"ellipses",fill:"currentColor",filter:"url(#gooey)"},l.createElement("ellipse",{className:"ellipse",cx:220,cy:200,rx:16,ry:16}),l.createElement("ellipse",{className:"ellipse",cx:280,cy:200,rx:16,ry:16}),l.createElement("ellipse",{className:"ellipse",cx:340,cy:200,rx:16,ry:16}),l.createElement("ellipse",{className:"ellipse",cx:400,cy:200,rx:16,ry:16}))),ct=({isWithWrapper:e,isFullScreen:t,isNoPadding:n,delay:s=1e3,minHeight:r})=>{const[i,o]=l.useState(!1),c=l.useRef(!1);l.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]),l.useEffect(()=>{const d=setTimeout(()=>{c.current&&o(!0)},s);return()=>{clearTimeout(d)}},[s]);const u=l.useMemo(()=>i?a.jsx(Ste,{className:"w-33 h-4 text-black"}):null,[i]);return t?a.jsx("div",{className:"flex min-h-screen-dynamic w-full items-center justify-center bp48:pb-20",children:u}):e?a.jsx("div",{className:Y("flex items-center justify-center w-full h-full flex-1",!n&&"bp48:pb-20",r===90&&"min-h-90"),children:u}):u},vte=({isClientPage:e,isAddClientPage:t})=>{const n=kn(L=>L.isCataloguesEnumsReady),s=kn(L=>L.isCataloguesArticlesReady),r=kn(L=>L.isCataloguesRegionsReady),i=Fe(),[o,c]=l.useState({}),{data:u,isFetching:d,isSuccess:p}=Vt({queryKey:["clientsList"],queryFn:()=>fte(),staleTime:1e3*60*5,refetchOnWindowFocus:!0}),g=l.useMemo(()=>!(!p||!n||!s||!r),[p,n,s,r]),A=l.useMemo(()=>u?.length?u:[],[u]),E=l.useMemo(()=>A.map(O=>({...O,statusText:h.clients.clientStatuses?.[Y1(O.status)]?.toLowerCase()??""})),[A]),x=l.useMemo(()=>E.filter(L=>!L.isArchived),[E]),y=l.useMemo(()=>E.filter(L=>L.isArchived),[E]),I=l.useMemo(()=>i.pathname==="/clients/archived",[i.pathname]),{searchText:v,isSearchTextActive:S,searchedArchivedClientsList:b,handleSearchTextChange:w,handleSearchTextFocus:_,handleSearchTextBlur:N}=Ite({archivedClientsList:y,isClientPage:e,isAddClientPage:t}),R=bt(),{mutate:D}=tt({mutationFn:({id:L,isArchived:O})=>Ate({id:L,isArchived:O}),onMutate:({id:L})=>{c(O=>({...O,[L]:!0}))},onSuccess:L=>{R.setQueryData(["clientsList"],O=>O?O.map(P=>P.id!==L.id?P:{...P,updatedAt:L.updatedAt,archivedAt:L.archivedAt,isArchived:L.isArchived}):[]),c(O=>{const P={...O};return delete P[L.id],P})}}),k=l.useCallback((L,O)=>{O.stopPropagation(),O.preventDefault(),!o[L]&&D({id:L,isArchived:!A.find(P=>P.id===L)?.isArchived})},[o,A,D]);return g?a.jsxs(a.Fragment,{children:[!!(A?.length||I)&&a.jsxs("div",{className:"flex flex-col bp48:flex-row bp48:items-start bp48:justify-between px-4 h-[7.5rem] bp48:h-[5rem] bp48:min-h-12 bg-white sticky top-[3.5rem] pt-6 bp48:pt-8 z-10",children:[a.jsxs("div",{className:"bp48:flex bp48:items-center space-x-4 lg:flex-1",children:[a.jsx(Je,{to:"/clients",end:!0,className:({isActive:L})=>Y("roboto-flex-25-700-1 uppercase cursor-pointer text-[24px] leading-[32px]",!!L&&"text-zinc-950",!L&&"text-zinc-400 hover:text-zinc-500"),children:h.clients.layout.nav.CLIENTS}),a.jsx(Je,{to:"/clients/archived",end:!0,className:({isActive:L})=>Y("roboto-flex-25-700-1 uppercase cursor-pointer text-[24px] leading-[32px]",!!L&&"text-zinc-950",!L&&"text-zinc-400 hover:text-zinc-500"),children:h.clients.layout.nav.ARCHIVED})]}),a.jsxs("div",{className:"mt-6 bp48:mt-0 flex flex-row-reverse bp48:flex-row justify-between bp48:items-center lg:w-1/2 flex-1",children:[a.jsx("div",{className:Y("w-full bp48:ml-8 lg:ml-0",!S&&"ml-4",!!S&&"ml-0"),children:!!I&&!!y?.length&&a.jsx(dte,{placeholder:h.clients.layout.search.PLACEHOLDER,value:v,handleChange:w,onFocus:_,onBlur:N})}),a.jsx("div",{className:Y("bp48:ml-8",!!S&&"hidden bp48:block"),children:a.jsx(ut,{asChild:!0,children:a.jsx(Je,{to:"/clients/add",state:{isPreventScrollToTop:!0,isFromArchived:I},children:h.clients.layout.buttons.NEW_CLIENT})})})]})]}),a.jsx(Xi,{context:{notArchivedClientsList:x,archivedClientsList:y,searchedArchivedClientsList:b,isFetching:d,isChangingStatusInProcessById:o,handleChangeStatusClick:k}})]}):a.jsx(ct,{isWithWrapper:!0})},_te=({variant:e="default",children:t,...n})=>a.jsx("div",{className:Y("inline-block h-5 items-center justify-center w-fit whitespace-nowrap shrink-0 gap-1 overflow-hidden","pr-[6px] pl-[6px] rounded-full roboto-flex-25-700-1 text-[12px] leading-[20px] uppercase",e==="gray"&&"bg-zinc-100 text-zinc-600",e==="default"&&"bg-sky-100 text-sky-600"),...n,children:t}),Tte=({clause:e,part:t,number:n,codeType:s})=>a.jsx("span",{children:et({clause:e,part:t,number:n,codeType:s})}),Nte=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_4164_1667)"},l.createElement("path",{d:"M19 4H5C3.89543 4 3 4.89543 3 6C3 7.10457 3.89543 8 5 8H19C20.1046 8 21 7.10457 21 6C21 4.89543 20.1046 4 19 4Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 8V18C5 18.5304 5.21071 19.0391 5.58579 19.4142C5.96086 19.7893 6.46957 20 7 20H17C17.5304 20 18.0391 19.7893 18.4142 19.4142C18.7893 19.0391 19 18.5304 19 18V8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 12H14",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_4164_1667"},l.createElement("rect",{width:24,height:24,fill:"white"})))),wte=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_4164_1689)"},l.createElement("path",{d:"M21 6C21 4.89543 20.1046 4 19 4H16.5H5C3.89543 4 3 4.89543 3 6C3 7.10457 3.89543 8 5 8H8.5H19C20.1046 8 21 7.10457 21 6Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 8V18C5 18.5304 5.21071 19.0391 5.58579 19.4142C5.96086 19.7893 6.46957 20 7 20H17C17.5304 20 18.0391 19.7893 18.4142 19.4142C18.7893 19.0391 19 18.5304 19 18V8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12 12V16.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9 14L12 11L15 14",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_4164_1689"},l.createElement("rect",{width:24,height:24,fill:"white"})))),Q6=({isChangingStatusInProcessById:e,handleChangeStatusClick:t,id:n,isArchived:s,size:r="8x8"})=>{const[i,o]=l.useState(!1),c=l.useMemo(()=>!!e?.[n],[e,n]);l.useEffect(()=>{if(!c){o(!1);return}const d=setTimeout(()=>{o(!0)},200);return()=>{clearTimeout(d)}},[c]);const u=l.useMemo(()=>{const d="flex justify-center items-center transition-opacity duration-100 supports-hover:group-hover:opacity-100 group-hover:[transition-duration:0ms] text-zinc-400 select-none";return c?Y(d,"cursor-default"):Y(d,"hover:text-zinc-900 cursor-pointer")},[c]);return a.jsx("div",{className:"flex justify-end",children:a.jsx("div",{className:Y(u,!!c&&"opacity-100",!c&&"supports-hover:opacity-0",r==="8x8"&&"h-8 w-8",r==="6x6"&&"h-6 w-6"),onClick:d=>t(n,d),children:c&&i?a.jsx(Co,{className:"size-5 animate-spin text-zinc-400"}):s?a.jsx(wte,{}):a.jsx(Nte,{})})})},Rte=({clientData:e,isChangingStatusInProcessById:t,handleChangeStatusClick:n})=>{const{id:s,createdAt:r,updatedAt:i,statusText:o,isArchived:c,episodesArticles:u,clientInfo:{firstName:d,lastName:p,middleName:g}}=e;return a.jsxs(Je,{to:`/clients/${s}`,state:{isPreventScrollToTop:!0,isFromArchived:c,clientData:e},className:Y("flex bp48:table-row flex-col items-stretch justify-start pt-4 pb-4 bp48:pt-0 px-4 bp48:p
853x-0 group hover:bg-zinc-50 cursor-pointer hover:[&+div>div]:border-zinc-50 border-t bp48:border-none border-zinc-200 hover:border-zinc-50 first:border-none hover:[&+div]:border-zinc-50",!!t?.[s]&&"opacity-60 pointer-events-none"),children:[a.jsx("div",{className:"order-5 hidden bp48:table-cell pl-4"}),a.jsxs("div",{className:"order-2 mt-2 bp48:h-[6.875rem] bp48:mt-0 bp48:table-cell bp48:border-t bp48:border-zinc-200 bp48:group-hover:border-zinc-50 bp48:group-first:border-none bp48:align-middle bp48:w-1/2 m-0 bp48:py-8 bp48:pr-2 ",children:[a.jsxs("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] flex justify-between items-start w-full",children:[a.jsxs("div",{className:"min-w-0 wrap-anywhere-with-fallback",children:[p," ",d," ",g]}),a.jsx("div",{className:"flex bp48:hidden",children:a.jsx(Q6,{isChangingStatusInProcessById:t,handleChangeStatusClick:n,id:s,isArchived:c,size:"6x6"})})]}),!!u?.length&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] mt-1 bp48:mt-1.5",children:u.map(({part:A,number:E,clause:x})=>({part:A,number:E,clause:x,text:et({clause:x,part:A,number:E})})).sort((A,E)=>A.text.localeCompare(E.text)).map((A,E)=>a.jsxs(Oe.Fragment,{children:[E<3&&a.jsxs(a.Fragment,{children:[E>0&&", ",a.jsx(Tte,{clause:A.clause,part:A.part,number:A.number})]}),E===3&&a.jsx(a.Fragment,{children:"…"})]},E))})]}),a.jsx("div",{className:"order-1 h-5 bp48:h-auto bp48:table-cell bp48:border-t bp48:border-zinc-200 bp48:group-hover:border-zinc-50 bp48:group-first:border-none bp48:align-middle bp48:w-1/4 m-0 bp48:pl-2 bp48:pr-2",children:a.jsx(_te,{variant:c?"gray":"default",children:o})}),a.jsxs("div",{className:"order-3 mt-2 bp48:mt-0 bp48:table-cell bp48:border-t bp48:border-zinc-200 bp48:group-hover:border-zinc-50 bp48:group-first:border-none bp48:align-middle bp48:w-3/16 m-0 bp48:py-8 bp48:pl-2 bp48:pr-2",children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500",children:[h.clients.labels.CREATED,":"," ",a.jsx("span",{className:"whitespace-nowrap",children:_r({dateString:r,isWithTime:!0})})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500",children:[h.clients.labels.UPDATED,":"," ",a.jsx("span",{className:"whitespace-nowrap",children:_r({dateString:i,isWithTime:!0})})]})]}),a.jsx("div",{className:"order-4 hidden bp48:table-cell bp48:border-t bp48:border-zinc-200 bp48:group-hover:border-zinc-50 bp48:group-first:border-none bp48:align-middle bp48:w-1/16 m-0 bp48:py-8 bp48:pl-2",children:a.jsx(Q6,{isChangingStatusInProcessById:t,handleChangeStatusClick:n,id:s,isArchived:c,size:"8x8"})}),a.jsx("div",{className:"order-6 hidden bp48:table-cell pr-4"})]})},Dte=({isArchived:e,isArchivedClientsExists:t})=>a.jsxs("div",{className:Y("flex flex-1 bp48:flex-0 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-center mx-4 bp48:mx-0","bp48:mt-37"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),!!e&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3.5 text-center",children:t?h.clients.emptyPage.messages.NOT_FOUND:h.clients.emptyPage.messages.ARCHIVED_EMPTY}),!e&&!!t&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3.5 text-center",children:h.clients.emptyPage.messages.ACTIVE_EMPTY}),!e&&!t&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:[a.jsx("div",{className:"bp48:inline",children:h.clients.emptyPage.messages.WELCOME_PART1})," ",a.jsx("div",{className:"bp48:inline",children:h.clients.emptyPage.messages.WELCOME_PART2})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:[a.jsx("div",{className:"bp48:inline",children:h.clients.emptyPage.messages.ADD_PROMPT_PART1})," ",a.jsx("div",{className:"bp48:inline",children:h.clients.emptyPage.messages.ADD_PROMPT_PART2})]}),a.jsx("div",{className:"mt-4 bp48:mt-8",children:a.jsx(ut,{variant:"h16",asChild:!0,children:a.jsx(Je,{to:"/clients/add",state:{isPreventScrollToTop:!0},children:h.clients.emptyPage.buttons.ADD_FIRST_CLIENT})})})]})]}),i7=({isArchived:e,isFetching:t,isChangingStatusInProcessById:n,list:s,isArchivedClientsExists:r,isNotArchivedClientsExists:i,handleChangeStatusClick:o})=>s?.length?a.jsx("div",{className:Y("pb-8 flex-1",!!t&&"opacity-60 pointer-events-none"),children:a.jsx("div",{className:"bp48:table w-full p-0 m-0",children:s.map((c,u)=>a.jsx(Rte,{clientData:c,isChangingStatusInProcessById:n,handleChangeStatusClick:o},u))})}):a.jsx(Dte,{isArchived:e,isArchivedClientsExists:r,isNotArchivedClientsExists:i}),kte=()=>{const{archivedClientsList:e,notArchivedClientsList:t,isFetching:n,isChangingStatusInProcessById:s,handleChangeStatusClick:r}=zt();return a.jsx(i7,{isArchived:!1,isFetching:n,isChangingStatusInProcessById:s,list:t,isArchivedClientsExists:!!e?.length,isNotArchivedClientsExists:!!t?.length,handleChangeStatusClick:r})},Ote=()=>{const{archivedClientsList:e,notArchivedClientsList:t,searchedArchivedClientsList:n,isFetching:s,isChangingStatusInProcessById:r,handleChangeStatusClick:i}=zt();return a.jsx(i7,{isArchived:!0,list:n,isArchivedClientsExists:!!e?.length,isNotArchivedClientsExists:!!t?.length,isFetching:s,isChangingStatusInProcessById:r,handleChangeStatusClick:i})},sn=$n(e=>({isRedirectCompleted:!1,isMenuOpen:!1,isSearchOpen:!1,openMenuSelectedPath:null,filtersByClientIdByInstance:{},currentHashByClient:{},setIsRedirectCompleted:t=>e(n=>({isRedirectCompleted:typeof t=="function"?t(n.isRedirectCompleted):t})),setIsMenuOpen:t=>e(n=>({isMenuOpen:typeof t=="function"?t(n.isMenuOpen):t})),setOpenMenuSelectedPath:t=>e(n=>({openMenuSelectedPath:typeof t=="function"?t(n.openMenuSelectedPath):t})),setIsSearchOpen:t=>e(n=>({isSearchOpen:typeof t=="function"?t(n.isSearchOpen):t})),setCurrentHash:(t,n)=>e(s=>({currentHashByClient:{...s.currentHashByClient,[t]:n}})),setFilters:(t,n,s)=>e(r=>{const i=r.filtersByClientIdByInstance[t]??{};return{filtersByClientIdByInstance:{...r.filtersByClientIdByInstance,[t]:{...i,[n]:s}}}})})),Pte=({link:e})=>{const t=sn(s=>s.setIsMenuOpen),n=l.useCallback(()=>{t(!1)},[t]);return a.jsx(a.Fragment,{children:a.jsx(Je,{to:e.to,end:e.end,className:({isActive:s})=>Y("roboto-flex-25-700-1","uppercase","px-1.5","text-[14px]","leading-[24px]","transition-colors","cursor-pointer",!s&&"bg-transparent",!s&&"text-zinc-400",!s&&"hover:text-zinc-500",!!s&&"bg-zinc-50",!!s&&"text-black"),onClick:n,children:e.name})})},Bu=e=>
853l.createElement("svg",{width:10,height:7,viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M7.15493e-08 6.5L5.00664 0.5L10 6.5L5.00664 5L7.15493e-08 6.5Z",fill:"currentColor"})),qr=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7848_402)"},l.createElement("path",{d:"M3.33203 7.99984L6.66536 11.3332L13.332 4.6665",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7848_402"},l.createElement("rect",{width:16,height:16,fill:"white"})))),xi=16,fl=250,hc={down:"bottom-start",up:"top-start"};function Io({referenceTop:e,referenceBottom:t,floatingHeight:n,viewportHeight:s,gap:r,preferredDirection:i}){const o=s-t-r,c=e-r-xi,u=n<=o,d=n<=c;return i==="down"?u?"down":"up":d?"up":u?"down":"up"}const vm=({placeholder:e=h.inputs.dropdownWithSearch.ALL,value:t,isClearable:n=!0,isCloseOnScroll:s=!1,isError:r,isArrow:i=!0,isCompactLabel:o=!1,verticalPosition:c,horizontalPosition:u,popupMaxWidth:d,isOptionWrap:p=!1,options:g,onChange:A,label:E})=>{const[x,y]=l.useState(!1),I=Fe(),v=l.useRef(null),S=l.useRef(null),b=l.useRef([]),w=l.useCallback(Q=>{v.current&&(v.current.contains(Q.target)||y(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}),[w]),l.useEffect(()=>{if(!x)return;const Q=v.current,M=S.current;if(!Q||!M)return;const K=u==="right"?"end":"start",W=Ji(Q,M,async()=>{if(c){const X=c==="top"?"up":"down",oe=Q.getBoundingClientRect(),te=`${Io({referenceTop:oe.top,referenceBottom:oe.bottom,floatingHeight:M.offsetHeight,viewportHeight:window.innerHeight,gap:0,preferredDirection:X})==="up"?"top":"bottom"}-${K}`,le=await Ei(Q,M,{placement:te,strategy:"absolute",middleware:[Ai({padding:16}),...u?[LI({apply({rects:ue,elements:ye}){Object.assign(ye.floating.style,{minWidth:`${ue.reference.width}px`})}})]:[]]}),he=xi-oe.top,fe=Math.max(le.y,he);Object.assign(M.style,{left:`${le.x}px`,top:`${fe}px`});return}const H=Q.getBoundingClientRect(),G=`${Io({referenceTop:H.top,referenceBottom:H.bottom,floatingHeight:M.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"})==="up"?"top":"bottom"}-${K}`,$=await Ei(Q,M,{placement:G,strategy:"absolute",middleware:[_o(6),Ai({padding:16}),...u?[LI({apply({rects:X,elements:oe}){Object.assign(oe.floating.style,{minWidth:`${X.reference.width}px`})}})]:[]]}),J=xi-H.top,ne=Math.max($.y,J);Object.assign(M.style,{left:`${$.x}px`,top:`${ne}px`})});return()=>{Object.assign(M.style,{left:"",top:"",minWidth:""}),W()}},[u,c,x]),l.useEffect(()=>{if(!x||!s)return;const Q=performance.now(),M=()=>{performance.now()-Q<fl||y(!1)},K=[],W=H=>{if(!H)return;const j=H.parentElement;if(!j)return;j.scrollHeight>j.clientHeight&&(j.addEventListener("scroll",M,{passive:!0}),K.push(j)),W(j)};return W(v.current),window.addEventListener("scroll",M,{passive:!0}),window.addEventListener("resize",M,{passive:!0}),K.push(window),b.current=K,()=>{b.current.forEach(H=>{if(H instanceof Window){H.removeEventListener("scroll",M),H.removeEventListener("resize",M);return}H.removeEventListener("scroll",M)}),b.current=[]}},[x,s]);const _=l.useMemo(()=>g.some(Q=>!!Q.to),[g]),N=l.useMemo(()=>n?[{value:"all",label:e,isPlaceholder:!0},...g]:g,[g,e,n]),R=l.useMemo(()=>{if(!_)return;const Q=N.filter(W=>!W.isPlaceholder&&!!W.to);if(Q.length===0)return;const M=Q.find(W=>W.to===I.pathname);return M||Q.reduce((W,H)=>!H.to||!I.pathname.startsWith(H.to)?W:W===void 0||W.to.length<H.to.length?H:W,void 0)},[_,N,I.pathname]),D=l.useMemo(()=>t!==void 0?!t&&n?"all":t:R?.value??(n?"all":null),[t,n,R]),k=l.useMemo(()=>{const Q=N.filter(j=>!!j.isPlaceholder),M=N.filter(j=>!j.isPlaceholder),K=M.filter(j=>j.zone==="primary"),W=M.filter(j=>j.zone!=="primary"),H=K.length>0&&W.length>0;return[...Q.map(j=>({option:j,isFollowedByZoneSeparator:!1})),...K.map((j,q)=>({option:j,isFollowedByZoneSeparator:H&&q===K.length-1})),...W.map(j=>({option:j,isFollowedByZoneSeparator:!1}))]},[N]),L=l.useCallback(()=>{y(Q=>!Q)},[]),O=l.useCallback(Q=>{A?.(Q.value),y(!1)},[A]),P=l.useCallback(({event:Q,option:M})=>{M.value===R?.value&&Q.preventDefault(),y(!1)},[R?.value]),B=l.useMemo(()=>
853{if(!x)return null;const Q=(()=>{if(d!=null)return{maxWidth:d}})();return a.jsx("div",{ref:S,className:Y("absolute z-50 flex flex-col max-h-82 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)]",d==null&&"min-w-80",d!=null&&"w-max"),style:Q,children:a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:k.map(({option:M,isFollowedByZoneSeparator:K})=>{const W=a.jsxs("div",{className:Y("flex items-start justify-between px-3 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!M.isPlaceholder&&"text-zinc-950",!!M.isPlaceholder&&"text-zinc-500"),children:[a.jsx("span",{className:Y(p&&"min-w-0 whitespace-normal wrap-break-word",!p&&"whitespace-nowrap"),children:M.label}),M.value===D&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]}),H=M.to&&!M.isPlaceholder?a.jsx(Je,{to:M.to,state:M.state,end:!0,onClick:j=>P({event:j,option:M}),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer block"),children:W}):a.jsx("div",{onClick:()=>O(M),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer"),children:W});return a.jsxs(l.Fragment,{children:[H,!!K&&a.jsx("div",{"aria-hidden":!0,className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},M.value)})})})})},[x,D,k,O,P,p,d]),F=l.useMemo(()=>{const Q="flex gap-1 items-center justify-start h-6 cursor-pointer rounded-[4px]";return r?Y(Q,"bg-red-100","hover:bg-red-100"):Q},[r]),z=l.useMemo(()=>o?Y("overflow-hidden text-ellipsis whitespace-nowrap","roboto-flex-100-600-1 text-[14px] leading-[20px] text-zinc-400"):Y("overflow-hidden text-ellipsis whitespace-nowrap","max-w-40 bp56_25:max-w-70 roboto-flex-25-700-1 uppercase text-zinc-900 text-[14px] leading-[16px]"),[o]);return a.jsxs("div",{ref:v,className:"relative w-fit max-w-full shrink-0 select-none",children:[a.jsxs("div",{className:F,onClick:L,children:[!!E&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400",children:E}),a.jsx("div",{className:z,children:N.find(Q=>Q.value===D)?.label??R?.label??e}),!!i&&a.jsx(Bu,{className:Y("size-2",!x&&"rotate-180")})]}),B]})},Dn=({label:e,placeholder:t=h.inputs.dropdownWithSearch.ALL,values:n,isClearable:s=!0,isCloseOnScroll:r=!1,isError:i,isGrid:o,options:c,onChange:u,resetKey:d=0})=>{const[p,g]=l.useState(()=>n??[]),[A,E]=l.useState(!1),x=l.useRef(n??[]),[y,I]=l.useState(""),v=l.useRef(null),S=l.useRef(null),b=l.useRef(null),w=l.useRef(null),_=l.useRef([]),N=l.useCallback(()=>{const H=S.current;if(H){if(typeof H.focus=="function"){H.focus({preventScroll:!0});return}H.focus()}},[]),R=l.useCallback(H=>{v.current&&(v.current.contains(H.target)||(g(n??[]),E(!1)))},[n]);l.useEffect(()=>(document.addEventListener("mousedown",R),()=>{document.removeEventListener("mousedown",R)}),[R]);const D=l.useMemo(()=>{const H=Ka({value:y});if(!H)return c;const j=Ka({value:qh({text:H,target:"ru"})}),q=Ka({value:qh({text:H,target:"en"})}),G=[H,j,q],$=G.map(X=>X.replace(/\./g,"")),J=G.map(X=>X.replace(/\D+/g," ").replace(/\s+/g," ").trim()),ne=c.filter(X=>{const oe=Ka({value:X.label}),ie=oe.replace(/\./g,""),ee=oe.replace(/\D+/g," ").replace(/\s+/g," ").trim();return!!(G.some(te=>oe.includes(te))||$.some(te=>ie.includes(te))||J.some(te=>!!te&&ee.includes(te)))});return ne.length?ne:[{value:"noMatches",label:h.inputs.dropdownWithSearch.NO_MATCHES,isNoMatches:!0}]},[c,y]),k=l.useMemo(()=>{const H=D.filter(J=>!!J.isPlaceholder),j=D.filter(J=>!J.isPlaceholder);if(j.length===1&&j[0].isNoMatches)return[{option:j[0],isFollowedByZoneSeparator:!1}];const q=j.filter(J=>J.zone==="primary"),G=j.filter(J=>J.zone!=="primary"),$=q.length>0&&G.length>0;return[...H.map(J=>({option:J,isFollowedByZoneSeparator:!1})),...q.map((J,ne)=>({option:J,isFollowedByZoneSeparator:$&&ne===q.length-1})),...G.map(J=>({option:J,isFollowedByZoneSeparator:!1}))]},[D]),L=l.useCallback(()=>{E(H=>!H)},[]);l.useEffect(()=>{if(!A)return;N();const H=v.current,j=b.current;if(!H||!j)return;const q=Ji(H,j,async()=>{const G=H.getBoundingClientRect(),$=Io({referenceTop:G.top,referenceBottom:G.bottom,floatingHeight:j.offsetHeight,viewportHe
853ight:window.innerHeight,gap:6,preferredDirection:"down"}),J=await Ei(H,j,{placement:hc[$],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),ne=xi-G.top,X=Math.max(J.y,ne);Object.assign(j.style,{left:`${J.x}px`,top:`${X}px`})});return()=>q()},[A,N]),l.useEffect(()=>{x.current=n??[]},[n]),l.useEffect(()=>{g(x.current??[])},[d]);const O=l.useCallback(()=>{E(!1),u&&u(p??[])},[u,p]),P=l.useCallback(()=>{g([])},[]),B=l.useCallback(H=>{I(H.target.value)},[]),F=l.useCallback(()=>{I("")},[]),z=l.useCallback(H=>{g(j=>{const q=j??[];return q.includes(H.value)?q.filter($=>$!==H.value):[...q,H.value]})},[]);l.useEffect(()=>{if(!A)return;const H=b.current,j=w.current;if(!H)return;const q=$=>{if(!j){$.preventDefault();return}j.scrollHeight>j.clientHeight||$.preventDefault()},G=$=>{const J=$.deltaY;if(!j){$.preventDefault();return}if(!j.contains($.target)){$.preventDefault();return}if(!(j.scrollHeight>j.clientHeight)){$.preventDefault();return}const X=j.scrollTop===0,oe=Math.ceil(j.scrollTop+j.clientHeight)>=j.scrollHeight;if(X&&J<0){$.preventDefault();return}oe&&J>0&&$.preventDefault()};return j&&j.addEventListener("wheel",q,{passive:!1}),H.addEventListener("wheel",G,{passive:!1,capture:!0}),()=>{j&&j.removeEventListener("wheel",q),H.removeEventListener("wheel",G,{capture:!0})}},[A]),l.useEffect(()=>{if(!A||!o&&!r)return;const H=performance.now(),j=()=>{performance.now()-H<fl||E(!1)},q=[],G=$=>{if(!$)return;const J=$.parentElement;J&&(J.scrollHeight>J.clientHeight&&(J.addEventListener("scroll",j,{passive:!0}),q.push(J)),G(J))};return G(v.current),window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j,{passive:!0}),q.push(window),_.current=q,()=>{_.current.forEach($=>{if($ instanceof Window){$.removeEventListener("scroll",j),$.removeEventListener("resize",j);return}$.removeEventListener("scroll",j)}),_.current=[]}},[A,o,r]);const Q=l.useMemo(()=>{const H="flex gap-1 items-center justify-start cursor-pointer rounded-[4px]";return i?Y(H,"bg-red-100","hover:bg-red-100"):o?A?Y(H,"px-1.5","min-h-8","bg-zinc-100"):Y(H,"px-1.5","min-h-8","bg-white","hover:bg-zinc-50"):Y(H,"h-6")},[i,o,A]),M=l.useMemo(()=>{if(!o)return Y("flex items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap max-w-40 bp56_25:max-w-50 roboto-flex-25-700-1 uppercase text-zinc-900 text-[14px] leading-[16px]");const H=Y("min-w-0 flex-1 w-0 roboto-flex-100-400-1 text-[16px] leading-[24px]");return n?.length?Y(H,"text-zinc-950"):Y(H,"text-zinc-500")},[o,n]),K=l.useMemo(()=>{const H=n??[];if(!H.length)return a.jsx("div",{className:M,children:t});if(o){const G=c.filter(J=>H.includes(J.value)).map(J=>J.label).filter(J=>!!J),$=G.map((J,ne)=>{const X=ne===G.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[J,!X&&", "]},`${J}-${ne}`)});return $?a.jsx("div",{className:M,children:$}):a.jsx("div",{className:M,children:t})}const j=c.find(G=>H.includes(G.value));if(!j)return a.jsx("div",{className:M,children:t});const q=j.label??t;return H.length>1?a.jsx(a.Fragment,{children:a.jsxs("div",{className:M,children:[a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:q}),a.jsx("div",{className:"inline-block",children:" "}),a.jsxs("div",{className:"inline-block text-zinc-400",children:["+",H.length-1]})]})}):a.jsx("div",{className:M,children:a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:q})})},[n,c,t,M,o]),W=l.useMemo(()=>A?a.jsxs("div",{ref:b,className:Y("absolute flex flex-col max-h-85 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50",!!o&&"w-full",!o&&"w-106"),children:[a.jsx("div",{className:"p-1 cursor-text",onClick:N,children:a.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-8 h-8 bg-zinc-100 rounded-[4px]",children:[a.jsx("div",{className:"pl-2.5",children:a.jsx(l2,{className:"size-5 -scale-x-100 text-zinc-400"})}),a.jsx("input",{ref:S,value:y,onChange:B,className:"file:text-foreground placeholder:text-muted-foreground bg-transparent transition-[color,box-shadow] outline-none focus:ring-0 focus:shadow-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 password-clean border-0 block roboto-flex-100-400-1 w-full h-full text-[16px] leading-[20px] text-zinc-950"}),a.jsx("div",{className:Y("pr-1.5 cursor-pointer",!y&&"hidden"),onClick:F,children:!!y&&a.jsx(ga,{className:"size-6 text-zinc-400"})})]})}),a.jsx("div",{className:"flex flex-col p-1 pt-0 flex-1 overflow-hidden select-none",children:a.jsx("div",{ref:w,className:"overflow-y-auto flex-1 overscroll-contain",children:k.map(({option:
853H,isFollowedByZoneSeparator:j})=>a.jsxs(l.Fragment,{children:[a.jsx("div",{onClick:()=>{H.isNoMatches||z(H)},className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group",!H.isNoMatches&&"cursor-pointer",!!H.isNoMatches&&"cursor-default pointer-events-none"),children:a.jsxs("div",{className:Y("flex items-center justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!H.isNoMatches&&!(H.isPlaceholder&&o)&&"text-zinc-950",!(!H.isNoMatches&&!(H.isPlaceholder&&o))&&"text-zinc-500"),children:[H.label,(p??[]).includes(H.value)&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]})}),!!j&&a.jsx("div",{"aria-hidden":!0,className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},H.value))})}),a.jsxs("div",{className:"flex justify-between items-center min-h-11 h-11 mb-1 px-4 gap-1.5",children:[a.jsx("div",{className:"roboto-flex-25-700-1 flex-1 text-[14px] leading-[16px] uppercase text-zinc-100 flex justify-center items-center h-8 bg-zinc-900 hover:bg-zinc-950 hover:text-white rounded-full cursor-pointer",onClick:O,children:h.inputs.dropdownWithSearch.APPLY}),!!s&&a.jsx("div",{className:Y("roboto-flex-25-700-1 flex-1 text-[14px] leading-[16px] uppercase  flex justify-center items-center h-8 bg-zinc-100 hover:bg-zinc-200 rounded-full cursor-pointer",!(p??[]).length&&"text-zinc-300",!!(p??[]).length&&"text-zinc-950"),onClick:P,children:h.inputs.dropdownWithSearch.CLEAR})]})]}):null,[A,y,k,p,s,O,P,N,z,B,F,o]);return a.jsxs("div",{ref:v,className:"relative",children:[a.jsxs("div",{className:Q,onClick:L,children:[!!e&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400",children:e}),K,!o&&a.jsx(Bu,{className:Y("size-2",!A&&"rotate-180")})]}),W]})},Ve=$n(e=>({aggregationsDataByClientIdByKey:{},episodesByClientIdByKey:{},selectedRegionIdsByClientIdByKey:{},selectedCourtIdsByClientIdByKey:{},selectedPleaStatusesByClientIdByKey:{},selectedConclusionArticlesByClientIdByKey:{},selectedPunishmentsByClientIdByKey:{},selectedEpisodesByClientIdByKey:{},selectedGendersByClientIdByKey:{},selectedCriminalStatusesByClientIdByKey:{},fabulaStatusByClientId:{},resetKey:0,setAggregationsData:({clientId:t,key:n,data:s})=>e(r=>{const i=r.aggregationsDataByClientIdByKey[t]??{};return{aggregationsDataByClientIdByKey:{...r.aggregationsDataByClientIdByKey,[t]:{...i,[n]:s}}}}),setEpisodesData:({clientId:t,key:n,data:s})=>e(r=>{const i=r.episodesByClientIdByKey[t]??{};return{episodesByClientIdByKey:{...r.episodesByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedRegionIds:({clientId:t,key:n,selectedRegionIds:s})=>e(r=>{const i=r.selectedRegionIdsByClientIdByKey[t]??{};return{selectedRegionIdsByClientIdByKey:{...r.selectedRegionIdsByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedCourtIds:({clientId:t,key:n,selectedCourtIds:s})=>e(r=>{const i=r.selectedCourtIdsByClientIdByKey[t]??{};return{selectedCourtIdsByClientIdByKey:{...r.selectedCourtIdsByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedPleaStatuses:({clientId:t,key:n,selectedPleaStatuses:s})=>e(r=>{const i=r.selectedPleaStatusesByClientIdByKey[t]??{};return{selectedPleaStatusesByClientIdByKey:{...r.selectedPleaStatusesByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedPunishments:({clientId:t,key:n,selectedPunishments:s})=>e(r=>{const i=r.selectedPunishmentsByClientIdByKey[t]??{};return{selectedPunishmentsByClientIdByKey:{...r.selectedPunishmentsByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedConclusionArticles:({clientId:t,key:n,selectedConclusionArticles:s})=>e(r=>{const i=r.selectedConclusionArticlesByClientIdByKey[t]??{};return{selectedConclusionArticlesByClientIdByKey:{...r.selectedConclusionArticlesByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedEpisodes:({clientId:t,key:n,selectedEpisodes:s})=>e(r=>{const i=r.selectedEpisodesByClientIdByKey[t]??{};return{selectedEpisodesByClientIdByKey:{...r.selectedEpisodesByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedGenders:({clientId:t,key:n,selectedGenders:s})=>e(r=>{const i=r.selectedGendersByClientIdByKey[t]??{};return{selectedGendersByClientIdByKey:{...r.selectedGendersByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedCriminalStatuses:({clientId:t,key:n,selectedCriminalStatuses:s})=>e(r=>{const i=r.selectedCriminalStatusesByClientIdByKey[t]??{};return{selectedCriminalStatusesByClientIdByKey:{...r.selectedCriminalStatusesByClientIdByKey,[t]:{...i,[n]:s}}}}),setFabulaStatus:({clientId:t,fabulaStatus:n})=>e(s=>({fabulaStatusByClientId:{...s.fabulaStatusByClientId,[t]:n}})),setResetKey:t=>e(n=>({resetKey:typeof t=="function"?t(n.resetKey):t}))})),ao={isFabulizerReady:!1,isOpen:!1,isOpenPrevious:!1,openTriggered:0,text:"",isAutoCommit:!1,objectToFabulize:null,objectToFabulizePrevious:null,
853status:"notStarted",statusPrevious:null,externalData:null,commitData:null,tmpLocalData:null},o7=$n(e=>({clients:{},setIsFabulizerReady:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.isFabulizerReady):n;return{clients:{...s.clients,[t]:{...r,isFabulizerReady:i}}}}),setIsAutoCommit:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.isAutoCommit):n;return{clients:{...s.clients,[t]:{...r,isAutoCommit:i}}}}),setIsOpen:(t,n,s)=>e(r=>{const i=r.clients[t]??ao,o=typeof n=="function"?n(i.isOpen):n;return{clients:{...r.clients,[t]:{...i,isOpenPrevious:s??i.isOpen,isOpen:o,openTriggered:i.openTriggered+1}}}}),setText:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.text):n;return{clients:{...s.clients,[t]:{...r,text:i}}}}),setObjectToFabulize:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.objectToFabulize):n;return{clients:{...s.clients,[t]:{...r,objectToFabulizePrevious:r.objectToFabulize,objectToFabulize:i}}}}),setStatus:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.status):n;return{clients:{...s.clients,[t]:{...r,status:i}}}}),setStatusPrevious:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.statusPrevious):n;return{clients:{...s.clients,[t]:{...r,statusPrevious:i}}}}),setExternalData:(t,n)=>e(s=>{const r=s.clients[t]??ao;return{clients:{...s.clients,[t]:{...r,externalData:n}}}}),setCommitData:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.commitData):n;return{clients:{...s.clients,[t]:{...r,commitData:i}}}}),setTmpLocalData:(t,n)=>e(s=>{const r=s.clients[t]??ao,i=typeof n=="function"?n(r.tmpLocalData):n;return{clients:{...s.clients,[t]:{...r,tmpLocalData:i}}}})})),wt=({clientId:e})=>{const{clients:t,setIsFabulizerReady:n,setText:s,setStatus:r,setStatusPrevious:i,setObjectToFabulize:o,setIsOpen:c,setExternalData:u,setCommitData:d,setTmpLocalData:p,setIsAutoCommit:g}=o7(),A=e&&t[e]?t[e]:ao,E=A.isFabulizerReady,x=A.isOpen,y=A.isOpenPrevious,I=A.text,v=A.status,S=A.openTriggered,b=A.objectToFabulize,w=A.objectToFabulizePrevious,_=A.statusPrevious,N=A.externalData,R=A.commitData,D=A.tmpLocalData,k=A.isAutoCommit,L=l.useCallback(H=>{e&&n(e,H)},[e,n]),O=l.useCallback(H=>{e&&s(e,H)},[e,s]),P=l.useCallback(H=>{e&&r(e,H)},[e,r]),B=l.useCallback(H=>{e&&i(e,H)},[e,i]),F=l.useCallback(H=>{e&&o(e,H)},[e,o]),z=l.useCallback((H,j)=>{e&&c(e,H,j)},[e,c]),Q=l.useCallback(H=>{e&&d(e,H)},[e,d]),M=l.useCallback(H=>{e&&u(e,H)},[e,u]),K=l.useCallback(H=>{e&&p(e,H)},[e,p]),W=l.useCallback(H=>{e&&g(e,H)},[e,g]);return{isFabulizerReady:E,isOpen:x,isOpenPrevious:y,text:I,status:v,openTriggered:S,objectToFabulize:b,objectToFabulizePrevious:w,statusPrevious:_,externalData:N,commitData:R,tmpLocalData:D,isAutoCommit:k,setText:O,setStatus:P,setStatusPrevious:B,setIsFabulizerReady:L,setObjectToFabulize:F,setIsOpen:z,setExternalData:M,setCommitData:Q,setTmpLocalData:K,setIsAutoCommit:W}},br=(e,t,n,s)=>{const r=e[t]??{};return{...e,[t]:{...r,[n]:s}}},Ie=$n(e=>({aggregationsDataByClientIdByKey:{},defenseRequestAggregationsByClientIdByKey:{},episodesByClientIdByKey:{},totalResultsByClientIdByKey:{},selectedRegionIdsByClientIdByKey:{},selectedPleaStatusesByClientIdByKey:{},selectedConclusionArticlesByClientIdByKey:{},selectedEpisodesByClientIdByKey:{},selectedPunishmentTypesByClientIdByKey:{},selectedAppealGoalsByClientIdByKey:{},selectedDefenseRequestsResultsByClientIdByKey:{},selectedAppealReviewResultsByClientIdByKey:{},selectedGendersByClientIdByKey:{},selectedCriminalStatusesByClientIdByKey:{},selectedFirstInstanceVerdictResultByClientIdByKey:{},selectedApplicantCategoriesByClientIdByKey:{},selectedDefenseRequestsGoalsByClientIdByKeyByGoal:{},selectedArgumentResultsByClientIdByKeyByGoal:{},resetKey:0,setAggregationsData:({clientId:t,key:n,data:s})=>e(r=>({aggregationsDataByClientIdByKey:br(r.aggregationsDataByClientIdByKey,t,n,s)})),setDefenseRequestAggregationsData:({clientId:t,key:n,data:s})=>e(r=>({defenseRequestAggregationsByClientIdByKey:br(r.defenseRequestAggregationsByClientIdByKey,t,n,s)})),setEpisodesData:({clientId:t,key:n,data:s})=>e(r=>
853({episodesByClientIdByKey:br(r.episodesByClientIdByKey,t,n,s)})),setTotalResults:({clientId:t,key:n,totalResults:s})=>e(r=>{const i=r.totalResultsByClientIdByKey[t]??{};return{totalResultsByClientIdByKey:{...r.totalResultsByClientIdByKey,[t]:{...i,[n]:s}}}}),setSelectedRegionIds:({clientId:t,key:n,selectedRegionIds:s})=>e(r=>({selectedRegionIdsByClientIdByKey:br(r.selectedRegionIdsByClientIdByKey,t,n,s)})),setSelectedPleaStatuses:({clientId:t,key:n,selectedPleaStatuses:s})=>e(r=>({selectedPleaStatusesByClientIdByKey:br(r.selectedPleaStatusesByClientIdByKey,t,n,s)})),setSelectedConclusionArticles:({clientId:t,key:n,selectedConclusionArticles:s})=>e(r=>({selectedConclusionArticlesByClientIdByKey:br(r.selectedConclusionArticlesByClientIdByKey,t,n,s)})),setSelectedEpisodes:({clientId:t,key:n,selectedEpisodes:s})=>e(r=>({selectedEpisodesByClientIdByKey:br(r.selectedEpisodesByClientIdByKey,t,n,s)})),setSelectedPunishmentTypes:({clientId:t,key:n,selectedPunishmentTypes:s})=>e(r=>({selectedPunishmentTypesByClientIdByKey:br(r.selectedPunishmentTypesByClientIdByKey,t,n,s)})),setSelectedAppealGoals:({clientId:t,key:n,selectedAppealGoals:s})=>e(r=>({selectedAppealGoalsByClientIdByKey:br(r.selectedAppealGoalsByClientIdByKey,t,n,s)})),setSelectedDefenseRequestsResults:({clientId:t,key:n,selectedDefenseRequestsResults:s})=>e(r=>({selectedDefenseRequestsResultsByClientIdByKey:br(r.selectedDefenseRequestsResultsByClientIdByKey,t,n,s)})),setSelectedAppealReviewResults:({clientId:t,key:n,selectedAppealReviewResults:s})=>e(r=>({selectedAppealReviewResultsByClientIdByKey:br(r.selectedAppealReviewResultsByClientIdByKey,t,n,s)})),setSelectedGenders:({clientId:t,key:n,selectedGenders:s})=>e(r=>({selectedGendersByClientIdByKey:br(r.selectedGendersByClientIdByKey,t,n,s)})),setSelectedCriminalStatuses:({clientId:t,key:n,selectedCriminalStatuses:s})=>e(r=>({selectedCriminalStatusesByClientIdByKey:br(r.selectedCriminalStatusesByClientIdByKey,t,n,s)})),setSelectedFirstInstanceVerdictResult:({clientId:t,key:n,selectedFirstInstanceVerdictResult:s})=>e(r=>({selectedFirstInstanceVerdictResultByClientIdByKey:br(r.selectedFirstInstanceVerdictResultByClientIdByKey,t,n,s)})),setSelectedApplicantCategories:({clientId:t,key:n,selectedApplicantCategories:s})=>e(r=>({selectedApplicantCategoriesByClientIdByKey:br(r.selectedApplicantCategoriesByClientIdByKey,t,n,s)})),setSelectedDefenseRequestsGoalsByGoal:({clientId:t,key:n,defenseGoal:s,selectedDefenseRequestsGoals:r})=>e(i=>{const o=i.selectedDefenseRequestsGoalsByClientIdByKeyByGoal[t]??{},c=o[n]??{};return{selectedDefenseRequestsGoalsByClientIdByKeyByGoal:{...i.selectedDefenseRequestsGoalsByClientIdByKeyByGoal,[t]:{...o,[n]:{...c,[s]:r}}}}}),setSelectedArgumentResultsByGoal:({clientId:t,key:n,defenseGoal:s,selectedArgumentResults:r})=>e(i=>{const o=i.selectedArgumentResultsByClientIdByKeyByGoal[t]??{},c=o[n]??{};return{selectedArgumentResultsByClientIdByKeyByGoal:{...i.selectedArgumentResultsByClientIdByKeyByGoal,[t]:{...o,[n]:{...c,[s]:r}}}}}),setResetKey:t=>e(n=>({resetKey:typeof t=="function"?t(n.resetKey):t}))})),a7={"first-instance":"first-instance","second-instance":"second-instance"},H6=rt(async function(t,n){const s=Se.getState().accessToken,r=a7[n],i=Ke(`/clients/${t}/${r}/cases/filters/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`}}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data??null}),Lte=rt(async function(t,n,s){const r=Se.getState().accessToken,i=a7[n],o=Ke(`/clients/${t}/${i}/cases/filters/`),c=await qe(o,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify(s)}),u=await Ye(c);if(He(u))throw{httpCode:503,errorData:u.error};if(u.status==="error")throw{httpCode:c.status,errorData:u.error};return u.data??null}),Mte=rt(async function({clientId:t,text:n,startPosition:s,endPosition:r,caseId:i,instance:o}){const c=Se.getState().accessToken,u=Ke(`/clients/${t}/quotes/`),d=await qe(u,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`},body:JSON.stringify({text:n,startPosition:s,endPosition:r,caseId:i,instance:o}),timeout:3e5}),p=await Ye(d);if(He(p))throw{httpCode:503,errorData:p.error};if(p.status==="error")throw{httpCode:d.status,errorData:p.error}}),mc=(e,t)=>{const n=Oe.useRef(null),s=sn(c=>c.filtersByClientIdByInstance[e]?.[t]??null),r=sn(c=>c.setFilters),i=tt({mutationFn:c=>Lte(e,t,c)});return{saveFilters:Oe.useCallback(c=>{const d={...n.current??s??{},...c};n.current=d,i.mutate(d,{onSuccess:p=>{p&&(n.current=p,r(e,t,p))}})},[i,s,r,e,t])}},hr=e=>e?.length?[{episodeId:e}]:null,rE=e=>{if(!e?.length)return null;const t=e.map(n=>{try{const s=JSON.parse(n),r=s.article??void 0,i=s.part??void 0,o=s.clause??void 0;return{...r!==void 0&&r!==""&&{number:r},...i!==void 0&&i!==""&&{part:i},...o!==void 0&&o!==""&&{clause:o}}}catch{return null}}).filter(n=>n!=null&&Object.keys(n).length>0);return t.length?t:null},xf=({episode:e})=>pt(e)?e.isDeleted===!0:!1,jte=({order:e,article:t})=>{if(t===void 0)return`Эпизод ${e}`;const n=et({clause:t.clause,part:t.part,number:t.number});return`Эпизод ${e}, ${n}`},gc=({episodes:e,articles:t})=>e.filter(s=>!xf({episode:s})).map((s,r)=>{const i=t?.find(o=>o.id===s.catalogueArticleId);return{value:s.id,label:jte({order:r+1,article:i})}}),V6="77",G6="50",iE=e=>[...e].sort((t,n)=>t.value===V6?-1:n.value===V6?1:t.value===G6?-1:n.value===G6?1:t.label.localeCompare(n.label,"ru")),vs=()=>{const e=kn(t=>t.catalogues?.regions);return l.useMemo(()=>e?e.reduce((t,n)=>(t[String(n.number)]=n,t),{}):{},[e])},$h=({onClick:e,isFilled:t,label:n})=>t?a.jsx("div",{className:Y("h-6 flex items-center gap-1 text-[14px] leading-[20px] group roboto-flex-100-600-1 text-zinc-500 cursor-pointer text-nowrap"),onClick:e,children:n}):null,Tt="first-instance",Bte=({clientData:e,mainWrapperRef:t})=>{const n=vs(),{status:s}=wt({clientId:e?.id}),r=Ve(ce=>ce.fabulaStatusByClientId[e.id]),i=Ve(ce=>ce.aggregationsDataByClientIdByKey[e.id]?.[Tt]),o=Ve(ce=>ce.selectedPleaStatusesByClientIdByKey[e.id]?.[Tt]),c=Ve(ce=>ce.selectedPunishmentsByClientIdByKey[e.id]?.[Tt]),u=Ve(ce=>ce.selectedConclusionArticlesByClientIdByKey[e.id]?.[Tt]),d=Ve(ce=>ce.selectedRegionIdsByClientIdByKey[e.id]?.[Tt]),p=Ve(ce=>
853ce.selectedEpisodesByClientIdByKey[e.id]?.[Tt]),g=Ve(ce=>ce.selectedGendersByClientIdByKey[e.id]?.[Tt]),A=Ve(ce=>ce.selectedCriminalStatusesByClientIdByKey[e.id]?.[Tt]),E=Ve(ce=>ce.setSelectedEpisodes),x=Ve(ce=>ce.setSelectedGenders),y=Ve(ce=>ce.setSelectedCriminalStatuses),I=Ve(ce=>ce.setSelectedPleaStatuses),v=Ve(ce=>ce.setSelectedPunishments),S=Ve(ce=>ce.setSelectedConclusionArticles),b=Ve(ce=>ce.setSelectedRegionIds),w=Ie(ce=>ce.setSelectedConclusionArticles),_=Ie(ce=>ce.setSelectedEpisodes),N=Ie(ce=>ce.setSelectedGenders),R=Ie(ce=>ce.setSelectedCriminalStatuses),D=Ie(ce=>ce.setSelectedPleaStatuses),k=Ie(ce=>ce.setSelectedPunishmentTypes),L=Ie(ce=>ce.setSelectedRegionIds),O=Ie(ce=>ce.setResetKey),P=Ve(ce=>ce.setSelectedPunishments),B=Ve(ce=>ce.resetKey),{saveFilters:F}=mc(e.id,Tt),z=kn(ce=>ce.catalogues?.articles),Q=l.useMemo(()=>gc({episodes:e.episodes,articles:z}),[e.episodes,z]),M=l.useMemo(()=>new Set(Q.map(ce=>ce.value)),[Q]),K=l.useMemo(()=>{if(!p?.length)return null;const ce=[];for(const xe of p)M.has(xe)&&ce.push(xe);return ce.length?ce:null},[p,M]),W=l.useCallback(ce=>{if(!ce?.length){E({clientId:e.id,key:Tt,selectedEpisodes:null}),_({clientId:e.id,key:Tt,selectedEpisodes:null}),F({episodes:hr(null)}),ln({ref:t});return}E({clientId:e.id,key:Tt,selectedEpisodes:ce}),_({clientId:e.id,key:Tt,selectedEpisodes:ce}),F({episodes:hr(ce)}),ln({ref:t})},[e.id,E,_,t,F]);l.useEffect(()=>{if(p?.length&&K?.length!==p.length){if(!K?.length){E({clientId:e.id,key:Tt,selectedEpisodes:null}),_({clientId:e.id,key:Tt,selectedEpisodes:null}),F({episodes:hr(null)});return}E({clientId:e.id,key:Tt,selectedEpisodes:K}),_({clientId:e.id,key:Tt,selectedEpisodes:K}),F({episodes:hr(K)})}},[p,K,e.id,E,_,F]);const H=i?.global_regions?.regions?.buckets,j=l.useMemo(()=>{const ce=(xe,re)=>({label:et({part:xe.part,number:xe.article??""}),value:JSON.stringify({article:xe.article,part:xe.part??""}),zone:re});return[...(i?.cluster_article_nested??[]).map(xe=>ce(xe,"primary")),...(i?.conclusions_article_nested??[]).map(xe=>ce(xe,"secondary"))]},[i?.cluster_article_nested,i?.conclusions_article_nested]),q=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;S({clientId:e.id,key:Tt,selectedConclusionArticles:xe}),w({clientId:e.id,key:Tt,selectedConclusionArticles:xe}),F({articles:rE(xe)}),ln({ref:t})},[e.id,S,w,t,F]),G=l.useMemo(()=>{if(!H)return[];const ce=H.reduce((xe,re)=>{const pe=re.key;if(pe==null)return xe;const _e=String(pe),Le=n[Number(pe)]?.name??_e;return xe.push({label:Le,value:_e}),xe},[]);return iE(ce)},[H,n]),$=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;b({clientId:e.id,key:Tt,selectedRegionIds:xe}),L({clientId:e.id,key:Tt,selectedRegionIds:xe}),F({regions:xe?xe.map(Number):null}),ln({ref:t})},[e.id,b,L,t,F]),J=i?.global_plea?.plea_nested?.plea_status?.buckets,ne=l.useMemo(()=>J?J.reduce((ce,xe)=>{const re=xe.key;if(re==null)return ce;const pe=String(re);return ce.push({label:Vn(pe),value:pe}),ce},[]):[],[J]),X=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;I({clientId:e.id,key:Tt,selectedPleaStatuses:xe}),D({clientId:e.id,key:Tt,selectedPleaStatuses:xe}),F({pleaStatuses:xe}),ln({ref:t})},[e.id,I,D,t,F]),oe=l.useMemo(()=>(i?.punishment_nested?.verdicts_nested?.punishment_type?.buckets??[]).filter(xe=>xe.key!=null).map(xe=>({label:Vn(String(xe.key)),value:String(xe.key)})),[i]),ie=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;v({clientId:e.id,key:Tt,selectedPunishments:xe}),k({clientId:e.id,key:Tt,selectedPunishmentTypes:xe}),F({punishments:xe}),ln({ref:t})},[e.id,v,k,t,F]),ee=l.useMemo(()=>{const ce=i?.global_genders?.genders_nested?.genders?.buckets??[];if(!ce.length)return[];const xe=h.enums.genders;return ce.filter(re=>re.key!=null&&re.key!=="").map(re=>{const pe=String(re.key);return{label:On(xe,pe,Vn(pe)),value:pe}})},[i]),te=l.useMemo(()=>{const ce=i?.global_criminal_statuses?.criminal_statuses_nested?.criminal_statuses?.buckets??[];if(!ce.length)return[];const xe=h.enums.criminalStatuses;return ce.filter(re=>re.key!=null&&re.key!=="").map(re=>{const pe=String(re.key);return{label:On(xe,pe,Vn(pe)),value:pe}})},[i]),le=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;x({clientId:e.id,key:Tt,selectedGenders:xe}),N({clientId:e.id,key:Tt,selectedGenders:xe}),F({genders:xe}),ln({ref:t})},[e.id,x,N,t,F]),he=l.useCallback(ce=>{const xe=ce&&ce.length?ce:null;y({clientId:e.id,key:Tt,selectedCriminalStatuses:xe}),R({clientId:e.id,key:Tt,selectedCriminalStatuses:xe}),F({criminalStatuses:xe}),ln({ref:t})},[e.id,y,R,t,F]),fe=Ie(ce=>ce.selectedPunishmentTypesByClientIdByKey[e.id]?.[Tt]??null),ue=l.useMemo(()=>!!(K?.length||u?.length||d?.length||g?.length||A?.length||o?.length||fe?.length),[K?.length,u?.length,d?.length,g?.length,A?.length,o?.length,fe?.length]),ye=l.useCallback(()=>{E({clientId:e.id,key:Tt,selectedEpisodes:null}),S({clientId:e.id,key:Tt,selectedConclusionArticles:null}),b({clientId:e.id,key:Tt,selectedRegionIds:null}),I({clientId:e.id,key:Tt,selectedPleaStatuses:null}),x({clientId:e.id,key:Tt,selectedGenders:null}),y({clientId:e.id,key:Tt,selectedCriminalStatuses:null}),_({clientId:e.id,key:Tt,selectedEpisodes:null}),w({clientId:e.id,key:Tt,selectedConclusionArticles:null}),L({clientId:e.id,key:Tt,selectedRegionIds:null}),D({clientId:e.id,key:Tt,selectedPleaStatuses:null}),N({clientId:e.id,key:Tt,selectedGenders:null}),R({clientId:e.id,key:Tt,selectedCriminalStatuses:null}),k({clientId:e.id,key:Tt,selectedPunishmentTypes:null}),P({clientId:e.id,key:Tt,selectedPunishments:null}),F({episodes:null,articles:null,regions:null,genders:null,criminalStatuses:null,pleaStatuses:null,punishments:null}),O(ce=>ce+1)},[E,e.id,S,b,I,x,y,_,w,L,D,N,R,k,P,F,O]);return s==="pending"||r!=="ok"?null:a.jsx("div",{className:"flex flex-col gap-y-3 w-full",children:a.jsxs("div",{className:"flex justify-between w-full",children:[a.jsxs("div",{className:"flex flex-col bp90:flex-row flex-wrap bp90:flex-nowrap bp90:items-start bp90:justify-start gap-x-4 bp90:gap-x-6 gap-y-1",children:[a.jsx("div",{className:"shrink-0",children:a.jsx(vm,{isClearable:!1,value:"first-instance",options:[{label:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,value:"first-instance",to:`/clients/${e.id}/cases/first-instance`},{label:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,value:"second-instance",to:`/clients/${e.id}/cases/second-instance`}]})}),a.jsx("div",{className:"hidden bp90:block self-center w-0 h-4 border-r border-zinc-200 shrink-0"}),a.jsxs("div",{className:"flex flex-wrap bp90:flex-nowrap bp90:items-start bp90:justify-start gap-x-4 gap-y-1 bp90:gap-4",children:[a.jsx(Dn,{placeholder:h.client.cases.aggregations.events.PLACEHOLDER,values:K,options:Q,onChange:W,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.articles.PLACEHOLDER,values:u,options:j,onChange:q,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.regions.PLACEHOLDER,values:d,options:G,onChange:$,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.plea.PLACEHOLDER,values:o,options:ne,onChange:X,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.punishment.PLACEHOLDER,values:c,options:oe,onCh
853ange:ie,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.genders.PLACEHOLDER,values:g,options:ee,onChange:le,resetKey:B}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.criminalStatuses.PLACEHOLDER,values:A,options:te,onChange:he,resetKey:B})]})]}),a.jsx("div",{className:"text-nowrap",children:a.jsx($h,{onClick:ye,isFilled:ue,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]})})},VA=({onClick:e,isFilled:t,label:n})=>t?a.jsx("div",{className:Y("h-6 flex items-center gap-1 text-[14px] leading-[20px] group roboto-flex-100-600-1 text-zinc-500 cursor-pointer"),onClick:e,children:n}):null,kt="second-instance",Fte=({clientData:e,mainWrapperRef:t})=>{const n=vs(),{status:s}=wt({clientId:e?.id}),r=Ve(ue=>ue.fabulaStatusByClientId[e.id]),i=Ve(ue=>ue.aggregationsDataByClientIdByKey[e.id]?.[kt]),o=Ve(ue=>ue.selectedPleaStatusesByClientIdByKey[e.id]?.[kt]),c=Ve(ue=>ue.selectedPunishmentsByClientIdByKey[e.id]?.[kt]),u=Ve(ue=>ue.selectedConclusionArticlesByClientIdByKey[e.id]?.[kt]),d=Ve(ue=>ue.selectedRegionIdsByClientIdByKey[e.id]?.[kt]),p=Ve(ue=>ue.selectedEpisodesByClientIdByKey[e.id]?.[kt]),g=Ve(ue=>ue.selectedGendersByClientIdByKey[e.id]?.[kt]),A=Ve(ue=>ue.selectedCriminalStatusesByClientIdByKey[e.id]?.[kt]),E=Ie(ue=>ue.setSelectedEpisodes),x=Ie(ue=>ue.setSelectedConclusionArticles),y=Ie(ue=>ue.setSelectedGenders),I=Ie(ue=>ue.setSelectedCriminalStatuses),v=Ve(ue=>ue.setSelectedEpisodes),S=Ve(ue=>ue.setSelectedGenders),b=Ve(ue=>ue.setSelectedCriminalStatuses),w=Ve(ue=>ue.setSelectedPleaStatuses),_=Ve(ue=>ue.setSelectedPunishments),N=Ve(ue=>ue.setSelectedConclusionArticles),R=Ve(ue=>ue.setSelectedRegionIds),D=Ie(ue=>ue.setSelectedRegionIds),k=Ie(ue=>ue.setResetKey),L=Ie(ue=>ue.setSelectedPunishmentTypes),O=Ve(ue=>ue.setSelectedPunishments),P=Ve(ue=>ue.resetKey),{saveFilters:B}=mc(e.id,kt),F=kn(ue=>ue.catalogues?.articles),z=l.useMemo(()=>gc({episodes:e.episodes,articles:F}),[e.episodes,F]),Q=l.useMemo(()=>new Set(z.map(ue=>ue.value)),[z]),M=l.useMemo(()=>{if(!p?.length)return null;const ue=[];for(const ye of p)Q.has(ye)&&ue.push(ye);return ue.length?ue:null},[p,Q]),K=l.useMemo(()=>!!(M?.length||u?.length||d?.length||g?.length||A?.length||o?.length||c?.length),[M?.length,u?.length,d?.length,g?.length,A?.length,o?.length,c?.length]),W=l.useCallback(ue=>{if(!ue?.length){v({clientId:e.id,key:kt,selectedEpisodes:null}),E({clientId:e.id,key:kt,selectedEpisodes:null}),B({episodes:hr(null)}),ln({ref:t});return}v({clientId:e.id,key:kt,selectedEpisodes:ue}),E({clientId:e.id,key:kt,selectedEpisodes:ue}),B({episodes:hr(ue)}),ln({ref:t})},[e.id,v,E,t,B]);l.useEffect(()=>{if(p?.length&&M?.length!==p.length){if(!M?.length){v({clientId:e.id,key:kt,selectedEpisodes:null}),E({clientId:e.id,key:kt,selectedEpisodes:null}),B({episodes:hr(null)});return}v({clientId:e.id,key:kt,selectedEpisodes:M}),E({clientId:e.id,key:kt,selectedEpisodes:M}),B({episodes:hr(M)})}},[p,M,e.id,v,E,B]);const H=i?.global_regions?.regions?.buckets,j=l.useMemo(()=>{const ue=(ye,ce)=>({label:et({part:ye.part,number:ye.article??""}),value:JSON.stringify({article:ye.article,part:ye.part??""}),zone:ce});return[...(i?.cluster_article_nested??[]).map(ye=>ue(ye,"primary")),...(i?.conclusions_article_nested??[]).map(ye=>ue(ye,"secondary"))]},[i?.cluster_article_nested,i?.conclusions_article_nested]),q=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;N({clientId:e.id,key:kt,selectedConclusionArticles:ye}),x({clientId:e.id,key:kt,selectedConclusionArticles:ye}),B({articles:rE(ye)}),ln({ref:t})},[e.id,N,x,t,B]),G=l.useMemo(()=>{if(!H)return[];const ue=H.reduce((ye,ce)=>{const xe=ce.key;if(xe==null)return ye;const re=String(xe),pe=n[Number(xe)]?.name??re;return ye.push({label:pe,value:re}),ye},[]);return iE(ue)},[H,n]),$=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;R({clientId:e.id,key:kt,selectedRegionIds:ye}),D({clientId:e.id,key:kt,selectedRegionIds:ye}),B({regions:ye?ye.map(Number):null}),ln({ref:t})},[e.id,R,D,t,B]),J=i?.global_plea?.plea_nested?.plea_status?.buckets,ne=l.useMemo(()=>J?J.reduce((ue,ye)=>{const ce=ye.key;if(ce==null)return ue;const xe=String(ce);return ue.push({label:Vn(xe),value:xe}),ue},[]):[],[J]),X=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;w({clientId:e.id,key:kt,selectedPleaStatuses:ye}),B({pleaStatuses:ye}),ln({ref:t})},[e.id,w,t,B]),oe=l.useMemo(()=>(i?.punishment_nested?.verdicts_nested?.punishment_type?.buckets??[]).filter(ye=>ye.key!=null).map(ye=>({label:Vn(String(ye.key)),value:String(ye.key)})),[i]),ie=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;_({clientId:e.id,key:kt,selectedPunishments:ye}),B({punishments:ye}),ln({ref:t})},[e.id,_,t,B]),ee=l.useMemo(()=>{const ue=i?.global_genders?.genders_nested?.genders?.buckets??[];if(!ue.length)return[];const ye=h.enums.genders;return ue.filter(ce=>ce.key!=null&&ce.key!=="").map(ce=>
853{const xe=String(ce.key);return{label:On(ye,xe,Vn(xe)),value:xe}})},[i]),te=l.useMemo(()=>{const ue=i?.global_criminal_statuses?.criminal_statuses_nested?.criminal_statuses?.buckets??[];if(!ue.length)return[];const ye=h.enums.criminalStatuses;return ue.filter(ce=>ce.key!=null&&ce.key!=="").map(ce=>{const xe=String(ce.key);return{label:On(ye,xe,Vn(xe)),value:xe}})},[i]),le=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;S({clientId:e.id,key:kt,selectedGenders:ye}),y({clientId:e.id,key:kt,selectedGenders:ye}),B({genders:ye}),ln({ref:t})},[e.id,S,y,t,B]),he=l.useCallback(ue=>{const ye=ue&&ue.length?ue:null;b({clientId:e.id,key:kt,selectedCriminalStatuses:ye}),I({clientId:e.id,key:kt,selectedCriminalStatuses:ye}),B({criminalStatuses:ye}),ln({ref:t})},[e.id,b,I,t,B]),fe=l.useCallback(()=>{v({clientId:e.id,key:kt,selectedEpisodes:null}),N({clientId:e.id,key:kt,selectedConclusionArticles:null}),R({clientId:e.id,key:kt,selectedRegionIds:null}),w({clientId:e.id,key:kt,selectedPleaStatuses:null}),S({clientId:e.id,key:kt,selectedGenders:null}),b({clientId:e.id,key:kt,selectedCriminalStatuses:null}),E({clientId:e.id,key:kt,selectedEpisodes:null}),x({clientId:e.id,key:kt,selectedConclusionArticles:null}),D({clientId:e.id,key:kt,selectedRegionIds:null}),y({clientId:e.id,key:kt,selectedGenders:null}),I({clientId:e.id,key:kt,selectedCriminalStatuses:null}),L({clientId:e.id,key:kt,selectedPunishmentTypes:null}),O({clientId:e.id,key:kt,selectedPunishments:null}),B({episodes:null,articles:null,regions:null,genders:null,criminalStatuses:null,pleaStatuses:null,punishments:null}),k(ue=>ue+1)},[v,e.id,N,R,w,S,b,E,x,D,y,I,L,O,B,k]);return s==="pending"||r!=="ok"?null:a.jsx("div",{className:"flex flex-col gap-y-3 w-full",children:a.jsxs("div",{className:"flex justify-between w-full",children:[a.jsxs("div",{className:"flex flex-col bp90:flex-row flex-wrap bp90:flex-nowrap bp90:items-start bp90:justify-start gap-x-4 bp90:gap-x-6 gap-y-1",children:[a.jsx("div",{className:"shrink-0",children:a.jsx(vm,{isClearable:!1,value:kt,options:[{label:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,value:"first-instance",to:`/clients/${e.id}/cases/first-instance`},{label:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,value:"second-instance",to:`/clients/${e.id}/cases/second-instance`}]})}),a.jsx("div",{className:"hidden bp90:block self-center w-0 h-4 border-r border-zinc-200 shrink-0"}),a.jsxs("div",{className:"flex flex-wrap bp90:flex-nowrap bp90:items-start bp90:justify-start gap-x-4 gap-y-1 bp90:gap-4",children:[a.jsx(Dn,{placeholder:h.client.cases.aggregations.events.PLACEHOLDER,values:M,options:z,onChange:W,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.articles.PLACEHOLDER,values:u,options:j,onChange:q,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.regions.PLACEHOLDER,values:d,options:G,onChange:$,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.plea.PLACEHOLDER,values:o,options:ne,onChange:X,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.punishment.PLACEHOLDER,values:c,options:oe,onChange:ie,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.genders.PLACEHOLDER,values:g,options:ee,onChange:le,resetKey:P}),a.jsx(Dn,{placeholder:h.client.cases.aggregations.criminalStatuses.PLACEHOLDER,values:A,options:te,onChange:he,resetKey:P})]})]}),a.jsx("div",{className:"text-nowrap",children:a.jsx(VA,{onClick:fe,isFilled:K,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]})})},Ute=({clientData:e,mainWrapperRef:t})=>{const n=Fe(),s=Ve(c=>c.fabulaStatusByClientId[e?.id??""]),{status:r}=wt({clientId:e?.id}),{topPosition:i,isSubMenuHidden:o}=l.useMemo(()=>{const c=n.pathname.includes("/cases/first-instance/saved")||n.pathname.includes("/cases/second-instance/saved"),u=n.pathname.includes("/cases/first-instance")||n.pathname.includes("/cases/second-instance");return e?!u||c?{topPosition:null,isSubMenuHidden:!1}:r==="pending"||s!=="ok"?{topPosition:null,isSubMenuHidden:!0}:n.pathname.includes("/cases/second-instance")?{topPosition:a.jsx(Fte,{clientData:e,mainWrapperRef:t}),isSubMenuHidden:!1}:{topPosition:a.jsx(Bte,{clientData:e,mainWrapperRef:t}),isSubMenuHidden:!1}:{topPosition:null,isSubMenuHidden:!1}},[e,t,n.pathname,s,r]);return{topPosition:i,isSubMenuHidden:o}},zte=({linksTree:e,nodeMap:t,parentMap:n,isSuccess:s,mainWrapperRef:r,clientData:i})=>{const o=Fe(),{episodeId:c,legacyFelonyId:u,defenseStrategyPageType:d,defenseStrategyPageSubType:p,circumstanceId:g,evidenceId:A,defenseLineId:E}=st(),x=l.useMemo(()=>{let N=o.pathname;return N=N.replace(/\/+$/,""),c&&(N=N.replace(`/${c}`,"")),u&&(N=N.replace(`/${u}`,"")),d&&(N=N.replace(`/${d}`,"")),p&&(N=N.replace(`/${p}`,"")),g&&(N=N.replace(`/${g}`,"")),A&&(N=N.replace(`/${A}`,"")),E&&(N=N.replace(`/${E}`,"")),N},[o.pathname,c,u,d,p,g,A,E]),y=Yo(x,!0),I=t.has(y)?y:Yo(x,!1),v=t.get(I),{topPosition:S,isSubMenuHidden:b}=Ute({clientData:i,mainWrapperRef:r});if(!v&&!S||b)return null;const w=e[0].id;let _=v;for(;_;){const N=n.get(_.id);if(!N||N.id===w)break;_=N}
853return _?.id===w||!_?.children&&!S||!s?null:a.jsxs("div",{className:Y("pb-3","bg-white","flex","flex-col","gap-y-3","bp62_5:min-h-9","items-start","px-4","sticky","top-[3.5rem]","z-12","pt-6","bp48:pt-4"),children:[!!_?.children&&a.jsx("div",{className:"flex items-center space-x-1",children:_.children.map(N=>a.jsx(Pte,{link:N},N.id))}),S]})};function Qte(e){const t=sn(i=>i.setIsRedirectCompleted),n=Fe(),s=at(),r=l.useCallback(i=>{const o=n.pathname.replace(/\/+$/,"")||"/";for(const c of i){const u=c.to.replace(/\/+$/,"");if(!c.end){if(u===o&&c.redirectTo)return s(c.redirectTo,{replace:!0,state:n.state}),!0;if(c.children?.length&&r(c.children))return!0}}return!1},[n.pathname,n.state,s]);l.useLayoutEffect(()=>{!e?.length||r(e)||t(!0)},[r,e,t])}const Hte=new Set(["VALIDATION_ERROR","NOT_FOUND"]),Vte=({error:e})=>typeof e.code=="string"?e.code:pt(e.errorData)&&typeof e.errorData.code=="string"?e.errorData.code:null;function Gte({error:e}){if(!pt(e))return!1;const t=Vte({error:e});return t?Hte.has(t):!1}function Zi(e){const{id:t}=st(),s=e?.clientId?e.clientId:t,{data:r,isSuccess:i,error:o,isFetching:c,isPending:u}=Vt({queryKey:["client",s],queryFn:()=>s7({id:s}),enabled:!!s,staleTime:1e3*60*5,refetchOnWindowFocus:!0}),d=l.useMemo(()=>{if(r)return r},[r]),p=l.useMemo(()=>Gte({error:o}),[o]);return{clientData:d,isSuccess:i,error:o,isFetching:c,isPending:u,isClientNotFound:p}}const l7=1e3*60*5,c7=1e3*60*30,qte=1e4,Wte=3,Kte="episodeId",_m=({clientId:e,defenseLineId:t})=>["clientDefenseLineDefenseTree",e,t],GA=({defenseLine:e})=>pt(e)?e.isDeleted===!0:!1,u7=({queryClient:e,clientId:t,defenseLineId:n})=>{const s=e.getQueryData(_m({clientId:t,defenseLineId:n}));return s?s.updatedAt?s.updatedAt:"":null},d7=({queryClient:e,clientId:t})=>{const n={},r=e.getQueryData(["client",t])?.defenseLines;return r&&r.forEach(i=>{GA({defenseLine:i})||(n[i.id]=u7({queryClient:e,clientId:t,defenseLineId:i.id}))}),n},Oy=({path:e})=>{const n=e.split("#")[0].split("?")[0].match(/^clients\/([^/]+)\//);if(!n)return;const s=n[1];if(s)return s},$te=({path:e,clientId:t})=>{const n=new RegExp(`^clients/${t}/defense-lines/([^/]+)/?$`);return e.match(n)},Yte=({path:e,clientId:t})=>{const n=e.split("#")[0].split("?")[0],s=$te({path:n,clientId:t});if(!s)return;const r=s[1];if(r)return r},Xte=({handledByClient:e,clientId:t})=>{const n=e.get(t);if(n)return n;const s=new Set;return e.set(t,s),s},Py=({path:e,clientId:t})=>{const n=`clients/${t}/episodes/`;return!!e.startsWith(n)},su=$n(e=>({defenseTreeRefreshBaselinesByClientId:{},markDefenseTreeRefreshBaselines:({clientId:t,baselinesByDefenseLineId:n})=>e(s=>({defenseTreeRefreshBaselinesByClientId:{...s.defenseTreeRefreshBaselinesByClientId,[t]:n}})),markDefenseTreeRefreshBaselineForLine:({clientId:t,defenseLineId:n,baseline:s})=>e(r=>({defenseTreeRefreshBaselinesByClientId:{...r.defenseTreeRefreshBaselinesByClientId,[t]:{...r.defenseTreeRefreshBaselinesByClientId[t],[n]:s}}})),clearDefenseTreeRefreshBaselineForLine:({clientId:t,defenseLineId:n})=>e(s=>{const r=s.defenseTreeRefreshBaselinesByClientId[t];if(!r||!(n in r))return s;const i={...r};if(delete i[n],Object.keys(i).length===0){const o={...s.defenseTreeRefreshBaselinesByClientId};return delete o[t],{defenseTreeRefreshBaselinesByClientId:o}}return{defenseTreeRefreshBaselinesByClientId:{...s.defenseTreeRefreshBaselinesByClientId,[t]:i}}})})),Hn=$n((e,t)=>{const s=new Map,r=(c,u,d)=>`${c}:::${u}:::${d}`,i=(c,u,d)=>{const p=r(c,u,d),g=s.get(p);g&&clearTimeout(g);const A=setTimeout(()=>{e(E=>{const x={...E.requestsByClient[c]??{}},y={...x[u]??{}};return delete y[d],{requestsByClient:{...E.requestsByClient,[c]:{...x,[u]:y}}}}),s.delete(p)},3e5);s.set(p,A)},o=(c,u,d)=>{const p=r(c,u,d),g=s.get(p);g&&(clearTimeout(g),s.delete(p))};return{requestsByClient:{},setRequest:(c,u,d,p)=>e(g=>({requestsByClient:{...g.requestsByClient,[c]:{...g.requestsByClient[c]??{},[u]:{...g.requestsByClient[c]?.[u]??{},[d]:p}}}})),getRequest:(c,u,d)=>t().requestsByClient[c]?.[u]?.[d],updateRequest:(c,u,d,p)=>e(g=>{const A={...g.requestsByClient[c]??{}},E={...A[u]??{}},x=E[d];if(!x)return{requestsByClient:g.requestsByClient};const y={...x,...p};return E[d]=y,(y.status==="error"||y.status==="settled")&&i(c,u,d),{requestsByClient:{...g.requestsByClient,[c]:{...A,[u]:E}}}}),deleteRequest:(c,u,d)=>e(p=>{const g={...p.requestsByClient[c]??{}},A={...g[u]??{}},E=A[d];return E?.status==="inflight"&&E.controller&&E.controller.abort(),delete A[d],o(c,u,d),{requestsByClient:{...p.requestsByClient,[c]:{...g,[u]:A}}}})}}),bs=$n((e,t)=>{const s=new Map,r=(c,u,d,p)=>`${c}:::${u}:::${d}:::${p}`,i=(c,u,d,p)=>{const g=r(c,u,d,p),A=s.get(g);A&&clearTimeout(A);const E=setTimeout(()=>{e(x=>{const y={...x.requestsByClient[c]??{}},I={...y[u]??{}},v={...I[d]??{}};return delete v[p],{requestsByClient:{...x.requestsByClient,[c]:{...y,[u]:{...I,[d]:v}}}}}),s.delete(g)},3e5);s.set(g,E)},o=(c,u,d,p)=>{const g=r(c,u,d,p),A=s.get(g);A&&(clearTimeout(A),s.delete(g))};return{requestsByClient:{},setRequest:(c,u,d,p,g)=>e(A=>({requestsByClient:{...A.requestsByClient,[c]:{...A.requestsByClient[c]??{},[u]:{...A.requestsByClient[c]?.[u]??{},[d]:{...A.requestsByClient[c]?.[u]?.[d]??{},[p]:g}}}}})),getRequest:(c,u,d,p)=>t().requestsByClient[c]?.[u]?.[d]?.[p],updateRequest:(c,u,d,p,g)=>e(A=>{const E={...A.requestsByClient[c]??{}},x={...E[u]??{}},y={...x[d]??{}},I=y[p];if(!I)return{requestsByClient:A.requestsByClient};const v={...I,...g};return y[p]=v,(v.status==="error"||v.status==="settled")&&i(c,u,d,p),{requestsByClient:{...A.requestsByClient,[c]:{...E,[u]:{...x,[d]:y}}}}}),deleteRequest:(c,u,d,p)=>e(g=>{const A={...g.requestsByClient[c]??{}},E={...A[u]??{}},x={...E[d]??{}},y=x[p];return y?.status==="inflight"&&y.controller&&y.controller.abort(),delete x[p],o(c,u,d,p),{requestsByClient:{...g.requestsByClient,[c]:{...A,[u]:{...E,[d]:x}}}}})}}),ra=$n((e,t)=>{const s=new Map,r=(c,u,d)=>`${c}:::${u}:::${d}`,i=(c,u,d)=>{const p=r(c,u,d),g=s.get(p);g&&clearTimeout(g);const A=setTimeout(()=>{e(E=>{const x={...E.requestsByClient[c]??{}},y={...x[u]??{}};return delete y[d],{requestsByClient:{...E.requestsByClient,[c]:{...x,[u]:y}}}}),s.delete(p)},3e5);s.set(p,A)},o=(c,u,d)=>{const p=r(c,u,d),g=s.get(p);g&&(clearTimeout(g),s.delete(p))};return{requestsByClient:{},setRequest:(c,u,d,p)=>e(g=>({requestsByClient:{...g.requestsByClient,[c]:{...g.requestsByClient[c]??{},[u]:{...g.requestsByClient[c]?.[u]??{},[d]:p}}}})),getRequest:(c,u,d)=>t().requestsByClient[c]?.[u]?.[d],updateRequest:(c,u,d,p)=>e(g=>{const A={...g.requestsByClient[c]??{}},E={...A[u]??{}},x=E[d];if(!x)return{requestsByClient:g.requestsByClient};const y={...x,...p};return E[d]=y,(y.status==="error"||y.status==="settled")&&i(c,u,d),{requestsByClient:{...g.requestsByClient,[c]:{...A,[u]:E}}}}),deleteRequest:(c,u,d)=>e(p=>{const g={...p.requestsByClient[c]??{}},A={...g[u]??{}};return delete A[d],o(c,u,d),{requestsByClient:{...p.requestsByClient,[c]:{...g,[u]:A}}}})}}),Jte=({clientId:e,patchRequestsByPath:t,postRequestsByPath:n,deleteRequestsByPath:s,handledRequestKe
853ys:r,isInitialized:i})=>{const o=[];return t&&Object.entries(t).forEach(([c,u])=>{Oy({path:c})!==e||!Py({path:c,clientId:e})||u&&Object.entries(u).forEach(([g,A])=>{A&&Object.entries(A).forEach(([E,x])=>{if(!x||x.status!=="settled")return;const y=`patch:${c}:${g}:${E}`;if(!i){r.add(y);return}r.has(y)||o.push(y)})})}),n&&Object.entries(n).forEach(([c,u])=>{Oy({path:c})!==e||!Py({path:c,clientId:e})||u&&Object.entries(u).forEach(([g,A])=>{if(!A||A.status!=="settled")return;const E=`post:${c}:${g}`;if(!i){r.add(E);return}r.has(E)||o.push(E)})}),s&&Object.entries(s).forEach(([c,u])=>{Oy({path:c})!==e||!Py({path:c,clientId:e})||u&&Object.entries(u).forEach(([g,A])=>{if(!A||A.status!=="settled")return;const E=`delete:${c}:${g}`;if(!i){r.add(E);return}r.has(E)||o.push(E)})}),o},Zte=({clientId:e,patchRequestsByPath:t,handledRequestKeys:n,isInitialized:s})=>{if(!t)return[];const r=[];return Object.entries(t).forEach(([i,o])=>{const c=Yte({path:i,clientId:e});c&&o&&Object.entries(o).forEach(([u,d])=>{u===Kte&&d&&Object.entries(d).forEach(([p,g])=>{if(!g||g.status!=="settled")return;const A=`patch:${i}:${u}:${p}`;if(!s){n.add(A);return}n.has(A)||r.push({requestKey:A,defenseLineId:c})})})}),r},ene=({clientId:e})=>{const t=bt(),n=l.useRef(new Map),s=l.useRef(new Set),r=bs(c=>{if(e)return c.requestsByClient[e]}),i=ra(c=>{if(e)return c.requestsByClient[e]}),o=Hn(c=>{if(e)return c.requestsByClient[e]});l.useEffect(()=>{if(!e)return;const c=Xte({handledByClient:n.current,clientId:e}),u=s.current.has(e),d=Jte({clientId:e,patchRequestsByPath:r,postRequestsByPath:i,deleteRequestsByPath:o,handledRequestKeys:c,isInitialized:u}),p=Zte({clientId:e,patchRequestsByPath:r,handledRequestKeys:c,isInitialized:u});if(s.current.add(e),p.forEach(({requestKey:A,defenseLineId:E})=>{c.add(A),su.getState().markDefenseTreeRefreshBaselineForLine({clientId:e,defenseLineId:E,baseline:u7({queryClient:t,clientId:e,defenseLineId:E})})}),d.length===0)return;d.forEach(A=>{c.add(A)});const g=d7({queryClient:t,clientId:e});Object.keys(g).length!==0&&su.getState().markDefenseTreeRefreshBaselines({clientId:e,baselinesByDefenseLineId:g})},[e,r,i,o,t])};function tne(e){const t=e?.episodesArticles?.length?e.episodesArticles.slice(0,3).map(({clause:n,part:s,number:r})=>et({clause:n,part:s,number:r})).sort((n,s)=>n.localeCompare(s)).join(", ")+(e.episodesArticles.length>3?", …":""):"";return l.useMemo(()=>{if(e?.id)return{to:e.isArchived?"/clients/archived":"/clients",data:{name:xo({lastName:e.clientInfo.lastName,firstName:e.clientInfo.firstName,middleName:e.clientInfo.middleName,isShort:!0}),episodesArticlesText:t,statusText:h.clients.clientStatuses?.[Y1(e.status)]?.toLowerCase()??""}}},[e?.id,e?.isArchived,e?.clientInfo?.lastName,e?.clientInfo?.firstName,e?.clientInfo?.middleName,e?.status,t])}function nne(e){const t=e?.id,n=Fe(),s=Pv(),r=bk(),i=e?.clientInfo?xo({lastName:e.clientInfo.lastName,firstName:e.clientInfo.firstName,middleName:e.clientInfo.middleName,isShort:!0}):h.client.navigation.CLIENT,o=l.useMemo(()=>{const c=n.pathname.split("/"),u=c[3],d=c[4];return(u==="cases"||u==="defense-strategy")&&d==="second-instance"?"second-instance":"first-instance"},[n.pathname]);return l.useMemo(()=>{if(!t)return[];const c=[{id:"fabula",to:`/clients/${t}/overview/fabula`,name:h.client.navigation.FABULA,end:!1},{id:"stage",to:`/clients/${t}/overview/stage`,name:h.client.navigation.STAGE,end:!1,children:[{id:"preInvestigationCheck",to:`/clients/${t}/overview/stage/pre-investigation-check`,name:h.client.stage.stages.PRE_INVESTIGATION_CHECK,end:!0},{id:"inquiry",to:`/clients/${t}/overview/stage/inquiry`,name:h.client.stage.stages.INQUIRY,end:!0},{id:"preliminaryInvestigation",to:`/clients/${t}/overview/stage/preliminary-investigation`,name:h.client.stage.stages.PRELIMINARY_INVESTIGATION,end:!0},{id:"courtFirstInstance",to:`/clients/${t}/overview/stage/court-first-instance`,name:h.client.stage.stages.COURT_FIRST_INSTANCE,end:!0},{id:"courtSecondInstance",to:`/clients/${t}/overview/stage/court-second-instance`,name:h.client.stage.stages.COURT_SECOND_INSTANCE,end:!0},{id:"courtThirdInstance",to:`/clients/${t}/overview/stage/court-third-instance`,name:h.client.stage.stages.COURT_THIRD_INSTANCE,end:!0},{id:"courtFinalInstance",to:`/clients/${t}/overview/stage/court-final-instance`,name:h.client.stage.stages.COURT_FINAL_INSTANCE,end:!0}]},{id:"participants",to:`/clients/${t}/overview/participants`,name:h.client.navigation.PARTICIPANTS,end:!1,redirectTo:`/clients/${t}/overview/participants/witnesses`,children:[{id:"witnesses",to:`/clients/${t}/overview/participants/witnesses`,name:h.client.navigation.WITNESSES,end:!0},{id:"victims",to:`/clients/${t}/overview/participants/victims`,name:h.client.navigation.VICTIMS,end:!0}]},{id:"circumstances",to:`/clients/${t}/overview/circumstances`,name:h.client.navigation.CIRCUMSTANCES,end:!1},{id:"evidence",to:`/clients/${t}/overview/evidence`,name:h.client.navigation.EVIDENCE,end:!1}];s||c.push({id:"defenseLines",to:`/clients/${t}/overview/defense-lines`,name:h.client.navigation.DEFENSE_LINES,end:!1});const u=[{id:"client",to:`/clients/${t}`,name:i,end:!0},{id:"overview",to:`/clients/${t}/overview`,name:h.client.navigation.OVERVIEW,end:!1,redirectTo:`/clients/${t}/overview/fabula`,children:c},{id:"cases",to:`/clients/${t}/cases/${o}`,name:h.client.navigation.CASES,end:!1,activePathBase:`/clients/${t}/cases`,children:[{id:"allCases",to:`/clients/${t}/cases/${o}`,name:h.client.navigation.ALL_CASES,end:!0},{id:"savedCases",to:`/clients/${t}/cases/${o}/saved`,name:h.client.navigation.SAVED_CASES,end:!0}]},{id:"defenseStrategy",to:`/clients/${t}/defense-strategy/${o}`,name:h.client.navigation.DEFENSE_STRATEGY,end:!1,activePathBase:`/clients/${t}/defense-strategy`},{id:"quotes",to:`/clients/${t}/quotes`,name:h.client.navigation.QUOTES,end:!1,activePathBase:`/clients/${t}/quotes`}];return r||u.push({id:"documents",to:`/clients/${t}/documents`,name:h.client.navigation.DOCUMENTS,end:!1,activePathBase:`/clients/${t}/documents`}),[{id:"root",to:`/clients/${t}`,name:h.client.navigation.CLIENT,end:!1,children:u}]},[t,i,o,s,r])}const sne=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_6014_22600)"},l.createElement("path",{d:"M3.3335 5H16.6668",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.3335 10H16.6668",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.3335 15H16.6668",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_6014_22600"},l.createElement("rect",{width:20,height:20,fill:"white"})))),rne=(e,t,n)=>{const s=Fe();return{activeParentPath:l.useMemo(()=>{const i=Yo(s.pathname,!0),o=t.has(i)?i:Yo(s.pathname,!1),c=t.get(o);if(!c)return;const u=n.get(c.id);if(!u)return;const d=n.get(u.id);if(d&&d.id!==e[0].id)return Yo(u.to,u.end)},[s.pathname,t,n,e])}},f7=e=>l.createElement("svg",{width:40,height:40,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M12.0003 12L28 28M12 28L27.9997 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),Ws=l.forwardRef(({onClose:e,closeRequestRef:t,children:n,isForceAnimateOnStart:s,contentRef:r,isMaxWidthDisabled:i},o)=>{const c=ck(),u=s??c==="PUSH",[d,p]=l.useState(!u),g=l.useRef(null),A=l.useRef(!1),E=Is(v=>v.registerModalDebugInfoBottomSheet),x=Is(v=>v.unregisterModalDebugInfoBottomSheet);l.useEffect(()=>{u&&requestAnimationFrame(()=>p(!0))},[u]),l.useEffect(()=>{d&&(A.current||(E(),A.current=!0))},[d,E]),l.useEffect(()=>()=>{A.current&&(x(),A.current=!1)},[x]);const y=l.useCallback(()=>
853{if(t?.current?.()!==!1){if(!d){e();return}A.current&&(x(),A.current=!1),p(!1)}},[t,d,e,x]);l.useImperativeHandle(o,()=>({close:y}),[y]);const I=l.useCallback(()=>{d||e()},[d,e]);return l.useEffect(()=>{const v=g.current;if(v)return v.addEventListener("transitionend",I),()=>{v.removeEventListener("transitionend",I)}},[I]),a.jsxs("div",{className:Y("fixed","overflow-hidden","flex","flex-col","justify-between","items-stretch","top-0","left-0","w-full","h-full","min-w-(--breakpoint-bp23_25)","z-20"),children:[a.jsx("div",{className:Y("cursor-pointer","absolute","top-0","left-0","w-full","h-full","bg-black","z-20","transition-opacity","duration-200","ease-out",!!d&&"opacity-88",!d&&"opacity-0"),onClick:y}),a.jsxs("div",{className:Y("relative","cursor-pointer","z-21","min-h-14","px-5","bp48:px-6","flex","justify-end","items-center","group","transition-opacity","duration-200","ease-out"),onClick:y,children:[a.jsx(ga,{className:Y("block","bp48:hidden","text-white","opacity-32","group-hover:opacity-64")}),a.jsx(f7,{className:Y("hidden","bp48:block","text-white","opacity-32","group-hover:opacity-64")})]}),a.jsxs("div",{ref:g,className:Y("relative","z-21","flex-1","flex","flex-col","justify-start","items-stretch","bg-white","rounded-tl-[16px]","rounded-tr-[16px]","transition-transform","duration-200","ease-out","overflow-y-hidden",!!d&&"translate-y-0",!d&&"translate-y-full"),children:[a.jsx("div",{className:Y("min-h-4")}),a.jsx("div",{className:Y(!i&&"bp48:max-w-360","bp48:w-full","bp48:mx-auto","bp48:px-4","flex","flex-col","flex-1","overflow-y-auto"),ref:r,children:n})]})]})}),ine=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M3.5 0.999999L9.5 6.00664L3.5 11L5 6.00664L3.5 0.999999Z",fill:"currentColor"})),MI=({link:e})=>{const n=Fe().state?.clientData,s=sn(o=>o.setIsMenuOpen),r=sn(o=>o.setOpenMenuSelectedPath),i=l.useCallback(o=>{if(e.end){s(!1);return}o.preventDefault(),r(Yo(e.to,e.end))},[e.to,e.end,s,r]);return a.jsxs(Je,{to:e.to,end:e.end,className:({isActive:o})=>Y("roboto-flex-64-600-0","text-[14px]","leading-[20px]","text-zinc-500","pr-4","py-2.5","flex","items-center",!o&&Y("pl-4","hover:bg-zinc-50"),!!o&&Y("pl-3.5","border-l-2","border-black","bg-zinc-50")),onClick:i,state:{clientData:n},children:[e.name,!!e.children&&a.jsx(ine,{className:"text-zinc-400 h-3 w-3 ml-1.5"})]})},one=({link:e})=>{const n=Fe().state?.clientData,s=sn(i=>i.setIsMenuOpen),r=l.useCallback(()=>{s(!1)},[s]);return e.end?a.jsxs(a.Fragment,{children:[a.jsx(Je,{to:e.to,end:e.end,className:({isActive:i})=>Y("block","w-full","roboto-flex-25-700-1","text-[16px]","leading-[16px]","uppercase","text-zinc-950","pr-4","py-3.5",!i&&Y("pl-4","hover:bg-zinc-50"),!!i&&Y("pl-3.5","border-l-2","border-black","bg-zinc-50")),state:{clientData:n},onClick:r,children:e.name}),!!e.children&&e.children.map(i=>a.jsx(MI,{link:i},i.id))]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[16px]","leading-[16px]","uppercase","text-zinc-950","px-4","py-3.5"),children:e.name}),!!e.children&&e.children.map(i=>a.jsx(MI,{link:i},i.id))]})},ane=({link:e,linksTree:t})=>{const s=Fe().state?.clientData,r=sn(o=>o.setOpenMenuSelectedPath),i=l.useCallback(o=>{if(o.preventDefault(),!!e.grandParent){if(e.grandParent.id===t[0].id){r(null);return}r(Yo(e.grandParent.to,e.grandParent.end))}},[e.grandParent,t,r]);return a.jsxs(Je,{to:e.grandParent?e.grandParent.to:e.to,className:Y("flex","justify-start","items-center","roboto-flex-25-700-1","text-[16px]","leading-[16px]","uppercase","text-zinc-950","hover:bg-zinc-50"),onClick:i,state:{clientData:s},children:[a.jsx("div",{className:"pl-4 pr-5 py-4",children:a.jsx(nE,{className:"size-4 text-zinc-400"})}),a.jsx("div",{className:"py-4",children:e.name})]})},lne=(e,t)=>{const n=sn(r=>r.openMenuSelectedPath);return{selectedItem:l.useMemo(()=>{if(!n)return;const r=e.get(n);if(!r)return;const i=t.get(r.id),o=i?t.get(i.id):void 0;return{...r,parent:i,grandParent:o}},[e,t,n])}},cne=({linksTree:e,nodeMap:t,parentMap:n})=>{const s=sn(p=>p.isMenuOpen),r=sn(p=>p.setIsMenuOpen),i=l.useCallback(()=>{r(!1)},[r]),o=e?.[0]?.children,{selectedItem:c}=lne(t,n),u=l.useMemo(()=>!o||c?null:o.map(p=>a.jsx(one,{link:p},p.id)),[o,c]),d=l.useMemo(()=>!c||!c.children?null:a.jsxs(a.Fragment,{children:[a.jsx(ane,{link:c,linksTree:e}),c.children.map(p=>a.jsx(MI,{link:p},p.id))]}),[c,e]);return!s||!u&&!d?null:a.jsxs(Ws,{onClose:i,children:[d,u]})},une=({linksTree:e})=>{const t=sn(r=>r.setIsSearchOpen),n=sn(r=>
853r.isSearchOpen),s=l.useCallback(()=>{t(!1)},[t]);return n?a.jsx(Ws,{onClose:s,children:a.jsx("div",{children:"Search"})}):null},dne=({linksTree:e,nodeMap:t,parentMap:n})=>{const s=sn(x=>x.setIsMenuOpen),r=sn(x=>x.setOpenMenuSelectedPath),o=Fe().pathname,c=Yo(o,!0),u=t.has(c)?c:Yo(o,!1),{activeParentPath:d}=rne(e,t,n),p=l.useCallback(()=>{s(!0),r(d??null)},[d,s,r]),g=t.get(u),A=g?n.get(g.id):void 0,E=A?n.get(A.id):void 0;return a.jsxs(a.Fragment,{children:[a.jsx(cne,{linksTree:e,nodeMap:t,parentMap:n}),a.jsx(une,{linksTree:e}),a.jsx("div",{className:Y("flex","justify-between","items-center","bp48:hidden","sticky","bottom-0","left-0","w-full","bg-zinc-50"),onClick:p,children:a.jsxs("div",{className:Y("flex","flex-1","h-12","items-center","group","pl-4","cursor-pointer"),children:[a.jsx(sne,{className:Y("text-zinc-400","group-hover:text-zinc-500")}),a.jsxs("div",{className:Y("ml-2","roboto-flex-25-700-1","text-[16px]","leading-[16px]","uppercase","text-zinc-400","group-hover:text-zinc-500","whitespace-nowrap"),children:[!!(E?.name&&E.id!==e[0].id)&&a.jsxs(a.Fragment,{children:[E?.name,a.jsx("span",{className:"text-zinc-400 mx-1.5",children:"/"})]}),!!(A?.name&&A.id!==e[0].id)&&a.jsxs(a.Fragment,{children:[A?.name,a.jsx("span",{className:"text-zinc-400 mx-1.5",children:"/"})]}),g?.name]})]})})]})},fne=e=>{const{nodeMap:t,parentMap:n}=l.useMemo(()=>{const s=new Map,r=new Map,i=(o,c)=>{for(const u of o){const d=Yo(u.to,u.end);u.children&&i(u.children,u),s.set(d,u),c&&!r.has(u.id)&&r.set(u.id,c)}};return i(e),{nodeMap:s,parentMap:r}},[e]);return{nodeMap:t,parentMap:n}},Fu=()=>{const{setIsOpen:e,setObjectToFabulize:t}=o7(),n=l.useCallback(({clientId:r,to:i,breadcrumbsNames:o,type:c,id:u})=>{e(r,!0),t(r,{to:i,breadcrumbsNames:o,type:c,id:u})},[e,t]),s=l.useCallback(({clientId:r})=>{e(r,!1)},[e]);return{openFabulizer:n,hideFabulizer:s}},oE=rt(async function({clientId:t,text:n,resourceType:s,resourceId:r,parentRunId:i,isAutoCommit:o,signal:c}){const u=Se.getState().accessToken,d=Ke(`/fabulizer/${t}/start/`),p=await qe(d,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify({text:n,resourceType:s,resourceId:r,parentRunId:i,autoCommit:o}),signal:c}),g=await Ye(p);if(He(g))throw{httpCode:503,errorData:g.error};if(g.status==="error")throw{httpCode:p.status,errorData:g.error};if(!g.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return{}}),d2=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/fabulizer/${t}/cancel/`),i=await qe(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};if(!o.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return{}}),pne=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=await qe(Ke(`/fabulizer/${t}/history/`),{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};return i.data??[]}),jI=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=await qe(Ke(`/fabulizer/${t}/state/`),{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};return i.data}),hne=rt(async function({clientId:t,clientInfo:n,witness:s,victim:r,episodes:i,courtFirstInstance:o,courtSecondInstance:c,courtThirdInstance:u,courtFinalInstance:d,preInvestigationCheck:p,preliminaryInvestigation:g,inquiry:A,signal:E}){const x=Se.getState().accessToken,y=Ke(`/fabulizer/${t}/commit/`),I=await qe(y,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${x}`},signal:E,body:JSON.stringify({clientInfo:n,witness:s,victim:r,episodes:i,courtFirstInstance:o,courtSecondInstance:c,courtThirdInstance:u,courtFinalInstance:d,preInvestigationCheck:p,preliminaryInvestigation:g,inquiry:A})}),v=await Ye(I);if(He(v))throw{httpCode:503,errorData:v.error};if(v.status==="error")throw{httpCode:I.status,errorData:v.error};if(!v.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return v.data}),mne=({clientId:e,textareaRef:t,mountedRef:n,initFabulizerStateMutation:s})=>{const r=l.useRef(null),i=l.useRef(null),{status:o,objectToFabulize:c,text:u,statusPrevious:d,setStatus:p,setStatusPrevious:g,setIsAutoCommit:A,setExternalData:E,setCommitData:x}=wt({clientId:e}),{mutate:y}=tt({mutationFn:oE,onMutate:()=>{i.current||(i.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:()=>{n.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),g(null))},onError:v=>{n.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),d&&p(d),g(null),ve({type:"failed",message:h.client.fabulizer.errors.START_FAILED,key:"FABULIZER_START_FAILED"}),v.code==="ALREADY_STARTED"&&e&&s({clientId:e}))}}),I=l.useCallback(()=>
853{if(d||o!=="notStarted"||!c?.type||!e)return;if(!u.length){ve({type:"failed",message:h.client.fabulizer.errors.TEXT_REQUIRED,key:"FABULIZER_TEXT_REQUIRED"}),t.current?.focus();return}r.current?.abort();const v=new AbortController;r.current=v,E(null),x(()=>null),p("pending"),g(o),A(!1),y({clientId:e,text:u,resourceType:c.type,resourceId:c?.id,signal:v.signal,isAutoCommit:!1})},[c?.type,c?.id,u,o,e,d,y,r,t,p,g,A,E,x]);return l.useEffect(()=>()=>{i.current&&clearTimeout(i.current),r.current?.abort()},[]),{startFabulizer:I}},gne=({clientId:e,timeoutPollRef:t,pollCountRef:n,mountedRef:s,pollControllerRef:r})=>{const i=l.useRef(null),o=l.useRef(null),{status:c,statusPrevious:u,setStatus:d,setStatusPrevious:p,setExternalData:g,setCommitData:A}=wt({clientId:e}),{mutate:E}=tt({mutationFn:d2,onMutate:()=>{i.current||(i.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:()=>{s.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),g(null),A(()=>null),p(null))},onError:y=>{s.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),y.code==="NOT_STARTED"&&(u&&d(u),p(null),ve({type:"failed",message:h.client.fabulizer.errors.CANCEL_FAILED,key:"FABULIZER_CANCEL_FAILED"})))}}),x=l.useCallback(()=>{if(u||!["pending","awaitingChoice","autoCommitted","error"].includes(c)||!e)return;t.current&&clearTimeout(t.current),n.current=0,r.current?.abort(),o.current?.abort();const y=new AbortController;o.current=y,d("notStarted"),p(c),E({clientId:e,signal:y.signal})},[c,u,e,E,r,n,t,d,p]);return l.useEffect(()=>()=>{i.current&&clearTimeout(i.current),o.current?.abort()},[]),{cancelFabulizer:x}},Ane=({clientId:e,timeoutPollRef:t,mountedRef:n,pollCountRef:s,pollControllerRef:r})=>{const i=l.useRef(null),o=l.useRef(null),{status:c,statusPrevious:u,setStatus:d,setStatusPrevious:p,setIsOpen:g,setExternalData:A,setCommitData:E}=wt({clientId:e}),{mutate:x}=tt({mutationFn:d2,onMutate:()=>{i.current||(i.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:()=>{n.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),A(null),E(()=>null),p(null))},onError:I=>{n.current&&(i.current&&clearTimeout(i.current),Ze("FABULIZER_SLOW"),I.code==="NOT_STARTED"&&(u&&d(u),p(null),g(!0,!0),ve({type:"failed",message:h.client.fabulizer.errors.CANCEL_FAILED,key:"FABULIZER_CANCEL_FAILED"})))}}),y=l.useCallback(()=>{if(u||!["error","autoCommitted"].includes(c)||!e)return;t.current&&clearTimeout(t.current),s.current=0,r.current?.abort(),o.current?.abort();const I=new AbortController;o.current=I,d("notStarted"),p(c),g(!1),x({clientId:e,signal:I.signal})},[c,u,e,x,r,s,t,d,p,g]);return l.useEffect(()=>()=>{i.current&&clearTimeout(i.current),o.current?.abort()},[]),{cancelAndCloseFabulizer:y}},Ene=({clientId:e,timeoutPollRef:t,mountedRef:n,pollCountRef:s,pollControllerRef:r,initFabulizerStateMutation:i})=>{const o=l.useRef(null),c=l.useRef(null),u=l.useRef(null),{status:d,objectToFabulize:p,isAutoCommit:g,text:A,statusPrevious:E,setStatus:x,setStatusPrevious:y,setIsOpen:I,setExternalData:v,setCommitData:S}=wt({clientId:e}),{mutate:b}=tt({mutationFn:oE,onMutate:()=>{o.current||(o.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:()=>{n.current&&(o.current&&clearTimeout(o.current),Ze("FABULIZER_SLOW"),y(null))},onError:N=>{n.current&&(o.current&&clearTimeout(o.current),Ze("FABULIZER_SLOW"),E&&x(E),y(null),ve({type:"failed",message:h.client.fabulizer.errors.START_FAILED,key:"FABULIZER_START_FAILED"}),N.code==="ALREADY_STARTED"&&e&&i({clientId:e}))}}),{mutate:w}=tt({mutationFn:d2,onMutate:()=>{o.current||(o.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:()=>{if(!n.current||!e||!p?.type)return;u.current?.abort();const N=new AbortController;u.current=N,o.current&&clearTimeout(o.current),Ze("FABULIZER_SLOW"),y("notStarted"),b({clientId:e,text:A,resourceType:p.type,resourceId:p.id,signal:N.signal,isAutoCommit:g})},onError:N=>{if(n.current){if(o.current&&clearTimeout(o.current),Ze("FABULIZER_SLOW"),N.code!=="NOT_STARTED"){if(!e||!p?.type)return;u.current?.abort();const R=new AbortController;u.current=R,o.current&&clearTimeout(o.current),Ze("FABULIZER_SLOW"),y("notStarted"),b({clientId:e,text:A,resourceType:p.type,resourceId:p.id,signal:R.signal,isAutoCommit:g});return}E&&x(E),y(null),I(!0,!0),ve({type:"failed",message:h.client.fabulizer.errors.CANCEL_FAILED,key:"FABULIZER_CANCEL_FAILED"})}}}),_=l.useCallback(()=>
853{if(E||d!=="error"||!e)return;t.current&&clearTimeout(t.current),s.current=0,r.current?.abort(),c.current?.abort();const N=new AbortController;c.current=N,v(null),S(()=>null),x("pending"),y(d),w({clientId:e,signal:N.signal})},[d,E,e,w,t,s,r,x,y,v,S]);return l.useEffect(()=>()=>{o.current&&clearTimeout(o.current),c.current?.abort(),u.current?.abort()},[]),{cancelAndStartFabulizer:_}},xne=({clientId:e,mountedRef:t})=>{const n=l.useRef(null),s=l.useRef(null),r=bt(),{status:i,statusPrevious:o,commitData:c,setIsOpen:u,setStatus:d,setStatusPrevious:p,setExternalData:g,setCommitData:A}=wt({clientId:e}),{mutate:E,isPending:x}=tt({mutationFn:hne,onMutate:()=>{n.current||(n.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"FABULIZER_SLOW",duration:0})},3e3))},onSuccess:(I,v)=>{if(!t.current||(n.current&&clearTimeout(n.current),Ze("FABULIZER_SLOW"),!e))return;if(r.invalidateQueries({queryKey:["client",e]}),r.invalidateQueries({queryKey:["strategies","first-instance",e]}),r.invalidateQueries({queryKey:["strategies","second-instance",e]}),r.invalidateQueries({queryKey:["cases","first-instance",e]}),r.invalidateQueries({queryKey:["cases","second-instance",e]}),r.invalidateQueries({queryKey:["casesFilters",e]}),v.episodes!==void 0&&v.episodes.length>0){const _=d7({queryClient:r,clientId:e});Object.keys(_).length>0&&su.getState().markDefenseTreeRefreshBaselines({clientId:e,baselinesByDefenseLineId:_})}r.setQueryData(["client",e],_=>{if(!_||!I)return _;if("clientInfo"in I)return{..._,clientInfo:I.clientInfo,updatedAt:I.updatedAt??_.updatedAt};if("witness"in I){const N=I.witness,R=_.witnesses?.some(k=>k.id===N.id)?_.witnesses.map(k=>k.id===N.id?N:k):[..._.witnesses??[],N];return{..._,witnesses:R,updatedAt:I.updatedAt??_.updatedAt}}if("victim"in I){const N=I.victim,R=_.victims?.some(k=>k.id===N.id)?_.victims.map(k=>k.id===N.id?N:k):[..._.victims??[],N];return{..._,victims:R,updatedAt:I.updatedAt??_.updatedAt}}return"episodes"in I?{..._,episodes:I.episodes,updatedAt:I.updatedAt??_.updatedAt}:"courtFirstInstance"in I?{..._,phases:{..._.phases,courtFirstInstance:I.courtFirstInstance},updatedAt:I.updatedAt??_.updatedAt}:"courtSecondInstance"in I?{..._,phases:{..._.phases,courtSecondInstance:I.courtSecondInstance},updatedAt:I.updatedAt??_.updatedAt}:"courtThirdInstance"in I?{..._,phases:{..._.phases,courtThirdInstance:I.courtThirdInstance},updatedAt:I.updatedAt??_.updatedAt}:"courtFinalInstance"in I?{..._,phases:{..._.phases,courtFinalInstance:I.courtFinalInstance},updatedAt:I.updatedAt??_.updatedAt}:"preInvestigationCheck"in I?{..._,phases:{..._.phases,preInvestigationCheck:I.preInvestigationCheck},updatedAt:I.updatedAt??_.updatedAt}:"preliminaryInvestigation"in I?{..._,phases:{..._.phases,preliminaryInvestigation:I.preliminaryInvestigation},updatedAt:I.updatedAt??_.updatedAt}:"inquiry"in I?{..._,phases:{..._.phases,inquiry:I.inquiry},updatedAt:I.updatedAt??_.updatedAt}:_});const b=()=>{requestAnimationFrame(()=>{g(null),A(()=>null),d("notStarted"),p(null)})};if(!I.updatedAt){b();return}const w=({attemptIndex:_=0,maxAttempts:N=10})=>{if(r.getQueryData(["client",e])?.updatedAt===I.updatedAt){b();return}if(_>=N){b();return}requestAnimationFrame(()=>w({attemptIndex:_+1,maxAttempts:N}))};requestAnimationFrame(()=>w({attemptIndex:0,maxAttempts:10}))},onError:()=>{t.current&&(n.current&&clearTimeout(n.current),Ze("FABULIZER_SLOW"),u(!0),o&&d(o),p(null),ve({type:"failed",message:h.client.fabulizer.errors.COMMIT_FAILED,key:"FABULIZER_COMMIT_FAILED"}))}}),y=l.useCallback(()=>{if(o||i!=="awaitingChoice"&&i!=="autoCommitted"||!e)return;u(!1),p(i),s.current?.abort();const I=new AbortController;s.current=I,E({clientId:e,signal:I.signal,clientInfo:c?.clientInfo,witness:c?.witness,victim:c?.victim,episodes:c?.episodes,courtFirstInstance:c?.courtFirstInstance,courtSecondInstance:c?.courtSecondInstance,courtThirdInstance:c?.courtThirdInstance,courtFinalInstance:c?.courtFinalInstance,preInvestigationCheck:c?.preInvestigationCheck,preliminaryInvestigation:c?.preliminaryInvestigation,inquiry:c?.inquiry})},[i,o,p,e,c,E,u]);return l.useEffect(()=>()=>{n.current&&clearTimeout(n.current),s.current?.abort()},[]),{commitFabulizer:y,isCommitPending:x}},os="episodes",Cne=({clientId:e,textareaRef:t})=>{const n=l.useRef(0),s=l.useRef(null),r=l.useRef(!1),i=Sm(),o=l.useRef(null),{isFabulizerReady:c,status:u,statusPrevious:d,setIsFabulizerReady:p,setStatus:g,setStatusPrevious:A,setObjectToFabulize:E,setText:x,setIsOpen:y,setExternalData:I,setCommitData:v,setIsAutoCommit:S}=wt({clientId:e}),b=l.useCallback((Q,M,K)=>{if(!Q?.externalData||!Q?.localData)return;const W=M.reduce((G,$)=>G&&typeof G=="object"?G[$]:void 0,Q.localData),H=M.reduce((G,$)=>G&&typeof G=="object"?G[$]:void 0,Q.externalData),j=K==="string"?!H?.trim():K==="number"?H==null||isNaN(H):H==null,q=K==="string"?!W?.trim():K==="number"?W==null||isNaN(W):W==null;if(!j&&q)return"external"},[]),w=l.useCallback((Q,M)=>
853{if(!Q?.externalData)return[];const K=M.reduce((W,H)=>W&&typeof W=="object"?W[H]:void 0,Q.externalData);return K?K.map(W=>W.id):[]},[]),_=l.useCallback((Q,M)=>Q==="client_info"?{clientInfo:{firstName:b(M,["firstName"],"string"),lastName:b(M,["lastName"],"string"),middleName:b(M,["middleName"],"string"),gender:b(M,["gender"],"string"),citizenship:b(M,["citizenship"],"string"),dateOfBirth:b(M,["dateOfBirth"],"string"),ageStatus:b(M,["ageStatus"],"string"),ageStatusGroup:b(M,["ageStatusGroup"],"string"),maritalStatus:b(M,["maritalStatus"],"string"),children:b(M,["children"],"boolean"),education:b(M,["education"],"string"),isMilitary:b(M,["isMilitary"],"boolean"),isActiveMilitary:b(M,["isActiveMilitary"],"boolean"),occupation:b(M,["occupation"],"string"),mentalHealth:b(M,["mentalHealth"],"string"),physicalHealth:b(M,["physicalHealth"],"string"),criminalStatus:b(M,["criminalStatus"],"string"),characteristicsDescription:b(M,["characteristicsDescription"],"string"),characteristicsSource:b(M,["characteristicsSource"],"string"),isSpecialSubject:b(M,["isSpecialSubject"],"boolean"),specialSubjectType:b(M,["specialSubjectType"],"string"),specialSubjectDescription:b(M,["specialSubjectDescription"],"string"),contacts:w(M,["contacts"]),criminalRecords:w(M,["criminalRecords"])}}:Q==="witness"?{witness:{lastName:b(M,["lastName"],"string"),firstName:b(M,["firstName"],"string"),middleName:b(M,["middleName"],"string"),dateOfBirth:b(M,["dateOfBirth"],"string"),gender:b(M,["gender"],"string"),ageStatus:b(M,["ageStatus"],"string"),relationToClient:b(M,["relationToClient"],"string"),testimonyStage:b(M,["testimonyStage"],"string"),contacts:w(M,["contacts"])}}:Q==="victim"?{victim:{lastName:b(M,["lastName"],"string"),firstName:b(M,["firstName"],"string"),middleName:b(M,["middleName"],"string"),dateOfBirth:b(M,["dateOfBirth"],"string"),gender:b(M,["gender"],"string"),ageStatus:b(M,["ageStatus"],"string"),relationToClient:b(M,["relationToClient"],"string"),contacts:w(M,["contacts"])}}:Q===os?{episodes:w(M,[])}:Q==="court_first_instance"?{courtFirstInstance:{caseNumber:b(M,["caseNumber"],"string"),courtName:b(M,["courtName"],"string"),judgeLastName:b(M,["judgeLastName"],"string"),judgeFirstName:b(M,["judgeFirstName"],"string"),judgeMiddleName:b(M,["judgeMiddleName"],"string"),prosecutorLastName:b(M,["prosecutorLastName"],"string"),prosecutorFirstName:b(M,["prosecutorFirstName"],"string"),prosecutorMiddleName:b(M,["prosecutorMiddleName"],"string"),conclusionDescription:b(M,["conclusionDescription"],"string"),measureStartDate:b(M,["measureStartDate"],"string"),measureEndDate:b(M,["measureEndDate"],"string"),penitentiaryType:b(M,["penitentiaryType"],"string"),punishmentType:b(M,["punishmentType"],"string"),punishmentDuration:b(M,["punishmentDuration"],"number"),preTrialMeasures:w(M,["preTrialMeasures"]),sessions:w(M,["sessions"]),felonies:w(M,["felonies"])}}:Q==="court_second_instance"?{courtSecondInstance:{appealCourtName:b(M,["a
853ppealCourtName"],"string"),judgeLastName:b(M,["judgeLastName"],"string"),judgeFirstName:b(M,["judgeFirstName"],"string"),judgeMiddleName:b(M,["judgeFirstName"],"string"),applicantLastName:b(M,["applicantLastName"],"string"),applicantFirstName:b(M,["applicantFirstName"],"string"),applicantMiddleName:b(M,["applicantMiddleName"],"string"),applicantCategory:b(M,["applicantCategory"],"string"),applicationDate:b(M,["applicationDate"],"string"),appealGoal:b(M,["appealGoal"],"string"),appealPleaStatus:b(M,["appealPleaStatus"],"string"),appealPleaDetails:b(M,["appealPleaDetails"],"string"),appealDocuments:b(M,["appealDocuments"],"string"),appealGrounds:b(M,["appealGrounds"],"string"),requestGoal:b(M,["requestGoal"],"string"),requestResult:b(M,["requestResult"],"string"),requestArgumentDescription:b(M,["requestArgumentDescription"],"string"),requestArgumentConfirmationStatus:b(M,["requestArgumentConfirmationStatus"],"string"),requestArgumentLegalBasis:b(M,["requestArgumentLegalBasis"],"string"),requestArgumentGoal:b(M,["requestArgumentGoal"],"string"),requestArgumentResult:b(M,["requestArgumentResult"],"string"),oppositeRequestGoal:b(M,["oppositeRequestGoal"],"string"),oppositeRequestResult:b(M,["oppositeRequestResult"],"string"),oppositeRequestArgumentDescription:b(M,["oppositeRequestArgumentDescription"],"string"),oppositeRequestArgumentConfirmationStatus:b(M,["oppositeRequestArgumentConfirmationStatus"],"string"),oppositeRequestArgumentLegalBasis:b(M,["oppositeRequestArgumentLegalBasis"],"string"),oppositeRequestArgumentGoal:b(M,["oppositeRequestArgumentGoal"],"string"),oppositeRequestArgumentResult:b(M,["oppositeRequestArgumentResult"],"string"),isConvicted:b(M,["isConvicted"],"boolean"),punishmentDescription:b(M,["punishmentDescription"],"string"),punishmentType:b(M,["punishmentType"],"string"),punishmentAppealDate:b(M,["punishmentAppealDate"],"string"),isFinalSentencing:b(M,["isFinalSentencing"],"boolean"),punishmentDuration:b(M,["punishmentDuration"],"number"),measureStartDate:b(M,["measureStartDate"],"string"),measureEndDate:b(M,["measureEndDate"],"string"),penitentiaryType:b(M,["penitentiaryType"],"string"),sessions:w(M,["sessions"]),felonies:w(M,["felonies"])}}:Q==="court_third_instance"?{courtThirdInstance:{cassationCourtName:b(M,["cassationCourtName"],"string"),judgeLastName:b(M,["judgeLastName"],"string"),judgeFirstName:b(M,["judgeFirstName"],"string"),judgeMiddleName:b(M,["judgeMiddleName"],"string"),applicantLastName:b(M,["a
853pplicantLastName"],"string"),applicantFirstName:b(M,["applicantFirstName"],"string"),applicantMiddleName:b(M,["applicantMiddleName"],"string"),applicantCategory:b(M,["applicantCategory"],"string"),applicationDate:b(M,["applicationDate"],"string"),cassationGoal:b(M,["cassationGoal"],"string"),cassationPleaStatus:b(M,["cassationPleaStatus"],"string"),cassationPleaDetails:b(M,["cassationPleaDetails"],"string"),cassationDocuments:b(M,["cassationDocuments"],"string"),cassationGrounds:b(M,["cassationGrounds"],"string"),requestGoal:b(M,["requestGoal"],"string"),requestResult:b(M,["requestResult"],"string"),requestArgumentDescription:b(M,["requestArgumentDescription"],"string"),requestArgumentConfirmationStatus:b(M,["requestArgumentConfirmationStatus"],"string"),requestArgumentLegalBasis:b(M,["requestArgumentLegalBasis"],"string"),requestArgumentGoal:b(M,["requestArgumentGoal"],"string"),requestArgumentResult:b(M,["requestArgumentResult"],"string"),oppositeRequestGoal:b(M,["oppositeRequestGoal"],"string"),oppositeRequestResult:b(M,["oppositeRequestResult"],"string"),oppositeRequestArgumentDescription:b(M,["oppositeRequestArgumentDescription"],"string"),oppositeRequestArgumentConfirmationStatus:b(M,["oppositeRequestArgumentConfirmationStatus"],"string"),oppositeRequestArgumentLegalBasis:b(M,["oppositeRequestArgumentLegalBasis"],"string"),oppositeRequestArgumentGoal:b(M,["oppositeRequestArgumentGoal"],"string"),oppositeRequestArgumentResult:b(M,["oppositeRequestArgumentResult"],"string"),cassationSatisfactionStatus:b(M,["cassationSatisfactionStatus"],"string"),cassationResult:b(M,["cassationResult"],"string"),cassationResultMotives:b(M,["cassationResultMotives"],"string"),cassationDescription:b(M,["cassationDescription"],"string"),sessions:w(M,["sessions"]),felonies:w(M,["felonies"])}}:Q==="court_final_instance"?{courtFinalInstance:{}}:Q==="pre_investigation_check"?{preInvestigationCheck:{crimeReportRegistryNumber:b(M,["crimeReportRegistryNumber"],"string"),criminalCaseOpeningDate:b(M,["criminalCaseOpeningDate"],"string"),applicantLastName:b(M,["a
853pplicantLastName"],"string"),applicantFirstName:b(M,["applicantFirstName"],"string"),applicantMiddleName:b(M,["applicantMiddleName"],"string"),applicantDateOfBirth:b(M,["applicantDateOfBirth"],"string"),applicantPhone:b(M,["applicantPhone"],"string"),applicantEmail:b(M,["applicantEmail"],"string"),applicantAddress:b(M,["applicantAddress"],"string"),applicantGender:b(M,["applicantGender"],"string"),applicantAgeStatus:b(M,["applicantAgeStatus"],"string"),applicantRelationToClient:b(M,["applicantRelationToClient"],"string"),investigatorLastName:b(M,["investigatorLastName"],"string"),investigatorFirstName:b(M,["investigatorFirstName"],"string"),investigatorMiddleName:b(M,["investigatorMiddleName"],"string"),investigatorPosition:b(M,["investigatorPosition"],"string"),investigatorRank:b(M,["investigatorRank"],"string"),investigatorDepartment:b(M,["investigatorDepartment"],"string"),result:b(M,["result"],"string")}}:Q==="preliminary_investigation"?{preliminaryInvestigation:{caseNumber:b(M,["caseNumber"],"string"),criminalCaseOpeningDate:b(M,["criminalCaseOpeningDate"],"string"),investigatorLastName:b(M,["investigatorLastName"],"string"),investigatorFirstName:b(M,["investigatorFirstName"],"string"),investigatorMiddleName:b(M,["investigatorMiddleName"],"string"),investigatorPosition:b(M,["investigatorPosition"],"string"),investigatorRank:b(M,["investigatorRank"],"string"),investigatorDepartment:b(M,["investigatorDepartment"],"string"),result:b(M,["result"],"string")}}:Q==="inquiry"?{inquiry:{caseNumber:b(M,["caseNumber"],"string"),criminalCaseOpeningDate:b(M,["criminalCaseOpeningDate"],"string"),result:b(M,["result"],"string"),investigatorLastName:b(M,["investigatorLastName"],"string"),investigatorFirstName:b(M,["investigatorFirstName"],"string"),investigatorMiddleName:b(M,["investigatorMiddleName"],"string"),investigatorPosition:b(M,["investigatorPosition"],"string"),investigatorRank:b(M,["investigatorRank"],"string"),investigatorDepartment:b(M,["investigatorDepartment"],"string")}}:{},[b,w]),N=l.useCallback((Q,M)=>{if(!e||!M)return;const K=Q===os?Array.isArray(M.externalData)?M.externalData.filter(j=>!!j?.id):[]:M.externalData;I(K);const W=_(Q,{...M,externalData:K});v(W)},[e,_,I,v]),{mutate:R}=tt({mutationFn:jI,onSuccess:Q=>{if(r.current&&!c){switch(Q.resourceType){case"client_info":E({to:`/clients/${e}`,breadcrumbsNames:[h.client.navigation.CLIENT],type:"client_info"});break;case"witness":E({to:`/clients/${e}/overview/participants/witnesses`,breadcrumbsNames:[xo({lastName:Q.localData?.lastName,firstName:Q.localData?.firstName,middleName:Q.localData?.middleName,placeholder:h.client.participants.witnesses.placeholders.NEW_WITNESS,isShort:!0})],type:"witness",id:Q.localData?.id});break;case"victim":E({to:`/clients/${e}/overview/participants/victims`,breadcrumbsNames:[xo({lastName:Q.localData?.lastName,firstName:Q.localData?.firstName,middleName:Q.localData?.middleName,placeholder:h.client.participants.victims.placeholders.NEW_VICTIM,isShort:!0})],type:"victim",id:Q.localData?.id});break;case os:E({to:`/clients/${e}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os});break;case"court_first_instance":E({to:`/clients/${e}/overview/stage/court-first-instance`,breadcrumbsNames:[h.client.stage.stages.COURT_FIRST_INSTANCE],type:"court_first_instance"});break;case"court_second_instance":E({to:`/clients/${e}/overview/stage/court-second-instance`,breadcrumbsNames:[h.client.stage.stages.COURT_SECOND_INSTANCE],type:"court_second_instance"});break;case"court_third_instance":E({to:`/clients/${e}/overview/stage/court-third-instance`,breadcrumbsNames:[h.client.stage.stages.COURT_THIRD_INSTANCE],type:"court_third_instance"});break;case"court_final_instance":E({to:`/clients/${e}/overview/stage/court-final-instance`,breadcrumbsNames:[h.client.stage.stages.COURT_FINAL_INSTANCE],type:"court_final_instance"});break;case"pre_investigation_check":E({to:`/clients/${e}/overview/stage/pre-investigation-check`,breadcrumbsNames:[h.client.stage.stages.PRE_INVESTIGATION_CHECK],type:"pre_investigation_check"});break;case"preliminary_investigation":E({to:`/clients/${e}/overview/stage/preliminary-investigation`,breadcrumbsNames:[h.client.stage.stages.PRELIMINARY_INVESTIGATION],type:"preliminary_investigation"});break;case"inquiry":E({to:`/clients/${e}/overview/stage/inquiry`,breadcrumbsNames:[h.client.stage.stages.INQUIRY],type:"inquiry"});break}g(Q.status),S(Q.autoCommit),A(null),p(!0),y(!0,!0),x(Q.text),Q.status==="awaitingChoice"&&N(Q.resourceType,Q)}},onError:Q=>{r.current&&Q.code==="NOT_STARTED"&&(c||(I(null),v(()=>null),g("notStarted"),A(null),p(!0)))}}),D=l.useCallback(()=>{n.current=n.current+1;const Q=Math.round((Math.random()*2-1)*1e3*.2);
853return n.current<=15?1e3+Q:Math.min((n.current-14)*1e3,1e4)+Q},[]),k=l.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),{mutate:L}=tt({mutationFn:jI,onMutate:()=>{k()},onSuccess:Q=>{if(r.current&&c){if(k(),Q.status==="pending"){if(!e)return;s.current||(s.current=setTimeout(()=>{o.current?.abort();const M=new AbortController;o.current=M,L({clientId:e,signal:M.signal})},D()));return}g(Q.status),S(Q.autoCommit),A(null),Q.status==="awaitingChoice"&&N(Q.resourceType,Q)}},onError:Q=>{r.current&&c&&Q.code==="NOT_STARTED"&&(I(null),v(()=>null),g("notStarted"),A(null))}}),{startFabulizer:O}=mne({clientId:e,textareaRef:t,mountedRef:r,initFabulizerStateMutation:R}),{cancelFabulizer:P}=gne({clientId:e,timeoutPollRef:s,pollCountRef:n,mountedRef:r,pollControllerRef:o}),{cancelAndCloseFabulizer:B}=Ane({clientId:e,timeoutPollRef:s,mountedRef:r,pollCountRef:n,pollControllerRef:o}),{cancelAndStartFabulizer:F}=Ene({clientId:e,timeoutPollRef:s,mountedRef:r,pollCountRef:n,pollControllerRef:o,initFabulizerStateMutation:R}),{commitFabulizer:z}=xne({clientId:e,mountedRef:r});return l.useEffect(()=>{if(c||!e)return;const Q="fabulizer"+e;Is.getState().initializedKeys.has(Q)||(i(Q),n.current=0,R({clientId:e}))},[c,e,R,i]),l.useEffect(()=>{if(!c||!e||u!=="pending"||d!==null)return;o.current?.abort();const Q=new AbortController;o.current=Q,L({clientId:e,signal:Q.signal})},[c,u,d,e,L]),l.useEffect(()=>(r.current=!0,()=>{s.current&&clearTimeout(s.current),r.current=!1,n.current=0,o.current?.abort()}),[]),{startFabulizer:O,cancelFabulizer:P,cancelAndCloseFabulizer:B,cancelAndStartFabulizer:F,commitFabulizer:z}},yne=({clientData:e,textareaRef:t})=>{const{isOpen:n,isOpenPrevious:s,openTriggered:r,objectToFabulize:i,objectToFabulizePrevious:o,setText:c}=wt({clientId:e?.id});l.useEffect(()=>{i&&o&&i.type!==o.type&&c("")},[i,o,c]),l.useEffect(()=>{if(!n||!t?.current)return;const u=t.current;if(u.focus(),!s){t.current.select();return}const d=u.value.length;u.setSelectionRange(d,d)},[n,s,r,t])},aE=({isDisabled:e=!1,onClick:t,children:n})=>{const[s,r]=l.useState(!1),i=l.useRef(null),o=l.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return l.useEffect(()=>{if(o(),!e){r(!1);return}return i.current=setTimeout(()=>{r(!0)},1e3),()=>{o()}},[e,o]),a.jsx("div",{className:Y("flex items-center justify-center roboto-flex-25-700-1 text-[16px] leading-[20px] h-8 rounded-full px-3 uppercase select-none",!!s&&"bg-zinc-100 text-zinc-300 hover:bg-zinc-100 hover:text-zinc-300",!s&&"bg-zinc-100 text-zinc-950 hover:bg-zinc-200 hover:text-zinc-950",!!e&&"cursor-default",!e&&"cursor-pointer"),onClick:t,children:n})},qA=({onClick:e,isDisabled:t=!1,children:n})=>{const[s,r]=l.useState(!1),i=l.useRef(null),o=l.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);return l.useEffect(()=>{if(o(),!t){r(!1);return}return i.current=setTimeout(()=>{r(!0)},1e3),()=>{o()}},[t,o]),a.jsx("div",{className:Y("flex items-center justify-center roboto-flex-25-700-1 text-[16px] leading-[20px] h-8  rounded-full px-3 uppercase select-none",!!s&&"bg-zinc-600 text-zinc-500",!s&&"bg-zinc-900 text-zinc-100 hover:bg-zinc-950 hover:text-white",!!t&&"cursor-default",!t&&"cursor-pointer"),onClick:e,children:n})},bne=({textareaRef:e,text:t,handleTextareaChange:n,handleHideButtonClick:s,handleAnalyzeButtonClick:r,objectToFabulize:i,statusPrevious:o})=>a.jsxs("div",{className:"h-42 w-full max-w-220",children:[a.jsx("div",{className:"h-31",children:a.jsx("textarea",{ref:e,value:t,onChange:n,className:"w-full h-full bg-zinc-100 px-4 py-3 rounded-2xl appearance-none focus:outline-none focus:ring-0 focus:border-transparent hover:outline-none resize-none"})}),a.jsxs("div",{className:"flex justify-between items-center mt-3 h-8",children:[a.jsx("div",{className:"flex items-center gap-1.5 overflow-hidden whitespace-nowrap",children:a.jsx(Je,{to:i.to,className:Y("roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 hover:underline max-w-full overflow-hidden whitespace-nowrap text-ellipsis mr-6"),children:i.breadcrumbsNames.join(" · ")})}),a.jsxs("div",{className:"flex gap-2 flex-1 justify-end",children:[a.jsx(aE,{onClick:s,children:h.client.fabulizer.buttons.HIDE}),a.jsx(qA,{isDisabled:!!o,onClick:r,children:h.client.fabulizer.buttons.ANALYZE}
853)]})]})]}),p7=e=>l.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_4867_27469)"},l.createElement("circle",{cx:24,cy:24,r:24,transform:"matrix(-1 0 0 1 48 0)",fill:"#F4F4F5"}),l.createElement("path",{d:"M29.4047 42.0816C28.5688 42.4816 26.924 43.7067 22.2323 40.6814C17.5406 37.6562 14.5476 31.0807 14.0622 29.9306C13.2533 30.1639 11.3335 30.1906 10.1255 28.4304C8.91751 26.6703 9.35253 25.4469 9.72104 25.0552M31.2921 33.6309H28.434M31.6427 29.8306H36.0378C36.3074 29.8639 36.6471 29.6305 35.849 28.4304C34.8514 26.9303 31.5348 21.4299 31.6427 19.5047M31.6427 19.5047C31.7505 17.5796 33.3414 17.4296 34.3121 17.4296C35.2828 17.4296 37.332 18.1046 37.332 21.0799C37.332 24.0551 36.9815 24.6051 35.5524 24.6051C34.1233 24.6051 31.5078 21.4299 31.6427 19.5047ZM31.6427 19.5047H29.8361M29.8361 19.5047C30.0338 21.1632 29.8361 24.4801 28.1643 24.4801C26.5735 24.4801 26.142 21.3049 26.142 20.4798C26.142 19.8566 26.1574 18.9196 26.897 18.4984M29.8361 19.5047C29.7462 19.0964 29.2267 18.2796 27.8677 18.2796C27.4521 18.2796 27.1366 18.3619 26.897 18.4984M26.897 18.4984H14.6824M14.6824 18.4984C14.6824 20.1172 14.0353 20.6548 12.8219 20.6548M14.6824 18.4984C14.2959 17.267 13.7548 14.3893 14.6824 12.7292C15.8418 10.654 16.8125 9.52892 20.5066 9.97895C24.2006 10.429 25.7915 11.129 28.7575 11.129C31.7235 11.129 33.9346 7.05372 30.2136 5.6536C27.2368 4.53351 22.6457 6.62035 20.7223 7.80378",stroke:"#0A0A0A",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_4867_27469"},l.createElement("rect",{width:48,height:48,fill:"white",transform:"matrix(-1 0 0 1 48 0)"})))),Aa=({children:e,className:t})=>a.jsx("span",{className:Y("shimmer",t),children:e}),Ine=({objectToFabulize:e,statusPrevious:t,handleCancelButtonClick:n})=>a.jsxs("div",{className:"h-16 w-full max-w-220 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center overflow-hidden whitespace-nowrap",children:[a.jsx(p7,{className:"w-12 h-12 min-w-12 min-h-12"}),a.jsxs("div",{className:"flex items-center roboto-flex-100-400-1 text-[16px] leading-[20px] ml-3 overflow-hidden whitespace-nowrap mr-6",children:[a.jsx(Aa,{children:h.client.fabulizer.messages.ANALYZE_STARTED})," ",a.jsx(Je,{to:e.to,className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-sky-700 underline hover:text-sky-800 max-w-full overflow-hidden whitespace-nowrap text-ellipsis",children:e.breadcrumbsNames.join(" · ")})]})]}),a.jsx("div",{className:"flex flex-1 justify-end",children:a.jsx(aE,{isDisabled:!!t,onClick:n,children:h.client.fabulizer.buttons.CANCEL})})]}),Sne=({textareaRef:e,text:t,handleTextareaChange:n,handleCancelAndCloseButtonClick:s,handleRetryAnalyzeButtonClick:r,objectToFabulize:i,statusPrevious:o})=>a.jsxs("div",{className:"h-42 w-full max-w-220",children:[a.jsx("div",{className:"h-31",children:a.jsx("textarea",{ref:e,value:t,onChange:n,className:"w-full h-full bg-zinc-100 px-4 py-3 rounded-2xl appearance-none focus:outline-none focus:ring-0 focus:border-transparent hover:outline-none resize-none"})}),a.jsxs("div",{className:"flex justify-between items-center mt-3 h-8",children:[a.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden whitespace-nowrap",children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex items-center gap-1.5 whitespace-nowrap",children:[a.jsx(nu,{className:"w-6 h-6 min-w-6 min-h-6 text-red-500"}),h.client.fabulizer.messages.ANALYZE_FAILED]}),a.jsx(Je,{to:i.to,className:Y("roboto-flex-100-400-1 text-[16px] leading-[20px] text-sky-700 underline hover:text-sky-800 max-w-full overflow-hidden whitespace-nowrap text-ellipsis"),children:i.breadcrumbsNames.join(" · ")})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(aE,{onClick:s,children:h.client.fabulizer.buttons.HIDE}),a.jsx(qA,{isDisabled:!!o,onClick:r,children:h.client.fabulizer.buttons.RETRY})]})]})]}),vne=({objectToFabulize:e,externalData:t,clientData:n,status:s,handleCancelButtonClick:r,handleCommitButtonClick:i,handleCancelAndCloseButtonClick:o})=>{const c=l.useMemo(()=>
853{if(!t)return 0;if(e.type==="client_info"){if(!n?.clientInfo)return 0;const u=t,d=n.clientInfo,p={firstName:"string",lastName:"string",middleName:"string",gender:"string",citizenship:"string",dateOfBirth:"string",ageStatus:"string",ageStatusGroup:"string",maritalStatus:"string",children:"boolean",education:"string",isMilitary:"boolean",isActiveMilitary:"boolean",occupation:"string",mentalHealth:"string",physicalHealth:"string",criminalStatus:"string",characteristicsDescription:"string",characteristicsSource:"string",isSpecialSubject:"boolean",specialSubjectType:"string",specialSubjectDescription:"string",contacts:"array",criminalRecords:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E];if(!x)return A;const y=u[E],I=d[E];return(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="witness"){const u=t;if(!u?.id)return 0;const d=n?.witnesses?.find(A=>A.id===u.id),p={lastName:"string",firstName:"string",middleName:"string",dateOfBirth:"string",gender:"string",ageStatus:"string",relationToClient:"string",testimonyStage:"string",contacts:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u[E],I=d?.[E];return(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="victim"){const u=t;if(!u?.id)return 0;const d=n?.victims?.find(A=>A.id===u.id),p={lastName:"string",firstName:"string",middleName:"string",dateOfBirth:"string",gender:"string",ageStatus:"string",relationToClient:"string",contacts:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u[E],I=d?.[E];return(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type===os)return(Array.isArray(t)?t.filter(d=>!!d?.id):[]).length;if(e.type==="court_first_instance"){if(!n?.phases.courtFirstInstance)return 0;const u=t,d=n.phases.courtFirstInstance,p={caseNumber:"string",courtName:"string",judgeLastName:"string",judgeFirstName:"string",judgeMiddleName:"string",prosecutorLastName:"string",prosecutorFirstName:"string",prosecutorMiddleName:"string",conclusionDescription:"string",measureStartDate:"string",measureEndDate:"string",penitentiaryType:"string",punishmentType:"string",punishmentDuration:"number",preTrialMeasures:"array",sessions:"array",felonies:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];
853return!y||(x==="string"?!y?.trim():x==="number"?y==null||isNaN(y):y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:x==="number"?y===I?A:A+1:A},0)}if(e.type==="court_second_instance"){if(!n?.phases.courtSecondInstance)return 0;const u=t,d=n.phases.courtSecondInstance,p={appealCourtName:"string",judgeLastName:"string",judgeFirstName:"string",judgeMiddleName:"string",applicantLastName:"string",applicantFirstName:"string",applicantMiddleName:"string",applicantCategory:"string",applicationDate:"string",appealGoal:"string",appealPleaStatus:"string",appealPleaDetails:"string",appealDocuments:"array",appealGrounds:"string",requestGoal:"string",requestResult:"string",requestArgumentDescription:"string",requestArgumentConfirmationStatus:"string",requestArgumentLegalBasis:"string",requestArgumentGoal:"string",requestArgumentResult:"string",oppositeRequestGoal:"string",oppositeRequestResult:"string",oppositeRequestArgumentDescription:"string",oppositeRequestArgumentConfirmationStatus:"string",oppositeRequestArgumentLegalBasis:"string",oppositeRequestArgumentGoal:"string",oppositeRequestArgumentResult:"string",isConvicted:"boolean",punishmentDescription:"string",punishmentType:"string",punishmentCategory:"string",punishmentDocument:"string",punishmentAppealDate:"string",isFinalSentencing:"boolean",punishmentDuration:"number",measureStartDate:"string",measureEndDate:"string",remainingDuration:"string",penitentiaryType:"string",sessions:"array",felonies:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];
853return!y||(x==="string"?!y?.trim():x==="number"?y==null||isNaN(y):y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:x==="number"?y===I?A:A+1:A},0)}if(e.type==="court_third_instance"){if(!n?.phases.courtThirdInstance)return 0;const u=t,d=n.phases.courtThirdInstance,p={cassationCourtName:"string",judgeLastName:"string",judgeFirstName:"string",judgeMiddleName:"string",applicantLastName:"string",applicantFirstName:"string",applicantMiddleName:"string",applicantCategory:"string",applicationDate:"string",cassationGoal:"string",cassationPleaStatus:"string",cassationPleaDetails:"string",cassationDocuments:"array",cassationGrounds:"string",requestGoal:"string",requestResult:"string",requestArgumentDescription:"string",requestArgumentConfirmationStatus:"string",requestArgumentLegalBasis:"string",requestArgumentGoal:"string",requestArgumentResult:"string",oppositeRequestGoal:"string",oppositeRequestResult:"string",oppositeRequestArgumentDescription:"string",oppositeRequestArgumentConfirmationStatus:"string",oppositeRequestArgumentLegalBasis:"string",oppositeRequestArgumentGoal:"string",oppositeRequestArgumentResult:"string",cassationSatisfactionStatus:"string",cassationResult:"string",cassationResultMotives:"string",cassationDescription:"string",sessions:"array",felonies:"array"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];
853return!y||(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="court_final_instance"){if(!n?.phases.courtFinalInstance)return 0;const u=t,d=n.phases.courtFinalInstance,p={};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];return!y||(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="pre_investigation_check"){if(!n?.phases.preInvestigationCheck)return 0;const u=t,d=n.phases.preInvestigationCheck,p={crimeReportRegistryNumber:"string",criminalCaseOpeningDate:"string",applicantLastName:"string",applicantFirstName:"string",applicantMiddleName:"string",applicantDateOfBirth:"string",applicantPhone:"string",applicantEmail:"string",applicantAddress:"string",applicantGender:"string",applicantAgeStatus:"string",applicantRelationToClient:"string",investigatorLastName:"string",investigatorFirstName:"string",investigatorMiddleName:"string",investigatorPosition:"string",investigatorRank:"string",investigatorDepartment:"string",result:"string"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];
853return!y||(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="preliminary_investigation"){if(!n?.phases.preliminaryInvestigation)return 0;const u=t,d=n.phases.preliminaryInvestigation,p={caseNumber:"string",criminalCaseOpeningDate:"string",investigatorLastName:"string",investigatorFirstName:"string",investigatorMiddleName:"string",investigatorPosition:"string",investigatorRank:"string",investigatorDepartment:"string",result:"string"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];return!y||(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}if(e.type==="inquiry"){if(!n?.phases.inquiry)return 0;const u=t,d=n.phases.inquiry,p={caseNumber:"string",criminalCaseOpeningDate:"string",result:"string",investigatorLastName:"string",investigatorFirstName:"string",investigatorMiddleName:"string",investigatorPosition:"string",investigatorRank:"string",investigatorDepartment:"string"};return Object.keys(p).reduce((A,E)=>{const x=p[E],y=u?.[E],I=d[E];
853return!y||(x==="string"?!y?.trim():y==null)?A:x==="array"?A+y.length:x==="boolean"?y===I?A:A+1:x==="string"?typeof y=="string"&&typeof I=="string"&&y.trim()===I.trim()?A:A+1:A},0)}return 0},[t,e.type,n?.clientInfo,n?.witnesses,n?.victims,n?.phases.courtFirstInstance,n?.phases.courtSecondInstance,n?.phases.courtThirdInstance,n?.phases.courtFinalInstance,n?.phases.preInvestigationCheck,n?.phases.preliminaryInvestigation,n?.phases.inquiry]);return a.jsxs("div",{className:"h-16 w-full max-w-220 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center overflow-hidden whitespace-nowrap",children:[a.jsx(p7,{className:"w-12 h-12 min-w-12 min-h-12"}),a.jsxs("div",{className:"flex roboto-flex-100-400-1 text-[16px] leading-[20px] ml-3 overflow-hidden whitespace-nowrap mr-6 text-ellipsis",children:[h.client.fabulizer.messages.ANALYZE_COMPLETED," ",a.jsx(Je,{to:e.to,className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-sky-700 underline hover:text-sky-800 max-w-full overflow-hidden whitespace-nowrap text-ellipsis",children:e.breadcrumbsNames.join(" · ")}),s==="awaitingChoice"&&a.jsxs(a.Fragment,{children:[" ",a.jsxs("div",{children:["— ",h.client.fabulizer.messages.AVAILABLE," ",c," ",lZ(c)]})]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[s==="autoCommitted"&&a.jsx(a.Fragment,{children:a.jsx(qA,{onClick:o,children:h.client.fabulizer.buttons.DONE})}),s==="awaitingChoice"&&a.jsxs(a.Fragment,{children:[a.jsx(aE,{onClick:r,children:h.client.fabulizer.buttons.CANCEL}),a.jsx(qA,{onClick:i,children:h.client.fabulizer.buttons.COMMIT})]})]})]})},_ne=({clientData:e})=>{const t=Fe(),n=bt(),s=l.useRef(null),{hideFabulizer:r}=Fu(),{isFabulizerReady:i,isOpen:o,text:c,status:u,objectToFabulize:d,statusPrevious:p,externalData:g,isAutoCommit:A,setText:E}=wt({clientId:e?.id}),{startFabulizer:x,cancelFabulizer:y,cancelAndCloseFabulizer:I,cancelAndStartFabulizer:v,commitFabulizer:S}=Cne({clientId:e?.id,textareaRef:s}),b=l.useMemo(()=>{if(!e?.id)return!1;const P=`/clients/${e.id}/overview/fabula`;return t.pathname.startsWith(P)},[e?.id,t.pathname]),w=l.useMemo(()=>e?.id?t.pathname.startsWith(`/clients/${e.id}/quotes`):!1,[e?.id,t.pathname]),_=l.useCallback(()=>{e?.id&&r({clientId:e.id})},[e?.id,r]),N=l.useCallback(()=>{x()},[x]),R=l.useCallback(()=>{y()},[y]),D=l.useCallback(()=>{I()},[I]),k=l.useCallback(()=>{v()},[v]),L=l.useCallback(()=>{S()},[S]),O=l.useCallback(P=>{E(P.target.value)},[E]);return yne({clientData:e,textareaRef:s}),l.useLayoutEffect(()=>{A&&u==="autoCommitted"&&e?.id&&(n.invalidateQueries({queryKey:["client",e.id]}),n.invalidateQueries({queryKey:["strategies","first-instance",e.id]}),n.invalidateQueries({queryKey:["strategies","second-instance",e.id]}),n.invalidateQueries({queryKey:["cases","first-instance",e.id]}),n.invalidateQueries({queryKey:["cases","second-instance",e.id]}),n.invalidateQueries({queryKey:["casesFilters",e.id]}))},[u,A,e?.id,n]),l.useLayoutEffect(()=>{b&&A&&u==="autoCommitted"&&D()},[u,b,A,D]),w||!o||!d||!i||["pending"].includes(u)&&d.type===os&&b&&A?null:a.jsxs("div",{className:Y("sticky","flex","justify-center","items-center","bottom-0","bg-white/72","backdrop-blur-[24px]","py-4","px-4","z-200",u==="error"&&"h-50",u==="notStarted"&&"h-50",u==="pending"&&"h-16",u==="awaitingChoice"&&"h-16",u==="autoCommitted"&&"h-16"),children:[u==="notStarted"&&a.jsx(bne,{textareaRef:s,text:c,handleTextareaChange:O,handleHideButtonClick:_,handleAnalyzeButtonClick:N,objectToFabulize:d,statusPrevious:!!p}),u==="pending"&&a.jsx(Ine,{objectToFabulize:d,statusPrevious:!!p,handleCancelButtonClick:R}),u==="error"&&a.jsx(Sne,{textareaRef:s,text:c,handleTextareaChange:O,handleCancelAndCloseButtonClick:D,handleRetryAnalyzeButtonClick:k,objectToFabulize:d,statusPrevious:!!p}),(u==="awaitingChoice"||u==="autoCommitted")&&a.jsx(vne,{objectToFabulize:d,externalData:g,clientData:e,status:u,handleCancelButtonClick:R,handleCommitButtonClick:L,handleCancelAndCloseButtonClick:D})]})},lE=({containerRef:e})=>{const t=Fe(),n=l.useRef(t.state?.isPreventScrollToTop??!1);l.useEffect(()=>{n.current=t.state?.isPreventScrollToTop??!1},[t.state]),l.useEffect(()=>{window.location.hash||n.current||ln({ref:e})},[t.pathname,n,e])},Tne=({episodes:e})=>
853{if(!e?.length)return null;const t=[];for(const n of e)if(n.episodeId?.length)for(const s of n.episodeId)s&&t.push(s);return t.length?t:null},q6=(e,t,n,s)=>{if(!n)return;s.setSelectedPleaStatuses({clientId:e,key:t,selectedPleaStatuses:n.pleaStatuses??null}),s.setSelectedPunishments({clientId:e,key:t,selectedPunishments:n.punishments??null}),s.setSelectedPunishmentTypesDefenseStrategy({clientId:e,key:t,selectedPunishmentTypes:n.punishments??null}),s.setSelectedGenders({clientId:e,key:t,selectedGenders:n.genders??null}),s.setSelectedGendersDefenseStrategy({clientId:e,key:t,selectedGenders:n.genders??null}),s.setSelectedCriminalStatuses({clientId:e,key:t,selectedCriminalStatuses:n.criminalStatuses??null}),s.setSelectedCriminalStatusesDefenseStrategy({clientId:e,key:t,selectedCriminalStatuses:n.criminalStatuses??null});let r=null;if(n.articles){const c=n.articles.map(u=>{if(!u.number&&!u.part&&!u.clause)return null;const d={article:u.number??null,part:u.part??""};return u.clause&&(d.clause=u.clause),JSON.stringify(d)}).filter(Boolean);r=c.length?c:null}s.setSelectedConclusionArticles({clientId:e,key:t,selectedConclusionArticles:r}),s.setSelectedConclusionArticlesDefenseStrategy({clientId:e,key:t,selectedConclusionArticles:r});const i=Tne({episodes:n.episodes});s.setSelectedEpisodes({clientId:e,key:t,selectedEpisodes:i}),s.setSelectedEpisodesDefenseStrategy({clientId:e,key:t,selectedEpisodes:i});const o=n.regions?.length?n.regions.map(String):null;s.setSelectedRegionIds({clientId:e,key:t,selectedRegionIds:o}),s.setSelectedRegionIdsDefenseStrategy({clientId:e,key:t,selectedRegionIds:o}),s.setSelectedDefenseRequestsResultsDefenseStrategy({clientId:e,key:t,selectedDefenseRequestsResults:n.defenseRequestsResults??null}),s.setSelectedFirstInstanceVerdictResultDefenseStrategy({clientId:e,key:t,selectedFirstInstanceVerdictResult:n.firstInstanceVerdictResult??null}),s.setSelectedApplicantCategoriesDefenseStrategy({clientId:e,key:t,selectedApplicantCategories:n.applicantCategory??null}),s.setSelectedAppealReviewResultsDefenseStrategy({clientId:e,key:t,selectedAppealReviewResults:n.appealReviewResults??null}),s.setSelectedAppealGoalsDefenseStrategy({clientId:e,key:t,selectedAppealGoals:n.appealGoals??null})},Nne=e=>{const t=Ve(D=>D.setSelectedPleaStatuses),n=Ve(D=>D.setSelectedPunishments),s=Ie(D=>D.setSelectedPunishmentTypes),r=Ve(D=>D.setSelectedGenders),i=Ve(D=>D.setSelectedConclusionArticles),o=Ie(D=>D.setSelectedConclusionArticles),c=Ve(D=>D.setSelectedEpisodes),u=Ie(D=>D.setSelectedEpisodes),d=Ie(D=>D.setSelectedGenders),p=Ve(D=>D.setSelectedCriminalStatuses),g=Ie(D=>D.setSelectedCriminalStatuses),A=Ve(D=>D.setSelectedRegionIds),E=Ie(D=>D.setSelectedRegionIds),x=Ie(D=>D.setSelectedDefenseRequestsResults),y=Ie(D=>D.setSelectedFirstInstanceVerdictResult),I=Ie(D=>D.setSelectedApplicantCategories),v=Ie(D=>D.setSelectedAppealReviewResults),S=Ie(D=>D.setSelectedAppealGoals),b=sn(D=>D.setFilters),w=Oe.useRef({setSelectedPleaStatuses:t,setSelectedPunishments:n,setSelectedPunishmentTypesDefenseStrategy:s,setSelectedGenders:r,setSelectedConclusionArticles:i,setSelectedConclusionArticlesDefenseStrategy:o,setSelectedEpisodes:c,setSelectedEpisodesDefenseStrategy:u,setSelectedGendersDefenseStrategy:d,setSelectedCriminalStatuses:p,setSelectedCriminalStatusesDefenseStrategy:g,setSelectedRegionIds:A,setSelectedRegionIdsDefenseStrategy:E,setSelectedDefenseRequestsResultsDefenseStrategy:x,setSelectedFirstInstanceVerdictResultDefenseStrategy:y,setSelectedApplicantCategoriesDefenseStrategy:I,setSelectedAppealReviewResultsDefenseStrategy:v,setSelectedAppealGoalsDefenseStrategy:S}),_=Oe.useRef(b);_.current=b;const{data:N}=Vt({queryKey:["casesFilters",e,"first-instance"],queryFn:()=>H6(e,"first-instance"),enabled:!!e,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,structuralSharing:!1}),{data:R}=Vt({queryKey:["casesFilters",e,"second-instance"],queryFn:()=>H6(e,"second-instance"),enabled:!!e,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,structuralSharing:!1});Oe.useEffect(()=>{e&&N!==void 0&&(_.current(e,"first-instance",N),q6(e,"first-instance",N,w.current))},[e,N]),Oe.useEffect(()=>{e&&R!==void 0&&(_.current(e,"second-instance",R),q6(e,"second-instance",R,w.current))},[e,R])},wne=e=>
853l.createElement("svg",{width:224,height:205,viewBox:"0 0 224 205",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M34.8418 202.265V161.123L35.5938 159.619V91.0835H35.0566L16.1504 151.455H41.9316L44.6172 150.38H64.2754V167.138H0.359375V150.81L35.916 45.8589H53.3184V202.265H34.8418Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M193.842 202.265V161.123L194.594 159.619V91.0835H194.057L175.15 151.455H200.932L203.617 150.38H223.275V167.138H159.359V150.81L194.916 45.8589H212.318V202.265H193.842Z",fill:"#0A0A0A"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75.9076 20.9811C82.0061 17.5669 90.9642 15.7207 98.9287 16.1078C102.865 16.2992 106.093 17.0175 108.348 18.0169C110.632 19.0289 111.221 19.9892 111.357 20.3187L126.146 14.2127C123.908 8.79233 119.373 5.4017 114.83 3.38865C110.259 1.3629 104.957 0.381999 99.7056 0.126716C89.2959 -0.379334 77.252 1.89176 68.0917 7.02006C57.0381 13.2083 52.2972 25.2042 56.1512 36.1296C60.0408 47.1557 71.5061 54.2659 86.9995 54.2659C100.683 54.2659 108.505 48.7954 114.928 44.3027C115.048 44.2191 115.167 44.1358 115.286 44.0528C115.476 43.9195 115.666 43.7872 115.855 43.656C121.88 39.463 127.37 35.9127 138.708 35.9127C153.828 35.9127 163.494 46.2912 168.027 55.0099C169.116 57.1052 169.655 60.8585 169.373 65.7013C169.257 67.6984 169.016 69.6601 168.72 71.4448H130.606C125.39 69.2894 119.628 68.5921 114.277 69.634C109.813 70.5035 105.417 72.6628 102.168 76.3508H100.346C99.5089 74.8008 98.3989 73.2692 96.9686 71.8702C92.5641 67.5619 86.0177 65.3455 77.5823 66.3188C71.2761 67.0464 66.9306 70.8948 64.3247 75.2055C61.8168 79.3541 60.6556 84.2562 60.2777 88.7156C59.895 93.232 60.26 97.9375 61.3418 102.04C62.3075 105.702 64.3204 110.697 68.6731 113.495C70.5807 114.722 72.9839 115.751 75.6539 116.306L75.2912 117.074C74.0885 119.617 72.9182 122.091 71.796 124.643C71.6264 125.028 71.4535 125.418 71.2835 125.802L71.2824 125.804C70.9171 126.628 70.5652 127.421 70.2885 128.077C69.9203 128.95 69.3728 130.284 69.0881 131.65C68.8716 132.689 68.1591 136.672 71.3142 139.936C73.9815 142.694 77.4243 142.69 78.2234 142.689L98.1979 142.689V126.689H88.4577C88.7457 126.075 89.0454 125.437 89.3538 124.781L89.3581 124.772C91.3535 120.529 93.7159 115.506 95.6636 110.769C96.0423 109.848 96.418 108.91 96.7874 107.957C98.379 113.46 101.818 119.134 108.843 121.385C116.157 123.727 123 122.444 128.496 118.928C133.759 115.561 137.478 110.381 139.727 105.099C141.981 99.8083 143.045 93.7602 142.351 88.0876C142.325 87.874 142.296 87.6597 142.264 87.4448H168.224C168.855 89.3991 169.813 91.258 171.233 92.8978C174.798 97.0146 179.653 97.9575 183.564 97.9575V81.9575C183.472 81.9575 183.388 81.9562 183.31 81.9538C183.243 81.5901 183.181 81.097 183.148 80.4477C184.078 76.9333 185.039 71.915 185.346 66.6313C185.678 60.9357 185.341 53.628 182.223 47.6301C176.238 36.1159 162.171 19.9127 138.708 19.9127C122.622 19.9127 113.878 25.539 106.716 30.5226C106.503 30.6711 106.292 30.818 106.083 30.9634C99.8525 35.3055 95.6044 38.2659 86.9995 38.2659C76.2343 38.2659 72.257 33.6902 71.2399 30.8069C70.1873 27.823 71.0758 23.6862 75.9076 20.9811ZM117.336 85.339C119.466 84.9241 122.237 85.2019 124.934 86.4215C125.48 86.859 126.202 87.8446 126.469 90.0323C126.775 92.5295 126.32 95.7475 125.007 98.8294C123.691 101.92 121.797 104.22 119.874 105.45C118.184 106.531 116.269 106.963 113.725 106.147C113.657 106.126 112.02 105.476 111.6 100.369C111.221 95.7611 112.268 90.6244 113.617 87.7849C114.114 86.7405 115.177 85.7594 117.336 85.339ZM86.403 84.2417C86.4339 84.3186 86.4561 84.3839 86.472 84.4361C86.1279 88.6381 85.026 93.147 83.4579 97.7985L83.4216 97.7827C82.8091 99.1913 82.1843 99.8454 81.8013 100.151C81.4211 100.455 81.0247 100.621 80.565 100.699C79.592 100.864 78.44 100.603 77.6732 100.23C77.5417 100.005 77.1796 99.3511 76.813 97.9607C76.2385 95.7821 75.9784 92.9252 76.2206 90.0665C76.4676 87.1509 77.1814 84.8655 78.0172 83.4829C78.7386 82.2895 79.2013 82.2375 79.4029 82.2149L79.4162 82.2133C83.9814 81.6866 85.4351 82.9702 85.7806 83.3082C86.0772 83.5983 86.2784 83.9309 86.403 84.2417Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M99.7878 153.216C99.7878 161.216 99.7839 161.216 99.7839 161.216L99.8109 161.216C99.8674 161.217 99.9708 161.22 100.117 161.225C100.41 161.235 100.87 161.256 101.465 161.302C102.661 161.393 104.36 161.579 106.301 161.949C110.332 162.718 114.7 164.156 117.925 166.595L127.5
85379 153.836C121.552 149.276 114.438 147.213 109.3 146.233C106.656 145.728 104.349 145.476 102.685 145.348C101.849 145.285 101.166 145.251 100.673 145.234C100.535 145.23 100.412 145.226 100.304 145.223C100.218 145.221 100.143 145.22 100.077 145.219C100.003 145.217 99.9409 145.217 99.8925 145.216L99.83 145.216L99.8063 145.216L99.7964 145.216H99.7919C99.7898 145.216 99.7878 145.216 99.7878 153.216Z",fill:"#0A0A0A"}),l.createElement("path",{d:"M113.5 204.515C128.175 204.515 143.189 197.711 156.87 182.935L145.13 172.064C133.847 184.25 122.895 188.488 113.589 188.515C108.404 188.374 103.104 185.27 100.596 182.319L88.4045 192.681C93.4921 198.666 102.966 204.293 113.331 204.513L113.415 204.515H113.5Z",fill:"#0A0A0A"})),Gr={CLIENT_NOT_FOUND:"CLIENT_NOT_FOUND",DOCUMENT_NOT_FOUND:"DOCUMENT_NOT_FOUND",LEGAL_BASE_NOT_FOUND:"LEGAL_BASE_NOT_FOUND",PRACTICE_NOT_FOUND:"PRACTICE_NOT_FOUND",TARIFF_NOT_FOUND:"TARIFF_NOT_FOUND"},ia=({type:e,backTo:t,to:n,isInBottomSheet:s})=>{const r=Se(x=>x.user),i=U1(),o=e===Gr.CLIENT_NOT_FOUND,c=e===Gr.DOCUMENT_NOT_FOUND,u=e===Gr.LEGAL_BASE_NOT_FOUND,d=e===Gr.PRACTICE_NOT_FOUND,p=e===Gr.TARIFF_NOT_FOUND,g=l.useMemo(()=>r?.access?.hasFullAccess||r?.access?.isPaidActive||r?.access?.isTrialActive?"/clients":"/profile/subscription",[r?.access?.hasFullAccess,r?.access?.isPaidActive,r?.access?.isTrialActive]),A=l.useMemo(()=>t||(i?"/":n||(o?"/clients":u?"/legal-base":p?"/profile/subscription":r?g:"/sign-in")),[t,i,n,o,u,p,r,g]),E=l.useMemo(()=>o?{title:h.page404.CLIENT_NOT_FOUND.TITLE,buttonText:h.page404.CLIENT_NOT_FOUND.BUTTON,to:A}:c?{title:h.page404.DOCUMENT_NOT_FOUND.TITLE,buttonText:h.page404.DOCUMENT_NOT_FOUND.BUTTON,to:A}:u?{title:h.page404.LEGAL_BASE_NOT_FOUND.TITLE,buttonText:h.page404.LEGAL_BASE_NOT_FOUND.BUTTON,to:A}:d?{title:h.page404.PRACTICE_NOT_FOUND.TITLE,buttonText:h.page404.PRACTICE_NOT_FOUND.BUTTON,to:A}:p?{title:h.page404.TARIFF_NOT_FOUND.TITLE,buttonText:h.page404.TARIFF_NOT_FOUND.BUTTON,to:A}:{title:h.page404.TITLE,buttonText:h.page404.BUTTON,to:A},[o,c,u,d,p,A]);return a.jsxs("div",{className:Y("flex flex-col items-center justify-center mx-4 bp48:mx-0",!!s&&"flex-1 min-h-full w-full",!s&&"min-h-[calc(100vh-7rem)]"),children:[a.jsx("div",{className:"h-38.5 bp48:h-51.5 flex items-center justify-center",children:a.jsx(wne,{className:"block h-full"})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[18px] bp48:text-[20px] leading-[24px] text-zinc-950 mt-4 text-center",children:E.title}),a.jsx("div",{className:"mt-4 bp48:mt-8",children:a.jsx(ut,{variant:"h16",asChild:!0,children:a.jsx(Je,{to:E.to,children:E.buttonText})})})]})},Rne=()=>{vv({meta:[{name:"viewport",content:"width=800, user-scalable=no"}]});const{clientData:e,isSuccess:t,isFetching:n,isClientNotFound:s}=Zi(),{id:r}=st();ene({clientId:r});const i=kn(v=>v.isCataloguesEnumsReady),o=kn(v=>v.isCataloguesArticlesReady),c=kn(v=>v.isCataloguesRegionsReady),{mainWrapperRef:u}=zt(),p=Fe().state?.clientData,g=e??p,A=tne(g),E=nne(g),{nodeMap:x,parentMap:y}=fne(E);Nne(g?.id),Qte(E);const I=l.useMemo(()=>!(!i||!o||!c),[i,o,c]);return lE({containerRef:u}),s?a.jsxs(a.Fragment,{children:[a.jsx(Kh,{isClientPage:!0}),a.jsx(ia,{type:Gr.CLIENT_NOT_FOUND})]}):I?a.jsxs(a.Fragment,{children:[a.jsx(Kh,{isClientPage:!0,backLink:A,linksTree:g?E:void 0}),a.jsx(zte,{linksTree:E,nodeMap:x,parentMap:y,isSuccess:t,mainWrapperRef:u,clientData:g}),a.jsx(Xi,{context:{clientData:g,isSuccess:t,isFetching:n,mainWrapperRef:u}}),a.jsx(dne,{linksTree:E,nodeMap:x,parentMap:y}),a.jsx(_ne,{clientData:g})]}):a.jsx(ct,{isWithWrapper:!0})},Dne=e=>["clients","{clientId}","episodes",e];function kne(){const e=zt(),{episodeId:t}=st(),{externalData:n,status:s,statusPrevious:r,objectToFabulize:i}=wt({clientId:e?.clientData?.id}),o=bt(),c=e?.clientData?.id,u=l.useCallback(()=>{o.resetQueries({queryKey:["clientsList"]}),c&&(o.resetQueries({queryKey:["strategies","first-instance",c]}),o.resetQueries({queryKey:["strategies","second-instance",c]}),o.resetQueries({queryKey:["cases","first-instance",c]}),o.resetQueries({queryKey:["cases","second-instance",c]}),o.resetQueries({queryKey:["casesFilters",c]}))},[o,c]),d=l.useMemo(()=>!(s==="notStarted"||i?.type!==os),[s,i]),p=l.useMemo(()=>n?i?.type!==os?[]:s!=="awaitingChoice"&&!r?[]:Array.isArray(n)?n:[]:[],[s,n,r,i]),g=l.useMemo(()=>{const S=e?.clientData?.episodes??[],b=p.map(N=>({...N,isExternal:!0})),w=b.map(N=>{const R=S.find(D=>D.id===N.id);return R||N});return[...S.filter(N=>!b.some(R=>R.id===N.id)),...w]},[e?.clientData?.episodes,p]),A=l.useMemo(()=>g.filter(S=>!xf({episode:S})),[g]),E=l.useMemo(()=>c?A.map((S,b)=>{const w=!d&&!S?.catalogueArticleId;return{id:S?.id??"",title:`${h.client.fabula.infoCards.TITLE} ${b+1}`,text:S?.description??"",instance:lA({value:S?.location??""}),to:`/clients/${c}
853/overview/fabula/${S?.id??""}`,isExternal:S?.isExternal,isDeleted:xf({episode:S}),isError:w,commitDataPath:["episodes"],date:Kt({dateString:S?.date??"",isWithTime:!1,isShortMonth:!0})}}):[],[A,d,c]),x=l.useMemo(()=>{const S=g??[];if(t){const N=S.findIndex(D=>D?.id===t);if(N===-1)return;const R=S[N];return R?{...R,index:N}:void 0}const b=A;if(!b.length)return;const w=b[0];if(!w?.id)return;const _=S.findIndex(N=>N?.id===w.id);return{...w,index:_===-1?0:_}},[g,t,A]),y=l.useMemo(()=>x?.id?A.findIndex(S=>S?.id===x.id):-1,[A,x?.id]),I=l.useMemo(()=>{const S=x?.predictedArticles;if(!Array.isArray(S)||S.length===0)return;const b=S.map(w=>w?.id).filter(w=>typeof w=="string"&&w.length>0);if(b.length!==0)return b},[x?.predictedArticles]),v=l.useMemo(()=>{if(!x?.id)return[];const S=Dne(x.id),b=d;return[{rows:[{select:{isDisabled:b,label:h.client.fabula.fields.PRELIMINARY_QUALIFICATION,value:x.catalogueArticleId??"",externalErrorText:x.catalogueArticleId?void 0:h.client.fabula.fields.validationErrors.PRELIMINARY_QUALIFICATION_REQUIRED,placeholder:h.client.fabula.fields.placeholders.PRELIMINARY_QUALIFICATION_HINT,emptyPlaceholder:h.client.fabula.fields.placeholders.PRELIMINARY_QUALIFICATION_EMPTY,catalogue:"articles",isSearchable:!0,primaryArticleIds:I,patch:{endpoint:S,field:"catalogueArticleId"},onPatchSuccess:u}},{textarea:{isDisabled:b,label:h.client.fabula.fields.DESCRIPTION,value:x.description??"",placeholder:h.client.fabula.fields.placeholders.DESCRIPTION,patch:{endpoint:S,field:"description"}}},{dateOnly:{isDisabled:b,label:h.client.fabula.fields.DATE,value:x.date??"",placeholder:h.client.fabula.fields.placeholders.DATE,patch:{endpoint:S,field:"date"}}},{input:{isDisabled:b,label:h.client.fabula.fields.LOCATION,value:x.location??"",placeholder:h.client.fabula.fields.placeholders.LOCATION,maxLength:255,patch:{endpoint:S,field:"location"}}},{textarea:{isDisabled:b,label:h.client.fabula.fields.METHOD,value:x.method??"",placeholder:h.client.fabula.fields.placeholders.METHOD,patch:{endpoint:S,field:"method"}}},{textarea:{isDisabled:b,label:h.client.fabula.fields.SUBJECTIVE_SIDE,value:x.subjectiveSide??"",placeholder:h.client.fabula.fields.placeholders.SUBJECTIVE_SIDE,patch:{endpoint:S,field:"subjectiveSide"}}},{select:{isDisabled:b,label:h.client.fabula.fields.CLIENT_ROLE,value:x.clientRole??"",placeholder:h.client.fabula.fields.placeholders.CLIENT_ROLE,enumKey:"clientRoles",catalogue:"enums",patch:{endpoint:S,field:"clientRole"}}},{select:{isDisabled:b,label:h.client.fabula.fields.PLEA_STATUS,value:x.pleaStatus??"",placeholder:h.client.fabula.fields.placeholders.PLEA_STATUS,enumKey:"pleaStatuses",catalogue:"enums",patch:{endpoint:S,field:"pleaStatus"}}},{textarea:{isDisabled:b,label:h.client.fabula.fields.COMMENT,value:x.comment??"",placeholder:h.client.fabula.fields.placeholders.COMMENT,patch:{endpoint:S,field:"comment"}}}]}]},[x,d,I,u]);return{clientData:e?.clientData,isSuccess:e?.isSuccess,isFetching:e?.isFetching??!1,infoCards:E,currentEpisode:x,currentEpisodeVisibleIndex:y,propertyCards:v,isFabulizerInProcess:d,episodesWithExternalData:g,visibleEpisodes:A}}const Yn=({leftColumnStickyTitle:e,leftColumn:t,rightColumnStickyTitle:n,rightColumn:s,isLeftColumnDisabled:r,isRightColumnDisabled:i,isLeftColumnPreventScrollPropagation:o,headerMode:c,fabulizerMode:u,rightStickyTitleRef:d,leftContainerRef:p})=>{const g=l.useRef(null),A=l.useMemo(()=>c==="common"||c==="simple",[c]),E=l.useCallback(x=>{const y=x.currentTarget;if(!(y instanceof HTMLDivElement))return;const{scrollTop:I,scrollHeight:v,clientHeight:S}=y,b=x.deltaY<0,w=x.deltaY>0;b&&I>0||w&&Math.ceil(I+S)<v||x.preventDefault()},[]);return l.useEffect(()=>{if(!o)return;const x=g.current;if(x)return x.addEventListener("wheel",E,{passive:!1}),()=>{x.removeEventListener("wheel",E)}},[o,E]),a.jsxs("div",{className:Y("flex","bg-white","flex-1"),children:[a.jsx("div",{className:"hidden bp48:block w-76 min-w-76 bp72:w-110 bp72:min-w-110",children:a.jsxs("div",{className:Y("flex","flex-col","border-r-2","border-zinc-200",c==="popup"&&Y("sticky top-14 bp75:top-15 z-10",Y(u==="searchInsteadOfFabulizer"&&["[@supp
853orts(height:100dvh)]:min-h-[calc(100dvh-9.25rem-4rem-1rem)]","min-h-[calc(var(--vh)*100-9.25rem-4rem-1rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-9.25rem-4rem-1rem)]","max-h-[calc(var(--vh)*100-9.25rem-4rem-1rem)]"],u!=="searchInsteadOfFabulizer"&&["[@supports(height:100dvh)]:min-h-[calc(100dvh-9.25rem)]","min-h-[calc(var(--vh)*100-9.25rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-9.25rem)]","max-h-[calc(var(--vh)*100-9.25rem)]"])),!!A&&Y("sticky","top-[4.5rem]",u==="none"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-4.5rem)]","min-h-[calc(var(--vh)*100-4.5rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-4.5rem)]","max-h-[calc(var(--vh)*100-4.5rem)]"),u==="big"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-4.5rem-12.5rem)]","min-h-[calc(var(--vh)*100-4.5rem-12.5rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-4.5rem-12.5rem)]","max-h-[calc(var(--vh)*100-4.5rem-12.5rem)]"),u==="small"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-4.5rem-4em)]","min-h-[calc(var(--vh)*100-4.5rem-4em)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-4.5rem-4em)]","max-h-[calc(var(--vh)*100-4.5rem-4em)]"),u==="searchInsteadOfFabulizer"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-4.5rem-4rem-1rem)]","min-h-[calc(var(--vh)*100-4.5rem-4rem-1rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-4.5rem-4rem-1rem)]","max-h-[calc(var(--vh)*100-4.5rem-4rem-1rem)]")),c==="withSubMenu"&&Y("sticky","top-[7.5rem]",u==="none"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-7.5rem)]","min-h-[calc(var(--vh)*100-7.5rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-7.5rem)]","max-h-[calc(var(--vh)*100-7.5rem)]"),u==="big"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-7.5rem-12.5rem)]","min-h-[calc(var(--vh)*100-7.5rem-12.5rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-7.5rem-12.5rem)]","max-h-[calc(var(--vh)*100-7.5rem-12.5rem)]"),u==="small"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-7.5rem-4em)]","min-h-[calc(var(--vh)*100-7.5rem-4em)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-7.5rem-4em)]","max-h-[calc(var(--vh)*100-7.5rem-4em)]"),u==="searchInsteadOfFabulizer"&&Y("[@supports(height:100dvh)]:min-h-[calc(100dvh-7.5rem-4rem-1rem)]","min-h-[calc(var(--vh)*100-7.5rem-4rem-1rem)]","[@supports(height:100dvh)]:max-h-[calc(100dvh-7.5rem-4rem-1rem)]","max-h-[calc(var(--vh)*100-7.5rem-4rem-1rem)]")),!!r&&"opacity-60 pointer-events-none"),children:[!!e&&a.jsx("div",{className:Y("flex","items-center","justify-between","roboto-flex-25-700-1","text-[20px]","leading-[20px]","bp48:text-[24px]","bp48:leading-[24px]","uppercase","text-zinc-950","relative","pl-4","pb-5"),children:e}),a.jsx("div",{ref:p??g,className:Y("overflow-auto",!!o&&"overscroll-contain"),children:t})]})}),a.jsxs("div",{className:Y("min-w-0","flex-1","max-w-full","pl-4","bp48:pl-6","pr-4","bp50:pr-4",u==="none"&&Y("pb-0","bp34_375:pb-6"),u==="big"&&Y("pb-0","bp34_375:pb-0"),u==="small"&&Y("pb-0","bp34_375:pb-0"),u==="searchInsteadOfFabulizer"&&Y("pb-[calc(4rem+1rem)]","bp34_375:pb-[calc(4rem+1.5rem+1rem)]"),i&&"opacity-60 pointer-events-none"),children:[a.jsx("div",{className:Y("pb-1","bg-white","z-10","sticky",c==="popup"&&"top-14 bp75:top-15",c==="inSheet"&&"top-0",c==="common"&&"pt-0 bp48:pt-3.5 top-14",c==="withSubMenu"&&"pt-2.5 top-8 bp48:top-27",c==="simple"&&"pt-3 top-13 bp48:top-14"),"data-case-sticky":"right",ref:d,children:n}),a.jsx("div",{className:Y(c==="simple"&&"pt-0",c!=="simple"&&"pt-3"),children:s})]})]})},One=({line:e,bgClassName:t})=>{const n=e.trim().split(" ");return a.jsx(a.Fragment,{children:n.map((s,r)=>a.jsxs(Oe.Fragment,{children:[a.jsx("span",{className:Y("relative",t),children:a.jsx("span",{className:"relative",children:s})}),r<n.length-1&&" "]},r))})},tn=({text:e,wrapWordBgClassName:t})=>{if(!e)return null;const n=e.split(`
854`);return a.jsx(a.Fragment,{children:n.map((s,r)=>a.jsxs(Oe.Fragment,{children:[!r&&t?a.jsx(One,{line:s,bgClassName:t}):s,r<n.length-1&&a.jsx("br",{})]},r))})},Pne=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7527_68318)"},l.createElement("path",{d:"M10 3.33337L10 16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33398 10H16.6673",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7527_68318"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Lne=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7527_68259)"},l.createElement("path",{d:"M15 5L5.00003 15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 5L15 15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7527_68259"},l.createElement("rect",{width:20,height:20,fill:"white"}
854)))),Mne=({ref:e,to:t,state:n,hash:s,isActive:r,isExternal:i,text:o,title:c,instance:u,description:d,isTextBlockLimited:p,isTitleTruncate:g,handleClick:A,handleClickOnExternalControl:E,isSelectedExternalValue:x,isError:y})=>{const I=t?Je:"div",v=t?{to:t+(s?`#${s}`:""),onClick:A,state:n}:{onClick:A},S=l.useMemo(()=>!o&&!u&&!d,[o,u,d]);return a.jsxs(I,{ref:e,className:Y("block border-l-2 pl-4 pr-6 group cursor-pointer",!r&&"bg-white border-white",!!r&&"bg-zinc-50 border-black",!S&&"pt-4 pb-4",!!S&&"pt-3 pb-3"),...v,children:[a.jsxs("div",{children:[a.jsxs("div",{className:Y("flex items-center justify-between roboto-flex-100-600-1 font-semibold",!!S&&"text-[18px] leading-[24px]",!S&&"text-[16px] leading-[24px]",!!i&&"text-sky-400 group-hover:text-sky-500",!!(!i&&r)&&"text-zinc-950",!i&&!r&&"text-zinc-500 group-hover:text-zinc-600"),children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[!!y&&a.jsx("figure",{className:"size-1.5 rounded-full text-red-500 bg-current flex items-center"}),a.jsx("div",{className:Y("min-w-0 flex-1",!!g&&"truncate",!!p&&!g&&"line-clamp-2"),children:a.jsx(tn,{text:c})})]}),!!i&&a.jsx("div",{className:"flex w-6 items-center justify-end pr-0.5 text-sky-400 hover:text-sky-500 cursor-pointer",onClick:E??void 0,children:x?a.jsx(Lne,{className:"w-5 h-5"}):a.jsx(Pne,{className:"w-5 h-5"})})]}),!!o&&a.jsx("div",{className:Y("roboto-flex-100-400-1 text-[16px] leading-[20px]",!!p&&"line-clamp-2",!i&&"text-zinc-950",!!(i&&x)&&"text-zinc-950",!!(i&&!x)&&"text-zinc-500 opacity-60"),children:a.jsx(tn,{text:o})})]}),!!(u||d)&&a.jsxs("div",{className:"mt-2 flex justify-between",children:[a.jsx("div",{className:Y("roboto-flex-100-400-1 text-[14px] leading-[16px] whitespace-nowrap overflow-hidden text-ellipsis",!i&&"text-zinc-500",!!(i&&x)&&"text-zinc-500",!!(i&&!x)&&"text-zinc-500 opacity-60"),children:!!u&&a.jsx(tn,{text:u})}),!!d&&a.jsx("div",{className:Y("roboto-flex-100-400-1 text-[14px] leading-[16px] whitespace-nowrap ml-3 text-right",!i&&"text-zinc-500",!!(i&&x)&&"text-zinc-500",!!(i&&!x)&&"text-zinc-500 opacity-60"),children:a.jsx(tn,{text:d})})]})]})},Ac=({id:e,title:t,text:n,instance:s,date:r,to:i,fallbackTo:o,hash:c,clientId:u,isExternal:d,isTextBlockLimited:p,isTitleTruncate:g,commitDataPath:A,scrollToHashedElement:E,ref:x,isError:y})=>{const I=Fe(),{commitData:v,setCommitData:S}=wt({clientId:u}),b=sn(L=>L.currentHashByClient),w=Eo({data:v,path:A}),_=l.useCallback(L=>{L.preventDefault(),L.stopPropagation(),e&&S(O=>{const P=Eo({data:O,path:A});if(!Array.isArray(P))return O;const B=P.includes(e)?P.filter(F=>F!==e):[...P,e];return ul({data:O,path:A,value:B})})},[A,e,S]),N=l.useMemo(()=>!(!Array.isArray(w)||!w.length||!e||!w.includes(e)),[e,w]),R=l.useMemo(()=>u?b[u]:null,[u,b]),D=l.useCallback(L=>{E&&(L.preventDefault(),L.stopPropagation(),E(c??null))},[E,c]),k=l.useMemo(()=>qs({path:i,end:!1},I.pathname)?E&&!c&&!R?!0:!(E&&R!==`#${c}`):!(!o||!qs({path:o??"",end:!0},I.pathname)),[i,o,I.pathname,R,c,E]);return a.jsx(Mne,{ref:x,to:i,hash:c,isActive:k,isExternal:d,text:n,title:t,instance:s,description:r,isTextBlockLimited:p,isTitleTruncate:g,handleClick:D,handleClickOnExternalControl:_,isSelectedExternalValue:N,isError:y})};function jne(){const e=at(),t=Fe(),{clientData:n,isSuccess:s}=zt(),{episodeId:r}=st(),{externalData:i,status:o,statusPrevious:c,objectToFabulize:u}=wt({clientId:n?.id}),d=l.useMemo(()=>i?u?.type!==os?[]:o!=="awaitingChoice"&&!c?[]:Array.isArray(i)?i:[]:[],[o,i,c,u]),p=l.useMemo(()=>{const A=n?.episodes??[],E=d.map(I=>({...I,isExternal:!0})),x=E.map(I=>{const v=A.find(S=>S.id===I.id);return v||I});return[...A.filter(I=>!E.some(v=>v.id===I.id)),...x]},[n?.episodes,d]),g=l.useMemo(()=>p.filter(A=>!xf({episode:A})),[p]);l.useEffect(()=>{if(!s||!n?.id)return;const A=t.pathname,E=`/clients/${n.id}/overview/fabula`,x=A.slice(E.length);!x.startsWith("/")||x.slice(1).split("/").filter(Boolean).length<2||e(E,{replace:!0})},[s,n?.id,t.pathname,e]),l.useEffect(()=>{!s||!n?.id||c||!r||p.some(E=>E?.id===r)||e(`/clients/${n.id}/overview/fabula`,{replace:!0})},[s,n?.id,r,p,c,e]),l.useEffect(()=>{if(!s||!n?.id||c||r||!g.length)return;const A=g[0];A?.id&&e(`/clients/${n.id}/overview/fabula/${A.id}`,{replace:!0})},[s,n?.id,r,c,e,g])}function Bne({value:e}){if(e==null)return;const t=e.trim();if(t!=="")return t}function Fne({linkData:e}){if(e)return e.path}function Une({clientId:e,caseId:t}){return e===void 0||t===void 0}function Ea({clientId:e,caseId:t,basePath:n,pathSuffix:s}){if(!Une({clientId:e,caseId:t}))return`${n}/${s}`}function h7({explicitTitle:e,titleBase:t}){return e!==""?e:t}function Tm({base:e,index:t}){if(e!==void 0&&t!==void 0)return t===0?e:`${e}/${t}`}function Nm({eventPath:e,eventIndex:t,felonyIndex:n}){if(e!==void 0&&n!==void 0)return n===0?e:t===0?`${e}/0/${n}`:`${e}/${n}`}function cE({value:e}){return typeof e!="string"?"":e.trim()}function wm({articleText:e,fallbackTitle:t}){return e===void 0||e.trim()===""?t:e}function BI({base:e,suffix:t}){if(e!==void 0)return`${e}${t}`}function uE({path:e,hashSuffix:t}){if(e!==void 0)return`${e}${t}`}function m7({index:e,prefix:t}){return e===void 0?"":`${t}${e}`}function g7({relativeField:e,linkFieldConfig:t}){if(Object.prototype.hasOwnProperty.call(t,e))return e}function FI(e){return!(e===void 0||e.length===0)}function zne({textValue:e,clientId:t,caseId:n}){return!e||!t||!n}function Qne({visibleCountBeforeTruncate:e,hasTruncatedItem:t}){return!!(e>0||t)}function W6({segment:e}){return!(e===void 0||e.indices.length===0)}function Hne({segments:e}){return e.length<=4||e[0].name!=="case_narrative"||!W6({segment:e[1]})||!W6({segment:e[2]})||e[3].name!=="objects"}function Vne({itemCount:e,containerWidth:t}){return e===0||t<=0}function Gne({columnGap:e,gap:t}){return e!==""?e:t}function K6({measuredWidth:e,fallback:t}){return e===void 0||e===0?t:e}function qne({container:e,shadowRow:t}){if(e&&t)return{container:e,shadowRow:t}}function Wne(e,t,n){return!(!e||!t||n<=0)}function Kne({rowWidth:e,containerWidth:t}){return e<=0||e>=t}const To=({isChangeable:e,onClick:t,children:n,isCompact:s})=>{const r=l.useCallback(()=>{e&&t&&t()},[e,t]);return a.jsx("div",{className:Y("flex flex-col bp34_375:flex-row justify-between items-start",!!e&&"curs
854or-pointer group",!s&&"mb-1 bp34_375:mb-0.5 last:mb-0",!!s&&"mb-0 bp34_375:mb-0.5 last:mb-0"),onClick:r,children:n})},dE=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7514_25164)"},l.createElement("g",{clipPath:"url(#clip1_7514_25164)"},l.createElement("path",{d:"M6 2L6 10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2 6H10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7514_25164"},l.createElement("rect",{width:12,height:12,fill:"white"})),l.createElement("clipPath",{id:"clip1_7514_25164"},l.createElement("rect",{width:12,height:12,fill:"white"})))),A7=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7514_26700)"},l.createElement("path",{d:"M9 3L3.00002 8.99998",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3 3L8.99998 8.99998",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7514_26700"},l.createElement("rect",{width:12,height:12,fill:"white"})))),_h={PROFILE:"profile",DEFAULT:"default"},No=({children:e,isGrouped:t,isExternalAvailable:n,isSelectedExternalValue:s,isCompact:r,labelTheme:i=_h.DEFAULT})=>a.jsxs("div",{className:Y("relative","flex","text-[14px]","leading-[20px]","bp34_375:text-[16px]","bp34_375:leading-[20px]","text-zinc-400","bp34_375:text-zinc-500","justify-between","roboto-flex-100-400-1",!r&&"py-0 bp34_375:py-1.5",!!r&&"py-0 bp34_375:py-0.75",!t&&"w-58.5 min-w-58.5 bp50:w-60 bp50:min-w-60 bp62_5:w-72 bp62_5:min-w-72",!!t&&"w-54 min-w-54 bp50:w-55.5 bp50:min-w-55.5 bp62_5:w-67.5 bp62_5:m
854in-w-67.5",i===_h.PROFILE&&"w-72 min-w-72 bp50:w-72 bp50:min-w-72 bp62_5:w-72 bp62_5:min-w-72"),children:[a.jsxs("div",{className:Y("hidden bp34_375:flex items-center justify-center absolute h-3.25 left-0",!r&&"top-2.5",!!r&&"top-1.5",!n&&"right-3",!!n&&"right-1.5"),children:[a.jsx("div",{className:Y("h-0.25 w-full",!n&&"bg-zinc-100",!!n&&"bg-sky-200 group-hover:bg-sky-400")}),n&&a.jsx("div",{className:"h-3 w-3 text-sky-200 group-hover:text-sky-400 ml-1.5",children:s?a.jsx(A7,{className:"h-3 w-3"}):a.jsx(dE,{className:"h-3 w-3"})})]}),a.jsx("div",{className:"pr-3",children:e})]}),wo=({children:e,paddingY:t="1_1.5"})=>a.jsx("div",{className:Y("roboto-flex-100-400-1","text-[16px]","leading-[20px]","text-zinc-950","flex-1","w-full","min-w-0",t==="1_1"&&"py-1",t==="1_0.75"&&"py-1 bp34_375:py-0.75",t==="1_1.5"&&"py-1 bp34_375:py-1.5"),children:e}),oa=({sourcePath:e,label:t,className:n})=>Is(r=>r.isGridSourcePathVisible)&&e?a.jsxs("div",{className:Y("mt-0.5 text-[9px] leading-[14px] text-zinc-400 break-all",n),children:[!!t&&a.jsxs("span",{className:"text-zinc-500",children:[t,": "]}),e]}):null,pn=({label:e,text:t,isGrouped:n,placeholder:s,sourcePath:r})=>{const i=l.useMemo(()=>Ut(t),[t]),o=l.useMemo(()=>i?s??"":`${t??""}`,[i,s,t]);return a.jsxs(To,{children:[a.jsx(No,{isGrouped:n,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:e})}),a.jsx(wo,{children:a.jsxs("div",{children:[a.jsx("div",{className:Y("flex items-center gap-2",!!i&&"text-zinc-400",!i&&"text-zinc-950"),children:a.jsx(tn,{text:o})}),a.jsx(oa,{sourcePath:r})]})})]})},Ro=({additionalFields:e,isGrouped:t,placeholder:n,sourcePath:s})=>{const r=l.useMemo(()=>FI(e)?e.length-1:-1,[e]),i=l.useCallback(({field:o,index:c})=>{if(o.sourcePath!==void 0&&o.sourcePath!==null)return o.sourcePath;if(c===r)return s},[r,s]);return FI(e)?a.jsx(a.Fragment,{children:e.map((o,c)=>a.jsx(pn,{isGrouped:t,label:o.label,text:o.value??"",placeholder:n,sourcePath:i({field:o,index:c})},`additional-${c}`))}):null};var $ne=function(){},E7=typeof window<"u",Yne=E7?l.useLayoutEffect:l.useEffect,Xne=function(e,t){return t},fE=function(e,t){var n=l.useState(Xne(e,t)),s=n[0],r=n[1];return l.useEffect(function(){var i=!0,o=window.matchMedia(e),c=function(){i&&r(!!o.matches)};return o.addEventListener("change",c),r(o.matches),function(){i=!1,o.removeEventListener("change",c)}},[e]),s},x7={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Jne(){var e=l.useState(null),t=e[0],n=e[1],s=l.useState(x7),r=s[0],i=s[1],o=l.useMemo(function(){return new window.ResizeObserver(function(c){if(c[0]){var u=c[0].contentRect,d=u.x,p=u.y,g=u.width,A=u.height,E=u.top,x=u.left,y=u.bottom,I=u.right;i({x:d,y:p,width:g,height:A,top:E,left:x,bottom:y,right:I})}})},[]);return Yne(function(){if(t)return o.observe(t),function(){o.disconnect()}},[t]),[n,r]}const Yh=E7&&typeof window.ResizeObserver<"u"?Jne:(function(){return[$ne,x7]}),Zne=56,ese=200,Do=({children:e,content:t,delay:n=250,isClampToParent:s=!1,isFollowCursor:r=!1,isDisableOnTouch:i=!1,isClickBlocked:o=!1,verticalPosition:c="top",horizontalPosition:u,verticalOffset:d=4,topOffset:p=Zne,isAllowEmptyContent:g=!1,isPopupVisible:A=!0,isFullWidth:E=!0,onHoverChange:x})=>{const[y,I]=l.useState(!1),[v,S]=l.useState(0),[b,w]=l.useState(0),[_,N]=l.useState(c),[R,D]=l.useState(0),k=l.useRef(null),L=l.useRef(null),O=l.useRef(null),P=l.useRef(null),B=l.useRef(ol(ee=>{S(ee)},1e3)).current,F=l.useRef(null),z=fE("(any-pointer: coarse), (hover: none)",!1),Q=l.useMemo(()=>!!(z||typeof window<"u"&&"ontouchstart"in window||typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0),[z]),M=l.useMemo(()=>!(!i||!Q),[i,Q]),K=l.useCallback(({element:ee})=>{const te=[window];let le=ee?.parentElement;for(;le;){const he=getComputedStyle(le),fe=he.overflowY||he.overflow;(fe==="auto"||fe==="scroll"||fe==="overlay")&&le.scrollHeight>le.clientHeight&&te.push(le),le=le.parentElement}return te},[]),W=l.useCallback(({pageX:ee})=>{const te=k.current,le=L.current;if(!te||!le)return{left:0,top:void 0};const he=te.getBoundingClientRect(),fe=le.offsetWidth||le.getBoundingClientRect().width,ue=le.offsetHeight||le.getBoundingClientRect().height,ye=16;let ce=0,xe,re=c;if(r?ce=ee-he.left-fe/2:u==="left"?ce=0:u==="right"?ce=he.width-fe:ce=(he.width-fe)/2,s)ce=Math.max(0,Math.min(ce,he.width-fe));else{const pe=he.left+ce;ce=Math.max(ye,Math.min(pe,window.innerWidth-fe-ye))-he.left}return c==="top"?(xe=-ue-d,re="top",p>0&&he.top+xe<p&&(xe=he.height+d,re="bottom")):(xe=he.height+d,re="bottom",he.bottom+d+ue>window.innerHeight-ye&&p>0&&he.top-ue-d>=p&&(xe=-ue-d,re="top")),N(re),{left:ce,top:xe}},[s,r,u,c,d,p]),H=l.useCallback(({pageX:ee})=>{const te=L.current;if(!te||te.offsetWidth===0||te.offsetHeight===0)return;const{left:le}=W({pageX:ee});if(y&&r){B(le);return}S(le)},[W,B,y,r]);l.useEffect(()=>{const ee=k.current;if(!ee)return;const te=()=>{const he=ee.offsetHeight;w(he)};te();const le=new ResizeObserver(te);return le.observe(ee),()=>{le.disconnect()}},[]),l.useLayoutEffect(()=>{if(!y){D(0);return}if(!t)return;let ee=!1,te=0;const le=()=>{if(ee)return;const he=k.current,fe=L.current;if(!he||!fe)return;const ue=fe.offsetWidth||fe.getBoundingClientRect().width,ye=fe.offsetHeight||fe.getBoundingClientRect().height;if(ue===0||ye===0){te=requestAnimationFrame(le);return}const ce=he.getBoundingClientRect(),xe=F.current??ce.left+ce.width/2,{left:re}=W({pageX:xe});if(S(re),!E){const pe=he.offsetWidth;D(Math.max(ue,pe))}};return le(),()=>{ee=!0,cancelAnimationFrame(te)}},[y,W,t,A,E]),l.useEffect(()=>{x&&x({isHovered:y}
854)},[y,x]);const j=Q?0:n,q=y&&A,G=l.useMemo(()=>E||!t?0:R>0?R:ese,[R,t,E]),$=l.useCallback(ee=>{M||(F.current=ee.clientX,j>0?P.current=setTimeout(()=>{F.current=ee.clientX,H({pageX:ee.clientX}),I(!0)},j):(H({pageX:ee.clientX}),I(!0)))},[j,M,H]),J=l.useCallback(ee=>{if(M)return;F.current=null,P.current&&(clearTimeout(P.current),P.current=null);const te=ee.relatedTarget,le=k.current,he=L.current,fe=O.current;te&&te instanceof Node&&(le&&le.contains(te)||fe&&fe.contains(te)||he&&he.contains(te))||I(!1)},[M]),ne=l.useCallback(ee=>{M||(F.current=ee.clientX,r&&H({pageX:ee.clientX}))},[M,H,r]),X=l.useCallback(ee=>{if(o&&(ee.preventDefault(),ee.stopPropagation()),!Q||M)return;const te=ee.changedTouches[0];if(!te)return;const le=te.clientX;y?(F.current=null,I(!1)):(F.current=le,H({pageX:le}),I(!0)),ee.preventDefault()},[o,y,Q,M,H]),oe=l.useCallback(ee=>{ee.stopPropagation()},[]),ie=l.useCallback(ee=>{ee.stopPropagation()},[]);return l.useEffect(()=>{if(!y||!Q||M)return;const ee=te=>{const le=te.target;if(!le)return;const he=k.current,fe=L.current,ue=O.current;he&&he.contains(le)||ue&&ue.contains(le)||fe&&fe.contains(le)||I(!1)};return document.addEventListener("touchend",ee,!0),()=>{document.removeEventListener("touchend",ee,!0)}},[y,Q,M]),l.useEffect(()=>()=>{P.current&&clearTimeout(P.current)},[]),l.useEffect(()=>{if(!y)return;const ee=k.current,te=()=>{I(!1)},le=K({element:ee});return le.forEach(he=>{he.addEventListener("scroll",te,{passive:!0})}),()=>{le.forEach(he=>{he.removeEventListener("scroll",te)})}},[y,K]),!t&&!g?a.jsx(a.Fragment,{children:e}):a.jsxs("div",{ref:k,onMouseEnter:$,onMouseLeave:J,onMouseMove:ne,onTouchEnd:X,className:Y("relative inline-flex",E&&"w-full",!!y&&"overflow-visible",!y&&"overflow-hidden"),children:[e,!!t&&a.jsx("div",{ref:O,className:Y("absolute z-22",E&&"w-full",!E&&!!t&&y&&"pointer-events-auto"),style:{top:_==="bottom"?`${b}px`:void 0,bottom:_==="top"?`${b}px`:void 0,height:`${b+d}px`,left:E?void 0:`${v}px`,width:!E&&G>0?`${G}px`:void 0},children:a.jsx("div",{ref:L,onMouseEnter:$,onMouseLeave:J,onClick:oe,onMouseDown:ie,className:Y("absolute bg-zinc-800 rounded-[6px] transition-opacity duration-200 z-23 cursor-text select-text px-4 py-3 max-w-[calc(100vw-2rem)] whitespace-normal wrap-break-word",q?"pointer-events-auto":"pointer-events-none",!!E&&u==="left"&&"left-0",!!E&&u==="right"&&"right-0",!!q&&"visible",!q&&"invisible"),style:{top:_==="bottom"?`${d}px`:void 0,bottom:_==="top"?`${d}px`:void 0,left:(()=>{if(!E)return"0px";if(r)return`${v}px`;if(s)return`${v}px`;if(u===void 0)return`${v}px`})()},children:t})})]})},WA=20,tse=10,nse=24,sse=6,UI={visibleCount:0,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1};function rse({left:e,right:t}){return!(e.visibleCount!==t.visibleCount||e.truncatedIndex!==t.truncatedIndex||e.truncatedMaxWidth!==t.truncatedMaxWidth||e.truncatedSlotNeedsEllipsis!==t.truncatedSlotNeedsEllipsis)}const ise=({itemWidths:e,fullItemCount:t,separatorWidth:n})=>Array.from({length:t}).reduce((s,r,i)=>(i>0&&s.push(n),s.push(e[i]??0),s),[]),ose=({itemWidths:e,fullItemCount:t,truncatedWidth:n,separatorWidth:s,gapWidth:r})=>{const i=ise({itemWidths:e,fullItemCount:t,separatorWidth:s});if(n!=null&&(i.length>0&&i.push(s),i.push(n)),!i.length)return 0;const o=i.reduce((u,d)=>u+d,0),c=(i.length-1)*r;return o+c};function ase({itemCount:e,itemWidths:t,getCrumbRowWidth:n,widthBeforeDropdownTail:s,getAvailableForTruncatedSlot:r,getTruncatedSlotNeedsEllipsis:i}){function o({index:c,visibleCount:u}){if(c>=e)return{resultType:"visibleCount",visibleCount:u};if(n({fullItemCount:c+1})<=s)return o({index:c+1,visibleCount:c+1});const d=r({truncatedIndex:c});return d<WA?{resultType:"visibleCount",visibleCount:u}:(t[c]??0)<=d+1?{resultType:"layout",layout:{visibleCount:c+1,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1}}:{resultType:"layout",layout:{visibleCount:c,truncatedIndex:c,truncatedMaxWidth:d,truncatedSlotNeedsEllipsis:i({truncatedIndex:c,truncatedMaxWidth:d})}}}return o({index:0,visibleCount:0})}function lse({startCount:e,itemWidths:t,getAvailableForTruncatedSlot:n,getTruncatedSlotNeedsEllipsis:s}){function r({count:i}){if(i===0){const c=n({truncatedIndex:0});return{visibleCount:0,truncatedIndex:0,truncatedMaxWidth:c,truncatedSlotNeedsEllipsis:s({truncatedIndex:0,truncatedMaxWidth:c})}}const o=n({truncatedIndex:i});return o<WA?r({count:i-1}
854):(t[i]??0)<=o+1?{visibleCount:i+1,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1}:{visibleCount:i,truncatedIndex:i,truncatedMaxWidth:o,truncatedSlotNeedsEllipsis:s({truncatedIndex:i,truncatedMaxWidth:o})}}return r({count:e})}const cse=({itemWidths:e,containerWidth:t,dropdownWidth:n,separatorWidth:s,gapWidth:r})=>{const i=e.length;if(Vne({itemCount:i,containerWidth:t}))return UI;const o=({truncatedIndex:v,truncatedMaxWidth:S})=>(e[v]??0)>S+1,c=({fullItemCount:v,truncatedWidth:S})=>ose({itemWidths:e,fullItemCount:v,truncatedWidth:S,separatorWidth:s,gapWidth:r});if(c({fullItemCount:i})<=t)return{visibleCount:i,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1};const u=2*r+s+n,d=({truncatedIndex:v})=>v===i-1?0:u,p=({truncatedIndex:v})=>v>0?2*r+s:r,g=({truncatedIndex:v})=>Math.max(0,t-c({fullItemCount:v})-p({truncatedIndex:v})-d({truncatedIndex:v})),A=Math.max(0,t-u);if(g({truncatedIndex:0})<WA){const v=g({truncatedIndex:0});return{visibleCount:0,truncatedIndex:0,truncatedMaxWidth:v,truncatedSlotNeedsEllipsis:o({truncatedIndex:0,truncatedMaxWidth:v})}}const E=ase({itemCount:i,itemWidths:e,getCrumbRowWidth:c,widthBeforeDropdownTail:A,getAvailableForTruncatedSlot:g,getTruncatedSlotNeedsEllipsis:o});if(E.resultType==="layout")return E.layout;const x=E.visibleCount;if(x===0){const v=g({truncatedIndex:0});return{visibleCount:0,truncatedIndex:0,truncatedMaxWidth:v,truncatedSlotNeedsEllipsis:o({truncatedIndex:0,truncatedMaxWidth:v})}}if(i-x<=0)return{visibleCount:x,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1};const I=g({truncatedIndex:x});return I<WA?lse({startCount:x-1,itemWidths:e,getAvailableForTruncatedSlot:g,getTruncatedSlotNeedsEllipsis:o}):(e[x]??0)<=I+1?{visibleCount:x+1,truncatedIndex:null,truncatedMaxWidth:null,truncatedSlotNeedsEllipsis:!1}:{visibleCount:x,truncatedIndex:x,truncatedMaxWidth:I,truncatedSlotNeedsEllipsis:o({truncatedIndex:x,truncatedMaxWidth:I})}},use=({entry:e})=>{const t=e.borderBoxSize,n=e.contentBoxSize;return Array.isArray(t)&&t[0]?.inlineSize?Math.floor(t[0].inlineSize):Array.isArray(n)&&n[0]?.inlineSize?Math.floor(n[0].inlineSize):Math.floor(e.contentRect.width)},Zp=({containerElement:e})=>{const t=Math.floor(e.getBoundingClientRect().width),n=e.clientWidth;return t>0?t:n>0?n:0},dse=({items:e,shadowRowElement:t,itemMeasureRefs:n,separatorMeasureRef:s,dropdownMeasureRef:r})=>{n.current.length=e.length;const i=window.getComputedStyle(t),o=Gne({columnGap:i.columnGap,gap:i.gap}),c=Number.parseFloat(o),u=Number.isNaN(c)?sse:c,d=K6({measuredWidth:s.current?.offsetWidth,fallback:tse}),p=K6({measuredWidth:r.current?.offsetWidth,fallback:nse}),g=e.map((A,E)=>n.current[E]?.offsetWidth??0);return g.some(A=>A===0)?null:{itemWidths:g,separatorWidth:d,dropdownWidth:p,gapWidth:u}},fse=({items:e})=>{const t=l.useRef(null),n=l.useRef(null),s=l.useRef(null),r=l.useRef(null),i=l.useRef(null),o=l.useRef([]),[c,u]=l.useState(null),[d,p]=l.useState(0),[g,A]=l.useState(UI),[E,x]=l.useState(!1),y=l.useCallback(b=>{t.current=b,u(b)},[]),I=l.useCallback(b=>{n.current=b},[]),v=l.useCallback(({index:b})=>w=>{o.current[b]=w},[]),S=l.useCallback(({widthOverride:b}={})=>{const w=t.current,_=s.current,N=qne({container:w,shadowRow:_});if(!N){x(!1);return}const R=b??Zp({containerElement:N.container});if(R<=0){x(!1);return}const D=dse({items:e,shadowRowElement:N.shadowRow,itemMeasureRefs:o,separatorMeasureRef:r,dropdownMeasureRef:i});if(!D){x(!1);return}const k=cse({itemWidths:D.itemWidths,containerWidth:R,dropdownWidth:D.dropdownWidth,separatorWidth:D.separatorWidth,gapWidth:D.gapWidth});return p(L=>L===R?L:R),A(L=>rse({left:L,right:k})?L:k),x(!0),{layout:k,width:R}},[e]);return l.useLayoutEffect(()=>{A(UI),x(!1)},[e]),l.useLayoutEffect(()=>{if(d>0){S({widthOverride:d});return}S({})},[e,d,S]),l.useLayoutEffect(()=>{const b=n.current;if(!Wne(b,E,d)||b.scrollWidth<=b.clientWidth+1)return;const w=Zp({containerElement:b});Kne({rowWidth:w,containerWidth:d})||S({widthOverride:w})},[d,E,g,S]),l.useEffect(()=>{if(!c)return;const b=R=>{const D=R.find(L=>L.target===c);if(!D)return;const k=use({entry:D});k<=0||p(L=>L===k?L:k)},w=new ResizeObserver(b);w.observe(c);const _=Zp({containerElement:c});_>0&&p(R=>R===_?R:_);const N=()=>{const R=Zp({containerElement:c});R<=0||p(D=>D===R?D:R)};return window.addEventListener("resize",N,{passive:!0}),()=>{w.disconnect(),window.removeEventListener("resize",N)}},[c]),l.useEffect(()=>{if(!document.fonts?.ready)return;const b={isCancelled:!1};return document.fonts.ready.then(()=>
854{if(b.isCancelled)return;const w=t.current;if(!w)return;const _=Zp({containerElement:w});_<=0||p(N=>N===_?N:_)}),()=>{b.isCancelled=!0}},[e]),{layout:g,containerWidth:d,isLayoutReady:E,handleContainerRef:y,handleRowRef:I,shadowRowRef:s,separatorMeasureRef:r,dropdownMeasureRef:i,handleItemMeasureRef:v}},$6=300,pse=({segments:e,isTightFooterSpacing:t})=>{const n=Fe(),s=l.useMemo(()=>(e??[]).map((D,k)=>({id:`${D.to??"segment"}-${D.text}-${k}`,text:D.text,to:D.to})),[e]),{layout:r,containerWidth:i,isLayoutReady:o,handleContainerRef:c,handleRowRef:u,shadowRowRef:d,separatorMeasureRef:p,dropdownMeasureRef:g,handleItemMeasureRef:A}=fse({items:s}),E=l.useMemo(()=>r.truncatedIndex!=null?r.truncatedIndex+1:r.visibleCount,[r.truncatedIndex,r.visibleCount]),x=l.useMemo(()=>s.slice(E),[E,s]),y=l.useMemo(()=>x.map(D=>({label:D.text,value:D.id,to:D.to,state:n.state})),[x,n.state]),I=l.useMemo(()=>i?Math.min(i,$6):$6,[i]),v=l.useCallback(D=>D.to?a.jsx(Je,{to:D.to,state:n.state,className:"block max-w-full truncate hover:text-zinc-950 transition-colors",children:D.text}):a.jsx("span",{className:"block max-w-full truncate hover:text-zinc-950 transition-colors",children:D.text}),[n.state]),S=l.useCallback(D=>a.jsx("span",{className:"shrink-0 min-w-0 max-w-full whitespace-nowrap",children:v(D)}),[v]),b=l.useCallback(D=>a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"right",isDisableOnTouch:!0,content:a.jsx("p",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-50 w-max max-w-[300px] wrap-break-word whitespace-normal",children:D.text}
854),children:a.jsx("span",{className:"block min-w-0 w-full truncate",children:v(D)})}),[v]),w=l.useCallback(()=>a.jsx("span",{className:"text-zinc-300 shrink-0 whitespace-nowrap","aria-hidden":!0,children:"›"}),[]),_=l.useMemo(()=>r.truncatedIndex!=null?s.slice(0,r.truncatedIndex):s.slice(0,r.visibleCount),[s,r.truncatedIndex,r.visibleCount]),N=l.useMemo(()=>r.truncatedIndex!=null?s[r.truncatedIndex]??null:null,[s,r.truncatedIndex]),R=o&&x.length>0;return s.length?a.jsx("div",{ref:c,className:"w-full min-w-0 max-w-full",children:a.jsxs("div",{className:Y("relative flex w-full min-w-0 max-w-full items-center roboto-flex-100-600-1 text-[14px] leading-[20px] text-zinc-400",!!t&&"mb-0 h-5",!t&&"mb-0.5 h-8"),children:[a.jsxs("div",{ref:d,"aria-hidden":!0,className:"pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex w-max items-center gap-1.5 whitespace-nowrap opacity-0",children:[s.map((D,k)=>a.jsxs(l.Fragment,{children:[a.jsx("span",{ref:A({index:k}),className:"inline-block shrink-0 whitespace-nowrap",children:D.text}),k<s.length-1&&a.jsx("span",{ref:(()=>{if(k===0)return p})(),className:"text-zinc-300 shrink-0 whitespace-nowrap",children:"›"})]},D.id)),a.jsx("span",{ref:g,className:"inline-block shrink-0 whitespace-nowrap px-0.5 roboto-flex-100-600-1 text-[14px] leading-[20px]",children:"..."})]}),a.jsxs("div",{ref:u,className:"flex min-w-0 w-full max-w-full items-center gap-1.5",children:[a.jsx("div",{className:"flex min-w-0 shrink items-center gap-1.5 overflow-x-clip",children:o&&_.map((D,k)=>a.jsxs(l.Fragment,{children:[k>0&&w(),S(D)]},D.id))}),o&&!!N&&r.truncatedMaxWidth!=null&&a.jsxs(a.Fragment,{children:[_.length>0&&w(),a.jsxs("div",{className:"min-w-0 flex-1",children:[r.truncatedSlotNeedsEllipsis&&b(N),!r.truncatedSlotNeedsEllipsis&&S(N)]})]}),!!R&&a.jsxs(a.Fragment,{children:[Qne({visibleCountBeforeTruncate:_.length,hasTruncatedItem:!!N})&&w(),a.jsx("div",{className:"relative z-30 shrink-0",children:a.jsx(vm,{options:y,isClearable:!1,isArrow:!1,isCompactLabel:!0,verticalPosition:"bottom",horizontalPosition:"right",isCloseOnScroll:!0,isOptionWrap:!0,popupMaxWidth:I,placeholder:"..."})})]})]})]})}):null},zI=({sourcePath:e,targetPath:t})=>a.jsxs("div",{className:"space-y-px",children:[a.jsx(oa,{label:"path",sourcePath:e,className:"mt-0"}),a.jsx(oa,{label:"target",sourcePath:t,className:"mt-0"})]}),xa=({pathSegments:e,sourcePath:t,targetPath:n,children:s})=>a.jsxs("div",{className:"mb-3 last:mb-0",children:[a.jsx(pse,{segments:e,isTightFooterSpacing:!0}),a.jsx(zI,{sourcePath:t,targetPath:n}),s]}),hse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{eventIndex:A,relativeField:E}=l.useMemo(()=>{const N={},R=gi(e),D=R.findIndex(k=>k.name==="events"&&k.indices.length>0);if(D!==-1){N.eventIndex=R[D].indices[0];const k=D+1;if(R.length>k){const L=R[k].name;Object.prototype.hasOwnProperty.call(r.linkFieldConfig,L)&&(N.relativeField=L)}}return N},[e,r]),x=l.useMemo(()=>{if(A===void 0||!E)return;const N=n?._source?.case_narrative?.events?.[A],R=r.getLinkFieldData({fieldName:E,event:N,caseData:n});if(R&&R.value)return R},[E,A,n,r]),y=l.useMemo(()=>{if(A===void 0)return;const N=h.client.case.firstInstance.fabula.menu.titles.SECTION,R=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${A+1}`,D=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"fabula"}),k=(()=>{if(D!==void 0&&A!==void 0)return A===0?D:`${D}/${A}`})();return[{text:N,to:D},{text:R,to:k}]},[c,d,g,A]),I=l.useMemo(()=>{if(A!==void 0)return n?._source?.case_narrative?.events?.[A]},[n?._source?.case_narrative?.events,A]),v=l.useMemo(()=>{const N=I?.date;if(typeof N!="string")return"";const R=N.trim();return R||""},[I?.date]),S=l.useMemo(()=>Kt({dateString:v,isWithTime:!1,isShortMonth:!1}),[v]),b=l.useMemo(()=>{const N=I?.event_description;if(typeof N!="string")return"";const R=N.trim();return R||""},[I?.event_description]),w=l.useMemo(()=>{const N=I?.location;if(typeof N!="string")return"";const R=N.trim();return R||""},[I?.location]),_=l.useMemo(()=>{const N=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.f
854irstInstance.fabula.event.placeholders.NOT_SPECIFIED});return x?a.jsxs(a.Fragment,{children:[N,a.jsx(pn,{isGrouped:t,label:x.label,text:x.value,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):a.jsxs(a.Fragment,{children:[N,a.jsx(pn,{isGrouped:t,label:h.client.case.firstInstance.fabula.event.link.fields.SHORT_DESCRIPTION,text:b,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:h.client.case.firstInstance.fabula.event.link.fields.DATE,text:S,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:h.client.case.firstInstance.fabula.event.link.fields.LOCATION,text:w,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]})},[x,t,b,S,w,s]);return a.jsx(xa,{pathSegments:y,sourcePath:i,targetPath:o,children:_})},mse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{eventIndex:A,felonyIndex:E,relativeField:x}=l.useMemo(()=>{const b={},w=gi(e);w.length>=3&&w[0].name==="case_narrative"&&w[1].name==="events"&&w[1].indices.length===1&&w[2].name==="felonies"&&w[2].indices.length===1&&(b.eventIndex=w[1].indices[0],b.felonyIndex=w[2].indices[0]);const _=w.findIndex(N=>N.name==="felonies"&&N.indices.length>0);if(_!==-1&&w.length>_+1){const N=w[_+1].name;Object.prototype.hasOwnProperty.call(r.linkFieldConfig,N)&&(b.relativeField=N)}return b},[e,r]),y=l.useMemo(()=>{if(A!==void 0&&E!==void 0)return n?._source?.case_narrative?.events?.[A]?.felonies?.[E]},[n?._source?.case_narrative?.events,A,E]),I=l.useMemo(()=>{const b=y?.objects?.primary_object?.related_law?.law,w=b?.part,_=b?.article,N=b?.clause;return _?et({clause:N,part:w,number:_}):""},[y]),v=l.useMemo(()=>{if(A===void 0||E===void 0)return;const b=h.client.case.firstInstance.fabula.menu.titles.SECTION,w=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${(A??0)+1}`,_=wm({articleText:I,fallbackTitle:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE}),N=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"fabula"}),R=Tm({base:N,index:A}),D=Nm({eventPath:R,eventIndex:A,felonyIndex:E});return[{text:b,to:N},{text:w,to:R},{text:_,to:D}]},[c,d,g,A,E,I]),S=l.useMemo(()=>{const b=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),w=a.jsxs(a.Fragment,{children:[b,a.jsx(pn,{isGrouped:t,label:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE,text:I,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]});if(!x)return w;const _=r.getLinkFieldData({fieldName:x,felony:y,caseData:n,eventIndex:A,felonyIndex:E});return _?a.jsxs(a.Fragment,{children:[b,a.jsx(pn,{isGrouped:t,label:_.label,text:_.value,sourcePath:_.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):w},[x,y,n,A,E,t,I,s,r]);return a.jsx(xa,{pathSegments:v,sourcePath:i,targetPath:o,children:S})},gse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{eventIndex:A,felonyIndex:E,actionIndex:x,relativeField:y,harmIndex:I}=l.useMemo(()=>{const _={},N=gi(e);if(N.length>=5&&N[0].name==="case_narrative"&&N[1].name==="events"&&N[1].indices.length===1&&N[2].name==="felonies"&&N[2].indices.length===1&&N[3].name==="objective_part"&&N[4].name==="actions"&&N[4].indices.length===1){_.eventIndex=N[1].indices[0],_.actionIndex=N[4].indices[
8540],_.felonyIndex=N[2].indices[0];const R=N.findIndex(D=>D.name==="victims_harm"&&D.indices.length===1);if(R===-1&&(_.relativeField=N[5]?.name),R!==-1){_.harmIndex=N[R].indices[0];const D=R+1;N.length>D&&(_.relativeField=N[D].name)}}return _},[e]),v=l.useMemo(()=>{if(A===void 0||E===void 0)return"";const N=n?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objects?.primary_object?.related_law?.law,R=N?.part,D=N?.article,k=N?.clause;return D?et({clause:k,part:R,number:D}):""},[n?._source?.case_narrative?.events,A,E]),S=l.useMemo(()=>{if(A===void 0||x===void 0)return;const _=h.client.case.firstInstance.fabula.menu.titles.SECTION,N=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${(A??0)+1}`,R=wm({articleText:v,fallbackTitle:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE}),D=`${h.client.case.firstInstance.fabula.event.titles.ACTION} ${(x??0)+1}`,k=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"fabula"}),L=Tm({base:k,index:A}),O=Nm({eventPath:L,eventIndex:A,felonyIndex:E}),P=m7({index:x,prefix:"#action-"});return[{text:_,to:k},{text:N,to:L},{text:R,to:O},{text:D,to:uE({path:O,hashSuffix:P})}]},[c,d,g,A,E,x,v]),b=l.useMemo(()=>{if(A!==void 0&&E!==void 0&&x!==void 0)return n?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objective_part?.actions?.[x]},[n?._source?.case_narrative?.events,A,E,x]),w=l.useMemo(()=>{const _=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),N={action:b,caseData:n,eventIndex:A,felonyIndex:E,actionIndex:x,harmIndex:I},R=r.getLinkFieldData({fieldName:"description",...N}),D=r.getLinkFieldData({fieldName:"injuries",...N}),k=a.jsxs(a.Fragment,{children:[_,a.jsx(pn,{isGrouped:t,label:R?.label??"",text:R?.value??"",sourcePath:R?.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:D?.label??"",text:D?.value??"",sourcePath:D?.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]});if(!y)return k;const L=g7({relativeField:y,linkFieldConfig:r.linkFieldConfig});if(!L)return k;const O=r.getLinkFieldData({fieldName:L,...N});return O?a.jsxs(a.Fragment,{children:[_,a.jsx(pn,{isGrouped:t,label:O.label,text:O.value,sourcePath:O.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):k},[s,t,y,b,n,r,A,E,x,I]);return a.jsx(xa,{pathSegments:S,sourcePath:i,targetPath:o,children:w})},Ase=({path:e,caseData:t,isGrouped:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{eventIndex:A,felonyIndex:E,relativeField:x}=l.useMemo(()=>{const R=gi(e);if(R.length>=4&&R[0].name==="case_narrative"&&R[1].name==="events"&&R[1].indices.length===1&&R[2].name==="felonies"&&R[2].indices.length===1&&R[3].name==="objective_part"){const D={eventIndex:R[1].indices[0],felonyIndex:R[2].indices[0]};if(R.length>4){const k=R[4].name;Object.prototype.hasOwnProperty.call(r.linkFieldConfig,k)&&(D.relativeField=k)}return{eventIndex:D.eventIndex,felonyIndex:D.felonyIndex,relativeField:D.relativeField}}return{eventIndex:void 0,felonyIndex:void 0,relativeField:void 0}},[e,r]),y=l.useMemo(()=>{if(A!==void 0&&E!==void 0)return t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objective_part},[t?._source?.case_narrative?.events,A,E]),I=l.useMemo(()=>{if(A===void 0||E===void 0)return"";const D=t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objects?.primary_object?.related_law?.law,k=D?.part,L=D?.article,O=D?.clause;return L?et({clause:O,part:k,number:L}):""},[t?._source?.case_narrative?.events,A,E]),v=l.useMemo(()=>{if(A===void 0||E===void 0)return;const R=h.client.case.firstInstance.fabula.menu.titles.SECTION,D=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${(A??0)+1}`,k=wm({articleText:I,fallbackTitle:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE}),L=h.client.case.firstInstance.fabula.event.titles.OBJECTIVE_PART,O=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"fabula"}),P=Tm({base:O,index:A}),B=Nm({eventPath:P,eventIndex:A,felonyIndex:E});return[{text:R,to:O},{text:D,to:P},{text:k,to:B},{text:L,to:uE({path:B,hashSuffix:"#objective-part"})}]},[c,d,g,A,E,I]),S=l.useMemo(()=>
854{if(A===void 0||E===void 0)return;const R=t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objective_part?.actions??[];if(Array.isArray(R)&&R.length!==0)return R[0]},[t?._source?.case_narrative?.events,A,E]),b=l.useMemo(()=>{const R=S?.description;if(typeof R!="string")return"";const D=R.trim();return D||""},[S]),w=l.useMemo(()=>{const R=(()=>{const D=S?.date;return typeof D=="string"?D:""})();return Kt({dateString:R,isWithTime:!1,isShortMonth:!1})},[S]),_=l.useMemo(()=>{const R=S?.location;if(typeof R!="string")return"";const D=R.trim();return D||""},[S]),N=l.useMemo(()=>{const R=a.jsx(Ro,{additionalFields:s,isGrouped:n,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),D=a.jsxs(a.Fragment,{children:[R,a.jsx(pn,{isGrouped:n,label:h.client.case.firstInstance.fabula.event.fields.ACTION_DESCRIPTION,text:b,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:n,label:h.client.case.firstInstance.fabula.event.link.fields.DATE,text:w,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:n,label:h.client.case.firstInstance.fabula.event.link.fields.LOCATION,text:_,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]});if(!x)return D;const k=r.getLinkFieldData({fieldName:x,objectivePart:y,caseData:t});return k?a.jsxs(a.Fragment,{children:[R,a.jsx(pn,{isGrouped:n,label:k.label,text:k.value,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):D},[x,y,t,n,b,w,_,s,r]);return a.jsx(xa,{pathSegments:v,sourcePath:i,targetPath:o,children:N})},Ese=({path:e,caseData:t,additionalFields:n,linkFieldConfig:s,sourcePath:r,targetPath:i})=>{const{id:o,listInstance:c,caseId:u,caseInstance:d}=st(),p=`/clients/${o}/cases/${c??"first-instance"}/${u}/${d??"first-instance"}`,{eventIndex:g,felonyIndex:A,subjectivePartIndex:E,relativeField:x}=l.useMemo(()=>{const _=gi(e);return _.length>=4&&_[0].name==="case_narrative"&&_[1].name==="events"&&_[1].indices.length===1&&_[2].name==="felonies"&&_[2].indices.length===1&&_[3].name==="subjective_parts"&&_[3].indices.length===1?{eventIndex:_[1].indices[0],felonyIndex:_[2].indices[
8540],subjectivePartIndex:_[3].indices[0],relativeField:_[4]?.name}:{eventIndex:void 0,felonyIndex:void 0,subjectivePartIndex:void 0,relativeField:void 0}},[e]),y=l.useMemo(()=>{if(g===void 0||A===void 0)return"";const N=t?._source?.case_narrative?.events?.[g]?.felonies?.[A]?.objects?.primary_object?.related_law?.law,R=N?.part,D=N?.article,k=N?.clause;return D?et({clause:k,part:R,number:D}):""},[t?._source?.case_narrative?.events,g,A]),I=l.useMemo(()=>{if(g===void 0||A===void 0)return;const _=h.client.case.firstInstance.fabula.menu.titles.SECTION,N=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${(g??0)+1}`,R=wm({articleText:y,fallbackTitle:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE}),D=h.client.case.firstInstance.fabula.event.titles.SUBJECTIVE_PARTS,k=Ea({clientId:o,caseId:u,basePath:p,pathSuffix:"fabula"}),L=Tm({base:k,index:g}),O=Nm({eventPath:L,eventIndex:g,felonyIndex:A}),P=m7({index:E,prefix:"#subjective-part-"});return[{text:_,to:k},{text:N,to:L},{text:R,to:O},{text:D,to:uE({path:O,hashSuffix:P})}]},[o,u,p,g,A,E,y]),v=l.useMemo(()=>{if(g===void 0||A===void 0||E===void 0)return;const _=t?._source?.case_narrative?.events?.[g]?.felonies?.[A]?.subjective_parts??[];if(Array.isArray(_)&&_.length!==0)return _[E]},[t?._source?.case_narrative?.events,g,A,E]),S=l.useMemo(()=>({subjectivePart:v,caseData:t,eventIndex:g,felonyIndex:A,subjectivePartIndex:E}),[v,t,g,A,E]),b=l.useCallback(({fieldName:_})=>{const N=s.getLinkFieldData({fieldName:_,...S});return N?a.jsx(pn,{isGrouped:!0,label:N.label,text:N.value,sourcePath:N.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}):null},[s,S]),w=l.useMemo(()=>{const _=a.jsx(Ro,{additionalFields:n,isGrouped:!0,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),N=a.jsxs(a.Fragment,{children:[_,b({fieldName:"intent_type"}),b({fieldName:"intents"}),b({fieldName:"motives"}),b({fieldName:"goals"})]});if(!x)return N;const R=g7({relativeField:x,linkFieldConfig:s.linkFieldConfig});if(!R)return N;const D=s.getLinkFieldData({fieldName:R,...S});return D?a.jsxs(a.Fragment,{children:[_,a.jsx(pn,{isGrouped:!0,label:D.label,text:D.value,sourcePath:D.sourcePath,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):N},[x,n,s,S,b]);return a.jsx(xa,{pathSegments:I,sourcePath:r,targetPath:i,children:w})},xse=({path:e,caseData:t,isGrouped:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{eventIndex:A,felonyIndex:E,relativeField:x}=l.useMemo(()=>{const _=gi(e);return _.length>=4&&_[0].name==="case_narrative"&&_[1].name==="events"&&_[1].indices.length===1&&_[2].name==="felonies"&&_[2].indices.length===1&&_[3].name==="objects"?{eventIndex:_[1].indices[0],felonyIndex:_[2].indices[
8540],relativeField:void 0}:{eventIndex:void 0,felonyIndex:void 0,relativeField:void 0}},[e]),y=l.useMemo(()=>{if(!r.linkFieldConfig)return;const _=gi(e);if(Hne({segments:_}))return;const N=_.slice(4).map(D=>D.name);return Object.entries(r.linkFieldConfig).find(([,D])=>D.path?.length===N.length&&D.path.every((k,L)=>k===N[L]))?.[0]},[e,r]),I=l.useMemo(()=>{if(A===void 0||E===void 0)return"";const N=t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objects?.primary_object?.related_law?.law,R=N?.part,D=N?.article,k=N?.clause;return D?et({clause:k,part:R,number:D}):""},[t?._source?.case_narrative?.events,A,E]),v=l.useMemo(()=>{if(A===void 0||E===void 0)return;const _=h.client.case.firstInstance.fabula.menu.titles.SECTION,N=`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${(A??0)+1}`,R=wm({articleText:I,fallbackTitle:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE}),D=h.client.case.firstInstance.fabula.event.titles.OBJECTS,k=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"fabula"}),L=Tm({base:k,index:A}),O=Nm({eventPath:L,eventIndex:A,felonyIndex:E});return[{text:_,to:k},{text:N,to:L},{text:R,to:O},{text:D,to:uE({path:O,hashSuffix:"#objects"})}]},[c,d,g,A,E,I]),S=l.useMemo(()=>{if(A===void 0||E===void 0)return"";const N=t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objects?.primary_object?.description;if(typeof N!="string")return"";const R=N.trim();return R||""},[t?._source?.case_narrative?.events,A,E]),b=l.useMemo(()=>{if(A!==void 0&&E!==void 0)return t?._source?.case_narrative?.events?.[A]?.felonies?.[E]?.objects},[t?._source?.case_narrative?.events,A,E]),w=l.useMemo(()=>{const _=a.jsx(Ro,{additionalFields:s,isGrouped:n,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}),N=a.jsxs(a.Fragment,{children:[_,a.jsx(pn,{isGrouped:n,label:h.client.case.firstInstance.fabula.event.fields.OBJECT_DESCRIPTION,text:S,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}),R=x??y;if(!R)return N;const D=r.getLinkFieldData({fieldName:R,objects:b,caseData:t});return D?a.jsxs(a.Fragment,{children:[_,a.jsx(pn,{isGrouped:n,label:D.label,text:D.value,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED})]}):N},[x,y,b,t,n,S,s,r]);return a.jsx(xa,{pathSegments:v,sourcePath:i,targetPath:o,children:w})},Cse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{accusedIndex:A,fieldTailPath:E,fieldTailSegments:x}=l.useMemo(()=>{const b=gi(e);if(b.length>=2&&b[0].name==="general_information"&&b[1].name==="accused"&&b[1].indices.length===1){const w=b[1].indices[0],_=b.slice(2).map(R=>R.name),N=b.slice(2);return{accusedIndex:w,fieldTailPath:_,fieldTailSegments:N}}return{accusedIndex:void 0,fieldTailPath:void 0,fieldTailSegments:void 0}},[e]),y=l.useMemo(()=>{if(A===void 0)return;const b=h.client.case.firstInstance.information.menu.titles.SECTION,w=h.client.case.firstInstance.information.menu.items.ACCUSED,N=(()=>{const k=n?._source?.general_information?.accused?.[A]?.name??"";return typeof k!="string"?"":k.trim()})()??`${h.client.case.firstInstance.evidence.item.fields.ACCUSED_NAME} ${(A??0)+1}`,R=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"information"}),D=`#accused-${A}`;return[{text:b,to:R},{text:w,to:BI({base:R,suffix:"/accused"})},{text:N,to:BI({base:R,suffix:`/accused${D}`})}]},[c,d,g,A,n?._source?.general_information?.accused]),I=l.useMemo(()=>{if(A!==void 0)return n?._source?.general_information?.accused?.[A]},[n?._source?.general_information?.accused,A]),v=l.useMemo(()=>{const b=I?.name;if(typeof b!="string")return"";const w=b.trim();return w||""},[I]),S=l.useMemo(()=>{const b=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}),w=(()=>{if((E?.length??0)!==0)return r.getLinkFieldData({fieldTailPath:E,fieldTailSegments:x,accused:I,caseData:n,accusedIndex:A})})();if(!w){const _=r.getLinkFieldData({fieldTailPath:["name"],fieldTailSegments:x,accused:I,caseData:n,accusedIndex:A});return a.jsxs(a.Fragment,{children:[b,a.jsx(pn,{isGrouped:t,label:_?.label??h.client.case.f
854irstInstance.information.accused.fields.NAME,text:_?.value??v,sourcePath:_?.sourcePath,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED})]})}return a.jsxs(a.Fragment,{children:[b,a.jsx(pn,{isGrouped:t,label:w.label,text:w.value,sourcePath:w.sourcePath,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED})]})},[s,t,E,x,I,n,A,v,r]);return a.jsx(xa,{pathSegments:y,sourcePath:i,targetPath:o,children:S})},pE=e=>{const t=gi(e);return t.length>=4&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1&&t[2].name==="felonies"&&t[2].indices.length===1&&t[3].name==="objects"?"OBJECTS":t.length>=4&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1&&t[2].name==="felonies"&&t[2].indices.length===1&&t[3].name==="subjective_parts"&&t[3].indices.length===1?"SUBJECTIVE_PART":t.length>=5&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1&&t[2].name==="felonies"&&t[2].indices.length===1&&t[3].name==="objective_part"&&t[4].name==="actions"&&t[4].indices.length===1?"ACTION":t.length>=4&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1&&t[2].name==="felonies"&&t[2].indices.length===1&&t[3].name==="objective_part"?"OBJECTIVE_PART":t.length>=2&&t[0].name==="general_information"&&t[1].name==="accused"&&t[1].indices.length===1?"ACCUSED":t.length>=1&&t[0].name==="evidence"&&t[0].indices.length===1?"EVIDENCE":t.length>=1&&t[0].name==="testimonies"&&t[0].indices.length===1?"TESTIMONY":t.length>=2&&t[0].name==="circumstances"&&t[0].indices.length===1&&t[1].name==="related_circumstances"&&t[1].indices.length===1||t.length>=1&&t[0].name==="circumstances"&&t[0].indices.length===1?"CIRCUMSTANCE":t.length>=3&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1&&t[2].name==="felonies"&&t[2].indices.length===1?"FELONY":t.length>=2&&t[0].name==="case_narrative"&&t[1].name==="events"&&t[1].indices.length===1?"EVENT":"UNKNOWN"},yse=e=>{const t=e.trim();return t?pE(t)!=="UNKNOWN":!1},Wl=(e,t)=>!yse(e)||!t?._source?!1:f2(e.trim(),t._source)!==void 0,f2=(e,t)=>{if(typeof e!="string"||e.length===0)return;let n=t;const s=e.split("."),r=(o,c)=>{if(o!==null&&typeof o=="object"&&!Array.isArray(o))return o[c]},i=(o,c)=>{if(Array.isArray(o))return o[c]};for(const o of s){const c=o.match(/^([a-zA-Z0-9_]+)/),u=c?c[1]:"";if(n=r(n,u),n===void 0)return;const d=/\[(\d+)\]/g;let p;for(;(p=d.exec(o))!==null;)if(n=i(n,Number(p[1])),n===void 0)return}return n},Wi=({ids:e,path:t,caseData:n})=>{if(!e)return null;const s=Array.isArray(e)?e:[e];if(!s.length)return null;const r=f2(t,n?._source);return!Array.isArray(r)||!r.length?null:s.map(i=>{const o=r.findIndex(c=>c?.id===i);return o===-1?null:`${t}[${o}]`}).filter(i=>!!i)},bse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{evidenceIndex:A,fieldTailPath:E,fieldTailSegments:x}=l.useMemo(()=>{const S=gi(e);if(S.length>=1&&S[0].name==="evidence"&&S[0].indices.length===1){const b=S[0].indices[0],w=S.slice(1).map(N=>N.name),_=S.slice(1);return{evidenceIndex:b,fieldTailPath:w,fieldTailSegments:_}}return{evidenceIndex:void 0,fieldTailPath:void 0,fieldTailSegments:void 0}},[e]),y=l.useMemo(()=>{if(A!==void 0)return n?._source?.evidence?.[A]},[n?._source?.evidence,A]),I=l.useMemo(()=>{if(A===void 0)return;const S=h.client.case.firstInstance.evidence.menu.titles.SECTION,b=(()=>{const R=(()=>{if(y){if("title"in y)return y.title;if("evidence_title"in y)return y.evidence_title}})(),D=cE({value:R}),k=`${h.client.case.firstInstance.evidence.menu.items.EVIDENCE} ${A+1}`;return h7({explicitTitle:D,titleBase:k})})(),w=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"evidence"}),_=(()=>{if(y){if("accused_ids"in y)return y.accused_ids?.[0];if("related_accused_ids"in y)return y.related_accused_ids?.[0]}})(),N=A===0||!w||!_||!y?.evidence_id?w:`${w}/evidence/${_}/${y.evidence_id}`;return[{text:S,to:w},{text:b,to:N}]},[c,d,g,A,y]),v=l.useMemo(()=>{const S=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.f
854irstInstance.evidence.item.placeholders.NOT_SPECIFIED}),b={evidence:y,caseData:n,evidenceIndex:A},w=(()=>{const N=(()=>{if(y)return"title"in y?r.getLinkFieldData({fieldTailPath:["title"],...b}):r.getLinkFieldData({fieldTailPath:["evidence_title"],...b})})(),R=r.getLinkFieldData({fieldTailPath:["type"],...b}),D=(()=>{if(y&&"usage_in_felonies"in y)return r.getLinkFieldData({fieldTailPath:["usage_in_felonies","purpose"],fieldTailSegments:x,...b})})();return a.jsxs(a.Fragment,{children:[S,a.jsx(pn,{isGrouped:t,label:N?.label??"",text:N?.value??"",sourcePath:N?.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:R?.label??"",text:R?.value??"",sourcePath:R?.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}),!!D&&a.jsx(pn,{isGrouped:t,label:D.label,text:D.value,sourcePath:D.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED})]})})();if(!(E&&E.length>0))return w;const _=r.getLinkFieldData({fieldTailPath:E,fieldTailSegments:x,evidence:y,caseData:n,evidenceIndex:A});return _?a.jsxs(a.Fragment,{children:[S,a.jsx(pn,{isGrouped:t,label:_.label,text:_.value,sourcePath:_.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED})]}):w},[E,x,y,n,A,t,s,r]);return a.jsx(xa,{pathSegments:I,sourcePath:i,targetPath:o,children:v})},Ise=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{testimonyIndex:A,fieldTailPath:E,fieldTailSegments:x}=l.useMemo(()=>{const S=gi(e);if(S.length>=1&&S[0].name==="testimonies"&&S[0].indices.length===1){const b=S[0].indices[0],w=S.slice(1).map(N=>N.name),_=S.slice(1);return{testimonyIndex:b,fieldTailPath:w,fieldTailSegments:_}}return{testimonyIndex:void 0,fieldTailPath:void 0,fieldTailSegments:void 0}},[e]),y=l.useMemo(()=>{if(A===void 0)return;const S=n?._source;if(S&&"testimonies"in S)return S.testimonies?.[A]},[n?._source,A]),I=l.useMemo(()=>{if(A===void 0)return;const S=h.client.case.firstInstance.evidence.menu.titles.SECTION,b=(()=>{const k=y?.description,L=cE({value:k}),O=`${h.client.case.firstInstance.evidence.item.titles.EVIDENCE} ${A+1}`;return h7({explicitTitle:L,titleBase:O})})(),w=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"evidence"}),_=(()=>{const k=n?._source?.evidence??[];return!(!Array.isArray(k)||k.length===0)})(),N=BI({base:w,suffix:"/testimony"}),R=y?(y.related_accused_ids??[]).find(L=>typeof L=="string"&&L):void 0,D=(()=>{if(!w)return;const k=y?.testimony_id,L=typeof k=="string"&&k?k:"";return N?!R||!L?A===0&&!_?w:N:A===0&&!_?w:`${N}/${R}/${L}`:w})();return[{text:S,to:w},{text:b,to:D}]},[c,d,g,A,n,y]),v=l.useMemo(()=>{const S=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}),b={testimony:y,caseData:n,testimonyIndex:A},w=r.getLinkFieldData({fieldTailPath:["name"],...b}),_=r.getLinkFieldData({fieldTailPath:["description"],...b}),N=r.getLinkFieldData({fieldTailPath:["type"],...b}),R=a.jsxs(a.Fragment,{children:[S,a.jsx(pn,{isGrouped:t,label:w?.label??"",text:w?.value??"",sourcePath:w?.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:_?.label??"",text:_?.value??"",sourcePath:_?.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}),a.jsx(pn,{isGrouped:t,label:N?.label??"",text:N?.value??"",sourcePath:N?.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED})]});if(!(E&&E.length>0))return R;const D=r.getLinkFieldData({fieldTailPath:E,fieldTailSegments:x,testimony:y,caseData:n,testimonyIndex:A});return D?a.jsxs(a.Fragment,{children:[S,a.jsx(pn,{isGrouped:t,label:D.label,text:D.value,sourcePath:D.sourcePath,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED})]}):R},[E,x,y,n,A,t,s,r]);return a.jsx(xa,{pathSegments:I,sourcePath:i,targetPath:o,children:v})},Sse=({path:e,isGrouped:t,caseData:n,additionalFields:s,linkFieldConfig:r,sourcePath:i,targetPath:o})=>{const{id:c,listInstance:u,caseId:d,caseInstance:p}
854=st(),g=`/clients/${c}/cases/${u??"first-instance"}/${d}/${p??"first-instance"}`,{circumstanceIndex:A,relatedIndex:E,fieldTailPath:x,fieldTailSegments:y}=l.useMemo(()=>{const N=gi(e),R={};return N.length>=1&&N[0].name==="circumstances"&&N[0].indices.length===1&&(R.circumstanceIndex=N[0].indices[0]),N.length>=2&&N[1].name==="related_circumstances"&&(N[1].indices.length===1&&(R.relatedIndex=N[1].indices[0]),R.fieldTailPath=N.slice(1).map(D=>D.name),R.fieldTailSegments=N.slice(1)),R},[e]),I=l.useMemo(()=>{if(A!==void 0)return n?._source?.circumstances?.[A]},[n?._source?.circumstances,A]),v=l.useMemo(()=>A===void 0?void 0:(I?.related_circumstances??[])?.[E??0],[I,A,E]),S=l.useMemo(()=>{if(A===void 0)return;const N=h.client.case.firstInstance.circumstances.menu.titles.SECTION,R=(()=>{const W=n?._source?.general_information?.accused??[],j=n?._source?.circumstances?.[A]?.related_accused_id??null;if(!j)return"";const q=W.find($=>$?.id===j),G=cE({value:q?.name});return G||`${h.client.case.firstInstance.circumstances.circumstance.fields.TYPE} ${A+1}`})(),D=Ea({clientId:c,caseId:d,basePath:g,pathSuffix:"circumstances"}),k=E??0,L=v?.circumstance_id??"",O=typeof L=="string"?L:"",P=({circumstanceIdx:W,relatedIdx:H,circumstanceId:j})=>W===0&&H===0||!j?D:`${D}/${j}`,F=I?.related_circumstances?.[0]?.circumstance_id??"",Q=P({circumstanceIdx:A,relatedIdx:0,circumstanceId:typeof F=="string"?F:""}),M=P({circumstanceIdx:A,relatedIdx:k,circumstanceId:O}),K=(()=>{const W=v?.description;if(typeof W!="string")return`${h.client.case.firstInstance.circumstances.circumstance.fields.TYPE} ${k+1}`;const H=W.trim();return H||`${h.client.case.firstInstance.circumstances.circumstance.fields.TYPE} ${k+1}`})();return[{text:N,to:D},{text:R,to:Q},{text:K,to:M}]},[A,c,d,g,E,v?.circumstance_id,v?.description,I?.related_circumstances,n?._source?.general_information?.accused,n?._source?.circumstances]),b=l.useMemo(()=>({circumstance:I,caseData:n,circumstanceIndex:A,relatedIndex:E}),[I,n,A,E]),w=l.useCallback(({fieldTailPathValue:N})=>{const R=r.getLinkFieldData({fieldTailPath:N,fieldTailSegments:y,...b});return R?a.jsx(pn,{isGrouped:t,label:R.label,text:R.value,sourcePath:R.sourcePath,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}):null},[y,t,r,b]),_=l.useMemo(()=>{const N=a.jsx(Ro,{additionalFields:s,isGrouped:t,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}),R=a.jsxs(a.Fragment,{children:[N,w({fieldTailPathValue:["related_circumstances","description"]}),w({fieldTailPathValue:["related_circumstances","type"]}),w({fieldTailPathValue:["related_circumstances","consideration_type"]})]});if(!(x&&x.length>0))return R;const D=r.getLinkFieldData({fieldTailPath:x,fieldTailSegments:y,...b});return D?a.jsxs(a.Fragment,{children:[N,a.jsx(pn,{isGrouped:t,label:D.label,text:D.value,sourcePath:D.sourcePath,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED})]}):R},[s,x,y,t,r,b,w]);return a.jsx(xa,{pathSegments:S,sourcePath:i,targetPath:o,children:_})},Ly=({isGrouped:e,text:t,linkFieldConfigs:n})=>{const s=Bne({value:t?.sourcePath}),r=l.useMemo(()=>{const u=t?.value,d=t?.caseData;if(typeof u!="string")return;const p=u.trim();if(!p)return;const g=pE(p);if(!d?._source)return{path:p,type:g,resolved:void 0};const A=f2(p,d._source);return{path:p,type:g,resolved:A}},[t?.value,t?.caseData]),i=Fne({linkData:r}),o=l.useMemo(()=>!r||r.type==="UNKNOWN"?null:r.type==="EVENT"?n?.event?a.jsx(hse,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.event,sourcePath:s,targetPath:i}):null:r.type==="FELONY"?n?.felony?a.jsx(mse,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.felony,sourcePath:s,targetPath:i}):null:r.type==="ACTION"?n?.action?a.jsx(gse,{path:r.path,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.action,sourcePath:s,targetPath:i}):null:r.type==="OBJECTIVE_PART"?n?.objectivePart?a.jsx(Ase,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.objectivePart,sourcePath:s,targetPath:i}):null:r.type==="SUBJECTIVE_PART"?n?.subjectivePart?a.jsx(Ese,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.subjectivePart,sourcePath:s,targetPath:i}):null:r.type==="OBJECTS"?n?.objects?a.jsx(xse,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.objects,sourcePath:s,targetPath:i}):null:r.type==="ACCUSED"?n?.accused?a.jsx(Cse,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.accused,sourcePath:s,targetPath:i}
854):null:r.type==="EVIDENCE"?n?.evidence?a.jsx(bse,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.evidence,sourcePath:s,targetPath:i}):null:r.type==="TESTIMONY"?n?.testimony?a.jsx(Ise,{path:r.path,resolved:r.resolved,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.testimony,sourcePath:s,targetPath:i}):null:r.type==="CIRCUMSTANCE"&&n?.circumstance?a.jsx(Sse,{path:r.path,isGrouped:e,additionalFields:t?.additionalFields,caseData:t?.caseData,linkFieldConfig:n.circumstance,sourcePath:s,targetPath:i}):null,[r,n,e,t?.additionalFields,t?.caseData,s,i]),c=l.useMemo(()=>FI(t?.additionalFields),[t?.additionalFields]);return!o&&!s&&!c?null:!o&&c?a.jsxs(a.Fragment,{children:[a.jsx(Ro,{additionalFields:t?.additionalFields,isGrouped:e,placeholder:t?.placeholder??""}),a.jsx(zI,{sourcePath:s,targetPath:i})]}):o||a.jsx(zI,{sourcePath:s,targetPath:i})},vse=({isGrouped:e,text:t,linkFieldConfigs:n,isValueDifferentFromCompare:s})=>{const r=l.useMemo(()=>cE({value:t?.valueToCompare})?a.jsx(Ly,{isGrouped:e,text:{...t,value:t.valueToCompare},linkFieldConfigs:n}):a.jsx(tn,{text:t?.placeholder??""}),[e,t,n]);return s?a.jsxs("div",{className:"flex flex-col gap-y-1.5 w-full bp72:flex-row bp72:gap-y-0",children:[a.jsx("div",{className:"w-full bp72:w-1/2 bp72:min-w-0 bp72:pr-1.5",children:a.jsx("span",{className:"inline-block line-through text-red-500 [&_a]:line-through [&_a]:text-red-500",children:a.jsx(Ly,{isGrouped:e,text:{...t,value:t?.value},linkFieldConfigs:n})})}),a.jsx("div",{className:"w-full bp72:w-1/2 bp72:min-w-0 bp72:pl-1.5",children:r})]}):a.jsx(Ly,{isGrouped:e,text:t,linkFieldConfigs:n})},_se=({valueToUse:e,valueToCompareFormatted:t,isValueDifferentFromCompare:n,isComparePlaceholder:s=!1})=>{if(!n||t===void 0)return a.jsx(tn,{text:e??""});const r=(e??"").trim(),i=(t??"").trim();return a.jsxs("div",{className:"flex flex-col gap-y-1.5 w-full bp72:flex-row bp72:gap-y-0",children:[a.jsx("div",{className:"w-full bp72:w-1/2 bp72:min-w-0 bp72:pr-1.5",children:a.jsx("span",{className:"line-through text-red-500",children:a.jsx(tn,{text:r})})}),a.jsx("div",{className:Y("w-full bp72:w-1/2 bp72:min-w-0 bp72:pl-1.5",!!s&&"text-zinc-400",!s&&"text-zinc-950"),children:a.jsx(tn,{text:i})})]})},p2=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_16803_43356)"},l.createElement("path",{d:"M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 6.66667H10.0083",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 10H9.9974V13.3333H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_16803_43356"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Tse=.25,Nse=Tse*16,wse=56,Ls=({children:e,text:t,isClampToParent:n=!0,isFollowCursor:s=!0,isBelow:r=!1,isClickBlocked:i=!1,isDisableOnTouch:o=!1,width:c,maxWidth:u,position:d,clampToScrollContainer:p=!1,verticalOffset:g=0,delay:A=250,disabled:E=!1,topOffset:x=wse,isTextCentered:y=!1})=>{const[I,v]=l.useState(!1),[S,b]=l.useState(0),[w,_]=l.useState(!1),N=l.useRef(null),R=l.useRef(null),D=l.useRef(null),k=l.useRef(ol(J=>{b(J)},1e3)).current,L=l.useRef(null),O=fE("(any-pointer: coarse), (hover: none)",!1),P=l.useMemo(()=>!!(O||typeof window<"u"&&"ontouchstart"in window||typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0),[O]),B=l.useMemo(()=>!(!o||!P),[o,P]),F=l.useMemo(()=>{if(!Array.isArray(t))return null;const J=t.filter(ne=>typeof ne=="string");return J.length!==t.length?null:J},[t]),z=l.useCallback(({element:J})=>{const ne=[window];let X=J?.parentElement;for(;X;){const oe=getComputedStyle(X),ie=oe.overflowY||oe.overflow;(ie==="auto"||ie==="scroll"||ie==="overlay")&&X.scrollHeight>X.clientHeight&&ne.push(X),X=X.parentElement}return ne},[]),Q=l.useCallback(({element:J})=>{const ne=["auto","scroll","hidden","clip"];let X=J?.parentElement;for(;X;){const oe=getComputedStyle(X);if(ne.includes(oe.overflowX)||ne.includes(oe.overflowY))return X;X=X.parentElement}return null},[]),M=l.useCallback(({pageX:J})=>{const ne=N.current,X=R.current;if(!ne||!X)return 0;const oe=ne.getBoundingClientRect(),ie=X.offsetWidth/2,ee=s?J-oe.left-ie:d==="left"?0:d==="right"?oe.width-X.offsetWidth:oe.width/2-ie,te=n?Math.min(Math.max(ee,0),oe.width-X.offsetWidth):ee,le=oe.left+te,he=16,fe=(()=>
854{if(!p)return null;const xe=Q({element:ne});return xe?xe.getBoundingClientRect():null})(),ue=fe?Math.max(he,fe.left+he):he,ye=(()=>{const xe=window.innerWidth-X.offsetWidth-he;return fe?Math.min(xe,fe.right-X.offsetWidth-he):xe})();return Math.min(Math.max(le,ue),ye)-oe.left},[n,s,d,p,Q]),K=l.useCallback(({pageX:J})=>{const ne=M({pageX:J});if(I){k(ne);return}b(ne)},[M,k,I]),W=P?0:A,H=l.useCallback(J=>{E||B||(L.current=J.clientX,W>0?D.current=setTimeout(()=>{L.current=J.clientX,K({pageX:J.clientX}),v(!0)},W):(K({pageX:J.clientX}),v(!0)))},[E,W,B,K]),j=l.useCallback(()=>{E||B||(L.current=null,D.current&&(clearTimeout(D.current),D.current=null),k.cancel&&k.cancel(),_(!1),v(!1))},[k,E,B]),q=l.useCallback(J=>{E||B||(L.current=J.clientX,K({pageX:J.clientX}))},[E,B,K]),G=l.useCallback(J=>{if(E||(i&&(J.preventDefault(),J.stopPropagation()),!P)||B)return;const ne=J.changedTouches[0];if(!ne)return;const X=ne.clientX;I?(L.current=null,_(!1),v(!1)):(L.current=X,K({pageX:X}),v(!0)),J.preventDefault()},[E,i,I,P,B,K]);l.useLayoutEffect(()=>{if(!I||E)return;let J=!1,ne=0;const X=()=>{if(J)return;const oe=N.current,ie=R.current;if(!oe||!ie)return;const ee=ie.offsetWidth||ie.getBoundingClientRect().width,te=ie.offsetHeight||ie.getBoundingClientRect().height;if(ee===0||te===0){ne=requestAnimationFrame(X);return}const le=oe.getBoundingClientRect();if(!r&&x>0){const ue=le.top-te-Nse>=x;_(!ue)}!r&&x<=0&&_(!1);const he=L.current??le.left+le.width/2,fe=M({pageX:he});b(fe)};return X(),()=>{J=!0,cancelAnimationFrame(ne)}},[I,E,r,x,M]);const $=r||w;return l.useEffect(()=>{E&&(L.current=null,D.current&&(clearTimeout(D.current),D.current=null),k.cancel&&k.cancel(),_(!1),v(!1))},[k,E]),l.useEffect(()=>()=>{D.current&&clearTimeout(D.current),k.cancel&&k.cancel()},[k]),l.useEffect(()=>{if(!I||!P||B)return;const J=ne=>{const X=ne.target;if(!X)return;const oe=N.current,ie=R.current;oe&&oe.contains(X)||ie&&ie.contains(X)||(_(!1),v(!1))};return document.addEventListener("touchend",J,!0),()=>{document.removeEventListener("touchend",J,!0)}},[I,P,B]),l.useEffect(()=>{if(!I)return;const J=N.current,ne=()=>{_(!1),v(!1)},X=z({element:J});return X.forEach(oe=>{oe.addEventListener("scroll",ne,{passive:!0})}),()=>{X.forEach(oe=>{oe.removeEventListener("scroll",ne)})}},[I,z]),a.jsxs("div",{ref:N,onMouseEnter:H,onMouseLeave:j,onMouseMove:q,onTouchEnd:G,className:Y("relative inline-flex",I?"overflow-visible":"overflow-hidden"),children:[e,a.jsxs("div",{ref:R,className:Y("absolute flex max-w-96 px-1.5 py-0.5 bg-black/80 rounded-md roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-50 drop-shadow-[0px_4px_4px_rgba(0,0,0,0.08)] select-none pointer-events-none cursor-default z-22",!!y&&"items-center justify-center text-center whitespace-normal",!y&&"items-start justify-start text-left",!c&&!u&&!y&&"whitespace-nowrap",c===50&&"w-50",c===60&&"w-60",c===65&&"w-65",c===96&&"w-96",u===50&&"max-w-50 w-max",u===60&&"max-w-60 w-max",u===65&&"max-w-65 w-max",u===96&&"max-w-96 w-max",$?"top-[calc(100%+0.25rem)]":"bottom-[calc(100%+0.25rem)]",!!I&&"visible",!I&&"invisible"),style:{left:`${S}px`,transform:`translateY(${g}px)`},children:[!!F&&a.jsx(wI,{lines:F}),!F&&t]})]})},Wr=({width:e=96,isClampToParent:t=!1,isFollowCursor:n=!1,...s})=>a.jsx(Ls,{width:e,isClampToParent:t,isFollowCursor:n,...s,children:a.jsx("span",{className:"size-6 inline-flex items-center justify-center cursor-pointer text-sky-400 hover:text-sky-500",children:a.jsx(p2,{className:"size-5"})})}),C7=({label:e,to:t,onClick:n,disabled:s=!1,isPending:r=!1,isFullWidth:i=!1,asChild:o=!1,type:c="button",dataAttributes:u,children:d,...p})=>{const g=l.useMemo(()=>Y("inline-flex","items-center","justify-center","relative","whitespace-nowrap","h-[24px]","px-3","rounded-full","roboto-flex-25-700-1","text-[12px]","leading-[14px]","uppercase","bg-zinc-100","text-zinc-600","hover:bg-zinc-200","hover:text-zinc-600","cursor-pointer","transition-[color,box-shadow]","focus-visible:ring-4","focus-visible:outline-1",!!i&&"w-full",!!(s||r)&&"pointer-events-none",!!(s||r)&&"opacity-50"),[s,r,i]),A=l.useCallback(y=>{if(s||r){y?.preventDefault();return}n?.()},[n,s,r]),E=l.useMemo(()=>r?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"invisible",children:e}),a.jsx("span",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(Co,{className:"size-4 animate-spin stroke-current text-zinc-400"})})]}):e,[e,r]),x=l.useMemo(()=>({className:g,"aria-busy":r,"aria-disabled":!!(s||r),...u}),[g,r,s,u]);if(o&&Oe.isValidElement(d)){const y={...x,children:E,onClick:A};return Oe.cloneElement(d,y)}return t?a.jsx(Je,{to:t,...x,onClick:A,children:E}):a.jsx("button",{type:c,disabled:!!(s||r),onClick:A,...p,...x,children:E})};C7.displayName="H6F12Px3Bg100Bgh200T600Th600";const Xh=({label:e,isGrouped:t,isEmpty:n,isValueFullWidth:s,hint:r,sourcePath:i,isSourcePathVisible:o,labelTheme:c,actionButton:u,children:d})=>{const p=l.useMemo(()=>u?"1_1":"1_1.5",[u]);return a.jsxs(To,{children:[a.jsx(No,{isGrouped:t,labelTheme:c,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:e})}),a.jsx(wo,{paddingY:p,children:a.jsxs("div",{children:[a.jsxs("div",{className:Y("flex items-center gap-4",n!==void 0&&n&&"text-zinc-400",n!==void 0&&!n&&"text-zinc-950"),children:[a.jsxs("div",{className:Y("flex items-center gap-1.5 min-w-0",!!s&&"flex-1"),children:[d,!!r&&a.jsx(Wr,{text:r})]}),!!u&&a.jsx(C7,{label:u.label,to:u.to,onClick:u.onClick,disabled:u.disabled,isPending:u.isPending})]}),!!(o&&i)&&a.jsx("div",{className:"mt-0.5 text-[9px] leading-[14px] text-zinc-400 break-all",children:i})]})})]})},Rse=({text:e,isGrouped:t,isEmpty:n})=>{const s=Is(d=>d.isGridSourcePathVisible),{id:r,listInstance:i,caseId:o,caseInstance:c}=st(),u=l.useMemo(()=>
854{if(!e)return[];if(zne({textValue:e.value,clientId:r,caseId:o}))return[];const d=`/clients/${r}/cases/${i??"first-instance"}/${o}/${c??"first-instance"}/information`,p=e.value;return Array.isArray(p)?p.filter(A=>typeof A=="string").map(A=>A.trim()).map(A=>{const E=gi(A);if(E.length===0)return null;if(E.length>=2&&E[0].name==="general_information"&&E[1].name==="accused"&&E[1].indices.length===1){const x=E[1].indices[0],y=e?.caseData?._source?.general_information?.accused?.[x]?.name??"";return{link:`${d}/accused#accused-${x}`,name:y}}if(E.length>=2&&E[0].name==="general_information"&&E[1].name==="victims_details"&&E[1].indices.length===1){const x=E[1].indices[0];return{link:`${d}/victims#victims-${x}`,name:e?.caseData?._source?.general_information?.victims_details?.[x]?.name??""}}if(E.length>=2&&E[0].name==="general_information"&&E[1].name==="witnesses_details"&&E[1].indices.length===1){const x=E[1].indices[0];return{link:`${d}/witnesses#witnesses-${x}`,name:e?.caseData?._source?.general_information?.witnesses_details?.[x]?.name??""}}return null}).filter(A=>A!==null):[]},[e,r,o,i,c]);return e?.value?a.jsx(Xh,{label:e.label,isGrouped:t,hint:e.hint,sourcePath:e?.sourcePath,isSourcePathVisible:s,children:a.jsx("div",{children:u.map((d,p)=>a.jsxs(Oe.Fragment,{children:[p>0&&", ",a.jsx(Je,{to:d.link,className:"underline underline-offset-[25%] decoration-[3%]",children:a.jsx(tn,{text:d.name})})]},p))})}):a.jsx(Xh,{label:e?.label??"",isGrouped:t,hint:e?.hint,isEmpty:n,sourcePath:e?.sourcePath,isSourcePathVisible:s,children:a.jsx(tn,{text:e?.placeholder})})};function Dse(e){Object.assign(e,{isDeferredTooltipContent:!0})}function kse(e){if(!l.isValidElement(e))return!1;const t=e.type;return typeof t!="function"||!("isDeferredTooltipContent"in t)?!1:t.isDeferredTooltipContent===!0}const Ose=250,Pse=({children:e,content:t})=>{const n=kse(t),[s,r]=l.useState(!1),[i,o]=l.useState(!1),[c,u]=l.useState(!1),[d,p]=l.useState(!1),g=l.useRef(null),A=l.useCallback(({isReady:S})=>{o(S)},[]),E=l.useCallback(()=>{p(!0)},[]),x=l.useCallback(({isHovered:S})=>{if(!S){g.current&&(clearTimeout(g.current),g.current=null),r(!1),o(!1),u(!1),p(!1);return}r(!0),p(!1),g.current=setTimeout(()=>{u(!0)},Ose)},[]);l.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const y=l.useMemo(()=>{if(!n)return t;if(s)return Oe.cloneElement(t,{onReadyChange:A,onRequestClose:E})},[t,A,E,n,s]),I=l.useMemo(()=>{if(n)return 0},[n]),v=l.useMemo(()=>n?d||!c?!1:i:!0,[i,n,d,c]);return a.jsx(Do,{content:y,delay:I,verticalPosition:"bottom",isClampToParent:!1,isAllowEmptyContent:n,isPopupVisible:v,isFullWidth:!1,onHoverChange:n?x:void 0,children:a.jsx("span",{className:"inline-block max-w-full",children:e})})},Lse=({text:e,isGrouped:t,isEmpty:n})=>{const s=Is(i=>i.isGridSourcePathVisible),r=l.useMemo(()=>{if(n)return a.jsx(tn,{text:e?.placeholder});const i=Array.isArray(e?.value)?e?.value??[]:[],o=Array.isArray(e?.isRemovedIcon)?e?.isRemovedIcon??[]:[],c=e?.arrayItemTooltips,u=e?.arrayItemOnClick;return a.jsx("div",{className:"min-w-0 overflow-visible",children:i.map((d,p)=>{const g=c?.[p],A=a.jsx(tn,{text:String(d)}),E=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"group-hover/normItem:underline decoration-dashed decoration-zinc-600 decoration-1 underline-offset-2",children:A}),!!o[p]&&a.jsxs("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] tracking-[-0.01em] text-zinc-400",children:[" ","⊘"]})]});return a.jsxs(Oe.Fragment,{children:[p>0&&a.jsx("span",{children:", "}),a.jsxs("span",{className:Y("inline-block max-w-full align-baseline whitespace-nowrap",!!g&&"group/normItem cursor-pointer transition-colors hover:text-zinc-600"),onClick:()=>{g&&u&&u({index:p})},children:[!!g&&a.jsx(Pse,{content:g,children:E}),!g&&E]})]},p)})})},[n,e]);return a.jsx(Xh,{label:e?.label??"",isGrouped:t,isEmpty:n,hint:e?.hint,sourcePath:e?.sourcePath,isSourcePathVisible:s,children:a.jsx("div",{className:"overflow-visible",children:r})})},Mse=({isGrouped:e,text:t,labelTheme:n,linkFieldConfigs:s})=>{const r=Is(p=>p.isGridSourcePathVisible),i=l.useMemo(()=>{if(t?.type==="link"||t?.type==="plainLink")return!t?.value;if(t?.type==="boolean")return t?.value===void 0||t?.value===null;if(t?.type==="array")return!t?.value||!Array.isArray(t?.value)||!t?.value?.length;if(t?.type==="date"){if(typeof t?.value!="string"||Ut(t.value))return!0;const p=String(t?.value).trim(),g=Kt({dateString:p,isWithTime:!1,isS
854hortMonth:!1});return Ut(g)}return!t?.value},[t]),o=l.useMemo(()=>{if(t?.type==="link")return typeof t.value!="string"?t?.placeholder:t.value;if(i)return t?.placeholder;if(t?.type==="boolean")return t?.value?h.inputs.yesNo.YES:h.inputs.yesNo.NO;if(t?.type==="date"){const p=String(t?.value).trim();return Kt({dateString:p,isWithTime:!1,isShortMonth:!1})}return typeof t?.value!="string"?t?.placeholder:t.value},[t?.value,t?.type,t?.placeholder,i]),c=l.useMemo(()=>{if(t?.valueToCompare===void 0)return;const p=t.valueToCompare;if(p===null||typeof p=="string"&&p.trim()==="")return t?.placeholder??"";if(t?.type==="boolean")return t.valueToCompare?h.inputs.yesNo.YES:h.inputs.yesNo.NO;if(t?.type==="date"){const g=String(t.valueToCompare).trim();return g?Kt({dateString:g,isWithTime:!1,isShortMonth:!1})?.trim()??"":""}return typeof t?.valueToCompare=="string"?t.valueToCompare.trim():Array.isArray(t?.valueToCompare)&&t.valueToCompare.length>0?t.valueToCompare.filter(A=>!!A).join(", ").trim():String(t?.valueToCompare).trim()},[t?.valueToCompare,t?.type,t?.placeholder]),u=l.useMemo(()=>{const p=t?.valueToCompare;return p===void 0?!1:p===null?!0:typeof p!="string"?!1:p.trim()===""},[t?.valueToCompare]),d=l.useMemo(()=>{if(t?.valueToCompare===void 0)return!1;const p=t?.type==="boolean"?t?.value:String(t?.value??"").trim(),g=t?.type==="boolean"?t?.valueToCompare:String(t?.valueToCompare??"").trim();return p!==g},[t?.value,t?.valueToCompare,t?.type]);return t?.type==="link"?a.jsx(vse,{isGrouped:e,text:t,linkFieldConfigs:s,isValueDifferentFromCompare:d}):t?.type==="plainLink"?a.jsx(Rse,{text:t,isEmpty:i,isGrouped:e}):t?.type==="array"?a.jsx(Lse,{text:t,isEmpty:i,isGrouped:e}):a.jsx(Xh,{label:t?.label??"",isGrouped:e,isEmpty:i,hint:t?.hint,sourcePath:t?.sourcePath,isSourcePathVisible:r,actionButton:t?.actionButton,labelTheme:n,children:a.jsx(_se,{valueToUse:o,valueToCompareFormatted:c,isValueDifferentFromCompare:d,isComparePlaceholder:u})})},Uf=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7492_15547)"},l.createElement("path",{d:"M8.5 1.5V10.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 9L3.5 10.5L2 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.5 10.5V1.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 3L8.5 1.5L7 3",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7492_15547"},l.createElement("rect",{width:12,height:12,fill:"white"})))),er=[];for(let e=0;e<256;++e)er.push((e+256).toString(16).slice(1));function jse(e,t=0){return(er[e[t+0]]+er[e[t+1]]+er[e[t+2]]+er[e[t+3]]+"-"+er[e[t+4]]+er[e[t+5]]+"-"+er[e[t+6]]+er[e[t+7]]+"-"+er[e[t+8]]+er[e[t+9]]+"-"+er[e[t+10]]+er[e[t+11]]+er[e[t+12]]+er[e[t+13]]+er[e[t+14]]+er[e[t+15]]).toLowerCase()}const Bse=new Uint8Array(16);function Fse(){return crypto.getRandomValues(Bse)}function Hr(e,t,n){return crypto.randomUUID?crypto.randomUUID():Use(e)}function Use(e,t,n){e=e||{};const s=e.random??e.rng?.()??Fse();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,jse(s)}function Ca(e){const{clientId:t}=e,n=bt(),s=bs(g=>g.setRequest),r=bs(g=>g.updateRequest),i=bs(g=>g.deleteRequest),o=bs(g=>g.requestsByClient),c=l.useRef({requestId:null,timeoutId:null}),u=tt({mutationFn:({path:g,bodyKey:A,bodyValue:E,signal:x})=>r7({path:g,body:{[A]:E},signal:x}),onSuccess:(g,A)=>{c.current.requestId===A.requestId&&(c.current.timeoutId&&clearTimeout(c.current.timeoutId),c.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const E=bs.getState().getRequest(t??"",A.path,A.bodyKey,A.requestId??"");E&&E.requestId===A.requestId&&(r(t??"",A.path,A.bodyKey,A.requestId??"",{status:"settled"}),A.onPatchSuccess?.())},onMutate:async g=>{const{pathSegments:A,pathValues:E,bodyKey:x,bodyValue:y}
854=g,I=["client",t],v=A?.slice(2)??[],S=n.getQueryData(I),b=S?d(S,v,E,x,y):{updatedNode:S,previousFieldValue:void 0};n.setQueryData(I,b.updatedNode);const w=g.requestId??null;return c.current.timeoutId&&(clearTimeout(c.current.timeoutId),c.current.timeoutId=null),Ze("PATCH_SLOW"),c.current.requestId=w,c.current.timeoutId=setTimeout(()=>{c.current.requestId===w&&ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"PATCH_SLOW",duration:0})},3e3),{previousFieldValue:b.previousFieldValue}},onError:(g,A,E)=>{A&&c.current.requestId===A.requestId&&(c.current.timeoutId&&clearTimeout(c.current.timeoutId),c.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const x=["client",t];if(!A)return;const y=A?.requestId,I=bs.getState().getRequest(t??"",A.path,A.bodyKey,y??"");if(!I||I.requestId!==y||(A.path&&A.bodyKey&&y&&r(t??"",A.path,A.bodyKey,y,{status:"error",error:g}),ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,duration:3e3,key:"SAVE_CHANGES_FAILED"}),!E?.previousFieldValue))return;const v=A.pathSegments?.slice(2)??[],S=n.getQueryData(x),b=S?d(S,v,A.pathValues,A.bodyKey,E.previousFieldValue):{updatedNode:S};n.setQueryData(x,b.updatedNode)}}),d=l.useCallback((g,A,E,x,y)=>{if(!g)return{updatedNode:g};if(A.length===0){if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const b=x?g[x]:void 0;return x?{updatedNode:{...g,[x]:y},previousFieldValue:b}:{updatedNode:g,previousFieldValue:b}}return{updatedNode:g}}const[I,...v]=A;if(Array.isArray(g)){const b=(()=>{if(I.startsWith("{")&&I.endsWith("}")){const N=I.slice(1,-1);return E?.[N]}return I})(),w=g.map(N=>N.id===b?d(N,v,E,x,y).updatedNode:N),_=g.find(N=>N.id===b);if(_){if(v.length===0&&x)return{updatedNode:w,previousFieldValue:_[x]};const N=d(_,v,E,x,y);return{updatedNode:w,previousFieldValue:N.previousFieldValue}}return{updatedNode:w}}const S=ho(I);if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const b=g[S],w=d(b,v,E,x,y);return w.updatedNode===b&&w.previousFieldValue===void 0?{updatedNode:g}:{updatedNode:{...g,[S]:w.updatedNode},previousFieldValue:w.previousFieldValue}}return{updatedNode:g}},[]);return{patchResourceItem:l.useCallback(g=>{const{pathSegments:A,pathValues:E,bodyKey:x,bodyValue:y}=g,v=A.map(_=>{if(E){for(const N of Object.keys(E))if(_===`{${N}}`)return E?.[N]!==void 0?E[N]:""}return _==="{clientId}"?t!==void 0?t:"":_}).join("/")+"/",S=Hr(),b=o?.[t??""]?.[v]?.[x]??{};Object.keys(b).forEach(_=>{const N=b[_];N&&N.status==="inflight"&&i(t??"",v,x,_)});const w=new AbortController;return s(t??"",v,x,S,{requestId:S,status:"inflight",controller:w,path:v,bodyKey:x,startedAt:Date.now()}),u.mutateAsync({path:v,pathSegments:A,pathValues:E,bodyKey:x,bodyValue:y,requestId:S,signal:w.signal,onPatchSuccess:g.onPatchSuccess}),S},[u,t,s,i,o])}}function zf(){const e=bt(),t=bs(d=>d.setRequest),n=bs(d=>d.updateRequest),s=bs(d=>d.deleteRequest),r=bs(d=>d.requestsByClient),i=l.useRef({requestId:null,timeoutId:null}),o=l.useCallback((d,p,g,A,E)=>{if(!d)return{updatedNode:d};if(p.length===0){if(typeof d=="object"&&d!==null&&!Array.isArray(d)){const v=A?d[A]:void 0;return A?{updatedNode:{...d,[A]:E},previousFieldValue:v}:{updatedNode:d,previousFieldValue:v}}return{updatedNode:d}}const[x,...y]=p;if(Array.isArray(d)){const v=(()=>{if(x.startsWith("{")&&x.endsWith("}")){const w=x.slice(1,-1);return g?.[w]}return x})(),S=d.map(w=>w.id===v?o(w,y,g,A,E).updatedNode:w),b=d.find(w=>w.id===v);if(b){if(y.length===0&&A)return{updatedNode:S,previousFieldValue:b[A]};const w=o(b,y,g,A,E);return{updatedNode:S,previousFieldValue:w.previousFieldValue}}return{updatedNode:S}}const I=ho(x);if(typeof d=="object"&&d!==null&&!Array.isArray(d)){const v=d[I],S=o(v,y,g,A,E);return S.updatedNode===v&&S.previousFieldValue===void 0?{updatedNode:d}:{updatedNode:{...d,[I]:S.updatedNode},previousFieldValue:S.previousFieldValue}}return{updatedNode:d}},[]),c=tt({mutationFn:({path:d,bodyKey:p,bodyValue:g,signal:A})=>r7({path:d,body:{[p]:g},signal:A}),onSuccess:(d,p)=>{i.current.requestId===p.requestId&&(i.current.timeoutId&&clearTimeout(i.current.timeoutId),i.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));
854const g=bs.getState().getRequest("",p.path,p.bodyKey,p.requestId??"");g&&g.requestId===p.requestId&&(n("",p.path,p.bodyKey,p.requestId??"",{status:"settled"}),e.setQueryData(["account","me"],d),Se.getState().setUser(d))},onMutate:async d=>{const{pathSegments:p,pathValues:g,bodyKey:A,bodyValue:E}=d,x=["account","me"],y=p?.slice(2)??[],I=e.getQueryData(x)??Se.getState().user,v=I?o(I,y,g,A,E):{updatedNode:I,previousFieldValue:void 0};e.setQueryData(x,v.updatedNode);const S=v.updatedNode;S===void 0?Se.getState().setUser(null):Se.getState().setUser(S);const b=d.requestId??null;return i.current.timeoutId&&(clearTimeout(i.current.timeoutId),i.current.timeoutId=null),Ze("PATCH_SLOW"),i.current.requestId=b,i.current.timeoutId=setTimeout(()=>{i.current.requestId===b&&ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"PATCH_SLOW",duration:0})},3e3),{previousFieldValue:v.previousFieldValue,previousAccount:I}},onError:(d,p,g)=>{p&&i.current.requestId===p.requestId&&(i.current.timeoutId&&clearTimeout(i.current.timeoutId),i.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const A=["account","me"];if(!p)return;const E=p?.requestId,x=bs.getState().getRequest("",p.path,p.bodyKey,E??"");if(!x||x.requestId!==E||(p.path&&p.bodyKey&&E&&n("",p.path,p.bodyKey,E,{status:"error",error:d}),ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,duration:3e3,key:"SAVE_CHANGES_FAILED"}),!g?.previousFieldValue))return;const y=p.pathSegments?.slice(2)??[],I=e.getQueryData(A)??Se.getState().user,v=I?o(I,y,p.pathValues,p.bodyKey,g.previousFieldValue):{updatedNode:I};e.setQueryData(A,v.updatedNode);const S=v.updatedNode;S===void 0?Se.getState().setUser(null):Se.getState().setUser(S)}});return{patchResourceItem:l.useCallback(d=>{const{pathSegments:p,pathValues:g,bodyKey:A,bodyValue:E}=d,y=p.map(b=>{if(g){for(const w of Object.keys(g))if(b===`{${w}}`)return g?.[w]!==void 0?g[w]:""}return b}).join("/")+"/",I=Hr(),v=r?.[""]?.[y]?.[A]??{};Object.keys(v).forEach(b=>{const w=v[b];w&&w.status==="inflight"&&s("",y,A,b)});const S=new AbortController;return t("",y,A,I,{requestId:I,status:"inflight",controller:S,path:y,bodyKey:A,startedAt:Date.now()}),c.mutateAsync({path:y,pathSegments:p,pathValues:g,bodyKey:A,bodyValue:E,requestId:I,signal:S.signal}),I},[c,t,s,r])}}const zse=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,externalValue:o,commitDataPath:c,placeholder:u,type:d,patch:p,maxLength:g,sourcePath:A,labelTheme:E})=>{const x=l.useRef(null),[y,I]=l.useState("view"),[v,S]=l.useState(i??""),[b,w]=l.useState(!1),[_,N]=l.useState({hasError:!1,type:null}),{commitData:R,setCommitData:D}=wt({clientId:e}),{patchResourceItem:k}=Ca({clientId:e}),{patchResourceItem:L}=zf(),[O,P]=l.useState(null),B=l.useMemo(()=>p.endpoint.map(re=>re==="{clientId}"?e!==void 0?String(e):"":re).join("/")+"/",[p,e]),F=bs(xe=>xe.requestsByClient?.[String(e??"")]?.[B]?.[p.field]),z=l.useMemo(()=>{if(O)return F?.[O]},[F,O]),Q=!!z&&!!O&&z.requestId===O&&z.status==="error",M=l.useMemo(()=>!!r&&Ut(v),[r,v]),K=l.useMemo(()=>!(g===void 0||(v?.toString()??"").length<=g),[v,g]),W=l.useMemo(()=>{if(d!=="days"||Ut(v))return!1;const xe=v.toString().trim().replace(/[^0-9]/g,"");return!!Number.isNaN(Number(xe))},[d,v]),H=l.useMemo(()=>d!=="tel"||Ut(v)?!1:of({value:v.toString()})==="",[d,v]),j=l.useMemo(()=>!(d!=="email"||Ut(v)||hu.test(v.toString())),[d,v]),q=l.useMemo(()=>!!(y==="view"&&_.hasError||Q),[y,_.hasError,Q]),G=l.useMemo(()=>Eo({data:R,path:c})==="external",[R,c]),$=l.useMemo(()=>{if(Ut(o))return"";const xe=typeof o=="number"?o:o.trim(),re=xe.toString();return d==="tel"?mu({value:re}):d==="email"?Ny({value:re}):d==="days"?I6({value:xe}):xe},[o,d]),J=l.useMemo(()=>{if(Ut(i))return"";const xe=typeof i=="number"?i:i.trim(),re=xe.toString();return d==="tel"?mu({value:re}):d==="email"?Ny({value:re}):d==="days"?I6({value:xe}):xe},[i,d]),ne=l.useMemo(()=>d==="tel"?of({value:v.toString()}):d==="email"?Ny({value:v.toString()}):d==="days"?Number(v).toString():v,[v,d]),X=l.useMemo(()=>!(Ut(i)||Ut(o)||i===o),[i,o]),oe=l.useMemo(()=>!(!Ut(i)||Ut(o)),[i,o]),ie=l.useMemo(()=>!!(X||oe),[X,oe]),ee=l.useMemo(()=>
854{if(g===void 0)return null;const xe=v?.toString()?.length??0;if(g-xe>10)return null;const re=String(g).length+1,pe=Number("1".padEnd(re,"0"))-1;return{current:xe>pe?`>${pe}`:String(xe),max:String(g)}},[v,g]),te=l.useCallback(xe=>{if(g===void 0){N({hasError:!1,type:null});return}if(xe.length>g){N({hasError:!0,type:"maxLengthExceeded"});return}N({hasError:!1,type:null})},[g]);l.useEffect(()=>{y==="view"&&(_.hasError||q||S(i??""))},[i,y,_.hasError,q]),l.useEffect(()=>{y==="waitingForConfirmation"&&b&&i!==void 0&&i!==null&&i===ne&&(w(!1),N({hasError:!1,type:null}),I("view"))},[y,i,ne,b]);const le=l.useCallback(()=>{ie&&c&&D(xe=>ul({data:xe,path:c,value:G?void 0:"external"}))},[c,G,D,ie]),he=l.useCallback(xe=>{const re=xe.target.value,pe=d==="days"?re.toString().trim().replace(/[^0-9]/g,""):re;S(pe),te(pe?.toString()??"");const _e=d==="tel"?of({value:pe.toString()}):d==="days"?Number(pe).toString():pe;y==="editing"&&_e!==i&&w(!0)},[y,i,d,te]),fe=l.useCallback(()=>{I("editing"),requestAnimationFrame(()=>{x.current&&x.current.select()})},[]),ue=l.useCallback(()=>{if(M){I("view"),S(i??""),N({hasError:!0,type:"emptyRequired"}),w(!1);return}if(K){I("view");return}if(H){I("view"),N({hasError:!0,type:"invalidPhone"});return}if(j){I("view"),N({hasError:!0,type:"invalidEmail"});return}if(W){I("view"),N({hasError:!0,type:"invalidDays"});return}if((Ut(ne)&&Ut(i)||ne===i)&&!Q){I("view"),N({hasError:!1,type:null}),w(!1);return}I("waitingForConfirmation");const re=(p.endpoint[0]==="accounts"?L:k)({pathSegments:p.endpoint,pathValues:{},bodyKey:p.field,bodyValue:ne,onPatchSuccess:p.onPatchSuccess});P(re)},[p.endpoint,p.field,p.onPatchSuccess,i,k,L,M,K,H,j,W,ne,Q]),ye=l.useCallback(xe=>{if(xe.key==="Escape"||xe.key==="Esc"){Wn.flushSync(()=>S(i??"")),x.current?.blur();return}if(xe.key==="Enter"){x.current?.blur();return}},[i]),ce=l.useMemo(()=>X?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:G?$:J}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:G?J:$})]}):oe?a.jsx("div",{className:Y(!!G&&"text-zinc-950",!G&&"text-zinc-400"),children:G?$:u}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:Y(!!J&&"text-zinc-950",!J&&"text-zinc-400"),children:[!n&&a.jsxs("div",{className:"relative -ml-1.5",children:[a.jsx("input",{ref:x,id:p.field,type:"text",className:Y("flex-1","file:text-foreground","placeholder:text-muted-foreground","autofill-neutralize","flex","min-w-0","outline-none","focus:ring-0","focus:shadow-none","file:inline-flex","file:h-7","file:border-0","file:bg-transparent","file:text-sm","file:font-medium","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","password-clean","pl-1.5","pr-14","py-1.5","w-full","focus:bg-zinc-100","focus:cursor-text","rounded-[4px]","roboto-flex-100-400-1","text-zinc-950","text-[16px]","leading-[20px]",!q&&"bg-white",!q&&"cursor-pointer",!q&&"hover:bg-zinc-50",!!q&&"bg-red-100",!!q&&"cursor-text"),value:y!=="view"||_.hasError||q?v:J,placeholder:u,onChange:he,onFocus:fe,onBlur:ue,onKeyDown:ye}),!!((y!=="view"||_.hasError)&&ee)&&a.jsxs("div",{className:Y("pointer-events-none","absolute","h-full","flex","items-center","top-0","right-1.5","bottom-0","px-2","roboto-flex-100-400-1","text-[12px]","leading-[18px]",!(ee.current>ee.max)&&"text-zinc-500",ee.current>ee.max&&"text-red-600"),children:[ee.current,"/",ee.max]})]}),!!n&&a.jsx(a.Fragment,{children:J||u})]}),!!(_.hasError||q)&&a.jsxs("div",{className:"pl-1.5 text-red-600 roboto-flex-100-400-1 text-[14px] leading-[16px] mt-1 mb-1",children:[!!_.hasError&&a.jsxs(a.Fragment,{children:[_.type==="emptyRequired"&&h.inputs.validationErrors.EMPTY_REQUIRED,_.type==="invalidPhone"&&h.inputs.validationErrors.INVALID_PHONE,_.type==="invalidEmail"&&h.inputs.validationErrors.INVALID_EMAIL,_.type==="invalidDays"&&h.inputs.validationErrors.INVALID_DAYS,_.type==="maxLengthExceeded"&&h.inputs.validationErrors.MAX_LENGTH_EXCEEDED]}),!!q&&a.jsx(a.Fragment,{children:Q&&h.inputs.validationErrors.SAVE_FAILED})]})]}),[J,_.hasError,_.type,G,X,oe,u,$,n,v,q,Q,y,he,fe,ue,ye,p.field,ee]);return a.jsxs(To,{isChangeable:ie,onClick:le,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:oe,isSelectedExternalValue:G,labelTheme:E,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:n?"1_1.5":"0_0",children:a.jsxs("div",{children:[ce,a.jsx(oa,{sourcePath:A})]})})]})},Qse=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,externalValue:o,commitDataPath:c,placeholder:u,type:d,minRows:p=1,patch:g,maxLength:A,sourcePath:E})=>{const v=l.useRef(null),S=l.useRef(null),[b,w]=l.useState(()=>20*p+12),[_,N]=l.useState("view"),[R,D]=l.useState(i??""),[k,L]=l.useState(!1),[O,P]=l.useState({hasError:!1,type:null}),{commitData:B,setCommitData:F}=wt({clientId:e}),{patchResourceItem:z}=Ca({clientId:e}),{patchResourceItem:Q}=zf(),[M,K]=l.useState(null),W=l.useMemo(()=>!g||!g.endpoint?"":g.endpoint.map(me=>me==="{clientId}"?e!==void 0?String(e):"":me).join("/")+"/",[g,e]),H=bs(se=>se.requestsByClient?.[String(e??"")]?.[W]?.[g.field]),j=l.useMemo(()=>
854{if(M)return H?.[M]},[H,M]),q=!!j&&!!M&&j.requestId===M&&j.status==="error",G=l.useMemo(()=>!!r&&Ut(R),[r,R]),$=l.useMemo(()=>!(A===void 0||(R?.toString()??"").length<=A),[R,A]),J=l.useMemo(()=>!!(_==="view"&&O.hasError||q),[_,O.hasError,q]),ne=l.useMemo(()=>Eo({data:B,path:c})==="external",[B,c]),X=l.useMemo(()=>{if(Ut(o))return"";const se=typeof o=="number"?o:o.trim(),me=se.toString();return d==="address"?lA({value:me}):se},[o,d]),oe=l.useMemo(()=>{if(Ut(i))return"";const se=typeof i=="number"?i:i.trim(),me=se.toString();return d==="address"?lA({value:me}):se},[i,d]),ie=l.useMemo(()=>d==="address"?lA({value:R.toString()}):R,[R,d]),ee=l.useMemo(()=>!(Ut(i)||Ut(o)||i===o),[i,o]),te=l.useMemo(()=>!(!Ut(i)||Ut(o)),[i,o]),le=l.useMemo(()=>!!(ee||te),[ee,te]),he=l.useMemo(()=>{if(A===void 0)return null;const se=R?.toString()?.length??0;if(A-se>100)return null;const me=String(A).length+1,de=Number("1".padEnd(me,"0"))-1;return{current:se>de?`>${de}`:String(se),max:String(A)}},[R,A]),fe=l.useCallback(se=>{if(A===void 0){P({hasError:!1,type:null});return}if(se.length>A){P({hasError:!0,type:"maxLengthExceeded"});return}P({hasError:!1,type:null})},[A]),ue=l.useMemo(()=>_!=="view"||O.hasError||J?String(R??""):String(oe??""),[_,O.hasError,J,R,oe]),ye=l.useMemo(()=>he?!!(_!=="view"||O.hasError):!1,[O.hasError,_,he]),ce=l.useCallback(()=>{const se=20*p+(ye?32:12),me=S.current;if(!me)return se;const de=me.clientHeight;return de<se?se:de},[p,20,32,12,ye]);l.useLayoutEffect(()=>{const se=ce();w(se)},[ce,ue,n]),l.useEffect(()=>{const se=()=>w(ce()),me=S.current,de=typeof window<"u"&&"ResizeObserver"in window;if(!me||!de){const Pe=()=>{se()};return window.addEventListener("resize",Pe),()=>{window.removeEventListener("resize",Pe)}}const ge=new ResizeObserver(()=>{se()});return ge.observe(me),()=>{ge.disconnect()}},[ce]),l.useEffect(()=>{_==="view"&&(O.hasError||J||D(i??""))},[i,_,O.hasError,J]),l.useEffect(()=>{_==="waitingForConfirmation"&&k&&i!==void 0&&i!==null&&i===ie&&(L(!1),P({hasError:!1,type:null}),N("view"))},[_,i,ie,k]);const xe=l.useCallback(()=>{le&&c&&F(se=>ul({data:se,path:c,value:ne?void 0:"external"}))},[c,ne,F,le]),re=l.useCallback(se=>{const me=se.target.value;D(me),fe(me?.toString()??""),_==="editing"&&me!==i&&L(!0)},[_,i,fe]),pe=l.useCallback(()=>{N("editing"),requestAnimationFrame(()=>{v.current&&v.current.select()})},[]),_e=l.useCallback(()=>{if(G){N("view"),D(i??""),P({hasError:!0,type:"emptyRequired"}),L(!1);return}if($){N("view");return}if((Ut(ie)&&Ut(i)||ie===i)&&!q){N("view"),P({hasError:!1,type:null}),L(!1);return}N("waitingForConfirmation");const me=(g.endpoint[0]==="accounts"?Q:z)({pathSegments:g.endpoint,pathValues:{},bodyKey:g.field,bodyValue:ie});K(me)},[g.endpoint,g.field,i,z,Q,G,ie,$,q]),Le=l.useCallback(se=>{if(se.key==="Escape"){Wn.flushSync(()=>D(i??"")),v.current?.blur();return}if(se.key==="Esc"){Wn.flushSync(()=>D(i??"")),v.current?.blur();return}if(se.key==="Enter"){if(se.ctrlKey){se.preventDefault(),v.current?.blur();return}if(se.shiftKey){se.preventDefault(),v.current?.blur();return}}},[i]),Ee=l.useMemo(()=>ee?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:ne?X:oe}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:ne?oe:X})]}):te?a.jsx("div",{className:Y(!!ne&&"text-zinc-950",!ne&&"text-zinc-400"),children:ne?X:u}):a.jsxs("div",{className:Y("min-h-10",!!oe&&"text-zinc-950",!oe&&"text-zinc-400"),children:[!n&&a.jsxs("div",{className:"relative w-full",children:[a.jsx("div",{className:"absolute inset-x-0 top-0 invisible pointer-events-none",children:a.jsxs("div",{ref:S,className:Y("whitespace-pre-wrap","break-words","roboto-flex-100-400-1","text-[16px]","leading-[20px]","px-1.5","pt-1.5",!ye&&"pb-1.5",!!ye&&"pb-6.5","w-full","box-border"),children:[ue," "]})}),a.jsx("textarea",{ref:v,id:g.field,autoComplete:"false",className:Y("file:text-foreground","placeholder:text-muted-foreground","autofill-neutralize","whitespace-pre-wrap","resize-none","flex","min-w-0","outline-none","focus:ring-0","focus:shadow-none","file:inline-flex","file:h-7","file:border-0","file:bg-transparent","file:text-sm","file:font-medium","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","password-clean","px-1.5","pt-1.5",!ye&&"pb-1.5",!!ye&&"pb-6.5","-ml-1.5","w-full","overflow-hidden",!J&&"bg-white",!J&&"curs
854or-pointer",!J&&"hover:bg-zinc-50",!!J&&"bg-red-100",!!J&&"cursor-text",!!J&&"hover:bg-red-100","focus:bg-zinc-100","focus:cursor-text","rounded-[4px]","roboto-flex-100-400-1","text-zinc-950","text-[16px]","leading-[20px]"),style:{height:b},value:ue,placeholder:u,onChange:re,onFocus:pe,onBlur:_e,onKeyDown:Le}),!!(ye&&he)&&a.jsxs("div",{className:Y("pointer-events-none","absolute","bottom-1.5","right-3","flex","items-center","roboto-flex-100-400-1","text-[12px]","leading-[20px]",!(he.current>he.max)&&"text-zinc-500",he.current>he.max&&"text-red-600"),children:[he.current,"/",he.max]})]}),!!n&&a.jsx(a.Fragment,{children:oe?a.jsx(tn,{text:oe.toString()}):u}),!!(O.hasError||J)&&a.jsxs("div",{className:"pl-1.5 text-red-600 roboto-flex-100-400-1 text-[14px] leading-[16px] mt-1 mb-1",children:[!!O.hasError&&a.jsxs(a.Fragment,{children:[O.type==="emptyRequired"&&h.inputs.validationErrors.EMPTY_REQUIRED,O.type==="maxLengthExceeded"&&h.inputs.validationErrors.MAX_LENGTH_EXCEEDED]}),!!J&&a.jsx(a.Fragment,{children:q&&h.inputs.validationErrors.SAVE_FAILED})]})]}),[oe,O.hasError,O.type,ne,ee,te,u,X,n,J,q,ue,b,re,pe,_e,Le,g.field,he,ye]);return a.jsxs(To,{isChangeable:le,onClick:xe,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:te,isSelectedExternalValue:ne,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:n?"1_1.5":"0_0",children:a.jsxs("div",{children:[Ee,a.jsx(oa,{sourcePath:E})]})})]})},y7=({label:e,description:t,isDescriptionShimmering:n})=>!t&&!n?a.jsx(a.Fragment,{children:e}):a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{children:[!!n&&a.jsx(Aa,{children:e}),!n&&e]}),!!t&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",children:t})]}),h2=({label:e,description:t})=>t?`${e} (${t})`:e,m2=({placeholder:e=h.inputs.dropdownWithSearch.ALL,emptyPlaceholder:t,value:n,isClearable:s=!0,isError:r,options:i,onChange:o})=>{const[c,u]=l.useState(!1),d=Fe(),p=l.useRef(null),g=l.useRef(null),A=l.useRef([]),E=l.useCallback(O=>{p.current&&(p.current.contains(O.target)||u(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}),[E]),l.useEffect(()=>{if(!c)return;const O=p.current,P=g.current;if(!O||!P)return;const B=Ji(O,P,async()=>{const F=O.getBoundingClientRect(),z=Io({referenceTop:F.top,referenceBottom:F.bottom,floatingHeight:P.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"}),Q=await Ei(O,P,{placement:hc[z],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),M=xi-F.top,K=Math.max(Q.y,M);Object.assign(P.style,{left:`${Q.x}px`,top:`${K}px`})});return()=>B()},[c]),l.useEffect(()=>{if(!c)return;const O=performance.now(),P=()=>{performance.now()-O<fl||u(!1)},B=[],F=z=>{if(!z)return;const Q=z.parentElement;if(!Q)return;Q.scrollHeight>Q.clientHeight&&(Q.addEventListener("scroll",P,{passive:!0}),B.push(Q)),F(Q)};return F(p.current),window.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P,{passive:!0}),B.push(window),A.current=B,()=>{A.current.forEach(z=>{if(z instanceof Window){z.removeEventListener("scroll",P),z.removeEventListener("resize",P);return}z.removeEventListener("scroll",P)}),A.current=[]}},[c]);const x=l.useMemo(()=>i.some(O=>!!O.to),[i]),y=l.useMemo(()=>s?[{value:"all",label:c&&t?t:e,isPlaceholder:!0},...i]:i,[i,e,t,s,c]),I=l.useMemo(()=>{if(!x)return;const O=y.filter(F=>!F.isPlaceholder&&!!F.to);if(O.length===0)return;const P=O.find(F=>F.to===d.pathname);return P||O.reduce((F,z)=>!z.to||!d.pathname.startsWith(z.to)?F:F===void 0||F.to.length<z.to.length?z:F,void 0)},[x,y,d.pathname]),v=l.useMemo(()=>n!==void 0?!n&&s?"all":n:I?.value??(s?"all":null),[n,s,I]),S=l.useMemo(()=>{const O=y.filter(Q=>!!Q.isPlaceholder),P=y.filter(Q=>!Q.isPlaceholder),B=P.filter(Q=>Q.zone==="primary"),F=P.filter(Q=>Q.zone!=="primary"),z=B.length>0&&F.length>0;return[...O.map(Q=>({option:Q,isFollowedByZoneSeparator:!1})),...B.map((Q,M)=>({option:Q,isFollowedByZoneSeparator:z&&M===B.length-1})),...F.map(Q=>({option:Q,isFollowedByZoneSeparator:!1}))]},[y]),b=l.useCallback(()=>{u(O=>!O)},[]),w=l.useCallback(O=>{o?.(O.value),u(!1)},[o]),_=l.useCallback(({event:O,option:P})=>{P.value===I?.value&&O.preventDefault(),u(!1)},[I?.value]),N=l.useMemo(()=>c?a.jsx("div",{ref:g,className:"absolute flex flex-col max-h-82 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50 w-full",children:a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:S.map(({option:O,isFollowedByZoneSeparator:P})=>{const B=a.jsxs("div",{className:Y("flex items-start justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!O.isPlaceholder&&"text-zinc-950",!!O.isPlaceholder&&"text-zinc-500"),children:[a.jsx(y7,{label:O.label,description:O.description,isDescriptionShimmering:O.isDescriptionShimmering}),O.value===v&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]}),F=O.to&&!O.isPlaceholder?a.jsx(Je,{to:O.to,state:O.state,end:!0,onClick:z=>_({event:z,option:O}),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer block"),children:B}):a.jsx("div",{onClick:()=>w(O),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer"),children:B});return a.jsxs(l.Fragment,{children:[F,!!P&&a.jsx("div",{"aria-hidden":!0,
854className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},O.value)})})})}):null,[c,v,S,w,_]),R=l.useMemo(()=>{const O="flex gap-1 items-center justify-between h-8 px-1.5 cursor-pointer rounded-[4px]";return r?Y(O,"bg-red-100","hover:bg-red-100"):c?Y(O,"bg-zinc-100"):Y(O,"bg-white","hover:bg-zinc-50")},[r,c]),D=l.useMemo(()=>{const O="overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1 w-0 roboto-flex-100-400-1 text-[16px] leading-[20px]";return v==="all"||v===null?Y(O,"text-zinc-500"):Y(O,"text-zinc-950")},[v]),k=l.useMemo(()=>{const O=y.find(P=>P.value===v);return O||I},[y,v,I]),L=l.useMemo(()=>k?h2({label:k.label,description:k.description}):e,[k,e]);return a.jsxs("div",{ref:p,className:"relative select-none",children:[a.jsx("div",{className:R,onClick:b,children:a.jsx("div",{className:D,children:L})}),N]})},Hse=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,externalValue:o,commitDataPath:c,placeholder:u,patch:d,sourcePath:p})=>{const[g,A]=l.useState(!1),[E,x]=l.useState(i??null),[y,I]=l.useState(!1),{commitData:v,setCommitData:S}=wt({clientId:e}),{patchResourceItem:b}=Ca({clientId:e}),{patchResourceItem:w}=zf(),[_,N]=l.useState(null),R=Oe.useMemo(()=>d.endpoint.map($=>$==="{clientId}"?e!==void 0?String(e):"":$).join("/")+"/",[d,e]),D=bs(G=>G.requestsByClient?.[String(e??"")]?.[R]?.[d.field]),k=Oe.useMemo(()=>{if(_)return D?.[_]},[D,_]),L=!!k&&!!_&&k.requestId===_&&k.status==="error",O=l.useMemo(()=>!!r&&za(E),[r,E]),P=Oe.useMemo(()=>!!L,[L]),B=l.useMemo(()=>Eo({data:v,path:c})==="external",[v,c]),F=l.useMemo(()=>za(o)?"":o?h.inputs.yesNo.YES:h.inputs.yesNo.NO,[o]),z=l.useMemo(()=>za(i)?"":i?h.inputs.yesNo.YES:h.inputs.yesNo.NO,[i]),Q=l.useMemo(()=>!(za(i)||za(o)||i===o),[i,o]),M=l.useMemo(()=>!(!za(i)||za(o)),[i,o]),K=l.useMemo(()=>!!(Q||M),[Q,M]);l.useEffect(()=>{g||P||x(i??null)},[i,g,P]),l.useEffect(()=>{g&&y&&i!==void 0&&i===E&&(I(!1),A(!1))},[g,i,E,y]);const W=l.useCallback(()=>{K&&c&&S(G=>ul({data:G,path:c,value:B?void 0:"external"}))},[c,B,S,K]),H=l.useMemo(()=>za(i)?null:i?"yes":"no",[i]),j=l.useCallback(G=>{const $=G==="yes"?!0:G==="no"?!1:null;if(O&&za($)){A(!1),I(!1);return}if(i===$&&!L){A(!1),I(!1);return}x($),I(!0),A(!0);const ne=(d.endpoint[0]==="accounts"?w:b)({pathSegments:d.endpoint,pathValues:{},bodyKey:d.field,bodyValue:$});N(ne)},[d.endpoint,d.field,b,w,O,i,L]),q=l.useMemo(()=>Q?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:B?F:z}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:B?z:F})]}):M?a.jsx("div",{className:Y(!!B&&"text-zinc-950",!B&&"text-zinc-400"),children:B?F:u}):a.jsxs("div",{className:Y(!!z&&"text-zinc-950",!z&&"text-zinc-400"),children:[!n&&a.jsx("div",{className:"-ml-1.5",children:a.jsx(m2,{placeholder:u,value:H,options:[{value:"yes",label:h.inputs.yesNo.YES},{value:"no",label:h.inputs.yesNo.NO}],onChange:j,isClearable:!r,isError:P})}),!!n&&a.jsx(a.Fragment,{children:z||u})]}),[z,B,Q,M,u,F,n,H,j,r,P]);return a.jsxs(To,{isChangeable:K,onClick:W,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:M,isSelectedExternalValue:B,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:n?"1_1.5":"0_0",children:a.jsxs("div",{children:[q,a.jsx(oa,{sourcePath:p})]})})]})},b7=({label:e,placeholder:t=h.inputs.dropdownWithSearch.ALL,emptyPlaceholder:n,value:s,isClearable:r=!0,isCloseOnScroll:i=!1,isError:o,isGrid:c,options:u,onChange:d})=>{const[p,g]=l.useState(!1),[A,E]=l.useState(""),x=l.useRef(null),y=l.useRef(null),I=l.useRef(null),v=l.useRef(null),S=l.useRef([]),b=l.useCallback(()=>{y.current?.focus()},[]),w=l.useCallback(M=>{x.current&&(x.current.contains(M.target)||g(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}),[w]);const _=l.useMemo(()=>s||(r?"all":null),[s,r]),N=l.useMemo(()=>{const K=r?[{value:"all",label:p&&n?n:t,isPlaceholder:!0},...u]:u,W=Ka({value:A});if(!W)return K;const H=Ka({value:qh({text:W,target:"ru"})}),j=Ka({value:qh({text:W,target:"en"})}),q=[W,H,j],G=q.map(ne=>ne.replace(/\./g,"")),$=q.map(ne=>ne.replace(/\D+/g," ").replace(/\s+/g," ").trim()),J=K.filter(ne=>{const X=Ka({value:ne.label}),oe=(()=>
854{if(!ne.description)return X;const te=Ka({value:ne.description});return`${X} ${te}`.trim()})(),ie=oe.replace(/\./g,""),ee=oe.replace(/\D+/g," ").replace(/\s+/g," ").trim();return!!(q.some(te=>oe.includes(te))||G.some(te=>ie.includes(te))||$.some(te=>!!te&&ee.includes(te)))});return J.length?J:[{value:"noMatches",label:h.inputs.dropdownWithSearch.NO_MATCHES,isNoMatches:!0}]},[u,A,t,n,r,p]),R=l.useMemo(()=>{const M=N.filter(q=>!!q.isPlaceholder),K=N.filter(q=>!q.isPlaceholder);if(K.length===1&&K[0].isNoMatches)return[{option:K[0],isFollowedByZoneSeparator:!1}];const W=K.filter(q=>q.zone==="primary"),H=K.filter(q=>q.zone!=="primary"),j=W.length>0&&H.length>0;return[...M.map(q=>({option:q,isFollowedByZoneSeparator:!1})),...W.map((q,G)=>({option:q,isFollowedByZoneSeparator:j&&G===W.length-1})),...H.map(q=>({option:q,isFollowedByZoneSeparator:!1}))]},[N]),D=l.useMemo(()=>{if(s)return u.find(M=>M.value===s)},[u,s]),k=l.useCallback(()=>{g(M=>!M)},[]);l.useEffect(()=>{if(!p)return;b();const M=x.current,K=I.current;if(!M||!K)return;const W=Ji(M,K,async()=>{const H=M.getBoundingClientRect(),j=Io({referenceTop:H.top,referenceBottom:H.bottom,floatingHeight:K.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"}),q=await Ei(M,K,{placement:hc[j],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),G=xi-H.top,$=Math.max(q.y,G);Object.assign(K.style,{left:`${q.x}px`,top:`${$}px`})});return()=>W()},[p,b]);const L=l.useCallback(M=>{E(M.target.value)},[]),O=l.useCallback(()=>{E("")},[]),P=l.useCallback(M=>{d(M.value),g(!1),E("")},[d]);l.useEffect(()=>{if(!p)return;const M=I.current,K=v.current;if(!M)return;const W=j=>{if(!K){j.preventDefault();return}K.scrollHeight>K.clientHeight||j.preventDefault()},H=j=>{const q=j.deltaY;if(!K){j.preventDefault();return}if(!K.contains(j.target)){j.preventDefault();return}if(!(K.scrollHeight>K.clientHeight)){j.preventDefault();return}const $=K.scrollTop===0,J=Math.ceil(K.scrollTop+K.clientHeight)>=K.scrollHeight;if($&&q<0){j.preventDefault();return}J&&q>0&&j.preventDefault()};return K&&K.addEventListener("wheel",W,{passive:!1}),M.addEventListener("wheel",H,{passive:!1,capture:!0}),()=>{K&&K.removeEventListener("wheel",W),M.removeEventListener("wheel",H,{capture:!0})}},[p]),l.useEffect(()=>{if(!p||!c&&!i)return;const M=performance.now(),K=()=>{performance.now()-M<fl||g(!1)},W=[],H=j=>{if(!j)return;const q=j.parentElement;if(!q)return;q.scrollHeight>q.clientHeight&&(q.addEventListener("scroll",K,{passive:!0}),W.push(q)),H(q)};return H(x.current),window.addEventListener("scroll",K,{passive:!0}),window.addEventListener("resize",K,{passive:!0}),W.push(window),S.current=W,()=>{S.current.forEach(j=>{if(j instanceof Window){j.removeEventListener("scroll",K),j.removeEventListener("resize",K);return}j.removeEventListener("scroll",K)}),S.current=[]}},[p,c,i]);const B=l.useMemo(()=>{const M="flex gap-1 items-center justify-start cursor-pointer rounded-[4px]";return o?Y(M,"h-8","px-1.5","bg-red-100","hover:bg-red-100"):c?p?Y(M,"px-1.5","h-8","bg-zinc-100"):Y(M,"px-1.5","h-8","bg-white","hover:bg-zinc-50"):Y(M,"h-6")},[o,c,p]),F=l.useMemo(()=>{const M="overflow-hidden text-ellipsis whitespace-nowrap";if(!c)return Y(M,"max-w-40 bp56_25:max-w-50 roboto-flex-25-700-1 uppercase text-zinc-900 text-[14px] leading-[16px]");const K=Y(M,"min-w-0 flex-1 w-0 roboto-flex-100-400-1 text-[16px] leading-[20px]");return _==="all"||_===null?Y(K,"text-zinc-500"):Y(K,"text-zinc-950")},[c,_]),z=l.useMemo(()=>D?h2({label:D.label,description:D.description}):t,[D,t]),Q=l.useMemo(()=>p?a.jsxs("div",{ref:I,className:Y("absolute flex flex-col max-h-82 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50",!!c&&"w-full",!c&&"w-106"),children:[a.jsx("div",{className:"p-1 cursor-text",onClick:b,children:a.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-8 h-8 bg-zinc-100 rounded-[4px]",children:[a.jsx("div",{className:"pl-2.5",children:a.jsx(l2,{className:"size-5 -scale-x-100 text-zinc-400"})}),a.jsx("input",{ref:y,value:A,onChange:L,className:"file:text-foreground placeholder:text-muted-foreground bg-transparent transition-[color,box-shadow] outline-none focus:ring-0 focus:shadow-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 password-clean border-0 block roboto-flex-100-400-1 w-full h-full text-[16px] leading-[20px] text-zinc-950"}),a.jsx("div",{className:Y("pr-1.5 cursor-pointer",!A&&"hidden"),onClick:O,children:!!A&&a.jsx(ga,{className:"size-6 text-zinc-400"})})]})}),a.jsx("div",{className:"flex flex-col p-1 pt-0 flex-1 overflow-hidden select-none",children:a.jsx("div",{ref:v,className:"overflow-y-auto flex-1 overscroll-contain",children:R.map(({option:M,isFollowedByZoneSeparator:K})=>a.jsxs(l.Fragment,{children:[a.jsx("div",{onClick:()=>{M.isNoMatches||P(M)},className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group",!M.isNoMatches&&"cursor-pointer",!!M.isNoMatches&&"cursor-default pointer-events-none"),children:a.jsxs("div",{className:Y("flex items-start justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!M.isNoMatches&&!(M.isPlaceholder&&c)&&"text-zinc-950",!(!M.isNoMatches&&!(M.isPlaceholder&&c))&&"text-zinc-500"),children:[a.jsx(y7,{label:M.label,description:M.description,isDescriptionShimmering:M.isDescriptionShimmering}),M.value===_&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]})}
854),!!K&&a.jsx("div",{"aria-hidden":!0,className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},M.value))})})]}):null,[p,A,_,R,b,P,L,O,c]);return a.jsxs("div",{ref:x,className:"relative",children:[a.jsxs("div",{className:B,onClick:k,children:[!!e&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400",children:e}),a.jsx("div",{className:F,children:z}),!c&&a.jsx(Bu,{className:Y("size-2",!p&&"rotate-180")})]}),Q]})},Vse=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,externalValue:o,commitDataPath:c,placeholder:u,emptyPlaceholder:d,catalogue:p,enumKey:g,patch:A,isSearchable:E,primaryArticleIds:x,theme:y,externalErrorText:I,onPatchSuccess:v,sourcePath:S})=>{const{catalogues:b}=kn(),[w,_]=l.useState(!1),[N,R]=l.useState(i??null),[D,k]=l.useState(!1),[L,O]=l.useState(!1),{commitData:P,setCommitData:B}=wt({clientId:e}),{patchResourceItem:F}=Ca({clientId:e}),{patchResourceItem:z}=zf(),[Q,M]=l.useState(null),K=l.useMemo(()=>A.endpoint.map(ue=>ue==="{clientId}"?e!==void 0?String(e):"":ue).join("/")+"/",[A,e]),W=bs(fe=>fe.requestsByClient?.[String(e??"")]?.[K]?.[A.field]),H=l.useMemo(()=>{if(Q)return W?.[Q]},[W,Q]),j=!!H&&!!Q&&H.requestId===Q&&H.status==="error",q=l.useMemo(()=>!!r&&!N,[r,N]),G=l.useMemo(()=>!!(!w&&L||j||I),[w,L,j,I]),$=l.useMemo(()=>Eo({data:P,path:c})==="external",[P,c]),J=l.useMemo(()=>{if(p==="enums")return!b?.enums||!g?null:On(h.enums[g],o,"");const fe=b?.articles;if(!fe)return null;const ue=fe.find(ye=>ye.id===o);return ue?et({clause:ue.clause,part:ue.part,number:ue.number}):""},[p,b?.articles,b?.enums,g,o]),ne=l.useMemo(()=>{if(p==="enums")return!b?.enums||!g?null:On(h.enums[g],i,"");const fe=b?.articles;if(!fe)return null;const ue=fe.find(ye=>ye.id===i);return ue?et({clause:ue.clause,part:ue.part,number:ue.number}):""},[p,b?.articles,b?.enums,g,i]),X=l.useMemo(()=>!(Qd(i)||Qd(o)||i===o),[i,o]),oe=l.useMemo(()=>!(!Qd(i)||Qd(o)),[i,o]),ie=l.useMemo(()=>!!(X||oe),[X,oe]);l.useEffect(()=>{w||L||R(i??null)},[i,w,L]),l.useEffect(()=>{w&&D&&i!==void 0&&i===N&&(k(!1),O(!1),_(!1))},[w,i,N,D]);const ee=l.useCallback(()=>{ie&&c&&B(fe=>ul({data:fe,path:c,value:$?void 0:"external"}))},[c,$,B,ie]),te=l.useMemo(()=>{if(p==="enums"){if(!g)return[];const ye=b?.enums?.[g];if(!ye)return[];const ce=h.enums[g];return ye.map(xe=>({value:String(xe),label:On(ce,String(xe),String(xe))}))}const fe=b?.articles;if(!fe)return[];const ue=!!x?.length;return fe.map(ye=>{const ce=String(ye.id);return{value:ce,label:et({clause:ye.clause,part:ye.part,number:ye.number}),...ue&&{zone:x.includes(ce)?"primary":"secondary"}}})},[p,b?.articles,b?.enums,g,x]),le=l.useCallback(fe=>{const ue=Qd(fe)?null:fe;if(q&&!ue){_(!1),O(!0),k(!1);return}if(i===ue&&!j){_(!1),O(!1),k(!1);return}R(ue),O(!1),k(!0),_(!0);const ce=(A.endpoint[0]==="accounts"?z:F)({pathSegments:A.endpoint,pathValues:{},bodyKey:A.field,bodyValue:ue,onPatchSuccess:v});M(ce)},[q,A.endpoint,A.field,z,F,i,j,v]),he=l.useMemo(()=>X?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:$?J:ne}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:$?ne:J})]}):oe?a.jsx("div",{className:Y(!!$&&"text-zinc-950",!$&&"text-zinc-400"),children:$?J:u}):a.jsxs("div",{className:Y("relative",!!ne&&"text-zinc-950",!ne&&"text-zinc-400"),children:[!n&&a.jsxs("div",{className:"-ml-1.5",children:[!E&&a.jsx(m2,{placeholder:u,emptyPlaceholder:d,value:N,options:te,onChange:le,isClearable:!r,isError:G}),!!E&&a.jsx(b7,{placeholder:u,emptyPlaceholder:d,value:N,options:te,onChange:le,isClearable:!r,isError:G,isGrid:!0}),!!G&&!!I&&a.jsx("div",{className:"pl-1.5 text-red-600 roboto-flex-100-400-1 text-[14px] leading-[16px] mt-1 mb-1",children:I})]}),!!n&&a.jsx(a.Fragment,{children:ne||u})]}),[X,$,J,ne,oe,u,n,E,d,N,te,le,r,G,I]);return a.jsxs(To,{isChangeable:ie,onClick:ee,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:oe,isSelectedExternalValue:$,labelTheme:y,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:n?"1_1.5":"0_0",children:a.jsxs("div",{children:[he,a.jsx(oa,{sourcePath:S})]})})]})},Gse=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,placeholder:o,emptyPlaceholder:c,options:u,isSearchable:d,patch:p,onPatchSuccess:g,theme:A,sourcePath:E})=>{const[x,y]=l.useState(i??null),[I,v]=l.useState(!1),[S,b]=l.useState(!1),[w,_]=l.useState(!1),[N,R]=l.useState(null),{patchResourceItem:D}=Ca({clientId:e}),k=l.useMemo(()=>p.endpoint.map(j=>j==="{clientId}"?e===void 0?"":String(e):j).join("/")+"/",[p.endpoint,e]),L=bs(H=>H.requestsByClient?.[String(e??"")]?.[k]?.[p.field]),O=l.useMemo(()=>
854{if(N)return L?.[N]},[L,N]),P=l.useMemo(()=>!(!O||!N||O.requestId!==N||O.status!=="error"),[O,N]),B=l.useMemo(()=>!(!r||x),[r,x]),F=l.useMemo(()=>!!(!S&&w||P),[S,w,P]),z=l.useMemo(()=>{const H=u.find(j=>j.value===i);return H===void 0?"":h2({label:H.label,description:H.description})},[u,i]),Q=l.useMemo(()=>r?`${s} *`:s??"",[s,r]),M=l.useMemo(()=>z!==""?z:o??"",[z,o]),K=l.useMemo(()=>n?"1_1.5":"0_0",[n]);l.useEffect(()=>{S||w||y(i??null)},[i,S,w]),l.useEffect(()=>{S&&I&&i!==void 0&&i===x&&(v(!1),_(!1),b(!1))},[S,i,x,I]);const W=l.useCallback(H=>{const j=Qd(H)?null:H;if(B&&!j){b(!1),_(!0),v(!1);return}if(i===j&&!P){b(!1),_(!1),v(!1);return}y(j),_(!1),v(!0),b(!0);const q=D({pathSegments:p.endpoint,pathValues:{},bodyKey:p.field,bodyValue:j,onPatchSuccess:g});R(q)},[B,p.endpoint,p.field,D,i,P,g]);return a.jsxs(To,{children:[a.jsx(No,{isGrouped:t,labelTheme:A,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:Q})}),a.jsx(wo,{paddingY:K,children:a.jsxs("div",{className:Y("relative",!!z&&"text-zinc-950",!z&&"text-zinc-400"),children:[!n&&a.jsxs("div",{className:"-ml-1.5",children:[!d&&a.jsx(m2,{placeholder:o,emptyPlaceholder:c,value:x,options:u,onChange:W,isClearable:!r,isError:F}),!!d&&a.jsx(b7,{placeholder:o,emptyPlaceholder:c,value:x,options:u,onChange:W,isClearable:!r,isError:F,isGrid:!0})]}),!!n&&a.jsx(a.Fragment,{children:M}),a.jsx(oa,{sourcePath:E})]})})]})},qse=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...e},l.createElement("polyline",{points:"15 18 9 12 15 6"})),Wse=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...e},l.createElement("polyline",{points:"9 18 15 12 9 6"})),Kse=({viewMonthDate:e,setViewMonthDate:t})=>{const n=l.useCallback(()=>{t(i=>new Date(i.getFullYear(),i.getMonth()-1,1))},[t]),s=l.useCallback(()=>{t(i=>new Date(i.getFullYear(),i.getMonth()+1,1))},[t]),r=l.useMemo(()=>{const i=is(e,"LLLL yyyy",{locale:jf});return i&&i.charAt(0).toUpperCase()+i.slice(1)},[e]);return a.jsxs("div",{className:"h-7 flex justify-between",children:[a.jsx("button",{type:"button",onClick:n,className:"h-7 w-7 text-zinc-600 flex justify-center items-center rounded-[4px] cursor-pointer border border-zinc-200",children:a.jsx(qse,{className:"size-4"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-zinc-950 flex justify-center items-center text-[16px]",children:r}),a.jsx("button",{type:"button",onClick:s,className:"h-7 w-7 text-zinc-600 flex justify-center items-center rounded-[4px] cursor-pointer border border-zinc-200",children:a.jsx(Wse,{className:"size-4"})})]})},$se=()=>{const e=h.dateTime.WEEKDAYS_SHORT;return a.jsx("div",{className:"roboto-flex-100-400-1 text-zinc-600 text-[14px] mt-2.5 h-7 flex justify-between",children:e.map((t,n)=>a.jsx("div",{className:"w-8 flex justify-center items-center",children:t},n))})},Yse=({dateValue:e,isCurrentMonth:t,minDate:n,maxDate:s,selectedDate:r,setHoverDate:i,onSelectDate:o})=>{const c=l.useMemo(()=>{const g=is(tu(e),"yyyy-MM-dd");if(n){const A=is(tu(n),"yyyy-MM-dd");if(g<A)return!0}if(s){const A=is(tu(s),"yyyy-MM-dd");if(g>A)return!0}return!1},[e,n,s]),u=l.useCallback(()=>{!i||c||i(e)},[i,e,c]),d=l.useCallback(()=>{c||o&&i&&(o(e),i(null))},[o,e,i,c]),p=l.useMemo(()=>!(!r||r.getDate()!==e.getDate()||r.getMonth()!==e.getMonth()||r.getFullYear()!==e.getFullYear()),[r,e]);return r&&p?a.jsx("div",{className:Y("roboto-flex-100-400-1 text-zinc-950 w-8 flex justify-center items-center text-[14px]",!c&&"cursor-pointer"),onClick:d,children:a.jsx("div",{className:"text-white bg-zinc-900 rounded-[4px] w-8 h-8 flex justify-center items-center",children:r.getDate()})}):a.jsx("div",{className:Y("roboto-flex-100-400-1 text-zinc-950 w-8 flex justify-center items-center group",!c&&"cursor-pointer"),onClick:d,onMouseEnter:u,children:a.jsx("div",{className:Y("rounded-[4px] w-8 h-8 flex justify-center items-center text-[14px]",!!c&&Y("text-zinc-400","cursor-default"),!c&&Y(!!t&&"text-zinc-950",!t&&"text-zinc-400","group-hover:bg-zinc-100")),children:e.getDate()})})},Xse=({days:e,viewMonthDate:t,minDate:n,maxDate:s,setHoverDate:r,onSelectDate:i,selectedDate:o})=>a.jsx("div",{className:"h-10 flex justify-between",children:e.map((c,u)=>{const d=c.getMonth()===t.getMonth();return a.jsx(Yse,{dateValue:c,isCurrentMonth:d,minDate:n,maxDate:s,setHoverDate:r,onSelectDate:i,selectedDate:o},u)})}
854),Jse=({viewMonthDate:e=new Date,minDate:t,maxDate:n,setHoverDate:s,onSelectDate:r,selectedDate:i})=>{const o=l.useMemo(()=>{const u=e.getFullYear(),d=e.getMonth(),A=(new Date(u,d,1).getDay()+6)%7,E=Array.from({length:42},(x,y)=>{const I=y-A+1;return new Date(u,d,I)});return Array.from({length:6},(x,y)=>E.slice(y*7,y*7+7))},[e]),c=l.useCallback(()=>{s&&s(null)},[s]);return a.jsx("div",{onMouseLeave:c,children:o.map((u,d)=>a.jsx(Xse,{days:u,viewMonthDate:e,minDate:t,maxDate:n,setHoverDate:s,onSelectDate:r,selectedDate:i},d))})},Zse=l.forwardRef(({selectedDate:e,minDate:t,maxDate:n,setHoverDate:s,onSelectDate:r},i)=>{const[o,c]=l.useState(()=>e??new Date),u=l.useCallback(d=>{d.preventDefault()},[]);return a.jsxs("div",{ref:i,className:"absolute h-81 w-61.5 pt-2.75 px-2.75 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-1 select-none z-50",onMouseDown:u,children:[a.jsx(Kse,{viewMonthDate:o,setViewMonthDate:c}),a.jsx($se,{}),a.jsx(Jse,{viewMonthDate:o,minDate:t,maxDate:n,setHoverDate:s,onSelectDate:r,selectedDate:e})]})}),QI=l.forwardRef(({value:e,date:t,placeholder:n,minDate:s,maxDate:r,onChange:i,onFocus:o,onBlur:c,onKeyDown:u,onSelectDate:d,isError:p,className:g},A)=>{const[E,x]=l.useState(!1),[y,I]=l.useState(null),v=l.useRef(null),S=l.useRef(null),b=l.useRef([]),w=l.useCallback(k=>{x(!0),o&&o(k)},[o]),_=l.useCallback(k=>{x(!1),c&&c(k)},[c]),N=l.useCallback(k=>{if(i){if(y){k.preventDefault(),k.stopPropagation();return}i(k)}},[i,y]),R=l.useCallback(k=>{if(u){if(y){k.preventDefault(),k.stopPropagation();return}u(k)}},[u,y]),D=l.useMemo(()=>y?lo({value:is(y,"yyyy-MM-dd")}):null,[y]);return l.useEffect(()=>{if(!y||typeof A!="object"||!A||!A.current)return;const k=A.current;document.activeElement===k&&requestAnimationFrame(()=>{k.select()})},[y,A]),l.useEffect(()=>{if(!E)return;const k=v.current,L=S.current;if(!k||!L)return;const O=Ji(k,L,async()=>{const P=k.getBoundingClientRect(),B=Io({referenceTop:P.top,referenceBottom:P.bottom,floatingHeight:L.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"}),F=await Ei(k,L,{placement:hc[B],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),z=xi-P.top,Q=Math.max(F.y,z);Object.assign(L.style,{left:`${F.x}px`,top:`${Q}px`})});return()=>O()},[E,A]),l.useEffect(()=>{if(!E)return;const k=performance.now(),L=()=>{performance.now()-k<fl||(I(null),x(!1),!(typeof A!="object"||!A||!A.current)&&document.activeElement===A.current&&A.current.blur())},O=[],P=B=>{if(!B)return;const F=B.parentElement;if(!F)return;F.scrollHeight>F.clientHeight&&(F.addEventListener("scroll",L,{passive:!0}),O.push(F)),P(F)};return P(v.current),window.addEventListener("scroll",L,{passive:!0}),window.addEventListener("resize",L,{passive:!0}),O.push(window),b.current=O,()=>{b.current.forEach(B=>{if(B instanceof Window){B.removeEventListener("scroll",L),B.removeEventListener("resize",L);return}B.removeEventListener("scroll",L)}),b.current=[]}},[E,A]),a.jsxs("div",{ref:v,className:"relative",children:[a.jsx("input",{ref:A,type:"text",className:Y("file:text-foreground","placeholder:text-muted-foreground","autofill-neutralize","flex","min-w-0","outline-none","focus:ring-0","focus:shadow-none","file:inline-flex","file:h-7","file:border-0","file:bg-transparent","file:text-sm","file:font-medium","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","password-clean","px-1.5","py-1.5","-ml-1.5","w-full",!p&&"bg-white",!p&&"cursor-pointer",!p&&"hover:bg-zinc-50",!!p&&"bg-red-100",!!p&&"cursor-text",!!p&&"hover:bg-red-100","focus:bg-zinc-100","focus:cursor-text","rounded-[4px]","roboto-flex-100-400-1","text-zinc-950","text-[16px]","leading-[20px]",g),value:D||e,placeholder:n,onChange:N,onFocus:w,onBlur:_,onKeyDown:R}),!!E&&a.jsx(Zse,{ref:S,selectedDate:t,minDate:s,maxDate:r,setHoverDate:I,onSelectDate:d})]})}),ere=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,value:i,externalValue:o,commitDataPath:c,placeholder:u,patch:d,sourcePath:p})=>{const g=Oe.useMemo(()=>Ut(i)?i:lo({value:(i??"").toString()}),[i]),A=Oe.useMemo(()=>
854Ut(o)?o:lo({value:(o??"").toString()}),[o]),E=l.useRef(null),[x,y]=l.useState("view"),[I,v]=l.useState(g??""),[S,b]=l.useState(!1),[w,_]=l.useState(!1),{commitData:N,setCommitData:R}=wt({clientId:e}),{patchResourceItem:D}=Ca({clientId:e}),{patchResourceItem:k}=zf(),[L,O]=l.useState(null),P=l.useMemo(()=>d.endpoint.map(ue=>ue==="{clientId}"?e!==void 0?String(e):"":ue).join("/")+"/",[d,e]),B=bs(fe=>fe.requestsByClient?.[String(e??"")]?.[P]?.[d.field]),F=l.useMemo(()=>{if(L)return B?.[L]},[B,L]),z=!!F&&!!L&&F.requestId===L&&F.status==="error",Q=l.useMemo(()=>!!r&&Ut(I),[r,I]),M=l.useMemo(()=>Ut(I)?!1:lo({value:I.toString()})==="",[I]),K=l.useMemo(()=>!!(x==="view"&&w||z||M),[x,w,z,M]),W=l.useMemo(()=>Eo({data:N,path:c})==="external",[N,c]),H=l.useMemo(()=>{if(Ut(A))return"";const fe=A.trim();return Kt({dateString:I0({value:fe}),isWithTime:!1,isShortMonth:!1})},[A]),j=l.useMemo(()=>{if(Ut(g))return"";const fe=g.trim();return Kt({dateString:I0({value:fe}),isWithTime:!1,isShortMonth:!1})},[g]),q=l.useMemo(()=>{if(Ut(g))return null;const fe=lo({value:I.toString()});if(fe==="")return null;const ue=Fs(fe,"dd.MM.yyyy",new Date);return Mu(ue)?ue:null},[I,g]),G=l.useMemo(()=>Ut(I)?null:lo({value:I.toString()}),[I]),$=l.useMemo(()=>!(Ut(g)||Ut(A)||g===A),[g,A]),J=l.useMemo(()=>!(!Ut(g)||Ut(A)),[g,A]),ne=l.useMemo(()=>!!($||J),[$,J]);l.useEffect(()=>{x==="view"&&(w||K||v(g??""))},[g,x,w,K]),l.useEffect(()=>{x==="waitingForConfirmation"&&S&&g!==void 0&&g!==null&&g===G&&(b(!1),_(!1),y("view"))},[x,g,G,S]);const X=l.useCallback(()=>{ne&&c&&R(fe=>ul({data:fe,path:c,value:W?void 0:"external"}))},[c,W,R,ne]),oe=l.useCallback(fe=>{const ye=fe.target.value;v(ye),_(!1);const ce=lo({value:ye.toString()});x==="editing"&&ce!==g&&b(!0)},[x,g]),ie=l.useCallback(()=>{y("editing"),requestAnimationFrame(()=>{E.current&&E.current.select()})},[]),ee=l.useCallback(()=>{if(Q){y("view"),v(g??""),_(!0),b(!1);return}if(M){y("view"),_(!0);return}if(G===g&&!z){y("view"),_(!1),b(!1);return}y("waitingForConfirmation");const ue=(d.endpoint[0]==="accounts"?k:D)({pathSegments:d.endpoint,pathValues:{},bodyKey:d.field,bodyValue:G===null?null:I0({value:G})});O(ue)},[d.endpoint,d.field,g,D,k,Q,M,G,z]),te=l.useCallback(fe=>{v(lo({value:is(fe,"yyyy-MM-dd")})),b(!0),E.current&&requestAnimationFrame(()=>{E.current?.blur()})},[]),le=l.useCallback(fe=>{if(fe.key==="Escape"||fe.key==="Esc"){Wn.flushSync(()=>v(g??"")),E.current?.blur();return}if(fe.key==="Enter"){E.current?.blur();return}},[g]),he=l.useMemo(()=>$?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:W?H:j}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:W?j:H})]}):J?a.jsx("div",{className:Y(!!W&&"text-zinc-950",!W&&"text-zinc-400"),children:W?H:u}):a.jsxs("div",{className:Y(!!j&&"text-zinc-950",!j&&"text-zinc-400"),children:[!n&&a.jsx(QI,{ref:E,value:(()=>{if(x!=="view"||w||K){if(z&&x==="view"){const fe=Kt({dateString:I0({value:I}),isWithTime:!1,isShortMonth:!1});return fe===""?I:fe}return I}return j})(),date:q,placeholder:u,onChange:oe,onFocus:ie,onBlur:ee,onKeyDown:le,onSelectDate:te,isError:K}),!!n&&a.jsx(a.Fragment,{children:j||u})]}),[j,w,W,$,J,u,H,n,I,K,x,z,q,oe,ie,ee,le,te]);return a.jsxs(To,{isChangeable:ne,onClick:X,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:J,isSelectedExternalValue:W,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:n?"1_1.5":"0_0",children:a.jsxs("div",{children:[he,a.jsx(oa,{sourcePath:p})]})})]})};var My,Y6;function tre(){return Y6||(Y6=1,My=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var s,r,i;if(Array.isArray(t)){if(s=t.length,s!=n.length)return!1;for(r=s;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),s=i.length,s!==Object.keys(n).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=s;r--!==0;){var o=i[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),My}var nre=tre();const cA=Am(nre),sre=({placeholder:e=h.inputs.dropdownWithSearch.ALL,values:t,isClearable:n=!0,isCloseOnScroll:s=!1,isError:r,isGrid:i,options:o,onChange:c,label:u,resetKey:d=0})=>{const[p,g]=l.useState(()=>t??[]),[A,E]=l.useState(!1),x=l.useRef(t??[]),y=l.useRef(null),I=l.useRef(null),v=l.useRef([]),S=l.useCallback(P=>{y.current&&(y.current.contains(P.target)||(g(t??[]),E(!1)))},[t]);l.useEffect(()=>
854(document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}),[S]),l.useEffect(()=>{x.current=t??[]},[t]),l.useEffect(()=>{g(x.current??[])},[d]),l.useEffect(()=>{if(!A)return;const P=y.current,B=I.current;if(!P||!B)return;const F=Ji(P,B,async()=>{const z=P.getBoundingClientRect(),Q=Io({referenceTop:z.top,referenceBottom:z.bottom,floatingHeight:B.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"}),M=await Ei(P,B,{placement:hc[Q],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),K=xi-z.top,W=Math.max(M.y,K);Object.assign(B.style,{left:`${M.x}px`,top:`${W}px`})});return()=>F()},[A]),l.useEffect(()=>{if(!A||!i&&!s)return;const P=performance.now(),B=()=>{performance.now()-P<fl||E(!1)},F=[],z=Q=>{if(!Q)return;const M=Q.parentElement;if(!M)return;M.scrollHeight>M.clientHeight&&(M.addEventListener("scroll",B,{passive:!0}),F.push(M)),z(M)};return z(y.current),window.addEventListener("scroll",B,{passive:!0}),window.addEventListener("resize",B,{passive:!0}),F.push(window),v.current=F,()=>{v.current.forEach(Q=>{if(Q instanceof Window){Q.removeEventListener("scroll",B),Q.removeEventListener("resize",B);return}Q.removeEventListener("scroll",B)}),v.current=[]}},[A,i,s]);const b=l.useCallback(()=>{E(P=>!P)},[]),w=l.useCallback(P=>{g(B=>{const F=B??[];return F.includes(P.value)?F.filter(Q=>Q!==P.value):[...F,P.value]})},[]),_=l.useCallback(()=>{cA(p,t)||(E(!1),c&&c(p??[]))},[p,c,t]),N=l.useCallback(()=>{g([])},[]),R=l.useMemo(()=>{const P=o.filter(M=>!!M.isPlaceholder),B=o.filter(M=>!M.isPlaceholder),F=B.filter(M=>M.zone==="primary"),z=B.filter(M=>M.zone!=="primary"),Q=F.length>0&&z.length>0;return[...P.map(M=>({option:M,isFollowedByZoneSeparator:!1})),...F.map((M,K)=>({option:M,isFollowedByZoneSeparator:Q&&K===F.length-1})),...z.map(M=>({option:M,isFollowedByZoneSeparator:!1}))]},[o]),D=l.useMemo(()=>A?a.jsxs("div",{ref:I,className:Y("absolute flex flex-col max-h-85 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50",!!i&&"w-full",!i&&"min-w-80"),children:[a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:R.map(({option:P,isFollowedByZoneSeparator:B})=>a.jsxs(l.Fragment,{children:[a.jsx("div",{onClick:()=>w(P),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer"),children:a.jsxs("div",{className:Y("flex items-start justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!P.isPlaceholder&&"text-zinc-950",!!P.isPlaceholder&&"text-zinc-500"),children:[P.label,(p??[]).includes(P.value)&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]})}),!!B&&a.jsx("div",{"aria-hidden":!0,className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},P.value))})}),a.jsxs("div",{className:"flex justify-between items-center min-h-11 h-11 mb-1 px-4 gap-1.5",children:[a.jsx("div",{className:"roboto-flex-25-700-1 flex-1 text-[14px] leading-[16px] uppercase text-zinc-100 flex justify-center items-center h-8 bg-zinc-900 hover:bg-zinc-950 hover:text-white rounded-full cursor-pointer",onClick:_,children:h.inputs.dropdownWithSearch.APPLY}),!!n&&a.jsx("div",{className:Y("roboto-flex-25-700-1 flex-1 text-[14px] leading-[16px] uppercase  flex justify-center items-center h-8 bg-zinc-100 hover:bg-zinc-200 rounded-full cursor-pointer",!(p??[]).length&&"text-zinc-300",!!(p??[]).length&&"text-zinc-950"),onClick:N,children:h.inputs.dropdownWithSearch.CLEAR})]})]}):null,[A,p,R,w,N,_,i,n]),k=l.useMemo(()=>{const P="flex gap-1 items-center justify-between cursor-pointer rounded-[4px] px-1.5";return r?Y(P,"bg-red-100","hover:bg-red-100"):i?A?Y(P,"min-h-8","bg-zinc-100"):Y(P,"min-h-8","bg-white","hover:bg-zinc-50"):Y(P,"h-8","bg-zinc-100","hover:bg-zinc-100")},[r,i,A]),L=l.useMemo(()=>{if(!i)return Y("overflow-hidden text-ellipsis whitespace-nowrap max-w-40 bp56_25:max-w-70 roboto-flex-25-700-1 uppercase text-zinc-600 text-[14px] leading-[16
854px] ");const P=Y("min-w-0 flex-1 w-0 roboto-flex-100-400-1 text-[16px] leading-[24px]");return!p||p.length===0?Y(P,"text-zinc-500"):Y(P,"text-zinc-950")},[i,p]),O=l.useMemo(()=>{const P=t??[];if(!P.length)return a.jsx("div",{className:L,children:e});if(i){const z=o.filter(M=>P.includes(M.value)).map(M=>M.label).filter(M=>!!M),Q=z.map((M,K)=>{const W=K===z.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[M,!W&&", "]},`${M}-${K}`)});return Q?a.jsx("div",{className:L,children:Q}):a.jsx("div",{className:L,children:e})}const B=o.find(z=>P.includes(z.value));if(!B)return a.jsx("div",{className:L,children:e});const F=B.label??e;return P.length>1?a.jsxs("div",{className:L,children:[F," ",a.jsxs("div",{className:"inline-block text-zinc-400",children:["+",P.length-1]})]}):a.jsx("div",{className:L,children:F})},[t,o,e,L,i]);return a.jsxs("div",{ref:y,className:"relative select-none",children:[a.jsxs("div",{className:k,onClick:b,children:[!!(u&&!i)&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400",children:u}),O,!i&&a.jsx(Bu,{className:Y("text-zinc-400 size-2",!A&&"rotate-180")})]}),D]})},rre=({clientId:e,isGrouped:t,isDisabled:n,label:s,isRequired:r,values:i,externalValues:o,commitDataPath:c,placeholder:u,catalogue:d,enumKey:p,patch:g,isSearchable:A,patchBodyMapper:E,sourcePath:x})=>{const{catalogues:y}=kn(),[I,v]=l.useState(!1),[S,b]=l.useState(i??null),[w,_]=l.useState(!1),[N,R]=l.useState(!1),{commitData:D,setCommitData:k}=wt({clientId:e}),{patchResourceItem:L}=Ca({clientId:e}),{patchResourceItem:O}=zf(),[P,B]=l.useState(null),F=l.useMemo(()=>g.endpoint.map(te=>te==="{clientId}"?e!==void 0?String(e):"":te).join("/")+"/",[g,e]),z=bs(ee=>ee.requestsByClient?.[String(e??"")]?.[F]?.[g.field]),Q=l.useMemo(()=>{if(P)return z?.[P]},[z,P]),M=!!Q&&!!P&&Q.requestId===P&&Q.status==="error",K=l.useMemo(()=>r?!S||S.length===0:!1,[r,S]),W=l.useMemo(()=>!!(!I&&N||M),[I,N,M]),H=l.useMemo(()=>Eo({data:D,path:c})==="external",[D,c]),j=l.useMemo(()=>{if(d==="enums"){if(!y?.enums||!p)return null;const he=h.enums[p];return(o??[]).map(ue=>On(he,String(ue),""))}const ee=y?.articles;return ee?(o??[]).map(le=>{const he=ee.find(fe=>fe.id===le);return he?et({clause:he.clause,part:he.part,number:he.number}):""}).filter(le=>!!le):null},[d,y?.articles,y?.enums,p,o]),q=l.useMemo(()=>{if(d==="enums"){if(!y?.enums||!p)return null;const he=h.enums[p];return(i??[]).map(ue=>On(he,String(ue),""))}const ee=y?.articles;return ee?(i??[]).map(le=>{const he=ee.find(fe=>fe.id===le);return he?et({clause:he.clause,part:he.part,number:he.number}):""}).filter(le=>!!le):null},[d,y?.articles,y?.enums,p,i]),G=l.useMemo(()=>{const ee=i??[],te=o??[];if(ee.length===0||te.length===0)return!1;const le=[...ee].sort(),he=[...te].sort();return!cA(le,he)},[i,o]),$=l.useMemo(()=>{const ee=i??[],te=o??[];return!(ee.length!==0||te.length===0)},[i,o]),J=l.useMemo(()=>!!(G||$),[G,$]);l.useEffect(()=>{I||N||W||b(i??null)},[i,I,N,W]),l.useEffect(()=>{I&&w&&i!==void 0&&cA(i??[],S??[])&&(_(!1),R(!1),v(!1))},[I,i,S,w]);const ne=l.useCallback(()=>{J&&c&&k(ee=>ul({data:ee,path:c,value:H?void 0:"external"}))},[c,H,k,J]),X=l.useMemo(()=>{if(d==="enums"){if(!p)return[];const te=y?.enums?.[p];if(!te)return[];const le=h.enums[p];return te.map(he=>({value:String(he),label:On(le,String(he),String(he))}))}const ee=y?.articles;return ee?ee.map(te=>({value:String(te.id),label:et({clause:te.clause,part:te.part,number:te.number})})):[]},[d,y?.articles,y?.enums,p]),oe=l.useCallback(ee=>{const te=ee??[];if(K&&te.length===0){v(!1),R(!0),_(!1);return}if(cA(i??[],te)&&!M){v(!1),R(!1),_(!1);return}b(te),R(!1),_(!0),v(!0);const he=(g.endpoint[0]==="accounts"?O:L)({pathSegments:g.endpoint,pathValues:{},bodyKey:g.field,bodyValue:E?.({values:te,catalogue:d,endpoint:g.endpoint,field:g.field})??te});B(he)},[K,g.endpoint,g.field,L,O,i,M,d,E]),ie=l.useMemo(()=>G?a.jsxs("div",{children:[a.jsx("div",{className:"text-zinc-950",children:(()=>{const te=((H?j:q)??[]).filter(le=>!!le);return te.length?te.map((le,he)=>{const fe=he===te.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[le,!fe&&", "]},`${le}-${he}`)}):null})()}),a.jsxs("div",{className:"relative flex h-3 items-center",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover:text-sky-400",children:a.jsx(Uf,{})})]}),a.jsx("div",{className:"text-zinc-950",children:(()=>{const te=((H?q:j)??[]).filter(le=>!!le);return te.length?te.map((le,he)=>{const fe=he===te.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[le,!fe&&", "]},`${le}-${he}`)}):null})()})]}):$?a.jsx("div",{className:Y(!!H&&"text-zinc-950",!H&&"text-zinc-400"),children:(()=>
854{if(!H)return u;const ee=(j??[]).filter(te=>!!te);return ee.length?ee.map((te,le)=>{const he=le===ee.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[te,!he&&", "]},`${te}-${le}`)}):u})()}):a.jsxs("div",{className:Y("leading-[24px]","py-1",!!q?.length&&"text-zinc-950",!q?.length&&"text-zinc-400"),children:[!n&&a.jsxs("div",{className:"-ml-1.5",children:[!A&&a.jsx(sre,{placeholder:u,values:S??null,options:X,onChange:oe,isClearable:!r,isError:W,isGrid:!0}),!!A&&a.jsx(Dn,{placeholder:u,values:S??null,options:X,onChange:oe,isClearable:!r,isError:W,isGrid:!0})]}),!!n&&a.jsx("div",{className:"-ml-1.5 px-1.5",children:(()=>{const ee=(q??[]).filter(te=>!!te);return ee.length?ee.map((te,le)=>{const he=le===ee.length-1;return a.jsxs("div",{className:"inline-block whitespace-nowrap",children:[te,!he&&", "]},`${te}-${le}`)}):u??""})()})]}),[q,H,G,$,u,j,n,S,W,X,oe,r,A]);return a.jsxs(To,{isChangeable:J,onClick:ne,children:[a.jsx(No,{isGrouped:t,isExternalAvailable:$,isSelectedExternalValue:H,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:`${s} ${r?"*":""}`})}),a.jsx(wo,{paddingY:"0_0",children:a.jsxs("div",{children:[ie,a.jsx(oa,{sourcePath:x})]})})]})},Cf=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M8 3.33337V12.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33398 8H12.6673",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),g2=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18457_51662)"},l.createElement("path",{d:"M11.334 4.66708L4.66816 11.3329",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M4.66602 4.66708L11.3318 11.3329",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18457_51662"},l.createElement("rect",{width:16,height:16,fill:"white"})))),I7=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18457_51648)"},l.createElement("path",{d:"M9.33398 2V4.66667C9.33398 4.84348 9.40422 5.01305 9.52925 5.13807C9.65427 5.2631 9.82384 5.33333 10.0007 5.33333H12.6673",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.334 14H4.66732C4.3137 14 3.97456 13.8595 3.72451 13.6095C3.47446 13.3594 3.33398 13.0203 3.33398 12.6667V3.33333C3.33398 2.97971 3.47446 2.64057 3.72451 2.39052C3.97456 2.14048 4.3137 2 4.66732 2H9.33398L12.6673 5.33333V12.6667C12.6673 13.0203 12.5268 13.3594 12.2768 13.6095C12.0267 13.8595 11.6876 14 11.334 14Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18457_51648"},l.createElement("rect",{width:16,height:16,fill:"white"})))),ire=({fileName:e,isPendingUpload:t,isPendingDetach:n,isControlsDisabled:s,onDownload:r,onDetach:i})=>{const o=l.useRef(null),[c,u]=l.useState(!1),d=l.useCallback(()=>{const p=o.current;if(p){if(p.scrollWidth>p.clientWidth){u(!0);return}u(!1)}},[]);return l.useEffect(()=>{const p=o.current;if(!p)return;d();const g=new ResizeObserver(d);return g.observe(p),()=>{g.disconnect()}},[e,d]),a.jsxs("div",{className:Y("group relative flex min-w-0 items-center rounded bg-zinc-100 hover:bg-zinc-200",!!n&&"pointer-events-none opacity-60"),children:[a.jsx(Ls,{text:e,maxWidth:96,isClampToParent:!1,isFollowCursor:!0,isDisableOnTouch:!0,disabled:!c||!!n,children:a.jsxs("div",{onClick:r,className:Y("flex min-w-0 select-none items-center gap-1 rounded py-0.5 pl-1 pr-1",!n&&!t&&"cursor-pointer"),children:[!!t&&a.jsx(Co,{className:"size-4 text-zinc-400 shrink-0 animate-spin"}),!t&&a.jsx(I7,{className:"size-4 text-zinc-400 shrink-0"}),a.jsx("span",{ref:o,className:"roboto-flex-100-400-1 min-w-0 max-w-[200px] truncate text-[16px] leading-[20px] text-zinc-950",children:e})]})}),!t&&a.jsx("button",{type:"button",disabled:s,onClick:i,className:"group/close absolute bottom-0 right-0 top-0 flex cursor-pointer items-center pl-2 pr-1 opacity-0 transition-opacity group-hover:opacity-100",children:a.jsx("span",{className:"flex shrink-0 rounded bg-black/64 p-0.5 text-zinc-50 group-hover/close:bg-black/80 group-hover/close:text-white",children:a.jsx(g2,{className:"h-3.5 w-3.5"})})})]})},A2=({url:e})=>{const t=document.createElement("a");t.href=e,t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),t.remove()},X6=50*1024*1024,ore=({clientId:e,isGrouped:t,documents:n,sourcePath:s})=>{const r=Is(P=>P.isGridSourcePathVisible),i=l.useRef(null),o=l.useRef(new Set),c=l.useRef(new Set),[u,d]=l.useState([]),p=l.useCallback(()=>crypto.randomUUID(),[]);l.useEffect(()=>
854{o.current=new Set(n.values.documents.map(P=>P.uploadId))},[n.values.documents]);const g=l.useCallback(()=>{ve({type:"failed",message:h.inputs.notifications.FILE_UPLOAD_ALREADY_ATTACHED,key:"FILE_UPLOAD_ALREADY_ATTACHED",duration:4e3})},[]),A=l.useCallback(()=>{ve({type:"failed",message:h.inputs.notifications.FILE_UPLOAD_FAILED,key:"FILE_UPLOAD_FAILED",duration:4e3})},[]),E=l.useCallback(({uploadId:P})=>!!(o.current.has(P)||c.current.has(P)),[]),x=l.useCallback(()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})},[]),y=l.useCallback((P,B)=>{const F=n.patch.find(z=>z.action===P);return F?F.endpoint.map(z=>B?B[z]??z:z).join("/").replace(/^\/+|\/+$/g,"")+"/":""},[n.patch]),I=tt({mutationFn:async P=>{const{file:B}=P;if(!e)throw new Error("CLIENT_ID_IS_REQUIRED");y("upload");const F=await mte({file:B});if(E({uploadId:F}))return{kind:"duplicate"};c.current.add(F);try{const z=y("attach",{"{clientId}":String(e),...n.values.pathValues??{}});return await u2({path:z,body:{uploadId:F}}),{kind:"attached",uploadId:F,filename:B.name}}finally{c.current.delete(F)}},onSuccess:(P,B)=>{if(d(F=>F.filter(z=>z.uploadId!==B.tempUploadId)),P.kind==="duplicate"){g();return}if(o.current.has(P.uploadId)){g();return}o.current=new Set([...o.current,P.uploadId]),n.values.customPatch?.onAttachSuccess?.({uploadId:P.uploadId,originalFileName:P.filename})},onError:(P,B)=>{d(F=>F.filter(z=>z.uploadId!==B.tempUploadId)),A()}}),v=tt({mutationFn:async P=>{if(!e)throw new Error("CLIENT_ID_IS_REQUIRED");const B=y("detach",{"{clientId}":String(e),...n.values.pathValues??{},"{documentId}":P});await Ff({path:B})},onSuccess:(P,B)=>{n.values.customPatch?.onDetachSuccess?.(B)},onError:()=>{x()}}),S=l.useCallback(()=>{i.current?.click()},[]),b=l.useCallback(P=>{const B=Array.from(P.target.files??[]);if(P.target.value="",!B.length)return;const F=B.filter(M=>M.size>X6),z=B.filter(M=>M.size<=X6);if(F.length>0&&ve({type:"warning",message:h.inputs.notifications.FILE_UPLOAD_MAX_SIZE_50_MB,duration:4e3}),!z.length)return;const Q=z.map(M=>({file:M,tempUploadId:p()}));d(M=>[...M,...Q.map(K=>({uploadId:K.tempUploadId,originalFileName:K.file.name}))]),Q.forEach(M=>{I.mutate({file:M.file,tempUploadId:M.tempUploadId})})},[I,p]),w=l.useCallback(({documentId:P})=>{v.mutate(P)},[v]),_=l.useCallback(()=>{ve({type:"failed",message:h.inputs.notifications.FILE_DOWNLOAD_FAILED,key:"FILE_DOWNLOAD_FAILED",duration:4e3})},[]),N=l.useRef(new Set),R=l.useCallback(({count:P})=>qt({count:P,zero:h.inputs.notifications.FILE_DOWNLOAD_PENDING_ZERO,one:h.inputs.notifications.FILE_DOWNLOAD_PENDING_ONE,many:h.inputs.notifications.FILE_DOWNLOAD_PENDING_MANY}).replace("{count}",String(P)),[]),D=l.useCallback(()=>{const P=N.current.size;if(P===0){Ze("FILE_DOWNLOAD_PENDING");return}ve({type:"pending",message:R({count:P}),key:"FILE_DOWNLOAD_PENDING",duration:0})},[R]),k=l.useCallback(async({uploadId:P})=>{if(!N.current.has(P)){N.current.add(P),D();try{const B=await gte({uploadId:P});A2({url:B.url})}catch{_()}finally{N.current.delete(P),D()}}},[_,D]);l.useEffect(()=>()=>{Ze("FILE_DOWNLOAD_PENDING")},[]);const L=l.useMemo(()=>{if(v.isPending)return v.variables},[v.isPending,v.variables]),O=l.useMemo(()=>[...n.values.documents.map((P,B)=>({renderKey:`${P.uploadId}-${B}`,uploadId:P.uploadId,originalFileName:P.originalFileName||P.uploadId,isPendingUpload:!1})),...u.map((P,B)=>({renderKey:`${P.uploadId}-${B}`,uploadId:P.uploadId,originalFileName:P.originalFileName,isPendingUpload:!0}))],[n.values.documents,u]);return a.jsx(Xh,{label:n.label,isGrouped:t,isEmpty:!1,isValueFullWidth:!0,sourcePath:s,isSourcePathVisible:r,children:a.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2",children:[a.jsx("input",{ref:i,type:"file",multiple:!0,accept:".pdf,.docx,.txt",className:"hidden",onChange:b,disabled:n.values.isDisabled}),a.jsxs("div",{className:"flex items-start flex-row gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[!O.length&&a.jsxs("button",{type:"button",disabled:n.values.isDisabled,onClick:S,className:Y("roboto-flex-100-400-1 flex items-center gap-1 text-left text-[16px] leading-[20px] cursor-pointer text-zinc-400 hover:text-zinc-500 hover:bg-zinc-100 rounded px-1 py-0.5"),children:[a.jsx(Cf,{className:"size-4 shrink-0"}),h.client.circumstances.buttons.UPLOAD_FILE]}),!!O.length&&a.jsx("ul",{className:"flex w-full min-w-0 flex-row gap-1 flex-wrap",children:O.map(P=>a.jsx(ire,{fileName:P.originalFileName,isPendingUpload:P.isPendingUpload,isPendingDetach:L===P.uploadId,isControlsDisabled:n.values.isDisabled,onDownload:()=>{P.isPendingUpload||k({uploadId:P.uploadId})},onDetach:()=>w({documentId:P.uploadId})},P.renderKey))})]}),a.jsx("div",{className:"flex shrink-0 items-center justify-center mr-0.5 mt-0.5",children:!!O.length&&a.jsx("button",{type:"button",disabled:n.values.isDisabled,onClick:S,className:"cursor-pointer text-zinc-400 hover:text-zinc-600",children:a.jsx(Cf,{className:"size-5 shrink-0"})})})]})]})})},Rm=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17781_2758)"},l.createElement("path",{d:"M11.3346 4.66667L4.66797 11.3333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.33203 4.66667H11.332V10.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17781_2758"},l.createElement("rect",{width:16,height:16,fill:"white"})))),Jh=({evidence:e})=>pt(e)?e.isDeleted===!0:!1,are=({clientId:e,isGrouped:t,isDisabled:n,label:s,evidenceIds:r,patch:i,theme:o})=>{const c=at(),u=Fe(),{clientData:d}=Zi(),{patchResourceItem:p}=Ca({clientId:e}),g=l.useMemo(()=>
854{const x=d?.evidences;if(!x)return[];const y=x.filter(I=>!Jh({evidence:I}));return r.flatMap(I=>{const v=y.findIndex(S=>S.id===I);return v===-1?[]:[{evidenceId:I,title:h.client.evidence.titles.LIST_ITEM.replace("{order}",String(v+1))}]})},[d?.evidences,r]),A=l.useCallback(()=>{if(!i)return;const x=u.state??{};c(u.pathname,{state:{...x,isPreventScrollToTop:!0,evidencePopupTarget:{endpoint:i.endpoint,field:i.field,evidenceIds:r}}})},[i,r,c,u.pathname,u.state]),E=l.useCallback(({evidenceId:x})=>{i&&p({pathSegments:i.endpoint,pathValues:{},bodyKey:i.field,bodyValue:r.filter(y=>y!==x)})},[i,p,r]);return a.jsxs(To,{children:[a.jsx(No,{isGrouped:t,labelTheme:o,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:s??""})}),a.jsx(wo,{paddingY:"1_1.5",children:a.jsxs("div",{className:"flex flex-row items-start gap-2",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[!g.length&&a.jsxs("button",{type:"button",disabled:n,onClick:A,className:"roboto-flex-100-400-1 flex items-center gap-1 rounded px-1 py-0.5 text-left text-[16px] leading-[20px] cursor-pointer text-zinc-400 hover:bg-zinc-100 hover:text-zinc-500",children:[a.jsx(Cf,{className:"size-4 shrink-0","aria-hidden":!0}),h.client.defenseLines.buttons.ADD_EVIDENCE]}),!!g.length&&a.jsx("ul",{className:"flex w-full min-w-0 flex-row flex-wrap items-center gap-1",children:g.map(({evidenceId:x,title:y})=>a.jsxs("li",{className:"group relative flex min-w-0 items-center rounded bg-zinc-100 hover:bg-zinc-200",children:[a.jsxs(Hs,{to:`/clients/${e}/overview/evidence/${x}`,className:"flex min-w-0 items-center gap-1 rounded py-0.5 pl-1 pr-1.5",children:[a.jsx(Rm,{className:"size-4 shrink-0 text-zinc-400","aria-hidden":!0}),a.jsx("span",{className:"roboto-flex-100-400-1 max-w-[200px] truncate text-[16px] leading-[20px] text-zinc-950",children:y})]}),!n&&a.jsx("button",{type:"button",onClick:()=>E({evidenceId:x}),className:"group/close absolute bottom-0 right-0 top-0 flex cursor-pointer items-center pl-2 pr-1 opacity-0 transition-opacity group-hover:opacity-100",children:a.jsx("span",{className:"flex shrink-0 rounded bg-black/64 p-0.5 text-zinc-50 group-hover/close:bg-black/80 group-hover/close:text-white",children:a.jsx(g2,{className:"h-3.5 w-3.5"})})})]},x))})]}),a.jsx("div",{className:"flex shrink-0 items-center justify-center mr-0.5 mt-0.5",children:!!g.length&&a.jsx("button",{type:"button",disabled:n,onClick:A,className:"cursor-pointer text-zinc-400 hover:text-zinc-600",children:a.jsx(Cf,{className:"size-5 shrink-0","aria-hidden":!0})})})]})})]})},lre=new Set(["inquiry","preInvestigationCheck","preliminaryInvestigation","courtFirstInstance","courtSecondInstance","courtThirdInstance","management"]),cre=new Set(["contacts","criminalRecords","events","felonies","witnesses","victims","circumstances"]),J6={"client-info":"clientInfo","criminal-records":"criminalRecords","pre-investigation-check":"preInvestigationCheck","preliminary-investigation":"preliminaryInvestigation","court-first-instance":"courtFirstInstance","court-second-instance":"courtSecondInstance","court-third-instance":"courtThirdInstance"},Z6=e=>e.startsWith("{")?!0:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e),ure=e=>J6[e]?J6[e]:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase()),dre=({endpoint:e,field:t})=>{if(e[0]==="accounts")return`user.${t}`;if(e[0]!=="clients")return;const n=["clientData"];let s=1;for(;s<e.length&&Z6(e[s]);)s+=1;for(;s<e.length;s+=1){const o=e[s];if(Z6(o)){n.push("[]");continue}n.push(ure(o))}let r="";for(const o of n){if(o==="[]"){r+="[]";continue}r=r?`${r}.${o}`:o}return[...n].reverse().find(o=>o!=="[]")===t?r:r.endsWith("[]")?`${r}.${t}`:`${r}.${t}`},fre=({commitDataPath:e,field:t})=>{const n=["clientData"];lre.has(e[0]??"")&&n.push("phases");for(const i of e){if(cre.has(i)){n.push(`${i}[]`);continue}n.push(i)}let s="";for(const i of n){if(i.endsWith("[]")){s+=i;continue}s=s?`${s}.${i}`:i}return e[e.length-1]===t?s:s.endsWith("[]")?`${s}.${t}`:s.includes(t)?s:`${s}.${t}`},ql=({sourcePath:e,commitDataPath:t,patch:n})=>{if(e)return e;if(n?.field){if(n.endpoint?.length){const s=dre({endpoint:n.endpoint,field:n.field});if(s)return s}if(t?.length)return fre({commitDataPath:t,field:n.field})}},pre=({sourcePath:e,patch:t})=>{if(e)return e;const n=t?.find(s=>
854s.action==="attach");if(n?.endpoint.length)return ql({patch:{endpoint:n.endpoint,field:"documents"}})},ew=({clientId:e,isGrouped:t,text:n,input:s,checkbox:r,select:i,customSelect:o,textarea:c,dateOnly:u,selectMultiple:d,documents:p,evidenceLinks:g,labelTheme:A,linkFieldConfigs:E})=>{if(n)return a.jsx(Mse,{isGrouped:t,text:n,labelTheme:A,linkFieldConfigs:E});if(s){const x=ql({sourcePath:s.sourcePath,commitDataPath:s.commitDataPath,patch:s.patch});return a.jsx(zse,{clientId:e,isGrouped:t,isDisabled:s.isDisabled,label:s.label,isRequired:s.isRequired,value:s.value,externalValue:s.externalValue,commitDataPath:s.commitDataPath,patch:s.patch,type:s.type,maxLength:s.maxLength,placeholder:s.placeholder,sourcePath:x,labelTheme:A})}if(c){const x=ql({sourcePath:c.sourcePath,commitDataPath:c.commitDataPath,patch:c.patch});return a.jsx(Qse,{clientId:e,isGrouped:t,isDisabled:c.isDisabled,label:c.label,isRequired:c.isRequired,value:c.value,externalValue:c.externalValue,commitDataPath:c.commitDataPath,patch:c.patch,type:c.type,maxLength:c.maxLength,placeholder:c.placeholder,sourcePath:x})}if(r){const x=ql({sourcePath:r.sourcePath,commitDataPath:r.commitDataPath,patch:r.patch});return a.jsx(Hse,{clientId:e,isGrouped:t,isDisabled:r.isDisabled,label:r.label,isRequired:r.isRequired,value:r.value,externalValue:r.externalValue,commitDataPath:r.commitDataPath,patch:r.patch,placeholder:r.placeholder,sourcePath:x})}if(i){const x=ql({sourcePath:i.sourcePath,commitDataPath:i.commitDataPath,patch:i.patch});return a.jsx(Vse,{clientId:e,isGrouped:t,isDisabled:i.isDisabled,label:i.label,isRequired:i.isRequired,value:i.value,externalValue:i.externalValue,commitDataPath:i.commitDataPath,patch:i.patch,placeholder:i.placeholder,emptyPlaceholder:i.emptyPlaceholder,enumKey:i.enumKey,catalogue:i.catalogue,isSearchable:i.isSearchable,primaryArticleIds:i.primaryArticleIds,externalErrorText:i.externalErrorText,onPatchSuccess:i.onPatchSuccess,sourcePath:x,theme:A},`${i.patch.endpoint}`)}if(o){const x=ql({sourcePath:o.sourcePath,commitDataPath:void 0,patch:o.patch});return a.jsx(Gse,{clientId:e,isGrouped:t,isDisabled:o.isDisabled,label:o.label,isRequired:o.isRequired,value:o.value,placeholder:o.placeholder,emptyPlaceholder:o.emptyPlaceholder,options:o.options,isSearchable:o.isSearchable,patch:o.patch,onPatchSuccess:o.onPatchSuccess,sourcePath:x,theme:A},`${o.patch.endpoint}`)}if(u){const x=ql({sourcePath:u.sourcePath,commitDataPath:u.commitDataPath,patch:u.patch});return a.jsx(ere,{clientId:e,isGrouped:t,isDisabled:u.isDisabled,label:u.label,isRequired:u.isRequired,value:u.value,externalValue:u.externalValue,commitDataPath:u.commitDataPath,patch:u.patch,placeholder:u.placeholder,sourcePath:x})}if(d){const x=ql({sourcePath:d.sourcePath,commitDataPath:d.commitDataPath,patch:d.patch});return a.jsx(rre,{clientId:e,isGrouped:t,isDisabled:d.isDisabled,label:d.label,isRequired:d.isRequired,values:d.values,externalValues:d.externalValues,commitDataPath:d.commitDataPath,placeholder:d.placeholder,catalogue:d.catalogue,enumKey:d.enumKey,patch:d.patch,isSearchable:d.isSearchable,patchBodyMapper:d.patchBodyMapper,sourcePath:x})}if(p){const x=pre({sourcePath:p.sourcePath,patch:p.patch});return a.jsx(ore,{clientId:e,isGrouped:t,documents:p,sourcePath:x})}return g?a.jsx(are,{clientId:e,isGrouped:t,isDisabled:g.isDisabled,label:g.label,evidenceIds:g.evidenceIds,patch:g.patch,theme:A}):null},hre=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M10.0013 10.8334C10.4615 10.8334 10.8346 10.4603 10.8346 10C10.8346 9.53978 10.4615 9.16669 10.0013 9.16669C9.54106 9.16669 9.16797 9.53978 9.16797 10C9.16797 10.4603 9.54106 10.8334 10.0013 10.8334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10.0013 16.6667C10.4615 16.6667 10.8346 16.2936 10.8346 15.8333C10.8346 15.3731 10.4615 15 10.0013 15C9.54106 15 9.16797 15.3731 9.16797 15.8333C9.16797 16.2936 9.54106 16.6667 10.0013 16.6667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10.0013 4.99998C10.4615 4.99998 10.8346 4.62688 10.8346 4.16665C10.8346 3.70641 10.4615 3.33331 10.0013 3.33331C9.54106 3.33331 9.16797 3.70641 9.16797 4.16665C9.16797 4.62688 9.54106 4.99998 10.
8540013 4.99998Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),mre=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("rect",{x:2,y:2,width:20,height:20,rx:4,fill:"black",fillOpacity:.64}),l.createElement("path",{d:"M12.0007 12.6667C12.3688 12.6667 12.6673 12.3682 12.6673 12C12.6673 11.6319 12.3688 11.3334 12.0007 11.3334C11.6325 11.3334 11.334 11.6319 11.334 12C11.334 12.3682 11.6325 12.6667 12.0007 12.6667Z",fill:"#FAFAFA",stroke:"#FAFAFA",strokeWidth:2}),l.createElement("path",{d:"M12.0007 17.3333C12.3688 17.3333 12.6673 17.0349 12.6673 16.6667C12.6673 16.2985 12.3688 16 12.0007 16C11.6325 16 11.334 16.2985 11.334 16.6667C11.334 17.0349 11.6325 17.3333 12.0007 17.3333Z",fill:"#FAFAFA",stroke:"#FAFAFA",strokeWidth:2}),l.createElement("path",{d:"M12.0007 7.99996C12.3688 7.99996 12.6673 7.70148 12.6673 7.33329C12.6673 6.9651 12.3688 6.66663 12.0007 6.66663C11.6325 6.66663 11.334 6.9651 11.334 7.33329C11.334 7.70148 11.6325 7.99996 12.0007 7.99996Z",fill:"#FAFAFA",stroke:"#FAFAFA",strokeWidth:2})),gre=({title:e,to:t,target:n,onClick:s,isCloseOnClick:r,isDisabled:i,handleClose:o,icon:c})=>{const u=l.useCallback(p=>{if(i){p.preventDefault(),p.stopPropagation();return}t||p.preventDefault(),p.stopPropagation(),s?.(p),r&&o()},[t,s,r,i,o]),d=a.jsxs(a.Fragment,{children:[!!c&&a.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center text-zinc-400",children:c}),e]});return t?a.jsx(Je,{to:t,target:n,rel:n==="_blank"?"noopener noreferrer":void 0,className:Y("px-3 py-2 flex items-center gap-2 min-w-0 roboto-flex-100-400-1 text-[16px] leading-[20px] normal-case select-none",!i&&"cursor-pointer text-zinc-950 hover:bg-zinc-50",!!i&&"cursor-default text-zinc-300"),onClick:u,children:d}):a.jsx("div",{className:Y("px-3 py-2 flex items-center gap-2 min-w-0 roboto-flex-100-400-1 text-[16px] leading-[20px] normal-case select-none",!i&&"cursor-pointer text-zinc-950 hover:bg-zinc-50",!!i&&"cursor-default text-zinc-300"),onClick:u,children:d})},Are=({width:e,items:t,handleClose:n,verticalOffset:s=6.5})=>{const r=l.useRef(null),[i,o]=l.useState("bottom"),[c,u]=l.useState(null),d=s===9?36:26;l.useLayoutEffect(()=>{const A=r.current;if(!A)return;const E=A.parentElement;if(!E)return;const x=A.getBoundingClientRect(),y=E.getBoundingClientRect();if(Io({referenceTop:y.top,referenceBottom:y.bottom,floatingHeight:x.height,viewportHeight:window.innerHeight,gap:d-y.height,preferredDirection:"down"})==="down")return;if(y.bottom-d-x.height>=xi){o("top");return}u(xi-y.top)},[d]);const p=c!==null?{top:`${c}px`}:i==="bottom"?{top:`${d}px`}:{bottom:`${d}px`},g=l.useCallback(A=>{A.preventDefault(),A.stopPropagation()},[]);return a.jsx("div",{ref:r,style:p,onClick:g,className:Y("absolute flex flex-col right-0 px-1 py-0.5 bg-white w-68 min-w-68 rounded-[8px] z-20","shadow-[0px_0.27px_2.06px_0px_rgba(0,0,0,0.0323),0px_0.89px_6.92px_0px_rgba(0,0,0,0.0477),0px_4px_31px_0px_rgba(0,0,0,0.08)]",e===79&&"bp72:w-79 bp72:min-w-79"),children:t.map((A,E)=>{if("isSeparator"in A&&A.isSeparator)return a.jsx("div",{className:"h-px bg-zinc-200 my-1.5 mx-3 shrink-0",role:"separator"},E);const x=A;return a.jsx(gre,{title:x.title,to:x.to,target:x.target,onClick:x.onClick,isCloseOnClick:x.isCloseOnClick,isDisabled:x.isDisabled,icon:x.icon,handleClose:n},E)})})},Ss=({width:e,items:t,isRightColumn:n,isWidthHalf:s,isDisabled:r,isNavigationPill:i,onOpenChange:o,hoverGroupName:c,isDocumentRowKebab:u=!1,verticalOffset:d})=>{const[p,g]=l.useState(!1),A=l.useRef(null),E=l.useCallback(y=>{y.preventDefault(),y.stopPropagation(),g(I=>!I)},[]),x=l.useCallback(()=>{g(!1)},[]);return l.useEffect(()=>{const y=I=>{A.current&&(A.current.contains(I.target)||g(!1))};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]),l.useEffect(()=>{o&&o(p)},[p,o]),c&&r?null:a.jsxs("div",{ref:A,onClick:E,className:Y("flex items-center justify-end group/kebab",!u&&"h-6 hover:text-zinc-500",!i&&"relative",!!i&&"absolute right-0 top-0",!!s&&"w-1/2",!i&&!!n&&"pr-0.5",!i&&!n&&"pr-0.5 mr-4",!!u&&"pl-px",!r&&"cursor-pointer text-zinc-500",!!r&&"cursor-default text-zinc-400 pointer-events-none",c==="header"&&"opacity-100 pointer-events-auto bp48:opacity-0 bp48:pointer-events-none bp48:group-hover/header:opacity-100 bp48:group-hover/header:pointer-events-auto bp48:group-focus-within/header:opacity-100 bp48:group-focus-within/header:pointer-events-auto",c==="item"&&"opacity-100 pointer-events-auto bp48:opacity-0 bp48:pointer-events-none bp48:group-hover/item:opacity-100 bp48:group-hover/item:pointer-events-auto bp48:group-focus-within/item:opacity-100 bp48:group-focus-within/item:pointer-events-auto",c==="foldable"&&"opacity-100 pointer-events-auto bp48:opacity-0 bp48:pointer-events-none bp48:group-hover/foldable:opacity-100 bp48:group-hover/foldable:pointer-events-auto bp48:group-focus-within/foldable:opacity-100 bp48:group-focus-within/foldable:pointer-events-auto"),children:[a.jsxs("div",{className:Y("flex items-center justify-center rounded-md","group-hover/kebab:text-zinc-600 group-hover/kebab:bg-zinc-100",!!p&&"text-zinc-600 bg-zinc-100",!!u&&"size-8",!u&&"size-6 min-w-6 w-fit"),children:[!!i&&a.jsx(mre,{className:"w-5 h-5"}),!i&&a.jsx(hre,{className:"w-5 h-5"})]}),!!p&&a.jsx(Are,{verticalOffset:d,width:e,items:t,handleClose:x})]})};function Uu(e){const{clientId:t}=e,n=bt(),s=ra(d=>d.setRequest),r=ra(d=>d.updateRequest),i=l.useRef(null),o=tt({mutationFn:({path:d,body:p})=>u2({path:d,body:p}),onMutate:async()=>(i.current||(i.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"PATCH_SLOW",duration:0})},3e3)),{}),onError:(d,p)=>{if(!p)return;const g=p?.requestId;p.path&&g&&r(t??"",p.path,g,{status:"error",error:d}),i.current&&(clearTimeout(i.current),i.current=null),Ze("PATCH_SLOW"),ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,duration:3e3,key:"SAVE_CHANGES_FAILED"})},onSettled:(d,p,g)=>{if(!g)return;if(p){r(t??"",g.path,g.requestId??"",{status:"error",error:p});return}r(t??"",g.path,g.requestId??"",{status:"settled"}),i.current&&(clearTimeout(i.current),i.current=null),Ze("PATCH_SLOW");const A=["client",t],E=(()=>{const S=d,b=S&&typeof S=="object"?{...S}:{},w=g?.body;if(w&&typeof w=="object"){const N=w.articles;if(Array.isArray(N)){const R=N.map(D=>{const k=D,L=k.catalogueArticleId??k.id??k;return{catalogueArticle:{id:String(L)}}});b.articles=R}}return b})(),x=n.getQueryData(A);if(!x)return;
854const y=structuredClone(x),I=(S,b,w)=>{if(!S||b.length===0)return S;const[_,...N]=b;if(Array.isArray(S)){const R=(()=>{if(_.startsWith("{")&&_.endsWith("}")){const k=_.slice(1,-1);return w?.[k]}return _})();return S.map(k=>k.id===R?I(k,N,w):k)}if(typeof S=="object"&&S!==null&&!Array.isArray(S)){if(N.length===0){const L=ho(_),O=S[L]??[];return{...S,[L]:[...O,E]}}const R=ho(_),D=S[R],k=I(D,N,w);return{...S,[R]:k}}return S},v=I(y,g.pathSegments?.slice(2)??[],g.pathValues);n.setQueryData(A,v)}}),c=l.useCallback((d,p,g,A,E)=>{if(!d)return{updatedNode:d};if(p.length===0){if(typeof d=="object"&&d!==null&&!Array.isArray(d)){const v=A?d[A]:void 0;return A?{updatedNode:{...d,[A]:E},previousFieldValue:v}:{updatedNode:d,previousFieldValue:v}}return{updatedNode:d}}const[x,...y]=p;if(Array.isArray(d)){const v=(()=>{if(x.startsWith("{")&&x.endsWith("}")){const w=x.slice(1,-1);return g?.[w]}return x})(),S=d.map(w=>w.id===v?c(w,y,g,A,E).updatedNode:w),b=d.find(w=>w.id===v);if(b){if(y.length===0&&A)return{updatedNode:S,previousFieldValue:b[A]};const w=c(b,y,g,A,E);return{updatedNode:S,previousFieldValue:w.previousFieldValue}}return{updatedNode:S}}const I=ho(x);if(typeof d=="object"&&d!==null&&!Array.isArray(d)){const v=d[I],S=c(v,y,g,A,E);return S.updatedNode===v&&S.previousFieldValue===void 0?{updatedNode:d}:{updatedNode:{...d,[I]:S.updatedNode},previousFieldValue:S.previousFieldValue}}return{updatedNode:d}},[]);return{postResource:l.useCallback(d=>{const{pathSegments:p,pathValues:g,body:A}=d,x=p.map(I=>{if(g){for(const v of Object.keys(g))if(I===`{${v}}`)return g?.[v]!==void 0?g[v]:""}return I==="{clientId}"?t!==void 0?t:"":I}).join("/")+"/",y=Hr();return s(t??"",x,y,{requestId:y,status:"inflight",path:x,startedAt:Date.now()}),o.mutateAsync({path:x,pathSegments:p,pathValues:g,body:A,requestId:y}).then(I=>{const v=I,S=v&&typeof v=="object"&&v.id?String(v.id):null;return{requestId:y,createdId:S}})},[o,t,s])}}function Ere(e){const{clientId:t}=e,n=bt(),s=Hn(g=>g.setRequest),r=Hn(g=>g.updateRequest),i=Hn(g=>g.deleteRequest),o=Hn(g=>g.requestsByClient),c=Hn(g=>g.getRequest),u=l.useRef({requestId:null,timeoutId:null}),d=tt({mutationFn:({path:g,signal:A})=>Ff({path:g,signal:A}),onMutate:async g=>{const A=g.requestId??null;return u.current.timeoutId&&(clearTimeout(u.current.timeoutId),u.current.timeoutId=null),Ze("PATCH_SLOW"),u.current.requestId=A,u.current.timeoutId=setTimeout(()=>{u.current.requestId===A&&ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"PATCH_SLOW",duration:0})},3e3),{}},onError:(g,A)=>{if(!A)return;const E=A?.requestId;if(A&&u.current.requestId===E&&(u.current.timeoutId&&clearTimeout(u.current.timeoutId),u.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW")),A.path&&E){const x=c(t??"",A.path,E);if(!x||x.requestId!==E)return;r(t??"",A.path,E,{status:"error",error:g})}ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,duration:3e3,key:"SAVE_CHANGES_FAILED"})},onSettled:(g,A,E)=>{if(!E)return;if(A){r(t??"",E.path,E.requestId??"",{status:"error",error:A});return}r(t??"",E.path,E.requestId??"",{status:"settled"}),E&&u.current.requestId===E.requestId&&(u.current.timeoutId&&clearTimeout(u.current.timeoutId),u.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const x=["client",t],y=(()=>{if(!g||typeof g!="object")return null;const N=g.preservedId;return N==null?null:String(N)})();if(y){const N=String(t??""),R=E.path,D=`${R}${y}/`,k=`${R}#${y}`,L=P=>{const B=o?.[N]?.[P];B&&Object.keys(B).forEach(F=>{i(N,P,F)})},O=o?.[N]??{};O[D]&&L(D),O[k]&&L(k)}const I=n.getQueryData(x);if(!I)return;const v=structuredClone(I),S=E.pathSegments?.slice(2)??[],b=N=>N&&typeof N=="object"&&!Array.isArray(N)?N:{},w=(N,R)=>{if(R.length===0)return N;const[D,...k]=R,L=ho(D);if(k.length===0){const F=y?[{id:y,isDeleted:!1}]:[];return{...N,[L]:F}}const O=N[L];if(Array.isArray(O)){const F=k[0],z=(()=>{if(F&&F.startsWith("{")&&F.endsWith("}")){const M=F.slice(1,-1);return(E.pathValues??{})[M]}return F})();if(z==null)return N;const Q=O.map(M=>String(M.id)!==String(z)?M:w(M,k.slice(1)));return{...N,[L]:Q}}const P=b(O),B=w(P,k);return B===P?N:{...N,[L]:B}},_=w(v,S);n.setQueryData(x,_)}});return{deleteResource:l.useCallback(g=>{const{pathSegments:A,pathValues:E}=g,y=A.map(b=>{if(E){for(const w of Object.keys(E))if(b===`{${w}}`)return E?.[w]!==void 0?E[w]:""}return b==="{clientId}"?t!==void 0?t:"":b}).join("/")+"/",I=o?.[String(t??"")]?.[y];
854I&&Object.entries(I).forEach(([b,w])=>{w?.status==="inflight"&&i(String(t??""),y,b)});const v=Hr(),S=new AbortController;return s(t??"",y,v,{requestId:v,status:"inflight",path:y,controller:S,startedAt:Date.now()}),d.mutateAsync({path:y,signal:S.signal,pathSegments:A,pathValues:E,requestId:v}),Promise.resolve({requestId:v})},[d,t,s,i,o])}}function zu(e){const{clientId:t,isSoftDelete:n,onSuccess:s}=e,r=bt(),i=Hn(E=>E.setRequest),o=Hn(E=>E.updateRequest),c=Hn(E=>E.getRequest),u=Hn(E=>E.deleteRequest),d=Hn(E=>E.requestsByClient),p=l.useRef({requestId:null,timeoutId:null}),g=tt({mutationFn:({path:E,signal:x})=>Ff({path:E,signal:x}),onMutate:async E=>{const x=E.requestId??null;return p.current.timeoutId&&(clearTimeout(p.current.timeoutId),p.current.timeoutId=null),Ze("PATCH_SLOW"),p.current.requestId=x,p.current.timeoutId=setTimeout(()=>{p.current.requestId===x&&ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"PATCH_SLOW",duration:0})},3e3),{}},onError:(E,x)=>{if(!x)return;const y=x?.requestId,I=(()=>{const v=x.path,S=x?.itemId;return S?`${v}#${S}`:v})();if(x.path&&y){p.current.requestId===y&&(p.current.timeoutId&&clearTimeout(p.current.timeoutId),p.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const v=c(t??"",I,y);if(!v||v.requestId!==y)return;o(t??"",I,y,{status:"error",error:E})}ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,duration:3e3,key:"SAVE_CHANGES_FAILED"})},onSettled:(E,x,y)=>{if(!y)return;if(x){const D=(()=>{const k=y.path,L=y?.itemId;return L?`${k}#${L}`:k})();o(t??"",D,y.requestId??"",{status:"error",error:x});return}const I=(()=>{const D=y.path,k=y?.itemId;return k?`${D}#${k}`:D})();o(t??"",I,y.requestId??"",{status:"settled"}),y&&p.current.requestId===y.requestId&&(p.current.timeoutId&&clearTimeout(p.current.timeoutId),p.current={requestId:null,timeoutId:null},Ze("PATCH_SLOW"));const v=["client",t],S=r.getQueryData(v);if(!S)return;const b=structuredClone(S),w=y.pathSegments?.slice(2)??[],_=D=>D&&typeof D=="object"&&!Array.isArray(D)?D:{},N=(D,k)=>{if(k.length===0)return D;const[L,...O]=k,P=ho(L),B=D[P];if(Array.isArray(B)){if(O.length===0)return D;const Q=String(O[0]),M=Q.startsWith("{")&&Q.endsWith("}")?(y.pathValues??{})[Q.slice(1,-1)]:Q;if(M==null)return D;if(O.length===1){if(n){const H=B.map(j=>String(j.id)===String(M)?{...j,isDeleted:!0}:j);return{...D,[P]:H}}const W=B.filter(H=>String(H.id)!==String(M));return{...D,[P]:W}}const K=B.map(W=>String(W.id)!==String(M)?W:N(W,O.slice(1)));return{...D,[P]:K}}const F=_(B),z=N(F,O);return z===F?D:{...D,[P]:z}},R=N(b,w);r.setQueryData(v,R),s?.()}});return{deleteResourceItem:l.useCallback(E=>{const{pathSegments:x,pathValues:y,itemId:I}=E,S=x.map(R=>{if(y){for(const D of Object.keys(y))if(R===`{${D}}`)return y?.[D]!==void 0?y[D]:""}return R==="{clientId}"?t!==void 0?t:"":R}).join("/")+"/",b=(()=>{if(!I)return S;const R=String(I);return`${S}#${R}`})(),w=d?.[String(t??"")]?.[b];w&&Object.entries(w).forEach(([R,D])=>{D?.status==="inflight"&&u(String(t??""),b,R)});const _=Hr(),N=new AbortController;return i(t??"",b,_,{requestId:_,status:"inflight",path:b,controller:N,startedAt:Date.now()}),g.mutateAsync({path:S,pathSegments:x,pathValues:y,requestId:_,itemId:I,signal:N.signal}),Promise.resolve({requestId:_})},[g,t,i,u,d])}}const Nt=({clientId:e,isKebabMenuDisabled:t,post:{endpoint:n,title:s,isDuplicate:r}={},delete:{endpoint:i,title:o}={},deleteAll:{endpoint:c,title:u}={},title:d,titleSuffix:p,isSecondaryTitle:g,rows:A,rowsGroups:E,textWithTooltip:x,anchor:y,mainWrapperRef:I,scrollOffset:v,labelTheme:S,linkFieldConfigs:b})=>{const{commitData:w,setCommitData:_}=wt({clientId:e}),{postResource:N}=Uu({clientId:e}),{deleteResource:R}=Ere({clientId:e}),{deleteResourceItem:D}=zu({clientId:e}),[k,L]=l.useState(null),[O,P]=l.useState(null),[B,F]=l.useState(null),[z,Q]=l.useState(null),M=l.useRef({}),K=l.useMemo(()=>n?(n?.map(_e=>_e==="{clientId}"?e!==void 0?String(e):"":_e)).join("/")+"/":"",[n,e]),W=ra(pe=>pe.requestsByClient?.[String(e??"")]?.[K]),H=l.useMemo(()=>{if(k)return W?.[k]},[W,k]),j=!!H&&!!k&&H.requestId===k&&H.status==="settled",q=l.useMemo(()=>c?(c?.map(_e=>_e==="{clientId}"?e!==void 0?String(e):"":_e)).join("/")+"/":"",[c,e]),G=Hn(pe=>pe.requestsByClient?.[String(e??"")]),$=Hn(pe=>pe.requestsByClient?.[String(e??"")]?.[q]),ne=l.useMemo(()=>
854{if(B)return $?.[B]},[$,B])?.status==="inflight";l.useEffect(()=>{if(!B)return;const pe=$?.[B];pe?.status!=="inflight"&&(pe||F(null))},[B,$]),l.useEffect(()=>()=>F(null),[]);const X=l.useMemo(()=>i?(i?.map(_e=>_e==="{clientId}"?e!==void 0?String(e):"":_e)).join("/")+"/":"",[i,e]),oe=l.useMemo(()=>{if(!X)return"";if(!i)return X;const pe=i[i.length-1];return pe?`${X}#${String(pe)}`:X},[X,i]),ie=Hn(pe=>pe.requestsByClient?.[String(e??"")]?.[oe]),te=l.useMemo(()=>{if(z)return ie?.[z]},[ie,z])?.status==="inflight";l.useEffect(()=>{if(!j||!O)return;const pe=M.current[O]??null;pe&&I&&requestAnimationFrame(()=>{mf({ref:I,elementRef:{current:pe},behavior:"smooth",offset:v})})},[j,O,I,v]);const le=l.useCallback(({id:pe,commitDataPath:_e})=>{pe&&_e&&_(Le=>{const Ee=Eo({data:Le,path:_e});if(!Array.isArray(Ee))return Le;const se=Ee.includes(pe)?Ee.filter(me=>me!==pe):[...Ee,pe];return ul({data:Le,path:_e,value:se})})},[_]),he=l.useCallback(()=>{if(!n)return;const pe=(()=>{if(!r)return{};const _e=A??[];return _e.length?_e.reduce((Le,Ee)=>{if(Ee.input){const se=Ee.input.patch.field,me=Ee.input.value;return{...Le,[se]:me}}if(Ee.textarea){const se=Ee.textarea.patch.field,me=Ee.textarea.value;return{...Le,[se]:me}}if(Ee.checkbox){const se=Ee.checkbox.patch.field,me=Ee.checkbox.value;return{...Le,[se]:me}}if(Ee.select){const se=Ee.select.patch.field,me=Ee.select.value;return{...Le,[se]:me}}if(Ee.customSelect){const se=Ee.customSelect.patch.field,me=Ee.customSelect.value;return{...Le,[se]:me}}if(Ee.dateOnly){const se=Ee.dateOnly.patch.field,me=Ee.dateOnly.value;return{...Le,[se]:me}}if(Ee.selectMultiple){const se=Ee.selectMultiple.patch.field,me=Ee.selectMultiple.values??[],de=Ee.selectMultiple.patchBodyMapper?Ee.selectMultiple.patchBodyMapper({values:me,catalogue:Ee.selectMultiple.catalogue,endpoint:Ee.selectMultiple.patch.endpoint,field:Ee.selectMultiple.patch.field}):me;return{...Le,[se]:de}}return Le},{}):{}})();N({pathSegments:n,pathValues:{},body:pe}).then(({requestId:_e,createdId:Le})=>{L(_e),P(Le??null)})},[n,N,r,A]),fe=l.useCallback(()=>{c&&R({pathSegments:c,pathValues:{}}).then(({requestId:pe})=>{F(pe)})},[c,R]),ue=l.useCallback(()=>{if(!i)return;const pe=i[i.length-1];pe&&D({pathSegments:i,pathValues:{},itemId:String(pe)}).then(({requestId:_e})=>{Q(_e)})},[i,D]),ye=l.useMemo(()=>{const pe=[];return n&&pe.push({title:s??"",isCloseOnClick:!0,onClick:he}),i&&pe.push({title:o??"",isCloseOnClick:!0,onClick:ue}),c&&pe.push({title:u??"",isCloseOnClick:!0,onClick:fe}),pe},[n,i,c,he,ue,fe,s,o,u]),ce=l.useCallback(pe=>{if(!pe.post?.endpoint)return;const _e=(pe.rows??[]).reduce((Le,Ee)=>{if(Ee.input){const se=Ee.input.patch.field,me=Ee.input.value;return{...Le,[se]:me}}if(Ee.textarea){const se=Ee.textarea.patch.field,me=Ee.textarea.value;return{...Le,[se]:me}}if(Ee.checkbox){const se=Ee.checkbox.patch.field,me=Ee.checkbox.value;return{...Le,[se]:me}}if(Ee.select){const se=Ee.select.patch.field,me=Ee.select.value;return{...Le,[se]:me}}if(Ee.customSelect){const se=Ee.customSelect.patch.field,me=Ee.customSelect.value;return{...Le,[se]:me}}if(Ee.dateOnly){const se=Ee.dateOnly.patch.field,me=Ee.dateOnly.value;return{...Le,[se]:me}}if(Ee.selectMultiple){const se=Ee.selectMultiple.patch.field,me=Ee.selectMultiple.values??[],de=Ee.selectMultiple.patchBodyMapper?Ee.selectMultiple.patchBodyMapper({values:me,catalogue:Ee.selectMultiple.catalogue,endpoint:Ee.selectMultiple.patch.endpoint,field:Ee.selectMultiple.patch.field}):me;return{...Le,[se]:de}}return Le},{});N({pathSegments:pe.post.endpoint,pathValues:{},body:_e}).then(({requestId:Le,createdId:Ee})=>{L(Le),P(Ee??null)})}
854,[N]),xe=l.useCallback(pe=>{pe.delete?.endpoint&&pe.rowId&&D({pathSegments:pe.delete.endpoint,pathValues:{},itemId:String(pe.rowId)})},[D]),re=l.useCallback(pe=>{const{group:_e,isDeleteForbidden:Le}=pe,Ee=[];return _e.post?.endpoint&&Ee.push({title:_e.post?.title??"",isCloseOnClick:!0,onClick:()=>ce(_e)}),Le||_e.delete?.endpoint&&Ee.push({title:_e.delete?.title??"",isCloseOnClick:!0,onClick:()=>xe(_e)}),Ee},[ce,xe]);return a.jsxs("div",{id:y,className:Y("mb-8 bp34_375:mb-3 last:mb-0 group/header",!!y&&"scroll-mt-[174px]",!!te&&"opacity-60 pointer-events-none"),children:[!!d&&a.jsxs("div",{className:Y("flex justify-between items-center w-full pt-1 pb-1 mb-2 bp48:mb-0",!g&&"roboto-flex-100-600-1 text-[14px] leading-[20px] bp48:text-[16px] bp48:leading-[24px]",!!g&&"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500"),children:[a.jsxs("div",{children:[a.jsx(tn,{text:d}),!!p&&a.jsxs(a.Fragment,{children:[" ",a.jsx("span",{className:"text-zinc-400",children:p})]})]}),!!(n||i||c)&&a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:ye,isDisabled:t,hoverGroupName:"header"})]}),!!x?.text&&a.jsx("div",{className:Y("roboto-flex-100-400-1","text-[16px]","leading-[20px]","text-zinc-400","flex-1","w-full","py-1","bp34_375:py-1.5","mb-1","bp34_375:mb-0.5","last:mb-0"),children:x.text}),!!E?.length&&a.jsx("div",{className:Y(!!ne&&"opacity-60 pointer-events-none"),children:E.map((pe,_e)=>{const Le=Eo({data:w,path:pe.commitDataPath}),Ee=!(!Le||!Array.isArray(Le)||!Le.length||!pe.rowId||!Le.includes(pe.rowId)),se=(pe.delete?.endpoint?.map(Pe=>Pe==="{clientId}"?e!==void 0?String(e):"":Pe)??[]).join("/")+"/",me=G?.[`${se}#${String(pe.rowId??"")}`],de=Object.values(me??{}).some(ge=>ge?.status==="inflight");return a.jsxs("div",{id:pe.rowId,ref:ge=>{pe.rowId&&(M.current[String(pe.rowId)]=ge)}
854,className:Y("mb-4 last:mb-0 group/item",!!pe.isExternal&&"cursor-pointer",!!de&&"opacity-60 pointer-events-none"),onClick:pe.isExternal?()=>le({id:pe.rowId,commitDataPath:pe.commitDataPath}):void 0,children:[!!pe.title&&a.jsxs("div",{className:"flex flex-row justify-between items-center mt-0.5 mb-1",children:[a.jsxs("div",{className:Y("flex justify-between items-center","w-full","text-[14px]","leading-[24px]","bp34_375:text-[16px]","bp34_375:leading-[24px]",!pe.isPrimaryTitle&&"roboto-flex-100-400-1 text-zinc-400 bp34_375:text-zinc-500",!!pe.isPrimaryTitle&&"roboto-flex-100-600-1 text-zinc-950 bp34_375:text-zinc-950",!!pe.isExternal&&"pr-6",!!(pe.isExternal&&!Ee)&&"opacity-60"),children:[pe.title,!!((pe.post?.endpoint||E?.length>1&&pe.delete?.endpoint)&&!pe.isExternal)&&a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:re({group:pe,isDeleteForbidden:!(E?.length>1)}),isDisabled:pe.isKebabMenuDisabled,hoverGroupName:"item"})]}),!!pe.isExternal&&a.jsxs("div",{className:"relative flex items-center justify-center flex-1 h-3 w-full",children:[a.jsx("div",{className:"h-0.25 w-full bg-sky-200 group-hover/item:bg-sky-400"}),a.jsx("div",{className:"absolute -left-4.5 top-0 h-3 w-3 text-sky-200 group-hover/item:text-sky-400",children:Ee?a.jsx(A7,{className:"h-3 w-3"}):a.jsx(dE,{className:"h-3 w-3"})})]})]}),!!pe?.rows?.length&&a.jsxs("div",{className:Y("relative mb-4 last:mb-0 pl-4.5",!!(pe.isExternal&&!Ee)&&"opacity-60"),children:[a.jsx("div",{className:"absolute -top-0.5 -bottom-0.5 left-1 w-0.25 bg-zinc-100"}),pe.rows.map((ge,Pe)=>a.jsx(ew,{clientId:e,isGrouped:!0,text:ge.text,input:ge.input,checkbox:ge.checkbox,select:ge.select,customSelect:ge.customSelect,textarea:ge.textarea,dateOnly:ge.dateOnly,selectMultiple:ge.selectMultiple,documents:ge.documents,evidenceLinks:ge.evidenceLinks,labelTheme:S,linkFieldConfigs:b},Pe))]},_e)]},_e)})}),!!A?.length&&a.jsx("div",{children:A.map((pe,_e)=>a.jsx(ew,{clientId:e,isGrouped:!1,text:pe.text,input:pe.input,checkbox:pe.checkbox,select:pe.select,customSelect:pe.customSelect,textarea:pe.textarea,dateOnly:pe.dateOnly,selectMultiple:pe.selectMultiple,documents:pe.documents,evidenceLinks:pe.evidenceLinks,labelTheme:S,linkFieldConfigs:b},_e))})]})},xre=({handleAddEvent:e,handleOpenFabulizer:t})=>a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-26"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:h.client.fabula.emptyPage.messages.WELCOME}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:[a.jsx("div",{className:"bp56_25:inline",children:h.client.fabula.emptyPage.messages.DESCRIPTION_PART1})," ",a.jsx("div",{className:"bp56_25:inline",children:h.client.fabula.emptyPage.messages.DESCRIPTION_PART2})]}),a.jsxs("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:[a.jsx(ut,{variant:"h16inverse",asChild:!0,onClick:e,children:h.client.fabula.emptyPage.buttons.ADD_EPISODE}),a.jsx(ut,{variant:"h16",asChild:!0,onClick:t,children:h.client.fabula.emptyPage.buttons.TO_FABULIZER})]})]})]}),jy=({status:e})=>{const t=h.client.fabula.emptyPage.inProcessRotations,[n,s]=l.useState(0),r=l.useMemo(()=>["awaitingChoice","autoCommitted","error"].includes(e),[e]),i=l.useMemo(()=>t||[],[t]);l.useEffect(()=>{if(i.length<2)return;const c=window.setInterval(()=>{s(u=>u===i.length-1?0:u+1)},1e4);return()=>{window.clearInterval(c)}},[i]);const o=l.useMemo(()=>i[n]?i[n]:i[0],[i,n]);return a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-26"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:[!!r&&a.jsx(a.Fragment,{children:"Фабула не распознана"}),!r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"inline-block",children:o.ICON})," ",a.jsx(Aa,{children:o.WELCOME})]})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:[!!r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{children:"Попробуйте повторить анализ через некоторое время или свяжитесь с нами"})," ",a.jsxs("div",{children:["по телефону"," ",a.jsx("a",{href:"tel:+78005504898",className:"text-sky-700 underline underline-offset-[25%] decoration-[3%] hover:text-sky-800 cursor-pointer",children:"+7 800 550 48 98"})," ","или по эл. почте"," ",a.jsx("a",{href:"mailto:[email protected]",className:"text-sky-700 underline underline-offset-[25%] decoration-[3%] hover:text-sky-800 cursor-pointer",children:"[email protected]"})]})]}),!r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{children:o.DESCRIPTION_PART1}),a.jsx("div",{children:o.DESCRIPTION_PART2})]})]})]})]})},_s=({containerRef:e,activeElementRef:t,isReady:n=!0,isActive:s=!0})=>{const r=l.useRef(!1);l.useEffect(()=>{if(r.current||!n||(r.current=!0,!s)||!t.current||!e.current)return;const i=e.current,o=t.current;!i||!o||mf({ref:e,elementRef:t})},[e,t,n,s])},Cre={catalogueArticleId:null,description:null,date:null,location:null,method:null,
854subjectiveSide:null,clientRole:null,pleaStatus:null,comment:null},yre=()=>{const{id:e,episodeId:t}=st(),n=at(),s=bt(),r=l.useMemo(()=>["client",e],[e]),{postResource:i}=Uu({clientId:e}),o=ra(N=>{if(e)return N.requestsByClient?.[e]}),c=l.useMemo(()=>{if(!e)return!1;const N=o?.[`clients/${e}/episodes/`];return N?!!Object.values(N).some(R=>R?.status==="inflight"):!1},[e,o]),{deleteResourceItem:u}=zu({clientId:e,isSoftDelete:!0,onSuccess:()=>{s.resetQueries({queryKey:["clientsList"]}),e&&(s.resetQueries({queryKey:["cases","first-instance",e]}),s.resetQueries({queryKey:["cases","second-instance",e]}),s.resetQueries({queryKey:["strategies","first-instance",e]}),s.resetQueries({queryKey:["strategies","second-instance",e]}),s.resetQueries({queryKey:["casesFilters",e]}))}}),d=Hn(N=>{if(e)return N.requestsByClient?.[e]}),p=l.useCallback(()=>{const N=s.getQueryData(r);return N?.episodes?N.episodes:[]},[s,r]),g=l.useCallback(N=>{if(!e||!N)return!1;const R=`clients/${e}/episodes/${N}/`,D=d?.[`${R}#${N}`];return D?!!Object.values(D).some(k=>k?.status==="inflight"):!1},[e,d]),A=l.useCallback(N=>{const R=p(),D=k=>{if(k<0)return null;const L=R[k],O=L?.id;return!O||xf({episode:L})||g(O)?D(k-1):O};return D(N)},[p,g]),E=l.useCallback(N=>{const R=p(),D=k=>{if(k>=R.length)return null;const L=R[k],O=L?.id;return!O||xf({episode:L})||g(O)?D(k+1):O};return D(N)},[p,g]),x=l.useCallback(N=>!A(N-1),[A]),y=l.useCallback(N=>{if(!e)return;const R=N+1;if(x(R)){const L=E(R+1);if(L){n(`/clients/${e}/overview/fabula/${L}`,{replace:!0});return}n(`/clients/${e}/overview/fabula`,{replace:!0});return}const k=A(N);if(k){n(`/clients/${e}/overview/fabula/${k}`,{replace:!0});return}n(`/clients/${e}/overview/fabula`,{replace:!0})},[e,x,E,A,n]),I=l.useCallback(()=>{e&&i({pathSegments:["clients","{clientId}","episodes"],pathValues:{},body:{...Cre}}).then(({createdId:N})=>{N&&n(`/clients/${e}/overview/fabula/${N}`)})},[e,i,n]),v=l.useCallback(N=>{if(!e)return;const R=N.episodeId;u({pathSegments:["clients","{clientId}","episodes","{episodeId}"],pathValues:{clientId:e,episodeId:R},itemId:R})},[e,u]),S=l.useMemo(()=>!e||!t?"":`clients/${e}/episodes/${t}/`,[e,t]),b=Hn(N=>{if(!e)return;if(!t)return N.requestsByClient?.[e]?.[S];const R=`${S}#${t}`;return N.requestsByClient?.[e]?.[R]}),w=l.useRef(new Set),_=l.useRef(!1);return l.useEffect(()=>{const N=b;if(!N)return;_.current||(Object.entries(N).filter(([,O])=>O?.status==="settled").forEach(([O])=>{w.current.add(O)}),_.current=!0);const R=w.current,D=Object.entries(N).filter(([,O])=>O?.status==="settled").map(([O])=>O).filter(O=>!R.has(O));if(D.length===0)return;if(!e||!t){D.forEach(O=>R.add(O));return}const L=p().findIndex(O=>{const P=O?.id;return P?P===t:!1});y(L-1),D.forEach(O=>R.add(O))},[b,e,t,p,y]),{handleAddEpisode:I,handleDeleteEpisode:v,isAddPending:c,isDeleteOnePending:g(t)}},By=()=>{jne();const{clientData:e,isSuccess:t,isFetching:n,infoCards:s,currentEpisode:r,currentEpisodeVisibleIndex:i,propertyCards:o,isFabulizerInProcess:c,visibleEpisodes:u}=kne(),{episodeId:d}=st(),{mainWrapperRef:p}=zt(),g=l.useRef(null),A=l.useRef(null),E=l.useRef(void 0),x=l.useRef(!1),y=at(),I=Fe(),{isFabulizerReady:v,isOpen:S,status:b,statusPrevious:w}=wt({clientId:e?.id}),_=b==="notStarted",{openFabulizer:N}=Fu(),{handleAddEpisode:R,handleDeleteEpisode:D,isAddPending:k,isDeleteOnePending:L}=yre(),O=l.useCallback(()=>{e?.id&&N({clientId:e.id,to:`/clients/${e.id}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os})},[N,e]),P=l.useCallback(()=>{e?.id&&y(`/clients/${e.id}/fabulizer-history`,{state:{returnToPath:I.pathname}})},[e?.id,I.pathname,y]),B=l.useMemo(()=>[{title:h.client.fabula.buttons.ADD_EPISODE_WITH_AI,onClick:O,isCloseOnClick:!0,isDisabled:!_||k},{title:h.client.fabula.buttons.ADD,onClick:R,isCloseOnClick:!0,isDisabled:k||c},{title:h.client.fabula.buttons.FABULIZER_HISTORY,onClick:P,isCloseOnClick:!0}],[O,R,P,_,k,c]),F=l.useMemo(()=>s.length?d?s.findIndex(K=>!!qs({path:K.to,end:!0},I.pathname)):0:-1,[d,s,I.pathname]),z=l.useMemo(()=>!(F<0||!r),[F,r]);_s({containerRef:g,activeElementRef:A,isReady:!!t&&v&&u.length>0,isActive:z}),i>=0&&(E.current=i+1);const Q=E.current;if(c&&(x.current=!0),u.length>0&&(x.current=!1),!t||!v||!e?.id)return a.jsx(ct,{isWithWrapper:!0});if(!u.length){if(c)return a.jsx(jy,{status:b});if(x.current){if(w)return a.jsx(jy,{status:b});if(n)return a.jsx(jy,{status:b});x.current=!1}return a.jsx(xre,{handleAddEvent:R,handleOpenFabulizer:O})}if(u.length>0&&!r)return a.jsx(ct,{isWithWrapper:!0});const M=o[0];return a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:S?["notStarted","error"].includes(b)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:g,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[h.client.fabula.titles.TITLE,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!1,items:B})]}),leftColumn:a.jsx("div",{children:s.map((K,W)=>{const H=F===W;return a.jsx(Ac,{id:K.id,ref:H?A:null,clientId:e.id,title:K.title,text:K.text,instance:K.instance,date:K.date,to:K.to,isExternal:K.isExternal,isError:K.isError,commitDataPath:K.commitDataPath,isTextBlockLimited:!0,fallbackTo:W?void 0:`/cl
854ients/${e.id}/overview/fabula`},K.id)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[!!Q&&`${h.client.fabula.titles.EPISODE} ${Q}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.fabula.buttons.DELETE,onClick:()=>{r?.id&&D({episodeId:r.id})},isCloseOnClick:!0,isDisabled:L||c}]})]}),rightColumn:a.jsx("div",{children:!!(r&&M)&&a.jsx(Nt,{clientId:e.id,rows:M.rows,mainWrapperRef:p,scrollOffset:230},r.id)})})};function bre(){const e=bt(),t=zt(),{catalogues:n}=kn(),s=n?.articles,{externalData:r,status:i,statusPrevious:o,objectToFabulize:c}=wt({clientId:t?.clientData?.id}),u=l.useMemo(()=>!(i==="notStarted"||c?.type!=="client_info"),[i,c]),d=l.useMemo(()=>!r||c?.type!=="client_info"||i!=="awaitingChoice"&&!o?null:r,[i,r,o,c]),p=t?.clientData,g=t?.isSuccess,A=174,E=xo({lastName:p?.clientInfo?.lastName,firstName:p?.clientInfo?.firstName,middleName:p?.clientInfo?.middleName,isShort:!1}),x=l.useMemo(()=>[{title:h.client.titles.PERSONAL_DATA,to:`/clients/${p?.id}`},{title:h.client.titles.CRIMINAL_INFORMATION,to:`/clients/${p?.id}`,hash:"criminal-information"}],[p?.id]),y=l.useMemo(()=>{const S=p?.clientInfo?.contacts??[];if(!d?.contacts?.length)return S;const b=d.contacts.map(N=>({...N,isExternal:!0})),w=b.map(N=>{const R=S.find(D=>D.id===N.id);return R||N});return[...S.filter(N=>!b.some(R=>R.id===N.id)),...w]},[p?.clientInfo?.contacts,d?.contacts]),I=l.useMemo(()=>{const S=p?.clientInfo?.criminalRecords??[];if(!d?.criminalRecords?.length)return S;const b=d.criminalRecords.map(N=>({...N,isExternal:!0})),w=b.map(N=>{const R=S.find(D=>D.id===N.id);return R||N});return[...S.filter(N=>!b.some(R=>R.id===N.id)),...w]},[p?.clientInfo?.criminalRecords,d?.criminalRecords]),v=l.useMemo(()=>[{title:h.client.fields.FULL_NAME,rows:[{input:{isDisabled:u,label:h.client.fields.LAST_NAME,value:p?.clientInfo?.lastName,externalValue:d?.lastName,commitDataPath:["clientInfo","lastName"],placeholder:h.client.fields.placeholders.LAST_NAME,isRequired:!0,maxLength:50,patch:{endpoint:["clients","{clientId}","client-info"],field:"lastName",onPatchSuccess:()=>e.invalidateQueries({queryKey:["clientsList"]})}}},{input:{isDisabled:u,label:h.client.fields.FIRST_NAME,value:p?.clientInfo?.firstName,externalValue:d?.firstName,commitDataPath:["clientInfo","firstName"],placeholder:h.client.fields.placeholders.FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","client-info"],field:"firstName",onPatchSuccess:()=>e.invalidateQueries({queryKey:["clientsList"]})}}},{input:{isDisabled:u,label:h.client.fields.MIDDLE_NAME,value:p?.clientInfo?.middleName,externalValue:d?.middleName,commitDataPath:["clientInfo","middleName"],placeholder:h.client.fields.placeholders.MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","client-info"],field:"middleName",onPatchSuccess:()=>e.invalidateQueries({queryKey:["clientsList"]})}}}]},{title:h.client.fields.contacts.TITLE,isKebabMenuDisabled:u,post:{endpoint:["clients","{clientId}","client-info","contacts"],title:h.client.fields.contacts.ADD},deleteAll:{endpoint:["clients","{clientId}","client-info","contacts"],title:h.client.fields.contacts.DELETE_ALL},rowsGroups:y?.length?y.map((S,b)=>({title:`${h.client.fields.contacts.CONTACT} ${b+1}`,isExternal:S.isExternal,commitDataPath:["clientInfo","contacts"],isKebabMenuDisabled:u,post:{endpoint:["clients","{clientId}","client-info","contacts"],title:h.client.fields.contacts.DUPLICATE},delete:{endpoint:["clients","{clientId}","client-info","contacts",S.id??""],title:h.client.fields.contacts.DELETE},rowId:S.id,rows:[{input:{isDisabled:u,label:h.client.fields.contacts.PHONE,value:S.phone,type:"tel",placeholder:h.client.fields.placeholders.contacts.PHONE,patch:{endpoint:["clients","{clientId}","client-info","contacts",S.id??""],field:"phone"}}},{input:{isDisabled:u,label:h.client.fields.contacts.EMAIL,value:S.email,type:"email",placeholder:h.client.fields.placeholders.contacts.EMAIL,maxLength:100,patch:{endpoint:["clients","{clientId}","client-info","contacts",S.id??""],field:"email"}}},{textarea:{isDisabled:u,label:h.client.fields.contacts.ADDRESS,value:S.address,type:"address",placeholder:h.client.fields.placeholders.contacts.ADDRESS,maxLength:255,patch:{endpoint:["clients","{clientId}","client-info","contacts",S.id??""],field:"address"}}},{textarea:{isDisabled:u,label:h.client.fields.contacts.COMMENT,value:S.comment,placeholder:h.client.fields.placeholders.contacts.COMMENT,maxLength:255,patch:{endpoint:["clients","{clientId}","client-info","contacts",S.id??""],field:"comment"}}}]})):[]},{title:h.client.titles.DESCRIPTION,rows:[{select:{isDisabled:u,label:h.client.fields.GENDER,value:p?.clientInfo?.gender,externalValue:d?.gender,commitDataPath:["clientInfo","gender"],placeholder:h.client.fields.placeholders.GENDER,enumKey:"genders",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"gender"}}},{input:{isDisabled:u,label:h.client.fields.CITIZENSHIP,value:p?.clientInfo?.citizenship,externalValue:d?.citizenship,commitDataPath:["clientInfo","citizenship"],placeholder:h.client.fields.placeholders.CITIZENSHIP,maxLength:50,patch:{endpoint:["clients","{clientId}","client-info"],field:"citizenship"}}},{dateOnly:{isDisabled:u,label:h.client.fields.DATE_OF_BIRTH,value:p?.clientInfo?.dateOfBirth,externalValue:d?.dateOfBirth,commitDataPath:["clientInfo","dateOfBirth"],placeholder:h.client.fields.placeholders.DATE_OF_BIRTH,patch:{endpoint:["clients","{clientId}","client-info"],field:"dateOfBirth"}}},{select:{isDisabled:u,label:h.client.fields.AGE_STATUS,value:p?.clientInfo?.ageStatus,externalValue:d?.ageStatus,commitDataPath:["clientInfo","ageStatus"],placeholder:h.client.fields.placeholders.AGE_STATUS,enumKey:"ageStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"ageStatus"}}},{select:{isDisabled:u,label:h.client.fields.AGE_STATUS_GROUP,value:p?.clientInfo?.ageStatusGroup,externalValue:d?.ageStatusGroup,commitDataPath:["clientInfo","ageStatusGroup"],placeholder:h.client.fields.placeholders.AGE_STATUS_GROUP,enumKey:"ageStatusGroups",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"ageStatusGroup"}}},{select:{isDisabled:u,label:h.client.fields.MARITAL_STATUS,value:p?.clientInfo?.maritalStatus,externalValue:d?.maritalStatus,commitDataPath:["clientInfo","maritalStatus"],placeholder:h.client.fields.placeholders.MARITAL_STATUS,enumKey:"maritalStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"maritalStatus"}}},{checkbox:{isDisabled:u,label:h.client.fields.CHILDREN,value:p?.clientInfo?.children,externalValue:d?.children,commitDataPath:["clientInfo","children"],placeholder:h.client.fields.placeholders.CHILDREN,patch:{endpoint:["clients","{clientId}","client-info"],field:"children"}}},{input:{isDisabled:u,label:h.client.fields.EDUCATION,value:p?.clientInfo?.education,externalValue:d?.education,commitDataPath:["clientInfo","education"],placeholder:h.client.fields.placeholders.EDUCATION,maxLength:500,patch:{endpoint:["clients","{clientId}","client-info"],field:"education"}}},{checkbox:{isDisabled:u,label:h.client.fields.IS_MILITARY,value:p?.clientInfo?.isMilitary,externalValue:d?.isMilitary,commitDataPath:["clientInfo","isMilitary"],placeholder:h.client.fields.placeholders.IS_MILITARY,patch:{endpoint:["clients","{clientId}
854","client-info"],field:"isMilitary"}}},{checkbox:{isDisabled:u,label:h.client.fields.IS_ACTIVE_MILITARY,value:p?.clientInfo?.isActiveMilitary,externalValue:d?.isActiveMilitary,commitDataPath:["clientInfo","isActiveMilitary"],placeholder:h.client.fields.placeholders.IS_ACTIVE_MILITARY,patch:{endpoint:["clients","{clientId}","client-info"],field:"isActiveMilitary"}}},{input:{isDisabled:u,label:h.client.fields.OCCUPATION,value:p?.clientInfo?.occupation,externalValue:d?.occupation,commitDataPath:["clientInfo","occupation"],placeholder:h.client.fields.placeholders.OCCUPATION,maxLength:500,patch:{endpoint:["clients","{clientId}","client-info"],field:"occupation"}}},{select:{isDisabled:u,label:h.client.fields.MENTAL_HEALTH,value:p?.clientInfo?.mentalHealth,externalValue:d?.mentalHealth,commitDataPath:["clientInfo","mentalHealth"],placeholder:h.client.fields.placeholders.MENTAL_HEALTH,enumKey:"mentalHealths",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"mentalHealth"}}},{select:{isDisabled:u,label:h.client.fields.PHYSICAL_HEALTH,value:p?.clientInfo?.physicalHealth,externalValue:d?.physicalHealth,commitDataPath:["clientInfo","physicalHealth"],placeholder:h.client.fields.placeholders.PHYSICAL_HEALTH,enumKey:"physicalHealths",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"physicalHealth"}}},{select:{isDisabled:u,label:h.client.fields.CRIMINAL_STATUS,value:p?.clientInfo?.criminalStatus,externalValue:d?.criminalStatus,commitDataPath:["clientInfo","criminalStatus"],placeholder:h.client.fields.placeholders.CRIMINAL_STATUS,enumKey:"criminalStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"criminalStatus"}}}]},{anchor:"criminal-information",title:h.client.fields.criminalInformation.TITLE,isKebabMenuDisabled:u,post:{endpoint:["clients","{clientId}","client-info","criminal-records"],title:h.client.fields.criminalInformation.ADD},deleteAll:{endpoint:["clients","{clientId}","client-info","criminal-records"],title:h.client.fields.criminalInformation.DELETE_ALL},rowsGroups:I?.length?I.map((S,b)=>({title:`${h.client.fields.criminalInformation.CRIMINAL_RECORD} ${b+1}`,isExternal:S.isExternal,commitDataPath:["clientInfo","criminalRecords"],isKebabMenuDisabled:u,post:{endpoint:["clients","{clientId}","client-info","criminal-records"],title:h.client.fields.criminalInformation.DUPLICATE},delete:{endpoint:["clients","{clientId}","client-info","criminal-records",S.id??""],title:h.client.fields.criminalInformation.DELETE},rowId:S.id,rows:[{selectMultiple:{isDisabled:u,label:h.client.fields.criminalInformation.criminalRecord.ARTICLE,placeholder:h.client.fields.placeholders.criminalInformation.criminalRecord.ARTICLE,catalogue:"articles",patch:{endpoint:["clients","{clientId}","client-info","criminal-records",S.id??""],field:"articles"},isSearchable:!0,values:S.articles?S.articles.map(w=>{const _=s?.find(N=>N.id===w.catalogueArticleId);return{...w,catalogueArticle:_}}).sort((w,_)=>{const N=String(w?.catalogueArticle?.number??""),R=String(_?.catalogueArticle?.number??""),D=N.localeCompare(R,void 0,{numeric:!0,sensitivity:"base"});if(D!==0)return D;const k=String(w?.catalogueArticle?.part??""),L=String(_?.catalogueArticle?.part??""),O=k.localeCompare(L,void 0,{numeric:!0,sensitivity:"base"});if(O!==0)return O;const P=String(w?.catalogueArticle?.clause??""),B=String(_?.catalogueArticle?.clause??"");return P.localeCompare(B,void 0,{numeric:!0,sensitivity:"base"})}).map(w=>w?.catalogueArticle?.id).filter(w=>!!w):[],patchBodyMapper:({values:w})=>w.map(_=>({catalogueArticleId:_}))}},{textarea:{isDisabled:u,label:h.client.fields.criminalInformation.criminalRecord.DESCRIPTION,value:S.description??"",placeholder:h.client.fields.placeholders.criminalInformation.criminalRecord.DESCRIPTION,maxLength:1e3,patch:{endpoint:["clients","{clientId}","client-info","criminal-records",S.id??""],field:"description"}}},{checkbox:{isDisabled:u,label:h.client.fields.criminalInformation.criminalRecord.IS_CLEARED,value:S.isCleared,placeholder:h.client.fields.placeholders.criminalInformation.criminalRecord.IS_CLEARED,patch:{endpoint:["clients","{clientId}","client-info","criminal-records",S.id??""],field:"isCleared"}}},{checkbox:{isDisabled:u,label:h.client.fields.criminalInformation.criminalRecord.IS_RECIDIVISM,value:S.isRecidivism,placeholder:h.client.fields.placeholders.criminalInformation.criminalRecord.IS_RECIDIVISM,patch:{endpoint:["clients","{clientId}","client-info","criminal-records",S.id??""],field:"isRecidivism"}}}]})):[]},{title:h.client.fields.characteristics.TITLE,rows:[{select:{isDisabled:u,label:h.client.fields.characteristics.CHARACTERISTICS_DESCRIPTION,value:p?.clientInfo?.characteristicsDescription,externalValue:d?.characteristicsDescription,commitDataPath:["clientInfo","characteristicsDescription"],placeholder:h.client.fields.placeholders.characteristics.CHARACTERISTICS_DESCRIPTION,enumKey:"characteristicDescriptions",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"characteristicsDescription"}}},{input:{isDisabled:u,label:h.client.fields.characteristics.CHARACTERISTICS_SOURCE,value:p?.clientInfo?.characteristicsSource,externalValue:d?.characteristicsSource,commitDataPath:["clientInfo","characteristicsSource"],placeholder:h.client.fields.placeholders.characteristics.CHARACTERISTICS_SOURCE,maxLength:500,patch:{endpoint:["clients","{clientId}","client-info"],field:"characteristicsSource"}}}]},{title:h.client.fields.specialSubject.TITLE,rows:[{checkbox:{isDisabled:u,label:h.client.fields.specialSubject.IS_SPECIAL_SUBJECT,value:p?.clientInfo?.isSpecialSubject,externalValue:d?.isSpecialSubject,commitDataPath:["clientInfo","isSpecialSubject"],placeholder:h.client.fields.placeholders.specialSubject.IS_SPECIAL_SUBJECT,patch:{endpoint:["clients","{clientId}","client-info"],field:"isSpecialSubject"}}},{select:{isDisabled:u,label:h.client.fields.specialSubject.SPECIAL_SUBJECT_TYPE,value:p?.clientInfo?.specialSubjectType,externalValue:d?.specialSubjectType,commitDataPath:["clientInfo","specialSubjectType"],placeholder:h.client.fields.placeholders.specialSubject.SPECIAL_SUBJECT_TYPE,enumKey:"specialSubjectTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","client-info"],field:"specialSubjectType"}}},{textarea:{isDisabled:u,label:h.client.fields.specialSubject.DESCRIPTION,value:p?.clientInfo?.specialSubjectDescription??"",externalValue:d?.specialSubjectDescription,commitDataPath:["clientInfo","specialSubjectDescription"],placeholder:h.client.fields.placeholders.specialSubject.DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","client-info"],field:"specialSubjectDescription"}}}]}],[p?.clientInfo?.firstName,p?.clientInfo?.lastName,p?.clientInfo?.middleName,p?.clientInfo?.gender,p?.clientInfo?.citizenship,p?.clientInfo?.dateOfBirth,p?.clientInfo?.ageStatus,p?.clientInfo?.ageStatusGroup,p?.clientInfo?.maritalStatus,p?.clientInfo?.children,p?.clientInfo?.education,p?.clientInfo?.isMilitary,p?.clientInfo?.isActiveMilitary,p?.clientInfo?.occupation,p?.clientInfo?.mentalHealth,p?.clientInfo?.physicalHealth,p?.clientInfo?.criminalStatus,p?.clientInfo?.characteristicsDescription,p?.clientInfo?.characteristicsSource,p?.clientInfo?.isSpecialSubject,p?.clientInfo?.specialSubjectType,p?.clientInfo?.specialSubjectDescription,y,I,d?.ageStatus,d?.ageStatusGroup,d?.characteristicsDescription,d?.characteristicsSource,d?.children,d?.citizenship,d?.criminalStatus,d?.dateOfBirth,d?.education,d?.firstName,d?.gender,d?.isActiveMilitary,d?.isMilitary,d?.isSpecialSubject,d?.lastName,d?.maritalStatus,d?.mentalHealth,d?.middleName,d?.occupation,d?.physicalHealth,d?.specialSubjectDescription,d?.specialSubjectType,u,s,e]);return{isSuccess:g,clientName:E,infoCards:x,propertyCards:v,clientData:p,scrollOffset:A,isFabulizerInProcess:u}}function S7({infoCards:e,clientId:t,offset:n=174}){const s=sn(y=>y.setCurrentHash),r=l.useRef(null),i=Sm(),{isSuccess:o,mainWrapperRef:c}=zt(),u=l.useMemo(()=>e.map(y=>y.hash).filter(y=>!!y),[e]),d=l.useCallback(()=>
854{if(!t)return;const y=window.location.hash.replace(/^#/,""),I=y?`#${y}`:null;s(t,I)},[t,s]),p=l.useCallback(y=>{const I=y?.replace(/^#/,"")??"",v=I?`#${I}`:"";if(window.location.hash===v)return;const S=window.location.pathname+window.location.search;window.history.replaceState(null,"",`${S}${v}`),d()},[d]),g=l.useCallback(()=>{if(!c?.current)return;const y=10,I=c.current,v=I.scrollTop,S=I.clientHeight,b=I.scrollHeight,w=I.getBoundingClientRect();if(b-(v+S)<=y){const P=u[u.length-1];p(P);return}const N=v+S,R=v+n,D=N,k=[n];u.forEach(P=>{const B=document.getElementById(P);if(!B)return;const z=B.getBoundingClientRect().top-w.top+v;k.push(z)}),k.push(b);let L=null,O=-1;for(let P=0;P<k.length-1;P++){const B=k[P],F=k[P+1],z=F-B;if(z<=0)continue;const Q=Math.max(B,R),M=Math.min(F,D),W=Math.max(0,M-Q)/z;W>O&&(O=W,L=P===0?null:u[P-1])}p(L)},[u,c,p,n]),A=l.useMemo(()=>ol(g,50),[g]);l.useEffect(()=>{const y=c.current;if(y)return y.addEventListener("scroll",A),window.addEventListener("resize",A),()=>{y.removeEventListener("scroll",A),window.removeEventListener("resize",A),A.cancel()}},[A,c]);const E=l.useCallback(y=>{if(!c?.current)return;const I=(()=>{if(!y)return 0;const v=document.getElementById(y);if(!v)return 0;const S=v.getBoundingClientRect(),b=c.current.getBoundingClientRect(),w=S.top-n-b.top;return c.current.scrollTop+w})();c.current.scrollTo({top:I}),p(y)},[c,n,p]),x=l.useCallback(y=>{if(!o||!y)return;if(document.getElementById(y)){E(y);return}r.current=requestAnimationFrame(()=>x(y))},[o,E]);return l.useEffect(()=>{const y=window.location.hash.replace(/^#/,"");if(y)return x(y),()=>{r.current&&cancelAnimationFrame(r.current)}},[o,x]),l.useEffect(()=>{if(!t)return;const y="scrollToHashedElement"+t;if(!Is.getState().initializedKeys.has(y))return i(y),d(),window.addEventListener("hashchange",d),()=>window.removeEventListener("hashchange",d)},[t,d,i]),{scrollToHashedElement:E}}const Ire=()=>{const{mainWrapperRef:e}=zt(),{isClientNotFound:t}=Zi(),{isSuccess:n,infoCards:s,propertyCards:r,clientData:i,scrollOffset:o,isFabulizerInProcess:c}=bre(),{isFabulizerReady:u,isOpen:d,status:p}=wt({clientId:i?.id}),g=p==="notStarted",{scrollToHashedElement:A}=S7({infoCards:s,clientId:i?.id});lE({containerRef:e});const{openFabulizer:E}=Fu(),x=l.useCallback(()=>{i?.id&&E({clientId:i.id,to:`/clients/${i?.id}`,breadcrumbsNames:[h.client.navigation.CLIENT],type:"client_info"})},[E,i]);return t?a.jsx(ia,{type:Gr.CLIENT_NOT_FOUND}):!n||!u?a.jsx(ct,{isWithWrapper:!0}):a.jsx(Yn,{headerMode:"common",fabulizerMode:d?["notStarted","error"].includes(p)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftColumnStickyTitle:null,leftColumn:a.jsx(a.Fragment,{children:s.map((y,I)=>a.jsx(Ac,{title:y.title,to:y.to,hash:y.hash,clientId:i?.id,scrollToHashedElement:A},I))}),rightColumnStickyTitle:a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex items-center justify-between group roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4 bp48:pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[h.client.titles.TITLE,a.jsx("div",{className:"normal-case flex items-center",children:a.jsx(Wr,{text:h.client.tooltips.TITLE})})]}),a.jsx(Ss,{isRightColumn:!0,isWidthHalf:!0,items:[{title:h.client.fabulizer.buttons.FILL_WITH_AI,onClick:x,isCloseOnClick:!0,isDisabled:!g}],isDisabled:c})]})}),rightColumn:a.jsx("div",{children:r.map(y=>a.jsx(Nt,{clientId:i?.id,anchor:y.anchor,title:y.title??"",rows:y.rows,rowsGroups:y.rowsGroups,post:y.post,deleteAll:y.deleteAll,isKebabMenuDisabled:y.isKebabMenuDisabled,mainWrapperRef:e,scrollOffset:o},y.title))})})};function Sre(){const{clientData:e,isSuccess:t}=zt(),{externalData:n,status:s,statusPrevious:r,objectToFabulize:i}=wt({clientId:e?.id}),o=l.useMemo(()=>!n||i?.type!=="victim"||s!=="awaitingChoice"&&!r?null:n,[s,n,r,i]),c=l.useMemo(()=>[{title:h.client.participants.titles.WITNESSES,to:`/clients/${e?.id}/overview/participants/witnesses`,fallbackTo:`/clients/${e?.id}/overview/participants`}
854,{title:h.client.participants.titles.VICTIMS,to:`/clients/${e?.id}/overview/participants/victims`}],[e?.id]),u=l.useMemo(()=>e?.victims?.length?[...e.victims].sort((d,p)=>d.createdAt&&p.createdAt?d.createdAt.localeCompare(p.createdAt):0).map(d=>{const p=s!=="notStarted"&&i?.type==="victim"&&i?.id===d.id,g=(()=>{if(!o?.id||o?.id!==d.id)return d.contacts;const A=d?.contacts??[];if(!o?.contacts?.length)return A;const E=o.contacts.map(I=>({...I,isExternal:!0})),x=E.map(I=>{const v=A.find(S=>S.id===I.id);return v||I});return[...A.filter(I=>!E.some(v=>v.id===I.id)),...x]})();return{id:d.id,firstName:d.firstName,middleName:d.middleName,lastName:d.lastName,propertyCards:[{rows:[{input:{isDisabled:p,label:h.client.participants.victims.fields.LAST_NAME,value:d.lastName,externalValue:o?.id===d.id?o?.lastName:void 0,commitDataPath:["victim","lastName"],placeholder:h.client.participants.victims.fields.placeholders.LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"lastName"}}},{input:{isDisabled:p,label:h.client.participants.victims.fields.FIRST_NAME,value:d.firstName,externalValue:o?.id===d.id?o?.firstName:void 0,commitDataPath:["victim","firstName"],placeholder:h.client.participants.victims.fields.placeholders.FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"firstName"}}},{input:{isDisabled:p,label:h.client.participants.victims.fields.MIDDLE_NAME,value:d.middleName,externalValue:o?.id===d.id?o?.middleName:void 0,commitDataPath:["victim","middleName"],placeholder:h.client.participants.victims.fields.placeholders.MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"middleName"}}},{select:{isDisabled:p,label:h.client.participants.victims.fields.GENDER,value:d.gender,externalValue:o?.id===d.id?o?.gender:void 0,commitDataPath:["victim","gender"],placeholder:h.client.participants.victims.fields.placeholders.GENDER,enumKey:"genders",catalogue:"enums",patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"gender"}}},{dateOnly:{isDisabled:p,label:h.client.participants.victims.fields.DATE_OF_BIRTH,value:d.dateOfBirth,externalValue:o?.id===d.id?o?.dateOfBirth:void 0,commitDataPath:["victim","dateOfBirth"],placeholder:h.client.participants.victims.fields.placeholders.DATE_OF_BIRTH,patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"dateOfBirth"}}},{select:{isDisabled:p,label:h.client.participants.victims.fields.AGE_STATUS,value:d.ageStatus,externalValue:o?.id===d.id?o?.ageStatus:void 0,commitDataPath:["victim","ageStatus"],placeholder:h.client.participants.victims.fields.placeholders.AGE_STATUS,enumKey:"ageStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"ageStatus"}}},{input:{isDisabled:p,label:h.client.participants.victims.fields.RELATION_TO_CLIENT,value:d.relationToClient,externalValue:o?.id===d.id?o?.relationToClient:void 0,commitDataPath:["victim","relationToClient"],placeholder:h.client.participants.victims.fields.placeholders.RELATION_TO_CLIENT,maxLength:500,patch:{endpoint:["clients","{clientId}","victims",d.id??""],field:"relationToClient"}}}]},{title:h.client.participants.victims.fields.contacts.TITLE,isKebabMenuDisabled:p,deleteAll:{endpoint:["clients","{clientId}","victims",d.id??"","contacts"],title:h.client.participants.buttons.DELETE_ALL_CONTACTS},post:{endpoint:["clients","{clientId}","victims",d.id??"","contacts"],title:h.client.participants.buttons.ADD_CONTACT},rowsGroups:g.map((A,E)=>({title:`${h.client.participants.victims.fields.contacts.CONTACT} ${E+1}`,isKebabMenuDisabled:p,isExternal:A.isExternal,commitDataPath:["victim","contacts"],rowId:A.id,delete:{endpoint:["clients","{clientId}","victims",d.id??"","contacts",A.id??""],title:h.client.participants.buttons.DELETE_CONTACT},post:{endpoint:["clients","{clientId}","victims",d.id??"","contacts"],title:h.client.participants.buttons.DUPLICATE_CONTACT},rows:[{input:{isDisabled:p,label:h.client.participants.victims.fields.contacts.PHONE,value:A.phone,type:"tel",placeholder:h.client.participants.victims.fields.placeholders.contacts.PHONE,patch:{endpoint:["clients","{clientId}","victims",d.id??"","contacts",A.id??""],field:"phone"}}},{input:{isDisabled:p,label:h.client.participants.victims.fields.contacts.EMAIL,value:A.email,type:"email",placeholder:h.client.participants.victims.fields.placeholders.contacts.EMAIL,maxLength:100,patch:{endpoint:["clients","{clientId}","victims",d.id??"","contacts",A.id??""],field:"email"}}},{textarea:{isDisabled:p,label:h.client.participants.victims.fields.contacts.ADDRESS,value:A.address,type:"address",placeholder:h.client.participants.victims.fields.placeholders.contacts.ADDRESS,maxLength:255,patch:{endpoint:["clients","{clientId}","victims",d.id??"","contacts",A.id??""],field:"address"}}}]}))}]}}):[],[e?.victims,o,s,i?.id,i?.type]);return{clientData:e,isSuccess:t,infoCards:c,victims:u,externalVictim:o}}const Kr=Oe.forwardRef(({title:e,className:t,children:n,isKebabMenuDisabled:s,kebabMenuItems:r,anchor:i},o)=>{const[c,u]=l.useState(!0),d=l.useCallback(()=>{u(!c)},[c]);return a.jsxs("div",{ref:o,id:i,className:Y(t,"group/foldable",!!i&&"scroll-mt-[116px]"),children:[a.jsxs("div",{className:Y("flex items-start gap-2 text-zinc-950"),children:[a.jsxs("div",{className:Y("roboto-flex-100-600-1","text-[20px]","leading-[24px]","py-1","cursor-pointer","flex","items-start","gap-2","flex-1"),onClick:d,children:[a.jsx("div",{children:e}),a.jsx("div",{className:"flex items-center justify-center min-w-2.5 min-h-2.5",children:a.jsx(Bu,{className:Y("text-zinc-400 mt-2.5",!!c&&"rotate-180")}
854)}),!!r?.length&&a.jsx("div",{className:"flex-1"})]}),!!r?.length&&a.jsx("div",{className:"py-1",children:a.jsx(Ss,{items:r,isRightColumn:!0,isDisabled:s,hoverGroupName:"foldable"})})]}),a.jsx("div",{className:Y("pt-1.5",!c&&"hidden"),children:n})]})}),vre=()=>{const{mainWrapperRef:e}=zt(),{isSuccess:t,infoCards:n,victims:s,clientData:r}=Sre(),{openFabulizer:i}=Fu(),{isFabulizerReady:o,isOpen:c,status:u,objectToFabulize:d}=wt({clientId:r?.id}),p=u==="notStarted",{postResource:g}=Uu({clientId:r?.id}),{deleteResourceItem:A}=zu({clientId:r?.id}),E=Hn(P=>P.requestsByClient?.[String(r?.id??"")]),x=l.useRef([]),y=l.useRef(new Set),I=l.useRef(!1),v=l.useRef(null),S=l.useRef(null),b=Fe(),w=l.useMemo(()=>r?.id?["clients",String(r.id),"victims"].join("/")+"/":"",[r?.id]),_=ra(P=>P.requestsByClient?.[String(r?.id??"")]?.[w]),N=l.useCallback(({id:P})=>{const B=s.find(F=>F.id===P);i({clientId:r.id,to:`/clients/${r?.id}/overview/participants/victims`,breadcrumbsNames:[xo({lastName:B?.lastName,firstName:B?.firstName,middleName:B?.middleName,placeholder:h.client.participants.victims.placeholders.NEW_VICTIM,isShort:!0})],type:"victim",id:P})},[r?.id,s,i]),R=l.useCallback(()=>{r?.id&&g({pathSegments:["clients","{clientId}","victims"],pathValues:{},body:{}})},[r?.id,g]),D=l.useCallback(P=>{r?.id&&A({pathSegments:["clients","{clientId}","victims","{victimId}"],pathValues:{victimId:P},itemId:P})},[r?.id,A]),k=l.useCallback(P=>{if(!r?.id)return!1;const F=`${["clients",String(r.id),"victims",String(P)].join("/")+"/"}#${String(P)}`,z=E?.[F];return z?Object.values(z).some(Q=>Q?.status==="inflight"):!1},[r?.id,E]);l.useEffect(()=>{const P=_;if(!P)return;const B=y.current;I.current||(Object.entries(P).filter(([,K])=>K?.status==="settled").forEach(([K])=>B.add(K)),I.current=!0);const F=Object.entries(P).filter(([,K])=>K?.status==="settled").map(([K])=>K).filter(K=>!B.has(K));if(!F.length)return;const z=x.current.filter(Boolean).length,Q=()=>x.current.reduce((K,W)=>W||K,null),M=K=>{if(x.current.filter(Boolean).length>z){const j=Q();j&&requestAnimationFrame(()=>{mf({ref:e,elementRef:{current:j},behavior:"smooth",offset:230})}),F.forEach(q=>B.add(q));return}if(K<10){requestAnimationFrame(()=>M(K+1));return}const H=Q();H&&requestAnimationFrame(()=>{mf({ref:e,elementRef:{current:H},behavior:"smooth",offset:230})}),F.forEach(j=>B.add(j))};requestAnimationFrame(()=>M(0))},[_,e]);const L=Oe.useMemo(()=>n.findIndex(P=>!!qs({path:P.to,end:!1},b.pathname)),[n,b.pathname]),O=Oe.useMemo(()=>L>=0,[L]);return _s({containerRef:v,activeElementRef:S,isReady:t&&o&&n.length>0,isActive:O}),!t||!o?a.jsx(ct,{isWithWrapper:!0}):a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:c?["notStarted","error"].includes(u)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:v,leftColumnStickyTitle:h.client.participants.titles.TITLE,leftColumn:a.jsx("div",{children:n.map((P,B)=>{const F=L===B;return a.jsx(Ac,{ref:F?S:null,...P},B)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[`${h.client.participants.titles.VICTIMS}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.participants.buttons.ADD_VICTIM,onClick:R,isCloseOnClick:!0}]})]}),rightColumn:a.jsx("div",{children:s.map((P,B)=>{const F=u!=="notStarted"&&d?.type==="victim"&&d?.id===P.id;return a.jsx(Kr,{ref:z=>{x.current[B]=z},title:xo({lastName:P.lastName,firstName:P.firstName,middleName:P.middleName,placeholder:h.client.participants.placeholders.NAME_NOT_SPECIFIED,isShort:!1}),className:Y("mt-6 first:mt-0",!!k(P.id)&&"opacity-60 pointer-events-none"),kebabMenuItems:(()=>{const z=[{title:h.client.fabulizer.buttons.FILL_WITH_AI,onClick:()=>N({id:P.id}),isCloseOnClick:!0,isDisabled:!p}];return s.length>1&&z.push({title:h.client.participants.buttons.DELETE_VICTIM,onClick:()=>D(P.id),isCloseOnClick:!0,isDisabled:!1}),z})(),isKebabMenuDisabled:F,children:P.propertyCards.map((z,Q)=>a.jsx(Nt,{clientId:r?.id,title:z.title,post:z.post,deleteAll:z.deleteAll,rows:z.rows,rowsGroups:z.rowsGroups,mainWrapperRef:e,scrollOffset:230,isKebabMenuDisabled:z.isKebabMenuDisabled},Q))},B)})})})};function _re(){const{clientData:e,isSuccess:t}=zt(),{externalData:n,status:s,statusPrevious:r,objectToFabulize:i}=wt({clientId:e?.id}),o=l.useMemo(()=>!n||i?.type!=="witness"||s!=="awaitingChoice"&&!r?null:n,[s,n,r,i]),c=l.useMemo(()=>[{title:h.client.participants.titles.WITNESSES,to:`/clients/${e?.
854id}/overview/participants/witnesses`,fallbackTo:`/clients/${e?.id}/overview/participants`},{title:h.client.participants.titles.VICTIMS,to:`/clients/${e?.id}/overview/participants/victims`}],[e?.id]),u=l.useMemo(()=>e?.witnesses?.length?[...e.witnesses].sort((d,p)=>d.createdAt&&p.createdAt?d.createdAt.localeCompare(p.createdAt):0).map(d=>{const p=s!=="notStarted"&&i?.type==="witness"&&i?.id===d.id,g=(()=>{if(!o?.id||o?.id!==d.id)return d.contacts;const A=d?.contacts??[];if(!o?.contacts?.length)return A;const E=o.contacts.map(I=>({...I,isExternal:!0})),x=E.map(I=>{const v=A.find(S=>S.id===I.id);return v||I});return[...A.filter(I=>!E.some(v=>v.id===I.id)),...x]})();return{id:d.id,firstName:d.firstName,middleName:d.middleName,lastName:d.lastName,propertyCards:[{rows:[{input:{isDisabled:p,label:h.client.participants.witnesses.fields.LAST_NAME,value:d.lastName,externalValue:o?.id===d.id?o?.lastName:void 0,commitDataPath:["witness","lastName"],placeholder:h.client.participants.witnesses.fields.placeholders.LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"lastName"}}},{input:{isDisabled:p,label:h.client.participants.witnesses.fields.FIRST_NAME,value:d.firstName,externalValue:o?.id===d.id?o?.firstName:void 0,commitDataPath:["witness","firstName"],placeholder:h.client.participants.witnesses.fields.placeholders.FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"firstName"}}},{input:{isDisabled:p,label:h.client.participants.witnesses.fields.MIDDLE_NAME,value:d.middleName,externalValue:o?.id===d.id?o?.middleName:void 0,commitDataPath:["witness","middleName"],placeholder:h.client.participants.witnesses.fields.placeholders.MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"middleName"}}},{select:{isDisabled:p,label:h.client.participants.witnesses.fields.GENDER,value:d.gender,externalValue:o?.id===d.id?o?.gender:void 0,commitDataPath:["witness","gender"],placeholder:h.client.participants.witnesses.fields.placeholders.GENDER,enumKey:"genders",catalogue:"enums",patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"gender"}}},{dateOnly:{isDisabled:p,label:h.client.participants.witnesses.fields.DATE_OF_BIRTH,value:d.dateOfBirth,externalValue:o?.id===d.id?o?.dateOfBirth:void 0,commitDataPath:["witness","dateOfBirth"],placeholder:h.client.participants.witnesses.fields.placeholders.DATE_OF_BIRTH,patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"dateOfBirth"}}},{select:{isDisabled:p,label:h.client.participants.witnesses.fields.AGE_STATUS,value:d.ageStatus,externalValue:o?.id===d.id?o?.ageStatus:void 0,commitDataPath:["witness","ageStatus"],placeholder:h.client.participants.witnesses.fields.placeholders.AGE_STATUS,enumKey:"ageStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"ageStatus"}}},{input:{isDisabled:p,label:h.client.participants.witnesses.fields.RELATION_TO_CLIENT,value:d.relationToClient,externalValue:o?.id===d.id?o?.relationToClient:void 0,commitDataPath:["witness","relationToClient"],placeholder:h.client.participants.witnesses.fields.placeholders.RELATION_TO_CLIENT,maxLength:500,patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"relationToClient"}}},{select:{isDisabled:p,label:h.client.participants.witnesses.fields.TESTIMONY_STAGE,value:d.testimonyStage,externalValue:o?.id===d.id?o?.testimonyStage:void 0,commitDataPath:["witness","testimonyStage"],placeholder:h.client.participants.witnesses.fields.placeholders.TESTIMONY_STAGE,enumKey:"testimonyStages",catalogue:"enums",patch:{endpoint:["clients","{clientId}","witnesses",d.id??""],field:"testimonyStage"}}}]},{title:h.client.participants.witnesses.fields.contacts.TITLE,isKebabMenuDisabled:p,deleteAll:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts"],title:h.client.participants.buttons.DELETE_ALL_CONTACTS},post:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts"],title:h.client.participants.buttons.ADD_CONTACT},rowsGroups:g.map((A,E)=>({title:`${h.client.participants.witnesses.fields.contacts.CONTACT} ${E+1}`,isExternal:A.isExternal,commitDataPath:["witness","contacts"],isKebabMenuDisabled:p,rowId:A.id,delete:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts",A.id??""],title:h.client.participants.buttons.DELETE_CONTACT},post:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts"],title:h.client.participants.buttons.DUPLICATE_CONTACT},rows:[{input:{isDisabled:p,label:h.client.participants.witnesses.fields.contacts.PHONE,value:A.phone,type:"tel",placeholder:h.client.participants.witnesses.fields.placeholders.contacts.PHONE,patch:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts",A.id??""],field:"phone"}}},{input:{isDisabled:p,label:h.client.participants.witnesses.fields.contacts.EMAIL,value:A.email,type:"email",placeholder:h.client.participants.witnesses.fields.placeholders.contacts.EMAIL,maxLength:100,patch:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts",A.id??""],field:"email"}}},{textarea:{isDisabled:p,label:h.client.participants.witnesses.fields.contacts.ADDRESS,value:A.address,type:"address",placeholder:h.client.participants.witnesses.fields.placeholders.contacts.ADDRESS,maxLength:255,patch:{endpoint:["clients","{clientId}","witnesses",d.id??"","contacts",A.id??""],field:"address"}}}]}))}]}}):[],[e?.witnesses,o,s,i?.id,i?.type]);return{clientData:e,isSuccess:t,infoCards:c,witnesses:u,externalWitness:o}}const tw=()=>{const{mainWrapperRef:e}=zt(),{isSuccess:t,infoCards:n,witnesses:s,clientData:r}=_re(),{openFabulizer:i}=Fu(),{isFabulizerReady:o,isOpen:c,status:u,objectToFabulize:d}=wt({clientId:r?.id}),{postResource:p}=Uu({clientId:r?.id}),{deleteResourceItem:g}=zu({clientId:r?.id}),A=Hn(O=>O.requestsByClient?.[String(r?.id??"")]),E=l.useRef([]),x=l.useRef(new Set),y=l.useRef(!1),I=l.useRef(null),v=l.useRef(null),S=Fe(),b=l.useMemo(()=>r?.id?["clients",String(r.id),"witnesses"].join("/")+"/":"",[r?.id]),w=ra(O=>O.requestsByClient?.[String(r?.id??"")]?.[b]),_=l.useCallback(({id:O})=>{const P=s.find(B=>B.id===O);i({clientId:r.id,to:`/clients/${r?.id}/overview/participants/witnesses`,breadcrumbsNames:[xo({lastName:P?.lastName,firstName:P?.firstName,middleName:P?.middleName,placeholder:h.client.participants.witnesses.placeholders.NEW_WITNESS,isShort:!0})],type:"witness",id:O})},[r?.id,s,i]),N=l.useCallback(()=>{r?.id&&p({pathSegments:["clients","{clientId}","witnesses"],pathValues:{},body:{}})},[r?.id,p]),R=l.useCallback(O=>{r?.id&&g({pathSegments:["clients","{clientId}","witnesses","{witnessId}"],pathValues:{witnessId:O},itemId:O})},[r?.id,g]),D=l.useCallback(O=>{if(!r?.id)return!1;const B=`${["clients",String(r.id),"witnesses",String(O)].join("/")+"/"}#${String(O)}`,F=A?.[B];return F?Object.values(F).some(z=>z?.status==="inflight"):!1},[r?.id,A]);l.useEffect(()=>{const O=w;if(!O)return;const P=x.current;y.current||(Object.entries(O).filter(([,M])=>M?.status==="settled").forEach(([M])=>P.add(M)),y.current=!0);const B=Object.entries(O).filter(([,M])=>M?.status==="settled").map(([M])=>M).filter(M=>!P.has(M));if(!B.length)return;const F=E.current.filter(Boolean).length,z=()=>E.current.reduce((M,K)=>K||M,null),Q=M=>
854{if(E.current.filter(Boolean).length>F){const H=z();H&&requestAnimationFrame(()=>{mf({ref:e,elementRef:{current:H},behavior:"smooth",offset:230})}),B.forEach(j=>P.add(j));return}if(M<10){requestAnimationFrame(()=>Q(M+1));return}const W=z();W&&requestAnimationFrame(()=>{mf({ref:e,elementRef:{current:W},behavior:"smooth",offset:230})}),B.forEach(H=>P.add(H))};requestAnimationFrame(()=>Q(0))},[w,e]);const k=Oe.useMemo(()=>n.findIndex(O=>!!qs({path:O.to,end:!1},S.pathname)),[n,S.pathname]),L=Oe.useMemo(()=>k>=0,[k]);return _s({containerRef:I,activeElementRef:v,isReady:t&&o&&n.length>0,isActive:L}),!t||!o?a.jsx(ct,{isWithWrapper:!0}):a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:c?["notStarted","error"].includes(u)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:I,leftColumnStickyTitle:h.client.participants.titles.TITLE,leftColumn:a.jsx("div",{children:n.map((O,P)=>{const B=k===P;return a.jsx(Ac,{ref:B?v:null,...O},P)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[`${h.client.participants.titles.WITNESSES}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.participants.buttons.ADD_WITNESS,onClick:N,isCloseOnClick:!0}]})]}),rightColumn:a.jsx("div",{children:s.map((O,P)=>{const B=u!=="notStarted"&&d?.type==="witness"&&d?.id===O.id,F=u==="notStarted";return a.jsx(Kr,{ref:z=>{E.current[P]=z},title:xo({lastName:O.lastName,firstName:O.firstName,middleName:O.middleName,placeholder:h.client.participants.placeholders.NAME_NOT_SPECIFIED,isShort:!1}),className:Y("mt-6 first:mt-0",!!D(O.id)&&"opacity-60 pointer-events-none"),kebabMenuItems:(()=>{const z=[{title:h.client.fabulizer.buttons.FILL_WITH_AI,onClick:()=>_({id:O.id}),isCloseOnClick:!0,isDisabled:!F}];return s.length>1&&z.push({title:h.client.participants.buttons.DELETE_WITNESS,onClick:()=>R(O.id),isCloseOnClick:!0,isDisabled:!1}),z})(),isKebabMenuDisabled:B,children:O.propertyCards.map((z,Q)=>a.jsx(Nt,{clientId:r?.id,title:z.title,post:z.post,deleteAll:z.deleteAll,rows:z.rows,rowsGroups:z.rowsGroups,isKebabMenuDisabled:z.isKebabMenuDisabled,mainWrapperRef:e,scrollOffset:230},Q))},P)})})})},Tre=({id:e,title:t,startDate:n,endDate:s,status:r,nextStageStatus:i,to:o,fallbackTo:c})=>{const u=Fe(),d=l.useMemo(()=>qs({path:o,end:!1},u.pathname)?!0:!(!c||!qs({path:c??"",end:!0},u.pathname)),[o,c,u.pathname]),p=s==null,g=l.useMemo(()=>r==="skipped"?null:a.jsx("div",{children:a.jsxs("div",{className:"flex",children:[a.jsx("div",{className:"flex justify-start w-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-stretch w-3 h-full",children:[a.jsx("div",{className:Y("w-0.25 h-4.5",e==="pre-investigation-check"&&"bg-white",e!=="pre-investigation-check"&&r!=="notStarted"&&"bg-zinc-200")}),a.jsx("div",{className:Y("flex items-center justify-center w-3 h-3 rounded-full",r==="finished"&&"bg-zinc-200",r==="active"&&"bg-sky-200",r==="notStarted"&&"bg-zinc-200"),children:a.jsx("div",{className:Y("w-1.5 h-1.5 rounded-full",r==="finished"&&"bg-zinc-400",r==="active"&&"bg-sky-500",r==="notStarted"&&"bg-white")})}),a.jsx("div",{className:Y("flex-1 w-0.25",e==="court-final-instance"&&"bg-white",e!=="court-final-instance"&&i!=="notStarted"&&"bg-zinc-200")})]})}),a.jsxs("div",{className:"pt-3 pb-3",children:[a.jsx("div",{className:Y("roboto-flex-100-600-1 text-[18px] leading-[24px]",d?"text-zinc-950":"text-zinc-500"),children:a.jsx(tn,{text:t})}),r!=="notStarted"&&a.jsxs("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 mt-0.5",children:[r==="finished"&&`${_r({dateString:n??"",isWithTime:!1})}–${_r({dateString:s??"",isWithTime:!1})}`,r==="active"&&(p?sa({startDate:n??"",isShort:!0}):`${_r({dateString:n??"",isWithTime:!1})}–${_r({dateString:s??"",isWithTime:!1})}`)]})]})]})}),[e,t,n,s,r,i,d,p]);return r==="skipped"?null:r==="notStarted"?a.jsx("div",{className:Y("block border-l-2 pl-3.5 pr-4 cursor-default",!d&&"border-white",!!d&&"bg-zinc-50 border-black"),children:g}):a.jsx(Je,{className:Y("block border-l-2 pl-3.5 pr-4",!d&&"border-white",!!d&&"bg-zinc-50 border-black"),to:o,children:g})};function Nre(){const e=at(),{clientData:t,isSuccess:n}=zt(),{stageId:s}=st();l.useEffect(()=>{if(!n||!t||!s)return;if(!["pre-investigation-check","inquiry","preliminary-investigation","court-first-instance","court-second-instance","court-third-instance","court-final-instance"].includes(s)){e(`/clients/${t.id}
854/overview/stage`,{replace:!0});return}const i=t?.phases?.management;if(!i){e(`/clients/${t.id}/overview/stage`,{replace:!0});return}const o=ho(s);if(["inquiry","preliminaryInvestigation"].includes(o)){const d=`skip${o.charAt(0).toUpperCase()+o.slice(1)}`;if(i[d]){e(`/clients/${t.id}/overview/stage`,{replace:!0});return}}const c=`${o}StartDate`;i[c]||e(`/clients/${t.id}/overview/stage`,{replace:!0})},[n,t,s,e]),l.useEffect(()=>{!n||!t||s||!t?.phases?.management?.preInvestigationCheckStartDate||e(`/clients/${t.id}/overview/stage/pre-investigation-check`,{replace:!0})},[n,t,s,e])}function wre({clientData:e,criminalsString:t}){const n=e?.phases?.preInvestigationCheck,{externalData:s,status:r,statusPrevious:i,objectToFabulize:o}=wt({clientId:e?.id}),c=l.useMemo(()=>!(r==="notStarted"||o?.type!=="pre_investigation_check"),[r,o]),u=l.useMemo(()=>!s||o?.type!=="pre_investigation_check"||r!=="awaitingChoice"&&!i?null:s,[r,s,i,o]);return!e||!n?[]:[{rows:[{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.CRIME_REPORT_REGISTRY_NUMBER,value:n.crimeReportRegistryNumber,externalValue:u?.crimeReportRegistryNumber,commitDataPath:["preInvestigationCheck","crimeReportRegistryNumber"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.CRIME_REPORT_REGISTRY_NUMBER,maxLength:15,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"crimeReportRegistryNumber"}}},{text:{label:h.client.stage.preInvestigationCheck.fields.ARTICLES,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.preInvestigationCheck.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.preInvestigationCheck.fields.START_DATE,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.preInvestigationCheckStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.preInvestigationCheckStartDate"}},{text:{label:h.client.stage.preInvestigationCheck.fields.END_DATE,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.preInvestigationCheckEndDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.preInvestigationCheckEndDate"}},{text:{label:h.client.stage.preInvestigationCheck.fields.DURATION,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.DURATION,value:e?.phases?.management.preInvestigationCheckStartDate&&e?.phases?.management.preInvestigationCheckEndDate?sa({startDate:e?.phases?.management.preInvestigationCheckStartDate??"",endDate:e?.phases?.management.preInvestigationCheckEndDate??""}):"",sourcePath:"clientData.phases.management.preInvestigationCheckStartDate"}},{dateOnly:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.CRIMINAL_CASE_OPENING_DATE,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.CRIMINAL_CASE_OPENING_DATE,value:n.criminalCaseOpeningDate,externalValue:u?.criminalCaseOpeningDate,commitDataPath:["preInvestigationCheck","criminalCaseOpeningDate"],patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"criminalCaseOpeningDate"}}}]},{title:h.client.stage.preInvestigationCheck.titles.APPLICANT,rows:[{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_LAST_NAME,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_LAST_NAME,maxLength:50,value:n.applicantLastName,externalValue:u?.applicantLastName,commitDataPath:["preInvestigationCheck","applicantLastName"],patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantLastName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_FIRST_NAME,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_FIRST_NAME,maxLength:50,value:n.applicantFirstName,externalValue:u?.applicantFirstName,commitDataPath:["preInvestigationCheck","applicantFirstName"],patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantFirstName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_MIDDLE_NAME,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_MIDDLE_NAME,maxLength:50,value:n.applicantMiddleName,externalValue:u?.applicantMiddleName,commitDataPath:["preInvestigationCheck","applicantMiddleName"],patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantMiddleName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_PHONE,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_PHONE,value:n.applicantPhone,externalValue:u?.applicantPhone,commitDataPath:["preInvestigationCheck","applicantPhone"],type:"tel",patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantPhone"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_EMAIL,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_EMAIL,value:n.applicantEmail,externalValue:u?.applicantEmail,commitDataPath:["preInvestigationCheck","applicantEmail"],t
854ype:"email",maxLength:100,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantEmail"}}},{textarea:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_ADDRESS,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_ADDRESS,value:n.applicantAddress,externalValue:u?.applicantAddress,commitDataPath:["preInvestigationCheck","applicantAddress"],type:"address",maxLength:255,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantAddress"}}},{select:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_GENDER,value:n.applicantGender,externalValue:u?.applicantGender,commitDataPath:["preInvestigationCheck","applicantGender"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_GENDER,enumKey:"genders",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantGender"}}},{dateOnly:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_DATE_OF_BIRTH,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_DATE_OF_BIRTH,value:n.applicantDateOfBirth,externalValue:u?.applicantDateOfBirth,commitDataPath:["preInvestigationCheck","applicantDateOfBirth"],patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantDateOfBirth"}}},{select:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_AGE_STATUS,value:n.applicantAgeStatus,externalValue:u?.applicantAgeStatus,commitDataPath:["preInvestigationCheck","applicantAgeStatus"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_AGE_STATUS,enumKey:"ageStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantAgeStatus"}}},{textarea:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.APPLICANT_RELATION_TO_CLIENT,value:n.applicantRelationToClient,externalValue:u?.applicantRelationToClient,commitDataPath:["preInvestigationCheck","applicantRelationToClient"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.APPLICANT_RELATION_TO_CLIENT,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"applicantRelationToClient"}}}]},{title:h.client.stage.preInvestigationCheck.titles.INVESTIGATOR_DATA,rows:[{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_LAST_NAME,value:n.investigatorLastName,externalValue:u?.investigatorLastName,commitDataPath:["preInvestigationCheck","investigatorLastName"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorLastName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_FIRST_NAME,value:n.investigatorFirstName,externalValue:u?.investigatorFirstName,commitDataPath:["preInvestigationCheck","investigatorFirstName"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorFirstName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_MIDDLE_NAME,value:n.investigatorMiddleName,externalValue:u?.investigatorMiddleName,commitDataPath:["preInvestigationCheck","investigatorMiddleName"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorMiddleName"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_POSITION,value:n.investigatorPosition,externalValue:u?.investigatorPosition,commitDataPath:["preInvestigationCheck","investigatorPosition"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_POSITION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorPosition"}}},{input:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_RANK,value:n.investigatorRank,externalValue:u?.investigatorRank,commitDataPath:["preInvestigationCheck","investigatorRank"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_RANK,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorRank"}}},{textarea:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.INVESTIGATOR_DEPARTMENT,value:n.investigatorDepartment,externalValue:u?.investigatorDepartment,commitDataPath:["preInvestigationCheck","investigatorDepartment"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.INVESTIGATOR_DEPARTMENT,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"investigatorDepartment"}}}]},{rows:[{select:{isDisabled:c,label:h.client.stage.preInvestigationCheck.fields.RESULT,value:n.result,externalValue:u?.result,commitDataPath:["preInvestigationCheck","result"],placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.RESULT,enumKe
854y:"preInvestigationResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","pre-investigation-check"],field:"result"}}}]}]}function Rre({clientData:e,criminalsString:t}){const n=e?.phases?.inquiry,{externalData:s,status:r,statusPrevious:i,objectToFabulize:o}=wt({clientId:e?.id}),c=l.useMemo(()=>!(r==="notStarted"||o?.type!=="inquiry"),[r,o]),u=l.useMemo(()=>!s||o?.type!=="inquiry"||r!=="awaitingChoice"&&!i?null:s,[r,s,i,o]);return!e||!n?[]:[{rows:[{input:{isDisabled:c,label:h.client.stage.inquiry.fields.CASE_NUMBER,value:n.caseNumber,externalValue:u?.caseNumber,commitDataPath:["inquiry","caseNumber"],placeholder:h.client.stage.inquiry.fields.placeholder.CASE_NUMBER,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"caseNumber"}}},{text:{label:h.client.stage.preInvestigationCheck.fields.ARTICLES,placeholder:h.client.stage.preInvestigationCheck.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.inquiry.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.inquiry.fields.START_DATE,placeholder:h.client.stage.inquiry.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.inquiryStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.inquiryStartDate"}},{text:{label:h.client.stage.inquiry.fields.END_DATE,placeholder:h.client.stage.inquiry.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.inquiryEndDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.inquiryEndDate"}},{text:{label:h.client.stage.inquiry.fields.DURATION,placeholder:h.client.stage.inquiry.fields.placeholder.DURATION,value:e?.phases?.management.inquiryStartDate&&e?.phases?.management.inquiryEndDate?sa({startDate:e?.phases?.management.inquiryStartDate??"",endDate:e?.phases?.management.inquiryEndDate??""}):"",sourcePath:"clientData.phases.management.inquiryStartDate"}},{dateOnly:{isDisabled:c,label:h.client.stage.inquiry.fields.CRIMINAL_CASE_OPENING_DATE,placeholder:h.client.stage.inquiry.fields.placeholder.CRIMINAL_CASE_OPENING_DATE,value:n.criminalCaseOpeningDate,externalValue:u?.criminalCaseOpeningDate,commitDataPath:["inquiry","criminalCaseOpeningDate"],patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"criminalCaseOpeningDate"}}}]},{title:h.client.stage.inquiry.titles.INVESTIGATOR_DATA,rows:[{input:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_LAST_NAME,value:n.investigatorLastName,externalValue:u?.investigatorLastName,commitDataPath:["inquiry","investigatorLastName"],placeholder:h.client.stage.inquiry.fields.placeholder.INVESTIGATOR_LAST_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorLastName"}}},{input:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_FIRST_NAME,value:n.investigatorFirstName,externalValue:u?.investigatorFirstName,commitDataPath:["inquiry","investigatorFirstName"],placeholder:h.client.stage.inquiry.fields.placeholder.INVESTIGATOR_FIRST_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorFirstName"}}},{input:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_MIDDLE_NAME,value:n.investigatorMiddleName,externalValue:u?.investigatorMiddleName,commitDataPath:["inquiry","investigatorMiddleName"],placeholder:h.client.stage.inquiry.fields.placeholder.INVESTIGATOR_MIDDLE_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorMiddleName"}}},{input:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_POSITION,value:n.investigatorPosition,externalValue:u?.investigatorPosition,commitDataPath:["inquiry","investigatorPosition"],placeholder:h.client.stage.inquiry.fields.placeholder.INVESTIGATOR_POSITION,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorPosition"}}},{input:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_RANK,value:n.investigatorRank,externalValue:u?.investigatorRank,commitDataPath:["inquiry","investigatorRank"],placeholder:h.client.stage.
854inquiry.fields.placeholder.INVESTIGATOR_RANK,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorRank"}}},{textarea:{isDisabled:c,label:h.client.stage.inquiry.fields.INVESTIGATOR_DEPARTMENT,value:n.investigatorDepartment,externalValue:u?.investigatorDepartment,commitDataPath:["inquiry","investigatorDepartment"],placeholder:h.client.stage.inquiry.fields.placeholder.INVESTIGATOR_DEPARTMENT,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"investigatorDepartment"}}}]},{rows:[{select:{isDisabled:c,label:h.client.stage.inquiry.fields.RESULT,value:n.result,externalValue:u?.result,commitDataPath:["inquiry","result"],placeholder:h.client.stage.inquiry.fields.placeholder.RESULT,enumKey:"inquiryResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","inquiry"],field:"result"}}}]}]}function Dre({clientData:e,criminalsString:t}){const n=e?.phases?.preliminaryInvestigation,{externalData:s,status:r,statusPrevious:i,objectToFabulize:o}=wt({clientId:e?.id}),c=l.useMemo(()=>!(r==="notStarted"||o?.type!=="preliminary_investigation"),[r,o]),u=l.useMemo(()=>!s||o?.type!=="preliminary_investigation"||r!=="awaitingChoice"&&!i?null:s,[r,s,i,o]);return!e||!n?[]:[{rows:[{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.CASE_NUMBER,value:n.caseNumber,externalValue:u?.caseNumber,commitDataPath:["preliminaryInvestigation","caseNumber"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.CASE_NUMBER,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"caseNumber"}}},{text:{label:h.client.stage.preliminaryInvestigation.fields.ARTICLES,placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.preliminaryInvestigation.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.preliminaryInvestigation.fields.START_DATE,placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.preliminaryInvestigationStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.preliminaryInvestigationStartDate"}},{text:{label:h.client.stage.preliminaryInvestigation.fields.END_DATE,placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.preliminaryInvestigationEndDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.preliminaryInvestigationEndDate"}},{text:{label:h.client.stage.preliminaryInvestigation.fields.DURATION,placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.DURATION,value:e?.phases?.management.preliminaryInvestigationStartDate&&e?.phases?.management.preliminaryInvestigationEndDate?sa({startDate:e?.phases?.management.preliminaryInvestigationStartDate??"",endDate:e?.phases?.management.preliminaryInvestigationEndDate??""}):"",sourcePath:"clientData.phases.management.preliminaryInvestigationStartDate"}},{dateOnly:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.CRIMINAL_CASE_OPENING_DATE,value:n.criminalCaseOpeningDate,externalValue:u?.criminalCaseOpeningDate,commitDataPath:["preliminaryInvestigation","criminalCaseOpeningDate"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.CRIMINAL_CASE_OPENING_DATE,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"criminalCaseOpeningDate"}}}]},{title:h.client.stage.preliminaryInvestigation.titles.INVESTIGATOR_DATA,rows:[{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_LAST_NAME,value:n.investigatorLastName,externalValue:u?.investigatorLastName,commitDataPath:["preliminaryInvestigation","investigatorLastName"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_LAST_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorLastName"}}},{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_FIRST_NAME,value:n.investigatorFirstName,externalValue:u?.investigatorFirstName,commitDataPath:["preliminaryInvestigation","investigatorFirstName"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_FIRST_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorFirstName"}}},{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_MIDDLE_NAME,value:n.investigatorMiddleName,externalValue:u?.investigatorMiddleName,commitDataPath:["preliminaryInvestigation","investigatorMiddleName"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_MIDDLE_NAME,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorMiddleName"}}},{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_POSITION,value:n.investigatorPosition,externalValue:u?.investigatorPosition,commitDataPath:["preliminaryInvestigation","investigatorPosition"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_POSITION,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorPosition"}}},{input:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_RANK,value:n.investigatorRank,externalValue:u?.investigatorRank,commitDataPath:["preliminaryInvestigation","investigatorRank"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_RANK,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorRank"}}},{textarea:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.INVESTIGATOR_DEPARTMENT,value:n.investigatorDepartment,externalValue:u?.investigatorDepartment,commitDataPath:["preliminaryInvestigation","investigatorDepartment"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.INVESTIGATOR_DEPARTMENT,maxLength:100,patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"investigatorDepartment"}}}]},{rows:[{select:{isDisabled:c,label:h.client.stage.preliminaryInvestigation.fields.RESULT,value:n.result,externalValue:u?.result,commitDataPath:["preliminaryInvestigation","result"],placeholder:h.client.stage.preliminaryInvestigation.fields.placeholder.RESULT,enumKe
854y:"preliminaryInvestigationResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","preliminary-investigation"],field:"result"}}}]}]}function kre({clientData:e,criminalsString:t}){const{catalogues:n}=kn(),s=n?.articles,{externalData:r,status:i,statusPrevious:o,objectToFabulize:c}=wt({clientId:e?.id}),u=l.useMemo(()=>!(i==="notStarted"||c?.type!=="court_first_instance"),[i,c]),d=l.useMemo(()=>!r||c?.type!=="court_first_instance"||i!=="awaitingChoice"&&!o?null:r,[i,r,o,c]),p=e?.phases?.courtFirstInstance,g=l.useMemo(()=>{const x=p?.preTrialMeasures??[];if(!d?.preTrialMeasures?.length)return x;const y=d.preTrialMeasures.map(S=>({...S,isExternal:!0})),I=y.map(S=>{const b=x.find(w=>w.id===S.id);return b||S});return[...x.filter(S=>!y.some(b=>b.id===S.id)),...I]},[p?.preTrialMeasures,d?.preTrialMeasures]),A=l.useMemo(()=>{const x=p?.sessions??[];if(!d?.sessions?.length)return x;const y=d.sessions.map(S=>({...S,isExternal:!0})),I=y.map(S=>{const b=x.find(w=>w.id===S.id);return b||S});return[...x.filter(S=>!y.some(b=>b.id===S.id)),...I]},[p?.sessions,d?.sessions]),E=l.useMemo(()=>{const x=p?.felonies??[];if(!d?.felonies?.length)return x;const y=d.felonies.map(S=>({...S,isExternal:!0})),I=y.map(S=>{const b=x.find(w=>w.id===S.id);return b||S});return[...x.filter(S=>!y.some(b=>b.id===S.id)),...I]},[p?.felonies,d?.felonies]);return!e||!p?[]:[{rows:[{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.CASE_NUMBER,value:p.caseNumber,externalValue:d?.caseNumber,commitDataPath:["courtFirstInstance","caseNumber"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.CASE_NUMBER,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"caseNumber"}}},{text:{label:h.client.stage.courtFirstInstance.fields.ARTICLES,placeholder:h.client.stage.courtFirstInstance.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.courtFirstInstance.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.courtFirstInstance.fields.START_DATE,placeholder:h.client.stage.courtFirstInstance.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.courtFirstInstanceStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.courtFirstInstanceStartDate"}},{text:{label:h.client.stage.courtFirstInstance.fields.END_DATE,placeholder:h.client.stage.courtFirstInstance.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.courtFirstInstanceEndDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.courtFirstInstanceEndDate"}},{text:{label:h.client.stage.courtFirstInstance.fields.DURATION,placeholder:h.client.stage.courtFirstInstance.fields.placeholder.DURATION,value:e?.phases?.management.courtFirstInstanceStartDate&&e?.phases?.management.courtFirstInstanceEndDate?sa({startDate:e?.phases?.management.courtFirstInstanceStartDate??"",endDate:e?.phases?.management.courtFirstInstanceEndDate??""}):"",sourcePath:"clientData.phases.management.courtFirstInstanceStartDate"}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.COURT_NAME,value:p.courtName,externalValue:d?.courtName,commitDataPath:["courtFirstInstance","courtName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.COURT_NAME,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"courtName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.JUDGE_LAST_NAME,value:p.judgeLastName,externalValue:d?.judgeLastName,commitDataPath:["courtFirstInstance","judgeLastName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.JUDGE_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"judgeLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.JUDGE_FIRST_NAME,value:p.judgeFirstName,externalValue:d?.judgeFirstName,commitDataPath:["courtFirstInstance","judgeFirstName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.JUDGE_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"judgeFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.JUDGE_MIDDLE_NAME,value:p.judgeMiddleName,externalValue:d?.judgeMiddleName,commitDataPath:["courtFirstInstance","judgeMiddleName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.JUDGE_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"judgeMiddleName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PROSECUTOR_LAST_NAME,value:p.prosecutorLastName,externalValue:d?.prosecutorLastName,commitDataPath:["courtFirstInstance","prosecutorLastName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PROSECUTOR_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"prosecutorLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PROSECUTOR_FIRST_NAME,value:p.prosecutorFirstName,externalValue:d?.prosecutorFirstName,commitDataPath:["courtFirstInstance","prosecutorFirstName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PROSECUTOR_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"prosecutorFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PROSECUTOR_MIDDLE_NAME,value:p.prosecutorMiddleName,externalValue:d?.prosecutorMiddleName,commitDataPath:["courtFirstInstance","prosecutorMiddleName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PROSECUTOR_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"prosecutorMiddleName"}}}]},{title:h.client.stage.courtFirstInstance.preTrialMeasure.titles.PRE_TRIAL_MEASURES,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures"],title:h.client.stage.courtFirstInstance.preTrialMeasure.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures"],title:h.client.stage.courtFirstInstance.preTrialMeasure.buttons.ADD},rowsGroups:g?.length?g.map((x,y)=>({title:`${h.client.stage.courtFirstInstance.preTrialMeasure.titles.PRE_TRIAL_MEASURE} ${y+1}`,isKebabMenuDisabled:u,isExternal:x.isExternal,commitDataPath:["courtFirstInstance","preTrialMeasures"],rowId:x.id,delete:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures",x.id??""],title:h.client.stage.courtFirstInstance.preTrialMeasure.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures"],title:h.client.stage.courtFirstInstance.preTrialMeasure.buttons.DUPLICATE},rows:[{select:{isDisabled:u,label:h.client.stage.courtFirstInstance.preTrialMeasure.fields.PRE_TRIAL_MEASURE_TYPE,value:x.preTrialMeasureType,placeholder:h.client.stage.courtFirstInstance.preTrialMeasure.fields.placeholder.PRE_TRIAL_MEASURE_TYPE,enumKey:"preTrialMeasureTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures",x.id??""],field:"preTrialMeasureType"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtFirstInstance.preTrialMeasure.fields.START_DATE,placeholder:h.client.stage.courtFirstInstance.preTrialMeasure.fields.placeholder.START_DATE,value:x.startDate,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures",x.id??""],field:"startDate"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtFirstInstance.preTrialMeasure.fields.END_DATE,placeholder:h.client.stage.courtFirstInstance.preTrialMeasure.fields.placeholder.END_DATE,value:x.endDate,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures",x.id??""],field:"endDate"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.preTrialMeasure.fields.CONDITIONS,value:x.conditions,placeholder:h.client.stage.courtFirstInstance.preTrialMeasure.fields.placeholder.CONDITIONS,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","pre-trial-measures",x.id??""],field:"conditions"}}}]})):[]},{title:h.client.stage.courtFirstInstance.felony.titles.FELONIES,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies"],title:h.client.stage.courtFirstInstance.felony.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies"],title:h.client.stage.courtFirstInstance.felony.buttons.ADD},rowsGroups:E?.length?E.map((x,y)=>({title:`${h.client.stage.courtFirstInstance.felony.titles.FELONY} ${y+1}`,isKebabMenuDisabled:u,isExternal:x.isExternal,commitDataPath:["courtFirstInstance","felonies"],rowId:x.id,delete:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies",x.id??""],title:h.client.stage.courtFirstInstance.felony.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies"],title:h.client.stage.courtFirstInstance.felony.buttons.DUPLICATE},rows:[{select:{isDisabled:u,label:h.client.stage.courtFirstInstance.felony.fields.ARTICLE,value:x.catalogueArticleId,placeholder:h.client.stage.courtFirstInstance.felony.fields.placeholder.ARTICLE,catalogue:"articles",patch:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies",x.id??""],field:"catalogueArticleId"}}},{text:{label:h.client.stage.courtFirstInstance.felony.fields.DESCRIPTION,placeholder:h.client.stage.courtFirstInstance.felony.fields.placeholder.DESCRIPTION,value:(()=>{const I=s?.find(v=>v.id===x.catalogueArticleId);return I?I.content:""})(),sourcePath:`clientData.phases.courtFirstInstance.felonies[${y}].catalogueArticleId`}},{checkbox:{isDisabled:u,label:h.client.stage.courtFirstInstance.felony.fields.IS_GUILTY,value:x.isGuilty,placeholder:h.client.stage.courtFirstInstance.felony.fields.placeholder.IS_GUILTY,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","felonies",x.id??""],field:"isGuilty"}}}]})):[]},{title:h.client.stage.courtFirstInstance.titles.PUNISHMENT,rows:[{textarea:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.CONCLUSION_DESCRIPTION,value:p.conclusionDescription,externalValue:d?.conclusionDescription,commitDataPath:["courtFirstInstance","conclusionDescription"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.CONCLUSION_DESCRIPTION,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"conclusionDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PUNISHMENT_TYPE,value:p.punishmentType,externalValue:d?.punishmentType,commitDataPath:["courtFirstInstance","punishmentType"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PUNISHMENT_TYPE,enumKey:"punishmentTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"punishmentType"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PUNISHMENT_DURATION,value:p.punishmentDuration,externalValue:d?.punishmentDuration,commitDataPath:["courtFirstInstance","punishmentDuration"],type:"days",placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PUNISHMENT_DURATION,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"punishmentDuration"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.MEASURE_START_DATE,value:p.measureStartDate,externalValue:d?.measureStartDate,commitDataPath:["courtFirstInstance","measureStartDate"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.MEASURE_START_DATE,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"measureStartDate"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.MEASURE_END_DATE,value:p.measureEndDate,externalValue:d?.measureEndDate,commitDataPath:["courtFirstInstance","measureEndDate"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.MEASURE_END_DATE,patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"measureEndDate"}}},{text:{label:h.client.stage.courtFirstInstance.fields.REMAINING_SENTENCE,placeholder:h.client.stage.courtFirstInstance.fields.placeholder.REMAINING_SENTENCE,value:p.measureStartDate&&p.measureEndDate?sa({startDate:p.measureStartDate,endD
854ate:p.measureEndDate,durationInDaysToSubtract:Number(p.punishmentDuration)||0}):"",sourcePath:"clientData.phases.courtFirstInstance.measureStartDate"}},{select:{isDisabled:u,label:h.client.stage.courtFirstInstance.fields.PENITENTIARY_TYPE,value:p.penitentiaryType,externalValue:d?.penitentiaryType,commitDataPath:["courtFirstInstance","penitentiaryType"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.PENITENTIARY_TYPE,enumKey:"penitentiaryTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-first-instance"],field:"penitentiaryType"}}}]},{title:h.client.stage.courtFirstInstance.session.titles.SESSIONS,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions"],title:h.client.stage.courtFirstInstance.session.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions"],title:h.client.stage.courtFirstInstance.session.buttons.ADD},rowsGroups:A?.length?A.map((x,y)=>({title:`${h.client.stage.courtFirstInstance.session.titles.SESSION} ${y+1}`,isKebabMenuDisabled:u,isExternal:x.isExternal,commitDataPath:["courtFirstInstance","sessions"],rowId:x.id,delete:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions",x.id??""],title:h.client.stage.courtFirstInstance.session.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions"],title:h.client.stage.courtFirstInstance.session.buttons.DUPLICATE},rows:[{dateOnly:{isDisabled:u,label:h.client.stage.courtFirstInstance.session.fields.SESSION_DATE,value:x.sessionDate,placeholder:h.client.stage.courtFirstInstance.session.fields.placeholder.SESSION_DATE,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions",x.id??""],field:"sessionDate"}}},{select:{isDisabled:u,label:h.client.stage.courtFirstInstance.session.fields.SESSION_STATUS,value:x.sessionStatus,placeholder:h.client.stage.courtFirstInstance.session.fields.placeholder.SESSION_STATUS,enumKey:"courtSessionStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions",x.id??""],field:"sessionStatus"}}},{input:{isDisabled:u,label:h.client.stage.courtFirstInstance.session.fields.DELAY_REASON,value:x.delayReason,placeholder:h.client.stage.courtFirstInstance.session.fields.placeholder.DELAY_REASON,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-first-instance","sessions",x.id??""],field:"delayReason"}}}]})):[]}]}function Ore({clientData:e,criminalsString:t}){const{catalogues:n}=kn(),s=n?.articles,{externalData:r,status:i,statusPrevious:o,objectToFabulize:c}=wt({clientId:e?.id}),u=l.useMemo(()=>!(i==="notStarted"||c?.type!=="court_second_instance"),[i,c]),d=l.useMemo(()=>!r||c?.type!=="court_second_instance"||i!=="awaitingChoice"&&!o?null:r,[i,r,o,c]),p=e?.phases?.courtSecondInstance,g=l.useMemo(()=>{const E=p?.sessions??[];if(!d?.sessions?.length)return E;const x=d.sessions.map(v=>({...v,isExternal:!0})),y=x.map(v=>{const S=E.find(b=>b.id===v.id);return S||v});return[...E.filter(v=>!x.some(S=>S.id===v.id)),...y]},[p?.sessions,d?.sessions]),A=l.useMemo(()=>{const E=p?.felonies??[];if(!d?.felonies?.length)return E;const x=d.felonies.map(v=>({...v,isExternal:!0})),y=x.map(v=>{const S=E.find(b=>b.id===v.id);return S||v});return[...E.filter(v=>!x.some(S=>S.id===v.id)),...y]},[p?.felonies,d?.felonies]);return!e||!p?[]:[{rows:[{text:{label:h.client.stage.courtSecondInstance.fields.ARTICLES,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.courtSecondInstance.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.courtSecondInstance.fields.START_DATE,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.courtSecondInstanceStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.courtSecondInstanceStartDate"}},{text:{label:h.client.stage.courtSecondInstance.fields.END_DATE,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.courtSecondInstanceEndDate??"",isWithTime:!1,isS
854hortMonth:!1}),sourcePath:"clientData.phases.management.courtSecondInstanceEndDate"}},{text:{label:h.client.stage.courtSecondInstance.fields.DURATION,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.DURATION,value:e?.phases?.management.courtSecondInstanceStartDate&&e?.phases?.management.courtSecondInstanceEndDate?sa({startDate:e?.phases?.management.courtSecondInstanceStartDate??"",endDate:e?.phases?.management.courtSecondInstanceEndDate??""}):"",sourcePath:"clientData.phases.management.courtSecondInstanceStartDate"}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_COURT_NAME,value:p.appealCourtName,externalValue:d?.appealCourtName,commitDataPath:["courtSecondInstance","appealCourtName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_COURT_NAME,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealCourtName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.JUDGE_LAST_NAME,value:p.judgeLastName,externalValue:d?.judgeLastName,commitDataPath:["courtSecondInstance","judgeLastName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.JUDGE_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"judgeLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.JUDGE_FIRST_NAME,value:p.judgeFirstName,externalValue:d?.judgeFirstName,commitDataPath:["courtSecondInstance","judgeFirstName"],placeholder:h.client.stage.courtFirstInstance.fields.placeholder.JUDGE_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"judgeFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.JUDGE_MIDDLE_NAME,value:p.judgeMiddleName,externalValue:d?.judgeMiddleName,commitDataPath:["courtSecondInstance","judgeMiddleName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.JUDGE_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"judgeMiddleName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPLICANT_LAST_NAME,value:p.applicantLastName,externalValue:d?.applicantLastName,commitDataPath:["courtSecondInstance","applicantLastName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPLICANT_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"applicantLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPLICANT_FIRST_NAME,value:p.applicantFirstName,externalValue:d?.applicantFirstName,commitDataPath:["courtSecondInstance","applicantFirstName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPLICANT_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"applicantFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPLICANT_MIDDLE_NAME,value:p.applicantMiddleName,externalValue:d?.applicantMiddleName,commitDataPath:["courtSecondInstance","applicantMiddleName"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPLICANT_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"applicantMiddleName"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPLICANT_CATEGORY,value:p.applicantCategory,externalValue:d?.applicantCategory,commitDataPath:["courtSecondInstance","applicantCategory"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPLICANT_CATEGORY,enumKey:"applicantCategories",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"applicantCategory"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPLICATION_DATE,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPLICATION_DATE,value:p.applicationDate,externalValue:d?.applicationDate,commitDataPath:["courtSecondInstance","applicationDate"],patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"applicationDate"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_GOAL,value:p.appealGoal,externalValue:d?.appealGoal,commitDataPath:["courtSecondInstance","appealGoal"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_GOAL,enumKey:"appealGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_PLEA_STATUS,value:p.appealPleaStatus,externalValue:d?.appealPleaStatus,commitDataPath:["courtSecondInstance","appealPleaStatus"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_PLEA_STATUS,enumKey:"appealPleaStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealPleaStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_PLEA_DETAILS,value:p.appealPleaDetail
854s,externalValue:d?.appealPleaDetails,commitDataPath:["courtSecondInstance","appealPleaDetails"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_PLEA_DETAILS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealPleaDetails"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_APPEAL_DOCUMENTS,value:p.appealDocuments,externalValue:d?.appealDocuments,commitDataPath:["courtSecondInstance","appealDocuments"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_APPEAL_DOCUMENTS,enumKey:"appealDocuments",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealAppealDocuments"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.APPEAL_APPEAL_GROUNDS,value:p.appealGrounds,externalValue:d?.appealGrounds,commitDataPath:["courtSecondInstance","appealGrounds"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.APPEAL_APPEAL_GROUNDS,enumKey:"appealGrounds",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"appealGrounds"}}}]},{title:h.client.stage.courtSecondInstance.titles.APPEAL_REQUEST,rows:[{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_GOAL,value:p.requestGoal,externalValue:d?.requestGoal,commitDataPath:["courtSecondInstance","requestGoal"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_GOAL,enumKey:"requestGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_RESULT,value:p.requestResult,externalValue:d?.requestResult,commitDataPath:["courtSecondInstance","requestResult"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_RESULT,enumKey:"requestResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestResult"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_ARGUMENT_DESCRIPTION,value:p.requestArgumentDescription,externalValue:d?.requestArgumentDescription,commitDataPath:["courtSecondInstance","requestArgumentDescription"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_ARGUMENT_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestArgumentDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_ARGUMENT_CONFIRMATION_STATUS,value:p.requestArgumentConfirmationStatus,externalValue:d?.requestArgumentConfirmationStatus,commitDataPath:["courtSecondInstance","requestArgumentConfirmationStatus"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_ARGUMENT_CONFIRMATION_STATUS,enumKey:"requestArgumentConfirmationStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestArgumentConfirmationStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_ARGUMENT_LEGAL_BASIS,value:p.requestArgumentLegalBasis,externalValue:d?.requestArgumentLegalBasis,commitDataPath:["courtSecondInstance","requestArgumentLegalBasis"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_ARGUMENT_LEGAL_BASIS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestArgumentLegalBasis"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_ARGUMENT_GOAL,value:p.requestArgumentGoal,externalValue:d?.requestArgumentGoal,commitDataPath:["courtSecondInstance","requestArgumentGoal"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_ARGUMENT_GOAL,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestArgumentGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.REQUEST_ARGUMENT_RESULT,value:p.requestArgumentResult,externalValue:d?.requestArgumentResult,commitDataPath:["courtSecondInstance","requestArgumentResult"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REQUEST_ARGUMENT_RESULT,enumKe
854y:"requestArgumentResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"requestArgumentResult"}}}]},{title:h.client.stage.courtSecondInstance.titles.OPPOSITE_REQUEST,rows:[{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_GOAL,value:p.oppositeRequestGoal,externalValue:d?.oppositeRequestGoal,commitDataPath:["courtSecondInstance","oppositeRequestGoal"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_GOAL,enumKey:"requestGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_RESULT,value:p.oppositeRequestResult,externalValue:d?.oppositeRequestResult,commitDataPath:["courtSecondInstance","oppositeRequestResult"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_RESULT,enumKey:"requestResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestResult"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION,value:p.oppositeRequestArgumentDescription,externalValue:d?.oppositeRequestArgumentDescription,commitDataPath:["courtSecondInstance","oppositeRequestArgumentDescription"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestArgumentDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS,value:p.oppositeRequestArgumentConfirmationStatus,externalValue:d?.oppositeRequestArgumentConfirmationStatus,commitDataPath:["courtSecondInstance","oppositeRequestArgumentConfirmationStatus"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS,enumKey:"requestArgumentConfirmationStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestArgumentConfirmationStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS,value:p.oppositeRequestArgumentLegalBasis,externalValue:d?.oppositeRequestArgumentLegalBasis,commitDataPath:["courtSecondInstance","oppositeRequestArgumentLegalBasis"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestArgumentLegalBasis"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_ARGUMENT_GOAL,value:p.oppositeRequestArgumentGoal,externalValue:d?.oppositeRequestArgumentGoal,commitDataPath:["courtSecondInstance","oppositeRequestArgumentGoal"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_GOAL,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestArgumentGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.OPPOSITE_REQUEST_ARGUMENT_RESULT,value:p.oppositeRequestArgumentResult,externalValue:d?.oppositeRequestArgumentResult,commitDataPath:["courtSecondInstance","oppositeRequestArgumentResult"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_RESULT,enumKey:"requestArgumentResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"oppositeRequestArgumentResult"}}}]},{title:h.client.stage.courtSecondInstance.felony.titles.FELONIES,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies"],title:h.client.stage.courtSecondInstance.felony.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies"],title:h.client.stage.courtSecondInstance.felony.buttons.ADD},rowsGroups:A?.length?A.map((E,x)=>({title:`${h.client.stage.courtSecondInstance.felony.titles.FELONY} ${x+1}`,isKebabMenuDisabled:u,isExternal:E.isExternal,commitDataPath:["courtSecondInstance","felonies"],rowId:E.id,delete:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies",E.id??""],title:h.client.stage.courtSecondInstance.felony.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies"],title:h.client.stage.courtSecondInstance.felony.buttons.DUPLICATE},rows:[{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.felony.fields.ARTICLE,value:E.catalogueArticleId,placeholder:h.client.stage.courtSecondInstance.felony.fields.placeholder.ARTICLE,catalogue:"articles",patch:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies",E.id??""],field:"catalogueArticleId"}}},{text:{label:h.client.stage.courtSecondInstance.felony.fields.DESCRIPTION,placeholder:h.client.stage.courtSecondInstance.felony.fields.placeholder.DESCRIPTION,value:(()=>{const y=s?.find(I=>I.id===E.catalogueArticleId);return y?y.content:""})(),sourcePath:`clientData.phases.courtSecondInstance.felonies[${x}].catalogueArticleId`}},{checkbox:{isDisabled:u,label:h.client.stage.courtSecondInstance.felony.fields.IS_GUILTY,value:E.isGuilty,placeholder:h.client.stage.courtSecondInstance.felony.fields.placeholder.IS_GUILTY,patch:{endpoint:["clients","{clientId}","phases","court-second-instance","felonies",E.id??""],field:"isGuilty"}}}]})):[]},{title:h.client.stage.courtSecondInstance.titles.CONCLUSIONS,rows:[{checkbox:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.IS_CONVICTED,value:p.isConv
854icted,externalValue:d?.isConvicted,commitDataPath:["courtSecondInstance","isConvicted"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.IS_CONVICTED,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"isConvicted"}}},{textarea:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.PUNISHMENT_DESCRIPTION,value:p.punishmentDescription,externalValue:d?.punishmentDescription,commitDataPath:["courtSecondInstance","punishmentDescription"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.PUNISHMENT_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"punishmentDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.PUNISHMENT_TYPE,value:p.punishmentType,externalValue:d?.punishmentType,commitDataPath:["courtSecondInstance","punishmentType"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.PUNISHMENT_TYPE,enumKey:"punishmentTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"punishmentType"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.PUNISHMENT_APPEAL_DATE,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.PUNISHMENT_APPEAL_DATE,value:p.punishmentAppealDate,externalValue:d?.punishmentAppealDate,commitDataPath:["courtSecondInstance","punishmentAppealDate"],patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"punishmentAppealDate"}}},{checkbox:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.IS_FINAL_SENTENCING,value:p.isFinalSentencing,externalValue:d?.isFinalSentencing,commitDataPath:["courtSecondInstance","isFinalSentencing"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.IS_FINAL_SENTENCING,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"isFinalSentencing"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.PUNISHMENT_DURATION,value:p.punishmentDuration,externalValue:d?.punishmentDuration,commitDataPath:["courtSecondInstance","punishmentDuration"],type:"days",placeholder:h.client.stage.courtSecondInstance.fields.placeholder.PUNISHMENT_DURATION,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"punishmentDuration"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.MEASURE_START_DATE,value:p.measureStartDate,externalValue:d?.measureStartDate,commitDataPath:["courtSecondInstance","measureStartDate"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.MEASURE_START_DATE,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"measureStartDate"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.MEASURE_END_DATE,value:p.measureEndDate,externalValue:d?.measureEndDate,commitDataPath:["courtSecondInstance","measureEndDate"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.MEASURE_END_DATE,patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"measureEndDate"}}},{text:{label:h.client.stage.courtSecondInstance.fields.REMAINING_SENTENCE,placeholder:h.client.stage.courtSecondInstance.fields.placeholder.REMAINING_SENTENCE,value:p.measureStartDate&&p.measureEndDate?sa({startDate:p.measureStartDate,endDate:p.measureEndDate,durationInDaysToSubtract:Number(p.punishmentDuration)||0}):"",sourcePath:"clientData.phases.courtSecondInstance.measureStartDate"}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.fields.PENITENTIARY_TYPE,value:p.penitentiaryType,externalValue:d?.penitentiaryType,commitDataPath:["courtSecondInstance","penitentiaryType"],placeholder:h.client.stage.courtSecondInstance.fields.placeholder.PENITENTIARY_TYPE,enumKey:"penitentiaryTypes",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance"],field:"penitentiaryType"}}}]},{title:h.client.stage.courtSecondInstance.session.titles.SESSIONS,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions"],title:h.client.stage.courtSecondInstance.session.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions"],title:h.client.stage.courtSecondInstance.session.buttons.ADD},rowsGroups:g?.length?g.map((E,x)=>({title:`${h.client.stage.courtSecondInstance.session.titles.SESSION} ${x+1}`,isKebabMenuDisabled:u,isExternal:E.isExternal,commitDataPath:["courtSecondInstance","sessions"],rowId:E.id,delete:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions",E.id??""],title:h.client.stage.courtSecondInstance.session.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions"],title:h.client.stage.courtSecondInstance.session.buttons.DUPLICATE},rows:[{dateOnly:{isDisabled:u,label:h.client.stage.courtSecondInstance.session.fields.SESSION_DATE,value:E.sessionDate,placeholder:h.client.stage.courtSecondInstance.session.fields.placeholder.SESSION_DATE,patch:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions",E.id??""],field:"sessionDate"}}},{select:{isDisabled:u,label:h.client.stage.courtSecondInstance.session.fields.SESSION_STATUS,value:E.sessionStatus,placeholder:h.client.stage.courtSecondInstance.session.fields.placeholder.SESSION_STATUS,enumKey:"courtSessionStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions",E.id??""],field:"sessionStatus"}}},{input:{isDisabled:u,label:h.client.stage.courtSecondInstance.session.fields.DELAY_REASON,value:E.delayReason,placeholder:h.client.stage.courtSecondInstance.session.fields.placeholder.DELAY_REASON,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-second-instance","sessions",E.id??""],field:"delayReason"}}}]})):[]}]}function Pre({clientData:e,criminalsString:t}){const{catalogues:n}=kn(),s=n?.articles,{externalData:r,status:i,statusPrevious:o,objectToFabulize:c}=wt({clientId:e?.id}),u=l.useMemo(()=>!(i==="notStarted"||c?.type!=="court_third_instance"),[i,c]),d=l.useMemo(()=>!r||c?.type!=="court_third_instance"||i!=="awaitingChoice"&&!o?null:r,[i,r,o,c]),p=e?.phases?.courtThirdInstance,g=l.useMemo(()=>{const E=p?.sessions??[];if(!d?.sessions?.length)return E;const x=d.sessions.map(v=>({...v,isExternal:!0})),y=x.map(v=>{const S=E.find(b=>b.id===v.id);return S||v});return[...E.filter(v=>!x.some(S=>S.id===v.id)),...y]},[p?.sessions,d?.sessions]),A=l.useMemo(()=>{const E=p?.felonies??[];if(!d?.felonies?.length)return E;
854const x=d.felonies.map(v=>({...v,isExternal:!0})),y=x.map(v=>{const S=E.find(b=>b.id===v.id);return S||v});return[...E.filter(v=>!x.some(S=>S.id===v.id)),...y]},[p?.felonies,d?.felonies]);return!e||!p?[]:[{rows:[{text:{label:h.client.stage.courtThirdInstance.fields.ARTICLES,placeholder:h.client.stage.courtThirdInstance.fields.placeholder.ARTICLES,value:t,sourcePath:"clientData.phases.courtThirdInstance.felonies[0].catalogueArticleId"}},{text:{label:h.client.stage.courtThirdInstance.fields.START_DATE,placeholder:h.client.stage.courtThirdInstance.fields.placeholder.START_DATE,value:Kt({dateString:e?.phases?.management.courtThirdInstanceStartDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.courtThirdInstanceStartDate"}},{text:{label:h.client.stage.courtThirdInstance.fields.END_DATE,placeholder:h.client.stage.courtThirdInstance.fields.placeholder.END_DATE,value:Kt({dateString:e?.phases?.management.courtThirdInstanceEndDate??"",isWithTime:!1,isShortMonth:!1}),sourcePath:"clientData.phases.management.courtThirdInstanceEndDate"}},{text:{label:h.client.stage.courtThirdInstance.fields.DURATION,placeholder:h.client.stage.courtThirdInstance.fields.placeholder.DURATION,value:e?.phases?.management.courtThirdInstanceStartDate&&e?.phases?.management.courtThirdInstanceEndDate?sa({startDate:e?.phases?.management.courtThirdInstanceStartDate??"",endDate:e?.phases?.management.courtThirdInstanceEndDate??""}):"",sourcePath:"clientData.phases.management.courtThirdInstanceStartDate"}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_COURT_NAME,value:p.cassationCourtName,externalValue:d?.cassationCourtName,commitDataPath:["courtThirdInstance","cassationCourtName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_COURT_NAME,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationCourtName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.JUDGE_LAST_NAME,value:p.judgeLastName,externalValue:d?.judgeLastName,commitDataPath:["courtThirdInstance","judgeLastName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.JUDGE_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"judgeLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.JUDGE_FIRST_NAME,value:p.judgeFirstName,externalValue:d?.judgeFirstName,commitDataPath:["courtThirdInstance","judgeFirstName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.JUDGE_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"judgeFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.JUDGE_MIDDLE_NAME,value:p.judgeMiddleName,externalValue:d?.judgeMiddleName,commitDataPath:["courtThirdInstance","judgeMiddleName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.JUDGE_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"judgeMiddleName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.APPLICANT_LAST_NAME,value:p.applicantLastName,externalValue:d?.applicantLastName,commitDataPath:["courtThirdInstance","applicantLastName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.APPLICANT_LAST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"applicantLastName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.APPLICANT_FIRST_NAME,value:p.applicantFirstName,externalValue:d?.applicantFirstName,commitDataPath:["courtThirdInstance","applicantFirstName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.APPLICANT_FIRST_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"applicantFirstName"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.APPLICANT_MIDDLE_NAME,value:p.applicantMiddleName,externalValue:d?.applicantMiddleName,commitDataPath:["courtThirdInstance","applicantMiddleName"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.APPLICANT_MIDDLE_NAME,maxLength:50,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"applicantMiddleName"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.APPLICANT_CATEGORY,value:p.applicantCategory,externalValue:d?.applicantCategory,commitDataPath:["courtThirdInstance","applicantCategory"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.APPLICANT_CATEGORY,enumKe
854y:"cassationApplicantCategories",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"applicantCategory"}}},{dateOnly:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.APPLICATION_DATE,placeholder:h.client.stage.courtThirdInstance.fields.placeholder.APPLICATION_DATE,value:p.applicationDate,externalValue:d?.applicationDate,commitDataPath:["courtThirdInstance","applicationDate"],patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"applicationDate"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_GOAL,value:p.cassationGoal,externalValue:d?.cassationGoal,commitDataPath:["courtThirdInstance","cassationGoal"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_GOAL,enumKey:"cassationGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_PLEA_STATUS,value:p.cassationPleaStatus,externalValue:d?.cassationPleaStatus,commitDataPath:["courtThirdInstance","cassationPleaStatus"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_PLEA_STATUS,enumKey:"cassationPleaStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationPleaStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_PLEA_DETAILS,value:p.cassationPleaDetails,externalValue:d?.cassationPleaDetails,commitDataPath:["courtThirdInstance","cassationPleaDetails"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_PLEA_DETAILS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationPleaDetails"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_DOCUMENTS,value:p.cassationDocuments,externalValue:d?.cassationDocuments,commitDataPath:["courtThirdInstance","cassationDocuments"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_DOCUMENTS,enumKey:"cassationDocuments",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationDocuments"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_GROUNDS,value:p.cassationGrounds,externalValue:d?.cassationGrounds,commitDataPath:["courtThirdInstance","cassationGrounds"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_GROUNDS,enumKey:"cassationGrounds",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationGrounds"}}}]},{title:h.client.stage.courtThirdInstance.titles.CASSATION_REQUEST,rows:[{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_GOAL,value:p.requestGoal,externalValue:d?.requestGoal,commitDataPath:["courtThirdInstance","requestGoal"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_GOAL,enumKey:"requestGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_RESULT,value:p.requestResult,externalValue:d?.requestResult,commitDataPath:["courtThirdInstance","requestResult"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_RESULT,enumKey:"cassationRequestResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestResult"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_ARGUMENT_DESCRIPTION,value:p.requestArgumentDescription,externalValue:d?.requestArgumentDescription,commitDataPath:["courtThirdInstance","requestArgumentDescription"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_ARGUMENT_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestArgumentDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_ARGUMENT_CONFIRMATION_
854STATUS,value:p.requestArgumentConfirmationStatus,externalValue:d?.requestArgumentConfirmationStatus,commitDataPath:["courtThirdInstance","requestArgumentConfirmationStatus"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_ARGUMENT_CONFIRMATION_STATUS,enumKey:"requestArgumentConfirmationStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestArgumentConfirmationStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_ARGUMENT_LEGAL_BASIS,value:p.requestArgumentLegalBasis,externalValue:d?.requestArgumentLegalBasis,commitDataPath:["courtThirdInstance","requestArgumentLegalBasis"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_ARGUMENT_LEGAL_BASIS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestArgumentLegalBasis"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_ARGUMENT_GOAL,value:p.requestArgumentGoal,externalValue:d?.requestArgumentGoal,commitDataPath:["courtThirdInstance","requestArgumentGoal"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_ARGUMENT_GOAL,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestArgumentGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.REQUEST_ARGUMENT_RESULT,value:p.requestArgumentResult,externalValue:d?.requestArgumentResult,commitDataPath:["courtThirdInstance","requestArgumentResult"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.REQUEST_ARGUMENT_RESULT,enumKey:"requestArgumentResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"requestArgumentResult"}}}]},{title:h.client.stage.courtThirdInstance.titles.OPPOSITE_REQUEST,rows:[{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_GOAL,value:p.oppositeRequestGoal,externalValue:d?.oppositeRequestGoal,commitDataPath:["courtThirdInstance","oppositeRequestGoal"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_GOAL,enumKey:"requestGoals",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_RESULT,value:p.oppositeRequestResult,externalValue:d?.oppositeRequestResult,commitDataPath:["courtThirdInstance","oppositeRequestResult"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_RESULT,enumKey:"requestResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestResult"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION,value:p.oppositeRequestArgumentDescription,externalValue:d?.oppositeRequestArgumentDescription,commitDataPath:["courtThirdInstance","oppositeRequestArgumentDescription"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestArgumentDescription"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS,value:p.oppositeRequestArgumentConfirmationStatus,externalValue:d?.oppositeRequestArgumentConfirmationStatus,commitDataPath:["courtThirdInstance","oppositeRequestArgumentConfirmationStatus"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_CONFIRMATION_STATUS,enumKey:"requestArgumentConfirmationStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestArgumentConfirmationStatus"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS,value:p.oppositeRequestArgumentLegalBasis,externalValue:d?.oppositeRequestArgumentLegalBasis,commitDataPath:["courtThirdInstance","oppositeRequestArgumentLegalBasis"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_LEGAL_BASIS,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestArgumentLegalBasis"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_ARGUMENT_GOAL,value:p.oppositeRequestArgumentGoal,externalValue:d?.oppositeRequestArgumentGoal,commitDataPath:["courtThirdInstance","oppositeRequestArgumentGoal"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_GOAL,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestArgumentGoal"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.OPPOSITE_REQUEST_ARGUMENT_RESULT,value:p.oppositeRequestArgumentResult,externalValue:d?.oppositeRequestArgumentResult,commitDataPath:["courtThirdInstance","oppositeRequestArgumentResult"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.OPPOSITE_REQUEST_ARGUMENT_RESULT,enumKe
854y:"requestArgumentResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"oppositeRequestArgumentResult"}}}]},{title:h.client.stage.courtThirdInstance.felony.titles.FELONIES,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies"],title:h.client.stage.courtThirdInstance.felony.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies"],title:h.client.stage.courtThirdInstance.felony.buttons.ADD},rowsGroups:A?.length?A.map((E,x)=>({title:`${h.client.stage.courtThirdInstance.felony.titles.FELONY} ${x+1}`,isKebabMenuDisabled:u,isExternal:E.isExternal,commitDataPath:["courtThirdInstance","felonies"],rowId:E.id,delete:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies",E.id??""],title:h.client.stage.courtThirdInstance.felony.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies"],title:h.client.stage.courtThirdInstance.felony.buttons.DUPLICATE},rows:[{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.felony.fields.ARTICLE,value:E.catalogueArticleId,placeholder:h.client.stage.courtThirdInstance.felony.fields.placeholder.ARTICLE,catalogue:"articles",patch:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies",E.id??""],field:"catalogueArticleId"}}},{text:{label:h.client.stage.courtThirdInstance.felony.fields.DESCRIPTION,placeholder:h.client.stage.courtThirdInstance.felony.fields.placeholder.DESCRIPTION,value:(()=>{const y=s?.find(I=>I.id===E.catalogueArticleId);return y?y.content:""})(),sourcePath:`clientData.phases.courtThirdInstance.felonies[${x}].catalogueArticleId`}},{checkbox:{isDisabled:u,label:h.client.stage.courtThirdInstance.felony.fields.IS_GUILTY,value:E.isGuilty,placeholder:h.client.stage.courtThirdInstance.felony.fields.placeholder.IS_GUILTY,patch:{endpoint:["clients","{clientId}","phases","court-third-instance","felonies",E.id??""],field:"isGuilty"}}}]})):[]},{title:h.client.stage.courtThirdInstance.titles.RESULTS,rows:[{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_SATISFACTION_STATUS,value:p.cassationSatisfactionStatus,externalValue:d?.cassationSatisfactionStatus,commitDataPath:["courtThirdInstance","cassationSatisfactionStatus"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_SATISFACTION_STATUS,enumKey:"satisfactionStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationSatisfactionStatus"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_RESULT,value:p.cassationResult,externalValue:d?.cassationResult,commitDataPath:["courtThirdInstance","cassationResult"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_RESULT,enumKey:"cassationRequestResults",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationResult"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_RESULT_MOTIVES,value:p.cassationResultMotives,externalValue:d?.cassationResultMotives,commitDataPath:["courtThirdInstance","cassationResultMotives"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_RESULT_MOTIVES,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationResultMotives"}}},{textarea:{isDisabled:u,label:h.client.stage.courtThirdInstance.fields.CASSATION_DESCRIPTION,value:p.cassationDescription,externalValue:d?.cassationDescription,commitDataPath:["courtThirdInstance","cassationDescription"],placeholder:h.client.stage.courtThirdInstance.fields.placeholder.CASSATION_DESCRIPTION,maxLength:500,patch:{endpoint:["clients","{clientId}","phases","court-third-instance"],field:"cassationDescription"}}}]},{title:h.client.stage.courtThirdInstance.session.titles.SESSIONS,isKebabMenuDisabled:u,deleteAll:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions"],title:h.client.stage.courtThirdInstance.session.buttons.DELETE_ALL},post:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions"],title:h.client.stage.courtThirdInstance.session.buttons.ADD},rowsGroups:g?.length?g.map((E,x)=>({title:`${h.client.stage.courtThirdInstance.session.titles.SESSION} ${x+1}`,isKebabMenuDisabled:u,isExternal:E.isExternal,commitDataPath:["courtThirdInstance","sessions"],rowId:E.id,delete:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions",E.id??""],title:h.client.stage.courtThirdInstance.session.buttons.DELETE},post:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions"],title:h.client.stage.courtThirdInstance.session.buttons.DUPLICATE},rows:[{dateOnly:{isDisabled:u,label:h.client.stage.courtThirdInstance.session.fields.SESSION_DATE,value:E.sessionDate,placeholder:h.client.stage.courtThirdInstance.session.fields.placeholder.SESSION_DATE,patch:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions",E.id??""],field:"sessionDate"}}},{select:{isDisabled:u,label:h.client.stage.courtThirdInstance.session.fields.SESSION_STATUS,value:E.sessionStatus,placeholder:h.client.stage.courtThirdInstance.session.fields.placeholder.SESSION_STATUS,enumKey:"courtSessionStatuses",catalogue:"enums",patch:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions",E.id??""],field:"sessionStatus"}}},{input:{isDisabled:u,label:h.client.stage.courtThirdInstance.session.fields.DELAY_REASON,value:E.delayReason,placeholder:h.client.stage.courtThirdInstance.session.fields.placeholder.DELAY_REASON,maxLength:255,patch:{endpoint:["clients","{clientId}","phases","court-third-instance","sessions",E.id??""],field:"delayReason"}}}]})):[]}]}function Lre({clientData:e,criminalsString:t}){return[]}function Mre(){const{clientData:e,isSuccess:t}=zt(),{stageId:n}=st(),s=230,r=l.useMemo(()=>["pre-investigation-check","inquiry","preliminary-investigation","court-first-instance","court-second-instance","court-third-instance","court-final-instance"],[]),i=e?.phases?.management,o=l.useMemo(()=>{const v=r.map((S,b)=>{const w=ho(S),_=`${w}StartDate`,N=`${w}EndDate`,R=i?.[_]??null,D=i?.[N]??null,k=r.reduce((P,B,F)=>{if(F<=b)return P;const Q=`${ho(B)}StartDate`;return i?.[Q]?!0:P},!1),L=(()=>
854{if(["inquiry","preliminaryInvestigation"].includes(w)){if(!i)return"notStarted";const P=`skip${w.charAt(0).toUpperCase()+w.slice(1)}`;if(i[P])return"skipped"}return R?D||k?"finished":"active":"notStarted"})(),O=!!D&&!k;return{id:S,title:h.client.stage.stages[UA(S)],startDate:R,endDate:D,status:L,canResume:O}});return v.map((S,b)=>({...S,nextStageStatus:v?.[b+1]?.status??void 0}))},[r,i]),c=l.useMemo(()=>{if(!t)return null;const v=n??r[0],S=ho(v),b=i?i[`${S}StartDate`]:null,w=i?i[`${S}EndDate`]:null;return{id:v,clientDataKey:S,title:h.client.stage.stages[UA(v)],startDate:b,endDate:w}},[r,i,n,t]),u=l.useMemo(()=>e?.episodesArticles?e.episodesArticles.map(({part:v,number:S,clause:b})=>et({clause:b,part:v,number:S})).sort((v,S)=>v.localeCompare(S)).join(", "):"",[e]),d=wre({clientData:e,criminalsString:u}),p=Rre({clientData:e,criminalsString:u}),g=Dre({clientData:e,criminalsString:u}),A=kre({clientData:e,criminalsString:u}),E=Ore({clientData:e,criminalsString:u}),x=Pre({clientData:e,criminalsString:u}),y=Lre({clientData:e,criminalsString:u}),I=l.useMemo(()=>c?.id==="pre-investigation-check"?d:c?.id==="inquiry"?p:c?.id==="preliminary-investigation"?g:c?.id==="court-first-instance"?A:c?.id==="court-second-instance"?E:c?.id==="court-third-instance"?x:y,[c,d,p,g,A,E,x,y]);return{clientData:e,isSuccess:t,stageInfoCards:o,currentStageManagementData:c,propertyCards:I,scrollOffset:s}}const KA=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17866_8783)"},l.createElement("path",{d:"M3.33594 5.83333H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M8.33594 9.16667V14.1667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.6641 9.16667V14.1667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M4.16406 5.83333L4.9974 15.8333C4.9974 16.2754 5.17299 16.6993 5.48555 17.0118C5.79811 17.3244 6.22204 17.5 6.66406 17.5H13.3307C13.7728 17.5 14.1967 17.3244 14.5092 17.0118C14.8218 16.6993 14.9974 16.2754 14.9974 15.8333L15.8307 5.83333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M7.5 5.83333V3.33333C7.5 3.11232 7.5878 2.90036 7.74408 2.74408C7.90036 2.5878 8.11232 2.5 8.33333 2.5H11.6667C11.8877 2.5 12.0996 2.5878 12.2559 2.74408C12.4122 2.90036 12.5 3.11232 12.5 3.33333V5.83333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17866_8783"},l.createElement("rect",{width:20,height:20,fill:"white"})))),jre=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_15523_24491)"},l.createElement("path",{d:"M14.166 4.1665H5.83268C4.91221 4.1665 4.16602 4.9127 4.16602 5.83317V14.1665C4.16602 15.087 4.91221 15.8332 5.83268 15.8332H14.166C15.0865 15.8332 15.8327 15.087 15.8327 14.1665V5.83317C15.8327 4.9127 15.0865 4.1665 14.166 4.1665Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_15523_24491"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Bre=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_15523_4026)"},l.createElement("path",{d:"M2.5 4.1665V15.8332L9.16667 9.99984L2.5 4.1665Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.666 4.1665V15.8332L18.3327 9.99984L11.666 4.1665Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_15523_4026"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Fre=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_15523_12079)"},l.createElement("path",{d:"M3.33398 4.1665V15.8332L13.334 9.99984L3.33398 4.1665Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M16.666 4.1665V15.8332",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_15523_12079"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Ure=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_15523_7909)"},l.createElement("path",{d:"M5.83398 3.3335V16.6668L16.6673 10.0002L5.83398 3.3335Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_15523_7909"},l.createElement("rect",{width:20,height:20,fill:"white"}
854)))),zre={finished:h.client.stage.phasesManagement.statuses.FINISHED,notStarted:h.client.stage.phasesManagement.statuses.NOT_STARTED,skipped:h.client.stage.phasesManagement.statuses.SKIPPED},Qre=({stageInfoCard:e,onUpdateStartDate:t,onUpdateEndDate:n,onTrash:s,onComplete:r,onSkip:i,onResume:o,onNextStage:c})=>{const{id:u,title:d,startDate:p,endDate:g,status:A,nextStageStatus:E,isSkippable:x,canResume:y}=e,I=l.useMemo(()=>{if(!p)return null;try{return Fs(p,"yyyy-MM-dd",new Date)}catch{return null}},[p]),v=l.useMemo(()=>{if(!g)return null;try{return Fs(g,"yyyy-MM-dd",new Date)}catch{return null}},[g]),S=l.useRef(null),b=l.useRef(null),[w,_]=Oe.useState(()=>I),[N,R]=Oe.useState(()=>v);Oe.useEffect(()=>{_(I),R(v)},[I,v]);const D=Oe.useCallback(j=>{_(j),t?.({stageId:u,value:j?is(j,"yyyy-MM-dd"):null}),requestAnimationFrame(()=>{S.current?.blur()})},[u,t]),k=Oe.useCallback(j=>{R(j),n?.({stageId:u,value:j?is(j,"yyyy-MM-dd"):null}),requestAnimationFrame(()=>{b.current?.blur()})},[u,n]),L=Oe.useCallback(()=>{s?.({stageId:u})},[u,s]),O=Oe.useCallback(()=>{r?.({stageId:u})},[u,r]),P=Oe.useCallback(()=>{i?.({stageId:u})},[u,i]),B=Oe.useCallback(()=>{o?.({stageId:u})},[u,o]),F=Oe.useCallback(()=>{c?.({stageId:u})},[u,c]),z=l.useMemo(()=>w?lo({value:is(w,"yyyy-MM-dd")}):"",[w]),Q=l.useMemo(()=>N?lo({value:is(N,"yyyy-MM-dd")}):"",[N]),M=l.useMemo(()=>A!=="active"&&A!=="finished"?null:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-[92px]",children:a.jsx(QI,{ref:S,value:z,date:w,placeholder:h.client.stage.phasesManagement.labels.START,onSelectDate:D})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-zinc-400 text-[16px] leading-[20px] pr-3",children:"–"}),!!g&&a.jsx("div",{className:"w-[92px]",children:a.jsx(QI,{ref:b,value:Q,date:N,onSelectDate:k})}),!g&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:h.client.stage.phasesManagement.labels.CURRENT_TIME})]}),[A,w,N,g,z,Q,D,k]),K=l.useMemo(()=>A==="active"?a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"flex items-center",children:[!!(p&&u!=="preInvestigationCheck")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"cursor-pointer h-8 bp75:h-16 px-4 flex items-center",onClick:L,type:"button",children:a.jsx(KA,{className:"text-zinc-400 size-5"})}),a.jsx("div",{className:"h-[20px] w-px rounded-full bg-gray-200"})]}),a.jsxs("div",{className:"flex",children:[a.jsxs("button",{className:"flex gap-1 cursor-pointer h-8 bp75:h-16 pl-4 pr-3 last:pr-6 items-center",onClick:O,type:"button",children:[a.jsx(jre,{className:"text-zinc-400 size-5"}),a.jsx("div",{className:"roboto-flex-64-600-0 text-[14px] leading-[20px] text-zinc-800",children:h.client.stage.phasesManagement.buttons.COMPLETE})]}),!!x&&a.jsxs("button",{className:"flex gap-1 cursor-pointer h-8 bp75:h-16 items-center pl-3 pr-3 last:pr-6",onClick:P,type:"button",children:[a.jsx(Bre,{className:"text-zinc-400 size-5"}),a.jsx("div",{className:"roboto-flex-64-600-0 text-[14px] leading-[20px] text-zinc-800",children:h.client.stage.phasesManagement.buttons.SKIP})]}),u!=="courtFinalInstance"&&a.jsxs("button",{className:"flex gap-1 cursor-pointer h-8 bp75:h-16 items-center pl-3 pr-3 last:pr-6",onClick:F,type:"button",children:[a.jsx(Fre,{className:"text-zinc-400 size-5"}),a.jsx("div",{className:"roboto-flex-64-600-0 text-[14px] leading-[20px] text-zinc-800",children:h.client.stage.phasesManagement.buttons.NEXT_STAGE})]})]})]})}):A==="finished"&&y?a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"flex items-center",children:[u!=="preInvestigationCheck"&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"cursor-pointer h-8 bp75:h-16 px-4 flex items-center",onClick:L,type:"button",children:a.jsx(KA,{className:"text-zinc-400 size-5"})}),a.jsx("div",{className:"h-[20px] w-px rounded-full bg-gray-200"})]}),a.jsxs("button",{className:"flex gap-1 cursor-pointer h-8 bp75:h-16 pl-4 pr-6 items-center",onClick:B,type:"button",children:[a.jsx(Ure,{className:"text-zinc-400 size-5"}),a.jsx("div",{className:"roboto-flex-64-600-0 text-[14px] leading-[20px] text-zinc-800",children:h.client.stage.ph
854asesManagement.buttons.RESUME})]})]})}):a.jsx("div",{className:"flex items-center pr-6",children:a.jsx("div",{className:"px-1.5 py-[3px] text-zinc-600 roboto-flex-25-700-1 uppercase text-[12px] leading[14px] bg-zinc-100 rounded-full",children:zre[A]})}),[A,p,x,y,u,L,O,P,F,B]),W=l.useMemo(()=>a.jsx("div",{className:"flex justify-start w-6",children:a.jsxs("div",{className:"flex flex-col items-center justify-stretch w-3 h-full",children:[a.jsx("div",{className:Y("w-0.25 h-5 bp75:h-6",u!=="preInvestigationCheck"&&A!=="notStarted"&&"bg-zinc-200")}),a.jsx("div",{className:Y("flex items-center justify-center w-4 h-4 rounded-full",A==="finished"&&"bg-zinc-200",A==="active"&&(p?"bg-sky-200":"bg-zinc-200"),A==="notStarted"&&"bg-zinc-200",A==="skipped"&&"bg-zinc-200"),children:a.jsx("div",{className:Y("w-2 h-2 rounded-full",A==="finished"&&"bg-zinc-400",A==="active"&&(p?"bg-sky-500":"bg-white"),A==="notStarted"&&"bg-white",A==="skipped"&&"bg-white")})}),a.jsx("div",{className:Y("flex-1 w-0.25",u!=="courtFinalInstance"&&A!=="notStarted"&&E!=="notStarted"&&"bg-zinc-200")})]})}),[u,A,p,E]),H=l.useMemo(()=>a.jsxs("div",{className:Y("flex pl-4 justify-between flex-col bp75:flex-row",A==="active"&&"outline outline-solid outline-zinc-200 rounded-2xl",M?"flex-col":"flex-row"),children:[a.jsxs("div",{className:"flex",children:[W,a.jsxs("div",{className:"pl-1 pt-4 pb-4 bp75:pt-5 bp75:pb-5 w-full bp75:w-[380px]",children:[a.jsx("div",{className:Y("roboto-flex-100-600-1 text-[18px] leading-[24px] text-zinc-400 mb-2 bp75:mb-0",(A==="finished"||A==="active")&&"text-zinc-950"),children:d}),a.jsxs("div",{className:Y("flex-row items-center flex bp75:hidden w-full",M?"justify-between":"justify-end hidden"),children:[M,K]})]}),a.jsx("div",{className:"items-center py-4 pr-4 hidden bp75:flex",children:M})]}),a.jsx("div",{className:Y("items-center",!!M&&"hidden bp75:flex",!M&&"flex"),children:K})]}),[A,d,M,K,W]);return A==="notStarted"?a.jsx("div",{className:"block cursor-default",children:H}):a.jsx("div",{className:"block",children:H})},es=["preInvestigationCheck","inquiry","preliminaryInvestigation","courtFirstInstance","courtSecondInstance","courtThirdInstance","courtFinalInstance"],Hre={preInvestigationCheckStartDate:null,preInvestigationCheckEndDate:null,inquiryStartDate:null,inquiryEndDate:null,preliminaryInvestigationStartDate:null,preliminaryInvestigationEndDate:null,courtFirstInstanceStartDate:null,courtFirstInstanceEndDate:null,courtSecondInstanceStartDate:null,courtSecondInstanceEndDate:null,courtThirdInstanceStartDate:null,courtThirdInstanceEndDate:null,courtFinalInstanceStartDate:null,courtFinalInstanceEndDate:null,skipInquiry:!1,skipPreliminaryInvestigation:!1};function Vre(e){const t=l.useCallback(({managementEntity:S})=>S?{preInvestigationCheckStartDate:S.preInvestigationCheckStartDate??null,preInvestigationCheckEndDate:S.preInvestigationCheckEndDate??null,inquiryStartDate:S.inquiryStartDate??null,inquiryEndDate:S.inquiryEndDate??null,preliminaryInvestigationStartDate:S.preliminaryInvestigationStartDate??null,preliminaryInvestigationEndDate:S.preliminaryInvestigationEndDate??null,courtFirstInstanceStartDate:S.courtFirstInstanceStartDate??null,courtFirstInstanceEndDate:S.courtFirstInstanceEndDate??null,courtSecondInstanceStartDate:S.courtSecondInstanceStartDate??null,courtSecondInstanceEndDate:S.courtSecondInstanceEndDate??null,courtThirdInstanceStartDate:S.courtThirdInstanceStartDate??null,courtThirdInstanceEndDate:S.courtThirdInstanceEndDate??null,courtFinalInstanceStartDate:S.courtFinalInstanceStartDate??null,courtFinalInstanceEndDate:S.courtFinalInstanceEndDate??null,skipInquiry:S.skipInquiry??!1,skipPreliminaryInvestigation:S.skipPreliminaryInvestigation??!1}:Hre,[]),n=l.useCallback(({source:S,phaseId:b,dateType:w})=>{const _=`${b}${w==="start"?"Start":"End"}Date`,N=S[_];return typeof N=="string"?N:null},[]),s=l.useCallback(({payload:S,phaseId:b})=>b==="inquiry"?!!S.skipInquiry:b==="preliminaryInvestigation"?!!S.skipPreliminaryInvestigation:!1,[]),r=l.useCallback(({payload:S})=>{const b=es.map((w,_)=>{const N=n({source:S,phaseId:w,dateType:"start"}),R=n({source:S,phaseId:w,dateType:"end"}),D=es.some((P,B)=>{if(B<=_)return!1;const F=es[B];return s({payload:S,phaseId:F})?!1:!!n({source:S,phaseId:F,dateType:"start"})}),k=s({payload:S,phaseId:w})?"skipped":N?R?"finished":"active":_===0&&!D?"active":"notStarted",L=w==="inquiry"&&!S.skipInquiry||w==="preliminaryInvestigation"&&!S.skipPreliminaryInvestigation&&!S.skipInquiry,O=!!R&&!D;return{id:w,title:h.client.stage.stages[Y1(w)],startDate:N||null,endD
854ate:R||null,status:k,nextStageStatus:void 0,isSkippable:L,canResume:O}});return b.map((w,_)=>({...w,nextStageStatus:b[_+1]?.status}))},[n,s]),i=l.useCallback(({payload:S,stageId:b,updates:w})=>{const _=n({source:S,phaseId:b,dateType:"start"}),N=n({source:S,phaseId:b,dateType:"end"});let R=w.startDate!==void 0?w.startDate??null:_,D=w.endDate!==void 0?w.endDate??null:N;if(w.startDate!==void 0&&R&&D){const k=Fs(R,"yyyy-MM-dd",new Date),L=Fs(D,"yyyy-MM-dd",new Date);k>L&&(D=R)}if(w.endDate!==void 0&&D&&R){const k=Fs(D,"yyyy-MM-dd",new Date),L=Fs(R,"yyyy-MM-dd",new Date);k<L&&(R=D)}return{newStart:R,newEnd:D}},[n]),o=l.useCallback(({payload:S,stageId:b})=>{const w=es.indexOf(b);if(w<0||b==="preInvestigationCheck")return S;const _=es[w-1],N=s({payload:S,phaseId:_}),R={...S,[`${b}StartDate`]:null,[`${b}EndDate`]:null};if(N){_==="inquiry"&&(R.skipInquiry=!1),_==="preliminaryInvestigation"&&(R.skipPreliminaryInvestigation=!1);let D=null;for(let k=w-2;k>=0;k--){const L=es[k];if(!s({payload:S,phaseId:L})){D=n({source:S,phaseId:L,dateType:"end"});break}}R[`${_}StartDate`]=D?is(Wa(Fs(D,"yyyy-MM-dd",new Date),1),"yyyy-MM-dd"):null,R[`${_}EndDate`]=null}else R[`${_}EndDate`]=null;return R},[s,n]),c=l.useMemo(()=>t({managementEntity:e}),[e,t]),[u,d]=l.useState(c);l.useEffect(()=>{d(t({managementEntity:e}))},[e,t]);const p=l.useMemo(()=>JSON.stringify(u)!==JSON.stringify(c),[u,c]),g=l.useMemo(()=>r({payload:u}),[r,u]),A=l.useCallback(({stageId:S,updates:b})=>{const w=es.indexOf(S);w<0||d(_=>{const N={..._},{newStart:R,newEnd:D}=i({payload:_,stageId:S,updates:b});N[`${S}StartDate`]=R,N[`${S}EndDate`]=D;const k=R;for(let O=w-1;O>=0;O--){const P=es[O];if(s({payload:N,phaseId:P}))continue;if(!k)break;const B=n({source:N,phaseId:P,dateType:"start"}),F=n({source:N,phaseId:P,dateType:"end"}),z=F??B;if(!z)break;const Q=Fs(k,"yyyy-MM-dd",new Date);if(Fs(z,"yyyy-MM-dd",new Date)<=Q)break;if(F){if(N[`${P}EndDate`]=k,!B)break;const K=Fs(B,"yyyy-MM-dd",new Date);if(Q<K){N[`${P}StartDate`]=k;continue}break}N[`${P}StartDate`]=k}const L=D??R;for(let O=w+1;O<es.length;O++){const P=es[O];if(s({payload:N,phaseId:P}))continue;if(!L)break;const B=n({source:N,phaseId:P,dateType:"start"});if(!B)break;const F=Fs(L,"yyyy-MM-dd",new Date);if(Fs(B,"yyyy-MM-dd",new Date)>=F)break;N[`${P}StartDate`]=L;const Q=n({source:N,phaseId:P,dateType:"end"});if(!Q)continue;const M=Fs(Q,"yyyy-MM-dd",new Date);if(F>M){N[`${P}EndDate`]=L;continue}break}return N})},[i,s,n]),E=l.useCallback(({stageId:S})=>{d(b=>o({payload:b,stageId:S}))},[o]),x=l.useCallback(({stageId:S})=>{d(b=>{const w=n({source:b,phaseId:S,dateType:"start"}),_=is(Wa(new Date,-1),"yyyy-MM-dd"),N=w&&w>_?w:_,R={[`${S}EndDate`]:N};return w||(R[`${S}StartDate`]=N),{...b,...R}})},[n]),y=l.useCallback(({stageId:S})=>{const b=es.indexOf(S);b<0||b>=es.length-1||d(w=>{if(S==="preliminaryInvestigation"&&w.skipInquiry)return w;const _={};S==="inquiry"&&(_.skipInquiry=!0),S==="preliminaryInvestigation"&&(_.skipPreliminaryInvestigation=!0);const N={...w,..._};let R=null;for(let O=b-1;O>=0;O--){const P=es[O];if(!s({payload:N,phaseId:P})){R=n({source:N,phaseId:P,dateType:"end"});break}}let D=b+1;for(;D<es.length&&s({payload:N,phaseId:es[D]});)D+=1;if(D>=es.length)return w;const k=es[D],L=R?is(Wa(Fs(R,"yyyy-MM-dd",new Date),1),"yyyy-MM-dd"):null;return{...N,[`${S}StartDate`]:null,[`${S}EndDate`]:null,[`${k}StartDate`]:L}})},[s,n]),I=l.useCallback(({stageId:S})=>{A({stageId:S,updates:{endDate:null}})},[A]),v=l.useCallback(({stageId:S})=>{const b=es.indexOf(S);b<0||d(w=>{let _=b+1;for(;_<es.length&&s({payload:w,phaseId:es[_]});)_+=1;if(_>=es.length)return w;const N=es[_],R=n({source:w,phaseId:S,dateType:"start"}),D=is(new Date,"yyyy-MM-dd"),k=is(Wa(new Date,-1),"yyyy-MM-dd"),L=R&&R>k?R:k,O=is(Wa(Fs(L,"yyyy-MM-dd",new Date),1),"yyyy-MM-dd"),P=O>D?O:D,B={[`${S}EndDate`]:L,[`${N}StartDate`]:P};return R||(B[`${S}StartDate`]=L),{...w,...B}})},[s,n]);return{payload:u,hasChanges:p,stageCards:g,updateStageDates:A,handleTrashStage:E,handleCompleteStage:x,handleSkipStage:y,handleResumeStage:I,handleNextStage:v,setPayload:d}}const Gre=rt(async function({clientId:t,body:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/phases/management/`),i=await qe(r,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(n)});if(He(i))throw{httpCode:503,errorData:i.error};const o=await Ye(i);if(i.status===422)throw{httpCode:422,errorData:typeof o=="object"&&o!==null&&"detail"in o?o:void 0};if(He(o))throw{httpCode:503,errorData:o.error};if(!i.ok){const c=o.status==="error"?o.error:{code:"UNKNOWN_ERROR"};throw{httpCode:i.status,errorData:c}}
854if(o.status==="error"||!o.data)throw{httpCode:500,errorData:o.status==="error"?o.error:void 0};return o.data}),qre=({handleConfirmCancelNo:e,handleConfirmCancelYes:t})=>a.jsxs("div",{className:"fixed inset-0 z-100 w-screen h-screen flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-0 bg-black/10 backdrop-blur-[48px]",onClick:e,"aria-hidden":!0}),a.jsxs("div",{className:"relative z-10 flex flex-col gap-4 p-6 bg-white rounded-2xl min-w-[424px] shadow-[0px_0.27px_2.06px_0px_rgba(0,0,0,0.0323),0px_0.89px_6.92px_0px_rgba(0,0,0,0.0477),0px_4px_31px_0px_rgba(0,0,0,0.08)]",children:[a.jsx("h4",{className:"roboto-flex-100-600-1 text-[24px] leading-[20px] text-zinc-950",children:h.client.stage.phasesManagement.confirmCancel.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 leading-[20px] text-zinc-950",children:h.client.stage.phasesManagement.confirmCancel.DESCRIPTION}),a.jsxs("div",{className:"flex gap-2 justify-end mt-4",children:[a.jsx(ut,{className:"w-[96px]",variant:"h14inverse",onClick:e,children:h.client.stage.phasesManagement.confirmCancel.NO}),a.jsx(ut,{className:"w-[96px]",variant:"h14",onClick:t,children:h.client.stage.phasesManagement.confirmCancel.YES})]})]})]}),nw=({onClose:e,clientId:t,management:n,contentRef:s})=>{const r=bt(),i=l.useRef(()=>!0),[o,c]=Oe.useState(!1),[u,d]=Oe.useState(!1),{payload:p,hasChanges:g,stageCards:A,updateStageDates:E,handleTrashStage:x,handleCompleteStage:y,handleSkipStage:I,handleResumeStage:v,handleNextStage:S}=Vre(n),b=l.useCallback(async()=>{if(t){c(!0);try{await Gre({clientId:t,body:p}),await r.invalidateQueries({queryKey:["client",t]}),e()}catch{ve({type:"failed",message:h.client.stage.phasesManagement.messages.SAVE_FAILED,key:"STAGE_MANAGEMENT_SAVE_FAILED",duration:3e3})}finally{c(!1)}}},[t,p,r,e]);i.current=()=>g?(d(!0),!1):!0;const w=l.useCallback(()=>{i.current()&&e()},[e]),_=l.useCallback(()=>{d(!1)},[]),N=l.useCallback(()=>{d(!1),e()},[e]),R=l.useCallback(({stageId:k,value:L})=>{E({stageId:k,updates:{startDate:L}})},[E]),D=l.useCallback(({stageId:k,value:L})=>{E({stageId:k,updates:{endDate:L}})},[E]);return t?u?a.jsx(qre,{handleConfirmCancelYes:N,handleConfirmCancelNo:_}):a.jsx(Ws,{onClose:e,closeRequestRef:i,contentRef:s,children:a.jsxs("div",{className:"py-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950",children:h.client.stage.phasesManagement.titles.TITLE}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ut,{variant:"h8inverse",onClick:w,children:h.client.stage.phasesManagement.buttons.CANCEL}),a.jsx(ut,{variant:"h8",onClick:b,isPending:o,children:h.client.stage.phasesManagement.buttons.SAVE})]})]}),a.jsx("div",{className:"flex flex-col mt-8",children:A.map(k=>a.jsx(Qre,{stageInfoCard:k,onUpdateStartDate:R,onUpdateEndDate:D,onTrash:x,onComplete:y,onSkip:I,onResume:v,onNextStage:S},k.id))})]})}):null},sw=()=>{const{mainWrapperRef:e}=zt();Nre();const{clientData:t,isSuccess:n,stageInfoCards:s,currentStageManagementData:r,propertyCards:i,scrollOffset:o}=Mre(),{isFabulizerReady:c,isOpen:u,status:d,setObjectToFabulize:p}=wt({clientId:t?.id}),g=d==="notStarted",{openFabulizer:A}=Fu(),E=l.useRef(null),x=l.useRef(null),y=Fe(),[I,v]=Oe.useState(!1),S=l.useCallback(()=>{v(!0)},[]),b=l.useCallback(()=>{v(!1)},[]),w=l.useCallback(()=>{t?.id&&A({clientId:t.id,to:`/clients/${t?.id}/overview/stage/${r?.id}`,breadcrumbsNames:[h.client.stage.stages[UA(r?.id??"")]],type:b6(r?.id??"")})},[A,t,r]),_=l.useMemo(()=>s.findIndex((O,P)=>{const B=`/clients/${t?.id}/overview/stage/${O.id}`;if(qs({path:B,end:!1},y.pathname))return!0;if(P===0&&O.id===s[0]?.id){const z=`/clients/${t?.id}/overview/stage`;if(qs({path:z,end:!0},y.pathname))return!0}return!1}),[s,y.pathname,t?.id]),N=l.useMemo(()=>_>=0,[_]);_s({containerRef:E,activeElementRef:x,isReady:n&&c&&s.length>0,isActive:N});const R=l.useMemo(()=>[{title:h.client.stage.buttons.MANAGE_STAGES,onClick:S,isCloseOnClick:!0}],[S]),D=r?.id,k=t?.id?`/clients/${t.id}
854/overview/stage/${D}`:null;return l.useEffect(()=>{!c||!t?.id||!D||d==="notStarted"&&k&&p({to:k,breadcrumbsNames:[h.client.stage.stages[UA(D)]],type:b6(D)})},[c,t?.id,D,d,k,p]),!n||!c||!t?a.jsx(ct,{isWithWrapper:!0}):s.some(O=>O.status==="active"||O.status==="finished")?a.jsxs(a.Fragment,{children:[a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:u?["notStarted","error"].includes(d)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:E,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[h.client.stage.titles.TITLE,a.jsx(Ss,{isWidthHalf:!0,items:R})]}),leftColumn:a.jsx("div",{children:s.map((O,P)=>{const B=_===P;return a.jsx("div",{ref:B?x:null,children:a.jsx(Tre,{to:`/clients/${t?.id}/overview/stage/${O.id}`,fallbackTo:P?void 0:`/clients/${t?.id}/overview/stage`,...O})},P)})}),rightColumnStickyTitle:a.jsx("div",{children:a.jsxs("div",{className:"flex items-center justify-between group roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[r?.title,a.jsx(Ss,{isRightColumn:!0,isWidthHalf:!0,items:[{title:h.client.fabulizer.buttons.MANAGE_STAGE,onClick:S,isCloseOnClick:!0},{title:h.client.fabulizer.buttons.FILL_WITH_AI,onClick:w,isCloseOnClick:!0,isDisabled:!g}]})]})}),rightColumn:a.jsx("div",{children:i.map((O,P)=>a.jsx(Nt,{clientId:t?.id,anchor:O.anchor,title:O.title??"",rows:O.rows,rowsGroups:O.rowsGroups,deleteAll:O.deleteAll,post:O.post,mainWrapperRef:e,scrollOffset:o,isKebabMenuDisabled:O.isKebabMenuDisabled},P))})}),!!I&&a.jsx(nw,{onClose:b,clientId:t?.id,management:t?.phases?.management,contentRef:e})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-1 bp48:flex-0 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-center mx-4 bp48:mx-0 bp48:mt-37",children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:h.client.stage.emptyPage.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.stage.emptyPage.DESCRIPTION}),a.jsx("div",{className:"mt-4 bp48:mt-8",children:a.jsx(ut,{variant:"h16",onClick:S,children:h.client.stage.emptyPage.BUTTON})})]}),!!I&&a.jsx(nw,{onClose:b,clientId:t?.id,management:t?.phases?.management,contentRef:e})]})},HI=({circumstance:e})=>pt(e)?e.isDeleted===!0:!1,Wre={description:null,catalogueArticleId:null,circumstanceType:"mitigating",mitigatingCategory:null,aggravatingCategory:null,reviewResult:null},Kre=()=>{const{id:e,circumstanceId:t}=st(),n=at(),s=bt(),r=l.useMemo(()=>["client",e],[e]),{postResource:i}=Uu({clientId:e}),o=ra(D=>{if(e)return D.requestsByClient?.[e]}),c=l.useMemo(()=>{if(!e)return!1;const D=o?.[`clients/${e}/circumstances/`];return D?!!Object.values(D).some(k=>k?.status==="inflight"):!1},[e,o]),u=tt({mutationFn:async()=>{if(!e)throw new Error("missing client id");return Ff({path:`clients/${e}/circumstances/`})},onSuccess:()=>{e&&(s.setQueryData(r,D=>D&&{...D,circumstances:[]}),n(`/clients/${e}/overview/circumstances`,{replace:!0}))},onError:()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})}}),{deleteResourceItem:d}=zu({clientId:e,isSoftDelete:!0}),p=Hn(D=>{if(e)return D.requestsByClient?.[e]}),g=l.useCallback(()=>{const D=s.getQueryData(r);return D?.circumstances?D.circumstances:[]},[s,r]),A=l.useCallback(D=>{if(!e||!D)return!1;const k=`clients/${e}/circumstances/${D}/`,L=p?.[`${k}#${D}`];return L?!!Object.values(L).some(O=>O?.status==="inflight"):!1},[e,p]),E=l.useCallback(D=>{const k=g(),L=O=>{if(O<0)return null;const P=k[O],B=P?.id;return!B||HI({circumstance:P})||A(B)?L(O-1):B};return L(D)},[g,A]),x=l.useCallback(D=>{const k=g(),L=O=>{if(O>=k.length)return null;const P=k[O],B=P?.id;return!B||HI({circumstance:P})||A(B)?L(O+1):B};return L(D)},[g,A]),y=l.useCallback(D=>!E(D-1),[E]),I=l.useCallback(D=>{if(!e)return;const k=D+1;if(y(k)){const P=x(k+1);if(P){n(`/clients/${e}/overview/circumstances/${P}`,{replace:!0});return}n(`/clients/${e}/overview/circumstances`,{replace:!0});return}const O=E(D);if(O){n(`/clients/${e}/overview/circumstances/${O}`,{replace:!0});return}n(`/clients/${e}/overview/circumstances`,{replace:!0})},[e,y,x,E,n]),v=l.useCallback(()=>{e&&i({pathSegments:["clients","{clientId}","circumstances"],pathValues:{},body:{...Wre}}).then(({createdId:D})=>{D&&n(`/clients/${e}/overview/circumstances/${D}`)})},[e,i,n]),S=l.useCallback(()=>{e&&(u.isPending||u.mutate())},[e,u]),b=l.useCallback(D=>{if(!e)return;const k=D.circumstanceId;d({pathSegments:["clients","{clientId}","circumstances","{circumstanceId}"],pathValues:{clientId:e,circumstanceId:k},itemId:k})},[e,d]),w=l.useMemo(()=>!e||!t?"":`clients/${e}/circumstances/${t}/`,[e,t]),_=Hn(D=>{if(!e)return;if(!t)return D.requestsByClient?.[e]?.[w];const k=`${w}#${t}`;return D.requestsByClient?.[e]?.[k]}),N=l.useRef(new Set),R=l.useRef(!1);return l.useEffect(()=>{const D=_;if(!D)return;R.current||(Object.entries(D).filter(([,B])=>B?.status==="settled").forEach(([B])=>{N.current.add(B)}),R.current=!0);const k=N.current,L=Object.entries(D).filter(([,B])=>B?.status==="settled").map(([B])=>
854B).filter(B=>!k.has(B));if(L.length===0)return;if(!e||!t){L.forEach(B=>k.add(B));return}const P=g().findIndex(B=>{const F=B?.id;return F?F===t:!1});I(P-1),L.forEach(B=>k.add(B))},[_,e,t,g,I]),{handleAddCircumstance:v,handleDeleteAllCircumstances:S,handleDeleteCircumstance:b,isAddPending:c,isDeleteAllPending:u.isPending,isDeleteOnePending:A(t)}},$re=e=>["clients","{clientId}","circumstances",e],Yre=({clientId:e,circumstance:t,primaryArticleIds:n,isFieldsDisabled:s})=>{const r=bt(),i=Oe.useMemo(()=>["client",e],[e]),o=Oe.useCallback((u,d)=>{r.setQueryData(i,p=>p&&{...p,circumstances:(p.circumstances??[]).map(g=>g.id!==u?g:{...g,documents:[...g.documents??[],d]})})},[i,r]),c=Oe.useCallback((u,d)=>{r.setQueryData(i,p=>p&&{...p,circumstances:(p.circumstances??[]).map(g=>g.id!==u?g:{...g,documents:(g.documents??[]).filter(A=>A.uploadId!==d)})})},[i,r]);return Oe.useMemo(()=>{if(!t||!e)return{rows:[]};const u=$re(t.id),d=t.circumstanceType==="aggravating",p=[{action:"upload",endpoint:["uploads"]},{action:"attach",endpoint:[...u,"documents"]},{action:"detach",endpoint:[...u,"documents","{documentId}"]}];return{rows:[{textarea:{isDisabled:s,label:h.client.circumstances.fields.DESCRIPTION,value:t.description??"",placeholder:h.client.circumstances.placeholders.DESCRIPTION,patch:{endpoint:u,field:"description"}}},{select:{isDisabled:s,label:h.client.circumstances.fields.ARTICLE,placeholder:h.client.circumstances.placeholders.ARTICLE,catalogue:"articles",value:String(t.catalogueArticleId??""),patch:{endpoint:u,field:"catalogueArticleId"},isSearchable:!0,primaryArticleIds:n.map(A=>String(A))}},{select:{isDisabled:s,isRequired:!0,label:h.client.circumstances.fields.TYPE,placeholder:h.client.circumstances.placeholders.TYPE,catalogue:"enums",enumKey:"circumstanceTypes",value:String(t.circumstanceType??""),patch:{endpoint:u,field:"circumstanceType"}}},{select:{isDisabled:s,label:h.client.circumstances.fields.CATEGORY,placeholder:h.client.circumstances.placeholders.CATEGORY,catalogue:"enums",enumKey:d?"circumstanceAggravatingCategories":"circumstanceMitigatingCategories",value:String(d?t.aggravatingCategory??"":t.mitigatingCategory??""),patch:{endpoint:u,field:d?"aggravatingCategory":"mitigatingCategory"}}},{select:{isDisabled:s,label:h.client.circumstances.fields.REVIEW_RESULT,placeholder:h.client.circumstances.placeholders.REVIEW_RESULT,catalogue:"enums",enumKey:"circumstanceReviewResults",value:String(t.reviewResult??""),patch:{endpoint:u,field:"reviewResult"}}},{documents:{label:h.client.circumstances.fields.DOCUMENTS,patch:p,values:{documents:t.documents??[],isDisabled:s,pathValues:{"{circumstanceId}":String(t.id)},customPatch:{onAttachSuccess:A=>o(t.id,A),onDetachSuccess:A=>c(t.id,A)}}}}]}},[t,e,o,c,s,n])},rw=()=>{const{mainWrapperRef:e,clientData:t,isSuccess:n}=zt(),s=at(),{circumstanceId:r}=st(),i=Fe(),o=Oe.useRef(null),c=Oe.useRef(null),u=Oe.useRef(void 0),{isFabulizerReady:d,isOpen:p,status:g}=wt({clientId:t?.id}),{handleAddCircumstance:A,handleDeleteAllCircumstances:E,handleDeleteCircumstance:x,isAddPending:y,isDeleteAllPending:I,isDeleteOnePending:v}=Kre(),S=Oe.useMemo(()=>(t?.circumstances??[]).filter(O=>!HI({circumstance:O})),[t?.circumstances]),b=Oe.useMemo(()=>t?.id?S.map((O,P)=>({title:h.client.circumstances.titles.LIST_ITEM.replace("{order}",String(P+1)),to:`/clients/${t.id}/overview/circumstances/${O.id}`,description:O.description??"",result:O.reviewResult!=null?On(h.enums.circumstanceReviewResults,String(O.reviewResult),String(O.reviewResult)):"",type:O.circumstanceType!=null?On(h.enums.circumstanceTypes,String(O.circumstanceType),String(O.circumstanceType)):""})):[],[S,t?.id]),w=Oe.useMemo(()=>{if(r)return t?.circumstances?.find(O=>O.id===r);if(S.length)return S[0]},[r,S,t?.circumstances]),_=Oe.useMemo(()=>t?.episodesArticles?.map(O=>O.id)??[],[t?.episodesArticles]),{rows:N}=Yre({clientId:t?.id,circumstance:w,primaryArticleIds:_,isFieldsDisabled:!1});Oe.useLayoutEffect(()=>{if(!t?.id||!n)return;if(!S.length&&r){s(`/clients/${t.id}/overview/circumstances`,{replace:!0});return}if(!r||!S.length)return;(t?.circumstances??[]).some(P=>P.id===r)||s(`/clients/${t.id}
854/overview/circumstances`,{replace:!0})},[r,S,t?.id,t?.circumstances,n,s]);const R=Oe.useMemo(()=>S.length?r?b.findIndex(O=>!!qs({path:O.to,end:!0},i.pathname)):0:-1,[r,S.length,b,i.pathname]),D=Oe.useMemo(()=>R>=0&&!!w,[R,w]);if(_s({containerRef:o,activeElementRef:c,isReady:n&&d&&S.length>0,isActive:D}),!n||!d||!t?.id)return a.jsx(ct,{isWithWrapper:!0});if(!S.length)return a.jsxs("div",{className:Y("flex w-full min-h-[calc(100dvh-14rem)] flex-col items-center justify-center px-4 py-10"),children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.circumstances.empty.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center max-w-[520px]",children:h.client.circumstances.empty.DESCRIPTION}),a.jsx(ut,{variant:"h16",type:"button",className:"mt-8 h-16 min-h-16",onClick:A,disabled:y,children:h.client.circumstances.buttons.ADD})]});if(S.length>0&&!w)return a.jsx(ct,{isWithWrapper:!0});const k=w?S.findIndex(O=>O.id===w.id):-1;k>=0&&(u.current=k+1);const L=u.current;return a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:p?["notStarted","error"].includes(g)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:o,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[h.client.circumstances.titles.LEFT_SECTION,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!1,items:[{title:h.client.circumstances.kebab.ADD,onClick:A,isCloseOnClick:!0,isDisabled:y},{title:h.client.circumstances.kebab.DELETE_ALL,onClick:E,isCloseOnClick:!0,isDisabled:I}]})]}),leftColumn:a.jsx("div",{children:b.map((O,P)=>{const B=R===P;return a.jsx(Ac,{ref:B?c:null,title:O.title,text:O.description,instance:O.result,date:O.type,to:O.to,isTextBlockLimited:!0,fallbackTo:P?void 0:`/clients/${t.id}/overview/circumstances`},O.to)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[!!L&&`${h.client.circumstances.titles.RIGHT_SECTION_TITLE} ${L}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.circumstances.kebab.DELETE_ONE,onClick:()=>{w&&x({circumstanceId:w.id,activeCircumstanceId:r})},isCloseOnClick:!0,isDisabled:v}]})]}),rightColumn:a.jsx("div",{children:!!w&&a.jsx(Nt,{clientId:t.id,rows:N,mainWrapperRef:e,scrollOffset:230},w.id)})})},v7={description:null,catalogueArticleId:null,evidenceType:null,side:null,reviewResult:null,comment:null},Xre=()=>{const{id:e,evidenceId:t}=st(),n=at(),s=bt(),r=l.useMemo(()=>["client",e],[e]),{postResource:i}=Uu({clientId:e}),o=ra(D=>{if(e)return D.requestsByClient?.[e]}),c=l.useMemo(()=>{if(!e)return!1;const D=o?.[`clients/${e}/evidences/`];return D?!!Object.values(D).some(k=>k?.status==="inflight"):!1},[e,o]),u=tt({mutationFn:async()=>{if(!e)throw new Error("missing client id");return Ff({path:`clients/${e}/evidences/`})},onSuccess:()=>{e&&(s.setQueryData(r,D=>D&&{...D,evidences:[]}),n(`/clients/${e}/overview/evidence`,{replace:!0}))},onError:()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})}}),{deleteResourceItem:d}=zu({clientId:e,isSoftDelete:!0}),p=Hn(D=>{if(e)return D.requestsByClient?.[e]}),g=l.useCallback(()=>{const D=s.getQueryData(r);return D?.evidences?D.evidences:[]},[s,r]),A=l.useCallback(D=>{if(!e||!D)return!1;const k=`clients/${e}/evidences/${D}/`,L=p?.[`${k}#${D}`];return L?!!Object.values(L).some(O=>O?.status==="inflight"):!1},[e,p]),E=l.useCallback(D=>{const k=g(),L=O=>{if(O<0)return null;const P=k[O],B=P?.id;return!B||Jh({evidence:P})||A(B)?L(O-1):B};return L(D)},[g,A]),x=l.useCallback(D=>{const k=g(),L=O=>{if(O>=k.length)return null;const P=k[O],B=P?.id;return!B||Jh({evidence:P})||A(B)?L(O+1):B};return L(D)},[g,A]),y=l.useCallback(D=>!E(D-1),[E]),I=l.useCallback(D=>{if(!e)return;const k=D+1;if(y(k)){const P=x(k+1);if(P){n(`/clients/${e}/overview/evidence/${P}`,{replace:!0});return}n(`/clients/${e}/overview/evidence`,{replace:!0});return}const O=E(D);if(O){n(`/clients/${e}/overview/evidence/${O}`,{replace:!0});return}n(`/clients/${e}/overview/evidence`,{replace:!0})},[e,y,x,E,n]),v=l.useCallback(()=>{e&&i({pathSegments:["clients","{clientId}
854","evidences"],pathValues:{},body:{...v7}}).then(({createdId:D})=>{D&&n(`/clients/${e}/overview/evidence/${D}`)})},[e,i,n]),S=l.useCallback(()=>{e&&(u.isPending||u.mutate())},[e,u]),b=l.useCallback(D=>{if(!e)return;const k=D.evidenceId;d({pathSegments:["clients","{clientId}","evidences","{evidenceId}"],pathValues:{clientId:e,evidenceId:k},itemId:k})},[e,d]),w=l.useMemo(()=>!e||!t?"":`clients/${e}/evidences/${t}/`,[e,t]),_=Hn(D=>{if(!e)return;if(!t)return D.requestsByClient?.[e]?.[w];const k=`${w}#${t}`;return D.requestsByClient?.[e]?.[k]}),N=l.useRef(new Set),R=l.useRef(!1);return l.useEffect(()=>{const D=_;if(!D)return;R.current||(Object.entries(D).filter(([,B])=>B?.status==="settled").forEach(([B])=>{N.current.add(B)}),R.current=!0);const k=N.current,L=Object.entries(D).filter(([,B])=>B?.status==="settled").map(([B])=>B).filter(B=>!k.has(B));if(L.length===0)return;if(!e||!t){L.forEach(B=>k.add(B));return}const P=g().findIndex(B=>{const F=B?.id;return F?F===t:!1});I(P-1),L.forEach(B=>k.add(B))},[_,e,t,g,I]),{handleAddEvidence:v,handleDeleteAllEvidences:S,handleDeleteEvidence:b,isAddPending:c,isDeleteAllPending:u.isPending,isDeleteOnePending:A(t)}},Jre=e=>["clients","{clientId}","evidences",e],_7=({clientId:e,evidence:t,primaryArticleIds:n,isFieldsDisabled:s})=>{const r=bt(),i=Oe.useMemo(()=>["client",e],[e]),o=Oe.useCallback((u,d)=>{r.setQueryData(i,p=>p&&{...p,evidences:(p.evidences??[]).map(g=>g.id!==u?g:{...g,documents:[...g.documents??[],d]})})},[i,r]),c=Oe.useCallback((u,d)=>{r.setQueryData(i,p=>p&&{...p,evidences:(p.evidences??[]).map(g=>g.id!==u?g:{...g,documents:(g.documents??[]).filter(A=>A.uploadId!==d)})})},[i,r]);return Oe.useMemo(()=>{if(!t||!e)return{rows:[]};const u=Jre(t.id),d=[{action:"upload",endpoint:["uploads"]},{action:"attach",endpoint:[...u,"documents"]},{action:"detach",endpoint:[...u,"documents","{documentId}"]}];return{rows:[{textarea:{isDisabled:s,label:h.client.evidence.fields.DESCRIPTION,value:t.description??"",placeholder:h.client.evidence.placeholders.DESCRIPTION,patch:{endpoint:u,field:"description"}}},{select:{isDisabled:s,label:h.client.evidence.fields.ARTICLE,placeholder:h.client.evidence.placeholders.ARTICLE,catalogue:"articles",value:String(t.catalogueArticleId??""),patch:{endpoint:u,field:"catalogueArticleId"},isSearchable:!0,primaryArticleIds:n.map(g=>String(g))}},{select:{isDisabled:s,label:h.client.evidence.fields.TYPE,placeholder:h.client.evidence.placeholders.TYPE,catalogue:"enums",enumKey:"evidenceTypes",value:String(t.evidenceType??""),patch:{endpoint:u,field:"evidenceType"}}},{select:{isDisabled:s,label:h.client.evidence.fields.USED_BY,placeholder:h.client.evidence.placeholders.USED_BY,catalogue:"enums",enumKey:"evidenceSides",value:String(t.side??""),patch:{endpoint:u,field:"side"}}},{select:{isDisabled:s,label:h.client.evidence.fields.REVIEW_RESULT,placeholder:h.client.evidence.placeholders.REVIEW_RESULT,catalogue:"enums",enumKey:"evidenceReviewResults",value:String(t.reviewResult??""),patch:{endpoint:u,field:"reviewResult"}}},{documents:{label:h.client.evidence.fields.DOCUMENTS,patch:d,values:{documents:t.documents??[],isDisabled:s,pathValues:{"{evidenceId}":String(t.id)},customPatch:{onAttachSuccess:g=>o(t.id,g),onDetachSuccess:g=>c(t.id,g)}}}},{textarea:{isDisabled:s,label:h.client.evidence.fields.COMMENT,value:t.comment??"",placeholder:h.client.evidence.placeholders.COMMENT,patch:{endpoint:u,field:"comment"}}}]}},[t,e,o,c,s,n])},iw=()=>{const{mainWrapperRef:e,clientData:t,isSuccess:n}=zt(),s=at(),{evidenceId:r}=st(),i=Fe(),o=Oe.useRef(null),c=Oe.useRef(null),u=Oe.useRef(void 0),{isFabulizerReady:d,isOpen:p,status:g}=wt({clientId:t?.id}),{handleAddEvidence:A,handleDeleteAllEvidences:E,handleDeleteEvidence:x,isAddPending:y,isDeleteAllPending:I,isDeleteOnePending:v}=Xre(),S=Oe.useMemo(()=>(t?.evidences??[]).filter(O=>!Jh({evidence:O})),[t?.evidences]),b=Oe.useMemo(()=>t?.id?S.map((O,P)=>({title:h.client.evidence.titles.LIST_ITEM.replace("{order}",String(P+1)),to:`/clients/${t.id}/overview/evidence/${O.id}`,description:O.description??"",result:O.reviewResult!=null?On(h.enums.evidenceReviewResults,String(O.reviewResult),String(O.reviewResult)):"",type:O.evidenceType!=null?On(h.enums.evidenceTypes,String(O.evidenceType),String(O.evidenceType)):""})):[],[S,t?.id]),w=Oe.useMemo(()=>
854{if(r)return t?.evidences?.find(O=>O.id===r);if(S.length)return S[0]},[r,S,t?.evidences]),_=Oe.useMemo(()=>t?.episodesArticles?.map(O=>O.id)??[],[t?.episodesArticles]),{rows:N}=_7({clientId:t?.id,evidence:w,primaryArticleIds:_,isFieldsDisabled:!1});Oe.useLayoutEffect(()=>{if(!t?.id||!n)return;if(!S.length&&r){s(`/clients/${t.id}/overview/evidence`,{replace:!0});return}if(!r||!S.length)return;(t?.evidences??[]).some(P=>P.id===r)||s(`/clients/${t.id}/overview/evidence`,{replace:!0})},[r,S,t?.id,t?.evidences,n,s]);const R=Oe.useMemo(()=>S.length?r?b.findIndex(O=>!!qs({path:O.to,end:!0},i.pathname)):0:-1,[r,S.length,b,i.pathname]),D=Oe.useMemo(()=>R>=0&&!!w,[R,w]);if(_s({containerRef:o,activeElementRef:c,isReady:n&&d&&S.length>0,isActive:D}),!n||!d||!t?.id)return a.jsx(ct,{isWithWrapper:!0});if(!S.length)return a.jsxs("div",{className:Y("flex w-full min-h-[calc(100dvh-14rem)] flex-col items-center justify-center px-4 py-10"),children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.evidence.empty.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.evidence.empty.DESCRIPTION}),a.jsx(ut,{variant:"h16",type:"button",className:"mt-8 h-16 min-h-16",onClick:A,disabled:y,children:h.client.evidence.buttons.ADD})]});if(S.length>0&&!w)return a.jsx(ct,{isWithWrapper:!0});const k=w?S.findIndex(O=>O.id===w.id):-1;k>=0&&(u.current=k+1);const L=u.current;return a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:p?["notStarted","error"].includes(g)?"big":"small":"none",isLeftColumnPreventScrollPropagation:!1,leftContainerRef:o,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[h.client.evidence.titles.LEFT_SECTION,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!1,items:[{title:h.client.evidence.kebab.ADD,onClick:A,isCloseOnClick:!0,isDisabled:y},{title:h.client.evidence.kebab.DELETE_ALL,onClick:E,isCloseOnClick:!0,isDisabled:I}]})]}),leftColumn:a.jsx("div",{children:b.map((O,P)=>{const B=R===P;return a.jsx(Ac,{ref:B?c:null,title:O.title,text:O.description,instance:O.result,date:O.type,to:O.to,isTextBlockLimited:!0,fallbackTo:P?void 0:`/clients/${t.id}/overview/evidence`},O.to)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[!!L&&`${h.client.evidence.titles.RIGHT_SECTION_TITLE} ${L}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.evidence.kebab.DELETE_ONE,onClick:()=>{w&&x({evidenceId:w.id,activeEvidenceId:r})},isCloseOnClick:!0,isDisabled:v}]})]}),rightColumn:a.jsx("div",{children:!!w&&a.jsx(Nt,{clientId:t.id,rows:N,mainWrapperRef:e,scrollOffset:230},w.id)})})},E2=({baselineUpdatedAt:e,nextUpdatedAt:t})=>e?t?e!==t:!1:!!t,T7=({updatedAt:e})=>!!e,Dm=$n((e,t)=>({deferFetchDefenseLineIdsByClient:{},markDeferDefenseTreeFetch:({clientId:n,defenseLineId:s})=>e(r=>({deferFetchDefenseLineIdsByClient:{...r.deferFetchDefenseLineIdsByClient,[n]:{...r.deferFetchDefenseLineIdsByClient[n],[s]:!0}}})),clearDeferDefenseTreeFetch:({clientId:n,defenseLineId:s})=>e(r=>{const i=r.deferFetchDefenseLineIdsByClient[n];if(!i||!i[s])return r;const o={...i};return delete o[s],{deferFetchDefenseLineIdsByClient:{...r.deferFetchDefenseLineIdsByClient,[n]:o}}}),pickIsDefenseTreeFetchDeferred:({clientId:n,defenseLineId:s})=>{const r=t().deferFetchDefenseLineIdsByClient[n];return!(!r||!r[s])}})),ic=new Map,km=new Map,N7=({clientId:e,defenseLineId:t})=>`${e}/${t}`,Fy=({pollKey:e,generation:t})=>{const n=km.get(e);return!(n===void 0||n!==t)},hE=({pollKey:e})=>{const t=km.get(e);return t===void 0?0:t},VI=({pollKey:e})=>{const t=ic.get(e);t&&(clearTimeout(t),ic.delete(e));const n=hE({pollKey:e});km.set(e,n+1)},ow=({clientId:e,defenseLineId:t})=>{Dm.getState().clearDeferDefenseTreeFetch({clientId:e,defenseLineId:t})},Zre=({pollMode:e,baselineUpdatedAt:t,nextUpdatedAt:n})=>e==="untilUpdatedAtReady"?T7({updatedAt:n}):E2({baselineUpdatedAt:t,nextUpdatedAt:n}),w7=({queryClient:e,clientId:t,defenseLineId:n,baselineUpdatedAt:s,attempt:r,pollKey:i,generation:o,pollMode:c})=>{const u=setTimeout(()=>{eie({queryClient:e,clientId:t,defenseLineId:n,baselineUpdatedAt:s,attempt:r,pollKey:i,generation:o,pollMode:c})},qte);ic.set(i,u)},eie=async({queryClient:e,clientId:t,defenseLineId:n,baselineUpdatedAt:s,attempt:r,pollKey:i,generation:o,pollMode:c})=>{if(!Fy({pollKey:i,generation:o}))return;const u=_m({clientId:t,defenseLineId:n});try{const d=await Uv({clientId:t,defenseLineId:n});if(!Fy({pollKey:i,generation:o}))return;if(e.setQueryData(u,d),T7({updatedAt:d.updatedAt})&&ow({clientId:t,defenseLineId:n}),Zre({pollMode:c,baselineUpdatedAt:s,nextUpdatedAt:d.updatedAt})){VI({pollKey:i}
854);return}}catch{}if(Fy({pollKey:i,generation:o})){if(r>=Wte){VI({pollKey:i}),ow({clientId:t,defenseLineId:n});return}w7({queryClient:e,clientId:t,defenseLineId:n,baselineUpdatedAt:s,attempt:r+1,pollKey:i,generation:o,pollMode:c})}},tie=({clientId:e})=>{const t=`${e}/`;ic.forEach((n,s)=>{if(s.startsWith(t))return;clearTimeout(n),ic.delete(s);const r=hE({pollKey:s});km.set(s,r+1)})},nie=({clientId:e})=>{tie({clientId:e})},sie=()=>{ic.forEach((e,t)=>{clearTimeout(e);const n=hE({pollKey:t});km.set(t,n+1)}),ic.clear()},rie=({clientId:e,defenseLineId:t})=>{const n=N7({clientId:e,defenseLineId:t});return!!ic.has(n)},x2=({queryClient:e,clientId:t,defenseLineId:n,pollMode:s="untilUpdatedAtChanged"})=>{const r=N7({clientId:t,defenseLineId:n});VI({pollKey:r});const i=hE({pollKey:r}),o=_m({clientId:t,defenseLineId:n}),u=e.getQueryData(o)?.updatedAt;w7({queryClient:e,clientId:t,defenseLineId:n,baselineUpdatedAt:u,attempt:1,pollKey:r,generation:i,pollMode:s})},iie=({queryClient:e,clientId:t,defenseLineId:n})=>{Dm.getState().markDeferDefenseTreeFetch({clientId:t,defenseLineId:n}),x2({queryClient:e,clientId:t,defenseLineId:n,pollMode:"untilUpdatedAtReady"})},oie=({cacheIndex:e,capturedIndex:t})=>e!==-1?e:t!==void 0?t:-1,aie=()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})},lie=()=>{const{id:e,defenseLineId:t}=st(),n=at(),s=bt(),r=l.useMemo(()=>["client",e],[e]),{postResource:i}=Uu({clientId:e}),o=ra(k=>{if(e)return k.requestsByClient?.[e]}),c=l.useMemo(()=>{if(!e)return!1;const k=o?.[`clients/${e}/defense-lines/`];return k?!!Object.values(k).some(L=>L?.status==="inflight"):!1},[e,o]),u=tt({mutationFn:async()=>{if(!e)throw new Error("missing client id");return o$({clientId:e})},onSuccess:()=>{e&&(s.setQueryData(r,k=>k&&{...k,defenseLines:[]}),n(`/clients/${e}/overview/defense-lines`,{replace:!0}))},onError:aie}),{deleteResourceItem:d}=zu({clientId:e,isSoftDelete:!0}),p=Hn(k=>{if(e)return k.requestsByClient?.[e]}),g=l.useRef(new Map),A=l.useCallback(()=>{const k=s.getQueryData(r);return k?.defenseLines?k.defenseLines:[]},[s,r]),E=l.useCallback(k=>{if(!e||!k)return!1;const L=`clients/${e}/defense-lines/${k}/`,O=p?.[`${L}#${k}`];return O?!!Object.values(O).some(P=>P?.status==="inflight"):!1},[e,p]),x=l.useCallback(k=>{const L=A(),O=P=>{if(P<0)return null;const B=L[P],F=B?.id;return!F||GA({defenseLine:B})||E(F)?O(P-1):F};return O(k)},[A,E]),y=l.useCallback(k=>{const L=A(),O=P=>{if(P>=L.length)return null;const B=L[P],F=B?.id;return!F||GA({defenseLine:B})||E(F)?O(P+1):F};return O(k)},[A,E]),I=l.useCallback(k=>!x(k-1),[x]),v=l.useCallback(k=>{if(!e)return;const L=k+1;if(I(L)){const B=y(L+1);if(B){n(`/clients/${e}/overview/defense-lines/${B}`,{replace:!0});return}n(`/clients/${e}/overview/defense-lines`,{replace:!0});return}const P=x(k);if(P){n(`/clients/${e}/overview/defense-lines/${P}`,{replace:!0});return}n(`/clients/${e}/overview/defense-lines`,{replace:!0})},[e,I,y,x,n]),S=l.useCallback(()=>{e&&i({pathSegments:["clients","{clientId}","defense-lines"],pathValues:{},body:{}}).then(({createdId:k})=>{k&&(iie({queryClient:s,clientId:e,defenseLineId:k}),n(`/clients/${e}/overview/defense-lines/${k}`))})},[e,i,n,s]),b=l.useCallback(()=>{e&&(u.isPending||u.mutate())},[e,u]),w=l.useCallback(k=>{if(!e)return;const L=k.defenseLineId,O=A().findIndex(P=>{const B=P?.id;return B?B===L:!1});O!==-1&&g.current.set(L,O),d({pathSegments:["clients","{clientId}","defense-lines","{defenseLineId}"],pathValues:{clientId:e,defenseLineId:L},itemId:L})},[e,d,A]),_=l.useMemo(()=>!e||!t?"":`clients/${e}/defense-lines/${t}/`,[e,t]),N=Hn(k=>{if(!e)return;if(!t)return k.requestsByClient?.[e]?.[_];const L=`${_}#${t}`;return k.requestsByClient?.[e]?.[L]}),R=l.useRef(new Set),D=l.useRef(!1);return l.useEffect(()=>{const k=N;if(!k)return;D.current||(Object.entries(k).filter(([,Q])=>Q?.status==="settled").forEach(([Q])=>{R.current.add(Q)}),D.current=!0);const L=R.current,O=Object.entries(k).filter(([,Q])=>Q?.status==="settled").map(([Q])=>Q).filter(Q=>!L.has(Q));if(O.length===0)return;if(!e||!t){O.forEach(Q=>L.add(Q));return}const B=A().findIndex(Q=>{const M=Q?.id;return M?M===t:!1}),F=g.current.get(t);g.current.delete(t);
854const z=oie({cacheIndex:B,capturedIndex:F});if(O.forEach(Q=>L.add(Q)),z===-1){n(`/clients/${e}/overview/defense-lines`,{replace:!0});return}v(z-1)},[N,e,t,A,v,n]),{handleAddDefenseLine:S,handleDeleteAllDefenseLines:b,handleDeleteDefenseLine:w,isAddPending:c,isDeleteAllPending:u.isPending,isDeleteOnePending:E(t)}},cie={УК:"uk_rf",УПК:"upk_rf","Пленумы ВС":"plenum"},uie=/ст\.?\s*(\d+(?:\.\d+)?)/i,die=/(?:^|\s)ч\.\s*(\d+(?:\.\d+)?)/i,fie=/(?:^|\s)п\.\s*(\d+(?:\.\d+)?)/i,pie=/^(\d+)\s+Пленум(?:\s+ВСРФ)?/i,hie="Пленумы ВС",mie=({codex:e})=>{const t=cie[e];if(t)return t},gie=({catalogueArticleId:e,catalogueArticles:t})=>{if(!e||!t)return;const n=t.find(r=>r.id===e);if(!n)return;const s=n.number.trim();if(s)return s},Aie=({text:e})=>{const t=e.match(uie);if(t&&t[1])return t[1]},Eie=({text:e})=>{const t=e.trim().match(pie);if(t&&t[1])return t[1]},xie=({codex:e})=>e===hie,Cie=({article:e,catalogueArticles:t})=>{if(xie({codex:e.codex}))return Eie({text:e.article});const n=gie({catalogueArticleId:e.catalogueArticleId,catalogueArticles:t});return n||Aie({text:e.article})},yie=({reference:e})=>{const t=e.match(die);if(!t)return;const n=t[1];if(!n)return;const r=e.match(fie)?.[1];return r?`part-${n}-clause-${r}`:`part-${n}`},bie=({article:e,catalogueArticles:t})=>{const n=mie({codex:e.codex});if(!n)return;const s=Cie({article:e,catalogueArticles:t});if(s)return{baseId:n,articleId:`${n}:${s}`,anchorId:yie({reference:e.article})}},R7=({practiceCount:e,isRecalculating:t})=>{if(t||e===null||e===void 0)return;if(e===0)return h.client.defenseLines.practice.NONE;const n=qt({count:e,zero:h.client.defenseLines.practice.SIMILAR_CASES_ZERO,one:h.client.defenseLines.practice.SIMILAR_CASES_ONE,many:h.client.defenseLines.practice.SIMILAR_CASES_MANY});return`${e} ${n}`},D7=({node:e})=>e.children.length===0?[e]:e.children.flatMap(t=>D7({node:t})),Zh=({tree:e})=>e===void 0?[]:D7({node:e}),Iie=({defenseLineTree:e,fallbackTree:t})=>e?.id?e:t,C2=({leaves:e,leafId:t})=>{if(t===null)return"";const n=e.find(s=>s.id===t);return n===void 0?"":n.label},Sie=({leaves:e,leafId:t,isRecalculating:n})=>{if(t===null)return;const s=e.find(r=>r.id===t);if(s!==void 0)return R7({practiceCount:s.practiceCount,isRecalculating:n})},vie=({isOpen:e,status:t})=>e?t==="notStarted"||t==="error"?"big":"small":"none",_ie=({index:e,clientId:t})=>{if(e===0)return`/clients/${t}/overview/defense-lines`},aw=({leaf:e})=>e.practiceCount===null||e.practiceCount===void 0?-1:e.practiceCount,Tie=({leaves:e,isRecalculating:t})=>[...e].sort((n,s)=>{const r=aw({leaf:s}),i=aw({leaf:n});return r-i}).map(n=>{const s=R7({practiceCount:n.practiceCount,isRecalculating:t});return s===void 0?t?{value:n.id,label:n.label,isDescriptionShimmering:!0}:{value:n.id,label:n.label}:{value:n.id,label:n.label,description:s}}),Nie=({article:e})=>e.article.trim(),wie=({leaves:e,leafId:t,catalogueArticles:n})=>{if(t===null)return[];const s=e.find(r=>r.id===t);return s===void 0?[]:s.articles.map(r=>({text:Nie({article:r}),legalBaseRef:bie({article:r,catalogueArticles:n})}))},k7=({leaves:e,leafId:t})=>{if(t===null)return;const n=e.find(i=>i.id===t);if(n===void 0)return;const s=n.practiceFilters;if(!s)return;const r={pleaStatuses:s.pleaStatuses,defenseRequestsGoals:s.defenseRequestsGoals,defenseRequestsLaws:s.defenseRequestsLaws};return s.argumentDescriptions.length===0?r:{...r,defenseRequestsArgumentDescriptions:s.argumentDescriptions}},y2=({clientId:e,defenseLineId:t})=>{const n=nf(u=>u.defenseTree),s=nf(u=>u.isDefenseTreeReady),r=Dm(u=>{if(!e||!t)return!1;const d=u.deferFetchDefenseLineIdsByClient[e];return!(!d||!d[t])}),i=l.useMemo(()=>e?t?_m({clientId:e,defenseLineId:t}):["clientDefenseLineDefenseTree",e]:["clientDefenseLineDefenseTree"],[e,t]),{data:o}=Vt({queryKey:i,queryFn:({signal:u})=>{if(!e||!t)throw new Error("Missing client or defense line id");return Uv({clientId:e,defenseLineId:t,signal:u})},enabled:!!e&&!!t&&!r,staleTime:l7,gcTime:c7,refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1});return{effectiveTree:l.useMemo(()=>Iie({defenseLineTree:o,fallbackTree:n}),[o,n]),defenseLineTree:o,isFallbackReady:s}},Rie=({clientId:e,defenseLineId:t,hasDefenseLineTree:n,defenseLineTreeUpdatedAt:s})=>{const{id:r}=st(),i=bt(),o=l.useRef(new Set),c=su(u=>{if(r&&t)return u.defenseTreeRefreshBaselinesByClientId[r]?.[t]});l.useEffect(()=>{r&&(nie({clientId:r}
854),o.current=new Set)},[r,t]),l.useEffect(()=>{if(!r||!e||e!==r||!t||c===void 0||!n)return;if(c===null){su.getState().clearDefenseTreeRefreshBaselineForLine({clientId:r,defenseLineId:t});return}if(E2({baselineUpdatedAt:c,nextUpdatedAt:s})){su.getState().clearDefenseTreeRefreshBaselineForLine({clientId:r,defenseLineId:t});return}const d=`${r}/${t}/${c}`;o.current.has(d)||(o.current.add(d),x2({queryClient:i,clientId:r,defenseLineId:t}))},[r,e,t,n,s,c,i])},Die=({clientId:e,defenseLineId:t})=>{const{id:n}=st(),s=bt(),r=Dm(i=>{if(!e||e!==n||!t)return!1;const o=i.deferFetchDefenseLineIdsByClient[e];return!(!o||!o[t])});l.useEffect(()=>{e&&e===n&&t&&r&&(rie({clientId:e,defenseLineId:t})||x2({queryClient:s,clientId:e,defenseLineId:t,pollMode:"untilUpdatedAtReady"}))},[e,n,t,r,s])},mE=({text:e})=>{const t=e.split(/\n\n+/).filter(n=>n.trim());return t.length?t.map(n=>`	${n.trim()}`).join(`
855
856`):e.trim()},lw=({partNumber:e,content:t})=>{if(!t?.trim())return;const n=mE({text:t.trim()});return e?.trim()?`${e.trim()}. ${n.replace(/^\t/,"")}`:n},kie=({clauseNumber:e,content:t})=>{const n=mE({text:t.trim()});return`${e.trim()}) ${n.replace(/^\t/,"")}`},Oie=({model:e,anchorId:t})=>{if(t){for(const n of e.codexPartBlocks)for(const s of n)if(s.anchorId===t)return s}},O7=e=>"vsrfId"in e,Pie=e=>!O7(e),Lie=()=>{let e="",t=0;return{append:({value:s,separatorBefore:r})=>{r&&t>0&&(e+=r,t+=r.length);const i=t;return e+=s,t+=s.length,{text:s,start:i,end:t}},getPlainText:()=>e}},Mie=({hasContent:e,separatorBefore:t})=>e?`
857`:t,Wd=({blocks:e,separatorBefore:t})=>e.length?`
858
859`:t,b2=({rawNumber:e,index:t})=>{const n=e?.trim();return n?n.replace(/\s+/g,"-"):`${t+1}`},Th=({builder:e,editionInfo:t,content:n,separatorBefore:s,kind:r,anchorId:i})=>{const o={kind:r};if(n?.trim()&&(o.content=e.append({value:n.trim(),separatorBefore:s})),t?.trim()&&(o.editionInfo=e.append({value:t.trim(),separatorBefore:Mie({hasContent:!!o.content,separatorBefore:s})})),!(!o.editionInfo&&!o.content))return i&&(o.anchorId=i),o},jie=({builder:e,subItem:t,subItemIndex:n,parentAnchorId:s,separatorBefore:r})=>Th({builder:e,editionInfo:t.editionInfo,content:mE({text:t.content}),separatorBefore:r,kind:"subItem",anchorId:`${s}-sub-${b2({rawNumber:t.subItemNumber,index:n})}`}),Bie=({builder:e,clause:t,clauseIndex:n,parentAnchorId:s,separatorBefore:r})=>{const i=[],o=`${s}-clause-${b2({rawNumber:t.clauseNumber,index:n})}`,c=Th({builder:e,editionInfo:t.editionInfo,content:kie({clauseNumber:t.clauseNumber,content:t.content}),separatorBefore:Wd({blocks:i,separatorBefore:r}),kind:"clause",anchorId:o});return c&&i.push(c),(t.subItems??[]).forEach((u,d)=>{const p=jie({builder:e,subItem:u,subItemIndex:d,parentAnchorId:o,separatorBefore:Wd({blocks:i,separatorBefore:r})});p&&i.push(p)}),i},Fie=({builder:e,part:t,partIndex:n,separatorBefore:s})=>{const r=[],i=t.clauses??[],o=`part-${b2({rawNumber:t.partNumber,index:n})}`;if(i.length){const d=Th({builder:e,editionInfo:t.editionInfo,content:lw({partNumber:t.partNumber,content:t.content}),separatorBefore:Wd({blocks:r,separatorBefore:s}),kind:"part",anchorId:o});
859return d&&r.push(d),i.forEach((p,g)=>{const A=Bie({builder:e,clause:p,clauseIndex:g,parentAnchorId:o,separatorBefore:Wd({blocks:r,separatorBefore:s})});A.length&&r.push(...A)}),r}const c=t.resolvedText??t.content,u=Th({builder:e,editionInfo:t.editionInfo,content:lw({partNumber:t.partNumber,content:c}),separatorBefore:Wd({blocks:r,separatorBefore:s}),kind:"part",anchorId:o});if(u&&r.push(u),t.punishment?.trim()){const d=Th({builder:e,content:mE({text:t.punishment}),separatorBefore:Wd({blocks:r,separatorBefore:s}),kind:"punishment"});d&&r.push(d)}return r},Uie=({builder:e,note:t})=>{if(t)return e.append({value:t,separatorBefore:`
860
861`})},P7=({article:e})=>{if(O7(e))return{plainText:e.content,codexPartBlocks:[]};if(!Pie(e))return{plainText:"",codexPartBlocks:[]};const t=Lie(),n=e.resolvedNotes??e.notes,s=Uie({builder:t,note:n});e.editionInfo?.trim()&&t.append({value:e.editionInfo.trim(),separatorBefore:`
862
863`});const r=[];return(e.parts??[]).forEach((i,o)=>{const c=Fie({builder:t,part:i,partIndex:o,separatorBefore:`
864
865`});c.length&&r.push(c)}),{plainText:t.getPlainText(),note:s,codexPartBlocks:r}},I2=e=>"vsrfId"in e,S2=e=>!I2(e),zie=({articleDetail:e})=>{if(e.number)return`Статья ${e.number}`},Qie=({articleDetail:e})=>e.title,Hie=({articleDetail:e})=>{if(e&&e.baseName)return e.baseName},Vie=({articleDetail:e})=>{if(!e)return"";if(I2(e))return Qie({articleDetail:e});const t=zie({articleDetail:e});return t?`${t}. ${e.title.toUpperCase()}`:e.title},Gie=({articleDetail:e})=>{if(e&&S2(e))return e.resolvedNotes??e.notes},qie=220,Wie=({articleDetail:e})=>I2(e)||S2(e)?e.title:"",Kie=({articleDetail:e})=>{if(!e)return"";const t=Wie({articleDetail:e});return t?t.toUpperCase():""},$ie=({model:e,targetAnchorId:t})=>{if(!t)return 0;for(const n of e.codexPartBlocks)for(const s of n)if(s.anchorId===t){if(s.content)return s.content.start;if(s.editionInfo)return s.editionInfo.start}return 0},Yie=({articleDetail:e,targetAnchorId:t})=>{if(!e)return"";const n=P7({article:e}),s=$ie({model:n,targetAnchorId:t});return ju({text:n.plainText.slice(s),maxLength:qie,preserveLineBreaks:!0})},Xie=1e3*60*5,L7=({baseId:e,articleId:t,onReadFull:n,onRequestClose:s,onReadyChange:r,targetAnchorId:i})=>{const{data:o,isLoading:c,isError:u}=Vt({queryKey:["legalBaseArticle",e,t],queryFn:()=>e7({baseId:e,articleId:t}),staleTime:Xie});l.useEffect(()=>{if(r){if(c){r({isReady:!1});return}if(u){r({isReady:!1});return}if(!o){r({isReady:!1});return}r({isReady:!0})}},[o,u,c,r]);const d=l.useMemo(()=>Kie({articleDetail:o}),[o]),p=l.useMemo(()=>Yie({articleDetail:o,targetAnchorId:i}),[o,i]),g=l.useCallback(A=>{A.stopPropagation(),n(),s?.()},[n,s]);return c||u||!o?null:a.jsxs("div",{className:"w-72 max-w-72 whitespace-normal wrap-break-word",children:[!!d&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] text-white uppercase",children:d}),!!p&&a.jsx("div",{className:"roboto-flex-100-400-1 mt-2 whitespace-pre-wrap text-[14px] leading-[16px] text-white",children:p}),a.jsxs("button",{type:"button",className:"roboto-flex-100-400-1 mt-2 inline-flex cursor-pointer items-center gap-0.5 text-[14px] leading-[16px] text-zinc-400 hover:text-zinc-200",onClick:g,children:[h.clients.legalBase.article.READ_FULL,a.jsx(Rm,{className:"size-3.5 shrink-0 mt-0.5","aria-hidden":!0})]})]})};Dse(L7);const M7=({defenseLineId:e})=>["clients","{clientId}","defense-lines",e],Jie=({clientId:e,defenseLine:t,leaves:n,episodes:s,isFieldsDisabled:r,isPracticeRecalculating:i,onReadFullArticle:o})=>{const c=kn(E=>E.catalogues?.articles),u=l.useMemo(()=>Tie({leaves:n,isRecalculating:i}),[n,i]),d=l.useMemo(()=>gc({episodes:s,articles:c}),[s,c]),p=l.useMemo(()=>wie({leaves:n,leafId:t?.leafId??null,catalogueArticles:c}),[n,t?.leafId,c]),g=l.useMemo(()=>p.map(E=>{const x=E.legalBaseRef;if(x)return a.jsx(L7,{baseId:x.baseId,articleId:x.articleId,targetAnchorId:x.anchorId,onReadFull:()=>o({baseId:x.baseId,articleId:x.articleId,anchorId:x.anchorId})})}),[p,o]),A=l.useCallback(({index:E})=>{const x=p[E]?.legalBaseRef;x&&o({baseId:x.baseId,articleId:x.articleId,anchorId:x.anchorId})},[p,o]);return l.useMemo(()=>
865{if(!t)return{rows:[]};if(!e)return{rows:[]};const E=M7({defenseLineId:t.id}),x=i?h.client.defenseLines.placeholders.DEFENSE_LINE_SEARCHING:h.client.defenseLines.placeholders.DEFENSE_LINE;return{rows:[{customSelect:{isDisabled:r,isSearchable:!0,label:h.client.defenseLines.fields.DEFENSE_LINE,placeholder:x,value:t.leafId??"",options:u,patch:{endpoint:E,field:"leafId"}}},{textarea:{isDisabled:r,label:h.client.defenseLines.fields.THESIS,value:t.thesis??"",placeholder:h.client.defenseLines.placeholders.THESIS,patch:{endpoint:E,field:"thesis"}}},{customSelect:{isDisabled:r,label:h.client.defenseLines.fields.EPISODE,placeholder:h.client.defenseLines.placeholders.EPISODE,value:t.episodeId??"",options:d,patch:{endpoint:E,field:"episodeId"}}},{evidenceLinks:{isDisabled:r,label:h.client.defenseLines.fields.EVIDENCE,evidenceIds:t.evidenceIds,patch:{endpoint:E,field:"evidenceIds"}}},{text:{type:"array",label:h.client.defenseLines.fields.NORMATIVE,placeholder:h.client.defenseLines.placeholders.NORMATIVE,value:p.map(I=>I.text),arrayItemTooltips:g,arrayItemOnClick:A}},{textarea:{isDisabled:r,label:h.client.defenseLines.fields.COMMENT,value:t.comment??"",placeholder:h.client.defenseLines.placeholders.COMMENT,patch:{endpoint:E,field:"comment"}}}]}},[e,t,d,r,i,u,p,g,A])},Zie=({leafId:e,hasLeaf:t,isRecalculating:n})=>{const s=at(),r=Fe(),i=l.useCallback(()=>{if(n)return;t||ve({type:"warning",message:h.client.defenseLines.practice.NO_LEAF_WARNING});const o=r.state??{};s(r.pathname,{state:{...o,isPreventScrollToTop:!0,practicePopupOpen:!0,practicePopupLeafId:e}})},[t,n,e,s,r.pathname,r.state]);return a.jsxs("button",{type:"button",onClick:i,disabled:n,className:Y("mb-4 inline-flex items-center gap-1 rounded pl-1 pr-2 h-6","roboto-flex-100-400-1 text-[14px] leading-[16px] transition-colors",!!n&&"bg-amber-50 text-zinc-950 cursor-default",!!(!n&&t)&&"bg-sky-50 text-zinc-950 hover:bg-sky-100 cursor-pointer",!n&&!t&&"bg-zinc-50 text-zinc-400 hover:bg-zinc-100 cursor-pointer"),children:[!!n&&a.jsx(Co,{className:"size-4 shrink-0 animate-spin text-zinc-400","aria-hidden":!0}),!n&&a.jsx(Rm,{className:"size-4 shrink-0 text-zinc-400","aria-hidden":!0}),a.jsx("span",{children:h.client.defenseLines.practice.LINK})]})},al=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_10604_7246)"},l.createElement("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_10604_7246"},l.createElement("rect",{width:20,height:20,fill:"white"})))),j7=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17313_23091)"},l.createElement("circle",{cx:10.4167,cy:9.58341,r:7.91667,stroke:"currentColor",strokeWidth:2}),l.createElement("path",{d:"M1.66406 18.3334L4.58073 15.4167",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17313_23091"},l.createElement("rect",{width:20,height:20,fill:"white",transform:"matrix(-1 0 0 1 20 0)"})))),$A=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17313_12906)"},l.createElement("path",{d:"M4 20H20",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12 14V4",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12 14L16 10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12 14L8 10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17313_12906"},l.createElement("rect",{width:24,height:24,fill:"white"})))),gE=({placeholder:e,searchTag:t,isDownloadHidden:n=!1,isMatchNavigationHidden:s=!1,searchValue:r="",isSearchActive:i=!1,matchesLength:o=0,activeMatchIndexNormalized:c=0,onFindShortcut:u=()=>{},onSearchValueChange:d=()=>{},onClearSearchClick:p=()=>{},onPrevMatchClick:g=()=>{},onNextMatchClick:A=()=>{},onDownloadVerdictClick:E=()=>{},isDownloadVerdictPending:x=!1})=>{const y=l.useRef(null),I=l.useCallback(({shouldSelectText:w})=>{y.current&&(y.current.focus({preventScroll:!0}),w&&y.current.select())},[]),v=l.useCallback(w=>{if(w.key==="Escape"){w.preventDefault(),p();return}if(!(!o||s)){if(w.key==="Enter"){if(w.preventDefault(),!w.shiftKey){A();return}g()}w.key==="ArrowDown"&&(w.preventDefault(),A()),w.key==="ArrowUp"&&(w.preventDefault(),g())}},[s,o,p,A,g]),S=l.useCallback(()=>{I({shouldSelectText:!0})},[I]),b=l.useCallback(w=>{w.stopPropagation(),t?.onClose()},[t]);return l.useEffect(()=>{const w=_=>{const N=_.key.toLowerCase();(_.ctrlKey||_.metaKey)&&(_.code==="KeyF"||N==="f")&&(_.preventDefault(),u(),I({shouldSelectText:!0}))};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[I,u]),a.jsx(a.Fragment,{children:a.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 w-full max-w-[580px] bp56_25:max-w-[680px] bp72:max-w-[848px] px-4 group z-20",children:a.jsxs("div",{className:"h-12 bg-white rounded-full shadow-[0_8px_16px_rgba(0,0,0,0.08),0_0_4px_rgba(0,0,0,0.04)] border border-zinc-200 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[a.jsx("div",{className:"w-11 h-12 pl-3 flex items-center justify-center cursor-pointer shrink-0",onClick:S,children:a.jsx(j7,{className:"size-5 text-zinc-400 group-hover:text-zinc-500"})}),!!t&&a.jsxs("div",{className:"flex items-center gap-1 pl-3 pr-2 mr-2 py-2 bg-zinc-950 rounded-full shrink-0 h-[32px]",children:[a.jsx("span",{className:"roboto-flex-25-700-1 text-[14px] leading-[16
865px] text-zinc-100 whitespace-nowrap uppercase",children:t.label}),a.jsx("button",{type:"button",onClick:b,className:"flex items-center justify-center size-5 text-white cursor-pointer",children:a.jsx(g2,{className:"size-4"})})]}),a.jsx("input",{ref:y,value:r,onChange:w=>d(w.target.value),onKeyDown:v,placeholder:e,className:"h-12 flex-1 min-w-0 outline-none bg-transparent roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 placeholder:text-zinc-400 pr-4"})]}),a.jsxs("div",{className:"flex items-center",children:[!!i&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:p,className:"w-14 h-12 pl-3 pr-3 flex items-center justify-center text-zinc-400 hover:text-zinc-500 cursor-pointer",children:a.jsx(ga,{className:"size-5"})}),!s&&a.jsxs(a.Fragment,{children:[a.jsx("figure",{className:"min-w-0 w-px bg-zinc-200 h-6 mr-3"}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 whitespace-nowrap w-[78px] min-w-0",children:[o?c+1:0," из"," ",o]}),a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("button",{type:"button",onClick:g,disabled:!o,className:Y("w-10 h-12 pl-2 flex items-center justify-center",!!o&&"text-zinc-400 hover:text-zinc-500 cursor-pointer",!o&&"text-zinc-300 cursor-default"),children:a.jsx(al,{className:"size-6 rotate-180"})}),a.jsx("button",{type:"button",onClick:A,disabled:!o,className:Y("w-10 h-12 pr-2 flex items-center justify-center",!!o&&"text-zinc-400 hover:text-zinc-500 cursor-pointer",!o&&"text-zinc-300 cursor-default"),children:a.jsx(al,{className:"size-6"})})]})]})]}),!n&&a.jsxs(a.Fragment,{children:[a.jsx("figure",{className:"min-w-0 w-px bg-zinc-200 h-6"}),a.jsx(Ls,{text:h.client.cases.caseSource.tooltips.DOWNLOAD_VERDICT,isClampToParent:!1,isFollowCursor:!1,isBelow:!1,isDisableOnTouch:!0,disabled:x,children:a.jsx("button",{className:Y("w-13 h-12 pl-2 pr-3 flex items-center justify-center",!!x&&"text-zinc-400 cursor-default",!x&&"text-zinc-400 hover:text-zinc-500 cursor-pointer"),type:"button",disabled:x,onClick:E,children:a.jsx($A,{className:"size-6"})})})]})]})]})})})},eoe=200,v2=({initialSearchValue:e,debounceMs:t=eoe}={})=>{const n=l.useRef(null),s=e?.trim()??"",[r,i]=l.useState(s),[o,c]=l.useState(s),u=l.useCallback(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null)},[]),d=l.useCallback(g=>{i(g),g.trim()||(u(),c(""))},[u]),p=l.useCallback(()=>{u(),i(""),c("")},[u]);return l.useEffect(()=>(u(),n.current=window.setTimeout(()=>{c(r.trim())},t),()=>{u()}),[u,t,r]),l.useEffect(()=>{u();const g=e?.trim()??"";i(g),c(g)},[u,e]),{searchValue:r,debouncedSearchValue:o,isSearchActive:!!o,handleSearchValueChange:d,handleClearSearchClick:p}},B7=({content:e,isContentLoading:t=!1,scrollContainerRef:n,contentRef:s,initialSearchTerms:r})=>{const i=l.useMemo(()=>({a:"а",c:"с",e:"е",h:"н",k:"к",m:"м",o:"о",p:"р",t:"т",x:"х",y:"у",b:"в"}),[]),o=l.useRef([]),c=l.useRef(null),u=l.useRef(null),d=l.useRef(!1),p=Fe(),g=l.useMemo(()=>p.state?.initialSearchPickMode==="last"?"last":"first",[p.state]),A=l.useMemo(()=>{const se=sr(r);if(se.length)return se;const me=p.state,de=sr(me?.initialSearchTerms);if(de.length)return de},[r,p.state]),E=!!A?.length,[x,y]=l.useState(0),[I,v]=l.useState(0),[S,b]=l.useState(""),[w,_]=l.useState(()=>E?"preparing":"idle"),N=l.useMemo(()=>w==="preparing"||w==="centering",[w]),R=l.useCallback(({node:se,matchIndex:me,isActive:de})=>{o.current[me]=se,de&&(u.current=se)},[]),D=l.useCallback(()=>{const se=n?.current;se&&(se.scrollTop=0)},[n]),{searchValue:k,debouncedSearchValue:L,isSearchActive:O,handleSearchValueChange:P,handleClearSearchClick:B}=v2(),F=l.useCallback((se,me)=>me<=0?0:(se%me+me)%me,[]),z=l.useCallback(se=>{ye.current=!0,P(se),se.trim()||(y(0),o.current=[])},[P]),Q=l.useCallback(()=>{c.current=null},[]),M=l.useCallback(({reason:se})=>{Q(),c.current=se,v(me=>me+1)},[Q]),K=l.useCallback(se=>se.rangeCount?se.getRangeAt(0):null,[]),W=l.useCallback(({contentNode:se,selectionRange:me})=>{if(!me.intersectsNode(se))return null;const ge=document.createRange();ge.selectNodeContents(se);const Pe=me.cloneRange();return me.compareBoundaryPoints(Range.START_TO_START,ge)<0&&Pe.setStart(ge.startContainer,ge.startOffset),me.compareBoundaryPoints(Range.END_TO_END,ge)>0&&Pe.setEnd(ge.endContainer,ge.endOffset),Pe.collapsed?null:Pe},[]),H=l.useCallback(()=>{const se=window.getSelection();if(!se||se.isCollapsed)return;const me=K(se);if(!me||!se.toString().replace(/\s+/g," ").trim())return;const ge=s?.current;!ge||!W({contentNode:ge,selectionRange:me})||(se.removeAllRanges(),Q())},[Q,s,K,W]),j=l.useCallback(()=>{B(),Q(),y(0),o.current=[]},[Q,B]),q=l.useCallback(se=>{const me=se.toLowerCase(),de=me==="ё"?"е":me,ge=i[de];return ge||de},[i]),G=l.useCallback(se=>/[a-zа-я0-9]/.test(se),[]),$=l.useCallback(se=>/[a-zа-я]/.test(se),[]),J=l.useCallback(({text:se})=>{const me=[];let de="",ge=[];for(let Pe=0;Pe<se.length;Pe+=1){const Ue=q(se[Pe]);if(!G(Ue)){if(!de)continue;me.push({text:de,originalIndices:ge}),de="",ge=[];continue}de+=Ue,ge.push(Pe)}return de&&me.push({text:de,originalIndices:ge}),me},[G,q]),ne=l.useCallback(({tokens:se})=>{const me=[];let de=0;for(;de<se.length;){const ge=se[de];if(!(ge.text.length===1&&$(ge.text))){me.push(ge),de+=1;continue}let Ue=de;for(;Ue<se.length;){const dt=se[Ue];if(!(dt.text.length===1&&$(dt.text)))break;Ue+=1}
865if(Ue-de<4){me.push(ge),de+=1;continue}const nt=se.slice(de,Ue),At=nt.map(dt=>dt.text).join(""),ht=nt.flatMap(dt=>dt.originalIndices);me.push({text:At,originalIndices:ht}),de=Ue}return me},[$]),X=l.useCallback(({text:se,tokens:me})=>{const de=[];if(me.length<2)return de;for(let ge=0;ge<me.length-1;ge+=1){const Pe=me[ge],Ue=me[ge+1],Be=Pe.originalIndices[Pe.originalIndices.length-1],nt=Ue.originalIndices[0];let At=!1,ht=!1;for(let dt=Be+1;dt<nt;dt+=1){const Gt=se[dt];if(/\s/.test(Gt)){At=!0;continue}ht=!0}de.push({hasWhitespace:At,hasSpecial:ht,originalIndex:nt-1})}return de},[]),oe=l.useCallback(({text:se})=>{const me=ne({tokens:J({text:se})});if(!me.length)return[];const de=X({text:se,tokens:me}),ge=[];return me.forEach((Pe,Ue)=>{for(let At=0;At<Pe.text.length;At+=1)ge.push({kind:"char",value:Pe.text[At],originalIndex:Pe.originalIndices[At]});if(Ue===me.length-1)return;const nt=de[Ue];nt&&ge.push({kind:"separator",hasWhitespace:nt.hasWhitespace,hasSpecial:nt.hasSpecial,originalIndex:nt.originalIndex})}),ge},[J,X,ne]),ie=l.useCallback(({text:se})=>{const me=oe({text:se});return me.length?me.map(ge=>ge.kind==="char"?ge.value:" ").join(""):""},[oe]),ee=l.useCallback(({textUnits:se,queryUnits:me,startTextUnitIndex:de})=>{const ge=new Set,Pe=({textUnitIndex:Ue,queryUnitIndex:Be})=>{if(Be===me.length)return Ue;if(Ue>se.length)return null;const nt=`${Ue}:${Be}`;if(ge.has(nt))return null;const At=me[Be];if(!At)return null;if(At.kind==="char"){const Cn=se[Ue];if(Cn?.kind==="separator"&&Cn.hasSpecial){const Zr=Pe({textUnitIndex:Ue+1,queryUnitIndex:Be});if(typeof Zr=="number")return Zr}if(!(Cn?.kind==="char"&&Cn.value===At.value))return ge.add(nt),null;const Rr=Pe({textUnitIndex:Ue+1,queryUnitIndex:Be+1});return typeof Rr=="number"?Rr:(ge.add(nt),null)}if(At.hasWhitespace){const Cn=se[Ue];if(Cn?.kind!=="separator"||!Cn.hasWhitespace&&!Cn.hasSpecial)return ge.add(nt),null;const wr=Pe({textUnitIndex:Ue+1,queryUnitIndex:Be+1});return typeof wr=="number"?wr:(ge.add(nt),null)}const dt=Pe({textUnitIndex:Ue,queryUnitIndex:Be+1});if(typeof dt=="number")return dt;if(!(se[Ue]?.kind==="separator"))return ge.add(nt),null;const _n=Pe({textUnitIndex:Ue+1,queryUnitIndex:Be+1});return typeof _n=="number"?_n:(ge.add(nt),null)};return Pe({textUnitIndex:de,queryUnitIndex:0})},[]),te=l.useCallback(({text:se,query:me})=>{const de=oe({text:se}),ge=oe({text:me});if(!de.length)return[];if(!ge.length)return[];if(ge[0]?.kind!=="char")return[];const Pe=[],Ue=ge[0].value;for(let Be=0;Be<de.length;Be+=1){const nt=de[Be];if(!(nt.kind==="char"&&nt.value===Ue))continue;const ht=ee({textUnits:de,queryUnits:ge,startTextUnitIndex:Be});if(typeof ht!="number"||ht<=Be)continue;let dt=ht-1;for(;dt>=Be&&de[dt]?.kind!=="char";)dt-=1;if(dt<Be)continue;const Gt=de[dt];Gt&&Gt.kind==="char"&&Pe.push({start:nt.originalIndex,end:Gt.originalIndex+1})}return Pe},[oe,ee]),le=l.useMemo(()=>L?e?te({text:e,query:L}):[]:[],[e,L,te]),he=l.useMemo(()=>le.length&&g==="last"?le.length-1:0,[g,le.length]);l.useEffect(()=>{if(d.current=!1,b(""),!E){_("idle");return}if(t){_("preparing");return}if(!e){_("done");return}_("preparing")},[e,E,t,p.key]),l.useEffect(()=>{if(!e||!E||d.current)return;const se=A.find(de=>te({text:e,query:de}).length>0);if(d.current=!0,se){b(se),z(se);return}const me=A[0];if(!me){b(""),_("done"),D();return}b(me),z(me)},[e,E,A,te,z,D]);const fe=l.useMemo(()=>S?ie({text:S}):"",[S,ie]),ue=l.useMemo(()=>L?ie({text:L}):"",[ie,L]),ye=l.useRef(!1),ce=l.useRef(!1),xe=l.useRef(!1);l.useEffect(()=>{ye.current=!1,ce.current=!1,xe.current=!1},[fe]),l.useEffect(()=>{if(e&&fe&&!ye.current&&L&&ue===fe){if(le.length){if(ce.current=!1,xe.current)return;y(he),M({reason:"initialState"}),_("centering"),xe.current=!0;return}ce.current||(ce.current=!0,ve({type:"failed",message:h.client.cases.caseSource.messages.NO_EXACT_MATCH_TOAST,key:"CASE_SOURCE_NO_EXACT_MATCH"}),D(),y(0),o.current=[],_("done"))}},[fe,e,L,ue,le.length,D,he,M]);const re=l.useMemo(()=>F(x,le.length),[x,F,le.length]),pe=l.useCallback(()=>{le.length&&(M({reason:"navigation"}),y(se=>F(se-1,le.length)))},[F,le.length,M]),_e=l.useCallback(()=>{le.length&&(M({reason:"navigation"}),y(se=>F(se+1,le.length)))},[F,le.length,M]),Le=l.useMemo(()=>
865{if(o.current=[],u.current=null,!L||!le.length)return e;const se=[],me={value:0};return le.forEach((de,ge)=>{me.value<de.start&&se.push(e.slice(me.value,de.start));const Pe=ge===re,Ue=e.slice(de.start,de.end);se.push(a.jsx("span",{ref:Be=>{R({node:Be,matchIndex:ge,isActive:Pe})},className:Y(Pe&&"bg-amber-300",!Pe&&"bg-amber-200"),children:Ue},`match-${de.start}-${de.end}-${ge}`)),me.value=de.end}),me.value<e.length&&se.push(e.slice(me.value)),se},[re,R,e,L,le]),Ee=l.useCallback(({text:se,startOffset:me})=>{if(!L||!le.length)return se;const de=me+se.length,ge=[];if(le.forEach((Be,nt)=>{if(Be.end<=me||Be.start>=de)return;const At=Math.max(0,Be.start-me),ht=Math.min(se.length,Be.end-me);ht<=At||ge.push({localStart:At,localEnd:ht,globalIndex:nt})}),!ge.length)return se;const Pe=[],Ue={value:0};return ge.forEach(({localStart:Be,localEnd:nt,globalIndex:At})=>{Ue.value<Be&&Pe.push(se.slice(Ue.value,Be));const ht=At===re,dt=se.slice(Be,nt);Pe.push(a.jsx("span",{ref:Gt=>{R({node:Gt,matchIndex:At,isActive:ht})},className:Y(ht&&"bg-amber-300",!ht&&"bg-amber-200"),children:dt},`segment-match-${me}-${Be}-${At}`)),Ue.value=nt}),Ue.value<se.length&&Pe.push(se.slice(Ue.value)),Pe},[re,R,L,le]);return l.useEffect(()=>{N||(Q(),y(0),L.trim()&&M({reason:"typing"}))},[Q,L,N,M]),l.useLayoutEffect(()=>{const se=c.current;if(!se)return;const me=se==="initialState";if(N&&!me||!le.length)return;const de=n?.current;if(!de)return;const ge=o.current[re]??u.current;if(!ge)return;const Pe=ge.getBoundingClientRect(),Ue=de.getBoundingClientRect(),Be=Pe.top-Ue.top,nt=de.scrollTop+Be-de.clientHeight/2+Pe.height/2,At=Math.max(de.scrollHeight-de.clientHeight,0),ht=Math.min(Math.max(nt,0),At);de.scrollTop=ht,me&&_("done"),c.current=null},[re,I,L,N,le.length,n]),l.useEffect(()=>()=>{Q()},[Q]),{searchValue:k,isSearchActive:O,isInitialSearchResolving:N,matchesLength:le.length,activeMatchIndexNormalized:re,renderedContent:Le,renderHighlightedTextSegment:Ee,handleFindShortcut:H,handleSearchValueChange:z,handleClearSearchClick:j,handlePrevMatchClick:pe,handleNextMatchClick:_e}},toe=({block:e,renderSegmentText:t})=>a.jsxs("div",{className:"flex flex-col",children:[!!e.content&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 whitespace-pre-wrap indent-8",children:t({segment:e.content})}),!!e.editionInfo&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 whitespace-pre-wrap",children:t({segment:e.editionInfo})})]}),noe=({partBlocks:e,renderSegmentText:t})=>a.jsx("div",{className:"flex flex-col gap-4",children:e.map((n,s)=>a.jsx("div",{className:"flex flex-col gap-4",children:n.map((r,i)=>a.jsx(toe,{block:r,renderSegmentText:t},`part-${s}-block-${i}`))},`part-${s}`))}),soe=1e3*60*5,F7=({baseId:e,articleId:t,onClose:n,targetAnchorId:s})=>{const r=l.useRef(null),i=l.useRef(null),{data:o,isLoading:c,isSuccess:u,isError:d}=Vt({queryKey:["legalBaseArticle",e,t],queryFn:()=>{if(!t)throw new Error("Missing article id");return e7({baseId:e,articleId:t})},enabled:!!t,staleTime:soe}),p=l.useMemo(()=>{if(o)return P7({article:o})},[o]),g=l.useMemo(()=>!(!o||!S2(o)),[o]),A=l.useMemo(()=>{if(!p)return;const B=Oie({model:p,anchorId:s});if(!B?.content)return;const F=B.content.text.split(`
866`).map(z=>z.trim()).find(z=>z.length>0);if(F)return[F]},[p,s]),{searchValue:E,isSearchActive:x,isInitialSearchResolving:y,matchesLength:I,activeMatchIndexNormalized:v,renderedContent:S,renderHighlightedTextSegment:b,handleFindShortcut:w,handleSearchValueChange:_,handleClearSearchClick:N,handlePrevMatchClick:R,handleNextMatchClick:D}=B7({content:p?.plainText??"",isContentLoading:c,scrollContainerRef:r,contentRef:i,initialSearchTerms:A}),k=l.useCallback(({segment:B})=>b({text:B.text,startOffset:B.start}),[b]);if(l.useEffect(()=>{t&&(A?.length||N())},[t,A,N]),!t)return null;const L=Vie({articleDetail:o}),O=Hie({articleDetail:o}),P=Gie({articleDetail:o});return a.jsxs(Ws,{onClose:n,isForceAnimateOnStart:!0,isMaxWidthDisabled:!0,contentRef:r,children:[!!c&&!u&&!d&&a.jsx(ct,{isWithWrapper:!0}),!!d&&a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)] px-4",children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 text-center",children:h.clients.legalBase.article.LOAD_ERROR})}),!!u&&a.jsxs("div",{className:Y(!!y&&"opacity-0",!y&&"opacity-100 transition-opacity duration-200"),children:[a.jsxs("div",{className:"px-4 pb-20 max-w-[872px] w-full mx-auto mt-2",children:[a.jsxs("div",{className:"flex flex-col gap-4",children:[!!O&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16
866px] text-zinc-500 px-1.5 py-0.5 bg-zinc-100 rounded-full w-fit",children:O}),a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase",children:L})]}),!!P&&a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 mt-2",children:[!!p?.note&&k({segment:p.note}),!p?.note&&P]}),a.jsxs("div",{ref:i,className:"mt-4",children:[!!g&&!!p&&a.jsx(noe,{partBlocks:p.codexPartBlocks,renderSegmentText:k}),!g&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 whitespace-pre-wrap",children:S})]})]}),a.jsx(gE,{placeholder:h.clients.legalBase.search.ARTICLE_PLACEHOLDER,isDownloadHidden:!0,searchValue:E,isSearchActive:x,matchesLength:I,activeMatchIndexNormalized:v,onFindShortcut:w,onSearchValueChange:_,onClearSearchClick:N,onPrevMatchClick:R,onNextMatchClick:D})]})]})},roe=({lineTree:e,fallbackTree:t})=>Zh(e?{tree:e}:{tree:t}),ioe=e=>e.map(t=>t.data),ooe=({clientId:e,defenseLineIds:t})=>{const n=l.useMemo(()=>e?t.map(r=>({queryKey:_m({clientId:e,defenseLineId:r}),queryFn:({signal:i})=>Uv({clientId:e,defenseLineId:r,signal:i}),enabled:!1,staleTime:l7,gcTime:c7})):[],[e,t]),s=GQ({queries:n,combine:ioe});return l.useMemo(()=>{const r={};return t.forEach((i,o)=>{r[i]=s[o]}),r},[t,s])},cw=({refreshBaseline:e,defenseLineTreeUpdatedAt:t,isDefenseTreeFetchDeferred:n})=>n?!0:!(e===void 0||e===null||E2({baselineUpdatedAt:e,nextUpdatedAt:t})),uw=()=>{const{mainWrapperRef:e,clientData:t,isSuccess:n}=zt(),s=at(),{defenseLineId:r}=st(),i=Fe(),o=l.useRef(null),c=l.useRef(null),u=l.useRef(void 0),[d,p]=l.useState(null),g=nf(X=>X.defenseTree),{isFabulizerReady:A,isOpen:E,status:x}=wt({clientId:t?.id}),{handleAddDefenseLine:y,handleDeleteDefenseLine:I,isAddPending:v,isDeleteOnePending:S}=lie(),b=l.useMemo(()=>(t?.defenseLines??[]).filter(X=>!GA({defenseLine:X})),[t?.defenseLines]),w=l.useMemo(()=>{if(r)return t?.defenseLines?.find(X=>X.id===r);if(b.length)return b[0]},[r,b,t?.defenseLines]),{effectiveTree:_,defenseLineTree:N,isFallbackReady:R}=y2({clientId:t?.id,defenseLineId:w?.id});Rie({clientId:t?.id,defenseLineId:w?.id,hasDefenseLineTree:N!==void 0,defenseLineTreeUpdatedAt:N?.updatedAt}),Die({clientId:t?.id,defenseLineId:w?.id});const D=su(X=>{if(t?.id)return X.defenseTreeRefreshBaselinesByClientId[t.id]}),k=Dm(X=>{if(t?.id)return X.deferFetchDefenseLineIdsByClient[t.id]}),L=l.useMemo(()=>w?.id?cw({refreshBaseline:D?.[w.id],defenseLineTreeUpdatedAt:N?.updatedAt,isDefenseTreeFetchDeferred:k?.[w.id]===!0}):!1,[w?.id,D,N?.updatedAt,k]),O=l.useMemo(()=>Zh({tree:_}),[_]),P=l.useMemo(()=>b.map(X=>X.id),[b]),B=ooe({clientId:t?.id,defenseLineIds:P}),F=l.useMemo(()=>t?.id?b.map((X,oe)=>{const ie=B[X.id],ee=cw({refreshBaseline:D?.[X.id],defenseLineTreeUpdatedAt:ie?.updatedAt,isDefenseTreeFetchDeferred:k?.[X.id]===!0}),te=roe({lineTree:ie,fallbackTree:g});return{title:h.client.defenseLines.titles.LIST_ITEM.replace("{order}",String(oe+1)),to:`/clients/${t.id}/overview/defense-lines/${X.id}`,text:C2({leaves:te,leafId:X.leafId}),instance:Sie({leaves:te,leafId:X.leafId,isRecalculating:ee})}}):[],[t?.id,b,B,D,k,g]),z=l.useCallback(X=>{p(X)},[]),Q=l.useCallback(()=>{p(null)},[]),{rows:M}=Jie({clientId:t?.id,defenseLine:w,leaves:O,episodes:t?.episodes??[],isFieldsDisabled:!1,isPracticeRecalculating:L,onReadFullArticle:z});l.useLayoutEffect(()=>{if(!t?.id||!n)return;if(!b.length&&r){s(`/clients/${t.id}/overview/defense-lines`,{replace:!0});return}if(!r||!b.length)return;(t?.defenseLines??[]).some(oe=>oe.id===r)||s(`/clients/${t.id}/overview/defense-lines`,{replace:!0})},[t?.id,t?.defenseLines,r,b,n,s]);const K=l.useMemo(()=>b.length?r?F.findIndex(X=>!!qs({path:X.to,end:!0},i.pathname)):0:-1,[r,b.length,F,i.pathname]),W=l.useMemo(()=>!(K<0||!w),[K,w]);_s({containerRef:o,activeElementRef:c,isReady:n&&A&&b.length>0,isActive:W});const H=l.useMemo(()=>vie({isOpen:E,status:x}),[E,x]),j=l.useMemo(()=>w?b.findIndex(X=>X.id===w.id):-1,[b,w]),q=w?.leafId??null,G=!!w?.leafId,$=l.useCallback(({isActive:X})=>X?c:null,[]),J=l.useCallback(()=>{w&&I({defenseLineId:w.id})},[w,I]);l.useEffect(()=>()=>{sie()},[]),j>=0&&(u.current=j+1);const ne=u.current;return n?A?t?.id?b.length?R?b.length>0&&!w?a.jsx(ct,{isWithWrapper:!0}):a.jsx(Yn,{headerMode:"withSubMenu",fabulizerMode:H,isLeftColumnPreventScrollPropagation:!1,leftContainerRef:o,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[h.client.defenseLines.titles.LEFT_SECTION,a.jsxs("button",{type:"button",onClick:y,disabled:v,className:"flex items-center gap-1 mr-4 px-1 py-0.5 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400 hover:text-zinc-500 disabled:opacity-50 cursor-pointer",children:[a.jsx(Cf,{className:"size-4 shrink-0"}),h.client.defenseLines.buttons.ADD]})]}),leftColumn:a.jsx("div",{children:F.map((X,oe)=>a.jsx(Ac,{ref:$({isActive:K===oe}),title:X.title,text:X.text,instance:X.instance,to:X.to,isTextBlockLimited:!0,fallbackTo:_ie({index:oe,clientId:t.id})},X.to))}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] bp48:text-[24px] bp48:leading-[24px] uppercase text-zinc-950 pt-4.5 pb-2.5 bp48:pt-0.5 bp48:pb-0",children:[!!ne&&`${h.client.defenseLines.titles.RIGHT_SECTION_TIT
866LE} ${ne}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.defenseLines.kebab.DELETE_ONE,onClick:J,isCloseOnClick:!0,isDisabled:S}]})]}),rightColumn:a.jsxs("div",{children:[!!w&&a.jsx(Zie,{leafId:q,hasLeaf:G,isRecalculating:L}),!!w&&a.jsx(Nt,{clientId:t.id,rows:M,mainWrapperRef:e,scrollOffset:230},w.id),!!d&&a.jsx(F7,{baseId:d.baseId,articleId:d.articleId,targetAnchorId:d.anchorId,onClose:Q})]})}):a.jsx(ct,{isWithWrapper:!0}):a.jsxs("div",{className:"flex w-full min-h-[calc(100dvh-14rem)] flex-col items-center justify-center px-4 py-10",children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.defenseLines.empty.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center max-w-[520px]",children:h.client.defenseLines.empty.DESCRIPTION}),a.jsx(ut,{variant:"h16",type:"button",className:"mt-8 h-16 min-h-16",onClick:y,disabled:v,children:h.client.defenseLines.buttons.ADD})]}):a.jsx(ct,{isWithWrapper:!0}):a.jsx(ct,{isWithWrapper:!0}):a.jsx(ct,{isWithWrapper:!0})},aoe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17781_9475)"},l.createElement("path",{d:"M10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 6.66699V10.0003",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 13.333H10.0083",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17781_9475"},l.createElement("rect",{width:20,height:20,fill:"white"})))),ms=({isDisabled:e=!1,children:t,onClick:n,theme:s="default",type:r="default"})=>{const i=()=>{e||n?.()};if(s==="secondary"){const o=r==="warning";return a.jsxs("div",{className:"flex flex-row items-center gap-2",children:[a.jsxs("div",{role:"button",onClick:i,className:Y("inline-flex items-center gap-1 rounded-sm pl-1 pr-1.5 py-1 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-950 duration-100",o?"bg-amber-50 hover:bg-amber-100":"bg-sky-50 hover:bg-sky-100",!e&&"cursor-pointer",!!e&&"cursor-default text-zinc-300"),children:[a.jsx(Rm,{className:Y("size-4",!e&&"text-zinc-400",!!e&&"text-zinc-300"),"aria-hidden":!0}),a.jsx("span",{children:t})]}),!!o&&a.jsx(Ls,{text:a.jsxs("div",{children:[h.client.cases.links.SOURCE_WARNING_FIRST_LINE," ",a.jsx("br",{}),h.client.cases.links.SOURCE_WARNING_SECOND_LINE]}),isClampToParent:!1,children:a.jsx("div",{className:"flex items-center justify-center cursor-pointer size-6 text-amber-400 hover:text-amber-500",children:a.jsx(aoe,{className:"size-5"})})})]})}return a.jsx("div",{role:"button",onClick:i,className:Y("inline-block roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase underline",!e&&"text-zinc-400 hover:text-zinc-500 cursor-pointer",!!e&&"text-zinc-300 cursor-default"),children:t})},loe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_7848_27076)"},l.createElement("path",{d:"M15.0013 6.66663H8.33464C7.41416 6.66663 6.66797 7.41282 6.66797 8.33329V15C6.66797 15.9204 7.41416 16.6666 8.33464 16.6666H15.0013C15.9218 16.6666 16.668 15.9204 16.668 15V8.33329C16.668 7.41282 15.9218 6.66663 15.0013 6.66663Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M13.332 6.66671V5.00004C13.332 4.55801 13.1564 4.13409 12.8439 3.82153C12.5313 3.50897 12.1074 3.33337 11.6654 3.33337H4.9987C4.55667 3.33337 4.13275 3.50897 3.82019 3.82153C3.50763 4.13409 3.33203 4.55801 3.33203 5.00004V11.6667C3.33203 12.1087 3.50763 12.5327 3.82019 12.8452C4.13275 13.1578 4.55667 13.3334 4.9987 13.3334H6.66536",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_7848_27076"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Om=({text:e,isBelow:t,successMessage:n,tooltipText:s,notifyKey:r})=>{const i=l.useCallback(async()=>{await navigator.clipboard.writeText(e),ve({type:"success",message:n,duration:3e3,key:r})},[r,n,e]);return a.jsx(Ls,{text:s,isClampToParent:!1,isFollowCursor:!1,isBelow:t,isDisableOnTouch:!0,children:a.jsx("div",{onClick:i,className:"flex items-center gap-1 h-6 w-6 text-zinc-400 hover:text-zinc-950 cursor-pointer",children:a.jsx(loe,{className:"w-5 h-5"})})})},coe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M7.4987 3.33333H12.4987C12.9407 3.33333 13.3646 3.50892 13.6772 3.82148C13.9898 4.13404 14.1654 4.55797 14.1654 4.99999V16.6667L9.9987 14.1667L5.83203 16.6667V4.99999C5.83203 4.55797 6.00763 4.13404 6.32019 3.82148C6.63275 3.50892 7.05667 3.33333 7.4987 3.33333Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),uoe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M2.5 2.5L17.5 17.5",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.8137 3.485C7.0237 3.39083 7.25536 3.33833 7.4987 3.33833H12.4987C12.9407 3.33833 13.3646 3.51393 13.6772 3.82649C13.9898 4.13905 14.1654 4.56297 14.1654 5.005V10.8383M14.1654 14.1667V16.6667L9.9987 14.1667L5.83203 16.6667V5.83333L14.1654 14.1667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),doe=({isSaved:e,isSavingCase:t,handleSaveCase:n,isBelow:s,clampTooltipsToContainer:r})=>{const[i,o]=l.useState(!1);l.useEffect(()=>{if(!t){o(!1);return}const u=setTimeout(()=>{o(!0)},200);return()=>{clearTimeout(u)}},[t]);const c=l.useMemo(()=>{const u="flex items-center justify-center h-6 w-6 text-zinc-400 select-none";return t?Y(u,"cursor-default"):Y(u,"hover:text-zinc-950 cursor-pointer")},[t]);return a.jsxs("div",{className:c,onClick:n,children:[!!(t&&i)&&a.jsx(Co,{className:"size-5 animate-spin text-zinc-400"}),(!t||!i)&&a.jsxs(a.Fragment,{children:[!!e&&a.jsx(Ls,{text:h.client.cases.placeholders.UNSAVE_CASE,isClampToParent:!1,isFollowCursor:!1,isBelow:s,clampToScrollContainer:r,isDisableOnTouch:!0,children:a.jsx(uoe,{className:"size-5"})}),!e&&a.jsx(Ls,{text:h.client.cases.placeholders.SAVE_CASE,isClampToParent:!1,isFollowCursor:!1,isBelow:s,clampToScrollContainer:r,isDisableOnTouch:!0,children:a.jsx(coe,{className:"size-5"})})]})]})},foe=rt(async function(t,n){const s=Se.getState().accessToken,r={};n?.searchAfter!=null&&(r.searchAfter=n.searchAfter),n?.limit!=null&&(r.limit=n.limit);const i=Ke(`/clients/${t}/cases/saved/`),o=await qe(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),poe=rt(async function({id:t,clientId:n,isSaved:s,instance:r}){const i=Se.getState().accessToken,o=await qe(Ke(`/clients/${n}/cases/${t}/saved/`),{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({isSaved:s,instance:r})}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),hoe=({clientId:e})=>{const t=bt(),[n,s]=l.useState({});return{patchCase:tt({mutationFn:async({caseId:i,isSaved:o,currentInstance:c})=>{await poe({id:i,clientId:e,isSaved:o,instance:c})},onMutate:({loadingForId:i})=>{s(o=>({...o,[i]:!0}))},onSuccess:(i,{firstInstanceCaseId:o,secondInstanceCaseId:c,isSaved:u})=>{const d=[o,c].filter(p=>p!=null);d.length!==0&&(t.setQueriesData({queryKey:["cases"]},p=>{if(!p)return p;const g=A=>({...A,results:A.results?.map(E=>
866E._id!=null&&d.includes(E._id)?{...E,isSaved:u}:E)??null});return"pages"in p?{...p,pages:p.pages.map(A=>A&&g(A))}:g(p)}),o!=null&&t.setQueryData(["caseFirstInstance",e,o],p=>p!=null?{...p,isSaved:u}:p),c!=null&&t.setQueryData(["caseSecondInstance",e,c],p=>p!=null?{...p,isSaved:u}:p),u||t.setQueriesData({queryKey:["cases","saved"]},p=>{if(!p)return p;const g=A=>({...A,results:A.results?.filter(E=>!E.instances.some(x=>x.instance==="first_instance"&&x.data._id===o||x.instance==="second_instance"&&x.data._id===c))??[],totalResults:Math.max(0,(A.totalResults??0)-1)});return"pages"in p?{...p,pages:p.pages.map(A=>A&&g(A))}:g(p)}))},onError:()=>{ve({type:"failed",message:h.client.cases.messages.SAVE_CASE_FAILED,key:"SAVE_CASE",duration:3e3})},onSettled:(i,o,{loadingForId:c})=>{s(u=>({...u,[c]:!1}))}}).mutate,isPendingMap:n}},Pm=({score:e,tooltipText:t,tooltipPosition:n,size:s="12_20"})=>{const r=l.useMemo(()=>{if(s==="14_24")return"w-[40px] h-[24px] pl-[8px] pr-[6px] py-[4px] text-[14px] leading-[16px]";if(s==="12_20")return"w-[35px] h-[20px] py-[3px] px-[6px] text-[12px] leading-[14px]"},[s]),i=l.useMemo(()=>e===void 0?"bg-red-100 text-red-600":e>80?"bg-green-100 text-green-600":e>60&&e<=80?"bg-amber-100 text-amber-600":"bg-red-100 text-red-600",[e]),o=l.useMemo(()=>e===void 0?"--":e===100?99:e,[e]),c=l.useMemo(()=>a.jsxs("div",{className:Y("roboto-flex-25-700-1","flex","items-center","justify-center","rounded-full",r,i),children:[o,"%"]}),[o,r,i]);return t?a.jsx(Ls,{text:t,isClampToParent:!1,isFollowCursor:!1,position:n,children:c}):c},Ko=({label:e,sourcePath:t,children:n})=>{const s=Is(r=>r.isGridSourcePathVisible);return a.jsxs(To,{isCompact:!0,children:[a.jsx(No,{isCompact:!0,children:a.jsx(tn,{wrapWordBgClassName:"before:bg-white before:absolute before:top-0 before:left-0 before:bottom-0 before:-right-3",text:e})}),a.jsx(wo,{paddingY:"1_0.75",children:a.jsxs("div",{children:[n,!!(s&&t)&&a.jsx("div",{className:"mt-0.5 text-[9px] leading-[14px] text-zinc-400 break-all",children:t})]})})]})},moe=({phase:e})=>{const t=e.fields.sourcePaths;return a.jsxs("div",{className:"mt-2",children:[a.jsx(Ko,{label:h.client.cases.fields.PLEA_STATUS,sourcePath:t?.pleaStatus,children:e.fields.pleaStatus??h.client.cases.placeholders.NOT_SPECIFIED_MASCULINE}),a.jsx(Ko,{label:h.client.cases.fields.VERDICT_STATUS,sourcePath:t?.verdictStatus,children:e.fields.verdictStatus??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.COURT_NAME,sourcePath:t?.courtName,children:e.fields.courtName??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.FELONY_PUNISHMENT,sourcePath:t?.punishment,children:e.fields.punishment??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.FINAL_SENTENCING_PUNISHMENT,sourcePath:t?.finalSentencingPunishment,children:e.fields.finalSentencingPunishment??h.client.cases.placeholders.NOT_SPECIFIED})]})};function goe({appealReviewResultStatus:e}){if(!e)return h.client.cases.placeholders.NOT_SPECIFIED;const t=h.client.defenseStrategy.filters.circle;return e===t.VERDICT_RESULT_CHANGED?t.VERDICT_CHANGED:e===t.VERDICT_RESULT_CANCELED?t.VERDICT_CANCELED:e===t.VERDICT_RESULT_UNCHANGED?t.VERDICT_UNCHANGED:e}const Aoe=({phase:e,isBottomSheet:t=!1})=>{const n=e.fields.sourcePaths;return a.jsxs("div",{className:"mt-2",children:[a.jsx(Ko,{label:t?h.client.cases.fields.PLEA_STATUS:h.client.cases.fields.APPEAL_REVIEW_RESULT,sourcePath:t?n?.pleaStatus:n?.appealReviewResultStatus,children:t?e.fields.pleaStatus??h.client.cases.placeholders.NOT_SPECIFIED_MASCULINE:goe({appealReviewResultStatus:e.fields.appealReviewResultStatus})}),a.jsx(Ko,{label:h.client.cases.fields.VERDICT_STATUS,sourcePath:n?.verdictStatus,children:e.fields.verdictStatus??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.COURT_NAME,sourcePath:n?.courtName,children:e.fields.courtName??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.FELONY_PUNISHMENT,sourcePath:n?.punishment,children:e.fields.punishment??h.client.cases.placeholders.NOT_SPECIFIED}),a.jsx(Ko,{label:h.client.cases.fields.FINAL_SENTENCING_PUNISHMENT,sourcePath:n?.finalSentencingPunishment,children:e.fields.finalSentencingPunishment??h.client.cases.placeholders.NOT_SPECIFIED})]})},dw=({listInstance:e,selectedCaseInstance:t,isCrossLoading:n=!1,onSelectCaseInstance:s,hasFirstTab:r=!1,hasSecondTab:i=!1,listBaseInstanceData:o,item:c,primaryFelonies:u,itemId:d,clientData:p,maxFeloniesToShow:g,selectedFelony:A,isTooltipsBelow:E,clampTooltipsToContainer:x,isOpenedFromOverviewPopup:y,isSaved:I,handleSelectFelony:v,handleShowAllFelonies:S})=>{const{patchCase:b,isPendingMap:w}=hoe({clientId:p.id}),_=Fe(),N=at(),R=w[d],D=l.useMemo(()=>y?{isCaseOpenedFromOverviewPopup:!0,returnToPath:_.pathname,returnToState:_.state}:{}
866,[y,_.pathname,_.state]),k=g||c.felonies.length,L=l.useCallback(()=>{if(R)return;const W=c?.data?._source?.case_id??d,H=t==="first-instance"?d:c?.data?._source?.fi_file_id??null,j=t==="second-instance"?d:c?.data?._source?.appeal_file_id??null;!H&&!j||b({caseId:W,firstInstanceCaseId:H,secondInstanceCaseId:j,isSaved:!c.isSaved,loadingForId:d,currentInstance:t==="first-instance"?"first_instance":"second_instance"})},[t,d,c?.data,c.isSaved,R,b]),O=c.id??"",P=l.useCallback(()=>{if(n||!O)return;const W=`/clients/${p.id}/cases/${e}/${d}/${t}/source`;N(W,{state:{..._.state,...D,isPreventScrollToTop:!0,isForceCaseSourceAnimateOnStart:!0,isSaved:I}})},[n,O,p.id,e,d,t,N,_.state,D,I]),B=c.data,F=`/clients/${p.id}/cases/${e}/${d}/${t}/${t==="first-instance"?"overview":"information/general"}`,z=t==="first-instance"?B:e==="first-instance"?o:void 0,Q=t==="second-instance"?B:e==="second-instance"?o:void 0,M={isSaved:I,..._.state,...D,isPreventScrollToTop:!1,isForceCaseDetailedAnimateOnStart:!0,...z?{caseFirstInstanceData:z}:{},...Q?{caseSecondInstanceData:Q}:{}},K=r||i;return a.jsxs("div",{className:"pt-6 first:pt-0 pb-8 border-b border-zinc-100 last:border-b-0",children:[a.jsxs("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 mb-6 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ls,{text:h.client.cases.placeholders.GO_TO_CASE_CARD,isBelow:E,isDisableOnTouch:!0,children:a.jsx(Je,{to:F,state:M,onClick:W=>{n&&W.preventDefault()},className:Y("underline-offset-[25%] decoration-[2%]",!n&&"hover:underline",!!n&&"cursor-default text-zinc-400"),children:c.title})}),a.jsx(Wr,{text:h.client.cases.tooltips.CASE}),!!c.hasCui&&a.jsx(Om,{text:c.cui,isBelow:E,successMessage:h.client.cases.messages.COPY_CUI_SUCCESS,tooltipText:h.client.cases.placeholders.COPY_CUI,notifyKey:"COPY_CUI"})]}),a.jsx(doe,{isSaved:c.isSaved,isSavingCase:R,handleSaveCase:L,isBelow:E,clampTooltipsToContainer:x})]}),a.jsxs("div",{className:"flex space-between gap-4",children:[a.jsx("div",{className:"min-w-61 w-61",children:c.felonies.slice(0,k).map((W,H)=>{const j=A?.id===W.id,G=u?.find($=>$.articleName===W.articleName)?.score??W.score;return a.jsxs("div",{className:Y("flex items-center gap-3 roboto-flex-25-700-1 text-[14px] leading-[24px] uppercase cursor-pointer pt-1 pb-1 first:pt-0 last:pb-0 overflow-hidden text-ellipsis whitespace-nowrap",!j&&"text-zinc-400",j&&"text-zinc-950"),onClick:()=>v(d,W.id),children:[a.jsx(Pm,{score:G,size:"14_24"}),W.articleName]},W.id??`felony-${H}`)})}),a.jsxs("div",{children:[!!(K&&s)&&a.jsxs("div",{className:"flex flex-start items-center mb-5 gap-1",children:[(e==="first-instance"||r)&&a.jsx("button",{type:"button",onClick:()=>s("first-instance"),className:Y("roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase px-1.5 h-6 flex items-center justify-center cursor-pointer",t==="first-instance"?"text-zinc-950 bg-zinc-100":"text-zinc-400 hover:text-zinc-500 hover:bg-zinc-100"),children:h.client.stage.stages.COURT_FIRST_INSTANCE}),(e==="second-instance"||i)&&a.jsx("button",{type:"button",onClick:()=>s("second-instance"),className:Y("roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase px-1.5 h-6 flex items-center justify-center cursor-pointer",t==="second-instance"?"text-zinc-950 bg-zinc-100":"text-zinc-400 hover:text-zinc-500 hover:bg-zinc-100"),children:h.client.stage.stages.COURT_SECOND_INSTANCE})]}),A?.phases.map((W,H)=>{const j=!K||H>0;return a.jsxs("div",{children:[j&&a.jsx("div",{className:"flex flex-start items-center mb-5",children:a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] text-zinc-950 uppercase px-1.5 h-6 bg-zinc-100 flex items-center justify-center",children:W.name})}),t==="first-instance"?a.jsx(moe,{phase:W}):a.jsx(Aoe,{phase:W,isBottomSheet:!!E})]},W.id??`phase-${H}`)})]})]}),a.jsxs("div",{className:"mt-5 flex space-between gap-4 h-5",children:[a.jsx("div",{className:"min-w-61 w-61 flex items-center justify-start",children:c.felonies.length>k&&a.jsx("div",{onClick:S,className:"inline-block roboto-flex-25-700-1 text-[12px] leading-[14px] text-zinc-400 hover:text-zinc-500 uppercase underline cursor-pointer",children:h.client.cases.links.ALL_FELONIES})}),a.jsx(ms,{onClick:P,children:h.client.cases.links.SOURCE})]})]})},U7=rt(async function(t){const n=Se.getState().accessToken,s=Ke(`/clients/${t?.clientId}/first-instance/cases/${t?.caseId}/`),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`}}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data}),Eoe=rt(async function({clientId:t,caseId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/first-instance/cases/${n}/file/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s,timeout:3e5}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),xoe=rt(async function({clientId:t,caseId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/first-instance/cases/${n}/source/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s,timeout:3e5}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),z7=rt(async function(t){const n=Se.getState().accessToken,s=Ke(`/clients/${t?.clientId}/second-instance/cases/${t?.caseId}/`),r=await qe(s,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${n}`}}),i=await Ye(r);if(He(i))throw{httpCode:503,errorData:i.error};if(i.status==="error")throw{httpCode:r.status,errorData:i.error};if(!i.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return i.data}),Coe=rt(async function({clientId:t,caseId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/second-instance/cases/${n}/file/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s,timeout:3e5}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),yoe=rt(async function({clientId:t,caseId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/second-instance/cases/${n}/source/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s,timeout:3e5}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),Lm=({conclusions:e,felonyId:t,relatedAccusedId:n})=>{const s=n?Math.max(0,e.findIndex(o=>o.related_accused_id===n)):0,r=e[s]?.verdicts??[],i=Math.max(0,r.findIndex(o=>o.related_felony_id===t));return{conclusionIndex:s,verdictIndex:i}},Mm=({conclusionIndex:e,verdictIndex:t})=>({pleaStatus:`caseData._source.conclusions[${e}].verdicts[${t}].plea.status`,appealReviewResultStatus:"caseData._source.general_information.is_modified",verdictStatus:`caseData._source.conclusions[${e}].verdicts[${t}].result`,courtName:"caseData._source.general_information.court_name",punishment:`caseData._source.conclusions[${e}].verdicts[${t}].punishment.description`,finalSentencingPunishment:`caseData._source.conclusions[${e}].final_sentencing.punishment.description`});function boe({instanceType:e,source:t}){if(e!=="second-instance"||!("is_modified"in t.general_information))return;const n=t.general_information.is_modified;if(n!=null)return n}function Ioe({caseEntity:e}){const t=Object.create(null),n=e?.inner_hits?.felony_hit?.hits?.hits??[];for(const s of n){const r=s?._source,i=r?.event_id,o=r?.felony_id,c=s?._score;if(!i||!o||typeof c!="number")continue;const u=`${i}:::${o}`;t[u]=c}return t}function v0({caseEntity:e,instanceType:t,regionsMapById:n}){const s=e?._source,r=e?._id??null,i=!!s?.metadata_cui,o=s?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,c=s?.metadata_region??0,u=n[String(c)]?.name??void 0,d=`${h.client.cases.titles.CASE_CARD_TITLE} ${o}${u?` (${u})`:""}`,p=s?.case_narrative?.events??[],g=[],A=Ioe({caseEntity:e});
866for(const y of p){const I=y.felonies??[];for(const v of I){if(!v.felony_id)continue;const S=`${y.event_id}:::${v.felony_id}`,b=v.objects?.primary_object?.related_law?.law,w=b?et({clause:b.clause,part:b.part,number:b.article??""}):"",_=s?.conclusions??[],R=_.flatMap(H=>H.verdicts??[]).find(H=>H.related_felony_id===v.felony_id)??null,D=s?.general_information?.court_name??void 0;let k;for(const H of p)if(k=H.felonies?.find(q=>q.felony_id===v.felony_id)?.subjective_parts?.[0]?.related_accused_id??void 0,k)break;const L=k?_.find(H=>H.related_accused_id===k):void 0,{conclusionIndex:O,verdictIndex:P}=Lm({conclusions:_,felonyId:v.felony_id,relatedAccusedId:k}),F=(s?.defense_requests??[]).find(H=>H.related_felony_id===v.felony_id)??null,z=t==="first-instance"?h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,Q=boe({instanceType:t,source:s}),M={pleaStatus:R?.plea?.status??void 0,appealReviewResultStatus:Q,courtName:D,punishment:R?.punishment?.description??void 0,finalSentencingPunishment:L?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:L?.final_sentencing?.result??void 0,verdictStatus:R?.result??void 0,sourcePaths:Mm({conclusionIndex:O,verdictIndex:P})};t==="first-instance"&&F&&(M.defenseRequestGoal=F.goal??void 0,M.defenseRequestResult=F.result??void 0);const K=A[S],W=typeof K=="number"?Math.round(K*100):void 0;g.push({id:S,articleName:w,score:W,phases:[{id:t==="first-instance"?"courtFirstInstance":"courtSecondInstance",name:z,fields:M}]})}}const E=e,x=!!e.isSaved;return{id:r,title:d,cui:o,hasCui:i,felonies:g,data:E,isSaved:x}}function Soe({clientId:e,listInstance:t,primaryItem:n,selectedCaseInstance:s,savedInstances:r}){const i=vs(),o=n?.data?._source?.appeal_file_id??null,c=n?.data?._source?.fi_file_id??null,u=r?.first_instance,d=r?.second_instance,p=s==="first-instance"&&t==="second-instance"&&!!u,g=s==="second-instance"&&t==="first-instance"&&!!d,A=s==="first-instance"&&t==="second-instance"&&!p&&c,E=s==="second-instance"&&t==="first-instance"&&!g&&o,x=A?c:null,y=E?o:null,{data:I,isFetching:v}=Vt({queryKey:["caseFirstInstance",e,x],queryFn:()=>U7({clientId:e,caseId:x}),enabled:!!x,staleTime:1e3*60*5}),{data:S,isFetching:b}=Vt({queryKey:["caseSecondInstance",e,y],queryFn:()=>z7({clientId:e,caseId:y}),enabled:!!y,staleTime:1e3*60*5});return{displayItem:l.useMemo(()=>p&&u?v0({caseEntity:u,instanceType:"first-instance",regionsMapById:i}):g&&d?v0({caseEntity:d,instanceType:"second-instance",regionsMapById:i}):A&&I?v0({caseEntity:I,instanceType:"first-instance",regionsMapById:i}):E&&S?v0({caseEntity:S,instanceType:"second-instance",regionsMapById:i}):n,[p,g,u,d,A,E,I,S,n,i]),isCrossLoading:v||b}}const AE=({listInstance:e,activeInstance:t,savedInstances:n,item:s,
866clientData:r,maxFeloniesToShow:i,isSaved:o,clampTooltipsToContainer:c,isOpenedFromOverviewPopup:u})=>{const d=e==="first-instance"&&!!s?.data?._source?.appeal_file_id,p=e==="second-instance"&&!!s?.data?._source?.fi_file_id,g=t==="second-instance"&&(e==="second-instance"||d)?"second-instance":e,[A,E]=l.useState(g);l.useEffect(()=>{E(g)},[s.id,g]);const{displayItem:x,isCrossLoading:y}=Soe({clientId:r.id,listInstance:e,primaryItem:s,selectedCaseInstance:A,savedInstances:n}),I=e,[v,S]=l.useState(!1),[b,w]=l.useState(null),[_,N]=l.useState(null),R=Ve($=>$.selectedPleaStatusesByClientIdByKey[r.id]?.[I]),D=Ve($=>$.selectedPunishmentsByClientIdByKey[r.id]?.[I]),k=l.useCallback(($,J)=>{w(ne=>({...ne,[$]:J})),N(ne=>({...ne,[$]:J}))},[]),L=l.useCallback(($,J)=>{N(X=>({...X,[$]:J}));const ne=x.felonies.slice(0,i).map(X=>X.id);w(X=>({...X,[$]:ne.includes(J)?J:ne[0]}))},[x.felonies,i]),O=l.useCallback(()=>{S(!0)},[]),P=l.useCallback(()=>{S(!1)},[]),B=x.id,F=l.useMemo(()=>new Set((R??[]).map(String)),[R]),z=l.useMemo(()=>new Set((D??[]).map(String)),[D]),Q=l.useCallback(()=>{for(const $ of x.felonies)if(($.phases??[]).some(ne=>
866!!ne.fields?.pleaStatus&&F.has(String(ne.fields.pleaStatus))))return $.id},[x.felonies,F]),M=l.useCallback(()=>{for(const $ of x.felonies){const J=$.phases??[];if(!J.some(oe=>!!oe.fields?.pleaStatus&&F.has(String(oe.fields.pleaStatus))))continue;if(z.size>0?J.some(oe=>[...z].some(ie=>String(oe.fields?.punishment??"").includes(ie))):!1)return $.id}},[x.felonies,z,F]),K=l.useCallback(()=>{if(z.size!==0){for(const $ of x.felonies)if(($.phases??[]).some(ne=>[...z].some(X=>String(ne.fields?.punishment??"").includes(String(X)))))return $.id}},[x.felonies,z]),W=(()=>{if(!B)return;const $=b?.[B]??M()??Q()??K()??x.felonies[0]?.id;return x.felonies.find(J=>J.id===$)})(),H=(()=>{if(!B)return;const $=_?.[B]??M()??Q()??K()??x.felonies[0]?.id;return x.felonies.find(J=>J.id===$)})(),j=l.useCallback($=>{E($)},[]);if(!B)return null;const q={listInstance:e,selectedCaseInstance:A,isCrossLoading:y,onSelectCaseInstance:j,listBaseInstanceData:s.data,item:x,primaryFelonies:s.felonies,itemId:B,hasFirstTab:p,hasSecondTab:d,clientData:r,maxFeloniesToShow:i,selectedFelony:W,handleSelectFelony:k,handleShowAllFelonies:O,isSaved:o,clampTooltipsToContainer:c,isOpenedFromOverviewPopup:u},G={...q,maxFeloniesToShow:0,selectedFelony:H,handleSelectFelony:L,isTooltipsBelow:!0};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Y(!!y&&"opacity-60"),children:a.jsx(dw,{...q})}),!!v&&!y&&a.jsx(Ws,{onClose:P,isForceAnimateOnStart:!0,children:a.jsx(dw,{...G})})]})},voe=e=>l.createElement("svg",{width:108,height:108,viewBox:"0 0 108 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.3839 12.8373C24.3183 17.7547 19.5194 25.4031 16.3857 30.5946C14.857 33.1272 13.3119 35.63 12.1422 38.4024C11.7603 39.3076 11.3275 40.1806 10.9353 41.0794C10.7858 41.4222 10.2181 42.0639 10.546 42.139C10.839 42.2062 10.994 41.6858 11.2176 41.4586C12.8379 39.8128 14.5019 38.2237 16.1521 36.6178C20.945 31.9537 25.7502 27.3149 30.6736 22.8314C35.2672 18.648 39.7616 14.12 44.5915 10.2942C46.206 9.01544 47.7926 7.70063 49.4482 6.4907C51.4494 5.02828 49.0252 7.2542 48.6307 7.68418C38.5526 18.6677 30.4078 31.5437 21.2522 43.4664C17.5055 48.3453 13.2722 52.9187 9.98152 58.2343C9.03654 59.7608 8.19697 61.3671 7.25632 62.8967C6.89935 63.4772 6.29422 64.1203 6.01052 64.7706C5.93705 64.939 6.35643 64.7785 6.49716 64.6813C9.00408 62.9514 11.3516 60.7906 13.7189 58.8366C23.9182 50.4185 33.9702 41.77 44.0465 33.16C52.5532 25.8912 60.7792 18.0975 69.5271 11.2089C71.5103 9.64717 77.6757 5.34572 75.5809 6.70262C75.1114 7.00678 74.1008 7.91953 73.8874 8.10803C70.9739 10.6822 68.0748 13.283 65.1862 15.8936C56.5607 23.6891 48.6141 32.191 40.8055 41.0348C33.2819 49.5556 25.5593 57.8775 18.1766 66.5552C17.9855 66.7798 17.8094 66.9818 17.6607 67.2468C17.5784 67.3936 17.5024 67.484 17.398 67.6037C16.6726 68.4349 19.1895 66.458 20.0745 65.8637C41.3048 51.6071 62.4474 37.1299 82.4134 20.634C82.5755 20.5001 82.7972 20.4289 82.9 20.2325C83.3411 19.39 81.52 21.4026 80.8756 22.0506C74.8262 28.1337 68.985 34.4661 63.2591 40.9455C56.5012 48.593 49.891 56.4265 42.9856 63.9006C40.578 66.5065 37.9696 68.8233 35.54 71.3849C34.1361 72.8651 32.9776 74.6488 31.5495 76.0808C29.3227 78.3138 27.23 80.716 25.009 82.9517C23.7848 84.184 22.4664 85.3104 21.0867 86.309C20.5583 86.6915 20.0271 87.075 19.5392 87.5248C19.2348 87.8054 18.2876 88.2942 18.6632 88.4172C18.9714 88.5181 19.2739 88.1843 19.5586 88.0156C23.1137 85.9094 26.5863 83.5566 30.0604 81.2897C41.6322 73.7392 53.2268 66.1629 64.5828 58.1897C70.1095 54.3093 75.5692 50.2829 81.0216 46.266C82.1209 45.4561 83.2185 44.5488 84.3794 43.8456C84.4881 43.7797 84.6072 43.7737 84.6714 43.6448C85.2513 42.4819 86.6737 41.5764 87.6107 40.834C88.2201 40.3512 88.6777 39.9196 89.1875 39.2947C89.7995 38.5443 92.1593 36.0809 89.3529 38.7036C79.4799 47.9301 69.9398 57.5891 60.6897 67.626C52.6373 76.3632 44.5297 84.9593 36.0266 93.1242C33.442 95.606 30.8162 98.0324 28.2598 100.553C27.8216 100.985 26.5108 102.241 27.0335 101.958C29.0364 100.874 31.0562 99.1782 32.8732 97.8312C38.733 93.4868 44.5114 89.0005 50.3144 84.5579C62.1391 75.5053 73.9423 66.3682 86.2676 58.2232C91.3789 54.8454 96.5586 51.614 101.655 48.2068C103.261 47.1333 98.8478 51.0009 97.4214 52.3673C88.3802 61.0279 79.5448 70.0168 71.2985 79.6724C67.1862 84.4874 63.4149 89.8291 58.8599 94.128C57.811 95.118 61.2623 92.6709 62.4416 91.8972C68.9593 87.6214 75.4203 83.236 81.81 78.7131C88.1053 74.257 94.4733 69.7913 100.487 64.8375C101.901 63.6731 97.8651 67.4626 96.5455 68.7637C91.5812 73.6584 87.0605 79.0104 82.3745 84.2455C78.5407 88.5285 74.6969 92.8073 70.7924 97.0058C69.6393 98.2456 68.5157 99.6195 67.2788 100.754C64.5532 103.252 73.0602 96.2691 7
8665.9313 93.9942C78.9958 91.5661 82.0762 89.1754 85.2165 86.8779C85.831 86.4283 86.4403 85.9689 87.0657 85.5394C87.43 85.2892 88.2832 84.5843 88.2726 85.0709C88.2532 85.9564 87.2888 87.3531 86.9197 88.0602C86.1904 89.4576 85.4561 90.8358 84.8271 92.2988C84.6825 92.6352 83.3231 95.416 83.6203 95.7565",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("g",{clipPath:"url(#clip0_20568_103591)"},l.createElement("path",{d:"M66.2705 74.1244C70.6731 73.6616 73.8671 69.7174 73.4043 65.3148C72.9416 60.9121 68.9974 57.7182 64.5948 58.1809C60.1921 58.6437 56.9982 62.5879 57.4609 66.9905C57.9236 71.3932 61.8678 74.5871 66.2705 74.1244Z",stroke:"black",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M77.0229 75.539L71.459 71.0334",stroke:"black",strokeWidth:4,strokeLinejoin:"round"}),l.createElement("path",{d:"M57.4673 32.0642L46.279 33.2402C35.0906 34.4161 31.0856 39.3618 32.2616 50.5502L33.6727 63.9762C34.8486 75.1646 39.7944 79.1696 50.9827 77.9936",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.25 48.084L77.9556 54.797",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.2497 48.0841L68.299 49.0248C61.586 49.7304 59.1131 47.7279 58.4076 41.0149L57.4668 32.0642L77.2497 48.0841Z",stroke:"black",strokeWidth:4,strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_20568_103591"},l.createElement("rect",{width:54,height:54,fill:"white",transform:"translate(24.8301 30.9695) rotate(-6)"})))),Q7=rt(async function(t,n){const s=Se.getState().accessToken,r={};n?.isSaved!==void 0&&(r.isSaved=!!n.isSaved),n?.articles!=null&&(r.articles=n.articles),n?.courts!=null&&(r.courts=n.courts),n?.episodes!=null&&(r.episodes=n.episodes),n?.searchAfter!=null&&(r.searchAfter=n.searchAfter),n?.limit!=null&&(r.limit=n.limit),n?.instances!=null&&(r.instances=n.instances),n?.punishments!=null&&(r.punishments=n.punishments),n?.pleaStatuses!=null&&(r.pleaStatuses=n.pleaStatuses),n?.regions!=null&&(r.regions=n.regions),n?.genders!=null&&(r.genders=n.genders),n?.criminalStatuses!=null&&(r.criminalStatuses=n.criminalStatuses),n?.defenseRequestsGoals!=null&&(r.defenseRequestsGoals=n.defenseRequestsGoals),n?.defenseRequestsLaws!=null&&(r.defenseRequestsLaws=n.defenseRequestsLaws),n?.defenseRequestsArgumentDescriptions!=null&&(r.defenseRequestsArgumentDescriptions=n.defenseRequestsArgumentDescriptions);const i=Ke(`/clients/${t}/first-instance/cases/`),o=await qe(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),H7=":::",_oe=({regionName:e})=>e?` (${e})`:"",Toe=({caseItem:e})=>{const t={},n=e?.inner_hits?.felony_hit?.hits?.hits??[];for(const s of n){if(!s)continue;const r=s?._source?.event_id??void 0;if(!r)continue;const i=s?._source?.felony_id??void 0;if(!i)continue;const o=`${r}${H7}${i}`,c=s?._score;if(typeof c=="number"){t[o]=c;continue}t[o]=0}return t},Noe=({caseItem:e,felonyId:t})=>{const n=e?._source?.conclusions??[];for(const s of n){const i=(s?.verdicts??[]).find(o=>o.related_felony_id===t);if(i)return i}return null},woe=({caseItem:e,felonyId:t})=>{const n=e?._source?.defense_requests??[];for(const s of n)if(s.related_felony_id!==t)return s;return null},Roe=({caseItem:e,felonyId:t})=>{const n=e?._source?.case_narrative?.events??[];for(const s of n){const i=(s?.felonies??[]).find(c=>c.felony_id===t);if(!i)continue;const o=i?.subjective_parts??[];for(const c of o)if(c.related_accused_id)return c.related_accused_id}},Doe=({caseItem:e,relatedAccusedId:t})=>{if(t===void 0)return null;const s=(e?._source?.conclusions??[]).find(r=>r.related_accused_id===t);return s===void 0?null:s},koe=({scoreMap:e,key:t})=>{const n=e[t];if(n)return Math.round(n*100)},Ooe=({caseItem:e,scoreMap:t})=>{const n=e?._source?.case_narrative?.events??[],s=[];for(const r of n){const i=r?.felonies??[];for(const o of i){if(!o.felony_id)continue;const c=`${r.event_id}${H7}${o.felony_id}`,u=o.objects.primary_object.related_law.law,d=et({clause:u.clause,part:u.part,number:u.article??""}),p=Noe({caseItem:e,felonyId:o.felony_id}),g=woe({caseItem:e,felonyId:o.felony_id}),A=e?._source?.general_information?.court_name??void 0,E=Roe({caseItem:e,felonyId:o.felony_id}),x=Doe({caseItem:e,relatedAccusedId:E}),y=e?._source?.conclusions??[],{conclusionIndex:I,verdictIndex:v}=Lm({conclusions:y,felonyId:o.felony_id,relatedAccusedId:E});s.push({id:c,articleName:d,score:koe({scoreMap:t,key:c}),phases:[{id:"courtFirstInstance",name:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,fields:{pleaStatus:p?.plea?.status??void 0,defenseRequestGoal:g?.goal??void 0,defenseRequestResult:g?.result??void 0,courtName:A,punishment:p?.punishment?.description??void 0,finalSentencingPunishment:x?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:x?.final_sentencing?.result??void 0,verdictStatus:p?.result??void 0,sourcePaths:Mm({conclusionIndex:I,verdictIndex:v})}}]})}}return s},Poe=({caseItem:e,regionsMapById:t})=>{const n=!!e?._source?.metadata_cui,s=e?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,r=e?._source?.metadata_region??0,i=t[r]?.name??void 0,o=`${h.client.cases.titles.CASE_CARD_TITLE} ${s}
866${_oe({regionName:i})}`,c=Toe({caseItem:e});return{id:e?._id,title:o,cui:s,hasCui:n,felonies:Ooe({caseItem:e,scoreMap:c}),data:e,isSaved:!!e.isSaved}},Loe=1e3*60*5,Moe=5e3,joe=3e4,Boe=5e3,Foe="200px 0px",fw=3e3,Uoe=({pageParam:e})=>{if(e!==void 0)return{searchAfterScore:e[0],searchAfterId:e[1]}},zoe=({clientData:e,leafId:t,presetParams:n,isEnabled:s,endOfListRef:r})=>{const i=vs(),o=e?.id??"",c=l.useRef(null),u=l.useRef(null),{data:d,isSuccess:p,isFetching:g,fetchNextPage:A,hasNextPage:E,isFetchingNextPage:x}=fa({queryKey:["cases","defense-line-practice",o,t,n],queryFn:({pageParam:b})=>Q7(o,{...n,isSaved:!1,searchAfter:Uoe({pageParam:b})}),enabled:!!o&&s,staleTime:Loe,initialPageParam:void 0,networkMode:"always",getNextPageParam:b=>{if(b?.nextSearchAfter&&b.nextSearchAfter.length===2&&b.nextSearchAfter[0]&&b.nextSearchAfter[1])return b.nextSearchAfter},refetchInterval:b=>{if(b.state.status==="error")return Boe;const w=b.state.data?.pages??[];if(!w.length)return!1;const _=w[0]?.fabulaStatus??"ok";return _==="no_embeddings"?Moe:_==="no_fabula"?joe:!1}}),y=d?.pages,I=y?.[0]?.fabulaStatus??"ok",v={totalResults:y?.[0]?.totalResults??0,searchAfter:y?.[y.length-1]?.nextSearchAfter},S=l.useMemo(()=>(d?.pages??[]).flatMap(w=>w?.results??[]).map(w=>Poe({caseItem:w,regionsMapById:i})),[d,i]);return l.useEffect(()=>{if(c.current&&(clearTimeout(c.current),c.current=null),!o){Ze("CASES_SLOW_LOADING");return}if(p){Ze("CASES_SLOW_LOADING");return}return c.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},fw),()=>{c.current&&(clearTimeout(c.current),c.current=null)}},[o,s,p,t]),l.useEffect(()=>{if(!r)return;const b=r.current;if(!b)return;const w=new IntersectionObserver(_=>{_[0].isIntersecting&&E&&(x||(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},fw),A()))},{rootMargin:Foe});return w.observe(b),()=>{w.disconnect()}},[r,A,E,x]),l.useEffect(()=>{x||u.current&&(clearTimeout(u.current),Ze("CASES_SLOW_LOADING"),u.current=null)},[x]),l.useEffect(()=>()=>{c.current&&(clearTimeout(c.current),c.current=null),u.current&&(clearTimeout(u.current),u.current=null),Ze("CASES_SLOW_LOADING")},[]),{casesFormatted:S,paginationData:v,isSuccess:p,isFetching:g,fabulaStatus:I}},Qoe=8,Hoe="first-instance",Voe=10,V7=({clientData:e,leafId:t,leafLabel:n,presetParams:s,onClose:r})=>{const i=l.useRef(null),o=l.useRef(null),{casesFormatted:c,paginationData:u,isSuccess:d,fabulaStatus:p}=zoe({clientData:e,leafId:t,presetParams:s,isEnabled:!0,endOfListRef:o}),g=l.useMemo(()=>!u.searchAfter||u.searchAfter.length!==2||!u.searchAfter[0]||!u.searchAfter[1],[u.searchAfter]),A=p!=="ok",E=d&&!c.length,x=d&&!!c.length,y=l.useCallback(()=>{i.current?.close()},[]);return a.jsx(Ws,{ref:i,onClose:r,isForceAnimateOnStart:!0,children:a.jsxs("div",{className:"pb-8 flex flex-col h-full px-4",children:[a.jsxs("div",{className:Y("flex flex-col gap-6 mb-8",!n&&"pt-4"),children:[!!n&&a.jsx("p",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:n}),a.jsx("p",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950",children:h.client.defenseLines.practice.TITLE})]}),!d&&a.jsx(ct,{isWithWrapper:!0}),E&&!!A&&a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-4 py-10",children:[a.jsx("div",{className:"flex h-24 items-center justify-center",children:a.jsx(hs,{"aria-hidden":!0})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] mt-5 text-center",children:a.jsx(Aa,{children:h.client.defenseLines.practice.ANALYZING_TITLE})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center max-w-[520px]",children:h.client.defenseLines.practice.ANALYZING_DESCRIPTION})]}),E&&!A&&a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-4 py-10",children:[a.jsx("div",{className:"flex h-24 items-center justify-center",children:a.jsx(voe,{"aria-hidden":!0})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.defenseLines.practice.EMPTY_TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center max-w-[520px]",children:h.client.defenseLines.practice.EMPTY_DESCRIPTION}),a.jsx(ut,{variant:"h16inverse",type:"button",className:"mt-8",onClick:y,children:h.client.defenseLines.practice.BACK})]}),!!x&&a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{children:c.map((I,v)=>a.jsx(AE,{listInstance:Hoe,item:I,isSaved:!1,clientData:e,maxFeloniesToShow:Qoe,clampTooltipsToContainer:!0,isOpenedFromOverviewPopup:!0},I.id??`practice-case-${v}`))}),a.jsxs("div",{ref:o,className:Y("flex items-center justify-center h-14",u.totalResults<=Voe&&"hidden"),children:[!g&&a.jsx(ct,{}),!!g&&a.jsx("p",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.cases.messages.EVERYTHING_SHOWN})]})]})]})})},Goe=({leafId:e})=>{const t=at(),n=Fe(),{defenseLineId:s}=st(),{clientData:r}=Zi(),{effectiveTree:i}=y2({clientId:r?.id,defenseLineId:s}),o=l.useMemo(()=>Zh({tree:i}),[i]),c=l.useMemo(()=>k7({leaves:o,leafId:e}),[o,e]),u=l.useMemo(()=>C2({leaves:o,leafId:e}),[o,e]),d=l.useCallback(()=>{t(n.pathname,{replace:!0,state:{isPreventScrollToTop:!0}})},[n.pathname,t]);return r?a.jsx(V7,{clientData:r,leafId:e,leafLabel:u,presetParams:c,onClose:d},e):a.jsx(ct,{isWithWrapper:!0})}
866,qoe=({ref:e,to:t,state:n,isActive:s,text:r,title:i,count:o,instance:c,description:u,isTextBlockLimited:d,isTextTruncated:p,isHeader:g,titleTrailing:A,onClick:E})=>{const x=t?Je:"div",y=t?{to:t,state:n}:{onClick:E},I=l.useMemo(()=>!r&&!c&&!u,[r,c,u]);return a.jsxs(x,{ref:e,className:Y("block border-l-2 pl-4 pr-6 group",!!g&&"cursor-default",!g&&"cursor-pointer",!s&&"bg-white border-white",!!s&&"bg-zinc-50 border-black",!g&&!I&&"pt-4 pb-4",!g&&!!I&&"pt-3 pb-3",!!g&&"pt-0 pb-2"),...y,children:[a.jsxs("div",{children:[a.jsxs("div",{className:Y("flex items-center justify-between roboto-flex-100-600-1 font-semibold",!!I&&!!g&&"text-[16px] leading-[24px]",!!I&&!g&&"text-[18px] leading-[24px]",!I&&"text-[16px] leading-[24px]",!!g&&"text-zinc-950",!g&&!!s&&"text-zinc-950",!g&&!s&&"text-zinc-500 group-hover:text-zinc-600"),children:[a.jsxs("div",{className:Y("min-w-0 flex-1",!!d&&"line-clamp-2"),children:[a.jsx(tn,{text:i})," ",!!o&&a.jsx("sup",{children:o})]}),A]}),!!r&&a.jsx("div",{className:Y("roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",!!d&&!p&&"line-clamp-2",!!p&&"line-clamp-1"),children:a.jsx(tn,{text:r})})]}),!!(c||u)&&a.jsxs("div",{className:"mt-2 flex justify-between",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] whitespace-nowrap overflow-hidden text-ellipsis text-zinc-500",children:!!c&&a.jsx(tn,{text:c})}),!!u&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] whitespace-nowrap ml-3 text-right text-zinc-500",children:a.jsx(tn,{text:u})})]})]})},Kn=({ref:e,isActive:t,count:n,text:s,title:r,instance:i,description:o,isTextBlockLimited:c,isHeader:u,isTextTruncated:d,to:p,state:g,titleTrailing:A,onClick:E})=>a.jsx(qoe,{ref:e,to:p,state:g,isActive:t,text:s,title:r,instance:i,description:o,count:n,isTextBlockLimited:c,isTextTruncated:d,isHeader:u,titleTrailing:A,onClick:E});function Woe({isChecked:e,isError:t}){return t?"bg-red-200":e?"bg-zinc-900":"bg-zinc-200"}const Koe=({isChecked:e,isError:t,onClick:n,className:s})=>{const r=Woe({isChecked:e,isError:t});return a.jsx("button",{type:"button","aria-pressed":e,onClick:n,className:Y("flex shrink-0 cursor-pointer items-center justify-center","h-6 w-6 min-h-6 min-w-6 rounded-[8px]",r,s),children:a.jsx(qr,{className:Y(!e&&"hidden","size-4","text-zinc-50")})})};function $oe({previous:e,created:t}
866){const n=e.evidences;return n?{...e,evidences:[...n,t]}:{...e,evidences:[t]}}async function Yoe({clientId:e}){return await u2({path:`clients/${e}/evidences/`,body:{...v7}})}function Xoe({left:e,right:t}){if(e.length!==t.length)return!1;const n=new Set(e);return!t.some(s=>!n.has(s))}function Joe({reviewResult:e}){return e==null?"":On(h.enums.evidenceReviewResults,String(e),String(e))}function Zoe({evidenceType:e}){return e==null?"":On(h.enums.evidenceTypes,String(e),String(e))}function eae({clientData:e}){return e?.evidences?e.evidences.filter(t=>!Jh({evidence:t})):[]}function tae({clientData:e}){return e?.episodesArticles?e.episodesArticles.map(t=>t.id):[]}function nae({evidences:e}){return e.map((t,n)=>({id:t.id,title:h.client.evidence.titles.LIST_ITEM.replace("{order}",String(n+1)),description:t.description??"",result:Joe({reviewResult:t.reviewResult}),type:Zoe({evidenceType:t.evidenceType})}))}function sae({evidences:e,activeEvidenceId:t}){if(e.length!==0)return t?e.find(n=>n.id===t):e[0]}function rae({evidences:e,displayEvidence:t}){return t?e.findIndex(n=>n.id===t.id):-1}function iae({selectedEvidenceCount:e}){return e<1?h.molecules.editor.EVIDENCE_POPUP_SELECT_HINT:h.molecules.editor.EVIDENCE_POPUP_SELECTED_COUNT.replace("{count}",String(e))}const G7=({onClose:e,initialSelectedEvidenceIds:t,onApply:n,applyLabel:s})=>{const{id:r}=st(),{clientData:i,isSuccess:o}=Zi(),c=bt(),u=l.useRef(null),d=l.useRef(null),p=l.useRef(null),g=l.useRef(null),[A,E]=l.useState(()=>new Set(t??[])),x=l.useRef(!1),[y,I]=l.useState(null),v=l.useMemo(()=>["client",r],[r]),S=l.useMemo(()=>eae({clientData:i}),[i]),b=l.useMemo(()=>i?.id?nae({evidences:S}):[],[i?.id,S]),w=l.useMemo(()=>sae({evidences:S,activeEvidenceId:y}),[y,S]),_=l.useMemo(()=>rae({evidences:S,displayEvidence:w}),[w,S]),N=l.useMemo(()=>tae({clientData:i}),[i]),R=l.useMemo(()=>A.size,[A]),D=l.useMemo(()=>iae({selectedEvidenceCount:R}),[R]),k=l.useMemo(()=>{if(o&&i&&i.id)return i},[i,o]);l.useLayoutEffect(()=>{x.current||k&&(x.current=!0,E(new Set(t??[])))},[k,t]);const{rows:L}=_7({clientId:i?.id,evidence:w,primaryArticleIds:N,isFieldsDisabled:!1}),O=tt({mutationFn:async()=>{if(!r)throw new Error("missing client id");return Yoe({clientId:r})},onSuccess:G=>{r&&(c.setQueryData(v,$=>$&&$oe({previous:$,created:G})),I(G.id))},onError:()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})}}),P=tt({mutationFn:async({evidenceId:G})=>{if(!r)throw new Error("missing client id");return Ff({path:`clients/${r}/evidences/${G}/`})},onSuccess:(G,$)=>{r&&(c.setQueryData(v,J=>{if(!J)return J;
866const ne=(J.evidences??[]).filter(X=>X.id!==$.evidenceId);return{...J,evidences:ne}}),E(J=>{if(!J.has($.evidenceId))return J;const ne=new Set(J);return ne.delete($.evidenceId),ne}))},onError:()=>{ve({type:"failed",message:h.inputs.notifications.SAVE_CHANGES_FAILED,key:"SAVE_CHANGES_FAILED",duration:4e3})}}),B=l.useCallback(({evidenceId:G})=>{E($=>{const J=new Set($);return J.has(G)?(J.delete(G),J):(J.add(G),J)})},[]),F=l.useCallback(({evidenceId:G})=>{I(G)},[]),z=l.useCallback(({event:G,evidenceId:$})=>{G.preventDefault(),G.stopPropagation(),B({evidenceId:$})},[B]),Q=l.useCallback(({evidenceId:G})=>{F({evidenceId:G})},[F]),M=l.useCallback(()=>{r&&(O.isPending||O.mutate())},[O,r]),K=l.useCallback(()=>{w&&(P.isPending||P.mutate({evidenceId:w.id}))},[P,w]),W=l.useCallback(()=>{g.current?.close()},[]),H=l.useCallback(()=>{const G=Array.from(A);Xoe({left:t??[],right:G})||n?.({evidenceIds:G}),g.current?.close()},[t,n,A]),j=l.useCallback(({isActive:G})=>G?p:null,[p]),q=l.useMemo(()=>a.jsxs("div",{className:Y("flex w-full flex-1 flex-col items-center justify-center px-4 py-10"),children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.evidence.empty.TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.evidence.empty.DESCRIPTION}),a.jsx(ut,{variant:"h16",type:"button",className:"mt-8 h-16 min-h-16",onClick:M,disabled:O.isPending,children:h.client.evidence.buttons.ADD})]}),[O.isPending,M]);return l.useLayoutEffect(()=>{if(!S.length){I(null);return}y&&S.some(G=>G.id===y)||I(S[0].id)},[y,S]),k?a.jsxs(Ws,{ref:g,onClose:e,isForceAnimateOnStart:!0,contentRef:u,children:[!S.length&&q,!!S.length&&a.jsxs("div",{className:"relative mt-[24px] flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 pb-20",children:a.jsx(Yn,{headerMode:"inSheet",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:d,leftColumnStickyTitle:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:h.client.evidence.titles.LEFT_SECTION}),a.jsxs("button",{type:"button",onClick:M,disabled:O.isPending,className:"flex items-center gap-1 pr-4 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400 hover:text-zinc-500 disabled:opacity-50 cursor-pointer",children:[a.jsx(Cf,{className:"size-4 shrink-0"}),h.molecules.editor.EVIDENCE_POPUP_ADD]})]}),leftColumn:a.jsx("div",{children:b.map(G=>{const $=w?.id===G.id,J=j({isActive:$});return a.jsxs("div",{className:"relative",children:[a.jsx(Kn,{ref:J,title:G.title,text:G.description,instance:G.result,description:G.type,isTextBlockLimited:!0,isActive:$,onClick:()=>Q({evidenceId:G.id}),titleTrailing:a.jsx(Koe,{isChecked:A.has(G.id),onClick:ne=>z({event:ne,evidenceId:G.id})})}),a.jsx("div",{onClick:()=>B({evidenceId:G.id}),className:"absolute inset-y-0 right-0 w-1/4 cursor-pointer"})]},G.id)})}),rightColumnStickyTitle:a.jsxs("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:[`${h.client.evidence.titles.RIGHT_SECTION_TITLE} ${_+1}`,a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.evidence.kebab.DELETE_ONE,onClick:K,isCloseOnClick:!0,isDisabled:P.isPending}]})]}),rightColumn:a.jsx("div",{children:!!w&&a.jsx(Nt,{clientId:k.id,rows:L,mainWrapperRef:u},w.id)})})}),a.jsx("div",{className:"fixed bottom-4 left-1/2 z-10 w-full max-w-[680px] -translate-x-1/2 px-4 bp56_25:max-w-[849px] bp48:px-6",children:a.jsxs("div",{className:"flex h-12 items-center justify-between rounded-full border border-zinc-200 bg-white shadow-[0_8px_16px_rgba(0,0,0,0.08),0_0_4px_rgba(0,0,0,0.04)]",children:[a.jsx("div",{className:"min-w-0 flex-1 pl-4 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950",children:D}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2 pr-2",children:[a.jsx(ut,{variant:"h8inverse",type:"button",onClick:W,children:h.client.stage.ph
866asesManagement.buttons.CANCEL}),a.jsx(ut,{variant:"h8",type:"button",onClick:H,children:s??h.inputs.dropdownWithSearch.APPLY})]})]})})]})]}):a.jsx(Ws,{onClose:e,isForceAnimateOnStart:!0,children:a.jsx(ct,{isWithWrapper:!0})})},oae=({target:e})=>{const t=at(),n=Fe(),{id:s}=st(),{patchResourceItem:r}=Ca({clientId:s}),i=l.useCallback(()=>{t(n.pathname,{replace:!0,state:{isPreventScrollToTop:!0}})},[n.pathname,t]),o=l.useCallback(({evidenceIds:c})=>{r({pathSegments:e.endpoint,pathValues:{},bodyKey:e.field,bodyValue:c})},[r,e]);return a.jsx(G7,{onClose:i,onApply:o,initialSelectedEvidenceIds:e.evidenceIds,applyLabel:h.client.defenseLines.buttons.SAVE})},pw=()=>{const t=Fe().state;return t?.practicePopupOpen===!0?a.jsx(Goe,{leafId:t.practicePopupLeafId??null}):t?.evidencePopupTarget?a.jsx(oae,{target:t.evidencePopupTarget}):null},hw=100,mw=5;function aae({sections:e,containerRef:t,sectionRefs:n,onActiveChange:s,isManualSelectionBlocked:r}){const i=Oe.useCallback(()=>{if(!t?.current||e.length===0||r?.current)return;const c=t.current,u=c.scrollTop,d=c.clientHeight,p=c.scrollHeight,g=c.getBoundingClientRect(),A=u+d,E=p-A;if(u<=mw){r?.current&&(r.current=!1),e.length>0&&s("section-0");return}if(E<=mw){r?.current&&(r.current=!1),e.length>0&&s(`section-${e.length-1}`);return}const x=d/2,y=x-hw/2,I=x+hw/2;let v=null,S=1/0,b=!1;for(let w=0;w<e.length;w+=1){const _=`section-${w}`,N=n.current[_];if(!N)continue;const R=N.getBoundingClientRect(),D=R.top-g.top,k=R.bottom-g.top,L=(D+k)/2,O=Math.abs(L-x);if(D<=I&&k>=y&&(!b||O<S)){S=O,v=_,b=!0;continue}b||O<S&&(S=O,v=_)}v&&s(v)},[e,t,n,s,r]),o=Oe.useMemo(()=>ol(i,50),[i]);Oe.useEffect(()=>{const c=t.current;if(!c)return;const u=()=>{r?.current&&(r.current=!1)};return c.addEventListener("scroll",o),c.addEventListener("wheel",u,{passive:!0}),c.addEventListener("touchstart",u,{passive:!0}),window.addEventListener("resize",o),i(),()=>{c.removeEventListener("scroll",o),c.removeEventListener("wheel",u),c.removeEventListener("touchstart",u),window.removeEventListener("resize",o),o.cancel()}},[o,i,t,r])}const lae=({tokens:e})=>e.map((t,n)=>typeof t=="string"?a.jsx(l.Fragment,{children:t},n):t.type==="bold"?a.jsx("span",{className:"roboto-flex-100-600-1",children:t.text},n):a.jsx(Je,{to:t.to,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-[25%] decoration-[3%] text-zinc-950 hover:text-zinc-600",children:t.text},n)),gw=({paragraph:e,isLastParagraph:t})=>typeof e=="string"?a.jsx("p",{className:Y(!t&&"mb-3"),children:e}):a.jsx("p",{className:Y(!t&&"mb-3"),children:a.jsx(lae,{tokens:e})}),cae=({content:e})=>{const t=l.useCallback(r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&r.type==="card",[]),n=l.useCallback(r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&r.type==="list-decimal",[]),s=l.useCallback(r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&r.type==="image",[]);return e.map((r,i)=>{const o=e[i+1],u=!(typeof o=="string"||Array.isArray(o));return s(r)?a.jsx("div",{className:Y(i>0&&"mt-3","mb-3","mt-6"),children:a.jsx("img",{src:r.src,alt:`image-${i}`,className:"w-full rounded-xl"})},`image-${i}`):n(r)?a.jsx("ol",{className:Y(i>0&&"mt-3",!u&&"mb-3","list-decimal pl-5.5 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 space-y-3"),children:r.content.map((d,p)=>a.jsx("li",{children:d},`list-decimal-item-${i}-${p}`))},`list-decimal-${i}`):t(r)?a.jsxs("div",{className:Y(i>0&&"mt-6","px-8 pt-6 pb-8 bg-zinc-50 rounded-2xl"),children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 mb-2",children:r.title}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 flex flex-col",children:r.content.map((d,p)=>a.jsx(gw,{paragraph:d,isLastParagraph:p===r.content.length-1},`card-paragraph-${i}-${p}`))})]},`card-${i}`):a.jsx(gw,{paragraph:r,isLastParagraph:u},`paragraph-${i}`)})},uae=({sections:e,setSectionRef:t})=>a.jsx("div",{className:"max-w-[954px] w-full",children:e.map((n,s)=>{const r=`section-${s}`;return a.jsxs("div",{ref:t(r),id:r,className:Y(s>0&&"mt-12 mb-12"),children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:n.title}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 mt-3 flex flex-col",children:a.jsx(cae,{content:n.content})})]},r)})}),dae=({sections:e,activeSectionId:t,onTabClick:n})=>a.jsx("div",{className:"hidden bp48:block w-[212px] shrink-0",children:a.jsx("div",{className:"sticky top-22",children:a.jsx("div",{className:"flex flex-col",children:e.map((s,r)=>{const i=`section-${r}`;return a.jsx("button",{onClick:()=>n({sectionId:i}),className:Y("text-left px-4 py-2 relative border-solid border-l-2 cursor-pointer",t===i?"bg-zinc-100 text-zinc-950  border-zinc-950":"text-zinc-500 hover:text-zinc-600 border-zinc-100"),children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16
866px]",children:s.title})},i)})})})}),q7=({title:e,sections:t,scrollContainerRef:n})=>{const[s,r]=l.useState(t.length>0?"section-0":null),i=l.useRef({}),o=l.useRef(!1),c=l.useCallback(({sectionId:d})=>{const p=i.current[d];if(!p||!n.current)return;o.current=!0;const g=n.current,A=g.getBoundingClientRect(),E=p.getBoundingClientRect(),y=g.scrollTop+(E.top-A.top)-20;g.scrollTo({top:y,behavior:"smooth"}),r(d)},[n]);aae({sections:t,containerRef:n,sectionRefs:i,onActiveChange:r,isManualSelectionBlocked:o});const u=l.useCallback(d=>p=>{i.current[d]=p},[]);return a.jsxs("div",{className:"bp48:max-w-360 mx-auto",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 py-8",children:e}),a.jsxs("div",{className:"flex gap-[106px] justify-between",children:[a.jsx(uae,{sections:t,setSectionRef:u}),a.jsx(dae,{sections:t,activeSectionId:s,onTabClick:c})]})]})},fae=({isOpen:e,onClose:t})=>{const n=l.useRef(null),s=h.structuredPages.cases.help;return e?a.jsx(Ws,{onClose:t,isForceAnimateOnStart:!0,isMaxWidthDisabled:!0,contentRef:n,children:a.jsx(q7,{title:s.title,sections:s.sections,scrollContainerRef:n})}):null},pae=()=>{const e=zt(),t=e?.clientData,n=e?.isSuccess,s=e?.mainWrapperRef,[r,i]=l.useState(!1),o=l.useCallback(()=>{i(!0)},[]),c=l.useCallback(()=>{i(!1)},[]);return t?a.jsxs("div",{className:"flex flex-col flex-1 pt-6",children:[a.jsx(Xi,{context:{clientData:t,isSuccess:n,mainWrapperRef:s}}),a.jsx("div",{className:"fixed bottom-18 left-4 z-10",children:a.jsx(zv,{label:h.client.newClient.buttons.HELP_BUTTON,iconVariant:"help",onClick:o})}),a.jsx(fae,{isOpen:r,onClose:c})]}):null},hae=()=>a.jsx(Qn,{to:"first-instance",replace:!0}),W7=({clientData:e,isSaved:t,fabulaStatus:n,isFetching:s=!1,handleResetFilters:r})=>{const i=Fe(),{status:o,setIsOpen:c,setObjectToFabulize:u}=wt({clientId:e?.id}),d=o==="pending"||o==="awaitingChoice"||n==="no_embeddings"||n==="no_fabula"&&(s||o==="autoCommitted"),p=l.useCallback(()=>{e?.id&&(c(!0),u({to:`/clients/${e.id}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}))},[c,u,e?.id]);return e?.id?a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-33"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:t?h.client.cases.emptyPage.messages.SAVED_PROMPT:d?a.jsx(Aa,{children:h.client.cases.emptyPage.messages.FABULA_ANALYZING}):n==="no_fabula"?h.client.cases.emptyPage.messages.FABULA_PROMPT:h.client.cases.emptyPage.messages.NOT_FOUND}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:t?h.client.cases.emptyPage.messages.SAVED_PROMPT_DESCRIPTION:d?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bp56_25:inline",children:h.client.cases.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART1})," ",a.jsx("div",{className:"bp56_25:inline",children:h.client.cases.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART2})]}):n==="no_fabula"?h.client.cases.emptyPage.messages.FABULA_PROMPT_DESCRIPTION:h.client.cases.emptyPage.messages.NOT_FOUND_DESCRIPTION}),!d&&!t&&(n==="no_fabula"?a.jsxs("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:[a.jsx(ut,{variant:"h16inverse",asChild:!0,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,state:i.state,children:h.client.cases.emptyPage.buttons.TO_FABULA})}),a.jsx(ut,{variant:"h16",asChild:!0,onClick:p,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,state:i.state,children:h.client.cases.emptyPage.buttons.TO_FABULIZER})})]}):a.jsx("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:a.jsx(ut,{variant:"h16inverse",onClick:r,children:h.client.cases.emptyPage.buttons.RESET_FILTERS})}))]})]}):null},Qu=({selectedEpisodeIds:e})=>{if(e?.length)return[{episodeId:e}]},Ul="first-instance";function mae({clientData:e,isSaved:t,aggregations:n,endOfListRef:s}){const r=vs(),i=e?.id??"",o=Ve(re=>re.selectedRegionIdsByClientIdByKey[i]?.[Ul]),c=Ve(re=>re.selectedCourtIdsByClientIdByKey[i]?.[Ul]),u=Ve(re=>re.selectedPleaStatusesByClientIdByKey[i]?.[Ul]),d=Ve(re=>re.selectedPunishmentsByClientIdByKey[i]?.[Ul]),p=Ve(re=>re.selectedConclusionArticlesByClientIdByKey[i]?.[Ul]),g=Ve(re=>
866re.selectedEpisodesByClientIdByKey[i]?.[Ul]),A=Ve(re=>re.selectedGendersByClientIdByKey[i]?.[Ul]),E=Ve(re=>re.selectedCriminalStatusesByClientIdByKey[i]?.[Ul]),x=Ve(re=>re.setSelectedEpisodes),y=Ve(re=>re.setSelectedGenders),I=Ve(re=>re.setSelectedCriminalStatuses),v=Ve(re=>re.setSelectedPleaStatuses),S=Ve(re=>re.setSelectedPunishments),b=Ve(re=>re.setSelectedConclusionArticles),w=Ve(re=>re.setFabulaStatus),_=sn(re=>Object.prototype.hasOwnProperty.call(re.filtersByClientIdByInstance[i]??{},"first-instance")),N=(()=>{if(!(!p||!p.length))return p.map(re=>{try{const pe=JSON.parse(re);return{number:pe.article??void 0,part:pe.part??void 0}}catch{return}}).filter(Boolean)})(),R=o&&o.length?o.map(re=>parseInt(re,10)).filter(re=>!Number.isNaN(re)):void 0,D=R?.length?R.join(","):void 0,k=c??void 0,L=k?k.join(","):void 0,O=k,P=u??void 0,B=P?P.join(","):void 0,F=P,z=p?p.map(re=>{try{const pe=JSON.parse(re);return`${pe.codeType??""}:${pe.article??""}:${pe.part??""}:${pe.clause??""}`}catch{return re}}).filter(re=>!!re).join(","):void 0,Q=d&&d.length?d:void 0,M=Q?Q.join(","):void 0,K=A&&A.length?A:void 0,W=K?K.join(","):void 0,H=E&&E.length?E:void 0,j=H?H.join(","):void 0,q=g?.join(","),G=Qu({selectedEpisodeIds:g}),$=l.useRef(null),{data:J,isSuccess:ne,isFetching:X,fetchNextPage:oe,hasNextPage:ie,isFetchingNextPage:ee}=fa({queryKey:["cases","first-instance",i,t,D,L,B,z,M,q,W,j],queryFn:re=>Q7(i,{isSaved:t,aggregations:n,articles:N??void 0,courts:O??void 0,episodes:G,searchAfter:re.pageParam?{searchAfterScore:re.pageParam[0],searchAfterId:re.pageParam[1]}:void 0,punishments:Q??void 0,pleaStatuses:F??void 0,regions:R,genders:K??void 0,criminalStatuses:H??void 0}),enabled:!!i&&_,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:re=>{if(re?.nextSearchAfter&&re.nextSearchAfter.length===2&&re.nextSearchAfter[0]&&re.nextSearchAfter[1])return re.nextSearchAfter},refetchInterval:re=>{const _e=re?.state?.data?.pages??void 0;if(!_e?.length)return!1;const Le=_e?.[0]?.fabulaStatus??"ok";return Le==="no_embeddings"?5e3:Le==="no_fabula"?3e4:!1}}),te=J?.pages,le=te?.flatMap(re=>re?.results??[])??[],fe={totalResults:te?.[0]?.totalResults??0,searchAfter:te?.[te.length-1]?.nextSearchAfter},ue=te?.[0]?.aggregations??null,ye=te?.[0]?.episodes??null,ce=te?.[0]?.fabulaStatus??"ok";return l.useEffect(()=>{i&&ne&&w({clientId:i,fabulaStatus:ce})},[i,ne,ce,w]),l.useEffect(()=>{if(!s)return;const re=s.current;if(!re)return;const pe=new IntersectionObserver(_e=>{_e[0].isIntersecting&&ie&&!ee&&($.current&&clearTimeout($.current),$.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},3e3),oe())},{rootMargin:"200px 0px"});return pe.observe(re),()=>{pe.disconnect()}},[s,oe,ie,ee]),l.useEffect(()=>{ee||!$.current||(clearTimeout($.current),Ze("CASES_SLOW_LOADING"),$.current=null)},[ee]),l.useEffect(()=>()=>{$.current&&(clearTimeout($.current),$.current=null)},[]),{casesFormatted:le.map(re=>{const pe=re?._id,_e=!!re?._source?.metadata_cui,Le=re?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,Ee=re?._source?.metadata_region??0,se=r[Ee]?.name??void 0,me=`${h.client.cases.titles.CASE_CARD_TITLE} ${Le}${se?` (${se})`:""}`,de=(()=>{const Pe={},Ue=re?.inner_hits?.felony_hit?.hits?.hits??[];for(const Be of Ue){if(!Be)continue;const nt=Be?._source?.event_id??void 0;if(!nt)continue;const At=Be?._source?.felony_id??void 0;if(!At)continue;const ht=typeof Be?._score=="number"?Be?._score:void 0,dt=`${nt}:::${At}`;Pe[dt]=ht??0}return Pe})(),ge=re?._source?.case_narrative?.events?re._source.case_narrative.events.reduce((Pe,Ue)=>{const Be=Ue.felonies;return Be?.length&&Be.forEach(nt=>{if(!nt.felony_id)return;const At=`${Ue.event_id}:::${nt.felony_id}`,ht=nt.objects.primary_object.related_law.law,dt=et({clause:ht.clause,part:ht.part,number:ht.article??""}),Gt=re?._source?.conclusions?re?._source?.conclusions.reduce(($t,Gn)=>{if($t||!Gn?.verdicts?.length)return $t;const Dr=Gn.verdicts.find(_i=>_i.related_felony_id===nt.felony_id);return Dr||$t},null):null,ft=re?._source?.defense_requests?re?._source?.defense_requests.reduce(($t,Gn)=>$t||(Gn.related_felony_id!==nt.felony_id?Gn:$t),null):null,_n=re?._source?.general_information?.court_name??void 0,Cn=re?._source?.case_narrative?.events?re?._source?.case_narrative?.events.reduce(($t,Gn)=>{if($t||!Gn?.felonies?.length)return $t;
866const Dr=Gn.felonies.find(kr=>kr.felony_id===nt.felony_id);return Dr?Dr?.subjective_parts?.length?Dr?.subjective_parts.reduce((kr,tg)=>kr||!tg.related_accused_id?kr:tg.related_accused_id,void 0):void 0:$t},void 0):void 0,wr=Cn&&re?._source?.conclusions?re?._source?.conclusions.reduce(($t,Gn)=>$t||Gn.related_accused_id!==Cn?$t:Gn,null):void 0,eo=re?._source?.conclusions??[],{conclusionIndex:Rr,verdictIndex:Zr}=Lm({conclusions:eo,felonyId:nt.felony_id,relatedAccusedId:Cn}),ei=[{id:"courtFirstInstance",name:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,fields:{pleaStatus:Gt?.plea?.status??void 0,defenseRequestGoal:ft?.goal??void 0,defenseRequestResult:ft?.result??void 0,courtName:_n,punishment:Gt?.punishment?.description??void 0,finalSentencingPunishment:wr?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:wr?.final_sentencing?.result??void 0,verdictStatus:Gt?.result??void 0,sourcePaths:Mm({conclusionIndex:Rr,verdictIndex:Zr})}}],Xn=de[At]?Math.round(de[At]*100):void 0;Pe.push({id:At,articleName:dt,score:Xn,phases:ei})}),Pe},[]):[];return{id:pe,title:me,cui:Le,hasCui:_e,felonies:ge,data:re,isSaved:!!re.isSaved}}),aggregationsData:ue,episodesData:ye,paginationData:fe,isSuccess:ne,isFetching:X,fabulaStatus:ce,setSelectedEpisodes:x,setSelectedPleaStatuses:v,setSelectedPunishments:S,setSelectedConclusionArticles:b,setSelectedGenders:y,setSelectedCriminalStatuses:I}}const gae=8,Bs="first-instance",Aae=()=>{const e=l.useRef(null),n=zt()?.clientData,{saveFilters:s}=mc(n?.id??"",Bs),r=Ve(F=>F.setAggregationsData),i=Ve(F=>F.setEpisodesData),o=Ve(F=>F.setResetKey),c=Ie(F=>F.setSelectedConclusionArticles),u=Ie(F=>F.setSelectedEpisodes),d=Ie(F=>F.setSelectedGenders),p=Ie(F=>F.setSelectedCriminalStatuses),g=Ie(F=>F.setSelectedPleaStatuses),A=Ve(F=>F.setSelectedRegionIds),E=Ie(F=>F.setSelectedRegionIds),x=Ie(F=>F.setSelectedPunishmentTypes),{casesFormatted:y,aggregationsData:I,episodesData:v,paginationData:S,isSuccess:b,isFetching:w,fabulaStatus:_,setSelectedEpisodes:N,setSelectedPleaStatuses:R,setSelectedPunishments:D,setSelectedConclusionArticles:k,setSelectedGenders:L,setSelectedCriminalStatuses:O}=mae({clientData:n,isSaved:!1,aggregations:!1,endOfListRef:e}),P=l.useCallback(()=>{n?.id&&(N({clientId:n.id,key:Bs,selectedEpisodes:null}),R({clientId:n.id,key:Bs,selectedPleaStatuses:null}),g({clientId:n.id,key:Bs,selectedPleaStatuses:null}),A({clientId:n.id,key:Bs,selectedRegionIds:null}),E({clientId:n.id,key:Bs,selectedRegionIds:null}),D({clientId:n.id,key:Bs,selectedPunishments:null}),x({clientId:n.id,key:Bs,selectedPunishmentTypes:null}),k({clientId:n.id,key:Bs,selectedConclusionArticles:null}),c({clientId:n.id,key:Bs,selectedConclusionArticles:null}),u({clientId:n.id,key:Bs,selectedEpisodes:null}),L({clientId:n.id,key:Bs,selectedGenders:null}),d({clientId:n.id,key:Bs,selectedGenders:null}),O({clientId:n.id,key:Bs,selectedCriminalStatuses:null}),p({clientId:n.id,key:Bs,selectedCriminalStatuses:null}),o(F=>F+1),s({episodes:null,articles:null,pleaStatuses:null,regions:null,punishments:null,genders:null,criminalStatuses:null}))},[N,R,g,A,E,D,x,k,c,u,L,d,O,p,o,s,n?.id]),B=l.useMemo(()=>!S?.searchAfter||S.searchAfter.length!==2||!S.searchAfter[0]||!S.searchAfter[1],[S.searchAfter]);return l.useEffect(()=>{n?.id&&b&&(r({clientId:n.id,key:Bs,data:I}),i({clientId:n.id,key:Bs,data:v}))},[n?.id,I,v,b,S.searchAfter,r,i]),!b||!n?a.jsx(ct,{isWithWrapper:!0}):y.length?a.jsxs("div",{className:"px-4",children:[a.jsx("div",{children:y.map((F,z)=>a.jsx(AE,{listInstance:Bs,item:F,isSaved:!1,clientData:n,maxFeloniesToShow:gae},F.id??`case-${z}`))}),a.jsxs("div",{ref:e,className:Y("flex items-center justify-center h-14",S.totalResults<=10&&"hidden"),children:[!B&&a.jsx(ct,{}),B&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.cases.messages.EVERYTHING_SHOWN})]})]}):a.jsx(W7,{clientData:n,fabulaStatus:_,isFetching:w,handleResetFilters:P})},Eae=({clientData:e,isSaved:t,fabulaStatus:n,isFetching:s=!1,handleResetFilters:r})=>{const i=Fe(),{status:o,setIsOpen:c,setObjectToFabulize:u}=wt({clientId:e?.id}),d=o==="pending"||o==="awaitingChoice"||n==="no_embeddings"||n==="no_fabula"&&(s||o==="autoCommitted"),p=l.useCallback(()=>{e?.id&&(c(!0),u({to:`/clients/${e.id}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}))},[c,u,e?.id]);return e?.id?a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-33"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:t?h.client.cases.emptyPage.messages.SAVED_PROMPT:d?a.jsx(Aa,{children:h.client.cases.emptyPage.messages.FABULA_ANALYZING}):n==="no_fabula"?h.client.cases.emptyPage.messages.FABULA_PROMPT:h.client.cases.emptyPage.messages.NOT_FOUND}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:t?h.client.cases.emptyPage.messages.SAVED_PROMPT_DESCRIPTION:d?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bp56_25:inline",children:h.client.cases.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART1})," ",a.jsx("div",{className:"bp56_25:inline",children:h.client.cases.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART2})]}):n==="no_fabula"?h.client.cases.emptyPage.messages.FABULA_PROMPT_DESCRIPTION:h.client.cases.emptyPage.messages.NOT_FOUND_DESCRIPTION}),!d&&!t&&(n==="no_fabula"?a.jsxs("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:[a.jsx(ut,{variant:"h16inverse",asChild:!0,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,state:i.state,children:h.client.cases.emptyPage.buttons.TO_FABULA})}),a.jsx(ut,{variant:"h16",asChild:!0,onClick:p,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,state:i.state,children:h.client.cases.emptyPage.buttons.TO_FABULIZER})})]}):a.jsx("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:a.jsx(ut,{variant:"h16inverse",onClick:r,children:h.client.cases.emptyPage.buttons.RESET_FILTERS})}))]})]}):null},xae=rt(async function(t,n){const s=Se.getState().accessToken,r={};n?.isSaved!==void 0&&(r.isSaved=!!n.isSaved),n?.articles!=null&&(r.articles=n.articles),n?.courts!=null&&(r.courts=n.courts),n?.episodes!=null&&(r.episodes=n.episodes
866),n?.searchAfter!=null&&(r.searchAfter=n.searchAfter),n?.limit!=null&&(r.limit=n.limit),n?.instances!=null&&(r.instances=n.instances),n?.punishments!=null&&(r.punishments=n.punishments),n?.pleaStatuses!=null&&(r.pleaStatuses=n.pleaStatuses),n?.regions!=null&&(r.regions=n.regions),n?.genders!=null&&(r.genders=n.genders),n?.criminalStatuses!=null&&(r.criminalStatuses=n.criminalStatuses);const i=Ke(`/clients/${t}/second-instance/cases/`),o=await qe(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),zl="second-instance";function Cae({clientData:e,isSaved:t,aggregations:n,endOfListRef:s}){const r=vs(),i=e?.id??"",o=Ve(re=>re.selectedRegionIdsByClientIdByKey[i]?.[zl]),c=Ve(re=>re.selectedCourtIdsByClientIdByKey[i]?.[zl]),u=Ve(re=>re.selectedPleaStatusesByClientIdByKey[i]?.[zl]),d=Ve(re=>re.selectedPunishmentsByClientIdByKey[i]?.[zl]),p=Ve(re=>re.selectedConclusionArticlesByClientIdByKey[i]?.[zl]),g=Ve(re=>re.selectedEpisodesByClientIdByKey[i]?.[zl]),A=Ve(re=>re.selectedGendersByClientIdByKey[i]?.[zl]),E=Ve(re=>re.selectedCriminalStatusesByClientIdByKey[i]?.[zl]),x=Ve(re=>re.setSelectedEpisodes),y=Ve(re=>re.setSelectedGenders),I=Ve(re=>re.setSelectedCriminalStatuses),v=Ve(re=>re.setSelectedPleaStatuses),S=Ve(re=>re.setSelectedPunishments),b=Ve(re=>re.setSelectedConclusionArticles),w=Ve(re=>re.setFabulaStatus),_=sn(re=>Object.prototype.hasOwnProperty.call(re.filtersByClientIdByInstance[i]??{},"second-instance")),N=(()=>{if(!(!p||!p.length))return p.map(re=>{try{const pe=JSON.parse(re);return{number:pe.article??void 0,part:pe.part??void 0}}catch{return}}).filter(Boolean)})(),R=o&&o.length?o.map(re=>parseInt(re,10)).filter(re=>!Number.isNaN(re)):void 0,D=R?.length?R.join(","):void 0,k=c??void 0,L=k?k.join(","):void 0,O=k,P=u??void 0,B=P?P.join(","):void 0,F=P,z=p?p.map(re=>{try{const pe=JSON.parse(re);return`${pe.codeType??""}:${pe.article??""}:${pe.part??""}:${pe.clause??""}`}catch{return re}}).filter(re=>!!re).join(","):void 0,Q=d&&d.length?d:void 0,M=Q?Q.join(","):void 0,K=A&&A.length?A:void 0,W=K?K.join(","):void 0,H=E&&E.length?E:void 0,j=H?H.join(","):void 0,q=g?.join(","),G=Qu({selectedEpisodeIds:g}),$=l.useRef(null),{data:J,isSuccess:ne,isFetching:X,fetchNextPage:oe,hasNextPage:ie,isFetchingNextPage:ee}=fa({queryKey:["cases","second-instance",i,t,D,L,B,z,M,q,W,j],queryFn:re=>xae(i,{isSaved:t,aggregations:n,articles:N??void 0,courts:O??void 0,episodes:G,searchAfter:re.pageParam?{searchAfterScore:re.pageParam[0],searchAfterId:re.pageParam[1]}:void 0,punishments:Q??void 0,pleaStatuses:F??void 0,regions:R,genders:K??void 0,criminalStatuses:H??void 0}),enabled:!!i&&_,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:re=>{if(re?.nextSearchAfter&&re.nextSearchAfter.length===2&&re.nextSearchAfter[0]&&re.nextSearchAfter[1])return re.nextSearchAfter},refetchInterval:re=>{const _e=re?.state?.data?.pages??void 0;if(!_e?.length)return!1;const Le=_e?.[0]?.fabulaStatus??"ok";return Le==="no_embeddings"?5e3:Le==="no_fabula"?3e4:!1}}),te=J?.pages,le=te?.flatMap(re=>re?.results??[])??[],fe={totalResults:te?.[0]?.totalResults??0,searchAfter:te?.[te.length-1]?.nextSearchAfter},ue=te?.[0]?.aggregations??null,ye=te?.[0]?.episodes??null,ce=te?.[0]?.fabulaStatus??"ok";return l.useEffect(()=>{i&&ne&&w({clientId:i,fabulaStatus:ce})},[i,ne,ce,w]),l.useEffect(()=>{if(!s)return;const re=s.current;if(!re)return;const pe=new IntersectionObserver(_e=>{_e[0].isIntersecting&&ie&&!ee&&($.current&&clearTimeout($.current),$.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},3e3),oe())},{rootMargin:"200px 0px"});return pe.observe(re),()=>{pe.disconnect()}},[s,oe,ie,ee]),l.useEffect(()=>{ee||!$.current||(clearTimeout($.current),Ze("CASES_SLOW_LOADING"),$.current=null)},[ee]),l.useEffect(()=>()=>{$.current&&(clearTimeout($.current),$.current=null)},[]),{casesFormatted:le.map(re=>{const pe=re?._id,_e=!!re?._source?.metadata_cui,Le=re?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,Ee=re?._source?.metadata_region??0,se=r[Ee]?.name??void 0,me=`${h.client.cases.titles.CASE_CARD_TITLE} ${Le}${se?` (${se})`:""}`,de=(()=>{const Pe={},Ue=re?.inner_hits?.felony_hit?.hits?.hits??[];for(const Be of Ue){if(!Be)continue;const nt=Be?._source?.event_id??void 0;if(!nt)continue;const At=Be?._source?.felony_id??void 0;if(!At)continue;const ht=typeof Be?._score=="number"?Be?._score:void 0,dt=`${nt}:::${At}`;Pe[dt]=ht??0}return Pe})(),ge=re?._source?.case_narrative?.events?re._source.case_narrative.events.reduce((Pe,Ue)=>{const Be=Ue.felonies;return Be?.length&&Be.forEach(nt=>{if(!nt.felony_id)return;const At=`${Ue.event_id}:::${nt.felony_id}`,ht=nt.objects.primary_object.related_law.law,dt=et({clause:ht.clause,part:ht.part,number:ht.article??""}),Gt=re?._source?.conclusions?re?._source?.conclusions.reduce((Xn,$t)=>{if(Xn||!$t?.verdicts?.length)return Xn;const Gn=$t.verdicts.find(Dr=>Dr.related_felony_id===nt.felony_id);return Gn||Xn},null):null,ft=re?._source?.general_information?.court_name??void 0,_n=re?._source?.case_narrative?.events?re?._source?.case_narrative?.events.reduce((Xn,$t)=>{if(Xn||!$t?.felonies?.length)return Xn;const Gn=$t.felonies.find(_i=>_i.felony_id===nt.felony_id);return Gn?Gn?.subjective_parts?.length?Gn?.subjective_parts.reduce((_i,kr)=>_i||!kr.related_accused_id?_i:kr.related_accused_id,void 0):void 0:Xn},void 0):void 0,Cn=_n&&re?._source?.conclusions?re?._source?.conclusions.reduce((Xn,$t)=>Xn||$t.related_accused_id!==_n?Xn:$t,null):void 0,wr=re?._source?.conclusions??[],{conclusionIndex:eo,verdictIndex:Rr}=Lm({conclusions:wr,felonyId:nt.felony_id,relatedAccusedId:_n}),Zr=[{id:"courtFirstInstance",name:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,fields:{pleaStatus:Gt?.plea?.status??void 0,appealReviewResultStatus:re?._source?.general_information?.is_modified??void 0,courtName:ft,punishment:Gt?.punishment?.description??void 0,finalSentencingPunishment:Cn?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:Cn?.final_sentencing?.result??void 0,verdictStatus:Gt?.result??void 0,sourcePaths:Mm({conclusionIndex:eo,verdictIndex:Rr})}}],ei=de[At]?Math.round(de[At]*100):void 0;Pe.push({id:At,articleName:dt,score:ei,phases:Zr})}),Pe},[]):[];return{id:pe,title:me,cui:Le,hasCui:_e,felonies:ge,data:re,isSaved:!!re.isSaved}}
866),aggregationsData:ue,episodesData:ye,paginationData:fe,isSuccess:ne,isFetching:X,fabulaStatus:ce,setSelectedEpisodes:x,setSelectedPleaStatuses:v,setSelectedPunishments:S,setSelectedConclusionArticles:b,setSelectedGenders:y,setSelectedCriminalStatuses:I}}const yae=8,lr="second-instance",bae=()=>{const e=l.useRef(null),n=zt()?.clientData,s=Ve(P=>P.setAggregationsData),r=Ve(P=>P.setEpisodesData),i=Ve(P=>P.setResetKey),o=Ie(P=>P.setSelectedConclusionArticles),c=Ie(P=>P.setSelectedEpisodes),u=Ie(P=>P.setSelectedGenders),d=Ie(P=>P.setSelectedCriminalStatuses),p=Ve(P=>P.setSelectedRegionIds),g=Ie(P=>P.setSelectedRegionIds),{casesFormatted:A,aggregationsData:E,episodesData:x,paginationData:y,isSuccess:I,isFetching:v,fabulaStatus:S,setSelectedEpisodes:b,setSelectedPleaStatuses:w,setSelectedPunishments:_,setSelectedConclusionArticles:N,setSelectedGenders:R,setSelectedCriminalStatuses:D}=Cae({clientData:n,isSaved:!1,aggregations:!1,endOfListRef:e}),{saveFilters:k}=mc(n?.id??"",lr),L=l.useCallback(()=>{n?.id&&(b({clientId:n.id,key:lr,selectedEpisodes:null}),c({clientId:n.id,key:lr,selectedEpisodes:null}),w({clientId:n.id,key:lr,selectedPleaStatuses:null}),p({clientId:n.id,key:lr,selectedRegionIds:null}),g({clientId:n.id,key:lr,selectedRegionIds:null}),_({clientId:n.id,key:lr,selectedPunishments:null}),N({clientId:n.id,key:lr,selectedConclusionArticles:null}),o({clientId:n.id,key:lr,selectedConclusionArticles:null}),R({clientId:n.id,key:lr,selectedGenders:null}),D({clientId:n.id,key:lr,selectedCriminalStatuses:null}),u({clientId:n.id,key:lr,selectedGenders:null}),d({clientId:n.id,key:lr,selectedCriminalStatuses:null}),i(P=>P+1),k({episodes:null,articles:null,pleaStatuses:null,regions:null,punishments:null,genders:null,criminalStatuses:null}))},[b,c,w,p,g,_,N,o,R,D,u,d,i,k,n?.id]),O=l.useMemo(()=>!y?.searchAfter||y.searchAfter.length!==2||!y.searchAfter[0]||!y.searchAfter[1],[y.searchAfter]);return l.useEffect(()=>{n?.id&&I&&(s({clientId:n.id,key:lr,data:E}),r({clientId:n.id,key:lr,data:x}))},[n?.id,E,x,I,y.searchAfter,s,r]),!I||!n?a.jsx(ct,{isWithWrapper:!0}):A.length?a.jsxs("div",{className:"px-4",children:[a.jsx("div",{children:A.map((P,B)=>a.jsx(AE,{listInstance:lr,item:P,isSaved:!1,clientData:n,maxFeloniesToShow:yae},P.id??`case-${B}`))}),a.jsxs("div",{ref:e,className:Y("flex items-center justify-center h-14",y.totalResults<=10&&"hidden"),children:[!O&&a.jsx(ct,{}),O&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.cases.messages.EVERYTHING_SHOWN})]})]}):a.jsx(Eae,{clientData:n,fabulaStatus:S,isFetching:v,handleResetFilters:L})};function Iae({instanceType:e,source:t}){if(!("is_modified"in t.general_information))return;const n=t.general_information.is_modified;if(n!=null)return n}function Sae({caseEntity:e}){const t=Object.create(null),n=e?.inner_hits?.felony_hit?.hits?.hits??[];for(const s of n){const r=s?._source,i=r?.event_id,o=r?.felony_id,c=s?._score;if(!i||!o||typeof c!="number")continue;const u=`${i}:::${o}`;t[u]=c}return t}function vae({caseEntity:e,instanceType:t,regionsMapById:n}){const s=e?._source,r=e?._id??null,i=!!s?.metadata_cui,o=s?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,c=s?.metadata_region??0,u=n[String(c)]?.name??void 0,d=`${h.client.cases.titles.CASE_CARD_TITLE} ${o}${u?` (${u})`:""}`,p=s?.case_narrative?.events??[],g=[],A=Sae({caseEntity:e});for(const y of p){const I=y.felonies??[];for(const v of I){if(!v.felony_id)continue;const S=`${y.event_id}:::${v.felony_id}`,b=v.objects?.primary_object?.related_law?.law,w=b?et({clause:b.clause,part:b.part,number:b.article??""}):"",_=s?.conclusions??[],R=_.flatMap(M=>M.verdicts??[]).find(M=>M.related_felony_id===v.felony_id)??null,D=s?.general_information?.court_name??void 0;let k;for(const M of p)if(k=M.felonies?.find(W=>W.felony_id===v.felony_id)?.subjective_parts?.[0]?.related_accused_id??void 0,k)break;const L=k?_.find(M=>M.related_accused_id===k):void 0;(s?.defense_requests??[]).find(M=>M.related_felony_id===v.felony_id);const P=h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,B=Iae({instanceType:t,source:s}),F={pleaStatus:R?.plea?.status??void 0,appealReviewResultStatus:B,courtName:D,punishment:R?.punishment?.description??void 0,finalSentencingPunishment:L?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:L?.f
866inal_sentencing?.result??void 0,verdictStatus:R?.result??void 0},z=A[S],Q=typeof z=="number"?Math.round(z*100):void 0;g.push({id:S,articleName:w,score:Q,phases:[{id:"courtSecondInstance",name:P,fields:F}]})}}const E=e,x=!!e.isSaved;return{id:r,title:d,cui:o,hasCui:i,felonies:g,data:E,isSaved:x}}function _ae({clientData:e,endOfListRef:t}){const n=vs(),s=e?.id??"",r=l.useRef(null),{data:i,isSuccess:o,isFetched:c,fetchNextPage:u,hasNextPage:d,isFetchingNextPage:p}=fa({queryKey:["cases","saved",s],queryFn:I=>foe(s,{searchAfter:I.pageParam?{searchAfterScore:I.pageParam[0],searchAfterId:I.pageParam[1]}:void 0}),enabled:!!s,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:()=>{}}),g=i?.pages,A=g?.flatMap(I=>I?.results??[])??[],x={totalResults:g?.[0]?.totalResults??0,searchAfter:void 0};return l.useEffect(()=>{if(!t)return;const I=t.current;if(!I)return;const v=new IntersectionObserver(S=>{S[0].isIntersecting&&d&&!p&&(r.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},3e3),u())},{rootMargin:"200px 0px"});return v.observe(I),()=>{v.disconnect()}},[t,u,d,p]),l.useEffect(()=>{p||!r.current||(clearTimeout(r.current),Ze("CASES_SLOW_LOADING"),r.current=null)},[p]),l.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),{casesFormatted:A.flatMap(I=>{const v=I.instances.find(z=>z.instance==="first_instance"),S=I.instances.find(z=>z.instance==="second_instance"),b={...v?.instance==="first_instance"&&{first_instance:v.data},...S?.instance==="second_instance"&&{second_instance:S.data}},w=v?"first-instance":"second-instance",_=I.activeInstance?I.activeInstance==="first_instance"?"first-instance":"second-instance":void 0;if(!v&&S){const z=vae({caseEntity:S.data,instanceType:"second-instance",regionsMapById:n});return[{...z,id:z.id??I.id,isSaved:!0,listInstance:w,activeInstance:_,savedInstances:b}]}if(!v)return[];const N=v.data,R=N._id??I.id,D=!!N?._source?.metadata_cui,k=N?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED_LOWERCASE,L=N?._source?.metadata_region??0,O=n[L]?.name??void 0,P=`${h.client.cases.titles.CASE_CARD_TITLE} ${k}${O?` (${O})`:""}`,B=(()=>{const z={},Q=N?.inner_hits?.felony_hit?.hits?.hits??[];for(const M of Q){if(!M)continue;const K=M?._source?.event_id??void 0;if(!K)continue;const W=M?._source?.felony_id??void 0;if(!W)continue;const H=typeof M?._score=="number"?M?._score:void 0,j=`${K}:::${W}`;z[j]=H??0}return z})(),F=N?._source?.case_narrative?.events?N._source.case_narrative.events.reduce((z,Q)=>{const M=Q.felonies;return M?.length&&M.forEach(K=>{if(!K.felony_id)return;const W=`${Q.event_id}:::${K.felony_id}`,H=K.objects.primary_object.related_law.law,j=et({clause:H.clause,part:H.part,number:H.article??""}),q=N?._source?.conclusions?N?._source?.conclusions.reduce((le,he)=>{if(le||!he?.verdicts?.length)return le;const fe=he.verdicts.find(ue=>ue.related_felony_id===K.felony_id);return fe||le},null):null,G=N?._source?.defense_requests?N?._source?.defense_requests.reduce((le,he)=>le||he.related_felony_id!==K.felony_id?le:he,null):null,$=N?._source?.general_information?.court_name??void 0,J=N?._source?.case_narrative?.events?N?._source?.case_narrative?.events.reduce((le,he)=>{if(le||!he?.felonies?.length)return le;const fe=he.felonies.find(ye=>ye.felony_id===K.felony_id);return fe?fe?.subjective_parts?.length?fe?.subjective_parts.reduce((ye,ce)=>ye||!ce.related_accused_id?ye:ce.related_accused_id,void 0):void 0:le},void 0):void 0,ne=J&&N?._source?.conclusions?N?._source?.conclusions.reduce((le,he)=>le||he.related_accused_id!==J?le:he,null):void 0,X=N?._source?.conclusions??[],{conclusionIndex:oe,verdictIndex:ie}=Lm({conclusions:X,felonyId:K.felony_id,relatedAccusedId:J}),ee=[{id:"courtFirstInstance",name:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,fields:{pleaStatus:q?.plea?.status??void 0,appealReviewResultStatus:N?._source?.general_information?.is_modified??void 0,defenseRequestGoal:G?.goal??void 0,defenseRequestResult:G?.result??void 0,courtName:$,punishment:q?.punishment?.description??void 0,finalSentencingPunishment:ne?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:ne?.final_sentencing?.result??void 0,verdictStatus:q?.result??void 0,sourcePaths:Mm({conclusionIndex:oe,verdictIndex:ie})}}],te=B[W]?Math.round(B[W]*100):void 0;z.push({id:W,articleName:j,score:te,phases:ee})}),z},[]):[];
866return[{id:R,title:P,cui:k,hasCui:D,felonies:F,data:N,isSaved:!0,listInstance:w,activeInstance:_,savedInstances:b}]}),paginationData:x,isSuccess:o,isFetched:c}}const Tae=8,Aw=()=>{const e=l.useRef(null),n=zt()?.clientData,{casesFormatted:s,paginationData:r,isSuccess:i,isFetched:o}=_ae({clientData:n,endOfListRef:e}),c=l.useMemo(()=>!r?.searchAfter||r.searchAfter.length!==2||!r.searchAfter[0]||!r.searchAfter[1],[r.searchAfter]);return!o||!n||!i?a.jsx(ct,{isWithWrapper:!0}):s.length?a.jsxs("div",{className:"px-4",children:[a.jsx("div",{children:s.map((u,d)=>a.jsx(AE,{listInstance:u.listInstance,activeInstance:u.activeInstance,savedInstances:u.savedInstances,item:u,clientData:n,maxFeloniesToShow:Tae,isSaved:!0},u.id??`case-${d}`))}),a.jsxs("div",{ref:e,className:Y("flex items-center justify-center h-14",r.totalResults<=10&&"hidden"),children:[!c&&a.jsx(ct,{}),c&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.cases.messages.EVERYTHING_SHOWN})]})]}):a.jsx(W7,{clientData:n,isSaved:!0})},Nae=()=>{const e=zt(),t=e?.clientData,n=e?.isSuccess,s=e?.mainWrapperRef;return t?a.jsx("div",{className:"flex flex-col flex-1 pt-6 bp48:pt-4",children:a.jsx(Xi,{context:{clientData:t,isSuccess:n,mainWrapperRef:s}})}):null},wae=()=>a.jsx(Qn,{to:"first-instance",replace:!0}),Rae=()=>{const e=zt(),t=e?.clientData,n=e?.isSuccess,s=e?.mainWrapperRef;return t?a.jsx("div",{className:"flex flex-col flex-1",children:a.jsx(Xi,{context:{clientData:t,isSuccess:n,mainWrapperRef:s}})}):null},Dae=({clientData:e,fabulaStatus:t,isFetching:n=!1})=>{const{status:s,setIsOpen:r,setObjectToFabulize:i}=wt({clientId:e?.id}),o=s==="pending"||s==="awaitingChoice"||t==="no_embeddings"||t==="no_fabula"&&(n||s==="autoCommitted"),c=l.useCallback(()=>{e?.id&&(r(!0),i({to:`/clients/${e.id}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}))},[r,i,e?.id]);return e?.id?a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-35"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:o?a.jsx(Aa,{children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING}):h.client.strategies.emptyPage.messages.FABULA_PROMPT}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bp56_25:inline",children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART1})," ",a.jsx("div",{className:"bp56_25:inline",children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART2})]}):h.client.strategies.emptyPage.messages.FABULA_PROMPT_DESCRIPTION}),!o&&t==="no_fabula"&&a.jsxs("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:[a.jsx(ut,{variant:"h16inverse",asChild:!0,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,children:h.client.strategies.emptyPage.buttons.TO_FABULA})}),a.jsx(ut,{variant:"h16",asChild:!0,onClick:c,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,children:h.client.strategies.emptyPage.buttons.TO_FABULIZER})})]})]})]}):null},yf=rt(async function(t,n){const s=Se.getState().accessToken,r={};n?.isSaved!==void 0&&(r.isSaved=!!n.isSaved),n?.articles!=null&&(r.articles=n.articles),n?.evidence!=null&&(r.evidence=n.evidence),n?.circumstances!=null&&(r.circumstances=n.circumstances),n?.courts!=null&&(r.courts=n.courts),n?.episodes!=null&&(r.episodes=n.episodes),n?.searchAfter!=null&&(r.searchAfter=n.searchAfter),n?.limit!=null&&(r.limit=n.limit),n?.punishments!=null&&(r.punishments=n.punishments),n?.pleaStatuses!=null&&(r.pleaStatuses=n.pleaStatuses),n?.regions!=null&&(r.regions=n.regions),n?.defenseRequestsResults!=null&&(r.defenseRequestsResults=n.defenseRequestsResults),n?.defenseRequestsGoal!=null&&(r.defenseRequestsGoal=n.defenseRequestsGoal),n?.genders!=null&&(r.genders=n.genders),n?.criminalStatuses!=null&&(r.criminalStatuses=n.criminalStatuses);const i=Ke(`/clients/${t}/first-instance/strategies/`),o=await qe(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data}),Ql="first-instance";function kae({clientData:e,aggregations:t,endOfListRef:n}){const s=vs(),r=e?.id??"",i=Ie(X=>X.selectedRegionIdsByClientIdByKey[r]?.[Ql]),o=Ie(X=>X.selectedPleaStatusesByClientIdByKey[r]?.[Ql]),c=Ie(X=>X.selectedConclusionArticlesByClientIdByKey[r]?.[Ql]),u=Ie(X=>
866X.selectedEpisodesByClientIdByKey[r]?.[Ql]),d=Ie(X=>X.selectedPunishmentTypesByClientIdByKey[r]?.[Ql]),p=Ie(X=>X.selectedGendersByClientIdByKey[r]?.[Ql]),g=Ie(X=>X.selectedCriminalStatusesByClientIdByKey[r]?.[Ql]),A=Ie(X=>X.selectedDefenseRequestsResultsByClientIdByKey[r]?.[Ql]),E=sn(X=>Object.prototype.hasOwnProperty.call(X.filtersByClientIdByInstance[r]??{},"first-instance")),x=(()=>{if(!(!c||!c.length))return c.map(X=>{try{const oe=JSON.parse(X);return{number:oe.article?oe.article:void 0,part:oe.part?oe.part:void 0,clause:oe.clause?oe.clause:void 0,code_type:oe.codeType?oe.codeType:void 0}}catch{return}}).filter(Boolean)})(),y=i&&i.length?i.map(X=>parseInt(X,10)).filter(X=>!Number.isNaN(X)):void 0,I=o??void 0,v=I?I.join(","):void 0,S=I,b=c?c.map(X=>{try{const oe=JSON.parse(X);return`${oe.codeType??""}:${oe.article??""}:${oe.part??""}:${oe.clause??""}`}catch{return X}}).filter(X=>!!X).join(","):void 0,w=d&&d.length?d:void 0,_=w?w.join(","):void 0,N=p&&p.length?p.join(","):void 0,R=g&&g.length?g.join(","):void 0,D=A&&A.length?A:void 0,k=D?D.join(","):void 0,L=u?.join(","),O=Qu({selectedEpisodeIds:u}),P=l.useRef(null),{data:B,isSuccess:F,isFetching:z,fetchNextPage:Q,hasNextPage:M,isFetchingNextPage:K}=fa({queryKey:["strategies","first-instance",r,y,v,b,_,L,N,R,k],queryFn:X=>yf(r,{aggregations:t,articles:x??void 0,episodes:O,genders:p&&p.length?p:void 0,criminalStatuses:g&&g.length?g:void 0,searchAfter:X.pageParam?{searchAfterScore:X.pageParam[0],searchAfterId:X.pageParam[1]}:void 0,punishments:w??void 0,pleaStatuses:S??void 0,regions:y??void 0,defenseRequestsResults:D??void 0}),enabled:!!r&&E,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:X=>{if(X?.nextSearchAfter&&X.nextSearchAfter.length===2&&X.nextSearchAfter[0]&&X.nextSearchAfter[1])return X.nextSearchAfter},refetchInterval:X=>{const ie=X?.state?.data?.pages;if(!ie?.length)return!1;const ee=ie?.[0]?.fabulaStatus??"ok";return ee==="no_embeddings"?5e3:ee==="no_fabula"?3e4:!1}}),W=B?.pages,H=W?.flatMap(X=>X?.results??[])??[],q={totalResults:W?.[0]?.totalResults??0,searchAfter:W?.[W.length-1]?.nextSearchAfter},G=W?.[0]?.aggregations??null,$=W?.[0]?.episodes??null,J=W?.[0]?.fabulaStatus??"ok";return l.useEffect(()=>{if(!n)return;const X=n.current;if(!X)return;const oe=new IntersectionObserver(ie=>{ie[0].isIntersecting&&M&&!K&&(P.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"CASES_SLOW_LOADING",duration:0})},3e3),Q())},{rootMargin:"200px 0px"});return oe.observe(X),()=>{oe.disconnect()}},[n,Q,M,K]),l.useEffect(()=>{K||!P.current||(clearTimeout(P.current),Ze("CASES_SLOW_LOADING"),P.current=null)},[K]),l.useEffect(()=>()=>{P.current&&(clearTimeout(P.current),P.current=null)},[]),{strategiesFormatted:H.map(X=>{const oe=X?._id,ie=X?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED,ee=X?._source?.metadata_region??0,te=s[ee]?.name??void 0,le=`${h.client.cases.titles.CASE_CARD_TITLE} ${ie}${te?` (${te})`:""}`,he=(()=>{const ue={},ye=X?.inner_hits?.felony_hit?.hits?.hits??[];for(const ce of ye){if(!ce)continue;const xe=ce?._source?.event_id??void 0;if(!xe)continue;const re=ce?._source?.felony_id??void 0;if(!re)continue;const pe=typeof ce?._score=="number"?ce?._score:void 0,_e=`${xe}:::${re}`;ue[_e]=pe??0}return ue})(),fe=X?._source?.case_narrative?.events?X._source.case_narrative.events.reduce((ue,ye)=>{const ce=ye.felonies;return ce?.length&&ce.forEach(xe=>{if(!xe.felony_id)return;const re=`${ye.event_id}:::${xe.felony_id}`,pe=xe.objects.primary_object.related_law.law,_e=et({clause:pe.clause,part:pe.part,number:pe.article??""}),Le=X?._source?.conclusions?X?._source?.conclusions.reduce((Ue,Be)=>{if(Ue||!Be?.verdicts?.length)return Ue;const nt=Be.verdicts.find(At=>At.related_felony_id===xe.felony_id);return nt||Ue},null):null,Ee=X?._source?.defense_requests?X?._source?.defense_requests.reduce((Ue,Be)=>Ue||(Be.related_felony_id!==xe.felony_id?Be:Ue),null):null,se=X?._source?.general_information?.court_name??void 0,me=X?._source?.case_narrative?.events?X?._source?.case_narrative?.events.reduce((Ue,Be)=>{if(Ue||!Be?.felonies?.length)return Ue;const nt=Be.felonies.find(ht=>ht.felony_id===xe.felony_id);return nt?nt?.subjective_parts?.length?nt?.subjective_parts.reduce((ht,dt)=>ht||!dt.related_accused_id?ht:dt.related_accused_id,void 0):void 0:Ue},void 0):void 0,de=me&&X?._source?.conclusions?X?._source?.conclusions.reduce((Ue,Be)=>Ue||Be.related_accused_id!==me?Ue:Be,null):void 0,ge=[{id:"courtFirstInstance",name:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,fields:{pleaStatus:Le?.plea?.status??void 0,defenseRequestGoal:Ee?.goal??void 0,defenseRequestResult:Ee?.result??void 0,courtName:se,punishment:Le?.punishment?.description??void 0,finalSentencingPunishment:de?.final_sentencing?.punishment?.description??void 0,finalSentencingResult:de?.final_sentencing?.result??void 0}}],Pe=he[re]?Math.round(he[re]*100):void 0;ue.push({id:re,articleName:_e,score:Pe,phases:ge})}),ue},[]):[];return{id:oe,title:le,cui:ie,felonies:fe,data:X}}
866),aggregationsData:G,episodesData:$,paginationData:q,isSuccess:F,isFetching:z,fabulaStatus:J}}const Oae=({articles:e,maxArticleItemDocCount:t})=>{const n=l.useRef(null),s=l.useRef(null),[r,i]=l.useState(0),[o,c]=l.useState(!1),u=l.useRef(0),d=l.useRef(0),p=l.useRef(!1),g=1,[A,E]=Yh(),[x,y]=Yh(),I=fE("(any-pointer: coarse), (hover: none)",!1),v=l.useMemo(()=>!!(I||typeof window<"u"&&"ontouchstart"in window||typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0),[I]),S=l.useCallback(F=>{const z=n.current??A.current,Q=s.current??x.current;if(!z||!Q)return 0;const M=Math.max(0,Q.scrollWidth-z.clientWidth);return F<0?0:F>M?M:F},[A,x]),b=l.useCallback(F=>{n.current=F,A(F)},[A]),w=l.useCallback(F=>{s.current=F,x(F)},[x]),_=l.useMemo(()=>{const F=E.width??0;return(y.width??0)>F+1},[E.width,y.width]);l.useEffect(()=>{!_&&r!==0&&i(0)},[_,r]);const N=l.useCallback(F=>{if(v||!_)return;const z=n.current;z&&(c(!0),u.current=F.clientX,d.current=r,p.current=!1,z.style.cursor="grabbing",z.style.userSelect="none")},[v,_,r]),R=l.useCallback(F=>{if(v||!_||!o)return;const z=F.clientX-u.current;if(!p.current){if(Math.abs(z)<=g)return;const M=n.current;M&&typeof M.setPointerCapture=="function"&&M.setPointerCapture(F.pointerId),p.current=!0}const Q=S(d.current-z);i(Q)},[S,o,v,_]),D=l.useCallback(F=>{if(v||!_)return;const z=n.current;z&&(c(!1),typeof z.releasePointerCapture=="function"&&typeof z.hasPointerCapture=="function"&&z.hasPointerCapture(F.pointerId)&&z.releasePointerCapture(F.pointerId),z.style.cursor="",z.style.userSelect="")},[v,_]),k=l.useCallback(F=>{p.current&&(F.preventDefault(),F.stopPropagation(),p.current=!1)},[]),L=l.useMemo(()=>v?`relative h-40 bp56_25:h-41 w-full ${_?"overflow-x-auto":"overflow-x-hidden"} overflow-y-hidden touch-auto scrollbar-none`:"relative h-40 bp56_25:h-41 w-full overflow-hidden touch-pan-y",[v,_]),O=l.useMemo(()=>v?{}:_?{transform:`translateX(-${r}px)`}:{},[v,_,r]),P=l.useMemo(()=>v?{WebkitOverflowScrolling:"touch"}:{},[v]),B=l.useMemo(()=>e?.length?[...e].sort((F,z)=>z.doc_count-F.doc_count):[],[e]);return a.jsx("div",{ref:b,className:L,style:P,onClick:k,onPointerDown:N,onPointerMove:R,onPointerUp:D,onPointerCancel:D,children:a.jsx("div",{ref:w,className:"flex w-max",style:O,children:!!B?.length&&B.map((F,z)=>a.jsxs("div",{className:"min-w-44 max-w-44 w-44 h-40 bp56_25:h-41 pt-4 bp
86656_25:pt-3 pb-6 bp56_25:pb-8 group px-1 first:pl-0 last:pr-0",children:[a.jsxs("div",{className:"relative flex items-end justify-center pb-1 h-24 mb-2",children:[a.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-sky-100 min-h-7",style:{height:`${Math.ceil(F.doc_count/t*68)+28}px`}}),a.jsx("div",{className:"relative roboto-flex-112-600-0 text-[14px] leading-[20px] text-sky-500",children:fn({value:F.doc_count})})]}),a.jsx("div",{className:"flex justify-center roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 group-hover:text-sky-500",children:et({clause:F.clause,part:F.part,number:F.article,codeType:F.code_type})})]},z))})})},K7=({articles:e})=>{if(!e?.length)return null;const t=Math.ceil(e.length/2),n=e.slice(0,t),s=e.slice(t);return a.jsxs("div",{className:"w-full",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-white whitespace-nowrap",children:h.client.case.firstInstance.defenseRequest.item.titles.POSSIBLE_LEGAL_BASIS}),a.jsxs("div",{className:"mt-1.5 flex gap-4 align-top justify-between",children:[a.jsx("div",{children:n.map((r,i)=>a.jsx("div",{className:"whitespace-nowrap roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-400",children:et({clause:r.clause,part:r.part,number:r.article,codeType:r.code_type})},i))}),a.jsx("div",{children:s.map((r,i)=>a.jsx("div",{className:"whitespace-nowrap roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:et({clause:r.clause,part:r.part,number:r.article,codeType:r.code_type})},i))})]})]})},Pae=({item:e,clientId:t})=>{const n=at(),s=Fe(),r=l.useMemo(()=>e.argument_articles.length>0,[e.argument_articles]),i=l.useMemo(()=>{if(!e.argument_articles.length)return 0;const u=e.argument_articles.map(d=>{const p=d?.doc_count;return typeof p=="number"&&Number.isFinite(p)?p:0});return u.length?Math.max(0,...u):0},[e.argument_articles]),o=l.useCallback(u=>{u.preventDefault()},[]),c=l.useCallback(()=>{if(!t)return;const u=s.state??{},d={goal:e.defense_goal??null,articles:[],argumentResults:[]};n(`/clients/${t}/defense-strategy/first-instance`,{state:{...u,isPreventScrollToTop:!0,isForceDefenseStrategyDetailedAnimateOnStart:!0,defenseRequestsGoal:d}})},[t,e,s.state,n]);return a.jsxs("div",{onClick:()=>c(),draggable:!1,onDragStartCapture:o,className:"block pt-6 bp56_25:pt-8 pb-0 border-b border-zinc-200 border-bottom-1 last:border-b-0 hover:bg-zinc-50 cursor-pointer -ml-4 -mr-4 pl-4 pr-4",children:[a.jsxs("div",{className:"flex align-center justify-between",children:[a.jsx("div",{className:"roboto-flex-25-600-1 text-[20px] leading-[24px] text-zinc-950",children:e.defense_goal}),a.jsxs("div",{className:"hidden bp56_25:flex items-center uppercase roboto-flex-25-700-1 text-[12px] bg-green-50 text-green-600 rounded-full px-1.5 whitespace-nowrap h-5 mt-1",children:[Math.round(e.defense_success_percent??0),"%"," ",qt({count:Math.round(e.defense_success_percent??0),zero:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ZERO,one:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ONE,many:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_MANY})]})]}),a.jsxs("div",{className:Y("mt-4 bp56_25:mt-2 flex align-center justify-between",!r&&"pb-8"),children:[a.jsxs("div",{className:"flex align-center justify-start gap-3 bp56_25:gap-4 roboto-flex-100-400-1 text-[14px] bp56_25:text-[16px] leading-[16px] bp56_25:leading-[20px] mb-0",children:[!!e.goal_articles?.length&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col align-center justify-start gap-3",children:(()=>{const u=e.goal_articles?.[0];if(!u)return null;const d=Math.max(0,(e.goal_articles?.length??0)-1);return a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"left",content:a.jsx(K7,{articles:e.goal_articles??[]}),children:a.jsxs("div",{className:"text-zinc-950",children:[et({clause:u.clause,part:u.part,number:u.article,codeType:u.code_type}),!!d&&a.jsxs("span",{className:"text-zinc-500 ml-1",children:["+",d]})]})})})()}),a.jsx("div",{className:"text-zinc-500",children:"·"})]}),a.jsxs("div",{className:"flex align-center justify-start gap-4 text-zinc-500",children:[a.jsxs("div",{children:[fn({value:e.felony_count})," ",qt({count:e.felony_count,zero:h.client.defenseStrategy.defenseRequest.FELONIES_ZERO,one
866:h.client.defenseStrategy.defenseRequest.FELONIES_ONE,many:h.client.defenseStrategy.defenseRequest.FELONIES_MANY})]}),a.jsxs("div",{children:[fn({value:e.defense_arguments_count})," ",qt({count:e.defense_arguments_count,zero:h.client.defenseStrategy.defenseRequest.ARGUMENTS_ZERO,one:h.client.defenseStrategy.defenseRequest.ARGUMENTS_ONE,many:h.client.defenseStrategy.defenseRequest.ARGUMENTS_MANY})]}),a.jsx("div",{children:r?`${fn({value:e.articles_count})} ${qt({count:e.articles_count,zero:h.client.defenseStrategy.defenseRequest.RIGHTS_ZERO,one:h.client.defenseStrategy.defenseRequest.RIGHTS_ONE,many:h.client.defenseStrategy.defenseRequest.RIGHTS_MANY})}`:h.client.defenseStrategy.defenseRequest.RIGHTS_ABSENT})]})]}),a.jsxs("div",{className:"flex bp56_25:hidden items-center uppercase roboto-flex-25-700-1 text-[12px] bg-green-50 text-green-600 rounded-full px-1.5 whitespace-nowrap h-5",children:[Math.round(e.defense_success_percent??0),"%"," ",qt({count:Math.round(e.defense_success_percent??0),zero:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ZERO,one:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ONE,many:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_MANY})]})]}),!!r&&a.jsx(Oae,{articles:e.argument_articles,maxArticleItemDocCount:i})]})},_2=({handleResetFilters:e})=>a.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 pt-32 pb-42",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.messages.NO_RESULTS_BY_FILTERS}),a.jsx("div",{className:"h-8 flex items-center justify-center px-3 bg-zinc-100 rounded-full roboto-flex-25-700-1 text-[14px] leading-[16px] text-zinc-950 uppercase cursor-pointer hover:bg-zinc-200",onClick:e,children:"Сбросить все"})]}),Lae=({aggregationsData:e,clientId:t,isSuccess:n,handleResetFilters:s})=>{const r=e?.defense_requests_goals_nested;return n?r?.length?a.jsx(a.Fragment,{children:!!r?.length&&a.jsx(a.Fragment,{children:r.map((i,o)=>i?a.jsx(Pae,{item:i,clientId:t},o):null)})}):a.jsx(_2,{handleResetFilters:s}):a.jsx(ct,{isWithWrapper:!0,minHeight:90,delay:0,isNoPadding:!0})},T2=({tabs:e})=>a.jsx("div",{className:Y("flex items-center justify-start gap-1 whitespace-nowrap"),children:e.map(t=>a.jsx(Je,{to:t.to,state:t.state,end:!!t.end,className:({isActive:n})=>Y("flex items-center justify-center roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400 px-1.5 py-1 cursor-pointer whitespace-nowrap select-none hover:text-zinc-500",n&&"text-zinc-950 bg-zinc-100"),children:t.label},t.id))}),Mae=({clientId:e,typeLabel:t,typeTermLabel:n,mainText:s,pageType:r,notedTotal:i,ignoredTotal:o,purposeText:c,subcategory:u})=>{const d=at(),p=l.useCallback(()=>{d(`/clients/${e}/defense-strategy/first-instance/evidence${r==="prosecution"?"/prosecution":""}`,{state:{isPreventScrollToTop:!0,isForceDefenseStrategyEvidenceDetailedAnimateOnStart:!0,evidence:{usedBy:r==="defense"?"Сторона защиты":"Сторона обвинения",type:t,category:n,purpose:c,subcategory:u},pageType:r,notedTotal:i,ignoredTotal:o}})},[e,r,d,t,n,c,u,i,o]),g=a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[12px] leading-[14px] w-[33px] text-zinc-950 uppercase shrink-0 text-right",children:i}),a.jsxs("div",{className:"flex items-center justify-stretch gap-1 w-[228px]",children:[!!i&&a.jsx("div",{className:"h-1.5 bg-emerald-600 min-w-1.5 rounded-full",style:{width:i/(i+o)*100+"%"}}),!!o&&a.jsx("div",{className:"h-1.5 bg-slate-600 min-w-1.5 rounded-full",style:{width:o/(i+o)*100+"%"}})]}),a.jsx("div",{className:"roboto-flex-25-700-1 text-[12px] leading-[14px] w-[33px] text-zinc-950 uppercase shrink-0 text-left",children:o})]});return a.jsxs("div",{className:"py-8 flex gap-8 border-b border-zinc-200 border-bottom-1 last:border-b-0 hover:bg-zinc-50 cursor-pointer -ml-6 -mr-6 px-6",onClick:p,children:[a.jsxs("div",{className:"flex-1 overflow-hidden text-ellipsis",children:[a.jsx("div",{className:"mb-2 roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 whitespace-nowrap overflow-hidden text-ellipsis",children:Vn(s??"")}),a.jsxs("div",{className:"mb-1 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:[a.jsx("span",{children:t},t),a.jsx("span",{children:" · "}),a.jsx("span",{children:n},n)]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:c})]}),a.jsx("div",{className:"hidden bp56_25:block w-80",children:a.jsx(Do,{verticalPosition:"top",content:a.jsxs("div",{className:"flex items-center justify-between gap-4 w-72 max-w-72 bp90:w-80 bp90:max-w-80",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("figure",{className:"h-2 w-2 bg-emerald-600 rounded-full"}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] text-zinc-400",children:"Учтено"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center roboto-flex-100-400-1 text-[16px] text-zinc-400",children:"Не учтено"}),a.jsx("figure",{className:"h-2 w-2 bg-slate-600 rounded-full"})]})]}),children:a.jsx("div",{className:"relative w-full",children:g})})})]})},jae=({data:e,clientId:t,pageType:n,isSuccess:s,handleResetFilters:r})=>{const i=l.useCallback(p=>{const g=p?.by_consideration_type?.buckets;if(g?.length)for(const A of g){const E=A?.metadata?.top_docs?.hits?.hits;if(E?.length)for(const x of E){const I=x?.fields?.metadata_cui?.[0];if(I)return I}}},[]),o=l.useCallback(p=>{const g=p?.by_consideration_type?.buckets;if(g?.length)for(const A of g){const E=A?.top_evidence?.hits?.hits;if(E?.length)for(const x of E){const y=x?._source?.subcategory;if(y)return y;
866const v=x?.fields?.["evidence.description"]?.[0];if(v)return v}}},[]),c=l.useCallback(p=>{const g=p?.by_consideration_type?.buckets;return g?.length?g.reduce((A,E)=>E?.key!=="Принято во внимание"?A:A+(E.doc_count??0),0):0},[]),u=l.useCallback(p=>{const g=p?.by_consideration_type?.buckets;return g?.length?g.reduce((A,E)=>E?.key!=="Не принято во внимание"?A:A+(E.doc_count??0),0):0},[]),d=l.useCallback(p=>p.key,[]);return s?e?.length?a.jsx("div",{children:e.map((p,g)=>{const A=d(p);return p.by_type.category_terms.buckets?p.by_type.category_terms.buckets.map(E=>E.type_terms.buckets?E.type_terms.buckets.map(x=>{const y=c(x),I=u(x),v=o(x),S=i(x);return a.jsx(Mae,{clientId:t,typeLabel:E.key,typeTermLabel:x.key,mainText:Vn(v??""),metadataCui:S,pageType:n,notedTotal:y,ignoredTotal:I,purposeText:A??"",subcategory:v??""},`${p.key}-${E.key}-${x.key}-${g}`)}):null):null})}):a.jsx(_2,{handleResetFilters:r}):a.jsx(ct,{isWithWrapper:!0,minHeight:90,delay:0,isNoPadding:!0})},Bae=({aggregationsData:e,clientId:t,isSuccess:n,handleResetFilters:s})=>{const r=Fe(),i=e?.evidence_nested,o=l.useMemo(()=>{const d=[];return d.push({id:"defense",label:h.client.defenseStrategy.evidence.tabs.DEFENSE,state:{isPreventScrollToTop:!0},end:!0,to:`/clients/${t}/defense-strategy/first-instance/evidence`}),d.push({id:"prosecution",label:h.client.defenseStrategy.evidence.tabs.PROSECUTION,state:{isPreventScrollToTop:!0},to:`/clients/${t}/defense-strategy/first-instance/evidence/prosecution`}),d},[t]),c=l.useMemo(()=>r.pathname===`/clients/${t}/defense-strategy/first-instance/evidence`?"defense":r.pathname===`/clients/${t}/defense-strategy/first-instance/evidence/prosecution`?"prosecution":"defense",[r.pathname,t]),u=l.useMemo(()=>{if(c==="defense")return i?.evidence_usage_nested.by_usage_side.buckets.find(d=>d.key==="Сторона защиты")?.by_purpose?.buckets??void 0;if(c==="prosecution")return i?.evidence_usage_nested.by_usage_side.buckets.find(d=>d.key==="Сторона обвинения")?.by_purpose?.buckets??void 0},[c,i]);return a.jsxs("div",{className:"mt-1 space-y-2",children:[a.jsx(T2,{tabs:o},"tabs"),a.jsx(jae,{data:u,clientId:t,pageType:c,isSuccess:n,handleResetFilters:s},c)]})},Fae=({categoryBucket:e,clientId:t,pageType:n})=>{const s=at(),r=Uae(e),i=zae(e),o=Qae(e),c=Hae(e),u=l.useCallback(()=>{s(`/clients/${t}/defense-strategy/first-instance/circumstances${n==="aggravating"?"/aggravating":""}`,{state:{isPreventScrollToTop:!0,isForceDefenseStrategyCircumstancesDetailedAnimateOnStart:!0,circumstances:{type:n==="aggravating"?"Отягчающее":"Смягчающее",category:i},pageType:n,notedTotal:o,ignoredTotal:c}})},[s,t,n,i,o,c]);if(!r||!i)return null;const d=Vae({notedTotal:o,ignoredTotal:c});return a.jsxs("div",{className:"py-8 flex gap-8 border-b border-zinc-200 border-bottom-1 last:border-b-0 hover:bg-zinc-50 cursor-pointer -ml-6 -mr-6 px-6",onClick:u,children:[a.jsxs("div",{className:"flex-1 overflow-hidden text-ellipsis",children:[a.jsx("div",{className:"bp56_25:mb-0 mb-6  roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 whitespace-nowrap overflow-hidden text-ellipsis",children:Vn(i??"")}),a.jsx("div",{className:"flex items-start justify-between bp56_25:hidden",children:a.jsx("div",{className:"w-1/2",children:d})})]}),a.jsx("div",{className:"hidden bp56_25:block w-80",children:a.jsx(Do,{verticalPosition:"top",content:a.jsxs("div",{className:"flex items-center justify-between w-72 max-w-72 bp90:w-80 bp90:max-w-80",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("figure",{className:"size-2 bg-emerald-600 rounded-full"}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:"Учтено"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:"Не учтено"}),a.jsx("figure",{className:"size-2 bg-slate-600 rounded-full"})]})]}),children:a.jsx("div",{className:"relative bp56_25:mb-0 mb-3 group w-full",children:d})})})]})};function Uae(e){const t=e?.by_consideration_type?.buckets;if(t?.length)for(const n of t){const s=n?.metadata?.top_docs?.hits?.hits;if(s?.length)for(const r of s){const i=r?._id;if(i)return i}}}function zae(e){return e?.key?.toString()}function Qae(e){const t=e?.by_consideration_type?.buckets;return t?.length?t.reduce((n,s)=>s?.key!=="Принято во внимание"?n:n+(s.doc_count??0),0):0}function Hae(e){const t=e?.by_consideration_type?.buckets;return t?.length?t.reduce((n,s)=>s?.key!=="Не принято во внимание"?n:n+(s.doc_count??0),0):0}function Vae({notedTotal:e,ignoredTotal:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[12px] leading-[14px] w-[33px] text-zinc-950 uppercase text-right",children:e}),a.jsxs("div",{className:"flex items-center justify-stretch gap-1 w-[228px]",children:[!!e&&a.jsx("div",{className:"h-1.5 bg-emerald-600 min-w-1.5 rounded-full",style:{width:e/(e+t)*100+"%"}}),!!t&&a.jsx("div",{className:"h-1.5 bg-slate-600 min-w-1.5 rounded-full",style:{width:t/(e+t)*100+"%"}})]}),a.jsx("div",{className:"roboto-flex-25-700-1 text-[12px] leading-[14px] w-[33px] text-zinc-950 uppercase text-left",children:t})]})}const Gae=({data:e,clientId:t,pageType:n,isSuccess:s,handleResetFilters:r})=>s?e?.length?a.jsx("div",{children:e.map((i,o)=>a.jsx(Fae,{categoryBucket:i,clientId:t,pageType:n},`${i.key}-${o}`))}):a.jsx(_2,{handleResetFilters:r}):a.jsx(ct,{isWithWrapper:!0,minHeight:90,delay:0,isNoPadding:!0}),qae=({aggregationsData:e,clientId:t,isSuccess:n,handleResetFilters:s})=>{const r=Fe(),i=e?.circumstances_nested,o=l.useMemo(()=>{const d=[];return d.push({id:"mitigating",label:h.client.defenseStrategy.circumstances.tabs.MITIGATING,state:{isPreventScrollToTop:!0},end:!0,to:`/clients/${t}/defense-strategy/first-instance/circumstances`}),d.push({id:"aggravating",label:h.client.defenseStrategy.circumstances.tabs.AGGRAVATING,state:{isPreventScrollToTop:!0},to:`/clients/${t}/defense-strategy/first-instance/circumstances/aggravating`}),d},[t]),c=l.useMemo(()=>r.pathname===`/clients/${t}/defense-strategy/first-instance/circumstances`?"mitigating":r.pathname===`/clients/${t}/defense-strategy/first-instance/circumstances/aggravating`?"aggravating":"mitigating",[r.pathname,t]),u=l.useMemo(()=>
866{if(c==="mitigating")return i?.related_circumstances_nested.by_circumstances_type.buckets.find(d=>d.key==="Смягчающее")?.by_result_category?.buckets??void 0;if(c==="aggravating")return i?.related_circumstances_nested.by_circumstances_type.buckets.find(d=>d.key==="Отягчающее")?.by_result_category?.buckets??void 0},[c,i]);return a.jsxs("div",{className:"mt-1 space-y-2",children:[a.jsx(T2,{tabs:o},"tabs"),a.jsx(Gae,{data:u,clientId:t,isSuccess:n,pageType:c,handleResetFilters:s},c??"none")]})},$7=e=>l.createElement("svg",{width:25,height:25,viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},l.createElement("g",{style:{mixBlendMode:"multiply"}},l.createElement("mask",{id:"mask0_6360_46393",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:25,height:25},l.createElement("rect",{x:.5,y:.190186,width:24,height:24,fill:"url(#pattern0_6360_46393)"})),l.createElement("g",{mask:"url(#mask0_6360_46393)"},l.createElement("rect",{x:.5,y:.190186,width:24,height:24,fill:"#8B37EA"}))),l.createElement("defs",null,l.createElement("pattern",{id:"pattern0_6360_46393",patternContentUnits:"objectBoundingBox",width:1,height:1},l.createElement("use",{xlinkHref:"#image0_6360_46393",transform:"scale(0.000976562)"})),l.createElement("image",{id:"image0_6360_46393",width:1024,height:1024,preserveAspectRatio:"none",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAYAAAB/HSuDAAAAAXNSR0IArs4c6QAAIABJREFUeF7s3Ql4nFd58P2RZp/R7t0xJGkSytuULqSBDyilQOGlUCCEeAt2nMRbHG/ZbUuW98SxE1uSF0yWsvWllNIWSulCS/tB6cLWBXhLKVspNAmBJJY0mtEufdet6s53ODzPPM9onZnzz3Xp0jajmfM7Tx6fc5/73Kcmwn8IIIAAAggggAACCCCAAAIIIFD1AjVV30IaiAACCCCAAAIIIIAAAggggAACEQIAXAQIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4IEABwoJNpIgIIIIAAAggggAACCCCAAAIEALgGEEAAAQQQQAABBBBAAAEEEHBAgACAA51MExFAAAEEEEAAAQQQQAABBBAgAMA1gAACCCCAAAIIIIAAAggggIADAgQAHOhkmogAAggggAACCCCAAAIIIIAAAQCuAQQQQAABBBBAAAEEEEAAAQQcECAA4EAn00QEEEAAAQQQQAABBBBAAAEECABwDSCAAAIIIIAAAggggAACCCDggAABAAc6mSYigAACCCCAAAIIIIAAAgggQACAawABBBBAAAEEEEAAAQQQQAABBwQIADjQyTQRAQQQQAABBBBAAAEEEEAAAQIAXAMIIIAAAggggAACCCCAAAIIOCBAAMCBTqaJCCCAAAIIIIAAAggggAACCBAA4BpAAAEEEEAAAQQQQAABBBBAwAEBAgAOdDJNRAABBBBAAAEEEEAAAQQQQIAAANcAAggggAACCCCAAAIIIIAAAg4I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wb//f397W0AcQ5ACgBqtdr82NjYG/bt2/e1Ih9EUQQKERAAFNIRyiBAgAABAgQIECBA4AcFzp49O3Tx4sXPLy0tvTFm/lMIEDP/z98KcHFkZOTwoUOH/oQfAQKrCwgAfEMIECBAgAABAgQIEChe4NFHH72t0Wi8tdVqva2vr2/X5s2bPz8yMvK50dHRv37Xu97VKv4BFEigAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBbQACQW1j7BAgQIECAAAECBAgQIECgAAEBQAGdoAQCBAgQIECAAAECBAgQIJBb4P8ACEtSvG2r34sAAAAASUVORK5CYII="}))),Uy=({color:e,adjustedPercents:t,index:n})=>{const i=2*Math.PI*46,o=2,c=4/46*(180/Math.PI),u=o+c,d=l.useMemo(()=>t.every(D=>D===0),[t]),p=l.useMemo(()=>t.filter(D=>D>0).length,[t]),g=l.useMemo(()=>p!==1?-1:t.findIndex(D=>D===100),[p,t]),A=l.useMemo(()=>g!==-1&&n===g,[g,n]),E=l.useMemo(()=>d?0:g!==-1?A?100:0:t[n]??0,[t,n,d,g,A]),x=l.useMemo(()=>d?[]:g!==-1?[]:n===0?[]:t.slice(0,n),[t,n,d,g]),y=l.useMemo(()=>x.filter(D=>D>0).length,[x]),I=l.useMemo(()=>x.reduce((D,k)=>{if(k<=0)return D;const L=k/100*360,O=Math.max(0,L-u);return D+O},0),[x,u]),v=l.useMemo(()=>A||E<=0?0:I+y*u,[E,I,y,u,A]),S=l.useMemo(()=>
866{if(A)return 360;if(E<=0)return 0;const D=E/100*360;return Math.max(0,D-u)},[E,u,A]),b=l.useMemo(()=>S===0?0:S/360*i,[S,i]),w=l.useMemo(()=>A?"":`${b} ${i-b}`,[b,i,A]),_=l.useMemo(()=>A?"":`rotate(${v-90} 50 50)`,[v,A]),N=l.useMemo(()=>A?"butt":"round",[A]);return l.useMemo(()=>d?!1:g!==-1?A:E>0,[d,g,A,E])?a.jsx("svg",{className:"absolute inset-0 h-54 w-54",viewBox:"0 0 100 100",children:a.jsx("circle",{cx:"50",cy:"50",r:46,fill:"none",stroke:e,strokeWidth:4,strokeLinecap:N,strokeDasharray:w,transform:_})}):null},lf=e=>l.createElement("svg",{width:24,height:25,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M12 22.5C17.5228 22.5 22 18.0228 22 12.5C22 6.97715 17.5228 2.5 12 2.5C6.47715 2.5 2 6.97715 2 12.5C2 18.0228 6.47715 22.5 12 22.5Z",fill:"currentColor"}),l.createElement("path",{d:"M8 12.5L10.6667 15.5L16 9.5",stroke:"#FAFAFA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Wae=({pleaAdmittedCasesCount:e,pleaPartiallyAdmittedCasesCount:t,pleaNotAdmittedCasesCount:n,pleaAdmittedFeloniesCount:s,pleaPartiallyAdmittedFeloniesCount:r,pleaNotAdmittedFeloniesCount:i,handleChangePleaStatus:o,selectedPleaStatuses:c})=>{const u=l.useMemo(()=>["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"],[]),d=l.useMemo(()=>c?.length?u.reduce((O,P)=>{const B={...O};return B[P]=c.includes(P),B},{}):{"Признал(-а) вину полностью":!0,"Признал(-а) вину частично":!0,"Не признал(-а) вину":!0},[c,u]),p=l.useMemo(()=>u.reduce((P,B)=>d[B]?P+1:P,0)!==1?{"Признал(-а) вину полностью":!1,"Признал(-а) вину частично":!1,"Не признал(-а) вину":!1}:u.reduce((P,B)=>{const F={...P};return F[B]=d[B]===!0,F},{}),[d,u]),g=(d["Признал(-а) вину полностью"]?e:0)+(d["Признал(-а) вину частично"]?t:0)+(d["Не признал(-а) вину"]?n:0),A=(d["Признал(-а) вину полностью"]?s:0)+(d["Признал(-а) вину частично"]?r:0)+(d["Не признал(-а) вину"]?i:0),E=s+r+i,x=l.useCallback(O=>{p[O]||o(O)},[p,o]),y=fn({value:g}),{before:I,after:v}=cZ({count:g}),S=fn({value:A}),b=qt({count:A,zero:h.client.defenseStrategy.filters.circle.FELONIES_ZERO,one:h.client.defenseStrategy.filters.circle.FELONIES_ONE,many:h.client.defenseStrategy.filters.circle.FELONIES_MANY}),w=fn({value:s}),_=fn({value:r}),N=fn({value:i}),R=s===0?0:s/E*100>=1?Math.round(s/E*100):"<1",D=r===0?0:r/E*100>=1?Math.round(r/E*100):"<1",k=i===0?0:i/E*100>=1?Math.round(i/E*100):"<1",L=l.useMemo(()=>{if(E===0)return[0,0,0];const O=[s/E*100,r/E*100,i/E*100],P=2,B=O.map(G=>G>0);if(B.reduce((G,$)=>$?G+1:G,0)===0)return[0,0,0];const z=O.map((G,$)=>B[$]?Math.max(P,G):0),Q=z.reduce((G,$)=>G+$,0),M=(()=>{if(Q<=100){const oe=100-Q;if(oe===0)return z;const ie=O.reduce((ee,te,le)=>B[le]?ee+te:ee,0);return ie===0?z:z.map((ee,te)=>B[te]?ee+O[te]/ie*oe:ee)}const G=O.map((oe,ie)=>B[ie]?P:0),J=100-G.reduce((oe,ie)=>oe+ie,0);if(J<=0)return G;const ne=O.map((oe,ie)=>B[ie]?Math.max(0,oe-P):0),X=ne.reduce((oe,ie)=>oe+ie,0);return X===0?G:G.map((oe,ie)=>B[ie]?oe+ne[ie]/X*J:oe)})(),K=M.map(G=>Math.floor(G)),H=100-K.reduce((G,$)=>G+$,0);if(H===0)return K;const q=M.map((G,$)=>({index:$,remainder:G-K[$]})).slice().sort((G,$)=>$.remainder-G.remainder).slice(0,H).map(G=>G.index);return K.map((G,$)=>q.includes($)?G+1:G)},[E,s,r,i]);return a.jsxs("div",{className:"flex flex-col bp75:flex-row items-center justify-start h-auto bp75:h-54 mb-6 bp75:mb-0",children:[a.jsxs("div",{className:"relative w-54 h-54 p-2 mb-6 bp75:mb-0",children:[a.jsx("div",{className:"absolute inset-0 w-50 h-50 rounded-full border-[0.5px] border-zinc-200 left-2 top-2"}),a.jsx(Uy,{color:d["Признал(-а) вину полностью"]?"#8B37EA":"#E4E4E7",adjustedPercents:L,index:0}),a.jsx(Uy,{color:d["Признал(-а) вину частично"]?"#3CB5EB":"#E4E4E7",adjustedPercents:L,index:1}),a.jsx(Uy,{color:d["Не признал(-а) вину"]?"#FCAC31":"#E4E4E7",adjustedPercents:L,index:2}),a.jsxs("div",{className:"relative flex flex-col items-center justify-start pt-10 w-50 h-50",children:[a.jsx($7,{className:"size-6 mb
866-0.5"}),a.jsx("div",{className:"flex items-center justify-center roboto-flex-25-600-1 text-[48px] leading-[48px] text-zinc-950",children:S}),a.jsxs("div",{className:"flex flex-col items-center justify-center roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500",children:[a.jsx("div",{children:b}),a.jsxs("div",{children:[I," ",a.jsx("span",{className:"text-zinc-950",children:y})," ",v]})]})]})]}),a.jsxs("div",{className:"flex flex-row bp75:flex-col gap-6 bp75:gap-0 ml-0 bp75:ml-8",children:[a.jsxs("div",{className:"hidden bp75:flex items-center gap-1 h-[32px]",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:h.client.defenseStrategy.filters.clearButtons.POSITION}),a.jsx("div",{className:"mt-2",children:a.jsx(Wr,{text:h.client.defenseStrategy.filters.tooltips.POSITION})})]}),a.jsxs("div",{className:Y("flex items-center justify-start",!p["Признал(-а) вину полностью"]&&"cursor-pointer",!!p["Признал(-а) вину полностью"]&&"cursor-default"),onClick:()=>x("Признал(-а) вину полностью"),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!d["Признал(-а) вину полностью"]&&a.jsx(lf,{className:"size-6 text-[#8B37EA]"}),!d["Признал(-а) вину полностью"]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[h.client.defenseStrategy.filters.circle.PLEA_ADMITTED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:w}),a.jsx("span",{className:"text-zinc-400",children:" · "}),R,"%"]})]}),a.jsxs("div",{className:Y("flex items-center justify-start",!p["Признал(-а) вину частично"]&&"cursor-pointer",!!p["Признал(-а) вину частично"]&&"cursor-default"),onClick:()=>x("Признал(-а) вину частично"),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!d["Признал(-а) вину частично"]&&a.jsx(lf,{className:"size-6 text-[#3CB5EB]"}),!d["Признал(-а) вину частично"]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[h.client.defenseStrategy.filters.circle.PLEA_PARTIALLY_ADMITTED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:_}),a.jsx("span",{className:"text-zinc-400",children:" · "}),D,"%"]})]}),a.jsxs("div",{className:Y("flex items-center justify-start",!p["Не признал(-а) вину"]&&"cursor-pointer",!!p["Не признал(-а) вину"]&&"cursor-default"),onClick:()=>x("Не признал(-а) вину"),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!d["Не признал(-а) вину"]&&a.jsx(lf,{className:"size-6 text-[#FCAC31]"}),!d["Не признал(-а) вину"]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[h.client.defenseStrategy.filters.circle.PLEA_NOT_ADMITTED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:N}),a.jsx("span",{className:"text-zinc-400",children:" · "}),k,"%"]})]})]})]})};function Y7({itemKey:e,pleaStatusKey:t}){return`${e}:::${t}`}function Kae({list:e}){if(!e||e.length===0)return{};const t=["Признал(-а) вину полностью","Не признал(-а) вину","Признал(-а) вину частично"],n=e.map(i=>i.pleaStatuses.filter(o=>t.includes(o.key)).map(o=>({id:Y7({itemKey:i.key,pleaStatusKey:o.key}),total:o.total,pleaKey:o.key,itemKey:i.key}))).reduce((i,o)=>[...i,...o],[]),s=i=>{const o=t.indexOf(i);return o===-1?t.length:o};return n.slice().sort((i,o)=>
866{if(i.total===o.total){const c=s(i.pleaKey),u=s(o.pleaKey);return c===u?i.itemKey===o.itemKey?0:i.itemKey<o.itemKey?-1:1:c-u}return i.total-o.total}).reduce((i,o,c)=>{const u={...i};return u[o.id]=c,u},{})}const $ae=({pleaStatuses:e,normalized100Percent:t,punishmentKey:n,ranksMap:s,selectedPleaStatuses:r})=>{const i=["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"],o=l.useMemo(()=>!r||r.length===0||r.length===i.length,[r,i.length]);return a.jsx("div",{className:"flex-1 flex items-center justify-start pr-4 gap-1",children:e.map((c,u)=>{if(!c.sortingTotal||!["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"].includes(c.key))return null;const d=Math.round(c.sortingTotal/t*100),p=Y7({itemKey:n,pleaStatusKey:c.key}),g=s[p]??0,A=o?!0:!!r?.includes(c.key);return a.jsx("div",{style:{width:`${d}%`,minWidth:`calc(16px + ${g*2}px)`,display:A?"flex":"none"},className:"h-8 flex items-center",children:a.jsx("div",{className:Y("flex flex-1 items-center justify-center h-2 rounded-full",!!A&&(c.key==="Признал(-а) вину полностью"?"bg-[#7F22FE]":c.key==="Признал(-а) вину частично"?"bg-[#0EA5E9]":"bg-[#FE9A00]"),!A&&"bg-zinc-200")})},u)})})},Yae=({title:e,from:t,to:n,pleaStatuses:s})=>{const r=l.useMemo(()=>["Штраф"].includes(e)?"rubles":(["Лишение свободы на определенный срок","Обязательные работы","Исправительные работы","Ограничение свободы","Принудительные работы"].includes(e),"days"),[e]),i=l.useMemo(()=>{if(!t||!n)return null;if(r==="rubles"){const d=new Intl.NumberFormat("ru-RU").format(t),p=new Intl.NumberFormat("ru-RU").format(n);return`${d} ₽ — ${p} ₽`}const c=S6({value:t}),u=S6({value:n});return`${c} — ${u}`},[t,n,r]),o=s.reduce((c,u)=>c+u.total,0);return a.jsxs("div",{className:"max-w-[278px] w-[278px]",children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-white mb-1.5",children:[a.jsx("div",{children:e}),!!i&&a.jsx("div",{children:i})]}),a.jsx("div",{children:s.map((c,u)=>a.jsxs("div",{className:"flex items-center justify-start",children:[a.jsx("div",{className:Y("w-2 h-2 rounded-full mr-2",c.key==="Признал(-а) вину полностью"&&"bg-[#8B37EA]",c.key==="Признал(-а) вину частично"&&"bg-[#3CB5EB]",c.key==="Не признал(-а) вину"&&"bg-[#FCAC31]")}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[26px] text-zinc-400",children:[c.key==="Признал(-а) вину полностью"?h.client.defenseStrategy.filters.circle.PLEA_ADMITTED:c.key==="Не признал(-а) вину"?h.client.defenseStrategy.filters.circle.PLEA_NOT_ADMITTED:h.client.defenseStrategy.filters.circle.PLEA_PARTIALLY_ADMITTED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-white",children:c.total}),a.jsx("span",{className:"text-zinc-400",children:" · "}),o?Math.round(c.total/o*100):0,"%"]})]},u))})]})},Xae=({clientId:e,punishmentsList:t,selectedPleaStatuses:n,isPunishmentsFiltersFilled:s,handleResetPunishmentsFilters:r,handleSavePunishments:i})=>{const o=["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"],c=(()=>{const _=n??[];return _.length===0||_.length===o.length?o:_})(),u=t.map(_=>{const N=(_.pleaStatuses??[]).reduce((D,k)=>c.includes(k.key)?D+k.total:D,0),R=(_.pleaStatuses??[]).reduce((D,k)=>o.includes(k.key)?D+k.total:D,0);return{..._,total:N,sortingTotal:R}}).sort((_,N)=>{const R=_.total??_.total,D=N.total??N.total;return R===D?0:R>D?-1:1}),d=u.reduce((_,N)=>_+N.total,0),p=u.reduce((_,N)=>_<N.total?N.total:_,0),g=l.useMemo(()=>Kae({list:u}),[u]),A={"Признал(-а) вину полностью":0,"Признал(-а) вину частично":1,"Не признал(-а) вину":2},E=Ie(_=>_.selectedPunishmentTypesByClientIdByKey[e]?.["first-instance"]),x=Ie(_=>_.setSelectedPunishmentTypes),y=Ve(_=>_.setSelectedPunishments),I=l.useCallback(_=>{const N=E??[],D=N.includes(_)?N.filter(L=>L!==_):[...N,_],k=D.length?D:null;x({clientId:e,key:"first-instance",selectedPunishmentTypes:k}),y({clientId:e,key:"first-instance",selectedPunishments:k}),i(k)},[e,E,x,y,i]),v=l.useCallback(({itemTotal:_})=>
866{if(!d||!_)return 0;const N=Math.round(_/d*100);return N>100?100:N},[d]),S=l.useMemo(()=>{if(!u.length)return{totalLength:1,percentageLength:2};const N=u[0]?.total??0,R=fn({value:N})||"0",D=N?v({itemTotal:N}):0,k=R.length,L=String(D).length+1;return{totalLength:k,percentageLength:L}},[v,u]),{totalLength:b,percentageLength:w}=S;return a.jsxs("div",{className:"w-full bp75:w-auto relative flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"h-8 pl-3 flex items-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:h.client.defenseStrategy.filters.clearButtons.SELECT_HINT}),a.jsx("div",{className:"mt-1.5",children:a.jsx(Wr,{text:h.client.defenseStrategy.filters.tooltips.SELECT_HINT})})]}),a.jsx($h,{onClick:r,isFilled:s,label:h.client.defenseStrategy.filters.clearButtons.RESET})]}),u.map(_=>{const R=(()=>{const k=["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"],L=(_.pleaStatuses||[]).reduce((P,B)=>{const F={...P};return F[B.key]=B.total,F},{}),O=(_.pleaStatuses||[]).reduce((P,B)=>{const F={...P};return F[B.key]=B.total,F},{});return k.map(P=>({key:P,total:L[P]??0,sortingTotal:O[P]??0}))})().sort((k,L)=>{const O=Object.keys(A).length;return(A[k.key]??O)-(A[L.key]??O)}),D=(E??[]).includes(_.key);return a.jsx("div",{className:Y("pb-0.5 pt-0.5 last:pb-0 first:pt-0 group cursor-pointer"),onClick:()=>I(_.key),children:a.jsxs("div",{className:Y("h-8 flex items-center justify-between bg-zinc-50 rounded-full group-hover:bg-zinc-100 border-2",!!D&&"border-zinc-950 rounded-full",!D&&"border-zinc-50 group-hover:border-zinc-100"),children:[a.jsx("div",{className:"pl-3 pr-3 w-73.5 overflow-hidden text-ellipsis whitespace-nowrap roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:Vn(_.key)}),a.jsx("div",{className:"flex items-center",children:a.jsx(Do,{verticalPosition:"top",isClickBlocked:!0,content:a.jsx(Yae,{title:Vn(_.key),from:_.from,to:_.to,pleaStatuses:R}),children:a.jsx("div",{className:"h-8 flex items-center justify-center px-1",children:a.jsx(p2,{className:"size-5 text-sky-400 hover:text-sky-500"})})})}),a.jsxs("div",{className:"pl-3.5 pr-5.25 whitespace-nowrap",children:[a.jsx("span",{className:Y("roboto-flex-100-600-1 inline-block text-right tabular-nums",b===1&&"min-w-[9px]",b===2&&"min-w-[17.8px]",b===3&&"min-w-[26.6px]",b===4&&"min-w-[30.4px]",b===5&&"min-w-[39.2px]",b===6&&"min-w-[48px]",b===7&&"min-w-[56.8px]",b===8&&"min-w-[62.6px]",b>8&&"min-w-[71.4px]"),children:fn({value:_.total})}),a.jsx("span",{className:"inline-block text-center text-zinc-400",children:" · "}),a.jsxs("span",{className:Y("inline-block text-left text-zinc-500 tabular-nums",w===2&&"min-w-[22px]",w===3&&"min-w-[30.8px]",w===4&&"min-w-[39.6px]",w>4&&"min-w-[48.4px]"),children:[v({itemTotal:_.total}),"%"]})]}),a.jsx($ae,{pleaStatuses:R,normalized100Percent:p,punishmentKey:_.key,ranksMap:g,selectedPleaStatuses:n??null})]})},_.key)})]})},Jae=({clientId:e,isDefenseRequestsResultsFiltersFilled:t,handleResetDefenseRequestsResultsFilters:n,handleChangeResults:s})=>{const[r,i]=l.useState(!1),c=Ie(v=>v.aggregationsDataByClientIdByKey[e]?.["first-instance"])?.defense_requests_results_nested?.defense_result?.buckets??[],u=Ie(v=>v.selectedDefenseRequestsResultsByClientIdByKey[e]?.["first-instance"]??null),d=Ie(v=>v.setSelectedDefenseRequestsResults),p=l.useRef(null),g=l.useRef([]),A=l.useRef(new Set),[E,x]=l.useState(null),y=l.useCallback(v=>{const S=u??[],w=S.includes(v)?S.filter(N=>N!==v):[...S,v],_=w.length?w:null;d({clientId:e,key:"first-instance",selectedDefenseRequestsResults:_}),s(_)},[e,u,d,s]),I=l.useCallback(()=>{i(v=>!v)},[]);return l.useEffect(()=>{const v=p.current;if(!v)return;const S=new IntersectionObserver(b=>{for(const w of b){const _=w.target.getAttribute("data-index"),N=_?Number(_):NaN;Number.isNaN(N)||(w.isIntersecting&&A.current.add(N),w.isIntersecting||A.current.delete(N))}A.current.size&&x(Math.max(...A.current)),A.current.size||x(null)},{root:v,threshold:1});for(const b of g.current)b&&S.observe(b);return()=>S.disconnect()},[c.length]),a.jsxs("div",{className:"mt-7",children:[a.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex items-center pl-3 roboto-flex-100-400-1 text-[16px] leading-[20px] h-8 whitespace-nowrap text-zinc-400 justify-center",children:h.client.defenseStrategy.filters.results.TITLE}),a.jsx("div",{className:"mt-1.5",children:a.jsx(Wr,{text:h.client.defenseStrategy.filters.tooltips.RESULTS_TITLE})})]}),a.jsx($h,{onClick:n,isFilled:t,label:h.client.defenseStrategy.filters.clearButtons.RESET})]}),!!c.length&&a.jsx("div",{ref:p,className:Y("flex flex-wrap gap-1 pr-9",!r&&"max-h-17 overflow-hidden"),children:c.map((v,S)=>{const b=String(v.key??""),w=typeof v.doc_count=="number"?v.doc_count:0;
866if(!b)return null;const _=!!(u??[]).includes(b),N=S===E;return a.jsxs("div",{className:"relative",children:[a.jsxs("div",{ref:R=>{g.current[S]=R},"data-index":S,className:Y("flex items-center px-3 roboto-flex-100-400-1 text-[16px] leading-[20px] h-8 whitespace-nowrap justify-center rounded-full border-2 cursor-pointer",!_&&Y(!!w&&"text-zinc-950 bg-zinc-50 hover:bg-zinc-100 border-zinc-50",!w&&"text-zinc-400 bg-zinc-50 border-zinc-50 pointer-events-none"),!!_&&Y(!!w&&"text-zinc-950 bg-zinc-50 hover:bg-zinc-100 border-zinc-950",!w&&"text-zinc-400 bg-white border-zinc-100 pointer-events-none")),onClick:()=>y(b),children:[b,a.jsx("span",{className:"text-zinc-400",children:" · "}),a.jsx("span",{className:Y(!!w&&"text-zinc-500",!w&&"text-zinc-400"),children:w})]}),!!N&&a.jsx("div",{className:"absolute top-0 left-full translate-x-1.5 flex items-center justify-center h-full w-11 bg-zinc-50 cursor-pointer hover:bg-zinc-100 rounded-full",onClick:I,children:a.jsx(al,{className:Y("size-5 text-zinc-500",r&&"rotate-180")})})]},b)})})]})},Sn="first-instance",Zae=({clientData:e,mainWrapperRef:t,fabulaStatus:n,handleResetAllFilters:s,handleResetPunishmentsFilters:r,handleResetDefenseRequestsResultsFilters:i})=>{const o=vs(),c=Ie(Ee=>Ee.aggregationsDataByClientIdByKey[e.id]?.[Sn]),u=Ie(Ee=>Ee.selectedRegionIdsByClientIdByKey[e.id]?.[Sn]),d=Ie(Ee=>Ee.selectedConclusionArticlesByClientIdByKey[e.id]?.[Sn]),p=Ie(Ee=>Ee.selectedEpisodesByClientIdByKey[e.id]?.[Sn]),g=Ie(Ee=>Ee.setSelectedEpisodes),A=Ie(Ee=>Ee.setSelectedRegionIds),E=Ie(Ee=>Ee.setSelectedConclusionArticles),x=Ve(Ee=>Ee.setSelectedConclusionArticles),y=Ve(Ee=>Ee.setSelectedEpisodes),I=Ve(Ee=>Ee.setSelectedRegionIds),v=Ve(Ee=>Ee.setSelectedGenders),S=Ve(Ee=>Ee.setSelectedCriminalStatuses),b=Ve(Ee=>Ee.setSelectedPleaStatuses),w=Ie(Ee=>Ee.selectedGendersByClientIdByKey[e.id]?.[Sn]),_=Ie(Ee=>Ee.selectedCriminalStatusesByClientIdByKey[e.id]?.[Sn]),N=Ie(Ee=>Ee.setSelectedGenders),R=Ie(Ee=>Ee.setSelectedCriminalStatuses),D=Ie(Ee=>Ee.resetKey),{saveFilters:k}=mc(e.id,Sn),L=kn(Ee=>Ee.catalogues?.articles),O=l.useMemo(()=>gc({episodes:e.episodes,articles:L}),[e.episodes,L]),P=l.useMemo(()=>new Set(O.map(Ee=>Ee.value)),[O]),B=l.useMemo(()=>{if(!p?.length)return null;const Ee=[];for(const se of p)P.has(se)&&Ee.push(se);return Ee.length?Ee:null},[p,P]);l.useEffect(()=>{if(p?.length&&B?.length!==p.length){if(r(),i(),!B?.length){g({clientId:e.id,key:Sn,selectedEpisodes:null}),y({clientId:e.id,key:Sn,selectedEpisodes:null}),k({episodes:hr(null)});return}g({clientId:e.id,key:Sn,selectedEpisodes:B}),y({clientId:e.id,key:Sn,selectedEpisodes:B}),k({episodes:hr(B)})}},[p,B,r,i,e.id,g,y,k]);const F=Ie(Ee=>Ee.selectedPunishmentTypesByClientIdByKey[e.id]?.[Sn]??null),z=Ie(Ee=>Ee.selectedDefenseRequestsResultsByClientIdByKey[e.id]?.[Sn]??null),Q=Ie(Ee=>Ee.selectedPleaStatusesByClientIdByKey[e.id]?.[Sn]??null),M=Ie(Ee=>Ee.setSelectedPleaStatuses),K=l.useCallback(Ee=>
866{if(r(),i(),!Ee?.length){g({clientId:e.id,key:Sn,selectedEpisodes:null}),y({clientId:e.id,key:Sn,selectedEpisodes:null}),k({episodes:hr(null)}),ln({ref:t});return}g({clientId:e.id,key:Sn,selectedEpisodes:Ee}),y({clientId:e.id,key:Sn,selectedEpisodes:Ee}),k({episodes:hr(Ee)}),ln({ref:t})},[e.id,g,y,r,i,t,k]),W=l.useMemo(()=>{const Ee=(se,me)=>({label:et({part:se.part,number:se.article??""}),value:JSON.stringify({article:se.article??"",part:se.part??""}),zone:me});return[...(c?.cluster_article_nested??[]).map(se=>Ee(se,"primary")),...(c?.conclusions_article_nested??[]).map(se=>Ee(se,"secondary"))]},[c?.cluster_article_nested,c?.conclusions_article_nested]),H=l.useCallback(Ee=>{r(),i();const se=Ee&&Ee.length?Ee:null;E({clientId:e.id,key:Sn,selectedConclusionArticles:se}),x({clientId:e.id,key:Sn,selectedConclusionArticles:se}),k({articles:rE(se)}),ln({ref:t})},[e.id,E,x,r,i,t,k]),j=c?.global_regions?.regions?.buckets,q=l.useMemo(()=>{const Ee=c?.global_genders?.genders_nested?.genders?.buckets??[];if(!Ee.length)return[];const se=h.enums.genders;return Ee.filter(me=>me.key!=null&&me.key!=="").map(me=>{const de=String(me.key);return{label:On(se,de,Vn(de)),value:de}})},[c]),G=l.useMemo(()=>{const Ee=c?.global_criminal_statuses?.criminal_statuses_nested?.criminal_statuses?.buckets??[];if(!Ee.length)return[];const se=h.enums.criminalStatuses;return Ee.filter(me=>me.key!=null&&me.key!=="").map(me=>{const de=String(me.key);return{label:On(se,de,Vn(de)),value:de}})},[c]),$=l.useMemo(()=>{if(!j)return[];const Ee=j.reduce((se,me)=>{const de=me.key;if(de==null)return se;const ge=String(de),Pe=o[Number(de)]?.name??ge;return se.push({label:Pe,value:ge}),se},[]);return iE(Ee)},[j,o]),J=l.useCallback(Ee=>{r(),i();const se=Ee&&Ee.length?Ee:null;A({clientId:e.id,key:Sn,selectedRegionIds:se}),I({clientId:e.id,key:Sn,selectedRegionIds:se}),k({regions:se?se.map(Number):null}),ln({ref:t})},[e.id,A,I,r,i,t,k]),ne=l.useCallback(Ee=>{r(),i();const se=Ee&&Ee.length?Ee:null;N({clientId:e.id,key:Sn,selectedGenders:se}),v({clientId:e.id,key:Sn,selectedGenders:se}),k({genders:se}),ln({ref:t})},[e.id,N,v,r,i,t,k]),X=l.useCallback(Ee=>{r(),i();const se=Ee&&Ee.length?Ee:null;R({clientId:e.id,key:Sn,selectedCriminalStatuses:se}),S({clientId:e.id,key:Sn,selectedCriminalStatuses:se}),k({criminalStatuses:se}),ln({ref:t})},[e.id,R,S,r,i,t,k]),oe=c?.plea_nested?.verdicts_plea_nested?.filtered?.plea_statuses?.buckets?.find(Ee=>Ee.key==="Признал(-а) вину полностью")?.root_docs?.case_count?.value??0,ie=c?.plea_nested?.verdicts_plea_nested?.filtered?.plea_statuses?.buckets?.find(Ee=>Ee.key==="Признал(-а) вину частично")?.root_docs?.case_count?.value??0,ee=c?.plea_nested?.verdicts_plea_nested?.filtered?.plea_statuses?.buckets?.find(Ee=>Ee.key==="Не признал(-а) вину")?.root_docs?.case_count?.value??0,le=(c?.conclusions_nested?.verdicts_nested?.filtered?.punishment_type?.buckets??[]).map(Ee=>({type:"punishment",key:String(Ee.key??""),total:Ee.doc_count??0,from:void 0,to:void 0,pleaStatuses:(Ee.by_plea_status?.buckets??[]).map(se=>({key:String(se.key??""),total:se.doc_count??0}))})),he=le.reduce((Ee,se)=>{const me=(se.pleaStatuses??[]).find(ge=>ge.key==="Признал(-а) вину полностью"),de=me?me.total:0;return Ee+de},0),fe=le.reduce((Ee,se)=>{const me=(se.pleaStatuses??[]).find(ge=>ge.key==="Признал(-а) вину частично"),de=me?me.total:0;return Ee+de},0),ue=le.reduce((Ee,se)=>{const me=(se.pleaStatuses??[]).find(ge=>ge.key==="Не признал(-а) вину"),de=me?me.total:0;return Ee+de},0),ye=l.useCallback(Ee=>{const se=["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"];if(!se.includes(Ee))return;const me=Q??null,de=!me||me.length===0?se.filter(Ue=>Ue!==Ee):me.includes(Ee)?me.filter(Ue=>Ue!==Ee):[...me,Ee],ge=de.length===0||de.length===3?null:de;M({clientId:e.id,key:Sn,selectedPleaStatuses:ge}),b({clientId:e.id,key:Sn,selectedPleaStatuses:ge}),k({pleaStatuses:ge})},[e.id,Q,M,b,k]),ce=l.useMemo(()=>!!(B?.length||d?.length||u?.length||w?.length||_?.length),[B,d,u,w,_]),xe=l.useMemo(()=>!!Q?.length,[Q]),re=l.useMemo(()=>!!F?.length,[F]),pe=l.useMemo(()=>!!z?.length,[z]),_e=l.useCallback(Ee=>{k({punishments:Ee})},[k]),Le=l.useCallback(Ee=>{k({defenseRequestsResults:Ee})},[k]);return["no_fabula","no_embeddings"].includes(n)||!c?null:a.jsxs("div",{className:Y("pb-3","bg-white","flex","flex-col","justify-between","space-x-1","px-4"),children:[a.jsxs("div",{className:"mb-6.5",children:[a.jsxs("div",{className:"flex justify-between items-center w-full",children:[a.jsx("div",{className:"flex gap-2.5 w-full",children:a.jsxs("div",{className:"flex flex-wrap bp75:flex-nowrap bp75:items-start bp75:justify-start gap-x-4 bp75:gap-x-6 gap-y-1 bp75:gap-4 w-full",children:[a.jsxs("div",{className:"shrink-0 bp75:w-fit w-full flex justify-between items-center bp75:mb-0 mb-2.5",children:[a.jsx(vm,{isClearable:!1,value:"first-instance",options:[{label:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,value:"first-instance",to:`/clients/${e.id}/defense-strategy/first-instance`},{label:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,value:"second-instance",to:`/clients/${e.id}/defense-strategy/second-instance`}]}),a.jsx("div",{className:"items-center bp75:hidden flex",children:a.jsx(Wr,{text:h.client.defenseStrategy.aggregations.tooltips.TITLE})})]}),a.jsx("div",{className:"hidden bp75:block self-center w-0 h-4 border-r border-zinc-200 shrink-0"}),a.jsxs("div",{className:"flex flex-wrap bp75:flex-nowrap bp75:items-start bp75:justify-start gap-x-4 gap-y-1 bp75:gap-4",children:[a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.events.PLACEHOLDER,values:B,options:O,isCloseOnScroll:!0,onChange:K,resetKey:D}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.articles.PLACEHOLDER,values:d,options:W,isCloseOnScroll:!0,onChange:H,resetKey:D}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.regions.PLACEHOLDER,values:u,options:$,isCloseOnScroll:!0,onChange:J,resetKey:D}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.genders.PLACEHOLDER,values:w,options:q,isCloseOnScroll:!0,onChange:ne,resetKey:D}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.criminalStatuses.PLACEHOLDER,values:_,options:G,isCloseOnScroll:!0,onChange:X,resetKey:D})]}),a.jsx("div",{className:"items-center bp75:flex hidden -ml-1.5",children:a.jsx(Wr,{text:h.client.defenseStrategy.aggregations.tooltips.TITLE})})]})}),a.jsx("div",{className:"bp75:block hidden",children:a.jsx($h,{onClick:s,isFilled:ce||xe||re||pe,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]}),a.jsx("div",{className:"bp75:hidden mt-3 w-full flex justify-end",children:a.jsx($h,{onClick:s,isFilled:ce||xe||re||pe,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]}),a.jsxs("div",{className:"flex flex-col bp75:flex-row items-center justify-between gap-0 bp75:gap-21 mb-6 bp75:mb-0",children:[a.jsx(Wae,{pleaAdmittedCasesCount:oe,pleaPartiallyAdmittedCasesCount:ie,pleaNotAdmittedCasesCount:ee,pleaAdmittedFeloniesCount:he,pleaPartiallyAdmittedFeloniesCount:fe,pleaNotAdmittedFeloniesCount:ue,handleChangePleaStatus:ye,selectedPleaStatuses:Q}),a.jsx(Xae,{clientId:e.id,punishmentsList:le,selectedPleaStatuses:Q,isPunishmentsFiltersFilled:re,handleResetPunishmentsFilters:r,handleSavePunishments:_e})]}),a.jsx(Jae,{clientId:e.id,isDefenseRequestsResultsFiltersFilled:pe,handleResetDefenseRequestsResultsFilters:i,handleChangeResults:Le})]})},Ns="first-instance",eh=()=>{const e=l.useRef(null),t=l.useRef(!1),n=zt(),s=n?.clientData,r=n?.mainWrapperRef,o=Fe().pathname,c=Ct({path:`/clients/${s.id}/defense-strategy/first-instance`,end:!0}),u=Ct({path:`/clients/${s.id}/defense-strategy/first-instance/evidence`,end:!1}),d=Ct({path:`/clients/${s.id}/defense-strategy/first-instance/circumstances`,end:!1}),p=Ie(X=>X.setAggregationsData),g=Ie(X=>X.setEpisodesData),A=Ie(X=>X.setTotalResults),E=Ie(X=>X.setSelectedPunishmentTypes),x=Ie(X=>X.setSelectedDefenseRequestsResults),y=Ie(X=>X.setSelectedEpisodes),I=Ie(X=>X.setSelectedRegionIds),v=Ie(X=>X.setSelectedConclusionArticles),S=Ie(X=>X.setSelectedPleaStatuses),b=Ve(X=>X.setSelectedPleaStatuses),w=Ie(X=>X.setSelectedGenders),_=Ie(X=>X.setSelectedCriminalStatuses),N=Ie(X=>X.setResetKey),R=Ve(X=>X.setSelectedEpisodes),D=Ve(X=>X.setSelectedConclusionArticles),k=Ve(X=>X.setSelectedRegionIds),L=Ve(X=>X.setSelectedGenders),O=Ve(X=>X.setSelectedCriminalStatuses),P=Ve(X=>X.setSelectedPunishments),{saveFilters:B}=mc(s?.id??"",Ns),F=sn(X=>Object.prototype.hasOwnProperty.call(X.filtersByClientIdByInstance[s?.id??""]??{}
866,"first-instance")),{aggregationsData:z,episodesData:Q,paginationData:M,isSuccess:K,isFetching:W,fabulaStatus:H}=kae({clientData:s,aggregations:!1,endOfListRef:e});l.useEffect(()=>{K&&(t.current||(t.current=!0))},[K]),l.useEffect(()=>{s?.id&&K&&(p({clientId:s.id,key:Ns,data:z}),g({clientId:s.id,key:Ns,data:Q}),A({clientId:s.id,key:Ns,totalResults:M.totalResults}))},[s.id,z,Q,K,M.totalResults,M.searchAfter,p,g,A]);const j=l.useCallback(()=>{E({clientId:s.id,key:Ns,selectedPunishmentTypes:null}),P({clientId:s.id,key:Ns,selectedPunishments:null})},[s.id,E,P]),q=l.useCallback(()=>{x({clientId:s.id,key:Ns,selectedDefenseRequestsResults:null})},[s.id,x]),G=l.useCallback(()=>{y({clientId:s.id,key:Ns,selectedEpisodes:null}),v({clientId:s.id,key:Ns,selectedConclusionArticles:null}),I({clientId:s.id,key:Ns,selectedRegionIds:null}),S({clientId:s.id,key:Ns,selectedPleaStatuses:null}),w({clientId:s.id,key:Ns,selectedGenders:null}),_({clientId:s.id,key:Ns,selectedCriminalStatuses:null}),b({clientId:s.id,key:Ns,selectedPleaStatuses:null}),R({clientId:s.id,key:Ns,selectedEpisodes:null}),D({clientId:s.id,key:Ns,selectedConclusionArticles:null}),k({clientId:s.id,key:Ns,selectedRegionIds:null}),L({clientId:s.id,key:Ns,selectedGenders:null}),O({clientId:s.id,key:Ns,selectedCriminalStatuses:null}),B({episodes:null,articles:null,regions:null,genders:null,criminalStatuses:null,pleaStatuses:null,punishments:null,defenseRequestsResults:null}),j(),q(),N(X=>X+1)},[y,s.id,v,I,S,w,_,b,R,D,k,L,O,B,j,q,N]),$=l.useMemo(()=>o===`/clients/${s.id}/defense-strategy/first-instance`?"defense-request":o===`/clients/${s.id}/defense-strategy/first-instance/evidence`||o===`/clients/${s.id}/defense-strategy/first-instance/evidence/prosecution`?"evidence":o===`/clients/${s.id}/defense-strategy/first-instance/circumstances`||o===`/clients/${s.id}/defense-strategy/first-instance/circumstances/aggravating`?"circumstances":null,[o,s.id]),J=l.useMemo(()=>a.jsxs("div",{className:"px-4 flex items-center gap-4 pb-2 mt-6 bp48:mt-4 pt-0 bp48:pt-2 sticky top-[3.5rem] z-12 bg-white",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Je,{to:`/clients/${s.id}/defense-strategy/first-instance`,state:{isPreventScrollToTop:!0},end:!0,className:({isActive:X})=>Y("roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase cursor-pointer whitespace-nowrap",!!X&&"text-zinc-950",!X&&"text-zinc-400 hover:text-zinc-500"),children:h.client.defenseStrategy.menu.titles.DEFENSE_REQUESTS}),a.jsx("div",{className:"w-6 flex items-center",children:!!c&&a.jsx(Wr,{isBelow:!0,text:h.client.defenseStrategy.menu.tooltips.DEFENSE_REQUESTS})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Je,{to:`/clients/${s.id}/defense-strategy/first-instance/evidence`,state:{isPreventScrollToTop:!0},className:({isActive:X})=>Y("roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase cursor-pointer whitespace-nowrap",!!X&&"text-zinc-950",!X&&"text-zinc-400 hover:text-zinc-500"),children:h.client.defenseStrategy.menu.titles.EVIDENCE}),a.jsx("div",{className:"w-6 flex items-center -translate-y-0.25",children:!!u&&a.jsx(Wr,{isBelow:!0,text:h.client.defenseStrategy.menu.tooltips.EVIDENCE})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Je,{to:`/clients/${s.id}/defense-strategy/first-instance/circumstances`,state:{isPreventScrollToTop:!0},className:({isActive:X})=>Y("roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase cursor-pointer whitespace-nowrap",!!X&&"text-zinc-950",!X&&"text-zinc-400 hover:text-zinc-500"),children:h.client.defenseStrategy.menu.titles.CIRCUMSTANCES}),a.jsx("div",{className:"w-6 flex items-center -translate-y-0.25",children:!!d&&a.jsx(Wr,{isBelow:!0,text:h.client.defenseStrategy.menu.tooltips.CIRCUMSTANCES})})]})]}),[s.id,c,u,d]),ne=l.useMemo(()=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"px-4",children:[$==="defense-request"&&a.jsx(Lae,{aggregationsData:z,clientId:s.id,isSuccess:K,handleResetFilters:G}),$==="evidence"&&a.jsx(Bae,{aggregationsData:z,clientId:s.id,isSuccess:K,handleResetFilters:G}),$==="circumstances"&&a.jsx(qae,{aggregationsData:z,clientId:s.id,isSuccess:K,handleResetFilters:G})]})}),[G,z,s.id,$,K]);return!F||!t.current&&!K?a.jsx(ct,{isWithWrapper:!0}):H==="no_fabula"||H==="no_embeddings"?a.jsx(Dae,{clientData:s,fabulaStatus:H,isFetching:W}):a.jsxs(a.Fragment,{children:[a.jsx(Zae,{clientData:s,fabulaStatus:H,mainWrapperRef:r,handleResetAllFilters:G,handleResetPunishmentsFilters:j,handleResetDefenseRequestsResultsFilters:q}),J,ne]})},ele=({clientId:e,aggregations:t=!1})=>{const n=Fe(),s=Ie(z=>z.selectedRegionIdsByClientIdByKey[e]?.["first-instance"]),r=Ie(z=>z.selectedPleaStatusesByClientIdByKey[e]?.["first-instance"]),i=Ie(z=>z.selectedConclusionArticlesByClientIdByKey[e]?.["first-instance"]),o=Ie(z=>
866z.selectedEpisodesByClientIdByKey[e]?.["first-instance"]),c=Ie(z=>z.selectedPunishmentTypesByClientIdByKey[e]?.["first-instance"]),u=Ie(z=>z.selectedGendersByClientIdByKey[e]?.["first-instance"]),d=Ie(z=>z.selectedCriminalStatusesByClientIdByKey[e]?.["first-instance"]),p=n.state?.defenseRequestsGoal??null,g=sn(z=>Object.prototype.hasOwnProperty.call(z.filtersByClientIdByInstance[e]??{},"first-instance")),A=(()=>{if(!(!i||!i.length))return i.map(z=>{try{const Q=JSON.parse(z);return{number:Q.article??void 0,part:Q.part??void 0}}catch{return}}).filter(Boolean)})(),E=s?.length?s.map(z=>parseInt(z,10)).filter(z=>!Number.isNaN(z)):void 0,x=r??void 0,y=x?x.join(","):void 0,I=x,v=i?i.map(z=>{try{const Q=JSON.parse(z);return`${Q.codeType??""}:${Q.article??""}:${Q.part??""}:${Q.clause??""}`}catch{return z}}).filter(Boolean).join(","):void 0,S=c&&c.length?c:void 0,b=S?S.join(","):void 0,w=o?.join(","),_=u&&u.length?u.join(","):void 0,N=d&&d.length?d.join(","):void 0,R=Qu({selectedEpisodeIds:o}),D=fa({queryKey:["defense-request","first-instance",e,E,y,v,b,w,p?.goal??null,p?.articles?.map(z=>`${z.number??""}:${z.part??""}:${z.codexType??""}:${z.clause??""}`).join(",")??null,p?.argumentResults?.join(",")??null,_,N],queryFn:z=>yf(e,{aggregations:t,articles:A??void 0,episodes:R,genders:u&&u.length?u:void 0,criminalStatuses:d&&d.length?d:void 0,searchAfter:z.pageParam?{searchAfterScore:z.pageParam[0],searchAfterId:z.pageParam[1]}:void 0,punishments:S??void 0,pleaStatuses:I??void 0,regions:E??void 0,defenseRequestsGoal:p??void 0}),enabled:!!e&&!!p?.goal&&g,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:z=>z?.nextSearchAfter??void 0}),k=D.data?.pages,L=k?.[0]?.episodes??null,O=k?.[0]?.aggregations,P={totalResults:k?.[0]?.totalResults??0,searchAfter:k&&k.length?k[k.length-1]?.nextSearchAfter:void 0},B=k?.flatMap(z=>z?.results??[])??[],F=B.flatMap(z=>{const Q=z?._source?.defense_requests??[];return!Array.isArray(Q)||!Q.length?[]:Q.filter(M=>!!M).map(M=>({id:z?._id??null,cui:z?._source?.metadata_cui??null,defenseRequest:M}))});return{...D,episodesData:L,aggregationsData:O,paginationData:P,strategies:B,strategiesFormatted:F,fetchNextPage:D.fetchNextPage,isFetchingNextPage:D.isFetchingNextPage}},X7=e=>l.createElement("svg",{width:21,height:22,viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_8809_55040)"},l.createElement("path",{d:"M4.375 10.6362L8.75 15.0112L17.5 6.26117",stroke:"#22C55E",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_8809_55040"},l.createElement("rect",{width:21,height:21,fill:"white",transform:"translate(0 0.136169)"})))),J7=e=>l.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_8809_55044)"},l.createElement("path",{d:"M10 5.13617V10.9695",stroke:"#F59E0B",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("rect",{x:9.46094,y:13.9695,width:1.08333,height:1.08333,rx:.541667,fill:"#F59E0B",stroke:"#F59E0B"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_8809_55044"},l.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0 0.136169)"})))),Z7=e=>l.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_8809_55049)"},l.createElement("path",{d:"M14.1641 5.97002L5.83179 14.3023",stroke:"#EF4444",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.83594 5.97002L14.1682 14.3023",stroke:"#EF4444",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_8809_55049"},l.createElement("rect",{width:20,height:20,fill:"white",transform:"translate(0 0.136169)"})))),tle=({clientId:e})=>{const t=Fe(),n=at(),s=t.state??{},r=l.useRef(null),{isLoading:i,strategiesFormatted:o,aggregationsData:c,paginationData:u,fetchNextPage:d,strategies:p}=ele({clientId:e,aggregations:!0}),g=sn(_=>Object.prototype.hasOwnProperty.call(_.filtersByClientIdByInstance[e]??{},"first-instance")),A=Ie(_=>_.setDefenseRequestAggregationsData);l.useEffect(()=>{c&&A({clientId:e,key:"first-instance",data:c})},[e,c,A]);const E=l.useCallback(_=>_==="Учтено судом, принято во внимание"?a.jsx(X7,{}):_==="Учтено судом, не принято во внимание"?a.jsx(J7,{}):_==="Не учтено судом"?a.jsx(Z7,{}):null,[]),x=l.useCallback(_=>_==="Учтено судом, принято во внимание"?h.client.defenseStrategy.defenseRequestDataBlock.ARG_RESULT_CONSIDERED:_==="Учтено судом, не принято во внимание"?h.client.defenseStrategy.defenseRequestDataBlock.ARG_RESULT_IGNORED:_==="Не учтено судом"?h.client.defenseStrategy.defenseRequestDataBlock.ARG_RESULT_NOT_CONSIDERED:h.client.defenseStrategy.defenseRequestDataBlock.ARG_RESULT_UNKNOWN,[]),y=l.useMemo(()=>{const _=u?.searchAfter;return!_||_.length!==2||!_[0]||!_[1]},[u?.searchAfter]),I=l.useCallback((_,N)=>Jv({strategies:p,itemId:_,felonyId:N}),[p]),v=l.useMemo(()=>{const _=new Map;return p.forEach(N=>{const R=N?._id??null;if(!R)return;const L=((N?._source??null)?.case_narrative?.events??[]).flatMap(P=>P?.felonies??[]),O=new Map;
866L.forEach(P=>{const B=P?.felony_id??null,F=P?.objects?.primary_object?.related_law?.law;if(!B||!F?.article)return;const z=et({clause:F.clause,part:F.part,number:F.article});z&&O.set(B,z)}),_.set(R,O)}),_},[p]),S=l.useCallback(({caseId:_})=>{if(!_)return[];const N=v.get(_);if(!N)return[];const R=[],D=new Set;return N.forEach(k=>{D.has(k)||(D.add(k),R.push(k))}),R},[v]),b=l.useCallback(_=>{if(!_.length)return{mainArticle:"",additionalCount:0};const N=_[0]??"",R=_.length,D=Math.max(R-1,0);return D?{mainArticle:N,additionalCount:D}:{mainArticle:N,additionalCount:0}},[]),w=l.useCallback(({caseId:_})=>{if(!_){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE});return}n(`/clients/${e}/cases/first-instance/${_}/first-instance/source`,{state:{isPreventScrollToTop:!0,isForceCaseSourceAnimateOnStart:!0,isFromDefenseStrategyDetailedPage:!0,defenseRequestsGoal:s.defenseRequestsGoal}})},[e,n,s.defenseRequestsGoal]);return l.useEffect(()=>{if(!r.current||!d||y)return;const _=new IntersectionObserver(N=>{N[0].isIntersecting&&d()},{root:null,rootMargin:"0px",threshold:.1});return _.observe(r.current),()=>_.disconnect()},[d,y]),i||!g?a.jsx("div",{className:"flex-1 min-h-40",children:a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0})}):o.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex-1 grid content-start grid-cols-[max-content_minmax(0,2fr)_minmax(0,1fr)] gap-x-2 gap-y-3 bp56_25:grid-cols-[max-content_minmax(0,2fr)_minmax(0,1fr)_max-content]",children:o.map((_,N)=>{const R=S({caseId:_.id}),D=b(R);return a.jsxs(l.Fragment,{children:[a.jsx("div",{className:"col-span-3 bp56_25:col-span-4 h-6"}),a.jsx("div",{className:"col-span-3 bp56_25:col-span-4 roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 flex items-center mb-1",children:a.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[a.jsxs("div",{className:"flex flex-row gap-3 w-full",children:[a.jsx("div",{className:"-mt-[3px]",children:a.jsx(Pm,{score:I(_.id,_.defenseRequest.related_felony_id),tooltipText:"Похожесть преступления",tooltipPosition:"left"})}),a.jsx("div",{className:"flex flex-col gap-1.5",children:a.jsxs(Je,{to:`/clients/${e}/cases/first-instance/${_.id}/first-instance/defense-request/${_.defenseRequest.related_accused_id}/${_.defenseRequest.defense_request_id}`,state:{isFromDefenseStrategyDetailedPage:!0,isPreventScrollToTop:!1,isForceCaseDetailedAnimateOnStart:!0,defenseRequestsGoal:s.defenseRequestsGoal},className:"cursor-pointer hover:underline underline-offset-[25%] decoration-[2%]",children:[h.client.defenseStrategy.defenseRequestDataBlock.CASE_ARGUMENTS_TITLE_PREFIX,!!_.cui&&a.jsxs(a.Fragment,{children:[" ",_.cui]})]})})]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex flex-row items-center w-fit",children:a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"left",content:a.jsxs("div",{className:"w-full max-w-[257px]",children:[a.jsx("div",{className:"roboto-flex-25-400-1 text-[16px] leading-[20px] text-white whitespace-nowrap",children:h.client.defenseStrategy.evidence.tooltips.CRIMINAL_CASE_FELONIES}),a.jsx("div",{className:"flex flex-col gap-0.5 mt-3",children:R.map(k=>a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:k},`felony-article-${_.id}-${k}`))})]}),children:a.jsxs("div",{className:"flex flex-row items-center gap-1",children:[D.mainArticle||h.client.cases.placeholders.NOT_SPECIFIED,a.jsx("span",{className:"text-zinc-400",children:D.additionalCount>0?` +${D.additionalCount}`:""})]})})})]})}),(_.defenseRequest.defense_arguments??[]).map((k,L)=>{const O=x(k?.argument_result??null);return a.jsxs("div",{className:"contents roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-950",children:[a.jsx("div",{className:"flex items-start",children:E(k?.argument_result??null)}),a.jsx("div",{className:"min-w-0",children:a.jsx(Je,{to:`/clients/${e}/cases/first-instance/${_.id}/first-instance/defense-request/${_.defenseRequest.related_accused_id}/${_.defenseRequest.defense_request_id}#${k.defense_argument_id}`,state:{isFromDefenseStrategyDetailedPage:!0,isPreventScrollToTop:!1,isForceCaseDetailedAnimateOnStart:!0,defenseRequestsGoal:s.defenseRequestsGoal},className:"py-0.5 wrap-break-word roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 cursor-pointer hover:underline underline-offset-[25%] decoration-[3%]",children:k?.description??null})}
866),a.jsx("div",{className:"min-w-0 wrap-break-word roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:k?.laws?.map((P,B)=>a.jsxs(l.Fragment,{children:[B>0&&", ",a.jsx("span",{className:"whitespace-nowrap",children:et({clause:P.clause??"",part:P.part??"",number:P.article??"",codeType:P.code_type??""})})]},B))}),a.jsx("div",{className:"hidden bp56_25:block roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 text-right",children:O})]},L)}),a.jsx("div",{className:"col-span-3 bp56_25:col-span-4 pl-7",children:a.jsx(ms,{onClick:()=>w({caseId:_.id}),children:h.client.cases.links.SOURCE})}),a.jsx("div",{className:"col-span-3 bp56_25:col-span-4 h-6 bp56_25:h-4 border-b border-zinc-200 border-bottom-1 last:border-b-0"})]},N)})}),a.jsxs("div",{ref:r,className:"flex items-center justify-center min-h-14",children:[!y&&a.jsx(ct,{}),y&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h?.client?.defenseStrategy?.defenseRequestDataBlock?.EVERYTHING_SHOWN})]})]}):a.jsx("div",{className:"flex-1 min-h-40 w-full h-full flex items-center justify-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.messages.NO_RESULTS_BY_FILTERS})},nle=()=>{const e=vs(),t=l.useRef(null),{id:n}=st(),s=Ie($=>$.resetKey),r=Ie($=>$.setResetKey),i=Fe(),o=at(),c=i.state?.defenseRequestsGoal??null,u=i.state?.isForceDefenseStrategyDetailedAnimateOnStart===!0,d=Ie($=>$.aggregationsDataByClientIdByKey[n??""]?.["first-instance"]??null),p=Ie($=>$.defenseRequestAggregationsByClientIdByKey[n??""]?.["first-instance"]??null),{clientData:g}=Zi(),A=kn($=>$.catalogues?.articles),E=Ie($=>$.selectedRegionIdsByClientIdByKey[n??""]?.["first-instance"]),x=Ie($=>$.selectedConclusionArticlesByClientIdByKey[n??""]?.["first-instance"]),y=Ie($=>$.selectedEpisodesByClientIdByKey[n??""]?.["first-instance"]),I=Ie($=>$.selectedPunishmentTypesByClientIdByKey[n??""]?.["first-instance"]),v=Ie($=>$.selectedDefenseRequestsResultsByClientIdByKey[n??""]?.["first-instance"]),S=Ie($=>$.selectedGendersByClientIdByKey[n??""]?.["first-instance"]),b=Ie($=>$.selectedCriminalStatusesByClientIdByKey[n??""]?.["first-instance"]),w=l.useCallback(()=>{n&&o(`/clients/${n}/defense-strategy/first-instance`,{replace:!0,state:{isPreventScrollToTop:!0,defenseRequestsGoal:null}})},[n,o]);l.useEffect(()=>{if(!u)return;const $=i.state;if(!$)return;const J={...$};delete J.isForceDefenseStrategyDetailedAnimateOnStart;const ne=window.history.state??{};window.history.replaceState({...ne,usr:J},"",window.location.href)},[u,i.state]);const _=l.useMemo(()=>Y("roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500"),[]),N=l.useMemo(()=>{const $=c?.goal??null,J=d?.defense_requests_goals_nested??[];return!J||!J.length?{defense_goal:$??"",felony_count:0,goal_articles:[],argument_articles:[],articles_count:0,defense_arguments_count:0,defense_success_percent:0}:($?J.find(X=>X.defense_goal===$):null)??J[0]},[d,c?.goal]),R=l.useMemo(()=>g?gc({episodes:g.episodes,articles:A}):[],[g,A]),D=l.useMemo(()=>{if(!y?.length)return a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER});const $=R.filter(J=>y.includes(J.value));return $.length?$.length>1?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:$[0].label}),a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",$.length-1]})})]}):a.jsx("div",{className:_,children:$[0].label}):a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER})},[R,y,_]),k=l.useMemo(()=>{if(x?.length)try{const $=JSON.parse(x[0]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:et({part:$.part??"",number:$.article??"",codeType:$.codeType??"",clause:$.clause??""})}),x.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",x.length-1]})})]})}catch{return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:x[0]}),x.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",x.length-1]})})]})}return a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.articles.PLACEHOLDER})},[_,x]),L=a.jsx("div",{className:_,children:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE}),O=l.useMemo(()=>E?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:e[Number(E[0])]?.name??E[0]}),E.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",E.length-1]})})]}):a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.regions.PLACEHOLDER}),[_,E,e]),P=l.useMemo(()=>I?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:Vn(I[0])}),I.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",I.length-1]})})]}):null,[_,I]),B=l.useMemo(()=>v?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:v[0]}),v.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",v.length-1]})})]}):null,[_,v]),F=l.useMemo(()=>S?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:On(h.enums.genders,S[0],S[0])}),S.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",S.length-1]})})]}):a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.genders.PLACEHOLDER}),[_,S]),z=l.useMemo(()=>b?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:_,children:On(h.enums.criminalStatuses,b[0],b[0])}),b.length>1&&a.jsx("div",{className:_,children:a.jsxs("div",{className:"text-zinc-500",children:["+",b.length-1]})})]}):a.jsx("div",{className:_,children:h.client.defenseStrategy.aggregations.criminalStatuses.PLACEHOLDER}),[_,b]),Q=l.useMemo(()=>{const $=p?.argument_results_nested?.defense_arguments_nested?.defense_arguments_results?.buckets??[];return!Array.isArray($)||!$.length?[]:$.map(J=>String(J?.key??"")).filter(J=>!!J).map(J=>({label:Vn(J),value:J}))},[p?.argument_results_nested]),M=l.useMemo(()=>{const $=c?.argumentResults??null;return $?.length?$:null},[c?.argumentResults]),K=l.useMemo(()=>{const $=p?.argument_results_articles_nested??[],J=new Set;return $.map(X=>({article:String(X?.article??""),part:String(X?.part??""),clause:String(X?.clause??""),codeType:String(X?.code_type??"")})).filter(X=>!!X.article).filter(X=>{const oe=`${X.codeType}|${X.article}|${X.part}|${X.clause}`;return J.has(oe)?!1:(J.add(oe),!0)}).sort((X,oe)=>{const ie=X.codeType.localeCompare(oe.codeType,void 0,{sensitivity:"base"});if(ie!==0)return ie;const ee=X.article.localeCompare(oe.article,void 0,{numeric:!0,sensitivity:"base"});if(ee!==0)return ee;const te=X.part.localeCompare(oe.part,void 0,{numeric:!0,sensitivity:"base"});return te!==0?te:X.clause.localeCompare(oe.clause,void 0,{numeric:!0,sensitivity:"base"})}).map(({article:X,part:oe,clause:ie,codeType:ee})=>({label:et({clause:ie,part:oe,number:X,codeType:ee}),value:JSON.stringify({number:X,part:oe,codexType:ee,clause:ie})}))},[p?.argument_results_articles_nested]),W=l.useMemo(()=>{const $=c?.articles??null;return!$||!$.length?null:$.map(J=>JSON.stringify({number:J.number?J.number:"",part:J.part??"",codexType:J.codexType??"",clause:J.clause??""}))},[c?.articles]),H=l.useMemo(()=>K.map($=>$.value).join("|"),[K]),j=l.useMemo(()=>W?W.join("|"):"",[W]);l.useEffect(()=>{r($=>$+1)},[H,j,r]);const q=l.useCallback($=>{if(!n)return;const J=$&&$.length?$.map(X=>{try{const oe=JSON.parse(X);return{number:oe.number?oe.number:null,part:oe.part?oe.part:null,codexType:oe.codexType?oe.codexType:null,clause:oe.clause?oe.clause:null}}catch{return null}}
866).filter(Boolean):[],ne=i.state??{};o(`/clients/${n}/defense-strategy/first-instance`,{replace:!0,state:{...ne,defenseRequestsGoal:{goal:c?.goal??N.defense_goal??null,articles:J,argumentResults:c?.argumentResults??[]}}})},[n,N.defense_goal,c,i.state,o]),G=l.useCallback($=>{if(!n)return;const J=i.state??{};o(`/clients/${n}/defense-strategy/first-instance`,{replace:!0,state:{...J,defenseRequestsGoal:{goal:c?.goal??N.defense_goal??null,articles:c?.articles?c.articles:[],argumentResults:$&&$.length?$:[]}}})},[n,N.defense_goal,c,i.state,o]);return a.jsx(Ws,{onClose:w,isForceAnimateOnStart:u,contentRef:t,children:a.jsxs("div",{className:"pb-8 flex flex-col justify-between h-full",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:D}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:k}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:L}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:O}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:F}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:z}),!!P&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:P}),!!B&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:B})]}),a.jsxs("div",{className:"mt-6 flex align-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950",children:N.defense_goal}),a.jsx(Wr,{text:h.client.defenseStrategy.tooltips.DEFENSE_REQUEST})]}),a.jsxs("div",{className:"hidden bp56_25:flex items-center uppercase roboto-flex-25-700-1 text-[14px] leading-[16px] bg-green-50 text-green-600 rounded-full px-2 whitespace-nowrap h-6",children:[Math.round(N.defense_success_percent??0),"%"," ",qt({count:Math.round(N.defense_success_percent??0),zero:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ZERO,one:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ONE,many:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_MANY})]})]}),a.jsxs("div",{className:"mt-3 bp56_25:mt-3 flex align-center justify-between",children:[a.jsxs("div",{className:"flex align-center justify-start gap-3 bp56_25:gap-4 roboto-flex-100-400-1 text-[14px] bp56_25:text-[16px] leading-[16px] bp56_25:leading-[20px] mb-0",children:[!!N.goal_articles?.length&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col align-center justify-start gap-3",children:(()=>{const $=N.goal_articles?.[0];if(!$)return null;const J=Math.max(0,(N.goal_articles?.length??0)-1);return a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"left",content:a.jsx(K7,{articles:N.goal_articles??[]}),children:a.jsxs("div",{className:"text-zinc-950",children:[et({clause:$.clause,part:$.part,number:$.article,codeType:$.code_type}),!!J&&a.jsxs("span",{className:"text-zinc-500 ml-1",children:["+",J]})]})})})()}),a.jsx("div",{className:"text-zinc-500",children:"·"})]}),a.jsxs("div",{className:"flex align-center justify-start gap-4 text-zinc-500",children:[a.jsxs("div",{children:[fn({value:N.felony_count})," ",qt({count:N.felony_count,zero:h.client.defenseStrategy.defenseRequest.FELONIES_ZERO,one:h.client.defenseStrategy.defenseRequest.FELONIES_ONE,many:h.client.defenseStrategy.defenseRequest.FELONIES_MANY})]}),a.jsxs("div",{children:[fn({value:N.defense_arguments_count})," ",qt({count:N.defense_arguments_count,zero:h.client.defenseStrategy.defenseRequest.ARGUMENTS_ZERO,one:h.client.defenseStrategy.defenseRequest.ARGUMENTS_ONE,many:h.client.defenseStrategy.defenseRequest.ARGUMENTS_MANY})]}),a.jsx("div",{children:N.articles_count>0?`${fn({value:N.articles_count})} ${qt({count:N.articles_count,zero:h.client.defenseStrategy.defenseRequest.RIGHTS_ZERO,one:h.client.defenseStrategy.defenseRequest.RIGHTS_ONE,many:h.client.defenseStrategy.defenseRequest.RIGHTS_MANY})}`:h.client.defenseStrategy.defenseRequest.RIGHTS_ABSENT})]})]}),a.jsxs("div",{className:"flex bp56_25:hidden items-center uppercase roboto-flex-25-700-1 text-[12px] bg-green-50 text-green-600 rounded-full px-1.5 whitespace-nowrap h-5",children:[Math.round(N.defense_success_percent??0),"%"," ",qt({count:Math.round(N.defense_success_percent??0),zero:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ZERO,one
866:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_ONE,many:h.client.defenseStrategy.defenseRequest.SUCCESS_PERCENT_MANY})]})]}),a.jsxs("div",{className:"mt-7 flex flex-wrap gap-4",children:[a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.defenseRequests.PLACEHOLDER,values:W,options:K,onChange:q,resetKey:s}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.argumentResults.PLACEHOLDER,values:M,options:Q,onChange:G,resetKey:s})]}),a.jsx(tle,{clientId:n??""})]})})},sle=({isLoading:e,evidenceFormatted:t,clientId:n,evidenceFromLocationState:s,pageTypeFromLocationState:r,notedTotal:i,ignoredTotal:o,paginationData:c,fetchNextPage:u,strategies:d})=>{const p=vs(),g=l.useRef(null),A=at(),E=l.useCallback(O=>{const P=O.usage_in_felonies?.[0]?.used_by;return P==="Сторона защиты"?h.client.defenseStrategy.evidence.usedBy.DEFENSE:P==="Сторона обвинения"?h.client.defenseStrategy.evidence.usedBy.PROSECUTION:""},[]),x=l.useCallback(O=>O.description?O.description:"",[]),y=l.useCallback(O=>{const P=O?.consideration_type??"";if(P==="Принято во внимание")return!0;if(P==="Не принято во внимание")return!1},[]),I=l.useCallback(O=>O.metadata_cui,[]),v=l.useCallback(O=>O.id,[]),S=l.useCallback(O=>O.id,[]),b=l.useCallback(O=>{if(O.metadata_region)return p[O.metadata_region]?.name??void 0},[p]),w=l.useMemo(()=>{const O=new Map;return d.forEach(P=>{const B=P?._id??null;if(!B)return;const Q=((P?._source??null)?.case_narrative?.events??[]).flatMap(K=>K?.felonies??[]),M=new Map;Q.forEach(K=>{const W=K?.felony_id??null,H=K?.objects?.primary_object?.related_law?.law;if(!W||!H?.article)return;const j=et({clause:H.clause,part:H.part,number:H.article});j&&M.set(W,j)}),O.set(B,M)}),O},[d]),_=l.useCallback(({caseId:O})=>{if(!O)return[];const P=w.get(O);if(!P)return[];const B=[],F=new Set;return P.forEach(z=>{F.has(z)||(F.add(z),B.push(z))}),B},[w]),N=l.useCallback(O=>{if(!O.length)return{mainArticle:"",additionalCount:0};const P=O[0]??"",B=O.length,F=Math.max(B-1,0);return F?{mainArticle:P,additionalCount:F}:{mainArticle:P,additionalCount:0}},[]),R=l.useCallback(({caseId:O,evidence:P})=>{if(!O){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE});return}const B=P?.raw_quotes,F=sr(B),z=sr(P?.quotes),Q=F.length?F:z;A(`/clients/${n}/cases/first-instance/${O}/first-instance/source`,{state:{isPreventScrollToTop:!0,isForceCaseSourceAnimateOnStart:!0,isFromDefenseStrategyEvidenceDetailedPage:!0,evidence:s,pageType:r,notedTotal:i,ignoredTotal:o,initialSearchTerms:Q}})},[n,s,o,A,i,r]),D=l.useCallback((O,P)=>{if(!P)return"";const B=O?.evidence_id,F=typeof B=="string"&&B?B:void 0,z=O?.related_accused_ids?.[0],Q=typeof z=="string"&&z?z:void 0;return F&&Q?`/clients/${n}/cases/first-instance/${P}/first-instance/evidence/evidence/${Q}/${F}`:`/clients/${n}/cases/first-instance/${P}/first-instance/evidence`},[n]),k=l.useMemo(()=>{const O=c?.searchAfter;return!O||O.length!==2||!O[0]||!O[1]},[c?.searchAfter]),L=l.useCallback((O,P)=>{if(!O||!P||!P.length)return;const B=P.map(z=>z?.felony_id).filter(z=>!!z);if(!B.length)return;const F=B.map(z=>Jv({strategies:d,itemId:O,felonyId:z})).filter(z=>z!==void 0);if(F.length)return Math.max(...F)},[d]);return l.useEffect(()=>{if(!g.current||!u||k)return;const O=new IntersectionObserver(P=>{P[0].isIntersecting&&u()},{root:null,rootMargin:"0px",threshold:.1});return O.observe(g.current),()=>O.disconnect()},[u,k]),e?a.jsx("div",{className:"flex-1",children:a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0})}):t?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex-1",children:t.map((O,P)=>{const B=E(O),F=x(O),z=y(O),Q=I(O),M=v(O),K=S(O),W=b(O),H=_({caseId:M}),j=N(H);return!B||z===void 0||!M||!K?null:a.jsxs("div",{className:"py-8 flex gap-12 border-b border-zinc-200 border-bottom-1 last:border-b-0",children:[a.jsxs("div",{className:"flex flex-col gap-1 w-full",children:[a.jsxs("div",{className:"flex flex-row gap-3 w-full",children:[a.jsx("div",{className:"-mt-[3px]",children:a.jsx(Pm,{score:L(K,O.usage_in_felonies),tooltipText:"Похожесть преступления",tooltipPosition:"left"})}),a.jsx("div",{className:"w-full flex flex-col gap-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ls,{text:h.client.cases.placeholders.GO_TO_CASE_CARD,isDisableOnTouch:!0,children:a.jsxs(Je,{to:D(O,K),state:{isPreventScrollToTop:!1,isForceCaseDetailedAnimateOnStart:!0,isFromDefenseStrategyEvidenceDetailedPage:!0,evidence:s,pageType:r,notedTotal:i,ignoredTotal:o},className:"underline-offset-[25%] decoration-[2%] roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 hover:underline",children:[h.client.cases.titles.CASE_CARD_TITLE," ",Q??""," ",W?`(${W})`:""]})}),!!Q&&a.jsx(Om,{text:Q,isBelow:!1,successMessage:h.client.cases.messages.COPY_CUI_SUCCESS,tooltipText:h.client.cases.placeholders.COPY_CUI,notifyKey:"COPY_CUI"})]})})]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex flex-row items-center w-fit mt-1",children:a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"left",content:a.jsxs("div",{className:"w-full max-w-[257px]",children:[a.jsx("div",{className:"roboto-flex-25-400-1 text-[16px] leading-[20px] text-white whitespace-nowrap",children:h.client.defenseStrategy.evidence.tooltips.CRIMINAL_CASE_FELONIES}),a.jsx("div",{className:"flex flex-col gap-0.5 mt-3",children:H.map(q=>a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:q},`felony-article-${K}-${q}`))})]}),children:a.jsxs("div",{className:"flex flex-row items-center gap-1",children:[j.mainArticle||h.client.cases.placeholders.NOT_SPECIFIED,a.jsx("span",{className:"text-zinc-400",children:j.additionalCount>0?` +${j.additionalCount}`:""})]})})}),a.jsx("div",{className:"roboto-flex-400-1 text-[14px] leading-[16
866px] text-zinc-500 mt-2",children:B}),a.jsx("div",{className:"roboto-flex-400-1 text-[16px] leading-[20px] text-zinc-950",children:F}),a.jsx("div",{className:"mt-3 flex items-start",children:a.jsx(ms,{onClick:()=>R({caseId:M,evidence:O}),children:h.client.defenseStrategy.evidence.SOURCE})})]}),a.jsx("div",{className:"flex flex-col gap-1 items-end",children:a.jsx("div",{className:Y("flex items-center justify-center h-5 roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase rounded-full px-1.5 mt-0.5 whitespace-nowrap border-2",!!z&&"text-emerald-600 border-emerald-600",!z&&"text-slate-600 border-slate-600"),children:z?h.client.defenseStrategy.evidence.status.CONSIDERED:h.client.defenseStrategy.evidence.status.NOT_CONSIDERED})})]},P)})}),a.jsxs("div",{ref:g,className:Y("flex items-center justify-center min-h-14",!!(c&&c.totalResults<=10)&&"hidden"),children:[!k&&a.jsx(ct,{}),k&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h?.client?.defenseStrategy?.evidence?.messages?.EVERYTHING_SHOWN})]})]}):a.jsx("div",{className:"flex-1 min-h-40 w-full h-full flex items-center justify-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.messages.NO_RESULTS_BY_FILTERS})},rle=({clientId:e,aggregations:t=!1})=>{const n=Fe(),s=Ie(j=>j.selectedRegionIdsByClientIdByKey[e]?.["first-instance"]),r=Ie(j=>j.selectedPleaStatusesByClientIdByKey[e]?.["first-instance"]),i=Ie(j=>j.selectedConclusionArticlesByClientIdByKey[e]?.["first-instance"]),o=Ie(j=>j.selectedEpisodesByClientIdByKey[e]?.["first-instance"]),c=Ie(j=>j.selectedPunishmentTypesByClientIdByKey[e]?.["first-instance"]),u=Ie(j=>j.selectedDefenseRequestsResultsByClientIdByKey[e]?.["first-instance"]),d=Ie(j=>j.selectedGendersByClientIdByKey[e]?.["first-instance"]),p=Ie(j=>j.selectedCriminalStatusesByClientIdByKey[e]?.["first-instance"]),g=n.state?.evidence,A=sn(j=>Object.prototype.hasOwnProperty.call(j.filtersByClientIdByInstance[e]??{},"first-instance")),E=(()=>{if(!(!i||!i.length))return i.map(j=>{try{const q=JSON.parse(j);return{number:q.article?q.article:void 0,part:q.part?q.part:void 0,clause:q.clause?q.clause:void 0,code_type:q.codeType?q.codeType:void 0}}catch{return}}).filter(Boolean)})(),x=s?.length?s.map(j=>parseInt(j,10)).filter(j=>!Number.isNaN(j)):void 0,y=r??void 0,I=y?y.join(","):void 0,v=y,S=u?.length?u:void 0,b=S?S.join(","):void 0,w=i?i.map(j=>{try{const q=JSON.parse(j);return`${q.codeType??""}:${q.article??""}:${q.part??""}:${q.clause??""}`}catch{return j}}).filter(Boolean).join(","):void 0,_=c&&c.length?c:void 0,N=_?_.join(","):void 0,R=o?.join(","),D=d&&d.length?d.join(","):void 0,k=p&&p.length?p.join(","):void 0,L=Qu({selectedEpisodeIds:o}),O=fa({queryKey:["defense-request","first-instance",e,x,I,b,w,N,R,g?[g.usedBy??"",g.type??"",g.category??"",g.purpose??"",g.considerationType??""].join("|"):null,D,k],queryFn:j=>yf(e,{aggregations:t,articles:E??void 0,episodes:L,genders:d&&d.length?d:void 0,criminalStatuses:p&&p.length?p:void 0,searchAfter:j.pageParam?{searchAfterScore:j.pageParam[0],searchAfterId:j.pageParam[1]}:void 0,punishments:_??void 0,pleaStatuses:v??void 0,regions:x??void 0,defenseRequestsResults:S,evidence:g??void 0}),enabled:!!e&&!!g&&A,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:null,getNextPageParam:j=>j?.nextSearchAfter??void 0}),P=O.data?.pages,B=P?.[0]?.episodes??null,F=P?.[0]?.aggregations,z=P?.[0]?.totalResults??0,Q={totalResults:z,searchAfter:P&&P?.length?P[P.length-1]?.nextSearchAfter:void 0},M=P?.flatMap(j=>j?.results??[])??[],K=(M??[]).flatMap(j=>{const q=j?._id??null,G=j?._source??null,$=G?.metadata_cui??null,J=G?.metadata_region??null,ne=G?.file_id??null;return(G?.evidence??[]).map(X=>({...X,id:q,metadata_cui:$,metadata_region:J,file_id:ne}))}),W=bt(),H=l.useCallback(()=>{if(!e||!g||g.considerationType==="Принято во внимание")return;const j={...g,considerationType:"Принято во внимание"},q=[j.usedBy??"",j.type??"",j.category??"",j.purpose??"",j.considerationType??""].join("|"),G=["defense-request","first-instance",e,x,I,b,w,N,R,D,k,q];W.getQueryState(G)||W.prefetchInfiniteQuery({queryKey:G,queryFn:()=>yf(e,{aggregations:t,articles:E??void 0,episodes:L,genders:d&&d.length?d:void 0,criminalStatuses:p&&p.length?p:void 0,punishments:_??void 0,pleaStatuses:v??void 0,regions:x??void 0,defenseRequestsResults:S,evidence:j}),initialPageParam:null,staleTime:1e3*60*5,gcTime:1e3*60*10})},[W,e,g,t,E,L,_,v,x,S,I,b,w,N,R,d,p,D,k]);return l.useEffect(()=>{O.isSuccess&&H()}
866,[O.isSuccess,H]),{...O,episodesData:B,aggregationsData:F,paginationData:Q,evidenceFormatted:K,strategies:M,totalResults:z,fetchNextPage:O.fetchNextPage,isFetchingNextPage:O.isFetchingNextPage}},Ew=()=>{const e=vs(),t=at(),n=Fe(),{id:s}=st(),r=n.state?.evidence,i=n.state?.pageType??null,o=n.state?.notedTotal,c=n.state?.ignoredTotal,u=n.state?.isForceDefenseStrategyEvidenceDetailedAnimateOnStart===!0,{clientData:d}=Zi(),p=kn(j=>j.catalogues?.articles),g=Ie(j=>j.selectedRegionIdsByClientIdByKey[s??""]?.["first-instance"]),A=Ie(j=>j.selectedConclusionArticlesByClientIdByKey[s??""]?.["first-instance"]),E=Ie(j=>j.selectedEpisodesByClientIdByKey[s??""]?.["first-instance"]),x=Ie(j=>j.selectedPunishmentTypesByClientIdByKey[s??""]?.["first-instance"]),y=Ie(j=>j.selectedDefenseRequestsResultsByClientIdByKey[s??""]?.["first-instance"]),I=Ie(j=>j.selectedGendersByClientIdByKey[s??""]?.["first-instance"]),v=Ie(j=>j.selectedCriminalStatusesByClientIdByKey[s??""]?.["first-instance"]),S=sn(j=>Object.prototype.hasOwnProperty.call(j.filtersByClientIdByInstance[s??""]??{},"first-instance")),b=l.useMemo(()=>r?r.considerationType==="Принято во внимание"?o??0:(o??0)+(c??0):0,[r,o,c]),w=l.useMemo(()=>Y("roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500"),[]),_=l.useMemo(()=>d?gc({episodes:d.episodes,articles:p}):[],[d,p]),N=l.useMemo(()=>{if(!E?.length)return a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER});const j=_.filter(q=>E.includes(q.value));return j.length?j.length>1?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:j[0].label}),a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",j.length-1]})})]}):a.jsx("div",{className:w,children:j[0].label}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER})},[_,E,w]),R=l.useMemo(()=>{if(A?.length)try{const j=JSON.parse(A[0]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:et({part:j.part??"",number:j.article??"",clause:j.clause??"",codeType:j.codeType??""})}),A.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",A.length-1]})})]})}catch{return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:A[0]}),A.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",A.length-1]})})]})}return a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.articles.PLACEHOLDER})},[w,A]),D=a.jsx("div",{className:w,children:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE}),k=l.useMemo(()=>g?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:e[Number(g[0])]?.name??g[0]}),g.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",g.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.regions.PLACEHOLDER}),[w,g,e]),L=l.useMemo(()=>x?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:Vn(x[0])}),x.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",x.length-1]})})]}):null,[w,x]),O=l.useMemo(()=>y?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:y[0]}),y.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",y.length-1]})})]}):null,[w,y]),P=l.useMemo(()=>I?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:On(h.enums.genders,I[0],I[0])}),I.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",I.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.genders.PLACEHOLDER}),[w,I]),B=l.useMemo(()=>v?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:On(h.enums.criminalStatuses,v[0],v[0])}),v.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",v.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.criminalStatuses.PLACEHOLDER}),[w,v]),F=l.useCallback(()=>{s&&t(`/clients/${s}/defense-strategy/first-instance/evidence${n.state?.pageType==="prosecution"?"/prosecution":""}`,{replace:!0,state:{isPreventScrollToTop:!0}})},[s,n.state,t]);l.useEffect(()=>{if(!u)return;const j=n.state;if(!j)return;const q={...j};delete q.isForceDefenseStrategyEvidenceDetailedAnimateOnStart;const G=window.history.state??{};window.history.replaceState({...G,usr:q},"",window.location.href)},[u,n.state]);const{isLoading:z,evidenceFormatted:Q,paginationData:M,fetchNextPage:K,strategies:W}=rle({clientId:s??"",aggregations:!0}),H=l.useRef(null);return a.jsx(Ws,{onClose:F,isForceAnimateOnStart:u,contentRef:H,children:a.jsxs("div",{className:"pb-8 flex flex-col justify-between h-full",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:N}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:R}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:D}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:k}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:P}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:B}),!!L&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:L}),!!O&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:O})]}),a.jsxs("div",{className:"mt-5 mb-3 flex align-center justify-between",children:[a.jsxs("div",{className:"flex items-center justify-start",children:[a.jsx("span",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase",children:r?.subcategory}),a.jsx("span",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-300 uppercase",children:" · "}),a.jsxs("span",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-400 uppercase",children:[b," ",qt({count:b,zero:h.client.defenseStrategy.evidence.SIMILAR_EVIDENCE_ZERO,one
866:h.client.defenseStrategy.evidence.SIMILAR_EVIDENCE_ONE,many:h.client.defenseStrategy.evidence.SIMILAR_EVIDENCE_MANY})]})]}),a.jsx(Je,{to:`/clients/${s}/defense-strategy/first-instance/evidence`,state:{isPreventScrollToTop:!0,evidence:{...r,considerationType:r?.considerationType==="Принято во внимание"?void 0:"Принято во внимание"},pageType:i,notedTotal:o,ignoredTotal:c},className:"flex items-center justify-center h-8 px-3 roboto-flex-25-700-1 text-[14px] leading-[16px] text-zinc-950 uppercase bg-zinc-100 hover:bg-zinc-200 rounded-full whitespace-nowrap shrink-0",children:r?.considerationType==="Принято во внимание"?h.client.defenseStrategy.evidence.buttons.ALL:h.client.defenseStrategy.evidence.buttons.ONLY_CONSIDERED})]}),a.jsxs("div",{className:"mb-1",children:[a.jsx("span",{className:"roboto-flex-400-1 text-[16px] leading-[20px] text-zinc-950",children:r?.type}),a.jsx("span",{className:"roboto-flex-400-1 text-[16px] leading-[20px] text-zinc-400",children:" · "}),a.jsx("span",{className:"roboto-flex-400-1 text-[16px] leading-[20px] text-zinc-950",children:r?.category})]}),a.jsx("div",{className:"mb-2 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:r?.purpose}),a.jsx(sle,{isLoading:z||!S,evidenceFormatted:Q,clientId:s??"",evidenceFromLocationState:r,pageTypeFromLocationState:i,notedTotal:o,ignoredTotal:c,paginationData:M,fetchNextPage:K,strategies:W})]})})},ile=({isLoading:e,circumstancesFormatted:t,clientId:n,circumstancesFromLocationState:s,pageTypeFromLocationState:r,notedTotal:i,ignoredTotal:o,paginationData:c,fetchNextPage:u,strategies:d})=>{const p=vs(),g=l.useRef(null),A=at(),E=l.useCallback(({circumstance:k})=>{const L=k?.consideration_type??"";if(L==="Принято во внимание")return!0;if(L==="Не принято во внимание")return!1},[]),x=l.useCallback(({circumstance:k})=>k.id,[]),y=l.useCallback(({circumstance:k})=>k.id,[]),I=l.useCallback(({circumstance:k})=>k.metadata_cui,[]),v=l.useCallback(({circumstance:k})=>{const L=k.metadata_region;if(L)return p[L]?.name??void 0},[p]),S=l.useCallback(({caseId:k,circumstance:L})=>{if(!k){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE});return}const O=L?.raw_quotes,P=sr(O),B=sr(L?.quotes),F=P.length?P:B;A(`/clients/${n}/cases/first-instance/${k}/first-instance/source`,{state:{isPreventScrollToTop:!0,isForceCaseSourceAnimateOnStart:!0,isFromDefenseStrategyCircumstancesDetailedPage:!0,circumstances:s,pageType:r,notedTotal:i,ignoredTotal:o,initialSearchTerms:F}})},[s,n,A,r,i,o]),b=l.useMemo(()=>{const k=c?.searchAfter;return!k||k.length!==2||!k[0]||!k[1]},[c?.searchAfter]),w=l.useCallback(({itemId:k,felonyIds:L})=>{if(!k||!L||!L.length)return;const O=L.map(P=>Jv({strategies:d,itemId:k,felonyId:P})).filter(P=>P!==void 0);if(O.length)return Math.max(...O)},[d]),_=l.useCallback(({circumstance:k,caseId:L})=>{if(!L)return"";const O=k?.circumstance_id,P=typeof O=="string"&&O?O:void 0;return P?`/clients/${n}/cases/first-instance/${L}/first-instance/circumstances/${P}`:`/clients/${n}/cases/first-instance/${L}/first-instance/circumstances`},[n]),N=l.useMemo(()=>{const k=new Map;return d.forEach(L=>{const O=L?._id??null;if(!O)return;const F=((L?._source??null)?.case_narrative?.events??[]).flatMap(Q=>Q?.felonies??[]),z=new Map;F.forEach(Q=>{const M=Q?.felony_id??null,K=Q?.objects?.primary_object?.related_law?.law;if(!M||!K?.article)return;const W=et({clause:K.clause,part:K.part,number:K.article});W&&z.set(M,W)}),k.set(O,z)}),k},[d]),R=l.useCallback(({caseId:k})=>{if(!k)return[];const L=N.get(k);if(!L)return[];const O=[],P=new Set;return L.forEach(B=>{P.has(B)||(P.add(B),O.push(B))}),O},[N]),D=l.useCallback(({felonyArticles:k})=>{if(!k.length)return{mainArticle:"",additionalCount:0};const L=k[0]??"",O=k.length,P=Math.max(O-1,0);return P?{mainArticle:L,additionalCount:P}:{mainArticle:L,additionalCount:0}},[]);return l.useEffect(()=>{if(!g.current||!u||b)return;const k=new IntersectionObserver(L=>{L[0].isIntersecting&&u()},{root:null,rootMargin:"0px",threshold:.1});return k.observe(g.current),()=>k.disconnect()},[u,b]),e?a.jsx("div",{className:"flex-1",children:a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0})}):t?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex-1",children:t.map((k,L)=>{const O=E({circumstance:k}),P=x({circumstance:k}),B=y({circumstance:k}),F=I({circumstance:k}),z=v({circumstance:k}),Q=k.description??"";if(O===void 0||!P||!B)return null;const M=R({caseId:P}),K=D({felonyArticles:M});return a.jsxs("div",{className:"py-8 flex gap-12 border-b border-zinc-200 border-bottom-1 last:border-b-0",children:[a.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[a.jsxs("div",{className:"flex flex-row gap-3 w-full",children:[a.jsx("div",{className:"-mt-[3px]",children:a.jsx(Pm,{score:w({itemId:B,felonyIds:k.felony_ids}),tooltipText:"Похожесть преступления",tooltipPosition:"left"})}),a.jsx("div",{className:"w-full flex flex-col gap-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ls,{text:h.client.cases.placeholders.GO_TO_CASE_CARD,isDisableOnTouch:!0,children:a.jsxs(Je,{to:_({circumstance:k,caseId:B}),state:{isPreventScrollToTop:!1,isForceCaseDetailedAnimateOnStart:!0,isFromDefenseStrategyCircumstancesDetailedPage:!0,circumstances:s,pageType:r,notedTotal:i,ignoredTotal:o},className:"underline-offset-[25%] decoration-[2%] roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 hover:underline",children:[h.client.cases.titles.CASE_CARD_TITLE," ",F??""," ",z?`(${z})`:""]})}),!!F&&a.jsx(Om,{text:F,isBelow:!0,successMessage:h.client.cases.messages.COPY_CUI_SUCCESS,tooltipText:h.client.cases.placeholders.COPY_CUI,notifyKey:"COPY_CUI"})]})})]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex flex-row items-center w-fit",children:a.jsx(Do,{verticalPosition:"bottom",horizontalPosition:"left",content:a.jsxs("div",{className:"w-full max-w-[257px]",children:[a.jsx("div",{className:"roboto-flex-25-400-1 text-[16px] leading-[20px] text-white whitespace-nowrap",children:h.client.defenseStrategy.circumstances.tooltips.CRIMINAL_CASE_OFFENSES}),a.jsx("div",{className:"flex flex-col gap-0.5 mt-3",children:M.map(W=>a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:W},`felony-article-${B}-${W}`))})]}),children:a.jsxs("div",{className:"flex flex-row items-center gap-1",children:[K.mainArticle||h.client.cases.placeholders.NOT_SPECIFIED,a.jsx("span",{className:"text-zinc-400",children:K.additionalCount>0?` +${K.additionalCount}`:""})]})})}),a.jsx("div",{className:"roboto-flex-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1",children:Q}),a.jsx("div",{className:"mt-2 flex items-start",children:a.jsx(ms,{onClick:()=>S({caseId:P,circumstance:k}),children:h.client.defenseStrategy.circumstances.SOURCE})})]}),a.jsx("div",{className:"flex flex-col gap-1 items-end",children:a.jsx("div",{className:Y("flex items-center justify-center h-5 roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase rounded-full px-1.5 mt-0.5 whitespace-nowrap border-2",!!O&&"text-emerald-600 border-emerald-600",!O&&"text-slate-600 border-slate-600"),children:O?h.client.defenseStrategy.circumstances.status.CONSIDERED:h.client.defenseStrategy.circumstances.status.NOT_CONSIDERED})})]},L)})}),a.jsxs("div",{ref:g,className:Y("flex items-center justify-center min-h-14",!!(c&&c.totalResults<=10)&&"hidden"),children:[!b&&a.jsx(ct,{}),b&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h?.client?.defenseStrategy?.circumstances?.messages?.EVERYTHING_SHOWN})]})]}):a.jsx("div",{className:"flex-1 min-h-40 w-full h-full flex items-center justify-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.messages.NO_RESULTS_BY_FILTERS})},ole=({clientId:e,aggregations:t=!1})=>{const n=Fe(),s=Ie(j=>j.selectedRegionIdsByClientIdByKey[e]?.["first-instance"]),r=Ie(j=>j.selectedPleaStatusesByClientIdByKey[e]?.["first-instance"]),i=Ie(j=>j.selectedConclusionArticlesByClientIdByKey[e]?.["first-instance"]),o=Ie(j=>
866j.selectedEpisodesByClientIdByKey[e]?.["first-instance"]),c=Ie(j=>j.selectedPunishmentTypesByClientIdByKey[e]?.["first-instance"]),u=Ie(j=>j.selectedDefenseRequestsResultsByClientIdByKey[e]?.["first-instance"]),d=Ie(j=>j.selectedGendersByClientIdByKey[e]?.["first-instance"]),p=Ie(j=>j.selectedCriminalStatusesByClientIdByKey[e]?.["first-instance"]),g=n.state?.circumstances,A=sn(j=>Object.prototype.hasOwnProperty.call(j.filtersByClientIdByInstance[e]??{},"first-instance")),E=(()=>{if(!(!i||!i.length))return i.map(j=>{try{const q=JSON.parse(j);return{number:q.article?q.article:void 0,part:q.part?q.part:void 0,clause:q.clause?q.clause:void 0,code_type:q.codeType?q.codeType:void 0}}catch{return}}).filter(Boolean)})(),x=s?.length?s.map(j=>parseInt(j,10)).filter(j=>!Number.isNaN(j)):void 0,y=r??void 0,I=y?y.join(","):void 0,v=y,S=u?.length?u:void 0,b=S?S.join(","):void 0,w=i?i.map(j=>{try{const q=JSON.parse(j);return`${q.codeType??""}:${q.article??""}:${q.part??""}:${q.clause??""}`}catch{return j}}).filter(Boolean).join(","):void 0,_=c&&c.length?c:void 0,N=_?_.join(","):void 0,R=o?.join(","),D=d&&d.length?d.join(","):void 0,k=p&&p.length?p.join(","):void 0,L=Qu({selectedEpisodeIds:o}),O=fa({queryKey:["defense-request","first-instance",e,x,I,b,w,N,R,g?[g.type??"",g.category??"",g.considerationType??""].join("|"):null,D,k],queryFn:j=>yf(e,{aggregations:t,articles:E??void 0,episodes:L,genders:d&&d.length?d:void 0,criminalStatuses:p&&p.length?p:void 0,searchAfter:j.pageParam?{searchAfterScore:j.pageParam[0],searchAfterId:j.pageParam[1]}:void 0,punishments:_??void 0,pleaStatuses:v??void 0,regions:x??void 0,defenseRequestsResults:S,circumstances:g??void 0}),enabled:!!e&&!!g&&A,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:null,getNextPageParam:j=>j?.nextSearchAfter??void 0}),P=O.data?.pages,B=P?.[0]?.episodes??null,F=P?.[0]?.aggregations,z=P?.[0]?.totalResults??0,Q={totalResults:z,searchAfter:P&&P?.length?P[P.length-1]?.nextSearchAfter:void 0},M=P?.flatMap(j=>j?.results??[])??[],K=(M??[]).flatMap(j=>{const q=j?._id??null,G=j?._source?.metadata_cui??null,$=j?._source?.metadata_region??null,J=j?._source?.file_id??null;return(j?._source?.circumstances??[]).flatMap(X=>{const oe=X?.related_accused_id??null;return(X?.related_circumstances??[]).map(ee=>({...ee,id:q,metadata_cui:G,metadata_region:$,file_id:J,related_accused_id:oe}))})}),W=bt(),H=l.useCallback(()=>{if(!e||!g||g.considerationType==="Принято во внимание")return;const j={...g,considerationType:"Принято во внимание"},q=[j.type??"",j.category??"",j.considerationType??""].join("|"),G=["defense-request","first-instance",e,x,I,b,w,N,R,D,k,q];W.getQueryState(G)||W.prefetchInfiniteQuery({queryKey:G,queryFn:()=>yf(e,{aggregations:t,articles:E??void 0,episodes:L,genders:d&&d.length?d:void 0,criminalStatuses:p&&p.length?p:void 0,punishments:_??void 0,pleaStatuses:v??void 0,regions:x??void 0,defenseRequestsResults:S,circumstances:j}),initialPageParam:null,staleTime:1e3*60*5,gcTime:1e3*60*10})},[W,e,g,t,E,L,_,v,x,S,I,b,w,N,R,d,p,D,k]);return l.useEffect(()=>{O.isSuccess&&H()},[O.isSuccess,H]),{...O,episodesData:B,aggregationsData:F,paginationData:Q,circumstancesFormatted:K,strategies:M,totalResults:z,fetchNextPage:O.fetchNextPage,isFetchingNextPage:O.isFetchingNextPage}},xw=()=>{const e=vs(),t=at(),n=Fe(),{id:s}=st(),r=n.state?.circumstances,i=n.state?.pageType??null,o=n.state?.notedTotal,c=n.state?.ignoredTotal,u=n.state?.isForceDefenseStrategyCircumstancesDetailedAnimateOnStart===!0,{clientData:d}=Zi(),p=kn(q=>q.catalogues?.articles),g=Ie(q=>q.selectedRegionIdsByClientIdByKey[s??""]?.["first-instance"]),A=Ie(q=>q.selectedConclusionArticlesByClientIdByKey[s??""]?.["first-instance"]),E=Ie(q=>q.selectedEpisodesByClientIdByKey[s??""]?.["first-instance"]),x=Ie(q=>q.selectedPunishmentTypesByClientIdByKey[s??""]?.["first-instance"]),y=Ie(q=>q.selectedDefenseRequestsResultsByClientIdByKey[s??""]?.["first-instance"]),I=Ie(q=>q.selectedGendersByClientIdByKey[s??""]?.["first-instance"]),v=Ie(q=>q.selectedCriminalStatusesByClientIdByKey[s??""]?.["first-instance"]),S=sn(q=>Object.prototype.hasOwnProperty.call(q.filtersByClientIdByInstance[s??""]??{},"first-instance")),b=l.useMemo(()=>r?r.considerationType==="Принято во внимание"?o??0:(o??0)+(c??0):0,[r,o,c]),w=l.useMemo(()=>
866Y("roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500"),[]),_=l.useMemo(()=>d?gc({episodes:d.episodes,articles:p}):[],[d,p]),N=l.useMemo(()=>{if(!E?.length)return a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER});const q=_.filter(G=>E.includes(G.value));return q.length?q.length>1?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:q[0].label}),a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",q.length-1]})})]}):a.jsx("div",{className:w,children:q[0].label}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.events.PLACEHOLDER})},[_,E,w]),R=l.useMemo(()=>{if(A?.length)try{const q=JSON.parse(A[0]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:et({part:q.part??"",number:q.article??"",clause:q.clause??"",codeType:q.codeType??""})}),A.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",A.length-1]})})]})}catch{return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:A[0]}),A.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",A.length-1]})})]})}return a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.articles.PLACEHOLDER})},[w,A]),D=a.jsx("div",{className:w,children:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE}),k=l.useMemo(()=>g?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:e[Number(g[0])]?.name??g[0]}),g.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",g.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.regions.PLACEHOLDER}),[w,g,e]),L=l.useMemo(()=>x?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:Vn(x[0])}),x.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",x.length-1]})})]}):null,[w,x]),O=l.useMemo(()=>y?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:y[0]}),y.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",y.length-1]})})]}):null,[w,y]),P=l.useMemo(()=>I?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:On(h.enums.genders,I[0],I[0])}),I.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",I.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.genders.PLACEHOLDER}),[w,I]),B=l.useMemo(()=>v?.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:w,children:On(h.enums.criminalStatuses,v[0],v[0])}),v.length>1&&a.jsx("div",{className:w,children:a.jsxs("div",{className:"text-zinc-500",children:["+",v.length-1]})})]}):a.jsx("div",{className:w,children:h.client.defenseStrategy.aggregations.criminalStatuses.PLACEHOLDER}),[w,v]),F=l.useCallback(()=>{s&&t(`/clients/${s}/defense-strategy/first-instance/circumstances${n.state?.pageType==="aggravating"?"/aggravating":""}`,{replace:!0,state:{isPreventScrollToTop:!0}})},[s,n.state,t]),{isLoading:z,circumstancesFormatted:Q,totalResults:M,paginationData:K,fetchNextPage:W,strategies:H}=ole({clientId:s??"",aggregations:!0}),j=l.useRef(null);return l.useEffect(()=>{if(!u)return;const q=n.state;if(!q)return;const G={...q};delete G.isForceDefenseStrategyCircumstancesDetailedAnimateOnStart;const $=window.history.state??{};window.history.replaceState({...$,usr:G},"",window.location.href)},[u,n.state]),a.jsx(Ws,{onClose:F,isForceAnimateOnStart:u,contentRef:j,children:a.jsxs("div",{className:"pb-8 flex flex-col justify-between h-full",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:N}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:R}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:D}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:k}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:P}),a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:B}),!!L&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:L}),!!O&&a.jsx("div",{className:"flex gap-1 items-center justify-start bg-zinc-50 px-1 h-5",children:O})]}),a.jsxs("div",{className:"mt-5 mb-1 flex align-center justify-between gap-16",children:[a.jsx("div",{className:"flex items-center justify-start",children:a.jsxs("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase ",children:[r?.category,r?.category&&r?.type?", ":"",r?.type,a.jsx("span",{className:"text-zinc-300",children:" · "}),a.jsxs("span",{className:"text-zinc-400",children:[b," ",qt({count:b,zero:h.client.defenseStrategy.circumstances.SIMILAR_CIRCUMSTANCES_ZERO,one
866:h.client.defenseStrategy.circumstances.SIMILAR_CIRCUMSTANCES_ONE,many:h.client.defenseStrategy.circumstances.SIMILAR_CIRCUMSTANCES_MANY})]})]})}),a.jsx(Je,{to:`/clients/${s}/defense-strategy/first-instance/circumstances`,state:{isPreventScrollToTop:!0,circumstances:{...r,considerationType:r?.considerationType==="Принято во внимание"?void 0:"Принято во внимание"},pageType:i,notedTotal:o,ignoredTotal:c},className:"flex items-center justify-center h-8 px-3 roboto-flex-25-700-1 min-w-[146px] text-[14px] leading-[16px] text-zinc-950 uppercase bg-zinc-100 hover:bg-zinc-200 rounded-full whitespace-nowrap shrink-0",children:r?.considerationType==="Принято во внимание"?h.client.defenseStrategy.circumstances.buttons.ALL:h.client.defenseStrategy.circumstances.buttons.ONLY_CONSIDERED})]}),a.jsx(ile,{isLoading:z||!S,circumstancesFormatted:Q,totalResults:M,clientId:s??"",circumstancesFromLocationState:r,pageTypeFromLocationState:i,notedTotal:o,ignoredTotal:c,paginationData:K,fetchNextPage:W,strategies:H})]})})},ale=()=>{const e=zt(),t=e?.clientData,n=e?.isSuccess,s=e?.mainWrapperRef;return t?a.jsx("div",{className:"flex flex-col flex-1",children:a.jsx(Xi,{context:{clientData:t,isSuccess:n,mainWrapperRef:s}})}):null},lle=({clientData:e,fabulaStatus:t,isFetching:n=!1})=>{const{status:s,setIsOpen:r,setObjectToFabulize:i}=wt({clientId:e?.id}),o=s==="pending"||s==="awaitingChoice"||t==="no_embeddings"||t==="no_fabula"&&(n||s==="autoCommitted"),c=l.useCallback(()=>{e?.id&&(r(!0),i({to:`/clients/${e.id}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}))},[r,i,e?.id]);return e?.id?a.jsxs("div",{className:Y("flex flex-1 bp48:flex-1 pb-0 bp48:pb-20 mt-0 flex-col items-center justify-start mx-4 bp48:mx-0 bp48:mt-35"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5 text-center",children:o?a.jsx(Aa,{children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING}):h.client.strategies.emptyPage.messages.FABULA_PROMPT}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:o?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bp56_25:inline",children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART1})," ",a.jsx("div",{className:"bp56_25:inline",children:h.client.strategies.emptyPage.messages.FABULA_ANALYZING_DESCRIPTION_PART2})]}):h.client.strategies.emptyPage.messages.FABULA_PROMPT_DESCRIPTION}),!o&&t==="no_fabula"&&a.jsxs("div",{className:"flex gap-3 mt-4 bp48:mt-8",children:[a.jsx(ut,{variant:"h16inverse",asChild:!0,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,children:h.client.strategies.emptyPage.buttons.TO_FABULA})}),a.jsx(ut,{variant:"h16",asChild:!0,onClick:c,children:a.jsx(Je,{to:`/clients/${e.id}/overview/fabula`,children:h.client.strategies.emptyPage.buttons.TO_FABULIZER})})]})]})]}):null},cle=rt(async function(t,n){const s=Se.getState().accessToken,r={};n?.isSaved!==void 0&&(r.isSaved=!!n.isSaved),n?.articles!=null&&(r.articles=n.articles),n?.evidence!=null&&(r.evidence=n.evidence),n?.circumstances!=null&&(r.circumstances=n.circumstances),n?.courts!=null&&(r.courts=n.courts),n?.episodes!=null&&(r.episodes=n.episodes),n?.searchAfter!=null&&(r.searchAfter=n.searchAfter),n?.limit!=null&&(r.limit=n.limit),n?.punishments!=null&&(r.punishments=n.punishments),n?.pleaStatuses!=null&&(r.pleaStatuses=n.pleaStatuses),n?.appealReviewResults!=null&&(r.appealReviewResults=n.appealReviewResults),n?.regions!=null&&(r.regions=n.regions),n?.defenseRequestsResults!=null&&(r.defenseRequestsResults=n.defenseRequestsResults),n?.defenseRequestsGoal!=null&&(r.defenseRequestsGoal=n.defenseRequestsGoal),n?.genders!=null&&(r.genders=n.genders),n?.criminalStatuses!=null&&(r.criminalStatuses=n.criminalStatuses),n?.firstInstanceVerdictResult!=null&&(r.firstInstanceVerdictResult=n.firstInstanceVerdictResult),n?.applicantCategory!=null&&(r.applicantCategory=n.applicantCategory),n?.appealGoals!=null&&(r.appealGoals=n.appealGoals);const i=Ke(`/clients/${t}/second-instance/strategies/`),o=await qe(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(r)}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};return c.data});function ule({clientData:e,aggregations:t}){const n=vs(),s=e?.id??"",r=Ie(ie=>ie.selectedRegionIdsByClientIdByKey[s]?.["second-instance"]),i=Ie(ie=>ie.selectedPleaStatusesByClientIdByKey[s]?.["second-instance"]),o=Ie(ie=>ie.selectedAppealReviewResultsByClientIdByKey[s]?.["second-instance"]),c=Ie(ie=>ie.selectedConclusionArticlesByClientIdByKey[s]?.["second-instance"]),u=Ie(ie=>
866ie.selectedEpisodesByClientIdByKey[s]?.["second-instance"]),d=Ie(ie=>ie.selectedAppealGoalsByClientIdByKey[s]?.["second-instance"]),p=Ie(ie=>ie.selectedGendersByClientIdByKey[s]?.["second-instance"]),g=Ie(ie=>ie.selectedCriminalStatusesByClientIdByKey[s]?.["second-instance"]),A=Ie(ie=>ie.selectedFirstInstanceVerdictResultByClientIdByKey[s]?.["second-instance"]),E=Ie(ie=>ie.selectedApplicantCategoriesByClientIdByKey[s]?.["second-instance"]),x=sn(ie=>Object.prototype.hasOwnProperty.call(ie.filtersByClientIdByInstance[s]??{},"second-instance")),y=(()=>{if(!(!c||!c.length))return c.map(ie=>{try{const ee=JSON.parse(ie);return{number:ee.article?ee.article:void 0,part:ee.part?ee.part:void 0,clause:ee.clause?ee.clause:void 0,code_type:ee.codeType?ee.codeType:void 0}}catch{return}}).filter(Boolean)})(),I=r&&r.length?r.map(ie=>parseInt(ie,10)).filter(ie=>!Number.isNaN(ie)):void 0,v=i??void 0,S=v?v.join(","):void 0,b=v,w=o??void 0,_=w?w.join(","):void 0,N=c?c.map(ie=>{try{const ee=JSON.parse(ie);return`${ee.codeType??""}:${ee.article??""}:${ee.part??""}:${ee.clause??""}`}catch{return ie}}).filter(ie=>!!ie).join(","):void 0,R=d&&d.length?d:void 0,D=R?R.join(","):void 0,k=p&&p.length?p.join(","):void 0,L=g&&g.length?g.join(","):void 0,O=A??void 0,P=E??void 0,B=u?.join(","),F=Qu({selectedEpisodeIds:u}),{data:z,isSuccess:Q,isFetching:M,fetchNextPage:K,hasNextPage:W,isFetchingNextPage:H}=fa({queryKey:["strategies","second-instance",s,I,S,N,D,B,k,L,O,P,_],queryFn:ie=>cle(s,{aggregations:t,articles:y??void 0,episodes:F,genders:p&&p.length?p:void 0,criminalStatuses:g&&g.length?g:void 0,firstInstanceVerdictResult:A??void 0,applicantCategory:E??void 0,searchAfter:ie.pageParam?{searchAfterScore:ie.pageParam[0],searchAfterId:ie.pageParam[1]}:void 0,appealGoals:R??void 0,pleaStatuses:b??void 0,appealReviewResults:w??void 0,regions:I??void 0}),enabled:!!s&&x,staleTime:1e3*60*5,refetchOnWindowFocus:!0,refetchOnMount:"always",initialPageParam:void 0,getNextPageParam:ie=>{if(ie?.nextSearchAfter&&ie.nextSearchAfter.length===2&&ie.nextSearchAfter[0]&&ie.nextSearchAfter[1])return ie.nextSearchAfter},refetchInterval:ie=>{const te=ie?.state?.data?.pages;if(!te?.length)return!1;const le=te?.[0]?.fabulaStatus??"ok";return le==="no_embeddings"?5e3:le==="no_fabula"?3e4:!1}}),j=z?.pages,q=j?.flatMap(ie=>ie?.results??[])??[],$={totalResults:j?.[0]?.totalResults??0,searchAfter:j?.[j.length-1]?.nextSearchAfter},J=j?.[0]?.aggregations??null,ne=j?.[0]?.episodes??null,X=j?.[0]?.fabulaStatus??"ok";return{strategiesFormatted:q.map(ie=>{const ee=ie?._id,te=ie?._source?.metadata_cui??h.client.cases.placeholders.NOT_SPECIFIED,le=ie?._source?.metadata_region??0,he=n[le]?.name??void 0,fe=`${h.client.cases.titles.CASE_CARD_TITLE} ${te}${he?` (${he})`:""}`,ue=ie?.inner_hits?.felony_hit?.hits?.hits?.[0],ye=typeof ue?._score=="number"?Math.round(ue._score*100):void 0,ce=ie?._source?.general_information?.is_modified??null;return{id:ee,title:fe,cui:te,score:ye,isModified:ce,data:ie}}
866),aggregationsData:J,episodesData:ne,paginationData:$,isSuccess:Q,isFetching:M,fabulaStatus:X,hasNextPage:W??!1,isFetchingNextPage:H??!1,fetchNextPage:K}}const dle=({isModified:e})=>l.useMemo(()=>{const n=h.client.defenseStrategy.filters.circle,s="roboto-flex-25-700-1 flex items-center justify-center rounded-full px-1 whitespace-nowrap h-5 text-[12px] leading-[14px] shrink-0 uppercase border border-2";return e===n.VERDICT_RESULT_CANCELED?a.jsx("div",{className:Y(s,"text-sky-600 border-sky-600"),children:n.VERDICT_CANCELED}):e===n.VERDICT_RESULT_CHANGED?a.jsx("div",{className:Y(s,"text-orange-600 border-orange-600"),children:n.VERDICT_CHANGED}):e===n.VERDICT_RESULT_UNCHANGED?a.jsx("div",{className:Y(s,"text-zinc-600 border-zinc-600"),children:n.VERDICT_UNCHANGED}):null},[e]),fle=({item:e,clientId:t})=>{const n=l.useMemo(()=>!!e.cui&&e.cui!==h.client.cases.placeholders.NOT_SPECIFIED,[e.cui]),s=l.useMemo(()=>{const i=(e.data?._source?.appeals??[]).find(g=>!!(g?.applicant_requests??[])[0]?.goal),o=i?.related_accused_id??null,c=i?.appeal_id??null,u=i?.applicant_requests?.[0]?.applicant_request_id??null,d=e.id!==null&&o&&c?`/clients/${t}/cases/second-instance/${e.id}/second-instance/complaints-and-submissions/${o}/${c}${u?`#${u}`:""}`:e.id!==null?`/clients/${t}/cases/second-instance/${e.id}/second-instance/complaints-and-submissions${u?`#${u}`:""}`:null,p=e.id!==null?{isFromDefenseStrategySecondInstancePage:!0,isForceCaseDetailedAnimateOnStart:!0}:null;return a.jsx(Ls,{text:h.client.cases.placeholders.GO_TO_CASE_CARD,isDisableOnTouch:!0,children:d!==null&&p!==null?a.jsx(Je,{to:d,state:p,className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 underline-offset-[25%] decoration-[2%] hover:underline",children:e.title}):a.jsx("span",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950 underline-offset-[25%] decoration-[2%] hover:underline",children:e.title})})},[e.id,e.data,e.title,t]);return a.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[a.jsx(Pm,{score:e.score,size:"12_20"}),a.jsxs("div",{className:"min-w-0 flex-1 flex items-center gap-1.5",children:[s,!!n&&a.jsx(Om,{text:e.cui,successMessage:h.client.cases.messages.COPY_CUI_SUCCESS,tooltipText:h.client.cases.placeholders.COPY_CUI,notifyKey:"COPY_CUI"})]})]})};function ple(e){return l.useMemo(()=>{const t=e.data?._source;if(!t?.conclusions)return[];const n=[];for(const s of t.conclusions){const r=s.verdicts??[];for(const i of r){const o=i.related_law?.law,c=o?.article?et({clause:o.clause,part:o.part,number:o.article}):"",u=Array.isArray(i.diff)?i.diff:i.diff!=null?[i.diff]:[];for(const g of u)typeof g=="string"&&g.trim()&&n.push({description:g.trim(),lawText:c});const d=i.additional_punishment??[];for(const g of d)g.was_added&&g.type?.trim()&&n.push({description:g.type.trim(),lawText:c});const p=i.reclassified_from;p?.reason?.trim()&&c&&n.push({description:p.reason.trim(),lawText:p.law?.article?et({clause:p.law.clause,part:p.law.part,number:p.law.article}):c})}}return n},[e.data])}const hle=({item:e})=>{const t=ple(e);return t.length?a.jsxs("div",{className:"mt-4",children:[a.jsx("h3",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.filters.casesWithArgumentsItem.APPEAL_CHANGES_TITLE}),a.jsx("div",{className:"mt-2 flex flex-col gap-1",children:t.map((n,s)=>a.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 bg-zinc-50 rounded-[8px]",children:[a.jsx("span",{className:"min-w-0 flex-1 break-words roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 pt-2 pb-2",children:n.description}),a.jsx("span",{className:"order-1 shrink-0 grow-0 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 text-right whitespace-nowrap pt-2 pb-2",children:n.lawText})]},s))})]}):null},mle=e=>e==null?[]:Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim()!=="").map(t=>t.trim()):typeof e=="string"&&e.trim()?[e.trim()]:[],gle=e=>l.useMemo(()=>{const t=e.data?._source;if(!t?.conclusions)return[];const n=[];for(const s of t.conclusions){const r=mle(s.final_sentencing?.diff);n.push(...r)}return n},[e.data]),Ale=({item:e})=>{const t=gle(e);return t.length?a.jsxs("div",{className:"mt-4",children:[a.jsx("h3",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.filters.casesWithArgumentsItem.FINAL_SENTENCING_DIFF_TITLE}),a.jsx("div",{className:"mt-2 flex flex-col gap-1",children:t.map((n,s)=>a.jsx("div",{className:"flex items-center gap-4 px-4 bg-zinc-50 rounded-[8px]",children:a.jsx("span",{className:"min-w-0 flex-1 wrap-break-word roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 pt-2 pb-2",children:n})}
866,s))})]}):null},Ele=["Довод отклонен судом","Довод признан несостоятельным (довод опровергнут)","Довод указан и не учтен судом"],xle="Довод указан и учтен не в полной мере",Cle="Довод нашел свое подтверждение",yle=({argument:e})=>{const t=l.useMemo(()=>{const s=e.result;if(s==null||s.trim()==="")return null;const r=s.trim();return Ele.includes(r)?a.jsx("span",{className:"w-5.5 h-5.5 flex shrink-0",children:a.jsx(Z7,{})}):r===xle?a.jsx("span",{className:"w-5.5 h-5.5 flex shrink-0",children:a.jsx(J7,{})}):r===Cle?a.jsx("span",{className:"w-5.5 h-5.5 flex shrink-0",children:a.jsx(X7,{})}):null},[e.result]),n=l.useMemo(()=>{const s=e.laws;return s?.length?s.map((r,i)=>a.jsxs(Oe.Fragment,{children:[i>0&&", ",a.jsx("span",{className:"whitespace-nowrap",children:et({clause:r.clause??"",part:r.part??"",number:r.article??"",codeType:r.code_type??""})})]},`${r.article??""}-${r.part??""}-${r.clause??""}-${i}`)):null},[e.laws]);return a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("div",{className:"flex gap-2",children:[t,a.jsx("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:e.description??""})]}),a.jsx("span",{className:"max-w-55 text-right roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:n})]})},ble=({request:e})=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 shrink-0",children:h.client.defenseStrategy.filters.casesWithArgumentsItem.REQUEST_GOAL_TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex-none order-1 flex-grow-0",children:e.goal??""})]}),a.jsxs("div",{className:"mt-3",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.filters.casesWithArgumentsItem.REQUEST_ARGUMENTS_TITLE}),a.jsx("div",{className:"mt-2 flex flex-col gap-1",children:(e.appeal_arguments??[]).map((t,n)=>a.jsx(yle,{argument:t},`${t.appeal_argument_id??"unknown"}-${n}`))})]})]}),Ile=({item:e})=>{const t=(()=>{const n=e.data?._source?.appeals??[],s=[];for(const r of n){const i=r.applicant_requests??[];for(const o of i)s.push(o)}return s})();return t.length?a.jsx("div",{className:"mt-6 flex flex-col gap-8",children:t.map((n,s)=>a.jsx(ble,{request:n},`${n.applicant_request_id??"unknown"}-${s}`))}):null},Sle=({item:e,clientId:t})=>{const n=at(),s=l.useMemo(()=>e.id,[e.id]),r=l.useMemo(()=>{const o=e.data?._source?.appeals?.[0]?.applicant_requests?.[0]?.appeal_arguments?.[0]?.quote;if(typeof o!="string")return[];const c=o.trim();return c?[c]:[]},[e.data]),i=l.useCallback(()=>{if(!s){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE,key:"SOURCE_FILE_NOT_AVAILABLE"});return}n(`/clients/${t}/cases/second-instance/${s}/second-instance/source`,{state:{isFromDefenseStrategySecondInstancePage:!0,isPreventScrollToTop:!0,isForceCaseSourceAnimateOnStart:!0,initialSearchTerms:r}})},[s,t,r,n]);return a.jsxs("div",{className:"block pt-6 bp56_25:pt-8 pb-6 border-b border-zinc-200 last:border-b-0",children:[a.jsxs("div",{className:"w-full flex items-center justify-between gap-3",children:[a.jsx(fle,{item:e,clientId:t}),a.jsx(dle,{isModified:e.isModified})]}),a.jsx(Ale,{item:e}),a.jsx(hle,{item:e}),a.jsx(Ile,{item:e}),a.jsx("div",{className:"mt-4",children:a.jsx(ms,{onClick:i,children:h.client.defenseStrategy.circumstances.SOURCE})})]})},vle=({handleResetFilters:e})=>a.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 pt-32 pb-42",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.defenseStrategy.messages.NO_RESULTS_BY_FILTERS}),a.jsx("div",{className:"h-8 flex items-center justify-center px-3 bg-zinc-100 rounded-full roboto-flex-25-700-1 text-[14px] leading-[16px] text-zinc-950 uppercase cursor-pointer hover:bg-zinc-200",onClick:e,children:"Сбросить все"})]}),_le=({strategiesFormatted:e,clientId:t,paginationData:n,isSuccess:s,fetchNextPage:r,handleResetFilters:i})=>{const o=l.useRef(null),c=l.useMemo(()=>{const u=n?.searchAfter;return!u||u.length!==2||!u[0]||!u[1]},[n?.searchAfter]);return l.useEffect(()=>{if(!o.current||!r||c)return;const u=new IntersectionObserver(d=>{d[0].isIntersecting&&r()},{root:null,rootMargin:"0px",threshold:.1});return u.observe(o.current),()=>u.disconnect()},[r,c]),s?e.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{children:e.map((u,d)=>a.jsx(Sle,{item:u,clientId:t},u.id??d))}),a.jsxs("div",{ref:o,className:"flex items-center justify-center min-h-14",children:[!c&&a.jsx(ct,{}),!!c&&a.jsx("div",{className:"roboto-flex-25-500-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.defenseStrategy.defenseRequestDataBlock?.EVERYTHING_SHOWN})]})]}):a.jsx(vle,{handleResetFilters:i}):a.jsx(ct,{isWithWrapper:!0,minHeight:90,delay:0,isNoPadding:!0})},Cw=({placeholder:e=h.inputs.dropdownWithSearch.ALL,value:t,isClearable:n=!0,isCloseOnScroll:s=!1,isError:r,options:i,onChange:o,label:c})=>{const[u,d]=l.useState(!1),p=Fe(),g=l.useRef(null),A=l.useRef(null),E=l.useRef([]),x=l.useCallback(O=>{g.current&&(g.current.contains(O.target)||d(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}),[x]),l.useEffect(()=>{if(!u)return;const O=g.current,P=A.current;if(!O||!P)return;const B=Ji(O,P,async()=>{const F=O.getBoundingClientRect(),z=Io({referenceTop:F.top,referenceBottom:F.bottom,floatingHeight:P.offsetHeight,viewportHe
866ight:window.innerHeight,gap:6,preferredDirection:"down"}),Q=await Ei(O,P,{placement:hc[z],strategy:"absolute",middleware:[_o(6),Ai({padding:16}),LI({apply({rects:W,elements:H}){Object.assign(H.floating.style,{width:`${W.reference.width}px`})}})]}),M=xi-F.top,K=Math.max(Q.y,M);Object.assign(P.style,{left:`${Q.x}px`,top:`${K}px`})});return()=>B()},[u]),l.useEffect(()=>{if(!u||!s)return;const O=performance.now(),P=()=>{performance.now()-O<fl||d(!1)},B=[],F=z=>{if(!z)return;const Q=z.parentElement;if(!Q)return;Q.scrollHeight>Q.clientHeight&&(Q.addEventListener("scroll",P,{passive:!0}),B.push(Q)),F(Q)};return F(g.current),window.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",P,{passive:!0}),B.push(window),E.current=B,()=>{E.current.forEach(z=>{if(z instanceof Window){z.removeEventListener("scroll",P),z.removeEventListener("resize",P);return}z.removeEventListener("scroll",P)}),E.current=[]}},[u,s]);const y=l.useMemo(()=>i.some(O=>!!O.to),[i]),I=l.useMemo(()=>n?[{value:"all",label:e,isPlaceholder:!0},...i]:i,[i,e,n]),v=l.useMemo(()=>{if(!y)return;const O=I.filter(F=>!F.isPlaceholder&&!!F.to);if(O.length===0)return;const P=O.find(F=>F.to===p.pathname);return P||O.reduce((F,z)=>!z.to||!p.pathname.startsWith(z.to)?F:F===void 0||F.to.length<z.to.length?z:F,void 0)},[y,I,p.pathname]),S=l.useMemo(()=>t!==void 0?!t&&n?"all":t:v?.value??(n?"all":null),[t,n,v]),b=l.useMemo(()=>{const O=I.filter(Q=>!!Q.isPlaceholder),P=I.filter(Q=>!Q.isPlaceholder),B=P.filter(Q=>Q.zone==="primary"),F=P.filter(Q=>Q.zone!=="primary"),z=B.length>0&&F.length>0;return[...O.map(Q=>({option:Q,isFollowedByZoneSeparator:!1})),...B.map((Q,M)=>({option:Q,isFollowedByZoneSeparator:z&&M===B.length-1})),...F.map(Q=>({option:Q,isFollowedByZoneSeparator:!1}))]},[I]),w=l.useCallback(()=>{d(O=>!O)},[]),_=l.useCallback(O=>{o?.(O.value),d(!1)},[o]),N=l.useCallback(O=>{O.stopPropagation(),o?.("all")},[o]),R=l.useCallback(({event:O,option:P})=>{P.value===v?.value&&O.preventDefault(),d(!1)},[v?.value]),D=l.useMemo(()=>u?a.jsx("div",{ref:A,className:"absolute flex flex-col max-h-82 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50 min-w-80",children:a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:b.map(({option:O,isFollowedByZoneSeparator:P})=>{const B=a.jsxs("div",{className:Y("flex items-start justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!O.isPlaceholder&&"text-zinc-950",!!O.isPlaceholder&&"text-zinc-500"),children:[O.label,O.value===S&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]}),F=O.to&&!O.isPlaceholder?a.jsx(Je,{to:O.to,state:O.state,end:!0,onClick:z=>R({event:z,option:O}),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer block"),children:B}):a.jsx("div",{onClick:()=>_(O),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer"),children:B});return a.jsxs(l.Fragment,{children:[F,!!P&&a.jsx("div",{"aria-hidden":!0,className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},O.value)})})})}):null,[u,S,b,_,R]),k=l.useMemo(()=>{const O="flex gap-1 items-center justify-between h-14 pl-1.5 pr-3 cursor-pointer rounded-[4px]";return r?Y(O,"bg-red-100","hover:bg-red-100"):Y(O,"bg-zinc-100","hover:bg-zinc-100")},[r]),L=l.useMemo(()=>Y("overflow-hidden text-ellipsis whitespace-nowrap","max-w-40 bp56_25:max-w-70 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950"),[]);return a.jsxs("div",{ref:g,className:"relative select-none",children:[a.jsxs("div",{className:k,onClick:w,children:[a.jsxs("div",{className:"flex flex-1 min-w-0 flex-col justify-center gap-0",children:[!!c&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500",children:c}),a.jsx("div",{className:L,children:I.find(O=>O.value===S)?.label??v?.label??e})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!!(n&&S&&S!=="all")&&a.jsx("button",{type:"button",onClick:N,className:"flex items-center justify-center p-0 border-0 bg-transparent cursor-pointer text-zinc-400 hover:text-zinc-600","aria-label":"Clear",children:a.jsx(c2,{className:"size-5"})}),a.jsx(al,{className:Y("size-5 text-zinc-400",u&&"rotate-180")}
866)]})]}),D]})},zy=({color:e,adjustedPercents:t,index:n})=>{const i=2*Math.PI*46,o=2,c=4/46*(180/Math.PI),u=o+c,d=l.useMemo(()=>t.every(D=>D===0),[t]),p=l.useMemo(()=>t.filter(D=>D>0).length,[t]),g=l.useMemo(()=>p!==1?-1:t.findIndex(D=>D===100),[p,t]),A=l.useMemo(()=>g!==-1&&n===g,[g,n]),E=l.useMemo(()=>d?0:g!==-1?A?100:0:t[n]??0,[t,n,d,g,A]),x=l.useMemo(()=>d?[]:g!==-1?[]:n===0?[]:t.slice(0,n),[t,n,d,g]),y=l.useMemo(()=>x.filter(D=>D>0).length,[x]),I=l.useMemo(()=>x.reduce((D,k)=>{if(k<=0)return D;const L=k/100*360,O=Math.max(0,L-u);return D+O},0),[x,u]),v=l.useMemo(()=>A||E<=0?0:I+y*u,[E,I,y,u,A]),S=l.useMemo(()=>{if(A)return 360;if(E<=0)return 0;const D=E/100*360;return Math.max(0,D-u)},[E,u,A]),b=l.useMemo(()=>S===0?0:S/360*i,[S,i]),w=l.useMemo(()=>A?"":`${b} ${i-b}`,[b,i,A]),_=l.useMemo(()=>A?"":`rotate(${v-90} 50 50)`,[v,A]),N=l.useMemo(()=>A?"butt":"round",[A]);return l.useMemo(()=>d?!1:g!==-1?A:E>0,[d,g,A,E])?a.jsx("svg",{className:"absolute inset-0 h-54 w-54",viewBox:"0 0 100 100",children:a.jsx("circle",{cx:"50",cy:"50",r:46,fill:"none",stroke:e,strokeWidth:4,strokeLinecap:N,strokeDasharray:w,transform:_})}):null},ro="Отменено",io="Изменено",oo="Оставлено без изменений",Qy=(e,t)=>e===0||t===0?0:e/t*100<1?"<1":Math.round(e/t*100),Tle=e=>{const t=e.reduce((x,y)=>x+y,0);if(t===0)return[0,0,0];const n=2,s=e.map(x=>x/t*100),r=s.map(x=>x>0);if(r.reduce((x,y)=>y?x+1:x,0)===0)return[0,0,0];const o=s.map((x,y)=>r[y]?Math.max(n,x):0),c=o.reduce((x,y)=>x+y,0),u=(()=>{if(c<=100){const b=100-c;if(b===0)return o;const w=s.reduce((_,N,R)=>r[R]?_+N:_,0);return w===0?o:o.map((_,N)=>r[N]?_+s[N]/w*b:_)}const x=s.map((b,w)=>r[w]?n:0),I=100-x.reduce((b,w)=>b+w,0);if(I<=0)return x;const v=s.map((b,w)=>r[w]?Math.max(0,b-n):0),S=v.reduce((b,w)=>b+w,0);return S===0?x:x.map((b,w)=>r[w]?b+v[w]/S*I:b)})(),d=u.map(x=>Math.floor(x)),g=100-d.reduce((x,y)=>x+y,0);if(g===0)return d;const E=u.map((x,y)=>({index:y,remainder:x-d[y]})).slice().sort((x,y)=>y.remainder-x.remainder).slice(0,g).map(x=>x.index);return d.map((x,y)=>E.includes(y)?x+1:x)},Nle=({appealReviewResultBuckets:e,selectedAppealReviewResults:t,handleChangeAppealReviewResult:n})=>{const s=h.client.defenseStrategy.filters.circle,r=l.useMemo(()=>[ro,io,oo],[]),i=l.useMemo(()=>t?.length?r.reduce((b,w)=>{const _={...b};return _[w]=t.includes(w),_},{}):{[ro]:!0,[io]:!0,[oo]:!0},[r,t]),o=l.useMemo(()=>r.reduce((w,_)=>i[_]?w+1:w,0)!==1?{[ro]:!1,[io]:!1,[oo]:!1}:r.reduce((w,_)=>{const N={...w};return N[_]=i[_]===!0,N},{}),[r,i]),c=l.useCallback(b=>{o[b]||n(b)},[n,o]),u=l.useMemo(()=>e.reduce((b,w)=>{const _=String(w.key??""),N=w.doc_count??0;return _===io?{...b,verdictChanged:b.verdictChanged+N}:_===ro?{...b,verdictCanceled:b.verdictCanceled+N}:_===oo?{...b,verdictUnchanged:b.verdictUnchanged+N}:b},{verdictChanged:0,verdictCanceled:0,verdictUnchanged:0}),[e]),d=u.verdictChanged+u.verdictCanceled+u.verdictUnchanged,p=(i[ro]?u.verdictCanceled:0)+(i[io]?u.verdictChanged:0)+(i[oo]?u.verdictUnchanged:0),g=fn({value:p}),A=fn({value:u.verdictChanged}),E=fn({value:u.verdictCanceled}),x=fn({value:u.verdictUnchanged}),y=Qy(u.verdictChanged,d),I=Qy(u.verdictCanceled,d),v=Qy(u.verdictUnchanged,d),S=l.useMemo(()=>Tle([u.verdictCanceled,u.verdictChanged,u.verdictUnchanged]),[u.verdictCanceled,u.verdictChanged,u.verdictUnchanged]);return a.jsxs("div",{className:"flex flex-col items-center justify-start h-auto mb-6",children:[a.jsxs("div",{className:"relative w-54 h-54 p-2 mb-6",children:[a.jsx("div",{className:"absolute inset-0 w-50 h-50 rounded-full border-[0.5px] border-zinc-200 left-2 top-2"}),a.jsx(zy,{color:i[ro]?"#0284C7":"#E4E4E7",adjustedPercents:S,index:0}),a.jsx(zy,{color:i[io]?"#EA580C":"#E4E4E7",adjustedPercents:S,index:1}),a.jsx(zy,{color:i[oo]?"#52525B":"#E4E4E7",adjustedPercents:S,index:2}),a.jsxs("div",{className:"relative flex flex-col items-center justify-start pt-11.75 w-50 h-50",children:[a.jsx($7,{className:"size-6 mb-0.5"}),a.jsx("div",{className:"flex items-center justify-center roboto-flex-25-600-1 text-[48px] leading-[48px] text-zinc-950",children:g}),a.jsx("div",{className:"flex flex-col items-center justify-center roboto-flex-100-400-1 text-[14px] leading-[16
866px] text-zinc-500 text-center",children:a.jsx("div",{children:h.client.defenseStrategy.filters.circle.APPEALS_LABEL})})]})]}),a.jsxs("div",{className:"flex flex-row gap-6",children:[a.jsxs("div",{className:Y("flex items-center justify-start",!o[ro]&&"cursor-pointer",!!o[ro]&&"cursor-default"),onClick:()=>c(ro),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!i[ro]&&a.jsx(lf,{className:"size-6 text-sky-600"}),!i[ro]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[s.VERDICT_CANCELED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:E}),a.jsx("span",{className:"text-zinc-400",children:" · "}),I,"%"]})]}),a.jsxs("div",{className:Y("flex items-center justify-start",!o[io]&&"cursor-pointer",!!o[io]&&"cursor-default"),onClick:()=>c(io),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!i[io]&&a.jsx(lf,{className:"size-6 text-orange-600"}),!i[io]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[s.VERDICT_CHANGED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:A}),a.jsx("span",{className:"text-zinc-400",children:" · "}),y,"%"]})]}),a.jsxs("div",{className:Y("flex items-center justify-start",!o[oo]&&"cursor-pointer",!!o[oo]&&"cursor-default"),onClick:()=>c(oo),children:[a.jsxs("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-2",children:[!!i[oo]&&a.jsx(lf,{className:"size-6 text-neutral-600"}),!i[oo]&&a.jsx("div",{className:"size-5 bg-zinc-200 rounded-full"})]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[30px] text-zinc-500",children:[s.VERDICT_UNCHANGED," ",a.jsx("span",{className:"roboto-flex-100-600-1 text-zinc-950",children:x}),a.jsx("span",{className:"text-zinc-400",children:" · "}),v,"%"]})]})]})]})},wle="true",Rle="false",Dle=({goalSuccess:e})=>{const t=e.find(u=>u.keyAsString===wle),n=e.find(u=>u.keyAsString===Rle),s=t?.docCount??0,r=n?.docCount??0,i=s+r,o=i?Math.round(s/i*100):0,c=100-o;return i?a.jsxs("div",{className:"w-[46.7%] shrink-0 flex items-center justify-start pr-2 gap-3",children:[a.jsxs("div",{className:"min-w-10 w-10 h-5 flex items-center justify-end roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:[o,"%"]}),a.jsx("div",{className:"flex-1 flex items-center min-w-0 relative h-5 px-1",children:a.jsxs("div",{className:"flex flex-1 h-2 gap-1",children:[!!s&&a.jsx("div",{className:"h-full bg-emerald-600 min-w-[2px] rounded-full shrink-0",style:{flex:`${o} 1 0%`}}),!!r&&a.jsx("div",{className:"h-full bg-zinc-600 min-w-[2px] rounded-full shrink-0",style:{flex:`${c} 1 0%`}})]})}),a.jsxs("div",{className:"min-w-10 w-10 h-5 flex items-center justify-start roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:[c,"%"]})]}):null},kle=({clientId:e,appealGoalsList:t,selectedPleaStatuses:n,isAppealGoalsFiltersFilled:s,handleResetAppealGoalsFilters:r,handleChangeAppealGoals:i})=>{const o=["Признал(-а) вину полностью","Признал(-а) вину частично","Не признал(-а) вину"],c=(()=>{const x=n??[];return x.length===0||x.length===o.length?o:x})(),u=t.map(x=>{const y=(x.pleaStatuses??[]).reduce((w,_)=>c.includes(_.key)?w+_.total:w,0),I=(x.pleaStatuses??[]).reduce((w,_)=>o.includes(_.key)?w+_.total:w,0),v=(x.pleaStatuses??[]).length>0,S=v?y:x.total,b=v?I:x.total;return{...x,total:S,sortingTotal:b}}).sort((x,y)=>{const I=x.total??x.total,v=y.total??y.total;return I===v?0:I>v?-1:1}),d=Ie(x=>x.selectedAppealGoalsByClientIdByKey[e]?.["second-instance"]),p=Ie(x=>x.setSelectedAppealGoals),g=l.useCallback(x=>{const y=d??[],v=y.includes(x)?y.filter(b=>b!==x):[...y,x],S=v.length?v:null;p({clientId:e,key:"second-instance",selectedAppealGoals:S}),i(S)},[e,d,p,i]),A=l.useMemo(()=>{if(!u.length)return{totalLength:1};const y=u[0]?.total??0;return{totalLength:(fn({value:y})||"0").length}},[u]),{totalLength:E}=A;return a.jsxs("div",{className:"w-full bp75:w-auto relative flex-1",children:[a.jsxs("div",{className:"flex items-center mb-0.5 h-8",children:[a.jsx("div",{className:"flex-1 min-w-0 pl-3 pr-4 flex items-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:h.client.defenseStrategy.filters.clearButtons.SELECT_HINT_APPEAL_GOALS}),a.jsxs("div",{className:"w-[46.7%] shrink-0 flex items-center justify-between pl-2 pr-3",children:[a.jsx("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-400",children:h.client.defenseStrategy.filters.clearButtons.SATISFIED_NOT_SATISFIED}),a.jsx(VA,{onClick:r,isFilled:s,label:h.client.defenseStrategy.filters.clearButtons.RESET})]})]}),u.map(x=>{const y=(d??[]).includes(x.key);return a.jsx("div",{className:Y("pb-0.5 pt-0.5 last:pb-0 first:pt-0 group cursor-pointer"),onClick:()=>g(x.key),children:a.jsxs("div",{className:Y("h-8 flex items-center bg-zinc-50 rounded-full group-hover:bg-zinc-100 border-2",!!y&&"border-zinc-950 rounded-full",!y&&"border-zinc-50 group-hover:border-zinc-100"),children:[a.jsxs("div",{className:"flex-1 min-w-0 flex items-center",children:[a.jsx("div",{className:"flex-1 min-w-0 pl-3 pr-4 overflow-hidden text-ellipsis whitespace-nowrap roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:Vn(x.key)}),a.jsx("div",{className:"pl-4.5 pr-2 shrink-0",children:a.jsx("span",{className:Y("roboto-flex-100-600-1 inline-block text-right tabular-nums",E===1&&"min-w-[9px]",E===2&&"min-w-[17.8px]",E===3&&"min-w-[26.6px]",E===4&&"min-w-[30.4px]",E===5&&"min-w-[39.2px]",E===6&&"min-w-[48px]",E===7&&"min-w-[56.8px]",E===8&&"min-w-[62.6px]",E>8&&"min-w-[71.4px]"),children:fn({value:x.total})})})]}),a.jsx(Dle,{goalSuccess:x.goalSuccess??[]})]})},x.key)})]})},an="second-instance",Ole="Отменено",Ple="Изменено",Lle="Оставлено без изменений",Mle=({clientData:e,mainWrapperRef:t,fabulaStatus:n,handleResetAllFilters:s,handleResetAppealGoalsFilters:r})=>{const i=vs(),o=Ie(se=>se.aggregationsDataByClientIdByKey[e.id]?.[an]),c=Ie(se=>se.selectedRegionIdsByClientIdByKey[e.id]?.[an]),u=Ie(se=>se.selectedConclusionArticlesByClientIdByKey[e.id]?.[an]),d=Ie(se=>
866se.selectedEpisodesByClientIdByKey[e.id]?.[an]),p=Ie(se=>se.setSelectedEpisodes),g=Ie(se=>se.setSelectedRegionIds),A=Ie(se=>se.setSelectedConclusionArticles),E=Ve(se=>se.setSelectedConclusionArticles),x=Ve(se=>se.setSelectedEpisodes),y=Ve(se=>se.setSelectedRegionIds),I=Ve(se=>se.setSelectedGenders),v=Ve(se=>se.setSelectedCriminalStatuses),S=Ie(se=>se.selectedGendersByClientIdByKey[e.id]?.[an]),b=Ie(se=>se.selectedCriminalStatusesByClientIdByKey[e.id]?.[an]),w=Ie(se=>se.setSelectedGenders),_=Ie(se=>se.setSelectedCriminalStatuses),N=Ie(se=>se.selectedFirstInstanceVerdictResultByClientIdByKey[e.id]?.[an]),R=Ie(se=>se.selectedApplicantCategoriesByClientIdByKey[e.id]?.[an]),D=Ie(se=>se.setSelectedFirstInstanceVerdictResult),k=Ie(se=>se.setSelectedApplicantCategories),L=Ie(se=>se.resetKey),{saveFilters:O}=mc(e.id,an),P=kn(se=>se.catalogues?.articles),B=l.useMemo(()=>gc({episodes:e.episodes,articles:P}),[e.episodes,P]),F=l.useMemo(()=>new Set(B.map(se=>se.value)),[B]),z=l.useMemo(()=>{if(!d?.length)return null;const se=[];for(const me of d)F.has(me)&&se.push(me);return se.length?se:null},[d,F]);l.useEffect(()=>{if(d?.length&&z?.length!==d.length){if(r(),!z?.length){p({clientId:e.id,key:an,selectedEpisodes:null}),x({clientId:e.id,key:an,selectedEpisodes:null}),O({episodes:hr(null)});return}p({clientId:e.id,key:an,selectedEpisodes:z}),x({clientId:e.id,key:an,selectedEpisodes:z}),O({episodes:hr(z)})}},[d,z,r,e.id,p,x,O]);const Q=Ie(se=>se.selectedAppealGoalsByClientIdByKey[e.id]?.[an]??null),M=Ie(se=>se.selectedPleaStatusesByClientIdByKey[e.id]?.[an]??null),K=Ie(se=>se.selectedAppealReviewResultsByClientIdByKey[e.id]?.[an]??null),W=Ie(se=>se.setSelectedAppealReviewResults),H=l.useCallback(se=>
866{if(r(),!se?.length){p({clientId:e.id,key:an,selectedEpisodes:null}),x({clientId:e.id,key:an,selectedEpisodes:null}),O({episodes:hr(null)}),ln({ref:t});return}p({clientId:e.id,key:an,selectedEpisodes:se}),x({clientId:e.id,key:an,selectedEpisodes:se}),O({episodes:hr(se)}),ln({ref:t})},[e.id,p,x,r,t,O]),j=l.useMemo(()=>{const se=(me,de)=>({label:et({part:me.part,number:me.article??""}),value:JSON.stringify({article:me.article??"",part:me.part??""}),zone:de});return[...(o?.cluster_article_nested??[]).map(me=>se(me,"primary")),...(o?.conclusions_article_nested??[]).map(me=>se(me,"secondary"))]},[o?.cluster_article_nested,o?.conclusions_article_nested]),q=l.useCallback(se=>{r();const me=se&&se.length?se:null;A({clientId:e.id,key:an,selectedConclusionArticles:me}),E({clientId:e.id,key:an,selectedConclusionArticles:me}),O({articles:rE(me)}),ln({ref:t})},[e.id,A,E,r,t,O]),G=o?.global_regions?.regions?.buckets,$=l.useMemo(()=>{const se=o?.global_genders?.genders_nested?.genders?.buckets??[];if(!se.length)return[];const me=h.enums.genders;return se.filter(de=>de.key!=null&&de.key!=="").map(de=>{const ge=String(de.key);return{label:On(me,ge,Vn(ge)),value:ge}})},[o]),J=l.useMemo(()=>{const se=o?.global_criminal_statuses?.criminal_statuses_nested?.criminal_statuses?.buckets??[];if(!se.length)return[];const me=h.enums.criminalStatuses;return se.filter(de=>de.key!=null&&de.key!=="").map(de=>{const ge=String(de.key);return{label:On(me,ge,Vn(ge)),value:ge}})},[o]),ne=l.useMemo(()=>{if(!G)return[];const se=G.reduce((me,de)=>{const ge=de.key;if(ge==null)return me;const Pe=String(ge),Ue=i[Number(ge)]?.name??Pe;return me.push({label:Ue,value:Pe}),me},[]);return iE(se)},[G,i]),X=l.useCallback(se=>{r();const me=se&&se.length?se:null;g({clientId:e.id,key:an,selectedRegionIds:me}),y({clientId:e.id,key:an,selectedRegionIds:me}),O({regions:me?me.map(Number):null}),ln({ref:t})},[e.id,g,y,r,t,O]),oe=l.useCallback(se=>{r();const me=se&&se.length?se:null;w({clientId:e.id,key:an,selectedGenders:me}),I({clientId:e.id,key:an,selectedGenders:me}),O({genders:me}),ln({ref:t})},[e.id,w,I,r,t,O]),ie=l.useCallback(se=>{r();const me=se&&se.length?se:null;_({clientId:e.id,key:an,selectedCriminalStatuses:me}),v({clientId:e.id,key:an,selectedCriminalStatuses:me}),O({criminalStatuses:me}),ln({ref:t})},[e.id,_,v,r,t,O]),ee=l.useMemo(()=>{const se=o?.first_instance_verdict_result_nested?.verdicts_nested?.by_verdict_result?.buckets??[];if(!se.length)return[];const me=h.enums.punishmentTypes;return se.filter(de=>de.key!=null&&de.key!=="").map(de=>{const ge=String(de.key);return{label:On(me,ge,Vn(ge)),value:ge}})},[o]),te=l.useMemo(()=>{const se=o?.applicant_category_nested?.buckets??[];return se.length?se.filter(me=>me.key!=null&&me.key!=="").map(me=>{const de=String(me.key);return{label:Vn(de),value:de}}):[]},[o]),le=l.useCallback(se=>{r();const me=se==="all"||!se?null:se;D({clientId:e.id,key:an,selectedFirstInstanceVerdictResult:me}),O({firstInstanceVerdictResult:me}),ln({ref:t})},[e.id,D,r,t,O]),he=l.useCallback(se=>{r();const me=se==="all"||!se?null:se;k({clientId:e.id,key:an,selectedApplicantCategories:me}),O({applicantCategory:me}),ln({ref:t})},[e.id,k,r,t,O]),fe=o?.appeal_goals_nested,ye=(fe?.requests_nested?.successful_requests_filter?.by_appeal_goal?.buckets??fe?.successful_requests_filter?.by_appeal_goal?.buckets??[]).map(se=>{const me=se.goal_success?.buckets??[],de=se.case_count_agg?.to_root?.case_count?.value??0;return{key:String(se.key??""),total:de,goalSuccess:me.map(ge=>({keyAsString:ge.key_as_string??String(ge.key??""),docCount:ge.doc_count??0}))}}),ce=o?.appeal_review_result_nested?.buckets??[],xe=l.useCallback(se=>{const me=[Ole,Ple,Lle];if(!me.includes(se))return;const de=K??null,ge=!de||de.length===0?me.filter(Be=>Be!==se):de.includes(se)?de.filter(Be=>Be!==se):[...de,se],Pe=ge.length===0||ge.length===3?null:ge;W({clientId:e.id,key:an,selectedAppealReviewResults:Pe}),O({appealReviewResults:Pe})},[e.id,K,W,O]),re=l.useMemo(()=>!!(z?.length||u?.length||c?.length||S?.length||b?.length||N||R),[z,u,c,S,b,N,R]),pe=l.useMemo(()=>!!M?.length,[M]),_e=l.useMemo(()=>!!K?.length,[K]),Le=l.useMemo(()=>!!Q?.length,[Q]),Ee=l.useCallback(se=>{O({appealGoals:se})},[O]);return["no_fabula","no_embeddings"].includes(n)||!o?null:a.jsxs("div",{className:Y("pb-3","bg-white","flex","flex-col","justify-between","space-x-1","px-4"),children:[a.jsxs("div",{className:"mb-6.5",children:[a.jsxs("div",{className:"flex justify-between items-center w-full",children:[a.jsxs("div",{className:"flex flex-wrap bp75:flex-nowrap bp75:items-start bp75:justify-start gap-x-4 bp75:gap-x-6 gap-y-1 bp75:gap-4",children:[a.jsx("div",{className:"shrink-0 bp75:w-fit w-full flex justify-between items-center bp75:mb-0 mb-2.5",children:a.jsx(vm,{isClearable:!1,value:"second-instance",options:[{label:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,value:"first-instance",to:`/clients/${e.id}/defense-strategy/first-instance`},{label:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,value:"second-instance",to:`/clients/${e.id}/defense-strategy/second-instance`}]})}),a.jsx("div",{className:"hidden bp75:block self-center w-0 h-4 border-r border-zinc-200 shrink-0"}),a.jsxs("div",{className:"flex flex-wrap bp75:flex-nowrap bp75:items-start bp75:justify-start gap-x-4 gap-y-1 bp75:gap-4",children:[a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.events.PLACEHOLDER,values:z,options:B,isCloseOnScroll:!0,onChange:H,resetKey:L}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.articles.PLACEHOLDER,values:u,options:j,isCloseOnScroll:!0,onChange:q,resetKey:L}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.regions.PLACEHOLDER,values:c,options:ne,isCloseOnScroll:!0,onChange:X,resetKey:L}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.genders.PLACEHOLDER,values:S,options:$,isCloseOnScroll:!0,onChange:oe,resetKey:L}),a.jsx(Dn,{placeholder:h.client.defenseStrategy.aggregations.criminalStatuses.PLACEHOLDER,values:b,options:J,isCloseOnScroll:!0,onChange:ie,resetKey:L})]})]}),a.jsx("div",{className:"bp75:block hidden",children:a.jsx(VA,{onClick:s,isFilled:re||pe||_e||Le,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]}),a.jsx("div",{className:"bp75:hidden mt-3 w-full flex justify-end",children:a.jsx(VA,{onClick:s,isFilled:re||pe||_e||Le,label:h.client.defenseStrategy.filters.clearButtons.RESET_ALL})})]}
866),a.jsxs("div",{className:"grid grid-cols-1 bp75:grid-cols-2 gap-x-4 gap-y-2 mb-16",children:[a.jsx("div",{className:"order-1 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-400 mb-3 bp75:mb-0 bp75:pb-2 bp75:row-start-1 bp75:col-start-1 min-w-0",children:h.client.defenseStrategy.aggregations.firstInstanceVerdictResult.DESCRIPTION}),a.jsx("div",{className:"order-2 bp75:order-none bp75:row-start-2 bp75:col-start-1 min-w-0",children:a.jsx(Cw,{label:h.client.defenseStrategy.aggregations.firstInstanceVerdictResult.LABEL,placeholder:h.client.defenseStrategy.aggregations.firstInstanceVerdictResult.LABEL,value:N??null,options:ee,onChange:le,isClearable:!0,isCloseOnScroll:!0})}),a.jsx("div",{className:"order-3 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-400 mb-3 bp75:mb-0 bp75:pb-2 bp75:row-start-1 bp75:col-start-2 min-w-0",children:h.client.defenseStrategy.aggregations.applicantCategory.DESCRIPTION}),a.jsx("div",{className:"order-4 bp75:order-none bp75:row-start-2 bp75:col-start-2 min-w-0",children:a.jsx(Cw,{label:h.client.defenseStrategy.aggregations.applicantCategory.LABEL,placeholder:h.client.defenseStrategy.aggregations.applicantCategory.LABEL,value:R??null,options:te,onChange:he,isClearable:!0,isCloseOnScroll:!0})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-between gap-0 mb-6",children:[a.jsx("h2",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-left tracking-[-0.01em] uppercase text-zinc-950 flex-none order-0 grow-0 mb-0 w-full",children:h.client.defenseStrategy.filters.circle.TITLE}),a.jsx(Nle,{appealReviewResultBuckets:ce,selectedAppealReviewResults:K,handleChangeAppealReviewResult:xe})]}),a.jsxs("div",{className:"flex flex-col items-center justify-between gap-0 mb-1",children:[a.jsx("h2",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 flex-none order-0 grow-0 mb-0 w-full",children:h.client.defenseStrategy.filters.results.SECTION_TITLE}),a.jsx("div",{className:"mt-4 w-full",children:a.jsx(kle,{clientId:e.id,appealGoalsList:ye.map(se=>({key:se.key,total:se.total,pleaStatuses:[],goalSuccess:se.goalSuccess,type:"appealGoal"})),selectedPleaStatuses:null,isAppealGoalsFiltersFilled:Le,handleResetAppealGoalsFilters:r,handleChangeAppealGoals:Ee})})]})]})},ws="second-instance",yw=()=>{const e=l.useRef(!1),t=zt(),n=t?.clientData,s=t?.mainWrapperRef,r=Ie(j=>j.setAggregationsData),i=Ie(j=>j.setEpisodesData),o=Ie(j=>j.setTotalResults),c=Ie(j=>j.setSelectedAppealGoals),u=Ie(j=>j.setSelectedEpisodes),d=Ie(j=>j.setSelectedRegionIds),p=Ie(j=>j.setSelectedConclusionArticles),g=Ie(j=>j.setSelectedPleaStatuses),A=Ie(j=>j.setSelectedAppealReviewResults),E=Ie(j=>j.setSelectedGenders),x=Ie(j=>j.setSelectedCriminalStatuses),y=Ie(j=>j.setSelectedFirstInstanceVerdictResult),I=Ie(j=>j.setSelectedApplicantCategories),v=Ie(j=>j.setResetKey),S=Ve(j=>j.setSelectedEpisodes),b=Ve(j=>j.setSelectedConclusionArticles),w=Ve(j=>j.setSelectedRegionIds),_=Ve(j=>j.setSelectedGenders),N=Ve(j=>j.setSelectedCriminalStatuses),{saveFilters:R}=mc(n?.id??"",ws),D=sn(j=>Object.prototype.hasOwnProperty.call(j.filtersByClientIdByInstance[n?.id??""]??{},"second-instance")),{aggregationsData:k,episodesData:L,paginationData:O,strategiesFormatted:P,isSuccess:B,isFetching:F,fabulaStatus:z,fetchNextPage:Q}=ule({clientData:n,aggregations:!1});l.useEffect(()=>{B&&(e.current||(e.current=!0))},[B]),l.useEffect(()=>{n?.id&&B&&(r({clientId:n.id,key:ws,data:k}),i({clientId:n.id,key:ws,data:L}),o({clientId:n.id,key:ws,totalResults:O.totalResults}))},[n?.id,k,L,B,O.totalResults,O.searchAfter,r,i,o]);const M=l.useCallback(()=>{c({clientId:n.id,key:ws,selectedAppealGoals:null})},[n?.id,c]),K=l.useCallback(()=>{u({clientId:n.id,key:ws,selectedEpisodes:null}),p({clientId:n.id,key:ws,selectedConclusionArticles:null}),d({clientId:n.id,key:ws,selectedRegionIds:null}),g({clientId:n.id,key:ws,selectedPleaStatuses:null}),A({clientId:n.id,key:ws,selectedAppealReviewResults:null}),E({clientId:n.id,key:ws,selectedGenders:null}),x({clientId:n.id,key:ws,selectedCriminalStatuses:null}),y({clientId:n.id,key:ws,selectedFirstInstanceVerdictResult:null}),I({clientId:n.id,key:ws,selectedApplicantCategories:null}),S({clientId:n.id,key:ws,selectedEpisodes:null}),b({clientId:n.id,key:ws,selectedConclusionArticles:null}),w({clientId:n.id,key:ws,selectedRegionIds:null}),_({clientId:n.id,key:ws,selectedGenders:null}),N({clientId:n.id,key:ws,selectedCriminalStatuses:null}),R({episodes:null,articles:null,regions:null,genders:null,criminalStatuses:null,firstInstanceVerdictResult:null,applicantCategory:null,appealReviewResults:null}),M(),v(j=>j+1)},[n?.id,u,p,d,g,A,E,x,y,I,S,b,w,_,N,R,M,v]),W=l.useMemo(()=>a.jsx("div",{className:"px-4 pb-2 mt-6 bp48:mt-4 pt-0 bp48:pt-2 sticky top-[3.5rem] z-12 bg-white",children:a.jsx("h2",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-left tracking-[-0.01em] uppercase text-zinc-950",children:h.client.defenseStrategy.filters.results.CASES_WITH_ARGUMENTS_TITLE})}),[]),H=l.useMemo(()=>a.jsx("div",{className:"px-4",children:a.jsx(_le,{strategiesFormatted:P,clientId:n?.id??"",paginationData:O,isSuccess:B,fetchNextPage:Q,handleResetFilters:K})}),[n?.id,K,P,O,B,Q]);return!D||!e.current&&!B?a.jsx(ct,{isWithWrapper:!0}):z==="no_fabula"||z==="no_embeddings"?a.jsx(lle,{clientData:n,fabulaStatus:z,is
866Fetching:F}):a.jsxs(a.Fragment,{children:[a.jsx(Mle,{clientData:n,fabulaStatus:z,mainWrapperRef:s,handleResetAllFilters:K,handleResetAppealGoalsFilters:M}),W,H]})},jle=e=>l.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M9.37305 9.37256L54.6279 54.6274",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"}),l.createElement("path",{d:"M9.37305 54.6274L54.6279 9.37261",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),Ble=e=>{l.useEffect(()=>{if(!e)return;const t=window.scrollY;return document.body.style.position="fixed",document.body.style.top=`-${t}px`,document.body.style.width="100%",document.body.style.overflow="hidden",()=>{document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflow="",window.scrollTo(0,t)}},[e])},eP=l.forwardRef(({onClose:e,children:t,isForceAnimateOnStart:n,contentRef:s},r)=>{const i=ck(),o=n??i==="PUSH",[c,u]=l.useState(!o),d=l.useRef(null);l.useEffect(()=>{o&&requestAnimationFrame(()=>u(!0))},[o]);const p=l.useCallback(()=>{if(!c){e();return}u(!1)},[c,e]);l.useImperativeHandle(r,()=>({close:p}),[p]);const g=l.useCallback(()=>{c||e()},[c,e]);return l.useEffect(()=>{const A=d.current;if(A)return A.addEventListener("transitionend",g),()=>{A.removeEventListener("transitionend",g)}},[g]),Ble(c),a.jsxs("div",{className:Y("fixed","overflow-hidden","flex","flex-col","justify-between","items-stretch","top-0","left-0","w-full","h-full","min-w-[var(--breakpoint-bp23_25)]","z-20"),children:[a.jsx("div",{className:Y("cursor-pointer","absolute","top-0","left-0","w-full","h-full","bg-black","z-20","transition-opacity","duration-200","ease-out",!!c&&"opacity-95",!c&&"opacity-0"),onClick:p}),a.jsx("div",{className:Y("relative","cursor-pointer","z-21","flex","justify-end","items-center","group","transition-opacity","duration-200","ease-out","min-h-[64px]","px-[16px]",!!c&&"opacity-95",!c&&"opacity-0","bp50:min-h-[67.2px]","bp50:px-3","bp62_5:min-h-[84px]","bp62_5:px-[15px]","bp81_5:min-h-28","bp81_5:px-5"),onClick:p,children:a.jsx(jle,{className:Y("text-white","text-zinc-600","group-hover:text-zinc-500","h-8","w-8","bp50:block","bp50:h-[38.4px]","bp50:w-[38.4px]","bp62_5:h-[44.8px]","bp62_5:w-[44.8px]","bp81_5:h-16","bp81_5:w-16")})}),a.jsxs("div",{ref:d,className:Y("relative","z-21","flex-1","flex","flex-col","justify-start","items-stretch","bg-zinc-900","rounded-tl-[24px]","rounded-tr-[24px]","transition-transform","duration-200","ease-out","overflow-y-hidden",!!c&&"translate-y-0",!c&&"translate-y-full","bp50:rounded-tl-[28.8px]","bp50:rounded-tr-[28.8px]","bp62_5:rounded-tl-[36px]","bp62_5:rounded-tr-[36px]","bp81_5:rounded-tl-[48px]","bp81_5:rounded-tr-[48px]"),children:[a.jsx("div",{className:Y("min-h-0","bp50:min-h-[28.8px]","bp62_5:m
866in-h-[36px]","bp81_5:min-h-12")}),a.jsx("div",{className:Y("flex","flex-col","flex-1","overflow-y-auto","bp50:w-full","bp50:mx-auto","bp50:px-[9.6px]","bp62_5:w-full","bp62_5:mx-auto","bp62_5:px-3","bp81_5:w-full","bp81_5:mx-auto","bp81_5:px-4"),ref:s,children:a.jsx("div",{className:Y("bp50:max-w-auto","bp50:mx-auto","bp50:px-[9.6px]","bp62_5:max-w-auto","bp62_5:mx-auto","bp62_5:px-3","bp81_5:max-w-360","bp81_5:mx-auto","bp81_5:px-4"),children:t})})]})]})}),Fle=()=>{const e=l.useRef(null),t=at(),s=Fe().state?.newsItem,r=s?.date,i=s?.title,o=s?.text,c=s?.link,u=s?.imageUrl,d=l.useCallback(()=>{t("/",{state:{isPreventScrollToTop:!0}})},[t]);return a.jsx(eP,{onClose:d,isForceAnimateOnStart:!0,contentRef:e,children:a.jsxs("div",{className:Y("pb-8","bp50:pb-[4.8rem]","bp62_5:pb-6","bp81_5:pb-8"),children:[a.jsx("div",{className:Y("pointer-events-none","w-full","h-auto","pb-[56%]","rounded-[24px]","bp50:w-[374.4px]","bp50:h-[258px]","bp50:rounded-[28.8px]","bp50:pb-0","bp62_5:w-[468px]","bp62_5:h-[322px]","bp62_5:rounded-[36px]","bp62_5:pb-0","bp81_5:w-[624px]","bp81_5:h-[430px]","bp81_5:rounded-[48px]","bp81_5:pb-0"),style:{backgroundImage:`url(${u})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center center"}}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","mt-4","text-[18px]","leading-[22px]","px-4","bp50:mt-[28.8px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:px-0","bp62_5:mt-9","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:px-0","bp81_5:mt-12","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:px-0"),children:_r({dateString:r,isWithTime:!1})}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-100","mt-3","text-[18px]","leading-[22px]","px-4","bp50:mt-[14.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:px-0","bp62_5:mt-[18px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:px-0","bp81_5:mt-6","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:px-0"),children:i}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","mt-3","text-[18px]","leading-[22px]","px-4","bp50:mt-[14.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:px-0","bp62_5:mt-[18px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:px-0","bp81_5:mt-6","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:px-0"),children:o}),a.jsx("div",{className:Y("flex","items-center","justify-end","mt-3","px-4","bp50:mt-[14.4px]","bp50:px-0","bp62_5:mt-[18px]","bp62_5:px-0","bp81_5:mt-6","bp81_5:px-0"),children:a.jsxs(Hs,{to:c,target:"_blank",className:Y("group/newsLink","roboto-flex-112-500-0","text-[#556FD5]","hover:text-[#708DFE]","text-[18px]","leading-[22px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:["К новости",a.jsx(OO,{className:Y("inline-block","translate-y-[-1px]","text-[#556FD5]","group-hover/newsLink:text-[#708DFE]","ml-2","w-4","h-4","bp50:ml-[4.8px]","bp50:w-[16.8px]","bp50:h-[16.8px]","bp62_5:ml-1.5","bp62_5:w-[21px]","bp62_5:h-[21px]","bp81_5:ml-2","bp81_5:w-7","bp81_5:h-7")})]})})]})})},Ule=()=>{const e=l.useRef(null),t=at(),s=Fe().state?.testimonialItem,r=s?.summary,i=s?.name,o=s?.text,c=l.useCallback(()=>{t("/",{state:{isPreventScrollToTop:!0}})},[t]);return a.jsxs(eP,{onClose:c,isForceAnimateOnStart:!0,contentRef:e,children:[a.jsxs("div",{className:Y("pt-6","px-4","roboto-flex-112-500-0","text-[#556FD5]","text-[18px]","leading-[22px]","bp50:pt-0","bp50:px-0","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp62_5:pt-0","bp62_5:px-0","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp81_5:pt-0","bp81_5:px-0","bp81_5:text-[32px]","bp81_5:leading-[36px]"),children:[a.jsx(jO,{className:Y("inline-block","translate-y-[-3px]","text-[#556FD5]","mr-3","w-4","h-4","bp50:mr-[7.2px]","bp50:w-[16.8px]","bp50:h-[16.8px]","bp62_5:mr-[9px]","bp62_5:w-[21px]","bp62_5:h-[21px]","bp81_5:mr-3","bp81_5:w-7","bp81_5:h-7")}),r]}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-100","mt-3","text-[18px]","leading-[22px]","px-4","bp50:mt-[14.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:px-0","bp62_5:mt-[18px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:px-0","bp81_5:mt-6","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:px-0"),children:i}),a.jsx("div",{className:Y("roboto-flex-112-500-0","text-zinc-500","overflow-hidden","flex-1","mt-3","px-4","text-[18px]","leading-[22px]","bp50:mt-[14.4px]","bp50:text-[19.2px]","bp50:leading-[21.6px]","bp50:px-0","bp62_5:mt-[18px]","bp62_5:text-[24px]","bp62_5:leading-[27px]","bp62_5:px-0","bp81_5:mt-6","bp81_5:text-[32px]","bp81_5:leading-[36px]","bp81_5:px-0"),children:o})]})},zle=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_564_1130)"},l.createElement("path",{d:"M12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14Z",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M22 12C19.333 16.667 16 19 12 19C8 19 4.667 16.66
8667 2 12C4.667 7.333 8 5 12 5C16 5 19.333 7.333 22 12Z",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_564_1130"},l.createElement("rect",{width:24,height:24,fill:"white"})))),Qle=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_564_1134)"},l.createElement("path",{d:"M3 3L21 21",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10.584 10.587C10.2087 10.962 9.99775 11.4707 9.99756 12.0013C9.99737 12.5318 10.2079 13.0407 10.583 13.416C10.958 13.7913 11.4667 14.0022 11.9973 14.0024C12.5278 14.0026 13.0367 13.792 13.412 13.417",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.363 5.365C10.2204 5.11972 11.1082 4.99684 12 5C16 5 19.333 7.333 22 12C21.222 13.361 20.388 14.524 19.497 15.488M17.357 17.349C15.726 18.449 13.942 19 12 19C8 19 4.667 16.667 2 12C3.369 9.605 4.913 7.825 6.632 6.659",stroke:"#A1A1AA",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_564_1134"},l.createElement("rect",{width:24,height:24,fill:"white"})))),hi=l.forwardRef(({isError:e,errorText:t,handleChange:n,handleSetAutoCompleted:s,handleBlur:r,handleFocus:i,...o},c)=>{const u=l.useRef(null);l.useImperativeHandle(c,()=>u.current,[]);const[d,p]=l.useState({hasBeenSet:!1,isSet:!1}),[g,A]=l.useState(!1),E=l.useCallback(()=>{p(w=>({hasBeenSet:!!w.hasBeenSet||!!w.isSet,isSet:!0}))},[]);l.useEffect(()=>{const w=u.current;return w&&w.addEventListener("animationstart",E),()=>{w&&w.removeEventListener("animationstart",E)}},[u,E]);const x=l.useMemo(()=>!(!d.isSet||d.hasBeenSet),[d.isSet,d.hasBeenSet]);l.useEffect(()=>{if(s){if(!d.isSet){s(!1);return}if(d.hasBeenSet){s(!1);return}s(!0)}},[d.isSet,d.hasBeenSet,s]);const y=l.useCallback(()=>{A(w=>!w)},[]),I=l.useMemo(()=>({...o,placeholder:void 0,disabled:!!o.disabled,type:g?"text":o.type}),[g,o]),v=l.useCallback(w=>{n&&(w.target.value||p(_=>({hasBeenSet:!!_.hasBeenSet||!!_.isSet,isSet:!1})),n(w.target.value))},[n]),S=l.useCallback(w=>{r&&r(w)},[r]),b=l.useCallback(w=>{i&&i(w)},[i]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative w-full group",children:[a.jsx("div",{className:"relative w-full border-0",children:a.jsx("input",{ref:u,"data-slot":"input",className:Y("file:text-foreground placeholder:text-muted-foreground flex min-w-0 outline-none focus:ring-0 focus:shadow-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 password-clean pb-2 pl-4 rounded-lg roboto-flex-100-400-1 text-base leading-5 text-zinc-950 h-14 w-full",!o.value&&!x&&"pt-2 group-focus-within:pt-7 transition-[padding] duration-50",!(!o.value&&!x)&&"pt-7 transition-[color,box-shadow]",o.type==="password"&&"pr-12",o.type!=="password"&&"pr-2",!e&&"bg-zinc-100",!!e&&"bg-red-50"),onChange:v,onBlur:S,onFocus:b,...I})}),!!o.placeholder&&a.jsx("div",{className:Y("top-0 left-0 pr-2 pl-4 pt-2 w-full h-full absolute roboto-flex-100-400-1 text-zinc-500 flex items-center pointer-events-none leading-[20px] select-none",!!(o.value||x)&&"pb-7 text-[14px]",!o.value&&!x&&"pb-2 text-[16px] group-focus-within:pb-7 group-focus-within:text-[14px] transition-[padding,font-size] duration-50"),children:o.placeholder}),a.jsx("div",{className:Y("absolute inset-y-0 right-0 flex h-14 [&>div]:w-12 [&>div]:h-14 [&>div]:flex [&>div]:items-center [&>div]:justify-center items-center justify-right text-zinc-400 hover:text-zinc-500",!o.value&&!x&&"transition-opacity duration-100 group-focus-within:opacity-100 group-focus-within:transition-none group-hover:opacity-100 group-hover:transition-none opacity-0"),children:o.type==="password"&&a.jsx("div",{className:"cursor-pointer select-none",onClick:y,children:g?a.jsx(Qle,{className:"w-5 h-5"}):a.jsx(zle,{className:"w-5 h-5"})})})]}),!!(e&&t)&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16
866px] text-red-600 mt-1 ml-0.25",children:t})]})}),Hle=l.forwardRef(({className:e,placeholder:t,isError:n,handleChange:s,errorText:r,value:i,minRows:o=5,maxRows:c=10,...u},d)=>{const[p,g]=l.useState(0),A=l.useRef(null),E=l.useRef(null);l.useImperativeHandle(d,()=>E.current);const x=Math.max(o,c),y=l.useCallback(()=>{const v=20*o+24,S=A.current;if(!S)return v;const b=S.clientHeight;if(b<v)return v;if(x!==void 0){const w=20*x+24;if(b>w)return w}return b},[o,x]);l.useLayoutEffect(()=>{g(y())},[y,i]),l.useEffect(()=>{const v=()=>g(y()),S=A.current,b=typeof window<"u"&&"ResizeObserver"in window;if(!S||!b){const _=()=>v();return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}const w=new ResizeObserver(()=>v());return w.observe(S),()=>w.disconnect()},[y]);const I=l.useCallback(v=>{s&&s(v.target.value)},[s]);return a.jsxs("div",{className:Y("rounded-lg","overflow-hidden"),children:[a.jsxs("div",{className:"relative w-full",children:[a.jsx("div",{className:"absolute inset-x-0 top-0 invisible pointer-events-none",children:a.jsxs("div",{ref:A,className:"whitespace-pre-wrap break-words roboto-flex-100-400-1 text-[16px] leading-[20px] py-3 px-4 w-full box-border",children:[i," "]})}),a.jsx("textarea",{style:{height:p},ref:E,className:Y("block placeholder:text-muted-foreground roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 h-25 py-3 px-4 w-full resize-none outline-none focus:ring-0 focus:shadow-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 autofill-neutralize","scrollbar-custom",!n&&"bg-zinc-100",!!n&&"bg-red-50",e),placeholder:t,onChange:I,value:i,...u})]}),!!(n&&r)&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-red-600 mt-1 ml-0.25",children:r})]})}),Vle=({isOpen:e,onClose:t})=>{const n=l.useRef(null),s=h.structuredPages.newClient.help;return e?a.jsx(Ws,{onClose:t,isForceAnimateOnStart:!0,isMaxWidthDisabled:!0,contentRef:n,children:a.jsx(q7,{title:s.title,sections:s.sections,scrollContainerRef:n})}):null},Gle=()=>{vv({meta:[{name:"viewport",content:"width=800, user-scalable=no"}]});const e=l.useRef(null),[t,n]=l.useState(""),[s,r]=l.useState(""),[i,o]=l.useState(""),[c,u]=l.useState(""),[d,p]=l.useState(!1),[g,A]=l.useState(""),[E,{height:x}]=Yh(),[y,I]=l.useState(1),[v,S]=l.useState(!1),b=bt(),_=Fe().state?.isFromArchived??!1,N=at(),R=l.useRef(null),{mutate:D}=tt({mutationFn:pte,onMutate:()=>{p(!0),e.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"ADD_CLIENT_SLOW",duration:0})},3e3)},onSuccess:(M,K)=>{if(e.current&&clearTimeout(e.current),Ze("ADD_CLIENT_SLOW"),b.invalidateQueries({queryKey:["clientsList"]}),!M?.id){p(!1),N(`/clients${_?"/archived":""}`,{state:{isPreventScrollToTop:!0}});return}if(K.prompt){k({clientId:M.id,text:K.prompt,resourceType:os,isAutoCommit:!0});return}N(`/clients/${M.id}`,{state:{isPreventScrollToTop:!0}})},onError:M=>{if(e.current&&clearTimeout(e.current),Ze("ADD_CLIENT_SLOW"),p(!1),M.code==="VALIDATION_ERROR"){ve({type:"failed",message:h.client.newClient.errors.VALIDATION_ERROR,key:"ADD_CLIENT_LAST_NAME_REQUIRED"}),L(M);return}ve({type:"failed",message:h.client.newClient.errors.UNKNOWN_ERROR,key:"ADD_CLIENT_FAILED"})}}),{mutate:k}=tt({mutationFn:oE,onMutate:()=>{e.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:"ADD_CLIENT_SLOW",duration:0})},3e3)},onSuccess:(M,K)=>{e.current&&clearTimeout(e.current),Ze("ADD_CLIENT_SLOW"),p(!1),N(`/clients/${K.clientId}/overview/fabula`,{state:{isPreventScrollToTop:!0}})},onError:(M,K)=>{e.current&&clearTimeout(e.current),Ze("ADD_CLIENT_SLOW"),ve({type:"failed",message:h.client.fabulizer.errors.START_FAILED,key:"FABULIZER_START_FAILED"}),p(!1),N(`/clients/${K.clientId}`,{state:{isPreventScrollToTop:!0}})}}),L=l.useCallback(M=>{if(!M?.fields)return;const K=M.fields.find(j=>!(!Array.isArray(j.field)||j.field.length!==3||j.field[0]!=="body"||j.field[1]!=="clientInfo"||j.field[2]!=="lastName"));if(!K?.code)return;const W=K.code,H=h.client.newClient.fieldsErrors.lastName?.[W]??"";H&&u(H)},[]),O=l.useCallback(M=>{n(M),u("")},[]),P=l.useCallback(()=>{N(`/clients${_?"/archived":""}`,{state:{isPreventScrollToTop:!0}})},[N,_]),B=l.useCallback(M=>{M.preventDefault(),M.stopPropagation(),R.current?.close&&R.current?.close()},[R]),F=l.useCallback(()=>{S(!0)},[]),z=l.useCallback(()=>{S(!1)},[]),Q=l.useCallback(M=>{if(M.preventDefault(),M.stopPropagation(),!t){ve({type:"failed",message:h.client.newClient.errors.VALIDATION_ERROR,key:"ADD_CLIENT_LAST_NAME_REQUIRED"}),u(h.client.newClient.fieldsErrors.lastName.REQUIRED);return}D({isArchived:!1,lastName:t,firstName:s,middleName:i,prompt:g})},[D,t,s,i,g]);return l.useLayoutEffect(()=>{if(!x)return;const W=Math.floor((x-302)/20)-1;I(W)},[g,x]),l.useEffect(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),a.jsxs(a.Fragment,{children:[a.jsxs(Ws,{ref:R,onClose:P,children:[a.jsx("div",{className:"h-full",ref:E,children:a.jsxs("form",{onSubmit:Q,noValidate:!0,children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[36px] uppercase text-zinc-950 mt-6.5",children:h.client.newClient.titles.NEW_CLIENT}),a.jsxs("div",{className:"max-w-212 mx-auto w-full mt-9",children:[a.jsxs("div",{className:"flex justify-between gap-3",children:[a.jsx("div",{className:"w-full h-14 overflow-visible",children:a.jsx(hi,{placeholder:h.client.newClient.fields.LAST_NAME_REQUIRED,value:t,handleChange:O,isError:!!c,errorText:c,disabled:d})}),a.jsx("div",{className:"w-full h-14 overflow-visible",children:a.jsx(hi,{placeholder:h.client.newClient.fields.FIRST_NAME,value:s,handleChange:r,disabled:d})}),a.jsx("div",{className:"w-full",children:a.jsx(hi,{placeholder:h.client.newClient.fields.MIDDLE_NAME,value:i,handleChange:o,disabled:d})})]}),a.jsx("div",{className:"mt-8",children:a.jsx(Hle,{placeholder:h.client.newClient.fields.PROMPT,value:g,handleChange:A,maxR
866ows:y,disabled:d})}),a.jsxs("div",{className:"flex justify-end mt-6 gap-2 pb-4",children:[a.jsx(ut,{variant:"h12inverse",type:"button",onClick:B,disabled:d,children:h.client.newClient.buttons.CANCEL}),a.jsx(ut,{variant:"h12",type:"submit",isPending:d,children:h.client.newClient.buttons.ANALYZE})]})]})]})}),a.jsx("div",{className:"fixed bottom-18 left-4 z-22",children:a.jsx(zv,{label:h.client.newClient.buttons.HELP_BUTTON,iconVariant:"help",onClick:F})})]}),a.jsx(Vle,{isOpen:v,onClose:z})]})},bw=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19221_55739)"},l.createElement("path",{d:"M19 4V20H7C6.46957 20 5.96086 19.7893 5.58579 19.4142C5.21071 19.0391 5 18.5304 5 18V6C5 5.46957 5.21071 4.96086 5.58579 4.58579C5.96086 4.21071 6.46957 4 7 4H19Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M19 16H7C6.46957 16 5.96086 16.2107 5.58579 16.5858C5.21071 16.9609 5 17.4696 5 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9 8H15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19221_55739"},l.createElement("rect",{width:24,height:24,fill:"white"})))),qle=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19628_57353)"},l.createElement("path",{d:"M9 4H12L14 6H19C19.5304 6 20.0391 6.21071 20.4142 6.58579C20.7893 6.96086 21 7.46957 21 8V15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H9C8.46957 17 7.96086 16.7893 7.58579 16.4142C7.21071 16.0391 7 15.5304 7 15V6C7 5.46957 7.21071 4.96086 7.58579 4.58579C7.96086 4.21071 8.46957 4 9 4Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M17 17V19C17 19.5304 16.7893 20.0391 16.4142 20.4142C16.0391 20.7893 15.5304 21 15 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V10C3 9.46957 3.21071 8.96086 3.58579 8.58579C3.96086 8.21071 4.46957 8 5 8H7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19628_57353"},l.createElement("rect",{width:24,height:24,fill:"white"})))),Wle=e=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19628_57329)"},l.createElement("path",{d:"M13 10L20.383 17.418C21.206 18.238 21.206 19.566 20.383 20.385C19.9876 20.7783 19.4527 20.999 18.895 20.999C18.3373 20.999 17.8024 20.7783 17.407 20.385L10 13",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6 9L10 13",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M13 10L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3 21H10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.79285 15.793L3.20685 12.207C3.01938 12.0195 2.91406 11.7652 2.91406 11.5C2.91406 11.2348 3.01938 10.9805 3.20685 10.793L5.49985 8.5L5.99985 9L8.99985 6L8.49985 5.5L10.7928 3.207C10.9804 3.01953 11.2347 2.91422 11.4998 2.91422C11.765 2.91422 12.0193 3.01953 12.2068 3.207L15.7928 6.793C15.9803 6.98053 16.0856 7.23484 16.0856 7.5C16.0856 7.76517 15.9803 8.01947 15.7928 8.207L13.4998 10.5L12.9998 10L9.99985 13L10.4998 13.5L8.20685 15.793C8.01932 15.9805 7.76501 16.0858 7.49985 16.0858C7.23468 16.0858 6.98038 15.9805 6.79285 15.793V15.793Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19628_57329"},l.createElement("rect",{width:24,height:24,fill:"white"})))),tP={criminal_procedure_code:{icon:bw,searchPlaceholder:h.clients.legalBase.categories.UPK.SEARCH_PLACEHOLDER},criminal_code:{icon:bw,searchPlaceholder:h.clients.legalBase.categories.UK.SEARCH_PLACEHOLDER},supreme_court_plenum:{icon:Wle,searchPlaceholder:h.clients.legalBase.categories.VS_PLENUMS.SEARCH_PLACEHOLDER}},Kle={icon:qle,searchPlaceholder:h.clients.legalBase.search.PLACEHOLDER},$le=e=>e in tP,nP=({type:e})=>$le(e)?tP[e]:Kle,Yle=({base:e})=>{const t=Fe(),{icon:n}=nP({type:e.type});return a.jsxs(Hs,{to:Ef({baseId:e.id}),state:sf({state:t.state}),className:Y("w-full flex items-start gap-4 px-6 py-5 text-left border-b last:border-b-0 border-b-zinc-200","cursor-pointer hover:bg-zinc-50 hover:border-b-zinc-50","[&:has(+a:hover)]:border-b-zinc-50"),children:[a.jsx(n,{className:"size-6 shrink-0 text-zinc-400"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:e.name}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 mt-1",children:e.description})]})]})},Xle=/(<em>.*?<\/em>)/g,Hy=({text:e})=>e.split(Xle).map((n,s)=>{if(!n.startsWith("<em>"))return n;const r=n.slice(4,-5);return a.jsx("mark",{className:"bg-yellow-200 text-inherit",children:r},s)}),sP=({results:e,searchValue:t,endOfListRef:n,isAllLoaded:s,isFetchingNextPage:r,totalResults:i,returnPath:o="/legal-base"})=>{const c=Fe(),u=l.useCallback(({result:d})=>({to:i2({baseId:d.baseId,articleId:d.id}),state:dO({state:c.state,returnPath:o,searchQuery:t})}),[c.state,o,t]);return a.jsxs("div",{className:"max-w-[896px] w-full mx-auto mt-4 pb-20",children:[e.map(d=>{const{to:p,state:g}=u({result:d});return a.jsxs(Hs,{to:p,state:g,className:Y("block w-full text-left px-6 py-4","cursor-pointer hover:bg-zinc-50"),children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16
866px] text-zinc-500 px-1.5 py-0.5 bg-zinc-100 rounded-full w-fit",children:d.baseName}),a.jsxs("div",{className:"roboto-flex-100-700-1 text-[16px] leading-[24px] text-zinc-950 mt-1",children:[!!d.prefix&&a.jsxs(a.Fragment,{children:[Hy({text:d.prefix}),". "]}),Hy({text:d.title})]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 mt-1 line-clamp-2",children:Hy({text:d.snippet})})]},d.id)}),!s&&a.jsx("div",{ref:n,className:Y("flex items-center justify-center h-14",i<=10&&"hidden"),children:!!(!s&&r)&&a.jsx(ct,{delay:0})})]})},rP=({searchValue:e})=>{const t=l.useMemo(()=>h.clients.legalBase.search.NO_RESULTS_TITLE.replace("{query}",e.trim()),[e]);return a.jsxs("div",{className:"flex flex-col items-center justify-center h-[calc(100dvh-7rem)] w-full max-w-[872px] mx-auto px-6 text-center pb-10",children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:t}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 mt-2",children:h.clients.legalBase.search.NO_RESULTS_HINT})]})},iP=20,Jle=500,Zle="200px 0px",ece=({pageParam:e})=>{if(e!==void 0)return{searchAfterScore:e[0],searchAfterId:e[1]}},tce=({lastPage:e})=>{if(!(e.results.length<iP)&&e.nextSearchAfter&&e.nextSearchAfter.length===2&&e.nextSearchAfter[0]&&e.nextSearchAfter[1])return e.nextSearchAfter},nce=({debouncedSearchValue:e,isPending:t,isFetching:n,isFetchingNextPage:s})=>e?!!(t||n&&!s):!1,sce=({isDebouncingSearchValue:e,isSearchQueryFetching:t})=>!!(e||t),oP=({endOfListRef:e,initialSearchValue:t,baseIds:n}={})=>{const{searchValue:s,debouncedSearchValue:r,isSearchActive:i,handleSearchValueChange:o,handleClearSearchClick:c}=v2({initialSearchValue:t,debounceMs:Jle}),{data:u,isPending:d,isSuccess:p,isFetching:g,fetchNextPage:A,hasNextPage:E,isFetchingNextPage:x}=fa({queryKey:["legalBasesSearch",r,...n??[]],queryFn:({pageParam:N,signal:R})=>Xee({queryText:r,baseIds:n,limit:iP,searchAfter:ece({pageParam:N}),signal:R}),enabled:!!r,staleTime:1e3*60*5,initialPageParam:void 0,getNextPageParam:N=>tce({lastPage:N})}),y=l.useMemo(()=>(u?.pages??[]).flatMap(N=>N.results??[]),[u?.pages]),I=u?.pages?.[0]?.totalResults??0,v=l.useMemo(()=>!E,[E]),S=s.trim()!==r,b=nce({debouncedSearchValue:r,isPending:d,isFetching:g,isFetchingNextPage:x}),w=sce({isDebouncingSearchValue:S,isSearchQueryFetching:b}),_=!!r&&!w&&p;return l.useEffect(()=>{if(!e)return;const N=e.current;if(!N)return;const R=new IntersectionObserver(D=>{D[0].isIntersecting&&E&&(x||A())},{rootMargin:Zle});return R.observe(N),()=>{R.disconnect()}},[e,A,E,x]),{searchValue:s,debouncedSearchValue:r,isSearchActive:i,handleSearchValueChange:o,handleClearSearchClick:c,results:y,totalResults:I,isSearchSuccess:p,isSearchSettled:_,isSearchLoading:w,isAllLoaded:v,isFetchingNextPage:x}},rce=1e3*60*5,Iw=()=>{const e=Fe(),t=l.useRef(null),n=cO({state:e.state}),{searchValue:s,debouncedSearchValue:r,isSearchActive:i,handleSearchValueChange:o,handleClearSearchClick:c,results:u,totalResults:d,isSearchSettled:p,isSearchLoading:g,isAllLoaded:A,isFetchingNextPage:E}=oP({endOfListRef:t,initialSearchValue:n}),{data:x,isLoading:y,isSuccess:I}=Vt({queryKey:["legalBases"],queryFn:()=>ZO(),staleTime:rce}),v=a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)]",children:a.jsx(ct,{delay:0})});if(y||!I)return v;const S=u.length>0;return a.jsxs(a.Fragment,{children:[!i&&a.jsx("div",{className:"max-w-[896px] w-full mx-auto mt-4",children:x.map(b=>a.jsx(Yle,{base:b},b.id))}),!!i&&!!g&&a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)]",children:a.jsx(ct,{delay:0})}),!!i&&!g&&!!S&&a.jsx(sP,{results:u,searchValue:s,endOfListRef:t,isAllLoaded:A,isFetchingNextPage:E,totalResults:d}),!!i&&!!p&&!S&&a.jsx(rP,{searchValue:r}),a.jsx(gE,{placeholder:h.clients.legalBase.search.PLACEHOLDER,isDownloadHidden:!0,isMatchNavigationHidden:!0,searchValue:s,isSearchActive:i,onSearchValueChange:o,onClearSearchClick:c})]})},Sw=()=>a.jsx(Xi,{}),ice=e=>e.number?`Статья ${e.number}. ${e.title}`:e.title,oce=({nodes:e,getArticleLink:t})=>{const n=l.useCallback(r=>{const{to:i,state:o}=t({article:r});return a.jsx(Hs,{to:i,state:o,className:Y("block w-full text-left px-6 py-3","roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950","cursor-pointer hover:bg-zinc-50"),children:ice(r)},r.id)},[t]),s=l.useCallback((r,i)=>r.level==="part"?a.jsxs("div",{className:"pt-6 first:pt-0",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[20px] leading-[20px] text-zinc-400 uppercase py-3 border-b border-zinc-200",children:r.label}),a.jsxs("div",{children:[r.articles.map(n),r.children.map((o,c)=>s(o,`${i}-${c}`))]})]},i):r.level==="section"?a.jsxs("div",{children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[20px] leading-[20px] text-zinc-950 uppercase py-4.5 border-b border-zinc-200",children:r.label}),a.jsxs("div",{children:[r.articles.map(n),r.children.map((o,c)=>s(o,`${i}-${c}`))]})]}
866,i):a.jsxs("div",{className:"first:mt-2 mt-4 pl-6",children:[a.jsx("div",{className:"roboto-flex-25-600-1 text-[20px] leading-[20px] text-zinc-950 uppercase py-4.5",children:r.label}),a.jsxs("div",{children:[r.articles.map(n),r.children.map((o,c)=>s(o,`${i}-${c}`))]})]},i),[n]);return a.jsx("div",{className:"pb-20",children:e.map((r,i)=>s(r,`node-${i}`))})},aP=()=>{const e=at(),t=Fe(),{articleId:n}=st();l.useLayoutEffect(()=>{const{baseId:s,articleId:r}=o2({pathname:t.pathname});if(!s)return;const i=t.pathname.split("/").filter(Boolean),o=i[0]==="legal-base"&&i.length>=3;if(r){const u=i2({baseId:s,articleId:r});if(t.pathname===u)return;e(u,{replace:!0,state:t.state});return}if(o&&!n)return;const c=Ef({baseId:s});t.pathname!==c&&e(c,{replace:!0,state:t.state})},[n,t.pathname,t.state,e])},ace=()=>{const{baseId:e,articleId:t}=st();return l.useMemo(()=>n7({baseIdSlug:e,articleSlug:t}),[t,e])},lce=1e3*60*5,cce=2500,_0=()=>{const e=at(),t=Fe(),n=l.useRef(null),{baseId:s}=ace();aP();const r=uO({state:t.state}),i=l.useMemo(()=>{if(s)return[s]},[s]),{searchValue:o,isSearchActive:c,handleSearchValueChange:u,handleClearSearchClick:d,results:p,totalResults:g,debouncedSearchValue:A,isSearchSettled:E,isSearchLoading:x,isAllLoaded:y,isFetchingNextPage:I}=oP({endOfListRef:n,initialSearchValue:r,baseIds:i}),v=l.useMemo(()=>s?Ef({baseId:s}):"/legal-base",[s]),{data:S,isError:b,isLoading:w}=Vt({queryKey:["legalBase",s],queryFn:()=>{if(!s)throw new Error("Missing base id");return r2({baseId:s})},enabled:!!s,staleTime:lce}),_=p.length>0,N=l.useMemo(()=>S?nP({type:S.type}).searchPlaceholder:"",[S]),R=l.useCallback(({article:P})=>s?{to:i2({baseId:s,articleId:P.id}),state:dO({state:t.state,returnPath:Ef({baseId:s}),searchQuery:o})}:{to:"/legal-base",state:sf({state:t.state})},[s,t.state,o]),D=l.useCallback(()=>{e("/legal-base",{state:sf({state:t.state})})},[t.state,e]),k=l.useMemo(()=>{if(S)return{label:S.name,onClose:D}},[S,D]),L=l.useMemo(()=>sf({state:t.state}),[t.state]),O=a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)]",children:a.jsx(ct,{delay:cce})});return s?b&&!S?a.jsx(ia,{type:Gr.LEGAL_BASE_NOT_FOUND}):w||!S?O:a.jsxs(a.Fragment,{children:[!c&&a.jsx("div",{className:"max-w-[880px] mx-auto mt-4 px-4 w-full",children:a.jsx(oce,{nodes:S.nodes,getArticleLink:R})}),!!(c&&x)&&a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)]",children:a.jsx(ct,{delay:0})}),!!(c&&!x&&_)&&a.jsx(sP,{results:p,searchValue:o,endOfListRef:n,isAllLoaded:y,isFetchingNextPage:I,totalResults:g,returnPath:v}),!!(c&&E&&!_)&&a.jsx(rP,{searchValue:A}),a.jsx(gE,{placeholder:N,searchTag:k,isDownloadHidden:!0,isMatchNavigationHidden:!0,searchValue:o,isSearchActive:c,onSearchValueChange:u,onClearSearchClick:d})]}):a.jsx(Qn,{to:"/legal-base",replace:!0,state:L})},uce=1e3*60*5,dce=()=>{const e=at(),t=Fe(),{baseId:n,articleId:s}=l.useMemo(()=>o2({pathname:t.pathname}),[t.pathname]);aP();const{data:r}=Vt({queryKey:["legalBase",n],queryFn:()=>{if(!n)throw new Error("Missing base id");return r2({baseId:n})},enabled:!!n,staleTime:uce}),i=l.useCallback(()=>{const o=rte({baseId:n,pathname:t.pathname,state:t.state});e(o.to,{replace:!0,state:o.state})},[n,t.pathname,t.state,e]);return!n||!r?null:a.jsx(F7,{baseId:n,articleId:s??null,onClose:i})},fce=new Set(["VALIDATION_ERROR","NOT_FOUND","FILE_NOT_FOUND","FORBIDDEN"]),pce=({error:e})=>typeof e.code=="string"?e.code:pt(e.errorData)&&typeof e.errorData.code=="string"?e.errorData.code:null;function GI({error:e}){if(!pt(e))return!1;const t=pce({error:e});return t?fce.has(t):!1}function hce(e){const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),o=(r??n)==="first-instance",c=bt(),u=e?.caseFirstInstanceDataFromState?._id===s,d=e?.caseSecondInstanceDataFromState?._id===s,p=u?e?.caseFirstInstanceDataFromState?._source?.appeal_file_id??null:null,g=d?e?.caseSecondInstanceDataFromState?._source?.fi_file_id??null:null,A=c.getQueryData(["caseFirstInstance",t,s])?._source?.appeal_file_id??null,E=c.getQueryData(["caseSecondInstance",t,s])?._source?.fi_file_id??null,x=l.useMemo(()=>{if(o)return s;if(g)return g;if(E)return E},[o,s,g,E]),y=l.useMemo(()=>
866{if(!o)return s;if(p)return p;if(A)return A},[o,s,p,A]),I=l.useMemo(()=>!(!o||u||!x),[u,x,o]),v=l.useMemo(()=>!(o||d||!y),[d,o,y]),{data:S,isSuccess:b,isError:w,error:_}=Vt({queryKey:["caseFirstInstance",t,x],queryFn:()=>U7({clientId:t,caseId:x}),enabled:I,staleTime:1e3*60*15,refetchOnWindowFocus:!1}),{data:N,isSuccess:R,isError:D,error:k}=Vt({queryKey:["caseSecondInstance",t,y],queryFn:()=>z7({clientId:t,caseId:y}),enabled:v,staleTime:1e3*60*15,refetchOnWindowFocus:!1}),L=l.useMemo(()=>GI(o?{error:_}:{error:k}),[o,_,k]);return{caseFirstInstanceData:S,caseSecondInstanceData:N,isSuccessFirstInstance:b,isSuccessSecondInstance:R,isErrorFirstInstance:w,isErrorSecondInstance:D,isCaseNotFound:L}}const vw=({placeholder:e=h.inputs.dropdownWithSearch.ALL,value:t,isClearable:n=!0,isCloseOnScroll:s=!1,isError:r,options:i,onChange:o,label:c})=>{const[u,d]=l.useState(!1),p=Fe(),g=l.useRef(null),A=l.useRef(null),E=l.useRef([]),x=l.useCallback(L=>{g.current&&(g.current.contains(L.target)||d(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}),[x]),l.useEffect(()=>{if(!u)return;const L=g.current,O=A.current;if(!L||!O)return;const P=Ji(L,O,async()=>{const B=L.getBoundingClientRect(),F=Io({referenceTop:B.top,referenceBottom:B.bottom,floatingHeight:O.offsetHeight,viewportHeight:window.innerHeight,gap:6,preferredDirection:"down"}),z=await Ei(L,O,{placement:hc[F],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),Q=xi-B.top,M=Math.max(z.y,Q);Object.assign(O.style,{left:`${z.x}px`,top:`${M}px`})});return()=>P()},[u]),l.useEffect(()=>{if(!u||!s)return;const L=performance.now(),O=()=>{performance.now()-L<fl||d(!1)},P=[],B=F=>{if(!F)return;const z=F.parentElement;if(!z)return;z.scrollHeight>z.clientHeight&&(z.addEventListener("scroll",O,{passive:!0}),P.push(z)),B(z)};return B(g.current),window.addEventListener("scroll",O,{passive:!0}),window.addEventListener("resize",O,{passive:!0}),P.push(window),E.current=P,()=>{E.current.forEach(F=>{if(F instanceof Window){F.removeEventListener("scroll",O),F.removeEventListener("resize",O);return}F.removeEventListener("scroll",O)}),E.current=[]}},[u,s]);const y=l.useMemo(()=>i.some(L=>!!L.to),[i]),I=l.useMemo(()=>n?[{value:"all",label:e,isPlaceholder:!0},...i]:i,[i,e,n]),v=l.useMemo(()=>{if(!y)return;const L=I.filter(B=>!B.isPlaceholder&&!!B.to);if(L.length===0)return;const O=L.find(B=>B.to===p.pathname);return O||L.reduce((B,F)=>!F.to||!p.pathname.startsWith(F.to)?B:B===void 0||B.to.length<F.to.length?F:B,void 0)},[y,I,p.pathname]),S=l.useMemo(()=>t!==void 0?!t&&n?"all":t:v?.value??(n?"all":null),[t,n,v]),b=l.useMemo(()=>{const L=I.filter(z=>!!z.isPlaceholder),O=I.filter(z=>!z.isPlaceholder),P=O.filter(z=>z.zone==="primary"),B=O.filter(z=>z.zone!=="primary"),F=P.length>0&&B.length>0;return[...L.map(z=>({option:z,isFollowedByZoneSeparator:!1})),...P.map((z,Q)=>({option:z,isFollowedByZoneSeparator:F&&Q===P.length-1})),...B.map(z=>({option:z,isFollowedByZoneSeparator:!1}))]},[I]),w=l.useCallback(()=>{d(L=>!L)},[]),_=l.useCallback(L=>{o?.(L.value),d(!1)},[o]),N=l.useCallback(({event:L,option:O})=>{O.value===v?.value&&L.preventDefault(),d(!1)},[v?.value]),R=l.useMemo(()=>u?a.jsx("div",{ref:A,className:"absolute flex flex-col max-h-82 bg-white rounded-[8px] shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)] z-50 min-w-80",children:a.jsx("div",{className:"flex flex-col p-1 flex-1 overflow-hidden",children:a.jsx("div",{className:"overflow-y-auto flex-1 overscroll-contain",children:b.map(({option:L,isFollowedByZoneSeparator:O})=>{const P=a.jsxs("div",{className:Y("flex items-start justify-between pl-3 pr-0.5 pt-1.5 pb-1.5 roboto-flex-100-400-1 text-[16px] leading-[20px] group-hover:bg-zinc-50 rounded-[6px]",!L.isPlaceholder&&"text-zinc-950",!!L.isPlaceholder&&"text-zinc-500"),children:[L.label,L.value===S&&a.jsx("div",{className:"h-5 w-6 flex items-center justify-center",children:a.jsx(qr,{className:"size-4 text-zinc-900"})})]}),B=L.to&&!L.isPlaceholder?a.jsx(Je,{to:L.to,state:L.state,end:!0,onClick:F=>N({event:F,option:L}),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer block"),children:P}):a.jsx("div",{onClick:()=>_(L),className:Y("pt-0.5 pb-0.5 first:pt-0 last:pb-0 group cursor-pointer"),children:P});return a.jsxs(l.Fragment,{children:[B,!!O&&a.jsx("div",{"aria-hidden":!0,
866className:"h-0.25 bg-zinc-200 my-1 mx-3 shrink-0"})]},L.value)})})})}):null,[u,S,b,_,N]),D=l.useMemo(()=>{const L="flex gap-1 items-center justify-between h-5 px-1.5 cursor-pointer rounded-[4px]";return r?Y(L,"bg-red-100","hover:bg-red-100"):Y(L,"bg-zinc-100","hover:bg-zinc-100")},[r]),k=l.useMemo(()=>Y("overflow-hidden text-ellipsis whitespace-nowrap text-center","max-w-40 bp56_25:max-w-70 roboto-flex-25-700-1 uppercase text-zinc-600 text-[12px] leading-[10px]"),[]);return a.jsxs("div",{ref:g,className:"relative select-none",children:[a.jsxs("div",{className:D,onClick:w,children:[!!c&&a.jsx("div",{className:"roboto-flex-25-700-1 text-[14px] leading-[16px] uppercase text-zinc-400",children:c}),a.jsx("div",{className:k,children:I.find(L=>L.value===S)?.label??v?.label??e}),a.jsx(Bu,{className:Y("size-2 text-zinc-400",!u&&"rotate-180")})]}),R]})},mce=({containerRef:e,rightStickyTitleRef:t,isLoading:n})=>{const s=Fe(),r=l.useRef(null),i=l.useMemo(()=>{const u=s.pathname;return u.includes("/information/accused")||u.includes("/fabula")?76:u.includes("/defense-request/")?88:76},[s.pathname]),o=l.useCallback(u=>{if(n)return;const d=e.current;if(!d)return;const p=(()=>
866{if(!u)return 0;const g=document.getElementById(u);if(!g)return 0;const A=g.getBoundingClientRect(),E=d.getBoundingClientRect(),x=t?.current?.offsetHeight??0,y=i+x,I=A.top-y-E.top;return d.scrollTop+I})();d.scrollTo({top:p})},[e,i,n,t]),c=l.useCallback(u=>{if(n||!u)return;if(document.getElementById(u)){o(u);return}r.current=requestAnimationFrame(()=>c(u))},[n,o]);return l.useEffect(()=>{if(n)return;const u=(s.hash??"").replace(/^#/,"");if(u)return c(u),()=>{r.current&&cancelAnimationFrame(r.current)}},[n,c,s.pathname,s.hash]),{scrollToHashedElement:o}},N2=e=>e?._source?.summaries!=null,gce=({caseData:e})=>{const t=at(),n=Fe(),{id:s,listInstance:r,caseId:i,caseInstance:o}=st();l.useEffect(()=>{if(!s||!r||!i)return;const c=`/clients/${s}/cases/${r}/${i}/${o??"first-instance"}`,u=N2(e);if(n.pathname===c){t(u?`${c}/overview`:`${c}/information/general`,{replace:!0,state:n.state});return}if((n.pathname===`${c}/overview`||n.pathname.startsWith(`${c}/overview/`))&&!u){t(`${c}/information/general`,{replace:!0,state:n.state});return}if(n.pathname===`${c}/information`){t(`${c}/information/general`,{replace:!0,state:n.state});return}},[s,r,i,o,e,n.pathname,n.state,t])},lP=()=>{const e=rl(n=>n.runtimeConfig),t=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/*");return e?.HIDE_PROSECUTION_REQUEST!=="true"||!!t},uA=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Ace=e=>e==null?"":e?"Да":"Нет",Ece=e=>{if(!Array.isArray(e))return"";const t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length===0?"":t.join(", ")},T0=(e,t,n)=>{const s=e??[];if(!Array.isArray(s)||s.length===0)return;const i=t?.find(o=>o.name===n)?.indices?.[0]??0;return s[i]??void 0},cP=e=>{if(e!==void 0)return`caseData._source.evidence[${e}]`},uP=(e,t)=>t?.find(n=>n.name===e&&n.indices.length===1)?.indices?.[0],xce=(e,t,n)=>{const s=cP(e);if(!s)return;let r=s;for(const i of t){const o=uP(i,n);if(o!==void 0){r+=`[${o}].${i}`;continue}if(i==="quotes"||i==="usage_in_felonies"){r+=`[0].${i}`;continue}r+=`.${i}`}return r},Cce=e=>uP("usage_in_felonies",e)??0,yce={title:{path:["title"],label:h.client.case.firstInstance.evidence.item.fields.TITLE},evidence_title:{path:["evidence_title"],label:h.client.case.firstInstance.evidence.item.fields.TITLE},description:{path:["description"],label:h.client.case.firstInstance.evidence.item.fields.DESCRIPTION},type:{path:["type"],label:h.client.case.firstInstance.evidence.item.fields.TYPE},category:{path:["category"],label:h.client.case.firstInstance.evidence.item.fields.CATEGORY},subcategory:{path:["subcategory"],label:h.client.case.firstInstance.evidence.item.fields.SUBCATEGORY},consideration_type:{path:["consideration_type"],label:h.client.case.firstInstance.evidence.item.fields.RESULT},admissibility_status:{path:["admissibility_status"],label:h.client.case.firstInstance.evidence.item.fields.ADMISSIBILITY,getValue:({evidence:e})=>Ace(e?.admissibility_status)},inadmissibility_reason:{path:["inadmissibility_reason"],label:h.client.case.firstInstance.evidence.item.fields.INADMISSIBILITY_REASON},related_accused_ids:{path:["related_accused_ids"],label:h.client.case.firstInstance.evidence.item.fields.ACCUSED_NAME,getValue:({evidence:e,caseData:t})=>{const n=e?.related_accused_ids??[];if(!Array.isArray(n)||n.length===0)return"";const s=t?._source?.general_information?.accused??[],r=n.map(i=>s.find(o=>o?.id===i)?.name).filter(i=>typeof i=="string"&&i.trim().length>0).map(i=>i.trim());return Ece(r)}},quotes:{path:["quotes"],label:h.client.case.firstInstance.evidence.item.fields.QUOTE,getValue:({evidence:e,fieldTailSegments:t})=>{const n=T0(e?.quotes??[],t,"quotes");return typeof n=="string"?uA(n):""}},usage_in_felonies_law_article:{path:["usage_in_felonies","law","article"],label:h.client.case.firstInstance.evidence.item.fields.LAW_ARTICLE,getValue:({evidence:e,fieldTailSegments:t,caseData:n})=>{const r=T0(e?.usage_in_felonies,t,"usage_in_felonies")?.felony_id??void 0;if(!r)return"";const i=n?._source?.case_narrative?.events??[];for(const o of i??[]){const u=(o?.felonies??[])?.find(d=>d?.felony_id===r);if(u){const d=u?.objects?.primary_object?.related_law?.law,p=d?.part,g=d?.article,A=d?.clause;return g?et({clause:A,part:p,number:g}):""}}return""}
866,getSourcePath:e=>{const t=cP(e.evidenceIndex);if(!t)return;const n=Cce(e.fieldTailSegments);return`${t}.usage_in_felonies[${n}].felony_id`}},usage_in_felonies_purpose:{path:["usage_in_felonies","purpose"],label:h.client.case.firstInstance.evidence.item.fields.PURPOSE,getValue:({evidence:e,fieldTailSegments:t})=>{const n=T0(e?.usage_in_felonies,t,"usage_in_felonies");return uA(n?.purpose??"")}},usage_in_felonies_used_by:{path:["usage_in_felonies","used_by"],label:h.client.case.firstInstance.evidence.item.fields.USED_BY,getValue:({evidence:e,fieldTailSegments:t})=>{const n=T0(e?.usage_in_felonies,t,"usage_in_felonies");return uA(n?.used_by??"")}}},dP=e=>{const{fieldTailPath:t,fieldTailSegments:n,evidence:s,caseData:r,evidenceIndex:i}=e,o=(t??[]).join("/"),c=Object.entries(yce).find(([,A])=>A.path.join("/")===o);if(!c)return;const[,u]=c,d=u.getValue?u.getValue({evidence:s,caseData:r,fieldTailSegments:n}):uA((()=>{let A=s;for(const E of u.path){if(A==null||typeof A!="object"||Array.isArray(A))return"";A=A[E]}return A})()),p={evidenceIndex:i,fieldTailSegments:n},g=u.getSourcePath?u.getSourcePath(p):xce(i,u.path,n);return{label:u.label,value:d,sourcePath:g}},mh=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},bce=e=>e==null?"":e?"Да":"Нет",Ice=e=>{if(!Array.isArray(e))return"";const t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length===0?"":t.join(", ")},N0=(e,t,n)=>{const s=e??[];if(!Array.isArray(s)||s.length===0)return;const i=t?.find(o=>o.name===n)?.indices?.[0]??0;return s[i]??void 0},fP=e=>{if(e!==void 0)return`caseData._source.testimonies[${e}]`},pP=(e,t)=>t?.find(n=>n.name===e&&n.indices.length===1)?.indices?.[0],Sce=(e,t,n)=>{const s=fP(e);if(!s)return;let r=s;for(const i of t){const o=pP(i,n);if(o!==void 0){r+=`[${o}].${i}`;continue}if(i==="quotes"||i==="usage_in_felonies"){r+=`[0].${i}`;continue}r+=`.${i}`}return r},vce=e=>pP("usage_in_felonies",e)??0,_ce={description:{path:["description"],label:h.client.case.firstInstance.evidence.item.fields.DESCRIPTION},type:{path:["type"],label:h.client.case.firstInstance.evidence.item.fields.TYPE},category:{path:["category"],label:h.client.case.firstInstance.evidence.item.fields.CATEGORY},name:{path:["name"],label:h.client.case.firstInstance.evidence.item.fields.TESTIMONY_PERSON_NAME},consideration_type:{path:["consideration_type"],label:h.client.case.firstInstance.evidence.item.fields.RESULT},admissibility_status:{path:["admissibility_status"],label:h.client.case.firstInstance.evidence.item.fields.ADMISSIBILITY,getValue:({testimony:e})=>bce(e?.admissibility_status)},inadmissibility_reason:{path:["inadmissibility_reason"],label:h.client.case.firstInstance.evidence.item.fields.INADMISSIBILITY_REASON,getValue:({testimony:e})=>e?.admissibility_status!==!1?"":mh(e?.inadmissibility_reason??"")},related_accused_ids:{path:["related_accused_ids"],label:h.client.case.firstInstance.evidence.item.fields.ACCUSED_NAME,getValue:({testimony:e,caseData:t})=>{const n=e?.related_accused_ids??[];if(!Array.isArray(n)||n.length===0)return"";const s=t?._source?.general_information?.accused??[],r=n.map(i=>s.find(o=>o?.id===i)?.name).filter(i=>typeof i=="string"&&i.trim().length>0).map(i=>i.trim());return Ice(r)}},quotes:{path:["quotes"],label:h.client.case.firstInstance.evidence.item.fields.QUOTE,getValue:({testimony:e,fieldTailSegments:t})=>{const n=N0(e?.quotes??[],t,"quotes");return typeof n=="string"?mh(n):""}},usage_in_felonies_law_article:{path:["usage_in_felonies","law","article"],label:h.client.case.firstInstance.evidence.item.fields.LAW_ARTICLE,getValue:({testimony:e,fieldTailSegments:t,caseData:n})=>{const r=N0(e?.usage_in_felonies,t,"usage_in_felonies")?.felony_id??void 0;if(!r)return"";const i=n?._source?.case_narrative?.events??[];for(const o of i??[]){const u=(o?.felonies??[])?.find(d=>d?.felony_id===r);if(u){const d=u?.objects?.primary_object?.related_law?.law,p=d?.part,g=d?.article,A=d?.clause;return g?et({clause:A,part:p,number:g}):""}}return""},getSourcePath:e=>{const t=fP(e.testimonyIndex);if(!t)return;const n=vce(e.fieldTailSegments);return`${t}.usage_in_felonies[${n}].felony_id`}},usage_in_felonies_purpose:{path:["usage_in_felonies","purpose"],label:h.client.case.f
866irstInstance.evidence.item.fields.PURPOSE,getValue:({testimony:e,fieldTailSegments:t})=>{const n=N0(e?.usage_in_felonies,t,"usage_in_felonies");return mh(n?.purpose??"")}},usage_in_felonies_used_by:{path:["usage_in_felonies","used_by"],label:h.client.case.firstInstance.evidence.item.fields.USED_BY,getValue:({testimony:e,fieldTailSegments:t})=>{const n=N0(e?.usage_in_felonies,t,"usage_in_felonies");return mh(n?.used_by??"")}}},Tce=e=>{const{fieldTailPath:t,fieldTailSegments:n,testimony:s,caseData:r,testimonyIndex:i}=e,o=(t??[]).join("/"),c=Object.entries(_ce).find(([,A])=>A.path.join("/")===o);if(!c)return;const[,u]=c,d=u.getValue?u.getValue({testimony:s,caseData:r,fieldTailSegments:n}):mh((()=>{let A=s;for(const E of u.path){if(A==null||typeof A!="object"||Array.isArray(A))return"";A=A[E]}return A})()),p={testimonyIndex:i,fieldTailSegments:n},g=u.getSourcePath?u.getSourcePath(p):Sce(i,u.path,n);return{label:u.label,value:d,sourcePath:g}},hP=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Fc=e=>e==null?"":e?"Да":"Нет",th=e=>{if(!Array.isArray(e))return"";const t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length===0?"":t.join(", ")},Nce=(e,t)=>{let n=e;for(const s of t){if(n==null||typeof n!="object"||Array.isArray(n))return;n=n[s]}return n},wce=e=>{if(e!==void 0)return`caseData._source.general_information.accused[${e}]`},Rce=(e,t)=>t?.find(n=>n.name===e&&n.indices.length===1)?.indices?.[0],Ht=(e,t,n)=>{const s=wce(e);if(!s)return;let r=s;for(const i of t){const o=Rce(i,n);if(o!==void 0){r+=`[${o}].${i}`;continue}if(i==="characteristics"||i==="criminal_records"){r+=`[0].${i}`;continue}r+=`.${i}`}return r},Dce={name:{path:["name"],label:h.client.case.firstInstance.information.accused.fields.NAME,getSourcePath:e=>Ht(e.accusedIndex,["name"],e.fieldTailSegments)},gender:{path:["gender"],label:h.client.case.firstInstance.information.accused.fields.GENDER,getSourcePath:e=>Ht(e.accusedIndex,["gender"],e.fieldTailSegments)},age_group:{path:["age_group"],label:h.client.case.firstInstance.information.accused.fields.AGE_GROUP,getSourcePath:e=>Ht(e.accusedIndex,["age_group"],e.fieldTailSegments)},citizenship:{path:["citizenship"],label:h.client.case.firstInstance.information.accused.fields.CITIZENSHIP,getSourcePath:e=>Ht(e.accusedIndex,["citizenship"],e.fieldTailSegments)},address:{path:["address"],label:h.client.case.firstInstance.information.accused.fields.ADDRESS,getSourcePath:e=>Ht(e.accusedIndex,["address"],e.fieldTailSegments)},occupation:{path:["occupation"],label:h.client.case.firstInstance.information.accused.fields.OCCUPATION,getSourcePath:e=>Ht(e.accusedIndex,["occupation"],e.fieldTailSegments)},education:{path:["education"],label:h.client.case.firstInstance.information.accused.fields.EDUCATION,getSourcePath:e=>Ht(e.accusedIndex,["education"],e.fieldTailSegments)},marital_status:{path:["marital_status"],label:h.client.case.firstInstance.information.accused.fields.MARITAL_STATUS,getSourcePath:e=>Ht(e.accusedIndex,["marital_status"],e.fieldTailSegments)},children:{path:["children"],label:h.client.case.firstInstance.information.accused.fields.CHILDREN,getValue:({accused:e})=>Fc(e?.children),getSourcePath:e=>Ht(e.accusedIndex,["children"],e.fieldTailSegments)},workplace:{path:["employment_and_education","workplace"],label:h.client.case.firstInstance.information.accused.fields.WORKPLACE,getValue:({accused:e})=>th(e?.employment_and_education?.workplace),getSourcePath:e=>Ht(e.accusedIndex,["employment_and_education","workplace"],e.fieldTailSegments)},educational_institution:{path:["employment_and_education","educational_institution"],label:h.client.case.firstInstance.information.accused.fields.EDUCATIONAL_INSTITUTION,getValue:({accused:e})=>th(e?.employment_and_education?.educational_institution),getSourcePath:e=>Ht(e.accusedIndex,["employment_and_education","educational_institution"],e.fieldTailSegments)},special_subject_type:{path:["special_subject","type"],label:h.client.case.firstInstance.information.accused.fields.SPECIAL_SUBJECT_TYPE,getSourcePath:e=>Ht(e.accusedIndex,["special_subject","type"],e.fieldTailSegments)},special_subject_description:{path:["special_subject","description"],label:h.client.case.f
866irstInstance.information.accused.fields.SPECIAL_SUBJECT_DESCRIPTION,getSourcePath:e=>Ht(e.accusedIndex,["special_subject","description"],e.fieldTailSegments)},is_military:{path:["is_military"],label:h.client.case.firstInstance.information.accused.fields.IS_MILITARY,getValue:({accused:e})=>Fc(e?.is_military),getSourcePath:e=>Ht(e.accusedIndex,["is_military"],e.fieldTailSegments)},military_status:{path:["military_status"],label:h.client.case.firstInstance.information.accused.fields.MILITARY_STATUS,getSourcePath:e=>Ht(e.accusedIndex,["military_status"],e.fieldTailSegments)},mental_health:{path:["mental_health"],label:h.client.case.firstInstance.information.accused.fields.MENTAL_HEALTH,getSourcePath:e=>Ht(e.accusedIndex,["mental_health"],e.fieldTailSegments)},physical_health:{path:["physical_health"],label:h.client.case.firstInstance.information.accused.fields.PHYSICAL_HEALTH,getSourcePath:e=>Ht(e.accusedIndex,["physical_health"],e.fieldTailSegments)},criminal_records_status:{path:["criminal_records_status"],label:h.client.case.firstInstance.information.accused.fields.CRIMINAL_RECORDS_STATUS,getSourcePath:e=>Ht(e.accusedIndex,["criminal_records_status"],e.fieldTailSegments)},special_subject_is_special:{path:["special_subject","is_special"],label:h.client.case.firstInstance.information.accused.fields.SPECIAL_SUBJECT_IS_SPECIAL,getValue:({accused:e})=>Fc(e?.special_subject?.is_special),getSourcePath:e=>Ht(e.accusedIndex,["special_subject","is_special"],e.fieldTailSegments)},preventive_measure_type:{path:["preventive_measure","type"],label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_TYPE,getSourcePath:e=>Ht(e.accusedIndex,["preventive_measure","type"],e.fieldTailSegments)},preventive_measure_start_date:{path:["preventive_measure","start_date"],label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_START_DATE,getValue:({accused:e})=>{const t=e?.preventive_measure?.start_date??"";return Kt({dateString:t,isWithTime:!1,isShortMonth:!1})},getSourcePath:e=>Ht(e.accusedIndex,["preventive_measure","start_date"],e.fieldTailSegments)},preventive_measure_end_date:{path:["preventive_measure","end_date"],label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_END_DATE,getValue:({accused:e})=>{const t=e?.preventive_measure?.end_date??"";return Kt({dateString:t,isWithTime:!1,isShortMonth:!1})},getSourcePath:e=>Ht(e.accusedIndex,["preventive_measure","end_date"],e.fieldTailSegments)},preventive_measure_conditions:{path:["preventive_measure","conditions"],label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_CONDITIONS,getSourcePath:e=>Ht(e.accusedIndex,["preventive_measure","conditions"],e.fieldTailSegments)},characteristics_type:{path:["characteristics","type"],label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_TYPE,getValue:({accused:e})=>th(e?.characteristics?.map(t=>t?.type??"")),getSourcePath:e=>Ht(e.accusedIndex,["characteristics","type"],e.fieldTailSegments)},characteristics_source:{path:["characteristics","source"],label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_SOURCE,getValue:({accused:e})=>th(e?.characteristics?.map(t=>t?.source??"")),getSourcePath:e=>Ht(e.accusedIndex,["characteristics","source"],e.fieldTailSegments)},characteristics_quote:{path:["characteristics","quote"],label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_QUOTE,getValue:({accused:e})=>th(e?.characteristics?.map(t=>t?.quote??"")),getSourcePath:e=>Ht(e.accusedIndex,["characteristics","quote"],e.fieldTailSegments)},criminal_records_article:{path:["criminal_records","law","article"],label:h.client.case.firstInstance.information.accused.fields.ARTICLE,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(u=>u.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0,i=r?.law?.clause,o=r?.law?.part,c=r?.law?.article;return c?et({clause:i,part:o,number:c}):""},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","law","article"],e.fieldTailSegments)},criminal_records_is_law_removed:{path:["criminal_records","law","is_law_removed"],label:h.client.case.f
866irstInstance.information.accused.fields.IS_LAW_REMOVED,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(i=>i.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0;return Fc(r?.law?.is_law_removed)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","law","is_law_removed"],e.fieldTailSegments)},criminal_records_description:{path:["criminal_records","description"],label:h.client.case.firstInstance.information.accused.fields.DESCRIPTION,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(i=>i.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0;return hP(r?.description??"")},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","description"],e.fieldTailSegments)},criminal_records_is_recidivism:{path:["criminal_records","is_recidivism"],label:h.client.case.firstInstance.information.accused.fields.IS_RECIDIVISM,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(i=>i.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0;return Fc(r?.is_recidivism)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","is_recidivism"],e.fieldTailSegments)},criminal_records_crime_stage_is_article_30_applied:{path:["criminal_records","qualification","crime_stage","is_article_30_applied"],label:h.client.case.firstInstance.information.accused.fields.CRIME_STAGE_IS_ARTICLE_30_APPLIED,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(i=>i.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0;return Fc(r?.qualification?.crime_stage?.is_article_30_applied)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","qualification","crime_stage","is_article_30_applied"],e.fieldTailSegments)},criminal_records_crime_stage_article_30_part:{path:["criminal_records","qualification","crime_stage","article_30_part"],label:h.client.case.firstInstance.information.accused.fields.CRIME_STAGE_ARTICLE_30_PART,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(o=>o.name==="criminal_records")?.indices?.[0]??0,i=(Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0)?.qualification?.crime_stage?.article_30_part;return i==null?"":String(i)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","qualification","crime_stage","article_30_part"],e.fieldTailSegments)},criminal_records_participant_role_is_article_33_applied:{path:["criminal_records","qualification","participant_role","is_article_33_applied"],label:h.client.case.firstInstance.information.accused.fields.PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(i=>i.name==="criminal_records")?.indices?.[0]??0,r=Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0;return Fc(r?.qualification?.participant_role?.is_article_33_applied)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","qualification","participant_role","is_article_33_applied"],e.fieldTailSegments)},criminal_records_participant_role_article_33_part:{path:["criminal_records","qualification","participant_role","article_33_part"],label:h.client.case.firstInstance.information.accused.fields.PARTICIPANT_ROLE_ARTICLE_33_PART,getValue:({accused:e,fieldTailSegments:t})=>{const s=t?.find(o=>o.name==="criminal_records")?.indices?.[0]??0,i=(Array.isArray(e?.criminal_records)?e?.criminal_records[s]:void 0)?.qualification?.participant_role?.article_33_part;return i==null?"":String(i)},getSourcePath:e=>Ht(e.accusedIndex,["criminal_records","qualification","participant_role","article_33_part"],e.fieldTailSegments)}},mP=e=>{const{fieldTailPath:t,fieldTailSegments:n,accused:s,caseData:r,accusedIndex:i}=e,o=Object.entries(Dce).find(([,g])=>g.path.join("/")===(t??[]).join("/"));if(!o)return;const[,c]=o,u=(()=>{if(c.getValue)return c.getValue({accused:s,caseData:r,fieldTailSegments:n});const g=Nce(s,c.path);return hP(g)})(),d=Ht(i,c.path,n),p=c.getSourcePath({accusedIndex:i,fieldTailSegments:n});return{label:c.label,value:u,sourcePath:p??d}},dA=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},kce=(e,t,n)=>{const s=e??[];if(!Array.isArray(s)||s.length===0)return;const i=t?.find(o=>o.name===n)?.indices?.[0]??0;return s[i]??void 0},Oce=e=>{if(e!==void 0)return`caseData._source.circumstances[${e}]`},gP=(e,t)=>t?.find(n=>n.name===e&&n.indices.length===1)?.indices?.[0],Pce=(e,t,n,s)=>{const r=Oce(e);if(!r)return;let i=r;for(const o of t){if(o==="related_circumstances"){const c=s??gP(o,n)??0;i+=`[${c}].${o}`;continue}i+=`.${o}`}return i},Lce={description:{path:["related_circumstances","description"],label:h.client.case.f
866irstInstance.circumstances.circumstance.fields.QUOTE,getValue:({related:e})=>dA(e?.description)},type:{path:["related_circumstances","type"],label:h.client.case.firstInstance.circumstances.circumstance.fields.TYPE,getValue:({related:e})=>dA(e?.type)},consideration_type:{path:["related_circumstances","consideration_type"],label:h.client.case.firstInstance.circumstances.circumstance.fields.CONSIDERATION_RESULT,getValue:({related:e})=>dA(e?.consideration_type??"")}},Mce=e=>{const{fieldTailPath:t,fieldTailSegments:n,circumstance:s,caseData:r,circumstanceIndex:i,relatedIndex:o}=e,c=(t??[]).join("/"),u=Object.entries(Lce).find(([,x])=>x.path.join("/")===c);if(!u)return;const[,d]=u,p=kce(s?.related_circumstances,n,"related_circumstances"),g=o??gP("related_circumstances",n)??0,A=d.getValue?d.getValue({circumstance:s,related:p,caseData:r,fieldTailSegments:n}):dA((()=>{let x=p;for(const y of d.path.filter(I=>I!=="related_circumstances")){if(x==null||typeof x!="object"||Array.isArray(x))return"";x=x[y]}return x})()),E=Pce(i,d.path,n,g);return{label:d.label,value:A,sourcePath:E}},_w=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},nh=e=>{if(!Array.isArray(e))return"";const t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length===0?"":t.join(", ")},jce=({eventIndex:e,felonyIndex:t,subjectivePartIndex:n})=>{if(e!==void 0&&t!==void 0&&n!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}].subjective_parts[${n}]`},Uc=(e,t)=>{const n=jce(e);if(n)return`${n}.${t}`},AP={role:{label:h.client.case.firstInstance.fabula.event.fields.SUBJECT_ROLE,getValue:({subjectivePart:e})=>_w(e?.role),getSourcePath:e=>Uc(e,"role")},intent_type:{label:h.client.case.firstInstance.fabula.event.fields.INTENT_TYPE,getValue:({subjectivePart:e})=>_w(e?.intent_type),getSourcePath:e=>Uc(e,"intent_type")},intents:{label:h.client.case.firstInstance.fabula.event.fields.INTENTS,getValue:({subjectivePart:e})=>nh(e?.intents),getSourcePath:e=>Uc(e,"intents")},motives:{label:h.client.case.firstInstance.fabula.event.fields.MOTIVES,getValue:({subjectivePart:e})=>nh(e?.motives),getSourcePath:e=>Uc(e,"motives")},goals:{label:h.client.case.firstInstance.fabula.event.fields.GOALS,getValue:({subjectivePart:e})=>nh(e?.goals),getSourcePath:e=>Uc(e,"goals")},emotions:{label:h.client.case.firstInstance.fabula.event.fields.EMOTIONS,getValue:({subjectivePart:e})=>nh(e?.emotions),getSourcePath:e=>Uc(e,"emotions")},mental_states:{label:h.client.case.firstInstance.fabula.event.fields.MENTAL_STATES,getValue:({subjectivePart:e})=>nh(e?.mental_states),getSourcePath:e=>Uc(e,"mental_states")}},Bce=e=>{const{fieldName:t,subjectivePart:n,caseData:s,eventIndex:r,felonyIndex:i,subjectivePartIndex:o}=e;if(!t)return;const c=AP[t];if(!c)return;const u=c.getValue({subjectivePart:n,caseData:s}),d=c.getSourcePath({eventIndex:r,felonyIndex:i,subjectivePartIndex:o});return{label:c.label,value:u,sourcePath:d}},Fce=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},EP={primary_object_description:{path:["primary_object","description"],label:h.client.case.firstInstance.fabula.event.fields.OBJECT_DESCRIPTION},related_law_description:{path:["primary_object","related_law","description"],label:h.client.case.firstInstance.fabula.event.fields.RELATED_LAW_DESCRIPTION},article:{path:["primary_object","related_law","law","article"],label:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE},is_law_removed:{path:["primary_object","related_law","law","is_law_removed"],label:h.client.case.firstInstance.fabula.event.fields.LAW_IS_REMOVED,getValue:({objects:e})=>{const t=e?.primary_object?.related_law?.law?.is_law_removed;return t==null?"":String(t)}}},Uce=e=>{const{fieldName:t,objects:n,caseData:s}=e;if(!t)return;const r=EP[t];if(!r)return;const i=(()=>{if(r.getValue)return r.getValue({objects:n,caseData:s});const c=((u,d)=>{let p=u;for(const g of d){if(p==null||typeof p!="object"||Array.isArray(p))return;p=p[g]}return p})(n,r.path);return Fce(c)})();return{label:r.label,value:i}},Tw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Vy=e=>{const t=e?.actions??[];if(Array.isArray(t)&&t.length!==0)return t[0]}
866,xP={description:{label:h.client.case.firstInstance.fabula.event.fields.ACTION_DESCRIPTION,getValue:({objectivePart:e})=>{const t=Vy(e);return Tw(t?.description)}},date:{label:h.client.case.firstInstance.fabula.event.link.fields.DATE,getValue:({objectivePart:e})=>{const t=Vy(e),n=(()=>{const s=t?.date;if(typeof s=="string")return s;const r=t?.data;return typeof r=="string"?r:""})();return Kt({dateString:n,isWithTime:!1,isShortMonth:!1})}},location:{label:h.client.case.firstInstance.fabula.event.link.fields.LOCATION,getValue:({objectivePart:e})=>{const t=Vy(e);return Tw(t?.location)}}},zce=e=>{const{fieldName:t,objectivePart:n,caseData:s}=e;if(!t)return;const r=xP[t];if(!r)return;const i=r.getValue({objectivePart:n,caseData:s});return{label:r.label,value:i}},Nw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},CP={event_description:{label:h.client.case.firstInstance.fabula.event.fields.EVENT_DESCRIPTION,getValue:({event:e})=>Nw(e?.event_description)},location:{label:h.client.case.firstInstance.fabula.event.link.fields.LOCATION,getValue:({event:e})=>Nw(e?.location)}},Qce=e=>{const{fieldName:t,event:n,caseData:s}=e;if(!t)return;const r=CP[t];if(!r)return;const i=r.getValue({event:n,caseData:s});return{label:r.label,value:i}},Hce=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Vce=({eventIndex:e,felonyIndex:t})=>{if(e!==void 0&&t!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}]`},Gce=(e,t)=>{const n=Vce(e);if(n)return`${n}.${t}`},yP={severity:{label:h.client.case.firstInstance.fabula.event.fields.SEVERITY,getValue:({felony:e})=>Hce(e?.severity),getSourcePath:e=>Gce(e,"severity")}},qce=e=>{const{fieldName:t,felony:n,caseData:s,eventIndex:r,felonyIndex:i}=e;if(!t)return;const o=yP[t];if(!o)return;const c=o.getValue({felony:n,caseData:s}),u=o.getSourcePath({eventIndex:r,felonyIndex:i});return{label:o.label,value:c,sourcePath:u}},ww=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Wce=e=>{const t=e.map(n=>n.trim()).filter(n=>n.length>0);return t.length===0?"":t.join(", ")},w0=(e,t)=>{const n=e?.victims_harm??[];if(!Array.isArray(n))return"";const s=n.map(r=>{if(!r)return"";const i=(()=>{if(t==="injuries")return r.injuries;if(t==="physical_harm")return r.physical_harm;if(t==="emotional_harm")return r.emotional_harm;if(t==="material_harm")return r.material_harm})();return typeof i=="string"?i:""}).filter(r=>r.length>0);return Wce(s)},qI=({eventIndex:e,felonyIndex:t,actionIndex:n})=>{if(e!==void 0&&t!==void 0&&n!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}].objective_part.actions[${n}]`},Kce=(e,t,n)=>{if(n!==void 0)return n;const s=e?.victims_harm??[];if(!Array.isArray(s)||s.length===0)return 0;const r=s.findIndex(i=>{if(!i)return!1;const o=i[t];return typeof o=="string"&&o.trim().length>0});return r>=0?r:0},R0=(e,t)=>{const n=qI(e);if(!n)return;const s=Kce(e.action,t,e.harmIndex);return`${n}.victims_harm[${s}].${t}`},bP={description:{label:h.client.case.firstInstance.fabula.event.fields.ACTION_DESCRIPTION,getValue:({action:e})=>ww(e?.description),getSourcePath:e=>{const t=qI(e);if(t)return`${t}.description`}},method:{label:h.client.case.firstInstance.fabula.event.fields.ACTION_METHOD,getValue:({action:e})=>ww(e?.method),getSourcePath:e=>{const t=qI(e);if(t)return`${t}.method`}},injuries:{label:h.client.case.firstInstance.fabula.event.fields.INJURIES,getValue:({action:e})=>w0(e,"injuries"),getSourcePath:e=>R0(e,"injuries")},physical_harm:{label:h.client.case.firstInstance.fabula.event.fields.PHYSICAL_HARM,getValue:({action:e})=>w0(e,"physical_harm"),getSourcePath:e=>R0(e,"physical_harm")},emotional_harm:{label:h.client.case.firstInstance.fabula.event.fields.EMOTIONAL_HARM,getValue:({action:e})=>w0(e,"emotional_harm"),getSourcePath:e=>R0(e,"emotional_harm")},material_harm:{label:h.client.case.firstInstance.fabula.event.fields.MATERIAL_HARM,getValue:({action:e})=>w0(e,"material_harm"),getSourcePath:e=>R0(e,"material_harm")}},$ce=e=>{const{fieldName:t,action:n,caseData:s,eventIndex:r,felonyIndex:i,actionIndex:o,harmIndex:c}=e;if(!t)return;const u=bP[t];if(!u)return;const d=u.getValue({action:n,caseData:s}),p=u.getSourcePath({eventIndex:r,felonyIndex:i,actionIndex:o,harmIndex:c,action:n});return{label:u.label,value:d,sourcePath:p}},ui={evidence:{getLinkFieldData:dP},testimony:{getLinkFieldData:Tce},accused:{getLinkFieldData:mP},circumstance:{getLinkFieldData:Mce},subjectivePart:{linkFieldConfig:AP,getLinkFieldData:Bce},objects:{linkFieldConfig:EP,getLinkFieldData:Uce},objectivePart:{linkFieldConfig:xP,getLinkFieldData:zce},event:{linkFieldConfig:CP,getLinkFieldData:Qce},felony:{linkFieldConfig:yP,getLinkFieldData:qce},action:{linkFieldConfig:bP,getLinkFieldData:$ce}},Yce=({label:e,to:t,isActive:n,isError:s,onClick:r,kebabMenuItems:i,isKebabMenuDisabled:o})=>{const[c,u]=l.useState(!1),[d,p]=l.useState(!1);l.useEffect(()=>{if(!(typeof window<"u"&&typeof window.matchMedia=="function")){u(!1);return}u(window.matchMedia("(pointer: coarse)").matches)},[]);const g=l.useMemo(()=>!i?.length||o?null:a.jsx(Ss,{items:i,isNavigationPill:!0,onOpenChange:p}),[i,o]);return t?a.jsxs(Je,{to:t,end:!0,className:({isActive:A})=>{const E=n||A;return Y("relative group","roboto-flex-25-700-1","px-1.5","text-[14px]","leading-[24px]","transition-colors","cursor-pointer","uppercase","whitespace-nowrap",c&&"pr-6",!E&&"bg-transparent",!E&&"text-zinc-400",!E&&"hover:text-zinc-500",!!E&&"bg-zinc-100",!!E&&"text-black")},onClick:r,children:[a.jsxs("span",{className:Y("inline-block relative",!!s&&"pl-2.5"),children:[!!s&&a.jsx("figure",{className:"absolute left-0 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-red-500"}),e]}),!!g&&a.jsx("div",{className:Y("transition-opacity",!!(c||d)&&"opacity-100 pointer-events-auto",!c&&!d&&"opacity-0 pointer-events-none",!c&&!d&&"group-hover:opacity-100 group-hover:pointer-events-auto"),children:g})]}):a.jsxs("div",{className:Y("relative group","roboto-flex-25-700-1","px-1.5","text-[14px]","leading-[24px]","transition-colors","cursor-pointer","whitespace-nowrap",c&&"pr-6",!n&&"bg-transparent",!n&&"text-zinc-400",!!n&&"bg-zinc-50",!!n&&"text-black"),onClick:r,children:[a.jsxs("span",{className:Y("inline-block relative",!!s&&"pl-2.5"),children:[!!s&&a.jsx("figure",{className:"absolute left-0 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-red-500"}),e]}),!!g&&a.jsx("div",{className:Y("transition-opacity",!!(c||d)&&"opacity-100 pointer-events-auto",!c&&!d&&"opacity-0 pointer-events-none",!c&&!d&&"group-hover:opacity-100 group-hover:pointer-events-auto"),children:g})]})},IP=({items:e,isKebabMenuDisabled:t=!1})=>a.jsx("div",{className:"items-center bg-white flex flex-wrap gap-1",children:e.map((n,s)=>a.jsx(Yce,{label:n.label,to:n.to,isError:n.isError,isActive:n.isActive,onClick:n.onClick,kebabMenuItems:n.kebabMenuItems,isKebabMenuDisabled:t},s))}),Xce=({caseData:e,eventIndex:t=0,felonyIndex:n})=>{const{id:s,listInstance:r,caseId:i,caseInstance:o}=st(),c=`/clients/${s}/cases/${r??"first-instance"}/${i}/${o??"first-instance"}`,u=l.useMemo(()=>e?._source?.case_narrative?.events?.[t],[e,t]),d=l.useMemo(()=>u?.felonies??[],[u]),p=l.useMemo(()=>!d.length||n===void 0||!d[n]?0:n,[d,n]),g=`caseData._source.case_narrative.events[${t}]`,A=`${g}
866.felonies[${p}]`,E=l.useMemo(()=>{if(d.length)return n===void 0||!d?.[n]?d[0]:d[n]},[d,n]),x=l.useMemo(()=>u?u?.is_context_event===!0?[]:d.map((b,w)=>{const _=b?.objects?.primary_object?.related_law?.law,N=_?.article?et({clause:_?.clause,part:_?.part,number:_.article}):"",R=`${c}/fabula`,D=w===0?t===0?R:`${R}/${t}`:t===0?`${R}/0/${w}`:`${R}/${t}/${w}`;return{id:String(w),label:N,to:D}}).filter(b=>!!b.label):[],[u,d,t,c]),y=l.useMemo(()=>[{rows:[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.EVENT_DESCRIPTION,value:u?.event_description,sourcePath:`${g}.event_description`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},...u?.is_context_event===!0?[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.EVENT_TYPE,value:h.client.case.firstInstance.fabula.event.values.CONTEXT,sourcePath:`${g}.is_context_event`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED,hint:h.client.case.firstInstance.fabula.event.hints.CONTEXT_EVENT}}]:[],...u?.is_context_event!==!0?[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.SEVERITY,value:E?.severity,sourcePath:`${A}.severity`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}]:[]]}],[u?.event_description,u?.is_context_event,g,A,E?.severity]),I=l.useMemo(()=>{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.objects?.primary_object?.description,w=E?.objects?.primary_object?.related_law,_=w?.law,N=[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.OBJECT_DESCRIPTION,value:b,sourcePath:`${A}.objects.primary_object.description`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.LAW_ARTICLE,value:_?.article?et({clause:_?.clause,part:_?.part,number:_.article}):null,sourcePath:`${A}.objects.primary_object.related_law.law`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.fabula.event.fields.LAW_IS_REMOVED,value:_?.is_law_removed,sourcePath:`${A}.objects.primary_object.related_law.law.is_law_removed`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.RELATED_LAW_DESCRIPTION,value:w?.description,sourcePath:`${A}.objects.primary_object.related_law.description`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}],R=[{title:h.client.case.firstInstance.fabula.event.titles.PRIMARY_OBJECT,rows:N}],D=E?.objects?.secondary_objects;return D&&Array.isArray(D)&&D.length&&R.push({title:h.client.case.firstInstance.fabula.event.titles.SECONDARY_OBJECTS,rows:[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.SECONDARY_OBJECT_DESCRIPTION,value:D.join(", "),sourcePath:`${A}.objects.secondary_objects`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}),R},[u,A,E]),v=l.useMemo(()=>{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.subjective_parts??[];if(!Array.isArray(b))return[];if(!b.length)return[];const w=e?._source?.general_information?.accused??[];return b.map((_,N)=>{const R=(()=>{const k=_?.related_accused_id;return k?w?.find(O=>O?.id===k)?.name:null})(),D=_?.role;return{title:[R,D].filter(Boolean).join(" — "),rows:[{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.INTENT_TYPE,value:_?.intent_type,sourcePath:`${A}.subjective_parts[${N}].intent_type`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.INTENTS,value:Array.isArray(_?.intents)&&_?.intents?.length?(_?.intents).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].intents`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}
866,{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.MOTIVES,value:Array.isArray(_?.motives)&&_?.motives?.length?(_?.motives).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].motives`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.GOALS,value:Array.isArray(_?.goals)&&_?.goals?.length?(_?.goals).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].goals`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.EMOTIONS,value:Array.isArray(_?.emotions)&&_?.emotions?.length?(_?.emotions).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].emotions`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.MENTAL_STATES,value:Array.isArray(_?.mental_states)&&_?.mental_states?.length?(_?.mental_states).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].mental_states`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}})},[e?._source?.general_information?.accused,u,A,E]),S=l.useMemo(()=>{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.objective_part?.actions??[];return Array.isArray(b)?b.length?b.reduce((w,_,N)=>{w.push({anchor:`action-${N}`,title:`${h.client.case.firstInstance.fabula.event.titles.ACTION} ${N+1}`,rows:[{text:{type:"plainLink",label:h.client.case.firstInstance.fabula.event.fields.ACCUSED_NAMES,value:Wi({ids:_?.accused_ids??null,path:"general_information.accused",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].accused_ids`,caseData:e,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"plainLink",label:h.client.case.firstInstance.fabula.event.fields.WITNESSES_NAMES,value:Wi({ids:_?.witnesses_ids??null,path:"general_information.witnesses_details",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].witnesses_ids`,caseData:e,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.ACTION_DESCRIPTION,value:_?.description,sourcePath:`${A}.objective_part.actions[${N}].description`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.ACTION_METHOD,value:_?.method,sourcePath:`${A}.objective_part.actions[${N}].method`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}]});const R=(_?.victims_harm??[]).filter(Boolean).map((D,k)=>({rows:[{text:{type:"plainLink",label:h.client.case.firstInstance.fabula.event.fields.VICTIM_NAME,value:Wi({ids:D?.related_victim_id??null,path:"general_information.victims_details",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].related_victim_id`,caseData:e,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.INJURIES,value:D?.injuries,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].injuries`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.PHYSICAL_HARM,value:D?.physical_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].physical_harm`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.EMOTIONAL_HARM,value:D?.emotional_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].emotional_harm`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.fabula.event.fields.MATERIAL_HARM,value:D?.material_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}
866].material_harm`,placeholder:h.client.case.firstInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}));return R.length&&w.push({title:h.client.case.firstInstance.fabula.event.titles.HARM,isSecondaryTitle:!0,rowsGroups:R}),w},[]):[]:[]},[e,u,A,E]);return a.jsxs("div",{children:[!!x.length&&a.jsx("div",{className:"mb-6",children:a.jsx(IP,{items:x})},"pills"),y.map((b,w)=>a.jsx(Nt,{title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:ui},w)),!!I.length&&a.jsx(Kr,{title:h.client.case.firstInstance.fabula.event.titles.OBJECTS,anchor:"objects",className:"mt-6",children:I.map((b,w)=>a.jsx(Nt,{title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:ui},w))},"objects"),!!S.length&&a.jsx(Kr,{title:h.client.case.firstInstance.fabula.event.titles.OBJECTIVE_PART,anchor:"objective-part",className:"mt-6",children:S.map((b,w)=>a.jsx(Nt,{anchor:b.anchor,title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,isSecondaryTitle:b.isSecondaryTitle,linkFieldConfigs:ui},w))},"objectivePart"),!!v.length&&a.jsx(Kr,{title:h.client.case.firstInstance.fabula.event.titles.SUBJECTIVE_PARTS,className:"mt-6",children:v.map((b,w)=>a.jsx(Nt,{anchor:`subjective-part-${w}`,title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:ui},w))},"subjectivePart")]})},Ii=({initialSearchTerms:e,initialSearchPickMode:t}={})=>{const n=at(),s=Fe(),{id:r,listInstance:i,caseId:o,caseInstance:c}=st();return{handleSourceClick:l.useCallback(()=>{if(!r||!o){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE,key:"SOURCE_FILE_NOT_AVAILABLE"});return}const d=i??"first-instance",p=c==="first-instance"||c==="second-instance"?c:d,g=sr(e),E={...s.state??{},isForceCaseSourceAnimateOnStart:!0,isCaseSourceOpenedFromCaseCard:!0,returnToPath:s.pathname,returnToState:s.state};g.length?(E.initialSearchTerms=g,E.initialSearchPickMode=t??"first"):(delete E.initialSearchTerms,delete E.initialSearchPickMode),n(`/clients/${r}/cases/${d}/${o}/${p}/source`,{state:E})},[r,o,i,c,n,s.pathname,s.state,e,t])}},Jce=["Установил","Постановил","Определил"],Zce=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i,eventId:o,felonyId:c}=st(),u=`/clients/${n}/cases/${s??"first-instance"}/${r}/${i??"first-instance"}`,d=Fe(),p=l.useRef(null),g=l.useRef(null),A=l.useMemo(()=>(e?._source?.case_narrative?.events??[]).map((b,w)=>({id:b?.event_id??`event-${w}`,title:`${h.client.case.firstInstance.fabula.menu.items.EVENT} ${w+1}`,text:b?.event_description,date:b?.date&&Kt({dateString:String(b.date).trim(),isWithTime:!1,isShortMonth:!1})||void 0,instance:b?.location,to:w===0?`${u}/fabula`:`${u}/fabula/${w}`,state:d.state})),[e,u,d.state]),E=l.useMemo(()=>{const S=Number(o);return!Number.isFinite(S)||S<0?0:Math.min(Math.max(0,S),Math.max(0,A.length-1))},[o,A.length]),x=l.useMemo(()=>e?._source?.case_narrative?.events?.[E]?.felonies??[],[E,e]),y=l.useMemo(()=>{const S=Number(c);return!Number.isFinite(S)||S<0?0:Math.min(Math.max(0,S),Math.max(0,x.length-1))},[c,x.length]),I=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/:eventId/*");_s({containerRef:g,activeElementRef:p,isReady:!!e,isActive:!!I});const{handleSourceClick:v}=Ii({initialSearchTerms:Jce});return a.jsx(Yn,{leftColumn:a.jsx("div",{children:A.map((S,b)=>{const w=I?E===b:b===0;return a.jsx(Kn,{ref:w?p:null,title:S.title,text:S.text??void 0,description:S.date??void 0,instance:S.instance??void 0,isTextBlockLimited:!0,to:S.to,state:S.state,isActive:w},S.id)})}),leftColumnStickyTitle:h.client.case.firstInstance.fabula.menu.titles.SECTION,rightColumn:a.jsx(Xce,{caseData:e,eventIndex:E,felonyIndex:y}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:A[E]?.title}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:v,children:h.client.cases.links.SOURCE})})]}),rightStickyTitleRef:t,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:g})},eue=({caseData:e,circumstanceIndex:t,relatedIndex:n})=>{const s=l.useMemo(()=>{const r=t??0,i=n??0,o=e?._source?.circumstances?.[r],c=o?.related_circumstances?.[i],u=`caseData._source.circumstances[${r}]`;if(!c)return[];const d=(()=>{const x=new Map;
866return(e?._source?.case_narrative?.events??[]).forEach(I=>{(I?.felonies??[]).forEach(S=>{const b=S?.felony_id??void 0;if(!b)return;const w=S?.objects?.primary_object?.related_law?.law,_=w?.part,N=w?.article,R=w?.clause;if(!N)return;const D=et({clause:R,part:_,number:N});D&&x.set(String(b),D)})}),x})(),p=Array.isArray(c?.felony_ids)?c.felony_ids.map(x=>x?d.get(String(x))??"":"").filter(x=>x.trim().length>0).join(", "):"",g=[{text:{type:"plainLink",label:h.client.case.firstInstance.circumstances.circumstance.fields.ACCUSED_NAME,value:Wi({ids:o?.related_accused_id??null,path:"general_information.accused",caseData:e}),sourcePath:`${u}.related_accused_id`,caseData:e,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.FELONY_IDS,value:p||null,sourcePath:`${u}.related_circumstances[${i}].felony_ids`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.CIRCUMSTANCE,value:c?.description,sourcePath:`${u}.related_circumstances[${i}].description`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.TYPE,value:c?.type,sourcePath:`${u}.related_circumstances[${i}].type`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},...c?.type===h.client.case.firstInstance.circumstances.circumstance.values.MITIGATING?[{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.CATEGORY,value:c?.mitigation_category,sourcePath:`${u}.related_circumstances[${i}].mitigation_category`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}]:[],...c?.type===h.client.case.firstInstance.circumstances.circumstance.values.AGGRAVATING?[{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.CATEGORY,value:c?.aggravation_category,sourcePath:`${u}.related_circumstances[${i}].aggravation_category`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"string",label:h.client.case.firstInstance.circumstances.circumstance.fields.CONSIDERATION_RESULT,value:c?.consideration_type,sourcePath:`${u}.related_circumstances[${i}].consideration_type`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}],A=(c?.quotes??[]).filter(Boolean),E=[{rows:g}];return A.length&&E.push({title:h.client.case.firstInstance.circumstances.circumstance.titles.QUOTES,isSecondaryTitle:!0,rowsGroups:[{rows:A.map((x,y)=>({text:{type:"string",label:`${h.client.case.firstInstance.circumstances.circumstance.fields.QUOTE}${A.length>1?` ${y+1}`:""}`,value:x,sourcePath:`${u}.related_circumstances[${i}].quotes[${y}]`,placeholder:h.client.case.firstInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}))}]}),E},[e,t,n]);return a.jsx("div",{children:s.map((r,i)=>a.jsx(Nt,{title:r.title??"",isSecondaryTitle:r.isSecondaryTitle,rows:r.rows,rowsGroups:r.rowsGroups},i))})},SP=({onSourceClick:e})=>a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsx("div",{className:"flex items-start justify-between pl-4",children:a.jsx("h1",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950",children:h.client.case.firstInstance.circumstances.menu.titles.SECTION})}),a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-center text-[16px] leading-[20px] text-zinc-500",children:h.client.case.firstInstance.circumstances.menu.titles.EMPTY}),a.jsx(ms,{theme:"secondary",onClick:e,children:h.client.cases.links.SOURCE})]})]}),tue=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=`/clients/${t}/cases/${n??"first-instance"}/${s}/${r??"first-instance"}`,o=Fe(),c=l.useRef(null),u=l.useRef(null),d=l.useMemo(()=>{const _=e?._source?.circumstances??[],N=e?._source?.general_information?.accused??[];return(_??[]).map((R,D)=>{const k=(()=>{const P=R?.related_accused_id??null;return P?N.find(F=>F?.id===P)?.name??"":""})(),L={id:`circumstance-${D}`,title:k},O=(R?.related_circumstances??[]).map((P,B)=>{const F=P?.circumstance_id??"",z=typeof F=="string"?F:"",Q=D===0&&B===0?`${i}/circumstances`:`${i}/circumstances/${z}`;return{id:`circumstance-${z||`${D}-${B}`}
866`,title:`${h.client.case.firstInstance.circumstances.menu.items.CIRCUMSTANCE} ${B+1}`,text:P.description??"",description:P?.type??"",instance:P?.consideration_type??"",to:Q,state:o.state,relatedCircumstanceId:z,circumstanceIndex:D,relatedCircumstanceIndex:B}});return{header:L,items:O}})},[e,i,o.state]),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances"),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances/:relatedCircumstanceId"),{circumstanceIndex:A,relatedIndex:E}=l.useMemo(()=>{if(p)return{circumstanceIndex:0,relatedIndex:0};const _=g?.params?.relatedCircumstanceId;if(typeof _=="string"&&_)for(let N=0;N<(d?.length??0);N++){const D=(d?.[N]?.items??[]).findIndex(k=>k.relatedCircumstanceId===_);if(D>=0)return{circumstanceIndex:N,relatedIndex:D}}return{circumstanceIndex:0,relatedIndex:0}},[p,g,d]),x=(_,N,R,D,k,L,O)=>_===R&&N===D||D===0&&R===0&&(L!==null||O!==null&&k===O?.params?.relatedCircumstanceId),y=l.useMemo(()=>(e?._source?.circumstances??[])[A]?.related_circumstances?.[E],[e,A,E]),I=l.useMemo(()=>{const _=y?.description??"",N=typeof _=="string"?_.trim():"";return N?ju({text:N,maxLength:130}):""},[y]),v=l.useMemo(()=>X1(y?.raw_quotes),[y]),S=l.useMemo(()=>{const _=sr(y?.raw_quotes);return _.length>0?_:sr(y?.quotes)},[y]),{handleSourceClick:b}=Ii({initialSearchTerms:S??[]}),w=d.every(_=>_.items.length===0);return _s({containerRef:u,activeElementRef:c,isReady:!!e,isActive:!!g}),w?a.jsx(SP,{onSourceClick:b}):a.jsx(Yn,{leftColumn:a.jsx("div",{children:d.map((_,N)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:_.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),_.items.map((R,D)=>{const k=x(A,E,N,D,R.relatedCircumstanceId,p,g);return a.jsx(Kn,{ref:k?c:null,title:R.title,isTextBlockLimited:!0,isTextTruncated:!0,to:R.to,state:o.state,text:R.text,description:R.description,instance:R.instance,isActive:k},R.id)})]},_.header.id))}),leftColumnStickyTitle:h.client.case.firstInstance.circumstances.menu.titles.SECTION,rightColumn:a.jsx(eue,{caseData:e,circumstanceIndex:A,relatedIndex:E}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:I}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",type:v?"warning":"default",onClick:b,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:u})},nue=({caseData:e,index:t})=>{const n=l.useMemo(()=>{const s=t??0,r=e?._source?.evidence?.[s],i=`caseData._source.evidence[${s}]`;if(!r)return[];const o=[{text:{type:"plainLink",label:h.client.case.firstInstance.evidence.item.fields.ACCUSED_NAME,value:Wi({ids:r?.related_accused_ids??null,path:"general_information.accused",caseData:e}),sourcePath:`${i}.related_accused_ids`,caseData:e,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.DESCRIPTION,value:r?.description,sourcePath:`${i}.description`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.TYPE,value:r?.type,sourcePath:`${i}.type`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.CATEGORY,value:r?.category,sourcePath:`${i}.category`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.SUBCATEGORY,value:r?.subcategory,sourcePath:`${i}.subcategory`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.RESULT,value:r?.consideration_type,sourcePath:`${i}.consideration_type`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}
866,{text:{type:"boolean",label:h.client.case.firstInstance.evidence.item.fields.ADMISSIBILITY,value:r?.admissibility_status,sourcePath:`${i}.admissibility_status`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},...r?.admissibility_status===!1?[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.INADMISSIBILITY_REASON,value:r?.inadmissibility_reason,sourcePath:`${i}.inadmissibility_reason`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]:[]],c=(r?.quotes??[]).filter(Boolean),u=[{title:h.client.case.firstInstance.evidence.item.titles.EVIDENCE,rows:o}];c.length&&(c.length===1?u.push({title:h.client.case.firstInstance.evidence.item.titles.QUOTES,isSecondaryTitle:!0,rows:[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.QUOTE,value:c[0],sourcePath:`${i}.quotes[0]`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}):u.push({title:h.client.case.firstInstance.evidence.item.titles.QUOTES,isSecondaryTitle:!0,rowsGroups:[{rows:c.map((g,A)=>({text:{type:"string",label:`${h.client.case.firstInstance.evidence.item.fields.QUOTE} ${A+1}`,value:g,sourcePath:`${i}.quotes[${A}]`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}))}]}));const d=r?.usage_in_felonies??[],p=(()=>{const g=new Map;return(e?._source?.case_narrative?.events??[]).forEach(E=>{(E?.felonies??[]).forEach(y=>{const I=y?.felony_id??void 0;if(!I)return;const v=y?.objects?.primary_object?.related_law?.law,S=v?.part,b=v?.article,w=v?.clause;if(!b)return;const _=et({clause:w,part:S,number:b});g.set(I,_)})}),g})();return Array.isArray(d)&&d.length&&u.push({title:h.client.case.firstInstance.evidence.item.titles.USAGE_IN_FELONIES,rowsGroups:d.flatMap((g,A)=>{const E=[{title:h.client.case.firstInstance.evidence.item.titles.FELONY,isPrimaryTitle:!0,rows:[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.LAW_ARTICLE,value:(()=>{const S=g?.felony_id??void 0;if(S)return p.get(S)})(),sourcePath:`${i}.usage_in_felonies[${A}].felony_id`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.PURPOSE,value:g?.purpose,sourcePath:`${i}.usage_in_felonies[${A}].purpose`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.USED_BY,value:g?.used_by,sourcePath:`${i}.usage_in_felonies[${A}].used_by`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}],y=(Array.isArray(g?.case_narrative_field_links)?g.case_narrative_field_links:[]).filter(S=>pE(S)!=="UNKNOWN");if(y.length===0)return E;const I={title:h.client.case.firstInstance.evidence.item.titles.LINKS,isPrimaryTitle:!0},v=y.map((S,b)=>({rows:[{text:{type:"link",sourcePath:`${i}.usage_in_felonies[${A}].case_narrative_field_links[${b}]`,label:"",placeholder:"",value:S,caseData:e}}]}));return[...E,I,...v]})}),u},[e,t]);return a.jsx("div",{children:n.map(s=>a.jsx(Nt,{title:s.title??"",rows:s.rows,rowsGroups:s.rowsGroups,linkFieldConfigs:ui},s.title))})},sue=({caseData:e,index:t})=>{const n=l.useMemo(()=>{const s=t??0,r=e?._source?.testimonies?.[s],i=`caseData._source.testimonies[${s}]`;if(!r)return[];const c=[{title:"Показания",rows:[{text:{type:"plainLink",label:h.client.case.firstInstance.evidence.item.fields.ACCUSED_NAME,value:Wi({ids:r?.related_accused_ids??null,path:"general_information.accused",caseData:e}),sourcePath:`${i}.related_accused_ids`,caseData:e,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.DESCRIPTION,value:r?.description,sourcePath:`${i}.description`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.TYPE,value:r?.type,sourcePath:`${i}
866.type`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.CATEGORY,value:r?.category,sourcePath:`${i}.category`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.TESTIMONY_PERSON_NAME,value:r?.name??void 0,sourcePath:`${i}.name`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.RESULT,value:r?.consideration_type??void 0,sourcePath:`${i}.consideration_type`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.evidence.item.fields.ADMISSIBILITY,value:r?.admissibility_status??void 0,sourcePath:`${i}.admissibility_status`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},...r?.admissibility_status===!1?[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.INADMISSIBILITY_REASON,value:r?.inadmissibility_reason??void 0,sourcePath:`${i}.inadmissibility_reason`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]:[]]}],u=(r?.quotes??[]).filter(Boolean);u.length&&(u.length===1?c.push({title:h.client.case.firstInstance.evidence.item.titles.QUOTES,isSecondaryTitle:!0,rows:[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.QUOTE,value:u[0],sourcePath:`${i}.quotes[0]`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}):c.push({title:h.client.case.firstInstance.evidence.item.titles.QUOTES,isSecondaryTitle:!0,rowsGroups:[{rows:u.map((g,A)=>({text:{type:"string",label:`${h.client.case.firstInstance.evidence.item.fields.QUOTE} ${A+1}`,value:g,sourcePath:`${i}.quotes[${A}]`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}))}]}));const d=r?.usage_in_felonies??[],p=(()=>{const g=new Map;return(e?._source?.case_narrative?.events??[]).forEach(E=>{(E?.felonies??[]).forEach(y=>{const I=y?.felony_id??void 0;if(!I)return;const v=y?.objects?.primary_object?.related_law?.law,S=v?.part,b=v?.article,w=v?.clause;if(!b)return;const _=et({clause:w,part:S,number:b});g.set(I,_)})}),g})();return Array.isArray(d)&&d.length&&c.push({title:h.client.case.firstInstance.evidence.item.titles.USAGE_IN_FELONIES,rowsGroups:d.flatMap((g,A)=>{const E=[{title:h.client.case.firstInstance.evidence.item.titles.FELONY,isPrimaryTitle:!0,rows:[{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.LAW_ARTICLE,value:(()=>{const S=g?.felony_id??void 0;if(S)return p.get(S)})(),sourcePath:`${i}.usage_in_felonies[${A}].felony_id`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.PURPOSE,value:g?.purpose,sourcePath:`${i}.usage_in_felonies[${A}].purpose`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.evidence.item.fields.USED_BY,value:g?.used_by,sourcePath:`${i}.usage_in_felonies[${A}].used_by`,placeholder:h.client.case.firstInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}],y=(Array.isArray(g?.case_narrative_field_links)?g.case_narrative_field_links:[]).filter(S=>pE(S)!=="UNKNOWN");if(y.length===0)return E;const I={title:h.client.case.firstInstance.evidence.item.titles.LINKS,isPrimaryTitle:!0},v=y.map((S,b)=>({rows:[{text:{type:"link",sourcePath:`${i}.usage_in_felonies[${A}].case_narrative_field_links[${b}]`,label:"",placeholder:"",value:S,caseData:e}}]}));return[...E,I,...v]})}),c},[e,t]);return a.jsx("div",{children:n.map(s=>a.jsx(Nt,{title:s.title??"",rows:s.rows,rowsGroups:s.rowsGroups,linkFieldConfigs:ui},s.title))})},vP=({onSourceClick:e})=>a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsx("div",{className:"flex items-start justify-between pl-4",children:a.jsx("h1",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950",children:h.client.case.f
866irstInstance.evidence.menu.titles.SECTION})}),a.jsxs("div",{className:"flex flex-col flex-1 items-center justify-center gap-3",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-center text-[16px] leading-[20px] text-zinc-500",children:h.client.case.firstInstance.evidence.menu.titles.EMPTY}),a.jsx(ms,{theme:"secondary",onClick:e,children:h.client.cases.links.SOURCE})]})]}),rue=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=`/clients/${t}/cases/${n??"first-instance"}/${s}/${r??"first-instance"}`,o=Fe(),c=l.useRef(null),u=l.useRef(null),d=l.useMemo(()=>{const D=e?._source?.evidence??[],k=e?._source?.testimonies??[],L=e?._source?.general_information?.accused??[],O=new Map;L.forEach(z=>{const Q=z?.id;if(typeof Q=="string"&&Q){const M=z?.name??"",K=L.findIndex(W=>W?.id===Q);O.has(Q)||O.set(Q,{accusedId:Q,accusedName:M,accusedIndex:K,items:[]})}});const P=new Map;let B=1;D.forEach((z,Q)=>{const M=z?.evidence_id,W=`evidence-${(typeof M=="string"&&M?M:"")||Q}`;P.has(W)||(P.set(W,B),B++)}),k.forEach((z,Q)=>{const M=z?.testimony_id,W=`testimony-${(typeof M=="string"&&M?M:"")||Q}`;P.has(W)||(P.set(W,B),B++)}),D.forEach((z,Q)=>{const M=z?.evidence_title,K=z?.related_accused_ids??[],W=z?.evidence_id,H=typeof W=="string"&&W?W:"",j=`evidence-${H||Q}`,q=P.get(j)??Q+1,G=typeof M=="string"?M.trim():"";Array.isArray(K)&&K.length>0&&K.forEach($=>{typeof $=="string"&&O.has($)&&O.get($).items.push({id:`evidence-${H||Q}-${$}`,entityId:H,accusedId:$,text:G,title:`${h.client.case.firstInstance.evidence.menu.items.EVIDENCE} ${q}`,description:z?.type??"",instance:z?.consideration_type??"",to:`${i}/evidence/evidence/${$}/${H}`,state:o.state,type:"evidence",index:Q,evidenceIndex:Q})})}),k.forEach((z,Q)=>{const M=z?.description,K=typeof M=="string"?M.trim():"",W=z?.related_accused_ids??[],H=z?.testimony_id,j=typeof H=="string"&&H?H:"",q=`testimony-${j||Q}`,G=P.get(q)??Q+1;Array.isArray(W)&&W.length>0&&W.forEach($=>{typeof $=="string"&&O.has($)&&O.get($).items.push({id:`testimony-${j||Q}-${$}`,entityId:j,accusedId:$,text:K,title:`${h.client.case.firstInstance.evidence.menu.items.EVIDENCE} ${G}`,description:z?.type??"",instance:z?.consideration_type??"",to:`${i}/evidence/testimony/${$}/${j}`,state:o.state,type:"testimony",index:Q,testimonyIndex:Q})})});const F=Array.from(O.values()).sort((z,Q)=>z.accusedIndex-Q.accusedIndex).filter(z=>z.items.length>0);if(F.length>0&&F[0].items.length>0){const z=F[0].items[0],Q=D.length;z.type==="evidence"?z.to=`${i}/evidence`:z.to=Q>0?`${i}/evidence/testimony/${z.accusedId}/${z.entityId}`:`${i}/evidence`}return F.map(z=>({header:{id:`accused-${z.accusedId}`,title:z.accusedName},items:z.items}))},[e,i,o.state]),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/evidence/:accusedId/:itemId"),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/testimony/:accusedId/:itemId"),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence"),E=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/testimony"),{accusedIndex:x,itemIndex:y}=l.useMemo(()=>{if(A)return{accusedIndex:0,itemIndex:0};const D=p?.params?.itemId,k=p?.params?.accusedId;
866if(typeof D=="string"&&D&&typeof k=="string"&&k)for(let P=0;P<(d?.length??0);P++){const B=d?.[P];if(B?.header.id!==`accused-${k}`)continue;const z=(B.items??[]).findIndex(Q=>Q.type==="evidence"&&Q.entityId===D&&Q.accusedId===k);if(z>=0)return{accusedIndex:P,itemIndex:z}}const L=g?.params?.itemId,O=g?.params?.accusedId;if(typeof L=="string"&&L&&typeof O=="string"&&O)for(let P=0;P<(d?.length??0);P++){const B=d?.[P];if(B?.header.id!==`accused-${O}`)continue;const z=(B.items??[]).findIndex(Q=>Q.type==="testimony"&&Q.entityId===L&&Q.accusedId===O);if(z>=0)return{accusedIndex:P,itemIndex:z}}if(E&&(e?._source?.evidence??[]).length>0&&d?.[0]?.items?.length>0){const F=d[0].items.findIndex(z=>z.type==="testimony");if(F>=0)return{accusedIndex:0,itemIndex:F}}return{accusedIndex:0,itemIndex:0}},[p,g,A,E,d,e?._source?.evidence]),I=(D,k,L,O,P,B,F,z,Q)=>D===L&&k===O||O===0&&L===0&&(B!==null||F!==null||z!==null&&P.type==="evidence"&&P.entityId===z?.params?.itemId&&P.accusedId===z?.params?.accusedId||Q!==null&&P.type==="testimony"&&P.entityId===Q?.params?.itemId&&P.accusedId===Q?.params?.accusedId),v=l.useMemo(()=>
866{const D=d?.[x]?.items?.[y]?.text??"",k=typeof D=="string"?D.trim():"";return k?ju({text:k,maxLength:130}):""},[d,x,y]),S=d?.[x]?.items?.[y],b=l.useMemo(()=>{const D=d?.[x]?.items?.[y];if(D)return D.type==="evidence"?e?._source?.evidence?.[D.evidenceIndex??D.index]:e?._source?.testimonies?.[D.testimonyIndex??D.index]},[e,d,x,y]),w=l.useMemo(()=>X1(b?.raw_quotes),[b]),_=l.useMemo(()=>{if(!b)return;const D=sr(b.raw_quotes);return D.length>0?D:sr(b.quotes)},[b]),{handleSourceClick:N}=Ii({initialSearchTerms:_??[]}),R=l.useMemo(()=>d.every(D=>D.items.length===0),[d]);return _s({containerRef:u,activeElementRef:c,isReady:!!e,isActive:!!p||!!g}),R?a.jsx(vP,{onSourceClick:N}):a.jsx(Yn,{leftColumn:a.jsx("div",{children:d.map((D,k)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:D.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),D.items.map((L,O)=>{const P=I(x,y,k,O,L,A,E,p,g);return a.jsx(Kn,{ref:P?c:null,title:L.title,isTextBlockLimited:!0,isTextTruncated:!0,description:L.description,instance:L.instance,to:L.to,text:L.text,state:o.state,isActive:P},L.id)})]},D.header.id))}),leftColumnStickyTitle:h.client.case.firstInstance.evidence.menu.titles.SECTION,rightColumn:S?S.type==="evidence"?a.jsx(nue,{caseData:e,index:S.evidenceIndex??S.index}):a.jsx(sue,{caseData:e,index:S.testimonyIndex??S.index}):null,rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:v}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",type:w?"warning":"default",onClick:N,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:u})},iue=({caseData:e,accusedId:t,defenseRequestId:n})=>{const s=l.useMemo(()=>{const c=e?._source?.defense_requests??[];if(!Array.isArray(c)||c.length===0)return;const u=c.filter(p=>String(p?.related_accused_id??"")===String(t));return u.length===0?void 0:u.find(p=>String(p?.defense_request_id??"")===String(n))??u[0]},[e,t,n]),r=l.useMemo(()=>{if(!s)return"";const c=e?._source?.defense_requests??[];return`caseData._source.defense_requests[${Math.max(0,c.findIndex(d=>d===s))}]`},[e,s]),i=l.useMemo(()=>{if(!s||!r)return[];const c=s?.projected_goal,u=c==null,d=(()=>{const g=s?.laws??[];if(!Array.isArray(g)||g.length===0)return null;const A=g.map(E=>{const x=E?.part,y=E?.article,I=E?.clause,v=E?.code_type;return y?et({clause:I,part:x,number:y,codeType:v}):""}).filter(E=>typeof E=="string"&&E.trim().length>0);return A.length===0?null:A.join(", ")})();return[{rows:[{text:{type:"plainLink",label:h.client.case.firstInstance.defenseRequest.item.fields.ACCUSED_NAME,value:Wi({ids:s?.related_accused_id??null,path:"general_information.accused",caseData:e}),sourcePath:`${r}.related_accused_id`,caseData:e,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}},...u?[{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.GOAL,value:s?.goal,sourcePath:`${r}.goal`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}},...s?.goal===h.enums.requestGoals.OTHER?[{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.GOAL_DESCRIPTION,value:s?.goal_description,sourcePath:`${r}.goal_description`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}}]:[]]:[],{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.RESULT,value:s?.result,sourcePath:`${r}.result`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.LEGAL_BASIS,value:d,sourcePath:`${r}.laws`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}}]}]},[s,e,r]),o=l.useMemo(()=>!s||!r?[]:(Array.isArray(s?.defense_arguments)?s?.defense_arguments:[]).flatMap((d,p)=>
866{const g=[{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.ARGUMENT_DESCRIPTION,value:d?.description,sourcePath:`${r}.defense_arguments[${p}].description`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.ARGUMENT_RESULT,value:d?.argument_result,sourcePath:`${r}.defense_arguments[${p}].argument_result`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.defenseRequest.item.fields.LEGAL_BASIS,value:(()=>{const _=d?.laws??[];if(!Array.isArray(_)||_.length===0)return null;const N=_.map(R=>{const D=R?.part,k=R?.article,L=R?.clause,O=R?.code_type;return k?et({clause:L,part:D,number:k,codeType:O}):""}).filter(R=>typeof R=="string"&&R.trim().length>0);return N.length===0?null:N.join(", ")})(),sourcePath:`${r}.defense_arguments[${p}].laws`,placeholder:h.client.case.firstInstance.defenseRequest.item.placeholders.NOT_SPECIFIED}}],A=[],x=(Array.isArray(d?.argument_links)?d.argument_links:[]).map((_,N)=>{const R=_?.link,D=typeof R=="string"?R.trim():"";return Wl(D,e)?{rows:[{text:{type:"link",sourcePath:`${r}.defense_arguments[${p}].argument_links[${N}].link`,label:h.client.case.firstInstance.defenseRequest.item.fields.ARGUMENT_LINK_DESCRIPTION,placeholder:"",value:D,additionalFields:[{label:h.client.case.firstInstance.defenseRequest.item.fields.ARGUMENT_LINK_DESCRIPTION,value:_?.description,sourcePath:`${r}.defense_arguments[${p}].argument_links[${N}].description`}],caseData:e}}]}:null}).filter(_=>_!==null);x.length&&A.unshift(...x),(Array.isArray(d?.related_evidence_ids)?d?.related_evidence_ids.filter(Boolean):[]).forEach((_,N)=>{const R=(e?._source?.evidence??[]).findIndex(k=>k?.evidence_id===_);if(R<0)return;const D=`evidence[${R}]`;Wl(D,e)&&A.push({rows:[{text:{type:"link",sourcePath:`${r}.defense_arguments[${p}].related_evidence_ids[${N}]`,label:"",placeholder:"",value:D,caseData:e}}]})}),(Array.isArray(d?.related_testimony_ids)?d?.related_testimony_ids.filter(Boolean):[]).forEach((_,N)=>{const R=(e?._source?.testimonies??[]).findIndex(k=>k?.testimony_id===_);if(R<0)return;const D=`testimonies[${R}]`;Wl(D,e)&&A.push({rows:[{text:{type:"link",sourcePath:`${r}.defense_arguments[${p}].related_testimony_ids[${N}]`,label:"",placeholder:"",value:D,caseData:e}}]})}),(Array.isArray(d?.related_circumstance_ids)?d?.related_circumstance_ids.filter(Boolean):[]).forEach((_,N)=>{const R=e?._source?.circumstances??[];let D=-1,k=-1;if(R.forEach((O,P)=>{const F=(O?.related_circumstances??[]).findIndex(z=>z?.circumstance_id===_);F>=0&&D===-1&&(D=P,k=F)}),D<0||k<0)return;const L=`circumstances[${D}].related_circumstances[${k}]`;Wl(L,e)&&A.push({rows:[{text:{type:"link",sourcePath:`${r}.defense_arguments[${p}].related_circumstance_ids[${N}]`,label:"",placeholder:"",value:L,caseData:e}}]})});const S=d?.defense_argument_id,b=S==null?void 0:String(S);return[{anchorId:b||void 0,argumentCard:{title:`${h.client.case.firstInstance.defenseRequest.item.titles.ARGUMENT} ${p+1}`,rows:g},...A.length>0?{linkedItemsCard:{title:h.client.case.firstInstance.defenseRequest.item.titles.LINKED_ITEMS,rowsGroups:A}}:{}}]}),[s,e,r]);return a.jsxs("div",{children:[i.map((c,u)=>a.jsx(Nt,{title:c.title??"",isSecondaryTitle:c.isSecondaryTitle,rows:c.rows,rowsGroups:c.rowsGroups,linkFieldConfigs:ui},u)),o.map((c,u)=>a.jsxs("div",{id:c.anchorId,className:"mb-6 last:mb-0 scroll-mt-[116px]",children:[a.jsx(Nt,{title:c.argumentCard.title??"",isSecondaryTitle:c.argumentCard.isSecondaryTitle,rows:c.argumentCard.rows,rowsGroups:c.argumentCard.rowsGroups,linkFieldConfigs:ui}),c.linkedItemsCard&&a.jsx(Nt,{title:c.linkedItemsCard.title??"",isSecondaryTitle:c.linkedItemsCard.isSecondaryTitle,rows:c.linkedItemsCard.rows,rowsGroups:c.linkedItemsCard.rowsGroups,linkFieldConfigs:ui})]},`argument-pair-${u}`))]})},oue=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i,accusedId:o,requestId:c}=st(),u=`/clients/${n}/cases/${s??"first-instance"}/${r}/${i??"first-instance"}`,d=e?._source?.defense_requests,p=l.useMemo(()=>d?.some(B=>B?.goal===B?.result),[d]),g=l.useMemo(()=>
866{if(!d?.length||!p)return!1;if(!o||!c)return!0;const B=d.find(z=>String(z?.related_accused_id)!==String(o)?!1:String(z?.defense_request_id)===String(c));return B?B?.goal===B?.result:!0},[d,p,o,c]),[A,E]=l.useState(g),x=Fe(),y=l.useRef(null),I=l.useRef(null),v=l.useMemo(()=>{const B=new Map;return(e?._source?.case_narrative?.events??[]).forEach(z=>{(z?.felonies??[]).forEach(M=>{const K=M?.felony_id??void 0;if(!K)return;const W=M?.objects?.primary_object?.related_law?.law,H=W?.part,j=W?.article,q=W?.clause;if(!j)return;const G=et({clause:q,part:H,number:j});B.set(String(K),G)})}),B},[e?._source?.case_narrative?.events]),S=l.useMemo(()=>{const B=e?._source?.defense_requests??[],F=e?._source?.general_information?.accused??[],z=[],Q=new Map;return B.forEach(M=>{const K=M?.related_accused_id??"";Q.has(K)||(Q.set(K,[]),z.push(K)),Q.get(K)?.push(M)}),z.map(M=>{const K=(()=>{const $=F.find(ne=>ne?.id===M)?.name;return typeof $=="string"?$:""})(),W={id:`defense-accused-${M}`,title:K},H=Q.get(M)??[],q=(A?H.filter(G=>G?.goal===G?.result):H).map((G,$)=>{const J=G?.related_felony_id??void 0,ne=`${h.client.case.firstInstance.defenseRequest.menu.items.REQUEST} ${$+1}`,X=G?.is_request_successful?h.client.case.firstInstance.defenseRequest.menu.items.REQUEST_SUCCESSFUL:h.client.case.firstInstance.defenseRequest.menu.items.REQUEST_FAILED,oe=J?v.get(J)??"":"",ie=(()=>{const le=G?.goal??"",he=G?.laws??[];if(!Array.isArray(he)||he.length===0)return le;const fe=he[0];if(!fe?.article)return le;const ue=et({clause:fe.clause,part:fe.part,number:fe.article,codeType:fe.code_type});if(!ue)return le;const ye=he.length>1?he.length-1:0,ce=ye>0?` (+${ye})`:"";return`${ue}${ce} — ${le}`})(),ee=`${u}/defense-request/${M}/${G.defense_request_id}`,te=typeof x.state=="object"&&x.state!==null?x.state:void 0;return{id:`defense-accused-${M}-defense-request-${G.defense_request_id}`,title:ne,instance:oe,text:ie,description:X,to:ee,state:te,defenseRequestId:String(G.defense_request_id)}});return{header:W,items:q,accusedId:M}})},[e,u,x.state,A,v]),b=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request"),w=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request/:accusedId"),_=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request/:accusedId/:requestId"),{accusedId:N,requestDefenseRequestId:R}=l.useMemo(()=>{const B=S??[],F=()=>{const M=B[0],K=M?.items?.[0];return{accusedId:String(M?.accusedId??""),requestDefenseRequestId:String(K?.defenseRequestId??"")}};if(!B.length)return{accusedId:"",requestDefenseRequestId:""};const z=_&&_.params?.accusedId||w&&w.params?.accusedId||o,Q=_&&_.params?.requestId||c;if(_&&z&&Q){const M=B.findIndex(H=>String(H.accusedId)===String(z));if(M<0)return F();const K=B[M]?.items??[],W=K.findIndex(H=>String(H.defenseRequestId)===String(Q));return W<0?{accusedId:String(B[M].accusedId),requestDefenseRequestId:String(K[0]?.defenseRequestId??"")}:{accusedId:String(B[M].accusedId),requestDefenseRequestId:String(K[W].defenseRequestId)}}if(w&&z){const M=B.findIndex(W=>String(W.accusedId)===String(z));if(M<0)return F();const K=B[M]?.items??[];return{accusedId:String(B[M].accusedId),requestDefenseRequestId:String(K[0]?.defenseRequestId??"")}}return F()},[S,b,w,_,o,c]),D=l.useMemo(()=>{const B=e?._source?.case_narrative?.events??[],Q=(e?._source?.defense_requests??[]).find(G=>String(G?.related_accused_id)===String(N)&&String(G?.defense_request_id)===String(R))?.related_felony_id??void 0;if(!Q)return"";const M=B.flatMap(G=>(G.felonies??[]).map($=>({felony:$,event:G}))).filter(({felony:G})=>String(G?.felony_id)===String(Q));if(M.length!==1)return"";const{felony:K,event:W}=M[0];if(!K||!W)return"";const H=K?.event_id;if(!H)return"";const j=B.findIndex(G=>String(G?.event_id)===String(H));if(j===-1)return"";const q=W?.felonies?.findIndex(G=>String(G?.felony_id)===String(Q));return q===void 0||q===-1?"":j===0&&q===0||j===0?`${u}/fabula`:`${u}/fabula/${j}/${q}`},[e?._source?.defense_requests,N,R,e?._source?.case_narrative?.events,u]),k=l.useMemo(()=>{const z=(e?._source?.defense_requests??[]).find(K=>String(K?.related_accused_id)===String(N)&&String(K?.defense_request_id)===String(R))?.related_felony_id??void 0,Q=z?v.get(String(z))??"":"",M=typeof Q=="string"?Q.trim():"";return M?ju({text:M,maxLength:130}
866):h.client.case.firstInstance.defenseRequest.menu.titles.SECTION},[e?._source?.defense_requests,N,R,v]),L=l.useCallback(()=>{E(B=>!B)},[]),{handleSourceClick:O}=Ii(),P=l.useMemo(()=>{const B=D?a.jsx(Je,{ref:t,to:D,className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative cursor-pointer hover:text-zinc-700 underline decoration-[2%] underline-offset-[25%]",children:k}):a.jsx("div",{ref:t,className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:k});return a.jsxs("div",{children:[B,a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:O,children:h.client.cases.links.SOURCE})})]})},[D,k,t,O]);return _s({containerRef:I,activeElementRef:y,isReady:!!e,isActive:!!_}),a.jsx(Yn,{leftColumn:a.jsx("div",{children:S.map(B=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:B.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),B.items.map(F=>{const z=String(B.accusedId)===String(N)&&String(F.defenseRequestId)===String(R);return a.jsx(Kn,{ref:z?y:null,title:F.title,isTextBlockLimited:!0,text:F.text,instance:F.instance,description:F.description,isTextTruncated:!0,to:F.to,state:F.state,isActive:z},F.id)})]},B.header.id))}),leftColumnStickyTitle:a.jsxs("div",{className:"w-full flex flex-col items-start gap-y-3 bp72:flex-row bp72:items-center bp72:justify-between",children:[a.jsx("div",{className:"whitespace-nowrap",children:h.client.case.firstInstance.defenseRequest.menu.titles.SECTION}),!!p&&a.jsx("div",{className:"flex items-center justify-center mr-6 roboto-flex-25-700-1 h-6 text-[12px] leading-[14px] uppercase text-zinc-600 hover:text-zinc-950 bg-zinc-100 hover:bg-zinc-200 rounded-full px-3 cursor-pointer whitespace-nowrap",onClick:L,children:A?h.client.case.firstInstance.defenseRequest.menu.filters.ALL:h.client.case.firstInstance.defenseRequest.menu.filters.ONLY_ACCEPTED})]}),rightColumn:a.jsx(iue,{caseData:e,accusedId:N,defenseRequestId:R}),rightColumnStickyTitle:P,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:I})},aue=({caseData:e,groupIndex:t,requestIndex:n})=>{const s=l.useMemo(()=>{const u=e?._source?.prosecution_requests??[];if(!Array.isArray(u)||u.length===0)return;const d=e?._source?.defense_requests??[],p=new Map;d.forEach(y=>{const I=typeof y?.defense_request_id=="string"?y.defense_request_id:void 0;I&&p.set(I,y)});const g=[],A=new Map;u.forEach(y=>{const I=y?.related_defense_requests_id,v=typeof I=="string"?I:void 0,b=(v?p.get(v):void 0)?.related_accused_id??"";A.has(b)||(A.set(b,[]),g.push(b)),A.get(b)?.push(y)});const E=Math.max(0,Math.min(g.length-1,t??0)),x=Math.max(0,Math.min((A.get(g[E])?.length??1)-1,n??0));return A.get(g[E])?.[x]},[e,t,n]),r=l.useMemo(()=>{if(!s)return null;const u=e?._source?.defense_requests??[],d=new Map;u.forEach(x=>{const y=typeof x?.defense_request_id=="string"?x.defense_request_id:void 0;y&&d.set(y,x)});const p=s?.related_defense_requests_id,g=typeof p=="string"?p:void 0,E=(g?d.get(g):void 0)?.related_accused_id;return E?[E]:null},[s,e]),i=l.useMemo(()=>{if(!s)return"";const u=e?._source?.prosecution_requests??[];return`caseData._source.prosecution_requests[${Math.max(0,u.findIndex(p=>p===s))}]`},[e,s]),o=l.useMemo(()=>s?[{rows:[{text:{type:"plainLink",label:h.client.case.firstInstance.accusationRequest.item.fields.ACCUSED_NAME,value:Wi({ids:r,path:"general_information.accused",caseData:e}),sourcePath:`${i}.related_defense_requests_id`,caseData:e,placeholder:h.client.case.firstInstance.accusationRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.accusationRequest.item.fields.GOAL,value:s?.goal,sourcePath:`${i}.goal`,placeholder:h.client.case.firstInstance.accusationRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.accusationRequest.item.fields.RESULT,value:s.is_request_successful,sourcePath:`${i}.is_request_successful`,placeholder:h.client.case.firstInstance.accusationRequest.item.placeholders.NOT_SPECIFIED}}]}]:[],[s,e,r,i]),c=l.useMemo(()=>!s||!i?[]:(Array.isArray(s?.prosecution_arguments)?s?.prosecution_arguments:[]).flatMap((p,g)=>
866{const A=[{text:{type:"string",label:h.client.case.firstInstance.accusationRequest.item.fields.ARGUMENT_DESCRIPTION,value:p?.description,sourcePath:`${i}.prosecution_arguments[${g}].description`,placeholder:h.client.case.firstInstance.accusationRequest.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.accusationRequest.item.fields.ARGUMENT_RESULT,value:p?.argument_result,sourcePath:`${i}.prosecution_arguments[${g}].argument_result`,placeholder:h.client.case.firstInstance.accusationRequest.item.placeholders.NOT_SPECIFIED}}],E=[],y=(Array.isArray(p?.argument_links)?p.argument_links:[]).map((b,w)=>{const _=b?.link,N=typeof _=="string"?_.trim():"";return Wl(N,e)?{rows:[{text:{type:"link",sourcePath:`${i}.prosecution_arguments[${g}].argument_links[${w}].link`,label:h.client.case.firstInstance.accusationRequest.item.fields.ARGUMENT_LINK_DESCRIPTION,placeholder:"",value:N,additionalFields:[{label:h.client.case.firstInstance.accusationRequest.item.fields.ARGUMENT_LINK_DESCRIPTION,value:b?.description,sourcePath:`${i}.prosecution_arguments[${g}].argument_links[${w}].description`}],caseData:e}}]}:null}).filter(b=>b!==null);return y.length&&E.unshift(...y),(Array.isArray(p?.related_evidence_ids)?p?.related_evidence_ids.filter(Boolean):[]).forEach((b,w)=>{const _=(e?._source?.evidence??[]).findIndex(R=>R?.evidence_id===b);if(_<0)return;const N=`evidence[${_}]`;Wl(N,e)&&E.push({rows:[{text:{type:"link",sourcePath:`${i}.prosecution_arguments[${g}].related_evidence_ids[${w}]`,label:"",placeholder:"",value:N,caseData:e}}]})}),(Array.isArray(p?.related_testimony_ids)?p?.related_testimony_ids.filter(Boolean):[]).forEach((b,w)=>{const _=(e?._source?.testimonies??[]).findIndex(R=>R?.testimony_id===b);if(_<0)return;const N=`testimonies[${_}]`;Wl(N,e)&&E.push({rows:[{text:{type:"link",sourcePath:`${i}.prosecution_arguments[${g}].related_testimony_ids[${w}]`,label:"",placeholder:"",value:N,caseData:e}}]})}),(Array.isArray(p?.related_circumstance_ids)?p?.related_circumstance_ids.filter(Boolean):[]).forEach((b,w)=>{const _=e?._source?.circumstances??[];let N=-1,R=-1;if(_.forEach((k,L)=>{const P=(k?.related_circumstances??[]).findIndex(B=>B?.circumstance_id===b);P>=0&&N===-1&&(N=L,R=P)}),N<0||R<0)return;const D=`circumstances[${N}].related_circumstances[${R}]`;Wl(D,e)&&E.push({rows:[{text:{type:"link",sourcePath:`${i}.prosecution_arguments[${g}].related_circumstance_ids[${w}]`,label:"",placeholder:"",value:D,caseData:e}}]})}),[{argumentCard:{title:`${h.client.case.firstInstance.accusationRequest.item.titles.ARGUMENT} ${g+1}`,rows:A},...E.length>0?{linkedItemsCard:{title:h.client.case.firstInstance.accusationRequest.item.titles.LINKED_ITEMS,rowsGroups:E}}:{}}]}),[s,e,i]);return a.jsxs("div",{children:[o.map((u,d)=>a.jsx(Nt,{title:u.title??"",isSecondaryTitle:u.isSecondaryTitle,rows:u.rows,rowsGroups:u.rowsGroups,linkFieldConfigs:ui},d)),c.map((u,d)=>a.jsxs("div",{className:"mb-6 last:mb-0",children:[a.jsx(Nt,{title:u.argumentCard.title??"",isSecondaryTitle:u.argumentCard.isSecondaryTitle,rows:u.argumentCard.rows,rowsGroups:u.argumentCard.rowsGroups,linkFieldConfigs:ui}),u.linkedItemsCard&&a.jsx(Nt,{title:u.linkedItemsCard.title??"",isSecondaryTitle:u.linkedItemsCard.isSecondaryTitle,rows:u.linkedItemsCard.rows,rowsGroups:u.linkedItemsCard.rowsGroups,linkFieldConfigs:ui})]},`prosecution-argument-pair-${d}`))]})},lue=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i,groupId:o,requestIndex:c}=st(),u=`/clients/${n}/cases/${s??"first-instance"}/${r}/${i??"first-instance"}`,d=Fe(),p=l.useRef(null),g=l.useRef(null),A=l.useMemo(()=>{const N=new Map;return(e?._source?.case_narrative?.events??[]).forEach(D=>{(D?.felonies??[]).forEach(L=>{const O=L?.felony_id??void 0;if(!O)return;const P=L?.objects?.primary_object?.related_law?.law,B=P?.part,F=P?.article,z=P?.clause;if(!F)return;const Q=et({clause:z,part:B,number:F});N.set(String(O),Q)})}),N},[e?._source?.case_narrative?.events]),E=l.useMemo(()=>{const N=e?._source?.prosecution_requests??[],R=e?._source?.defense_requests??[],D=e?._source?.general_information?.accused??[],k=new Map;R.forEach(P=>{const B=typeof P?.defense_request_id=="string"?P.defense_request_id:void 0;B&&k.set(B,P)});const L=[],O=new Map;
866return N.forEach(P=>{const B=P?.related_defense_requests_id,F=typeof B=="string"?B:void 0,Q=(F?k.get(F):void 0)?.related_accused_id??"";O.has(Q)||(O.set(Q,[]),L.push(Q)),O.get(Q)?.push(P)}),L.map((P,B)=>{const F=(()=>{const W=D.find(j=>j?.id===P)?.name;return typeof W=="string"?W:""})(),z={id:`prosecution-accused-${B}`,title:F},M=(O.get(P)??[]).map((K,W)=>{const H=K?.related_defense_requests_id,j=typeof H=="string"?H:void 0,G=(j?k.get(j):void 0)?.related_felony_id??void 0,$=G?A.get(G)??"":"",J=K?.is_request_successful?h.client.case.firstInstance.accusationRequest.menu.items.REQUEST_SUCCESSFUL:h.client.case.firstInstance.accusationRequest.menu.items.REQUEST_FAILED,ne=K?.goal??"",X=`${h.client.case.firstInstance.accusationRequest.menu.items.REQUEST} ${W+1}`,oe=`${u}/accusation-request`,ie=B===0&&W===0?oe:W===0?`${oe}/${B}`:`${oe}/${B}/${W}`;return{id:`prosecution-accused-${B}-req-${W}`,title:X,description:J,instance:$,text:ne,to:ie,state:d.state,request:K}});return{header:z,items:M}})},[e?._source?.prosecution_requests,e?._source?.defense_requests,e?._source?.general_information?.accused,A,u,d.state]),x=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request"),y=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/:groupId"),I=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/:groupId/:requestIndex"),{groupIndex:v,requestIndex:S}=l.useMemo(()=>{const N=Math.max(0,(E?.length??0)-1);if(x)return{groupIndex:0,requestIndex:0};const R=Number(o),D=Number.isFinite(R)&&R>=0?R:0,k=Math.min(Math.max(0,D),N);if(y)return{groupIndex:k,requestIndex:0};if(I){const L=Math.max(0,(E?.[k]?.items?.length??0)-1),O=Number(c),P=Number.isFinite(O)&&O>=0?O:0,B=Math.min(Math.max(0,P),L);return{groupIndex:k,requestIndex:B}}return{groupIndex:0,requestIndex:0}},[x,y,I,o,c,E]),b=l.useMemo(()=>{const N=E?.[v]?.items?.[S];if(!N?.request)return h.client.case.firstInstance.accusationRequest.menu.titles.SECTION;const R=e?._source?.defense_requests??[],D=new Map;R.forEach(F=>{const z=typeof F?.defense_request_id=="string"?F.defense_request_id:void 0;z&&D.set(z,F)});const k=N.request?.related_defense_requests_id,L=typeof k=="string"?k:void 0,P=(L?D.get(L):void 0)?.related_felony_id??void 0;return(P?A.get(P)??"":"")||h.client.case.firstInstance.accusationRequest.menu.titles.SECTION},[E,v,S,e,A]),w=l.useMemo(()=>{const N=E?.[v]?.items?.[S];if(!N?.request)return"";const R=e?._source?.defense_requests??[],D=new Map;R.forEach(H=>{const j=typeof H?.defense_request_id=="string"?H.defense_request_id:void 0;j&&D.set(j,H)});const k=N.request?.related_defense_requests_id,L=typeof k=="string"?k:void 0,P=(L?D.get(L):void 0)?.related_felony_id??void 0;if(!P)return"";const B=e?._source?.case_narrative?.events??[],F=B.flatMap(H=>(H.felonies??[]).map(j=>({felony:j,event:H}))).filter(({felony:H})=>String(H?.felony_id)===String(P));if(F.length!==1)return"";const{felony:z,event:Q}=F[0];if(!z||!Q)return"";const M=z?.event_id;if(!M)return"";const K=B.findIndex(H=>String(H?.event_id)===String(M));if(K===-1)return"";const W=Q?.felonies?.findIndex(H=>String(H?.felony_id)===String(P));return W===void 0||W===-1?"":K===0&&W===0||K===0?`${u}/fabula`:`${u}/fabula/${K}/${W}`},[E,v,S,e,u]),_=l.useMemo(()=>w?a.jsx(Je,{ref:t,to:w,className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative cursor-pointer hover:text-zinc-700 underline decoration-[2%] underline-offset-[25%]",children:b}):a.jsx("div",{ref:t,className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:b}),[w,b,t]);return _s({containerRef:g,activeElementRef:p,isReady:!!e,isActive:!!I||!!y||!!x}),a.jsx(Yn,{leftColumn:a.jsx("div",{children:E.map((N,R)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:N.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),N.items.map((D,k)=>{const L=v===R&&S===k;return a.jsx(Kn,{ref:L?p:null,title:D.title,instance:D.instance,description:D.description,text:D.text,isTextBlockLimited:!0,isTextTruncated:!0,to:D.to,state:D.state,isActive:L},D.id)})]},N.header.id))}
866),leftColumnStickyTitle:h.client.case.firstInstance.accusationRequest.menu.titles.SECTION,rightColumn:a.jsx(aue,{caseData:e,groupIndex:v,requestIndex:S}),rightColumnStickyTitle:_,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:g})},cue=({caseData:e,accusedIndex:t})=>{const n=l.useMemo(()=>{const r=e?._source?.conclusions??[];if(!Array.isArray(r)||r.length===0)return;const i=[];if(r.forEach(u=>{const d=u?.related_accused_id??"";d&&(i.includes(d)||i.push(d))}),i.length===0)return r[0];const o=Math.max(0,Math.min(i.length-1,t??0)),c=i[o];return r.find(u=>u?.related_accused_id===c)},[e,t]),s=l.useMemo(()=>{const r=n?.verdicts??[],i=e?._source?.conclusions??[],c=`caseData._source.conclusions[${Math.max(0,n?i.findIndex(B=>B===n):0)}]`,u=e?._source?.case_narrative?.events??[],d=[],p=[],g=n?.final_sentencing,A=g?.result??null;p.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_SENTENCING_RESULT,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:A,sourcePath:`${c}.final_sentencing.result`}}),A===h.client.case.firstInstance.conclusions.item.statusValues.OTHER&&p.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_SENTENCING_RESULT_DESCRIPTION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:g?.result_description,sourcePath:`${c}.final_sentencing.result_description`}}),A===h.client.case.firstInstance.conclusions.item.statusValues.ACQUITTED&&p.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_SENTENCING_ACQUITTAL_GROUNDS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(g?.acquittal_grounds)?g?.acquittal_grounds?.filter(B=>!!B).join(", ")||null:g?.acquittal_grounds,sourcePath:`${c}.final_sentencing.acquittal_grounds`}}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.FINAL_SENTENCING,rows:p});const E=[],x=n?.final_sentencing?.punishment;E.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_PUNISHMENT_DESCRIPTION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:x?.description,sourcePath:`${c}.final_sentencing.punishment.description`}}),E.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_PUNISHMENT_TYPE,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:x?.type,sourcePath:`${c}.final_sentencing.punishment.type`}}),E.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.FINAL_PUNISHMENT_PENITENTIARY_TYPE,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:x?.penitentiary_type,sourcePath:`${c}.final_sentencing.punishment.penitentiary_type`}}),E.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.IS_ARTICLE_70_APPLIED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:x?.is_article_70_applied,sourcePath:`${c}.final_sentencing.punishment.is_article_70_applied`}}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.FINAL_PUNISHMENT,rows:E});const y=Math.max(0,(n?.verdicts??[]).findIndex(B=>!!B?.reclassified_aggregation?.trim())),I=Math.max(0,(n?.verdicts??[]).findIndex(B=>!!B?.reclassified_from?.reason?.trim())),v=[],S=(()=>{const F=(n?.verdicts??[]).flatMap(z=>{const Q=z.reclassified_aggregation?.trim();return Q?[Q]:[]});return F.length?F.join("; "):null})();v.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.titles.RECLASSIFICATION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:S,sourcePath:`${c}.verdicts[${y}].reclassified_aggregation`}});const b=(()=>{const F=(n?.verdicts??[]).flatMap(z=>{const Q=z.reclassified_from?.reason?.trim();return Q?[Q]:[]});return F.length?F.join("; "):null})();v.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.RECLASSIFICATION_REASON,placeholder:h.client.case.f
866irstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:b,sourcePath:`${c}.verdicts[${I}].reclassified_from.reason`}}),v.length>0&&d.push({title:h.client.case.firstInstance.conclusions.item.titles.RECLASSIFICATION,isSecondaryTitle:!0,rowsGroups:[{rows:v}]});const w=[],_=n?.final_sentencing?.punishment?.suspended_sentence;w.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.SUSPENDED_SENTENCE_IS_APPLIED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.is_applied,sourcePath:`${c}.final_sentencing.punishment.suspended_sentence.is_applied`}}),w.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.SUSPENDED_SENTENCE_REASON,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(_?.reason)?_?.reason?.filter(B=>!!B).join(", ")||null:_?.reason,sourcePath:`${c}.final_sentencing.punishment.suspended_sentence.reason`}}),w.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.SUSPENDED_SENTENCE_DURATION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.duration,sourcePath:`${c}.final_sentencing.punishment.suspended_sentence.duration`}}),w.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.SUSPENDED_SENTENCE_CONDITIONS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.conditions,sourcePath:`${c}.final_sentencing.punishment.suspended_sentence.conditions`}}),(Array.isArray(_?.related_circumstance_ids)?_?.related_circumstance_ids.filter(Boolean):[]).forEach((B,F)=>{const z=e?._source?.circumstances??[];let Q=-1,M=-1;if(z.forEach((W,H)=>{const q=(W?.related_circumstances??[]).findIndex(G=>G?.circumstance_id===B);q>=0&&Q===-1&&(Q=H,M=q)}),Q<0||M<0)return;const K=`circumstances[${Q}].related_circumstances[${M}]`;w.push({text:{type:"link",sourcePath:`${c}.final_sentencing.punishment.suspended_sentence.related_circumstance_ids[${F}]`,label:"",placeholder:"",value:K,caseData:e}})}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.SUSPENDED_SENTENCE,rows:w});const R=[],D=n?.final_sentencing?.punishment?.cancel_details;R.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.CANCEL_DETAILS_IS_CANCELED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:D?.is_canceled,sourcePath:`${c}.final_sentencing.punishment.cancel_details.is_canceled`}}),D?.is_canceled===!0&&R.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.CANCEL_DETAILS_REASON,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:D?.reason,sourcePath:`${c}.final_sentencing.punishment.cancel_details.reason`}}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.CANCEL_DETAILS,rows:R});const k=[],L=n?.final_sentencing?.punishment?.postponement_info;k.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.POSTPONEMENT_IS_APPLIED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:L?.is_applied,sourcePath:`${c}.final_sentencing.punishment.postponement_info.is_applied`}}),k.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.POSTPONEMENT_REASON,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(L?.reason)?L?.reason?.filter(B=>!!B).join(", ")||null:L?.reason,sourcePath:`${c}.final_sentencing.punishment.postponement_info.reason`}}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.POSTPONEMENT_INFO,rows:k}),(Array.isArray(n?.final_sentencing?.additional_punishment)?n?.final_sentencing?.additional_punishment:[]).forEac
866h((B,F)=>{const z=[];z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_TYPE,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.type,sourcePath:`${c}.final_sentencing.additional_punishment[${F}].type`}}),z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_DURATION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.duration,sourcePath:`${c}.final_sentencing.additional_punishment[${F}].duration`}}),z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_CONDITIONS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.conditions,sourcePath:`${c}.final_sentencing.additional_punishment[${F}].conditions`}}),d.push({title:h.client.case.firstInstance.conclusions.item.titles.ADDITIONAL_PUNISHMENT,rows:z})});const P=r.flatMap((B,F)=>{const z=[],Q=B?.related_felony_id,M=typeof Q=="string"?Q:void 0,K=(()=>{if(!M)return"";let pe=-1,_e=-1;if(u.forEach((ge,Pe)=>{const Be=(ge?.felonies??[]).findIndex(nt=>(nt?.felony_id??void 0)===M);Be>=0&&pe===-1&&(pe=Pe,_e=Be)}),pe<0||_e<0)return"";const Ee=(u?.[pe]?.felonies?.[_e]??void 0)?.objects?.primary_object?.related_law?.law,se=Ee?.part,me=Ee?.article,de=Ee?.clause;return me?et({clause:de,part:se,number:me}):""})(),W=B?.related_law?.qualification?.crime_stage,H=B?.related_law?.qualification?.participant_role,j=W?.is_article_30_applied,q=H?.is_article_33_applied,G=[],$=(()=>{const pe=W?.article_30_part;return pe?String(pe).trim():""})();j===!0&&$&&G.push(et({part:$,number:"30"}));const J=(()=>{const pe=H?.article_33_part;return pe?String(pe).trim():""})();q===!0&&J&&G.push(et({part:J,number:"33"})),K&&G.unshift(K);const ne=h.client.case.firstInstance.conclusions.item.titles.VERDICT+(G.length?` ${G.join(", ")}`:""),X=B?.result??null;z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.VERDICT_STATUS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X,sourcePath:`${c}.verdicts[${F}].result`}}),X===h.client.case.firstInstance.conclusions.item.statusValues.OTHER&&z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.VERDICT_DESCRIPTION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.verdict_description??null,sourcePath:`${c}.verdicts[${F}].verdict_description`}}),X===h.client.case.firstInstance.conclusions.item.statusValues.ACQUITTED&&z.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ACQUITTAL_GROUND,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.acquittal_ground??null,sourcePath:`${c}.verdicts[${F}].acquittal_ground`}});const oe=[];oe.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.PUNISHMENT_DESCRIPTION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.punishment?.description??null,sourcePath:`${c}.verdicts[${F}].punishment.description`}}),oe.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.PUNISHMENT_TYPE,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.punishment?.type??null,sourcePath:`${c}.verdicts[${F}].punishment.type`}}),oe.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.IS_ARTICLE_64_APPLIED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.punishment?.is_article_64_applied,sourcePath:`${c}.verdicts[${F}].punishment.is_article_64_applied`}});const ie={title:h.client.case.firstInstance.conclusions.item.titles.PUNISHMENT,isSecondaryTitle:!0,rowsGroups:[{rows:oe}]},te=(Array.isArray(B?.additional_punishment)?B?.additional_punishment:[]).map((pe,_e)=>{const Le=[];return Le.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_TYPE,placeholder:h.client.case.f
866irstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:pe?.type??null,sourcePath:`${c}.verdicts[${F}].additional_punishment[${_e}].type`}}),Le.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_DURATION,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:pe?.duration??null,sourcePath:`${c}.verdicts[${F}].additional_punishment[${_e}].duration`}}),Le.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_CONDITIONS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:pe?.conditions??null,sourcePath:`${c}.verdicts[${F}].additional_punishment[${_e}].conditions`}}),{title:h.client.case.firstInstance.conclusions.item.titles.ADDITIONAL_PUNISHMENT,isSecondaryTitle:!0,rowsGroups:[{rows:Le}]}}),le={title:ne,rows:z},he=[];he.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.PLEA_STATUS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.plea?.status??null,sourcePath:`${c}.verdicts[${F}].plea.status`}}),he.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.PLEA_DETAILS,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:B?.plea?.details??null,sourcePath:`${c}.verdicts[${F}].plea.details`}});const fe=B?.plea?.related_testimony_id,ue=typeof fe=="string"?fe:void 0;if(ue){const _e=(e?._source?.testimonies??[]).findIndex(Le=>(Le?.testimony_id??void 0)===ue);_e>=0&&he.push({text:{type:"link",sourcePath:`${c}.verdicts[${F}].plea.related_testimony_id`,label:h.client.case.firstInstance.conclusions.item.fields.PLEA_RELATED_TESTIMONY,placeholder:"",value:`testimonies[${_e}]`,caseData:e}})}const ye={title:h.client.case.firstInstance.conclusions.item.titles.PLEA,isSecondaryTitle:!0,rowsGroups:[{rows:he}]},ce=[],xe=B?.article_15_consideration;ce.push({text:{type:"boolean",label:h.client.case.firstInstance.conclusions.item.fields.ARTICLE_15_IS_APPLIED,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:xe?.is_applied,sourcePath:`${c}.verdicts[${F}].article_15_consideration.is_applied`}}),xe&&(ce.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ARTICLE_15_OLD_CATEGORY,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:xe.old_category??null,sourcePath:`${c}.verdicts[${F}].article_15_consideration.old_category`}}),ce.push({text:{type:"string",label:h.client.case.firstInstance.conclusions.item.fields.ARTICLE_15_NEW_CATEGORY,placeholder:h.client.case.firstInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:xe.new_category??null,sourcePath:`${c}.verdicts[${F}].article_15_consideration.new_category`}}));const re={title:h.client.case.firstInstance.conclusions.item.titles.ARTICLE_15_CONSIDERATION,isSecondaryTitle:!0,rowsGroups:[{rows:ce}]};return[le,ie,...te,ye,re]});return d.push(...P),d},[n,e]);return a.jsx("div",{children:s.map((r,i)=>a.jsx(Nt,{title:r.title??"",isSecondaryTitle:r.isSecondaryTitle,rows:r.rows,rowsGroups:r.rowsGroups,linkFieldConfigs:ui},i))})},uue=["Приговорил"],due=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=Fe(),o=l.useRef(null),c=l.useRef(null),u=l.useMemo(()=>{const E=e?._source?.conclusions??[],x=e?._source?.general_information?.accused??[],y=new Map;x.forEach(S=>{const b=S?.id??void 0;if(!b)return;const w=S?.name,_=typeof w=="string"?w:"";y.set(String(b),_)});const I=[];E.forEach(S=>{const b=S?.related_accused_id??"";b&&(I.includes(b)||I.push(b))});const v=`/clients/${t}/cases/${n??"first-instance"}/${s}/${r??"first-instance"}/conclusions`;return I.map((S,b)=>{const w=y.get(S)??"",_=b===0?v:`${v}/${b}`;return{id:`conclusions-accused-${b}`,title:w,to:_,state:i.state}})},[e,t,n,s,r,i.state]),d=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions"),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions/:accusedIndex"),g=l.useMemo(()=>
866{if(d)return 0;const E=Number(p?.params?.accusedIndex);return!Number.isFinite(E)||E<0?0:Math.min(Math.max(0,E),Math.max(0,u.length-1))},[d,p,u.length]);_s({containerRef:c,activeElementRef:o,isReady:!!e,isActive:!!p});const{handleSourceClick:A}=Ii({initialSearchTerms:uue,initialSearchPickMode:"last"});return a.jsx(Yn,{leftColumn:a.jsxs("div",{children:[a.jsx(Kn,{title:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),u.map((E,x)=>{const y=g===x;return a.jsx(Kn,{ref:y?o:null,title:E.title,isTextBlockLimited:!0,isTextTruncated:!0,to:E.to,state:E.state,isActive:y},E.id)})]}),leftColumnStickyTitle:h.client.case.firstInstance.conclusions.menu.titles.SECTION,rightColumn:a.jsx(cue,{caseData:e,accusedIndex:g}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:u?.[g]?.title??h.client.case.firstInstance.conclusions.menu.titles.SECTION}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:A,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:c})},Rw=({caseData:e})=>{const t=vs(),n=l.useMemo(()=>[{rows:[{text:{type:"string",label:h.client.case.firstInstance.information.general.fields.REGION,value:(()=>{const s=e?._source?.metadata_region;return s?t[s]?.name:null})(),sourcePath:"caseData._source.metadata_region",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.general.fields.CUI,value:e?._source?.metadata_cui??null,sourcePath:"caseData._source.metadata_cui",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.general.fields.CASE_NUMBER,value:e?._source?.general_information?.case_number,sourcePath:"caseData._source.general_information.case_number",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.general.fields.COURT_NAME,value:e?._source?.general_information?.court_name,sourcePath:"caseData._source.general_information.court_name",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.firstInstance.information.general.fields.JUDGES,value:e?._source?.general_information?.judges,sourcePath:"caseData._source.general_information.judges",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.firstInstance.information.general.fields.PROSECUTORS,value:e?._source?.general_information?.prosecutors,sourcePath:"caseData._source.general_information.prosecutors",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.firstInstance.information.general.fields.DEFENSE_LAWYERS,value:e?._source?.general_information?.defense_lawyers,sourcePath:"caseData._source.general_information.defense_lawyers",placeholder:h.client.case.firstInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.cases.general.fields.IS_SPECIAL_ORDER,value:e?._source?.general_information?.is_special_order,sourcePath:"caseData._source.general_information.is_special_order",placeholder:h.client.case.firstInstance.cases.general.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.cases.general.fields.IS_JURY_TRIAL,value:e?._source?.general_information?.is_jury_trial,sourcePath:"caseData._source.general_information.is_jury_trial",placeholder:h.client.case.firstInstance.cases.general.placeholders.NOT_SPECIFIED}}]}],[e,t]);return a.jsx("div",{children:n.map((s,r)=>a.jsx(Nt,{title:s.title??"",rows:s.rows,rowsGroups:s.rowsGroups},`property-card-${r}`))})},fue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.accused??[]).map((n,s)=>
866({title:n.name??h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.NAME,value:n.name,sourcePath:`caseData._source.general_information.accused[${s}].name`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.GENDER,value:n.gender,sourcePath:`caseData._source.general_information.accused[${s}].gender`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CITIZENSHIP,value:n.citizenship,sourcePath:`caseData._source.general_information.accused[${s}].citizenship`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.ADDRESS,value:n.address,sourcePath:`caseData._source.general_information.accused[${s}].address`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.AGE_GROUP,value:n.age_group,sourcePath:`caseData._source.general_information.accused[${s}].age_group`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.EDUCATION,value:n.education,sourcePath:`caseData._source.general_information.accused[${s}].education`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.MARITAL_STATUS,value:n.marital_status,sourcePath:`caseData._source.general_information.accused[${s}].marital_status`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.CHILDREN,value:n.children,sourcePath:`caseData._source.general_information.accused[${s}].children`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.firstInstance.information.accused.fields.WORKPLACE,value:n.employment_and_education?.workplace,sourcePath:`caseData._source.general_information.accused[${s}].employment_and_education.workplace`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.firstInstance.information.accused.fields.EDUCATIONAL_INSTITUTION,value:n.employment_and_education?.educational_institution,sourcePath:`caseData._source.general_information.accused[${s}].employment_and_education.educational_institution`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.general.fields.HAS_PRETRIAL_COOP_AGREEMENT,value:n.has_pretrial_cooperation_agreement,sourcePath:`caseData._source.general_information.accused[${s}].has_pretrial_cooperation_agreement`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.IS_MILITARY,value:n.is_military,sourcePath:`caseData._source.general_information.accused[${s}].is_military`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.MILITARY_STATUS,value:n.military_status,sourcePath:`caseData._source.general_information.accused[${s}].military_status`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.OCCUPATION,value:n.occupation,sourcePath:`caseData._source.general_information.accused[${s}
866].occupation`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.MENTAL_HEALTH,value:n.mental_health,sourcePath:`caseData._source.general_information.accused[${s}].mental_health`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.PHYSICAL_HEALTH,value:n.physical_health,sourcePath:`caseData._source.general_information.accused[${s}].physical_health`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CRIMINAL_RECORDS_STATUS,value:n.criminal_records_status,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records_status`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}}]},{title:h.client.case.firstInstance.information.accused.titles.RECORDS_TITLE,rowsGroups:(n.criminal_records??[]).map((r,i)=>({title:`${h.client.case.firstInstance.information.accused.titles.CRIMINAL_RECORD} ${i+1}`,rows:[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.ARTICLE,value:r?.law?.article?et({clause:r?.law?.clause,part:r?.law?.part,number:r?.law?.article}):null,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].law.article`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.IS_LAW_REMOVED,value:r?.law?.is_law_removed,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].law.is_law_removed`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.DESCRIPTION,value:r?.description,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].description`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.IS_RECIDIVISM,value:r?.is_recidivism,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].is_recidivism`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.CRIME_STAGE_IS_ARTICLE_30_APPLIED,value:r?.qualification?.crime_stage?.is_article_30_applied,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].qualification.crime_stage.is_article_30_applied`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},...r?.qualification?.crime_stage?.is_article_30_applied?[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CRIME_STAGE_ARTICLE_30_PART,value:r?.qualification?.crime_stage?.article_30_part?.toString(),sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].qualification.crime_stage.article_30_part`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED,value:r?.qualification?.participant_role?.is_article_33_applied,sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].qualification.participant_role.is_article_33_applied`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},...r?.qualification?.participant_role?.is_article_33_applied?[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.PARTICIPANT_ROLE_ARTICLE_33_PART,value:r?.qualification?.participant_role?.article_33_part?.toString(),sourcePath:`caseData._source.general_information.accused[${s}].criminal_records[${i}].qualification.participant_role.article_33_part`,placeholder:h.client.case.f
866irstInstance.information.accused.placeholders.NOT_SPECIFIED}}]:[]]}))},{title:h.client.case.firstInstance.information.accused.titles.CHARACTERISTICS,rowsGroups:(n.characteristics??[]).map((r,i)=>({title:"",rows:[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_TYPE,value:r?.type,sourcePath:`caseData._source.general_information.accused[${s}].characteristics[${i}].type`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_SOURCE,value:r?.source,sourcePath:`caseData._source.general_information.accused[${s}].characteristics[${i}].source`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.CHARACTERISTICS_QUOTE,value:r?.quote,sourcePath:`caseData._source.general_information.accused[${s}].characteristics[${i}].quote`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}}]}))},{title:h.client.case.firstInstance.information.accused.titles.SPECIAL_SUBJECT,rows:[{text:{type:"boolean",label:h.client.case.firstInstance.information.accused.fields.SPECIAL_SUBJECT_IS_SPECIAL,value:n?.special_subject?.is_special,sourcePath:`caseData._source.general_information.accused[${s}].special_subject.is_special`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},...n?.special_subject?.is_special?[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.SPECIAL_SUBJECT_TYPE,value:n?.special_subject?.type,sourcePath:`caseData._source.general_information.accused[${s}].special_subject.type`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.SPECIAL_SUBJECT_DESCRIPTION,value:n?.special_subject?.description,sourcePath:`caseData._source.general_information.accused[${s}].special_subject.description`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}}]:[]]},{title:h.client.case.firstInstance.information.accused.titles.PREVENTIVE_MEASURE,rows:[{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_TYPE,value:n.preventive_measure?.type,sourcePath:`caseData._source.general_information.accused[${s}].preventive_measure.type`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"date",label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_START_DATE,value:n.preventive_measure?.start_date,sourcePath:`caseData._source.general_information.accused[${s}].preventive_measure.start_date`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"date",label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_END_DATE,value:n.preventive_measure?.end_date,sourcePath:`caseData._source.general_information.accused[${s}].preventive_measure.end_date`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.accused.fields.PREVENTIVE_MEASURE_CONDITIONS,value:n.preventive_measure?.conditions,sourcePath:`caseData._source.general_information.accused[${s}].preventive_measure.conditions`,placeholder:h.client.case.firstInstance.information.accused.placeholders.NOT_SPECIFIED}}]}]})),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{title:n?.title??"",anchor:`accused-${s}`,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,rows:r.rows,rowsGroups:r.rowsGroups},i))},s))})},pue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.victims_details??[]).map((s,r)=>({title:s?.name??h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.f
866irstInstance.information.victims.fields.NAME,value:s?.name,sourcePath:`caseData._source.general_information.victims_details[${r}].name`,placeholder:h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.victims.fields.AGE_STATUS,value:s?.age_status,sourcePath:`caseData._source.general_information.victims_details[${r}].age_status`,placeholder:h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.victims.fields.GENDER,value:s?.gender,sourcePath:`caseData._source.general_information.victims_details[${r}].gender`,placeholder:h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.victims.fields.RELATION_TO_ACCUSED,value:s?.relation_to_accused,sourcePath:`caseData._source.general_information.victims_details[${r}].relation_to_accused`,placeholder:h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.victims.fields.ADDRESS,value:s?.address,sourcePath:`caseData._source.general_information.victims_details[${r}].address`,placeholder:h.client.case.firstInstance.information.victims.placeholders.NOT_SPECIFIED}}]}]})),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{title:n.title,anchor:`victims-${s}`,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,rows:r.rows,rowsGroups:r.rowsGroups},i))},s))})},hue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.witnesses_details??[]).map((s,r)=>({title:s?.name??h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.firstInstance.information.witnesses.fields.NAME,value:s?.name,sourcePath:`caseData._source.general_information.witnesses_details[${r}].name`,placeholder:h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.witnesses.fields.AGE_STATUS,value:s?.age_status,sourcePath:`caseData._source.general_information.witnesses_details[${r}].age_status`,placeholder:h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.witnesses.fields.GENDER,value:s?.gender,sourcePath:`caseData._source.general_information.witnesses_details[${r}].gender`,placeholder:h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.witnesses.fields.RELATION_TO_ACCUSED,value:s?.relation_to_accused,sourcePath:`caseData._source.general_information.witnesses_details[${r}].relation_to_accused`,placeholder:h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.firstInstance.information.witnesses.fields.ADDRESS,value:s?.address,sourcePath:`caseData._source.general_information.witnesses_details[${r}].address`,placeholder:h.client.case.firstInstance.information.witnesses.placeholders.NOT_SPECIFIED}}]}]})),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{anchor:`witnesses-${s}`,title:n.title,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,rows:r.rows,rowsGroups:r.rowsGroups},i))},s))})},Dw=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i}=st(),o=`/clients/${n}/cases/${s??"first-instance"}/${r}/${i??"first-instance"}`,c=Fe(),u=l.useRef(null),d=l.useRef(null),p=l.useMemo(()=>[{id:"general",title:h.client.case.firstInstance.information.menu.items.GENERAL,to:`${o}/information/general`,state:c.state},{id:"accused",title:h.client.case.firstInstance.information.menu.items.ACCUSED,to:`${o}/information/accused`,state:c.state,count:e?._source?.general_information.accused?.length},{id:"witnesses",title:h.client.case.firstInstance.information.menu.items.WITNESSES,to:`${o}/information/witnesses`,state:c.state,count:e?._source?.general_information.witnesses_details?.length}
866,{id:"victims",title:h.client.case.firstInstance.information.menu.items.VICTIMS,to:`${o}/information/victims`,state:c.state,count:e?._source?.general_information.victims_details?.length}],[o,c.state,e?._source?.general_information]),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/general"),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/accused"),E=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/witnesses"),x=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/victims"),y=l.useMemo(()=>g?"general":A?"accused":E?"witnesses":x?"victims":"general",[g,A,E,x]),I=l.useMemo(()=>p.find(w=>w.id===y)?.title??"",[p,y]),v=l.useMemo(()=>y==="general"?a.jsx(Rw,{caseData:e}):y==="accused"?a.jsx(fue,{caseData:e}):y==="witnesses"?a.jsx(hue,{caseData:e}):y==="victims"?a.jsx(pue,{caseData:e}):a.jsx(Rw,{caseData:e}),[y,e]);_s({containerRef:d,activeElementRef:u,isReady:!!e,isActive:!!A||!!E||!!x});const{handleSourceClick:S}=Ii();return a.jsx(Yn,{leftColumn:a.jsx("div",{children:p.map(b=>{const w=b.id===y;return a.jsx(Kn,{ref:w?u:null,title:b.title,isActive:w,to:b.to,state:b.state,count:b.count},b.id)})}),leftColumnStickyTitle:h.client.case.firstInstance.information.menu.titles.SECTION,rightColumn:v,rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:Y("flex","items-center","justify-between","roboto-flex-25-700-1","text-[24px]","leading-[24px]","uppercase","text-zinc-950","relative"),children:I}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:S,children:h.client.cases.links.SOURCE})})]}),rightStickyTitleRef:t,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:d})},mue=/^(circ_|evidence_|testimony_)[a-zA-Z0-9_]+$/,Gy="roboto-flex-100-400-1 text-[16px] leading-[20px] underline underline-offset-[25%] decoration-[3%] text-zinc-950 hover:text-zinc-600",gue=({caseData:e,basePath:t})=>{const n=new Map,s=e?._source?.circumstances??[];for(let p=0;p<s.length;p++){const g=s[p]?.related_circumstances??[];for(let A=0;A<g.length;A++){const E=g[A]?.circumstance_id??void 0,x=typeof E=="string"&&E?E:"";if(!x)continue;const y=A+1,I=p===0&&A===0?`${t}/circumstances`:`${t}/circumstances/${x}`;n.set(x,{displayIndex:y,to:I})}}const r=new Map,i=new Map,o=e?._source?.evidence??[],c=e?._source?.testimonies??[],u=new Map;let d=1;return o.forEach((p,g)=>{const A=p?.evidence_id,x=`evidence-${(typeof A=="string"&&A?A:"")||g}`;u.has(x)||(u.set(x,d),d+=1)}),c.forEach((p,g)=>{const A=p?.testimony_id,x=`testimony-${(typeof A=="string"&&A?A:"")||g}`;u.has(x)||(u.set(x,d),d+=1)}),o.forEach((p,g)=>{const A=p?.evidence_id,E=typeof A=="string"&&A?A:"",x=`evidence-${E||g}`,y=u.get(x)??g+1,v=(p?.related_accused_ids??[]).find(b=>typeof b=="string"&&b)??"";if(!E||!v)return;const S=`${t}/evidence/evidence/${v}/${E}`;r.set(E,{displayIndex:y,to:S})}),c.forEach((p,g)=>{const A=p?.testimony_id,E=typeof A=="string"&&A?A:"",x=`testimony-${E||g}`,y=u.get(x)??g+1,v=(p?.related_accused_ids??[]).find(b=>typeof b=="string"&&b)??"";if(!E||!v)return;const S=`${t}/evidence/testimony/${v}/${E}`;i.set(E,{displayIndex:y,to:S})}),{circ:n,evidence:r,testimony:i}},Aue=(e,t,n)=>{if(e.startsWith("circ_")){const s=t.circ.get(e);if(!s)return a.jsx("span",{children:e},n);const r=`${h.client.case.firstInstance.circumstances.menu.items.CIRCUMSTANCE} ${s.displayIndex}`;return a.jsx(Hs,{to:s.to,className:Gy,children:r},n)}if(e.startsWith("evidence_")){const s=t.evidence.get(e);if(!s)return a.jsx("span",{children:e},n);const r=`${h.client.case.firstInstance.evidence.menu.items.EVIDENCE} ${s.displayIndex}`;return a.jsx(Hs,{to:s.to,className:Gy,children:r},n)}if(e.startsWith("testimony_")){const s=t.testimony.get(e);if(!s)return a.jsx("span",{children:e},n);const r=`${h.client.case.firstInstance.evidence.menu.items.EVIDENCE} ${s.displayIndex}`;return a.jsx(Hs,{to:s.to,className:Gy,children:r},n)}return a.jsx("span",{children:e},n)},qy=({text:e,maps:t})=>{if(e==null||e==="")return null;const n=[],s=/\(([^)]+)\)/g;let r=0,i,o=0;for(;(i=s.exec(e))!==null;){const u=e.slice(r,i.index);u!==""&&n.push(u);const p=(i[1]??"").split(",").map(A=>
866A.trim()).filter(Boolean);p.length>0&&p.every(A=>mue.test(A))?n.push(a.jsxs(Oe.Fragment,{children:["(",p.map((A,E)=>a.jsxs(Oe.Fragment,{children:[E>0?", ":null,Aue(A,t,`${A}-${i?.index??0}-${E}`)]},`${A}-${i?.index??0}-${E}`)),")"]},`refs-${o++}`)):n.push(i[0]),r=i.index+i[0].length}const c=e.slice(r);return c!==""&&n.push(c),n},kw=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=`/clients/${t}/cases/${n??"first-instance"}/${s}/${r??"first-instance"}`,o=vs(),c=Is(M=>M.isGridSourcePathVisible),{handleSourceClick:u}=Ii(),d=e?._source?.summaries??null,p=d?.case_number??null,g=d?.case_info?.court_name,A=Oe.useMemo(()=>(d?.case_info?.judge_name??[]).filter(K=>typeof K=="string"&&!!K.trim()),[d?.case_info?.judge_name]),E=A.length>0?A.join(", "):null,x=A.length>1?h.client.case.firstInstance.overview.fields.JUDGE_MANY:h.client.case.firstInstance.overview.fields.JUDGE_ONE,y=Oe.useMemo(()=>{const M=d?.case_info?.articles_in_verdict?.filter(K=>typeof K=="string"&&!!K.trim())??[];return M.length>0?M.join(", "):null},[d]),I=e?._source?.metadata_article_part,v=e?._source?.metadata_article_number,S=I&&v?`ч. ${I} ст. ${v} УК РФ`:v?`ст. ${v} УК РФ`:null,b=y??S,w=d?.case_info?.accused?.[0],_=w?.full_name??null,N=w?.gender??null,R=Oe.useMemo(()=>{const M=w?.criminal_records?.filter(K=>!!K.trim())??[];return M.length>0?M.join(", "):null},[w]),D=w?.criminal_records_status??null,k=Oe.useMemo(()=>{const M=d?.case_info?.plea_by_article??[],K=new Set,W=[];for(const j of M){const q=j?.status,G=typeof q=="string"?q.trim():"";G&&!K.has(G)&&(K.add(G),W.push(G))}if(W.length>0)return W.join(", ");const H=d?.case_info?.plea_by_article?.[0]?.status;return typeof H=="string"&&H.trim()?H:null},[d]),L=e?._source?.metadata_region,O=L?o[L]?.name:null,P=Oe.useMemo(()=>gue({caseData:e,basePath:i}),[e,i]),B=Oe.useMemo(()=>qy({text:d?.case_narrative,maps:P}),[d?.case_narrative,P]),F=Oe.useMemo(()=>qy({text:d?.evidence_circ,maps:P}),[d?.evidence_circ,P]),z=Oe.useMemo(()=>qy({text:d?.conclusion,maps:P}),[d?.conclusion,P]),Q=h.client.case.firstInstance.overview.placeholders;return a.jsxs("div",{className:"flex flex-col gap-8 ml-4 pb-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 ",children:[h.client.case.firstInstance.overview.titles.CASE," ",p??"***"]}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:u,children:h.client.cases.links.SOURCE})}),a.jsxs("div",{className:"mt-6 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:[a.jsxs("div",{children:[g??Q.NOT_SPECIFIED," · ",x," ",E??Q.NOT_SPECIFIED,!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.case_info.court_name, caseData._source.summaries.case_info.judge_name"})]}),a.jsxs("div",{children:[h.client.case.firstInstance.overview.fields.REGION,":"," ",O??Q.NOT_SPECIFIED,!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.metadata_region"})]}),a.jsxs("div",{children:[h.client.case.firstInstance.overview.fields.ARTICLES,":"," ",b??Q.NOT_SPECIFIED_PLURAL,!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.case_info.articles_in_verdict, caseData._source.metadata_article_part, caseData._source.metadata_article_number"})]}),a.jsxs("div",{children:[h.client.case.firstInstance.overview.fields.ACCUSED,":"," ",_??Q.NOT_SPECIFIED,","," ",N??Q.NOT_SPECIFIED,","," ",R??Q.NOT_SPECIFIED,","," ",D??Q.NOT_SPECIFIED,!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.case_info.accused[]"})]}),a.jsxs("div",{children:[h.client.case.firstInstance.overview.fields.GUILT_POSITION,":"," ",k??Q.NOT_SPECIFIED,!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.case_info.plea_by_article[]"})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:h.client.case.f
866irstInstance.overview.titles.FABULA}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3 whitespace-pre-line",children:B??Q.NOT_SPECIFIED}),!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.case_narrative"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:h.client.case.firstInstance.overview.titles.EVIDENCE_AND_CIRCUMSTANCES}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3 whitespace-pre-line",children:F??Q.NOT_SPECIFIED}),!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.evidence_circ"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:h.client.case.firstInstance.overview.titles.COURT_DECISION}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-3 whitespace-pre-line",children:z??Q.NOT_SPECIFIED}),!!c&&a.jsx("div",{className:"mt-0.5 text-[11px] leading-[14px] text-zinc-400 break-all",children:"caseData._source.summaries.conclusion"})]})]})},Eue=({containerRef:e,caseFirstInstanceData:t,isLoading:n})=>{const s=N2(t),r=l.useRef(null),i=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/*"),o=lP(),c=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/*"),u=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/overview/*"),d=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/*"),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances/*"),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/*"),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request/*"),E=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions/*");return gce({caseData:t}),mce({containerRef:e,rightStickyTitleRef:r,isLoading:n}),n?a.jsx(ct,{isWithWrapper:!0}):u&&!s?a.jsx(Dw,{caseData:t,rightStickyTitleRef:r}):u?a.jsx(kw,{caseData:t}):d?a.jsx(Zce,{caseData:t,rightStickyTitleRef:r}):p?a.jsx(tue,{caseData:t}):g?a.jsx(rue,{caseData:t}):A?a.jsx(oue,{caseData:t,rightStickyTitleRef:r}):o&&i?a.jsx(lue,{caseData:t,rightStickyTitleRef:r}):E?a.jsx(due,{caseData:t}):c?a.jsx(Dw,{caseData:t,rightStickyTitleRef:r}):a.jsx(kw,{caseData:t})},xue=({basePath:e,locationState:t,isProsecutionRequestVisible:n,hasCaseSummaries:s})=>[...s?[{id:"overview",label:"Обзор",to:`${e}/overview`,state:t}]:[],{id:"information",label:h.client.case.firstInstance.information.menu.titles.SECTION,to:`${e}/information`,state:t},{id:"fabula",label:h.client.case.firstInstance.fabula.menu.titles.SECTION,to:`${e}/fabula`,state:t},{id:"circumstances",label:h.client.case.firstInstance.circumstances.menu.titles.SECTION,to:`${e}/circumstances`,state:t},{id:"evidence",label:h.client.case.firstInstance.evidence.menu.titles.SECTION,to:`${e}/evidence`,state:t},{id:"defenseRequest",label:h.client.case.firstInstance.defenseRequest.menu.titles.SECTION,to:`${e}/defense-request`,state:t},...n?[{id:"accusationRequest",label:h.client.case.firstInstance.accusationRequest.menu.titles.SECTION,to:`${e}/accusation-request`,state:t}]:[],{id:"conclusions",label:h.client.case.firstInstance.conclusions.menu.titles.SECTION,to:`${e}/conclusions`,state:t}],Cue=({basePath:e,locationState:t,hasCaseSummaries:n})=>{const s=lP();return{tabs:l.useMemo(()=>xue({basePath:e,locationState:t,isProsecutionRequestVisible:s,hasCaseSummaries:n}),[e,n,s,t]),isProsecutionRequestVisible:s}},yue=({containerRef:e,rightStickyTitleRef:t,isLoading:n})=>{const s=Fe(),r=l.useRef(null),i=l.useMemo(()=>{const u=s.pathname;return u.includes("/information/accused")?76:u.includes("/complaints-and-submissions")?88:76},[s.pathname]),o=l.useCallback(u=>{if(n)return;const d=e.current;if(!d)return;const p=(()=>
866{if(!u)return 0;const g=document.getElementById(u);if(!g)return 0;const A=g.getBoundingClientRect(),E=d.getBoundingClientRect(),x=t?.current?.offsetHeight??0,y=i+x,I=A.top-y-E.top;return d.scrollTop+I})();d.scrollTo({top:p})},[e,i,n,t]),c=l.useCallback(u=>{if(n||!u)return;if(document.getElementById(u)){o(u);return}r.current=requestAnimationFrame(()=>c(u))},[n,o]);return l.useEffect(()=>{if(n)return;const u=(s.hash??"").replace(/^#/,"");if(u)return c(u),()=>{r.current&&cancelAnimationFrame(r.current)}},[n,c,s.pathname,s.hash]),{scrollToHashedElement:o}},bue=()=>{const e=at(),t=Fe(),{id:n,listInstance:s,caseId:r,caseInstance:i}=st();l.useEffect(()=>{if(!n||!s||!r)return;const o=`/clients/${n}/cases/${s}/${r}/${i??"second-instance"}`;if(t.pathname===o){e(`${o}/information/general`,{replace:!0,state:t.state});return}if(t.pathname===`${o}/information`){e(`${o}/information/general`,{replace:!0,state:t.state});return}},[n,s,r,i,t.pathname,t.state,e])},Ow=({caseData:e})=>{const t=l.useMemo(()=>[{rows:[{text:{type:"string",label:h.client.case.secondInstance.information.general.fields.CASE_NUMBER,value:e?._source?.general_information?.case_number,sourcePath:"caseData._source.general_information.case_number",placeholder:h.client.case.secondInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.general.fields.APPEAL_COURT_NAME,value:e?._source?.general_information?.court_name,sourcePath:"caseData._source.general_information.court_name",placeholder:h.client.case.secondInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.information.general.fields.JUDGES,value:e?._source?.general_information?.judges,sourcePath:"caseData._source.general_information.judges",placeholder:h.client.case.secondInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.information.general.fields.PROSECUTORS,value:e?._source?.general_information?.prosecutors,sourcePath:"caseData._source.general_information.prosecutors",placeholder:h.client.case.secondInstance.information.general.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.information.general.fields.DEFENSE_LAWYERS,value:e?._source?.general_information?.defense_lawyers,sourcePath:"caseData._source.general_information.defense_lawyers",placeholder:h.client.case.secondInstance.information.general.placeholders.NOT_SPECIFIED}}]}],[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Nt,{title:n.title??"",rows:n.rows,rowsGroups:n.rowsGroups},`property-card-${s}`))})},Iue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.accused??[]).map((s,r)=>{const i=s.criminal_records??[],o=s.characteristics??[],c=s.procedural_history??[],u=s.plea??[],d=i.map((E,x)=>({title:`${h.client.case.secondInstance.information.subjects.titles.CRIMINAL_RECORD} ${x+1}`,rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.ARTICLE,value:E?.law?.article?et({clause:E?.law?.clause,part:E?.law?.part,number:E?.law?.article}):null,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].law.article`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.IS_LAW_REMOVED,value:E?.law?.is_law_removed,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].law.is_law_removed`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.DESCRIPTION,value:E?.description,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].description`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.IS_RECIDIVISM,value:E?.is_recidivism,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].is_recidivism`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.CRIME_STAGE_IS_ARTICLE_30_APPLIED,value:E?.qualification?.crime_stage?.is_article_30_applied,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].qualification.crime_stage.is_article_30_applied`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},...E?.qualification?.crime_stage?.is_article_30_applied?[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CRIME_STAGE_ARTICLE_30_PART,value:E?.qualification?.crime_stage?.article_30_part?.toString(),sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].qualification.crime_stage.article_30_part`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED,value:E?.qualification?.participant_role?.is_article_33_applied,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].qualification.participant_role.is_article_33_applied`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},...E?.qualification?.participant_role?.is_article_33_applied?[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PARTICIPANT_ROLE_ARTICLE_33_PART,value:E?.qualification?.participant_role?.article_33_part?.toString(),sourcePath:`caseData._source.general_information.accused[${r}].criminal_records[${x}].qualification.participant_role.article_33_part`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]:[]]})),p=o.map((E,x)=>({rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CHARACTERISTICS_TYPE,value:E?.type,sourcePath:`caseData._source.general_information.accused[${r}].characteristics[${x}].type`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CHARACTERISTICS_SOURCE,value:E?.source,sourcePath:`caseData._source.general_information.accused[${r}].characteristics[${x}].source`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CHARACTERISTICS_QUOTE,value:E?.quote,sourcePath:`caseData._source.general_information.accused[${r}].characteristics[${x}].quote`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]})),g=c.map((E,x)=>({rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_INSTANCE_LEVEL,value:E?.instance_level,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}].instance_level`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_COURT_NAME,value:E?.court_name,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}
866].court_name`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_DOCUMENT_DATE,value:E?.document_date,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}].document_date`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_DOCUMENT_TYPE,value:E?.document_type,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}].document_type`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_DESCRIPTION,value:E?.description,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}].description`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PROCEDURAL_HISTORY_RESULT,value:E?.result,sourcePath:`caseData._source.general_information.accused[${r}].procedural_history[${x}].result`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]})),A=u.map((E,x)=>({rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PLEA_STATUS,value:E?.status??null,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].status`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PLEA_DETAILS,value:E?.details??null,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].details`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.ARTICLE,value:E?.law?.article?et({clause:E?.law?.clause,part:E?.law?.part,number:E?.law?.article}):null,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].law.article`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.IS_LAW_REMOVED,value:E?.law?.is_law_removed,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].law.is_law_removed`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.CRIME_STAGE_IS_ARTICLE_30_APPLIED,value:E?.qualification?.crime_stage?.is_article_30_applied,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].qualification.crime_stage.is_article_30_applied`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},...E?.qualification?.crime_stage?.is_article_30_applied?[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CRIME_STAGE_ARTICLE_30_PART,value:E?.qualification?.crime_stage?.article_30_part?.toString(),sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].qualification.crime_stage.article_30_part`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.PARTICIPANT_ROLE_IS_ARTICLE_33_APPLIED,value:E?.qualification?.participant_role?.is_article_33_applied,sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].qualification.participant_role.is_article_33_applied`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},...E?.qualification?.participant_role?.is_article_33_applied?[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PARTICIPANT_ROLE_ARTICLE_33_PART,value:E?.qualification?.participant_role?.article_33_part?.toString(),sourcePath:`caseData._source.general_information.accused[${r}].plea[${x}].qualification.participant_role.article_33_part`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]:[]]}));return{title:s.name??h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.STATUS,value:s.status,sourcePath:`caseData._source.general_information.accused[${r}].status`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.NAME,value:s.name,sourcePath:`caseData._source.general_information.accused[${r}].name`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.GENDER,value:s.gender,sourcePath:`caseData._source.general_information.accused[${r}].gender`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CITIZENSHIP,value:s.citizenship,sourcePath:`caseData._source.general_information.accused[${r}].citizenship`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.AGE_GROUP,value:s.age_group,sourcePath:`caseData._source.general_information.accused[${r}].age_group`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.EDUCATION,value:s.education,sourcePath:`caseData._source.general_information.accused[${r}].education`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.MARITAL_STATUS,value:s.marital_status,sourcePath:`caseData._source.general_information.accused[${r}].marital_status`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.CHILDREN,value:s.children,sourcePath:`caseData._source.general_information.accused[${r}].children`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.information.subjects.fields.WORKPLACE,value:s.employment_and_education?.workplace,sourcePath:`caseData._source.general_information.accused[${r}].employment_and_education.workplace`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.information.subjects.fields.EDUCATIONAL_INSTITUTION,value:s.employment_and_education?.educational_institution,sourcePath:`caseData._source.general_information.accused[${r}].employment_and_education.educational_institution`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.IS_MILITARY,value:s.is_military,sourcePath:`caseData._source.general_information.accused[${r}].is_military`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.MILITARY_STATUS,value:s.military_status,sourcePath:`caseData._source.general_information.accused[${r}].military_status`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.OCCUPATION,value:s.occupation,sourcePath:`caseData._source.general_information.accused[${r}].occupation`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.MENTAL_HEALTH,value:s.mental_health,sourcePath:`caseData._source.general_information.accused[${r}].mental_health`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PHYSICAL_HEALTH,value:s.physical_health,sourcePath:`caseData._source.general_information.accused[${r}
866].physical_health`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.CRIMINAL_RECORDS_STATUS,value:s.criminal_records_status,sourcePath:`caseData._source.general_information.accused[${r}].criminal_records_status`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]},{title:h.client.case.secondInstance.information.subjects.titles.RECORDS_TITLE,textWithTooltip:d.length===0?{text:h.client.case.secondInstance.information.subjects.placeholders.NO_DATA}:void 0,rowsGroups:d},{title:h.client.case.secondInstance.information.subjects.titles.CHARACTERISTICS,textWithTooltip:p.length===0?{text:h.client.case.secondInstance.information.subjects.placeholders.NO_DATA}:void 0,rowsGroups:p},{title:h.client.case.secondInstance.information.subjects.titles.SPECIAL_SUBJECT,rows:[{text:{type:"boolean",label:h.client.case.secondInstance.information.subjects.fields.SPECIAL_SUBJECT_IS_SPECIAL,value:s?.special_subject?.is_special,sourcePath:`caseData._source.general_information.accused[${r}].special_subject.is_special`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.SPECIAL_SUBJECT_TYPE,value:s?.special_subject?.type,sourcePath:`caseData._source.general_information.accused[${r}].special_subject.type`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.SPECIAL_SUBJECT_DESCRIPTION,value:s?.special_subject?.description,sourcePath:`caseData._source.general_information.accused[${r}].special_subject.description`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]},{title:h.client.case.secondInstance.information.subjects.titles.PLEA,textWithTooltip:A.length===0?{text:h.client.case.secondInstance.information.subjects.placeholders.NO_DATA}:void 0,rowsGroups:A},{title:h.client.case.secondInstance.information.subjects.titles.PREVENTIVE_MEASURE,rows:[{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PREVENTIVE_MEASURE_TYPE,value:s?.preventive_measure?.type,sourcePath:`caseData._source.general_information.accused[${r}].preventive_measure.type`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.subjects.fields.PREVENTIVE_MEASURE_CONDITIONS,value:s?.preventive_measure?.conditions,sourcePath:`caseData._source.general_information.accused[${r}].preventive_measure.conditions`,placeholder:h.client.case.secondInstance.information.subjects.placeholders.NOT_SPECIFIED}}]},{title:h.client.case.secondInstance.information.subjects.titles.PROCEDURAL_HISTORY,textWithTooltip:g.length===0?{text:h.client.case.secondInstance.information.subjects.placeholders.NO_DATA}:void 0,rowsGroups:g}]}}),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{anchor:`subjects-${s}`,title:n.title,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,textWithTooltip:r.textWithTooltip,rows:r.rows,rowsGroups:r.rowsGroups},`property-card-${s}-${i}`))},`subject-${s}`))})},Sue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.victims_details??[]).map((s,r)=>({title:s?.name??h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.secondInstance.information.victims.fields.NAME,value:s?.name,sourcePath:`caseData._source.general_information.victims_details[${r}].name`,placeholder:h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.victims.fields.AGE_STATUS,value:s?.age_status,sourcePath:`caseData._source.general_information.victims_details[${r}].age_status`,placeholder:h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.victims.fields.GENDER,value:s?.gender,sourcePath:`caseData._source.general_information.victims_details[${r}].gender`,placeholder:h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.victims.fields.RELATION_TO_ACCUSED,value:s?.relation_to_accused,sourcePath:`caseData._source.general_information.victims_details[${r}].relation_to_accused`,placeholder:h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.victims.fields.ADDRESS,value:s?.address,sourcePath:`caseData._source.general_information.victims_details[${r}].address`,placeholder:h.client.case.secondInstance.information.victims.placeholders.NOT_SPECIFIED}}]}]})),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{title:n.title,anchor:`victims-${s}`,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,rows:r.rows,rowsGroups:r.rowsGroups},i))}
866,s))})},vue=({caseData:e})=>{const t=l.useMemo(()=>(e?._source?.general_information.witnesses_details??[]).map((s,r)=>({title:s?.name??h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED,propertyCards:[{rows:[{text:{type:"string",label:h.client.case.secondInstance.information.witnesses.fields.NAME,value:s?.name,sourcePath:`caseData._source.general_information.witnesses_details[${r}].name`,placeholder:h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.witnesses.fields.AGE_STATUS,value:s?.age_status,sourcePath:`caseData._source.general_information.witnesses_details[${r}].age_status`,placeholder:h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.witnesses.fields.GENDER,value:s?.gender,sourcePath:`caseData._source.general_information.witnesses_details[${r}].gender`,placeholder:h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.witnesses.fields.RELATION_TO_ACCUSED,value:s?.relation_to_accused,sourcePath:`caseData._source.general_information.witnesses_details[${r}].relation_to_accused`,placeholder:h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.information.witnesses.fields.ADDRESS,value:s?.address,sourcePath:`caseData._source.general_information.witnesses_details[${r}].address`,placeholder:h.client.case.secondInstance.information.witnesses.placeholders.NOT_SPECIFIED}}]}]})),[e]);return a.jsx("div",{children:t.map((n,s)=>a.jsx(Kr,{anchor:`witnesses-${s}`,title:n.title,className:"mt-6 first:mt-0",children:n.propertyCards.map((r,i)=>a.jsx(Nt,{title:r.title,rows:r.rows,rowsGroups:r.rowsGroups},i))},s))})},Pw=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i}=st(),o=`/clients/${n}/cases/${s??"second-instance"}/${r}/${i??"second-instance"}`,c=Fe(),u=l.useRef(null),d=l.useRef(null),p=l.useMemo(()=>[{id:"general",title:h.client.case.secondInstance.information.menu.items.GENERAL,to:`${o}/information/general`,state:c.state},{id:"accused",title:h.client.case.secondInstance.information.menu.items.SUBJECTS,to:`${o}/information/accused`,state:c.state,count:e?._source?.general_information.accused?.length},{id:"witnesses",title:h.client.case.secondInstance.information.menu.items.WITNESSES,to:`${o}/information/witnesses`,state:c.state,count:e?._source?.general_information.witnesses_details?.length},{id:"victims",title:h.client.case.secondInstance.information.menu.items.VICTIMS,to:`${o}/information/victims`,state:c.state,count:e?._source?.general_information.victims_details?.length}],[o,c.state,e?._source?.general_information]),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/general"),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/accused"),E=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/witnesses"),x=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/victims"),y=l.useMemo(()=>g?"general":A?"accused":x?"victims":E?"witnesses":"general",[g,A,E,x]),I=l.useMemo(()=>p.find(w=>w.id===y)?.title??"",[p,y]),v=l.useMemo(()=>y==="general"?a.jsx(Ow,{caseData:e}):y==="accused"?a.jsx(Iue,{caseData:e}):y==="victims"?a.jsx(Sue,{caseData:e}):y==="witnesses"?a.jsx(vue,{caseData:e}):a.jsx(Ow,{caseData:e}),[y,e]);_s({containerRef:d,activeElementRef:u,isReady:!!e,isActive:!!A||!!E||!!x});const{handleSourceClick:S}=Ii();return a.jsx(Yn,{leftColumn:a.jsx("div",{children:p.map(b=>{const w=b.id===y;return a.jsx(Kn,{ref:w?u:null,title:b.title,isActive:w,to:b.to,state:b.state,count:b.count},b.id)})}),leftColumnStickyTitle:h.client.case.secondInstance.information.menu.titles.SECTION,rightColumn:v,rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:Y("flex","items-center","justify-between","roboto-flex-25-700-1","text-[24px]","leading-[24px]","uppercase","text-zinc-950","relative"),children:I}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:S,children:h.client.cases.links.SOURCE})})]}),rightStickyTitleRef:t,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:d})},fA=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""}
866,_ue=(e,t,n)=>{const s=e??[];if(!Array.isArray(s)||s.length===0)return;const i=t?.find(o=>o.name===n)?.indices?.[0]??0;return s[i]??void 0},Tue=e=>{if(e!==void 0)return`caseData._source.circumstances[${e}]`},_P=(e,t)=>t?.find(n=>n.name===e&&n.indices.length===1)?.indices?.[0],Nue=(e,t,n,s)=>{const r=Tue(e);if(!r)return;let i=r;for(const o of t){if(o==="related_circumstances"){const c=s??_P(o,n)??0;i+=`[${c}].${o}`;continue}i+=`.${o}`}return i},wue={description:{path:["related_circumstances","description"],label:h.client.case.secondInstance.circumstances.circumstance.fields.QUOTE,getValue:({related:e})=>fA(e?.description)},type:{path:["related_circumstances","type"],label:h.client.case.secondInstance.circumstances.circumstance.fields.TYPE,getValue:({related:e})=>fA(e?.type)},consideration_type:{path:["related_circumstances","consideration_type"],label:h.client.case.secondInstance.circumstances.circumstance.fields.CONSIDERATION_RESULT,getValue:({related:e})=>fA(e?.consideration_type??"")}},Rue=e=>{const{fieldTailPath:t,fieldTailSegments:n,circumstance:s,caseData:r,circumstanceIndex:i,relatedIndex:o}=e,c=(t??[]).join("/"),u=Object.entries(wue).find(([,x])=>x.path.join("/")===c);if(!u)return;const[,d]=u,p=_ue(s?.related_circumstances,n,"related_circumstances"),g=o??_P("related_circumstances",n)??0,A=d.getValue?d.getValue({circumstance:s,related:p,caseData:r,fieldTailSegments:n}):fA((()=>{let x=p;for(const y of d.path.filter(I=>I!=="related_circumstances")){if(x==null||typeof x!="object"||Array.isArray(x))return"";x=x[y]}return x})()),E=Nue(i,d.path,n,g);return{label:d.label,value:A,sourcePath:E}},Lw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},sh=e=>{if(!Array.isArray(e))return"";const t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length===0?"":t.join(", ")},Due=({eventIndex:e,felonyIndex:t,subjectivePartIndex:n})=>{if(e!==void 0&&t!==void 0&&n!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}].subjective_parts[${n}]`},zc=(e,t)=>{const n=Due(e);if(n)return`${n}.${t}`},TP={role:{label:h.client.case.secondInstance.fabula.event.fields.SUBJECT_ROLE,getValue:({subjectivePart:e})=>Lw(e?.role),getSourcePath:e=>zc(e,"role")},intent_type:{label:h.client.case.secondInstance.fabula.event.fields.INTENT_TYPE,getValue:({subjectivePart:e})=>Lw(e?.intent_type),getSourcePath:e=>zc(e,"intent_type")},intents:{label:h.client.case.secondInstance.fabula.event.fields.INTENTS,getValue:({subjectivePart:e})=>sh(e?.intents),getSourcePath:e=>zc(e,"intents")},motives:{label:h.client.case.secondInstance.fabula.event.fields.MOTIVES,getValue:({subjectivePart:e})=>sh(e?.motives),getSourcePath:e=>zc(e,"motives")},goals:{label:h.client.case.secondInstance.fabula.event.fields.GOALS,getValue:({subjectivePart:e})=>sh(e?.goals),getSourcePath:e=>zc(e,"goals")},emotions:{label:h.client.case.secondInstance.fabula.event.fields.EMOTIONS,getValue:({subjectivePart:e})=>sh(e?.emotions),getSourcePath:e=>zc(e,"emotions")},mental_states:{label:h.client.case.secondInstance.fabula.event.fields.MENTAL_STATES,getValue:({subjectivePart:e})=>sh(e?.mental_states),getSourcePath:e=>zc(e,"mental_states")}},kue=e=>{const{fieldName:t,subjectivePart:n,caseData:s,eventIndex:r,felonyIndex:i,subjectivePartIndex:o}=e;if(!t)return;const c=TP[t];if(!c)return;const u=c.getValue({subjectivePart:n,caseData:s}),d=c.getSourcePath({eventIndex:r,felonyIndex:i,subjectivePartIndex:o});return{label:c.label,value:u,sourcePath:d}},Oue=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},NP={primary_object_description:{path:["primary_object","description"],label:h.client.case.secondInstance.fabula.event.fields.OBJECT_DESCRIPTION},related_law_description:{path:["primary_object","related_law","description"],label:h.client.case.secondInstance.fabula.event.fields.RELATED_LAW_DESCRIPTION},article:{path:["primary_object","related_law","law","article"],label:h.client.case.secondInstance.fabula.event.fields.LAW_ARTICLE},is_law_removed:{path:["primary_object","related_law","law","is_law_removed"],label:h.client.case.secondInstance.fabula.event.fields.LAW_IS_REMOVED,getValue:({objects:e})=>{const t=e?.primary_object?.related_law?.law?.is_law_removed;return t==null?"":String(t)}}},Pue=e=>{const{fieldName:t,objects:n,caseData:s}=e;if(!t)return;const r=NP[t];if(!r)return;const i=(()=>
866{if(r.getValue)return r.getValue({objects:n,caseData:s});const c=((u,d)=>{let p=u;for(const g of d){if(p==null||typeof p!="object"||Array.isArray(p))return;p=p[g]}return p})(n,r.path);return Oue(c)})();return{label:r.label,value:i}},Mw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Wy=e=>{const t=e?.actions??[];if(Array.isArray(t)&&t.length!==0)return t[0]},wP={description:{label:h.client.case.secondInstance.fabula.event.fields.ACTION_DESCRIPTION,getValue:({objectivePart:e})=>{const t=Wy(e);return Mw(t?.description)}},date:{label:h.client.case.secondInstance.fabula.event.link.fields.DATE,getValue:({objectivePart:e})=>{const t=Wy(e),n=(()=>{const s=t?.date;if(typeof s=="string")return s;const r=t?.data;return typeof r=="string"?r:""})();return Kt({dateString:n,isWithTime:!1,isShortMonth:!1})}},location:{label:h.client.case.secondInstance.fabula.event.link.fields.LOCATION,getValue:({objectivePart:e})=>{const t=Wy(e);return Mw(t?.location)}}},Lue=e=>{const{fieldName:t,objectivePart:n,caseData:s}=e;if(!t)return;const r=wP[t];if(!r)return;const i=r.getValue({objectivePart:n,caseData:s});return{label:r.label,value:i}},jw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},RP={event_description:{label:h.client.case.secondInstance.fabula.event.fields.EVENT_DESCRIPTION,getValue:({event:e})=>jw(e?.event_description)},location:{label:h.client.case.secondInstance.fabula.event.link.fields.LOCATION,getValue:({event:e})=>jw(e?.location)}},Mue=e=>{const{fieldName:t,event:n,caseData:s}=e;if(!t)return;const r=RP[t];if(!r)return;const i=r.getValue({event:n,caseData:s});return{label:r.label,value:i}},jue=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},Bue=({eventIndex:e,felonyIndex:t})=>{if(e!==void 0&&t!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}]`},Fue=(e,t)=>{const n=Bue(e);if(n)return`${n}.${t}`},DP={severity:{label:h.client.case.secondInstance.fabula.event.fields.SEVERITY,getValue:({felony:e})=>jue(e?.severity),getSourcePath:e=>Fue(e,"severity")}},Uue=e=>{const{fieldName:t,felony:n,caseData:s,eventIndex:r,felonyIndex:i}=e;if(!t)return;const o=DP[t];if(!o)return;const c=o.getValue({felony:n,caseData:s}),u=o.getSourcePath({eventIndex:r,felonyIndex:i});return{label:o.label,value:c,sourcePath:u}},Bw=e=>{if(typeof e!="string")return"";const t=e.trim();return t||""},zue=e=>{const t=e.map(n=>n.trim()).filter(n=>n.length>0);return t.length===0?"":t.join(", ")},D0=(e,t)=>{const n=e?.victims_harm??[];if(!Array.isArray(n))return"";const s=n.map(r=>{if(!r)return"";const i=(()=>{if(t==="injuries")return r.injuries;if(t==="physical_harm")return r.physical_harm;if(t==="emotional_harm")return r.emotional_harm;if(t==="material_harm")return r.material_harm})();return typeof i=="string"?i:""}).filter(r=>r.length>0);return zue(s)},WI=({eventIndex:e,felonyIndex:t,actionIndex:n})=>{if(e!==void 0&&t!==void 0&&n!==void 0)return`caseData._source.case_narrative.events[${e}].felonies[${t}].objective_part.actions[${n}]`}
866,Que=(e,t,n)=>{if(n!==void 0)return n;const s=e?.victims_harm??[];if(!Array.isArray(s)||s.length===0)return 0;const r=s.findIndex(i=>{if(!i)return!1;const o=i[t];return typeof o=="string"&&o.trim().length>0});return r>=0?r:0},k0=(e,t)=>{const n=WI(e);if(!n)return;const s=Que(e.action,t,e.harmIndex);return`${n}.victims_harm[${s}].${t}`},kP={description:{label:h.client.case.secondInstance.fabula.event.fields.ACTION_DESCRIPTION,getValue:({action:e})=>Bw(e?.description),getSourcePath:e=>{const t=WI(e);if(t)return`${t}.description`}},method:{label:h.client.case.secondInstance.fabula.event.fields.ACTION_METHOD,getValue:({action:e})=>Bw(e?.method),getSourcePath:e=>{const t=WI(e);if(t)return`${t}.method`}},injuries:{label:h.client.case.secondInstance.fabula.event.fields.INJURIES,getValue:({action:e})=>D0(e,"injuries"),getSourcePath:e=>k0(e,"injuries")},physical_harm:{label:h.client.case.secondInstance.fabula.event.fields.PHYSICAL_HARM,getValue:({action:e})=>D0(e,"physical_harm"),getSourcePath:e=>k0(e,"physical_harm")},emotional_harm:{label:h.client.case.secondInstance.fabula.event.fields.EMOTIONAL_HARM,getValue:({action:e})=>D0(e,"emotional_harm"),getSourcePath:e=>k0(e,"emotional_harm")},material_harm:{label:h.client.case.secondInstance.fabula.event.fields.MATERIAL_HARM,getValue:({action:e})=>D0(e,"material_harm"),getSourcePath:e=>k0(e,"material_harm")}},Hue=e=>{const{fieldName:t,action:n,caseData:s,eventIndex:r,felonyIndex:i,actionIndex:o,harmIndex:c}=e;if(!t)return;const u=kP[t];if(!u)return;const d=u.getValue({action:n,caseData:s}),p=u.getSourcePath({eventIndex:r,felonyIndex:i,actionIndex:o,harmIndex:c,action:n});return{label:u.label,value:d,sourcePath:p}},Qi={evidence:{getLinkFieldData:dP},accused:{getLinkFieldData:mP},circumstance:{getLinkFieldData:Rue},subjectivePart:{linkFieldConfig:TP,getLinkFieldData:kue},objects:{linkFieldConfig:NP,getLinkFieldData:Pue},objectivePart:{linkFieldConfig:wP,getLinkFieldData:Lue},event:{linkFieldConfig:RP,getLinkFieldData:Mue},felony:{linkFieldConfig:DP,getLinkFieldData:Uue},action:{linkFieldConfig:kP,getLinkFieldData:Hue}},qc=(e,t)=>t?e?.[t]??t:"",Fw=(e,t)=>Array.isArray(t)?t.map(n=>qc(e,n)).filter(n=>!!n):[],Vue=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i}=st(),o=`/clients/${n}/cases/${s??"second-instance"}/${r}/${i??"second-instance"}`,c=Fe(),u=l.useRef(null),d=l.useRef(null),p=l.useMemo(()=>{const M=new Map;return(e?._source?.case_narrative?.events??[]).forEach(W=>{(W?.felonies??[]).forEach(j=>{const q=j?.felony_id??void 0;if(!q)return;const G=j?.objects?.primary_object?.related_law?.law,$=G?.part,J=G?.article,ne=G?.clause;if(!J)return;const X=et({clause:ne,part:$,number:J});M.set(String(q),X)})}),M},[e?._source?.case_narrative?.events]),g=l.useMemo(()=>{const M=e?._source?.appeals??[],K=e?._source?.appeal_result??[],W=e?._source?.general_information?.accused??[],H=new Map;W.forEach(q=>{const G=q?.id;if(typeof G=="string"&&G&&!H.has(G)){const $=q?.name??"",J=W.findIndex(ne=>ne?.id===G);H.set(G,{accusedId:G,accusedName:$,accusedIndex:J,items:[]})}}),M.forEach((q,G)=>{const $=q?.related_accused_id??"";if(typeof $!="string"||!$||!H.has($))return;const J=q?.applicant_category,ne=typeof J=="string"?J:"",X=h.enums.applicantCategories?.[ne]??ne,oe=q?.appeal_goal,ie=typeof oe=="string"?oe:"",ee=h.enums.appealGoals?.[ie]??ie,le=K.find(ce=>ce?.appeal_id===q?.appeal_id)?.appeal_satisfaction,he=typeof le=="string"?le:"",fe=q?.appeal_id,ue=typeof fe=="string"&&fe?fe:String(G),ye=H.get($);ye&&ye.items.push({id:`appeal-${ue}-${$}`,entityId:ue,accusedId:$,title:X,text:ee,description:"",instance:he,to:`${o}/complaints-and-submissions/${$}/${ue}`,state:typeof c.state=="object"&&c.state!==null?c.state:void 0,index:G})});const j=Array.from(H.values()).sort((q,G)=>q.accusedIndex-G.accusedIndex).filter(q=>q.items.length>0);if(j.length>0&&j[0].items.length>0){const q=j[0].items[0];q.to=`${o}/complaints-and-submissions`}return j.map(q=>({header:{id:`appeal-accused-${q.accusedId}`,title:q.accusedName},items:q.items,accusedId:q.accusedId}))},[e,o,c.state]),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions/:accusedId/:itemId"),E=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions/:accusedId"),x=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions"),{accusedIndex:y,itemIndex:I}=l.useMemo(()=>
866{if(x)return{accusedIndex:0,itemIndex:0};const M=A?.params?.accusedId??E?.params?.accusedId,K=A?.params?.itemId;if(typeof M=="string"&&M)for(let W=0;W<(g?.length??0);W++){const H=g?.[W];if(H?.accusedId===M){if(typeof K=="string"&&K){const q=(H.items??[]).findIndex(G=>G.entityId===K&&G.accusedId===M);if(q>=0)return{accusedIndex:W,itemIndex:q}}return{accusedIndex:W,itemIndex:0}}}return{accusedIndex:0,itemIndex:0}},[A,E,x,g]),v=(M,K,W,H)=>M===W&&K===H,S=l.useMemo(()=>{const M=g?.[y]?.items?.[I]?.title??"",K=typeof M=="string"?M.trim():"";return K?ju({text:K,maxLength:130}):""},[g,y,I]),b=l.useMemo(()=>{const M=e?._source?.appeals??[],W=g?.[y]?.items?.[I]?.entityId??"";if(!W)return;const H=M.find(q=>String(q?.appeal_id)===String(W));if(H)return H;const j=Number(W);if(Number.isFinite(j))return M[j]},[e?._source?.appeals,g,y,I]),w=l.useMemo(()=>{if(!b)return;const K=(b.applicant_requests??[]).flatMap(H=>(Array.isArray(H?.appeal_arguments)?H.appeal_arguments:[]).map(q=>q?.quote??"")),W=sr(K);if(W.length)return W},[b]),{handleSourceClick:_}=Ii({initialSearchTerms:w??[]}),N=l.useMemo(()=>{const M=Array.isArray(b?.related_felony_id)?b.related_felony_id:[],K=Array.isArray(b?.opposing_requests)?b.opposing_requests.flatMap(W=>Array.isArray(W?.related_felony_id)?W.related_felony_id:[]):[];return Array.from(new Set([...M.filter(Boolean),...K.filter(Boolean)]))},[b]),R=l.useMemo(()=>b?.appeal_id?(e?._source?.appeal_result??[]).find(K=>K?.appeal_id===b.appeal_id):void 0,[e?._source?.appeal_result,b?.appeal_id]),k=`caseData._source.appeals[${l.useMemo(()=>{const M=e?._source?.appeals??[];return Math.max(0,M.findIndex(K=>K===b))},[e?._source?.appeals,b])}]`,O=`caseData._source.appeal_result[${l.useMemo(()=>{const M=e?._source?.appeal_result??[],K=b?.appeal_id;return K?Math.max(0,M.findIndex(W=>W?.appeal_id===K)):0},[e?._source?.appeal_result,b?.appeal_id])}]`,P=l.useMemo(()=>{if(!b)return[];const M=qc(h.enums.applicantCategories,b.applicant_category),K=qc(h.enums.appealGoals,b.appeal_goal),W=Fw(h.enums.appealGrounds,b.appeal_grounds),H=Fw(h.enums.appealDocuments,b.appeal_documents),j=b.appeal_goal??"",q=j==="OTHER"||j===h.enums.appealGoals.OTHER||K===h.enums.appealGoals.OTHER,G=R?.result??null,$=(()=>{const ne=N.map(X=>p.get(String(X))).filter(Boolean);return ne.length>0?ne.join(", "):null})(),J=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.LAW_ARTICLE,value:$,sourcePath:`${k}.related_felony_id`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPLICANT_NAME,value:b.applicant_name,sourcePath:`${k}.applicant_name`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPLICANT_CATEGORY,value:M,sourcePath:`${k}.applicant_category`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_GOAL,value:K,sourcePath:`${k}.appeal_goal`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},...q?[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_GOAL_DESCRIPTION,value:b.appeal_goal_description,sourcePath:`${k}.appeal_goal_description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_GROUNDS,value:W.length?W.join(", "):null,sourcePath:`${k}.appeal_grounds`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NO_DATA}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_DOCUMENTS,value:H.length?H.join(", "):null,sourcePath:`${k}.appeal_documents`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NO_DATA}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_RESULT,value:G,sourcePath:`${O}.result`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}];return[{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.APPEAL_INFORMATION,rows:J}]},[b,R?.result,k,O,N,p]),B=l.useMemo(()=>
866{if(!b)return[];const M=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_SATISFACTION,value:R?.appeal_satisfaction??null,sourcePath:`${O}.appeal_satisfaction`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_MOTIVES,value:R?.motives??null,sourcePath:`${O}.motives`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.APPEAL_DESCRIPTION,value:R?.appeal_description??null,sourcePath:`${O}.appeal_description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}];return[{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.APPEAL_RESULT,rows:M}]},[b,R?.appeal_satisfaction,R?.motives,R?.appeal_description,O]),F=l.useMemo(()=>{if(!b)return[];const M=b.applicant_requests??[];if(!Array.isArray(M)||M.length===0)return[{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.APPEAL_REQUESTS,textWithTooltip:{text:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NO_DATA}}];const K=[];return M.forEach((W,H)=>{const j=qc(h.enums.applicantCategories,W?.applicant_category),q=qc(h.enums.requestGoals,W?.goal),G=W?.goal??"",$=G==="OTHER"||G===h.enums.requestGoals.OTHER||q===h.enums.requestGoals.OTHER,J=W?.laws??[],ne=Array.isArray(J)?J.map(ie=>{const ee=ie?.part,te=ie?.article,le=ie?.clause,he=ie?.code_type;if(!te)return null;const fe=et({clause:le,part:ee,number:te,codeType:he});return fe?{text:fe,isRemoved:ie?.is_law_removed===!0}:null}).filter(ie=>ie!==null):[],X=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_APPLICANT_CATEGORY,value:j,sourcePath:`${k}.applicant_requests[${H}].applicant_category`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_GOAL,value:q,sourcePath:`${k}.applicant_requests[${H}].goal`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},...$?[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_GOAL_DESCRIPTION,value:W?.goal_description,sourcePath:`${k}.applicant_requests[${H}].goal_description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"array",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_LAW,value:ne.map(ie=>ie.text),isRemovedIcon:ne.map(ie=>ie.isRemoved),sourcePath:`${k}.applicant_requests[${H}].laws`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_IS_SUCCESSFUL,value:W?.is_request_successful??null,sourcePath:`${k}.applicant_requests[${H}].is_request_successful`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}];K.push({title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.APPEAL_REQUESTS,rows:X,anchor:W?.applicant_request_id??void 0}),(Array.isArray(W?.appeal_arguments)?W.appeal_arguments:[]).forEach((ie,ee)=>{const te=ie?.laws??[],le=Array.isArray(te)?te.map(ce=>{const xe=ce?.part,re=ce?.article,pe=ce?.clause,_e=ce?.code_type;if(!re)return null;const Le=et({clause:pe,part:xe,number:re,codeType:_e});return Le?{text:Le,isRemoved:ce?.is_law_removed===!0}:null}).filter(ce=>ce!==null):[],he=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_DESCRIPTION,value:ie?.description,sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_QUOTE,value:ie?.quote,sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].quote`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_RESULT,value:ie?.result,sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].result`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_LAW,value:le.map(ce=>ce.text),isRemovedIcon:le.map(ce=>ce.isRemoved),sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].laws`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}],fe=[];(Array.isArray(ie?.related_evidence_ids)?ie?.related_evidence_ids.filter(
866Boolean):[]).forEach((ce,xe)=>{const re=(e?._source?.evidence??[]).findIndex(_e=>_e?.evidence_id===ce);if(re<0)return;const pe=`evidence[${re}]`;fe.push({rows:[{text:{type:"link",sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].related_evidence_ids[${xe}]`,label:"",placeholder:"",value:pe,caseData:e}}]})}),(Array.isArray(ie?.related_circumstance_ids)?ie?.related_circumstance_ids.filter(Boolean):[]).forEach((ce,xe)=>{const re=e?._source?.circumstances??[];let pe=-1,_e=-1;if(re.forEach((Ee,se)=>{const de=(Ee?.related_circumstances??[]).findIndex(ge=>ge?.circumstance_id===ce);de>=0&&pe===-1&&(pe=se,_e=de)}),pe<0||_e<0)return;const Le=`circumstances[${pe}].related_circumstances[${_e}]`;fe.push({rows:[{text:{type:"link",sourcePath:`${k}.applicant_requests[${H}].appeal_arguments[${ee}].related_circumstance_ids[${xe}]`,label:"",placeholder:"",value:Le,caseData:e}}]})}),K.push({title:`${h.client.case.secondInstance.complaintsAndSubmissions.item.titles.ARGUMENT} ${ee+1}`,rows:he},{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.LINKED_ITEMS,rowsGroups:fe.length?fe:void 0})})}),K},[b,k,e]),z=l.useMemo(()=>{if(!b)return[];const M=b.opposing_requests??[];if(!Array.isArray(M)||M.length===0)return[{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.OPPOSING_REQUESTS,textWithTooltip:{text:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NO_DATA}}];const K=[];return M.forEach((W,H)=>{const j=qc(h.enums.applicantCategories,W?.applicant_category),q=qc(h.enums.requestGoals,W?.goal),G=W?.goal??"",$=G==="OTHER"||G===h.enums.requestGoals.OTHER||q===h.enums.requestGoals.OTHER,J=W?.laws??[],ne=Array.isArray(J)?J.map(ie=>{const ee=ie?.part,te=ie?.article,le=ie?.clause,he=ie?.code_type;if(!te)return null;const fe=et({clause:le,part:ee,number:te,codeType:he});return fe?{text:fe,isRemoved:ie?.is_law_removed===!0}:null}).filter(ie=>ie!==null):[],X=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_APPLICANT_CATEGORY,value:j,sourcePath:`${k}.opposing_requests[${H}].applicant_category`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_GOAL,value:q,sourcePath:`${k}.opposing_requests[${H}].goal`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},...$?[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_GOAL_DESCRIPTION,value:W?.goal_description,sourcePath:`${k}.opposing_requests[${H}].goal_description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"array",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_LAW,value:ne.map(ie=>ie.text),isRemovedIcon:ne.map(ie=>ie.isRemoved),sourcePath:`${k}.opposing_requests[${H}].laws`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.REQUEST_IS_SUCCESSFUL,value:W?.is_request_successful??null,sourcePath:`${k}.opposing_requests[${H}].is_request_successful`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}];K.push({title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.OPPOSING_REQUESTS,rows:X}),(Array.isArray(W?.opposing_arguments)?W.opposing_arguments:[]).forEach((ie,ee)=>{const te=ie?.laws??[],le=Array.isArray(te)?te.map(ce=>{const xe=ce?.part,re=ce?.article,pe=ce?.clause,_e=ce?.code_type;if(!re)return null;const Le=et({clause:pe,part:xe,number:re,codeType:_e});return Le?{text:Le,isRemoved:ce?.is_law_removed===!0}:null}).filter(ce=>ce!==null):[],he=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_DESCRIPTION,value:ie?.description,sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_QUOTE,value:ie?.quote,sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].quote`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_RESULT,value:ie?.result,sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].result`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_LAW,value:le.map(ce=>ce.text),isRemovedIcon:le.map(ce=>ce.isRemoved),sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].laws`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}],fe=[];(Array.isArray(ie?.related_evidence_ids)?ie?.related_evidence_ids.filter(
866Boolean):[]).forEach((ce,xe)=>{const re=(e?._source?.evidence??[]).findIndex(_e=>_e?.evidence_id===ce);if(re<0)return;const pe=`evidence[${re}]`;fe.push({rows:[{text:{type:"link",sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].related_evidence_ids[${xe}]`,label:"",placeholder:"",value:pe,caseData:e}}]})}),(Array.isArray(ie?.related_circumstance_ids)?ie?.related_circumstance_ids.filter(Boolean):[]).forEach((ce,xe)=>{const re=e?._source?.circumstances??[];let pe=-1,_e=-1;if(re.forEach((Ee,se)=>{const de=(Ee?.related_circumstances??[]).findIndex(ge=>ge?.circumstance_id===ce);de>=0&&pe===-1&&(pe=se,_e=de)}),pe<0||_e<0)return;const Le=`circumstances[${pe}].related_circumstances[${_e}]`;fe.push({rows:[{text:{type:"link",sourcePath:`${k}.opposing_requests[${H}].opposing_arguments[${ee}].related_circumstance_ids[${xe}]`,label:"",placeholder:"",value:Le,caseData:e}}]})}),K.push({title:`${h.client.case.secondInstance.complaintsAndSubmissions.item.titles.ARGUMENT} ${ee+1}`,rows:he},{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.LINKED_ITEMS,rowsGroups:fe.length?fe:void 0})})}),K},[b,k,e]),Q=l.useMemo(()=>{if(!b)return[];const M=b.court_arguments??[];if(!Array.isArray(M)||M.length===0)return[{title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.COURT_ARGUMENTS,textWithTooltip:{text:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NO_DATA}}];const K=[];return M.forEach((W,H)=>{const j=W?.laws??[],q=Array.isArray(j)?j.map(X=>{const oe=X?.part,ie=X?.article,ee=X?.clause,te=X?.code_type;if(!ie)return null;const le=et({clause:ee,part:oe,number:ie,codeType:te});return le?{text:le,isRemoved:X?.is_law_removed===!0}:null}).filter(X=>X!==null):[],G=[{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_DESCRIPTION,value:W?.description,sourcePath:`${k}.court_arguments[${H}].description`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_QUOTE,value:W?.quote,sourcePath:`${k}.court_arguments[${H}].quote`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}},{text:{type:"array",label:h.client.case.secondInstance.complaintsAndSubmissions.item.fields.ARGUMENT_LAW,value:q.map(X=>X.text),isRemovedIcon:q.map(X=>X.isRemoved),sourcePath:`${k}.court_arguments[${H}].laws`,placeholder:h.client.case.secondInstance.complaintsAndSubmissions.item.placeholders.NOT_SPECIFIED}}],$=[];(Array.isArray(W?.related_evidence_ids)?W?.related_evidence_ids.filter(Boolean):[]).forEach((X,oe)=>{const ie=(e?._source?.evidence??[]).findIndex(te=>te?.evidence_id===X);if(ie<0)return;const ee=`evidence[${ie}]`;$.push({rows:[{text:{type:"link",sourcePath:`${k}.court_arguments[${H}].related_evidence_ids[${oe}]`,label:"",placeholder:"",value:ee,caseData:e}}]})}),(Array.isArray(W?.related_circumstance_ids)?W?.related_circumstance_ids.filter(Boolean):[]).forEach((X,oe)=>{const ie=e?._source?.circumstances??[];let ee=-1,te=-1;if(ie.forEach((he,fe)=>{const ye=(he?.related_circumstances??[]).findIndex(ce=>ce?.circumstance_id===X);ye>=0&&ee===-1&&(ee=fe,te=ye)}),ee<0||te<0)return;const le=`circumstances[${ee}].related_circumstances[${te}]`;$.push({rows:[{text:{type:"link",sourcePath:`${k}.court_arguments[${H}].related_circumstance_ids[${oe}]`,label:"",placeholder:"",value:le,caseData:e}}]})}),K.push({title:`${h.client.case.secondInstance.complaintsAndSubmissions.item.titles.COURT_ARGUMENTS} ${H+1}`,rows:G}),$.length>0&&K.push({title:h.client.case.secondInstance.complaintsAndSubmissions.item.titles.LINKED_ITEMS,rowsGroups:$})}),K},[b,k,e]);return _s({containerRef:d,activeElementRef:u,isReady:!!e,isActive:!!(A??E)}),a.jsx(Yn,{leftColumn:a.jsx("div",{children:g.map((M,K)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:M.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),M.items.map((W,H)=>{const j=v(y,I,K,H);return a.jsx(Kn,{ref:j?u:null,title:W.title,text:W.text,description:W.description,instance:W.instance,isTextBlockLimited:!0,to:W.to,state:W.state,isActive:j},W.id)})]},M.header.id))}),leftColumnStickyTitle:h.client.case.secondInstance.complaintsAndSubmissions.menu.titles.SECTION,rightColumn:a.jsxs("div",{children:[P.map(M=>a.jsx(Nt,{title:M.title??"",rows:M.rows,rowsGroups:M.rowsGroups,textWithTooltip:M.textWithTooltip,linkFieldConfigs:Qi},M.title)),B.map(M=>a.jsx(Nt,{title:M.title??"",rows:M.rows,rowsGroups:M.rowsGroups,textWithTooltip:M.textWithTooltip,linkFieldConfigs:Qi},M.title)),F.map((M,K)=>
866a.jsx(Nt,{title:M.title??"",anchor:M.anchor,rows:M.rows,rowsGroups:M.rowsGroups,textWithTooltip:M.textWithTooltip,linkFieldConfigs:Qi},`${String(M.title??"")}-${K}`)),z.map((M,K)=>a.jsx(Nt,{title:M.title??"",rows:M.rows,rowsGroups:M.rowsGroups,textWithTooltip:M.textWithTooltip,linkFieldConfigs:Qi},`${String(M.title??"")}-${K}`)),Q.map((M,K)=>a.jsx(Nt,{title:M.title??"",rows:M.rows,rowsGroups:M.rowsGroups,textWithTooltip:M.textWithTooltip,linkFieldConfigs:Qi},`${String(M.title??"")}-${K}`))]}),rightColumnStickyTitle:a.jsxs("div",{ref:t,children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:S}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:_,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:d})},Gue=({caseData:e,eventIndex:t=0,felonyIndex:n})=>{const{id:s,listInstance:r,caseId:i,caseInstance:o}=st(),c=`/clients/${s}/cases/${r??"second-instance"}/${i}/${o??"second-instance"}`,u=l.useMemo(()=>e?._source?.case_narrative?.events?.[t],[e,t]),d=l.useMemo(()=>u?.felonies??[],[u]),p=`caseData._source.case_narrative.events[${t}].felonies[${n}]`,g=l.useMemo(()=>!d.length||n===void 0||!d[n]?0:n,[d,n]),A=`${p}.felonies[${g}]`,E=l.useMemo(()=>{if(d.length)return n===void 0||!d?.[n]?d[0]:d[n]},[d,n]),x=l.useMemo(()=>u?u?.is_context_event===!0?[]:d.map((b,w)=>{const _=b?.objects?.primary_object?.related_law?.law,N=_?.article?et({clause:_?.clause,part:_?.part,number:_.article}):"",R=`${c}/fabula`,D=w===0?t===0?R:`${R}/${t}`:t===0?`${R}/0/${w}`:`${R}/${t}/${w}`;return{id:String(w),label:N,to:D}}).filter(b=>!!b.label):[],[u,d,t,c]),y=l.useMemo(()=>[{rows:[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.EVENT_DESCRIPTION,value:u?.event_description,sourcePath:`${p}.event_description`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},...u?.is_context_event===!0?[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.EVENT_TYPE,value:h.client.case.secondInstance.fabula.event.values.CONTEXT,sourcePath:`${p}.is_context_event`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED,hint:h.client.case.secondInstance.fabula.event.hints.CONTEXT_EVENT}}]:[],...u?.is_context_event!==!0?[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.SEVERITY,value:E?.severity,sourcePath:`${A}.severity`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}]:[]]}],[u?.event_description,u?.is_context_event,p,A,E?.severity]),I=l.useMemo(()=>{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.objects?.primary_object?.description,w=E?.objects?.primary_object?.related_law,_=w?.law,N=[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.OBJECT_DESCRIPTION,value:b,sourcePath:`${A}.objects.primary_object.description`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.LAW_ARTICLE,value:_?.article?et({clause:_?.clause,part:_?.part,number:_.article}):null,sourcePath:`${A}.objects.primary_object.related_law.law`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.fabula.event.fields.LAW_IS_REMOVED,value:_?.is_law_removed,sourcePath:`${A}.objects.primary_object.related_law.law.is_law_removed`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.RELATED_LAW_DESCRIPTION,value:w?.description,sourcePath:`${A}.objects.primary_object.related_law.description`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}],R=[{title:h.client.case.secondInstance.fabula.event.titles.PRIMARY_OBJECT,rows:N}],D=E?.objects?.secondary_objects;return D&&Array.isArray(D)&&D.length&&R.push({title:h.client.case.secondInstance.fabula.event.titles.SECONDARY_OBJECTS,rows:[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.SECONDARY_OBJECT_DESCRIPTION,value:D.join(", "),sourcePath:`${A}.objects.secondary_objects`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}),R},[u,A,E]),v=l.useMemo(()=>
866{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.subjective_parts??[];if(!Array.isArray(b))return[];if(!b.length)return[];const w=e?._source?.general_information?.accused??[];return b.map((_,N)=>{const R=(()=>{const k=_?.related_accused_id;return k?w?.find(O=>O?.id===k)?.name:null})(),D=_?.role;return{title:[R,D].filter(Boolean).join(" — "),rows:[{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.INTENT_TYPE,value:_?.intent_type,sourcePath:`${A}.subjective_parts[${N}].intent_type`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.INTENTS,value:Array.isArray(_?.intents)&&_?.intents?.length?(_?.intents).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].intents`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.MOTIVES,value:Array.isArray(_?.motives)&&_?.motives?.length?(_?.motives).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].motives`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.GOALS,value:Array.isArray(_?.goals)&&_?.goals?.length?(_?.goals).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].goals`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.EMOTIONS,value:Array.isArray(_?.emotions)&&_?.emotions?.length?(_?.emotions).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].emotions`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.MENTAL_STATES,value:Array.isArray(_?.mental_states)&&_?.mental_states?.length?(_?.mental_states).join(", "):null,sourcePath:`${A}.subjective_parts[${N}].mental_states`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}})},[e?._source?.general_information?.accused,u,A,E]),S=l.useMemo(()=>{if(!u)return[];if(u?.is_context_event===!0)return[];if(!E)return[];const b=E?.objective_part?.actions??[];return Array.isArray(b)?b.length?b.reduce((w,_,N)=>{w.push({anchor:`action-${N}`,title:`${h.client.case.secondInstance.fabula.event.titles.ACTION} ${N+1}`,rows:[{text:{type:"plainLink",label:h.client.case.secondInstance.fabula.event.fields.ACCUSED_NAMES,value:Wi({ids:_?.accused_ids??null,path:"general_information.accused",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].accused_ids`,caseData:e,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"plainLink",label:h.client.case.secondInstance.fabula.event.fields.WITNESSES_NAMES,value:Wi({ids:_?.witnesses_ids??null,path:"general_information.witnesses_details",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].witnesses_ids`,caseData:e,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.ACTION_DESCRIPTION,value:_?.description,sourcePath:`${A}.objective_part.actions[${N}].description`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.ACTION_METHOD,value:_?.method,sourcePath:`${A}.objective_part.actions[${N}].method`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}]});const R=(_?.victims_harm??[]).filter(Boolean).map((D,k)=>({rows:[{text:{type:"plainLink",label:h.client.case.secondInstance.fabula.event.fields.VICTIM_NAME,value:Wi({ids:D?.related_victim_id??null,path:"general_information.victims_details",caseData:e}),sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].related_victim_id`,caseData:e,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.INJURIES,value:D?.injuries,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].injuries`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.PHYSICAL_HARM,value:D?.physical_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].physical_harm`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.EMOTIONAL_HARM,value:D?.emotional_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].emotional_harm`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.fabula.event.fields.MATERIAL_HARM,value:D?.material_harm,sourcePath:`${A}.objective_part.actions[${N}].victims_harm[${k}].material_harm`,placeholder:h.client.case.secondInstance.fabula.event.placeholders.NOT_SPECIFIED}}]}));return R.length&&w.push({title:h.client.case.secondInstance.fabula.event.titles.HARM,isSecondaryTitle:!0,rowsGroups:R}),w},[]):[]:[]},[e,u,A,E]);return a.jsxs("div",{children:[!!x.length&&a.jsx("div",{className:"mb-6",children:a.jsx(IP,{items:x})},"pills"),y.map((b,w)=>a.jsx(Nt,{title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:Qi},w)),!!I.length&&a.jsx(Kr,{title:h.client.case.secondInstance.fabula.event.titles.OBJECTS,anchor:"objects",className:"mt-6",children:I.map((b,w)=>a.jsx(Nt,{title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:Qi},w))},"objects"),!!S.length&&a.jsx(Kr,{title:h.client.case.secondInstance.fabula.event.titles.OBJECTIVE_PART,anchor:"objective-part",className:"mt-6",children:S.map((b,w)=>a.jsx(Nt,{anchor:b.anchor,title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,isSecondaryTitle:b.isSecondaryTitle,linkFieldConfigs:Qi},w))},"objectivePart"),!!v.length&&a.jsx(Kr,{title:h.client.case.secondInstance.fabula.event.titles.SUBJECTIVE_PARTS,className:"mt-6",children:v.map((b,w)=>a.jsx(Nt,{anchor:`subjective-part-${w}`,title:b.title??"",rows:b.rows,rowsGroups:b.rowsGroups,linkFieldConfigs:Qi},w))},"subjectivePart")]})},que=["Установил","Постановил","Определил"],Wue=({caseData:e,rightStickyTitleRef:t})=>{const{id:n,listInstance:s,caseId:r,caseInstance:i,eventId:o,felonyId:c}=st(),u=`/clients/${n}/cases/${s??"second-instance"}/${r}/${i??"second-instance"}`,d=Fe(),p=l.useRef(null),g=l.useRef(null),A=l.useMemo(()=>(e?._source?.case_narrative?.events??[]).map((b,w)=>({id:b?.event_id??`event-${w}`,title:`${h.client.case.secondInstance.fabula.menu.items.EVENT} ${w+1}`,text:b?.event_description,date:b?.date&&Kt({dateString:String(b.date).trim(),isWithTime:!1,isS
866hortMonth:!1})||void 0,instance:b?.location,to:w===0?`${u}/fabula`:`${u}/fabula/${w}`,state:d.state})),[e,u,d.state]),E=l.useMemo(()=>{const S=Number(o);return!Number.isFinite(S)||S<0?0:Math.min(Math.max(0,S),Math.max(0,A.length-1))},[o,A.length]),x=l.useMemo(()=>e?._source?.case_narrative?.events?.[E]?.felonies??[],[E,e]),y=l.useMemo(()=>{const S=Number(c);return!Number.isFinite(S)||S<0?0:Math.min(Math.max(0,S),Math.max(0,x.length-1))},[c,x.length]),I=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/:eventId/*");_s({containerRef:g,activeElementRef:p,isReady:!!e,isActive:!!I});const{handleSourceClick:v}=Ii({initialSearchTerms:que});return a.jsx(Yn,{leftColumn:a.jsx("div",{children:A.map((S,b)=>{const w=I?E===b:b===0;return a.jsx(Kn,{ref:w?p:null,title:S.title,text:S.text??void 0,description:S.date??void 0,instance:S.instance??void 0,isTextBlockLimited:!0,to:S.to,state:S.state,isActive:w},S.id)})}),leftColumnStickyTitle:h.client.case.secondInstance.fabula.menu.titles.SECTION,rightColumn:a.jsx(Gue,{caseData:e,eventIndex:E,felonyIndex:y}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:A[E]?.title}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:v,children:h.client.cases.links.SOURCE})})]}),rightStickyTitleRef:t,headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:g})},Kue=({caseData:e,circumstanceIndex:t,relatedIndex:n})=>{const s=l.useMemo(()=>{const r=t??0,i=n??0,o=e?._source?.circumstances?.[r],c=o?.related_circumstances?.[i],u=`caseData._source.circumstances[${r}]`;if(!c)return[];const d=(()=>{const y=new Map;return(e?._source?.case_narrative?.events??[]).forEach(v=>{(v?.felonies??[]).forEach(b=>{const w=b?.felony_id??void 0;if(!w)return;const _=b?.objects?.primary_object?.related_law?.law,N=_?.part,R=_?.article,D=_?.clause;if(!R)return;const k=et({clause:D,part:N,number:R});k&&y.set(String(w),k)})}),y})(),p=Array.isArray(c?.felony_ids)?c.felony_ids.map(y=>y?d.get(String(y))??"":"").filter(y=>y.trim().length>0).join(", "):"",g=[{text:{type:"plainLink",label:h.client.case.secondInstance.circumstances.circumstance.fields.ACCUSED_NAME,value:Wi({ids:o?.related_accused_id??null,path:"general_information.accused",caseData:e}),sourcePath:`${u}.related_accused_id`,caseData:e,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.FELONY_IDS,value:p||null,sourcePath:`${u}.related_circumstances[${i}].felony_ids`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.CIRCUMSTANCE,value:c?.description,sourcePath:`${u}.related_circumstances[${i}].description`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.TYPE,value:c?.type,sourcePath:`${u}.related_circumstances[${i}].type`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}},...c?.type===h.client.case.secondInstance.circumstances.circumstance.values.MITIGATING?[{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.CATEGORY,value:c?.mitigation_category,sourcePath:`${u}.related_circumstances[${i}].mitigation_category`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}]:[],...c?.type===h.client.case.secondInstance.circumstances.circumstance.values.AGGRAVATING?[{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.CATEGORY,value:c?.aggravation_category,sourcePath:`${u}.related_circumstances[${i}].aggravation_category`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}]:[],{text:{type:"string",label:h.client.case.secondInstance.circumstances.circumstance.fields.CONSIDERATION_RESULT,value:c?.consideration_type,sourcePath:`${u}.related_circumstances[${i}].consideration_type`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}
866],A=(c?.quotes??[]).filter(Boolean),E=[{rows:g}],x=A.map((y,I)=>({rows:[{text:{type:"string",label:`${h.client.case.secondInstance.circumstances.circumstance.fields.QUOTE}${A.length>1?` ${I+1}`:""}`,value:y,sourcePath:`${u}.related_circumstances[${i}].quotes[${I}]`,placeholder:h.client.case.secondInstance.circumstances.circumstance.placeholders.NOT_SPECIFIED}}]}));return E.push({title:h.client.case.secondInstance.circumstances.circumstance.titles.QUOTES,isSecondaryTitle:!0,textWithTooltip:x.length?void 0:{text:h.client.case.secondInstance.circumstances.circumstance.placeholders.NO_DATA},rowsGroups:x}),E},[e,t,n]);return a.jsx("div",{children:s.map((r,i)=>a.jsx(Nt,{title:r.title??"",isSecondaryTitle:r.isSecondaryTitle,rows:r.rows,rowsGroups:r.rowsGroups,linkFieldConfigs:Qi},i))})},$ue=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=`/clients/${t}/cases/${n??"second-instance"}/${s}/${r??"second-instance"}`,o=Fe(),c=l.useRef(null),u=l.useRef(null),d=l.useMemo(()=>{const _=e?._source?.circumstances??[],N=e?._source?.general_information?.accused??[];return(_??[]).map((R,D)=>{const k=(()=>{const P=R?.related_accused_id??null;return P?N.find(F=>F?.id===P)?.name??"":""})(),L={id:`circumstance-${D}`,title:k},O=(R?.related_circumstances??[]).map((P,B)=>{const F=P?.circumstance_id??"",z=typeof F=="string"?F:"",Q=D===0&&B===0?`${i}/circumstances`:`${i}/circumstances/${z}`;return{id:`circumstance-${z||`${D}-${B}`}`,title:`${h.client.case.secondInstance.circumstances.menu.items.CIRCUMSTANCE} ${B+1}`,text:P.description??"",description:P?.type??"",instance:P?.consideration_type??"",to:Q,state:o.state,relatedCircumstanceId:z,circumstanceIndex:D,relatedCircumstanceIndex:B}});return{header:L,items:O}})},[e,i,o.state]),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances"),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances/:relatedCircumstanceId"),{circumstanceIndex:A,relatedIndex:E}=l.useMemo(()=>{if(p)return{circumstanceIndex:0,relatedIndex:0};const _=g?.params?.relatedCircumstanceId;if(typeof _=="string"&&_)for(let N=0;N<(d?.length??0);N++){const D=(d?.[N]?.items??[]).findIndex(k=>k.relatedCircumstanceId===_);if(D>=0)return{circumstanceIndex:N,relatedIndex:D}}return{circumstanceIndex:0,relatedIndex:0}},[p,g,d]),x=(_,N,R,D,k,L,O)=>_===R&&N===D||D===0&&R===0&&(L!==null||O!==null&&k===O?.params?.relatedCircumstanceId),y=l.useMemo(()=>(e?._source?.circumstances??[])[A]?.related_circumstances?.[E],[e,A,E]),I=l.useMemo(()=>{const _=y?.description??"",N=typeof _=="string"?_.trim():"";return N?ju({text:N,maxLength:130}):""},[y]),v=l.useMemo(()=>X1(y?.raw_quotes),[y]),S=l.useMemo(()=>{const _=sr(y?.raw_quotes);if(_.length)return _;const N=sr(y?.quotes);if(N.length)return N},[y]),{handleSourceClick:b}=Ii({initialSearchTerms:S??[]}),w=d.every(_=>_.items.length===0);return _s({containerRef:u,activeElementRef:c,isReady:!!e,isActive:!!g}),w?a.jsx(SP,{onSourceClick:b}):a.jsx(Yn,{leftColumn:a.jsx("div",{children:d.map((_,N)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:_.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),_.items.map((R,D)=>{const k=x(A,E,N,D,R.relatedCircumstanceId,p,g);return a.jsx(Kn,{ref:k?c:null,title:R.title,isTextBlockLimited:!0,isTextTruncated:!0,to:R.to,state:o.state,text:R.text,description:R.description,instance:R.instance,isActive:k},R.id)})]},_.header.id))}),leftColumnStickyTitle:h.client.case.secondInstance.circumstances.menu.titles.SECTION,rightColumn:a.jsx(Kue,{caseData:e,circumstanceIndex:A,relatedIndex:E}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:I}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",type:v?"warning":"default",onClick:b,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:u})},Yue=({caseData:e,index:t})=>{const n=l.useMemo(()=>{const s=t??0,r=e?._source?.evidence?.[s],i=`caseData._source.evidence[${s}]`;if(!r)return[];const o=[{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.TITLE,value:r?.title,sourcePath:`${i}.title`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.DESCRIPTION,value:r?.description,sourcePath:`${i}.description`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.TYPE,value:r?.type,sourcePath:`${i}.type`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}}
866],c=(r?.quotes??[]).filter(Boolean),u=[{title:h.client.case.secondInstance.evidence.item.titles.EVIDENCE,titleSuffix:r?.is_new_evidence?h.client.case.secondInstance.evidence.item.titles.NEW:void 0,rows:o}],d=c.map((A,E)=>({rows:[{text:{type:"string",label:`${h.client.case.secondInstance.evidence.item.fields.QUOTE}${c.length>1?` ${E+1}`:""}`,value:A,sourcePath:`${i}.quotes[${E}]`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}));u.push({title:h.client.case.secondInstance.evidence.item.titles.QUOTES,isSecondaryTitle:!0,textWithTooltip:d.length===0?{text:h.client.case.secondInstance.evidence.item.placeholders.NO_DATA}:void 0,rowsGroups:d});const p=r?.usage_by_sides??[];u.push({title:h.client.case.secondInstance.evidence.item.titles.USAGE_BY_SIDES,...Array.isArray(p)&&p.length?{rowsGroups:p.map((A,E)=>({rows:[{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.USAGE_SIDE,value:A?.side,sourcePath:`${i}.usage_by_sides[${E}].side`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.USAGE_PURPOSE,value:A?.purpose,sourcePath:`${i}.usage_by_sides[${E}].purpose`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}))}:{textWithTooltip:{text:h.client.case.secondInstance.evidence.item.placeholders.NO_DATA}}});const g=r?.court_evaluation??null;return u.push({title:h.client.case.secondInstance.evidence.item.titles.COURT_EVALUATION,rows:[{text:{type:"string",label:h.client.case.secondInstance.evidence.item.fields.COURT_EVALUATION_RESULT,value:g?.result??null,sourcePath:`${i}.court_evaluation.result`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.evidence.item.fields.COURT_EVALUATION_ADMISSIBILITY,value:g?.admissibility_status??null,sourcePath:`${i}.court_evaluation.admissibility_status`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.evidence.item.fields.COURT_EVALUATION_RELEVANCE,value:g?.relevance_status??null,sourcePath:`${i}.court_evaluation.relevance_status`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}},{text:{type:"boolean",label:h.client.case.secondInstance.evidence.item.fields.COURT_EVALUATION_RELIABILITY,value:g?.reliability_status??null,sourcePath:`${i}.court_evaluation.reliability_status`,placeholder:h.client.case.secondInstance.evidence.item.placeholders.NOT_SPECIFIED}}]}),u},[e,t]);return a.jsx("div",{children:n.map(s=>a.jsx(Nt,{title:s.title??"",titleSuffix:s.titleSuffix,rows:s.rows,rowsGroups:s.rowsGroups,textWithTooltip:s.textWithTooltip,linkFieldConfigs:Qi},s.title))})},Xue=({caseData:e})=>{const{id:t,listInstance:n,caseId:s,caseInstance:r}=st(),i=`/clients/${t}/cases/${n??"second-instance"}/${s}/${r??"second-instance"}`,o=Fe(),c=l.useRef(null),u=l.useRef(null),d=l.useMemo(()=>{const N=e?._source?.evidence??[],R=e?._source?.general_information?.accused??[],D=new Map;R.forEach(P=>{const B=P?.id;if(typeof B=="string"&&B){const F=P?.name??"",z=R.findIndex(Q=>Q?.id===B);D.has(B)||D.set(B,{accusedId:B,accusedName:F,accusedIndex:z,items:[]})}});const k=new Map;let L=1;N.forEach((P,B)=>{const F=P?.evidence_id,Q=`evidence-${(typeof F=="string"&&F?F:"")||B}`;k.has(Q)||(k.set(Q,L),L++)}),N.forEach((P,B)=>{const F=P?.title,z=P?.accused_ids??[],Q=P?.evidence_id,M=typeof Q=="string"&&Q?Q:"",K=`evidence-${M||B}`,W=k.get(K)??B+1,H=typeof F=="string"?F.trim():"";Array.isArray(z)&&z.length>0&&z.forEach(j=>{typeof j=="string"&&D.has(j)&&D.get(j).items.push({id:`evidence-${M||B}-${j}`,entityId:M,accusedId:j,text:H,title:`${h.client.case.secondInstance.evidence.menu.items.EVIDENCE} ${W}`,description:P?.type??"",instance:P?.court_evaluation?.result??"",to:`${i}/evidence/evidence/${j}/${M}`,state:o.state,type:"evidence",index:B,evidenceIndex:B})})});const O=Array.from(D.values()).sort((P,B)=>P.accusedIndex-B.accusedIndex).filter(P=>P.items.length>0);if(O.length>0&&O[0].items.length>0){const P=O[0].items[0];P.to=`${i}/evidence`}return O.map(P=>({header:{id:`accused-${P.accusedId}`,title:P.accusedName},items:P.items}))},[e,i,o.state]),p=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/evidence/:accusedId/:itemId"),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence"),{accusedIndex:A,itemIndex:E}=l.useMemo(()=>
866{if(g)return{accusedIndex:0,itemIndex:0};const N=p?.params?.itemId,R=p?.params?.accusedId;if(typeof N=="string"&&N&&typeof R=="string"&&R)for(let D=0;D<(d?.length??0);D++){const k=d?.[D];if(k?.header.id!==`accused-${R}`)continue;const O=(k.items??[]).findIndex(P=>P.type==="evidence"&&P.entityId===N&&P.accusedId===R);if(O>=0)return{accusedIndex:D,itemIndex:O}}return{accusedIndex:0,itemIndex:0}},[p,g,d]),x=(N,R,D,k,L,O,P)=>N===D&&R===k||k===0&&D===0&&(O!==null||P!==null&&L.type==="evidence"&&L.entityId===P?.params?.itemId&&L.accusedId===P?.params?.accusedId),y=l.useMemo(()=>{const N=d?.[A]?.items?.[E]?.text??"",R=typeof N=="string"?N.trim():"";return R?ju({text:R,maxLength:130}):""},[d,A,E]),I=d?.[A]?.items?.[E],v=l.useMemo(()=>{const N=d?.[A]?.items?.[E];if(N)return e?._source?.evidence?.[N.evidenceIndex??N.index]},[e,d,A,E]),S=l.useMemo(()=>X1(v?.raw_quotes),[v]),b=l.useMemo(()=>{if(!v)return;const N=sr(v.raw_quotes);return N.length>0?N:sr(v.quotes)},[v]),{handleSourceClick:w}=Ii({initialSearchTerms:b??[]}),_=l.useMemo(()=>d.every(N=>N.items.length===0),[d]);return _s({containerRef:u,activeElementRef:c,isReady:!!e,isActive:!!p}),_?a.jsx(vP,{onSourceClick:w}):a.jsx(Yn,{leftColumn:a.jsx("div",{children:d.map((N,R)=>a.jsxs("div",{className:"pb-4 last:pb-0",children:[a.jsx(Kn,{title:N.header.title,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),N.items.map((D,k)=>{const L=x(A,E,R,k,D,g,p);return a.jsx(Kn,{ref:L?c:null,title:D.title,isTextBlockLimited:!0,isTextTruncated:!0,description:D.description,instance:D.instance,to:D.to,text:D.text,state:o.state,isActive:L},D.id)})]},N.header.id))}),leftColumnStickyTitle:h.client.case.secondInstance.evidence.menu.titles.SECTION,rightColumn:I?a.jsx(Yue,{caseData:e,index:I.evidenceIndex??I.index}):null,rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:y}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",type:S?"warning":"default",onClick:w,children:h.client.cases.links.SOURCE})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:u})},KI=({value:e,onChange:t,children:n,disabled:s=!1})=>{const r=l.useCallback(()=>{s||t(i=>!i)},[s,t]);return a.jsxs("div",{className:Y("flex items-start justify-start gap-3 py-0.5",!s&&"cursor-pointer",s&&"cursor-not-allowed opacity-30"),onClick:r,children:[a.jsx("div",{className:Y("h-5 w-9 rounded-full p-0.5 transition-colors duration-50 ease-out",!!e&&"bg-zinc-600",!e&&"bg-zinc-300"),children:a.jsx("div",{className:Y("h-4 w-4 bg-white rounded-full transition-transform duration-50 ease-in-out",!!e&&"translate-x-4",!e&&"translate-x-0")})}),n]})},Uw=(e,t)=>[{text:{type:"string",sourcePath:`${t}.type`,label:h.client.case.secondInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:e.type,valueToCompare:e.type_new??void 0}},{text:{type:"string",sourcePath:`${t}.duration`,label:h.client.case.secondInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_DURATION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:e.duration,valueToCompare:e.duration_new??void 0}},{text:{type:"string",sourcePath:`${t}.conditions`,label:h.client.case.secondInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_CONDITIONS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:e.conditions,valueToCompare:e.conditions_new??void 0}}],Jue=({caseData:e,accusedIndex:t,isIdenticalHidden:n=!1})=>{const s=l.useCallback(({value:d})=>d==null?!0:typeof d=="string"&&d.trim()==="",[]),r=l.useCallback(d=>{const p=d.text;if(!p)return!0;if(p.label===h.client.case.secondInstance.conclusions.item.fields.APPEAL_COURT_DECISION)return!1;const g=p.value,A=p.valueToCompare;if(A===void 0||s({value:g})&&s({value:A}))return!0;const E=p.type==="boolean"?g:String(g??"").trim(),x=p.type==="boolean"?A:String(A??"").trim();return E===x},[s]),i=l.useMemo(()=>{const d=e?._source?.conclusions??[];if(!Array.isArray(d)||d.length===0)return;const p=[];
866if(d.forEach(E=>{const x=E?.related_accused_id??"";x&&(p.includes(x)||p.push(x))}),p.length===0)return d[0];const g=Math.max(0,Math.min(p.length-1,t??0)),A=p[g];return d.find(E=>E?.related_accused_id===A)},[e,t]),o=l.useMemo(()=>e?._source?.general_information?.is_modified==="Изменено",[e]),c=l.useMemo(()=>{const d=i?.verdicts??[],p=[],g=[],A=e?._source?.conclusions??[],x=`caseData._source.conclusions[${Math.max(0,i?A.findIndex(X=>X===i):0)}]`,y=e?._source?.appeal_result??[],I=Math.max(0,y.findIndex(X=>X?.related_accused_id===i?.related_accused_id)),v=i?.final_sentencing,S=(e?._source?.appeal_result??[]).find(X=>X?.related_accused_id===i?.related_accused_id)?.appeal_description??null;p.push({rows:[{text:{type:"string",sourcePath:`caseData._source.appeal_result[${I}].appeal_description`,label:h.client.case.secondInstance.conclusions.item.fields.APPEAL_COURT_DECISION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:S}}]});const b=v?.result??null;g.push({text:{type:"string",sourcePath:`${x}.final_sentencing.result`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_SENTENCING_RESULT,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:b,valueToCompare:v?.result_new??void 0}}),b===h.client.case.secondInstance.conclusions.item.statusValues.OTHER&&g.push({text:{type:"string",sourcePath:`${x}.final_sentencing.result_description`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_SENTENCING_RESULT_DESCRIPTION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:v?.result_description,valueToCompare:v?.result_description_new??void 0}}),b===h.client.case.secondInstance.conclusions.item.statusValues.ACQUITTED&&g.push({text:{type:"string",sourcePath:`${x}.final_sentencing.acquittal_grounds`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_SENTENCING_ACQUITTAL_GROUNDS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(v?.acquittal_grounds)?v?.acquittal_grounds?.filter(X=>!!X).join(", ")||null:v?.acquittal_grounds,valueToCompare:Array.isArray(v?.acquittal_grounds_new)?v?.acquittal_grounds_new?.filter(X=>!!X).join(", ")||void 0:v?.acquittal_grounds_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.FINAL_SENTENCING,rows:g});const w=[],_=i?.final_sentencing?.punishment;w.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.description`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_PUNISHMENT_DESCRIPTION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.description,valueToCompare:_?.description_new??void 0}}),w.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.type`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_PUNISHMENT_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.type,valueToCompare:_?.type_new??void 0}}),w.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.penitentiary_type`,label:h.client.case.secondInstance.conclusions.item.fields.FINAL_PUNISHMENT_PENITENTIARY_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.penitentiary_type,valueToCompare:_?.penitentiary_type_new??void 0}}),w.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.punishment.is_article_70_applied`,label:h.client.case.secondInstance.conclusions.item.fields.IS_ARTICLE_70_APPLIED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:_?.is_article_70_applied,valueToCompare:_?.is_article_70_applied_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.FINAL_PUNISHMENT,rows:w});const N=Math.max(0,(i?.verdicts??[]).findIndex(X=>!!X?.reclassified_aggregation?.trim())),R=Math.max(0,(i?.verdicts??[]).findIndex(X=>!!X?.reclassified_from?.reason?.trim())),D=[],k=(()=>{const oe=(i?.verdicts??[]).flatMap(ie=>{const ee=ie.reclassified_aggregation?.trim();return ee?[ee]:[]});return oe.length?oe.join("; "):null})(),L=(()=>{const oe=(i?.verdicts??[]).flatMap(ie=>{const ee=ie.reclassified_from;if(!ee)return[];const te=ee.reason?.trim();return te?[te]:[]});return oe.length?oe.join("; "):null})();D.push({text:{type:"string",sourcePath:`${x}.verdicts[${N}].reclassified_aggregation`,label:h.client.case.secondInstance.conclusions.item.titles.RECLASSIFICATION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:k}}),D.push({text:{type:"string",sourcePath:`${x}.verdicts[${R}].reclassified_from.reason`,label:h.client.case.secondInstance.conclusions.item.fields.RECLASSIFICATION_REASON,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:L}}),D.length>0&&p.push({title:h.client.case.secondInstance.conclusions.item.titles.RECLASSIFICATION,isSecondaryTitle:!0,rowsGroups:[{rows:D}]});const O=[],P=i?.final_sentencing?.punishment?.suspended_sentence;O.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.punishment.suspended_sentence.is_applied`,label:h.client.case.secondInstance.conclusions.item.fields.SUSPENDED_SENTENCE_IS_APPLIED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:P?.is_applied,valueToCompare:P?.is_applied_new??void 0}}),O.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.suspended_sentence.reason`,label:h.client.case.secondInstance.conclusions.item.fields.SUSPENDED_SENTENCE_REASON,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(P?.reason)?P?.reason?.filter(X=>!!X).join(", ")||null:P?.reason,valueToCompare:Array.isArray(P?.reason_new)?P?.reason_new?.filter(X=>!!X).join(", ")??void 0:P?.reason_new??void 0}}),O.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.suspended_sentence.duration`,label:h.client.case.secondInstance.conclusions.item.fields.SUSPENDED_SENTENCE_DURATION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:P?.duration,valueToCompare:P?.duration_new??void 0}}),O.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.suspended_sentence.conditions`,label:h.client.case.secondInstance.conclusions.item.fields.SUSPENDED_SENTENCE_CONDITIONS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:P?.conditions,valueToCompare:P?.conditions_new??void 0}});const B=Array.isArray(P?.related_circumstance_ids)?P?.related_circumstance_ids.filter(
866Boolean):[],F=Array.isArray(P?.related_circumstance_ids_new)?P.related_circumstance_ids_new.filter(Boolean):[];B.forEach((X,oe)=>{const ie=e?._source?.circumstances??[];let ee=-1,te=-1;if(ie.forEach((fe,ue)=>{const ce=(fe?.related_circumstances??[]).findIndex(xe=>xe?.circumstance_id===X);ce>=0&&ee===-1&&(ee=ue,te=ce)}),ee<0||te<0)return;const le=`circumstances[${ee}].related_circumstances[${te}]`,he=F.includes(X);O.push({text:{type:"link",sourcePath:`${x}.final_sentencing.punishment.suspended_sentence.related_circumstance_ids[${oe}]`,label:"",placeholder:"",value:le,valueToCompare:he?le:void 0,caseData:e}})}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.SUSPENDED_SENTENCE,rows:O});const z=[],Q=i?.final_sentencing?.punishment?.cancel_details;z.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.punishment.cancel_details.is_canceled`,label:h.client.case.secondInstance.conclusions.item.fields.CANCEL_DETAILS_IS_CANCELED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Q?.is_canceled,valueToCompare:Q?.is_canceled_new??void 0}}),Q?.is_canceled===!0&&z.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.cancel_details.reason`,label:h.client.case.secondInstance.conclusions.item.fields.CANCEL_DETAILS_REASON,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Q?.reason,valueToCompare:Q?.reason_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.CANCEL_DETAILS,rows:z});const M=[],K=i?.final_sentencing?.punishment?.postponement_info;M.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.punishment.postponement_info.is_applied`,label:h.client.case.secondInstance.conclusions.item.fields.POSTPONEMENT_IS_APPLIED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:K?.is_applied,valueToCompare:K?.is_applied_new??void 0}}),M.push({text:{type:"string",sourcePath:`${x}.final_sentencing.punishment.postponement_info.reason`,label:h.client.case.secondInstance.conclusions.item.fields.POSTPONEMENT_REASON,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(K?.reason)?K?.reason?.filter(X=>!!X).join(", ")||null:K?.reason,valueToCompare:Array.isArray(K?.reason_new)?K?.reason_new?.filter(X=>!!X).join(", ")??void 0:K?.reason_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.POSTPONEMENT_INFO,rows:M}),(Array.isArray(i?.final_sentencing?.additional_punishment)?i?.final_sentencing?.additional_punishment:[]).forEac
866h((X,oe)=>{p.push({title:h.client.case.secondInstance.conclusions.item.titles.ADDITIONAL_PUNISHMENT,rows:Uw(X,`${x}.final_sentencing.additional_punishment[${oe}]`)})});const H=[];H.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.has_court_ordered_treatment`,label:h.client.case.secondInstance.conclusions.item.fields.HAS_COURT_ORDERED_TREATMENT,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:v?.has_court_ordered_treatment,valueToCompare:v?.has_court_ordered_treatment_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.MEDICAL_MEASURE,rows:H});const j=v?.preventive_measure_decision,q=[];q.push({text:{type:"string",sourcePath:`${x}.final_sentencing.preventive_measure_decision.decision`,label:h.client.case.secondInstance.conclusions.item.fields.PREVENTIVE_MEASURE_DECISION_DECISION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:j?.decision,valueToCompare:j?.decision_new??void 0}}),q.push({text:{type:"string",sourcePath:`${x}.final_sentencing.preventive_measure_decision.type`,label:h.client.case.secondInstance.conclusions.item.fields.PREVENTIVE_MEASURE_DECISION_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:j?.type,valueToCompare:j?.type_new??void 0}}),q.push({text:{type:"string",sourcePath:`${x}.final_sentencing.preventive_measure_decision.duration`,label:h.client.case.secondInstance.conclusions.item.fields.PREVENTIVE_MEASURE_DECISION_DURATION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:j?.duration,valueToCompare:j?.duration_new??void 0}}),q.push({text:{type:"string",sourcePath:`${x}.final_sentencing.preventive_measure_decision.conditions`,label:h.client.case.secondInstance.conclusions.item.fields.PREVENTIVE_MEASURE_DECISION_CONDITIONS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:j?.conditions,valueToCompare:j?.conditions_new??void 0}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.PREVENTIVE_MEASURE_DECISION,rows:q}),(Array.isArray(v?.other_measures)?v.other_measures:[]).forEach((X,oe)=>{const ie=[];ie.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.other_measures[${oe}].was_added`,label:h.client.case.secondInstance.conclusions.item.fields.OTHER_MEASURES_WAS_ADDED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.was_added,valueToCompare:X?.was_added_new??void 0}}),ie.push({text:{type:"boolean",sourcePath:`${x}.final_sentencing.other_measures[${oe}].was_deleted`,label:h.client.case.secondInstance.conclusions.item.fields.OTHER_MEASURES_WAS_DELETED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.was_deleted,valueToCompare:X?.was_deleted_new??void 0}}),ie.push({text:{type:"string",sourcePath:`${x}.final_sentencing.other_measures[${oe}].type`,label:h.client.case.secondInstance.conclusions.item.fields.OTHER_MEASURES_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.type,valueToCompare:X?.type_new??void 0}}),ie.push({text:{type:"string",sourcePath:`${x}.final_sentencing.other_measures[${oe}].description`,label:h.client.case.secondInstance.conclusions.item.fields.OTHER_MEASURES_DESCRIPTION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.description,valueToCompare:X?.description_new??void 0}});const ee=(()=>{const le=Array.isArray(X?.laws)?X.laws:[];if(le.length===0)return null;const he=le.map(fe=>fe?.article?et({clause:fe.clause,part:fe.part,number:fe.article,codeType:fe.code_type}):"").filter(Boolean);return he.length===0?null:he.join(", ")})(),te=(()=>{const le=Array.isArray(X?.laws_new)?X.laws_new:[];if(le.length===0)return;const he=le.map(fe=>fe?.article?et({clause:fe.clause,part:fe.part,number:fe.article,codeType:fe.code_type}):"").filter(Boolean);if(he.length!==0)return he.join(", ")})();ie.push({text:{type:"string",sourcePath:`${x}.final_sentencing.other_measures[${oe}].laws`,label:h.client.case.secondInstance.conclusions.item.fields.OTHER_MEASURES_LAWS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:ee,valueToCompare:te}}),p.push({title:h.client.case.secondInstance.conclusions.item.titles.OTHER_MEASURES,rows:ie})});const $=e?._source?.case_narrative?.events??[],J=d.flatMap((X,oe)=>{const ie=[],ee=X?.related_felony_id,te=typeof ee=="string"?ee:void 0,le=(()=>
866{if(!te)return"";let ft=-1,_n=-1;if($.forEach((ei,Xn)=>{const Gn=(ei?.felonies??[]).findIndex(Dr=>(Dr?.felony_id??void 0)===te);Gn>=0&&ft===-1&&(ft=Xn,_n=Gn)}),ft<0||_n<0)return"";const wr=($?.[ft]?.felonies?.[_n]??void 0)?.objects?.primary_object?.related_law?.law,eo=wr?.part,Rr=wr?.article,Zr=wr?.clause;return Rr?et({clause:Zr,part:eo,number:Rr}):""})(),fe=X?.reclassified_from?.qualification,ue=fe?.crime_stage,ye=fe?.participant_role,ce=ue?.is_article_30_applied,xe=ye?.is_article_33_applied,re=[],pe=(()=>{const ft=ue?.article_30_part;return ft?String(ft).trim():""})();ce===!0&&pe&&re.push(et({part:pe,number:"30"}));const _e=(()=>{const ft=ye?.article_33_part;return ft?String(ft).trim():""})();xe===!0&&_e&&re.push(et({part:_e,number:"33"})),le&&re.unshift(le);const Le=h.client.case.secondInstance.conclusions.item.titles.VERDICT+(re.length?` ${re.join(", ")}`:""),Ee=X?.result??null;ie.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].result`,label:h.client.case.secondInstance.conclusions.item.fields.VERDICT_STATUS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Ee,valueToCompare:X?.result_new??void 0}}),ie.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].was_added`,label:h.client.case.secondInstance.conclusions.item.fields.VERDICT_WAS_ADDED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.was_added,valueToCompare:X?.was_added_new??void 0}}),ie.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].was_deleted`,label:h.client.case.secondInstance.conclusions.item.fields.VERDICT_WAS_DELETED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.was_deleted,valueToCompare:X?.was_deleted_new??void 0}}),ie.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].has_civil_claims`,label:h.client.case.secondInstance.conclusions.item.fields.HAS_CIVIL_CLAIMS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.has_civil_claims,valueToCompare:X?.has_civil_claims_new??void 0}}),Ee===h.client.case.secondInstance.conclusions.item.statusValues.OTHER&&ie.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].verdict_description`,label:h.client.case.secondInstance.conclusions.item.fields.VERDICT_DESCRIPTION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.verdict_description??null,valueToCompare:X?.verdict_description_new??void 0}}),Ee===h.client.case.secondInstance.conclusions.item.statusValues.ACQUITTED&&ie.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].acquittal_ground`,label:h.client.case.secondInstance.conclusions.item.fields.ACQUITTAL_GROUND,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:Array.isArray(X?.acquittal_ground)?X.acquittal_ground.filter(ft=>!!ft).join(", ")||null:X?.acquittal_ground??null,valueToCompare:Array.isArray(X?.acquittal_ground_new)?X.acquittal_ground_new.filter(ft=>!!ft).join(", ")??void 0:X?.acquittal_ground_new??void 0}});const se=[];se.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].punishment.description`,label:h.client.case.secondInstance.conclusions.item.fields.PUNISHMENT_DESCRIPTION,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.punishment?.description??null,valueToCompare:X?.punishment_new?.description??void 0}}),se.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].punishment.type`,label:h.client.case.secondInstance.conclusions.item.fields.PUNISHMENT_TYPE,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.punishment?.type??null,valueToCompare:X?.punishment_new?.type??void 0}}),se.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].punishment.is_article_64_applied`,label:h.client.case.secondInstance.conclusions.item.fields.IS_ARTICLE_64_APPLIED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.punishment?.is_article_64_applied,valueToCompare:X?.punishment_new?.is_article_64_applied??void 0}});const me=X?.punishment?.cancel_details,de=X?.punishment_new?.cancel_details;se.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].punishment.cancel_details.is_canceled`,label:h.client.case.secondInstance.conclusions.item.fields.CANCEL_DETAILS_IS_CA
866NCELED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:me?.is_canceled,valueToCompare:de?.is_canceled??void 0}}),me?.is_canceled===!0&&se.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].punishment.cancel_details.reason`,label:h.client.case.secondInstance.conclusions.item.fields.CANCEL_DETAILS_REASON,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:me?.reason,valueToCompare:de?.reason??void 0}});const ge={title:h.client.case.secondInstance.conclusions.item.titles.PUNISHMENT,isSecondaryTitle:!0,rowsGroups:[{rows:se}]},Ue=(Array.isArray(X?.additional_punishment)?X?.additional_punishment:[]).map((ft,_n)=>({title:h.client.case.secondInstance.conclusions.item.titles.ADDITIONAL_PUNISHMENT,isSecondaryTitle:!0,rowsGroups:[{rows:[{text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].additional_punishment[${_n}].was_added`,label:h.client.case.secondInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_WAS_ADDED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:ft?.was_added,valueToCompare:ft?.was_added_new??void 0}},{text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].additional_punishment[${_n}].was_deleted`,label:h.client.case.secondInstance.conclusions.item.fields.ADDITIONAL_PUNISHMENT_WAS_DELETED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:ft?.was_deleted,valueToCompare:ft?.was_deleted_new??void 0}},...Uw({type:ft?.type??null,type_new:ft?.type_new,duration:ft?.duration??null,duration_new:ft?.duration_new,conditions:ft?.conditions??null,conditions_new:ft?.conditions_new},`${x}.verdicts[${oe}].additional_punishment[${_n}]`)]}]})),Be={title:Le,rows:ie},nt=[];nt.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].plea.status`,label:h.client.case.secondInstance.conclusions.item.fields.PLEA_STATUS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.plea?.status??null,valueToCompare:X?.plea_new?.status??void 0}}),nt.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].plea.details`,label:h.client.case.secondInstance.conclusions.item.fields.PLEA_DETAILS,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:X?.plea?.details??null,valueToCompare:X?.plea_new?.details??void 0}});const At={title:h.client.case.secondInstance.conclusions.item.titles.PLEA,isSecondaryTitle:!0,rowsGroups:[{rows:nt}]},ht=[],dt=X?.article_15_consideration;ht.push({text:{type:"boolean",sourcePath:`${x}.verdicts[${oe}].article_15_consideration.is_applied`,label:h.client.case.secondInstance.conclusions.item.fields.ARTICLE_15_IS_APPLIED,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:dt?.is_applied,valueToCompare:dt?.is_applied_new??void 0}}),dt&&(ht.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].article_15_consideration.old_category`,label:h.client.case.secondInstance.conclusions.item.fields.ARTICLE_15_OLD_CATEGORY,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:dt.old_category??null,valueToCompare:dt.old_category_new??void 0}}),ht.push({text:{type:"string",sourcePath:`${x}.verdicts[${oe}].article_15_consideration.new_category`,label:h.client.case.secondInstance.conclusions.item.fields.ARTICLE_15_NEW_CATEGORY,placeholder:h.client.case.secondInstance.conclusions.item.placeholders.NOT_SPECIFIED,value:dt.new_category??null,valueToCompare:dt.new_category_new??void 0}}));const Gt={title:h.client.case.secondInstance.conclusions.item.titles.ARTICLE_15_CONSIDERATION,isSecondaryTitle:!0,rowsGroups:[{rows:ht}]};return[Be,ge,...Ue,At,Gt]});if(p.push(...J),!n)return p;const ne=[];for(const X of p){const oe=(X.rows??[]).filter(te=>!r(te)),ie=X.rowsGroups?.map(te=>({...te,rows:(te.rows??[]).filter(le=>!r(le))})).filter(te=>(te.rows?.length??0)>0)??[];(oe.length>0||ie.some(te=>(te.rows?.length??0)>0))&&ne.push({...X,rows:oe,rowsGroups:ie})}return ne},[i,e,n,r]);return n&&c.length===0?a.jsxs("div",{className:"flex min-h-10 items-center roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:[!
866o&&h.client.case.secondInstance.conclusions.menu.NO_CHANGES,!!o&&h.client.case.secondInstance.conclusions.menu.APPEAL_CHANGES_NOT_AFFECTING_FIRST_INSTANCE]}):a.jsx("div",{children:c.map((d,p)=>a.jsx(Nt,{title:d.title??"",isSecondaryTitle:d.isSecondaryTitle,rows:d.rows,rowsGroups:d.rowsGroups,linkFieldConfigs:Qi},p))})},Zue=["Постановил","Определил"],ede=({caseData:e})=>{const[t,n]=l.useState(!1),{id:s,listInstance:r,caseId:i,caseInstance:o}=st(),c=Fe(),u=l.useRef(null),d=l.useRef(null),p=l.useMemo(()=>{const y=e?._source?.conclusions??[],I=e?._source?.general_information?.accused??[],v=new Map;I.forEach(w=>{const _=w?.id??void 0;if(!_)return;const N=w?.name,R=typeof N=="string"?N:"";v.set(String(_),R)});const S=[];y.forEach(w=>{const _=w?.related_accused_id??"";_&&(S.includes(_)||S.push(_))});const b=`/clients/${s}/cases/${r??"second-instance"}/${i}/${o??"second-instance"}/conclusions`;return S.map((w,_)=>{const N=v.get(w)??"",R=_===0?b:`${b}/${_}`;return{id:`conclusions-accused-${_}`,title:N,to:R,state:c.state}})},[e,s,r,i,o,c.state]),g=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions"),A=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions/:accusedIndex"),E=l.useMemo(()=>{if(g)return 0;const y=Number(A?.params?.accusedIndex);return!Number.isFinite(y)||y<0?0:Math.min(Math.max(0,y),Math.max(0,p.length-1))},[g,A,p.length]);_s({containerRef:d,activeElementRef:u,isReady:!!e,isActive:!!A});const{handleSourceClick:x}=Ii({initialSearchTerms:Zue});return a.jsx(Yn,{leftColumn:a.jsxs("div",{children:[a.jsx(Kn,{title:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,isTextBlockLimited:!0,isHeader:!0,isActive:!1}),p.map((y,I)=>{const v=E===I;return a.jsx(Kn,{ref:v?u:null,title:y.title,isTextBlockLimited:!0,isTextTruncated:!0,to:y.to,state:y.state,isActive:v},y.id)})]}),leftColumnStickyTitle:h.client.case.secondInstance.conclusions.menu.titles.SECTION,rightColumn:a.jsx(Jue,{caseData:e,accusedIndex:E,isIdenticalHidden:t}),rightColumnStickyTitle:a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between roboto-flex-25-700-1 text-[24px] leading-[24px] uppercase text-zinc-950 relative",children:p?.[E]?.title??h.client.case.secondInstance.conclusions.menu.titles.SECTION}),a.jsx("div",{className:"mt-3",children:a.jsx(ms,{theme:"secondary",onClick:x,children:h.client.cases.links.SOURCE})}),a.jsx("div",{className:"mt-4",children:a.jsx(KI,{value:t,onChange:n,children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",children:h.client.case.secondInstance.conclusions.menu.toggles.ONLY_CHANGES})})})]}),headerMode:"popup",fabulizerMode:"none",isLeftColumnPreventScrollPropagation:!0,leftContainerRef:d})},tde=({containerRef:e,caseSecondInstanceData:t,isLoading:n})=>{const s=l.useRef(null),r=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/information/*"),i=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions/*"),o=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/*"),c=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances/*"),u=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/*"),d=Ct("clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions/*");return bue(),yue({containerRef:e,rightStickyTitleRef:s,isLoading:n}),n?a.jsx(ct,{isWithWrapper:!0}):i?a.jsx(Vue,{caseData:t,rightStickyTitleRef:s}):o?a.jsx(Wue,{caseData:t,rightStickyTitleRef:s}):r?a.jsx(Pw,{caseData:t,rightStickyTitleRef:s}):c?a.jsx($ue,{caseData:t}):u?a.jsx(Xue,{caseData:t}):d?a.jsx(ede,{caseData:t}):a.jsx(Pw,{caseData:t})},nde=({basePath:e,locationState:t})=>[{id:"information",label:h.client.case.secondInstance.information.menu.titles.SECTION,to:`${e}/information`,state:t},{id:"fabula",label:h.client.case.secondInstance.fabula.menu.titles.SECTION,to:`${e}/fabula`,state:t},{id:"circumstances",label:h.client.case.secondInstance.circumstances.menu.titles.SECTION,to:`${e}/circumstances`,state:t},{id:"evidence",label:h.client.case.secondInstance.evidence.menu.titles.SECTION,to:`${e}/evidence`,state:t},{id:"complaints-and-submissions",label:h.client.case.secondInstance.complaintsAndSubmissions.menu.titles.SECTION,to:`${e}/complaints-and-submissions`,state:t},{id:"conclusions",label:h.client.case.secondInstance.conclusions.menu.titles.SECTION,to:`${e}/conclusions`,state:t}],sde=({basePath:e,locationState:t})=>({tabs:l.useMemo(()=>nde({basePath:e,locationState:t}),[e,t])}),rde=()=>{const e=at(),t=Fe(),{id:n,listInstance:s,caseId:r}=st();l.useEffect(()=>{if(!n||!s||!r)return;const i=`/clients/${n}/cases/${s}/${r}`;t.pathname===i&&e(`${i}/${s}/information/general`,{replace:!0,state:t.state})},[r,n,s,t.pathname,t.state,e])},OP=["general","accused","witnesses","victims"],ide={information:"information",fabula:"fabula",circumstances:"circumstances",evidence:"evidence","defense-request":"complaints-and-submissions","accusation-request":"complaints-and-submissions",conclusions:"conclusions"},ode={information:"information",fabula:"fabula",circumstances:"circumstances",evidence:"evidence","complaints-and-submissions":"defense-request",conclusions:"conclusions"};function ade(e){const t=e.match(/\/clients\/[^/]+\/cases\/[^/]+\/[^/]+\/[^/]+\/(.+)$/);if(!t)return null;const n=t[1];if(!n)return null;
866const s=n.split("/").filter(Boolean);if(s.length===0)return null;const r=s[0];return r==="information"&&s.length>1&&OP.includes(s[1])?{section:"information",hardcodedSubsection:s[1]}:{section:r,hardcodedSubsection:null}}function zw({pathname:e,targetInstance:t,basePathWithoutCaseInstance:n,targetCaseId:s}){const r=ade(e);if(!r)return`${n}/${s}/${t}/information/general`;const{section:i,hardcodedSubsection:o}=r,c=t==="second-instance"?ide[i]:ode[i];if(!c)return`${n}/${s}/${t}/information/general`;const u=`${n}/${s}/${t}/${c}`;return c==="information"&&o&&OP.includes(o)?`${u}/${o}`:u}const vn=()=>{const e=l.useRef(null),t=at(),n=Fe(),{id:s,listInstance:r,caseId:i,caseInstance:o}=st(),c=r,u=o??c,d=c==="first-instance",p=u==="first-instance",g=n.state?.isForceCaseDetailedAnimateOnStart===!0,A=n.state?.isSaved,E=n.state?.caseFirstInstanceData,x=n.state?.caseSecondInstanceData,y=E?._id===i,I=x?._id===i,{caseFirstInstanceData:v,caseSecondInstanceData:S,isSuccessFirstInstance:b,isSuccessSecondInstance:w,isErrorFirstInstance:_,isErrorSecondInstance:N,isCaseNotFound:R}=hce({caseFirstInstanceDataFromState:E,caseSecondInstanceDataFromState:x}),D=y?E:v,k=I?x:S,L=D?._source?.appeal_file_id??null,O=k?._source?.fi_file_id??null,P=d?p?!!L:!!i:!0,B=d?!0:p?!!i:!!O,F=l.useMemo(()=>d&&!p&&!P?"first-instance":!d&&p&&!B?"second-instance":u,[d,p,P,B,u]),z=F==="first-instance",Q=l.useMemo(()=>!(E||b||_),[E,b,_]),M=l.useMemo(()=>!(x||w||N),[x,w,N]),K=l.useCallback(()=>{const ie=n.state?.isFromDefenseStrategyDetailedPage,ee=n.state?.isFromDefenseStrategyEvidencePage,te=n.state?.isFromDefenseStrategyCircumstancesPage,le=n.state?.isFromDefenseStrategyEvidenceDetailedPage,he=n.state?.isFromDefenseStrategyCircumstancesDetailedPage,fe=n.state?.isFromDefenseStrategySecondInstancePage,ue=n.state?.pageType,ye=n.state?.isCaseOpenedFromQuotesPage===!0,ce=n.state?.returnToHash||"",xe=n.state?.isCaseOpenedFromOverviewPopup===!0,re=n.state?.returnToPath,pe=n.state?.returnToState;if(xe&&typeof re=="string"&&re.startsWith("/clients/")){t(re,{state:{isPreventScrollToTop:!0,...pe??n.state}});return}if(fe){t(`/clients/${s}/defense-strategy/second-instance`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(ie){t(`/clients/${s}/defense-strategy/first-instance`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(ee){t(`/clients/${s}/defense-strategy/first-instance/evidence${ue==="prosecution"?"/prosecution":""}`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(le){t(`/clients/${s}/defense-strategy/first-instance/evidence${ue==="prosecution"?"/prosecution":""}`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(te){t(`/clients/${s}/defense-strategy/first-instance/circumstances${ue==="aggravating"?"/aggravating":""}`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(he){t(`/clients/${s}/defense-strategy/first-instance/circumstances${ue==="aggravating"?"/aggravating":""}`,{state:{isPreventScrollToTop:!0,...n.state}});return}if(ye){t({pathname:`/clients/${s}/quotes`,hash:ce},{state:{isPreventScrollToTop:!0,...n.state}});return}t(`/clients/${s}/cases/${c}${A?"/saved":""}`,{state:{isPreventScrollToTop:!0}})},[t,s,c,A,n.state]);lE({containerRef:e}),rde(),l.useEffect(()=>{if(!g)return;const ie=n.state;if(!ie)return;const ee={...ie};delete ee.isForceCaseDetailedAnimateOnStart;const te=window.history.state??{};window.history.replaceState({...te,usr:ee},"",window.location.href)},[g,n.state]);const W=l.useMemo(()=>`/clients/${s}/cases/${c}/${i}/${F}`,[s,c,i,F]),H=l.useMemo(()=>N2(D),[D]),{tabs:j}=Cue({basePath:W,locationState:n.state,hasCaseSummaries:H}),{tabs:q}=sde({basePath:W,locationState:n.state}),G=l.useMemo(()=>z?j:q,[j,q,z]),$=l.useMemo(()=>`/clients/${s}/cases/${c}`,[s,c]),J=l.useMemo(()=>{const ie=p?i:O,ee=p?L:i;return[...B&&ie?[{label:h.client.stage.courtFirstInstance.titles.COURT_FIRST_INSTANCE,value:"first-instance",to:zw({pathname:n.pathname,targetInstance:"first-instance",basePathWithoutCaseInstance:$,targetCaseId:ie}),state:n.state}]:[],...P&&ee?[{label:h.client.stage.courtSecondInstance.titles.COURT_SECOND_INSTANCE,value:"second-instance",to:zw({pathname:n.pathname,targetInstance:"second-instance",basePathWithoutCaseInstance:$,targetCaseId:ee}),state:n.state}]:[]]},[i,O,L,p,n.pathname,n.state,$,B,P]),ne=l.useMemo(()=>{const ie=k?._source?.general_information?.is_modified,ee=h.client.defenseStrategy.filters.circle;return ie===ee.VERDICT_RESULT_CHANGED?{value:ee.VERDICT_RESULT_CHANGED,text:ee.VERDICT_CHANGED,accentClassName:"text-orange-600"}:ie===ee.VERDICT_RESULT_CANCELED?{value:ee.VERDICT_RESULT_CANCELED,text:ee.VERDICT_CANCELED,accentClassName:"text-sky-600"}:ie===ee.VERDICT_RESULT_UNCHANGED?{value:ee.VERDICT_RESULT_UNCHANGED,text:ee.VERDICT_UNCHANGED,accentClassName:"text-zinc-600"}:null},[k]),oe=!R&&!(z?Q:M);return a.jsxs(Ws,{onClose:K,contentRef:e,isForceAnimateOnStart:g,children:[!!R&&a.jsx(ia,{type:Gr.PRACTICE_NOT_FOUND,to:`/clients/${s}/cases/first-instance`,isInBottomSheet:!0}),!R&&a.jsxs(a.Fragment,{children:[!!oe&&a.jsxs("div",{className:"flex items-center justify-between pt-3 pb-6 sticky top-0 bg-white z-15 pl-4",children:[a.jsx("div",{className:"hidden bp75:block",children:a.jsx(T2,{tabs:G})}),a.jsx("div",{className:"block bp75:hidden",children:a.jsx(vw,{isClearable:!1,options:G.map(ie=>({label:ie.label,value:ie.id,to:ie.to,state:ie.state}))})}),a.jsxs("div",{className:"flex justify-end items-center gap-1.5",children:[!!ne&&a.jsx("div",{className:Y("flex items-center justify-center px-1.5 roboto-flex-25-700-1 uppercase text-[12px] leading-[10px] h-5 border-2 rounded-full border-current",ne.accentClassName),children:ne.text}),a.jsx(vw,{isClearable:!1,value:F,options:J})]})]}),z&&a.jsx(Eue,{containerRef:e,caseFirstInstanceData:D,isLoading:Q}),!z&&a.jsx(tde,{containerRef:e,caseSecondInstanceData:k,isLoading:M})]})]})},lde=({clientId:e})=>{const t=at(),n=Fe();return{handleClose:l.useCallback(()=>{Ze("CASE_SOURCE_NO_EXACT_MATCH");const r=n.state??{},i=r?.isFromDefenseStrategyDetailedPage,o=r?.isFromDefenseStrategyEvidencePage,c=r?.isFromDefenseStrategyCircumstancesPage,u=r?.isFromDefenseStrategyEvidenceDetailedPage,d=r?.isFromDefenseStrategyCircumstancesDetailedPage,p=r?.isFromDefenseStrategySecondInstancePage,g=r?.pageType,A=r?.returnToPath,E=r?.returnToState;if(A){t(A,{state:{isPreventScrollToTop:!0,...E??r}});return}if(p){t(`/clients/${e}/defense-strategy/second-instance`,{state:{isPreventScrollToTop:!0,...r}});return}if(i){t(`/clients/${e}/defense-strategy/first-instance`,{state:{isPreventScrollToTop:!0,...r}});return}if(o){t(`/clients/${e}/defense-strategy/first-instance/evidence${g==="prosecution"?"/prosecution":""}`,{state:{isPreventScrollToTop:!0,...r}});return}if(u){t(`/clients/${e}/defense-strategy/first-instance/evidence${g==="prosecution"?"/prosecution":""}`,{state:{isPreventScrollToTop:!0,...r}});return}if(c){t(`/clients/${e}/defense-strategy/first-instance/circumstances${g==="aggravating"?"/aggravating":""}`,{state:{isPreventScrollToTop:!0,...r}});return}if(d){t(`/clients/${e}/defense-strategy/first-instance/circumstances${g==="aggravating"?"/aggravating":""}`,{state:{isPreventScrollToTop:!0,...r}});return}const x=n.pathname.split("/"),y=x[4],I=x[5],v=r?.isSaved??!1;if(!y||!I){t("/clients",{state:{isPreventScrollToTop:!0}});return}t(`/clients/${e}/cases/${y}${v?"/saved":""}`,{state:{isPreventScrollToTop:!0}})},[e,n.pathname,n.state,t])}},cde=({clientId:e,caseId:t,effectiveInstance:n})=>{const{mutate:s,isPending:r}=tt({mutationFn:async()=>
866{if(!e||!t)throw new Error("Missing identifiers");return await(n==="first-instance"?Eoe:Coe)({clientId:e,caseId:t})},onSuccess:o=>{const c=o?.urlDocx??o?.urlTxt;if(!c){ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE,key:"SOURCE_FILE_NOT_AVAILABLE"});return}window.open(c,"_blank")},onError:()=>{ve({type:"failed",message:h.client.cases.messages.SOURCE_FILE_NOT_AVAILABLE,key:"SOURCE_FILE_NOT_AVAILABLE"})},onSettled:()=>{Ze("FORMING_DOCUMENT")}});return{handleDownloadVerdictClick:l.useCallback(()=>{ve({type:"pending",message:h.client.cases.messages.FORMING_DOCUMENT,key:"FORMING_DOCUMENT",duration:0}),s()},[s]),isDownloadVerdictPending:r}},Ky=36,ude=7,dde=10,fde=12,pde=-10,Qw=20,hde="(min-width: 81.5rem)",mde=42,gde=120,Ade=({scrollContainerRef:e,clientId:t,caseId:n,instance:s})=>{const r=bt(),i=l.useRef(null),o=l.useRef(!1),c=l.useRef(null),u=l.useRef(null),[d,p]=l.useState({isVisible:!1,topPx:0,leftPx:0}),[g,A]=l.useState(!1),E=l.useCallback(()=>{A(!1),p(Q=>Q.isVisible?{...Q,isVisible:!1}:Q)},[]),x=l.useCallback(Q=>Q.rangeCount?Q.getRangeAt(0):null,[]),y=l.useCallback(({root:Q,targetNode:M,targetOffset:K})=>{const W=document.createTreeWalker(Q,NodeFilter.SHOW_TEXT);let H=0,j=W.nextNode();for(;j;){const q=j.textContent?.length??0;if(j===M)return H+Math.min(Math.max(K,0),q);H+=q,j=W.nextNode()}return H},[]),I=l.useCallback(({sourceRange:Q,contentNode:M})=>{if(!Q.intersectsNode(M))return null;const W=document.createRange();W.selectNodeContents(M);const H=Q.cloneRange();return Q.compareBoundaryPoints(Range.START_TO_START,W)<0&&H.setStart(W.startContainer,W.startOffset),Q.compareBoundaryPoints(Range.END_TO_END,W)>0&&H.setEnd(W.endContainer,W.endOffset),H.collapsed?null:H},[]),v=l.useCallback(()=>{const Q=i.current;if(!Q)return null;const M=window.getSelection()??document.getSelection();if(!M||M.isCollapsed)return null;const K=x(M);if(!K)return null;const W=I({sourceRange:K,contentNode:Q});if(!W)return null;const H=y({root:Q,targetNode:W.startContainer,targetOffset:W.startOffset}),j=y({root:Q,targetNode:W.endContainer,targetOffset:W.endOffset}),q=W.toString();return q?{selection:M,text:q,startPosition:H,endPosition:j}:null},[y,I,x]),S=l.useCallback(({clientId:Q,caseId:M,instance:K,preparedQuoteSelection:W})=>{const H=K.split("-").join("_");return{clientId:Q,caseId:M,instance:H,text:W.text,startPosition:W.startPosition,endPosition:W.endPosition}},[]),b=l.useCallback(()=>window.matchMedia(hde).matches?Qw:Qw+mde,[]),w=l.useCallback(({sourceRange:Q,contentNode:M})=>{const K=document.createRange();return K.selectNodeContents(M),{isSelectionStartingBeforeContent:Q.compareBoundaryPoints(Range.START_TO_START,K)<0,isSelectionEndingAfterContent:Q.compareBoundaryPoints(Range.END_TO_END,K)>0}}
866,[]),_=l.useCallback(({scrollContainer:Q,contentTopPx:M,contentBottomPx:K})=>{const W=b(),H=Q.scrollTop+fde,j=Q.scrollTop+Q.clientHeight-W-Ky,q=M+pde,G=K-W-Ky,$=Math.max(q,H),J=Math.min(G,j);return{minTopPx:$,safeMaxTopPx:Math.max(J,$)}},[b]),N=l.useCallback(({desiredTopPx:Q,topLimits:M,boundaryFlags:K,isForwardSelection:W})=>{const{minTopPx:H,safeMaxTopPx:j}=M,{isSelectionStartingBeforeContent:q,isSelectionEndingAfterContent:G}=K;return q&&G?W?j:H:q?H:G?j:Math.min(Math.max(Q,H),j)},[]),R=l.useCallback(({sourceRange:Q,clippedRange:M,scrollContainer:K,contentNode:W,isForwardSelection:H})=>{const j=w({sourceRange:Q,contentNode:W}),q=document.createRange();H?q.setStart(M.endContainer,M.endOffset):q.setStart(M.startContainer,M.startOffset),q.collapse(!0);const G=q.getBoundingClientRect(),$=K.getBoundingClientRect(),J=W.getBoundingClientRect(),ne=G.top-$.top+K.scrollTop,X=G.bottom-$.top+K.scrollTop,oe=J.top-$.top+K.scrollTop,ie=J.bottom-$.top+K.scrollTop,ee=H?X+dde:ne-ude-Ky,te=_({scrollContainer:K,contentTopPx:oe,contentBottomPx:ie});return N({desiredTopPx:ee,topLimits:te,boundaryFlags:j,isForwardSelection:H})},[N,_,w]),D=l.useCallback(async()=>{if(E(),!t||!n||!s)return;const Q=v();if(!Q)return;const M=S({clientId:t,caseId:n,instance:s,preparedQuoteSelection:Q});try{Ze("CASE_SOURCE_QUOTE_SAVED"),ve({type:"pending",message:h.client.cases.caseSource.quotes.SAVE_PENDING_TOAST,key:"CASE_SOURCE_QUOTE_SAVING",duration:0}),await Mte(M),await r.invalidateQueries({queryKey:["clientQuotes",t]}),ve({type:"success",message:h.client.cases.caseSource.quotes.SAVE_SUCCESS_TOAST,key:"CASE_SOURCE_QUOTE_SAVED"})}catch{ve({type:"failed",message:h.client.cases.caseSource.quotes.SAVE_FAILED_TOAST})}finally{Ze("CASE_SOURCE_QUOTE_SAVING"),Q.selection.removeAllRanges(),E()}},[S,n,t,v,E,s,r]),k=l.useCallback(Q=>!Q.anchorNode||!Q.focusNode?!0:Q.anchorNode===Q.focusNode?Q.anchorOffset<=Q.focusOffset:(Q.anchorNode.compareDocumentPosition(Q.focusNode)&Node.DOCUMENT_POSITION_FOLLOWING)!==0,[]),L=l.useCallback(()=>{const Q=window.getSelection();if(!Q)return;if(Q.isCollapsed){E();return}const M=e.current,K=i.current;if(!M||!K)return;const W=x(Q);if(!W)return;const H=I({sourceRange:W,contentNode:K});if(!H){E();return}const j=k(Q);let q=0;try{q=R({sourceRange:W,clippedRange:H,scrollContainer:M,contentNode:K,isForwardSelection:j})}catch{E();return}A(!1),p({isVisible:!0,topPx:q,leftPx:0})},[R,I,x,k,E,e]),O=l.useCallback(()=>{L(),o.current=!1},[L]),P=l.useCallback(()=>{o.current=!0},[]),B=l.useCallback(()=>{const Q=window.getSelection();if(!Q||Q.isCollapsed){u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),E();return}u.current!==null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{u.current=null,L()})},[E,L]),F=l.useCallback(()=>{o.current&&(L(),o.current=!1)},[L]),z=l.useCallback(()=>{A(Q=>!d.isVisible||Q?Q:!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{o.current||L()},gde)},[d.isVisible,L]);return l.useEffect(()=>(document.addEventListener("selectionchange",B),()=>{document.removeEventListener("selectionchange",B),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}),[B]),l.useEffect(()=>(document.addEventListener("mouseup",F,!0),document.addEventListener("touchend",F,!0),()=>{document.removeEventListener("mouseup",F,!0),document.removeEventListener("touchend",F,!0)}),[F]),l.useEffect(()=>{const Q=e.current;if(Q)return Q.addEventListener("scroll",z,{passive:!0}),()=>{Q.removeEventListener("scroll",z),c.current&&(clearTimeout(c.current),c.current=null)}},[z,e]),{contentRef:i,quoteButtonPosition:d,isQuoteButtonTransparent:g,handleContentMouseDown:P,handleContentMouseUp:O,handleSaveQuoteClick:D}},Ede=500,xde=({isVisible:e,isTransparent:t,topPx:n,leftPx:s,handleClick:r})=>{const i=l.useRef(!1),o=l.useCallback(u=>{t||u.pointerType!=="touch"&&u.pointerType!=="pen"||(u.stopPropagation(),u.preventDefault(),i.current=!0,r(),window.setTimeout(()=>{i.current=!1},Ede))},[r,t]),c=l.useCallback(u=>{if(u.stopPropagation(),i.current){u.preventDefault();return}r()},[r]);return e?a.jsx("button",{type:"button",onPointerUp:o,onClick:c,className:Y("absolute z-20 rounded-full cursor-pointer","h-8","flex items-center justify-center","select-none","px-3 py-2","transition-opacity","roboto-flex-25-700-1 text-[14px] leading-[16
866px] uppercase","bg-zinc-900 text-zinc-100","hover:bg-zinc-950 hover:text-white",t?"opacity-0 pointer-events-none duration-0":"opacity-100 duration-200"),style:{top:n,left:s},children:h.client.cases.caseSource.quotes.SAVE_BUTTON}):null},Cde=()=>{const e=vs(),t=l.useRef(null),{id:n,listInstance:s,caseId:r,caseInstance:i}=st(),o=Fe(),{handleClose:c}=lde({clientId:n}),u=o.state?.isForceCaseSourceAnimateOnStart===!0,d=l.useMemo(()=>{const H=i??s;return H==="first-instance"||H==="second-instance"?H:"first-instance"},[i,s]),{handleDownloadVerdictClick:p,isDownloadVerdictPending:g}=cde({clientId:n,caseId:r,effectiveInstance:d}),{contentRef:A,quoteButtonPosition:E,isQuoteButtonTransparent:x,handleContentMouseDown:y,handleContentMouseUp:I,handleSaveQuoteClick:v}=Ade({scrollContainerRef:t,clientId:n,caseId:r,instance:d}),S=d==="first-instance"?xoe:yoe,{data:b,isLoading:w,error:_}=Vt({queryKey:["caseSource",d,n,r],queryFn:async()=>{if(!n||!r)throw{httpCode:422,errorData:{code:"VALIDATION_ERROR"}};return await S({clientId:n,caseId:r})}}),N=l.useMemo(()=>GI({error:_}),[_]),R=l.useMemo(()=>{const H=b?.metadataCui??"",j=b?.metadataRegion,q=typeof j=="number"?e[String(j)]?.name:void 0;return!H&&!q?h.client.cases.titles.CASE_CARD_TITLE:q?`${h.client.cases.titles.CASE_CARD_TITLE} ${H} (${q})`:`${h.client.cases.titles.CASE_CARD_TITLE} ${H}`},[b?.metadataCui,b?.metadataRegion,e]),D=b?.content??"",{searchValue:k,isSearchActive:L,isInitialSearchResolving:O,matchesLength:P,activeMatchIndexNormalized:B,renderedContent:F,handleFindShortcut:z,handleSearchValueChange:Q,handleClearSearchClick:M,handlePrevMatchClick:K,handleNextMatchClick:W}=B7({content:D,isContentLoading:w,scrollContainerRef:t,contentRef:A});return l.useEffect(()=>{if(!u)return;const H=o.state;if(!H)return;const j={...H};delete j.isForceCaseSourceAnimateOnStart;const q=window.history.state??{};window.history.replaceState({...q,usr:j},"",window.location.href)},[u,o.state]),a.jsxs(Ws,{onClose:c,contentRef:t,isForceAnimateOnStart:u,children:[!!N&&a.jsx(ia,{type:Gr.PRACTICE_NOT_FOUND,to:`/clients/${n}/cases/first-instance`,isInBottomSheet:!0}),!N&&a.jsxs(a.Fragment,{children:[!!w&&a.jsx(ct,{isWithWrapper:!0}),!w&&a.jsx("div",{className:"relative roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 whitespace-pre-wrap h-full ",children:a.jsxs("div",{className:Y(!!O&&"opacity-0",!O&&"opacity-100 transition-opacity duration-200"),children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase mt-6",children:R}),a.jsxs("div",{children:[a.jsx("div",{ref:A,onMouseDown:y,onMouseUp:I,onTouchStart:y,onTouchEnd:I,className:"w-full max-w-[750px] bp56_25:w-[844px] bp56_25:max-w-[844px] roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 pt-8 pb-20 wrap-anywhere-with-fallback",children:F}),a.jsx(xde,{isVisible:E.isVisible,isTransparent:x,topPx:E.topPx,leftPx:E.leftPx,handleClick:v}),a.jsx(gE,{placeholder:h.client.cases.caseSource.search.PLACEHOLDER,searchValue:k,isSearchActive:L,matchesLength:P,activeMatchIndexNormalized:B,onFindShortcut:z,onSearchValueChange:Q,onClearSearchClick:M,onPrevMatchClick:K,onNextMatchClick:W,onDownloadVerdictClick:p,isDownloadVerdictPending:g})]})]})})]})]})},jm=({valueRaw:e,valueNormalized:t,placeholder:n,isError:s,errorText:r,isDisabled:i,name:o,type:c,autoComplete:u,onChange:d})=>{const[p,g]=l.useState(!1),A=l.useMemo(()=>p||!t?e:mu({value:t}),[p,e,t]),E=l.useCallback(I=>{const v=of({value:I});d({rawValue:I,normalizedValue:v})},[d]),x=l.useCallback(()=>{g(!0)},[]),y=l.useCallback(()=>{g(!1)},[]);
866return a.jsx(hi,{name:o,placeholder:n,type:c,value:A,handleChange:E,onFocus:x,onBlur:y,autoComplete:u,isError:s,errorText:r,disabled:i})},bf=({to:e,variant:t="default",prefixText:n,suffixText:s,children:r,isDisabled:i=!1,onClick:o,state:c})=>{const u=l.useCallback(()=>{const p={default:{base:"roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase underline transition-colors duration-100 hover:!transition-none",notDisabled:"text-zinc-800 hover:text-zinc-500 cursor-pointer",disabled:"text-zinc-400 hover:text-zinc-400 cursor-default"},small:{base:"roboto-flex-100-400-1 text-[12px] leading-[16px] underline text-zinc-500 hover:text-zinc-600 cursor-pointer",notDisabled:"",disabled:""}};return Y(p[t].base,!i&&p[t].notDisabled,!!i&&p[t].disabled)},[t,i]),d=l.useMemo(()=>({default:{base:"roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase text-zinc-500"},small:{base:"roboto-flex-100-400-1 text-[12px] leading-[16px] text-zinc-500",active:""}})[t].base,[t]);return!n&&!s?e&&!i?a.jsx(Je,{to:e,state:c,onClick:o,className:u(),children:r}):a.jsx("span",{onClick:i?void 0:o,className:u(),children:r}):e&&!i?a.jsxs("span",{className:d,children:[n,a.jsx(Je,{to:e,state:c,onClick:o,className:u(),children:r}),s]}):a.jsxs("span",{className:d,children:[n,a.jsx("span",{onClick:i?void 0:o,className:u(),children:r}),s]})},yde=()=>{const e=Fe(),t=at(),{user:n,isUserLoadResolved:s}=Se(z=>z),r=Se(z=>z.setAccessToken),i=Se(z=>z.setIsUserLoadResolved),[o,c]=l.useState(!1),[u,d]=l.useState(!1),[p,g]=l.useState(""),[A,E]=l.useState(""),[x,y]=l.useState(""),[I,v]=l.useState(""),[S,b]=l.useState(""),w=yk(),_=l.useCallback(({minutes:z})=>qt({count:z,zero:h.signUp.enterSmsCode.errors.minutes.ZERO,one:h.signUp.enterSmsCode.errors.minutes.ONE,many:h.signUp.enterSmsCode.errors.minutes.MANY}),[]),N=l.useCallback(z=>{if(!z?.fields)return;const Q=z.fields.find(H=>!(!Array.isArray(H.field)||H.field.length!==2||H.field[0]!=="body"||H.field[1]!=="email"&&H.field[1]!=="phone"));if(!Q?.code)return;const W=((Q.field[1]==="phone"?"phone":"email")==="phone"?h.signIn.fieldsErrors.phone:h.signIn.fieldsErrors.email)[Q.code]??"";W&&v(W)},[]),R=l.useCallback(z=>{if(!z?.fields)return;const Q=z.fields.find(W=>!(!Array.isArray(W.field)||W.field.length!==2||W.field[0]!=="body"||W.field[1]!=="password"));if(!Q?.code)return;const M=Q.code,K=h.signIn.fieldsErrors.password?.[M]??"";K&&b(K)},[]),{mutate:D,isPending:k}=tt({mutationFn:jG,onSuccess:async z=>{if(z.accessToken){r(z.accessToken),i(!1);return}if(z.requiresSms&&!z.smsSent){const M=z.cooldownSeconds??0,K=Math.ceil(M/60),W=_({minutes:K});ve({type:"failed",message:`${h.signIn.enterSmsCode.errors.smsNotSent.PREFIX}${K} ${W}${h.signIn.enterSmsCode.errors.smsNotSent.SUFFIX}`,key:"SIGN_IN_FAILED"});return}const Q=e.state;z.requiresSms?t("/sign-in/sms",{state:{passToken:z.passToken,phone:z.phone??"",cooldownSeconds:z.cooldownSeconds??0,smsCode:z.smsCode??null,...Q?.redirectUrl&&{redirectUrl:Q.redirectUrl}}}):t("/sign-in/phone",{state:{passToken:z.passToken,...Q?.redirectUrl&&{redirectUrl:Q.redirectUrl}}})},onError:z=>{const Q=z.code;h.signIn.errors?.[Q]&&ve({type:"failed",message:h.signIn.errors[Q],key:"SIGN_IN_FAILED"}),h.signIn.errors?.[Q]||ve({type:"failed",message:h.signIn.errors.UNKNOW_ERROR,key:"SIGN_IN_FAILED"}),N(z),R(z)}}),L=l.useCallback(z=>{g(z.rawValue),E(z.normalizedValue),c(!1),v(""),b("")},[]),O=l.useCallback(z=>{y(z),d(!1),v(""),b("")},[]),P=l.useMemo(()=>k?!0:!(s||n),[k,n,s]),B=l.useMemo(()=>!!P,[o,u,P]),F=l.useCallback(z=>{if(z.preventDefault(),B)return;const Q=x.trim(),M=p.trim();A&&D({phone:A,password:Q}),A||D({email:M,password:Q})},[B,p,A,x,D]);return l.useEffect(()=>()=>{Ze("SIGN_IN_FAILED")},[]),a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-12"),children:h.signIn.titles.SIGN_IN}),a.jsx("form",{onSubmit:F,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-3",children:a.jsx(jm,{name:"username",type:"text",autoComplete:"username",valueRaw:p,valueNormalized:A,placeholder:h.signIn.placeholders.PHONE_OR_EMAIL,isError:!!I,errorText:I,isDisabled:P,onChange:L})}),a.jsx("div",{children:a.jsx(hi,{name:"password",placeholder:h.signIn.placeholders.PASSWORD,type:"password",value:x,handleChange:O,handleSetAutoCompleted:d,autoComplete:"current-password",disabled:P,isError:!!S,errorText:S})}),a.jsx("div",{className:"flex justify-end items-center h-9 mr-0.25",children:a.jsx(bf,{to:"/forgot-password",isDisabled:P,state:e.state,children:h.sign
866In.links.FORGOT_PASSWORD})}),a.jsx("div",{className:"mt-6",children:a.jsx(ut,{variant:"h14",isFullWidth:!0,isPending:P,disabled:B,type:"submit",children:h.signIn.buttons.SIGN_IN})}),!w&&a.jsx("div",{className:"flex justify-center items-center h-13",children:a.jsx(bf,{to:"/sign-up",prefixText:h.signIn.links.NO_ACCOUNT_PROMPT,isDisabled:P,state:e.state,children:h.signIn.links.SIGN_UP})})]})})]})},bde=()=>{const e=Fe(),t=at(),n=e.state,s=n?.passToken??"",[r,i]=l.useState(""),[o,c]=l.useState(""),[u,d]=l.useState(""),p=l.useCallback(({minutes:I})=>qt({count:I,zero:h.signIn.enterSmsCode.errors.minutes.ZERO,one:h.signIn.enterSmsCode.errors.minutes.ONE,many:h.signIn.enterSmsCode.errors.minutes.MANY}),[]),g=l.useCallback(I=>{if(!I?.fields)return;const v=I.fields.find(w=>!(!Array.isArray(w.field)||w.field.length!==2||w.field[0]!=="body"||w.field[1]!=="phone"));if(!v?.code)return;const S=v.code,b=h.signIn.phoneForm.fieldsErrors?.[S]??"";b&&d(b)},[]),{mutate:A,isPending:E}=tt({mutationFn:Mk,onSuccess:I=>{if(!I.smsSent){const v=I.cooldownSeconds??0,S=Math.ceil(v/60),b=p({minutes:S});ve({type:"failed",message:`${h.signIn.phoneForm.notifications.smsNotSent.PREFIX}${S} ${b}${h.signIn.phoneForm.notifications.smsNotSent.SUFFIX}`,key:"SIGN_IN_PHONE_ADD_COOLDOWN"}),t(".",{replace:!0,state:{...n??{},passToken:I.passToken}});return}t("/sign-in/sms",{state:{passToken:I.passToken,phone:o,cooldownSeconds:I.cooldownSeconds??0,smsCode:I.smsCode??null,...n?.redirectUrl&&{redirectUrl:n.redirectUrl}}})},onError:I=>{const v=I.code;if(["PHONE_ALREADY_REGISTERED","PHONE_NOT_CONFIRMED","PASS_TOKEN_EXPIRED","ACCOUNT_DATA_CONFLICT"].includes(v)){d(h.signIn.phoneForm.errors[v]);return}h.signIn.phoneForm.errors?.[v]&&ve({type:"failed",message:h.signIn.phoneForm.errors[v],key:"SIGN_IN_FAILED"}),h.signIn.phoneForm.errors?.[v]||ve({type:"failed",message:h.signIn.phoneForm.errors.UNKNOW_ERROR,key:"SIGN_IN_FAILED"}),g(I)}}),x=l.useCallback(I=>{i(I.rawValue),c(I.normalizedValue),d("")},[]),y=l.useCallback(I=>{if(I.preventDefault(),!E){if(!o){d(h.signIn.phoneForm.fieldsErrors.PHONE_REQUIRED);return}A({passToken:s,phone:o})}},[E,o,A,s]);return s?a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsxs("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase justify-start items-start mb-8 mx-4 bp34_375:mb-12",children:[h.signIn.phoneForm.titles.TITLE_1,a.jsx("br",{}),h.signIn.phoneForm.titles.TITLE_2]}),a.jsx("form",{onSubmit:y,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:h.signIn.phoneForm.description.TEXT}),a.jsx(jm,{name:"phone",type:"text",autoComplete:"tel",valueRaw:r,valueNormalized:o,placeholder:h.signIn.phoneForm.placeholders.PHONE,onChange:x,isError:!!u,errorText:u,isDisabled:E}),a.jsx(ut,{variant:"h14",className:"mt-8",isPending:E,isFullWidth:!0,type:"submit",children:h.signIn.phoneForm.buttons.CONFIRM})]})})]}):a.jsx(Qn,{to:"/sign-in",replace:!0})},Ide=({length:e=4,onChange:t,onComplete:n,isAutoFocusOnFirstElement:s=!0,errorText:r,isError:i,isDisabled:o,value:c=""})=>{const u=l.useMemo(()=>Array.from({length:e},()=>Oe.createRef()),[e]),d=l.useMemo(()=>{const v=c.slice(0,e);return Array.from({length:e},(S,b)=>v[b]??"")},[c,e]),p=l.useCallback(v=>{t&&t(v.value)},[t]),g=l.useCallback(v=>{!n||v.slots.some(b=>b==="")||n(v.value)},[n]),A=l.useCallback(v=>{v.target.select()},[]),E=l.useCallback(({index:v,rawValue:S})=>{const b=[...d],w=S.slice(-1);b[v]=w;const _=b.join("");p({value:_}),g({slots:b,value:_}),w&&(v>=e-1||u[v+1].current?.focus())},[d,p,g,u,e]),x=l.useCallback(v=>{const S=v.currentTarget.dataset.index;if(S===void 0)return;const b=Number(S);if(Number.isNaN(b))return;const w=v.currentTarget.value;/^\d*$/.test(w)&&E({index:b,rawValue:w})},[E]),y=l.useCallback((v,S)=>{if(/^\d$/.test(S.key)){const w=d.map((_,N)=>N<v?_:"");p({value:w.join("")})}if(S.key==="Backspace"&&!d[v]&&v>0){u[v-1].current?.focus();return}if(S.key==="ArrowLeft"&&v>0){S.preventDefault(),u[v-1].current?.focus();return}if(S.key==="ArrowRight"&&v<e-1){S.preventDefault(),u[v+1].current?.focus();return}},[d,u,p,e]),I=l.useCallback(v=>{v.preventDefault();const b=v.clipboardData.getData("text").slice(0,e).replace(/\D/g,"").slice(0,e),w=[...d];b.split("").forEach((R,D)=>{D<e&&(w[D]=R)});for(let R=b.length;R<e;R+=1)w[R]="";const _=w.join("");p({value:_}),g({slots:w,value:_});const N=w.findIndex(R=>R==="");if(N!==-1){u[N].current?.focus();return}u[e-1].current?.focus()},[d,p,g,u,e]);return l.useEffect(()=>{e<=0||s&&u[0].current?.focus()},[u,s,e]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Y("flex gap-2 justify-center"),children:d.map((v,S)=>a.jsx("input",{ref:u[S],"data-index":S,type:"text",inputMode:"numeric",maxLength:1,value:v,disabled:o,onChange:x,onFocus:A,onKeyDown:b=>y(S,b),onPaste:I,className:Y("w-14 h-14 text-center","roboto-flex-100-400-1","text-[16px]","leading-[20px]","rounded-[8px]","focus:outline-none","border",!o&&Y("text-zinc-950",!i&&"bg-zinc-100 border-zinc-100",!!i&&"bg-red-50 border-red-50"),!!o&&Y("text-zinc-400",!i&&"bg-white border-zinc-100",!!i&&"bg-red-50 border-red-50"))},S))}),!!(i&&r)&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16
866px] text-red-600 mt-2 text-center",children:r})]})},Sde=e=>l.createElement("svg",{width:108,height:108,viewBox:"0 0 108 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.3819 12.8371C24.3163 17.7545 19.5174 25.4028 16.3838 30.5943C14.8551 33.127 13.31 35.6297 12.1403 38.4022C11.7584 39.3073 11.3255 40.1803 10.9334 41.0791C10.7838 41.4219 10.2162 42.0636 10.5441 42.1388C10.8371 42.2059 10.992 41.6855 11.2156 41.4584C12.8359 39.8125 14.5 38.2234 16.1502 36.6175C20.943 31.9534 25.7483 27.3147 30.6716 22.8311C35.2653 18.6478 39.7597 14.1198 44.5896 10.294C46.204 9.01519 47.7906 7.70039 49.4463 6.49045C51.4474 5.02804 49.0232 7.25396 48.6287 7.68394C38.5506 18.6674 30.4058 31.5435 21.2502 43.4661C17.5036 48.3451 13.2703 52.9184 9.97957 58.2341C9.03459 59.7605 8.19501 61.3669 7.25437 62.8965C6.8974 63.4769 6.29227 64.1201 6.00856 64.7703C5.9351 64.9387 6.35447 64.7782 6.49521 64.6811C9.00213 62.9511 11.3496 60.7904 13.717 58.8364C23.9162 50.4182 33.9683 41.7698 44.0445 33.1598C52.5512 25.891 60.7773 18.0972 69.5251 11.2086C71.5083 9.64692 77.6738 5.34548 75.579 6.70238C75.1094 7.00653 74.0988 7.91929 73.8855 8.10779C70.972 10.6819 68.0728 13.2827 65.1843 15.8933C56.5588 23.6888 48.6122 32.1907 40.8035 41.0345C33.28 49.5554 25.5574 57.8773 18.1746 66.555C17.9835 66.7796 17.8074 66.9815 17.6588 67.2465C17.5764 67.3933 17.5004 67.4838 17.396 67.6035C16.6707 68.4347 19.1875 66.4577 20.0725 65.8634C41.3029 51.6069 62.4455 37.1297 82.4114 20.6338C82.5736 20.4998 82.7952 20.4287 82.8981 20.2322C83.3392 19.3897 81.5181 21.4023 80.8736 22.0503C74.8242 28.1334 68.983 34.4659 63.2572 40.9453C56.4992 48.5927 49.889 56.4263 42.9837 63.9003C40.576 66.5063 37.9677 68.823 35.538 71.3847C34.1341 72.8649 32.9756 74.6485 31.5476 76.0805C29.3207 78.3136 27.228 80.7158 25.0071 82.9514C23.7829 84.1838 22.4645 85.3102 21.0847 86.3088C20.5563 86.6913 20.0252 87.0748 19.5372 87.5246C19.2328 87.8052 18.2856 88.2939 18.6613 88.4169C18.9694 88.5178 19.272 88.1841 19.5567 88.0154C23.1117 85.9091 26.5843 83.5563 30.0584 81.2895C41.6302 73.739 53.2249 66.1627 64.5809 58.1894C70.1075 54.3091 75.5673 50.2827 81.0196 46.2658C82.1189 45.4559 83.2166 44.5486 84.3775 43.8453C84.4862 43.7795 84.6052 43.7734 84.6695 43.6446C85.2493 42.4816 86.6717 41.5762 87.6088 40.8338C88.2181 40.3509 88.6758 39.9194 89.1855 39.2945C89.7976 38.5441 92.1573 36.0807 89.351 38.7033C79.478 47.9298 69.9379 57.5889 60.6877 67.6258C52.6354 76.363 44.5278 84.9591 36.0247 93.1239C33.4401 95.6057 30.8142 98.0321 28.2579 100.553C27.8196 100.985 26.5088 102.241 27.0315 101.958C29.0344 100.873 31.0543 99.178 32.8712 97.8309C38.7311 93.4866 44.5095 89.0002 50.3125 84.5576C62.1372 75.505 73.9404 66.368 86.2656 58.2229C91.3769 54.8452 96.5566 51.6138 101.653 48.2066C103.259 47.1331 98.8459 51.0007 97.4195 52.367C88.3783 61.0276 79.5428 70.0165 71.2965 79.6721C67.1843 84.4872 63.4129 89.8289 58.8579 94.1278C57.809 95.1177 61.2604 92.6706 62.4396 91.897C68.9573 87.6212 75.4183 83.2357 81.808 78.7129C88.1034 74.2568 94.4713 69.791 100.485 64.8373C101.899 63.6729 97.8632 67.4623 96.5435 68.7635C91.5792 73.6582 87.0586 79.0102 82.3725 84.2453C78.5388 88.5282 74.6949 92.8071 70.7904 97.0055C69.6374 98.2453 68.5137 99.6193 67.2769 100.753C64.5512 103.252 73.0582 96.2688 75.9294 93.9939C78.9938 91.5659 82.0742 89.1751 85.2145 86.8777C85.829 86.4281 86.4384 85.9687 87.0637 85.5392C87.4281 85.2889 88.2812 84.5841 88.2706 85.0707C88.2513 85.9561 87.2868 87.3529 86.9177 88.06C86.1884 89.4573 85.4541 90.8356 84.8252 92.2985C84.6806 92.6349 83.3212 95.4158 83.6183 95.7563",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("g",{clipPath:"url(#clip0_11458_38827)"},l.createElement("path",{d:"M38.1951 51.9394L35.4775 41.7972C33.6431 34.951 37.7059 27.9141 44.5521 26.0796C51.3983 24.2452 58.4352 28.308 60.2696 35.1542L62.9872 45.2964M53.3088 58.7601L55.7244 67.7754M77.5995 72.7844L39.2845 83.0509L39.1335 82.4875L39.1061 81.7054C38.9434 77.0566 38.2534 72.4413 37.0494 67.9481C35.8455 63.4549 34.1354 59.113 31.952 55.0056L31.5846 54.3146L31.4336 53.7512L69.7487 43.4847L69.8997 44.0481L69.9271 44.8302C70.0898 49.479 70.7798 54.0943 71.9838 58.5875C73.1877 63.0807 74.8978 67.4226 77.0813 71.53L77.4486 72.221L77.5995 72.7844Z",stroke:"black",strokeWidth:4})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_11458_38827"},l.createElement("rect",{width:60,height:60,fill:"white",transform:"translate(14.7578 30.7856) rotate(-15)"})))),vde=({counter:e,isPending:t,formattedCounter:n,onResendSms:s})=>{const r=l.useMemo(()=>{const i=Math.max(1,Math.ceil(e/60)),o=qt({count:i,zero:h.molecules.enterSmsCodeTemplate.accessIsTemporarilyRestricted.minutes.ZERO,one
866:h.molecules.enterSmsCodeTemplate.accessIsTemporarilyRestricted.minutes.ONE,many:h.molecules.enterSmsCodeTemplate.accessIsTemporarilyRestricted.minutes.MANY});return h.molecules.enterSmsCodeTemplate.accessIsTemporarilyRestricted.DESCRIPTION.replace("{time}",i.toString()).replace("{minutes}",o)},[e]);return a.jsxs("div",{className:"px-4 flex flex-col flex-1 items-center text-center mx-4 pt-38 bp34_375:pb-8 pb-0",children:[a.jsx("div",{className:"flex items-center justify-center h-24",children:a.jsx(Sde,{})}),a.jsx("h4",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 justify-start items-start mb-2 bp34_375:mb-1.5 mt-5",children:h.molecules.enterSmsCodeTemplate.accessIsTemporarilyRestricted.TITLE}),a.jsx("div",{className:"mb-4 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:r}),a.jsxs(ut,{variant:"h12link",className:"text-[12px]! h-fit mt-px text-zinc-800",onClick:s,disabled:!!e||t,children:[h.molecules.enterSmsCodeTemplate.RESEND_CODE,!!e&&` ${n}`]})]})},Qf=({title:e,description:t,phone:n,smsCode:s,error:r,counter:i,isAccessTemporarilyRestrictedActive:o=!1,isError:c,isOtpInputDisabled:u,isPending:d,isHideResendButton:p,onSmsCodeChange:g,onSmsCodeComplete:A,onResendSms:E})=>{const x=l.useMemo(()=>mu({value:n}),[n]),y=l.useMemo(()=>fn({value:i}),[i]);return o?a.jsx(vde,{counter:i,isPending:d,onResendSms:E,formattedCounter:y}):a.jsxs("div",{className:"px-4 flex flex-col flex-1 items-center text-center mx-4 pt-38 bp34_375:pb-8 pb-0",children:[a.jsx("div",{className:"flex items-center justify-center h-27",children:a.jsx(hs,{})}),a.jsx("h4",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 justify-start items-start mb-2 bp34_375:mb-1.5 mt-5",children:e}),a.jsxs("div",{className:"mb-6 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px] bp34_375:mb-8",children:[t.PREFIX," ",a.jsx("span",{className:"whitespace-nowrap",children:x}),", ",a.jsx("br",{})," ",t.SUFFIX]}),a.jsx(Ide,{value:s,onChange:g,onComplete:A,errorText:r,isError:c,isDisabled:u||d}),!p&&a.jsxs("div",{className:"roboto-flex-25-700-1 text-[12px] text-zinc-500 gap-1 flex mt-4",children:[a.jsxs("span",{className:"uppercase",children:[h.molecules.enterSmsCodeTemplate.DID_NOT_RECEIVE_CODE,"?"]}),a.jsxs(ut,{variant:"h12link",className:"text-[12px]! h-fit mt-px text-zinc-800",onClick:E,disabled:!!i||d,children:[h.molecules.enterSmsCodeTemplate.RESEND_CODE,!!i&&` ${y}`]})]})]})},_de="DEV_SMS_CODE",Hw=4;function PP({smsCode:e}){const n=(e??"").trim().slice(0,Hw);if(n.length===Hw)return n}function Ci({smsSent:e,smsCode:t}){if(!e)return null;const n=PP({smsCode:t});return n||null}function aa({smsCode:e}){const t=PP({smsCode:e});t&&ve({type:"info",message:`${h.signIn.notifications.smsDisabledDev.PREFIX}${t}`,key:_de})}const Hf=300,Tde=()=>{const e=Fe(),t=at(),n=e.state,s=n?.passToken??"",r=n?.phone??"",i=n?.cooldownSeconds??0,o=n?.smsCode??null,c=l.useRef(null),u=l.useRef(null),[d,p]=l.useState(""),[g,A]=l.useState(0),[E,x]=l.useState(!1),[y,I]=l.useState(!1),[v,S]=l.useState(!1),[b,w]=l.useState(""),_=Se(W=>W.isUserLoadResolved),N=Se(W=>W.setIsUserLoadResolved),R=Se(W=>W.setAccessToken),D=l.useCallback(({attemptsLeft:W})=>qt({count:W,zero:h.signIn.enterSmsCode.errors.attemptsLeft.ZERO,one:h.signIn.enterSmsCode.errors.attemptsLeft.ONE,many:h.signIn.enterSmsCode.errors.attemptsLeft.MANY}),[]),k=l.useCallback(({minutes:W})=>qt({count:W,zero:h.signIn.enterSmsCode.errors.minutes.ZERO,one:h.signIn.enterSmsCode.errors.minutes.ONE,many:h.signIn.enterSmsCode.errors.minutes.MANY}),[]),L=l.useCallback(W=>{p(W)},[]),O=l.useCallback(({initialSeconds:W})=>{A(W),u.current&&clearInterval(u.current),c.current=Date.now(),u.current=setInterval(()=>{if(c.current===null)return;const H=Math.floor((Date.now()-c.current)/1029),j=W-H;if(j<=0){u.current&&clearInterval(u.current),A(0);return}A(j)},343)},[]),{mutate:P,isPending:B}=tt({mutationFn:zG,onSuccess:W=>{R(W.accessToken),N(!1)},onError:W=>{if(W.code==="INVALID_SMS_CODE"){const H=W.data?.attemptsLeft??0,j=D({attemptsLeft:H});w(`${h.signIn.enterSmsCode.errors.INVALID_CODE} ${H} ${j}`);return}if(W.code==="SMS_ATTEMPTS_EXCEEDED"){I(!0),w(h.signIn.enterSmsCode.errors.ATTEMPTS_EXCEEDED),g>Hf&&x(!0);return}if(W.code==="PASS_TOKEN_EXPIRED"){I(!0),w(h.signIn.enterSmsCode.errors.PASS_TOKEN_EXPIRED);return}S(!0),I(!0),w(h.signIn.enterSmsCode.errors.UNKNOW_ERROR)}}),F=l.useCallback(W=>{P({passToken:s,smsCode:W})},[s,P]),z=l.useCallback(({value:W})=>{const H=Ci({smsSent:!0,smsCode:W});if(!H)return;aa({smsCode:H}),p(H),P({passToken:s,smsCode:H});const j=e.state;j&&t(".",{replace:!0,state:{...j,smsCode:null}})},[e.state,t,s,P]),{mutate:Q,isPending:M}=tt({mutationFn:Mk,onSuccess:W=>{Ze("SIGN_IN_RESEND_SMS_SENDING");const H=W.smsSent,j=W.cooldownSeconds??0,q=Math.ceil(j/60),G=k({minutes:q});if(!H){ve({type:"failed",message:`${h.signIn.enterSmsCode.errors.resendSmsFailed.PREFIX}${q} ${G}${h.signIn.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"SIGN_IN_RESEND_SMS_FAILED"}),t(".",{replace:!0,state:{...n??{},passToken:W.passToken,cooldownSeconds:W.cooldownSeconds??0,smsCode:null}}),O({initialSeconds:j}),I(!0),S(!1);return}ve({type:"success",message:h.signIn.notifications.SENT,key:"SIGN_IN_RESEND_SMS_SENT"}),t(".",{replace:!0,state:{...n??{},passToken:W.passToken,cooldownSeconds:W.cooldownSeconds??0,smsCode:null}});const J=Ci({smsSent:H,smsCode:W.smsCode});J||p(""),J&&(aa({smsCode:J}),p(J),P({passToken:W.passToken,smsCode:J})),O({initialSeconds:j}),w(""),I(!1),S(!1)},onError:()=>{Ze("SIGN_IN_RESEND_SMS_SENDING"),I(!0),S(!0),w(h.signIn.enterSmsCode.errors.UNKNOW_ERROR)}}),K=l.useCallback(()=>{x(!1),Q({passToken:s,phone:r||void 0}),ve({type:"info",message:h.signIn.notifications.SENDING,key:"SIGN_IN_RESEND_SMS_SENDING"})},[s,r,Q]);return l.useEffect(()=>{O({initialSeconds:i})},[O,i]),l.useEffect(()=>{z({value:o})},[o,z]),l.useEffect(()=>()=>{S(!1),p(""),A(0),w(""),u.current&&clearInterval(u.current)},[]),!s||!r?a.jsx(Qn,{to:"/sign-in",replace:!0}):a.jsx(Qf,{title:h.signIn.enterSmsCode.TITLE,description:{PREFIX:h.signIn.enterSmsCode.description.PREFIX,SUFFIX:h.signIn.enterSmsCode.description.SUFFIX},phone:r,smsCode:d,onSmsCodeChange:L,isOtpInputDisabled:!_||y,isPending:B||M,counter:g,isAccessTemporarilyRestrictedActive:E,error:b,isError:!!b,isHideResendButton:v,onResendSms:K,onSmsCodeComplete:F})},Nde=()=>{const e=Fe(),t=at(),n=bt(),s=e.state,[r,i]=l.useState(""),[o,c]=l.useState(""),[u,d]=l.useState(""),[p,g]=l.useState(""),[A,E]=l.useState(""),[x,y]=l.useState(""),[I,v]=l.useState(""),[S,b]=l.useState(!1),[w,_]=l.useState(!1),[N,R]=l.useState(!1),[D,k]=l.useState(!1),[L,O]=l.useState(!1),[P,B]=l.useState(!1),[F,z]=l.useState(!1),Q=l.useCallback(({minutes:fe})=>
866qt({count:fe,zero:h.signUp.enterSmsCode.errors.minutes.ZERO,one:h.signUp.enterSmsCode.errors.minutes.ONE,many:h.signUp.enterSmsCode.errors.minutes.MANY}),[]),{mutate:M}=tt({mutationFn:async({email:fe,phone:ue})=>{const ye=fe?.trim(),ce=ue?.trim();if(!ye&&!ce)return b(!1),_(!1),{isExists:!1};if(ye&&ce)return b(!1),_(!1),{isExists:!1};const xe=ce?["postEmailStatus","phone",ce]:["postEmailStatus","email",ye??""],re=n.getQueryData(xe);if(re&&re.isExists)return re;if(ce){const _e=await II({phone:ce});return _e.isExists&&n.setQueryData(xe,_e),_e}const pe=await II({email:ye});return pe.isExists&&n.setQueryData(xe,pe),pe},onSuccess:(fe,ue)=>{if(ue.phone){_(fe.isExists);return}b(fe.isExists)},onError:()=>{b(!1),_(!1)}}),K=l.useMemo(()=>ol(fe=>{if(!hu.test(fe)){b(!1);return}M({email:fe})},500),[M]),W=l.useMemo(()=>ol(fe=>{if(!fe){_(!1);return}M({phone:fe})},500),[M]);l.useEffect(()=>()=>{K.cancel(),W.cancel()},[K,W]);const H=l.useCallback(fe=>{d(fe),E(""),y(""),v(""),b(!1),K(fe.trim())},[K]),j=l.useCallback(({rawValue:fe,normalizedValue:ue})=>{i(fe),c(ue),E(""),y(""),v(""),_(!1),W(ue)},[W]),q=l.useCallback(()=>{if(!hu.test(u.trim())){b(!1);return}M({email:u.trim()})},[u,M]),G=l.useCallback(fe=>{g(fe),E(""),v("")},[]),$=l.useCallback(fe=>{if(!fe?.fields)return;const ue=fe.fields.find(xe=>!(!Array.isArray(xe.field)||xe.field.length!==2||xe.field[0]!=="body"||xe.field[1]!=="email"));if(!ue?.code)return;const ye=ue.code,ce=h.signUp.fieldsErrors.email?.[ye]??"";ce&&E(ce)},[]),J=l.useCallback(fe=>{if(!fe?.fields)return;const ue=fe.fields.find(xe=>!(!Array.isArray(xe.field)||xe.field.length!==2||xe.field[0]!=="body"||xe.field[1]!=="phone"));if(!ue?.code)return;const ye=ue.code,ce=h.signUp.fieldsErrors.phone?.[ye]??"";ce&&y(ce)},[]),ne=l.useCallback(fe=>{if(!fe?.fields)return;const ue=fe.fields.find(xe=>!(!Array.isArray(xe.field)||xe.field.length!==2||xe.field[0]!=="body"||xe.field[1]!=="password"));if(!ue?.code)return;const ye=ue.code,ce=h.signUp.fieldsErrors.password?.[ye]??"";ce&&v(ce)},[]),{mutate:X,isPending:oe}=tt({mutationFn:BG,onSuccess:fe=>{if(!fe.smsSent){const ue=fe.cooldownSeconds??0,ye=Math.ceil(ue/60),ce=Q({minutes:ye});ve({type:"failed",message:`${h.signUp.enterSmsCode.errors.smsNotSent.PREFIX}${ye} ${ce}${h.signUp.enterSmsCode.errors.smsNotSent.SUFFIX}`,key:"SIGN_UP_FAILED"});return}t("/sign-up/sms",{state:{passToken:fe.passToken,phone:o,cooldownSeconds:fe.cooldownSeconds??0,smsCode:fe.smsCode??null,...s?.redirectUrl&&{redirectUrl:s.redirectUrl}}})},onError:fe=>{const ue=fe.code;h.signUp.errors?.[ue]&&ve({type:"failed",message:h.signUp.errors[ue],key:"SIGN_UP_FAILED"}),h.signUp.errors?.[ue]||ve({type:"failed",message:h.signUp.errors.UNKNOW_ERROR,key:"SIGN_UP_FAILED"}),$(fe),J(fe),ne(fe),fe?.code==="ACCOUNT_ALREADY_EXISTS"&&(b(!0),_(!0))}}),ie=l.useCallback(fe=>{if(fe.preventDefault(),N||B(!0),D||z(!0),!!N&&D&&!oe){if(S||w){ve({type:"failed",message:h.signUp.errors.ACCOUNT_ALREADY_EXISTS,key:"SIGN_UP_FAILED"});return}X({email:u.trim(),phone:o.trim(),password:p.trim(),isEmailMarketingConsent:!!L})}},[S,w,oe,u,o,p,X,N,L,D]),ee=l.useCallback(()=>{R(fe=>!fe),B(!1)},[]),te=l.useCallback(()=>{k(fe=>!fe),z(!1)},[]),le=l.useCallback(()=>{O(fe=>!fe)},[]),he=l.useCallback(fe=>{fe.stopPropagation()},[]);return l.useEffect(()=>()=>{Ze("SIGN_UP_SENT"),Ze("SIGN_UP_TRYING"),Ze("SIGN_UP_FAILED")},[]),a.jsxs("div",{className:"w-full bp34_375:w-114 pt-24 bp34_375:pt-20 pb-6 w-114 mx-auto",children:[a.jsxs("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-8"),children:[h.signUp.titles.SIGN_UP,a.jsx("div",{className:"mt-1 bp34_375:mt-2 text-[#556FD5]",children:h.signUp.titles.FREE_TRIAL})]}),a.jsx("form",{onSubmit:ie,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-3",children:a.jsx(jm,{name:"phone",type:"text",autoComplete:"tel",valueRaw:r,valueNormalized:o,placeholder:h.signUp.placeholders.PHONE,isError:!!x||!!w,errorText:w?h.signUp.errors.ACCOUNT_ALREADY_EXISTS:x,isDisabled:oe,onChange:j})}),a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"email",placeholder:h.signUp.placeholders.EMAIL,value:u,handleChange:H,onBlur:q,autoComplete:"email",isError:!!A||!!S,errorText:S?h.signUp.errors.ACCOUNT_ALREADY_EXISTS:A,disabled:oe})}),a.jsx("div",{children:a.jsx(hi,{name:"password",placeholder:h.signUp.placeholders.PASSWORD,type:"password",value:p,handleChange:G,autoComplete:"new-password",isError:!!I,errorText:I,disabled:oe})}),a.jsxs("div",{className:"mt-4",children:[a.jsxs("div",{onClick:ee,className:"flex items-start cursor-pointer pt-2 pb-2",children:[a.jsx("div",{className:Y("flex","items-center","justify-center","h-6","w-6","min-h-6","min-w-6","rounded-[8px]","mr-3",!!P&&"bg-red-200",!!(!P&&N)&&"bg-zinc-900",!P&&!N&&"bg-zinc-200"),children:a.jsx(qr,{className:Y(!N&&"hidden","size-4","text-zinc-50")})}),a.jsxs("div",{children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[12px] leading-[16
866px] text-zinc-500 pt-1",children:[h.signUp.agreements.publicOffer.PREFIX," ",a.jsx(Je,{to:"/documents/offer.pdf",onClick:he,target:"_blank",rel:"noopener noreferrer",className:"roboto-flex-100-400-1 text-[12px] leading-[16px] underline text-zinc-500 hover:text-zinc-600 cursor-pointer",children:h.signUp.agreements.publicOffer.PUBLIC_OFFER})," "]}),!!P&&a.jsx("div",{className:"mt-2 roboto-flex-100-400-1 text-[14px] leading-[16px] text-red-600",children:h.signUp.agreements.ERROR_REQUIRED_TO_SIGN_UP})]})]}),a.jsxs("div",{onClick:te,className:"flex items-start cursor-pointer pt-2 pb-2",children:[a.jsx("div",{className:Y("flex","items-center","justify-center","h-6","w-6","min-h-6","min-w-6","rounded-[8px]","mr-3",!!F&&"bg-red-200",!!(!F&&D)&&"bg-zinc-900",!F&&!D&&"bg-zinc-200"),children:a.jsx(qr,{className:Y(!D&&"hidden","size-4","text-zinc-50")})}),a.jsxs("div",{children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[12px] leading-[16px] text-zinc-500 pt-1",children:[h.signUp.agreements.dataProcessing.PREFIX," ",a.jsx(Je,{to:"/documents/personal-data.pdf",onClick:he,target:"_blank",rel:"noopener noreferrer",className:"roboto-flex-100-400-1 text-[12px] leading-[16px] underline text-zinc-500 hover:text-zinc-600 cursor-pointer",children:h.signUp.agreements.dataProcessing.DATA_PROCESSING})," "]}),!!F&&a.jsx("div",{className:"mt-2 roboto-flex-100-400-1 text-[14px] leading-[16px] text-red-600",children:h.signUp.agreements.ERROR_REQUIRED_TO_SIGN_UP})]})]}),a.jsxs("div",{onClick:le,className:"flex items-start cursor-pointer pt-2 pb-2",children:[a.jsx("div",{className:Y("flex","items-center","justify-center","h-6","w-6","min-h-6","min-w-6","rounded-[8px]","mr-3",!!L&&"bg-zinc-900",!L&&"bg-zinc-200"),children:a.jsx(qr,{className:Y(!L&&"hidden","size-4","text-zinc-50")})}),a.jsx("div",{children:a.jsxs("div",{className:"roboto-flex-100-400-1 text-[12px] leading-[16px] text-zinc-500 pt-1",children:[h.signUp.agreements.marketingCommunications.PREFIX," ",a.jsx(Je,{to:"/documents/expert-materials.pdf",onClick:he,target:"_blank",rel:"noopener noreferrer",className:"roboto-flex-100-400-1 text-[12px] leading-[16px] underline text-zinc-500 hover:text-zinc-600 cursor-pointer",children:h.signUp.agreements.marketingCommunications.MARKETING_COMMUNICATIONS_CONSENT})," ",h.signUp.agreements.marketingCommunications.SUFFIX_EMAIL_AND_PHONE]})})]})]}),a.jsx("div",{className:"mt-6",children:a.jsx(ut,{variant:"h14",isFullWidth:!0,isPending:oe,disabled:oe,type:"submit",children:h.signUp.buttons.SIGN_UP})}),a.jsx("div",{className:"flex justify-center items-center h-13",children:a.jsx(bf,{to:"/sign-in",prefixText:h.signUp.links.ALREADY_HAVE_ACCOUNT,isDisabled:oe,state:e.state,children:h.signUp.links.SIGN_IN})})]})})]})},wde=()=>{const e=Fe(),t=at(),n=e.state,s=n?.passToken??"",r=n?.phone??"",i=n?.cooldownSeconds??0,o=n?.smsCode??null,c=l.useRef(null),u=l.useRef(null),[d,p]=l.useState(""),[g,A]=l.useState(0),[E,x]=l.useState(!1),[y,I]=l.useState(!1),[v,S]=l.useState(!1),[b,w]=l.useState(""),_=Se(W=>W.isUserLoadResolved),N=Se(W=>W.setIsUserLoadResolved),R=Se(W=>W.setAccessToken),D=l.useCallback(({attemptsLeft:W})=>qt({count:W,zero:h.signUp.enterSmsCode.errors.attemptsLeft.ZERO,one:h.signUp.enterSmsCode.errors.attemptsLeft.ONE,many:h.signUp.enterSmsCode.errors.attemptsLeft.MANY}),[]),k=l.useCallback(({minutes:W})=>qt({count:W,zero:h.signUp.enterSmsCode.errors.minutes.ZERO,one:h.signUp.enterSmsCode.errors.minutes.ONE,many:h.signUp.enterSmsCode.errors.minutes.MANY}),[]),L=l.useCallback(W=>{p(W)},[]),O=l.useCallback(({initialSeconds:W})=>{A(W),u.current&&clearInterval(u.current),c.current=Date.now(),u.current=setInterval(()=>{if(c.current===null)return;const H=Math.floor((Date.now()-c.current)/1029),j=W-H;if(j<=0){u.current&&clearInterval(u.current),A(0);return}A(j)},343)},[]),{mutate:P,isPending:B}=tt({mutationFn:UG,onSuccess:W=>{pf({goalId:"success_reg"}),R(W.accessToken),N(!1)},onError:W=>{if(W.code==="INVALID_SMS_CODE"){const H=W.data?.attemptsLeft??0,j=D({attemptsLeft:H});w(`${h.signUp.enterSmsCode.errors.INVALID_CODE} ${H} ${j}`);return}if(W.code==="SMS_ATTEMPTS_EXCEEDED"){I(!0),w(h.signUp.enterSmsCode.errors.ATTEMPTS_EXCEEDED),g>Hf&&x(!0);return}if(W.code==="PASS_TOKEN_EXPIRED"){I(!0),w(h.signUp.enterSmsCode.errors.PASS_TOKEN_EXPIRED);return}if(W.code==="PHONE_ALREADY_CONFIRMED"){S(!0),I(!0),w(h.signUp.enterSmsCode.errors.PHONE_ALREADY_CONFIRMED);return}S(!0),I(!0),w(h.signUp.enterSmsCode.errors.UNKNOW_ERROR)}}),F=l.useCallback(W=>{P({passToken:s,smsCode:W})},[s,P]),z=l.useCallback(({value:W})=>{const H=Ci({smsSent:!0,smsCode:W});if(!H)return;aa({smsCode:H}),p(H),P({passToken:s,smsCode:H});const j=e.state;j&&t(".",{replace:!0,state:{...j,smsCode:null}})},[e.state,t,s,P]),{mutate:Q,isPending:M}=tt({mutationFn:QG,onSuccess:W=>{Ze("SIGN_UP_RESEND_SMS_SENDING");const H=W.smsSent,j=W.cooldownSeconds??0,q=Math.ceil(j/60),G=k({minutes:q});if(!H){ve({type:"failed",message:`${h.signUp.enterSmsCode.errors.resendSmsFailed.PREFIX}${q} ${G}${h.signUp.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"SIGN_UP_RESEND_SMS_FAILED"}),t(".",{replace:!0,state:{...n??{},passToken:W.passToken,cooldownSeconds:W.cooldownSeconds??0,smsCode:null}}),O({initialSeconds:j}),I(!0),S(!1);return}ve({type:"success",message:h.signUp.notifications.SENT,key:"SIGN_UP_RESEND_SMS_SENT"}),t(".",{replace:!0,state:{...n??{},passToken:W.passToken,cooldownSeconds:W.cooldownSeconds??0,smsCode:null}});const J=Ci({smsSent:H,smsCode:W.smsCode});J||p(""),J&&(aa({smsCode:J}),p(J),P({passToken:W.passToken,smsCode:J})),O({initialSeconds:j}),w(""),I(!1),S(!1)},onError:()=>{Ze("SIGN_UP_RESEND_SMS_SENDING"),I(!0),S(!0),w(h.signUp.enterSmsCode.errors.UNKNOW_ERROR)}}),K=l.useCallback(()=>{x(!1),Q({passToken:s}),ve({type:"info",message:h.signUp.notifications.SENDING,key:"SIGN_UP_RESEND_SMS_SENDING"})},[s,Q]);return l.useEffect(()=>{O({initialSeconds:i})},[O,i]),l.useEffect(()=>{z({value:o})},[o,z]),l.useEffect(()=>()=>{S(!1),p(""),A(0),w(""),u.current&&clearInterval(u.current)},[]),!s||!r?a.jsx(Qn,{to:"/sign-up",replace:!0}):a.jsx(Qf,{title:h.signUp.enterSmsCode.TITLE,description:{PREFIX:h.signUp.enterSmsCode.description.PREFIX,SUFFIX:h.signUp.enterSmsCode.description.SUFFIX},phone:r,smsCode:d,onSmsCodeChange:L,isOtpInputDisabled:!_||y,isPending:B||M,counter:g,isAccessTemporarilyRestrictedActive:E,error:b,isError:!!b,isHideResendButton:v,onResendSms:K,onSmsCodeComplete:F})},Rde=()=>{const e=Fe(),t=at(),n=bt(),[s,r]=l.useState(""),[i,o]=l.useState(""),[c,u]=l.useState(!1),{mutate:d}=tt({mutationFn:async({email:S})=>{const b=["getEmailStatus",S],w=n.getQueryData(b);if(w)return w;const _=await II({email:S});return n.setQueryData(b,_),_},onSuccess:S=>{u(!S.isExists)},onError:()=>{u(!0)}}),p=l.useMemo(()=>ol(S=>{if(!hu.test(S)){u(!1);return}d({email:S})},500),[d]),g=l.useCallback(S=>{r(S),o(""),u(!1),p(S.trim())}
866,[p]),A=l.useCallback(()=>{if(!hu.test(s.trim())){u(!1);return}d({email:s.trim()})},[s,d]),E=l.useMemo(()=>c?h.passwordReset.errors.ACCOUNT_NOT_FOUND:"",[c]),x=l.useCallback(S=>{if(!S?.fields)return;const b=S.fields.find(N=>!(!Array.isArray(N.field)||N.field.length!==2||N.field[0]!=="body"||N.field[1]!=="email"));if(!b?.code)return;const w=b.code,_=h.passwordReset.fieldsErrors.email?.[w]??"";_&&o(_)},[]),{mutate:y,isPending:I}=tt({mutationFn:Bk,onSuccess:()=>{t("/forgot-password/sent",{state:{email:s.trim()}})},onError:S=>{Ze("PASSWORD_RESET_SENDING");const b=S.code;ve({type:"failed",message:h.passwordReset.errors?.[b]??h.passwordReset.errors.UNKNOW_ERROR,key:"PASSWORD_RESET_FAILED"}),x(S)}}),v=l.useCallback(S=>{S.preventDefault(),!I&&(ve({type:"pending",message:h.passwordReset.notifications.SENDING,key:"PASSWORD_RESET_SENDING"}),y({email:s.trim()}))},[I,s,y]);return l.useEffect(()=>()=>{Ze("PASSWORD_RESET_SENDING"),Ze("PASSWORD_RESET_SENT"),Ze("PASSWORD_RESET_FAILED")},[]),a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-12"),children:h.passwordReset.titles.PASSWORD_RESTORE}),a.jsx("form",{onSubmit:v,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:h.passwordReset.titles.ENTER_EMAIL}),a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"email",placeholder:h.passwordReset.placeholders.EMAIL,value:s,handleChange:g,onBlur:A,autoComplete:"email",isError:!!i||!!c,errorText:E||i,disabled:I})}),a.jsx("div",{className:"mt-8",children:a.jsx(ut,{variant:"h14",isPending:I,disabled:I,isFullWidth:!0,type:"submit",children:h.passwordReset.buttons.RESTORE_PASSWORD})}),a.jsx("div",{className:"flex justify-center items-center h-13",children:a.jsx(bf,{to:"/sign-in",prefixText:h.passwordReset.links.REMEMBER_PASSWORD,isDisabled:I,state:e.state,children:h.passwordReset.links.SIGN_IN})})]})})]})},$y=60,Dde=()=>{const n=Fe().state?.email??"",s=l.useRef(null),r=l.useRef(null),[i,o]=l.useState($y),{mutate:c,isPending:u}=tt({mutationFn:Bk,onSuccess:()=>{Ze("PASSWORD_RESET_SENDING"),ve({type:"success",message:h.passwordReset.notifications.SENT,key:"PASSWORD_RESET_SENT"}),d()},onError:g=>{Ze("PASSWORD_RESET_SENDING");const A=g.code;ve({type:"failed",message:h.passwordReset.errors?.[A]??h.passwordReset.errors.UNKNOW_ERROR,key:"PASSWORD_RESET_FAILED"}),o(0)}}),d=l.useCallback(()=>{o($y),r.current&&clearInterval(r.current),s.current=Date.now(),r.current=setInterval(()=>{if(s.current===null)return;const g=Math.floor((Date.now()-s.current)/1029),A=$y-g;if(A<=0){r.current&&clearInterval(r.current),o(0);return}o(A)},343)},[]),p=l.useCallback(g=>{g.preventDefault(),!(i>0||u)&&(ve({type:"pending",message:h.passwordReset.notifications.SENDING,key:"PASSWORD_RESET_SENDING"}),c({email:n}))},[i,u,n,c]);return l.useEffect(()=>(d(),()=>{r.current&&clearInterval(r.current)}),[d]),l.useEffect(()=>()=>{Ze("PASSWORD_RESET_SENDING"),Ze("PASSWORD_RESET_SENT"),Ze("PASSWORD_RESET_FAILED")},[]),n?a.jsxs("div",{className:"bp34_375:mt-16 bp34_375:pb-20 max-w-160 mx-auto px-4 flex flex-col flex-1 items-center text-center justify-center",children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5",children:h.passwordReset.titles.VERIFY_EMAIL}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5",children:[h.passwordReset.links.EMAIL_SENT_PREFIX," ",a.jsx(Hs,{to:`mailto:${n}`,className:"underline hover:text-zinc-850 whitespace-nowrap",children:n}),h.passwordReset.links.EMAIL_SENT_SUFFIX]}),a.jsx("div",{className:"mt-4 mb-8",children:a.jsx(bf,{prefixText:h.passwordReset.links.RESEND_EMAIL_PREFIX,isDisabled:i>0||u,onClick:p,children:h.passwordReset.links.RESEND_EMAIL.replace("{time}",i>0?i.toString():"")})})]}):a.jsx(Qn,{to:"/forgot-password",replace:!0})},kde=()=>{const e=Se(S=>S.clearUser),t=Se(S=>S.clearAccessToken),n=Se(S=>S.setAccessToken),s=Se(S=>S.setTokenRedeemSmsState),r=bt(),[i]=F1(),o=i.get("token")??"",c=Sm(),u=Se(S=>S.setIsAppReady),d=Se(S=>S.setIsUserLoadResolved),p=Se(S=>S.setTokenRedeemStatus),g=Se(S=>S.setUser),{data:A,error:E,refetch:x}=Vt({queryKey:["me"],queryFn:dc,enabled:!1,retry:!1});l.useEffect(()=>{if(E){r.setQueryData(["me"],void 0),p("failed"),t(),e({reason:Ao.SIGN_OUT}),u(!0),d(!0);return}A&&(g(A),p("success"),u(!0),d(!0),ve({type:"success",message:h.signIn.notifications.AUTHORIZATION_SUCCESS,key:"TOKEN_REDEEM_AUTH_SUCCESS"}))},[r,A,E,g,p,u,d,e,t]);const y=S=>!S||typeof S!="object"||!("requiresSms"in S)?!1:!!S.requiresSms,{mutate:I}=tt({mutationFn:GG,onSuccess:async S=>{if(y(S)){const w=S;s({requiresSms:!0,passToken:w.passToken??null,cooldownSeconds:w.cooldownSeconds??null,smsSent:w.smsSent??!1,phone:w.phone??null,smsCode:Ci({smsSent:w.smsSent??!1,smsCode:w.smsCode})}),u(!0);return}const b=S?.accessToken;if(!b){ve({type:"failed",message:h.setupNewPassword.errors.TOKEN_REDEEM_FAIL}),p("failed"),u(!0),d(!0);return}n(b),x()},onError:()=>{ve({type:"failed",message:h.setupNewPassword.errors.TOKEN_REDEEM_FAIL}),p("failed"),u(!0),d(!0)}}),{mutate:v}=tt({mutationFn:z1,onSuccess:async()=>{e({reason:Ao.SIGN_OUT}),t(),r.resetQueries({queryKey:["me"],exact:!0}),I({token:o})},onError:()=>{ve({type:"failed",message:h.signOut.errors.SIGN_OUT_ERROR}),u(!0),d(!0)}});l.useEffect(()=>(p(null),()=>{p(null),s({requiresSms:!1,passToken:null,cooldownSeconds:null,smsSent:!1,phone:null,smsCode:null})}),[p,s]),l.useEffect(()=>{if(!Is.getState().initializedKeys.has(o)){if(c(o),o){v();return}x()}},[v,x,o,c])},Ode=()=>{const e=l.useRef(null),t=l.useRef(null),[n,s]=l.useState(""),[r,i]=l.useState(0),[o,c]=l.useState(!1),[u,d]=l.useState(!1),[p,g]=l.useState(!1),[A,E]=l.useState(""),x=Se(F=>F.setAccessToken),y=Se(F=>F.tokenRedeemSmsState),I=Se(F=>F.setTokenRedeemSmsState),{refetch:v}=Vt({queryKey:["me"],queryFn:dc,enabled:!1,retry:!1}),S=l.useCallback(({attemptsLeft:F})=>qt({count:F,zero:h.setupNewPassword.enterSmsCode.errors.ATTEMPTS_LEFT.ZERO,one
866:h.setupNewPassword.enterSmsCode.errors.ATTEMPTS_LEFT.ONE,many:h.setupNewPassword.enterSmsCode.errors.ATTEMPTS_LEFT.MANY}),[]),b=l.useCallback(({minutes:F})=>qt({count:F,zero:h.setupNewPassword.enterSmsCode.errors.minutes.ZERO,one:h.setupNewPassword.enterSmsCode.errors.minutes.ONE,many:h.setupNewPassword.enterSmsCode.errors.minutes.MANY}),[]),w=l.useCallback(({initialSeconds:F})=>{i(F),t.current&&clearInterval(t.current),e.current=Date.now(),t.current=setInterval(()=>{if(e.current===null)return;const z=Math.floor((Date.now()-e.current)/1029),Q=F-z;if(Q<=0){t.current&&clearInterval(t.current),i(0);return}i(Q)},343)},[]),{mutate:_,isPending:N}=tt({mutationFn:WG,onSuccess:async F=>{const z=F.accessToken;z&&(x(z),v())},onError:F=>{if(F.code==="INVALID_SMS_CODE"){const z=F.data?.attemptsLeft??0,Q=S({attemptsLeft:z});E(`${h.setupNewPassword.enterSmsCode.errors.INVALID_CODE} ${z} ${Q}`);return}if(F.code==="SMS_ATTEMPTS_EXCEEDED"){d(!0),E(h.setupNewPassword.enterSmsCode.errors.ATTEMPTS_EXCEEDED),r>Hf&&c(!0);return}if(F.code==="PASS_TOKEN_INVALID"){d(!0),E(h.setupNewPassword.enterSmsCode.errors.PASS_TOKEN_INVALID);return}g(!0),d(!0),E(h.setupNewPassword.enterSmsCode.errors.UNKNOW_ERROR)}}),{mutate:R,isPending:D}=tt({mutationFn:KG,onSuccess:F=>{Ze("TOKEN_REDEEM_RESEND_SMS_SENDING");const z=F.smsSent,Q=F.cooldownSeconds??0,M=Math.ceil(Q/60),K=b({minutes:M});if(!z){ve({type:"failed",message:`${h.setupNewPassword.enterSmsCode.errors.resendSmsFailed.PREFIX}${M} ${K}${h.setupNewPassword.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"TOKEN_REDEEM_RESEND_SMS_FAILED"}),I(H=>({...H,requiresSms:!0,passToken:F.passToken,cooldownSeconds:F.cooldownSeconds??null,smsSent:z,smsCode:Ci({smsSent:z,smsCode:F.smsCode})})),w({initialSeconds:Q}),d(!0),g(!1);return}ve({type:"success",message:h.setupNewPassword.enterSmsCode.notifications.SENT,key:"TOKEN_REDEEM_RESEND_SMS_SENT"});const W=Ci({smsSent:z,smsCode:F.smsCode});W||s(""),I(H=>({...H,requiresSms:!0,passToken:F.passToken,cooldownSeconds:F.cooldownSeconds??null,smsSent:z,smsCode:W})),w({initialSeconds:Q}),E(""),d(!1),g(!1)},onError:F=>{if(Ze("TOKEN_REDEEM_RESEND_SMS_SENDING"),F.code==="COOLDOWN_ACTIVE"){const z=F.data?.retryAfter??0,Q=Math.ceil(z/60),M=b({minutes:Q});ve({type:"failed",message:`${h.setupNewPassword.enterSmsCode.errors.resendSmsFailed.PREFIX}${Q} ${M}${h.setupNewPassword.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"TOKEN_REDEEM_RESEND_SMS_FAILED"}),w({initialSeconds:z}),d(!0),g(!1);return}if(F.code==="PASS_TOKEN_INVALID"){d(!0),g(!0),E(h.setupNewPassword.enterSmsCode.errors.PASS_TOKEN_INVALID);return}d(!0),g(!0),E(h.setupNewPassword.enterSmsCode.errors.UNKNOW_ERROR)}}),k=l.useCallback(F=>{s(F)},[]),L=y.passToken??"",O=y.phone??"",P=l.useCallback(F=>{_({passToken:L,smsCode:F})},[L,_]),B=l.useCallback(()=>{c(!1),R({passToken:L}),ve({type:"info",message:h.setupNewPassword.enterSmsCode.notifications.SENDING,key:"TOKEN_REDEEM_RESEND_SMS_SENDING"})},[L,R]);return l.useEffect(()=>{w({initialSeconds:y.cooldownSeconds??0})},[w,y.cooldownSeconds]),l.useEffect(()=>{const F=y.smsCode,z=y.passToken??"";!F||!z||(I(Q=>Q.smsCode?{...Q,smsCode:null}:Q),aa({smsCode:F}),s(F),_({passToken:z,smsCode:F}))},[y.smsCode,y.passToken,_,I]),l.useEffect(()=>()=>{g(!1),s(""),i(0),E(""),t.current&&clearInterval(t.current)},[]),a.jsx(Qf,{title:h.setupNewPassword.enterSmsCode.TITLE,description:{PREFIX:h.setupNewPassword.enterSmsCode.description.PREFIX,SUFFIX:h.setupNewPassword.enterSmsCode.description.SUFFIX},phone:O,smsCode:n,onSmsCodeChange:k,isOtpInputDisabled:u,isPending:N||D,counter:r,isAccessTemporarilyRestrictedActive:o,error:A,isError:!!A,isHideResendButton:p,onResendSms:B,onSmsCodeComplete:P})},Pde=()=>{kde();const e=Se(n=>n.tokenRedeemSmsState);return!!e.requiresSms&&!!e.passToken?a.jsx(Ode,{}):null},Lde=()=>{const[e]=F1(),t=e.get("token")??"",n=Se(k=>k.clearUser),s=Se(k=>k.clearAccessToken),r=Sm(),i=lte(),o=bt(),c=Se(k=>k.setIsAppReady),u=Se(k=>k.setIsUserLoadResolved),d=at(),p=l.useCallback(({minutes:k})=>qt({count:k,zero:h.changePhone.enterSmsCode.errors.minutes.ZERO,one:h.changePhone.enterSmsCode.errors.minutes.ONE,many:h.changePhone.enterSmsCode.errors.minutes.MANY}),[]),[g,A]=l.useState(null),[E,x]=l.useState(""),[y,I]=l.useState(""),[v,S]=l.useState(""),{mutate:b}=tt({mutationFn:$G,onSuccess:k=>{A(k.passToken),c(!0),u(!0)},onError:()=>{c(!0),u(!0),ve({type:"failed",message:h.setupNewPhone.errors.TOKEN_REDEEM_FAIL}),d("/sign-in",{replace:!0})}}),{mutate:w}=tt({mutationFn:z1,onSuccess:()=>{n({reason:Ao.SIGN_OUT}),s(),o.resetQueries({queryKey:["me"],exact:!0}),b({confirmationToken:t})},onError:()=>{ve({type:"failed",message:h.signOut.errors.SIGN_OUT_ERROR}),c(!0),u(!0)}}),{mutate:_,isPending:N}=tt({mutationFn:YG,onSuccess:(k,L)=>{if(A(k.passToken),!k.smsSent){const O=k.cooldownSeconds??0,P=Math.ceil(O/60),B=p({minutes:P});ve({type:"failed",message:`${h.changePhone.enterSmsCode.errors.resendSmsFailed.PREFIX}${P} ${B}${h.changePhone.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"PHONE_CHANGE_SEND_SMS_COOLDOWN"});return}d("/setup-new-phone/sms",{state:{passToken:k.passToken,phone:L.phone??"",cooldownSeconds:k.cooldownSeconds??0,smsCode:k.smsCode??null}})},onError:k=>{const L=k.code;if(L==="SAME_PHONE_ERROR"){S(h.changePhone.newPhoneNumber.errors.SAME_PHONE_ERROR);return}if(L==="PHONE_ALREADY_TAKEN"){S(h.changePhone.newPhoneNumber.errors.PHONE_ALREADY_TAKEN);return}S(h.setupNewPhone.errors.PHONE_INVALID)}});l.useEffect(()=>
866{Is.getState().initializedKeys.has(t)||(r(t),w())},[t,w,r]),l.useEffect(()=>()=>{i(t)},[t,i]);const R=k=>{k.preventDefault();const L=of({value:E});if(!L){S(h.setupNewPhone.errors.PHONE_INVALID);return}S(""),_({passToken:g??"",phone:L})},D=k=>{x(k.rawValue),I(k.normalizedValue),S("")};return g?a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase justify-start items-start mb-8 mx-4 bp34_375:mb-12",children:h.changePhone.newPhoneNumber.TITLE}),a.jsx("form",{onSubmit:R,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:h.changePhone.newPhoneNumber.DESCRIPTION}),a.jsx(jm,{name:"phone",type:"text",autoComplete:"tel",valueRaw:E,valueNormalized:y,placeholder:h.changePhone.newPhoneNumber.placeholders.PHONE,isError:!!v,errorText:v,isDisabled:N,onChange:D}),a.jsx(ut,{variant:"h14",className:"mt-8",isPending:N,disabled:N,isFullWidth:!0,type:"submit",children:h.changePhone.newPhoneNumber.buttons.CONFIRM})]})})]}):null},Mde=()=>{const e=Fe(),t=e.state,n=at(),s=t?.passToken??"",r=t?.phone??"",i=t?.cooldownSeconds??0,o=t?.smsCode??null,[c,u]=l.useState(s),d=l.useRef(null),p=l.useRef(null),[g,A]=l.useState(""),[E,x]=l.useState(0),[y,I]=l.useState(!1),[v,S]=l.useState(!1),[b,w]=l.useState(!1),[_,N]=l.useState(""),R=Se($=>$.setUser),D=Se($=>$.setAccessToken),k=Se($=>$.setIsAppReady),L=Se($=>$.setIsUserLoadResolved),O=Se($=>$.isUserLoadResolved),P=bt(),B=l.useCallback(({attemptsLeft:$})=>qt({count:$,zero:h.changePhone.enterSmsCode.errors.ATTEMPTS_LEFT.ZERO,one:h.changePhone.enterSmsCode.errors.ATTEMPTS_LEFT.ONE,many:h.changePhone.enterSmsCode.errors.ATTEMPTS_LEFT.MANY}),[]),F=l.useCallback(({minutes:$})=>qt({count:$,zero:h.changePhone.enterSmsCode.errors.minutes.ZERO,one:h.changePhone.enterSmsCode.errors.minutes.ONE,many:h.changePhone.enterSmsCode.errors.minutes.MANY}),[]),z=l.useCallback(({initialSeconds:$})=>{x($),p.current&&clearInterval(p.current),d.current=Date.now(),p.current=setInterval(()=>{if(d.current===null)return;const J=Math.floor((Date.now()-d.current)/1029),ne=$-J;if(ne<=0){p.current&&clearInterval(p.current),x(0);return}x(ne)},343)},[]),{mutate:Q,isPending:M}=tt({mutationFn:XG,onSuccess:async $=>{const J=$.accessToken??$.access_token;if(!J)return;D(J),L(!1);const ne=await dc();R(ne),k(!0),L(!0),P.invalidateQueries({queryKey:["me"]}),ve({type:"success",message:h.changePhone.enterSmsCode.notifications.PHONE_CHANGED}),n("/profile")},onError:$=>{if($.code==="INVALID_SMS_CODE"){const J=$.data?.attemptsLeft??0,ne=B({attemptsLeft:J});N(`${h.changePhone.enterSmsCode.errors.INVALID_CODE} ${J} ${ne}`);return}if($.code==="SMS_ATTEMPTS_EXCEEDED"){S(!0),N(h.changePhone.enterSmsCode.errors.ATTEMPTS_EXCEEDED),E>Hf&&I(!0);return}w(!0),S(!0),N(h.changePhone.enterSmsCode.errors.UNKNOW_ERROR)}}),{mutate:K,isPending:W}=tt({mutationFn:JG,onSuccess:$=>{Ze("PHONE_CHANGE_RESEND_SMS_SENDING");const J=$.smsSent,ne=$.cooldownSeconds??0,X=Math.ceil(ne/60),oe=F({minutes:X});if(!J){ve({type:"failed",message:`${h.changePhone.enterSmsCode.errors.resendSmsFailed.PREFIX}${X} ${oe}${h.changePhone.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"PHONE_CHANGE_RESEND_SMS_FAILED"}),u($.passToken);const te=e.state;n(".",{replace:!0,state:{...te??{},passToken:$.passToken,cooldownSeconds:$.cooldownSeconds??0,smsCode:null}}),z({initialSeconds:ne}),S(!0),w(!1);return}ve({type:"success",message:h.changePhone.checkEmail.notifications.SENT,key:"PHONE_CHANGE_RESEND_SMS_SENT"});const ie=Ci({smsSent:J,smsCode:$.smsCode});ie||A(""),ie&&(aa({smsCode:ie}),A(ie),Q({passToken:$.passToken,smsCode:ie})),u($.passToken);const ee=e.state;n(".",{replace:!0,state:{...ee??{},passToken:$.passToken,cooldownSeconds:$.cooldownSeconds??0,smsCode:null}}),z({initialSeconds:ne}),N(""),S(!1),w(!1)},onError:()=>{Ze("PHONE_CHANGE_RESEND_SMS_SENDING"),ve({type:"failed",message:h.changePhone.enterSmsCode.errors.RESEND_SMS_FAILED,key:"PHONE_CHANGE_RESEND_SMS_FAILED"}),w(!0),N(h.changePhone.enterSmsCode.errors.UNKNOW_ERROR)}}),H=l.useCallback(({value:$})=>{const J=Ci({smsSent:!0,smsCode:$});if(!J)return;aa({smsCode:J}),A(J),Q({passToken:c,smsCode:J});const ne=e.state;ne&&n(".",{replace:!0,state:{...ne,passToken:c,smsCode:null}})},[Q,e.state,n,c]),j=l.useCallback($=>{A($)},[]),q=l.useCallback($=>{Q({passToken:c,smsCode:$})},[c,Q]),G=l.useCallback(()=>{I(!1),K({passToken:c}),ve({type:"info",message:h.changePhone.checkEmail.notifications.SENDING,key:"PHONE_CHANGE_RESEND_SMS_SENDING"})},[c,K]);return l.useEffect(()=>{z({initialSeconds:i})},[z,i]),l.useEffect(()=>{H({value:o})},[o,H]),l.useEffect(()=>()=>
866{w(!1),A(""),x(0),N(""),p.current&&clearInterval(p.current)},[]),!s||!r?a.jsx(Qn,{to:"/setup-new-phone",replace:!0}):a.jsx(Qf,{title:h.changePhone.enterSmsCode.TITLE,description:{PREFIX:h.changePhone.enterSmsCode.description.PREFIX,SUFFIX:h.changePhone.enterSmsCode.description.SUFFIX},phone:r,smsCode:g,onSmsCodeChange:j,isOtpInputDisabled:!O||v,isPending:M||W,counter:E,isAccessTemporarilyRestrictedActive:y,error:_,isError:!!_,isHideResendButton:b,onResendSms:G,onSmsCodeComplete:q})},jde=()=>{const e=at(),t=Se(x=>x.user),[n,s]=l.useState(""),[r,i]=l.useState(""),o=l.useMemo(()=>t?.access?.hasFullAccess||t?.access?.isPaidActive||t?.access?.isTrialActive?"/clients":"/profile/subscription",[t]),c=l.useCallback(x=>{if(!x?.fields)return;const y=x.fields.find(S=>!(!Array.isArray(S.field)||S.field.length!==2||S.field[0]!=="body"||S.field[1]!=="password"));if(!y?.code)return;const I=y.code,v=h.setupNewPassword.fieldsErrors.password?.[I]??"";v&&i(v)},[]),{mutate:u,isPending:d}=tt({mutationFn:sq,onSuccess:()=>{ve({type:"success",message:h.setupNewPassword.notifications.SAVED,key:"PASSWORD_SET_SAVED"}),e(o)},onError:x=>{Ze("PASSWORD_SET_SENDING");const y=x.code;h.setupNewPassword.errors?.[y]&&ve({type:"failed",message:h.setupNewPassword.errors[y],key:"PASSWORD_SET_FAILED"}),h.setupNewPassword.errors?.[y]||ve({type:"failed",message:h.setupNewPassword.errors.UNKNOW_ERROR,key:"PASSWORD_SET_FAILED"}),c(x)}}),p=l.useMemo(()=>d,[d]),g=l.useMemo(()=>!!p,[p]),A=l.useCallback(x=>{s(x),i("")},[]),E=l.useCallback(x=>{x.preventDefault(),!g&&u({password:n.trim()})},[g,n,u]);return l.useEffect(()=>()=>{Ze("PASSWORD_SET_FAILED")},[]),a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-12"),children:h.passwordReset.titles.PASSWORD_CHANGING}),a.jsx("form",{onSubmit:E,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:h.setupNewPassword.titles.CREATE_NEW_PASSWORD}),a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"password",placeholder:h.setupNewPassword.placeholders.PASSWORD,value:n,handleChange:A,autoComplete:"new-password",type:"password",isError:!!r,errorText:r,disabled:p})}),a.jsx("div",{className:"mt-8",children:a.jsx(ut,{variant:"h14",isPending:p,disabled:g,isFullWidth:!0,type:"submit",children:h.setupNewPassword.buttons.SAVE_PASSWORD})})]})})]})};function YA({value:e}){return e==="first-instance"||e==="second-instance"}function LP({pathname:e}){const t=e.split("/");if(t[1]!=="clients")return null;const n=t[2];if(!n||t[3]!=="cases")return null;const s=t[4];if(!s)return null;if(!YA({value:s}))return n;const r=t[5];if(!r)return null;if(r==="saved")return t[6]?n:null;const i=t[6];return i?YA({value:i})?null:n:null}const Vw=()=>{const e=Fe(),t=l.useMemo(()=>LP({pathname:e.pathname}),[e.pathname]);return t?a.jsx(ia,{type:Gr.PRACTICE_NOT_FOUND,to:`/clients/${t}/cases`}):a.jsx(ia,{})},Cs=({isJustifyBetween:e=!0,isWaitingForAppReady:t=!0,isModal:n=!1,isFullscreen:s=!1,background:r="white",isMainFillViewportHe
866ight:i=!1})=>{const o=l.useRef(null),u=!!Se(A=>A.isAppReady)||!t,d=sn(A=>A.isMenuOpen),p=sn(A=>A.isSearchOpen),g=Is(A=>A.isModalDebugInfoVisible);return a.jsxs("div",{ref:o,className:Y("min-h-screen-dynamic",!s&&!n&&"relative",!!(s&&!n)&&Y("fixed","top-0","left-0","w-full","min-w-[var(--breakpoint-bp23_25)]","h-full","z-20",r==="zinc50"&&"bg-zinc-50",r!=="zinc50"&&"bg-white","overflow-x-hidden","overflow-y-auto","scrollbar-gutter-stable",!!(d||p)&&"overflow-y-hidden"),!!(!s&&n)&&Y("fixed","top-0","left-0","w-full","min-w-[var(--breakpoint-bp23_25)]","h-full","z-20","overflow-x-hidden","overflow-y-auto","scrollbar-gutter-stable")),children:[a.jsx("main",{className:Y("max-w-360","mx-auto","flex","flex-col","min-h-screen-dynamic",!!(s&&!n&&i)&&"h-full min-h-0",!!e&&Y("justify-between","bp34_375:justify-start")),children:!!u&&a.jsx(Xi,{context:{mainWrapperRef:o}})}),!!u&&!!n&&!!g&&a.jsx("div",{className:"pointer-events-none absolute top-0 right-0 left-0 z-22 h-14",children:a.jsx("div",{className:"relative mx-auto h-full w-full max-w-360",children:a.jsx(a2,{variant:"modal"})})})]})},Hl=()=>{const{mainWrapperRef:e}=zt();return a.jsxs(a.Fragment,{children:[a.jsx(Kh,{}),a.jsx(Xi,{context:{mainWrapperRef:e}})]})},Bde=({onConfirmed:e,isFetching:t})=>{const n=l.useRef(null),s=l.useRef(null),[r,i]=l.useState(""),[o,c]=l.useState(0),[u,d]=l.useState(!1),[p,g]=l.useState(!1),[A,E]=l.useState(!1),[x,y]=l.useState(""),I=Se(z=>z.setIsUserLoadResolved),v=Se(z=>z.setAccessToken),S=Se(z=>z.setEmailConfirmationStatus),b=Se(z=>z.emailConfirmSmsState),w=Se(z=>z.setEmailConfirmSmsState),_=l.useCallback(({minutes:z})=>qt({count:z,zero:h.confirmEmail.enterSmsCode.errors.minutes.ZERO,one:h.confirmEmail.enterSmsCode.errors.minutes.ONE,many:h.confirmEmail.enterSmsCode.errors.minutes.MANY}),[]),N=l.useCallback(({attemptsLeft:z})=>qt({count:z,zero:h.confirmEmail.enterSmsCode.errors.attemptsLeft.ZERO,one:h.confirmEmail.enterSmsCode.errors.attemptsLeft.ONE,many:h.confirmEmail.enterSmsCode.errors.attemptsLeft.MANY}),[]),R=l.useCallback(z=>{i(z)},[]),D=l.useCallback(({initialSeconds:z})=>{c(z),s.current&&clearInterval(s.current),n.current=Date.now(),s.current=setInterval(()=>{if(n.current===null)return;const Q=Math.floor((Date.now()-n.current)/1029),M=z-Q;if(M<=0){s.current&&clearInterval(s.current),c(0);return}c(M)},343)},[]),{mutate:k,isPending:L}=tt({mutationFn:qG,onSuccess:z=>{v(z.accessToken),S("success"),I(!1),ve({type:"success",message:h.confirmEmail.notifications.CONFIRM_EMAIL_SUCCESS}),e()},onError:z=>{if(z.code==="INVALID_SMS_CODE"){const Q=z.data?.attemptsLeft??0,M=N({attemptsLeft:Q});y(`${h.confirmEmail.enterSmsCode.errors.INVALID_CODE} ${Q} ${M}`);return}if(z.code==="SMS_ATTEMPTS_EXCEEDED"){g(!0),y(h.confirmEmail.enterSmsCode.errors.ATTEMPTS_EXCEEDED),o>Hf&&d(!0);return}if(z.code==="PASS_TOKEN_EXPIRED"){g(!0),y(h.confirmEmail.enterSmsCode.errors.PASS_TOKEN_EXPIRED);return}E(!0),g(!0),y(h.confirmEmail.enterSmsCode.errors.UNKNOW_ERROR)}}),O=l.useCallback(z=>{k({passToken:b.passToken??"",smsCode:z})},[k,b.passToken]),{mutate:P,isPending:B}=tt({mutationFn:VG,onSuccess:z=>{Ze("CONFIRM_EMAIL_RESEND_SMS_SENDING");const Q=z.smsSent,M=z.cooldownSeconds??0,K=Math.ceil(M/60),W=_({minutes:K});if(w(H=>({...H,requiresSms:!0,passToken:z.passToken,cooldownSeconds:z.cooldownSeconds??null,smsSent:z.smsSent,smsCode:Ci({smsSent:z.smsSent,smsCode:z.smsCode})})),!Q){ve({type:"failed",message:`${h.confirmEmail.enterSmsCode.errors.resendSmsFailed.PREFIX}${K} ${W}${h.confirmEmail.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"CONFIRM_EMAIL_RESEND_SMS_FAILED"}),D({initialSeconds:M}),g(!1),E(!1);return}ve({type:"success",message:h.confirmEmail.notifications.SENT,key:"CONFIRM_EMAIL_RESEND_SMS_SENT"}),D({initialSeconds:M}),g(!1),E(!1)},onError:()=>{Ze("CONFIRM_EMAIL_RESEND_SMS_SENDING"),g(!0),E(!0),y(h.confirmEmail.enterSmsCode.errors.UNKNOW_ERROR)}}),F=l.useCallback(()=>{d(!1),P({passToken:b.passToken??""}),ve({type:"info",message:h.confirmEmail.notifications.SENDING,key:"CONFIRM_EMAIL_RESEND_SMS_SENDING"})},[P,b.passToken]);return l.useEffect(()=>{D({initialSeconds:b.cooldownSeconds??0})},[b.cooldownSeconds,D]),l.useEffect(()=>{const z=b.smsCode,Q=b.passToken??"";!z||!Q||(w(M=>M.smsCode?{...M,smsCode:null}:M),aa({smsCode:z}),i(z),k({passToken:Q,smsCode:z}))},[b.smsCode,b.passToken,k,w]),l.useEffect(()=>()=>{E(!1),i(""),c(0),y(""),s.current&&clearInterval(s.current)},[]),a.jsx(Qf,{title:h.confirmEmail.enterSmsCode.TITLE,description:{PREFIX:h.confirmEmail.enterSmsCode.description.PREFIX,SUFFIX:h.confirmEmail.enterSmsCode.description.SUFFIX},phone:b.phone??"",smsCode:r,onSmsCodeChange:R,isOtpInputDisabled:p||t,isPending:L||B,counter:o,isAccessTemporarilyRestrictedActive:u,error:x,isError:!!x,isHideResendButton:A,onResendSms:F,onSmsCodeComplete:O})},Fde=()=>{const e=Fe(),t=l.useRef(e),n=Se(R=>R.clearUser),s=Se(R=>R.clearAccessToken),r=bt(),[i]=F1(),o=i.get("token")??"",c=Se(R=>R.setIsAppReady),u=Se(R=>
866R.setAccessToken),d=Se(R=>R.setIsUserLoadResolved),p=Se(R=>R.setEmailConfirmationStatus),g=Se(R=>R.setEmailConfirmSmsState),A=Se(R=>R.emailConfirmSmsState),E=Se(R=>R.setUser),x=Sm(),y=l.useCallback(R=>!!(R&&"requiresSms"in R&&R?.requiresSms),[]),{data:I,error:v,isFetching:S,refetch:b}=Vt({queryKey:["me"],queryFn:dc,enabled:!1,retry:!1});l.useEffect(()=>{if((t.current.pathname.replace(/\/+$/,"")||"/")==="/confirm-email"){if(v){r.setQueryData(["me"],void 0),s(),n({reason:Ao.SIGN_OUT}),c(!0),d(!0);return}I&&(E(I),c(!0),d(!0),ve({type:"success",message:h.signIn.notifications.AUTHORIZATION_SUCCESS}))}},[r,I,v,E,c,d,n,s]);const{mutate:w}=tt({mutationFn:HG,onSuccess:async R=>{if(y(R)){g({requiresSms:!0,passToken:R.passToken,cooldownSeconds:R.cooldownSeconds??null,smsSent:R.smsSent,phone:R.phone,smsCode:Ci({smsSent:R.smsSent,smsCode:R.smsCode})});return}"accessToken"in R&&R.accessToken&&u(R.accessToken),ve({type:"success",message:h.confirmEmail.notifications.CONFIRM_EMAIL_SUCCESS}),p("success"),b()},onError:()=>{ve({type:"failed",message:h.confirmEmail.errors.CONFIRM_EMAIL_FAIL}),p("failed"),c(!0),d(!0)}}),{mutate:_}=tt({mutationFn:z1,onSuccess:async()=>{n({reason:Ao.SIGN_OUT}),s(),r.resetQueries({queryKey:["me"],exact:!0}),w({token:o})},onError:()=>{ve({type:"failed",message:h.signOut.errors.SIGN_OUT_ERROR}),c(!0),d(!0)}});return l.useEffect(()=>{t.current=e},[e]),l.useEffect(()=>{(t.current.pathname.replace(/\/+$/,"")||"/")==="/confirm-email"&&(Is.getState().initializedKeys.has(o)||(x(o),_()))},[o,_,x]),!!A.requiresSms&&!!A.passToken?a.jsx(Bde,{onConfirmed:b,isFetching:S}):null},Ude=()=>{const e=at(),[t,n]=Oe.useState(""),[s,r]=Oe.useState(""),[i,o]=Oe.useState(""),[c,u]=Oe.useState(""),[d,p]=Oe.useState(""),[g,A]=Oe.useState(""),[E,x]=Oe.useState(""),[y,I]=Oe.useState(!1),[v,S]=Oe.useState(!1),[b,w]=Oe.useState(!1),_=l.useCallback(H=>{if(!H?.fields)return;const j=H.fields.find($=>!(!Array.isArray($.field)||$.field.length!==2||$.field[0]!=="body"||$.field[1]!=="email"));if(!j?.code)return;const q=j.code,G=h.bookDemo.fieldsErrors.email?.[q]??h.bookDemo.fieldsErrors.email.VALUE_ERROR;A(G)},[]),N=l.useCallback(H=>{if(!H?.fields)return;const j=H.fields.find($=>!(!Array.isArray($.field)||$.field.length!==2||$.field[0]!=="body"||$.field[1]!=="phone"));if(!j?.code)return;const q=j.code,G=h.bookDemo.fieldsErrors.phone?.[q]??h.bookDemo.fieldsErrors.phone.VALUE_ERROR;x(G)},[]),R=l.useCallback(H=>{if(!H?.fields)return;const j=H.fields.find($=>!(!Array.isArray($.field)||$.field.length!==2||$.field[0]!=="body"||$.field[1]!=="name"));if(!j?.code)return;const q=j.code,G=h.bookDemo.fieldsErrors.name?.[q]??h.bookDemo.fieldsErrors.name.VALUE_ERROR;p(G)},[]),{mutate:D,isPending:k}=tt({mutationFn:FG,onSuccess:(H,j)=>{pf({goalId:"book_demo_success"}),e("/book-demo-success",{state:{phone:j.phone}})},onError:H=>{const j=H.code;h.bookDemo.errors?.[j]&&ve({type:"failed",message:h.bookDemo.errors[j],key:"BOOK_DEMO_FAILED"}),h.bookDemo.errors?.[j]||ve({type:"failed",message:h.bookDemo.errors.UNKNOW_ERROR,key:"BOOK_DEMO_FAILED"}),R(H),_(H),N(H)}}),L=l.useCallback(H=>{n(H),p("")},[]),O=l.useCallback(({rawValue:H,normalizedValue:j})=>{r(H),o(j),x("")},[]),P=l.useCallback(H=>{u(H),A("")},[]),B=l.useCallback(()=>{I(H=>!H),w(!1)},[]),F=l.useCallback(()=>{S(H=>!H)},[]),z=l.useCallback(H=>{H.stopPropagation()},[]),Q=l.useCallback(({value:H})=>H?"":h.bookDemo.fieldsErrors.name.REQUIRED,[]),M=l.useCallback(({rawValue:H,normalizedValue:j})=>H.replace(/\D+/g,"")?j?"":h.bookDemo.fieldsErrors.phone.VALUE_ERROR:h.bookDemo.fieldsErrors.phone.REQUIRED,[]),K=l.useCallback(({value:H})=>H?hu.test(H)?"":h.bookDemo.fieldsErrors.email.VALUE_ERROR:h.bookDemo.fieldsErrors.email.REQUIRED,[]),W=l.useCallback(H=>{if(H.preventDefault(),k)return;const j=t.trim(),q=c.trim(),G=of({value:s}),$=Q({value:j}),J=M({rawValue:s,normalizedValue:G}),ne=K({value:q}),X=!y;p($),x(J),A(ne),w(X),!($||J||ne||X)&&D({name:j,phone:G,email:q,isMarketingConsent:!!v})},[y,k,D,t,s,c,v,Q,M,K]);return a.jsxs("div",{className:"w-full bp34_375:w-114 pt-24 bp34_375:pt-20 pb-6 mx-auto",children:[a.jsxs("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","mb-8","mx-4"),children:[h.bookDemo.titles.BOOK_DEMO,a.jsx("div",{className:"mt-1 bp34_375:mt-2 text-[#556FD5]",children:h.bookDemo.titles.SHOW_SYSTEM})]}),a.jsx("form",{onSubmit:W,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"fullName",placeholder:h.bookDemo.placeholders.FULL_NAME,value:t,handleChange:L,autoComplete:"name",isError:!!d,errorText:d,disabled:k})}),a.jsx("div",{className:"mb-3",children:a.jsx(jm,{name:"phone",type:"text",autoComplete:"tel",valueRaw:s,valueNormalized:i,placeholder:h.bookDemo.placeholders.PHONE,isError:!!E,errorText:E,isDisabled:k,onChange:O})}),a.jsx("div",{children:a.jsx(hi,{name:"email",placeholder:h.bookDemo.placeholders.EMAIL,value:c,handleChange:P,autoComplete:"email",isError:!!g,errorText:g,disabled:k})}),a.jsxs("div",{className:"mt-4",children:[a.jsxs("div",{onClick:B,className:"flex items-start cursor-pointer pt-2 pb-2",children:[a.jsx("div",{className:Y("flex","items-center","justify-center","h-6","w-6","min-h-6","min-w-6","rounded-[8px]","mr-3",!!b&&"bg-red-200",!!(!b&&y)&&"bg-zinc-900",!b&&!y&&"bg-zinc-200"),children:a.jsx(qr,{className:Y(!y&&"hidden","size-4","text-zinc-50")})}),a.jsxs("div",{children:[a.jsxs("div",{className:"roboto-flex-100-400-1 text-[12px] leading-[16
866px] text-zinc-500 pt-1",children:[h.bookDemo.agreements.dataProcessing.PREFIX," ",a.jsx(Je,{to:"/documents/personal-data.pdf",onClick:z,target:"_blank",rel:"noopener noreferrer",className:"roboto-flex-100-400-1 text-[12px] leading-[16px] underline text-zinc-500 hover:text-zinc-600 cursor-pointer",children:h.bookDemo.agreements.dataProcessing.DATA_PROCESSING})]}),!!b&&a.jsx("div",{className:"mt-2 roboto-flex-100-400-1 text-[14px] leading-[16px] text-red-600",children:h.bookDemo.agreements.ERROR_REQUIRED})]})]}),a.jsxs("div",{onClick:F,className:"flex items-start cursor-pointer pt-2 pb-2",children:[a.jsx("div",{className:Y("flex","items-center","justify-center","h-6","w-6","min-h-6","min-w-6","rounded-[8px]","mr-3",!!v&&"bg-zinc-900",!v&&"bg-zinc-200"),children:a.jsx(qr,{className:Y(!v&&"hidden","size-4","text-zinc-50")})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[12px] leading-[16px] text-zinc-500 pt-1",children:h.bookDemo.agreements.marketing.TEXT})]})]}),a.jsx("div",{className:"mt-7",children:a.jsx(ut,{variant:"h14",isFullWidth:!0,type:"submit",isPending:k,disabled:k,children:h.bookDemo.buttons.SUBMIT})})]})})]})},zde=()=>{const e=Se(i=>i.user),t=Fe(),n=l.useMemo(()=>!pt(t.state)||typeof t.state.phone!="string"?"":t.state.phone,[t.state]),s=l.useMemo(()=>mu({value:n}),[n]),r=l.useMemo(()=>!e?.id,[e?.id]);return n?a.jsxs("div",{className:"bp34_375:mt-16 bp34_375:pb-20 max-w-160 mx-auto px-4 flex flex-col flex-1 items-center text-center justify-center",children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5",children:h.bookDemo.success.TITLE}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-base leading-[20px] text-zinc-950 mt-1.5",children:[h.bookDemo.success.description.PREFIX," ",a.jsx("span",{className:"whitespace-nowrap",children:s})," ",h.bookDemo.success.description.SUFFIX,!!r&&a.jsxs(a.Fragment,{children:[a.jsx("br",{}),a.jsx("br",{}),h.bookDemo.success.description.WAITING_HINT]})]}),a.jsxs("div",{className:"mt-8 flex w-full max-w-114 flex-col items-stretch gap-2 bp34_375:flex-row bp34_375:flex-nowrap bp34_375:items-center bp34_375:justify-center",children:[a.jsx(ut,{variant:r?"h16inverse":"h16",asChild:!0,className:"w-full bp34_375:w-auto bp34_375:shrink-0",children:a.jsx(Je,{to:"/",children:h.bookDemo.buttons.BACK_TO_SITE})}),!!r&&a.jsx(ut,{variant:"h16",asChild:!0,className:"w-full bp34_375:w-auto bp34_375:shrink-0",children:a.jsx(Je,{to:"/sign-up",children:h.bookDemo.buttons.REGISTER})})]})]}):a.jsx(Qn,{to:"/book-demo",replace:!0})},Qde=()=>{const e=Fe(),{user:t}=Se(R=>R),n=l.useRef(null),s=l.useRef(null),r=l.useRef({}),i=l.useRef(!1),[o,c]=Yh(),[u,d]=Yh(),p=fE("(any-pointer: coarse), (hover: none)",!1),g=l.useMemo(()=>Lv({user:t}),[t]),A=l.useMemo(()=>!!(p||typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0),[p]),E=l.useMemo(()=>!!e.pathname.startsWith("/profile/subscription"),[e.pathname]),x=l.useCallback(R=>{n.current=R,R&&o(R)},[o]),y=l.useCallback(R=>{s.current=R,R&&u(R)},[u]),I=l.useCallback(({path:R})=>D=>{r.current[R]=D},[]),v=l.useCallback(()=>{const R=Object.keys(r.current);if(!R.length)return null;const D=R.reduce((k,L)=>e.pathname.startsWith(L)&&(!k||L.length>k.length)?L:k,null);return D?r.current[D]:null},[e.pathname]),S=l.useMemo(()=>{const R=c.width??0;return(d.width??0)>R+1},[c.width,d.width]),b=l.useCallback(()=>{const R=n.current;if(!R)return;const D=v();if(!D)return;const k=R.clientWidth;if(!k)return;const L=D.offsetLeft,O=L+D.offsetWidth,P=R.scrollLeft,B=P+k;if(L<P){R.scrollTo({left:L});return}O>B&&R.scrollTo({left:O-k})},[v]),w=l.useCallback(()=>{if(A){b();return}},[b,A]);l.useLayoutEffect(()=>{i.current||(w(),i.current=!0)},[w,c.width,d.width,e.pathname]);const _=l.useMemo(()=>A?Y("relative","w-full","mt-8","px-4",S?"overflow-x-auto":"overflow-x-hidden","overflow-y-hidden","touch-auto","scrollbar-none"):Y("relative","w-full","mt-8","px-4","overflow-hidden","touch-pan-y"),[S,A]),N=l.useMemo(()=>A?{WebkitOverflowScrolling:"touch"}:{},[A]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:x,className:_,style:N,children:a.jsxs("div",{ref:y,className:"flex flex-nowrap items-start justify-start w-max",children:[!g&&a.jsx(Je,{ref:I({path:"/clients"}),to:"/clients",end:!0,className:({isActive:R})=>Y("h-8","w-11","pr-3","flex","items-center","justify-center","roboto-flex-25-700-1","text-[24px]","leading-[32px]",!!R&&"text-zinc-950",!R&&"text-zinc-400 hover:text-zinc-500"),children:a.jsx(nE,{className:"w-4 h-4"})}),a.jsx(Je,{to:"/profile",end:!0,className:({isActive:R})=>Y("roboto-flex-25-700-1","text-[24px]","leading-[32px]","uppercase","justify-start","items-start","whitespace-nowrap",!!R&&"text-zinc-950",!R&&"text-zinc-400 hover:text-zinc-500"),children:h.profile.titles.PROFILE}),a.jsx(Je,{to:"/profile/subscription",end:!0,ref:I({path:"/profile/subscription"}),className:({isActive:R})=>Y("roboto-flex-25-700-1","pl-4","text-[24px]","leading-[32px]","uppercase","justify-start","items-start","whitespace-nowrap",!!R&&"text-zinc-950",!R&&"text-zinc-400 hover:text-zinc-500"),children:h.profile.titles.SUBSCRIPTION}),a.jsx(Je,{to:"/profile/payment-history",end:!0,ref:I({path:"/profile/payment-history"}),className:({isActive:R})=>Y("roboto-flex-25-700-1","pl-4","text-[24px]","leading-[32px]","uppercase","justify-start","items-start","whitespace-nowrap",!!R&&"text-zinc-950",!R&&"text-zinc-400 hover:text-zinc-500"),children:h.profile.titles.PAYMENT_HISTORY})]})}),a.jsx("div",{className:"flex flex-col justify-start items-start flex-1 mx-4 mt
866-6 mb-6",children:a.jsx(Xi,{})}),!!E&&a.jsxs("div",{className:Y("mx-4","mt-0","bp87_5:mt-6","bp87_5:h-45","bp87_5:border-t","bp87_5:border-zinc-200","pt-7.5","pb-15","bp87_5:pb-0","flex","flex-col","bp87_5:flex-row","items-stretch","bp87_5:items-start","justify-start"),children:[a.jsxs("div",{className:"bp87_5:flex-1 pt-0.5",children:[a.jsxs("div",{className:"roboto-flex-100-600-1 text-[18px] leading-[24px] text-zinc-950",children:[h.profile.layout.footer.TITLE_LINE_ONE,a.jsx("br",{className:"hidden bp87_5:block"})," ",h.profile.layout.footer.TITLE_LINE_TWO]}),a.jsx("div",{className:"mt-2 bp41_5:mt-0 bp87_5:mt-4 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500",children:h.profile.layout.footer.CONTACT_US})]}),a.jsxs("div",{className:"bp87_5:flex-1 mt-8 bp41_5:mt-12 bp87_5:mt-0 flex flex-col bp41_5:flex-row gap-4 bp41_5:gap-0 items-start justify-start",children:[a.jsxs("div",{className:"flex flex-1 flex-col items-start justify-start gap-4 bp87_5:gap-3 w-full bp41_5:w-auto",children:[a.jsxs("div",{className:"flex items-center justify-between leading-[20px] w-full bp41_5:w-auto",children:[a.jsx("div",{className:"w-1/2 bp41_5:w-27",children:a.jsx("a",{href:"tel:+78005504898",className:"roboto-flex-25-700-1 text-[14px] leading-[20px] text-zinc-950 uppercase hover:underline",children:"+7 800 550 48 98"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-1/2 bp41_5:w-auto",children:h.profile.layout.footer.CALLS})]}),a.jsxs("div",{className:"flex items-center justify-between leading-[20px] w-full bp41_5:w-auto",children:[a.jsx("div",{className:"w-1/2 bp41_5:w-27",children:a.jsx("a",{href:"tel:+74957411303",className:"roboto-flex-25-700-1 text-[14px] leading-[20px] text-zinc-950 uppercase hover:underline",children:"+7 495 741 13 03"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-1/2 bp41_5:w-auto",children:h.profile.layout.footer.CALLS})]})]}),a.jsxs("div",{className:"flex flex-1 flex-col items-start justify-start  gap-4 bp87_5:gap-3 w-full bp41_5:w-auto",children:[a.jsxs("div",{className:"flex items-center justify-between leading-[20px] w-full bp41_5:w-auto",children:[a.jsx("div",{className:"w-1/2 bp41_5:w-32.5",children:a.jsx("a",{href:"https://t.me/plevakoaisales",target:"_blank",rel:"noreferrer",className:"roboto-flex-25-700-1 text-[14px] leading-[20px] text-zinc-950 uppercase hover:underline",children:"@plevakoaisales"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-1/2 bp41_5:w-auto",children:h.profile.layout.footer.TELEGRAM})]}),a.jsxs("div",{className:"flex items-center justify-between leading-[20px] w-full bp41_5:w-auto",children:[a.jsx("div",{className:"w-1/2 bp41_5:w-32.5",children:a.jsx("a",{href:"https://wa.me/79152622207",target:"_blank",rel:"noreferrer",className:"roboto-flex-25-700-1 text-[14px] leading-[20px] text-zinc-950 hover:underline",children:"+7 915 262 22 07"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-1/2 bp41_5:w-auto",children:h.profile.layout.footer.WHATSAPP})]}),a.jsxs("div",{className:"flex items-center justify-between leading-[20px] w-full bp41_5:w-auto",children:[a.jsx("div",{className:"w-1/2 bp41_5:w-32.5",children:a.jsx("a",{href:"mailto:[email protected]",className:"roboto-flex-25-700-1 text-[14px] leading-[20px] text-zinc-950 uppercase hover:underline",children:"[email protected]"})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-1/2 bp41_5:w-auto",children:h.profile.layout.footer.EMAIL})]})]})]})]})]})},Hde="cabinet";function Vde(){const{user:e}=Se();return l.useMemo(()=>[{title:h.profile.fields.FULL_NAME,labelTheme:_h.PROFILE,rows:[{input:{isDisabled:!1,label:h.profile.fields.LAST_NAME,value:e?.lastName??"",placeholder:h.profile.placeholders.LAST_NAME,maxLength:100,patch:{endpoint:["accounts","me"],field:"lastName"},sourcePath:"user.lastName"}},{input:{isDisabled:!1,label:h.profile.fields.FIRST_NAME,value:e?.firstName??"",placeholder:h.profile.placeholders.FIRST_NAME,maxLength:100,patch:{endpoint:["accounts","me"],field:"firstName"},sourcePath:"user.firstName"}},{input:{isDisabled:!1,label:h.profile.fields.MIDDLE_NAME,value:e?.middleName??"",placeholder:h.profile.placeholders.MIDDLE_NAME,maxLength:100,patch:{endpoint:["accounts","me"],field:"middleName"},sourcePath:"user.middleName"}}]},{title:h.profile.fields.CONTACTS,labelTheme:_h.PROFILE,rows:[{text:{label:h.profile.fields.EMAIL,value:e?.email,sourcePath:"user.email",placeholder:h.profile.placeholders.EMAIL_NOT_SPECIFIED,actionButton:{label:h.profile.buttons.CHANGE,to:"/profile/change-email"}}},{text:{label:h.profile.fields.PHONE,value:mu({value:e?.phone??""}),sourcePath:"user.phone",placeholder:h.profile.placeholders.PHONE_NOT_SPECIFIED,actionButton:{label:h.profile.buttons.CHANGE,to:"/profile/change-phone"}}}]},{title:h.profile.fields.LAWYER_DETAILS,labelTheme:_h.PROFILE,rows:[{input:{isDisabled:!1,label:h.profile.fields.LAWYER_REGISTRATION_NUMBER,value:e?.lawyerRegistrationNumber??"",placeholder:h.profile.placeholders.LAWYER_REGISTRATION_NUMBER,maxLength:50,patch:{endpoint:["accounts","me"],field:"lawyerRegistrationNumber"},sourcePath:"user.lawyerRegistrationNumber"}},{select:{isDisabled:!1,isRequired:!0,label:h.profile.fields.LAWYER_PRACTICE_FORM,value:e?.lawyerPracticeForm??Hde,placeholder:h.profile.placeholders.LAWYER_PRACTICE_FORM,enumKey:"lawyerPracticeForms",catalogue:"enums",patch:{endpoint:["accounts","me"],field:"lawyerPracticeForm"},sourcePath:"user.lawyerPracticeForm"}},{input:{isDisabled:!1,label:h.profile.fields.OFFICIAL_NAME,value:e?.officialName??"",placeholder:h.profile.placeholders.OFFICIAL_NAME,maxLength:300,patch:{endpoint:["accounts","me"],field:"officialName"},sourcePath:"user.officialName"}}
866]}],[e])}const Gde=()=>{const e=Vde();return a.jsx("div",{className:"w-full max-w-212",children:e.map(t=>a.jsx(Nt,{title:t.title,rows:t.rows,labelTheme:t.labelTheme},t.title))})},qde=rt(async function({tariffId:t,promoCode:n,isAutoRenew:s,isPartial:r}){const i=Se.getState().accessToken,o=crypto.randomUUID(),c=Ke("/billing/purchase/"),u=await qe(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({tariffId:t,idempotencyKey:o,promoCode:n,isAutoRenew:s,isPartial:r})}),d=await Ye(u);if(He(d))throw{httpCode:503,errorData:d.error};if(d.status==="error")throw{httpCode:u.status,errorData:d.error};return d.data}),Wde=rt(async function(){const t=Se.getState().accessToken,n=Ke("/billing/tariffs/"),s=await qe(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};return r.data}),Kde=rt(async function(){const t=Se.getState().accessToken,n=Ke("/billing/payments/"),s=await qe(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};return r.data}),$de=rt(async function(){const t=Se.getState().accessToken,n=Ke("/billing/disable-autorenew/"),s=await qe(n,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),r=await Ye(s);if(He(r))throw{httpCode:503,errorData:r.error};if(r.status==="error")throw{httpCode:s.status,errorData:r.error};return r.data}),Yde=rt(async function(){const t=Se.getState().accessToken,n=await qe(Ke("/billing/activate-trial/"),{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${t}`}}),s=await Ye(n);if(He(s))throw{httpCode:503,errorData:s.error};if(s.status==="error")throw{httpCode:n.status,errorData:s.error};return s.data}),Xde=rt(async function({code:t,tariffId:n}){const s=Se.getState().accessToken,r=Ke("/billing/validate-promo/"),i=await qe(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({code:t,tariffId:n})}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};return o.data}),Gw="SUBSCRIPTION_FETCH_SLOW",MP=()=>{const e=Vt({queryKey:["billingTariffs"],queryFn:()=>Wde(),staleTime:3e5,refetchOnWindowFocus:!0}),t=l.useRef(null);return l.useEffect(()=>{if(t.current&&(clearTimeout(t.current),t.current=null),!e.isFetching||e.isSuccess||e.isError){Ze(Gw);return}return t.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:Gw,duration:0})},3e3),()=>{t.current&&(clearTimeout(t.current),t.current=null)}},[e.isFetching,e.isSuccess,e.isError]),e},Jde=({trialItem:e,wrapperClassName:t})=>{const n=at(),s=Se(E=>E.setUser),r=bt(),i=l.useMemo(()=>!(!e.isActive||!e.trialInfo?.expiresAt),[e.isActive,e.trialInfo?.expiresAt]),o=l.useMemo(()=>!e.isActive||!e.trialInfo?.expiresAt?null:Kt({dateString:e.trialInfo.expiresAt,isWithTime:!0,isShortMonth:!0,isCommaSeparator:!0}),[e.isActive,e.trialInfo?.expiresAt]),c=l.useMemo(()=>{const E=e.trialInfo?.secondsLeft;return E===null||E===void 0?null:E},[e.trialInfo?.secondsLeft]),u=l.useMemo(()=>{if(c===null)return!1;const E=3600*24;return c<E},[c]),{mutate:d}=tt({mutationFn:dc,onSuccess:E=>{r.setQueryData(["me"],E),s(x=>x&&{...x,...E}),n("/clients")}}),{mutate:p,isPending:g}=tt({mutationFn:Yde,onSuccess:()=>{ve({type:"success",message:h.profile.subscription.notifications.ACTIVATE_TRIAL_SUCCESS,key:"TRIAL_ACTIVATION_SAVE_FAILED"}),r.invalidateQueries({queryKey:["me"]}),r.invalidateQueries({queryKey:["billingTariffs"]}),d()},onError:()=>{ve({type:"failed",message:h.profile.subscription.notifications.ACTIVATE_TRIAL_ERROR,key:"TRIAL_ACTIVATION_SAVE_FAILED"})}}),A=l.useCallback(()=>{g||p()},[p,g]);return a.jsxs("article",{className:Y(t,"bp62_5:h-82","flex","flex-col","items-center","justify-start","flex-1","rounded-[16px]","pt-4","bp62_5:pt-6","pb-5","bp62_5:pb-6","px-5","bp62_5:px-6",!i&&"border border-[#F4F4F5]",!!i&&!!u&&"bg-amber-50",!!i&&!u&&"bg-sky-50"),children:[a.jsxs("div",{className:Y("flex","w-full","flex-row","mb-4","bp62_5:mb-0","bp62_5:flex-col","items-center","bp62_5:items-center","justify-between","bp62_5:justify-start"),children:[a.jsx("h2",{className:"roboto-flex-25-600-1 text-[18px] leading-[24px] text-zinc-950",children:h.profile.subscription.tri
866al.TITLE}),a.jsx("div",{className:Y("roboto-flex-64-600-0","text-[14px]","leading-[20px]","text-[#556FD5]",!!i&&"bp62_5:mb-4",!i&&"bp62_5:mb-47"),children:h.profile.subscription.trial.FREE_DAYS})]}),!!i&&a.jsxs("div",{className:Y("roboto-flex-100-400-1","text-[14px]","leading-[24px]","bp62_5:leading-[16px]","text-zinc-950","w-full","bp62_5:w-auto","bp62_5:text-center"),children:[h.profile.subscription.labels.ACTIVE_UNTIL,a.jsx("br",{})," ",h.profile.subscription.labels.ACTIVE_UNTIL_SUFFIX," ",o]}),!i&&a.jsx(ut,{variant:"h12inverse",isFullWidth:!0,onClick:A,isPending:g,children:h.profile.subscription.buttons.ACTIVATE})]})},Zde=({tariffItem:e,handleDisableAutorenew:t,isDisableAutorenewPending:n,wrapperClassName:s})=>{const r=e?.tariffInfo?.name??"",i=e?.tariffInfo?.subtitle??"",o=e?.tariffInfo?.priceRub??0,c=e?.tariffInfo?.durationMonths??0,u=e?.tariffInfo?.bonusDays??0,d=e?.tariffInfo?.id??"",p=e?.paidInfo??null,g=e?.isActive??!1,A=e?.isAutoRenew??!1,E=e?.tariffInfo?.tariffType??"regular",x=l.useMemo(()=>{const v=c+u/30;return Math.floor(o/v)},[o,c,u]),y=l.useMemo(()=>p?.expiresAt?Kt({dateString:p.expiresAt,isWithTime:!0,isShortMonth:!0,isCommaSeparator:!0}):null,[p?.expiresAt]),I=l.useMemo(()=>e?.validUntill?Kt({dateString:e?.validUntill,isWithTime:!0,isShortMonth:!0,isCommaSeparator:!0}):null,[e?.validUntill]);return a.jsxs("article",{className:Y(s,"bp62_5:h-82","flex","flex-col","items-center","justify-start","flex-1","border","border-[#F4F4F5]","rounded-[16px]","pt-4","bp62_5:pt-6","pb-5","bp62_5:pb-6","px-5","bp62_5:px-6",!!g&&"bg-zinc-50",E==="promo_trial"&&"bg-[radial-gradient(126.94%_99.52%_at_51.72%_100%,_#556FD5_0%,_#657EE0_100%)]"),children:[a.jsxs("div",{className:Y("flex","w-full","flex-row","gap-2","bp62_5:gap-0","mb-4","bp62_5:mb-0","bp62_5:flex-col","items-start","bp62_5:items-center","justify-between","bp62_5:justify-start"),children:[a.jsx("h2",{className:Y("roboto-flex-25-600-1","text-[18px]","leading-[24px]",E!=="promo_trial"&&"text-zinc-950",E==="promo_trial"&&"text-white"),children:r}),a.jsx("div",{className:Y("roboto-flex-64-600-0","text-[14px]","leading-[20px]","bp62_5:leading-[20px]","whitespace-nowrap","my-0.5","bp62_5:my-0",!!(y||I)&&"bp62_5:mb-4",!(y||I)&&"bp62_5:mb-26",E!=="promo_trial"&&"text-[#556FD5]",E==="promo_trial"&&Y("text-white","px-1.5","bg-[#FFFFFF1F]","rounded-full")),children:i})]}),!!(y||I)&&a.jsxs("div",{className:Y("bp62_5:h-8","w-full","bp62_5:w-auto","mb-5","bp62_5:mb-14","roboto-flex-100-400-1","text-[14px]","leading-[16px]","bp62_5:text-center",E!=="promo_trial"&&"text-zinc-950",E==="promo_trial"&&"text-white"),children:[y&&a.jsxs(a.Fragment,{children:[h.profile.subscription.labels.ACTIVE_UNTIL," ",a.jsx("br",{className:"hidden bp62_5:block"}),h.profile.subscription.labels.ACTIVE_UNTIL_SUFFIX," ",y]}),I&&a.jsxs(a.Fragment,{children:[h.profile.subscription.labels.VALID_UNTIL," ",a.jsx("br",{className:"hidden bp62_5:block"}),h.profile.subscription.labels.VALID_UNTIL_SUFFIX," ",I]})]}),a.jsxs("data",{value:x,className:Y("block","w-full","bp62_5:w-auto","roboto-flex-25-700-1","text-[32px]","leading-[32px]","mb-1",E!=="promo_trial"&&"text-zinc-800",E==="promo_trial"&&"text-white"),children:[fn({value:x??0})," ₽"]}),a.jsxs("div",{className:Y("w-full","bp62_5:w-auto","roboto-flex-100-400-1","text-[14px]","leading-[16px]","bp62_5:text-center","mb-5","bp62_5:mb-4",E!=="promo_trial"&&"text-zinc-500",E==="promo_trial"&&"text-white opacity-60"),children:[h.profile.subscription.hints.PER_MONTH_PREFIX," ",a.jsx("span",{className:"whitespace-nowrap",children:Xv({count:c}
866)}),h.profile.subscription.hints.PER_MONTH_SUFFIX,a.jsx("br",{}),h.profile.subscription.hints.TOTAL_SUM_PREFIX," ",a.jsxs("data",{className:"inline whitespace-nowrap",value:o,children:[fn({value:o??0})," ₽"]})]}),!g&&a.jsx(ut,{variant:E==="promo_trial"?"h12indigoInverse":"h12inverse",isFullWidth:!0,asChild:!0,children:a.jsx(Je,{to:`/profile/payment/${d}`,children:h.profile.subscription.buttons.CONNECT})}),!!(g&&A)&&a.jsx(ut,{variant:E==="promo_trial"?"h12linkWhite":"h12link",isFullWidth:!0,onClick:t,isPending:n,disabled:n,children:h.profile.subscription.actions.DISABLE_AUTORENEW})]})},Yy="SUBSCRIPTION_AUTORENEW_SLOW",efe=()=>{const e=bt(),{data:t,isSuccess:n,isError:s}=MP(),{user:r}=Se.getState(),i=Se(S=>S.setUser),o=l.useRef(null),c=l.useMemo(()=>!(r?.access?.isTrialActive||r?.access?.isPaidActive),[r]),{mutate:u}=tt({mutationFn:dc,onSuccess:S=>{S&&i(S)},onError:()=>{e.resetQueries({queryKey:["me"],exact:!0})}}),{mutate:d,isPending:p}=tt({mutationFn:$de,onMutate:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:Yy,duration:0})},3e3)},onSuccess:async()=>{o.current&&clearTimeout(o.current),o.current=null,Ze(Yy),ve({type:"success",message:h.profile.subscription.notifications.DISABLE_AUTORENEW_SUCCESS}),i(S=>!S||!S.paid?S:{...S,paid:{...S.paid,isAutoRenew:!1}}),u()},onError:()=>{o.current&&clearTimeout(o.current),o.current=null,Ze(Yy),ve({type:"failed",message:h.profile.subscription.notifications.DISABLE_AUTORENEW_ERROR})}}),g=l.useCallback(()=>{d()},[d]),A=l.useCallback(({totalCount:S,hasBothSpecialTariffs:b,isTrialTariff:w,isPromoTrialTariff:_})=>b?w?"basis-90/100 shrink-0 grow-1 order-1 bp62_5:basis-90/200 bp87_5:basis-0 bp87_5:order-none bp87_5:shrink-1 bp62_5":_?"basis-90/100 shrink-0 grow-1 order-2 bp62_5:basis-90/200 bp87_5:basis-0 bp87_5:order-none bp87_5:shrink-1":"basis-90/100 shrink-0 grow-1 order-3 bp62_5:basis-90/300 bp87_5:basis-0 bp87_5:order-none bp87_5:shrink-1":S%2===0?"basis-90/100 shrink-0 grow-1 bp62_5:basis-90/200 bp87_5:basis-0 bp87_5:shrink-1":"basis-90/100 shrink-0 grow-1 bp62_5:basis-90/300 bp87_5:basis-0 bp87_5:shrink-1",[]),E=l.useMemo(()=>{const S=[];if(!n||s||!r)return S;const b=!!r?.access?.isTrialActive&&!!r?.trial;(!r?.trial&&!r?.paid||b)&&S.push({type:"trial",isActive:b,isAutoRenew:!1,trialInfo:r?.trial}),r?.access?.isPaidActive&&r?.paid?.tariff&&(t.find(D=>D.id===r?.paid?.tariff?.id&&r.paid?.status==="active")||S.push({type:"paid",isActive:!0,isAutoRenew:r.paid.isAutoRenew,tariffInfo:r.paid.tariff,paidInfo:r.paid}));const N=t.map(R=>{const D=!!r?.paid?.tariff?.id&&R.id===r.paid.tariff.id&&r.paid?.status==="active",k=D?!!r.paid?.isAutoRenew:!1,L=D?r.paid:void 0;return{type:"available",isActive:D,isAutoRenew:k,trialInfo:void 0,tariffInfo:R,paidInfo:L,validUntill:R.tariffType==="promo_trial"?r?.trial?.expiresAt:null}});return[...S,...N]},[t,r,n,s]),x=l.useMemo(()=>!!(!n||s||!E?.length),[s,n,E?.length]),y=l.useMemo(()=>E.some(S=>S.type==="trial"),[E]),I=l.useMemo(()=>E.some(S=>S.type!=="trial"&&S.tariffInfo?.tariffType==="promo_trial"),[E]),v=y&&I;return x?a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0}):a.jsxs("section",{className:"flex flex-col w-full mb-10",children:[!!c&&a.jsx("div",{className:"bp62_5:mt-6 roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950",role:"status","aria-live":"polite",children:h.profile.subscription.messages.SUBSCRIPTION_EXPIRED}),a.jsx("div",{className:Y("bp62_5:mt-6",!!c&&"mt-4"),children:a.jsx("div",{className:"flex flex-wrap bp87_5:flex-nowrap gap-2 items-center justify-between",role:"group","aria-label":h.profile.titles.SUBSCRIPTION,children:E.map((S,b)=>
866{const w=S.type,_=A({totalCount:E.length,hasBothSpecialTariffs:v,isTrialTariff:w==="trial",isPromoTrialTariff:w!=="trial"&&S.tariffInfo?.tariffType==="promo_trial"});return w==="trial"?a.jsx(Jde,{trialItem:S,wrapperClassName:_},b):a.jsx(Zde,{tariffItem:S,handleDisableAutorenew:g,isDisableAutorenewPending:p,wrapperClassName:_},b)})})})]})},qw="PAYMENT_HISTORY_SLOW",tfe=()=>{const{data:e,isSuccess:t,isError:n,isFetching:s}=Vt({queryKey:["billingPayments"],queryFn:Kde}),r=l.useRef(null),i=l.useMemo(()=>e?.length?e.map(c=>({id:c.id,paymentId:c.paymentId,createdAt:c.createdAt,amountRub:c.amountRub,description:c.description,status:c.status,isTrial:c.isTrial,tariffName:c.tariff?.name??"",tariffSubtitle:c.tariff?.subtitle??""})):[],[e]),o=l.useMemo(()=>!!(!t||n),[n,t]);return l.useEffect(()=>{if(r.current&&(clearTimeout(r.current),r.current=null),t||n||!s){Ze(qw);return}return r.current=setTimeout(()=>{ve({type:"pending",message:h.network.errors.NETWORK_SLOW,key:qw,duration:0})},3e3),()=>{r.current&&(clearTimeout(r.current),r.current=null)}},[s,t,n]),o?a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0}):i?.length?a.jsx("section",{className:"w-full",children:a.jsxs("table",{className:"w-full border-collapse block bp62_5:table",children:[a.jsx("thead",{className:"hidden bp62_5:table-header-group",children:a.jsxs("tr",{className:"text-left border-b border-zinc-200",children:[a.jsx("th",{className:"py-4 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-[17%]",children:h.profile.paymentHistory.columns.DATE}),a.jsx("th",{className:"py-4 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-[17%]",children:h.profile.paymentHistory.columns.AMOUNT}),a.jsx("th",{className:"py-4 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-[41%]",children:h.profile.paymentHistory.columns.DESCRIPTION}),a.jsx("th",{className:"py-4 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-[17%]",children:h.profile.paymentHistory.columns.STATUS}),a.jsx("th",{className:"py-4 text-right roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 w-[8%]",children:h.profile.paymentHistory.columns.PAYMENT_ID})]})}),a.jsx("tbody",{className:"block bp62_5:table-row-group",children:i.map(c=>{const u=_r({dateString:c.createdAt,isWithTime:!0}),d=fn({value:c.amountRub??0}),p=c.paymentId?.split("-").pop()??"";return a.jsxs("tr",{className:Y("border-zinc-200","flex","flex-wrap","bp62_5:table-row","border-t","first:border-t-0","bp62_5:border-t","py-4","bp62_5:py-0"),children:[a.jsx("td",{className:"pt-2 pb-0 bp62_5:pt-4 bp62_5:pb-4 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 bp62_5:text-zinc-950 w-1/2 bp62_5:w-[17%] block bp62_5:table-cell order-4",children:u}),a.jsxs("td",{className:"pt-3 pb-0 bp62_5:pt-4 bp62_5:pb-4 roboto-flex-100-600-1 bp62_5:roboto-flex-100-400-1 text-[18px] bp62_5:text-[16px] leading-[24px] text-zinc-950 w-1/2 bp62_5:w-[17%] block bp62_5:table-cell order-2",children:[d," ₽"]}),a.jsx("td",{className:"bp62_5:py-4 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 w-full bp62_5:w-[41%] block bp62_5:table-cell order-1",children:c.isTrial?h.profile.paymentHistory.descriptions.TRIAL:`${h.profile.paymentHistory.descriptions.TARIFF_LABEL_PREFIX}${c.tariffName}${h.profile.paymentHistory.descriptions.TARIFF_LABEL_SUFFIX}${c.tariffSubtitle?` ${c.tariffSubtitle}`:""}`}),a.jsx("td",{className:"text-right bp62_5:text-left pt-3 pb-0 bp62_5:pt-4 bp62_5:pb-4 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 w-1/2 bp62_5:w-[17%] block bp62_5:table-cell order-3",children:a.jsxs("div",{className:Y("inline-flex items-center justify-center px-1.5 py-0.75 rounded-full roboto-flex-25-700-1 text-[12px] leading-[14px] uppercase text-center",c.status==="pending"&&"bg-sky-100 text-sky-600",c.status==="waiting_for_capture"&&"bg-sky-100 text-sky-600",c.status==="succeeded"&&"bg-green-100 text-green-600",c.status==="canceled"&&"bg-red-100 text-red-500"),children:[c.status==="pending"&&h.profile.paymentHistory.statuses.PENDING,c.status==="waiting_for_capture"&&h.profile.paymentHistory.statuses.WAITING_FOR_CAPTURE,c.status==="succeeded"&&(c.isTrial?h.profile.paymentHistory.statuses.SUCCEEDED_ACTIVATED:h.profile.paymentHistory.statuses.SUCCEEDED_PAID),c.status==="canceled"&&h.profile.paymentHistory.statuses.CANCELED]})}),a.jsx("td",{className:"pt-2 pb-0 bp62_5:pt-4 bp62_5:pb-4 roboto-mono-100-400-0 text-[16px] leading-[24px] text-zinc-500 text-right w-1/2 bp62_5:w-[8%] block bp62_5:table-cell order-5",children:!!(!c.isTrial&&c.paymentId)&&a.jsxs("div",{className:"inline-flex flex-row-reverse bp62_5:flex-row items-center gap-1 whitespace-nowrap",children:[a.jsx(Om,{text:c.paymentId??"",successMessage:h.profile.paymentHistory.messages.COPY_PAYMENT_ID_SUCCESS,tooltipText:h.profile.paymentHistory.placeholders.COPY_PAYMENT_ID,notifyKey:"COPY_PAYMENT_ID"}),p]})})]},c.id)})})]})}):a.jsxs("div",{className:Y("flex-1 w-full flex pb-20 flex-col items-center justify-center"),children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-5 text-center",children:h.profile.paymentHistory.messages.EMPTY_STATE_HINT})]})},nfe=l.forwardRef(({label:e,maxLength:t=6,isError:n,isSuccess:s,errorText:r,successText:i,handleChange:o,handleSetAutoCompleted:c,onComplete:u,...d},p)=>{const g=l.useRef(null),A=l.useRef("");l.useImperativeHandle(p,()=>g.current,[]);const[E,x]=l.useState({hasBeenSet:!1,isSet:!1}),y=l.useCallback(()=>{x(b=>({hasBeenSet:!!b.hasBeenSet||!!b.isSet,isSet:!0}))},[]);l.useEffect(()=>{const b=g.current;return b&&b.addEventListener("animationstart",y),()=>{b&&b.removeEventListener("animationstart",y)}},[g,y]),l.useEffect(()=>{if(c){if(!E.isSet){c(!1);return}if(E.hasBeenSet){c(!1);return}c(!0)}},[E.isSet,E.hasBeenSet,c]);const I=l.useCallback(()=>{g.current&&(g.current.value="",A.current="",o&&o(""),x({hasBeenSet:!1,isSet:!1}),g.current.focus())},[o]),v=l.useMemo(()=>({...d,disabled:!!d.disabled,type:d.type??"text",maxLength:t}),[d,t]),S=l.useCallback(b=>{const w=b.target.value,R=qh({text:w,target:"en"}).replace(/[^A-Za-z0-9]/g,"").slice(0,t);if(!o){b.target.value=R,R||x(D=>({hasBeenSet:!!D.hasBeenSet||!!D.isSet,isSet:!1}));return}if(R||x(D=>({hasBeenSet:!!D.hasBeenSet||!!D.isSet,isSet:!1})),o(R),b.target.value!==R&&(b.target.value=R),R.length<t){A.current="";return}u&&R!==A.current&&(A.current=R,u(R))},[o,t,u]);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative w-full group",children:[a.jsxs("div",{className:"relative w-full border-0",children:[a.jsx("input",{ref:g,"data-slot":"input",spellCheck:!1,className:Y("file:text-foreground placeholder:text-transparent flex min-w-0 outline-none focus:ring-0 focus:shadow-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 password-clean pb-2 pl-4 pr-2 roun
866ded-lg text-[16px] leading-[20px] h-14 w-full","roboto-mono-100-400-0 [letter-spacing:7px]","pt-7 transition-[color,box-shadow]",!n&&"bg-zinc-100",!!n&&"bg-red-100"),onChange:S,...v}),a.jsx("div",{className:"pointer-events-none absolute bottom-2.25 left-[15.5px] flex items-center justify-start gap-1.75","aria-hidden":"true",children:Array.from({length:t}).map((b,w)=>a.jsx("div",{className:"h-0.25 bg-zinc-950 w-[9.75px]"},w))})]}),!!e&&a.jsx("div",{className:"top-0 left-0 pr-2 pl-4 pt-2 w-full h-full absolute roboto-flex-100-400-1 text-zinc-500 flex items-center pointer-events-none text-[14px] leading-[20px] select-none pb-7",children:e}),!!d.value?.toString()?.length&&a.jsx("button",{type:"button",onClick:I,className:"absolute inset-y-0 right-0 flex h-14 w-8 items-center justify-center pr-2 text-zinc-400 hover:text-zinc-500 cursor-pointer","aria-label":"Очистить ввод",children:a.jsx(c2,{className:"h-5 w-5"})})]}),!!(n&&r)&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-red-600 mt-1 ml-0.25",children:r}),!!(s&&i)&&a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[16px] text-green-600 mt-1 ml-0.25",children:i})]})}),sfe=e=>l.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 424 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none",...e},l.createElement("rect",{width:424,height:64,fill:"#18181B"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint0_linear_161767_20301)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint1_radial_161767_20301)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint2_radial_161767_20301)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint3_radial_161767_20301)"}),l.createElement("defs",null,l.createElement("linearGradient",{id:"paint0_linear_161767_20301",x1:-789761e-12,y1:64,x2:421.972,y2:-11.3539,gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#A0E720"}),l.createElement("stop",{offset:.224597,stopColor:"#00D900"}),l.createElement("stop",{offset:.705047,stopColor:"#21A038"})),l.createElement("radialGradient",{id:"paint1_radial_161767_20301",cx:0,cy:0,r:1,gradientTransform:"matrix(27.8448 -132.073 157.37 28.0444 383.498 76.2182)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#00ADEE"}),l.createElement("stop",{offset:1,stopColor:"#00ADEE",stopOpacity:0})),l.createElement("radialGradient",{id:"paint2_radial_161767_20301",cx:0,cy:0,r:1,gradientTransform:"matrix(-79.7373 -37.8182 56.4836 -100.664 416.406 64)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#0087CD"}),l.createElement("stop",{offset:1,stopColor:"#00ADEE",stopOpacity:0})),l.createElement("radialGradient",{id:"paint3_radial_161767_20301",cx:0,cy:0,r:1,gradientTransform:"matrix(87.9642 165.818 -1098.55 492.589 -38.603 -101.818)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#FAED00"}),l.createElement("stop",{offset:1,stopColor:"#FAED00",stopOpacity:0})))),rfe=({isPending:e=!1,asChild:t=!1,children:n,type:s,onClick:r,disabled:i,isFullWidth:o=!1,marginTop:c,backgroundType:u,dataAttributes:d})=>{const p=l.useMemo(()=>Y("inline-flex items-center justify-center whitespace-nowrap","relative","group","rounded-full","cursor-pointer","disabled:pointer-events-none disabled:opacity-30","transition-[color,box-shadow]","focus-visible:ring-4 focus-visible:outline-1","h-14 bp48:h-16","flex flex-col items-center justify-center","py-2.5 px-8","roboto-flex-25-700-1 text-[16px] bp48:text-[20px] leading-[16px] bp48:leading-[32px] uppercase","text-zinc-100","bg-black","hover:text-white",!!o&&"w-full",c===2&&"mt-2"),[o,c]),g=l.useMemo(()=>!t||!Oe.isValidElement(n)?n:n.props.children,[n,t]),A=l.useMemo(()=>u==="partialPayment"?a.jsx(sfe,{className:"absolute inset-0 h-full w-full rounded-full pointer-events-none select-none group-hover:opacity-[0.96]"}):null,[u]),E=l.useMemo(()=>e?a.jsxs(a.Fragment,{children:[A,a.jsx("span",{className:"relative z-10 invisible",children:g}),a.jsx("span",{className:"absolute inset-0 z-10 flex items-center justify-center",children:a.jsx(Co,{className:"size-5 animate-spin stroke-current text-white"})})]}):a.jsxs(a.Fragment,{children:[A,a.jsx("span",{className:"relative z-10",children:g})]}),[A,g,e]);return l.useMemo(()=>t&&Oe.isValidElement(n)?Oe.cloneElement(n,{...d,className:p,children:E,onClick:r}):a.jsx("button",{disabled:!!e||!!i,type:s??"button","aria-busy":e,className:p,onClick:r,...d,children:E}),[t,n,p,E,s,r,e,i,d])},Xy=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e}
866,l.createElement("path",{d:"M2.57129 0.75H7.00488C7.26048 0.750105 7.50578 0.851488 7.68652 1.03223L10.1104 3.45703C10.2912 3.63787 10.3936 3.88293 10.3936 4.13867V10.2861C10.3933 10.8185 9.96113 11.25 9.42871 11.25H2.57129C2.03906 11.2498 1.60765 10.8184 1.60742 10.2861V1.71387C1.60765 1.18164 2.03906 0.750226 2.57129 0.75Z",stroke:"#A1A1AA",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ife=e=>l.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 424 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none",...e},l.createElement("rect",{width:424,height:64,fill:"url(#paint0_linear_161767_20296)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint1_radial_161767_20296)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint2_radial_161767_20296)"}),l.createElement("rect",{width:424,height:64,fill:"url(#paint3_radial_161767_20296)"}),l.createElement("defs",null,l.createElement("linearGradient",{id:"paint0_linear_161767_20296",x1:-134.909,y1:72,x2:466.361,y2:65.71,gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#A0E720"}),l.createElement("stop",{offset:.224597,stopColor:"#00D900"}),l.createElement("stop",{offset:.705047,stopColor:"#17CC10"})),l.createElement("radialGradient",{id:"paint1_radial_161767_20296",cx:0,cy:0,r:1,gradientTransform:"matrix(27.8448 -132.073 157.37 28.0444 383.498 76.2182)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#00ADEE"}),l.createElement("stop",{offset:1,stopColor:"#00ADEE",stopOpacity:0})),l.createElement("radialGradient",{id:"paint2_radial_161767_20296",cx:0,cy:0,r:1,gradientTransform:"matrix(-79.7373 -37.8182 56.4836 -100.664 416.406 64)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#0087CD"}),l.createElement("stop",{offset:1,stopColor:"#00ADEE",stopOpacity:0})),l.createElement("radialGradient",{id:"paint3_radial_161767_20296",cx:0,cy:0,r:1,gradientTransform:"matrix(87.9642 165.818 -1098.55 492.589 -38.603 -101.818)",gradientUnits:"userSpaceOnUse"},l.createElement("stop",{stopColor:"#FAED00"}),l.createElement("stop",{offset:1,stopColor:"#FAED00",stopOpacity:0})))),ofe=e=>l.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M10.7891 7.58789C12.5614 7.58789 13.9979 9.02297 13.998 10.793C13.998 12.5631 12.5615 13.998 10.7891 13.998C9.01668 13.998 7.58008 12.5631 7.58008 10.793C7.58026 9.02302 9.0168 7.58796 10.7891 7.58789ZM3.2666 7.57617C5.03883 7.57637 6.4755 9.01129 6.47559 10.7812C6.47559 12.5513 5.03888 13.9861 3.2666 13.9863C1.49416 13.9863 0.0566406 12.5514 0.0566406 10.7812C0.0567216 9.01117 1.49421 7.57617 3.2666 7.57617ZM3.20898 0C4.9814 3.87387e-08 6.41891 1.43496 6.41895 3.20508C6.41895 4.97523 4.98142 6.41016 3.20898 6.41016C1.43668 6.40999 -3.86844e-08 4.97513 0 3.20508C3.10229e-05 1.43506 1.4367 0.000162245 3.20898 0Z",fill:"white"}),l.createElement("path",{d:"M13.9479 3.25413C13.9479 5.02428 12.511 6.45927 10.7386 6.45927C8.96614 6.45927 7.5293 5.02428 7.5293 3.25413C7.5293 1.48398 8.96614 0.048996 10.7386 0.048996C12.511 0.0489961 13.9479 1.48398 13.9479 3.25413ZM8.76592 3.25413C8.76592 4.3422 9.64911 5.22425 10.7386 5.22425C11.8281 5.22425 12.7112 4.3422 12.7112 3.25413C12.7112 2.16607 11.8281 1.28402 10.7386 1.28402C9.64911 1.28402 8.76592 2.16607 8.76592 3.25413Z",fill:"white"})),Jy="billingRequestInProgress",afe=200,lfe=()=>{const e=l.useRef(null),[t,n]=l.useState(!1),[s,r]=l.useState(!1),[i,o]=l.useState(""),[c,u]=l.useState(void 0),[d,p]=l.useState(void 0),[g,A]=l.useState(null),[E,x]=l.useState(null),{tariffId:y}=st(),{data:I,isSuccess:v}=MP(),S=l.useCallback(()=>{typeof window>"u"||window.sessionStorage.setItem(Jy,"1")},[]),b=l.useCallback(()=>{typeof window>"u"||window.sessionStorage.removeItem(Jy)},[]),w=l.useCallback(()=>typeof window>"u"?!1:!!window.sessionStorage.getItem(Jy),[]),{mutate:_}=tt({mutationFn:qde,onSuccess:q=>{q&&q.paymentUrl&&(S(),window.location.assign(q.paymentUrl))},onError:()=>{b(),A(null),ve({type:"failed",message:h.profile.payment.errors.BILLING_REQUEST_FAILED,key:"PROFILE_PAYMENT_BILLING_REQUEST_FAILED"})}}),{mutate:N,isPending:R}=tt({mutationFn:Xde,onSuccess:(q,G)=>{x({code:G.code,...q}),u(void 0);const $=Math.floor(q.originalPrice-q.finalPrice);p(`${h.profile.payment.promoCodeSuccess.PREFIX}${fn({value:$})}${h.profile.payment.promoCodeSuccess.SUFFIX}`)},onError:q=>{const G=q.code;u(G==="PROMO_RESERVED"?(()=>{const $=h.profile.payment.promoCodeErrors.PROMO_RESERVED_EMAIL;return a.jsxs(a.Fragment,{children:[h.profile.payment.promoCodeErrors.PROMO_RESERVED_LINE1,a.jsx("br",{}),h.profile.payment.promoCodeErrors.PROMO_RESERVED_LINE2,a.jsx("a",{href:`mailto:${$}`,className:"underline hover:no-underline",children:$}),h.profile.payment.promoCodeErrors.PROMO_RESERVED_SUFFIX]})})():h.profile.payment.promoCodeErrors.NOT_FOUND),p(void 0)}}),D=l.useCallback(q=>{o(q),q.length!==6&&(u(void 0),p(void 0),x(null))},[]),k=l.useCallback(q=>{y&&(x(null),p(void 0),r(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,r(!1)},afe),N({code:q,tariffId:y}))},[y,N]);l.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]);const L=l.useCallback(q=>{n(q)},[]),O=l.useMemo(()=>!I||!y?null:I.find(q=>q.id===y)??null,[I,y]),P=O?.name??"",B=O?.priceRub??0,F=O?.durationMonths??0,z=O?.bonusDays??0,Q=E?.finalPrice??B,M=l.useMemo(()=>{const q=F+z/30;return Math.floor(Q/q)},[Q,F,z]),K=l.useMemo(()=>Q?Math.floor(Q*1.15/6):0,[Q]),W=l.useMemo(()=>!!(g||!y),[g,y]),H=l.useMemo(()=>!!(R||s),[R,s]),j=l.useCallback(q=>{if(q.preventDefault(),W||!y)return;const J=q.nativeEvent.submitter?.dataset?.isPartial==="true";A(J?"partial":"full"),_({tariffId:y,promoCode:E?.code??null,isAutoRenew:t,isPartial:J})},[t,W,_,y,E]);return l.useEffect(()=>{if(typeof window>"u")return;const q=()=>{w()&&(b(),A(null),i.length===6&&y&&(x(null),u(void 0),p(void 0),N({code:i,tariffId:y})))};return window.addEventListener("pageshow",q),q(),()=>{window.removeEventListener("pageshow",q)}},[b,w,i,y,N]),v?O?a.jsxs("div",{className:"relative flex flex-1",children:[a.jsxs(Je,{className:"absolute right-0 top-0 w-9 bp41_5:w-16 h-9 bp41_5:h-16 flex items-end justify-start text-zinc-400 hover:text-zinc-500",to:"/profile/subscription",children:[a.jsx(f7,{className:"hidden bp41_5:block size-10"}),a.jsx(ga,{className:"block bp41_5:hidden size-6"})]}),a.jsxs("form",{onSubmit:j,className:"flex flex-end bp41_5:flex-start justify-end bp41_5:justify-start flex-col flex-1",children:[a.jsx("div",{className:"flex bp41_5:flex-1 items-center justify-center pb-9 bp41_5:pb-9 pt-0 bp41_5:pt-25",children:a.jsxs("div",{className:"flex flex-col bp41_5:items-center justify-center w-full bp41_5:w-auto px-4 bp41_5:px-0",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[32px] leading-[32px] text-zinc-400 uppercase bp41_5:hidden",children:h.profile.payment.titles.SUBSCRIPTION_SETUP}),a.jsx("div",{className:"hidden roboto-flex-64-600-0 text-[48px] leading-[48px] text-zinc-400 uppercase bp41_5:block",children:h.profile.payment.titles.SUBSCRIPTION_SETUP}),a.jsxs("div",{className:"roboto-flex-25-700-1 text-[32px] leading-[32px] text-zinc-950 uppercase bp41_5:hidden",children:["«",P,"»"]}),a.jsxs("div",{className:"hidden roboto-flex-64-600-0 text-[48px] leading-[48px] text-zinc-950 uppercase bp41_5:block",children:["«",P,"»"]}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 bp41_5:text-center mt-4 bp41_5:mt-2",children:[fn({value:M})," ",h.profile.payment.texts.PER_MONTH,a.jsx("br",{className:"block bp41_5:hidden"})," ",Xv({count:F})," ",kO({count:z,prefix:"+ "})]}),a.jsxs("div",{className:"flex items-center bp41_5:justify-center justify-start gap-1 roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 mt-2 bp41_5:mt-1",children:[a.jsxs("div",{className:"inline-block relative px-1 h-6",children:[a.jsx(ife,{className:"absolute inset-0 h-full w-full rounded-[4px] pointer-events-none select-none"}),a.jsx("span",{className:"relative roboto-flex-100-600-0 text-white",children:h.profile.payment.texts.PARTIAL_BADGE})]})," ",a.jsxs("span",{className:"h-6",children:[h.profile.payment.texts.partialToday.PREFIX,fn({value:K})," ",h.profile.payment.texts.partialToday.SUFFIX]})," ",a.jsx(Wr,{width:96,text:h.profile.payment.tooltips.PARTIAL_PAYMENT})]}),a.jsx("div",{className:"mt-8 w-full bp41_5:w-106 h-19",children:a.jsx(nfe,{label:h.profile.payment.labels.PROMO_CODE,value:i,handleChange:D,onComplete:k,isError:!!c,isSuccess:!!d,errorText:c,successText:d,disabled:!!g||!!H})}),a.jsxs("div",{className:"mt-11 w-full bp41_5:w-106",children:[a.jsxs(ut,{variant:"h16",isFullWidth:!0,type:"submit",disabled:!y||!!H||g==="partial",isPending:g==="full",dataAttributes:{"data-is-partial":"false"},children:[h.profile.payment.buttons.payWithAmount.PREFIX,fn({value:E?.finalPrice??O.priceRub??0}),h.profile.payment.buttons.payWithAmount.SUFFIX]}),a.jsx(rfe,{isFullWidth:!0,type:"submit",disabled:!y||!!t||!!H||g==="full",isPending:g==="partial",marginTop:2,backgroundType:"partialPayment",dataAttributes:{"data-is-partial":"true"},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ofe,{className:"size-4"}),h.profile.payment.buttons.PAY_PARTIAL]})})]}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-500 mt-3 self-center",children:h.profile.payment.texts.CASHBOX_VPN_NOTICE}),a.jsx("div",{className:"hidden bp41_5:block mt-8 h-7",children:!!O.autoRenewable&&a.jsx(Ls,{width:6
8665,isBelow:!0,isFollowCursor:!1,verticalOffset:-2,position:"right",text:h.profile.payment.tooltips.AUTO_RENEW,disabled:!!g||!!H,children:a.jsx(KI,{value:t,onChange:L,disabled:!!g||!!H,children:a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex items-center gap-1 overflow-hidden select-none",children:[a.jsx("div",{children:h.profile.payment.toggles.AUTO_RENEW}),a.jsx(p2,{className:Y("size-5 text-sky-400 hover:text-sky-500",!g&&"cursor-pointer",!!g&&"cursor-not-allowed")})]})})})}),a.jsx("div",{className:"block bp41_5:hidden mt-7.5 h-7",children:!!O.autoRenewable&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(KI,{value:t,onChange:L,disabled:!!g||!!H,children:a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 flex items-center gap-1 overflow-hidden select-none",children:h.profile.payment.toggles.AUTO_RENEW})}),a.jsx(Wr,{width:60,isBelow:!0,isFollowCursor:!1,position:"right",text:h.profile.payment.tooltips.AUTO_RENEW,disabled:!!g||!!H})]})})]})}),a.jsxs("div",{className:"h-14 bp41_5:h-28 flex items-center justify-center gap-6",children:[a.jsxs(Je,{to:"/documents/offer.pdf",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 hover:underline",children:[a.jsx(Xy,{className:"size-3 text-zinc-500"}),h.profile.payment.links.TERMS]}),a.jsxs(Je,{to:"/documents/offer.pdf",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 hover:underline",children:[a.jsx(Xy,{className:"size-3 text-zinc-500"}),h.profile.payment.links.TARIFF_DESCRIPTION]}),a.jsxs(Je,{to:"/documents/offer.pdf",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-500 hover:underline",children:[a.jsx(Xy,{className:"size-3 text-zinc-500"}),h.profile.payment.links.OFFER]})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Kh,{}),a.jsx(ia,{type:Gr.TARIFF_NOT_FOUND})]}):a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0})},cfe=()=>{const e=at(),[t,n]=l.useState(""),[s,r]=l.useState(""),{mutate:i,isPending:o}=tt({mutationFn:jk,onSuccess:(p,g)=>{e("/profile/change-phone/check-email",{state:{password:g.password}})},onError:()=>{r(h.changePhone.confirmPassword.errors.INVALID_PASSWORD)}}),c=l.useCallback(p=>{p.preventDefault();const g=t.trim();if(!g){r(h.changePhone.confirmPassword.errors.INVALID_PASSWORD);return}i({password:g})},[t,i]),u=l.useCallback(p=>{n(p),r("")},[]),d=l.useMemo(()=>o,[o]);return a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-12"),children:h.changePhone.confirmPassword.TITLE}),a.jsx("form",{onSubmit:c,children:a.jsxs("div",{className:"mx-4",children:[a.jsx("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:h.changePhone.confirmPassword.DESCRIPTION}),a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"password",placeholder:h.changePhone.confirmPassword.placeholders.PASSWORD,value:t,handleChange:u,type:"password",isError:!!s,errorText:s,disabled:o})}),a.jsxs("div",{className:"mt-8 flex gap-2",children:[a.jsx(ut,{variant:"h14inverse",disabled:d,isFullWidth:!0,asChild:!0,children:a.jsx(Je,{to:"/profile",children:h.changePhone.confirmPassword.buttons.CANCEL})}),a.jsx(ut,{variant:"h14",isPending:o,disabled:d,isFullWidth:!0,type:"submit",children:h.changePhone.confirmPassword.buttons.CONTINUE})]})]})})]})},ufe=({description:e,email:t,resendPrefix:n,resendText:s,counter:r,onResendClick:i,isResendDisabled:o=!1})=>a.jsxs("div",{className:"bp34_375:mt-16 bp34_375:pb-20 max-w-160 mx-auto px-4 flex flex-col flex-1 items-center text-center justify-center",children:[a.jsx("div",{className:"h-27 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-3.5",children:h.molecules.checkEmailTemplate.TITLE}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5",children:[e.PART1," ",a.jsx("a",{href:`mailto:${t}`,className:"underline hover:text-zinc-850 whitespace-nowrap",children:t}),", ",e.PART2]}),a.jsx("div",{className:"mt-4 mb-8",children:a.jsx(bf,{prefixText:n,isDisabled:r>0||o,onClick:i,children:s.replace("{time}",r>0?r.toString():"")})})]}),O0=60,dfe=()=>{const n=Fe().state?.password??"",r=Se(E=>E.user)?.email??"",[i,o]=l.useState(O0),c=l.useRef(null),u=l.useRef(null),d=l.useCallback(E=>{o(E),u.current&&clearInterval(u.current),c.current=Date.now(),u.current=setInterval(()=>{if(c.current===null)return;const x=Math.floor((Date.now()-c.current)/1029),y=E-x;if(y<=0){u.current&&clearInterval(u.current),o(0);return}o(y)},343)},[]),{mutate:p,isPending:g}=tt({mutationFn:jk,onSuccess:()=>{Ze("PHONE_CHANGE_RESEND_SENDING"),ve({type:"success",message:h.changePhone.checkEmail.notifications.SENT,key:"PHONE_CHANGE_RESEND_SENT"}),d(O0)},onError:()=>{Ze("PHONE_CHANGE_RESEND_SENDING"),ve({type:"failed",message:h.changePhone.checkEmail.errors.UNKNOWN,key:"PHONE_CHANGE_RESEND_FAILED"}),o(0)}}),A=l.useCallback(E=>{E.preventDefault(),!(i>0||g)&&(d(O0),ve({type:"pending",message:h.changePhone.checkEmail.notifications.SENDING,key:"PHONE_CHANGE_RESEND_SENDING"}),p({password:n}))},[i,g,d,n,p]);return l.useEffect(()=>(d(O0),()=>{u.current&&clearInterval(u.current)}),[d]),l.useEffect(()=>()=>{Ze("PHONE_CHANGE_RESEND_SENDING"),Ze("PHONE_CHANGE_RESEND_SENT"),Ze("PHONE_CHANGE_RESEND_FAILED")},[]),n?a.jsx(ufe,{description:{PART1:h.changePhone.checkEmail.description.PART1,PART2:h.changePhone.checkEmail.description.PART2},email:r,resendPrefix:h.changePhone.checkEmail.links.RESEND_PREFIX,resendText:h.changePhone.checkEmail.links.RESEND,counter:i,onResendClick:A,isResendDisabled:g}):a.jsx(Qn,{to:"/profile/change-phone",replace:!0})},ffe=()=>{const e=at(),t=Se(A=>A.user),n=l.useCallback(({minutes:A})=>qt({count:A,zero:h.changeEmail.enterSmsCode.errors.minutes.ZERO,one
866:h.changeEmail.enterSmsCode.errors.minutes.ONE,many:h.changeEmail.enterSmsCode.errors.minutes.MANY}),[]),[s,r]=l.useState(""),[i,o]=l.useState(""),{mutate:c,isPending:u}=tt({mutationFn:ZG,onSuccess:A=>{if(!A.smsSent){const E=A.cooldownSeconds??0,x=Math.ceil(E/60),y=n({minutes:x});ve({type:"failed",message:`${h.changeEmail.enterSmsCode.errors.resendSmsFailed.PREFIX}${x} ${y}${h.changeEmail.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"EMAIL_CHANGE_INITIATE_COOLDOWN"});return}e("/profile/change-email/sms",{state:{passToken:A.passToken,phone:t?.phone??"",cooldownSeconds:A.cooldownSeconds??0,smsCode:A.smsCode??null}})},onError:A=>{const E=A.code;if(E==="PHONE_NOT_CONFIRMED"){o(h.changeEmail.enterNewEmail.errors.PHONE_NOT_CONFIRMED);return}if(E==="SAME_EMAIL_ERROR"){o(h.changeEmail.enterNewEmail.errors.SAME_EMAIL_ERROR);return}if(E==="EMAIL_ALREADY_TAKEN"){o(h.changeEmail.enterNewEmail.errors.EMAIL_ALREADY_TAKEN);return}o(h.changeEmail.enterNewEmail.errors.VALIDATION_ERROR)}}),d=l.useCallback(A=>{A.preventDefault();const E=s.trim();if(!E){o(h.changeEmail.enterNewEmail.errors.EMAIL_EMPTY_ERROR);return}if(!hu.test(E)){o(h.signUp.fieldsErrors.email.VALUE_ERROR);return}c({newEmail:E})},[s,c]),p=l.useCallback(A=>{r(A),o("")},[]),g=l.useMemo(()=>u,[u]);return a.jsxs("div",{className:"w-full bp34_375:w-114 pt-0 bp34_375:pt-41 pb-20 w-114 mx-auto",children:[a.jsx("div",{className:Y("roboto-flex-25-700-1","text-[24px]","leading-[24px]","text-zinc-950","uppercase","justify-start","items-start","mb-8","mx-4","bp34_375:mb-12"),children:h.changeEmail.enterNewEmail.TITLE}),a.jsx("form",{onSubmit:d,children:a.jsxs("div",{className:"mx-4",children:[a.jsxs("div",{className:"mb-8 roboto-flex-100-400-1 text-zinc-950 text-[16px] leading-[20px]",children:[h.changeEmail.enterNewEmail.DESCRIPTION.PART1,a.jsx("br",{}),h.changeEmail.enterNewEmail.DESCRIPTION.PART2]}),a.jsx("div",{className:"mb-3",children:a.jsx(hi,{name:"email",placeholder:h.changeEmail.enterNewEmail.placeholders.EMAIL,value:s,handleChange:p,type:"email",isError:!!i,errorText:i,disabled:u})}),a.jsxs("div",{className:"mt-8 flex gap-2",children:[a.jsx(ut,{variant:"h14inverse",disabled:g,isFullWidth:!0,asChild:!0,children:a.jsx(Je,{to:"/profile",children:h.changeEmail.enterNewEmail.buttons.CANCEL})}),a.jsx(ut,{variant:"h14",isPending:u,disabled:g,isFullWidth:!0,type:"submit",children:h.changeEmail.enterNewEmail.buttons.CONTINUE})]})]})})]})},pfe=()=>{const e=Fe(),t=at(),n=bt(),s=e.state,[r,i]=l.useState(s?.passToken??""),o=s?.phone??"",c=s?.cooldownSeconds??0,u=s?.smsCode??null,d=Se(j=>j.setUser),p=Se(j=>j.setIsAppReady),g=Se(j=>j.setIsUserLoadResolved),A=l.useRef(null),E=l.useRef(null),[x,y]=l.useState(""),[I,v]=l.useState(0),[S,b]=l.useState(!1),[w,_]=l.useState(!1),[N,R]=l.useState(!1),[D,k]=l.useState(""),L=l.useCallback(({attemptsLeft:j})=>qt({count:j,zero:h.changeEmail.enterSmsCode.errors.ATTEMPTS_LEFT.ZERO,one:h.changeEmail.enterSmsCode.errors.ATTEMPTS_LEFT.ONE,many:h.changeEmail.enterSmsCode.errors.ATTEMPTS_LEFT.MANY}),[]),O=l.useCallback(({minutes:j})=>qt({count:j,zero:h.changeEmail.enterSmsCode.errors.minutes.ZERO,one:h.changeEmail.enterSmsCode.errors.minutes.ONE,many:h.changeEmail.enterSmsCode.errors.minutes.MANY}),[]),P=l.useCallback(({initialSeconds:j})=>{v(j),E.current&&clearInterval(E.current),A.current=Date.now(),E.current=setInterval(()=>{if(A.current===null)return;const q=Math.floor((Date.now()-A.current)/1029),G=j-q;if(G<=0){E.current&&clearInterval(E.current),v(0);return}v(G)},343)},[]),{mutate:B,isPending:F}=tt({mutationFn:eq,onSuccess:async()=>{ve({type:"success",message:h.changeEmail.enterSmsCode.notifications.EMAIL_CHANGE_SENT}),g(!1);const j=await dc();d(j),p(!0),g(!0),n.invalidateQueries({queryKey:["me"]}),t("/profile")},onError:j=>{if(j.code==="INVALID_SMS_CODE"){const q=j.data?.attemptsLeft??0,G=L({attemptsLeft:q});k(`${h.changeEmail.enterSmsCode.errors.INVALID_CODE} ${q} ${G}`);return}if(j.code==="SMS_ATTEMPTS_EXCEEDED"){_(!0),k(h.changeEmail.enterSmsCode.errors.ATTEMPTS_EXCEEDED),I>Hf&&b(!0);return}if(j.code==="PASS_TOKEN_INVALID"){_(!0),k(h.changeEmail.enterSmsCode.errors.PASS_TOKEN_INVALID);return}R(!0),_(!0),k(h.changeEmail.enterSmsCode.errors.UNKNOW_ERROR)}}),z=l.useCallback(({value:j})=>{const q=Ci({smsSent:!0,smsCode:j});if(!q)return;aa({smsCode:q}),y(q),B({passToken:r,smsCode:q});const G=e.state;G&&t(".",{replace:!0,state:{...G,passToken:r,smsCode:null}})},[B,e.state,t,r]),{mutate:Q,isPending:M}=tt({mutationFn:tq,onSuccess:j=>{Ze("EMAIL_CHANGE_RESEND_SMS_SENDING");const q=j.smsSent,G=j.cooldownSeconds??0,$=Math.ceil(G/60),J=O({minutes:$});if(!q){ve({type:"failed",message:`${h.changeEmail.enterSmsCode.errors.resendSmsFailed.PREFIX}${$} ${J}${h.changeEmail.enterSmsCode.errors.resendSmsFailed.SUFFIX}`,key:"EMAIL_CHANGE_RESEND_SMS_FAILED"}),i(j.passToken);const oe=e.state;t(".",{replace:!0,state:{...oe??{},passToken:j.passToken,cooldownSeconds:j.cooldownSeconds??0,smsCode:null}}),P({initialSeconds:G}),_(!0),R(!1);return}ve({type:"success",message:h.changeEmail.enterSmsCode.notifications.SENT,key:"EMAIL_CHANGE_RESEND_SMS_SENT"});const ne=Ci({smsSent:q,smsCode:j.smsCode});ne||y(""),ne&&(aa({smsCode:ne}),y(ne),B({passToken:j.passToken,smsCode:ne})),i(j.passToken);const X=e.state;t(".",{replace:!0,state:{...X??{},passToken:j.passToken,cooldownSeconds:j.cooldownSeconds??0,smsCode:null}}),P({initialSeconds:G}),k(""),_(!1),R(!1)},onError:()=>{Ze("EMAIL_CHANGE_RESEND_SMS_SENDING"),_(!0),R(!0),k(h.changeEmail.enterSmsCode.errors.UNKNOW_ERROR)}}),K=l.useCallback(j=>{y(j)},[]),W=l.useCallback(j=>{B({passToken:r,smsCode:j})},[r,B]),H=l.useCallback(()=>{b(!1),Q({passToken:r}),ve({type:"info",message:h.changeEmail.enterSmsCode.notifications.SENDING,key:"EMAIL_CHANGE_RESEND_SMS_SENDING"})},[r,Q]);return l.useEffect(()=>{P({initialSeconds:c})},[P,c]),l.useEffect(()=>{z({value:u})},[u,z]),l.useEffect(()=>()=>{R(!1),y(""),v(0),k(""),E.current&&clearInterval(E.current)},[]),!r||!o?a.jsx(Qn,{to:"/profile/change-email",replace:!0}):a.jsx(Qf,{title:h.changeEmail.enterSmsCode.TITLE,description:{PREFIX:h.changeEmail.enterSmsCode.description.PREFIX,SUFFIX:h.changeEmail.enterSmsCode.description.SUFFIX},phone:o,smsCode:x,onSmsCodeChange:K,isOtpInputDisabled:w,isPending:F||M,counter:I,isAccessTemporarilyRestrictedActive:S,error:D,isError:!!D,isHideResendButton:N,onResendSms:H,onSmsCodeComplete:W})},Vl=()=>{const e=zt();return a.jsx(Xi,{context:e})},hfe=({isClientPage:e})=>{const t=Ct("/clients/:id/*"),n=Fe(),s=t?.params.id,r=l.useMemo(()=>
866{if(e&&s)return s},[e,s]),{isOpen:i,objectToFabulize:o,status:c}=wt({clientId:r}),u=l.useMemo(()=>!i||!o?0:c==="notStarted"||c==="error"?50:c==="pending"||c==="awaitingChoice"||c==="autoCommitted"?16:0,[i,o,c]),d=l.useMemo(()=>/\/source(?:\/|$)/.test(n.pathname),[n.pathname]),p=l.useMemo(()=>s?n.pathname.startsWith(`/clients/${s}/quotes`):!1,[s,n.pathname]),g=l.useMemo(()=>p||d?16:u,[p,d,u]);return a.jsx("div",{className:Y("fixed top-0 left-0 w-full h-full z-100 pointer-events-none"),children:a.jsx("div",{className:Y("absolute overflow-hidden top-0 left-0 right-0 pointer-events-none",g===0&&"bottom-0",g===16&&"bottom-16",g===50&&"bottom-50"),children:a.jsx(Fq,{transition:Pq,position:"bottom-center",autoClose:3e3,closeOnClick:!0,pauseOnFocusLoss:!0,draggable:!1,pauseOnHover:!0,closeButton:!1,hideProgressBar:!0,className:"!absolute",toastClassName:Y("!p-0 !w-auto !h-auto !min-h-0 !max-h-none !mt-2 !mb-0 ![background:transparent] !shadow-none whitespace-normal bp48:!h-10 bp48:!min-h-10 bp48:!max-h-10 bp48:whitespace-nowrap transition-opacity !duration-200 opacity-100 [&.simplefade-enter]:opacity-0 [&.simplefade-enter-active]:opacity-100 [&.simplefade-exit]:opacity-100 [&.simplefade-exit-active]:opacity-0 !pointer-events-auto"),limit:2})})})},mfe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17866_50600)"},l.createElement("path",{d:"M8.33594 10H11.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M7.5 3.33334C8.16304 3.33334 8.79893 3.59673 9.26777 4.06557C9.73661 4.53441 10 5.17029 10 5.83334V14.1667C10 14.8297 9.73661 15.4656 9.26777 15.9344C8.79893 16.4033 8.16304 16.6667 7.5 16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.5 3.33334C11.837 3.33334 11.2011 3.59673 10.7322 4.06557C10.2634 4.53441 10 5.17029 10 5.83334V14.1667C10 14.8297 10.2634 15.4656 10.7322 15.9344C11.2011 16.4033 11.837 16.6667 12.5 16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17866_50600"},l.createElement("rect",{width:20,height:20,fill:"white"})))),gfe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17866_50609)"},l.createElement("path",{d:"M9.16927 5.83334H5.0026C4.56058 5.83334 4.13665 6.00893 3.82409 6.32149C3.51153 6.63405 3.33594 7.05798 3.33594 7.5V15C3.33594 15.442 3.51153 15.866 3.82409 16.1785C4.13665 16.4911 4.56058 16.6667 5.0026 16.6667H12.5026C12.9446 16.6667 13.3686 16.4911 13.6811 16.1785C13.9937 15.866 14.1693 15.442 14.1693 15V10.8333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M8.33594 11.6667L16.6693 3.33334",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.5 3.33334H16.6667V7.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17866_50609"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Afe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17866_4636)"},l.createElement("path",{d:"M3.33594 16.6667H6.66927L15.4193 7.91667C15.8613 7.47464 16.1096 6.87512 16.1096 6.25C16.1096 5.62488 15.8613 5.02536 15.4193 4.58333C14.9772 4.14131 14.3777 3.89298 13.7526 3.89298C13.1275 3.89298 12.528 4.14131 12.0859 4.58333L3.33594 13.3333V16.6667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.25 5.41667L14.5833 8.75",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17866_4636"},l.createElement("rect",{width:20,height:20,fill:"white"})))),$I=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_17866_50561)"},l.createElement("path",{d:"M14.1667 14.1667H15.8333C16.2754 14.1667 16.6993 13.9911 17.0118 13.6785C17.3244 13.366 17.5 12.942 17.5 12.5V9.16667C17.5 8.72464 17.3244 8.30072 17.0118 7.98816C16.6993 7.6756 16.2754 7.5 15.8333 7.5H4.16667C3.72464 7.5 3.30072 7.6756 2.98816 7.98816C2.67559 8.30072 2.5 8.72464 2.5 9.16667V12.5C2.5 12.942 2.67559 13.366 2.98816 13.6785C3.30072 13.9911 3.72464 14.1667 4.16667 14.1667H5.83333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M14.1693 7.5V4.16667C14.1693 3.72464 13.9937 3.30072 13.6811 2.98816C13.3686 2.67559 12.9446 2.5 12.5026 2.5H7.5026C7.06058 2.5 6.63665 2.67559 6.32409 2.98816C6.01153 3.30072 5.83594 3.72464 5.83594 4.16667V7.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.5026 10.8333H7.5026C6.58213 10.8333 5.83594 11.5795 5.83594 12.5V15.8333C5.83594 16.7538 6.58213 17.5 7.5026 17.5H12.5026C13.4231 17.5 14.1693 16.7538 14.1693 15.8333V12.5C14.1693 11.5
866795 13.4231 10.8333 12.5026 10.8333Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17866_50561"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Bm=rt(async function({clientId:t,documentId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/documents/${n}/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),Efe=rt(async function({clientId:t,signal:n}){const s=Se.getState().accessToken,r=Ke(`/clients/${t}/documents/`),i=await qe(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${s}`},signal:n}),o=await Ye(i);if(He(o))throw{httpCode:503,errorData:o.error};if(o.status==="error")throw{httpCode:i.status,errorData:o.error};if(!o.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return o.data}),xfe=rt(async function({clientId:t,body:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/documents/`),o=await qe(i,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify(n),signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data}),Cfe=rt(async function({clientId:t,documentId:n,body:s,signal:r}){const i=Se.getState().accessToken,o=Ke(`/clients/${t}/documents/${n}/`),c=await qe(o,{method:"PATCH",credentials:"include",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(s),signal:r}),u=await Ye(c);if(He(u))throw{httpCode:503,errorData:u.error};if(u.status==="error")throw{httpCode:c.status,errorData:u.error};if(!u.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return u.data}),yfe=rt(async function({clientId:t,documentId:n,exportType:s,signal:r}){const i=Se.getState().accessToken,o=Ke(`/clients/${t}/documents/${n}/export/`),c={exportType:s},u=await qe(o,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(c),signal:r,timeout:3e5}),d=await Ye(u);if(He(d))throw{httpCode:503,errorData:d.error};if(d.status==="error")throw{httpCode:u.status,errorData:d.error};if(!d.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return d.data}),bfe=rt(async function({clientId:t,documentId:n,signal:s}){const r=Se.getState().accessToken,i=Ke(`/clients/${t}/documents/${n}/`),o=await qe(i,{method:"DELETE",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s}),c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};if(!c.data)throw{httpCode:500,errorData:{code:"UNKNOWN_ERROR"}};return c.data});function Ife(e){if(e===null||typeof e!="object")return!1;const t=e;return t.httpCode===409||t.errorData?.code==="VERSION_CONFLICT"}function jP({name:e}){const t=e.trim();return t===""?!0:t===h.client.documents.NEW_DOCUMENT}const Sfe=5,vfe=3,_fe=3e3,w2=({clientId:e,documentId:t})=>`${e}:::${t}`,Hi=$n((e,t)=>{const n=new Map,s=new Map,r=new Map,i=new Map,o=w2,c=({key:B,status:F})=>{t().statusByKey[B]!==F&&e(z=>({statusByKey:{...z.statusByKey,[B]:F}}))},u=({key:B,document:F,sentContent:z})=>{try{s.get(B)?.onVersionSettled?.({document:F,sentContent:z})}catch{}},d=({key:B})=>{const F=r.get(B);F&&(clearTimeout(F),r.delete(B))},p=({key:B})=>{d({key:B});const F=setTimeout(()=>{r.delete(B),O({key:B})},_fe);r.set(B,F)},g=({meta:B})=>B.name!==void 0||B.documentType!==void 0,A=({entry:B})=>!!(B.contentDirty||g({meta:B.pendingMeta})),E=({key:B})=>{const F=n.get(B);return F?!(F.inflight||A({entry:F})||r.has(B)):!0},x=({key:B})=>{const F=i.get(B);F&&(i.delete(B),F.forEach(z=>z()))},y=({key:B})=>{d({key:B}),n.delete(B),s.delete(B),x({key:B}),e(F=>{const z={...F.statusByKey};return delete z[B],{statusByKey:z}})},I=({key:B})=>{const F=n.get(B);F&&F.released&&(F.inflight||A({entry:F})||r.has(B)||y({key:B}))},v=({entry:B,key:F})=>{B.released&&y({key:F})},S=({version:B,meta:F,lexicalJson:z})=>{const Q={version:B};return F.name!==void 0&&(Q.name=F.name),F.documentType!==void 0&&(Q.documentType=F.documentType),z!==void 0&&(Q.lexicalJson=z),Q},b=({contentDirty:B,resolver:F})=>{if(!B)return{sent:!1};if(!F)return{sent:!1};try{return{sent:!0,lexicalJson:F()}}catch{return{sent:!1}}},w=({clientId:B,documentId:F,baseVersion:z})=>{const Q=o({clientId:B,documentId:F}),M=n.get(Q);if(M)return M.released=!1,M.knownVersion===void 0&&(M.knownVersion=z),M;const K={clientId:B,documentId:F,inflight:!1,pendingMeta:{},contentDirty:!1,hasUserRenamePending:!1,userRenameInflight:!1,knownVersion:z,conflictRetries:0,errorRetries:0,released:!1};return n.set(Q,K),K},_=({entry:B,metaSnapshot:F,sentUserRename:z,sentContent:Q})=>{B.pendingMeta={...F,...B.pendingMeta},z&&(B.hasUserRenamePending=!0),Q&&(B.contentDirty=!0),B.userRenameInflight=!1},N=async({clientId:B,documentId:F,body:z})=>{try{return{ok:!0,document:await Cfe({clientId:B,documentId:F,body:z})}}catch(Q){return{ok:!1,error:Q}}},R=async({key:B})=>{const F=n.get(B);if(!F)return null;const z=s.get(B)?.onContentConflict;try{if(z)return await z();const Q=await Bm({clientId:F.clientId,documentId:F.documentId});return u({key:B,document:Q,sentContent:!1}),Q}catch{return null}},D=async({key:B,entry:F,metaSnapshot:z,sentUserRename:Q,sentContent:M})=>{if(n.get(B)!==F)return;if(F.conflictRetries>=Sfe){_({entry:F,metaSnapshot:z,sentUserRename:Q,sentContent:M}),F.inflight=!1,c({key:B,status:"error"}),v({entry:F,key:B}),x({key:B});return}F.conflictRetries+=1;const K=await R({key:B});if(n.get(B)===F){if(!K){_({entry:F,metaSnapshot:z,sentUserRename:Q,sentContent:M}),F.inflight=!1,c({key:B,status:"error"}),v({entry:F,key:B}),x({key:B});return}F.knownVersion=K.version,F.pendingMeta={...z,...F.pendingMeta},Q&&(F.hasUserRenamePending=!0),F.userRenameInflight=!1,!F.hasUserRenamePending&&F.pendingMeta.name!==void 0&&!jP({name:K.name})&&delete F.pendingMeta.name,F.inflight=!1,O({key:B})}},k=({key:B,entry:F,document:z,sentContent:Q})=>{if(n.get(B)===F){if(F.knownVersion=z.version,F.conflictRetries=0,F.errorRetries=0,F.inflight=!1,F.userRenameInflight=!1,d({key:B}),u({key:B,document:z,sentContent:Q}),A({entry:F})){O({key:B});return}c({key:B,status:"idle"}),I({key:B}),x({key:B})}},L=async({key:B})=>{const F=n.get(B);if(!F||F.knownVersion===void 0)return;const z=F.knownVersion,Q={...F.pendingMeta},M=F.hasUserRenamePending,K=s.get(B)?.resolveLexicalJson,W=b({contentDirty:F.contentDirty,resolver:K});if(!g({meta:Q})&&!W.sent){F.inflight=!1,c({key:B,status:"idle"}),I({key:B}),x({key:B});return}F.pendingMeta={},F.hasUserRenamePending=!1,M&&(F.userRenameInflight=!0),W.sent&&(F.contentDirty=!1);const j=S({version:z,meta:Q,lexicalJson:W.lexicalJson}),q=await N({clientId:F.clientId,documentId:F.documentId,body:j});if(n.get(B)===F){if(q.ok){k({key:B,entry:F,document:q.document,sentContent:W.sent});return}if(Ife(q.error)){await D({key:B,entry:F,metaSnapshot:Q,sentUserRename:M,sentContent:W.sent});return}if(_({entry:F,metaSnapshot:Q,sentUserRename:M,sentContent:W.sent}),F.inflight=!1,F.errorRetries>=vfe){c({key:B,status:"error"}),v({entry:F,key:B}),x({key:B});return}F.errorRetries+=1,c({key:B,status:"saving"}),p({key:B})}}
866,O=({key:B})=>{const F=n.get(B);F&&(F.inflight||A({entry:F})&&F.knownVersion!==void 0&&(d({key:B}),F.inflight=!0,c({key:B,status:"saving"}),L({key:B})))},P=({entry:B,name:F,isUserRename:z})=>{if(F!==void 0){if(z){B.pendingMeta.name=F,B.hasUserRenamePending=!0;return}B.hasUserRenamePending||B.userRenameInflight||(B.pendingMeta.name=F)}};return{statusByKey:{},registerDocumentWriteHandlers:({clientId:B,documentId:F,handlers:z})=>{const Q=o({clientId:B,documentId:F}),M=s.get(Q);if(!M){s.set(Q,z);return}s.set(Q,{...M,...z})},seedDocumentVersion:({clientId:B,documentId:F,version:z})=>{w({clientId:B,documentId:F,baseVersion:z})},enqueueDocumentMeta:({clientId:B,documentId:F,baseVersion:z,fields:Q,isUserRename:M})=>{const K=w({clientId:B,documentId:F,baseVersion:z});Q.documentType!==void 0&&(K.pendingMeta.documentType=Q.documentType),P({entry:K,name:Q.name,isUserRename:M}),O({key:o({clientId:B,documentId:F})})},enqueueDocumentContent:({clientId:B,documentId:F,baseVersion:z})=>{const Q=w({clientId:B,documentId:F,baseVersion:z});Q.contentDirty=!0,O({key:o({clientId:B,documentId:F})})},releaseDocumentWriteQueue:({clientId:B,documentId:F})=>{const z=o({clientId:B,documentId:F}),Q=n.get(z);if(!Q){s.delete(z);return}Q.released=!0,I({key:z})},flushPendingDocumentWrites:({clientId:B,documentId:F})=>{const z=o({clientId:B,documentId:F});try{s.get(z)?.flushPendingContent?.()}catch{}O({key:z})},waitForDocumentWriteQueueIdle:({clientId:B,documentId:F})=>{const z=o({clientId:B,documentId:F});return E({key:z})?Promise.resolve():new Promise(Q=>{const M=i.get(z);if(M){M.push(Q);return}i.set(z,[Q])})}}}),Tfe=({documentId:e,version:t})=>{const{id:n}=st(),{clientData:s}=zt(),r=s?.id?s.id:n||"",i=bt(),o=Hi(E=>E.enqueueDocumentMeta),c=Hi(E=>E.registerDocumentWriteHandlers),u=Hi(E=>E.releaseDocumentWriteQueue),d=w2({clientId:r,documentId:e}),p=Hi(E=>E.statusByKey[d]),g=l.useCallback(({document:E})=>{i.setQueryData(["clientDocuments",r],x=>x&&x.map(y=>y.id!==E.id?y:{...y,...E})),i.setQueryData(["clientDocument",r,e],x=>x?x.id!==E.id?x:{...x,...E}:E)},[r,e,i]),A=l.useCallback(({name:E})=>{c({clientId:r,documentId:e,handlers:{onVersionSettled:g}}
866),o({clientId:r,documentId:e,baseVersion:t,fields:{name:E},isUserRename:!0})},[r,e,t,g,c,o]);return l.useEffect(()=>{p==="error"&&ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})},[p]),l.useEffect(()=>()=>{u({clientId:r,documentId:e})},[r,e,u]),{enqueueRename:A,status:p}},BP=l.forwardRef(({documentId:e,name:t,version:n,onEditingChange:s},r)=>{const[i,o]=l.useState(!1),[c,u]=l.useState(t),d=l.useRef(null),p=l.useRef(!1),g=l.useRef(!1),{enqueueRename:A,status:E}=Tfe({documentId:e,version:n}),x=E==="saving";l.useEffect(()=>{s(i)},[i,s]),l.useEffect(()=>{i||u(t)},[t,i]),l.useLayoutEffect(()=>{if(!i)return;const b=d.current;b&&(b.focus(),b.select())},[i]);const y=l.useCallback(()=>{g.current||(u(t),o(!0))},[t]);l.useImperativeHandle(r,()=>({handleRename:y}),[y]);const I=l.useCallback(()=>{if(!i||x)return;const b=c.trim();if(!b){u(t),o(!1);return}if(b===t){o(!1);return}g.current=!0,A({name:b})},[i,x,c,t,A]);l.useEffect(()=>{g.current&&(E!=="idle"&&E!=="error"||(g.current=!1,E==="error"&&u(t),o(!1)))},[E,t]);const v=l.useCallback(b=>{if(b.key==="Enter"){b.preventDefault(),I();return}b.key==="Escape"&&(b.preventDefault(),p.current=!0,u(t),o(!1))},[I,t]),S=l.useCallback(()=>{if(p.current){p.current=!1;return}I()},[I]);return i?a.jsx("div",{className:"relative min-w-0",children:a.jsx("input",{ref:d,type:"text",value:c,onChange:b=>u(b.target.value),onKeyDown:v,onBlur:S,disabled:x,className:"roboto-flex-100-400-1 w-full rounded bg-white text-[16px] leading-[24px] text-zinc-950 outline-none focus:bg-zinc-100 focus:ring-0 disabled:opacity-60"})}):a.jsx("div",{className:"min-w-0",children:a.jsx("span",{className:"roboto-flex-100-400-1 block w-full min-w-0 select-none truncate text-left text-[16px] leading-[24px] text-zinc-950",children:t})})});BP.displayName="EditNameInput";const FP=({clientId:e,documentId:t})=>{const n=l.useRef(new Set),[s,r]=l.useState(!1),{mutateAsync:i,isPending:o}=tt({mutationFn:async({documentId:p})=>{if(!e)throw new Error("Missing client id");return yfe({clientId:e,documentId:p,exportType:"docx"})},onSuccess:p=>{const g=p?.urlDocx;if(!g){ve({type:"failed",message:h.client.quotes.EXPORT_FAILED,key:"DOCUMENT_EXPORT_FAILED"});return}A2({url:g})},onError:()=>{ve({type:"failed",message:h.client.quotes.EXPORT_FAILED,key:"DOCUMENT_EXPORT_FAILED"})}}),c=l.useCallback(async({documentId:p})=>{if(e){r(!0);try{const g=Hi.getState();g.flushPendingDocumentWrites({clientId:e,documentId:p}),await g.waitForDocumentWriteQueueIdle({clientId:e,documentId:p}),await i({documentId:p})}catch{}finally{n.current.delete(p),r(n.current.size>0),Ze(`DOCUMENT_EXPORT_PENDING:${p}`)}}},[e,i]);return{handleExportDocumentClick:l.useCallback(p=>{const A=p||t;e&&A&&(n.current.has(A)||(n.current.add(A),r(!0),ve({type:"pending",message:h.client.cases.messages.FORMING_DOCUMENT,key:`DOCUMENT_EXPORT_PENDING:${A}`,duration:0}),c({documentId:A})))},[e,t,c]),isExportDocumentPending:!!(s||o)}};function Ge(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function UP(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);n.search=s.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ko=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Nfe=ko&&"documentMode"in document?document.documentMode:null,co=ko&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),oc=ko&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),XA=!(!ko||!("InputEvent"in window)||Nfe)&&"getTargetRanges"in new window.InputEvent("input"),EE=ko&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Fm=ko&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,wfe=ko&&/Android/.test(navigator.userAgent),zP=ko&&/^(?=.*Chrome).*/i.test(navigator.userAgent),YI=ko&&wfe&&zP,xE=ko&&/AppleWeb
866Kit\/[\d.]+/.test(navigator.userAgent)&&co&&!zP,Rfe=0,Dfe=1,kfe=2,QP=128,Ofe=1,Pfe=2,Lfe=3,Mfe=4,jfe=5,Bfe=6,em=EE||Fm||xE?" ":"​",CE=`
867
868`,R2=oc?" ":em,Au={bold:1,capitalize:1024,code:16,highlight:QP,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Ffe={directionless:1,unmergeable:2},XI={center:2,end:6,justify:4,left:1,right:3,start:5},Ufe={[Pfe]:"center",[Bfe]:"end",[Mfe]:"justify",[Ofe]:"left",[Lfe]:"right",[jfe]:"start"},zfe={normal:0,segmented:2,token:1},Qfe={[Rfe]:"normal",[kfe]:"segmented",[Dfe]:"token"},Ww="$config";function HP(e,t,n,s,r,i){let o=e.getFirstChild();for(;o!==null;){const c=o.__key;o.__parent===t&&(Ne(o)&&HP(o,c,n,s,r,i),n.has(c)||i.delete(c),r.push(c)),o=o.getNextSibling()}}let JI=!1,D2=0;function Hfe(e){D2=e.timeStamp}function Zy(e,t,n){const s=e.nodeName==="BR",r=t.__lexicalLineBreak;return r&&(e===r||s&&e.previousSibling===r)||s&&kE(e,n)!==void 0}function Vfe(e,t,n){const s=vi(Si(n));let r=null,i=null;s!==null&&s.anchorNode===e&&(r=s.anchorOffset,i=s.focusOffset);const o=e.nodeValue;o!==null&&W2(t,o,r,i,!1)}function Gfe(e,t,n){if(Me(e)){const s=e.anchor.getNode();if(s.is(n)&&e.format!==s.getFormat())return!1}return pl(t)&&n.isAttached()}function qfe(e,t,n,s){for(let r=e;r&&!Kpe(r);r=Gm(r)){const i=kE(r,t);if(i!==void 0){const o=Xt(i,n);if(o)return nn(o)||!rr(r)?void 0:[r,o]}else if(r===s)return[s,XL(n)]}}function VP(e,t,n){JI=!0;const s=performance.now()-D2>100;try{ea(e,()=>{const r=We()||(function(A){return A.getEditorState().read(()=>{const E=We();return E!==null?E.clone():null})})(e),i=new Map,o=e.getRootElement(),c=e._editorState,u=e._blockCursorElement;let d=!1,p="";for(let A=0;A<t.length;A++){const E=t[A],x=E.type,y=E.target,I=qfe(y,e,c,o);if(!I)continue;const[v,S]=I;if(x==="characterData")s&&$e(S)&&pl(y)&&Gfe(r,y,S)&&Vfe(y,S,e);else if(x==="childList"){d=!0;const b=E.addedNodes;for(let N=0;N<b.length;N++){const R=b[N],D=$L(R),k=R.parentNode;if(k!=null&&R!==u&&D===null&&!Zy(R,k,e)){if(oc){const L=(rr(R)?R.innerText:null)||R.nodeValue;L&&(p+=L)}k.removeChild(R)}}const w=E.removedNodes,_=w.length;if(_>0){let N=0;for(let R=0;R<_;R++){const D=w[R];(Zy(D,y,e)||u===D)&&(y.appendChild(D),N++)}_!==N&&i.set(v,S)}}}if(i.size>0)for(const[A,E]of i)E.reconcileObservedMutation(A,e);const g=n.takeRecords();if(g.length>0){for(let A=0;A<g.length;A++){const E=g[A],x=E.addedNodes,y=E.target;for(let I=0;I<x.length;I++){const v=x[I],S=v.parentNode;S==null||v.nodeName!=="BR"||Zy(v,y,e)||S.removeChild(v)}}n.takeRecords()}r!==null&&(d&&as(r),oc&&tM(e)&&r.insertRawText(p))})}finally{JI=!1}}function GP(e){const t=e._observer;t!==null&&VP(e,t.takeRecords(),t)}function qP(e){(function(t){D2===0&&Si(t).addEventListener("textInput",Hfe,!0)})(e),e._observer=new MutationObserver((t,n)=>{VP(e,t,n)})}let Wfe=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||Xfe).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function k2(e,t){return new Wfe(e,t)}function Nh(e,t,n="latest"){const s=(n==="latest"?e.getLatest():e).__state;return s?s.getValue(t):t.defaultValue}function Kfe(e){const t=new Map,n=new Set;for(let s=typeof e=="function"?e:e.replace;s.prototype&&s.prototype.getType!==void 0;s=Object.getPrototypeOf(s)){const{ownNodeConfig:r}=OE(s);if(r&&r.stateConfigs)for(const i of r.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&n.add(o.key)):o=i,t.set(o.key,o)}}return{flatKeys:n,sharedConfigMap:t}}let $fe=class WP{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,s=void 0,r=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=s,this.knownState=r;const{sharedConfigMap:o}=this.sharedNodeState,c=i!==void 0?i:(function(u,d,p){let g=p.size;if(d)for(const A in d){const E=u.get(A);E&&p.has(E)||g++}return g})(o,s,r);this.size=c}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let s=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const r=this.unknownState[t.key];r!==void 0&&(s=t.parse(r)),this.updateFromKnown(t,s)}return s}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[s,r]of this.knownState)s.isEqual(r,s.defaultValue)?delete t[s.key]:t[s.key]=s.unparse(r);for(const s of this.sharedNodeState.flatKeys)s in t&&(n[s]=t[s],delete t[s]);return Kw(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:s}=this,r=new Map(this.knownState);return new WP(t,n,(function(i,o,c){let u;if(c)for(const[d,p]of Object.entries(c)){const g=i.get(d);g?o.has(g)||o.set(g,g.parse(p)):(u=u||{},u[d]=p)}return u})(n.sharedConfigMap,r,s),r,this.size)}resetOnCopyNode(){for(const t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,n){const s=t.key;this.sharedNodeState.sharedConfigMap.set(s,t);const{knownState:r,unknownState:i}=this;r.has(t)||i&&s in i||(i&&(delete i[s],this.unknownState=Kw(i)),this.size++),r.set(t,n)}updateFromUnknown(t,n){const s=this.sharedNodeState.sharedConfigMap.get(t);s?this.updateFromKnown(s,s.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const s of n.keys())n.set(s,s.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[s,r]of Object.entries(t))this.updateFromUnknown(s,r)}};function Yfe(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new $fe(t,KP(t));return t.__state=n,n}function KP(e){return e.__state?e.__state.sharedNodeState:HL(X2(),e.getType()).sharedNodeState}function Kw(e){if(e)for(const t in e)return e}function Xfe(e){return e}function $w(e,t,n){for(const[s,r]of t.knownState){if(e.has(s.key))continue;e.add(s.key);const i=n?n.getValue(s):s.defaultValue;if(i!==r&&!s.isEqual(i,r))return!0}return!1}
868function Yw(e,t,n){const{unknownState:s}=t,r=n?n.unknownState:void 0;if(s){for(const[i,o]of Object.entries(s))if(!e.has(i)&&(e.add(i),o!==(r?r[i]:void 0)))return!0}return!1}function Xw(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Jw(e,t){const n=e.__mode,s=e.__format,r=e.__style,i=t.__mode,o=t.__format,c=t.__style,u=e.__state,d=t.__state;return(n===null||n===i)&&(s===null||s===o)&&(r===null||r===c)&&(e.__state===null||u===d||(function(p,g){if(p===g)return!0;if(p&&g&&p.size!==g.size)return!1;const A=new Set;return!(p&&$w(A,p,g)||g&&$w(A,g,p)||p&&Yw(A,p,g)||g&&Yw(A,g,p))})(u,d))}function Zw(e,t){const n=e.mergeWithSibling(t),s=Ln()._normalizedNodes;return s.add(e.__key),s.add(t.__key),n}function eR(e){let t,n,s=e;if(s.__text!==""||!s.isSimpleText()||s.isUnmergeable()){for(;(t=s.getPreviousSibling())!==null&&$e(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Jw(t,s)){s=Zw(t,s);break}break}t.remove()}for(;(n=s.getNextSibling())!==null&&$e(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Jw(s,n)){s=Zw(s,n);break}break}n.remove()}}else s.remove()}function JA(e){return tR(e.anchor),tR(e.focus),e}function tR(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let s,r;if(n===t.getChildrenSize()?(s=t.getChildAtIndex(n-1),r=!0):(s=t.getChildAtIndex(n),r=!1),$e(s)){e.set(s.__key,r?s.getTextContentSize():0,"text",!0);break}if(!Ne(s))break;e.set(s.__key,r?s.getChildrenSize():0,"element",!0)}}let Eu,nr,tm,yE,ZI,eS,xu,mo,tS,nm,ks="",Uo=null,Wc=null,Hd=!1,ZA=!1;function e1(e,t){const n=xu.get(e);if(t!==null){const s=iS(e);s.parentNode===t&&t.removeChild(s)}if(mo.has(e)||nr._keyToDOMMap.delete(e),Ne(n)){const s=n1(n,xu);nS(s,0,s.length-1,null)}n!==void 0&&K2(nm,tm,yE,n,"destroyed")}function nS(e,t,n,s){for(let r=t;r<=n;++r){const i=e[r];i!==void 0&&e1(i,s)}}function Qc(e,t){e.setProperty("text-align",t)}const Jfe="40px";function $P(e,t){const n=Eu.theme.indent;if(typeof n=="string"){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty("padding-inline-start","");const s=getComputedStyle(nr._rootElement||e).getPropertyValue("--lexical-indent-base-value")||Jfe;e.style.setProperty("padding-inline-start",`calc(${t} * ${s})`)}function YP(e,t){const n=e.style;t===0?Qc(n,""):t===1?Qc(n,"left"):t===2?Qc(n,"center"):t===3?Qc(n,"right"):t===4?Qc(n,"justify"):t===5?Qc(n,"start"):t===6&&Qc(n,"end")}function sS(e,t){const n=(function(s){const r=s.__dir;if(r!==null)return r;if(Os(s))return null;const i=s.getParentOrThrow();return Os(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function t1(e,t){const n=mo.get(e);n===void 0&&Ge(60);const s=n.createDOM(Eu,nr);if((function(r,i,o){const c=o._keyToDOMMap;(function(u,d,p){const g=`__lexicalKey_${d._key}`;u[g]=p})(i,o,r),c.set(r,i)})(e,s,nr),$e(n)?s.setAttribute("data-lexical-text","true"):nn(n)&&s.setAttribute("data-lexical-decorator","true"),Ne(n)){const r=n.__indent,i=n.__size;if(sS(s,n),r!==0&&$P(s,r),i!==0){const c=i-1;rS(n1(n,mo),n,0,c,n.getDOMSlot(s))}const o=n.__format;o!==0&&YP(s,o),n.isInline()||XP(null,n,s)}else{const r=n.getTextContent();if(nn(n)){const i=n.decorate(nr,Eu);i!==null&&JP(e,i),s.contentEditable="false"}ks+=r}return t!==null&&t.insertChild(s),K2(nm,tm,yE,n,"created"),s}function rS(e,t,n,s,r){const i=ks;ks="";let o=n;for(;o<=s;++o){t1(e[o],r);const c=mo.get(e[o]);c!==null&&$e(c)?Uo===null&&(Uo=c.getFormat(),Wc=c.getStyle()):Ne(c)&&o<s&&!c.isInline()&&(ks+=CE)}r.element.__lexicalTextContent=ks,ks=i+ks}function nR(e,t){if(e){const n=e.__last;if(n){const s=t.get(n);if(s)return Zo(s)?"line-break":nn(s)&&s.isInline()?"decorator":null}return"empty"}return null}function XP(e,t,n){const s=nR(e,xu),r=nR(t,mo);s!==r&&t.getDOMSlot(n).setManagedLineBreak(r)}function Zfe(e,t,n){var s;Uo=null,Wc=null,(function(r,i,o){const c=ks,u=r.__size,d=i.__size;ks="";const p=o.element;if(u===1&&d===1){const g=r.__first,A=i.__first;if(g===A)pA(g,p);else{const x=iS(g),y=t1(A,null);try{p.replaceChild(y,x)}catch(I){if(typeof I=="object"&&I!=null){const v=`${I.toString()} Parent: ${p.tagName}, new child: {tag: ${y.tagName} key: ${A}}, old child: {tag: ${x.tagName}, key: ${g}}.`;throw new Error(v)}throw I}e1(g,null)}const E=mo.get(A);$e(E)&&Uo===null&&(Uo=E.getFormat(),Wc=E.getStyle())}else{const g=n1(r,xu),A=n1(i,mo);if(g.length!==u&&Ge(227),A.length!==d&&Ge(228),u===0)d!==0&&rS(A,0,0,d-1,o);else if(d===0){if(u!==0){const E=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;nS(g,0,u-1,E?null:p),E&&(p.textContent="")}}else(function(E,x,y,I,v,S){const b=I-1,w=v-1;let _,N,R=S.getFirstChild(),D=0,k=0;for(;D<=b&&k<=w;){const P=x[D],B=y[k];if(P===B)R=eb(pA(B,S.element)),D++,k++;else{if(N===void 0&&(N=sR(y,k)),_===void 0)_=sR(x,D);else if(!_.has(P)){D++;continue}if(!N.has(P)){R=eb(iS(P)),e1(P,S.element),D++,_.delete(P);continue}if(_.has(B)){const z=vf(nr,B);z!==R&&S.withBefore(R).insertChild(z),R=eb(pA(B,S.element)),D++,k++}else t1(B,S.withBefore(R)),k++}const F=mo.get(B);F!==null&&$e(F)?Uo===null&&(Uo=F.getFormat(),Wc=F.getStyle()):Ne(F)&&k<=w&&!F.isInline()&&(ks+=CE)}const L=D>b,O=k>w;if(L&&!O){const P=y[w+1],B=P===void 0?null:nr.getElementByKey(P);rS(y,0,k,w,S.withBefore(B))}else O&&!L&&nS(x,D,b,S.element)})(0,g,A,u,d,o)}p.__lexicalTextContent=ks,ks=c+ks})(e,t,t.getDOMSlot(n)),s=t,Uo==null||Uo===s.__textFormat||ZA||s.setTextFormat(Uo),(function(r){Wc==null||Wc===r.__textStyle||ZA||r.setTextStyle(Wc)})(t)}function n1(e,t){const n=[];let s=e.__first;for(;s!==null;){const r=t.get(s);r===void 0&&Ge(101),n.push(s),s=r.__next}return n}function pA(e,t){const n=xu.get(e);let s=mo.get(e);n!==void 0&&s!==void 0||Ge(61);const r=Hd||eS.has(e)||ZI.has(e),i=vf(nr,e);if(n===s&&!r){let o;if(Ne(n)){const c=i.__lexicalTextContent;typeof c=="string"?o=c:(o=n.getTextContent(),i.__lexicalTextContent=o)}else o=n.getTextContent();return ks+=o,i}if(n!==s&&r&&K2(nm,tm,yE,s,"updated"),s.updateDOM(n,i,Eu)){const o=t1(e,null);return t===null&&Ge(62),t.replaceChild(o,i),e1(e,null),o}if(Ne(n)){Ne(s)||Ge(334,e);const o=s.__indent;(Hd||o!==n.__indent)&&$P(i,o);const c=s.__format;if((Hd||c!==n.__format)&&YP(i,c),r)Zfe(n,s,i),Os(s)||s.isInline()||XP(n,s,i);else{const u=i.__lexicalTextContent;let d;typeof u=="string"?d=u:(d=n.getTextContent(),i.__lexicalTextContent=d),ks+=d}
868if((Hd||s.__dir!==n.__dir)&&(sS(i,s),Os(s)&&!Hd))for(const u of s.getChildren())Ne(u)&&sS(vf(nr,u.getKey()),u)}else{const o=s.getTextContent();if(nn(s)){const c=s.decorate(nr,Eu);c!==null&&JP(e,c)}ks+=o}if(!ZA&&Os(s)&&s.__cachedText!==ks){const o=s.getWritable();o.__cachedText=ks,s=o}return i}function JP(e,t){let n=nr._pendingDecorators;const s=nr._decorators;if(n===null){if(s[e]===t)return;n=YL(nr)}n[e]=t}function eb(e){let t=e.nextSibling;return t!==null&&t===nr._blockCursorElement&&(t=t.nextSibling),t}function sR(e,t){const n=new Set;for(let s=t;s<e.length;s++)n.add(e[s]);return n}function epe(e,t,n,s,r,i){ks="",Hd=s===2,nr=n,Eu=n._config,tm=n._nodes,yE=nr._listeners.mutation,ZI=r,eS=i,xu=e._nodeMap,mo=t._nodeMap,ZA=t._readOnly,tS=new Map(n._keyToDOMMap);const o=new Map;return nm=o,pA("root",null),nr=void 0,tm=void 0,ZI=void 0,eS=void 0,xu=void 0,mo=void 0,Eu=void 0,tS=void 0,nm=void 0,o}function iS(e){const t=tS.get(e);return t===void 0&&Ge(75,e),t}function mt(e){return{type:e}}const Um=mt("SELECTION_CHANGE_COMMAND"),ZP=mt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),eL=mt("CLICK_COMMAND"),tL=mt("BEFORE_INPUT_COMMAND"),nL=mt("INPUT_COMMAND"),sL=mt("COMPOSITION_START_COMMAND"),rL=mt("COMPOSITION_END_COMMAND"),el=mt("DELETE_CHARACTER_COMMAND"),Jl=mt("INSERT_LINE_BREAK_COMMAND"),Cu=mt("INSERT_PARAGRAPH_COMMAND"),ru=mt("CONTROLLED_TEXT_INSERTION_COMMAND"),bE=mt("PASTE_COMMAND"),sm=mt("REMOVE_TEXT_COMMAND"),yu=mt("DELETE_WORD_COMMAND"),bu=mt("DELETE_LINE_COMMAND"),mr=mt("FORMAT_TEXT_COMMAND"),IE=mt("UNDO_COMMAND"),SE=mt("REDO_COMMAND"),iL=mt("KEYDOWN_COMMAND"),oL=mt("KEY_ARROW_RIGHT_COMMAND"),tpe=mt("MOVE_TO_END"),O2=mt("KEY_ARROW_LEFT_COMMAND"),aL=mt("MOVE_TO_START"),lL=mt("KEY_ARROW_UP_COMMAND"),cL=mt("KEY_ARROW_DOWN_COMMAND"),rm=mt("KEY_ENTER_COMMAND"),uL=mt("KEY_SPACE_COMMAND"),vE=mt("KEY_BACKSPACE_COMMAND"),dL=mt("KEY_ESCAPE_COMMAND"),P2=mt("KEY_DELETE_COMMAND"),fL=mt("KEY_TAB_COMMAND"),npe=mt("INSERT_TAB_COMMAND"),pL=mt("INDENT_CONTENT_COMMAND"),oS=mt("OUTDENT_CONTENT_COMMAND"),hL=mt("DROP_COMMAND"),mL=mt("FORMAT_ELEMENT_COMMAND"),gL=mt("DRAGSTART_COMMAND"),AL=mt("DRAGOVER_COMMAND"),spe=mt("DRAGEND_COMMAND"),_E=mt("COPY_COMMAND"),TE=mt("CUT_COMMAND"),im=mt("SELECT_ALL_COMMAND"),rpe=mt("CLEAR_EDITOR_COMMAND"),ipe=mt("CLEAR_HISTORY_COMMAND"),gh=mt("CAN_REDO_COMMAND"),Ah=mt("CAN_UNDO_COMMAND"),ope=mt("FOCUS_COMMAND"),ape=mt("BLUR_COMMAND"),lpe=mt("KEY_MODIFIER_COMMAND"),Qa=Object.freeze({}),aS=[["keydown",function(e,t){om=e.timeStamp,EL=e.key,!t.isComposing()&&it(t,iL,e)}],["pointerdown",function(e,t){const n=e.target,s=e.pointerType;$f(n)&&s!=="touch"&&s!=="pen"&&e.button===0&&ea(t,()=>{VL(n)||(uS=!0)})}],["compositionstart",function(e,t){it(t,sL,e)}],["compositionend",function(e,t){oc?Eh=!0:Fm||!EE&&!xE?it(t,rL,e):(hA=!0,mA=e.data)}],["input",function(e,t){e.stopPropagation(),ea(t,()=>{t.dispatchCommand(nL,e)},{event:e}),Vd=null}],["click",function(e,t){ea(t,()=>{const n=We(),s=vi(Si(t)),r=Vu();if(s){if(Me(n)){const i=n.anchor,o=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!Os(o)&&St().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&r!==null&&n.is(r))s.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&o!==n.focus.getNode()){const c=Vs(o,u=>Ne(u)&&!u.isInline());Ne(c)&&c.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=s.anchorNode;(rr(i)||pl(i))&&as(M2(r,s,t,e))}}it(t,eL,e)})}],["cut",Qa],["copy",Qa],["dragstart",Qa],["dragover",Qa],["dragend",Qa],["paste",Qa],["focus",Qa],["blur",Qa],["drop",Qa]];XA&&aS.push(["beforeinput",(e,t)=>(function(n,s){const r=n.inputType;r==="deleteCompositionText"||oc&&tM(s)||r!=="insertCompositionText"&&it(s,tL,n)})(e,t)]);let om=0,EL=null,xL=0,Vd=null;const lS=new WeakMap,s1=new WeakMap;let cS=!1,uS=!1,wh=!1,Eh=!1,hA=!1,mA="",$c=null,CL=[0,"",0,"root",0];function yL(e,t,n,s,r){const i=e.anchor,o=e.focus,c=i.getNode(),u=Ln(),d=vi(Si(u)),p=d!==null?d.anchorNode:null,g=i.key,A=u.getElementByKey(g),E=n.length;return g!==o.key||!$e(c)||(!r&&(!XA||xL<s+50)||c.isDirty()&&E<2||JL(n))&&i.offset!==o.offset&&!c.isComposing()||Ho(c)||c.isDirty()&&E>1||(r||!XA)&&A!==null&&!c.isComposing()&&p!==Sf(A)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||(function(x,y){if(y.isSegmented())return!0;
868if(!x.isCollapsed())return!1;const I=x.anchor.offset,v=y.getParentOrThrow(),S=ou(y);return I===0?!y.canInsertTextBefore()||!v.canInsertTextBefore()&&!y.isComposing()||S||(function(b){const w=b.getPreviousSibling();return($e(w)||Ne(w)&&w.isInline())&&!w.canInsertTextAfter()})(y):I===y.getTextContentSize()&&(!y.canInsertTextAfter()||!v.canInsertTextAfter()&&!y.isComposing()||S)})(e,c)}function rR(e,t){return pl(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function iR(e,t,n){const{anchorNode:s,anchorOffset:r,focusNode:i,focusOffset:o}=e;cS&&(cS=!1,rR(s,r)&&rR(i,o)&&!$c)||ea(t,()=>{if(!n)return void as(null);if(!Vm(t,s,i))return;let c=We();if($c&&Me(c)&&c.isCollapsed()){const u=c.anchor,d=$c.anchor;(u.key===d.key&&u.offset===d.offset+1||u.offset===1&&d.getNode().is(u.getNode().getPreviousSibling()))&&(c=$c.clone(),as(c))}if($c=null,Me(c)){const u=c.anchor,d=u.getNode();if(c.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(c.dirty=!0);const p=Si(t).event,g=p?p.timeStamp:performance.now(),[A,E,x,y,I]=CL,v=St(),S=t.isComposing()===!1&&v.getTextContent()==="";if(g<I+200&&u.offset===x&&u.key===y)gA(c,A,E);else if(u.type==="text")$e(d)||Ge(141),bL(c,d);else if(u.type==="element"&&!S){Ne(d)||Ge(259);const b=u.getNode();b.isEmpty()?(function(w,_){const N=_.getTextFormat(),R=_.getTextStyle();gA(w,N,R)})(c,b):gA(c,c.format,"")}}else{const p=u.key,g=c.focus.key,A=c.getNodes(),E=A.length,x=c.isBackward(),y=x?o:r,I=x?r:o,v=x?g:p,S=x?p:g;let b=2047,w=!1;for(let _=0;_<E;_++){const N=A[_],R=N.getTextContentSize();if($e(N)&&R!==0&&!(_===0&&N.__key===v&&y===R||_===E-1&&N.__key===S&&I===0)&&(w=!0,b&=N.getFormat(),b===0))break}c.format=w?b:0}}it(t,Um,void 0)})}function gA(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function bL(e,t){gA(e,t.getFormat(),t.getStyle())}function IL(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function cpe(e){const t=e.inputType,n=IL(e),s=Ln(),r=We();if(t==="deleteContentBackward"){if(r===null){const g=Vu();if(!Me(g))return!0;as(g.clone())}if(Me(r)){const g=r.anchor.key===r.focus.key;if(i=e.timeStamp,EL==="MediaLast"&&i<om+30&&s.isComposing()&&g){if(tr(null),om=0,setTimeout(()=>{ea(s,()=>{tr(null)})},30),Me(r)){const A=r.anchor.getNode();A.markDirty(),$e(A)||Ge(142),bL(r,A)}}else{tr(null),e.preventDefault();const A=r.anchor.getNode(),E=A.getTextContent(),x=A.canInsertTextAfter(),y=r.anchor.offset===0&&r.focus.offset===E.length;let I=YI&&g&&!y&&x;if(I&&r.isCollapsed()&&(I=!nn(gS(r.anchor,!0))),!I){it(s,el,!0);const v=We();YI&&Me(v)&&v.isCollapsed()&&($c=v,setTimeout(()=>$c=null))}}return!0}}var i;if(!Me(r))return!0;const o=e.data;Vd!==null&&q2(!1,s,Vd),r.dirty&&Vd===null||!r.isCollapsed()||Os(r.anchor.getNode())||n===null||r.applyDOMRange(n),Vd=null;const c=r.anchor,u=r.focus,d=c.getNode(),p=u.getNode();if(t==="insertText"||t==="insertTranspose"){if(o===`
869`)e.preventDefault(),it(s,Jl,!1);else if(o===CE)e.preventDefault(),it(s,Cu,void 0);else if(o==null&&e.dataTransfer){const g=e.dataTransfer.getData("text/plain");e.preventDefault(),r.insertRawText(g)}else o!=null&&yL(r,n,o,e.timeStamp,!0)?(e.preventDefault(),it(s,ru,o)):Vd=o;return xL=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":it(s,ru,e);break;case"insertFromComposition":tr(null),it(s,ru,e);break;case"insertLineBreak":tr(null),it(s,Jl,!1);break;case"insertParagraph":tr(null),wh&&!Fm?(wh=!1,it(s,Jl,!1)):it(s,Cu,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":it(s,bE,e);break;case"deleteByComposition":(function(g,A){return g!==A||Ne(g)||Ne(A)||!ou(g)||!ou(A)})(d,p)&&it(s,sm,e);break;case"deleteByDrag":case"deleteByCut":it(s,sm,e);break;case"deleteContent":it(s,el,!1);break;case"deleteWordBackward":it(s,yu,!0);break;
869case"deleteWordForward":it(s,yu,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":it(s,bu,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":it(s,bu,!1);break;case"formatStrikeThrough":it(s,mr,"strikethrough");break;case"formatBold":it(s,mr,"bold");break;case"formatItalic":it(s,mr,"italic");break;case"formatUnderline":it(s,mr,"underline");break;case"historyUndo":it(s,IE,void 0);break;case"historyRedo":it(s,SE,void 0)}return!0}function upe(e){if(rr(e.target)&&VL(e.target))return!0;const t=Ln(),n=We(),s=e.data,r=IL(e);if(s!=null&&Me(n)&&yL(n,r,s,e.timeStamp,!1)){Eh&&(r1(t,s),Eh=!1);const i=n.anchor.getNode(),o=vi(Si(t));if(o===null)return!0;const c=n.isBackward(),u=c?n.anchor.offset:n.focus.offset,d=c?n.focus.offset:n.anchor.offset;XA&&!n.isCollapsed()&&$e(i)&&o.anchorNode!==null&&i.getTextContent().slice(0,u)+s+i.getTextContent().slice(u+d)===eM(o.anchorNode)||it(t,ru,s);const p=s.length;oc&&p>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=p),YI&&t.isComposing()&&(om=0,tr(null))}else q2(!1,t,s!==null?s:void 0),Eh&&(r1(t,s||void 0),Eh=!1);return(function(){fr();const i=Ln();GP(i)})(),!0}function dpe(e){const t=Ln(),n=We();if(Me(n)&&!t.isComposing()){const s=n.anchor,r=n.anchor.getNode();tr(s.key),$2(TL),(e.timeStamp<om+30||s.type==="element"||!n.isCollapsed()||r.getFormat()!==n.format||$e(r)&&r.getStyle()!==n.style)&&it(t,ru,R2)}return!0}function fpe(e){return r1(Ln(),e.data),$2(NL),!0}function r1(e,t){const n=e._compositionKey;if(tr(null),n!==null&&t!=null){if(t===""){const s=Xt(n),r=Sf(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&$e(s)){const i=vi(Si(e));let o=null,c=null;i!==null&&i.anchorNode===r&&(o=i.anchorOffset,c=i.focusOffset),W2(s,r.nodeValue,o,c,!0)}return}if(t[t.length-1]===`
870`){const s=We();if(Me(s)||Qr(s)){if(Me(s)){const r=s.focus;s.anchor.set(r.key,r.offset,r.type)}return void it(e,rm,null)}}}q2(!0,e,t)}function ppe(e){const t=Ln();if(e.key==null)return!0;if(hA){if(kR(e))return ea(t,()=>{r1(t,mA)}),hA=!1,mA="",!0;hA=!1,mA=""}if((function(n){return An(n,"ArrowRight",{shiftKey:"any"})})(e))it(t,oL,e);else if((function(n){return An(n,"ArrowRight",Va)})(e))it(t,tpe,e);else if((function(n){return An(n,"ArrowLeft",{shiftKey:"any"})})(e))it(t,O2,e);else if((function(n){return An(n,"ArrowLeft",Va)})(e))it(t,aL,e);else if((function(n){return An(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))it(t,lL,e);else if((function(n){return An(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))it(t,cL,e);else if((function(n){return An(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))wh=!0,it(t,rm,e);else if((function(n){return n.key===" "})(e))it(t,uL,e);else if((function(n){return co&&An(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),wh=!0,it(t,Jl,!0);else if((function(n){return An(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))wh=!1,it(t,rm,e);else if((function(n){return An(n,"Backspace",{shiftKey:"any"})||co&&An(n,"h",{ctrlKey:!0})})(e))kR(e)?it(t,vE,e):(e.preventDefault(),it(t,el,!0));else if((function(n){return n.key==="Escape"})(e))it(t,dL,e);else if((function(n){return An(n,"Delete",{})||co&&An(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?it(t,P2,e):(e.preventDefault(),it(t,el,!1));else if((function(n){return An(n,"Backspace",DR)})(e))e.preventDefault(),it(t,yu,!0);else if((function(n){return An(n,"Delete",DR)})(e))e.preventDefault(),it(t,yu,!1);else if((function(n){return co&&An(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),it(t,bu,!0);else if((function(n){return co&&(An(n,"Delete",{metaKey:!0})||An(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),it(t,bu,!1);else if((function(n){return An(n,"b",Va)})(e))e.preventDefault(),it(t,mr,"bold");else if((function(n){return An(n,"u",Va)})(e))e.preventDefault(),it(t,mr,"underline");else if((function(n){return An(n,"i",Va)})(e))e.preventDefault(),it(t,mr,"italic");else if((function(n){return An(n,"Tab",{shiftKey:"any"})})(e))it(t,fL,e);else if((function(n){return An(n,"z",Va)})(e))e.preventDefault(),it(t,IE,void 0);else if((function(n){return co?An(n,"z",{metaKey:!0,shiftKey:!0}):An(n,"y",{ctrlKey:!0})||An(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),it(t,SE,void 0);else{const n=t._editorState._selection;n===null||Me(n)?OR(e)&&(e.preventDefault(),it(t,im,e)):(function(s){return An(s,"c",Va)})(e)?(e.preventDefault(),it(t,_E,e)):(function(s){return An(s,"x",Va
870)})(e)?(e.preventDefault(),it(t,TE,e)):OR(e)&&(e.preventDefault(),it(t,im,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(lpe,e),!0}function SL(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const cf=new Map;function vL(e){const t=Gpe(e.target);if(t===null)return;const n=GL(t.anchorNode);if(n===null)return;uS&&(uS=!1,ea(n,()=>{const u=Vu(),d=t.anchorNode;(rr(d)||pl(d))&&as(M2(u,t,n,e))}));const s=G2(n),r=s[s.length-1],i=r._key,o=cf.get(i),c=o||r;c!==n&&iR(t,c,!1),iR(t,n,!0),n!==r?cf.set(i,n):o&&cf.delete(i)}function oR(e){e._lexicalHandled=!0}function aR(e){return e._lexicalHandled===!0}function hpe(e){const t=lS.get(e);if(t===void 0)return;const n=s1.get(t);if(n===void 0)return;const s=n-1;s>=0||Ge(164),lS.delete(e),s1.set(t,s),s===0&&t.removeEventListener("selectionchange",vL);const r=DE(e);V2(r)?((function(o){if(o._parentEditor!==null){const c=G2(o),u=c[c.length-1]._key;cf.get(u)===o&&cf.delete(u)}else cf.delete(o._key)})(r),e.__lexicalEditor=null):r&&Ge(198);const i=SL(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function dS(e,t,n){fr();const s=e.__key,r=e.getParent();if(r===null)return;const i=(function(c){const u=We();if(!Me(u)||!Ne(c))return u;const{anchor:d,focus:p}=u,g=d.getNode(),A=p.getNode();return _f(g,c)&&d.set(c.__key,0,"element"),_f(A,c)&&p.set(c.__key,0,"element"),u})(e);let o=!1;if(Me(i)&&t){const c=i.anchor,u=i.focus;c.key===s&&(a1(c,e,r,e.getPreviousSibling(),e.getNextSibling()),o=!0),u.key===s&&(a1(u,e,r,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Qr(i)&&t&&e.isSelected()&&e.selectPrevious();if(Me(i)&&t&&!o){const c=e.getIndexWithinParent();au(e),o1(i,r,c,-1)}else au(e);n||Yr(r)||r.canBeEmpty()||!r.isEmpty()||dS(r,t),t&&i&&Os(r)&&r.isEmpty()&&r.selectEnd()}const _L=Symbol.for("ephemeral");function i1(e){return e[_L]||!1}class Jo{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=OE(this);return t===void 0&&Ge(64,this.name),t}static clone(t){Ge(65,this.name)}$config(){return{}}config(t,n){const s=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:s,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}resetOnCopyNodeFrom(t){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),KL(this,t)}getType(){return this.__type}isInline(){Ge(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Xt(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||We();if(n==null)return!1;const s=n.getNodes().some(r=>r.__key===this.__key);if($e(this))return s;if(Me(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const r=this.getParent();if(nn(this)&&this.isInline()&&r){const i=n.isBackward()?n.focus:n.anchor;if(r.is(i.getNode())&&i.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return s}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),s=0;for(;n!==null;){if(this.is(n))return s;s++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Xt(t)}getParentOrThrow(){const t=this.getParent();return t===null&&Ge(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(Yr(n))return Ne(t)||t===this&&nn(t)||Ge(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&Ge(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Xt(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let s=n.getFirstChild();for(;s!==null&&!s.is(this);)t.push(s),s=s.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Xt(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=Ne(this)?this:this.getParent(),s=Ne(t)?t:t.getParent(),r=n&&s?EA(n,s):null;return r?r.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=EA(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?aM(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&Ge(279),!1)))}isParentOf(t){const n=EA(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),s=[],r=new Set;let i=this;for(;i!==null;){const o=i.__key;
870if(r.has(o)||(r.add(o),s.push(i)),i===t)break;const c=Ne(i)?n?i.getFirstChild():i.getLastChild():null;if(c!==null){i=c;continue}const u=n?i.getNextSibling():i.getPreviousSibling();if(u!==null){i=u;continue}const d=i.getParentOrThrow();if(r.has(d.__key)||s.push(d),d===t)break;let p=null,g=d;do{if(g===null&&Ge(68),p=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;p!==null||r.has(g.__key)||s.push(g)}while(p===null);i=p}return n||s.reverse(),s}isDirty(){const t=Ln()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(i1(this))return this;const t=Xt(this.__key);return t===null&&Ge(113),t}getWritable(){if(i1(this))return this;fr();const t=Ec(),n=Ln(),s=t._nodeMap,r=this.__key,i=this.getLatest(),o=n._cloneNotNeeded,c=We();if(c!==null&&c.setCachedNodes(null),o.has(r))return c1(i),i;const u=sM(i);return o.add(r),c1(u),s.set(r,u),u}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){Ge(70)}updateDOM(t,n,s){Ge(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){Ge(18,this.name)}updateFromJSON(t){return(function(n,s){const r=n.getWritable(),i=s.$;let o=i;for(const c of KP(r).flatKeys)c in s&&(o!==void 0&&o!==i||(o={...i}),o[c]=s[c]);return(r.__state||o)&&Yfe(n).updateFromJSON(o),r})(this,t)}static transform(){return null}remove(t){dS(this,!0,t)}replace(t,n){fr();let s=We();s!==null&&(s=s.clone()),ob(this,t);const r=this.getLatest(),i=this.__key,o=t.__key,c=t.getWritable(),u=this.getParentOrThrow().getWritable(),d=u.__size;au(c);const p=r.getPreviousSibling(),g=r.getNextSibling(),A=r.__prev,E=r.__next,x=r.__parent;if(dS(r,!1,!0),p===null?u.__first=o:p.getWritable().__next=o,c.__prev=A,g===null?u.__last=o:g.getWritable().__prev=o,c.__next=E,c.__parent=x,u.__size=d,n&&(Ne(this)&&Ne(c)||Ge(139),this.getChildren().forEac
870h(y=>{c.append(y)})),Me(s)){as(s);const y=s.anchor,I=s.focus;y.key===i&&fR(y,c),I.key===i&&fR(I,c)}return Kl()===i&&tr(o),c}insertAfter(t,n=!0){fr(),ob(this,t);const s=this.getWritable(),r=t.getWritable(),i=r.getParent(),o=We();let c=!1,u=!1;if(i!==null){const E=t.getIndexWithinParent();if(au(r),Me(o)){const x=i.__key,y=o.anchor,I=o.focus;c=y.type==="element"&&y.key===x&&y.offset===E+1,u=I.type==="element"&&I.key===x&&I.offset===E+1}}const d=this.getNextSibling(),p=this.getParentOrThrow().getWritable(),g=r.__key,A=s.__next;if(d===null?p.__last=g:d.getWritable().__prev=g,p.__size++,s.__next=g,r.__next=A,r.__prev=s.__key,r.__parent=s.__parent,n&&Me(o)){const E=this.getIndexWithinParent();o1(o,p,E+1);const x=p.__key;c&&o.anchor.set(x,E+2,"element"),u&&o.focus.set(x,E+2,"element")}return t}insertBefore(t,n=!0){fr(),ob(this,t);const s=this.getWritable(),r=t.getWritable(),i=r.__key;au(r);const o=this.getPreviousSibling(),c=this.getParentOrThrow().getWritable(),u=s.__prev,d=this.getIndexWithinParent();o===null?c.__first=i:o.getWritable().__next=i,c.__size++,s.__prev=i,r.__prev=u,r.__next=s.__key,r.__parent=s.__parent;const p=We();return n&&Me(p)&&o1(p,this.getParentOrThrow(),d),t}isParentRequired(){return!1}createParentElementNode(){return hn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){fr();const s=this.getPreviousSibling(),r=this.getParentOrThrow();if(s===null)return r.select(0,0);if(Ne(s))return s.select();if(!$e(s)){const i=s.getIndexWithinParent()+1;return r.select(i,i)}return s.select(t,n)}selectNext(t,n){fr();const s=this.getNextSibling(),r=this.getParentOrThrow();if(s===null)return r.select();if(Ne(s))return s.select(0,0);if(!$e(s)){const i=s.getIndexWithinParent();return r.select(i,i)}return s.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const fS="historic",mpe="history-push",iu="history-merge",gpe="paste",Ape="collaboration",Epe="skip-scroll-into-view",xpe="skip-dom-selection",lR="skip-selection-focus",TL="composition-start",NL="composition-end";class Vf extends Jo{static getType(){return"linebreak"}static clone(t){return new Vf(t.__key)}constructor(t){super(t)}getTextContent(){return`
871`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const s=n.parentElement;if(s!==null&&u1(s)){const r=s.firstChild;if(r===n||r.nextSibling===n&&P0(r)){const i=s.lastChild;if(i===n||i.previousSibling===n&&P0(i))return!0}}return!1})(t)||(function(n){const s=n.parentElement;if(s!==null&&u1(s)){const r=s.firstChild;if(r===n||r.nextSibling===n&&P0(r))return!1;const i=s.lastChild;if(i===n||i.previousSibling===n&&P0(i))return!0}return!1})(t)?null:{conversion:Cpe,priority:0}}}static importJSON(t){return Iu().updateFromJSON(t)}}function Cpe(e){return{node:Iu()}}function Iu(){return ya(new Vf)}function Zo(e){return e instanceof Vf}function P0(e){return pl(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function tb(e,t){return 16&t?"code":t&QP?"mark":32&t?"sub":64&t?"sup":null}function nb(e,t){return 1&t?"strong":2&t?"em":"span"}function wL(e,t,n,s,r){const i=s.classList;let o=uf(r,"base");o!==void 0&&i.add(...o),o=uf(r,"underlineStrikethrough");let c=!1;const u=8&t&&4&t;o!==void 0&&(8&n&&4&n?(c=!0,u||i.add(...o)):u&&i.remove(...o));for(const d in Au){const p=Au[d];if(o=uf(r,d),o!==void 0)if(n&p){if(c&&(d==="underline"||d==="strikethrough")){t&p&&i.remove(...o);continue}((t&p)===0||u&&d==="underline"||d==="strikethrough")&&i.add(...o)}else t&p&&i.remove(...o)}}function RL(e,t,n){const s=t.firstChild,r=n.isComposing(),i=e+(r?em:"");if(s==null)t.textContent=i;else{const o=s.nodeValue;if(o!==i)if(r||oc){const[c,u,d]=(function(p,g){const A=p.length,E=g.length;let x=0,y=0;for(;x<A&&x<E&&p[x]===g[x];)x++;for(;y+x<A&&y+x<E&&p[A-y-1]===g[E-y-1];)y++;return[x,A-x-y,g.slice(x,E-y)]})(o,i);u!==0&&s.deleteData(c,u),s.insertData(c,d)}else s.nodeValue=i}}function cR(e,t,n,s,r,i){RL(r,e,t);const o=i.theme.text;o!==void 0&&wL(0,0,s,e,o)}function L0(e,t){const n=document.createElement(t);return n.appendChild(e),n}class So extends Jo{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new So(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return Qfe[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Kl()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Au[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return l1(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const s=this.__format,r=tb(0,s),i=nb(0,s),o=r===null?i:r,c=document.createElement(o);let u=c;
871this.hasFormat("code")&&c.setAttribute("spellcheck","false"),r!==null&&(u=document.createElement(i),c.appendChild(u)),cR(u,this,0,s,this.__text,t);const d=this.__style;return d!==""&&(c.style.cssText=d),c}updateDOM(t,n,s){const r=this.__text,i=t.__format,o=this.__format,c=tb(0,i),u=tb(0,o),d=nb(0,i),p=nb(0,o);if((c===null?d:c)!==(u===null?p:u))return!0;if(c===u&&d!==p){const y=n.firstChild;y==null&&Ge(48);const I=document.createElement(p);return cR(I,this,0,o,r,s),n.replaceChild(I,y),!1}let g=n;u!==null&&c!==null&&(g=n.firstChild,g==null&&Ge(49)),RL(r,g,this);const A=s.theme.text;A!==void 0&&i!==o&&wL(0,i,o,g,A);const E=t.__style,x=this.__style;return E!==x&&(n.style.cssText=x),!1}static importDOM(){return{"#text":()=>({conversion:Spe,priority:0}),b:()=>({conversion:bpe,priority:0}),code:()=>({conversion:Ha,priority:0}),em:()=>({conversion:Ha,priority:0}),i:()=>({conversion:Ha,priority:0}),mark:()=>({conversion:Ha,priority:0}),s:()=>({conversion:Ha,priority:0}),span:()=>({conversion:ype,priority:0}),strong:()=>({conversion:Ha,priority:0}),sub:()=>({conversion:Ha,priority:0}),sup:()=>({conversion:Ha,priority:0}),u:()=>({conversion:Ha,priority:0})}}static importJSON(t){return Rs().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return rr(n)||Ge(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=L0(n,"b")),this.hasFormat("italic")&&(n=L0(n,"i")),this.hasFormat("strikethrough")&&(n=L0(n,"s")),this.hasFormat("underline")&&(n=L0(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Au[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?Ffe[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=l1(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=zfe[t];if(this.__mode===n)return this;const s=this.getWritable();return s.__mode=n,s}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){fr();let s=t,r=n;const i=We(),o=this.getTextContent(),c=this.__key;if(typeof o=="string"){const u=o.length;s===void 0&&(s=u),r===void 0&&(r=u)}else s=0,r=0;if(!Me(i))return PL(c,s,c,r,"text","text");{const u=Kl();u!==i.anchor.key&&u!==i.focus.key||tr(c),i.setTextNodeRange(this,s,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,s,r){const i=this.getWritable(),o=i.__text,c=s.length;let u=t;u<0&&(u=c+u,u<0&&(u=0));const d=We();if(r&&Me(d)){const g=t+c;d.setTextNodeRange(i,g,i,g)}const p=o.slice(0,u)+s+o.slice(u+n);return i.__text=p,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){fr();const n=this.getLatest(),s=n.getTextContent();if(s==="")return[];const r=n.__key,i=Kl(),o=s.length;t.sort((D,k)=>D-k),t.push(o);const c=[],u=t.length;for(let D=0,k=0;D<o&&k<=u;k++){const L=t[k];L>D&&(c.push(s.slice(D,L)),D=L)}const d=c.length;if(d===1)return[n];const p=c[0],g=n.getParent();let A;const E=n.getFormat(),x=n.getStyle(),y=n.__detail;let I=!1,v=null,S=null;const b=We();if(Me(b)){const[D,k]=b.isBackward()?[b.focus,b.anchor]:[b.anchor,b.focus];D.type==="text"&&D.key===r&&(v=D),k.type==="text"&&k.key===r&&(S=k)}n.isSegmented()?(A=Rs(p),A.__format=E,A.__style=x,A.__detail=y,A.__state=Xw(n,A),I=!0):A=n.setTextContent(p);const w=[A];for(let D=1;D<d;D++){const k=Rs(c[D]);k.__format=E,k.__style=x,k.__detail=y,k.__state=Xw(n,k);const L=k.__key;i===r&&tr(L),w.push(k)}const _=v?v.offset:null,N=S?S.offset:null;let R=0;for(const D of w){if(!v&&!S)break;const k=R+D.getTextContentSize();if(v!==null&&_!==null&&_<=k&&_>=R&&(v.set(D.getKey(),_-R,"text"),_<k&&(v=null)),S!==null&&N!==null&&N<=k&&N>=R){S.set(D.getKey(),N-R,"text");break}R=k}if(g!==null){(function(L){const O=L.getPreviousSibling(),P=L.getNextSibling();O!==null&&c1(O),P!==null&&c1(P)})(this);const D=g.getWritable(),k=this.getIndexWithinParent();I?(D.splice(k,0,w),this.remove()):D.splice(k,1,w),Me(b)&&o1(b,g,k,d-1)}return w}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||Ge(50);const s=this.__key,r=t.__key,i=this.__text,o=i.length;Kl()===r&&tr(s);const c=We();if(Me(c)){const g=c.anchor,A=c.focus;g!==null&&g.key===r&&xR(g,n,s,t,o),A!==null&&A.key===r&&xR(A,n,s,t,o)}const u=t.__text,d=n?u+i:i+u;this.setTextContent(d);const p=this.getWritable();return t.remove(),p}isTextEntity(){return!1}}function ype(e){return{forChild:L2(e.style),node:null}}function bpe(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:L2(t.style,n?void 0:"bold"),node:null}}const uR=new WeakMap;function Ipe(e){if(!rr(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function Spe(e){const t=e;e.parentElement===null&&Ge(129);let n=t.textContent||"";if((function(s){let r,i=s.parentNode;const o=[s];for(;i!==null&&(r=uR.get(i))===void 0&&!Ipe(i);)o.push(i),i=i.parentNode;const c=r===void 0?i:r;for(let u=0;u<o.length;u++)uR.set(o[u],c);return c})(t)!==null){const s=n.split(/(\r?\n|\t)/),r=[],i=s.length;for(let o=0;o<i;o++){const c=s[o];c===`
872`||c===`\r
873`?r.push(Iu()):c==="	"?r.push(zm()):c!==""&&r.push(Rs(c))}return{node:r}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let s=t,r=!0;for(;s!==null&&(s=dR(s,!1))!==null;){const i=s.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===" "){let s=t,r=!0;for(;s!==null&&(s=dR(s,!0))!==null;)if((s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===""?{node:null}
873:{node:Rs(n)}}function dR(e,t){let n=e;for(;;){let s;for(;(s=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=s,rr(n)){const i=n.style.display;if(i===""&&!xS(n)||i!==""&&!i.startsWith("inline"))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(pl(n))return n;if(n.nodeName==="BR")return null}}const vpe={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ha(e){const t=vpe[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:L2(e.style,t),node:null}}function Rs(e=""){return ya(new So(e))}function $e(e){return e instanceof So}function L2(e,t){const n=e.fontWeight,s=e.textDecoration.split(" "),r=n==="700"||n==="bold",i=s.includes("line-through"),o=e.fontStyle==="italic",c=s.includes("underline"),u=e.verticalAlign;return d=>($e(d)&&(r&&!d.hasFormat("bold")&&d.toggleFormat("bold"),i&&!d.hasFormat("strikethrough")&&d.toggleFormat("strikethrough"),o&&!d.hasFormat("italic")&&d.toggleFormat("italic"),c&&!d.hasFormat("underline")&&d.toggleFormat("underline"),u!=="sub"||d.hasFormat("subscript")||d.toggleFormat("subscript"),u!=="super"||d.hasFormat("superscript")||d.toggleFormat("superscript"),t&&!d.hasFormat(t)&&d.toggleFormat(t)),d)}class Gf extends So{static getType(){return"tab"}static clone(t){return new Gf(t.__key)}constructor(t){super("	",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),s=uf(t.theme,"tab");return s!==void 0&&n.classList.add(...s),n}static importJSON(t){return zm().updateFromJSON(t)}setTextContent(t){return t!=="	"&&t!==""&&UP(126),super.setTextContent("	")}spliceText(t,n,s,r){return s===""&&n===0||s==="	"&&n===1||Ge(286),this}setDetail(t){return t!==2&&Ge(127),this}setMode(t){return t!=="normal"&&Ge(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function zm(){return ya(new Gf)}function DL(e){return e instanceof Gf}class _pe{key;offset;type;_selection;constructor(t,n,s){this._selection=null,this.key=t,this.offset=n,this.type=s}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:oM(Gi(ll(this,"next")),Gi(ll(t,"next")))<0}getNode(){const t=Xt(this.key);return t===null&&Ge(20),t}set(t,n,s,r){const i=this._selection,o=this.key;r&&this.key===t&&this.offset===n&&this.type===s||(this.key=t,this.offset=n,this.type=s,Qm()||(Kl()===o&&tr(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function la(e,t,n){return new _pe(e,t,n)}function sb(e,t){let n=t.__key,s=e.offset,r="element";if($e(t)){r="text";const i=t.getTextContentSize();s>i&&(s=i)}else if(!Ne(t)){const i=t.getNextSibling();if($e(i))n=i.__key,s=0,r="text";else{const o=t.getParent();o&&(n=o.__key,s=t.getIndexWithinParent()+1)}}e.set(n,s,r)}function fR(e,t){if(Ne(t)){const n=t.getLastDescendant();Ne(n)||$e(n)?sb(e,n):sb(e,t)}else sb(e,t)}class NE{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Qr(t))return!1;const n=this._nodes,s=t._nodes;return n.size===s.size&&Array.from(n).every(r=>s.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new NE(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),s=n.length,r=n[s-1];let i;if($e(r))i=r.select();else{const o=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(o,o)}i.insertNodes(t);for(let o=0;o<s;o++)n[o].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,s=[];for(const r of n){const i=Xt(r);i!==null&&s.push(i)}return Qm()||(this._cachedNodes=s),s}getTextContent(){const t=this.getNodes();let n="";for(let s=0;s<t.length;s++)n+=t[s].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((We()||Vu())===this&&t[0]){const n=Ar(t[0],"next");she(ac(n,n))}for(const n of t)n.remove()}}function Me(e){return e instanceof Hu}class Hu{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,s,r){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=s,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!Me(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(s){const r=[],[i,o]=s.getTextSlices();i&&r.push(i.caret.origin);const c=new Set,u=new Set;for(const d of s)if(ta(d)){const{origin:p}=d;r.length===0?c.add(p):(u.add(p),r.push(p))}else{const{origin:p}=d;Ne(p)&&u.has(p)||r.push(p)}if(o&&r.push(o.caret.origin),Tf(s.focus)&&Ne(s.focus.origin)&&s.focus.getNodeAtCaret()===null)for(let d=vo(s.focus.origin,"previous");ta(d)&&c.has(d.origin)&&!d.origin.isEmpty()&&d.origin.is(r[r.length-1]);
873d=e_(d))c.delete(d.origin),r.pop();for(;r.length>1;){const d=r[r.length-1];if(!Ne(d)||u.has(d)||d.isEmpty()||c.has(d))break;r.pop()}if(r.length===0&&s.isCollapsed()){const d=Gi(s.anchor),p=Gi(s.anchor.getFlipped()),g=E=>Zl(E)?E.origin:E.getNodeAtCaret(),A=g(d)||g(p)||(s.anchor.getNodeAtCaret()?d.origin:p.origin);r.push(A)}return r})(cM(CS(this),"next"));return Qm()||(this._cachedNodes=n),n}setTextNodeRange(t,n,s,r){this.anchor.set(t.__key,n,"text"),this.focus.set(s.__key,r,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],s=t[t.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[c,u]=pS(this);let d="",p=!0;for(let g=0;g<t.length;g++){const A=t[g];if(Ne(A)&&!A.isInline())p||(d+=`
874`),p=!A.isEmpty();else if(p=!1,$e(A)){let E=A.getTextContent();A===n?A===s?r.type==="element"&&i.type==="element"&&i.offset!==r.offset||(E=c<u?E.slice(c,u):E.slice(u,c)):E=o?E.slice(c):E.slice(u):A===s&&(E=o?E.slice(0,u):E.slice(0,c)),d+=E}else!nn(A)&&!Zo(A)||A===s&&this.isCollapsed()||(d+=A.getTextContent())}return d}applyDOMRange(t){const n=Ln(),s=n.getEditorState()._selection,r=OL(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,s);if(r===null)return;const[i,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),JA(this)}clone(){const t=this.anchor,n=this.focus;return new Hu(la(t.key,t.offset,t.type),la(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=l1(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Au[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),s=[],r=n.length;for(let i=0;i<r;i++){const o=n[i];o===`
875`||o===`\r
876`?s.push(Iu()):o==="	"?s.push(zm()):s.push(Rs(o))}this.insertNodes(s)}insertText(t){const n=this.anchor,s=this.focus,r=this.format,i=this.style;let o=n,c=s;!this.isCollapsed()&&s.isBefore(n)&&(o=s,c=n),o.type==="element"&&(function(I,v,S,b){const w=I.getNode(),_=w.getChildAtIndex(I.offset),N=Rs();if(N.setFormat(S),N.setStyle(b),Kf(_))_.splice(0,0,[N]);else{const R=Os(w)?hn().append(N):N;_===null?w.append(R):_.insertBefore(R)}I.is(v)&&v.set(N.__key,0,"text"),I.set(N.__key,0,"text")})(o,c,r,i),c.type==="element"&&Tu(c,Gi(ll(c,"next")));const u=o.offset;let d=c.offset;const p=this.getNodes(),g=p.length;let A=p[0];$e(A)||Ge(26);const E=A.getTextContent().length,x=A.getParentOrThrow();let y=p[g-1];if(g===1&&c.type==="element"&&(d=E,c.set(o.key,d,"text")),this.isCollapsed()&&u===E&&(Ho(A)||!A.canInsertTextAfter()||!x.canInsertTextAfter()&&A.getNextSibling()===null)){let I=A.getNextSibling();if($e(I)&&I.canInsertTextBefore()&&!Ho(I)||(I=Rs(),I.setFormat(r),I.setStyle(i),x.canInsertTextAfter()?A.insertAfter(I):x.insertAfter(I)),I.select(0,0),A=I,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&u===0&&(Ho(A)||!A.canInsertTextBefore()||!x.canInsertTextBefore()&&A.getPreviousSibling()===null)){let I=A.getPreviousSibling();if($e(I)&&!Ho(I)||(I=Rs(),I.setFormat(r),x.canInsertTextBefore()?A.insertBefore(I):x.insertBefore(I)),I.select(),A=I,t!=="")return void this.insertText(t)}else if(A.isSegmented()&&u!==E){const I=Rs(A.getTextContent());I.setFormat(r),A.replace(I),A=I}else if(!this.isCollapsed()&&t!==""){const I=y.getParent();if(!x.canInsertTextBefore()||!x.canInsertTextAfter()||Ne(I)&&(!I.canInsertTextBefore()||!I.canInsertTextAfter()))return this.insertText(""),kL(this.anchor,this.focus),void this.insertText(t)}if(g===1){if(ou(A)){const b=Rs(t);return b.select(),void A.replace(b)}const I=A.getFormat(),v=A.getStyle();if(u!==d||I===r&&v===i){if(DL(A)){const b=Rs(t);return b.setFormat(r),b.setStyle(i),b.select(),void A.replace(b)}}else{if(A.getTextContent()!==""){const b=Rs(t);if(b.setFormat(r),b.setStyle(i),b.select(),u===0)A.insertBefore(b,!1);else{const[w]=A.splitText(u);w.insertAfter(b,!1)}return void(b.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}A.setFormat(r),A.setStyle(i)}const S=d-u;A=A.spliceText(u,S,t,!0),A.getTextContent()===""?A.remove():this.anchor.type==="text"&&(this.format=I,this.style=v,A.isComposing()&&(this.anchor.offset-=t.length))}else{const I=new Set([...A.getParentKeys(),...y.getParentKeys()]),v=Ne(A)?A:A.getParentOrThrow();let S=Ne(y)?y:y.getParentOrThrow(),b=y;if(!v.is(S)&&S.isInline())do b=S,S=S.getParentOrThrow();while(S.isInline());if(c.type==="text"&&(d!==0||y.getTextContent()==="")||c.type==="element"&&y.getIndexWithinParent()<d)if($e(y)&&!ou(y)&&d!==y.getTextContentSize()){if(y.isSegmented()){const D=Rs(y.getTextContent());y.replace(D),y=D}Os(c.getNode())||c.type!=="text"||(y=y.spliceText(0,d,"")),I.add(y.__key)}else{const D=y.getParentOrThrow();D.canBeEmpty()||D.getChildrenSize()!==1?y.remove():D.remove()}else I.add(y.__key);const w=S.getChildren(),_=new Set(p),N=v.is(S),R=v.isInline()&&A.getNextSibling()===null?v:A;for(let D=w.length-1;D>=0;D--){const k=w[D];if(k.is(A)||Ne(k)&&k.isParentOf(A))break;k.isAttached()&&(!_.has(k)||k.is(b)?N||R.insertAfter(k,!1):k.remove())}if(!N){let D=S,k=null;for(;D!==null;){const L=D.getChildren(),O=L.length;(O===0||L[O-1].is(k))&&(I.delete(D.__key),k=D),D=D.getParent()}}if(ou(A))if(u===E)A.select();else{const D=Rs(t);D.select(),A.replace(D)}else A=A.spliceText(u,E-u,t,!0),A.getTextContent()===""?A.remove():this.anchor.type==="text"&&(this.format=A.getFormat(),this.style=A.getStyle(),A.isComposing()&&(this.anchor.offset-=t.length));for(let D=1;D<g;D++){const k=p[D],L=k.__key;I.has(L)||k.remove()}}}removeText(){const t=We()===this;xA(this,rhe(CS(this))),t&&We()!==this&&as(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void tr(null);const s=this.getNodes(),r=[];for(const w of s)$e(w)&&r.push(w);const i=w=>
876{s.forEach(_=>{if(Ne(_)){const N=_.getFormatFlags(t,w);_.setTextFormat(N)}})},o=r.length;if(o===0)return this.toggleFormat(t),tr(null),void i(n);const c=this.anchor,u=this.focus,d=this.isBackward(),p=d?u:c,g=d?c:u;let A=0,E=r[0],x=p.type==="element"?0:p.offset;if(p.type==="text"&&x===E.getTextContentSize()&&(A=1,E=r[1],x=0),E==null)return;const y=E.getFormatFlags(t,n);i(y);const I=o-1;let v=r[I];const S=g.type==="text"?g.offset:v.getTextContentSize();if(E.is(v)){if(x===S)return;if(Ho(E)||x===0&&S===E.getTextContentSize())E.setFormat(y);else{const w=E.splitText(x,S),_=x===0?w[0]:w[1];_.setFormat(y),p.type==="text"&&p.set(_.__key,0,"text"),g.type==="text"&&g.set(_.__key,S-x,"text")}return void(this.format=y)}x===0||Ho(E)||([,E]=E.splitText(x),x=0),E.setFormat(y);const b=v.getFormatFlags(t,y);S>0&&(S===v.getTextContentSize()||Ho(v)||([v]=v.splitText(S)),v.setFormat(b));for(let w=A+1;w<I;w++){const _=r[w],N=_.getFormatFlags(t,b);_.setFormat(N)}p.type==="text"&&p.set(E.__key,x,"text"),g.type==="text"&&g.set(v.__key,S,"text"),this.format=y|b}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const x=We();return Me(x)||Ge(134),x.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),s=Vs(n,Vi),r=t[t.length-1];if(Ne(s)&&"__language"in s){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const x=rb(this);s.splice(x,0,t),r.selectEnd()}return}if(!t.some(x=>(Ne(x)||nn(x))&&!x.isInline())){Ne(s)||Ge(211,n.constructor.name,n.getType());const x=rb(this);return s.splice(x,0,t),void r.selectEnd()}const i=(function(x){const y=hn();let I=null;for(let v=0;v<x.length;v++){const S=x[v],b=Zo(S);if(b||nn(S)&&S.isInline()||Ne(S)&&S.isInline()||$e(S)||S.isParentRequired()){if(I===null&&(I=S.createParentElementNode(),y.append(I),b))continue;I!==null&&I.append(S)}else y.append(S),I=null}return y})(t),o=i.getLastDescendant(),c=i.getChildren(),u=!Ne(s)||!s.isEmpty()?this.insertParagraph():null,d=c[c.length-1];let p=c[0];var g;Ne(g=p)&&Vi(g)&&!g.isEmpty()&&Ne(s)&&(!s.isEmpty()||s.canMergeWhenEmpty())&&(Ne(s)||Ge(211,n.constructor.name,n.getType()),s.append(...p.getChildren()),p=c[1]),p&&(s===null&&Ge(212,n.constructor.name,n.getType()),(function(x,y){const I=y.getParentOrThrow().getLastChild();let v=y;const S=[y];for(;v!==I;)v.getNextSibling()||Ge(140),v=v.getNextSibling(),S.push(v);let b=x;for(const w of S)b=b.insertAfter(w)})(s,p));const A=Vs(o,Vi);u&&Ne(A)&&(u.canMergeWhenEmpty()||Vi(d))&&(A.append(...u.getChildren()),u.remove()),Ne(s)&&s.isEmpty()&&s.remove(),o.selectEnd();const E=Ne(s)?s.getLastChild():null;Zo(E)&&A!==s&&E.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=hn();return St().splice(this.anchor.offset,0,[o]),o.select(),o}const t=rb(this),n=Vs(this.anchor.getNode(),Vi);Ne(n)||Ge(213);const s=n.getChildAtIndex(t),r=s?[s,...s.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(t){const n=Iu();if(this.insertNodes([n]),t){const s=n.getParentOrThrow(),r=n.getIndexWithinParent();s.select(r,r)}}extract(){const t=[...this.getNodes()],n=t.length;let s=t[0],r=t[n-1];const[i,o]=pS(this),c=this.isBackward(),[u,d]=c?[this.focus,this.anchor]:[this.anchor,this.focus],[p,g]=c?[o,i]:[i,o];if(n===0)return[];if(n===1){if($e(s)&&!this.isCollapsed()){const A=s.splitText(p,g),E=p===0?A[0]:A[1];return E?(u.set(E.getKey(),0,"text"),d.set(E.getKey(),E.getTextContentSize(),"text"),[E]):[]}return[s]}if($e(s)&&(p===s.getTextContentSize()?t.shift():p!==0&&([,s]=s.splitText(p),t[0]=s,u.set(s.getKey(),0,"text"))),$e(r)){const A=r.getTextContent().length;g===0?t.pop():g!==A&&([r]=r.splitText(g),t[t.length-1]=r,d.set(r.getKey(),r.getTextContentSize(),"text"))}return t}modify(t,n,s){if(yR(this,t,n,s))return;const r=t==="move",i=Ln(),o=vi(Si(i));if(!o)return;const c=i._blockCursorElement,u=i._rootElement,d=this.focus.getNode();if(u===null||c===null||!Ne(d)||d.isInline()||d.canBeEmpty()||AS(c,i,u),this.dirty){let p=vf(i,this.anchor.key),g=vf(i,this.focus.key);this.anchor.type==="text"&&(p=Sf(p)),this.focus.type==="text"&&(g=Sf(g)),p&&g&&ML(o,p,this.anchor.offset,g,this.focus.offset)}if((function(p,g,A,E){p.modify(g,A,E)})(o,t,n?"backward":"forward",s),o.rangeCount>0){const p=o.getRangeAt(0),g=this.anchor.getNode(),A=Os(g)?g:Hpe(g);if(this.applyDOMRange(p),this.dirty=!0,!r){const E=this.getNodes(),x=[];let y=!1;for(let I=0;I<E.length;I++){const v=E[I];_f(v,A)?x.push(v):y=!0}if(y&&x.length>0)if(n){const I=x[0];Ne(I)?I.selectStart():I.getParentOrThrow().selectStart()}else{const I=x[x.length-1];Ne(I)?I.selectEnd():I.getParentOrThrow().selectEnd()}
876o.anchorNode===p.startContainer&&o.anchorOffset===p.startOffset||(function(I){const v=I.focus,S=I.anchor,b=S.key,w=S.offset,_=S.type;S.set(v.key,v.offset,v.type,!0),v.set(b,w,_,!0)})(this)}}s==="lineboundary"&&yR(this,t,n,s,"decorators")}forwardDeletion(t,n,s){if(!s&&(t.type==="element"&&Ne(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const r=n.getParent(),i=n.getNextSibling()||(r===null?null:r.getNextSibling());if(Ne(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const s=this.anchor;let r=s.getNode();if(this.forwardDeletion(s,r,t))return;const i=n_(ll(s,t?"previous":"next"));if(i.getTextSlices().every(c=>c===null||c.distance===0)){let c={type:"initial"};for(const u of i.iterNodeCarets("shadowRoot"))if(ta(u)){if(!u.origin.isInline()){if(u.origin.isShadowRoot()){if(c.type==="merge-block")break;if(Ne(i.anchor.origin)&&i.anchor.origin.isEmpty()){const d=Gi(u);xA(this,ac(d,d)),i.anchor.origin.remove()}return}c.type!=="merge-next-block"&&c.type!=="merge-block"||(c={block:c.block,caret:u,type:"merge-block"})}}else{if(c.type==="merge-block")break;if(Tf(u)){if(Ne(u.origin)){if(u.origin.isInline()){if(!u.origin.isParentOf(i.anchor.origin))break}else c={block:u.origin,type:"merge-next-block"};continue}if(nn(u.origin)){if(!u.origin.isIsolated())if(c.type==="merge-next-block"&&(u.origin.isKeyboardSelectable()||!u.origin.isInline())&&Ne(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const d=LL();d.add(u.origin.getKey()),as(d)}else u.origin.remove();return}break}}if(c.type==="merge-block"){const{caret:u,block:d}=c;return xA(this,ac(!u.origin.isEmpty()&&d.isEmpty()?s_(Ar(d,u.direction)):i.anchor,u)),this.removeText()}}const o=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&s.offset===0&&hR(this,s.getNode()))return}else{const c=o.type==="text"?o.getNode():null;if(r=s.type==="text"?s.getNode():null,c!==null&&c.isSegmented()){const u=o.offset,d=c.getTextContentSize();if(c.is(r)||t&&u!==d||!t&&u!==0)return void mR(c,t,u)}else if(r!==null&&r.isSegmented()){const u=s.offset,d=r.getTextContentSize();if(r.is(c)||t&&u!==0||!t&&u!==d)return void mR(r,t,u)}(function(u,d){const p=u.anchor,g=u.focus,A=p.getNode(),E=g.getNode();if(A===E&&p.type==="text"&&g.type==="text"){const x=p.offset,y=g.offset,I=x<y,v=I?x:y,S=I?y:x,b=S-1;v!==b&&(function(w){return!(JL(w)||Tpe(w))})(A.getTextContent().slice(v,S))&&(d?g.set(g.key,b,g.type):p.set(p.key,b,p.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const s=this.anchor.getNode();s.isEmpty()&&Os(s.getParent())&&s.getPreviousSibling()===null&&hR(this,s)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,s=n.getNode();if(this.forwardDeletion(n,s,t))return;this.modify("extend",t,"word")}this.isCollapsed()?this.deleteCharacter(t):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Qr(e){return e instanceof NE}function pR(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function pS(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,s]=t;return n.type==="element"&&s.type==="element"&&n.key===s.key&&n.offset===s.offset?[0,0]:[pR(n),pR(s)]}function hR(e,t){for(let n=t;n;n=n.getParent()){if(Ne(n)){if(n.collapseAtStart(e))return!0;if(Yr(n))break}if(n.getPreviousSibling())break}return!1}const Tpe=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function mR(e,t,n){const s=e,r=s.getTextContent().split(/(?=\s)/g),i=r.length;let o=0,c=0;for(let d=0;d<i;d++){const p=d===i-1;if(c=o,o+=r[d].length,t&&o===n||o>n||p){r.splice(d,1),p&&(c=void 0);break}}const u=r.join("").trim();u===""?s.remove():(s.setTextContent(u),s.select(c,c))}function gR(e,t,n,s){let r,i=t;if(rr(e)){let o=!1;const c=e.childNodes,u=c.length,d=s._blockCursorElement;i===u&&(o=!0,i=u-1);let p=c[i],g=!1;if(p===d)p=c[i+1],g=!0;else if(d!==null){const A=d.parentNode;e===A&&t>Array.prototype.indexOf.call(A.children,d)&&i--}if(r=Kd(p),$e(r))i=ec(r,o?"next":"previous");else{let A=Kd(e);if(A===null)return null;if(Ne(A)){const E=s.getElementByKey(A.getKey());E===null&&Ge(214),[A,i]=A.getDOMSlot(E).resolveChildIndex(A,E,e,t),Ne(A)||Ge(215),o&&i>=A.getChildrenSize()&&(i=Math.max(0,A.getChildrenSize()-1));let y=A.getChildAtIndex(i);if(Ne(y)&&(function(I,v,S){const b=I.getParent();return S===null||b===null||!b.canBeEmpty()||b!==S.getNode()})(y,0,n)){const I=o?y.getLastDescendant():y.getFirstDescendant();I===null?A=y:(y=I,A=Ne(y)?y:y.getParentOrThrow()),i=0}$e(y)?(r=y,A=null,i=ec(y,o?"next":"previous")):y!==A&&o&&!g&&(Ne(A)||Ge(216),i=Math.min(A.getChildrenSize(),i+1))}else{const E=A.getIndexWithinParent();i=t===0&&nn(A)&&Kd(e)===A?E:E+1,A=A.getParentOrThrow()}if(Ne(A))return la(A.__key,i,"element")}}else r=Kd(e);return $e(r)?la(r.__key,ec(r,i,"clamp"),"text"):null}function AR(e,t,n){const s=e.offset,r=e.getNode();if(s===0){const i=r.getPreviousSibling(),o=r.getParent();if(t){if((n||!t)&&i===null&&Ne(o)&&o.isInline()){const c=o.getPreviousSibling();$e(c)&&e.set(c.__key,c.getTextContent().length,"text")}}else Ne(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):$e(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(s===r.getTextContent().length){const i=r.getNextSibling(),o=r.getParent();if(t&&Ne(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&Ne(o)&&o.isInline()&&!o.canInsertTextAfter()){const c=o.getNextSibling();$e(c)&&e.set(c.__key,0,"text")}}}function kL(e,t,n){if(e.type==="text"&&t.type==="text"){const s=e.isBefore(t),r=e.is(t);AR(e,s,r),AR(t,!s,r),r&&t.set(e.key,e.offset,e.type)}}function OL(e,t,n,s,r,i){if(e===null||n===null||!Vm(r,e,n))return null;const o=gR(e,t,Me(i)?i.anchor:null,r);if(o===null)return null;const c=gR(n,s,Me(i)?i.focus:null,r);if(c===null)return null;if(o.type==="element"&&c.type==="element"){const u=Kd(e),d=Kd(n);if(nn(u)&&nn(d))return null}return kL(o,c),[o,c]}function hS(e){return Ne(e)&&!e.isInline()}function PL(e,t,n,s,r,i){const o=Ec(),c=new Hu(la(e,t,r),la(n,s,i),0,"");return c.dirty=!0,o._selection=c,c}function ca(){const e=la("root",0,"element"),t=la("root",0,"element");return new Hu(e,t,0,"")}function LL(){return new NE(new Set)}function M2(e,t,n,s){const r=n._window;if(r===null)return null;const i=s||r.event,o=i?i.type:void 0,c=o==="selectionchange",u=!JI&&(c||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&i&&i.detail===3||o==="drop"||o===void 0);let d,p,g,A;if(Me(e)&&!u)return e.clone();if(t===null)return null;if(d=t.anchorNode,p=t.focusNode,g=t.anchorOffset,A=t.focusOffset,(c||o===void 0)&&Me(e)&&!Vm(n,d,p))return e.clone();const E=OL(d,g,p,A,n,e);if(E===null)return null;const[x,y]=E;let I=0,v="";if(Me(e)){const S=e.anchor;if(x.key===S.key)I=e.format,v=e.style;else{const b=x.getNode();$e(b)?(I=b.getFormat(),v=b.getStyle()):Ne(b)&&(I=b.getTextFormat(),v=b.getTextStyle())}}return new Hu(x,y,I,v)}function We(){return Ec()._selection}function Vu(){return Ln()._editorState._selection}function o1(e,t,n,s=1){const r=e.anchor,i=e.focus,o=r.getNode(),c=i.getNode();if(!t.is(o)&&!t.is(c))return;const u=t.__key;if(e.isCollapsed()){const d=r.offset;if(n<=d&&s>0||n<d&&s<0){const p=Math.max(0,d+s);r.set(u,p,"element"),i.set(u,p,"element"),ER(e)}}else{const d=e.isBackward(),p=d?i:r,g=p.getNode(),A=d?r:i,E=A.getNode();if(t.is(g)){const x=p.offset;(n<=x&&s>0||n<x&&s<0)&&p.set(u,Math.max(0,x+s),"element")}if(t.is(E)){const x=A.offset;(n<=x&&s>0||n<x&&s<0)&&A.set(u,Math.max(0,x+s),"element")}}ER(e)}function ER(e){const t=e.anchor,n=t.offset,s=e.focus,r=s.offset,i=t.getNode(),o=s.getNode();if(e.isCollapsed()){if(!Ne(i))return;const c=i.getChildrenSize(),u=n>=c,d=u?i.getChildAtIndex(c-1):i.getChildAtIndex(n);if($e(d)){let p=0;u&&(p=d.getTextContentSize()),t.set(d.__key,p,"text"),s.set(d.__key,p,"text")}return}if(Ne(i)){const c=i.getChildrenSize(),u=n>=c,d=u?i.getChildAtIndex(c-1):i.getChildAtIndex(n);if($e(d)){let p=0;u&&(p=d.getTextContentSize()),t.set(d.__key,p,"text")}}
876if(Ne(o)){const c=o.getChildrenSize(),u=r>=c,d=u?o.getChildAtIndex(c-1):o.getChildAtIndex(r);if($e(d)){let p=0;u&&(p=d.getTextContentSize()),s.set(d.__key,p,"text")}}}function a1(e,t,n,s,r){let i=null,o=0,c=null;s!==null?(i=s.__key,$e(s)?(o=s.getTextContentSize(),c="text"):Ne(s)&&(o=s.getChildrenSize(),c="element")):r!==null&&(i=r.__key,$e(r)?c="text":Ne(r)&&(c="element")),i!==null&&c!==null?e.set(i,o,c):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function xR(e,t,n,s,r){e.type==="text"?e.set(n,e.offset+(t?0:r),"text"):e.offset>s.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function ML(e,t,n,s,r){try{e.setBaseAndExtent(t,n,s,r)}catch{}}function CR(e,t,n){const s=vf(e,t.getKey());if(Ne(t)){const r=t.getDOMSlot(s);return[r.element,n+r.getFirstChildOffset()]}return[s,n]}function Npe(e,t,n,s,r,i,o){const c=s.anchorNode,u=s.focusNode,d=s.anchorOffset,p=s.focusOffset,g=document.activeElement;if(r.has(Ape)&&g!==i||g!==null&&H2(g))return;if(!Me(t))return void(e!==null&&Vm(n,c,u)&&s.removeAllRanges());const A=t.anchor,E=t.focus,x=A.getNode(),y=E.getNode(),[I,v]=CR(n,x,A.offset),[S,b]=CR(n,y,E.offset),w=t.format,_=t.style,N=t.isCollapsed();let R=I,D=S,k=!1;var L,O,P,B,F;if(A.type==="text"?(R=Sf(I),k=x.getFormat()!==w||x.getStyle()!==_):Me(e)&&e.anchor.type==="text"&&(k=!0),E.type==="text"&&(D=Sf(S)),R!==null&&D!==null&&(N&&(e===null||k||Me(e)&&(e.format!==w||e.style!==_))&&(L=w,O=_,P=v,B=A.key,F=performance.now(),CL=[L,O,P,B,F]),d!==v||p!==b||c!==R||u!==D||s.type==="Range"&&N||(g!==null&&i.contains(g)||r.has(lR)||i.focus({preventScroll:!0}),A.type==="element"))){if(ML(s,R,v,D,b),!oc||!t.isCollapsed()||i===null||r.has(lR)||document.activeElement!==null&&i.contains(document.activeElement)||i.focus({preventScroll:!0}),!r.has(Epe)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const z=Me(t)&&t.anchor.type==="element"?R.childNodes[v]||null:s.rangeCount>0?s.getRangeAt(0):null;if(z!==null){let Q;if(z instanceof Text){const M=document.createRange();M.selectNode(z),Q=M.getBoundingClientRect()}else Q=z.getBoundingClientRect();(function(M,K,W){const H=nM(W),j=Y2(H);if(H===null||j===null)return;let{top:q,bottom:G}=K,$=0,J=0,ne=W;for(;ne!==null;){const X=ne===H.body;if(X){$=0,J=Si(M).innerHeight;const ie=j.getComputedStyle(H.documentElement),ee=parseFloat(ie.scrollPaddingTop),te=parseFloat(ie.scrollPaddingBottom);isFinite(ee)&&($+=ee),isFinite(te)&&(J-=te)}else{const ie=ne.getBoundingClientRect();$=ie.top,J=ie.bottom}let oe=0;if(q<$?oe=-($-q):G>J&&(oe=G-J),oe!==0)if(X)j.scrollBy(0,oe);else{const ie=ne.scrollTop;ne.scrollTop+=oe;const ee=ne.scrollTop-ie;q-=ee,G-=ee}if(X)break;ne=Gm(ne)}})(n,Q,i)}}cS=!0}}function wpe(e){let t=We()||Vu();t===null&&(t=St().selectEnd()),t.insertNodes(e)}function rb(e){let t=e;e.isCollapsed()||t.removeText();const n=We();Me(n)&&(t=n),Me(t)||Ge(161);const s=t.anchor;let r=s.getNode(),i=s.offset;for(;!Vi(r);){const o=r;if([r,i]=Rpe(r,i),o.is(r))break}return i}function Rpe(e,t){const n=e.getParent();if(!n){const r=hn();return St().append(r),r.select(),[St(),0]}if($e(e)){const r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Ne(e)||t===0)return[n,e.getIndexWithinParent()];const s=e.getChildAtIndex(t);if(s){const r=new Hu(la(e.__key,t,"element"),la(e.__key,t,"element"),0,""),i=e.insertNewAfter(r);i&&i.append(s,...s.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function yR(e,t,n,s,r="decorators-and-blocks"){if(t==="move"&&s==="character"&&!e.isCollapsed()){const[p,g]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return g.set(p.key,p.offset,p.type),!0}const i=ll(e.focus,n?"previous":"next"),o=s==="lineboundary",c=t==="move";let u=i,d=r==="decorators-and-blocks";if(!lM(u)){for(const p of u){d=!1;const{origin:g}=p;if(!nn(g)||g.isIsolated()||(u=p,!o||!g.isInline()))break}if(d)for(const p of n_(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(ta(p))p.origin.isInline()||(u=p);else{if(Ne(p.origin))continue;nn(p.origin)&&!p.origin.isInline()&&(u=p)}break}}if(u===i)return!1;if(c&&!o&&nn(u.origin)&&u.origin.isKeyboardSelectable()){const p=LL();return p.add(u.origin.getKey()),as(p),!0}return u=Gi(u),c&&Tu(e.anchor,u),Tu(e.focus,u),d||!o}let zs=null,Qs=null,$r=!1,ib=!1,AA=0;const bR={characterData:!0,childList:!0,subtree:!0};function Qm(){return $r||zs!==null&&zs._readOnly}function fr(){$r&&Ge(13)}function jL(){AA>99&&Ge(14)}function Ec(){return zs===null&&Ge(195,BL()),zs}function Ln(){return Qs===null&&Ge(196,BL()),Qs}function BL(){let e=0;const t=new Set,n=If.version;if(typeof window<"u")for(const r of document.querySelectorAll("[contenteditable]")){const i=DE(r);if(V2(i))e++;else if(i){let o=String(i.constructor.version||"<0.17.1");o===n&&(o+=" (separately built, likely a bundler configuration issue)"),t.add(o)}}let s=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(s+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),s}function Dpe(){return Qs}
876function IR(e,t,n){const s=t.__type,r=HL(e,s);let i=n.get(s);i===void 0&&(i=Array.from(r.transforms),n.set(s,i));const o=i.length;for(let c=0;c<o&&(i[c](t),t.isAttached());c++);}function SR(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function FL(e,t){if(!t)return;const n=e._updateTags;let s=t;Array.isArray(t)||(s=[t]);for(const r of s)n.add(r)}function kpe(e){return j2(e,Ln()._nodes)}function j2(e,t){const n=e.type,s=t.get(n);s===void 0&&Ge(17,n);const r=s.klass;e.type!==r.getType()&&Ge(18,r.name);const i=r.importJSON(e),o=e.children;if(Ne(i)&&Array.isArray(o))for(let c=0;c<o.length;c++){const u=j2(o[c],t);i.append(u)}return i}function vR(e,t,n){const s=zs,r=$r,i=Qs;zs=t,$r=!0,Qs=e;try{return n()}finally{zs=s,$r=r,Qs=i}}function $a(e,t){const n=e._pendingEditorState,s=e._rootElement,r=e._headless||s===null;if(n===null)return;const i=e._editorState,o=i._selection,c=n._selection,u=e._dirtyType!==0,d=zs,p=$r,g=Qs,A=e._updating,E=e._observer;let x=null;if(e._pendingEditorState=null,e._editorState=n,!r&&u&&E!==null){Qs=e,zs=n,$r=!1,e._updating=!0;try{const N=e._dirtyType,R=e._dirtyElements,D=e._dirtyLeaves;E.disconnect(),x=epe(i,n,e,N,R,D)}catch(N){if(N instanceof Error&&e._onError(N),ib)throw N;return QL(e,null,s,n),qP(e),e._dirtyType=2,ib=!0,$a(e,i),void(ib=!1)}finally{E.observe(s,bR),e._updating=A,zs=d,$r=p,Qs=g}}n._readOnly||(n._readOnly=!0);const y=e._dirtyLeaves,I=e._dirtyElements,v=e._normalizedNodes,S=e._updateTags,b=e._deferred;u&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(N,R){const D=N._decorators;let k=N._pendingDecorators||D;const L=R._nodeMap;let O;for(O in k)L.has(O)||(k===D&&(k=YL(N)),delete k[O])})(e,n);const w=r?null:vi(Si(e));if(e._editable&&w!==null&&(u||c===null||c.dirty||!c.is(o))&&s!==null&&!S.has(xpe)){Qs=e,zs=n;try{if(E!==null&&E.disconnect(),u||c===null||c.dirty){const N=e._blockCursorElement;N!==null&&AS(N,e,s),Npe(o,c,e,w,S,s)}(function(N,R,D){let k=N._blockCursorElement;if(Me(D)&&D.isCollapsed()&&D.anchor.type==="element"&&R.contains(document.activeElement)){const L=D.anchor,O=L.getNode(),P=L.offset;let B=!1,F=null;if(P===O.getChildrenSize())ab(O.getChildAtIndex(P-1))&&(B=!0);else{const z=O.getChildAtIndex(P);if(z!==null&&ab(z)){const Q=z.getPreviousSibling();(Q===null||ab(Q))&&(B=!0,F=N.getElementByKey(z.__key))}}if(B){const z=N.getElementByKey(O.__key);return k===null&&(N._blockCursorElement=k=(function(Q){const M=Q.theme,K=document.createElement("div");K.contentEditable="false",K.setAttribute("data-lexical-cursor","true");let W=M.blockCursor;if(W!==void 0){if(typeof W=="string"){const H=lc(W);W=M.blockCursor=H}W!==void 0&&K.classList.add(...W)}return K})(N._config)),R.style.caretColor="transparent",void(F===null?z.appendChild(k):z.insertBefore(k,F))}}k!==null&&AS(k,N,R)})(e,s,c)}finally{E!==null&&E.observe(s,bR),Qs=g,zs=d}}x!==null&&(function(N,R,D,k,L){const O=Array.from(N._listeners.mutation),P=O.length;for(let B=0;B<P;B++){const[F,z]=O[B];for(const Q of z){const M=R.get(Q);M!==void 0&&F(M,{dirtyLeaves:k,prevEditorState:L,updateTags:D})}}})(e,x,S,y,i),Me(c)||c===null||o!==null&&o.is(c)||e.dispatchCommand(Um,void 0);const _=e._pendingDecorators;_!==null&&(e._decorators=_,e._pendingDecorators=null,Rh("decorator",e,!0,_)),(function(N,R,D){const k=wR(R),L=wR(D);k!==L&&Rh("textcontent",N,!0,L)})(e,t||i,n),Rh("update",e,!0,{dirtyElements:I,dirtyLeaves:y,editorState:n,mutatedNodes:x,normalizedNodes:v,prevEditorState:t||i,tags:S}),(function(N,R){if(N._deferred=[],R.length!==0){const D=N._updating;N._updating=!0;try{for(let k=0;k<R.length;k++)R[k]()}finally{N._updating=D}}})(e,b),(function(N){const R=N._updates;if(R.length!==0){const D=R.shift();if(D){const[k,L]=D;wE(N,k,L)}}})(e)}function Rh(e,t,n,...s){const r=t._updating;t._updating=n;try{const i=t._listeners[e],o=Array.from(i);for(const[c,u]of o){u&&u();const d=c(...s);i.has(c)?i.set(c,d):d&&d()}}finally{t._updating=r}}function _R(e,t){const n=e._updates;let s=t||!1;for(;n.length!==0;){const r=n.shift();if(r){const[i,o]=r,c=e._pendingEditorState;let u;o!==void 0&&(u=o.onUpdate,o.skipTransforms&&(s=!0),o.discrete&&(c===null&&Ge(191),c._flushSync=!0),u&&e._deferred.push(u),FL(e,o.tag)),c==null?wE(e,i,o):i()}}return s}function wE(e,t,n){const s=e._updateTags;let r,i=!1,o=!1;
876n!==void 0&&(r=n.onUpdate,FL(e,n.tag),i=n.skipTransforms||!1,o=n.discrete||!1),r&&e._deferred.push(r);const c=e._editorState;let u=e._pendingEditorState,d=!1;(u===null||u._readOnly)&&(u=e._pendingEditorState=UL(u||c),d=!0),u._flushSync=o;const p=zs,g=$r,A=Qs,E=e._updating;zs=u,$r=!1,e._updating=!0,Qs=e;const x=e._headless||e.getRootElement()===null;z2(null);try{d&&(x?c._selection!==null&&(u._selection=c._selection.clone()):u._selection=(function(S,b){const w=S.getEditorState()._selection,_=vi(Si(S));return Me(w)||w==null?M2(w,_,S,b):w.clone()})(e,n&&n.event||null));const I=e._compositionKey;t(),i=_R(e,i),(function(S,b){const w=b.getEditorState()._selection,_=S._selection;if(Me(_)){const N=_.anchor,R=_.focus;let D;if(N.type==="text"&&(D=N.getNode(),D.selectionTransform(w,_)),R.type==="text"){const k=R.getNode();D!==k&&k.selectionTransform(w,_)}}})(u,e),e._dirtyType!==0&&(i?(function(S,b){const w=b._dirtyLeaves,_=S._nodeMap;for(const N of w){const R=_.get(N);$e(R)&&R.isAttached()&&R.isSimpleText()&&!R.isUnmergeable()&&eR(R)}})(u,e):(function(S,b){const w=b._dirtyLeaves,_=b._dirtyElements,N=S._nodeMap,R=Kl(),D=new Map;let k=w,L=k.size,O=_,P=O.size;for(;L>0||P>0;){if(L>0){b._dirtyLeaves=new Set;for(const B of k){const F=N.get(B);$e(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&eR(F),F!==void 0&&SR(F,R)&&IR(b,F,D),w.add(B)}if(k=b._dirtyLeaves,L=k.size,L>0){AA++;continue}}b._dirtyLeaves=new Set,b._dirtyElements=new Map,O.delete("root")&&O.set("root",!0);for(const B of O){const F=B[0],z=B[1];if(_.set(F,z),!z)continue;const Q=N.get(F);Q!==void 0&&SR(Q,R)&&IR(b,Q,D)}k=b._dirtyLeaves,L=k.size,O=b._dirtyElements,P=O.size,AA++}b._dirtyLeaves=w,b._dirtyElements=_})(u,e),_R(e),(function(S,b,w,_){const N=S._nodeMap,R=b._nodeMap,D=[];for(const[k]of _){const L=R.get(k);L!==void 0&&(L.isAttached()||(Ne(L)&&HP(L,k,N,R,D,_),N.has(k)||_.delete(k),D.push(k)))}for(const k of D)R.delete(k);for(const k of w){const L=R.get(k);L===void 0||L.isAttached()||(N.has(k)||w.delete(k),R.delete(k))}})(c,u,e._dirtyLeaves,e._dirtyElements)),I!==e._compositionKey&&(u._flushSync=!0);const v=u._selection;if(Me(v)){const S=u._nodeMap,b=v.anchor.key,w=v.focus.key;S.get(b)!==void 0&&S.get(w)!==void 0||Ge(19)}else Qr(v)&&v._nodes.size===0&&(u._selection=null)}catch(I){return I instanceof Error&&e._onError(I),e._pendingEditorState=c,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void $a(e)}finally{zs=p,$r=g,Qs=A,e._updating=E,AA=0}e._dirtyType!==0||e._deferred.length>0||(function(I,v){const S=v.getEditorState()._selection,b=I._selection;if(b!==null){if(b.dirty||!b.is(S))return!0}else if(S!==null)return!0;return!1})(u,e)?u._flushSync?(u._flushSync=!1,$a(e)):d&&Fpe(()=>{$a(e)}):(u._flushSync=!1,d&&(s.clear(),e._deferred=[],e._pendingEditorState=null))}function ea(e,t,n){Qs===e&&n===void 0?t():wE(e,t,n)}class Dh{element;before;after;constructor(t,n,s){this.element=t,this.before=n||null,this.after=s||null}withBefore(t){return new Dh(this.element,t,this.after)}withAfter(t){return new Dh(this.element,this.before,t)}withElement(t){return this.element===t?this:new Dh(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&Ge(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&Ge(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&Ge(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(xE||Fm||EE);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,s=t.nodeName==="IMG"?t.nextSibling:null;s&&n.removeChild(s),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const s=this.element,r=this.before,i=document.createElement("br");if(s.insertBefore(i,r),t){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",s.insertBefore(o,i),s.__lexicalLineBreak=o}else s.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,s,r){if(s===this.element){const u=this.getFirstChildOffset();return[t,Math.min(u+t.getChildrenSize(),Math.max(u,r))]}const i=TR(n,s);i.push(r);const o=TR(n,this.element);let c=t.getIndexWithinParent();for(let u=0;u<o.length;u++){const d=i[u],p=o[u];
876if(d===void 0||d<p)break;if(d>p){c+=1;break}}return[t.getParentOrThrow(),c]}}function TR(e,t){const n=[];let s=t;for(;s!==e&&s!==null;s=s.parentNode){let r=0;for(let i=s.previousSibling;i!==null;i=i.previousSibling)r++;n.push(r)}return s!==e&&Ge(225),n.reverse()}class yi extends Jo{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return Ufe[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=Ln()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if($e(n)&&t.push(n),Ne(n)){const s=n.getAllTextNodes();t.push(...s)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Ne(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;Ne(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),s=n.length;if(t>=s){const i=n[s-1];return Ne(i)&&i.getLastDescendant()||i||null}const r=n[t];return Ne(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Xt(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Ge(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Xt(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Ge(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let s,r;if(t<n/2){for(s=this.getFirstChild(),r=0;s!==null&&r<=t;){if(r===t)return s;s=s.getNextSibling(),r++}return null}for(s=this.getLastChild(),r=n-1;s!==null&&r>=t;){if(r===t)return s;s=s.getPreviousSibling(),r--}return null}getTextContent(){let t="";const n=this.getChildren(),s=n.length;for(let r=0;r<s;r++){const i=n[r];t+=i.getTextContent(),Ne(i)&&r!==s-1&&!i.isInline()&&(t+=CE)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),s=n.length;for(let r=0;r<s;r++){const i=n[r];t+=i.getTextContentSize(),Ne(i)&&r!==s-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=XI[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Au[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return l1(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){fr();const s=We();let r=t,i=n;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const u=this.getFirstChild();if($e(u)||Ne(u))return u.select(0,0)}else if(!(t!==void 0&&t!==o||n!==void 0&&n!==o)){const u=this.getLastChild();if($e(u)||Ne(u))return u.select()}}r===void 0&&(r=o),i===void 0&&(i=o);const c=this.__key;return Me(s)?(s.anchor.set(c,r,"element"),s.focus.set(c,i,"element"),s.dirty=!0,s):PL(c,r,c,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();
876return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?XI[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,s){i1(this)&&Ge(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();t+n<=r||Ge(226,String(t),String(n),String(r));const o=i.__key,c=[],u=[],d=this.getChildAtIndex(t+n);let p=null,g=r-n+s.length;if(t!==0)if(t===r)p=this.getLastChild();else{const E=this.getChildAtIndex(t);E!==null&&(p=E.getPreviousSibling())}if(n>0){let E=p===null?this.getFirstChild():p.getNextSibling();for(let x=0;x<n;x++){E===null&&Ge(100);const y=E.getNextSibling(),I=E.__key;au(E.getWritable()),u.push(I),E=y}}let A=p;for(const E of s){A!==null&&E.is(A)&&(p=A=A.getPreviousSibling());const x=E.getWritable();x.__parent===o&&g--,au(x);const y=E.__key;if(A===null)i.__first=y,x.__prev=null;else{const I=A.getWritable();I.__next=y,x.__prev=I.__key}E.__key===o&&Ge(76),x.__parent=o,c.push(y),A=E}if(t+n===r)A!==null&&(A.getWritable().__next=null,i.__last=A.__key);else if(d!==null){const E=d.getWritable();if(A!==null){const x=A.getWritable();E.__prev=A.__key,x.__next=d.__key}else E.__prev=null}if(i.__size=g,u.length){const E=We();
876if(Me(E)){const x=new Set(u),y=new Set(c),{anchor:I,focus:v}=E;NR(I,x,y)&&a1(I,I.getNode(),this,p,d),NR(v,x,y)&&a1(v,v.getNode(),this,p,d),g!==0||this.canBeEmpty()||Yr(this)||this.remove()}}return i}getDOMSlot(t){return new Dh(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(rr(n)){const s=this.getIndent();s>0&&(n.style.paddingInlineStart=40*s+"px");const r=this.getDirection();r&&(n.dir=r)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),s=this.getTextStyle();return n===0&&s===""||Yr(this)||this.getChildren().some($e)||(n!==0&&(t.textFormat=n),s!==""&&(t.textStyle=s)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,s){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const s=this.getDOMSlot(t);let r=s.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const o=n.getElementByKey(i.getKey());o!==null&&(r==null?(s.insertChild(o),r=o):r!==o&&s.replaceChild(o,r),r=r.nextSibling)}}}function Ne(e){return e instanceof yi}function NR(e,t,n){let s=e.getNode();for(;s;){const r=s.__key;if(t.has(r)&&!n.has(r))return!0;s=s.getParent()}return!1}class RE extends Jo{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function nn(e){return e instanceof RE}class qf extends yi{__cachedText;static getType(){return"root"}static clone(){return new qf}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Ge(51)}getTextContent(){const t=this.__cachedText;return!Qm()&&Ln()._dirtyType!==0||t===null?super.getTextContent():t}remove(){Ge(52)}replace(t){Ge(53)}insertBefore(t){Ge(54)}insertAfter(t){Ge(55)}updateDOM(t,n){return!1}splice(t,n,s){for(const r of s)Ne(r)||nn(r)||Ge(282);return super.splice(t,n,s)}static importJSON(t){return St().updateFromJSON(t)}collapseAtStart(){return!0}}function Os(e){return e instanceof qf}function UL(e){return new Hm(new Map(e._nodeMap))}function B2(){return new Hm(new Map([["root",new qf]]))}function zL(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Ge(130,n.name),Ne(e)){const s=t.children;Array.isArray(s)||Ge(59,n.name);const r=e.getChildren();for(let i=0;i<r.length;i++){const o=zL(r[i]);s.push(o)}}return t}function Ope(e){return e instanceof Hm}class Hm{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return vR(n&&n.editor||null,this,t)}clone(t){const n=new Hm(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return vR(null,this,()=>({root:zL(St())}))}}class F2 extends yi{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Wf extends yi{static getType(){return"paragraph"}static clone(t){return new Wf(t.__key)}createDOM(t){const n=document.createElement("p"),s=uf(t.theme,"paragraph");return s!==void 0&&n.classList.add(...s),n}updateDOM(t,n,s){return!1}static importDOM(){return{p:t=>({conversion:Ppe,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(rr(n)){this.isEmpty()&&n.append(document.createElement("br"));const s=this.getFormatType();s&&(n.style.textAlign=s)}return{element:n}}static importJSON(t){return hn().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find($e);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const s=hn();s.setTextFormat(t.format),s.setTextStyle(t.style);const r=this.getDirection();return s.setDirection(r),s.setFormat(this.getFormatType()),s.setStyle(this.getStyle()),this.insertAfter(s,n),s}collapseAtStart(){const t=this.getChildren();if(t.length===0||$e(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Ppe(e){const t=hn();if(e.style&&(t.setFormat(e.style.textAlign),rM(e,t)),t.getFormatType()===""){const n=e.getAttribute("align");n&&n&&n in XI&&t.setFormat(n)}return{node:t}}function hn(){return ya(new Wf)}function Kf(e){return e instanceof Wf}const Pt=0,Ya=1,ns=3,Lpe=4;function QL(e,t,n,s){const r=e._keyToDOMMap;r.clear(),e._editorState=B2(),e._pendingEditorState=s,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",r.set("root",n))}function Mpe(e){const t=new Set,n=new Set;let s=e;for(;s;){const{ownNodeConfig:r}=OE(s),i=s.transform;if(!n.has(i)){n.add(i);const o=s.transform();o&&t.add(o)}if(r){const o=r.$transform;o&&t.add(o),s=r.extends}else{const o=Object.getPrototypeOf(s);s=o.prototype instanceof Jo&&o!==Jo?o:void 0}}return t}function U2(e){const t=e||{},n=Dpe(),s=t.theme||{},r=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,o=B2(),c=t.namespace||(r!==null?r._config.namespace:ZL()),u=t.editorState,d=[qf,
876So,Vf,Gf,Wf,F2,...t.nodes||[]],{onError:p,html:g}=t,A=t.editable===void 0||t.editable;let E;if(e===void 0&&n!==null)E=n._nodes;else{E=new Map;for(let y=0;y<d.length;y++){let I=d[y],v=null,S=null;if(typeof I!="function"){const _=I;I=_.replace,v=_.with,S=_.withKlass||null}OE(I);const b=I.getType(),w=Mpe(I);E.set(b,{exportDOM:g&&g.export?g.export.get(I):void 0,klass:I,replace:v,replaceWithKlass:S,sharedNodeState:Kfe(d[y]),transforms:w})}}const x=new If(o,r,E,{disableEvents:i,namespace:c,theme:s},p||console.error,(function(y,I){const v=new Map,S=new Set,b=w=>{Object.keys(w).forEach(_=>{let N=v.get(_);N===void 0&&(N=[],v.set(_,N)),N.push(w[_])})};return y.forEach(w=>{const _=w.klass.importDOM;if(_==null||S.has(_))return;S.add(_);const N=_.call(w.klass);N!==null&&b(N)}),I&&b(I),v})(E,g?g.import:void 0),A,e);return u!==void 0&&(x._pendingEditorState=u,x._dirtyType=2),(function(y){y.registerCommand(tL,cpe,Pt),y.registerCommand(nL,upe,Pt),y.registerCommand(sL,dpe,Pt),y.registerCommand(rL,fpe,Pt),y.registerCommand(iL,ppe,Pt)})(x),x}function jpe(e,t){const n=e.get(t);e.delete(t),n&&n()}function rh(e,t,n){return e.set(t,n),jpe.bind(null,e,t)}class If{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,s,r,i,o,c,u){this._createEditorArgs=u,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=s,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=ZL(),this._onError=i,this._htmlConversions=o,this._editable=c,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){return rh(this._listeners.update,t)}registerEditableListener(t){return rh(this._listeners.editable,t)}registerDecoratorListener(t){return rh(this._listeners.decorator,t)}registerTextContentListener(t){return rh(this._listeners.textcontent,t)}registerRootListener(t){const n=this._listeners.root;return Nr(rh(n,t,t(this._rootElement,null)||void 0),()=>(function(s,r,i){const o=s.get(r);o&&o(),s.set(r,r(...i)||void 0)})(n,t,[null,this._rootElement]))}registerCommand(t,n,s){s===void 0&&Ge(35);const r=this._commands;r.has(t)||r.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(t);i===void 0&&Ge(36,String(t));const o=i[s];return o.add(n),()=>{o.delete(n),i.every(c=>c.size===0)&&r.delete(t)}}registerMutationListener(t,n,s){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let o=i.get(n);o===void 0&&(o=new Set,i.set(n,o)),o.add(r);const c=s&&s.skipInitialization;return c!==void 0&&c||this.initializeMutationListener(n,r),()=>{o.delete(r),o.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&Ge(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const s=this._editorState,r=MR(s).get(n.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:s,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const s=this.getRegisteredNode(t);return s.transforms.add(n),s}registerNodeTransform(t,n){const s=this.registerNodeTransformToKlass(t,n),r=[s],i=s.replaceWithKlass;if(i!=null){const o=this.registerNodeTransformToKlass(i,n);r.push(o)}return(function(o,c){const u=MR(o.getEditorState()),d=[];
876for(const p of c){const g=u.get(p);g&&d.push(g)}d.length!==0&&o.update(()=>{for(const p of d)for(const g of p.keys()){const A=Xt(g);A&&A.markDirty()}},o._pendingEditorState===null?{tag:iu}:void 0)})(this,r.map(o=>o.klass.getType())),()=>{r.forEach(o=>o.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return it(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const s=uf(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,QL(this,n,t,r),n!==null&&(this._config.disableEvents||hpe(n),s!=null&&n.classList.remove(...s)),t!==null){const i=Y2(t),o=t.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,qP(this),this._updateTags.add(iu),$a(this),this._config.disableEvents||(function(c,u){const d=c.ownerDocument;lS.set(c,d);const p=s1.get(d)??0;p<1&&d.addEventListener("selectionchange",vL),s1.set(d,p+1),c.__lexicalEditor=u;const g=SL(c);for(let A=0;A<aS.length;A++){const[E,x]=aS[A],y=typeof x=="function"?I=>{aR(I)||(oR(I),(u.isEditable()||E==="click")&&x(I,u))}:I=>{if(aR(I))return;oR(I);const v=u.isEditable();switch(E){case"cut":return v&&it(u,TE,I);case"copy":return it(u,_E,I);case"paste":return v&&it(u,bE,I);case"dragstart":return v&&it(u,gL,I);case"dragover":return v&&it(u,AL,I);case"dragend":return v&&it(u,spe,I);case"focus":return v&&it(u,ope,I);case"blur":return v&&it(u,ape,I);case"drop":return v&&it(u,hL,I)}};c.addEventListener(E,y),g.push(()=>{c.removeEventListener(E,y)})}})(t,this),s!=null&&t.classList.add(...s)}else this._window=null,this._updateTags.add(iu),$a(this);Rh("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&Ge(38);let s=t;s._readOnly&&(s=UL(t),s._selection=t._selection?t._selection.clone():null),GP(this);const r=this._pendingEditorState,i=this._updateTags,o=n!==void 0?n.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),$a(this)),this._pendingEditorState=s,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),this._updating||$a(this)}parseEditorState(t,n){return(function(s,r,i){const o=B2(),c=zs,u=$r,d=Qs,p=r._dirtyElements,g=r._dirtyLeaves,A=r._cloneNotNeeded,E=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,zs=o,$r=!1,Qs=r,z2(null);try{const x=r._nodes;j2(s.root,x),i&&i(),o._readOnly=!0}catch(x){x instanceof Error&&r._onError(x)}finally{r._dirtyElements=p,r._dirtyLeaves=g,r._cloneNotNeeded=A,r._dirtyType=E,zs=c,$r=u,Qs=d}return o})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return $a(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(s,r,i){s._updating?s._updates.push([r,i]):wE(s,r,i)})(this,t,n)}focus(t,n={}){const s=this._rootElement;s!==null&&(s.setAttribute("autocapitalize","off"),ea(this,()=>{const r=We(),i=St();r!==null?r.dirty||as(r.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),$2("focus"),Qpe(()=>{s.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&s.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=vi(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Rh("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}If.version="0.42.0+prod.esm";let mS=null;function z2(e){mS=e}let Bpe=1;function HL(e,t){const n=Q2(e,t);return n===void 0&&Ge(30,t),n}function Q2(e,t){return e._nodes.get(t)}const Fpe=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function VL(e){return nn(pr(e))}function H2(e){const t=document.activeElement;if(!rr(t))return!1;const n=t.nodeName;return nn(pr(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&DE(t)==null)}function Vm(e,t,n){const s=e.getRootElement();
876try{return s!==null&&s.contains(t)&&s.contains(n)&&t!==null&&!H2(t)&&GL(t)===e}catch{return!1}}function V2(e){return e instanceof If}function GL(e){let t=e;for(;t!=null;){const n=DE(t);if(V2(n))return n;t=Gm(t)}return null}function DE(e){return e?e.__lexicalEditor:null}function ou(e){return DL(e)||e.isToken()}function Ho(e){return ou(e)||e.isSegmented()}function pl(e){return $f(e)&&e.nodeType===3}function qL(e){return $f(e)&&e.nodeType===9}function Sf(e){let t=e;for(;t!=null;){if(pl(t))return t;t=t.firstChild}return null}function l1(e,t,n){const s=Au[t];if(n!==null&&(e&s)===(n&s))return e;let r=e^s;return t==="subscript"?r&=-65:t==="superscript"?r&=-33:t==="lowercase"?(r&=-513,r&=-1025):t==="uppercase"?(r&=-257,r&=-1025):t==="capitalize"&&(r&=-257,r&=-513),r}function WL(e){return $e(e)||Zo(e)||nn(e)}function KL(e,t){const n=(function(){const o=mS;return mS=null,o})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);fr(),jL();const s=Ln(),r=Ec(),i=""+Bpe++;r._nodeMap.set(i,e),Ne(e)?s._dirtyElements.set(i,!0):s._dirtyLeaves.add(i),s._cloneNotNeeded.add(i),s._dirtyType=1,e.__key=i}function au(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),s=t.getWritable(),r=e.getPreviousSibling(),i=e.getNextSibling(),o=i!==null?i.__key:null,c=r!==null?r.__key:null,u=r!==null?r.getWritable():null,d=i!==null?i.getWritable():null;r===null&&(s.__first=o),i===null&&(s.__last=c),u!==null&&(u.__next=o),d!==null&&(d.__prev=c),n.__prev=null,n.__next=null,n.__parent=null,s.__size--}}function c1(e){jL(),i1(e)&&Ge(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,s=Ec(),r=Ln(),i=s._nodeMap,o=r._dirtyElements;n!==null&&(function(u,d,p){let g=u;for(;g!==null;){if(p.has(g))return;const A=d.get(g);if(A===void 0)break;p.set(g,!1),g=A.__parent}})(n,i,o);const c=t.__key;r._dirtyType=1,Ne(e)?o.set(c,!0):r._dirtyLeaves.add(c)}function tr(e){fr();const t=Ln(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const s=Xt(n);s!==null&&s.getWritable()}if(e!==null){const s=Xt(e);s!==null&&s.getWritable()}}}function Kl(){return Qm()?null:Ln()._compositionKey}function Xt(e,t){const n=(t||Ec())._nodeMap.get(e);return n===void 0?null:n}function $L(e,t){const n=kE(e,Ln());return n!==void 0?Xt(n,t):null}function kE(e,t){return e[`__lexicalKey_${t._key}`]}function pr(e,t){let n=e;for(;n!=null;){const s=$L(n,t);if(s!==null)return s;n=Gm(n)}return null}function YL(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function wR(e){return e.read(()=>St().getTextContent())}function St(){return XL(Ec())}function XL(e){return e._nodeMap.get("root")}function as(e){fr();const t=Ec();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Kd(e){const t=Ln(),n=(function(s,r){let i=s;for(;i!=null;){const o=kE(i,r);if(o!==void 0)return o;i=Gm(i)}return null})(e,t);return n===null?e===t.getRootElement()?Xt("root"):null:Xt(n)}function JL(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function G2(e){const t=[];for(let n=e;n!==null;n=n._updating?null:n._parentEditor)t.push(n);return t}function ZL(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function eM(e){return pl(e)?e.nodeValue:null}function q2(e,t,n){const s=vi(Si(t));if(s===null)return;const r=s.anchorNode;let{anchorOffset:i,focusOffset:o}=s;if(r!==null){let c=eM(r);const u=pr(r);if(c!==null&&$e(u)){if((c===em||c===R2)&&n){const d=n.length;c=n,i=d,o=d}c!==null&&W2(u,c,i,o,e)}}}function W2(e,t,n,s,r){let i=e;if(i.isAttached()&&(r||!i.isDirty())){const o=i.isComposing();let c=t;if((o||r)&&(t.endsWith(em)&&(c=t.slice(0,-em.length)),r)){const d=R2;let p;for(;(p=c.indexOf(d))!==-1;)c=c.slice(0,p)+c.slice(p+d.length),n!==null&&n>p&&(n=Math.max(p,n-d.length)),s!==null&&s>p&&(s=Math.max(p,s-d.length))}const u=i.getTextContent();if(r||c!==u){if(c===""){if(tr(null),EE||Fm||xE)i.remove();else{const y=Ln();setTimeout(()=>{y.update(()=>{i.isAttached()&&i.remove()})},20)}return}const d=i.getParent(),p=Vu(),g=i.getTextContentSize(),A=Kl(),E=i.getKey();if(i.isToken()||A!==null&&E===A&&!o||Me(p)&&(d!==null&&!d.canInsertTextBefore()&&p.anchor.offset===0||p.anchor.key===e.__key&&p.anchor.offset===0&&!i.canInsertTextBefore()&&!o||p.focus.key===e.__key&&p.focus.offset===g&&!i.canInsertTextAfter()&&!o))return void i.markDirty();const x=We();if(!Me(x)||n===null||s===null)return void RR(i,c,x);if(x.setTextNodeRange(i,n,i,s),i.isSegmented()){const y=Rs(i.getTextContent());i.replace(y),i=y}RR(i,c,x)}}}
876function RR(e,t,n){if(e.setTextContent(t),Me(n)){const s=e.getKey();for(const r of["anchor","focus"]){const i=n[r];i.type==="text"&&i.key===s&&(i.offset=ec(e,i.offset,"clamp"))}}}function M0(e,t,n){const s=t[n]||!1;return s==="any"||s===e[n]}function Upe(e,t){return M0(e,t,"altKey")&&M0(e,t,"ctrlKey")&&M0(e,t,"shiftKey")&&M0(e,t,"metaKey")}function An(e,t,n){if(!Upe(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;const s="Key"+t.toUpperCase();return e.code===s}const Va={ctrlKey:!co,metaKey:co},DR={altKey:co,ctrlKey:!co};function kR(e){return e.key==="Backspace"}function OR(e){return An(e,"a",Va)}function zpe(e){const t=St();if(Me(e)){const n=e.anchor,s=e.focus,r=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(r.getKey(),0,"element"),s.set(r.getKey(),r.getChildrenSize(),"element"),JA(e),e}{const n=t.select(0,t.getChildrenSize());return as(JA(n)),n}}function uf(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,s=n[t];if(s!==void 0)return s;const r=e[t];if(typeof r=="string"){const i=lc(r);return n[t]=i,i}return r}function K2(e,t,n,s,r){if(n.size===0)return;const i=s.__type,o=s.__key,c=t.get(i);c===void 0&&Ge(33,i);const u=c.klass;let d=e.get(u);d===void 0&&(d=new Map,e.set(u,d));const p=d.get(o),g=p==="destroyed"&&r==="created";(p===void 0||g)&&d.set(o,g?"updated":r)}function PR(e,t,n){const s=e.getParent();let r=n,i=e;return s!==null&&(t&&n===0?(r=i.getIndexWithinParent(),i=s):t||n!==i.getChildrenSize()||(r=i.getIndexWithinParent()+1,i=s)),i.getChildAtIndex(t?r-1:r)}function gS(e,t){const n=e.offset;if(e.type==="element")return PR(e.getNode(),t,n);{const s=e.getNode();if(t&&n===0||!t&&n===s.getTextContentSize()){const r=t?s.getPreviousSibling():s.getNextSibling();return r===null?PR(s.getParentOrThrow(),t,s.getIndexWithinParent()+(t?0:1)):r}}return null}function tM(e){const t=Si(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function it(e,t,n){return(function(s,r,i){const o=G2(s);for(let c=4;c>=0;c--)for(let u=0;u<o.length;u++){const d=o[u],p=d._commands.get(r);if(p!==void 0){const g=p[c];if(g!==void 0){const A=Array.from(g),E=A.length;let x=!1;if(ea(d,()=>{for(let y=0;y<E;y++)if(A[y](i,s))return void(x=!0)}),x)return x}}}return!1})(e,t,n)}function vf(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&Ge(75,t),n}function Gm(e){const t=e.assignedSlot||e.parentElement;return ES(t)?t.host:t}function nM(e){return qL(e)?e:rr(e)?e.ownerDocument:null}function $2(e){fr(),Ln()._updateTags.add(e)}function Qpe(e){fr(),Ln()._deferred.push(e)}function _f(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Y2(e){const t=nM(e);return t?t.defaultView:null}function Si(e){const t=e._window;return t===null&&Ge(78),t}function Hpe(e){let t=e.getParentOrThrow();for(;t!==null;){if(Yr(t))return t;t=t.getParentOrThrow()}return t}function Yr(e){return Os(e)||Ne(e)&&e.isShadowRoot()}function di(e,t=!1){const n=e.constructor.clone(e);return KL(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function ya(e){const t=Ln(),n=e.getType(),s=Q2(t,n);s===void 0&&Ge(200,e.constructor.name,n);const{replace:r,replaceWithKlass:i}=s;
876if(r!==null){const o=r(e),c=o.constructor;return i!==null?o instanceof i||Ge(201,i.name,i.getType(),c.name,c.getType(),e.constructor.name,n):o instanceof e.constructor&&c!==e.constructor||Ge(202,c.name,c.getType(),e.constructor.name,n),o.__key===e.__key&&Ge(203,e.constructor.name,n,c.name,c.getType()),o}return e}function ob(e,t){!Os(e.getParent())||Ne(t)||nn(t)||Ge(99)}function Vpe(e){const t=Xt(e);return t===null&&Ge(63,e),t}function ab(e){return(nn(e)||Ne(e)&&!e.canBeEmpty())&&!e.isInline()}function AS(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const s=e.parentElement;s!==null&&s.removeChild(e)}function vi(e){return ko?(e||window).getSelection():null}function Gpe(e){const t=Y2(e);return t?t.getSelection():null}function rr(e){return $f(e)&&e.nodeType===1}function $f(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function ES(e){return $f(e)&&e.nodeType===11}function xS(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function u1(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Vi(e){if(nn(e)&&!e.isInline())return!0;if(!Ne(e)||Yr(e))return!1;const t=e.getFirstChild(),n=t===null||Zo(t)||$e(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function X2(){return Ln()}const LR=new WeakMap,qpe=new Map;function MR(e){if(!e._readOnly&&e.isEmpty())return qpe;e._readOnly||Ge(192);let t=LR.get(e);return t||(t=(function(n){const s=new Map;for(const[r,i]of n._nodeMap){const o=i.__type;let c=s.get(o);c||(c=new Map,s.set(o,c)),c.set(r,i)}return s})(e),LR.set(e,t)),t}function sM(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Wpe(e){return(t=sM(e))[_L]=!0,t;var t}function rM(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,s=Math.round(n/40);t.setIndent(s)}function Kpe(e){return e.__lexicalUnmanaged===!0}function ih(e,t){return(function(n,s){return Object.prototype.hasOwnProperty.call(n,s)})(e,t)&&e[t]!==Jo[t]}function OE(e){const t=Ww in e.prototype?e.prototype[Ww]():void 0,n=(function(o){if(!(o===Jo||o.prototype instanceof Jo)){let c="<unknown>",u="<unknown>";try{c=o.getType()}catch{}try{If.version&&(u=JSON.parse(If.version))}catch{}
876Ge(290,o.name,c,u)}return o===RE||o===yi||o===Jo})(e),s=!n&&ih(e,"getType")?e.getType():void 0;let r,i=s;if(t)if(s)r=t[s];else for(const[o,c]of Object.entries(t))i=o,r=c;if(!n&&i&&(ih(e,"getType")||(e.getType=()=>i),ih(e,"clone")||(e.clone=o=>(z2(o),new e)),ih(e,"importJSON")||(e.importJSON=r&&r.$importJSON||(o=>new e().updateFromJSON(o))),!ih(e,"importDOM")&&r)){const{importDOM:o}=r;o&&(e.importDOM=()=>o)}return{ownNodeConfig:r,ownNodeType:i}}const Vs=(e,t)=>{let n=e;for(;n!=null&&!Os(n);){if(t(n))return n;n=n.getParent()}return null},$pe={next:"previous",previous:"next"};class J2{origin;constructor(t){this.origin=t}[Symbol.iterator](){return iM({hasNext:Tf,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Ar(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ar(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const s=this.getNodeAtCaret();return t.is(this.origin)||t.is(s)||(s===null?this.insert(t):s.replace(t,n)),this}splice(t,n,s="next"){const r=s===this.direction?n:Array.from(n).reverse();let i=this;const o=this.getParentAtCaret(),c=new Map;for(let u=i.getAdjacentCaret();u!==null&&c.size<t;u=u.getAdjacentCaret()){const d=u.origin.getWritable();c.set(d.getKey(),d)}for(const u of r){if(c.size>0){const d=i.getNodeAtCaret();if(d){if(c.delete(d.getKey()),c.delete(u.getKey()),!(d.is(u)||i.origin.is(u))){const p=u.getParent();p&&p.is(o)&&u.remove(),d.replace(u)}}else d===null&&Ge(263,Array.from(c).join(" "))}else i.insert(u);i=Ar(u,this.direction)}for(const u of c.values())u.remove();return this}}class am extends J2{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:vo(t,this.direction)}getParentCaret(t="root"){return Ar(Z2(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Yf(this.direction);return Ar(this.getNodeAtCaret(),t)||vo(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof am&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const Ype={root:Os,shadowRoot:Yr};function Yf(e){return $pe[e]}function Z2(e,t="root"){return Ype[t](e)?null:e}class Su extends J2{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ar(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Ne(this.origin)?vo(this.origin,this.direction):null}getParentCaret(t="root"){return Ar(Z2(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Yf(this.direction);return Ar(this.getNodeAtCaret(),t)||vo(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Su&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Su||t instanceof vu)&&this.direction===t.direction&&this.origin.is(t.origin)}}class vu extends J2{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:_u(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Ar(Z2(this.getParentAtCaret(),t),this.direction)}getFlipped(){return _u(this.origin,Yf(this.direction),this.offset)}isSamePointCaret(t){return t instanceof vu&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Su||t instanceof vu)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Ar(this.origin,this.direction)}}function Zl(e){return e instanceof vu}function Tf(e){return e instanceof Su}function ta(e){return e instanceof am}const Xpe={next:class extends vu{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends vu{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}}
876,Jpe={next:class extends Su{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Su{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Zpe={next:class extends am{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends am{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Ar(e,t){return e?new Jpe[t](e):null}function _u(e,t,n){return e?new Xpe[t](e,ec(e,n)):null}function ec(e,t,n="error"){const s=e.getTextContentSize();let r=t==="next"?s:t==="previous"?0:t;return(r<0||r>s)&&(n!=="clamp"&&UP(284,String(t),String(s),e.getKey()),r=r<0?0:s),r}function jR(e,t){return new the(e,t)}function vo(e,t){return Ne(e)?new Zpe[t](e):null}function ehe(e){return e&&e.getChildCaret()||e}function e_(e){return e&&ehe(e.getAdjacentCaret())}class t_{type="node-caret-range";direction;anchor;focus;constructor(t,n,s){this.anchor=t,this.focus=n,this.direction=s}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new t_(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=r=>{const i=this[r].getLatest();return Zl(i)?(function(o,c){const{direction:u,origin:d}=o,p=ec(d,c==="focus"?Yf(u):u);return jR(o,p-o.offset)})(i,r):null},n=t("anchor"),s=t("focus");if(n&&s){const{caret:r}=n,{caret:i}=s;if(r.isSameNodeCaret(i))return[jR(r,i.offset-r.offset),null]}return[n,s]}iterNodeCarets(t="root"){const n=Zl(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),s=this.focus.getLatest(),r=Zl(s),i=o=>o.isSameNodeCaret(s)?null:e_(o)||o.getParentCaret(t);return iM({hasNext:o=>o!==null&&!(r&&s.isSameNodeCaret(o)),initial:n.isSameNodeCaret(s)?null:i(n),map:o=>o,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class the{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,s=n+t;return s<n?[s,n]:[n,s]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[s,r]=this.getSliceIndices(),i=t.getTextContent();return _u(t.setTextContent(i.slice(0,s)+i.slice(r)),n,s)}}function n_(e){return ac(e,Ar(St(),e.direction))}function nhe(e){return ac(e,e)}function ac(e,t){return e.direction!==t.direction&&Ge(265),new t_(e,t,e.direction)}function iM(e){const{initial:t,hasNext:n,step:s,map:r}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const o={done:!1,value:r(i)};return i=s(i),o}}}function oM(e,t){const n=EA(e.origin,t.origin);switch(n===null&&Ge(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const s=e.type==="text",r=t.type==="text";return s&&r?(function(i,o){return Math.sign(i-o)})(e.offset,t.offset):e.type===t.type?0:s?-1:r?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return aM(n)}}function aM(e){const{a:t,b:n}=e,s=t.__key,r=n.__key;let i=t,o=n;for(;i&&o;i=i.getNextSibling(),o=o.getNextSibling()){if(i.__key===r)return-1;if(o.__key===s)return 1}return i===null?1:-1}function j0(e,t){return t.is(e)}function BR(e){return Ne(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function EA(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[s,r]=BR(e);s;r=s,s=s.getParent())n.set(s,r);for(let[s,r]=BR(t);s;r=s,s=s.getParent()){const i=n.get(s);if(i!==void 0)return i===null?(j0(e,s)||Ge(276),{commonAncestor:s,type:"ancestor"}):r===null?(j0(t,s)||Ge(277),{commonAncestor:s,type:"descendant"}):((Ne(i)||j0(e,i))&&(Ne(r)||j0(t,r))&&s.is(i.getParent())&&s.is(r.getParent())||Ge(278),{a:i,b:r,commonAncestor:s,type:"branch"})}return null}function ll(e,t){const{type:n,key:s,offset:r}=e,i=Vpe(e.key);return n==="text"?($e(i)||Ge(266,i.getType(),s),_u(i,t,r)):(Ne(i)||Ge(267,i.getType(),s),ihe(i,e.offset,t))}function Tu(e,t){const{origin:n,direction:s}=t,r=s==="next";Zl(t)?e.set(n.getKey(),t.offset,"text"):Tf(t)?$e(n)?e.set(n.getKey(),ec(n,s),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(r?1:0),"element"):(ta(t)&&Ne(n)||Ge(268),e.set(n.getKey(),r?0:n.getChildrenSize(),"element"))}function she(e){const t=We(),n=Me(t)?t:ca();return xA(n,e),as(n),n}function xA(e,t){Tu(e.anchor,t.anchor),Tu(e.focus,t.focus)}function CS(e){const{anchor:t,focus:n}=e,s=ll(t,"next"),r=ll(n,"next"),i=oM(s,r)<=0?"next":"previous";return ac(Nf(s,i),Nf(r,i))}function s_(e){const{direction:t,origin:n}=e,s=Ar(n,Yf(t)).getNodeAtCaret();return s?Ar(s,t):vo(n.getParentOrThrow(),t)}function FR(e,t="root"){const n=[e];for(let s=ta(e)?e.getParentCaret(t):e.getSiblingCaret();s!==null;s=s.getParentCaret(t))n.push(s_(s));return n}function lb(e){return!!e&&e.origin.isAttached()}function rhe(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",s="next";let r=t;
876const i=cM(e,s),o=FR(i.anchor,n),c=FR(i.focus.getFlipped(),n),u=new Set,d=[];for(const x of i.iterNodeCarets(n))if(ta(x))u.add(x.origin.getKey());else if(Tf(x)){const{origin:y}=x;Ne(y)&&!u.has(y.getKey())||d.push(y)}for(const x of d)x.remove();for(const x of i.getTextSlices()){if(!x)continue;const{origin:y}=x.caret,I=y.getTextContentSize(),v=s_(Ar(y,s)),S=y.getMode();if(Math.abs(x.distance)===I&&r==="removeEmptySlices"||S==="token"&&x.distance!==0)v.remove();else if(x.distance!==0){r="removeEmptySlices";let b=x.removeTextSlice();const w=x.caret.origin;if(S==="segmented"){const _=b.origin,N=Rs(_.getTextContent()).setStyle(_.getStyle()).setFormat(_.getFormat());v.replaceOrInsert(N),b=_u(N,s,b.offset)}w.is(o[0].origin)&&(o[0]=b),w.is(c[0].origin)&&(c[0]=b.getFlipped())}}let p,g;for(const x of o)if(lb(x)){p=Gi(x);break}for(const x of c)if(lb(x)){g=Gi(x);break}const A=(function(x,y,I){if(!x||!y)return null;const v=x.getParentAtCaret(),S=y.getParentAtCaret();if(!v||!S)return null;const b=v.getParents().reverse();b.push(v);const w=S.getParents().reverse();w.push(S);const _=Math.min(b.length,w.length);let N;for(N=0;N<_&&b[N]===w[N];N++);const R=(L,O)=>{let P;for(let B=N;B<L.length;B++){const F=L[B];if(Yr(F))return;!P&&O(F)&&(P=F)}return P},D=R(b,Vi),k=D&&R(w,L=>I.has(L.getKey())&&Vi(L));return D&&k?[D,k]:null})(p,g,u);if(A){const[x,y]=A;vo(x,"previous").splice(0,y.getChildren());let I=y.getParent();for(y.remove(!0);I&&I.isEmpty();){const v=I;I=I.getParent(),v.remove(!0)}}const E=[p,g,...o,...c].find(lb);if(E)return nhe(Nf(Gi(E),e.direction));Ge(269,JSON.stringify(o.map(x=>x.origin.__key)))}function Gi(e){const t=(function(r){let i=r;for(;ta(i);){const o=e_(i);if(!ta(o))break;i=o}return i})(e.getLatest()),{direction:n}=t;if($e(t.origin))return Zl(t)?t:_u(t.origin,n,n);const s=t.getAdjacentCaret();return Tf(s)&&$e(s.origin)?_u(s.origin,n,Yf(n)):t}function lM(e){return Zl(e)&&e.offset!==ec(e.origin,e.direction)}function Nf(e,t){return e.direction===t?e:e.getFlipped()}function cM(e,t){return e.direction===t?e:ac(Nf(e.focus,t),Nf(e.anchor,t))}function ihe(e,t,n){let s=vo(e,"next");for(let r=0;r<t;r++){const i=s.getAdjacentCaret();if(i===null)break;s=i}return Nf(s,n)}function ohe(...e){return e}function ahe(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function lc(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[s]of n.matchAll(/\S+/g))t.push(s);return t}function tl(e,...t){const n=lc(...t);n.length>0&&e.classList.add(...n)}function r_(e,...t){const n=lc(...t);n.length>0&&e.classList.remove(...n)}function Nr(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function lhe(e){const t=U2(e);return t._headless=!0,["registerDecoratorListener","registerRootListener","registerMutationListener","getRootElement","setRootElement","getElementByKey","focus","blur"].forEach(n=>{t[n]=()=>{throw new Error(`${n} is not supported in headless mode`)}}),t}function uM(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const d1=new Map;function dM(e){const t={};if(!e)return t;const n=e.split(";");for(const s of n)if(s!==""){const[r,i]=s.split(/:([^]+)/);r&&i&&(t[r.trim()]=i.trim())}return t}function lm(e){let t=d1.get(e);return t===void 0&&(t=dM(e),d1.set(e,t)),t}function che(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}function fM(e){const t=X2().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function pM(e){return fM(Os(e)?e:e.getParentOrThrow())}function UR(e){const t=pM(e);return t!==null&&t.direction==="rtl"}function hM(e,t,n="self"){const s=e.getStartEndPoints();if(t.isSelected(e)&&!Ho(t)&&s!==null){const[r,i]=s,o=e.isBackward(),c=r.getNode(),u=i.getNode(),d=t.is(c),p=t.is(u);if(d||p){const[g,A]=pS(e),E=c.is(u),x=t.is(o?u:c),y=t.is(o?c:u);let I,v=0;E?(v=g>A?A:g,I=g>A?g:A):x?(v=o?A:g,I=void 0):y&&(v=0,I=o?g:A);const S=t.__text.slice(v,I);S!==t.__text&&(n==="clone"&&(t=Wpe(t)),t.__text=S)}}return t}function zR(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return Ne(t)||uM(177),e.offset===t.getChildrenSize()}function uhe(e){const t=e.getStyle(),n=dM(t);d1.set(t,n)}function B0(e,t){(Me(e)?e.isCollapsed():$e(e)||Ne(e))||uM(280);const n=lm(Me(e)?e.style:$e(e)?e.getStyle():e.getTextStyle()),s=Object.entries(t).reduce((i,[o,c])=>(typeof c=="function"?i[o]=c(n[o],e):c===null?delete i[o]:i[o]=c,i),{...n}),r=che(s);Me(e)||$e(e)?e.setStyle(r):e.setTextStyle(r),d1.set(r,s)}function QR(e,t){if(Me(e)&&e.isCollapsed()){B0(e,t);const s=e.anchor.getNode();Ne(s)&&s.isEmpty()&&B0(s,t)}dhe(s=>{B0(s,t)});const n=e.getNodes();if(n.length>0){const s=new Set;for(const r of n){if(!Ne(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;const i=r.getKey();s.has(i)||(s.add(i),B0(r,t))}}}function dhe(e){const t=We();if(!t)return;const n=new Map,s=i=>n.get(i.getKey())||[0,i.getTextContentSize()];if(Me(t))for(const i of CS(t).getTextSlices())i&&n.set(i.caret.origin.getKey(),i.getSliceIndices());const r=t.getNodes();for(const i of r){if(!$e(i)||!i.canHaveFormat())continue;const[o,c]=s(i);
876c!==o&&(Ho(i)||o===0&&c===i.getTextContentSize()?e(i):e(i.splitText(o,c)[o===0?0:1]))}Me(t)&&t.anchor.type==="text"&&t.focus.type==="text"&&t.anchor.key===t.focus.key&&fhe(t)}function fhe(e){if(e.isBackward()){const{anchor:t,focus:n}=e,{key:s,offset:r,type:i}=t;t.set(n.key,n.offset,n.type),n.set(s,r,i)}}function phe(e,t){const n=e.getFormatType(),s=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),s!==t.getIndent()&&t.setIndent(s)}function qa(e,t,n=phe){if(e===null)return;const s=e.getStartEndPoints(),r=new Map;let i=null;if(s){const[o,c]=s;i=ca(),i.anchor.set(o.key,o.offset,o.type),i.focus.set(c.key,c.offset,c.type);const u=Vs(o.getNode(),Vi),d=Vs(c.getNode(),Vi);Ne(u)&&r.set(u.getKey(),u),Ne(d)&&r.set(d.getKey(),d)}for(const o of e.getNodes())if(Ne(o)&&Vi(o))r.set(o.getKey(),o);else if(s===null){const c=Vs(o,Vi);Ne(c)&&r.set(c.getKey(),c)}for(const[o,c]of r){const u=t();n(c,u),c.replace(u,!0),i&&(o===i.anchor.key&&i.anchor.set(u.getKey(),i.anchor.offset,i.anchor.type),o===i.focus.key&&i.focus.set(u.getKey(),i.focus.offset,i.focus.type))}i&&e.is(We())&&as(i)}function mM(e){const t=gM(e);return t!==null&&t.writingMode==="vertical-rl"}function gM(e){const t=e.anchor.getNode();return Ne(t)?fM(t):pM(t)}function HR(e,t){let n=mM(e)?!t:t;AM(e)&&(n=!n);const s=ll(e.focus,n?"previous":"next");if(lM(s))return!1;for(const r of n_(s)){if(ta(r))return!r.origin.isInline();if(!Ne(r.origin)){if(nn(r.origin))return!0;break}}return!1}function hhe(e,t,n,s){e.modify(t?"extend":"move",n,s)}function AM(e){const t=gM(e);return t!==null&&t.direction==="rtl"}function VR(e,t,n){const s=AM(e);let r;r=mM(e)||s?!n:n,hhe(e,t,r,"character")}function mhe(e,t,n){const s=lm(e.getStyle());return s!==null&&s[t]||n}function ghe(e,t,n=""){let s=null;const r=e.getNodes(),i=e.anchor,o=e.focus,c=e.isBackward(),u=c?o.offset:i.offset,d=c?o.getNode():i.getNode();if(Me(e)&&e.isCollapsed()&&e.style!==""){const p=lm(e.style);if(p!==null&&t in p)return p[t]}for(let p=0;p<r.length;p++){const g=r[p];if((p===0||u!==0||!g.is(d))&&$e(g)){const A=mhe(g,t,n);if(s===null)s=A;else if(s!==A){s="";break}}}return s===null?n:s}function Ahe(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const EM=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ehe=EM&&"documentMode"in document?document.documentMode:null;!(!EM||!("InputEvent"in window)||Ehe)&&"getTargetRanges"in new window.InputEvent("input");function xhe(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Che(e){const t=Vs(e,n=>Ne(n)&&!n.isInline());return Ne(t)||Ahe(4,e.__key),t}function Zc(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function GR(e){const t=We();if(!Me(t))return!1;const n=new Set,s=t.getNodes();for(let r=0;r<s.length;r++){const i=s[r],o=i.getKey();if(n.has(o))continue;const c=Vs(i,d=>Ne(d)&&!d.isInline());if(c===null)continue;const u=c.getKey();c.canIndent()&&!n.has(u)&&(n.add(u),e(c))}return n.size>0}function yhe(e,t){const n=qL(t)?t.body.childNodes:t.childNodes;let s=[];const r=[];for(const i of n)if(!CM.has(i.nodeName)){const o=yM(i,e,r,!1);o!==null&&(s=s.concat(o))}return(function(i){for(const o of i)o.getNextSibling()instanceof F2&&o.insertAfter(Iu());for(const o of i){const c=o.getChildren();for(const u of c)o.insertBefore(u);o.remove()}})(r),s}function i_(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),s=St().getChildren();for(let r=0;r<s.length;r++)xM(e,s[r],n,t);return n.innerHTML}function xM(e,t,n,s=null){let r=s===null||t.isSelected(s);const i=Ne(t)&&t.excludeFromCopy("html");let o=t;s!==null&&$e(t)&&(o=hM(s,t,"clone"));const c=Ne(o)?o.getChildren():[],u=Q2(e,o.getType());let d;d=u&&u.exportDOM!==void 0?u.exportDOM(e,o):o.exportDOM(e);const{element:p,after:g}=d;if(!p)return!1;const A=document.createDocumentFragment();for(let E=0;E<c.length;E++){const x=c[E],y=xM(e,x,A,s);!r&&Ne(t)&&y&&t.extractWithChild(x,s,"html")&&(r=!0)}if(r&&!i){if((rr(p)||ES(p))&&p.append(A),n.append(p),g){const E=g.call(o,p);E&&(ES(p)?p.replaceChildren(E):p.replaceWith(E))}}else n.append(A);return r}const CM=new Set(["STYLE","SCRIPT"]);function yM(e,t,n,s,r=new Map,i){let o=[];if(CM.has(e.nodeName))return o;let c=null;const u=(function(x,y){const{nodeName:I}=x,v=y._htmlConversions.get(I.toLowerCase());let S=null;if(v!==void 0)for(const b of v){const w=b(x);w!==null&&(S===null||(S.priority||0)<=(w.priority||0))&&(S=w)}return S!==null?S.conversion:null})(e,t),d=u?u(e):null;let p=null;if(d!==null){p=d.after;const x=d.node;if(c=Array.isArray(x)?x[x.length-1]:x,c!==null){for(const[,y]of r)if(c=y(c,i),!c)break;c&&o.push(...Array.isArray(x)?x:[c])}d.forChild!=null&&r.set(e.nodeName,d.forChild)}const g=e.childNodes;let A=[];const E=(c==null||!Yr(c))&&(c!=null&&hS(c)||s);for(let x=0;x<g.length;x++)A.push(...yM(g[x],t,n,E,new Map(r),c));return p!=null&&(A=p(A)),u1(e)&&(A=bhe(e,A,E?()=>{const x=new F2;return n.push(x),x}:hn)),c==null?A.length>0?o=o.concat(A):u1(e)&&(function(x){return x.nextSibling==null||x.previousSibling==null?!1:xS(x.nextSibling)&&xS(x.previousSibling)}
876)(e)&&(o=o.concat(Iu())):Ne(c)&&c.append(...A),o}function bhe(e,t,n){const s=e.style.textAlign,r=[];let i=[];for(let o=0;o<t.length;o++){const c=t[o];if(hS(c))s&&!c.getFormat()&&c.setFormat(s),r.push(c);else if(i.push(c),o===t.length-1||o<t.length-1&&hS(t[o+1])){const u=n();u.setFormat(s),u.append(...i),r.push(u),i=[]}}return r}const bM=[];let PE=class IM extends yi{__ids;static getType(){return"mark"}static clone(t){return new IM(t.__ids,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__ids=t.__ids}static importDOM(){return null}static importJSON(t){return yS().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIDs(t.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(t=bM,n){super(n),this.__ids=t}createDOM(t){const n=document.createElement("mark");return tl(n,t.theme.mark),this.__ids.length>1&&tl(n,t.theme.markOverlap),n}updateDOM(t,n,s){const r=t.__ids,i=this.__ids,o=r.length,c=i.length,u=s.theme.markOverlap;return o!==c&&(o===1?c===2&&tl(n,u):c===1&&r_(n,u)),!1}hasID(t){return this.getIDs().includes(t)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(t){const n=this.getWritable();return n.__ids=t,n}addID(t){const n=this.getWritable();return n.__ids.includes(t)?n:n.setIDs([...n.__ids,t])}deleteID(t){const n=this.getWritable(),s=n.__ids.indexOf(t);if(s===-1)return n;const r=Array.from(n.__ids);return r.splice(s,1),n.setIDs(r)}insertNewAfter(t,n=!0){const s=yS(this.__ids);return this.insertAfter(s,n),s}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,s){if(!Me(n)||s==="html")return!1;const r=n.anchor,i=n.focus,o=r.getNode(),c=i.getNode(),u=n.isBackward()?r.offset-i.offset:i.offset-r.offset;return this.isParentOf(o)&&this.isParentOf(c)&&this.getTextContent().length===u}excludeFromCopy(t){return t!=="clone"}};function yS(e=bM){return ya(new PE(e))}function Ihe(e){return e instanceof PE}function She(e){const t=e.getChildren();let n=null;for(let s=0;s<t.length;s++){const r=t[s];n===null?e.insertBefore(r):n.insertAfter(r),n=r}e.remove()}function f1(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function vhe(e,t=We()){return t==null&&f1(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?"":i_(e,t)}function _he(e,t=We()){return t==null&&f1(166),Me(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(The(e,t))}function qR(e,t,n){const s=e.getData("application/x-lexical-editor");if(s)try{const c=JSON.parse(s);if(c.namespace===n._config.namespace&&Array.isArray(c.nodes))return WR(n,bS(c.nodes),t)}catch(c){console.error(c)}const r=e.getData("text/html"),i=e.getData("text/plain");if(r&&i!==r)try{const c=new DOMParser().parseFromString((function(u){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:d=>d}).createHTML(u):u})(r),"text/html");return WR(n,yhe(n,c),t)}catch(c){console.error(c)}const o=i||e.getData("text/uri-list");if(o!=null)if(Me(t)){const c=o.split(/(\r?\n|\t)/);c[c.length-1]===""&&c.pop();for(let u=0;u<c.length;u++){const d=We();if(Me(d)){const p=c[u];p===`
877`||p===`\r
878`?d.insertParagraph():p==="	"?d.insertNodes([zm()]):d.insertText(p)}}}else t.insertRawText(o)}function WR(e,t,n){e.dispatchCommand(ZP,{nodes:t,selection:n})||(n.insertNodes(t),(function(s){if(Me(s)&&s.isCollapsed()){const r=s.anchor;let i=null;const o=ll(r,"previous");if(o)if(Zl(o))i=o.origin;else{const c=ac(o,vo(St(),"next").getFlipped());for(const u of c){if($e(u.origin)){i=u.origin;break}if(Ne(u.origin)&&!u.origin.isInline())break}}if(i&&$e(i)){const c=i.getFormat(),u=i.getStyle();s.format===c&&s.style===u||(s.format=c,s.style=u,s.dirty=!0)}}})(n))}function SM(e,t,n,s=[]){let r=t===null||n.isSelected(t);const i=Ne(n)&&n.excludeFromCopy("html");let o=n;t!==null&&$e(o)&&(o=hM(t,o,"clone"));const c=Ne(o)?o.getChildren():[],u=(function(d){const p=d.exportJSON(),g=d.constructor;if(p.type!==g.getType()&&f1(58,g.name),Ne(d)){const A=p.children;Array.isArray(A)||f1(59,g.name)}return p})(o);$e(o)&&o.getTextContentSize()===0&&(r=!1);for(let d=0;d<c.length;d++){const p=c[d],g=SM(e,t,p,u.children);!r&&Ne(n)&&g&&n.extractWithChild(p,t,"clone")&&(r=!0)}if(r&&!i)s.push(u);else if(Array.isArray(u.children))for(let d=0;d<u.children.length;d++){const p=u.children[d];s.push(p)}return r}function The(e,t){const n=[],s=St().getChildren();for(let r=0;r<s.length;r++)SM(e,t,s[r],n);return{namespace:e._config.namespace,nodes:n}}function bS(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n],r=kpe(s);$e(r)&&uhe(r),t.push(r)}return t}let Md=null;async function KR(e,t,n){if(Md!==null)return!1;if(t!==null)return new Promise((d,p)=>{e.update(()=>{d($R(e,t,n))})});const s=e.getRootElement(),r=e._window||window,i=r.document,o=vi(r);if(s===null||o===null)return!1;const c=i.createElement("span");c.style.cssText="position: fixed; top: -1000px;",c.append(i.createTextNode("#")),s.append(c);const u=new Range;return u.setStart(c,0),u.setEnd(c,1),o.removeAllRanges(),o.addRange(u),new Promise((d,p)=>{const g=e.registerCommand(_E,A=>
878(Zc(A,ClipboardEvent)&&(g(),Md!==null&&(r.clearTimeout(Md),Md=null),d($R(e,A,n))),!0),Lpe);Md=r.setTimeout(()=>{g(),Md=null,d(!1)},50),i.execCommand("copy"),c.remove()})}function $R(e,t,n){if(n===void 0){const r=vi(e._window),i=We();if(!i||i.isCollapsed()||!r)return!1;const o=r.anchorNode,c=r.focusNode;if(o!==null&&c!==null&&!Vm(e,o,c))return!1;n=Nhe(i)}t.preventDefault();const s=t.clipboardData;return s!==null&&(whe(s,n),!0)}const vM=[["text/html",vhe],["application/x-lexical-editor",_he]];function Nhe(e=We()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=X2();for(const[s,r]of vM){const i=r(n,e);i!==null&&(t[s]=i)}}return t}function whe(e,t){for(const[n]of vM)t[n]===void 0&&e.setData(n,"");for(const n in t){const s=t[n];s!==void 0&&e.setData(n,s)}}const Rhe=Symbol.for("preact-signals");function LE(){if(tc>1)return void tc--;let e,t=!1;for(;kh!==void 0;){let n=kh;for(kh=void 0,IS++;n!==void 0;){const s=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&_M(n))try{n.c()}catch(r){t||(e=r,t=!0)}n=s}}if(IS=0,tc--,t)throw e}function Dhe(e){if(tc>0)return e();tc++;try{return e()}finally{LE()}}let dn,kh;function YR(e){const t=dn;dn=void 0;try{return e()}finally{dn=t}}let tc=0,IS=0,CA=0;function XR(e){if(dn===void 0)return;let t=e.n;return t===void 0||t.t!==dn?(t={i:0,S:e,p:dn.s,n:void 0,t:dn,e:void 0,x:void 0,r:t},dn.s!==void 0&&(dn.s.n=t),dn.s=t,e.n=t,32&dn.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=dn.s,t.n=void 0,dn.s.n=t,dn.s=t),t):void 0}function Ir(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function khe(e,t){return new Ir(e,t)}function _M(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function JR(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function TM(e){let t,n=e.s;for(;n!==void 0;){const s=n.p;n.i===-1?(n.S.U(n),s!==void 0&&(s.n=n.n),n.n!==void 0&&(n.n.p=s)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=s}e.s=t}function jd(e,t){Ir.call(this,void 0),this.x=e,this.s=void 0,this.g=CA-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function NM(e){const t=e.u;if(e.u=void 0,typeof t=="function"){tc++;const n=dn;dn=void 0;try{t()}catch(s){throw e.f&=-2,e.f|=8,o_(e),s}finally{dn=n,LE()}}}function o_(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,NM(e)}function Ohe(e){if(dn!==this)throw new Error("Out-of-order effect");TM(this),dn=e,this.f&=-2,8&this.f&&o_(this),LE()}function Gd(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function a_(e,t){const n=new Gd(e,t);try{n.c()}catch(r){throw n.d(),r}const s=n.d.bind(n);return s[Symbol.dispose]=s,s}function wM(e,t={}){const n={};for(const s in e){const r=t[s],i=khe(r===void 0?e[s]:r);n[s]=i}return n}Ir.prototype.brand=Rhe,Ir.prototype.h=function(){return!0},Ir.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:YR(()=>{var n;(n=this.W)==null||n.call(this)}))},Ir.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&YR(()=>{var s;(s=this.Z)==null||s.call(this)}))}},Ir.prototype.subscribe=function(e){return a_(()=>{const t=this.value,n=dn;dn=void 0;try{e(t)}finally{dn=n}},{name:"sub"})},Ir.prototype.valueOf=function(){return this.value},Ir.prototype.toString=function(){return this.value+""},Ir.prototype.toJSON=function(){return this.value},Ir.prototype.peek=function(){const e=dn;dn=void 0;try{return this.value}finally{dn=e}},Object.defineProperty(Ir.prototype,"value",{get(){const e=XR(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(IS>100)throw new Error("Cycle detected");this.v=e,this.i++,CA++,tc++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{LE()}}}}),jd.prototype=new Ir,jd.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===CA))return!0;if(this.g=CA,this.f|=1,this.i>0&&!_M(this))return this.f&=-2,!0;const e=dn;try{JR(this),dn=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return dn=e,TM(this),this.f&=-2,!0},jd.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Ir.prototype.S.call(this,e)},jd.prototype.U=function(e){if(this.t!==void 0&&(Ir.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},jd.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}}
878,Object.defineProperty(jd.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=XR(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Gd.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Gd.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,NM(this),JR(this),tc++;const e=dn;return dn=this,Ohe.bind(this,e)},Gd.prototype.N=function(){2&this.f||(this.f|=2,this.o=kh,kh=this)},Gd.prototype.d=function(){this.f|=8,1&this.f||o_(this)},Gd.prototype.dispose=function(){this.d()};function Phe(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}k2("format",{parse:e=>typeof e=="number"?e:0});function wn(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function RM(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,s=t;for(const r in s)n[r]=RM(n[r],s[r]);return e}return t}const l_=0,SS=1,DM=2,cb=3,F0=4,Bd=5,ub=6,oh=7;function db(e){return e.id===l_}function kM(e){return e.id===DM}function Lhe(e){return(function(t){return t.id===SS})(e)||wn(305,String(e.id),String(SS)),Object.assign(e,{id:DM})}const Mhe=new Set;class jhe{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:l_}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):ahe;for(const s of this.configs)t=n(t,s);return t}init(t){const n=this.state;kM(n)||wn(306,String(n.id));const s={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...s,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(c,u,d){return Object.assign(c,{config:u,id:cb,registerState:d})})(n,this.mergeConfigs(),s);let o;this.state=i,this.extension.init&&(o=this.extension.init(t,i.config,s)),this.state=(function(c,u,d){return Object.assign(c,{id:F0,initResult:u,registerState:d})})(i,o,r)}build(t){const n=this.state;let s;n.id!==F0&&wn(307,String(n.id),String(Bd)),this.extension.build&&(s=this.extension.build(t,n.config,n.registerState));const r={...n.registerState,getOutput:()=>s,getSignal:this.getSignal.bind(this)};this.state=(function(i,o,c){return Object.assign(i,{id:Bd,output:o,registerState:c})})(n,s,r)}register(t,n){this._signal=n;const s=this.state;s.id!==Bd&&wn(308,String(s.id),String(Bd));const r=this.extension.register&&this.extension.register(t,s.config,s.registerState);return this.state=(function(i){return Object.assign(i,{id:ub})})(s),()=>{const i=this.state;i.id!==oh&&wn(309,String(s.id),String(oh)),this.state=(function(o){return Object.assign(o,{id:Bd})})(i),r&&r()}}afterRegistration(t){const n=this.state;let s;return n.id!==ub&&wn(310,String(n.id),String(ub)),this.extension.afterRegistration&&(s=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(r){return Object.assign(r,{id:oh})})(n),s}getSignal(){return this._signal===void 0&&wn(311),this._signal}getInitResult(){this.extension.init===void 0&&wn(312,this.extension.name);const t=this.state;return(function(n){return n.id>=F0})(t)||wn(313,String(t.id),String(F0)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=cb})(t)||wn(314,String(t.id),String(cb)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&wn(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&wn(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=oh})(t)||wn(316,String(t.id),String(oh)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Mhe}getPeerNameSet(){let t=this._peerNameSet;
878return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=Bd})(t)||wn(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}}const ZR={tag:iu};function Bhe(){const e=St();e.isEmpty()&&e.append(hn())}const Fhe={config:{setOptions:ZR,updateOptions:ZR},init:({$initialEditorState:e=Bhe})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},s){const r=s.getInitResult();if(!r.initialized){r.initialized=!0;const{$initialEditorState:i}=r;if(Ope(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const o=e.parseEditorState(i);e.setEditorState(o,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[qf,So,Vf,Gf,Wf]},e8=Symbol.for("@lexical/extension/LexicalBuilder");function t8(){}function Uhe(e){throw e}function U0(e){return Array.isArray(e)?e:[e]}const fb="0.42.0+prod.esm";let OM=class yA{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=fb,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[U0(Fhe)];for(const s of t)n.push(U0(s));return new yA(n)}static maybeFromEditor(t){const n=t[e8];return n&&(n.PACKAGE_VERSION!==fb&&wn(292,n.PACKAGE_VERSION,fb),n instanceof yA||wn(293)),n}static fromEditor(t){const n=yA.maybeFromEditor(t);return n===void 0&&wn(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...s}=this.buildCreateEditorArgs(),r=Object.assign(U2({...s,...n?{onError:i=>{n(i,r)}}:{}}),{[e8]:this});for(const i of this.sortedExtensionReps())i.build(r);return r}buildEditor(){let t=t8;function n(){try{t()}finally{t=t8}}const s=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});
878return t=Nr(this.registerEditor(s),()=>s.setRootElement(null)),s}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&wn(295,t.name),n}addEdge(t,n,s){const r=this.outgoingConfigEdges.get(t);r?r.set(n,s):this.outgoingConfigEdges.set(t,new Map([[n,s]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&wn(296);const n=U0(t),[s]=n;typeof s.name!="string"&&wn(297,typeof s.name);let r=this.extensionNameMap.get(s.name);if(r!==void 0&&r.extension!==s&&wn(298,s.name),!r){r=new jhe(this,s),this.extensionNameMap.set(s.name,r);const i=this.conflicts.get(s.name);typeof i=="string"&&wn(299,s.name,i);for(const o of s.conflictsWith||[])this.extensionNameMap.has(o)&&wn(299,s.name,o),this.conflicts.set(o,s.name);for(const o of s.dependencies||[]){const c=U0(o);this.addEdge(s.name,c[0].name,c.slice(1)),this.addExtension(c)}for(const[o,c]of s.peerDependencies||[])this.addEdge(s.name,o,c?[c]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(s,r)=>{let i=s.state;if(kM(i))return;const o=s.extension.name;var c;db(i)||wn(300,o,r||"[unknown]"),db(c=i)||wn(304,String(c.id),String(l_)),i=Object.assign(c,{id:SS}),s.state=i;const u=this.outgoingConfigEdges.get(o);if(u)for(const d of u.keys()){const p=this.extensionNameMap.get(d);p&&n(p,o)}i=Lhe(i),s.state=i,t.push(s)};for(const s of this.extensionNameMap.values())db(s.state)&&n(s);for(const s of t)for(const[r,i]of this.outgoingConfigEdges.get(s.extension.name)||[])if(i.length>0){const o=this.extensionNameMap.get(r);if(o)for(const c of i)o.configs.add(c)}for(const[s,...r]of this.roots)if(r.length>0){const i=this.extensionNameMap.get(s.name);i===void 0&&wn(301,s.name);for(const o of r)i.configs.add(o)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),s=new AbortController,r=[()=>s.abort()],i=s.signal;for(const o of n){const c=o.register(t,i);c&&r.push(c)}for(const o of n){const c=o.afterRegistration(t);c&&r.push(c)}return Nr(...r)}buildCreateEditorArgs(){const t={},n=new Set,s=new Map,r=new Map,i={},o={},c=this.sortedExtensionReps();for(const p of c){const{extension:g}=p;if(g.onError!==void 0&&(t.onError=g.onError),g.disableEvents!==void 0&&(t.disableEvents=g.disableEvents),g.parentEditor!==void 0&&(t.parentEditor=g.parentEditor),g.editable!==void 0&&(t.editable=g.editable),g.namespace!==void 0&&(t.namespace=g.namespace),g.$initialEditorState!==void 0&&(t.$initialEditorState=g.$initialEditorState),g.nodes)for(const A of Phe(g)){if(typeof A!="function"){const E=s.get(A.replace);E&&wn(302,g.name,A.replace.name,E.extension.name),s.set(A.replace,p)}n.add(A)}if(g.html){if(g.html.export)for(const[A,E]of g.html.export.entries())r.set(A,E);g.html.import&&Object.assign(i,g.html.import)}g.theme&&RM(o,g.theme)}Object.keys(o).length>0&&(t.theme=o),n.size&&(t.nodes=[...n]);const u=Object.keys(i).length>0,d=r.size>0;(u||d)&&(t.html={},u&&(t.html.import=i),d&&(t.html.export=r));for(const p of c)p.init(t);return t.onError||(t.onError=Uhe),t}};function zhe(e,t){const n=OM.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function Qhe(e){const t=window.location.origin,n=s=>{if(s.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const i=s.data;if(typeof i=="string"){let o;try{o=JSON.parse(i)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const c=o.payload;if(c&&c.functionId==="makeChanges"){const u=c.args;if(u){const[d,p,g,A,E]=u;e.update(()=>{const x=We();if(Me(x)){const y=x.anchor;let I=y.getNode(),v=0,S=0;if($e(I)&&d>=0&&p>=0&&(v=d,S=d+p,x.setTextNodeRange(I,v,I,S)),v===S&&g===""||(x.insertRawText(g),I=y.getNode()),$e(I)){v=A,S=A+E;const b=I.getTextContentSize();v=v>b?b:v,S=S>b?b:S,x.setTextNodeRange(I,v,I,S)}s.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function n8(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Gu=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Hhe=Gu&&"documentMode"in document?document.documentMode:null,Vhe=Gu&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ghe=!(!Gu||!("InputEvent"in window)||Hhe)&&"getTargetRanges"in new window.InputEvent("input"),qhe=Gu&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),s8=Gu&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Whe=Gu&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Khe=Gu&&/AppleWeb
878Kit\/[\d.]+/.test(navigator.userAgent)&&Vhe&&!Whe,r8=mt("DRAG_DROP_PASTE_FILE");class qm extends yi{__tag;static getType(){return"heading"}static clone(t){return new qm(t.__tag,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__tag=t.__tag}constructor(t="h1",n){super(n),this.__tag=t}getTag(){return this.getLatest().__tag}setTag(t){const n=this.getWritable();return n.__tag=t,n}createDOM(t){const n=this.__tag,s=document.createElement(n),r=t.theme.heading;if(r!==void 0){const i=r[n];tl(s,i)}return s}updateDOM(t,n,s){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Fd,priority:0}),h2:t=>({conversion:Fd,priority:0}),h3:t=>({conversion:Fd,priority:0}),h4:t=>({conversion:Fd,priority:0}),h5:t=>({conversion:Fd,priority:0}),h6:t=>({conversion:Fd,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&i8(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>i8(t)?{conversion:n=>({node:fo("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(rr(n)){this.isEmpty()&&n.append(document.createElement("br"));const s=this.getFormatType();s&&(n.style.textAlign=s);const r=this.getDirection();r&&(n.dir=r)}return{element:n}}static importJSON(t){return fo(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const s=t?t.anchor.offset:0,r=this.getLastDescendant(),i=!r||t&&t.anchor.key===r.getKey()&&s===r.getTextContentSize()||!t?hn():fo(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,n),s===0&&!this.isEmpty()&&t){const c=hn();c.select(),this.replace(c,!0)}return i}collapseAtStart(){const t=this.isEmpty()?hn():fo(this.getTag());
878return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}}function i8(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Fd(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=fo(t),e.style!==null&&(rM(e,n),n.setFormat(e.style.textAlign))),{node:n}}function fo(e="h1"){return ya(new qm(e))}function PM(e){return e instanceof qm}function z0(e){let t=null;if(Zc(e,DragEvent)?t=e.dataTransfer:Zc(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,s=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[s,Array.from(t.files),r]}function o8(e){const t=pr(e);return nn(t)}function pb(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function $he(e){return Nr(e.registerCommand(eL,t=>{const n=We();return!!Qr(n)&&(n.clear(),!0)},Pt),e.registerCommand(el,t=>{const n=We();return Me(n)?(n.deleteCharacter(t),!0):!!Qr(n)&&(n.deleteNodes(),!0)},Pt),e.registerCommand(yu,t=>{const n=We();return!!Me(n)&&(n.deleteWord(t),!0)},Pt),e.registerCommand(bu,t=>{const n=We();return!!Me(n)&&(n.deleteLine(t),!0)},Pt),e.registerCommand(ru,t=>{const n=We();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const s=t.dataTransfer;if(s!=null)qR(s,n,e);else if(Me(n)){const r=t.data;return r&&n.insertText(r),!0}}return!0},Pt),e.registerCommand(sm,()=>{const t=We();return!!Me(t)&&(t.removeText(),!0)},Pt),e.registerCommand(mr,t=>{const n=We();return!!Me(n)&&(n.formatText(t),!0)},Pt),e.registerCommand(mL,t=>{const n=We();if(!Me(n)&&!Qr(n))return!1;const s=n.getNodes();for(const r of s){const i=Vs(r,o=>Ne(o)&&!o.isInline());i!==null&&i.setFormat(t)}return!0},Pt),e.registerCommand(Jl,t=>{const n=We();return!!Me(n)&&(n.insertLineBreak(t),!0)},Pt),e.registerCommand(Cu,()=>{const t=We();return!!Me(t)&&(t.insertParagraph(),!0)},Pt),e.registerCommand(npe,()=>{const t=zm(),n=We();return Me(n)&&(t.setFormat(n.format),t.setStyle(n.style)),wpe([t]),!0},Pt),e.registerCommand(pL,()=>GR(t=>{const n=t.getIndent();t.setIndent(n+1)}),Pt),e.registerCommand(oS,()=>GR(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),Pt),e.registerCommand(lL,t=>{const n=We();if(Qr(n)){const s=n.getNodes();if(s.length>0)return t.preventDefault(),s[0].selectPrevious(),!0}else if(Me(n)){const s=gS(n.focus,!0);if(!t.shiftKey&&nn(s)&&!s.isIsolated()&&!s.isInline())return s.selectPrevious(),t.preventDefault(),!0}return!1},Pt),e.registerCommand(cL,t=>{const n=We();if(Qr(n)){const s=n.getNodes();if(s.length>0)return t.preventDefault(),s[0].selectNext(0,0),!0}else if(Me(n)){if((function(r){const i=r.focus;return i.key==="root"&&i.offset===St().getChildrenSize()})(n))return t.preventDefault(),!0;const s=gS(n.focus,!1);if(!t.shiftKey&&nn(s)&&!s.isIsolated()&&!s.isInline())return s.selectNext(),t.preventDefault(),!0}return!1},Pt),e.registerCommand(O2,t=>{const n=We();if(Qr(n)){const s=n.getNodes();if(s.length>0)return t.preventDefault(),UR(s[0])?s[0].selectNext(0,0):s[0].selectPrevious(),!0}if(!Me(n))return!1;if(HR(n,!0)){const s=t.shiftKey;return t.preventDefault(),VR(n,s,!0),!0}return!1},Pt),e.registerCommand(oL,t=>{const n=We();if(Qr(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),UR(r[0])?r[0].selectPrevious():r[0].selectNext(0,0),!0}if(!Me(n))return!1;const s=t.shiftKey;return!!HR(n,!1)&&(t.preventDefault(),VR(n,s,!1),!0)},Pt),e.registerCommand(vE,t=>{if(o8(t.target))return!1;const n=We();if(Me(n)){if((function(s){if(!s.isCollapsed())return!1;const{anchor:r}=s;if(r.offset!==0)return!1;const i=r.getNode();if(Os(i))return!1;const o=Che(i);return o.getIndent()>0&&(o.is(i)||i.is(o.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(oS,void 0);if(s8&&navigator.language==="ko-KR")return!1}else if(!Qr(n))return!1;return t.preventDefault(),e.dispatchCommand(el,!0)},Pt),e.registerCommand(P2,t=>{if(o8(t.target))return!1;const n=We();return!(!Me(n)&&!Qr(n))&&(t.preventDefault(),e.dispatchCommand(el,!1))},Pt),e.registerCommand(rm,t=>{const n=We();if(!Me(n))return!1;if(pb(n),t!==null){if((s8||qhe||Khe)&&Ghe)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Jl,!1)}return e.dispatchCommand(Cu,void 0)},Pt),e.registerCommand(dL,()=>{const t=We();return!!Me(t)&&(e.blur(),!0)},Pt),e.registerCommand(hL,t=>{const[,n]=z0(t);if(n.length>0){const r=n8(t.clientX,t.clientY);if(r!==null){const{offset:i,node:o}=r,c=pr(o);if(c!==null){const u=ca();if($e(c))u.anchor.set(c.getKey(),i,"text"),u.focus.set(c.getKey(),i,"text");else{const p=c.getParentOrThrow().getKey(),g=c.getIndexWithinParent()+1;u.anchor.set(p,g,"element"),u.focus.set(p,g,"element")}const d=JA(u);as(d)}e.dispatchCommand(r8,n)}return t.preventDefault(),!0}const s=We();return!!Me(s)},Pt),e.registerCommand(gL,t=>{const[n]=z0(t),s=We();return!(n&&!Me(s))},Pt),e.registerCommand(AL,t=>{const[n]=z0(t),s=We();if(n&&!Me(s))return!1;const r=n8(t.clientX,t.clientY);if(r!==null){const i=pr(r.node);nn(i)&&t.preventDefault()}return!0},Pt),e.registerCommand(im,()=>(zpe(),!0),Pt),e.registerCommand(_E,t=>(KR(e,Zc(t,ClipboardEvent)?t:null),!0),Pt),e.registerCommand(TE,t=>((async function(n,s){await KR(s,Zc(n,ClipboardEvent)?n:null),s.update(()=>{const r=We();
878Me(r)?r.removeText():Qr(r)&&r.getNodes().forEach(i=>i.remove())})})(t,e),!0),Pt),e.registerCommand(bE,t=>{const[,n,s]=z0(t);return n.length>0&&!s?(e.dispatchCommand(r8,n),!0):$f(t.target)&&H2(t.target)?!1:We()!==null&&((function(r,i){r.preventDefault(),i.update(()=>{const o=We(),c=Zc(r,InputEvent)||Zc(r,KeyboardEvent)?null:r.clipboardData;c!=null&&o!==null&&qR(c,o,i)},{tag:gpe})})(t,e),!0)},Pt),e.registerCommand(uL,t=>{const n=We();return Me(n)&&pb(n),!1},Pt),e.registerCommand(fL,t=>{const n=We();return Me(n)&&pb(n),!1},Pt))}function $l(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function vS(e){let t=1,n=e.getParent();for(;n!=null;){if(Yt(n)){const s=n.getParent();if(Ot(s)){t++,n=s.getParent();continue}$l(40)}return t}return t}function _S(e){let t=e.getParent();Ot(t)||$l(40);let n=t;for(;n!==null;)n=n.getParent(),Ot(n)&&(t=n);return t}function LM(e){let t=[];const n=e.getChildren().filter(Yt);for(let s=0;s<n.length;s++){const r=n[s],i=r.getFirstChild();Ot(i)?t=t.concat(LM(i)):t.push(r)}return t}function $o(e){return Yt(e)&&Ot(e.getFirstChild())}function a8(e){return Jf().append(e)}function MM(e,t){return Yt(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function l8(e){const t=We();if(t!==null){let n=t.getNodes();if(Me(t)){const r=t.getStartEndPoints();r===null&&$l(143);const[i]=r,o=i.getNode(),c=o.getParent();if(Yr(o)){const u=o.getFirstChild();if(u)n=u.selectStart().getNodes();else{const d=hn();o.append(d),n=d.select().getNodes()}}else if(MM(o,n)){const u=lu(e);if(Yr(c)){o.replace(u);const d=Jf();Ne(o)&&(d.setFormat(o.getFormatType()),d.setIndent(o.getIndent())),u.append(d)}else if(Yt(o)){const d=o.getParentOrThrow();Nu(u,d.getChildren()),d.replace(u)}return}}const s=new Set;for(let r=0;r<n.length;r++){const i=n[r];if(Ne(i)&&i.isEmpty()&&!Yt(i)&&!s.has(i.getKey())){c8(i,e);continue}let o=WL(i)?i.getParent():Yt(i)&&i.isEmpty()?i:null;for(;o!=null;){const c=o.getKey();if(Ot(o)){if(!s.has(c)){const u=lu(e);Nu(u,o.getChildren()),o.replace(u),s.add(c)}break}{const u=o.getParent();if(Yr(u)&&!s.has(c)){s.add(c),c8(o,e);break}o=u}}}}}function Nu(e,t){e.splice(e.getChildrenSize(),0,t)}function c8(e,t){if(Ot(e))return e;const n=e.getPreviousSibling(),s=e.getNextSibling(),r=Jf();let i;if(Nu(r,e.getChildren()),Ot(n)&&t===n.getListType())n.append(r),Ot(s)&&t===s.getListType()&&(Nu(n,s.getChildren()),s.remove()),i=n;else if(Ot(s)&&t===s.getListType())s.getFirstChildOrThrow().insertBefore(r),i=s;else{const c=lu(t);c.append(r),e.replace(c),i=c}r.setFormat(e.getFormatType()),r.setIndent(e.getIndent());const o=We();return Me(o)&&(i.getKey()===o.anchor.key&&o.anchor.set(r.getKey(),o.anchor.offset,"element"),i.getKey()===o.focus.key&&o.focus.set(r.getKey(),o.focus.offset,"element")),e.remove(),i}function c_(e,t){const n=e.getLastChild(),s=t.getFirstChild();n&&s&&$o(n)&&$o(s)&&(c_(n.getFirstChild(),s.getFirstChild()),s.remove());const r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function Yhe(){const e=We();if(Me(e)){const t=new Set,n=e.getNodes(),s=e.anchor.getNode();if(MM(s,n))t.add(_S(s));else for(let r=0;r<n.length;r++){const i=n[r];if(WL(i)){const o=xhe(i,Xf);o!=null&&t.add(_S(o))}}for(const r of t){let i=r;const o=LM(r);for(const c of o){const u=hn().setTextStyle(e.style).setTextFormat(e.format);Nu(u,c.getChildren()),i.insertAfter(u),i=u,c.__key===e.anchor.key&&Tu(e.anchor,Gi(vo(u,"next"))),c.__key===e.focus.key&&Tu(e.focus,Gi(vo(u,"next"))),c.remove()}r.remove()}}}function jM(e){const t=e.getListType()!=="check";let n=e.getStart();for(const s of e.getChildren())Yt(s)&&(s.getValue()!==n&&s.setValue(n),t&&s.getLatest().__checked!=null&&s.setChecked(void 0),Ot(s.getFirstChild())||n++)}function Xhe(e){const t=new Set;if($o(e)||t.has(e.getKey()))return;const n=e.getParent(),s=e.getNextSibling(),r=e.getPreviousSibling();if($o(s)&&$o(r)){const i=r.getFirstChild();if(Ot(i)){i.append(e);const o=s.getFirstChild();Ot(o)&&(Nu(i,o.getChildren()),s.remove(),t.add(s.getKey()))}}else if($o(s)){const i=s.getFirstChild();if(Ot(i)){const o=i.getFirstChild();o!==null&&o.insertBefore(e)}}else if($o(r)){const i=r.getFirstChild();Ot(i)&&i.append(e)}else if(Ot(n)){const i=di(e),o=di(n);i.append(o),o.append(e),r?r.insertAfter(i):s?s.insertBefore(i):n.append(i)}}function Jhe(e){if($o(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(Ot(n?n.getParent():void 0)&&Yt(n)&&Ot(t)){const s=t?t.getFirstChild():void 0,r=t?t.getLastChild():void 0;if(e.is(s))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(r))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=di(e),o=di(t);
878i.append(o),e.getPreviousSiblings().forEach(d=>o.append(d));const c=di(e),u=di(t);c.append(u),Nu(u,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(c),n.replace(e)}}}function Zhe(e=!1){const t=We();if(!Me(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let s=null;if(Yt(n)&&n.getChildrenSize()===0)s=n;else if($e(n)){const d=n.getParent();Yt(d)&&d.getChildren().every(p=>$e(p)&&p.getTextContent().trim()==="")&&(s=d)}if(s===null)return!1;const r=_S(s),i=s.getParent();Ot(i)||$l(40);const o=i.getParent();let c;if(Yr(o))c=hn(),r.insertAfter(c);else{if(!Yt(o))return!1;c=di(o),o.insertAfter(c)}c.setTextStyle(t.style).setTextFormat(t.format).select();const u=s.getNextSiblings();if(u.length>0){const d=e?(function(g,A){return g.getStart()+A.getIndexWithinParent()})(i,s):1,p=di(i).setStart(d);if(Yt(c)){const g=di(c);g.append(p),c.insertAfter(g)}else c.insertAfter(p);p.append(...u)}return(function(d){let p=d;for(;p.getNextSibling()==null&&p.getPreviousSibling()==null;){const g=p.getParent();if(g==null||!Yt(g)&&!Ot(g))break;p=g}p.remove()})(s),!0}class Xf extends yi{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();Ot(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:yi,importDOM:{li:()=>({conversion:eme,priority:0})}})}constructor(t=1,n=void 0,s){super(s),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,s){(function(o,c,u){const d=c.getParent();!Ot(d)||d.getListType()!=="check"||Ot(c.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),u&&c.__checked===u.__checked||o.setAttribute("aria-checked",c.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(o,c,u){const d=[],p=[],g=c.list,A=g?g.listitem:void 0;let E;if(g&&g.nested&&(E=g.nested.listitem),A!==void 0&&d.push(...lc(A)),g){const x=u.getParent(),y=Ot(x)&&x.getListType()==="check",I=u.getChecked();y&&!I||p.push(g.listitemUnchecked),y&&I||p.push(g.listitemChecked),y&&d.push(I?g.listitemChecked:g.listitemUnchecked)}if(E!==void 0){const x=lc(E);u.getChildren().some(y=>Ot(y))?d.push(...x):p.push(...x)}p.length>0&&r_(o,...p),d.length>0&&tl(o,...d)})(n,s.theme,this);const r=t?t.__style:"",i=this.__style;r!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(o,c,u){const d=lm(c.__textStyle);for(const p in d)o.style.setProperty(`--listitem-marker-${p}`,d[p]);if(u)for(const p in lm(u.__textStyle))p in d||o.style.removeProperty(`--listitem-marker-${p}`)})(n,this,t)}updateDOM(t,n,s){const r=n;return this.updateListItemDOM(t,r,s),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),s=this.getFormatType();s&&(n.style.textAlign=s);const r=this.getDirection();return r&&(n.dir=r),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const s=t[n];if(Ne(s)&&this.canMergeWith(s)){const r=s.getChildren();this.append(...r),s.remove()}else super.append(s)}return this}replace(t,n){if(Yt(t))return super.replace(t);this.setIndent(0);const s=this.getParentOrThrow();if(!Ot(s))return t;if(s.__first===this.getKey())s.insertBefore(t);else if(s.__last===this.getKey())s.insertAfter(t);else{const r=di(s);let i=this.getNextSibling();for(;i;){const o=i;i=i.getNextSibling(),r.append(o)}s.insertAfter(t),t.insertAfter(r)}
878return n&&(Ne(t)||$l(139),this.getChildren().forEach(r=>{t.append(r)})),this.remove(),s.getChildrenSize()===0&&s.remove(),t}insertAfter(t,n=!0){const s=this.getParentOrThrow();if(Ot(s)||$l(39),Yt(t))return super.insertAfter(t,n);const r=this.getNextSiblings();if(s.insertAfter(t,n),r.length!==0){const i=di(s);r.forEach(o=>i.append(o)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),s=this.getNextSibling();super.remove(t),n&&s&&$o(n)&&$o(s)&&(c_(n.getFirstChild(),s.getFirstChild()),s.remove())}resetOnCopyNodeFrom(t){super.resetOnCopyNodeFrom(t),t.getChecked()&&this.setChecked(!1)}insertNewAfter(t,n=!0){const s=di(this);return this.insertAfter(s,n),s}collapseAtStart(t){const n=hn();this.getChildren().forEach(o=>n.append(o));const s=this.getParentOrThrow(),r=s.getParentOrThrow(),i=Yt(r);if(s.getChildrenSize()===1)if(i)s.remove(),r.select();else{s.insertBefore(n),s.remove();const o=t.anchor,c=t.focus,u=n.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(u,o.offset,"element"),c.type==="element"&&c.getNode().is(this)&&c.set(u,c.offset,"element")}else s.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const s=this.getParent();return Ot(s)&&(n=s.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),s=0;for(;Yt(n);)n=n.getParentOrThrow().getParentOrThrow(),s++;return s}setIndent(t){typeof t!="number"&&$l(117),(t=Math.floor(t))>=0||$l(199);let n=this.getIndent();for(;n!==t;)n<t?(Xhe(this),n++):(Jhe(this),n--);return this}canInsertAfter(t){return Yt(t)}canReplaceWith(t){return Yt(t)}canMergeWith(t){return Yt(t)||Kf(t)}extractWithChild(t,n){if(!Me(n))return!1;const s=n.anchor.getNode(),r=n.focus.getNode();return this.isParentOf(s)&&this.isParentOf(r)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return lu("bullet")}canMergeWhenEmpty(){return!0}}function eme(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return u8(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return u8(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Jf(t==="true"||t!=="false"&&void 0)}}function u8(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Jf(e.hasAttribute("checked"))}}function Jf(e){return ya(new Xf(void 0,e))}function Yt(e){return e instanceof Xf}class Wm extends yi{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const s=n.getNextSibling();Ot(s)&&n.getListType()===s.getListType()&&c_(n,s)})(t),jM(t)},extends:yi,importDOM:{ol:()=>({conversion:f8,priority:0}),ul:()=>({conversion:f8,priority:0})}})}constructor(t="number",n=1,s){super(s);const r=nme[t]||t;this.__listType=r,this.__tag=r==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const s=this.__tag,r=document.createElement(s);return this.__start!==1&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,d8(r,t.theme,this),r}updateDOM(t,n,s){return t.__tag!==this.__tag||t.__listType!==this.__listType||(d8(n,s.theme,this),t.__start!==this.__start&&n.setAttribute("start",String(this.__start)),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return rr(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,s){const r=s.find(Yt)??this.getChildren().find(Yt),i=r?()=>di(r):Jf;let o=s;for(let c=0;c<s.length;c++){const u=s[c];Yt(u)||(o===s&&(o=[...s]),o[c]=i().append(!Ne(u)||Ot(u)||u.isInline()?u:Rs(u.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return Yt(t)}}function d8(e,t,n){const s=[],r=[],i=t.list;if(i!==void 0){const o=i[`${n.__tag}Depth`]||[],c=vS(n)-1,u=c%o.length,d=o[u],p=i[n.__tag];let g;const A=i.nested,E=i.checklist;if(A!==void 0&&A.list&&(g=A.list),p!==void 0&&s.push(p),E!==void 0&&n.__listType==="check"&&s.push(E),d!==void 0){s.push(...lc(d)
878);for(let x=0;x<o.length;x++)x!==u&&r.push(n.__tag+x)}if(g!==void 0){const x=lc(g);c>1?s.push(...x):r.push(...x)}}r.length>0&&r_(e,...r),s.length>0&&tl(e,...s)}function tme(e){const t=[];for(let n=0;n<e.length;n++){const s=e[n];if(Yt(s)){t.push(s);const r=s.getChildren();r.length>1&&r.forEach(i=>{Ot(i)&&t.push(a8(i))})}else t.push(a8(s))}return t}function f8(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=lu("number",e.start):t==="ul"&&(n=(function(s){if(s.getAttribute("__lexicallisttype")==="check"||s.classList.contains("contains-task-list")||s.getAttribute("data-is-checklist")==="1")return!0;for(const r of s.childNodes)if(rr(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(e)?lu("check"):lu("bullet")),{after:tme,node:n}}const nme={ol:"number",ul:"bullet"};function lu(e="number",t=1){return ya(new Wm(e,t))}function Ot(e){return e instanceof Wm}const sme=mt("UPDATE_LIST_START_COMMAND"),BM=mt("INSERT_UNORDERED_LIST_COMMAND"),FM=mt("INSERT_ORDERED_LIST_COMMAND"),TS=mt("REMOVE_LIST_COMMAND");function p8(e,t){return Nr(e.registerCommand(FM,()=>(l8("number"),!0),Ya),e.registerCommand(sme,n=>{const{listNodeKey:s,newStart:r}=n,i=Xt(s);return!!Ot(i)&&(i.getListType()==="number"&&(i.setStart(r),jM(i)),!0)},Ya),e.registerCommand(BM,()=>(l8("bullet"),!0),Ya),e.registerCommand(TS,()=>(Yhe(),!0),Ya),e.registerCommand(Cu,()=>Zhe(!!(t&&t.restoreNumbering)),Ya),e.registerNodeTransform(Xf,n=>{const s=n.getFirstChild();if(s){if($e(s)){const r=s.getStyle(),i=s.getFormat();n.getTextStyle()!==r&&n.setTextStyle(r),n.getTextFormat()!==i&&n.setTextFormat(i)}}else{const r=We();Me(r)&&(r.style!==n.getTextStyle()||r.format!==n.getTextFormat())&&r.isCollapsed()&&n.is(r.anchor.getNode())&&n.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(So,n=>{const s=n.getParent();if(Yt(s)&&n.is(s.getFirstChild())){const r=n.getStyle(),i=n.getFormat();r===s.getTextStyle()&&i===s.getTextFormat()||s.setTextStyle(r).setTextFormat(i)}}))}function rme(e){const t=n=>{const s=n.getParent();if(Ot(n.getFirstChild())||!Ot(s))return;const r=Vs(n,i=>Yt(i)&&Ot(i.getParent())&&Yt(i.getPreviousSibling()));if(r===null&&n.getIndent()>0)n.setIndent(0);else if(Yt(r)){const i=r.getPreviousSibling();if(Yt(i)){const o=(function(u){let d=u,p=d.getFirstChild();for(;Ot(p);){const g=p.getLastChild();if(!Yt(g))break;d=g,p=d.getFirstChild()}return d})(i),c=o.getParent();if(Ot(c)){const u=vS(c);u+1<vS(s)&&n.setIndent(u)}}}};return e.registerNodeTransform(Wm,n=>{const s=[n];for(;s.length>0;){const r=s.shift();if(Ot(r)){for(const i of r.getChildren())if(Yt(i)){t(i);const o=i.getFirstChild();Ot(o)&&s.push(o)}}}})}class wu extends RE{__src;__imageId;__width;__height;__altText;static getType(){return"image"}static clone(t){return new wu(t.__src,t.__imageId,t.__width,t.__height,t.__altText,t.__key)}constructor(t,n,s,r,i="",o){super(o),this.__src=t,this.__imageId=n,this.__width=s,this.__height=r,this.__altText=i}createDOM(){const t=document.createElement("span");return t.style.display="none",t.setAttribute("data-lexical-image-id",this.__imageId),t}updateDOM(){return!1}decorate(){return null}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__altText),t.setAttribute("width",String(this.__width)),t.setAttribute("height",String(this.__height)),t.setAttribute("data-lexical-image-id",this.__imageId),t.style.maxWidth="100%",t.style.height="auto",{element:t}}static importJSON(t){return new wu(t.src,t.imageId,t.width,t.height,t.altText??"")}exportJSON(){return{type:"image",version:1,src:this.__src,imageId:this.__imageId,width:this.__width,height:this.__height,altText:this.__altText}}isInline(){return!1}isIsolated(){return!0}getSrc(){return this.getLatest().__src}getImageId(){return this.getLatest().__imageId}getWidth(){return this.getLatest().__width}getHeight(){return this.getLatest().__height}getAltText(){return this.getLatest().__altText}}const ime=({src:e,imageId:t,width:n,height:s,altText:r=""})=>new wu(e,t,n,s,r),Ru=e=>e instanceof wu;function ome(e){const t=e.style.gridTemplateColumns;return t?{node:u_(t)}:null}class Zf extends yi{__templateColumns;constructor(t,n){super(n),this.__templateColumns=t}static getType(){return"layout-container"}static clone(t){return new Zf(t.__templateColumns,t.__key)}createDOM(t){const n=document.createElement("div");return n.style.gridTemplateColumns=this.__templateColumns,typeof t.theme.layoutContainer=="string"&&tl(n,t.theme.layoutContainer),n}exportDOM(){const t=document.createElement("div");return t.style.display="grid",t.style.gridTemplateColumns=this.__templateColumns,t.style.marginBottom="20px",t.setAttribute("data-lexical-layout-container","true"),{element:t}}updateDOM(t,n){return t.__templateColumns!==this.__templateColumns&&(n.style.gridTemplateColumns=this.__templateColumns),!1}static importDOM(){return{div:t=>t.hasAttribute("data-lexical-layout-container")?{conversion:ome,priority:2}:null}}static importJSON(t){return u_().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTemplateColumns(t.templateColumns)}isShadowRoot(){return!0}canBeEmpty(){return!1}exportJSON(){return{...super.exportJSON(),templateColumns:this.__templateColumns}}getTemplateColumns(){return this.getLatest().__templateColumns}setTemplateColumns(t){const n=this.getWritable();return n.__templateColumns=t,n}}function u_(e=""){return new Zf(e)}function Us(e){return e instanceof Zf}class cl extends yi{__isEditable;static getType(){return"layout-item"}static clone(t){return new cl(t.__isEditable,t.__key)}constructor(t=!0,n){super(n),this.__isEditable=t}createDOM(t){const n=document.createElement("div");return typeof t.theme.layoutItem=="string"&&tl(n,t.theme.layoutItem),n.contentEditable=this.__isEditable?"true":"false",n.dataset.readonly=this.__isEditable?"false":"true",n}updateDOM(t,n){return t.__isEditable!==this.__isEditable&&(n.contentEditable=this.__isEditable?"true":"false",n.dataset.readonly=this.__isEditable?"false":"true"),!1}exportDOM(){const t=document.createElement("div");return t.style.minWidth="0",t.style.maxWidth="100%",t.setAttribute("data-readonly",this.__isEditable?"false":"true"),{element:t}}static importJSON(t){return new cl(t.isEditable??!0)}exportJSON(){return{...super.exportJSON(),type:"layout-item",version:1,isEditable:this.__isEditable}}canBeEmpty(){return!1}getIsEditable(){return this.getLatest().__isEditable}}const p1=(e=!0)=>
878new cl(e),Fn=e=>e instanceof cl,UM=[];class Km extends PE{__text;constructor(t=UM,n="",s){super(t,s),this.__text=n}static getType(){return"comment-mark"}static clone(t){return new Km(t.__ids,t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text}static importJSON(t){return h1().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIDs(t.ids).setCommentText(t.text??"")}exportJSON(){return{...super.exportJSON(),type:"comment-mark",version:1,ids:this.getIDs(),text:this.getCommentText()}}createDOM(t){const n=super.createDOM(t);return tl(n,"editor-comment-mark"),n}getCommentText(){return this.getLatest().__text}setCommentText(t){const n=this.getWritable();return n.__text=t,n}insertNewAfter(t,n=!0){const s=h1(this.__ids,this.__text);return this.insertAfter(s,n),s}}function h1(e=UM,t=""){return ya(new Km(e,t))}function qu(e){return e instanceof Km}const zM=l.createContext(null);function ame(e,t){return{getTheme:function(){return t??null}}}function rn(){const e=l.useContext(zM);return e==null&&(function(t,...n){const s=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of n)r.append("v",i);throw s.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}const QM=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M16.6641 11.6668L16.6641 15.0002C16.6641 15.2212 16.5763 15.4331 16.42 15.5894C16.2637 15.7457 16.0517 15.8335 15.8307 15.8335L4.16406 15.8335C3.94305 15.8335 3.73109 15.7457 3.57481 15.5894C3.41853 15.4331 3.33073 15.2212 3.33073 15.0002L3.33073 11.6668C3.33073 11.4458 3.41853 11.2339 3.57481 11.0776C3.73109 10.9213 3.94305 10.8335 4.16406 10.8335L15.8307 10.8335C16.0517 10.8335 16.2637 10.9213 16.42 11.0776C16.5763 11.2339 16.6641 11.4458 16.6641 11.6668V11.6668Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 4.1665L10 7.49984",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.6641 5.8335L8.33073 5.8335",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),h8="1fr 1fr 1fr 1fr";function lme({cell:e,index:t}){if(t===0){e.style.gridColumn="span 3";return}if(t===1){e.style.textAlign="right";return}const n=(t-2)%3;if(n===1){e.style.borderBottom="1px solid #e4e4e7",e.style.minHeight="20px";return}n===2&&(e.style.gridColumn="span 2",e.style.textAlign="right")}function cme(e){return e instanceof HTMLElement&&Array.from(e.children).forEach((t,n)=>{t instanceof HTMLElement&&lme({cell:t,index:n})}),e}class $m extends Zf{__isFirst;constructor(t=!1,n){super(h8,n),this.__isFirst=t}static getType(){return"signatory-container"}static clone(t){return new $m(t.__isFirst,t.__key)}static importJSON(t){return HM({isFirst:!1}).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsFirst(t.isFirst)}createDOM(t){const n=super.createDOM(t);return n.setAttribute("data-signatory-block","true"),this.applyFirstAttribute(n),n}exportDOM(){const t=document.createElement("div");return t.style.display="grid",t.style.gridTemplateColumns=h8,t.style.gap="12px",t.style.alignItems="start",t.setAttribute("data-lexical-layout-container","true"),t.setAttribute("data-signatory-block","true"),{element:t,after:cme}}updateDOM(t,n){return t.__isFirst!==this.__isFirst&&this.applyFirstAttribute(n),!1}applyFirstAttribute(t){if(this.__isFirst){t.setAttribute("data-signatory-first","true");return}t.removeAttribute("data-signatory-first")}exportJSON(){return{...super.exportJSON(),isFirst:this.__isFirst}}getIsFirst(){return this.getLatest().__isFirst}setIsFirst(t){const n=this.getWritable();return n.__isFirst=t,n}}function HM({isFirst:e}){return new $m(e)}function Ps(e){return e instanceof $m}const ume="Защитник-адвокат";function VM(){for(const e of St().getChildren())if(Ps(e))return!0;return!1}function dme(){for(const e of St().getChildren())if(Ja(e))return e;return null}function fme({isFirst:e}){return e?Kt({dateString:new Date().toISOString(),isWithTime:!1,isS
878hortMonth:!1}):""}function pme(){const e=Se.getState().user;return xo({lastName:e?.lastName??void 0,firstName:e?.firstName??void 0,middleName:e?.middleName??void 0,isShort:!0})}function Oh({isEditable:e,text:t}){const n=p1(e),s=hn();return t.length>0&&s.append(Rs(t)),n.append(s),n}function hme({role:e,fullName:t}){return[Oh({isEditable:!0,text:e}),Oh({isEditable:!0,text:""}),Oh({isEditable:!0,text:t})]}function mme({dateText:e,fullName:t}){return[Oh({isEditable:!1,text:""}),Oh({isEditable:!0,text:e}),...hme({role:ume,fullName:t})]}function GM({isWithDateCaret:e}){const t=!VM(),n=HM({isFirst:t}),s=fme({isFirst:t}),r=pme();mme({dateText:s,fullName:r}).forEach(c=>n.append(c));const i=dme();if(i!==null&&i.insertBefore(n),i===null&&St().append(n),!e)return;const o=n.getChildAtIndex(1);Fn(o)&&o.selectStart()}const gme=()=>{const[e]=rn(),t=l.useCallback(s=>{s.preventDefault()},[]),n=l.useCallback(()=>{e.update(()=>{GM({isWithDateCaret:!0})})},[e]);return a.jsxs("button",{type:"button",contentEditable:!1,"data-signatory-add-button":"true",className:"group mt-1 inline-flex h-8 cursor-pointer items-center gap-2 rounded-md px-1.5 hover:bg-zinc-100",onMouseDown:t,onClick:n,children:[a.jsx(QM,{className:"size-5 text-zinc-600 group-hover:text-zinc-950"}),a.jsx("span",{className:"text-[14px] font-medium text-zinc-500",children:h.molecules.editor.SIGNATORY_BLOCK})]})};class Ym extends RE{static getType(){return"signatory-add-button"}static clone(t){return new Ym(t.__key)}createDOM(){const t=document.createElement("div");return t.setAttribute("data-signatory-add-button-host","true"),t}updateDOM(){return!1}decorate(){return l.createElement(gme)}exportDOM(){return{element:null}}static importJSON(){return qM()}exportJSON(){return{type:"signatory-add-button",version:1}}isInline(){return!1}isIsolated(){return!0}}function qM(){return new Ym}function Ja(e){return e instanceof Ym}const wf={arial:"Arial, Helvetica, sans-serif",times:'"Times New Roman", Times, serif'},Ame=e=>{const t=e.trim();if(!t)return null;if(t===wf.arial)return"arial";if(t===wf.times)return"times";const n=t.split(",")[0]?.replace(/['"]/g,"").trim().toLowerCase();return n==="arial"?"arial":n==="times new roman"?"times":null},Eme=({cssFontFamily:e})=>{const t=e.trim();if(t.length===0)return null;const n=t.split(",")[0];if(n===void 0)return null;const s=n.replace(/['"]/g,"").trim().toLowerCase();return s.length===0?null:s==="times new roman"||s==="times"?"times":"arial"},xme=({existingStyle:e,fontDeclaration:t})=>{const n=e.trim();return n.length===0?t:`${n.replace(/;$/,"").trim()}; ${t}`},Cme=({textNode:e,sourceElement:t})=>{const n=Eme({cssFontFamily:t.style.fontFamily});if(n===null)return;const s=e.getStyle();if(s.toLowerCase().includes("font-family"))return;const r=`font-family: ${wf[n]}`,i=xme({existingStyle:s,fontDeclaration:r});e.setStyle(i)};class df extends So{static getType(){return"extended-text"}static clone(t){return new df(t.__text,t.__key)}static importDOM(){const t=So.importDOM();if(t===null)return null;const n={};for(const[s,r]of Object.entries(t))n[s]=i=>{const o=r(i);if(o===null)return null;const c=o.conversion;return{...o,conversion:u=>{const d=c(u);if(d===null)return null;const p=d.forChild,g=(A,E)=>{const y=p===void 0?A:p(A,E);return $e(y)&&Cme({textNode:y,sourceElement:u}),y};return{after:d.after,node:d.node,forChild:g}}}};return n}static importJSON(t){return yme().updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),type:"extended-text"}}}function yme(e=""){return ya(new df(e))}const WM=()=>[qm,Wm,Xf,PE,Km,wu,Zf,cl,$m,Ym,df,{replace:So,with:e=>new df(e.__text),withKlass:df}],KM={ltr:"ltr",rtl:"rtl",layoutContainer:"editor-layout-container",layoutItem:"editor-layout-item",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listitem"},image:"editor-image",link:"editor-link",text:{bold:"editor-text-bold",italic:"editor-text-italic",overflowed:"editor-text-overflowed",hashtag:"editor-text-hashtag",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",underlineStrikethrough:"editor-text-underlineStrikethrough",code:"editor-text-code",highlight:"editor-text-highlight"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",o
878perator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},$M={root:{children:[{type:"paragraph",format:"",indent:0,version:1,direction:null,textStyle:"",textFormat:0,children:[{type:"text",mode:"normal",text:"",style:"",detail:0,format:0,version:1}]}],direction:null,format:"",indent:0,type:"root",version:1}},bme=["signatory-add-button"];function Ime(e){const t=o=>{const c=[];for(const u of o){if(!u||typeof u!="object"||Array.isArray(u))continue;const d=u;if(typeof d.type=="string"&&bme.includes(d.type))continue;const p={...d};Array.isArray(d.children)&&(p.children=t(d.children)),d.type==="paragraph"&&"caption"in p&&delete p.caption,c.push(p)}return c},n=e.root,s=Array.isArray(n.children)?t(n.children):[];return{root:{...n,type:"root",children:s.length>0?s:[...$M.root.children]}}}const Ga=$M;function m8(e){return e.length>0&&e.charCodeAt(0)===65279?e.slice(1):e}function ff(e){if(e==null)return Ga;if(typeof e=="string"){const o=m8(e).trim();if(!o)return Ga;try{return ff(JSON.parse(o))}catch{return Ga}}if(typeof e!="object"||Array.isArray(e))return Ga;const t=e;if(t.editorState!=null&&typeof t.editorState=="object")return ff(t.editorState);if(t.state!=null&&typeof t.state=="object")return ff(t.state);if(!("root"in t))return Ga;let n=t.root;if(typeof n=="string"){const o=m8(n).trim();try{n=JSON.parse(o)}catch{return Ga}}if(n==null||typeof n!="object"||Array.isArray(n))return Ga;const s=n;
878if(s.type!=="root")return Ga;const r=Array.isArray(s.children)?s.children:[],i={root:{...s,type:"root",version:typeof s.version=="number"?s.version:1,children:r,direction:s.direction??null,format:typeof s.format=="string"?s.format:"",indent:typeof s.indent=="number"?s.indent:0}};return Ime(i)}function Yc(e){return JSON.stringify(ff(e))}function Sme(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const vme=`
879  @page { margin: 12mm; }
880  @media print {
881    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
882  }
883  body {
884    margin: 0;
885    padding: 16px;
886    font-family: ${wf.arial};
887    font-size: 15px;
888    line-height: 20px;
889    color: #000;
890    background: #fff;
891  }
892  .editor-text-bold { font-weight: 700; }
893  .editor-text-underline {
894    text-decoration: underline;
895    text-underline-offset: 2px;
896  }
897  .editor-text-italic { font-style: italic; }
898  .editor-text-strikethrough { text-decoration: line-through; }
899  .editor-text-underlineStrikethrough {
900    text-decoration: underline line-through;
901    text-underline-offset: 2px;
902  }
903  .editor-paragraph { margin: 0 0 8px; position: relative; font-size: 14px; line-height: 20px; font-weight: 400; }
904  .editor-paragraph:last-child { margin-bottom: 0; }
905  .editor-heading-h1 { margin: 0 0 12px; padding: 0; font-size: 21px; line-height: 24px; font-weight: 700; }
906  .editor-heading-h2 { margin: 10px 0 12px; padding: 0; font-size: 14px; line-height: 16px; font-weight: 700; }
907  .editor-heading-h3 { margin: 8px 0 10px; padding: 0; }
908  .editor-heading-h4 { margin: 8px 0 8px; padding: 0; }
909  .editor-heading-h5 { margin: 6px 0 8px; padding: 0; }
910  .editor-list-ol, .editor-list-ul {
911    padding: 0;
912    margin: 0 0 0 16px;
913    list-style-position: outside;
914  }
915  .editor-list-ul { list-style-type: disc; }
916  .editor-list-ol { list-style-type: decimal; }
917  .editor-listitem { margin: 8px 32px; font-size: 14px; line-height: 20px; font-weight: 400; }
918  .editor-nested-listitem { list-style-type: none; }
919  .editor-layout-container { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
920  .editor-layout-container[data-columns="3"] { grid-template-columns: 1fr 1fr 1fr; }
921  .editor-layout-item { padding: 0; min-width: 0; max-width: 100%; }
922  .editor-layout-item[data-readonly="true"] {
923    background: transparent;
924    pointer-events: none;
925    user-select: none;
926  }
927`;function YM(e,t){return`<!DOCTYPE html>
928<html lang="ru">
929<head>
930  <meta charset="utf-8" />
931  <title>${Sme(t||"Документ")}</title>
932  <style>${vme}</style>
933</head>
934<body>
935  <div class="print-root">${e}</div>
936</body>
937</html>`}function _me(e){const t=ff(e),n=JSON.stringify(t),s=lhe({namespace:"DocumentPrint",theme:KM,nodes:[...WM()],onError(r){throw r}});try{s.setEditorState(s.parseEditorState(t))}catch{try{s.setEditorState(s.parseEditorState(n))}catch{s.setEditorState(s.parseEditorState(Ga))}}return s.getEditorState().read(()=>i_(s,null))}async function Tme(e,t){const n=e.getEditorState().read(()=>i_(e,null));await XM(YM(n,t))}async function Nme(e){const t=_me(e.lexicalJson);await XM(YM(t,e.title))}const wme=500;function XM(e){return new Promise((t,n)=>{const s=document.createElement("iframe");s.setAttribute("style",["position:fixed","left:-9999px","top:0","width:1200px","height:2000px","border:0","opacity:0","pointer-events:none"].join(";")),s.setAttribute("title","print");let r=null,i=!1;const o=()=>{i||(i=!0,r&&(URL.revokeObjectURL(r),r=null),s.remove(),t())},c=d=>{i||(i=!0,r&&(URL.revokeObjectURL(r),r=null),s.remove(),n(d instanceof Error?d:new Error(String(d))))},u=()=>{const d=s.contentWindow;if(!d){c(new Error("print: no contentWindow"));return}d.addEventListener("afterprint",o,{once:!0}),window.setTimeout(o,12e4);try{d.focus(),d.print()}catch(p){c(p)}};if(s.onload=()=>{if(!s.contentWindow){c(new Error("print: no contentWindow"));return}window.setTimeout(()=>{requestAnimationFrame(()=>{requestAnimationFrame(u)})},wme)},s.onerror=()=>{c(new Error("print: iframe load error"))},document.body.appendChild(s),e.length<2e6)s.srcdoc=e;else{const d=new Blob([e],{type:"text/html;charset=utf-8"});r=URL.createObjectURL(d),s.src=r}})}const JM=({clientId:e,documentId:t,getEditorPrint:n})=>{const{mutate:s,isPending:r}=tt({mutationFn:async({documentId:o})=>{const c=n?.current;if(c){await c();return}if(!e)throw new Error("Missing client id");const u=await Bm({clientId:e,documentId:o});await Nme({lexicalJson:u.lexicalJson,title:u.name??"Документ"})},onError:()=>{ve({type:"failed",message:h.client.quotes.EXPORT_FAILED,key:"DOCUMENT_LEXICAL_PRINT_FAILED"})},onSettled:(o,c,u)=>{Ze(`DOCUMENT_LEXICAL_PRINT_PENDING:${u.documentId}`)}});return{handleLexicalPrintClick:l.useCallback(o=>
937{const c=typeof o=="string"&&o.length>0?o:t;c&&(!n?.current&&!e||(ve({type:"pending",message:h.client.cases.messages.FORMING_DOCUMENT,key:`DOCUMENT_LEXICAL_PRINT_PENDING:${c}`,duration:0}),s({documentId:c})))},[e,t,n,s]),isLexicalPrintPending:r}},Rme=e=>{const{id:t}=st(),{clientData:n}=zt(),s=n?.id??t??"",r=bt();return tt({mutationFn:()=>{if(!s)throw new Error("Missing client id");return bfe({clientId:s,documentId:e})},onSuccess:i=>{r.setQueryData(["clientDocuments",s],o=>o&&o.filter(c=>c.id!==i.id))},onError:()=>{ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})}})},Dme=({documentName:e,handleConfirmNo:t,handleConfirmYes:n})=>{const s=h.client.documents.confirmDelete,r=s.DESCRIPTION.replace("{name}",e);return a.jsxs("div",{className:"fixed inset-0 z-100 w-screen h-screen flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-0 bg-white/10 backdrop-blur-[20px]",onClick:t,"aria-hidden":!0}),a.jsxs("div",{className:"relative z-10 flex flex-col gap-4 p-6 bg-white rounded-2xl max-w-[424px] w-full shadow-[0px_0.27px_2.06px_0px_rgba(0,0,0,0.0323),0px_0.89px_6.92px_0px_rgba(0,0,0,0.0477),0px_4px_31px_0px_rgba(0,0,0,0.08)]",children:[a.jsxs("h4",{className:"roboto-flex-100-600-1 text-[24px] leading-[20px] text-zinc-950",children:[s.TITLE,"?"]}),a.jsx("div",{className:"roboto-flex-100-400-1 leading-[20px] text-zinc-950",children:r}),a.jsxs("div",{className:"flex gap-2 justify-end mt-4",children:[a.jsx(ut,{className:"w-[96px]",variant:"h14inverse",onClick:t,children:s.CANCEL}),a.jsx(ut,{className:"w-[96px]",variant:"h14",onClick:n,children:s.CONFIRM})]})]})]})},kme=({documentId:e,title:t,updatedAt:n,version:s})=>{const{id:r}=st(),i=l.useRef(null),[o,c]=l.useState(!1),[u,d]=l.useState(!1),p=l.useCallback(L=>{d(L)},[]),{mutate:g,isPending:A}=Rme(e),{handleExportDocumentClick:E,isExportDocumentPending:x}=FP({clientId:r}),{handleLexicalPrintClick:y,isLexicalPrintPending:I}=JM({clientId:r}),v=l.useCallback(()=>{c(!0)},[]),S=l.useCallback(()=>{c(!1)},[]),b=l.useCallback(()=>{c(!1),g()},[g]),w=l.useMemo(()=>r?`/clients/${r}/documents/${e}`:"",[r,e]),_=l.useMemo(()=>{try{const L=hJ(n);return fJ(L)?h.client.documents.DATE_TODAY:pJ(L)?h.client.documents.DATE_YESTERDAY:is(L,"d MMMM yyyy",{locale:jf})}catch{return""}},[n]),N=l.useCallback(()=>{i.current?.handleRename()},[]),R=l.useCallback(()=>{E(e)},[e,E]),D=l.useCallback(()=>{y(e)},[e,y]),k=l.useMemo(()=>{const L=h.client.documents.documentMenu;return[{title:L.DOWNLOAD,onClick:R,isCloseOnClick:!0,icon:a.jsx($A,{className:"size-5"})},{title:L.PRINT,onClick:D,isCloseOnClick:!0,icon:a.jsx($I,{className:"size-5"})},{isSeparator:!0},{title:L.OPEN,to:w,isDisabled:!w,isCloseOnClick:!0,icon:a.jsx(Afe,{className:"size-5"})},{title:L.RENAME,onClick:N,isCloseOnClick:!0,icon:a.jsx(mfe,{className:"size-5"})},{title:L.OPEN_IN_NEW_TAB,to:w,target:"_blank",isDisabled:!w,isCloseOnClick:!0,icon:a.jsx(gfe,{className:"size-5"})},{isSeparator:!0},{title:L.DELETE,onClick:v,isCloseOnClick:!0,icon:a.jsx(KA,{className:"size-5"})}]},[N,v,R,D,w]);return a.jsxs(a.Fragment,{children:[o&&a.jsx(Dme,{documentName:t,handleConfirmNo:S,handleConfirmYes:b}),a.jsxs("div",{className:Y("relative -ml-4 -mr-4 px-4 cursor-pointer hover:bg-zinc-50 group",(A||x||I)&&"opacity-50 pointer-events-none"),children:[!!(w&&!u)&&a.jsx(Hs,{to:w,"aria-label":t,className:"absolute inset-0"}),a.jsxs("div",{className:"py-4 border-b border-zinc-200 group-last:border-b-0 group-hover:border-zinc-50 flex items-center gap-[112px]",children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx(BP,{ref:i,documentId:e,name:t,version:s,onEditingChange:p})}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-500 w-[212px]",children:_}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx("button",{type:"button",className:"cursor-pointer px-px",onClick:L=>{L.stopPropagation(),R()},children:a.jsx("span",{className:"size-8 flex items-center justify-center hover:bg-zinc-100 rounded-md",children:a.jsx($A,{className:"size-5 text-zinc-400"})})}),a.jsx("button",{type:"button",className:"cursor-pointer px-px",onClick:L=>{L.stopPropagation(),D()},children:a.jsx("span",{className:"size-8 flex items-center justify-center hover:bg-zinc-100 rounded-md",children:a.jsx($I,{className:"size-5 text-zinc-400"})})}),a.jsx(Ss,{isDocumentRowKebab:!0,isRightColumn:!0,items:k,verticalOffset:9,width:79})]})]})]})]})},Ome=e=>l.createElement("svg",{width:108,height:108,viewBox:"0 0 108 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.3819 12.8373C24.3163 17.7547 19.5174 25.403 16.3838 30.5945C14.8551 33.1272 13.31 35.6299 12.1403 38.4024C11.7584 39.3075 11.3255 40.1805 10.9334 41.0793C10.7838 41.4221 10.2162 42.0638 10.5441 42.139C10.8371 42.2061 10.992 41.6857 11.2156 41.4586C12.8359 39.8127 14.5 38.2236 16.1502 36.6177C20.943 31.9536 25.7483 27.3149 30.6716 22.8313C35.2653 18.648 39.7597 14.12 44.5896 10.2942C46.204 9.01538 47.7906 7.70057 49.4463 6.49064C51.4474 5.02822 49.0232 7.25414 48.6287 7.68412C38.5506 18.6676 30.4058 31.5436 21.2502 43.4663C17.5036 48.3453 13.2703 52.9186 9.97957 58.2343C9.03459 59.7607 8.19501 61.3671 7.25437 62.8966C6.8974 63.4771 6.29227 64.1203 6.00856 64.7705C5.9351 64.9389 6.35447 64.7784 6.49521 64.6813C9.00213 62.9513 11.3496 60.7905 13.717 58.8366C23.9162 50.4184 33.9683 41.7699 44.0445 33.16C52.5512 25.8911 60.7773 18.0974 69.5251 11.2088C71.5083 9.64711 77.6738 5.34566 75.579 6.70256C75.1094 7.00672 74.0988 7.91947 73.8855 8.10797C70.972 10.6821 68.0728 13.2829 65.1843 15.8935C56.5588 23.689 48.6122 32.1909 40.8035 41.0347C33.28 49.5556 25.5574 57.8775 18.1746 66.5552C17.9835 66.7798 17.8074 66.9817 17.6588 67.2467C17.5764 67.3935 17.5004 67.484 17.396 67.6036C16.6707 68.4349 19.1875 66.4579 20.0725 65.8636C41.3029 51.6071 62.4455 37.1298 82.4114 20.634C82.5736 20.5 82.7952 20.4288 82.8981 20.2324C83.3392 19.3899 81.5181 21.4025 80.8736 22.0505C74.8242 28.1336 68.983 34.4661 63.2572 40.9455C56.4992 48.5929 49.889 56.4265 42.9837 63.9005C40.576 66.5064 37.9677 68.8232 35.538 71.3849C34.1341 72.8651 32.9756 74.6487 31.5476 76.0807C29.3207 78.3138 27.228 80.7159 25.0071 82.9516C23.7829 84.184 22.4645 85.3103 21.0847 86.309C20.5563 86.6915 20.0252 87.075 19.5372 87.5248C19.2328 87.8054 18.2856 88.2941 18.6613 88.4171C18.9694 88.518 19.272 88.1842 19.5567 88.0156C23.1117 85.9093 26.5843 83.5565 30.0584 81.2897C41.6302 73.7391 53.2249 66.1629 64.5809 58.1896C70.1075 54.3092 75.5673 50.2829 81.0196 46.266C82.1189 45.4561 83.2166 44.5488 84.3775 43.8455C84.4862 43.7797 84.6052 43.7736 84.6695 43.6448C85.2493 42.4818 86.6717 41.5764 87.6088 40.8339C88.2181 40.3511 88.6758 39.9196 89.1855 39.2947C89.7976 38.5443 92.1573 36.0809 89.351 38.7035C79.478 47.93 69.9379 57.5891 60.6877 67.626C52.6354 76.3632 44.5278 84.9593 36.0247 93.1241C33.4401 95.6059 30.8142 98.0323 28.2579 100.553C27.8196 100.985 26.5088 102.241 27.0315 101.958C29.0344 
937100.873 31.0543 99.1781 32.8712 97.8311C38.7311 93.4868 44.5095 89.0004 50.3125 84.5578C62.1372 75.5052 73.9404 66.3682 86.2656 58.2231C91.3769 54.8453 96.5566 51.6139 101.653 48.2068C103.259 47.1333 98.8459 51.0009 97.4195 52.3672C88.3783 61.0278 79.5428 70.0167 71.2965 79.6723C67.1843 84.4874 63.4129 89.8291 58.8579 94.128C57.809 95.1179 61.2604 92.6708 62.4396 91.8972C68.9573 87.6214 75.4183 83.2359 81.808 78.7131C88.1034 74.257 94.4713 69.7912 100.485 64.8374C101.899 63.6731 97.8632 67.4625 96.5435 68.7637C91.5792 73.6584 87.0586 79.0103 82.3725 84.2455C78.5388 88.5284 74.6949 92.8073 70.7904 97.0057C69.6374 98.2455 68.5137 99.6195 67.2769 100.753C64.5512 103.252 73.0582 96.269 75.9294 93.9941C78.9938 91.566 82.0742 89.1753 85.2145 86.8778C85.829 86.4283 86.4384 85.9689 87.0637 85.5394C87.4281 85.2891 88.2812 84.5843 88.2706 85.0709C88.2513 85.9563 87.2868 87.3531 86.9177 88.0602C86.1884 89.4575 85.4541 90.8358 84.8252 92.2987C84.6806 92.6351 83.3212 95.4159 83.6183 95.7565",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("g",{clipPath:"url(#clip0_17669_49918)"},l.createElement("path",{d:"M57.4693 32.0642L46.2809 33.2402C35.0925 34.4161 31.0876 39.3618 32.2635 50.5502L33.6746 63.9762C34.8506 75.1646 39.7963 79.1696 50.9847 77.9936",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.25 48.0841L77.9556 54.7971",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.2517 48.0841L68.301 49.0248C61.5879 49.7304 59.1151 47.7279 58.4095 41.0149L57.4688 32.0642L77.2517 48.0841Z",stroke:"black",strokeWidth:4,strokeLinejoin:"round"}),l.createElement("path",{d:"M78.7823 68.4688H58.9833M68.8828 58.5693V78.3683V58.5693Z",stroke:"black",strokeWidth:4})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17669_49918"},l.createElement("rect",{width:54,height:54,fill:"white",transform:"translate(24.8281 30.9694) rotate(-6)"})))),Pme=({handleNewDocumentClick:e,isNewDocumentPending:t})=>a.jsxs("div",{className:"flex min-h-[calc(100dvh-7rem)] w-full flex-col items-center justify-center px-4 py-10 mx-auto",children:[a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(Ome,{className:"size-24"})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.documents.EMPTY_TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.documents.EMPTY_DESCRIPTION}),a.jsxs("div",{className:"flex gap-3 mt-6",children:[a.jsx(ut,{variant:"h16inverse",onClick:e,disabled:t,children:h.client.documents.NEW_DOCUMENT}),!1]})]}),Lme=()=>{const{id:e}=st(),{clientData:t,isSuccess:n}=zt(),s=t?.id??e??"",{data:r,isLoading:i,isFetching:o,isError:c}=Vt({queryKey:["clientDocuments",s],queryFn:({signal:u})=>{if(!s)throw new Error("Missing client id");return Efe({clientId:s,signal:u})},enabled:!!s&&n});return{documents:r??void 0,isLoading:i,isFetching:o,isError:c}},Mme=()=>{const{id:e}=st(),t=at(),{clientData:n}=zt(),s=n?.id??e??"",r=bt();return tt({mutationFn:()=>{if(!s)throw new Error("Missing client id");return xfe({clientId:s,body:{name:"Новый документ",lexicalJson:{}}})},onSuccess:i=>{r.setQueryData(["clientDocuments",s],c=>c?.length?[i,...c]:[i]),window.location.pathname.endsWith(`/clients/${s}/documents`)&&t(`/clients/${s}/documents/${i.id}`)},onError:()=>{ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})}})},jme=()=>{const{documents:e,isLoading:t,isFetching:n,isError:s}=Lme(),{mutate:r,isPending:i}=Mme();l.useEffect(()=>{s&&ve({type:"failed",message:h.client.documents.LIST_LOAD_FAILED,key:"DOCUMENTS_LIST_LOAD_FAILED"})},[s]);const o=l.useMemo(()=>s?!0:!(t||!e||e.length===0&&n),[e,n,t,s]),c=l.useMemo(()=>e?.map(d=>a.jsx(kme,{documentId:d.id,title:d.name,updatedAt:d.updatedAt,version:d.version},d.id)),[e]),u=l.useCallback(()=>{r()},[r]);return o?e?.length===0?a.jsx(Pme,{handleNewDocumentClick:u,isNewDocumentPending:i}):a.jsxs("div",{className:"mt-8 px-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase",children:h.client.documents.PAGE_TITLE}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx(ut,{variant:"h8inverse",onClick:u,disabled:i,children:h.client.documents.NEW_DOCUMENT}),!1]})]}),a.jsx("div",{className:"mt-4",children:c})]}):a.jsx("div",{className:"flex items-center justify-center h-[calc(100dvh-7rem)]",children:a.jsx(ct,{delay:0})})},Bme=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M2.5 2.5L17.5 17.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.8176 3.48498C7.0276 3.39082 7.25927 3.33832 7.5026 3.33832H12.5026C12.9446 3.33832 13.3686 3.51391 13.6811 3.82647C13.9937 4.13903 14.1693 4.56296 14.1693 5.00498V10.8383M14.1693 14.1667V16.6667L10.0026 14.1667L5.83594 16.6667V5.83332L14.1693 14.1667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Fme=({quoteItem:e,caseGroup:t,clientId:n,renderedQuoteText:s,onOpenSourceClick:r,onDeleteFlowActiveChange:i})=>{const o=bt(),[c,u]=l.useState(null),d=l.useRef(c);d.current=c;const p=tt({mutationFn:async({quoteId:S})=>yte({clientId:n,quoteId:S}),onSuccess:(S,b)=>{o.setQueryData(["clientQuotes",n],w=>w&&w.map(_=>_.caseId!==t.caseId?_:{..._,quotes:_.quotes.filter(N=>N.id!==b.quoteId)}).filter(_=>(_.quotes?.length??0)>0))},onError:()=>{u(null),ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})}}),{mutate:g}=p;l.useEffect(()=>{if(c===null)return;const S=window.setTimeout(()=>{const b=d.current;if(b!==null){if(b===1){g({quoteId:e.id}),u(0);return}b>0&&u(b-1)}},1e3);return()=>window.clearTimeout(S)},[c,g,e.id]);const A=l.useCallback(()=>{p.isPending||u(3)},[p.isPending]),E=l.useCallback(()=>{u(null)},[]),x=l.useCallback(()=>{r(e,t)},[r,e,t]),y=c!==null,I=y&&c>0,v=y||p.isPending;return l.useEffect(()=>{if(i)return i({quoteId:e.id,isDeleteFlowActive:v}),()=>{i({quoteId:e.id,isDeleteFlowActive:!1})}},[i,e.id,v]),a.jsxs("div",{className:"flex flex-col gap-3 pb-6 last:pb-0 first:pt-2 pt-4 border-b border-zinc-100 last:border-b-0",children:[a.jsx("div",{className:Y("roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-950 whitespace-pre-wrap",v&&"opacity-60 pointer-events-none"),children:s??e.text}),a.jsxs("div",{className:"flex justify-between items-center gap-3",children:[a.jsx("div",{className:Y(v&&"opacity-60 pointer-events-none"),children:a.jsx(ms,{onClick:x,children:h.client.cases.links.SOURCE})}),a.jsxs("div",{className:"flex h-8 min-h-8 shrink-0 items-center justify-end gap-3",children:[!v&&a.jsxs("div",{className:"flex h-8 min-h-8 items-center gap-6",children:[a.jsx("span",{className:"roboto-flex-25-400-1 text-[14px] leading-[16
937px] text-zinc-500",children:_r({dateString:e.createdAt,isWithTime:!0})}),a.jsx(Ls,{text:h.client.quotes.DELETE_QUOTE,isDisableOnTouch:!0,children:a.jsx("button",{type:"button",className:"flex h-8 w-8 cursor-pointer items-center justify-center text-zinc-400 duration-100 hover:text-zinc-500 disabled:pointer-events-none disabled:opacity-50",disabled:p.isPending,onClick:A,children:a.jsx(Bme,{className:"size-5"})})})]}),!!I&&a.jsxs("div",{className:"flex h-8 min-h-8 items-center gap-3",children:[a.jsx("span",{className:"roboto-flex-25-400-1 text-[14px] leading-[16px] text-zinc-600",children:h.client.quotes.DELETE_COUNTDOWN.replace("{count}",String(c))}),a.jsx(ut,{type:"button",variant:"h8",disabled:p.isPending,onClick:E,children:h.client.quotes.CANCEL_DELETE})]})]})]})]})},Ume=({searchValue:e,isSearchActive:t,matchesLength:n,activeMatchIndexNormalized:s,onFindShortcut:r,onSearchValueChange:i,onClearSearchClick:o,onPrevMatchClick:c,onNextMatchClick:u,onExportQuotesClick:d,isExportQuotesPending:p})=>{const g=l.useRef(null),A=l.useCallback(({shouldSelectText:y})=>{g.current&&(g.current.focus({preventScroll:!0}),y&&g.current.select())},[]),E=l.useCallback(y=>{if(y.key==="Escape"){y.preventDefault(),o();return}if(n){if(y.key==="Enter"){if(y.preventDefault(),!y.shiftKey){u();return}c()}y.key==="ArrowDown"&&(y.preventDefault(),u()),y.key==="ArrowUp"&&(y.preventDefault(),c())}},[n,o,u,c]),x=l.useCallback(()=>{A({shouldSelectText:!0})},[A]);return l.useEffect(()=>{const y=I=>{const v=I.key.toLowerCase();(I.ctrlKey||I.metaKey)&&(I.code==="KeyF"||v==="f")&&(I.preventDefault(),r(),A({shouldSelectText:!0}))};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[A,r]),a.jsx(a.Fragment,{children:a.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 w-full max-w-[580px] bp56_25:max-w-[680px] bp72:max-w-[848px] group z-20",children:a.jsxs("div",{className:"h-12 bg-white rounded-full shadow-[0_8px_16px_rgba(0,0,0,0.08),0_0_4px_rgba(0,0,0,0.04)] border border-zinc-200 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[a.jsx("div",{className:"w-11 h-12 pl-3 flex items-center justify-center cursor-pointer",onClick:x,children:a.jsx(j7,{className:"size-5 text-zinc-400 group-hover:text-zinc-500"})}),a.jsx("input",{ref:g,value:e,onChange:y=>i(y.target.value),onKeyDown:E,placeholder:h.client.quotes.SEARCH_PLACEHOLDER,className:"h-12 flex-1 min-w-0 outline-none bg-transparent roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 placeholder:text-zinc-400"})]}),a.jsxs("div",{className:"flex items-center",children:[!!t&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",onClick:o,className:"w-14 h-12 pl-3 pr-3 flex items-center justify-center text-zinc-400 hover:text-zinc-500 cursor-pointer",children:a.jsx(ga,{className:"size-5"})}),a.jsx("figure",{className:"min-w-0 w-px bg-zinc-200 h-6 mr-3"}),a.jsxs("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950 whitespace-nowrap w-[78px] min-w-0",children:[n?s+1:0," из"," ",n]}),a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("button",{type:"button",onClick:c,disabled:!n,className:Y("w-10 h-12 pl-2 flex items-center justify-center",!!n&&"text-zinc-400 hover:text-zinc-500 cursor-pointer",!n&&"text-zinc-300 cursor-default"),children:a.jsx(al,{className:"size-6 rotate-180"})}),a.jsx("button",{type:"button",onClick:u,disabled:!n,className:Y("w-10 h-12 pr-2 flex items-center justify-center",!!n&&"text-zinc-400 hover:text-zinc-500 cursor-pointer",!n&&"text-zinc-300 cursor-default"),children:a.jsx(al,{className:"size-6"})})]})]}),a.jsx("figure",{className:"min-w-0 w-px bg-zinc-200 h-6"}),a.jsx(Ls,{text:h.client.quotes.EXPORT_QUOTES_TOOLTIP,isClampToParent:!1,isFollowCursor:!1,isBelow:!1,isDisableOnTouch:!0,disabled:p,children:a.jsx("button",{className:Y("w-13 h-12 pl-2 pr-3 flex items-center justify-center",!!p&&"text-zinc-400 cursor-default",!p&&"text-zinc-400 hover:text-zinc-500 cursor-pointer"),type:"button",disabled:p,onClick:d,children:a.jsx($A,{className:"size-6"})})})]})]})})})}
937,zme=({flatQuotes:e,scrollContainerRef:t,excludedQuoteIdsFromSearch:n})=>{const s=l.useMemo(()=>({a:"а",c:"с",e:"е",h:"н",k:"к",m:"м",o:"о",p:"р",t:"т",x:"х",y:"у",b:"в"}),[]),r=l.useRef([]),i=l.useRef(null),o=l.useRef(null),[c,u]=l.useState(0),[d,p]=l.useState(0),{searchValue:g,debouncedSearchValue:A,isSearchActive:E,handleSearchValueChange:x,handleClearSearchClick:y}=v2(),I=l.useCallback((H,j)=>j<=0?0:(H%j+j)%j,[]),v=l.useCallback(H=>{x(H),H.trim()||(u(0),r.current=[])},[x]),S=l.useCallback(()=>{i.current=null,typeof o.current=="number"&&(cancelAnimationFrame(o.current),o.current=null)},[]),b=l.useCallback(({reason:H})=>{S(),i.current=H,p(j=>j+1)},[S]),w=l.useCallback(()=>{},[]),_=l.useCallback(()=>{y(),S(),u(0),r.current=[]},[S,y]),N=l.useCallback(H=>{const j=H.toLowerCase(),q=j==="ё"?"е":j,G=s[q];return G||q},[s]),R=l.useCallback(H=>/[a-zа-я0-9]/.test(H),[]),D=l.useCallback(H=>/[a-zа-я]/.test(H),[]),k=l.useCallback(({text:H})=>{const j=[];let q="",G=[];for(let $=0;$<H.length;$+=1){const J=N(H[$]);if(!R(J)){if(!q)continue;j.push({text:q,originalIndices:G}),q="",G=[];continue}q+=J,G.push($)}return q&&j.push({text:q,originalIndices:G}),j},[R,N]),L=l.useCallback(({tokens:H})=>{const j=[];let q=0;for(;q<H.length;){const G=H[q];if(!(G.text.length===1&&D(G.text))){j.push(G),q+=1;continue}let J=q;for(;J<H.length;){const ee=H[J];if(!(ee.text.length===1&&D(ee.text)))break;J+=1}if(J-q<4){j.push(G),q+=1;continue}const X=H.slice(q,J),oe=X.map(ee=>ee.text).join(""),ie=X.flatMap(ee=>ee.originalIndices);j.push({text:oe,originalIndices:ie}),q=J}return j},[D]),O=l.useCallback(({text:H,tokens:j})=>{const q=[];if(j.length<2)return q;for(let G=0;G<j.length-1;G+=1){const $=j[G],J=j[G+1],ne=$.originalIndices[$.originalIndices.length-1],X=J.originalIndices[0];let oe=!1,ie=!1;for(let ee=ne+1;ee<X;ee+=1){const te=H[ee];if(/\s/.test(te)){oe=!0;continue}ie=!0}q.push({hasWhitespace:oe,hasSpecial:ie,originalIndex:X-1})}return q},[]),P=l.useCallback(({text:H})=>{const j=L({tokens:k({text:H})});if(!j.length)return[];const q=O({text:H,tokens:j}),G=[];return j.forEach(($,J)=>{for(let oe=0;oe<$.text.length;oe+=1)G.push({kind:"char",value:$.text[oe],originalIndex:$.originalIndices[oe]});if(J===j.length-1)return;const X=q[J];X&&G.push({kind:"separator",hasWhitespace:X.hasWhitespace,hasSpecial:X.hasSpecial,originalIndex:X.originalIndex})}),G},[k,O,L]),B=l.useCallback(({textUnits:H,queryUnits:j,startTextUnitIndex:q})=>{const G=new Set,$=({textUnitIndex:J,queryUnitIndex:ne})=>{if(ne===j.length)return J;if(J>H.length)return null;const X=`${J}:${ne}`;if(G.has(X))return null;const oe=j[ne];if(!oe)return null;if(oe.kind==="char"){const fe=H[J];if(fe?.kind==="separator"&&fe.hasSpecial){const xe=$({textUnitIndex:J+1,queryUnitIndex:ne});if(typeof xe=="number")return xe}if(!(fe?.kind==="char"&&fe.value===oe.value))return G.add(X),null;const ce=$({textUnitIndex:J+1,queryUnitIndex:ne+1});return typeof ce=="number"?ce:(G.add(X),null)}if(oe.hasWhitespace){const fe=H[J];if(!(fe?.kind==="separator"&&(fe.hasWhitespace||fe.hasSpecial)))return G.add(X),null;const ye=$({textUnitIndex:J+1,queryUnitIndex:ne+1});return typeof ye=="number"?ye:(G.add(X),null)}const ee=$({textUnitIndex:J,queryUnitIndex:ne+1});if(typeof ee=="number")return ee;if(!(H[J]?.kind==="separator"))return G.add(X),null;const he=$({textUnitIndex:J+1,queryUnitIndex:ne+1});return typeof he=="number"?he:(G.add(X),null)};return $({textUnitIndex:q,queryUnitIndex:0})},[]),F=l.useCallback(({text:H,query:j})=>{const q=P({text:H}),G=P({text:j});if(!q.length||!G.length)return[];if(G[0]?.kind!=="char")return[];const $=[],J=G[0].value;for(let ne=0;ne<q.length;ne+=1){const X=q[ne];if(!(X.kind==="char"&&X.value===J))continue;const ie=B({textUnits:q,queryUnits:G,startTextUnitIndex:ne});if(typeof ie!="number"||ie<=ne)continue;let ee=ie-1;for(;ee>=ne&&q[ee]?.kind!=="char";)ee-=1;if(ee<ne)continue;const te=q[ee];!te||te.kind!=="char"||$.push({start:X.originalIndex,end:te.originalIndex+1})}return $},[P,B]),z=l.useMemo(()=>{if(!A)return[];if(!e.length)return[];const H=[];return e.forEach(j=>{if(n?.has(j.id)||!j.text)return;F({text:j.text,query:A}
937).forEach(G=>{H.push({quoteId:j.id,range:G})})}),H},[n,e,A,F]),Q=l.useMemo(()=>I(c,z.length),[c,I,z.length]),M=l.useCallback(()=>{z.length&&(b({reason:"navigation"}),u(H=>I(H-1,z.length)))},[I,z.length,b]),K=l.useCallback(()=>{z.length&&(b({reason:"navigation"}),u(H=>I(H+1,z.length)))},[I,z.length,b]),W=l.useCallback(H=>{H===e[0]?.id&&A&&z.length>0&&(r.current=[]);const j=e.find(ne=>ne.id===H);if(!j)return null;const q=j.text;if(!A||!z.length)return q;const G=z.map((ne,X)=>({...ne,globalIndex:X})).filter(ne=>ne.quoteId===H);if(!G.length)return q;const $=[];let J=0;return G.forEach(({range:ne,globalIndex:X})=>{J<ne.start&&$.push(q.slice(J,ne.start));const oe=X===Q,ie=q.slice(ne.start,ne.end);$.push(a.jsx("span",{ref:ee=>{r.current[X]=ee},className:Y(oe&&"bg-amber-300",!oe&&"bg-amber-200"),children:ie},`match-${ne.start}-${ne.end}-${X}`)),J=ne.end}),J<q.length&&$.push(q.slice(J)),$},[Q,A,e,z]);return l.useEffect(()=>{S(),u(0),A.trim()&&b({reason:"typing"})},[S,A,b]),l.useEffect(()=>{if(!z.length||!i.current)return;i.current=null;const j=t?.current;j&&(o.current=requestAnimationFrame(()=>{o.current=null;const q=r.current[Q];if(!q)return;const G=q.getBoundingClientRect(),$=j.getBoundingClientRect(),J=G.top-$.top,ne=j.scrollTop+J-j.clientHeight/2+G.height/2,X=Math.max(j.scrollHeight-j.clientHeight,0),oe=Math.min(Math.max(ne,0),X);j.scrollTop=oe}))},[Q,d,z.length,t]),l.useEffect(()=>()=>{S()},[S]),{searchValue:g,isSearchActive:E,matchesLength:z.length,activeMatchIndexNormalized:Q,renderQuoteText:W,handleFindShortcut:w,handleSearchValueChange:v,handleClearSearchClick:_,handlePrevMatchClick:M,handleNextMatchClick:K}},Qme=({clientId:e})=>{const{mutate:t,isPending:n}=tt({mutationFn:async()=>{if(!e)throw new Error("Missing client id");return xte({clientId:e})},onSuccess:r=>{const i=r?.urlDocx;if(!i){ve({type:"failed",message:h.client.quotes.EXPORT_FAILED,key:"QUOTES_EXPORT_FAILED"});return}A2({url:i})},onError:()=>{ve({type:"failed",message:h.client.quotes.EXPORT_FAILED,key:"QUOTES_EXPORT_FAILED"})},onSettled:()=>{Ze("QUOTES_EXPORT_PENDING")}});return{handleExportQuotesClick:l.useCallback(()=>{ve({type:"pending",message:h.client.cases.messages.FORMING_DOCUMENT,key:"QUOTES_EXPORT_PENDING",duration:0}),t()},[t]),isExportQuotesPending:n}},Hme=()=>a.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-4 py-10 bp48:pb-20 mx-auto",children:[a.jsx("div",{className:"h-24 flex items-center justify-center",children:a.jsx(hs,{})}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.quotes.EMPTY_CASES}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.quotes.EMPTY_CASES_DESCRIPTION})]}),Vme="quotes-case",g8=e=>`${Vme}-${e}`,Gme=({group:e,regionsMapById:t})=>{const n=e.metadataCui?.trim()??"",s=typeof e.metadataRegion=="number"?t[String(e.metadataRegion)]?.name:void 0,i=[h.client.quotes.CRIMINAL_CASE_TITLE,n,s].filter(o=>!!o&&String(o).length>0).join(" ");return i.length>0?i:e.caseId},qme=e=>{const t=e.article?.trim()??"";return t?et({clause:e.clause,part:e.part??null,number:t,codeType:e.code_type??null}):""},Wme=e=>qt({count:e,zero:h.client.quotes.QUOTES_COUNT.ZERO,one:h.client.quotes.QUOTES_COUNT.ONE,many:h.client.quotes.QUOTES_COUNT.MANY}).replace("{count}",String(e)),Kme=e=>{const t=e.map(qme).filter(Boolean);return t.length===0?"":t.length<=2?t.join(", "):`${t.slice(0,2).join(", ")}, +${t.length-2}`},NS=e=>e.replace(/_/g,"-")==="second-instance"?"second-instance":"first-instance",$me=e=>e?.length?e.map(t=>{const n=t.article?.trim()??"";return n?et({clause:t.clause,part:t.part??null,number:n,codeType:t.code_type??null}):""}).filter(Boolean).join(", "):"",Yme=({clientId:e,instance:t,caseId:n})=>{const s=NS(t);return`/clients/${e}/cases/${s}/${n}/${s}/information/general`},Xme=({group:e,regionsMapById:t})=>{const n=e.metadataCui?.trim()??"",s=typeof e.metadataRegion=="number"?t[String(e.metadataRegion)]?.name:void 0;return[h.client.quotes.CRIMINAL_CASE_TITLE,n,s?`(${s})`:void 0].filter(i=>!!i&&i.length>0).join(" ")},Jme=e=>[...e.map(n=>({...n,quotes:[...n.quotes??[]].sort((s,r)=>new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime())}))].sort((n,s)=>{const r=n.quotes[0]?new Date(n.quotes[0].createdAt).getTime():Number.NEGATIVE_INFINITY,i=s.quotes[0]?new Date(s.quotes[0].createdAt).getTime():Number.NEGATIVE_INFINITY;return i!==r?i-r:n.caseId.localeCompare(s.caseId)}),Zme=()=>{const e=vs(),t=at(),n=Fe(),{id:s}=st(),{clientData:r,isSuccess:i,mainWrapperRef:o}=zt(),c=r?.id??s,{handleExportQuotesClick:u,isExportQuotesPending:d}=Qme({clientId:c}),p=bt(),[g,A]=l.useState(()=>new Set),E=tt({mutationFn:async({caseId:q})=>
937{if(!c)throw new Error("Missing client id");return bte({clientId:c,caseId:q})},onSuccess:(q,G)=>{p.setQueryData(["clientQuotes",c],$=>$&&$.filter(J=>J.caseId!==G.caseId))},onError:()=>{ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})}}),x=tt({mutationFn:async()=>{if(!c)throw new Error("Missing client id");return Cte({clientId:c})},onSuccess:()=>{p.setQueryData(["clientQuotes",c],[])},onError:()=>{ve({type:"failed",message:h.network.errors.NETWORK_TIMEOUT,key:"NETWORK_TIMEOUT"})}}),{data:y,isLoading:I,isFetching:v}=Vt({queryKey:["clientQuotes",c],queryFn:async({signal:q})=>{if(!c)throw new Error("Missing client id");return await Ete({clientId:c,signal:q})},enabled:!!c&&i}),S=l.useMemo(()=>y?.length?Jme(y):y,[y]),b=l.useMemo(()=>{if(!S?.length)return[];const q=[];return S.forEach(G=>{(G.quotes??[]).forEach($=>{q.push({id:$.id,text:$.text})})}),q},[S]),{searchValue:w,isSearchActive:_,matchesLength:N,activeMatchIndexNormalized:R,renderQuoteText:D,handleFindShortcut:k,handleSearchValueChange:L,handleClearSearchClick:O,handlePrevMatchClick:P,handleNextMatchClick:B}=zme({flatQuotes:b,scrollContainerRef:o,excludedQuoteIdsFromSearch:g}),F=l.useMemo(()=>{if(!S?.length||!c)return[];const q=`/clients/${c}/quotes`;return S.map((G,$)=>({title:Gme({group:G,regionsMapById:e}),text:Kme(G.laws??[]),instance:G.result?.trim()??"",date:Wme(G.quotes?.length??0),to:q,hash:$===0?void 0:g8(G.caseId)}))},[S,c,e]),{scrollToHashedElement:z}=S7({infoCards:F,clientId:c,offset:45});lE({containerRef:o});const Q=l.useCallback((q,G)=>{if(!c)return;const $=NS(G.instance),J=NS(G.instance);t(`/clients/${c}/cases/${$}/${G.caseId}/${J}/source`,{state:{...n.state,isCaseSourceOpenedFromQuotesPage:!0,isForceCaseSourceAnimateOnStart:!0,returnToPath:n.pathname,returnToState:n.state,initialSearchTerms:sr([q.text])}})},[c,t,n.pathname,n.state]),M=l.useCallback((q,G)=>{q.metaKey||q.ctrlKey||q.shiftKey||q.altKey||c&&(q.preventDefault(),t(G,{state:{isPreventScrollToTop:!0,isCaseOpenedFromQuotesPage:!0,isForceCaseDetailedAnimateOnStart:!0,returnToHash:window.location.hash}}))},[c,t]),K=l.useCallback(q=>{E.mutate({caseId:q})},[E]),W=l.useCallback(()=>{x.mutate()},[x]),H=l.useCallback(({quoteId:q,isDeleteFlowActive:G})=>{A($=>{const J=new Set($);return G?(J.add(q),J):(J.delete(q),J)})},[]);if(!i||!r||I||!c)return a.jsx(ct,{isWithWrapper:!0});if(!S?.length)return v?a.jsx(ct,{isWithWrapper:!0}):a.jsx(Hme,{});const j=x.isPending;return a.jsx(Yn,{headerMode:"simple",fabulizerMode:"searchInsteadOfFabulizer",isRightColumnDisabled:j,isLeftColumnPreventScrollPropagation:!1,leftColumnStickyTitle:null,leftColumn:a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"pl-4 pr-6 pb-3 flex items-start justify-between gap-2 roboto-flex-25-700-1 text-[20px] leading-[20px] bp48:text-[24px] bp48:leading-[28px] uppercase text-zinc-950",children:[a.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:h.client.quotes.LEFT_TITLE}),a.jsx(Ss,{isWidthHalf:!0,isRightColumn:!0,items:[{title:h.client.quotes.DELETE_ALL_QUOTES_ALL_CASES,onClick:W,isCloseOnClick:!0,isDisabled:x.isPending}],isDisabled:x.isPending})]}),F.map((q,G)=>a.jsx(Ac,{title:q.title,text:q.text,instance:q.instance,date:q.date,to:q.to,hash:q.hash,clientId:c,scrollToHashedElement:z,isTitleTruncate:!0},q.hash??G))]}),rightColumnStickyTitle:null,rightColumn:a.jsxs("div",{children:[S.map(q=>{const G=$me(q.laws??[]),$=q.quotes??[],J=E.isPending&&E.variables?.caseId===q.caseId,ne=Yme({clientId:c,instance:q.instance,caseId:q.caseId});return a.jsxs("div",{id:g8(q.caseId),className:Y("relative first:pt-0 pt-14",J&&"opacity-60 pointer-events-none"),children:[a.jsxs("div",{className:"sticky top-20 z-9 -mx-4 bp48:-mx-6 px-4 bp48:px-6 bg-white pb-2 -translate-y-2",children:[a.jsxs("div",{className:"flex items-start justify-between roboto-flex-100-600-1 text-[20px] leading-[24px] text-zinc-950",children:[a.jsx(Je,{to:ne,onClick:X=>M(X,ne),className:"hover:underline decoration-[2%] underline-offset-[25%] decoration-zinc-950 hover:text-zinc-700 min-w-0",children:Xme({group:q,regionsMapById:e})}),a.jsx(Ss,{isRightColumn:!0,items:[{title:h.client.quotes.DELETE_ALL_QUOTES_FOR_CASE,onClick:()=>{K(q.caseId)},isCloseOnClick:!0,isDisabled:!$.length||J}],isDisabled:J})]}),!!G&&a.jsx("div",{className:"roboto-flex-25-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1",children:G})]}),a.jsx("div",{className:"flex flex-col",children:$.length===0?a.jsx("div",{className:"text-zinc-600",children:h.client.quotes.NO_QUOTES_FOR_CASE}):$.map(X=>a.jsx(Fme,{quoteItem:X,caseGroup:q,clientId:c,renderedQuoteText:D(X.id),onOpenSourceClick:Q,onDeleteFlowActiveChange:H},X.id))})]},q.caseId)}),a.jsx(Ume,{searchValue:w,isSearchActive:_,matchesLength:N,activeMatchIndexNormalized:R,onFindShortcut:k,onSearchValueChange:L,onClearSearchClick:O,onPrevMatchClick:P,onNextMatchClick:B,onExportQuotesClick:u,isExportQuotesPending:d})]})})};function ege({variant:e}){return e==="autoInit"?h.molecules.chat.ANALYZING_AUTO_INIT:h.molecules.chat.ANALYZING}const tge=({message:e})=>a.jsx("div",{className:"flex w-full flex-col self-start",children:a.jsx("div",{className:"roboto-flex-100-400-1 text-left text-sm leading-5 text-zinc-500",children:a.jsx(Aa,{children:ege({variant:e.variant})})})});function nge(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sge=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rge=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ige={};function A8(e,t){return(ige.jsx?rge:sge).test(e)}const oge=/[ \t\n\f\r]/g;function age(e){return typeof e=="object"?e.type==="text"?E8(e.value):!1:E8(e)}function E8(e){return e.replace(oge,"")===""}class Xm{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Xm.prototype.normal={};Xm.prototype.property={};Xm.prototype.space=void 0;function ZM(e,t){const n={},s={};for(const r of e)Object.assign(n,r.property),Object.assign(s,r.normal);return new Xm(n,s,t)}function wS(e){return e.toLowerCase()}class Xr{constructor(t,n){this.attribute=n,this.property=t}}Xr.prototype.attribute="";Xr.prototype.booleanish=!1;Xr.prototype.boolean=!1;Xr.prototype.commaOrSpaceSeparated=!1;Xr.prototype.commaSeparated=!1;Xr.prototype.defined=!1;Xr.prototype.mustUseProperty=!1;Xr.prototype.number=!1;Xr.prototype.overloadedBoolean=!1;Xr.prototype.property="";Xr.prototype.spaceSeparated=!1;Xr.prototype.space=void 0;let lge=0;const vt=Wu(),ys=Wu(),RS=Wu(),Xe=Wu(),Nn=Wu(),cu=Wu(),li=Wu();function Wu(){return 2**++lge}const DS=Object.freeze(Object.defineProperty({__proto__:null,boolean:vt,booleanish:ys,commaOrSpaceSeparated:li,commaSeparated:cu,number:Xe,overloadedBoolean:RS,spaceSeparated:Nn},Symbol.toStringTag,{value:"Module"})),hb=Object.keys(DS);class d_ extends Xr{constructor(t,n,s,r){let i=-1;
vendor: 4,330 bytes, line 937
937if(super(t,n),x8(this,"space",r),typeof s=="number")for(;++i<hb.length;){const o=hb[i];x8(this,hb[i],(s&DS[o])===DS[o])}}}d_.prototype.defined=!0;function x8(e,t,n){n&&(e[t]=n)}function ep(e){const t={},n={};for(const[s,r]of Object.entries(e.properties)){const i=new d_(s,e.transform(e.attributes||{},s),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(i.mustUseProperty=!0),t[s]=i,n[wS(s)]=s,n[wS(i.attribute)]=s}return new Xm(t,n,e.space)}const ej=ep({properties:{ariaActiveDescendant:null,ariaAtomic:ys,ariaAutoComplete:null,ariaBusy:ys,ariaChecked:ys,ariaColCount:Xe,ariaColIndex:Xe,ariaColSpan:Xe,ariaControls:Nn,ariaCurrent:null,ariaDescribedBy:Nn,ariaDetails:null,ariaDisabled:ys,ariaDropEffect:Nn,ariaErrorMessage:null,ariaExpanded:ys,ariaFlowTo:Nn,ariaGrabbed:ys,ariaHasPopup:null,ariaHidden:ys,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nn,ariaLevel:Xe,ariaLive:null,ariaModal:ys,ariaMultiLine:ys,ariaMultiSelectable:ys,ariaOrientation:null,ariaOwns:Nn,ariaPlaceholder:null,ariaPosInSet:Xe,ariaPressed:ys,ariaReadOnly:ys,ariaRelevant:null,ariaRequired:ys,ariaRoleDescription:Nn,ariaRowCount:Xe,ariaRowIndex:Xe,ariaRowSpan:Xe,ariaSelected:ys,ariaSetSize:Xe,ariaSort:null,ariaValueMax:Xe,ariaValueMin:Xe,ariaValueNow:Xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tj(e,t){return t in e?e[t]:t}function nj(e,t){return tj(e,t.toLowerCase())}const cge=ep({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:cu,acceptCharset:Nn,accessKey:Nn,action:null,allow:null,allowFullScreen:vt,allowPaymentRequest:vt,allowUserMedia:vt,alpha:vt,alt:null,as:null,async:vt,autoCapitalize:null,autoComplete:Nn,autoFocus:vt,autoPlay:vt,blocking:Nn,capture:null,charSet:null,checked:vt,cite:null,className:Nn,closedBy:null,colorSpace:null,cols:Xe,colSpan:Xe,command:null,commandFor:null,content:null,contentEditable:ys,controls:vt,controlsList:Nn,coords:Xe|cu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vt,defer:vt,dir:null,dirName:null,disabled:vt,download:RS,draggable:ys,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vt,formTarget:null,headers:Nn,height:Xe,hidden:RS,high:Xe,href:null,hrefLang:null,htmlFor:Nn,httpEquiv:Nn,id:null,imageSizes:null,imageSrcSet:null,inert:vt,inputMode:null,integrity:null,is:null,isMap:vt,itemId:null,itemProp:Nn,itemRef:Nn,itemScope:vt,itemType:Nn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vt,low:Xe,manifest:null,max:null,maxLength:Xe,media:null,method:null,min:null,minLength:Xe,multiple:vt,muted:vt,name:null,nonce:null,noModule:vt,noValidate:vt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vt,optimum:Xe,pattern:null,ping:Nn,placeholder:null,playsInl
937ine:vt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vt,referrerPolicy:null,rel:Nn,required:vt,reversed:vt,rows:Xe,rowSpan:Xe,sandbox:Nn,scope:null,scoped:vt,seamless:vt,selected:vt,shadowRootClonable:vt,shadowRootCustomElementRegistry:vt,shadowRootDelegatesFocus:vt,shadowRootMode:null,shadowRootSerializable:vt,shape:null,size:Xe,sizes:null,slot:null,span:Xe,spellCheck:ys,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Xe,step:null,style:null,tabIndex:Xe,target:null,title:null,translate:null,type:null,typeMustMatch:vt,useMap:null,value:ys,width:Xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nn,axis:null,background:null,bgColor:null,border:Xe,borderColor:null,bottomMargin:Xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vt,declare:vt,event:null,face:null,frame:null,frameBorder:null,hSpace:Xe,leftMargin:Xe,link:null,longDesc:null,lowSrc:null,marginHeight:Xe,marginWidth:Xe,noResize:vt,noHref:vt,noShade:vt,noWrap:vt,object:null,profile:null,prompt:null,rev:null,rightMargin:Xe,rules:null,scheme:null,scrolling:ys,standby:null,summary:null,text:null,topMargin:Xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:vt,disablePictureInPicture:vt,disableRemotePlayback:vt,exportParts:cu,part:Nn,prefix:null,property:null,results:Xe,security:null,unselectable:null},space:"html",transform:nj}),uge=ep({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
937-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:li,accentHeight:Xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Xe,amplitude:Xe,arabicForm:null,ascent:Xe,attributeName:null,attributeType:null,azimuth:Xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Xe,by:null,calcMode:null,capHeight:Xe,className:Nn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Xe,diffuseConstant:Xe,direction:null,display:null,dur:null,divisor:Xe,dominantBaseline:null,download:vt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Xe,enableBackground:null,end:null,event:null,exponent:Xe,externalResourcesRequired:null,fill:null,fillOpacity:Xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:cu,g2:cu,glyphName:cu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Xe,horizOriginX:Xe,horizOriginY:Xe,id:null,ideographic:Xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Xe,k:Xe,k1:Xe,k2:Xe,k3:Xe,k4:Xe,kernelMatrix:li,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 5,499 bytes, lines 937-938
937Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Xe,overlineThickness:Xe,paintOrder:null,panose1:null,path:null,pathLength:Xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Xe,pointsAtY:Xe,pointsAtZ:Xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:li,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:li,rev:li,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:li,requiredFeatures:li,requiredFonts:li,requiredFormats:li,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Xe,specularExponent:Xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Xe,strikethroughThickness:Xe,string:null,stroke:null,strokeDashArray:li,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Xe,strokeOpacity:Xe,strokeWidth:null,style:null,surfaceScale:Xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:li,tabIndex:Xe,tableValues:null,target:null,targetX:Xe,targetY:Xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:li,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Xe,underlineThickness:Xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Xe,values:null,vAlphabetic:Xe,vMathematical:Xe,vectorEffect:null,vHanging:Xe,vIdeographic:Xe,version:null,vertAdvY:Xe,vertOriginX:Xe,vertOriginY:Xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tj}),sj=ep({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rj=ep({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nj}),ij=ep({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dge={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},fge=/[A-Z]/g,C8=/-[a-z]/g,pge=/^data[-\w.:]+$/i;function hge(e,t){const n=wS(t);let s=t,r=Xr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pge.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(C8,gge);s="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!C8.test(i)){let o=i.replace(fge,mge);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}r=d_}return new r(s,t)}function mge(e){return"-"+e.toLowerCase()}function gge(e){return e.charAt(1).toUpperCase()}const Age=ZM([ej,cge,sj,rj,ij],"html"),f_=ZM([ej,uge,sj,rj,ij],"svg");function Ege(e){return e.join(" ").trim()}var Ud={},mb,y8;function xge(){if(y8)return mb;y8=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,u=`
938`,d="/",p="*",g="",A="comment",E="declaration";function x(I,v){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];v=v||{};var S=1,b=1;function w(F){var z=F.match(t);z&&(S+=z.length);var Q=F.lastIndexOf(u);b=~Q?F.length-Q:b+F.length}function _(){var F={line:S,column:b};return function(z){return z.position=new N(F),k(),z}}function N(F){this.start=F,this.end={line:S,column:b},this.source=v.source}N.prototype.content=I;function R(F){var z=new Error(v.source+":"+S+":"+b+": "+F);if(z.reason=F,z.filename=v.source,z.line=S,z.column=b,z.source=I,!v.silent)throw z}function D(F){var z=F.exec(I);if(z){var Q=z[0];return w(Q),I=I.slice(Q.length),z}}function k(){D(n)}function L(F){var z;for(F=F||[];z=O();)z!==!1&&F.push(z);return F}function O(){var F=_();if(!(d!=I.charAt(0)||p!=I.charAt(1))){for(var z=2;g!=I.charAt(z)&&(p!=I.charAt(z)||d!=I.charAt(z+1));)++z;if(z+=2,g===I.charAt(z-1))return R("End of comment missing");var Q=I.slice(2,z-2);return b+=2,w(Q),I=I.slice(z),b+=2,F({type:A,comment:Q})}}function P(){var F=_(),z=D(s);if(z){if(O(),!D(r))return R("property missing ':'");var Q=D(i),M=F({type:E,property:y(z[0].replace(e,g)),value:Q?y(Q[0].replace(e,g)):g});return D(o),M}}function B(){var F=[];L(F);for(var z;z=P();)z!==!1&&(F.push(z),L(F));return F}return k(),B()}function y(I){return I?I.replace(c,g):g}return mb=x,mb}var b8;function Cge(){if(b8)return Ud;b8=1;var e=Ud&&Ud.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.default=n;const t=e(xge());function n(s,r){let i=null;
vendor: 3,623 bytes, line 938
938if(!s||typeof s!="string")return i;const o=(0,t.default)(s),c=typeof r=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:d,value:p}=u;c?r(d,p,u):p&&(i=i||{},i[d]=p)}),i}return Ud}var ah={},I8;function yge(){if(I8)return ah;I8=1,Object.defineProperty(ah,"__esModule",{value:!0}),ah.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,i=function(d){return!d||n.test(d)||e.test(d)},o=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},u=function(d,p){return p===void 0&&(p={}),i(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(r,c):d=d.replace(s,c),d.replace(t,o))};return ah.camelCase=u,ah}var lh,S8;function bge(){if(S8)return lh;S8=1;var e=lh&&lh.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},t=e(Cge()),n=yge();function s(r,i){var o={};return!r||typeof r!="string"||(0,t.default)(r,function(c,u){c&&u&&(o[(0,n.camelCase)(c,i)]=u)}),o}return s.default=s,lh=s,lh}var Ige=bge();const Sge=Am(Ige),oj=aj("end"),p_=aj("start");function aj(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function vge(e){const t=p_(e),n=oj(e);if(t&&n)return{start:t,end:n}}function Ph(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?v8(e.position):"start"in e||"end"in e?v8(e):"line"in e||"column"in e?kS(e):""}function kS(e){return _8(e&&e.line)+":"+_8(e&&e.column)}function v8(e){return kS(e&&e.start)+"-"+kS(e&&e.end)}function _8(e){return e&&typeof e=="number"?e:1}class xr extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let r="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?r=t:!i.cause&&t&&(o=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof s=="string"){const u=s.indexOf(":");u===-1?i.ruleId=s:(i.source=s.slice(0,u),i.ruleId=s.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const c=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=c?c.line:void 0,this.name=Ph(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xr.prototype.file="";xr.prototype.name="";xr.prototype.reason="";xr.prototype.message="";xr.prototype.stack="";xr.prototype.column=void 0;xr.prototype.line=void 0;xr.prototype.ancestors=void 0;xr.prototype.cause=void 0;xr.prototype.fatal=void 0;xr.prototype.place=void 0;xr.prototype.ruleId=void 0;xr.prototype.source=void 0;const h_={}.hasOwnProperty,_ge=new Map,Tge=/[A-Z]/g,Nge=new Set(["table","tbody","thead","tfoot","tr"]),wge=new Set(["td","th"]),lj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Rge(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Bge(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,346 bytes, line 938
938if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=jge(n,t.jsx,t.jsxs)}const r={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?f_:Age,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=cj(r,e,void 0);return i&&typeof i!="string"?i:r.create(e,r.Fragment,{children:i||void 0},void 0)}function cj(e,t,n){if(t.type==="element")return Dge(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return kge(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Pge(e,t,n);if(t.type==="mdxjsEsm")return Oge(e,t);if(t.type==="root")return Lge(e,t,n);if(t.type==="text")return Mge(e,t)}function Dge(e,t,n){const s=e.schema;let r=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(r=f_,e.schema=r),e.ancestors.push(t);const i=dj(e,t.tagName,!1),o=Fge(e,t);let c=g_(e,t);return Nge.has(t.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!age(u):!0})),uj(e,o,i,t),m_(o,c),e.ancestors.pop(),e.schema=s,e.create(t,i,o,n)}function kge(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}cm(e,t.position)}function Oge(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cm(e,t.position)}function Pge(e,t,n){const s=e.schema;let r=s;t.name==="svg"&&s.space==="html"&&(r=f_,e.schema=r),e.ancestors.push(t);const i=t.name===null?e.Fragment:dj(e,t.name,!0),o=Uge(e,t),c=g_(e,t);return uj(e,o,i,t),m_(o,c),e.ancestors.pop(),e.schema=s,e.create(t,i,o,n)}function Lge(e,t,n){const s={};return m_(s,g_(e,t)),e.create(t,e.Fragment,s,n)}function Mge(e,t){return t.value}function uj(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function m_(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jge(e,t,n){return s;function s(r,i,o,c){const d=Array.isArray(o.children)?n:t;return c?d(i,o,c):d(i,o)}}function Bge(e,t){return n;function n(s,r,i,o){const c=Array.isArray(i.children),u=p_(s);return t(r,i,o,c,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Fge(e,t){const n={};let s,r;for(r in t.properties)if(r!=="children"&&h_.call(t.properties,r)){const i=zge(e,r,t.properties[r]);if(i){const[o,c]=i;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&wge.has(t.tagName)?s=c:n[o]=c}}if(s){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function Uge(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const i=s.data.estree.body[0];i.type;const o=i.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else cm(e,t.position);else{const r=s.name;let i;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const c=s.value.data.estree.body[0];c.type,i=e.evaluater.evaluateExpression(c.expression)}else cm(e,t.position);else i=s.value===null?!0:s.value;n[r]=i}return n}function g_(e,t){const n=[];let s=-1;const r=e.passKeys?new Map:_ge;for(;++s<t.children.length;){const i=t.children[s];let o;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const d=r.get(u)||0;o=u+"-"+d,r.set(u,d+1)}}const c=cj(e,i,o);c!==void 0&&n.push(c)}return n}function zge(e,t,n){const s=hge(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?nge(n):Ege(n)),s.property==="style"){let r=typeof n=="object"?n:Qge(e,String(n));return e.stylePropertyNameCase==="css"&&(r=Hge(r)),["style",r]}return[e.elementAttributeNameCase==="react"&&s.space?dge[s.property]||s.property:s.attribute,n]}}function Qge(e,t){try{return Sge(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,r=new xr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=lj+"#cannot-parse-style-attribute",r}}function dj(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const r=t.split(".");let i=-1,o;for(;++i<r.length;){const c=A8(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(i&&c.type==="Literal"),optional:!1}:c}s=o}else s=A8(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const r=s.value;return h_.call(e.components,r)?e.components[r]:r}if(e.evaluater)return e.evaluater.evaluateExpression(s);cm(e)}function cm(e,t){const n=new xr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=lj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Hge(e){const t={};let n;for(n in e)h_.call(e,n)&&(t[Vge(n)]=e[n]);return t}function Vge(e){let t=e.replace(Tge,Gge);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Gge(e){return"-"+e.toLowerCase()}const gb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qge={};function A_(e,t){const n=qge,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return fj(e,s,r)}function fj(e,t,n){if(Wge(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return T8(e.children,t,n)}return Array.isArray(e)?T8(e,t,n):""}function T8(e,t,n){const s=[];let r=-1;for(;++r<e.length;)s[r]=fj(e[r],t,n);return s.join("")}function Wge(e){return!!(e&&typeof e=="object")}const N8=document.createElement("i");function E_(e){const t="&"+e+";";N8.innerHTML=t;const n=N8.textContent;
vendor: 10,920 bytes, line 938
938return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mi(e,t,n,s){const r=e.length;let i=0,o;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,s.length<1e4)o=Array.from(s),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<s.length;)o=s.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Ui(e,t){return e.length>0?(mi(e,e.length,0,t),e):t}const w8={}.hasOwnProperty;function pj(e){const t={};let n=-1;for(;++n<e.length;)Kge(t,e[n]);return t}function Kge(e,t){let n;for(n in t){const r=(w8.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){w8.call(r,o)||(r[o]=[]);const c=i[o];$ge(r[o],Array.isArray(c)?c:c?[c]:[])}}}function $ge(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);mi(e,0,0,s)}function hj(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function go(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sr=xc(/[A-Za-z]/),gr=xc(/[\dA-Za-z]/),Yge=xc(/[#-'*+\--9=?A-Z^-~]/);function m1(e){return e!==null&&(e<32||e===127)}const OS=xc(/\d/),Xge=xc(/[\dA-Fa-f]/),Jge=xc(/[!-/:-@[-`{-~]/);function xt(e){return e!==null&&e<-2}function Pn(e){return e!==null&&(e<0||e===32)}function jt(e){return e===-2||e===-1||e===32}const ME=xc(new RegExp("\\p{P}|\\p{S}","u")),Du=xc(/\s/);function xc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function tp(e){const t=[];let n=-1,s=0,r=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&gr(e.charCodeAt(n+1))&&gr(e.charCodeAt(n+2)))r=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const c=e.charCodeAt(n+1);i<56320&&c>56319&&c<57344?(o=String.fromCharCode(i,c),r=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(s,n),encodeURIComponent(o)),s=n+r+1,o=""),r&&(n+=r,r=0)}return t.join("")+e.slice(s)}function Wt(e,t,n,s){const r=s?s-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(u){return jt(u)?(e.enter(n),c(u)):t(u)}function c(u){return jt(u)&&i++<r?(e.consume(u),c):(e.exit(n),t(u))}}const Zge={tokenize:e0e};function e0e(e){const t=e.attempt(this.parser.constructs.contentInitial,s,r);let n;return t;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Wt(e,t,"linePrefix")}function r(c){return e.enter("paragraph"),i(c)}function i(c){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return xt(c)?(e.consume(c),e.exit("chunkText"),i):(e.consume(c),o)}}const t0e={tokenize:n0e},R8={tokenize:s0e};function n0e(e){const t=this,n=[];let s=0,r,i,o;return c;function c(b){if(s<n.length){const w=n[s];return t.containerState=w[1],e.attempt(w[0].continuation,u,d)(b)}return d(b)}function u(b){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&S();const w=t.events.length;let _=w,N;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){N=t.events[_][1].end;break}v(s);let R=w;for(;R<t.events.length;)t.events[R][1].end={...N},R++;return mi(t.events,_+1,0,t.events.slice(w)),t.events.length=R,d(b)}return c(b)}function d(b){if(s===n.length){if(!r)return A(b);if(r.currentConstruct&&r.currentConstruct.concrete)return x(b);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(R8,p,g)(b)}function p(b){return r&&S(),v(s),A(b)}function g(b){return t.parser.lazy[t.now().line]=s!==n.length,o=t.now().offset,x(b)}function A(b){return t.containerState={},e.attempt(R8,E,x)(b)}function E(b){return s++,n.push([t.currentConstruct,t.containerState]),A(b)}function x(b){if(b===null){r&&S(),v(0),e.consume(b);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),y(b)}function y(b){if(b===null){I(e.exit("chunkFlow"),!0),v(0),e.consume(b);return}return xt(b)?(e.consume(b),I(e.exit("chunkFlow")),s=0,t.interrupt=void 0,c):(e.consume(b),y)}function I(b,w){const _=t.sliceStream(b);if(w&&_.push(null),b.previous=i,i&&(i.next=b),i=b,r.defineSkip(b.start),r.write(_),t.parser.lazy[b.start.line]){let N=r.events.length;for(;N--;)if(r.events[N][1].start.offset<o&&(!r.events[N][1].end||r.events[N][1].end.offset>o))return;const R=t.events.length;let D=R,k,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(k){L=t.events[D][1].end;break}k=!0}for(v(s),N=R;N<t.events.length;)t.events[N][1].end={...L},N++;mi(t.events,D+1,0,t.events.slice(R)),t.events.length=N}}function v(b){let w=n.length;for(;w-- >b;){const _=n[w];t.containerState=_[1],_[0].exit.call(t,e)}n.length=b}function S(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}function s0e(e,t,n){return Wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rf(e){if(e===null||Pn(e)||Du(e))return 1;if(ME(e))return 2}function jE(e,t,n){const s=[];let r=-1;for(;++r<e.length;){const i=e[r].resolveAll;i&&!s.includes(i)&&(t=i(t,n),s.push(i))}return t}const PS={name:"attention",resolveAll:r0e,tokenize:i0e};function r0e(e,t){let n=-1,s,r,i,o,c,u,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[s][1].end},A={...e[n][1].start};D8(g,-u),D8(A,u),o={type:u>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:A},i={type:u>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},r={type:u>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[s][1].end={...o.start},e[n][1].start={...c.end},d=[],e[s][1].end.offset-e[s][1].start.offset&&(d=Ui(d,[["enter",e[s][1],t],["exit",e[s][1],t]])),d=Ui(d,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),d=Ui(d,jE(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),d=Ui(d,[["exit",i,t],["enter",c,t],["exit",c,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=Ui(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,mi(e,s-1,n-s+3,d),n=s+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function i0e(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,r=Rf(s);let i;return o;function o(u){return i=u,e.enter("attentionSequence"),c(u)}function c(u){if(u===i)return e.consume(u),c;const d=e.exit("attentionSequence"),p=Rf(u),g=!p||p===2&&r||n.includes(u),A=!r||r===2&&p||n.includes(s);return d._open=!!(i===42?g:g&&(r||!A)),d._close=!!(i===42?A:A&&(p||!g)),t(u)}}function D8(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const o0e={name:"autolink",tokenize:a0e};function a0e(e,t,n){let s=0;return r;function r(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(E){return Sr(E)?(e.consume(E),o):E===64?n(E):d(E)}function o(E){return E===43||E===45||E===46||gr(E)?(s=1,c(E)):d(E)}function c(E){return E===58?(e.consume(E),s=0,u):(E===43||E===45||E===46||gr(E))&&s++<32?(e.consume(E),c):(s=0,d(E))}function u(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||m1(E)?n(E):(e.consume(E),u)}function d(E){return E===64?(e.consume(E),p):Yge(E)?(e.consume(E),d):n(E)}function p(E){return gr(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),s=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):A(E)}function A(E){if((E===45||gr(E))&&s++<63){const x=E===45?A:g;return e.consume(E),x}return n(E)}}const Jm={partial:!0,tokenize:l0e};function l0e(e,t,n){return s;function s(i){return jt(i)?Wt(e,r,"linePrefix")(i):r(i)}function r(i){return i===null||xt(i)?t(i):n(i)}}const mj={continuation:{tokenize:u0e},exit:d0e,name:"blockQuote",tokenize:c0e};function c0e(e,t,n){const s=this;return r;function r(o){if(o===62){const c=s.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return jt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function u0e(e,t,n){const s=this;return r;function r(o){return jt(o)?Wt(e,i,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(mj,t,n)(o)}}function d0e(e){e.exit("blockQuote")}const gj={name:"characterEscape",tokenize:f0e};function f0e(e,t,n){return s;function s(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),r}function r(i){return Jge(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Aj={name:"characterReference",tokenize:p0e};function p0e(e,t,n){const s=this;let r=0,i,o;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),u}function u(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,o=gr,p(g))}function d(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=Xge,p):(e.enter("characterReferenceValue"),i=7,o=OS,p(g))}function p(g){if(g===59&&r){const A=e.exit("characterReferenceValue");return o===gr&&!E_(s.sliceSerialize(A))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(g)&&r++<i?(e.consume(g),p):n(g)}}const k8={partial:!0,tokenize:m0e},O8={concrete:!0,name:"codeFenced",tokenize:h0e};function h0e(e,t,n){const s=this,r={partial:!0,tokenize:_};let i=0,o=0,c;return u;function u(N){return d(N)}function d(N){const R=s.events[s.events.length-1];return i=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,c=N,e.enter("co
938deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===c?(o++,e.consume(N),p):o<3?n(N):(e.exit("codeFencedFenceSequence"),jt(N)?Wt(e,g,"whitespace")(N):g(N))}function g(N){return N===null||xt(N)?(e.exit("codeFencedFence"),s.interrupt?t(N):e.check(k8,y,w)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),A(N))}function A(N){return N===null||xt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(N)):jt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Wt(e,E,"whitespace")(N)):N===96&&N===c?n(N):(e.consume(N),A)}function E(N){return N===null||xt(N)?g(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||xt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(N)):N===96&&N===c?n(N):(e.consume(N),x)}function y(N){return e.attempt(r,w,I)(N)}function I(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),v}function v(N){return i>0&&jt(N)?Wt(e,S,"linePrefix",i+1)(N):S(N)}function S(N){return N===null||xt(N)?e.check(k8,y,w)(N):(e.enter("codeFlowValue"),b(N))}function b(N){return N===null||xt(N)?(e.exit("codeFlowValue"),S(N)):(e.consume(N),b)}function w(N){return e.exit("codeFenced"),t(N)}function _(N,R,D){let k=0;return L;function L(z){return N.enter("lineEnding"),N.consume(z),N.exit("lineEnding"),O}function O(z){return N.enter("codeFencedFence"),jt(z)?Wt(N,P,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):P(z)}function P(z){return z===c?(N.enter("codeFencedFenceSequence"),B(z)):D(z)}function B(z){return z===c?(k++,N.consume(z),B):k>=o?(N.exit("codeFencedFenceSequence"),jt(z)?Wt(N,F,"whitespace")(z):F(z)):D(z)}function F(z){return z===null||xt(z)?(N.exit("codeFencedFence"),R(z)):D(z)}}}function m0e(e,t,n){const s=this;return r;function r(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return s.parser.lazy[s.now().line]?n(o):t(o)}}const Ab={name:"codeIndented",tokenize:A0e},g0e={partial:!0,tokenize:E0e};function A0e(e,t,n){const s=this;return r;function r(d){return e.enter("codeIndented"),Wt(e,i,"linePrefix",5)(d)}function i(d){const p=s.events[s.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?u(d):xt(d)?e.attempt(g0e,o,u)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||xt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),c)}function u(d){return e.exit("codeIndented"),t(d)}}function E0e(e,t,n){const s=this;return r;function r(o){return s.parser.lazy[s.now().line]?n(o):xt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):Wt(e,i,"linePrefix",5)(o)}function i(o){const c=s.events[s.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):xt(o)?r(o):n(o)}}const x0e={name:"codeText",previous:y0e,resolve:C0e,tokenize:b0e};function C0e(e){let t=e.length-4,n=3,s,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)r===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(r=s):(s===t||e[s][1].type==="lineEnding")&&(e[r][1].type="codeTextData",s!==r+2&&(e[r][1].end=e[s-1][1].end,e.splice(r+2,s-r-2),t-=s-r-2,s=r+2),r=void 0);return e}function y0e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function b0e(e,t,n){let s=0,r,i;return o;function o(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),s++,c):(e.exit("codeTextSequence"),u(g))}function u(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),u):g===96?(i=e.enter("codeTextSequence"),r=0,p(g)):xt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(g))}function d(g){return g===null||g===32||g===96||xt(g)?(e.exit("codeTextData"),u(g)):(e.consume(g),d)}function p(g){return g===96?(e.consume(g),r++,p):r===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(i.type="codeTextData",d(g))}}class I0e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const r=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return s&&ch(this.left,s),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ch(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ch(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ch(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ch(this.left,n.reverse())}}}function ch(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ej(e){const t={};let n=-1,s,r,i,o,c,u,d;const p=new I0e(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(s=p.get(n),n&&s[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(u=s[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,S0e(p,n)),n=t[n],d=!0);else if(s[1]._container){for(i=n,r=void 0;i--;)if(o=p.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(p.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(s[1].end={...p.get(r)[1].start},c=p.slice(r,n),c.unshift(s),p.splice(r,n-r+1,c))}}return mi(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function S0e(e,t){const n=e.get(t)[1],s=e.get(t)[2];let r=t-1;const i=[];let o=n._tokenizer;o||(o=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,u=[],d={};let p,g,A=-1,E=n,x=0,y=0;const I=[y];for(;E;){for(;e.get(++r)[1]!==E;);i.push(r),E._tokenizer||(p=s.sliceStream(E),E.next||p.push(null),g&&o.defineSki
vendor: 22,839 bytes, line 938
938p(E.start),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),E._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++A<c.length;)c[A][0]==="exit"&&c[A-1][0]==="enter"&&c[A][1].type===c[A-1][1].type&&c[A][1].start.line!==c[A][1].end.line&&(y=A+1,I.push(y),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(o.events=[],E?(E._tokenizer=void 0,E.previous=void 0):I.pop(),A=I.length;A--;){const v=c.slice(I[A],I[A+1]),S=i.pop();u.push([S,S+v.length-1]),e.splice(S,2,v)}for(u.reverse(),A=-1;++A<u.length;)d[x+u[A][0]]=x+u[A][1],x+=u[A][1]-u[A][0]-1;return d}const v0e={resolve:T0e,tokenize:N0e},_0e={partial:!0,tokenize:w0e};function T0e(e){return Ej(e),e}function N0e(e,t){let n;return s;function s(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(c)}function r(c){return c===null?i(c):xt(c)?e.check(_0e,o,i)(c):(e.consume(c),r)}function i(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function w0e(e,t,n){const s=this;return r;function r(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Wt(e,i,"linePrefix")}function i(o){if(o===null||xt(o))return n(o);const c=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(s.parser.constructs.flow,n,t)(o)}}function xj(e,t,n,s,r,i,o,c,u){const d=u||Number.POSITIVE_INFINITY;let p=0;return g;function g(v){return v===60?(e.enter(s),e.enter(r),e.enter(i),e.consume(v),e.exit(i),A):v===null||v===32||v===41||m1(v)?n(v):(e.enter(s),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),y(v))}function A(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),e.exit(s),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(v))}function E(v){return v===62?(e.exit("chunkString"),e.exit(c),A(v)):v===null||v===60||xt(v)?n(v):(e.consume(v),v===92?x:E)}function x(v){return v===60||v===62||v===92?(e.consume(v),E):E(v)}function y(v){return!p&&(v===null||v===41||Pn(v))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(s),t(v)):p<d&&v===40?(e.consume(v),p++,y):v===41?(e.consume(v),p--,y):v===null||v===32||v===40||m1(v)?n(v):(e.consume(v),v===92?I:y)}function I(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function Cj(e,t,n,s,r,i){const o=this;let c=0,u;return d;function d(E){return e.enter(s),e.enter(r),e.consume(E),e.exit(r),e.enter(i),p}function p(E){return c>999||E===null||E===91||E===93&&!u||E===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(E):E===93?(e.exit(i),e.enter(r),e.consume(E),e.exit(r),e.exit(s),t):xt(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||xt(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),u||(u=!jt(E)),E===92?A:g)}function A(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function yj(e,t,n,s,r,i){let o;return c;function c(A){return A===34||A===39||A===40?(e.enter(s),e.enter(r),e.consume(A),e.exit(r),o=A===40?41:A,u):n(A)}function u(A){return A===o?(e.enter(r),e.consume(A),e.exit(r),e.exit(s),t):(e.enter(i),d(A))}function d(A){return A===o?(e.exit(i),u(o)):A===null?n(A):xt(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Wt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===o||A===null||xt(A)?(e.exit("chunkString"),d(A)):(e.consume(A),A===92?g:p)}function g(A){return A===o||A===92?(e.consume(A),p):p(A)}}function Lh(e,t){let n;return s;function s(r){return xt(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,s):jt(r)?Wt(e,s,n?"linePrefix":"lineSuffix")(r):t(r)}}const R0e={name:"definition",tokenize:k0e},D0e={partial:!0,tokenize:O0e};function k0e(e,t,n){const s=this;let r;return i;function i(E){return e.enter("definition"),o(E)}function o(E){return Cj.call(s,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return r=go(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u):n(E)}function u(E){return Pn(E)?Lh(e,d)(E):d(E)}function d(E){return xj(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(D0e,g,g)(E)}function g(E){return jt(E)?Wt(e,A,"whitespace")(E):A(E)}function A(E){return E===null||xt(E)?(e.exit("definition"),s.parser.defined.push(r),t(E)):n(E)}}function O0e(e,t,n){return s;function s(c){return Pn(c)?Lh(e,r)(c):n(c)}function r(c){return yj(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function i(c){return jt(c)?Wt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||xt(c)?t(c):n(c)}}const P0e={name:"hardBreakEscape",tokenize:L0e};function L0e(e,t,n){return s;function s(i){return e.enter("hardBreakEscape"),e.consume(i),r}function r(i){return xt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const M0e={name:"headingAtx",resolve:j0e,tokenize:B0e};function j0e(e,t){let n=e.length-2,s=3,r,i;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(r={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},i={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},mi(e,s,n-s+1,[["enter",r,t],["enter",i,t],["exit",i,t],["exit",r,t]])),e}function B0e(e,t,n){let s=0;return r;function r(p){return e.enter("atxHeading"),i(p)}function i(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&s++<6?(e.consume(p),o):p===null||Pn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||xt(p)?(e.exit("atxHeading"),t(p)):jt(p)?Wt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||Pn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),d)}}const F0e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],P8=["pre","script","style","textarea"],U0e={concrete:!0,name:"htmlFlow",resolveTo:H0e,tokenize:V0e},z0e={partial:!0,tokenize:q0e},Q0e={partial:!0,tokenize:G0e};function H0e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function V0e(e,t,n){const s=this;let r,i,o,c,u;return d;function d(G){return p(G)}function p(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),g}function g(G){return G===33?(e.consume(G),A):G===47?(e.consume(G),i=!0,y):G===63?(e.consume(G),r=3,s.interrupt?t:H):Sr(G)?(e.consume(G),o=String.fromCharCode(G),I):n(G)}function A(G){return G===45?(e.consume(G),r=2,E):G===91?(e.consume(G),r=5,c=0,x):Sr(G)?(e.consume(G),r=4,s.interrupt?t:H):n(G)}function E(G){return G===45?(e.consume(G),s.interrupt?t:H):n(G)}function x(G){const $="CDATA[";return G===$.charCodeAt(c++)?(e.consume(G),c===$.length?s.interrupt?t:P:x):n(G)}function y(G){return Sr(G)?(e.consume(G),o=String.fromCharCode(G),I):n(G)}function I(G){if(G===null||G===47||G===62||Pn(G)){const $=G===47,J=o.toLowerCase();return!$&&!i&&P8.includes(J)?(r=1,s.interrupt?t(G):P(G)):F0e.includes(o.toLowerCase())?(r=6,$?(e.consume(G),v):s.interrupt?t(G):P(G)):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(G):i?S(G):b(G))}return G===45||gr(G)?(e.consume(G),o+=String.fromCharCode(G),I):n(G)}function v(G){return G===62?(e.consume(G),s.interrupt?t:P):n(G)}function S(G){return jt(G)?(e.consume(G),S):L(G)}function b(G){return G===47?(e.consume(G),L):G===58||G===95||Sr(G)?(e.consume(G),w):jt(G)?(e.consume(G),b):L(G)}function w(G){return G===45||G===46||G===58||G===95||gr(G)?(e.consume(G),w):_(G)}function _(G){return G===61?(e.consume(G),N):jt(G)?(e.consume(G),_):b(G)}function N(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),u=G,R):jt(G)?(e.consume(G),N):D(G)}function R(G){return G===u?(e.consume(G),u=null,k):G===null||xt(G)?n(G):(e.consume(G),R)}function D(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Pn(G)?_(G):(e.consume(G),D)}function k(G){return G===47||G===62||jt(G)?b(G):n(G)}function L(G){return G===62?(e.consume(G),O):n(G)}function O(G){return G===null||xt(G)?P(G):jt(G)?(e.consume(G),O):n(G)}function P(G){return G===45&&r===2?(e.consume(G),Q):G===60&&r===1?(e.consume(G),M):G===62&&r===4?(e.consume(G),j):G===63&&r===3?(e.consume(G),H):G===93&&r===5?(e.consume(G),W):xt(G)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(z0e,q,B)(G)):G===null||xt(G)?(e.exit("htmlFlowData"),B(G)):(e.consume(G),P)}function B(G){return e.check(Q0e,F,q)(G)}function F(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),z}function z(G){return G===null||xt(G)?B(G):(e.enter("htmlFlowData"),P(G))}function Q(G){return G===45?(e.consume(G),H):P(G)}function M(G){return G===47?(e.consume(G),o="",K):P(G)}function K(G){if(G===62){const $=o.toLowerCase();return P8.includes($)?(e.consume(G),j):P(G)}return Sr(G)&&o.length<8?(e.consume(G),o+=String.fromCharCode(G),K):P(G)}function W(G){return G===93?(e.consume(G),H):P(G)}function H(G){return G===62?(e.consume(G),j):G===45&&r===2?(e.consume(G),H):P(G)}function j(G){return G===null||xt(G)?(e.exit("htmlFlowData"),q(G)):(e.consume(G),j)}function q(G){return e.exit("htmlFlow"),t(G)}}function G0e(e,t,n){const s=this;return r;function r(o){return xt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return s.parser.lazy[s.now().line]?n(o):t(o)}}function q0e(e,t,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(Jm,t,n)}}const W0e={name:"htmlText",tokenize:K0e};function K0e(e,t,n){const s=this;let r,i,o;return c;function c(H){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(H),u}function u(H){return H===33?(e.consume(H),d):H===47?(e.consume(H),_):H===63?(e.consume(H),b):Sr(H)?(e.consume(H),D):n(H)}function d(H){return H===45?(e.consume(H),p):H===91?(e.consume(H),i=0,x):Sr(H)?(e.consume(H),S):n(H)}function p(H){return H===45?(e.consume(H),E):n(H)}function g(H){return H===null?n(H):H===45?(e.consume(H),A):xt(H)?(o=g,M(H)):(e.consume(H),g)}function A(H){return H===45?(e.consume(H),E):g(H)}function E(H){return H===62?Q(H):H===45?A(H):g(H)}function x(H){const j="CDATA[";return H===j.charCodeAt(i++)?(e.consume(H),i===j.length?y:x):n(H)}function y(H){return H===null?n(H):H===93?(e.consume(H),I):xt(H)?(o=y,M(H)):(e.consume(H),y)}function I(H){return H===93?(e.consume(H),v):y(H)}function v(H){return H===62?Q(H):H===93?(e.consume(H),v):y(H)}function S(H){return H===null||H===62?Q(H):xt(H)?(o=S,M(H)):(e.consume(H),S)}function b(H){return H===null?n(H):H===63?(e.consume(H),w):xt(H)?(o=b,M(H)):(e.consume(H),b)}function w(H){return H===62?Q(H):b(H)}function _(H){return Sr(H)?(e.consume(H),N):n(H)}function N(H){return H===45||gr(H)?(e.consume(H),N):R(H)}function R(H){return xt(H)?(o=R,M(H)):jt(H)?(e.consume(H),R):Q(H)}function D(H){return H===45||gr(H)?(e.consume(H),D):H===47||H===62||Pn(H)?k(H):n(H)}function k(H){return H===47?(e.consume(H),Q):H===58||H===95||Sr(H)?(e.consume(H),L):xt(H)?(o=k,M(H)):jt(H)?(e.consume(H),k):Q(H)}function L(H){return H===45||H===46||H===58||H===95||gr(H)?(e.consume(H),L):O(H)}function O(H){return H===61?(e.consume(H),P):xt(H)?(o=O,M(H)):jt(H)?(e.consume(H),O):k(H)}function P(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),r=H,B):xt(H)?(o=P,M(H)):jt(H)?(e.consume(H),P):(e.consume(H),F)}function B(H){return H===r?(e.consume(H),r=void 0,z):H===null?n(H):xt(H)?(o=B,M(H)):(e.consume(H),B)}function F(H){return H===null||H===34||H===39||H===60||H===61||H===96?n(H):H===47||H===62||Pn(H)?k(H):(e.consume(H),F)}function z(H){return H===47||H===62||Pn(H)?k(H):n(H)}function Q(H){return H===62?(e.consume(H),e.exit("htmlTextData"),e.exit("htmlText"),t):n(H)}function M(H){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),K}function K(H){return jt(H)?Wt(e,W,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):W(H)}function W(H){return e.enter("htmlTextData"),o(H)}}const x_={name:"labelEnd",resolveAll:J0e,resolveTo:Z0e,tokenize:eAe},$0e={tokenize:tAe},Y0e={tokenize:nAe},X0e={tokenize:sAe};function J0e(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const r=s.type==="labelImage"?4:2;s.type="data",t+=r}}return e.length!==n.length&&mi(e,0,e.length,n),e}function Z0e(e,t){let n=e.length,s=0,r,i,o,c;for(;n--;)if(r=e[n][1],i){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(i=n,r.type!=="labelLink")){s=2;break}}else r.type==="labelEnd"&&(o=n);const u={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[i+s+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",u,t],["enter",d,t]],c=Ui(c,e.slice(i+1,i+s+3)),c=Ui(c,[["enter",p,t]]),c=Ui(c,jE(t.parser.constructs.insideSpan.null,e.slice(i+s+4,o-3),t)),c=Ui(c,[["exit",p,t],e[o-2],e[o-1],["exit",d,t]]),c=Ui(c,e.slice(o+1)),c=Ui(c,[["exit",u,t]]),mi(e,i,e.length,c),e}function eAe(e,t,n){const s=this;let r=s.events.length,i,o;for(;r--;)if((s.events[r][1].type==="labelImage"||s.events[r][1].type==="labelLink")&&!s.events[r][1]._balanced){i=s.events[r][1];break}return c;function c(A){return i?i._inactive?g(A):(o=s.parser.defined.includes(go(s.sliceSerialize({start:i.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(A),e.exit("labelMarker"),e.exit("labelEnd"),u):n(A)}function u(A){return A===40?e.attempt($0e,p,o?p:g)(A):A===91?e.attempt(Y0e,p,o?d:g)(A):o?p(A):g(A)}function d(A){return e.attempt(X0e,p,g)(A)}function p(A){return t(A)}function g(A){return i._balanced=!0,n(A)}}function tAe(e,t,n){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),r}function r(g){return Pn(g)?Lh(e,i)(g):i(g)}function i(g){return g===41?p(g):xj(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function o(g){return Pn(g)?Lh(e,u)(g):p(g)}function c(g){return n(g)}function u(g){return g===34||g===39||g===40?yj(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function d(g){return Pn(g)?Lh(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function nAe(e,t,n){const s=this;return r;function r(c){return Cj.call(s,e,i,o,"reference","referenceMarker","referenceString")(c)}function i(c){return s.parser.defined.includes(go(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function sAe(e,t,n){return s;function s(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),r}function r(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const rAe={name:"labelStartImage",resolveAll:x_.resolveAll,tokenize:iAe};function iAe(e,t,n){const s=this;return r;function r(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),i}function i(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const oAe={name:"labelStartLink",resolveAll:x_.resolveAll,tokenize:aAe};function aAe(e,t,n){const s=this;return r;function r(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(o):t(o)}}const Eb={name:"lineEnding",tokenize:lAe};function lAe(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const bA={name:"thematicBreak",tokenize:cAe};function cAe(e,t,n){let s=0,r;return i;function i(d){return e.enter("thematicBreak"),o(d)}function o(d){return r=d,c(d)}function c(d){return d===r?(e.enter("thematicBreakSequence"),u(d)):s>=3&&(d===null||xt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function u(d){return d===r?(e.consume(d),s++,u):(e.exit("thematicBreakSequence"),jt(d)?Wt(e,c,"whitespace")(d):c(d))}}const zr={continuation:{tokenize:pAe},exit:mAe,name:"list",tokenize:fAe},uAe={partial:!0,tokenize:gAe},dAe={partial:!0,tokenize:hAe};function fAe(e,t,n){const s=this,r=s.events[s.events.length-1];let i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return c;function c(E){const x=s.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!s.containerState.marker||E===s.containerState.marker:OS(E)){if(s.containerState.type||(s.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(bA,n,d)(E):d(E);if(!s.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(E)}return n(E)}function u(E){return OS(E)&&++o<10?(e.consume(E),u):(!s.interrupt||o<2)&&(s.containerState.marker?E===s.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),d(E)):n(E)}function d(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||E,e.check(Jm,s.interrupt?n:p,e.attempt(uAe,A,g))}function p(E){return s.containerState.initialBlankLine=!0,i++,A(E)}function g(E){return jt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),A):n(E)}function A(E){return s.containerState.size=i+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function pAe(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Jm,r,i);function r(c){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Wt(e,t,"listItemIndent",s.containerState.size+1)(c)}function i(c){return s.containerState.furtherBlankLines||!jt(c)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,o(c)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(dAe,t,o)(c))}function o(c){return s.containerState._closeFlow=!0,s.interrupt=void 0,Wt(e,e.attempt(zr,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function hAe(e,t,n){const s=this;return Wt(e,r,"listItemIndent",s.containerState.size+1);function r(i){const o=s.events[s.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===s.containerState.size?t(i):n(i)}}function mAe(e){e.exit(this.containerState.type)}function gAe(e,t,n){const s=this;return Wt(e,r,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(i){const o=s.events[s.events.length-1];return!jt(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const L8={name:"setextUnderline",resolveTo:AAe,tokenize:EAe};function AAe(e,t){let n=e.length,s,r,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[s][1],t]),e[s][1].end={...e[i][1].end}):e[s][1]=o,e.push(["exit",o,t]),e}function EAe(e,t,n){const s=this;let r;return i;function i(d){let p=s.events.length,g;for(;p--;)if(s.events[p][1].type!=="lineEnding"&&s.events[p][1].type!=="linePrefix"&&s.events[p][1].type!=="content"){g=s.events[p][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),r=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===r?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),jt(d)?Wt(e,u,"lineSuffix")(d):u(d))}function u(d){return d===null||xt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const xAe={tokenize:CAe};function CAe(e){const t=this,n=e.attempt(Jm,s,e.attempt(this.parser.constructs.flowInitial,r,Wt(e,e.attempt(this.parser.constructs.flow,r,e.attempt(v0e,r)),"linePrefix")));return n;function s(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const yAe={resolveAll:Ij()},bAe=bj("string"),IAe=bj("text");function bj(e){return{resolveAll:Ij(e==="text"?SAe:void 0),tokenize:t};function t(n){const s=this,r=this.parser.constructs[e],i=n.attempt(r,o,c);return o;function o(p){return d(p)?i(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return d(p)?(n.exit("data"),i(p)):(n.consume(p),u)}function d(p){if(p===null)return!0;const g=r[p];let A=-1;if(g)for(;++A<g.length;){const E=g[A];if(!E.previous||E.previous.call(s,s.previous))return!0}return!1}}}function Ij(e){return t;function t(n,s){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(n,s):n}}function SAe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const s=e[n-1][1],r=t.sliceStream(s);let i=r.length,o=-1,c=0,u;for(;i--;){const d=r[i];
vendor: 4,947 bytes, lines 938-940
938if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(d===-2)u=!0,c++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:s.start._bufferIndex+o,_index:s.start._index+i,line:s.end.line,column:s.end.column-c,offset:s.end.offset-c},end:{...s.end}};s.end={...d.start},s.start.offset===s.end.offset?Object.assign(s,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const vAe={42:zr,43:zr,45:zr,48:zr,49:zr,50:zr,51:zr,52:zr,53:zr,54:zr,55:zr,56:zr,57:zr,62:mj},_Ae={91:R0e},TAe={[-2]:Ab,[-1]:Ab,32:Ab},NAe={35:M0e,42:bA,45:[L8,bA],60:U0e,61:L8,95:bA,96:O8,126:O8},wAe={38:Aj,92:gj},RAe={[-5]:Eb,[-4]:Eb,[-3]:Eb,33:rAe,38:Aj,42:PS,60:[o0e,W0e],91:oAe,92:[P0e,gj],93:x_,95:PS,96:x0e},DAe={null:[PS,yAe]},kAe={null:[42,95]},OAe={null:[]},PAe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kAe,contentInitial:_Ae,disable:OAe,document:vAe,flow:NAe,flowInitial:TAe,insideSpan:DAe,string:wAe,text:RAe},Symbol.toStringTag,{value:"Module"}));function LAe(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},i=[];let o=[],c=[];const u={attempt:R(_),check:R(N),consume:S,enter:b,exit:w,interrupt:R(N,{interrupt:!0})},d={code:null,containerState:{},defineSkip:y,events:[],now:x,parser:e,previous:null,sliceSerialize:A,sliceStream:E,write:g};let p=t.tokenize.call(d,u);return t.resolveAll&&i.push(t),d;function g(O){return o=Ui(o,O),I(),o[o.length-1]!==null?[]:(D(t,0),d.events=jE(i,d.events,d),d.events)}function A(O,P){return jAe(E(O),P)}function E(O){return MAe(o,O)}function x(){const{_bufferIndex:O,_index:P,line:B,column:F,offset:z}=s;return{_bufferIndex:O,_index:P,line:B,column:F,offset:z}}function y(O){r[O.line]=O.column,L()}function I(){let O;for(;s._index<o.length;){const P=o[s._index];if(typeof P=="string")for(O=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===O&&s._bufferIndex<P.length;)v(P.charCodeAt(s._bufferIndex));else v(P)}}function v(O){p=p(O)}function S(O){xt(O)?(s.line++,s.column=1,s.offset+=O===-3?2:1,L()):O!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===o[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=O}function b(O,P){const B=P||{};return B.type=O,B.start=x(),d.events.push(["enter",B,d]),c.push(B),B}function w(O){const P=c.pop();return P.end=x(),d.events.push(["exit",P,d]),P}function _(O,P){D(O,P.from)}function N(O,P){P.restore()}function R(O,P){return B;function B(F,z,Q){let M,K,W,H;return Array.isArray(F)?q(F):"tokenize"in F?q([F]):j(F);function j(ne){return X;function X(oe){const ie=oe!==null&&ne[oe],ee=oe!==null&&ne.null,te=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return q(te)(oe)}}function q(ne){return M=ne,K=0,ne.length===0?Q:G(ne[K])}function G(ne){return X;function X(oe){return H=k(),W=ne,ne.partial||(d.currentConstruct=ne),ne.name&&d.parser.constructs.disable.null.includes(ne.name)?J():ne.tokenize.call(P?Object.assign(Object.create(d),P):d,u,$,J)(oe)}}function $(ne){return O(W,H),z}function J(ne){return H.restore(),++K<M.length?G(M[K]):Q}}}function D(O,P){O.resolveAll&&!i.includes(O)&&i.push(O),O.resolve&&mi(d.events,P,d.events.length-P,O.resolve(d.events.slice(P),d)),O.resolveTo&&(d.events=O.resolveTo(d.events,d))}function k(){const O=x(),P=d.previous,B=d.currentConstruct,F=d.events.length,z=Array.from(c);return{from:F,restore:Q};function Q(){s=O,d.previous=P,d.currentConstruct=B,d.events.length=F,c=z,L()}}function L(){s.line in r&&s.column<2&&(s.column=r[s.line],s.offset+=r[s.line]-1)}}function MAe(e,t){const n=t.start._index,s=t.start._bufferIndex,r=t.end._index,i=t.end._bufferIndex;let o;if(n===r)o=[e[n].slice(s,i)];else{if(o=e.slice(n,r),s>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(s):o.shift()}i>0&&o.push(e[r].slice(0,i))}return o}function jAe(e,t){let n=-1;const s=[];let r;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
939`;break}case-3:{o=`\r
940`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&r)continue;o=" ";break}default:o=String.fromCharCode(i)}r=i===-2,s.push(o)}return s.join("")}function BAe(e){const s={constructs:pj([PAe,...(e||{}).extensions||[]]),content:r(Zge),defined:[],document:r(t0e),flow:r(xAe),lazy:{},string:r(bAe),text:r(IAe)};return s;function r(i){return o;function o(c){return LAe(s,i,c)}}}function FAe(e){for(;!Ej(e););return e}const M8=/[\0\t\n\r]/g;function UAe(){let e=1,t="",n=!0,s;return r;function r(i,o,c){const u=[];let d,p,g,A,E;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),g=0,t="",n&&(i.charCodeAt(0)===65279&&g++,n=void 0);g<i.length;){if(M8.lastIndex=g,d=M8.exec(i),A=d&&d.index!==void 0?d.index:i.length,E=i.charCodeAt(A),!d){t=i.slice(g);break}if(E===10&&g===A&&s)u.push(-3),s=void 0;
vendor: 8,970 bytes, line 940
940else switch(s&&(u.push(-5),s=void 0),g<A&&(u.push(i.slice(g,A)),e+=A-g),E){case 0:{u.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,u.push(-2);e++<p;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:s=!0,e=1}g=A+1}return c&&(s&&u.push(-5),t&&u.push(t),u.push(null)),u}}const zAe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function QAe(e){return e.replace(zAe,HAe)}function HAe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),i=r===120||r===88;return hj(n.slice(i?2:1),i?16:10)}return E_(n)||e}const Sj={}.hasOwnProperty;function VAe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),GAe(n)(FAe(BAe(n).document().write(UAe()(e,t,!0))))}function GAe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(re),autolinkProtocol:k,autolinkEmail:k,atxHeading:i(ue),blockQuote:i(ee),characterEscape:k,characterReference:k,codeFenced:i(te),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(te,o),codeText:i(le,o),codeTextData:k,data:k,codeFlowValue:k,definition:i(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(fe),hardBreakEscape:i(ye),hardBreakTrailing:i(ye),htmlFlow:i(ce,o),htmlFlowData:k,htmlText:i(ce,o),htmlTextData:k,image:i(xe),label:o,link:i(re),listItem:i(_e),listItemValue:A,listOrdered:i(pe,g),listUnordered:i(pe),paragraph:i(Le),reference:G,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(ue),strong:i(Ee),thematicBreak:i(me)},exit:{atxHeading:u(),atxHeadingSequence:_,autolink:u(),autolinkEmail:ie,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ne,characterReference:X,codeFenced:u(I),codeFencedFence:y,codeFencedFenceInfo:E,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:u(v),codeText:u(z),codeTextData:L,data:L,definition:u(),definitionDestinationString:w,definitionLabelString:S,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(P),hardBreakTrailing:u(P),htmlFlow:u(B),htmlFlowData:L,htmlText:u(F),htmlTextData:L,image:u(M),label:W,labelText:K,lineEnding:O,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:$,resourceDestinationString:H,resourceTitleString:j,resource:q,setextHeading:u(D),setextHeadingLineSequence:R,setextHeadingText:N,strong:u(),thematicBreak:u()}};vj(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(de){let ge={type:"root",children:[]};const Pe={stack:[ge],tokenStack:[],config:t,enter:c,exit:d,buffer:o,resume:p,data:n},Ue=[];let Be=-1;for(;++Be<de.length;)if(de[Be][1].type==="listOrdered"||de[Be][1].type==="listUnordered")if(de[Be][0]==="enter")Ue.push(Be);else{const nt=Ue.pop();Be=r(de,nt,Be)}for(Be=-1;++Be<de.length;){const nt=t[de[Be][0]];Sj.call(nt,de[Be][1].type)&&nt[de[Be][1].type].call(Object.assign({sliceSerialize:de[Be][2].sliceSerialize},Pe),de[Be][1])}if(Pe.tokenStack.length>0){const nt=Pe.tokenStack[Pe.tokenStack.length-1];(nt[1]||j8).call(Pe,void 0,nt[0])}for(ge.position={start:Gl(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:Gl(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)ge=t.transforms[Be](ge)||ge;return ge}function r(de,ge,Pe){let Ue=ge-1,Be=-1,nt=!1,At,ht,dt,Gt;for(;++Ue<=Pe;){const ft=de[Ue];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?Be++:Be--,Gt=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(At&&!Gt&&!Be&&!dt&&(dt=Ue),Gt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gt=void 0}if(!Be&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||Be===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(At){let _n=Ue;for(ht=void 0;_n--;){const Cn=de[_n];if(Cn[1].type==="lineEnding"||Cn[1].type==="lineEndingBlank"){if(Cn[0]==="exit")continue;ht&&(de[ht][1].type="lineEndingBlank",nt=!0),Cn[1].type="lineEnding",ht=_n}else if(!(Cn[1].type==="linePrefix"||Cn[1].type==="blockQuotePrefix"||Cn[1].type==="blockQuotePrefixWhitespace"||Cn[1].type==="blockQuoteMarker"||Cn[1].type==="listItemIndent"))break}dt&&(!ht||dt<ht)&&(At._spread=!0),At.end=Object.assign({},ht?de[ht][1].start:ft[1].end),de.splice(ht||Ue,0,["exit",At,ft[2]]),Ue++,Pe++}if(ft[1].type==="listItemPrefix"){const _n={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};At=_n,de.splice(Ue,0,["enter",_n,ft[2]]),Ue++,Pe++,dt=void 0,Gt=!0}}}return de[ge][1]._spread=nt,Pe}function i(de,ge){return Pe;function Pe(Ue){c.call(this,de(Ue),Ue),ge&&ge.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(de,ge,Pe){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([ge,Pe||void 0]),de.position={start:Gl(ge.start),end:void 0}}function u(de){return ge;function ge(Pe){de&&de.call(this,Pe),d.call(this,Pe)}}function d(de,ge){const Pe=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==de.type&&(ge?ge.call(this,de,Ue[0]):(Ue[1]||j8).call(this,de,Ue[0]));else throw new Error("Cannot close `"+de.type+"` ("+Ph({start:de.start,end:de.end})+"): it’s not open");Pe.position.end=Gl(de.end)}function p(){return A_(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function A(de){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function E(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=de}function x(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=de}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.value=de.replace(/(\r?\n|\r)$/g,"")}function S(de){const ge=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ge,Pe.identifier=go(this.sliceSerialize(de)).toLowerCase()}function b(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.title=de}function w(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.url=de}function _(de){const ge=this.stack[this.stack.length-1];if(!ge.depth){const Pe=this.sliceSerialize(de).length;ge.depth=Pe}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function R(de){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function k(de){const Pe=this.stack[this.stack.length-1].children;let Ue=Pe[Pe.length-1];(!Ue||Ue.type!=="text")&&(Ue=se(),Ue.position={start:Gl(de.start),end:void 0},Pe.push(Ue)),this.stack.push(Ue)}function L(de){const ge=this.stack.pop();ge.value+=this.sliceSerialize(de),ge.position.end=Gl(de.end)}function O(de){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ge.children[ge.children.length-1];Pe.position.end=Gl(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(k.call(this,de),L.call(this,de))}function P(){this.data.atHardBreak=!0}function B(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.value=de}function F(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.value=de}function z(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.value=de}function Q(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=ge,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function M(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=ge,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function K(de){const ge=this.sliceSerialize(de),Pe=this.stack[this.stack.length-2];Pe.label=QAe(ge),Pe.identifier=go(ge).toLowerCase()}function W(){const de=this.stack[this.stack.length-1],ge=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const Ue=de.children;Pe.children=Ue}else Pe.alt=ge}function H(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.url=de}function j(){const de=this.resume(),ge=this.stack[this.stack.length-1];ge.title=de}function q(){this.data.inReference=void 0}function G(){this.data.referenceType="collapsed"}function $(de){const ge=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ge,Pe.identifier=go(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}
vendor: 9,904 bytes, lines 940-944
940function J(de){this.data.characterReferenceType=de.type}function ne(de){const ge=this.sliceSerialize(de),Pe=this.data.characterReferenceType;let Ue;Pe?(Ue=hj(ge,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=E_(ge);const Be=this.stack[this.stack.length-1];Be.value+=Ue}function X(de){const ge=this.stack.pop();ge.position.end=Gl(de.end)}function oe(de){L.call(this,de);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(de)}function ie(de){L.call(this,de);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(de)}function ee(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function le(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function fe(){return{type:"emphasis",children:[]}}function ue(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function ce(){return{type:"html",value:""}}function xe(){return{type:"image",title:null,url:"",alt:null}}function re(){return{type:"link",title:null,url:"",children:[]}}function pe(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function _e(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function Le(){return{type:"paragraph",children:[]}}function Ee(){return{type:"strong",children:[]}}function se(){return{type:"text",value:""}}function me(){return{type:"thematicBreak"}}}function Gl(e){return{line:e.line,column:e.column,offset:e.offset}}function vj(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?vj(e,s):qAe(e,s)}}function qAe(e,t){let n;for(n in t)if(Sj.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function j8(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ph({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ph({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ph({start:t.start,end:t.end})+") is still open")}function WAe(e){const t=this;t.parser=n;function n(s){return VAe(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KAe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function $Ae(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
941`}]}function YAe(e,t){const n=t.value?t.value+`
942`:"",s={},r=t.lang?t.lang.split(/\s+/):[];r.length>0&&(s.className=["language-"+r[0]]);let i={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function XAe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JAe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZAe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),r=tp(s.toLowerCase()),i=e.footnoteOrder.indexOf(s);let o,c=e.footnoteCounts.get(s);c===void 0?(c=0,e.footnoteOrder.push(s),o=e.footnoteOrder.length):o=i+1,c+=1,e.footnoteCounts.set(s,c);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const d={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,d),e.applyData(t,d)}function e1e(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t1e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _j(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const r=e.all(t),i=r[0];i&&i.type==="text"?i.value="["+i.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=s:r.push({type:"text",value:s}),r}function n1e(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return _j(e,t);const r={src:tp(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function s1e(e,t){const n={src:tp(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function r1e(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function i1e(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return _j(e,t);const r={href:tp(s.url||"")};s.title!==null&&s.title!==void 0&&(r.title=s.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function o1e(e,t){const n={href:tp(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function a1e(e,t,n){const s=e.all(t),r=n?l1e(n):Tj(t),i={},o=[];if(typeof t.checked=="boolean"){const p=s[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let c=-1;for(;++c<s.length;){const p=s[c];(r||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
943`}),p.type==="element"&&p.tagName==="p"&&!r?o.push(...p.children):o.push(p)}const u=s[s.length-1];u&&(r||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
944`});const d={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,d),e.applyData(t,d)}function l1e(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=Tj(n[s])}return t}function Tj(e){const t=e.spread;return t??e.children.length>1}function c1e(e,t){const n={},s=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r<s.length;){const o=s[r];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function u1e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d1e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function f1e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p1e(e,t){const n=e.all(t),s=n.shift(),r=[];if(s){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],o),r.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=p_(t.children[1]),u=oj(t.children[t.children.length-1]);c&&u&&(o.position={start:c,end:u}),r.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function h1e(e,t,n){const s=n?n.children:void 0,i=(s?s.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let u=-1;const d=[];for(;++u<c;){const g=t.children[u],A={},E=o?o[u]:void 0;E&&(A.align=E);let x={type:"element",tagName:i,properties:A,children:[]};g&&(x.children=e.all(g),e.patch(g,x),x=e.applyData(g,x)),d.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function m1e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const B8=9,F8=32;function g1e(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),r=0;const i=[];for(;s;)i.push(U8(t.slice(r,s.index),r>0,!0),s[0]),r=s.index+s[0].length,s=n.exec(t);return i.push(U8(t.slice(r),r>0,!1)),i.join("")}function U8(e,t,n){let s=0,r=e.length;if(t){let i=e.codePointAt(s);for(;i===B8||i===F8;)s++,i=e.codePointAt(s)}if(n){let i=e.codePointAt(r-1);for(;i===B8||i===F8;)r--,i=e.codePointAt(r-1)}return r>s?e.slice(s,r):""}function A1e(e,t){const n={type:"text",value:g1e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function E1e(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const x1e={blockquote:KAe,break:$Ae,code:YAe,delete:XAe,emphasis:JAe,footnoteReference:ZAe,heading:e1e,html:t1e,imageReference:n1e,image:s1e,inlineCode:r1e,linkReference:i1e,link:o1e,listItem:a1e,list:c1e,paragraph:u1e,root:d1e,strong:f1e,table:p1e,tableCell:m1e,tableRow:h1e,text:A1e,thematicBreak:E1e,toml:Q0,yaml:Q0,definition:Q0,footnoteDefinition:Q0};function Q0(){}const Nj=-1,BE=0,Mh=1,g1=2,C_=3,y_=4,b_=5,I_=6,wj=7,Rj=8,C1e=typeof self=="object"?self:globalThis,z8=(e,t)=>
944{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new C1e[e](t)},y1e=(e,t)=>{const n=(r,i)=>(e.set(i,r),r),s=r=>{if(e.has(r))return e.get(r);const[i,o]=t[r];switch(i){case BE:case Nj:return n(o,r);case Mh:{const c=n([],r);for(const u of o)c.push(s(u));return c}case g1:{const c=n({},r);for(const[u,d]of o)c[s(u)]=s(d);return c}case C_:return n(new Date(o),r);case y_:{const{source:c,flags:u}=o;return n(new RegExp(c,u),r)}case b_:{const c=n(new Map,r);for(const[u,d]of o)c.set(s(u),s(d));return c}case I_:{const c=n(new Set,r);for(const u of o)c.add(s(u));return c}case wj:{const{name:c,message:u}=o;return n(z8(c,u),r)}case Rj:return n(BigInt(o),r);case"BigInt":return n(Object(BigInt(o)),r);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(z8(i,o),r)};return s},Q8=e=>y1e(new Map,e)(0),zd="",{toString:b1e}={},{keys:I1e}=Object,uh=e=>{const t=typeof e;if(t!=="object"||!e)return[BE,t];const n=b1e.call(e).slice(8,-1);switch(n){case"Array":return[Mh,zd];case"Object":return[g1,zd];case"Date":return[C_,zd];case"RegExp":return[y_,zd];case"Map":return[b_,zd];case"Set":return[I_,zd];case"DataView":return[Mh,n]}
vendor: 4,223 bytes, lines 944-946
944return n.includes("Array")?[Mh,n]:n.includes("Error")?[wj,n]:[g1,n]},H0=([e,t])=>e===BE&&(t==="function"||t==="symbol"),S1e=(e,t,n,s)=>{const r=(o,c)=>{const u=s.push(o)-1;return n.set(c,u),u},i=o=>{if(n.has(o))return n.get(o);let[c,u]=uh(o);switch(c){case BE:{let p=o;switch(u){case"bigint":c=Rj,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return r([Nj],o)}return r([c,p],o)}case Mh:{if(u){let A=o;return u==="DataView"?A=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(A=new Uint8Array(o)),r([u,[...A]],o)}const p=[],g=r([c,p],o);for(const A of o)p.push(i(A));return g}case g1:{if(u)switch(u){case"BigInt":return r([u,o.toString()],o);case"Boolean":case"Number":case"String":return r([u,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const p=[],g=r([c,p],o);for(const A of I1e(o))(e||!H0(uh(o[A])))&&p.push([i(A),i(o[A])]);return g}case C_:return r([c,o.toISOString()],o);case y_:{const{source:p,flags:g}=o;return r([c,{source:p,flags:g}],o)}case b_:{const p=[],g=r([c,p],o);for(const[A,E]of o)(e||!(H0(uh(A))||H0(uh(E))))&&p.push([i(A),i(E)]);return g}case I_:{const p=[],g=r([c,p],o);for(const A of o)(e||!H0(uh(A)))&&p.push(i(A));return g}}const{message:d}=o;return r([c,{name:u,message:d}],o)};return i},H8=(e,{json:t,lossy:n}={})=>{const s=[];return S1e(!(t||n),!!t,new Map,s)(e),s},A1=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Q8(H8(e,t)):structuredClone(e):(e,t)=>Q8(H8(e,t));function v1e(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function _1e(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function T1e(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||v1e,s=e.options.footnoteBackLabel||_1e,r=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[u]);if(!d)continue;const p=e.all(d),g=String(d.identifier).toUpperCase(),A=tp(g.toLowerCase());let E=0;const x=[],y=e.footnoteCounts.get(g);for(;y!==void 0&&++E<=y;){x.length>0&&x.push({type:"text",value:" "});let S=typeof n=="string"?n:n(u,E);typeof S=="string"&&(S={type:"text",value:S}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(u,E),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const I=p[p.length-1];if(I&&I.type==="element"&&I.tagName==="p"){const S=I.children[I.children.length-1];S&&S.type==="text"?S.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...x)}else p.push(...x);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(p,!0)};e.patch(d,v),c.push(v)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...A1(o),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:`
945`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
946`}]}}const FE=(function(e){if(e==null)return D1e;if(typeof e=="function")return UE(e);if(typeof e=="object")return Array.isArray(e)?N1e(e):w1e(e);if(typeof e=="string")return R1e(e);throw new Error("Expected function, string, or object as test")});function N1e(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=FE(e[n]);return UE(s);function s(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function w1e(e){const t=e;return UE(n);function n(s){const r=s;let i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function R1e(e){return UE(t);function t(n){return n&&n.type===e}}function UE(e){return t;function t(n,s,r){return!!(k1e(n)&&e.call(this,n,typeof s=="number"?s:void 0,r||void 0))}}function D1e(){return!0}function k1e(e){return e!==null&&typeof e=="object"&&"type"in e}const Dj=[],O1e=!0,LS=!1,P1e="skip";function kj(e,t,n,s){let r;typeof t=="function"&&typeof n!="function"?(s=n,n=t):r=t;
vendor: 13,446 bytes, lines 946-950
946const i=FE(r),o=s?-1:1;c(e,void 0,[])();function c(u,d,p){const g=u&&typeof u=="object"?u:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(A,"name",{value:"node ("+(u.type+(E?"<"+E+">":""))+")"})}return A;function A(){let E=Dj,x,y,I;if((!t||i(u,d,p[p.length-1]||void 0))&&(E=L1e(n(u,p)),E[0]===LS))return E;if("children"in u&&u.children){const v=u;if(v.children&&E[0]!==P1e)for(y=(s?v.children.length:-1)+o,I=p.concat(v);y>-1&&y<v.children.length;){const S=v.children[y];if(x=c(S,y,I)(),x[0]===LS)return x;y=typeof x[1]=="number"?x[1]:y+o}}return E}}}function L1e(e){return Array.isArray(e)?e:typeof e=="number"?[O1e,e]:e==null?Dj:[e]}function S_(e,t,n,s){let r,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,r=n):(i=t,o=n,r=s),kj(e,i,c,r);function c(u,d){const p=d[d.length-1],g=p?p.children.indexOf(u):void 0;return o(u,g,p)}}const MS={}.hasOwnProperty,M1e={};function j1e(e,t){const n=t||M1e,s=new Map,r=new Map,i=new Map,o={...x1e,...n.handlers},c={all:d,applyData:F1e,definitionById:s,footnoteById:r,footnoteCounts:i,footnoteOrder:[],handlers:o,one:u,options:n,patch:B1e,wrap:z1e};return S_(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?s:r,A=String(p.identifier).toUpperCase();g.has(A)||g.set(A,p)}}),c;function u(p,g){const A=p.type,E=c.handlers[A];if(MS.call(c.handlers,A)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(A)){if("children"in p){const{children:y,...I}=p,v=A1(I);return v.children=c.all(p),v}return A1(p)}return(c.options.unknownHandler||U1e)(c,p,g)}function d(p){const g=[];if("children"in p){const A=p.children;let E=-1;for(;++E<A.length;){const x=c.one(A[E],p);if(x){if(E&&A[E-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=V8(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=V8(y.value))}Array.isArray(x)?g.push(...x):g.push(x)}}}return g}}function B1e(e,t){e.position&&(t.position=vge(e))}function F1e(e,t){let n=t;if(e&&e.data){const s=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const o="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:o}}n.type==="element"&&i&&Object.assign(n.properties,A1(i)),"children"in n&&n.children&&r!==null&&r!==void 0&&(n.children=r)}return n}function U1e(e,t){const n=t.data||{},s="value"in t&&!(MS.call(n,"hProperties")||MS.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function z1e(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
947`});++s<e.length;)s&&n.push({type:"text",value:`
948`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
949`}),n}function V8(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function G8(e,t){const n=j1e(e,t),s=n.one(e,void 0),r=T1e(n),i=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return r&&i.children.push({type:"text",value:`
950`},r),i}function Q1e(e,t){return e&&"run"in e?async function(n,s){const r=G8(n,{file:s,...t});await e.run(r,s)}:function(n,s){return G8(n,{file:s,...e||t})}}function q8(e){if(e)throw e}var xb,W8;function H1e(){if(W8)return xb;W8=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},i=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),g=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!g)return!1;var A;for(A in d);return typeof A>"u"||e.call(d,A)},o=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},c=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(s)return s(d,p).value}else return;return d[p]};return xb=function u(){var d,p,g,A,E,x,y=arguments[0],I=1,v=arguments.length,S=!1;for(typeof y=="boolean"&&(S=y,y=arguments[1]||{},I=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});I<v;++I)if(d=arguments[I],d!=null)for(p in d)g=c(y,p),A=c(d,p),y!==A&&(S&&A&&(i(A)||(E=r(A)))?(E?(E=!1,x=g&&r(g)?g:[]):x=g&&i(g)?g:{},o(y,{name:p,newValue:u(S,x,A)})):typeof A<"u"&&o(y,{name:p,newValue:A}));return y},xb}var V1e=H1e();const Cb=Am(V1e);function jS(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function G1e(){const e=[],t={run:n,use:s};return t;function n(...r){let i=-1;const o=r.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...r);function c(u,...d){const p=e[++i];let g=-1;if(u){o(u);return}for(;++g<r.length;)(d[g]===null||d[g]===void 0)&&(d[g]=r[g]);r=d,p?q1e(p,c)(...d):o(null,...d)}}function s(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function q1e(e,t){let n;return s;function s(...o){const c=e.length>o.length;let u;c&&o.push(r);try{u=e.apply(this,o)}catch(d){const p=d;if(c&&n)throw p;return r(p)}c||(u&&u.then&&typeof u.then=="function"?u.then(i,r):u instanceof Error?r(u):i(u))}function r(o,...c){n||(n=!0,t(o,...c))}function i(o){r(null,o)}}const zo={basename:W1e,dirname:K1e,extname:$1e,join:Y1e,sep:"/"};function W1e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Zm(e);let n=0,s=-1,r=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else s<0&&(i=!0,s=r+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let o=-1,c=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(i){n=r+1;break}}else o<0&&(i=!0,o=r+1),c>-1&&(e.codePointAt(r)===t.codePointAt(c--)?c<0&&(s=r):(c=-1,s=o));return n===s?s=o:s<0&&(s=e.length),e.slice(n,s)}function K1e(e){if(Zm(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function $1e(e){Zm(e);let t=e.length,n=-1,s=0,r=-1,i=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){s=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?r<0?r=t:i!==1&&(i=1):r>-1&&(i=-1)}return r<0||n<0||i===0||i===1&&r===n-1&&r===s+1?"":e.slice(r,n)}function Y1e(...e){let t=-1,n;for(;++t<e.length;)Zm(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":X1e(n)}function X1e(e){Zm(e);const t=e.codePointAt(0)===47;let n=J1e(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function J1e(e,t){let n="",s=0,r=-1,i=0,o=-1,c,u;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(r===o-1||i===1))if(r!==o-1&&i===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",s=0):(n=n.slice(0,u),s=n.length-1-n.lastIndexOf("/")),r=o,i=0;continue}}else if(n.length>0){n="",s=0,r=o,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o),s=o-r-1;r=o,i=0}else c===46&&i>-1?i++:i=-1}return n}function Zm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Z1e={cwd:eEe};function eEe(){return"/"}function BS(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tEe(e){if(typeof e=="string")e=new URL(e);else if(!BS(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return nEe(e)}function nEe(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const yb=["history","path","basename","stem","extname","dirname"];class Oj{constructor(t){let n;t?BS(t)?n={path:t}:typeof t=="string"||sEe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Z1e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<yb.length;){const i=yb[s];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)yb.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?zo.basename(this.path):void 0}set basename(t){Ib(t,"basename"),bb(t,"basename"),this.path=zo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zo.dirname(this.path):void 0}set dirname(t){K8(this.basename,"dirname"),this.path=zo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zo.extname(this.path):void 0}set extname(t){if(bb(t,"extname"),K8(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){BS(t)&&(t=tEe(t)),Ib(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zo.basename(this.path,this.extname):void 0}set stem(t){Ib(t,"stem"),bb(t,"stem"),this.path=zo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const r=this.message(t,n,s);throw r.fatal=!0,r}info(t,n,s){const r=this.message(t,n,s);return r.fatal=void 0,r}message(t,n,s){const r=new xr(t,n,s);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function bb(e,t){if(e&&e.includes(zo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zo.sep+"`")}function Ib(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K8(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function sEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rEe=(function(e){const s=this.constructor.prototype,r=s[e],i=function(){return r.apply(i,arguments)};return Object.setPrototypeOf(i,s),i}),iEe={}.hasOwnProperty;class v_ extends rEe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=G1e()}copy(){const t=new v_;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(Cb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_b("data",this.frozen),this.namespace[t]=n,this):iEe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_b("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const r=n.call(t,...s);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=V0(t),s=this.parser||this.Parser;return Sb("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Sb("process",this.parser||this.Parser),vb("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,o){const c=V0(t),u=s.parse(c);s.run(u,c,function(p,g,A){if(p||!g||!A)return d(p);const E=g,x=s.stringify(E,A);lEe(x)?A.value=x:A.result=x,d(p,A)});function d(p,g){p||!g?o(p):i?i(g):n(void 0,g)}}}processSync(t){let n=!1,s;return this.freeze(),Sb("processSync",this.parser||this.Parser),vb("processSync",this.compiler||this.Compiler),this.process(t,r),Y8("processSync","process",n),s;function r(i,o){n=!0,q8(i),s=o}}run(t,n,s){$8(t),this.freeze();const r=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?i(void 0,s):new Promise(i);function i(o,c){const u=V0(n);r.run(t,u,d);function d(p,g,A){const E=g||t;p?c(p):o?o(E):s(void 0,E,A)}}}runSync(t,n){let s=!1,r;return this.run(t,n,i),Y8("runSync","run",s),r;function i(o,c){q8(o),r=c,s=!0}}stringify(t,n){this.freeze();const s=V0(n),r=this.compiler||this.Compiler;return vb("stringify",r),$8(t),r(t,s)}use(t,...n){const s=this.attachers,r=this.namespace;if(_b("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(d){if(typeof d=="function")u(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...g]=d;u(p,g)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}
vendor: 5,888 bytes, line 950
950function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(r.settings=Cb(!0,r.settings,d.settings))}function c(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const g=d[p];i(g)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function u(d,p){let g=-1,A=-1;for(;++g<s.length;)if(s[g][0]===d){A=g;break}if(A===-1)s.push([d,...p]);else if(p.length>0){let[E,...x]=p;const y=s[A][1];jS(y)&&jS(E)&&(E=Cb(!0,y,E)),s[A]=[d,E,...x]}}}}const oEe=new v_().freeze();function Sb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function vb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _b(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $8(e){if(!jS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Y8(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function V0(e){return aEe(e)?e:new Oj(e)}function aEe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lEe(e){return typeof e=="string"||cEe(e)}function cEe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uEe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",X8=[],J8={allowDangerousHtml:!0},dEe=/^(https?|ircs?|mailto|xmpp)$/i,fEe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function pEe(e){const t=hEe(e),n=mEe(e);return gEe(t.runSync(t.parse(n),n),e)}function hEe(e){const t=e.rehypePlugins||X8,n=e.remarkPlugins||X8,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...J8}:J8;return oEe().use(WAe).use(n).use(Q1e,s).use(t)}function mEe(e){const t=e.children||"",n=new Oj;return typeof t=="string"&&(n.value=t),n}function gEe(e,t){const n=t.allowedElements,s=t.allowElement,r=t.components,i=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,u=t.urlTransform||AEe;for(const p of fEe)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+uEe+p.id,void 0);return S_(e,d),Rge(e,{Fragment:a.Fragment,components:r,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function d(p,g,A){if(p.type==="raw"&&A&&typeof g=="number")return o?A.children.splice(g,1):A.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let E;for(E in gb)if(Object.hasOwn(gb,E)&&Object.hasOwn(p.properties,E)){const x=p.properties[E],y=gb[E];(y===null||y.includes(p.tagName))&&(p.properties[E]=u(String(x||""),E,p))}}if(p.type==="element"){let E=n?!n.includes(p.tagName):i?i.includes(p.tagName):!1;if(!E&&s&&typeof g=="number"&&(E=!s(p,g,A)),E&&A&&typeof g=="number")return c&&p.children?A.children.splice(g,1,...p.children):A.children.splice(g,1),g}}}function AEe(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||s!==-1&&t>s||dEe.test(e.slice(0,t))?e:""}function Z8(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,r=n.indexOf(t);for(;r!==-1;)s++,r=n.indexOf(t,r+t.length);return s}function EEe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xEe(e,t,n){const r=FE((n||{}).ignore||[]),i=CEe(t);let o=-1;for(;++o<i.length;)kj(e,"text",c);function c(d,p){let g=-1,A;for(;++g<p.length;){const E=p[g],x=A?A.children:void 0;if(r(E,x?x.indexOf(E):void 0,A))return;A=E}if(A)return u(d,p)}function u(d,p){const g=p[p.length-1],A=i[o][0],E=i[o][1];let x=0;const I=g.children.indexOf(d);let v=!1,S=[];A.lastIndex=0;let b=A.exec(d.value);for(;b;){const w=b.index,_={index:b.index,input:b.input,stack:[...p,d]};let N=E(...b,_);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?A.lastIndex=w+1:(x!==w&&S.push({type:"text",value:d.value.slice(x,w)}),Array.isArray(N)?S.push(...N):N&&S.push(N),x=w+b[0].length,v=!0),!A.global)break;b=A.exec(d.value)}return v?(x<d.value.length&&S.push({type:"text",value:d.value.slice(x)}),g.children.splice(I,1,...S)):S=[d],I+S.length}}function CEe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<n.length;){const r=n[s];t.push([yEe(r[0]),bEe(r[1])])}return t}function yEe(e){return typeof e=="string"?new RegExp(EEe(e),"g"):e}function bEe(e){return typeof e=="function"?e:function(){return e}}const Tb="phrasing",Nb=["autolink","link","image","label"];
vendor: 7,256 bytes, lines 950-954
950function IEe(){return{transforms:[REe],enter:{literalAutolink:vEe,literalAutolinkEmail:wb,literalAutolinkHttp:wb,literalAutolinkWww:wb},exit:{literalAutolink:wEe,literalAutolinkEmail:NEe,literalAutolinkHttp:_Ee,literalAutolinkWww:TEe}}}function SEe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Tb,notInConstruct:Nb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Tb,notInConstruct:Nb},{character:":",before:"[ps]",after:"\\/",inConstruct:Tb,notInConstruct:Nb}]}}function vEe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wb(e){this.config.enter.autolinkProtocol.call(this,e)}function _Ee(e){this.config.exit.autolinkProtocol.call(this,e)}function TEe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function NEe(e){this.config.exit.autolinkEmail.call(this,e)}function wEe(e){this.exit(e)}function REe(e){xEe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DEe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),kEe]],{ignore:["link","linkReference"]})}function DEe(e,t,n,s,r){let i="";if(!Pj(r)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!OEe(n)))return!1;const o=PEe(n+s);if(!o[0])return!1;const c={type:"link",title:null,url:i+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function kEe(e,t,n,s){return!Pj(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function OEe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function PEe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const r=Z8(e,"(");let i=Z8(e,")");for(;s!==-1&&r>i;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),i++;return[e,n]}function Pj(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Du(n)||ME(n))&&(!t||n!==47)}Lj.peek=HEe;function LEe(){this.buffer()}function MEe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jEe(){this.buffer()}function BEe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FEe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=go(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UEe(e){this.exit(e)}function zEe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=go(this.sliceSerialize(e)).toLowerCase(),n.label=t}function QEe(e){this.exit(e)}function HEe(){return"["}function Lj(e,t,n,s){const r=n.createTracker(s);let i=r.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return i+=r.move(n.safe(n.associationId(e),{after:"]",before:i})),c(),o(),i+=r.move("]"),i}function VEe(){return{enter:{gfmFootnoteCallString:LEe,gfmFootnoteCall:MEe,gfmFootnoteDefinitionLabelString:jEe,gfmFootnoteDefinition:BEe},exit:{gfmFootnoteCallString:FEe,gfmFootnoteCall:UEe,gfmFootnoteDefinitionLabelString:zEe,gfmFootnoteDefinition:QEe}}}function GEe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Lj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,r,i,o){const c=i.createTracker(o);let u=c.move("[^");const d=i.enter("footnoteDefinition"),p=i.enter("label");return u+=c.move(i.safe(i.associationId(s),{before:u,after:"]"})),p(),u+=c.move("]:"),s.children&&s.children.length>0&&(c.shift(4),u+=c.move((t?`
951`:" ")+i.indentLines(i.containerFlow(s,c.current()),t?Mj:qEe))),d(),u}}function qEe(e,t,n){return t===0?e:Mj(e,t,n)}function Mj(e,t,n){return(n?"":"    ")+e}const WEe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];jj.peek=JEe;function KEe(){return{canContainEols:["delete"],enter:{strikethrough:YEe},exit:{strikethrough:XEe}}}function $Ee(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WEe}],handlers:{delete:jj}}}function YEe(e){this.enter({type:"delete",children:[]},e)}function XEe(e){this.exit(e)}function jj(e,t,n,s){const r=n.createTracker(s),i=n.enter("strikethrough");let o=r.move("~~");return o+=n.containerPhrasing(e,{...r.current(),before:o,after:"~"}),o+=r.move("~~"),i(),o}function JEe(){return"~"}function ZEe(e){return e.length}function exe(e,t){const n=t||{},s=(n.align||[]).concat(),r=n.stringLength||ZEe,i=[],o=[],c=[],u=[];let d=0,p=-1;for(;++p<e.length;){const y=[],I=[];let v=-1;for(e[p].length>d&&(d=e[p].length);++v<e[p].length;){const S=txe(e[p][v]);if(n.alignDelimiters!==!1){const b=r(S);I[v]=b,(u[v]===void 0||b>u[v])&&(u[v]=b)}y.push(S)}o[p]=y,c[p]=I}let g=-1;if(typeof s=="object"&&"length"in s)for(;++g<d;)i[g]=e9(s[g]);else{const y=e9(s);for(;++g<d;)i[g]=y}g=-1;const A=[],E=[];for(;++g<d;){const y=i[g];let I="",v="";y===99?(I=":",v=":"):y===108?I=":":y===114&&(v=":");let S=n.alignDelimiters===!1?1:Math.max(1,u[g]-I.length-v.length);const b=I+"-".repeat(S)+v;n.alignDelimiters!==!1&&(S=I.length+S+v.length,S>u[g]&&(u[g]=S),E[g]=S),A[g]=b}o.splice(1,0,A),c.splice(1,0,E),p=-1;const x=[];for(;++p<o.length;){const y=o[p],I=c[p];g=-1;const v=[];for(;++g<d;){const S=y[g]||"";let b="",w="";if(n.alignDelimiters!==!1){const _=u[g]-(I[g]||0),N=i[g];N===114?b=" ".repeat(_):N===99?_%2?(b=" ".repeat(_/2+.5),w=" ".repeat(_/2-.5)):(b=" ".repeat(_/2),w=b):w=" ".repeat(_)}n.delimiterStart!==!1&&!g&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&S==="")&&(n.delimiterStart!==!1||g)&&v.push(" "),n.alignDelimiters!==!1&&v.push(b),v.push(S),n.alignDelimiters!==!1&&v.push(w),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||g!==d-1)&&v.push("|")}x.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return x.join(`
952`)}function txe(e){return e==null?"":String(e)}function e9(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function nxe(e,t,n,s){const r=n.enter("blockquote"),i=n.createTracker(s);i.move("> "),i.shift(2);const o=n.indentLines(n.containerFlow(e,i.current()),sxe);return r(),o}function sxe(e,t,n){return">"+(n?"":" ")+e}function rxe(e,t){return t9(e,t.inConstruct,!0)&&!t9(e,t.notInConstruct,!1)}function t9(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function n9(e,t,n,s){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
953`&&rxe(n.stack,n.unsafe[r]))return/[ \t]/.test(s.before)?"":" ";return`\\
954`}function ixe(e,t){const n=String(e);let s=n.indexOf(t),r=s,i=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===r?++i>o&&(o=i):i=1,r=s+t.length,s=n.indexOf(t,r);return o}function oxe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function axe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function lxe(e,t,n,s){const r=axe(n),i=e.value||"",o=r==="`"?"GraveAccent":"Tilde";
vendor: 7,628 bytes, lines 954-963
954if(oxe(e,n)){const g=n.enter("codeIndented"),A=n.indentLines(i,cxe);return g(),A}const c=n.createTracker(s),u=r.repeat(Math.max(ixe(i,r)+1,3)),d=n.enter("codeFenced");let p=c.move(u);if(e.lang){const g=n.enter(`codeFencedLang${o}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${o}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
955`,encode:["`"],...c.current()})),g()}return p+=c.move(`
956`),i&&(p+=c.move(i+`
957`)),p+=c.move(u),d(),p}function cxe(e,t,n){return(n?"":"    ")+e}function __(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function uxe(e,t,n,s){const r=__(n),i=r==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const u=n.createTracker(s);let d=u.move("[");return d+=u.move(n.safe(n.associationId(e),{before:d,after:"]",...u.current()})),d+=u.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(c=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":`
958`,...u.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=u.move(" "+r),d+=u.move(n.safe(e.title,{before:d,after:r,...u.current()})),d+=u.move(r),c()),o(),d}function dxe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function um(e){return"&#x"+e.toString(16).toUpperCase()+";"}function E1(e,t,n){const s=Rf(e),r=Rf(t);return s===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Bj.peek=fxe;function Bj(e,t,n,s){const r=dxe(n),i=n.enter("emphasis"),o=n.createTracker(s),c=o.move(r);let u=o.move(n.containerPhrasing(e,{after:r,before:c,...o.current()}));const d=u.charCodeAt(0),p=E1(s.before.charCodeAt(s.before.length-1),d,r);p.inside&&(u=um(d)+u.slice(1));const g=u.charCodeAt(u.length-1),A=E1(s.after.charCodeAt(0),g,r);A.inside&&(u=u.slice(0,-1)+um(g));const E=o.move(r);return i(),n.attentionEncodeSurroundingInfo={after:A.outside,before:p.outside},c+u+E}function fxe(e,t,n){return n.options.emphasis||"*"}function pxe(e,t){let n=!1;return S_(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,LS}),!!((!e.depth||e.depth<3)&&A_(e)&&(t.options.setext||n))}function hxe(e,t,n,s){const r=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(s);if(pxe(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),A=n.containerPhrasing(e,{...i.current(),before:`
959`,after:`
960`});return g(),p(),A+`
961`+(r===1?"=":"-").repeat(A.length-(Math.max(A.lastIndexOf("\r"),A.lastIndexOf(`
962`))+1))}const o="#".repeat(r),c=n.enter("headingAtx"),u=n.enter("phrasing");i.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
963`,...i.current()});return/^[\t ]/.test(d)&&(d=um(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),u(),c(),d}Fj.peek=mxe;function Fj(e){return e.value||""}function mxe(){return"<"}Uj.peek=gxe;function Uj(e,t,n,s){const r=__(n),i=r==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const u=n.createTracker(s);let d=u.move("![");return d+=u.move(n.safe(e.alt,{before:d,after:"]",...u.current()})),d+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(c=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=u.move(" "+r),d+=u.move(n.safe(e.title,{before:d,after:r,...u.current()})),d+=u.move(r),c()),d+=u.move(")"),o(),d}function gxe(){return"!"}zj.peek=Axe;function zj(e,t,n,s){const r=e.referenceType,i=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(s);let u=c.move("![");const d=n.safe(e.alt,{before:u,after:"]",...c.current()});u+=c.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return o(),n.stack=p,i(),r==="full"||!d||d!==g?u+=c.move(g+"]"):r==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function Axe(){return"!"}Qj.peek=Exe;function Qj(e,t,n){let s=e.value||"",r="`",i=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(s);)r+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++i<n.unsafe.length;){const o=n.unsafe[i],c=n.compilePattern(o);let u;if(o.atBreak)for(;u=c.exec(s);){let d=u.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(u.index+1)}}return r+s+r}function Exe(){return"`"}function Hj(e,t){const n=A_(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Vj.peek=xxe;function Vj(e,t,n,s){const r=__(n),i=r==='"'?"Quote":"Apostrophe",o=n.createTracker(s);let c,u;if(Hj(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=o.move("<");return g+=o.move(n.containerPhrasing(e,{before:g,after:">",...o.current()})),g+=o.move(">"),c(),n.stack=p,g}c=n.enter("link"),u=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(u=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${i}`),d+=o.move(" "+r),d+=o.move(n.safe(e.title,{before:d,after:r,...o.current()})),d+=o.move(r),u()),d+=o.move(")"),c(),d}function xxe(e,t,n){return Hj(e,n)?"<":"["}Gj.peek=Cxe;function Gj(e,t,n,s){const r=e.referenceType,i=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(s);let u=c.move("[");const d=n.containerPhrasing(e,{before:u,after:"]",...c.current()});u+=c.move(d+"]["),o();const p=n.stack;n.stack=[],o=n.enter("reference");const g=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return o(),n.stack=p,i(),r==="full"||!d||d!==g?u+=c.move(g+"]"):r==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function Cxe(){return"["}function T_(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yxe(e){const t=T_(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bxe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function qj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ixe(e,t,n,s){const r=n.enter("list"),i=n.bulletCurrent;
vendor: 6,474 bytes, lines 963-965
963let o=e.ordered?bxe(n):T_(n);const c=e.ordered?o==="."?")":".":yxe(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),qj(n)===o&&p){let g=-1;for(;++g<e.children.length;){const A=e.children[g];if(A&&A.type==="listItem"&&A.children&&A.children[0]&&A.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(o=c),n.bulletCurrent=o;const d=n.containerFlow(e,s);return n.bulletLastUsed=o,n.bulletCurrent=i,r(),d}function Sxe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vxe(e,t,n,s){const r=Sxe(n);let i=n.bulletCurrent||T_(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let o=i.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(s);c.move(i+" ".repeat(o-i.length)),c.shift(o);const u=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),p);return u(),d;function p(g,A,E){return A?(E?"":" ".repeat(o))+g:(E?i:i+" ".repeat(o-i.length))+g}}function _xe(e,t,n,s){const r=n.enter("paragraph"),i=n.enter("phrasing"),o=n.containerPhrasing(e,s);return i(),r(),o}const Txe=FE(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Nxe(e,t,n,s){return(e.children.some(function(o){return Txe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function wxe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Wj.peek=Rxe;function Wj(e,t,n,s){const r=wxe(n),i=n.enter("strong"),o=n.createTracker(s),c=o.move(r+r);let u=o.move(n.containerPhrasing(e,{after:r,before:c,...o.current()}));const d=u.charCodeAt(0),p=E1(s.before.charCodeAt(s.before.length-1),d,r);p.inside&&(u=um(d)+u.slice(1));const g=u.charCodeAt(u.length-1),A=E1(s.after.charCodeAt(0),g,r);A.inside&&(u=u.slice(0,-1)+um(g));const E=o.move(r+r);return i(),n.attentionEncodeSurroundingInfo={after:A.outside,before:p.outside},c+u+E}function Rxe(e,t,n){return n.options.strong||"*"}function Dxe(e,t,n,s){return n.safe(e.value,s)}function kxe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Oxe(e,t,n){const s=(qj(n)+(n.options.ruleSpaces?" ":"")).repeat(kxe(n));return n.options.ruleSpaces?s.slice(0,-1):s}const Kj={blockquote:nxe,break:n9,code:lxe,definition:uxe,emphasis:Bj,hardBreak:n9,heading:hxe,html:Fj,image:Uj,imageReference:zj,inlineCode:Qj,link:Vj,linkReference:Gj,list:Ixe,listItem:vxe,paragraph:_xe,root:Nxe,strong:Wj,text:Dxe,thematicBreak:Oxe};function Pxe(){return{enter:{table:Lxe,tableData:s9,tableHeader:s9,tableRow:jxe},exit:{codeText:Bxe,table:Mxe,tableData:Rb,tableHeader:Rb,tableRow:Rb}}}function Lxe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Mxe(e){this.exit(e),this.data.inTable=void 0}function jxe(e){this.enter({type:"tableRow",children:[]},e)}function Rb(e){this.exit(e)}function s9(e){this.enter({type:"tableCell",children:[]},e)}function Bxe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Fxe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Fxe(e,t){return t==="|"?t:e}function Uxe(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,r=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
964`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:A,table:o,tableCell:u,tableRow:c}};function o(E,x,y,I){return d(p(E,y,I),E.align)}function c(E,x,y,I){const v=g(E,y,I),S=d([v]);return S.slice(0,S.indexOf(`
965`))}function u(E,x,y,I){const v=y.enter("tableCell"),S=y.enter("phrasing"),b=y.containerPhrasing(E,{...I,before:i,after:i});return S(),v(),b}function d(E,x){return exe(E,{align:x,alignDelimiters:s,padding:n,stringLength:r})}function p(E,x,y){const I=E.children;let v=-1;const S=[],b=x.enter("table");for(;++v<I.length;)S[v]=g(I[v],x,y);return b(),S}function g(E,x,y){const I=E.children;let v=-1;const S=[],b=x.enter("tableRow");for(;++v<I.length;)S[v]=u(I[v],E,x,y);return b(),S}function A(E,x,y){let I=Kj.inlineCode(E,x,y);return y.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}function zxe(){return{exit:{taskListCheckValueChecked:r9,taskListCheckValueUnchecked:r9,paragraph:Hxe}}}function Qxe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Vxe}}}function r9(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Hxe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const s=n.children[0];if(s&&s.type==="text"){const r=t.children;let i=-1,o;for(;++i<r.length;){const c=r[i];if(c.type==="paragraph"){o=c;break}}o===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function Vxe(e,t,n,s){const r=e.children[0],i=typeof e.checked=="boolean"&&r&&r.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(s);i&&c.move(o);let u=Kj.listItem(e,t,n,{...s,...c.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),u;function d(p){return p+o}}function Gxe(){return[IEe(),VEe(),KEe(),Pxe(),zxe()]}function qxe(e){return{extensions:[SEe(),GEe(e),$Ee(),Uxe(e),Qxe()]}}
vendor: 8,431 bytes, line 965
965const Wxe={tokenize:Zxe,partial:!0},$j={tokenize:eCe,partial:!0},Yj={tokenize:tCe,partial:!0},Xj={tokenize:nCe,partial:!0},Kxe={tokenize:sCe,partial:!0},Jj={name:"wwwAutolink",tokenize:Xxe,previous:eB},Zj={name:"protocolAutolink",tokenize:Jxe,previous:tB},hl={name:"emailAutolink",tokenize:Yxe,previous:nB},ba={};function $xe(){return{text:ba}}let Hc=48;for(;Hc<123;)ba[Hc]=hl,Hc++,Hc===58?Hc=65:Hc===91&&(Hc=97);ba[43]=hl;ba[45]=hl;ba[46]=hl;ba[95]=hl;ba[72]=[hl,Zj];ba[104]=[hl,Zj];ba[87]=[hl,Jj];ba[119]=[hl,Jj];function Yxe(e,t,n){const s=this;let r,i;return o;function o(g){return!FS(g)||!nB.call(s,s.previous)||N_(s.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return FS(g)?(e.consume(g),c):g===64?(e.consume(g),u):n(g)}function u(g){return g===46?e.check(Kxe,p,d)(g):g===45||g===95||gr(g)?(i=!0,e.consume(g),u):p(g)}function d(g){return e.consume(g),r=!0,u}function p(g){return i&&r&&Sr(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function Xxe(e,t,n){const s=this;return r;function r(o){return o!==87&&o!==119||!eB.call(s,s.previous)||N_(s.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Wxe,e.attempt($j,e.attempt(Yj,i),n),n)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Jxe(e,t,n){const s=this;let r="",i=!1;return o;function o(g){return(g===72||g===104)&&tB.call(s,s.previous)&&!N_(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),r+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(Sr(g)&&r.length<5)return r+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const A=r.toLowerCase();if(A==="http"||A==="https")return e.consume(g),u}return n(g)}function u(g){return g===47?(e.consume(g),i?d:(i=!0,u)):n(g)}function d(g){return g===null||m1(g)||Pn(g)||Du(g)||ME(g)?n(g):e.attempt($j,e.attempt(Yj,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function Zxe(e,t,n){let s=0;return r;function r(o){return(o===87||o===119)&&s<3?(s++,e.consume(o),r):o===46&&s===3?(e.consume(o),i):n(o)}function i(o){return o===null?n(o):t(o)}}function eCe(e,t,n){let s,r,i;return o;function o(d){return d===46||d===95?e.check(Xj,u,c)(d):d===null||Pn(d)||Du(d)||d!==45&&ME(d)?u(d):(i=!0,e.consume(d),o)}function c(d){return d===95?s=!0:(r=s,s=void 0),e.consume(d),o}function u(d){return r||s||!i?n(d):t(d)}}function tCe(e,t){let n=0,s=0;return r;function r(o){return o===40?(n++,e.consume(o),r):o===41&&s<n?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Xj,t,i)(o):o===null||Pn(o)||Du(o)?t(o):(e.consume(o),r)}function i(o){return o===41&&s++,e.consume(o),r}}function nCe(e,t,n){return s;function s(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),s):c===38?(e.consume(c),i):c===93?(e.consume(c),r):c===60||c===null||Pn(c)||Du(c)?t(c):n(c)}function r(c){return c===null||c===40||c===91||Pn(c)||Du(c)?t(c):s(c)}function i(c){return Sr(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),s):Sr(c)?(e.consume(c),o):n(c)}}function sCe(e,t,n){return s;function s(i){return e.consume(i),r}function r(i){return gr(i)?n(i):t(i)}}function eB(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Pn(e)}function tB(e){return!Sr(e)}function nB(e){return!(e===47||FS(e))}function FS(e){return e===43||e===45||e===46||e===95||gr(e)}function N_(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const rCe={tokenize:fCe,partial:!0};function iCe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cCe,continuation:{tokenize:uCe},exit:dCe}},text:{91:{name:"gfmFootnoteCall",tokenize:lCe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:oCe,resolveTo:aCe}}}}function oCe(e,t,n){const s=this;let r=s.events.length;const i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o;for(;r--;){const u=s.events[r][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!o||!o._balanced)return n(u);const d=go(s.sliceSerialize({start:o.end,end:s.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function aCe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},r={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};r.end.column++,r.end.offset++,r.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},r.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},c=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",r,t],["exit",r,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...c),e}function lCe(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i=0,o;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),u}function u(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(g){if(i>999||g===93&&!o||g===null||g===91||Pn(g))return n(g);if(g===93){e.exit("chunkString");const A=e.exit("gfmFootnoteCallString");return r.includes(go(s.sliceSerialize(A)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Pn(g)||(o=!0),i++,e.consume(g),g===92?p:d}function p(g){return g===91||g===92||g===93?(e.consume(g),i++,d):d(g)}}function cCe(e,t,n){const s=this,r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let i,o=0,c;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(x)}function p(x){if(o>999||x===93&&!c||x===null||x===91||Pn(x))return n(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=go(s.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),A}return Pn(x)||(c=!0),o++,e.consume(x),x===92?g:p}function g(x){return x===91||x===92||x===93?(e.consume(x),o++,p):p(x)}function A(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),r.includes(i)||r.push(i),Wt(e,E,"gfmFootnoteDefinitionWhitespace")):n(x)}function E(x){return t(x)}}function uCe(e,t,n){return e.check(Jm,t,e.attempt(rCe,t,n))}function dCe(e){e.exit("gfmFootnoteDefinition")}function fCe(e,t,n){const s=this;return Wt(e,r,"gfmFootnoteDefinitionIndent",5);function r(i){const o=s.events[s.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):n(i)}}function pCe(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:i,resolveAll:r};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function r(o,c){let u=-1;for(;++u<o.length;)if(o[u][0]==="enter"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._close){let d=u;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[u][1].end.offset-o[u][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[u][1].type="strikethroughSequence",o[d][
vendor: 4,723 bytes, line 965
9651].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[u][1].end)},g={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[u][1].start)},A=[["enter",p,c],["enter",o[d][1],c],["exit",o[d][1],c],["enter",g,c]],E=c.parser.constructs.insideSpan.null;E&&mi(A,A.length,0,jE(E,o.slice(d+1,u),c)),mi(A,A.length,0,[["exit",g,c],["enter",o[u][1],c],["exit",o[u][1],c],["exit",p,c]]),mi(o,d-1,u-d+3,A),u=d+A.length-2;break}}for(u=-1;++u<o.length;)o[u][1].type==="strikethroughSequenceTemporary"&&(o[u][1].type="data");return o}function i(o,c,u){const d=this.previous,p=this.events;let g=0;return A;function A(x){return d===126&&p[p.length-1][1].type!=="characterEscape"?u(x):(o.enter("strikethroughSequenceTemporary"),E(x))}function E(x){const y=Rf(d);if(x===126)return g>1?u(x):(o.consume(x),g++,E);if(g<2&&!n)return u(x);const I=o.exit("strikethroughSequenceTemporary"),v=Rf(x);return I._open=!v||v===2&&!!y,I._close=!y||y===2&&!!v,c(x)}}}class hCe{constructor(){this.map=[]}add(t,n,s){mCe(this,t,n,s)}consume(t){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let r=s.pop();for(;r;){for(const i of r)t.push(i);r=s.pop()}this.map.length=0}}function mCe(e,t,n,s){let r=0;if(!(n===0&&s.length===0)){for(;r<e.map.length;){if(e.map[r][0]===t){e.map[r][1]+=n,e.map[r][2].push(...s);return}r+=1}e.map.push([t,n,s])}}function gCe(e,t){let n=!1;const s=[];for(;t<e.length;){const r=e[t];if(n){if(r[0]==="enter")r[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(r[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=s.length-1;s[i]=s[i]==="left"?"center":"right"}}else if(r[1].type==="tableDelimiterRow")break}else r[0]==="enter"&&r[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function ACe(){return{flow:{null:{name:"table",tokenize:ECe,resolveAll:xCe}}}}function ECe(e,t,n){const s=this;let r=0,i=0,o;return c;function c(L){let O=s.events.length-1;for(;O>-1;){const F=s.events[O][1].type;if(F==="lineEnding"||F==="linePrefix")O--;else break}const P=O>-1?s.events[O][1].type:null,B=P==="tableHead"||P==="tableRow"?N:u;return B===N&&s.parser.lazy[s.now().line]?n(L):B(L)}function u(L){return e.enter("tableHead"),e.enter("tableRow"),d(L)}function d(L){return L===124||(o=!0,i+=1),p(L)}function p(L){return L===null?n(L):xt(L)?i>1?(i=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),E):n(L):jt(L)?Wt(e,p,"whitespace")(L):(i+=1,o&&(o=!1,r+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,p):(e.enter("data"),g(L)))}function g(L){return L===null||L===124||Pn(L)?(e.exit("data"),p(L)):(e.consume(L),L===92?A:g)}function A(L){return L===92||L===124?(e.consume(L),g):g(L)}function E(L){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,jt(L)?Wt(e,x,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):x(L))}function x(L){return L===45||L===58?I(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),y):_(L)}function y(L){return jt(L)?Wt(e,I,"whitespace")(L):I(L)}function I(L){return L===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),v):L===45?(i+=1,v(L)):L===null||xt(L)?w(L):_(L)}function v(L){return L===45?(e.enter("tableDelimiterFiller"),S(L)):_(L)}function S(L){return L===45?(e.consume(L),S):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(L))}function b(L){return jt(L)?Wt(e,w,"whitespace")(L):w(L)}function w(L){return L===124?x(L):L===null||xt(L)?!o||r!==i?_(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):_(L)}function _(L){return n(L)}function N(L){return e.enter("tableRow"),R(L)}function R(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),R):L===null||xt(L)?(e.exit("tableRow"),t(L)):jt(L)?Wt(e,R,"whitespace")(L):(e.enter("data"),D(L))}function D(L){return L===null||L===124||Pn(L)?(e.exit("data"),R(L)):(e.consume(L),L===92?k:D)}function k(L){return L===92||L===124?(e.consume(L),D):D(L)}}function xCe(e,t){let n=-1,s=!0,r=0,i=[0,0,0,0],o=[0,0,0,0],c=!1,u=0,d,p,g;const A=new hCe;for(;++n<e.length;){const E=e[n],x=E[1];E[0]==="enter"?x.type==="tableHead"?(c=!1,u!==0&&(i9(A,t,u,d,p),p=void 0,u=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)}
vendor: 5,464 bytes, line 965
965,A.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=!0,g=void 0,i=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},A.add(n,0,[["enter",p,t]])),r=x.type==="tableDelimiterRow"?2:p?3:1):r&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(s=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],g=G0(A,t,i,r,void 0,g),i=[0,0,0,0]),o[2]=n)):x.type==="tableCellDivider"&&(s?s=!1:(i[1]!==0&&(o[0]=o[1],g=G0(A,t,i,r,void 0,g)),i=o,o=[i[1],n,0,0])):x.type==="tableHead"?(c=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,i[1]!==0?(o[0]=o[1],g=G0(A,t,i,r,n,g)):o[1]!==0&&(g=G0(A,t,o,r,n,g)),r=0):r&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=n)}for(u!==0&&i9(A,t,u,d,p),A.consume(t.events),n=-1;++n<t.events.length;){const E=t.events[n];E[0]==="enter"&&E[1].type==="table"&&(E[1]._align=gCe(t.events,n))}return e}function G0(e,t,n,s,r,i){const o=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(i.end=Object.assign({},qd(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const u=qd(t.events,n[1]);if(i={type:o,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const d=qd(t.events,n[2]),p=qd(t.events,n[3]),g={type:c,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),s!==2){const A=t.events[n[2]],E=t.events[n[3]];if(A[1].end=Object.assign({},E[1].end),A[1].type="chunkText",A[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,y=n[3]-n[2]-1;e.add(x,y,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return r!==void 0&&(i.end=Object.assign({},qd(t.events,r)),e.add(r,0,[["exit",i,t]]),i=void 0),i}function i9(e,t,n,s,r){const i=[],o=qd(t.events,n);r&&(r.end=Object.assign({},o),i.push(["exit",r,t])),s.end=Object.assign({},o),i.push(["exit",s,t]),e.add(n+1,0,i)}function qd(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const CCe={name:"tasklistCheck",tokenize:bCe};function yCe(){return{text:{91:CCe}}}function bCe(e,t,n){const s=this;return r;function r(u){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),i)}function i(u){return Pn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(u)}function c(u){return xt(u)?t(u):jt(u)?e.check({tokenize:ICe},t,n)(u):n(u)}}function ICe(e,t,n){return Wt(e,s,"whitespace");function s(r){return r===null?n(r):t(r)}}function SCe(e){return pj([$xe(),iCe(),pCe(e),ACe(),yCe()])}const vCe={};function _Ce(e){const t=this,n=e||vCe,s=t.data(),r=s.micromarkExtensions||(s.micromarkExtensions=[]),i=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),o=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);r.push(SCe(n)),i.push(Gxe()),o.push(qxe(n))}const TCe={p:({children:e,...t})=>a.jsx("p",{...t,className:"mt-1 first:mt-0 roboto-flex-100-400-1 text-sm leading-5 text-zinc-950 whitespace-pre-wrap",children:e}),a:({children:e,href:t,...n})=>a.jsx("a",{...n,href:t,target:"_blank",rel:"noreferrer noopener",className:"text-indigo-600 underline hover:text-indigo-700",children:e}),strong:({children:e,...t})=>a.jsx("strong",{...t,className:"roboto-flex-100-600-1",children:e}),em:({children:e,...t})=>a.jsx("em",{...t,className:"italic",children:e}),del:({children:e,...t})=>a.jsx("del",{...t,className:"line-through",children:e}),ul:({children:e,...t})=>a.jsx("ul",{...t,className:"my-1 list-outside list-disc pl-5",children:e}),ol:({children:e,...t})=>a.jsx("ol",{...t,className:"my-1 list-outside list-decimal pl-5",children:e}),li:({children:e,...t})=>a.jsx("li",{...t,className:"my-0.5 roboto-flex-100-400-1 text-sm leading-5 text-zinc-950",children:e}),h1:({children:e,...t})=>a.jsx("h1",{...t,className:"mt-2 mb-1 text-base roboto-flex-100-600-1 text-zinc-950",children:e}),h2:({children:e,...t})=>a.jsx("h2",{...t,className:"mt-2 mb-1 text-sm roboto-flex-100-600-1 text-zinc-950",children:e}),h3:({children:e,...t})=>a.jsx("h3",{...t,className:"mt-2 mb-1 text-sm roboto-flex-100-600-1 text-zinc-700",children:e}),blockquote:({children:e,...t})=>a.jsx("blockquote",{...t,className:"my-1 border-l-2 border-zinc-200 pl-3 text-sm leading-5 text-zinc-600",children:e}),code:({children:e,...t})=>a.jsx("code",{...t,className:"rounded bg-zinc-100 px-1 py-0.5 font-mono text-[12px] leading-4 text-zinc-800",children:e}),pre:({children:e,...t})=>a.jsx("pre",{...t,className:"my-2 overflow-x-auto rounded bg-zinc-100 p-2 font-mono text-[12px] leading-4 text-zinc-800",children:e}),hr:e=>a.jsx("hr",{...e,className:"my-2 border-zinc-200"}),table:({children:e,...t})=>a.jsx("div",{className:"my-2 rounded bg-zinc-50 p-2",children:a.jsx("table",{...t,className:"w-full border-collapse text-[12px] leading-4",children:e})}),th:({children:e,...t})=>a.jsx("th",{...t,className:"border-b border-zinc-200 px-2 py-1 text-left roboto-flex-100-600-1 text-zinc-700 wrap-anywhere-with-fallback",children:e}),td:({children:e,...t})=>a.jsx("td",{...t,className:"border-b border-zinc-200 px-2 py-1 align-top text-zinc-950 wrap-anywhere-with-fallback",children:e})}
965,NCe=({message:e})=>a.jsx("div",{className:Y("flex w-full flex-col self-start",!!e.isStreaming&&"shimmer"),children:a.jsx(pEe,{remarkPlugins:[_Ce],components:TCe,children:e.text})}),dm=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50170)"},l.createElement("path",{d:"M7.4974 11.6667L4.16406 8.33333M4.16406 8.33333L7.4974 5M4.16406 8.33333H13.3307C14.2148 8.33333 15.0626 8.68452 15.6878 9.30964C16.3129 9.93477 16.6641 10.7826 16.6641 11.6667C16.6641 12.5507 16.3129 13.3986 15.6878 14.0237C15.0626 14.6488 14.2148 15 13.3307 15H12.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50170"},l.createElement("rect",{width:20,height:20,fill:"white"})))),$d=({params:e,key:t})=>{const n=e[t];if(typeof n=="string"&&n.trim()!=="")return n},wCe=({params:e})=>{if(Pv())return;const t=$d({params:e,key:"clientId"});if(t===void 0)return;const n=$d({params:e,key:"defenseLineId"});if(n!==void 0)return`/clients/${t}/overview/defense-lines/${n}`},o9=({params:e})=>{const t=$d({params:e,key:"clientId"});if(t===void 0)return;const n=$d({params:e,key:"episodeId"});if(n!==void 0)return`/clients/${t}/overview/fabula/${n}`;if($d({params:e,key:"felonyId"})!==void 0)return`/clients/${t}/overview/fabula`;if($d({params:e,key:"eventId"})!==void 0)return`/clients/${t}/overview/fabula`},RCe=({link:e})=>{if(e===void 0)return;const t=e.params;if(e.type==="defense_line")return wCe({params:t});if(e.type==="felony")return o9({params:t});if(e.type==="event")return o9({params:t})},DCe=({option:e,optionKey:t,isInteractive:n,onOptionClick:s})=>{const r=l.useCallback(()=>{s({option:e,optionKey:t})},[s,e,t]),i=l.useMemo(()=>RCe({link:e.link}),[e.link]),o=l.useMemo(()=>Y("flex max-w-full items-start overflow-hidden rounded-xl py-1.5 pl-3 roboto-flex-100-400-1 text-sm leading-5",!!i&&"pr-0",!i&&"pr-3",!!n&&"bg-indigo-50 hover:bg-indigo-100 text-indigo-600",!n&&"bg-zinc-50 text-zinc-400"),[n,i]),c=l.useMemo(()=>Y("min-w-0 text-left",!!n&&"cursor-pointer",!n&&"cursor-default"),[n]),u=l.useMemo(()=>Y("-my-1.5 flex h-8 w-8 shrink-0 items-center justify-center",!!n&&"text-zinc-600",!n&&"text-zinc-400"),[n]);return a.jsxs("div",{className:o,children:[a.jsx("button",{type:"button",disabled:!n,onClick:r,className:c,children:e.label}),!!i&&a.jsx(Hs,{to:i,target:"_blank",rel:"noopener noreferrer",className:u,children:a.jsx(Rm,{className:"size-4 shrink-0"})})]})},kCe=({message:e,isInteractive:t,selectedChatChoiceKeys:n,onChatChoiceOptionClick:s})=>{const r=l.useMemo(()=>e.options.map((p,g)=>({option:p,optionKey:`${e.id}:${g}`})).filter(p=>!p.option.isBack),[e.options,e.id]),i=l.useMemo(()=>!e.multi||!t?r:r.filter(p=>!n.has(p.optionKey)),[r,e.multi,t,n]),o=l.useMemo(()=>e.options.map((p,g)=>({option:p,optionKey:`${e.id}:${g}`})).filter(p=>p.option.isBack),[e.options,e.id]),c=l.useCallback(({option:p,optionKey:g})=>{s({messageId:e.id,multi:e.multi,option:p,optionKey:g})},[e.id,e.multi,s]),u=l.useMemo(()=>Y("flex size-8 items-center justify-center",!!t&&"cursor-pointer text-zinc-600 hover:text-zinc-700",!t&&"cursor-default text-zinc-300"),[t]),d=l.useCallback((p,g)=>{const A=()=>{c(p)};return a.jsx("button",{type:"button",disabled:!t,onClick:A,"aria-label":p.option.label,title:p.option.label,className:u,children:a.jsx(dm,{className:"size-5"})},`back-${g}`)},[u,c,t]);return a.jsxs("div",{className:"flex w-full flex-col gap-2 self-start",children:[i.length>0&&a.jsx("div",{className:"flex w-full flex-wrap gap-1",children:i.map(p=>a.jsx(DCe,{option:p.option,optionKey:p.optionKey,isInteractive:t,onOptionClick:c},p.optionKey))}),o.length>0&&a.jsx("div",{className:"flex items-center gap-2",children:o.map(d)})]})},OCe=({message:e})=>a.jsx("div",{className:"flex w-full flex-col gap-0.5 self-start font-mono text-[11px] leading-4 text-zinc-400",children:e.lines.map(t=>a.jsxs("div",{className:"wrap-break-word",children:[a.jsx("span",{className:"text-zinc-400",children:t.key}),a.jsx("span",{className:"text-zinc-300",children:" = "}),a.jsx("span",{className:"text-zinc-500",children:t.value})]},t.key))}),PCe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19965_28553)"},l.createElement("path",{d:"M16.6693 9.16665C16.4655 7.70016 15.7852 6.34136 14.7331 5.29956C13.6811 4.25776 12.3157 3.59074 10.8473 3.40127C9.37893 3.2118 7.88896 3.51038 6.60694 4.25102C5.32492 4.99165 4.32198 6.13326 3.7526 7.49998M3.33594 4.16665V7.49998H6.66927",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10.8333C3.53974 12.2998 4.22005 13.6586 5.27207 14.7004C6.3241 15.7422 7.68947 16.4092 9.15788 16.5987C10.6263 16.7882 12.1163 16.4896 13.3983 15.7489C14.6803 15.0083 15.6832 13.8667 16.2526 12.5M16.6693 15.8333V12.5H13.3359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19965_28553"},l.createElement("rect",{width:20,height:20,fill:"white"})))),LCe=({errorMessage:e,onRetry:t})=>{const n=l.useCallback(()=>{t()},[t]);
965return a.jsxs("div",{className:"flex w-full flex-col gap-2 self-start",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[a.jsx(nu,{className:"size-5 shrink-0 text-red-500"}),a.jsx("div",{className:"roboto-flex-100-400-1 min-w-0 text-sm leading-5 text-zinc-950",children:e})]}),a.jsx("button",{type:"button",onClick:n,"aria-label":h.molecules.chat.RETRY,title:h.molecules.chat.RETRY,className:"flex size-8 cursor-pointer items-center justify-center text-zinc-600 hover:text-zinc-700",children:a.jsx(PCe,{className:"size-5"})})]})},MCe=({messages:e,shimmeringMessageId:t})=>a.jsx("div",{className:"flex w-full flex-col gap-1 self-start",children:e.map(n=>{const s=n.id===t;return a.jsxs("div",{className:"roboto-flex-100-400-1 text-left text-sm leading-5 text-zinc-500",children:[s&&a.jsx(Aa,{children:n.text}),!s&&n.text]},n.id)})}),US=({children:e,onRemove:t,isFileVariant:n=!1})=>a.jsxs("div",{className:Y("flex max-w-full items-center gap-0.5 bg-white py-[2px]",!!n&&"rounded-[4px] px-1",!n&&"rounded-full px-[6px]"),children:[e,t!==void 0&&a.jsx("button",{type:"button","aria-label":h.molecules.chat.PILL_REMOVE,onClick:t,className:"mt-0.5 flex shrink-0 cursor-pointer items-center justify-center text-zinc-400 hover:text-zinc-500",children:a.jsx(ga,{className:"size-3"})})]}),zS=({fileName:e,isLoading:t=!1,isUnavailable:n=!1})=>a.jsxs("div",{className:"flex min-w-0 items-center gap-0.5",children:[t&&a.jsx(Co,{className:"size-4 shrink-0 animate-spin text-zinc-400"}),!t&&a.jsx(I7,{className:"size-4 shrink-0 text-zinc-400"}),a.jsx("span",{className:Y("roboto-flex-100-400-1 max-w-40 truncate text-[14px] leading-[16px]",!!n&&"text-zinc-400",!n&&"text-zinc-950"),children:e})]});function w_({pill:e}){const t=e.payload.fileName?.trim()??"";return t!==""?t:h.molecules.chat.PILL_FILE_ATTACHMENT_FALLBACK}function jCe({pill:e}){return!((e.payload.fileName?.trim()??"")!==""||e.payload.fileId==="")}const BCe=["copilotFileAttachmentUpload"];function FCe({originalFileName:e}){const t=e.trim();return t!==""?{fileName:t,isLoading:!1,isUnavailable:!1}:{fileName:h.molecules.chat.PILL_FILE_ATTACHMENT_FALLBACK,isLoading:!1,isUnavailable:!1}}function UCe({clientId:e,pill:t}){const n=jCe({pill:t}),s=t.payload.fileId,r=Vt({queryKey:[...BCe,e,s],queryFn:()=>s$({clientId:e,uploadId:s}),enabled:n,staleTime:1/0,gcTime:1/0,retry:!1});return n?r.isPending?{fileName:h.molecules.chat.PILL_FILE_ATTACHMENT_FALLBACK,isLoading:!0,isUnavailable:!1}:r.isError?{fileName:h.molecules.chat.PILL_FILE_ATTACHMENT_UNAVAILABLE,isLoading:!1,isUnavailable:!0}:FCe({originalFileName:r.data.originalFileName}):{fileName:w_({pill:t}),isLoading:!1,isUnavailable:!1}}const zCe=({clientId:e,pill:t})=>{const n=UCe({clientId:e,pill:t});return a.jsx(US,{isFileVariant:!0,children:a.jsx(zS,{fileName:n.fileName,isLoading:n.isLoading,isUnavailable:n.isUnavailable})})};function QCe({pills:e}){const t=[],n=[];for(const s of e){if(s.type==="file_attachment"){n.push(s);continue}t.push(s)}return{nonFileAttachmentPills:t,fileAttachmentPills:n}}function sB({pill:e}){if(e.type==="file_attachment")return w_({pill:e});if(e.type==="document_ref"){const t=e.payload?.text?.trim()??"";return t!==""?t:h.molecules.chat.PILL_DOCUMENT_REF_FALLBACK}return e.text}function HCe({messageText:e}){const t=l.useRef(null),[n,s]=l.useState(!1),[r,i]=l.useState(!1);l.useLayoutEffect(()=>{const c=t.current;if(!c)return;const u=()=>{r||s(c.scrollHeight>c.clientHeight)};u();const d=new ResizeObserver(u);return d.observe(c),()=>d.disconnect()},[e,r]);const o=l.useCallback(()=>{i(c=>!c)},[]);return{textRef:t,isExpanded:r,isExpandToggleVisible:n,handleExpandToggleClick:o}}const VCe=e=>l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_20825_37941)"},l.createElement("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_20825_37941"},l.createElement("rect",{width:12,height:12,fill:"white"})))),GCe=[],qCe=({clientId:e,message:t})=>{const n=t.pills??GCe,{textRef:s,isExpanded:r,isExpandToggleVisible:i,handleExpandToggleClick:o}=HCe({messageText:t.text}),{nonFileAttachmentPills:c,fileAttachmentPills:u}=l.useMemo(()=>QCe({pills:n}),[n]);return a.jsx("div",{className:"flex w-fit max-w-full flex-col self-end",children:a.jsxs("div",{className:"flex min-h-9 w-67.25 max-w-93 flex-col gap-2.5 rounded-t-2xl rounded-br-sm rounded-bl-2xl bg-zinc-100 px-3 py-2",children:[n.length>0&&a.jsxs("div",{className:"flex flex-col gap-[6px]",children:[c.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-x-0.5 gap-y-1",children:c.map((d,p)=>a.jsxs("span",{className:"roboto-flex-100-400-1 flex max-w-full items-center text-sm leading-5 text-zinc-400",children:[a.jsx("span",{className:Y("min-w-0",d.type==="document_ref"&&"max-w-40 truncate"),children:sB({pill:d})}),p<c.length-1&&","]},`${d.type}-${p}`))}),u.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-x-0.5 gap-y-1",children:u.map((d,p)=>a.jsx(zCe,{clientId:e,pill:d},`${d.payload.fileId}-${p}`))})]}),t.text!==""&&a.jsxs("div",{className:"flex flex-col items-start gap-2",children:[a.jsx("div",{ref:s,className:Y("roboto-flex-100-400-1 text-sm leading-5 whitespace-pre-wrap text-zinc-950",!!r&&"line-clamp-none",!r&&"line-clamp-3"),children:t.text}),!!i&&a.jsxs("button",{type:"button",className:"flex cursor-pointer items-center gap-0.5 text-[14px] leading-[20px] text-zinc-500 hover:text-zinc-600",onClick:o,children:[!!r&&h.molecules.chat.USER_MESSAGE_COLLAPSE,!r&&h.molecules.chat.USER_MESSAGE_EXPAND,a.jsx(VCe,{className:Y("mt-0.5 size-3",!r&&"rotate-0",!!r&&"rotate-180")}
965)]})]})]})})};function WCe({messages:e}){const t=[],n=[],s=()=>{n.length!==0&&(t.push({type:"toolActionFeed",messages:[...n]}),n.length=0)};for(const r of e){if(r.kind==="toolAction"){n.push(r);continue}s();const i=r;t.push({type:"message",message:i})}return s(),t}const KCe=16;function $Ce({container:e}){return e.scrollHeight-e.scrollTop-e.clientHeight<=KCe}function YCe({messages:e}){const t=[...e].reverse();for(const n of t){if(n.kind==="user")return null;if(n.kind==="chatChoice")return n.id}return null}function XCe({messages:e,isStreamBusy:t}){if(!t)return null;const n=e[e.length-1];if(n===void 0||n.kind==="assistantText"||n.kind==="chatChoice"||n.kind==="analyzing")return null;for(let s=e.length-1;s>=0;s-=1){const r=e[s];return r.kind!=="toolAction"?null:r.id}return null}function JCe({messages:e}){const t=e.reduce((n,s)=>s.kind==="user"?s:n,null);return t===null?null:t.id}const zE={sessionId:null,messages:[],streamStatus:"idle",pendingAssistantMessageId:null,analyzingMessageId:null,isBootstrapped:!1,errorMessage:null,pendingEchoTexts:[]};function cr({state:e,documentId:t}){return e.documents[t]??zE}function ts({state:e,documentId:t,patch:n}){const s=cr({state:e,documentId:t});return{documents:{...e.documents,[t]:{...s,...n}}}}function ZCe({params:e}){return e.analyzingMessageId===null?e.messages:e.messages.filter(t=>t.id!==e.analyzingMessageId)}function q0({params:e}){return e.messages.filter(t=>t.kind==="toolAction"?!1:e.analyzingMessageId===null||t.id!==e.analyzingMessageId)}function a9({messages:e,pendingAssistantMessageId:t}){return t===null?e:e.map(n=>n.id!==t||n.kind!=="assistantText"?n:{...n,isStreaming:!1})}const It=$n(e=>({documents:{},composerFocusRequestId:0,requestComposerFocus:()=>e(t=>({composerFocusRequestId:t.composerFocusRequestId+1})),composerSendRequestId:0,requestComposerSend:()=>e(t=>({composerSendRequestId:t.composerSendRequestId+1})),chatScrollToBottomRequestId:0,requestChatScrollToBottom:()=>e(t=>({chatScrollToBottomRequestId:t.chatScrollToBottomRequestId+1})),copilotDocumentNameSuggestion:null,suggestCopilotDocumentName:(t,n)=>e(()=>({copilotDocumentNameSuggestion:{documentId:t,name:n}})),clearCopilotDocumentNameSuggestion:()=>e(()=>({copilotDocumentNameSuggestion:null})),isDevLogsVisible:!1,toggleDevLogsVisible:()=>e(t=>({isDevLogsVisible:!t.isDevLogsVisible})),markLoadingHistory:t=>e(n=>ts({state:n,documentId:t,patch:{streamStatus:"loadingHistory",errorMessage:null,messages:[],pendingAssistantMessageId:null,analyzingMessageId:null}})),prepareCopilotChatDocumentRemount:t=>e(n=>ts({state:n,documentId:t,patch:{messages:[],streamStatus:"loadingHistory",isBootstrapped:!1,errorMessage:null,pendingAssistantMessageId:null,analyzingMessageId:null}})),applyEmptyBootstrap:t=>e(n=>cr({state:n,documentId:t}).streamStatus==="error"?ts({state:n,documentId:t,patch:{isBootstrapped:!0}}):ts({state:n,documentId:t,patch:{sessionId:null,messages:[],streamStatus:"idle",isBootstrapped:!0}})),applyHistoryBootstrap:(t,n,s)=>e(r=>cr({state:r,documentId:t}).streamStatus==="error"?ts({state:r,documentId:t,patch:{sessionId:n,isBootstrapped:!0}}):ts({state:r,documentId:t,patch:{sessionId:n,messages:s,streamStatus:"idle",isBootstrapped:!0}})),markBootstrapError:(t,n)=>e(s=>ts({state:s,documentId:t,patch:{streamStatus:"error",errorMessage:n,isBootstrapped:!0}})),setSessionId:(t,n)=>e(s=>ts({state:s,documentId:t,patch:{sessionId:n,streamStatus:"streaming"}})),appendUserMessage:(t,n)=>e(s=>{const r=cr({state:s,documentId:t});return ts({state:s,documentId:t,patch:{messages:[...r.messages,n]}})}),removeMessage:(t,n)=>e(s=>{const i=cr({state:s,documentId:t}).messages.filter(o=>o.id!==n);return ts({state:s,documentId:t,patch:{messages:i}})}),truncateAfterLastUserMessage:t=>e(n=>{const s=cr({state:n,documentId:t}),r=s.messages.reduce((o,c,u)=>c.kind!=="user"?o:u,-1),i=s.messages.slice(0,r+1);return ts({state:n,documentId:t,patch:{messages:i,pendingAssistantMessageId:null,analyzingMessageId:null}})}),startStreamOpening:(t,n,s)=>e(r=>{const i=cr({state:r,documentId:t});return ts({state:r,documentId:t,patch:{streamStatus:"opening",pendingAssistantMessageId:null,analyzingMessageId:n,errorMessage:null,messages:[...i.messages,{kind:"analyzing",id:n,variant:s??"default"}]}})}
965),appendToolActionMessage:(t,n)=>e(s=>{const r=cr({state:s,documentId:t}),i=ZCe({params:r});return ts({state:s,documentId:t,patch:{messages:[...i,n],analyzingMessageId:null}})}),appendLogMessage:(t,n)=>e(s=>{const r=cr({state:s,documentId:t});return ts({state:s,documentId:t,patch:{messages:[...r.messages,n]}})}),appendAssistantText:(t,n,s)=>e(r=>{const i=cr({state:r,documentId:t}),o=q0({params:i}),c=i.pendingAssistantMessageId;if(c!==null){const u=o.map(d=>d.id!==c||d.kind!=="assistantText"?d:{...d,text:d.text+n});return ts({state:r,documentId:t,patch:{messages:u,analyzingMessageId:null}})}return ts({state:r,documentId:t,patch:{messages:[...o,{kind:"assistantText",id:s,author:"assistant",text:n,isStreaming:!0}],pendingAssistantMessageId:s,analyzingMessageId:null}})}),appendChatChoice:(t,n)=>e(s=>{const r=cr({state:s,documentId:t}),i=q0({params:r});return ts({state:s,documentId:t,patch:{analyzingMessageId:null,pendingAssistantMessageId:null,messages:[...i,n]}})}),finishStream:t=>e(n=>{const s=cr({state:n,documentId:t}),r=q0({params:s}),i=a9({messages:r,pendingAssistantMessageId:s.pendingAssistantMessageId});return ts({state:n,documentId:t,patch:{messages:i,analyzingMessageId:null,pendingAssistantMessageId:null,streamStatus:"idle"}})}),markStreamError:(t,n)=>e(s=>{const r=cr({state:s,documentId:t}),i=q0({params:r}),o=a9({messages:i,pendingAssistantMessageId:r.pendingAssistantMessageId});return ts({state:s,documentId:t,patch:{messages:o,analyzingMessageId:null,pendingAssistantMessageId:null,streamStatus:"error",errorMessage:n}})}),clearStreamError:t=>e(n=>{const s=cr({state:n,documentId:t});return s.streamStatus!=="error"||s.errorMessage===null?n:ts({state:n,documentId:t,patch:{streamStatus:"idle",errorMessage:null}})}),enqueueEcho:(t,n)=>e(s=>{const r=cr({state:s,documentId:t});return ts({state:s,documentId:t,patch:{pendingEchoTexts:[...r.pendingEchoTexts,n]}})}),shiftEcho:t=>e(n=>{const s=cr({state:n,documentId:t});return s.pendingEchoTexts.length===0?n:ts({state:n,documentId:t,patch:{pendingEchoTexts:s.pendingEchoTexts.slice(1)}})})})),eye=5e3,tye=({clientId:e,messages:t,isStreamBusy:n,isChatChoiceClickBlocked:s,selectedChatChoiceKeys:r,onChatChoiceOptionClick:i,streamErrorMessage:o,onStreamErrorRetry:c})=>{const u=l.useRef(null),d=l.useRef(Number.NEGATIVE_INFINITY),p=l.useRef(null),g=l.useRef(null),[A,E]=l.useState(0),x=It(O=>O.composerFocusRequestId),y=It(O=>O.chatScrollToBottomRequestId),I=It(O=>O.isDevLogsVisible),v=l.useMemo(()=>I?t:t.filter(O=>O.kind!=="log"),[I,t]),S=l.useCallback(()=>{d.current=Number.NEGATIVE_INFINITY,E(O=>O+1)},[]),b=l.useCallback(()=>{const O=u.current;O!==null&&(O.scrollTop=O.scrollHeight)},[]),w=l.useCallback(()=>{const O=u.current;O!==null&&$Ce({container:O})&&(d.current=Number.NEGATIVE_INFINITY)},[]);l.useEffect(()=>{const O=u.current;if(O===null)return;const P=()=>{d.current=performance.now()};return O.addEventListener("wheel",P,{passive:!0}),O.addEventListener("touchmove",P,{passive:!0}),()=>{O.removeEventListener("wheel",P),O.removeEventListener("touchmove",P)}},[]),l.useEffect(()=>{const O=u.current;if(O===null)return;const P=()=>{O.scrollTop=O.scrollHeight},B=new ResizeObserver(P);return B.observe(O),()=>{B.disconnect()}},[]),l.useLayoutEffect(()=>{const O=JCe({messages:t}),P=O!==null&&O!==p.current;P&&(p.current=O,d.current=Number.NEGATIVE_INFINITY);const B=o!==null&&o!==g.current;g.current=o,!(performance.now()-d.current<eye)&&(!P&&!n&&!B||b())},[t,n,o,b]),l.useLayoutEffect(()=>{A!==0&&b()},[A,b]),l.useLayoutEffect(()=>{x!==0&&S()},[x,S]),l.useLayoutEffect(()=>{y!==0&&S()},[y,S]);const _=l.useCallback(O=>{i(O),!(O.multi&&!O.option.isBack)&&S()},[i,S]),N=l.useMemo(()=>YCe({messages:v}),[v]),R=l.useMemo(()=>XCe({messages:v,isStreamBusy:n}),[v,n]),D=l.useMemo(()=>WCe({messages:v}),[v]),k=l.useCallback(O=>{if(O.kind==="user")return a.jsx(qCe,{clientId:e,message:O},O.id);if(O.kind==="analyzing")return a.jsx(tge,{message:O},O.id);if(O.kind==="assistantText")return a.jsx(NCe,{message:O},O.id);if(O.kind==="log")return a.jsx(OCe,{message:O},O.id);if(O.kind==="chatChoice"){const P=O.id===N&&!s;return a.jsx(kCe,{message:O,isInteractive:P,selectedChatChoiceKeys:r,onChatChoiceOptionClick:_},O.id)}return null},[N,e,_,s,r]),L=l.useCallback(O=>{if(O.type==="toolActionFeed"){const P=O.messages.map(B=>B.id).join("-");return a.jsx(MCe,{messages:O.messages,shimmeringMessageId:R},P)}return k(O.message)},[k,R]);return a.jsx("div",{ref:u,onScroll:w,"data-chat-scroll":!0,className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-3 py-4",children:a.jsxs("div",{className:"flex flex-col gap-4 wrap-break-word",children:[D.map(L),o!==null&&a.jsx(LCe,{errorMessage:o,onRetry:c})]})})};function nye({quota:e,kind:t}){return t==="day"?e.dayWindowResetsAt:e.monthWindowResetsAt}function sye({quota:e,kind:t}){const n=nye({quota:e,kind:t});if(n===null)return h.molecules.chat.RESOURCE_RING_WINDOW_NOT_STARTED;const s=Kt({dateString:n,isWithTime:!0,isCommaSeparator:!0});return s===""?h.molecules.chat.RESOURCE_RING_WINDOW_NOT_STARTED:h.molecules.chat.RESOURCE_RING_TOOLTIP_SUBTITLE_RESET_AT.replace("{resetAt}",s)}function rye({quota:e,loadStatus:t}){return e!==null}const iye={hue:38,saturation:.05,lightness:.34},l9={hue:38,saturation:.92,lightness:.5},oye={hue:20,saturation:.91,lightness:.48};function aye({progress:e}){return Number.isNaN(e)||e<=0?0:e>=1?1:e}function Db({from:e,to:t,ratio:n}){return e+(t-e)*n}function c9({from:e,to:t,ratio:n}){return{hue:Db({from:e.hue,to:t.hue,ratio:n}),saturation:Db({from:e.saturation,to:t.saturation,ratio:n}),lightness:Db({from:e.lightness,to:t.lightness,ratio:n})}}function lye({progress:e}){return e<=.5?c9({from:iye,to:l9,ratio:e/.5}):c9({from:l9,to:oye,ratio:(e-.5)/.5})}function cye({color:e}){const t=Math.round(e.hue),n=Math.round(e.saturation*100),s=Math.round(e.lightness*100);return`hsl(${t} ${n}% ${s}%)`}function uye({progress:e}){const t=aye({progress:e}),n=lye({progress:t});return cye({color:n})}const kb=11,dye=Oe.memo(({progress:e,color:t})=>{const n=2*Math.PI*kb,s=Math.min(1,Math.max(0,e)),r=n*(1-s);return a.jsxs("svg",{width:32,height:32,viewBox:"0 0 32 32",style:{color:t}
965,"aria-hidden":!0,children:[a.jsx("circle",{cx:16,cy:16,r:kb,fill:"none",stroke:"#F0F0F0",strokeWidth:3}),a.jsx("circle",{cx:16,cy:16,r:kb,fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:r,transform:"rotate(-90 16 16)"})]})}),ua=$n(e=>({quota:null,loadStatus:"idle",setQuota:t=>e({quota:t,loadStatus:"ready"}),setLoadStatus:t=>e({loadStatus:t}),reset:()=>e({quota:null,loadStatus:"idle"})}));function fye({quota:e,kind:t}){return t==="day"?e.dayUsagePercent:e.monthUsagePercent}function pye({value:e}){return Number.isNaN(e)||e<0?0:e>100?100:e}function hye({template:e,percent:t}){return e.replace("{percent}",String(Math.round(t)))}function mye({kind:e}){return e==="day"?h.molecules.chat.RESOURCE_RING_DAY_TOOLTIP_TITLE:h.molecules.chat.RESOURCE_RING_MONTH_TOOLTIP_TITLE}function gye({kind:e}){return e==="day"?h.molecules.chat.RESOURCE_RING_DAY_LABEL:h.molecules.chat.RESOURCE_RING_MONTH_LABEL}const u9=({kind:e,quota:t})=>{const n=pye({value:fye({quota:t,kind:e})}),s=n/100,r=uye({progress:s}),i=hye({template:gye({kind:e}),percent:n}),o=sye({quota:t,kind:e});return a.jsx(Ls,{text:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{children:mye({kind:e})}),a.jsx("span",{className:"text-zinc-300",children:o})]}),isBelow:!0,isClampToParent:!1,isFollowCursor:!1,isDisableOnTouch:!0,children:a.jsxs("div",{className:"flex cursor-default items-center gap-1",children:[a.jsx(dye,{progress:s,color:r}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-950",children:i})]})})},Aye=()=>{const e=ua(u=>u.quota),t=ua(u=>u.loadStatus),n=Se(u=>u.user),s=It(u=>u.isDevLogsVisible),r=It(u=>u.toggleDevLogsVisible),i=l.useCallback(()=>{r()},[r]),o=sE({user:n});return!rye({quota:e,loadStatus:t})||e===null?null:a.jsxs("div",{className:"flex h-[48px] w-full items-center justify-center gap-6 border-b border-zinc-100 px-3",children:[!!o&&a.jsxs("button",{type:"button",onClick:i,className:"roboto-flex-100-400-1 w-16 cursor-pointer whitespace-nowrap text-left text-[12px] leading-[12px] text-sky-600 transition-colors hover:text-sky-700",children:[!!s&&"hide logs",!s&&"show logs"]}),a.jsx(u9,{kind:"day",quota:e}),a.jsx(u9,{kind:"month",quota:e})]})},Eye=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_19098_53026)"},l.createElement("path",{d:"M12.5012 5.83333L7.08455 11.25C6.75303 11.5815 6.56678 12.0312 6.56678 12.5C6.56678 12.9688 6.75303 13.4185 7.08455 13.75C7.41607 14.0815 7.86571 14.2678 8.33455 14.2678C8.80339 14.2678 9.25303 14.0815 9.58455 13.75L15.0012 8.33333C15.6643 7.67029 16.0368 6.77101 16.0368 5.83333C16.0368 4.89565 15.6643 3.99637 15.0012 3.33333C14.3382 2.67029 13.4389 2.2978 12.5012 2.2978C11.5635 2.2978 10.6643 2.67029 10.0012 3.33333L4.58455 8.75C3.58999 9.74456 3.03125 11.0935 3.03125 12.5C3.03125 13.9065 3.58999 15.2554 4.58455 16.25C5.57911 17.2446 6.92803 17.8033 8.33455 17.8033C9.74107 17.8033 11.09 17.2446 12.0846 16.25L17.5012 10.8333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_19098_53026"},l.createElement("rect",{width:20,height:20,fill:"white"})))),rB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M14.9974 5V10C14.9974 10.663 14.734 11.2989 14.2652 11.7678C13.7963 12.2366 13.1604 12.5 12.4974 12.5H4.16406M4.16406 12.5L7.4974 9.16667M4.16406 12.5L7.4974 15.8333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),d9={document_ref:0,text_pill:1,chat_choice:2,file_attachment:3,echo_pill:4};function iB({pills:e}){return[...e].sort((t,n)=>d9[t.type]-d9[n.type])}const Df={text:"",pills:[]};function xye({pills:e,pill:t}){return t.type!=="text_pill"?!1:!!e.some(n=>n.type==="text_pill"&&n.text===t.text)}function Cye({pills:e,pill:t}){if(xye({pills:e,pill:t}))return e;const n=e.filter(s=>t.type!=="document_ref"||s.type!=="document_ref");return iB({pills:[...n,t]})}function W0({documents:e,documentId:t}){return e[t]??Df}function yye({value:e,previousText:t}){return typeof e=="function"?e(t):e}const Tr=$n()(xk(e=>({documents:{},setDraftText:(t,n)=>e(s=>{const r=W0({documents:s.documents,documentId:t}),i=yye({value:n,previousText:r.text});return{documents:{...s.documents,[t]:{...r,text:i}}}}),addPill:(t,n)=>e(s=>{const r=W0({documents:s.documents,documentId:t});return{documents:{...s.documents,[t]:{...r,pills:Cye({pills:r.pills,pill:n})}}}}),removePillAt:(t,n)=>e(s=>{const r=W0({documents:s.documents,documentId:t});return{documents:{...s.documents,[t]:{...r,pills:r.pills.filter((i,o)=>o!==n)}}}}),clearChatChoiceSelectionPills:t=>e(n=>{const s=W0({documents:n.documents,documentId:t});return{documents:{...n.documents,[t]:{...s,pills:s.pills.filter(r=>!("sourceOptionKey"in r)||r.sourceOptionKey===void 0)}}}}),clearDraft:t=>e(n=>{const s={...n.documents};return delete s[t],{documents:s}}),restoreDraft:(t,n)=>e(s=>({documents:{...s.documents,[t]:n}}))}),{name:"copilotChatDraft"})),R_=[],K0=new Map;function Ob({documents:e,documentId:t}){return e[t]??R_}const cc=$n(e=>({documents:{}
965,addUploadingItem:(t,n,s)=>{K0.set(n.localId,s),e(r=>{const i=Ob({documents:r.documents,documentId:t});return{documents:{...r.documents,[t]:[...i,n]}}})},removeUploadItem:(t,n)=>{K0.delete(n),e(s=>{const r=Ob({documents:s.documents,documentId:t});return{documents:{...s.documents,[t]:r.filter(i=>i.localId!==n)}}})},cancelUploadItem:(t,n)=>{const s=K0.get(n);s!==void 0&&s.abort(),cc.getState().removeUploadItem(t,n)},clearDocumentUploads:t=>{const n=Ob({documents:cc.getState().documents,documentId:t});for(const s of n)K0.delete(s.localId);e(s=>{const r={...s.documents};return delete r[t],{documents:r}})}})),bye=({documentId:e})=>{const t=Tr(i=>i.documents[e]?.pills??Df.pills),n=Tr(i=>i.removePillAt),s=cc(i=>i.documents[e]??R_),r=cc(i=>i.cancelUploadItem);return t.length===0&&s.length===0?null:a.jsxs("div",{className:"flex flex-wrap gap-x-0.5 gap-y-1",children:[t.map((i,o)=>a.jsxs(US,{onRemove:()=>n(e,o),isFileVariant:i.type==="file_attachment",children:[i.type==="file_attachment"&&a.jsx(zS,{fileName:w_({pill:i})}),i.type!=="file_attachment"&&a.jsx("span",{className:Y("roboto-flex-100-400-1 text-[14px] leading-[16px] text-zinc-950",i.type==="document_ref"&&"max-w-40 truncate"),children:sB({pill:i})})]},`${i.type}-${o}`)),s.map(i=>a.jsx(US,{onRemove:()=>r(e,i.localId),isFileVariant:!0,children:a.jsx(zS,{fileName:i.fileName,isLoading:!0})},i.localId))]})},oB=100,Iye=oB*1024,aB="application/vnd.openxmlformats-officedocument.wordprocessingml.document",Sye=`.docx,${aB}`;function vye({file:e}){return!!(e.type===aB||e.name.trim().toLowerCase().endsWith(".docx"))}function _ye({files:e,maxSizeBytes:t}){const n=[],s=[],r=[];for(const i of e){if(!vye({file:i})){r.push(i);continue}if(i.size>t){s.push(i);continue}n.push(i)}return{attachable:n,overSizeLimit:s,invalidType:r}}function Tye({fileId:e,fileName:t,mimeType:n}){const s={fileId:e},r=t.trim();return r!==""&&(s.fileName=r),n!==""&&(s.mimeType=n),{type:"file_attachment",payload:s}}function Nye({error:e}){if(pt(e)&&pt(e.errorData)){const t=e.errorData.message;if(typeof t=="string"&&t!=="")return t}return h.inputs.notifications.FILE_UPLOAD_FAILED}function wye(){return crypto.randomUUID()}function Rye({error:e}){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function lB({clientId:e,documentId:t}){const n=cc(c=>c.addUploadingItem),s=Tr(c=>c.addPill),r=cc(c=>c.removeUploadItem),i=l.useCallback(async({file:c})=>{const u=wye(),d=new AbortController;n(t,{localId:u,fileName:c.name,mimeType:c.type},d);try{const p=await t$({clientId:e,documentId:t,file:c,signal:d.signal});s(t,Tye({fileId:p,fileName:c.name,mimeType:c.type})),r(t,u)}catch(p){if(Rye({error:p}))return;r(t,u),ve({type:"failed",message:Nye({error:p}),key:"FILE_UPLOAD_FAILED",duration:4e3})}},[s,n,e,t,r]);return{attachSelectedFiles:l.useCallback(({files:c})=>{const{attachable:u,overSizeLimit:d,invalidType:p}=_ye({files:c,maxSizeBytes:Iye});p.length>0&&ve({type:"warning",message:h.molecules.chat.ATTACH_INVALID_FILE_TYPE,key:"COPILOT_ATTACH_INVALID_FILE_TYPE",duration:4e3}),d.length>0&&ve({type:"warning",message:h.molecules.chat.ATTACH_MAX_SIZE_EXCEEDED,key:"COPILOT_ATTACH_MAX_SIZE_EXCEEDED",duration:4e3});for(const g of u)i({file:g})},[i])}}function cB(e){return!(e.type!=="file_attachment"||e.payload.fileId==="")}function Dye({pills:e}){for(const t of e)if(t.type!=="document_ref"&&(cB(t)||t.type==="text_pill"||t.type==="chat_choice"))return!0;return!1}function QS({trimmedText:e,pills:t}){return!!(e.length>0||Dye({pills:t}))}function kye({clipboardData:e}){const t=[];for(let n=0;n<e.items.length;n+=1){const s=e.items[n];if(s.kind!=="file")continue;const r=s.getAsFile();r!==null&&t.push(r)}return t}function Oye({clipboardData:e}){const t=[];for(let n=0;n<e.files.length;n+=1)t.push(e.files[n]);return t}function Pye({clipboardData:e}){if(e===null)return[];const t=kye({clipboardData:e});return t.length>0?t:Oye({clipboardData:e})}function Lye({clipboardData:e}){return e.getData("text/plain").trim()!==""}function Mye({clipboardData:e}){return e===null?[]:Lye({clipboardData:e})?[]:Pye({clipboardData:e})}function jye({documents:e,documentId:t}){return(e[t]??R_).length>0}const f9=160,Bye=h.molecules.chat.ATTACH_TOOLTIP_SECOND_LINE.replace("{maxKilobytes}",String(oB));function Fye({isSendDisabled:e,isFileUploadInProgress:t,trimmedText:n,pills:s}){return!!(e||t||!QS({trimmedText:n,pills:s}))}const Uye=({clientId:e,documentId:t,isSendDisabled:n,onSubmit:s})=>{const r=l.useRef(null),i=l.useRef(null),o=Tr(R=>R.documents[t]?.text??Df.text),c=Tr(R=>R.documents[t]?.pills??Df.pills),u=Tr(R=>R.setDraftText),d=It(R=>R.composerFocusRequestId),p=It(R=>R.composerSendRequestId),{attachSelectedFiles:g}=lB({clientId:e,documentId:t});l.useEffect(()=>{d!==0&&r.current?.focus()},[d]);const A=cc(R=>jye({documents:R.documents,documentId:t})),E=o.trim(),x=Fye({isSendDisabled:n,isFileUploadInProgress:A,trimmedText:E,pills:c}),y=l.useCallback(()=>{const R=r.current;R&&(R.style.height="0px",R.style.height=`${Math.min(R.scrollHeight,f9)}px`)},[]);l.useLayoutEffect(()=>{y()},[o,y]);const I=l.useCallback(()=>{i.current?.click()},[]),v=l.useCallback(R=>{const D=Array.from(R.target.files??[]);R.target.value="",D.length!==0&&g({files:D})},[g]),S=l.useCallback(R=>{u(t,R.target.value)},[t,u]),b=l.useCallback(()=>{x||s({text:E,pills:c})},[x,s,c,E]),w=l.useRef(b);l.useEffect(()=>{w.current=b},[b]),l.useEffect(()=>{p!==0&&w.current()}
965,[p]);const _=l.useCallback(R=>{R.key==="Enter"&&(R.shiftKey||(R.preventDefault(),b()))},[b]),N=l.useCallback(R=>{const D=Mye({clipboardData:R.clipboardData});D.length!==0&&(R.preventDefault(),g({files:D}))},[g]);return a.jsx("div",{className:"mt-auto w-full p-2",children:a.jsxs("div",{className:"flex flex-col rounded-lg bg-indigo-50 p-2",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx(bye,{documentId:t}),a.jsx("textarea",{ref:r,"data-chat-scroll":!0,value:o,onChange:S,onKeyDown:_,onPaste:N,rows:1,placeholder:h.molecules.chat.COMPOSER_PLACEHOLDER,style:{maxHeight:f9},className:"mx-1 min-h-5 w-full resize-none overflow-y-auto overscroll-contain border-0 bg-transparent py-0 roboto-flex-100-400-1 text-[14px] leading-[20px] text-zinc-950 outline-none placeholder:text-zinc-400"})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[a.jsx("input",{ref:i,type:"file",accept:Sye,multiple:!0,className:"hidden",onChange:v}),a.jsx(Ls,{text:a.jsxs(a.Fragment,{children:[h.molecules.chat.ATTACH_TOOLTIP_FIRST_LINE,a.jsx("br",{}),Bye]}),isClampToParent:!1,isFollowCursor:!1,isDisableOnTouch:!0,isTextCentered:!0,children:a.jsx("button",{type:"button","aria-label":h.molecules.chat.ATTACH_TOOLTIP_FIRST_LINE,onClick:I,className:"flex size-8 cursor-pointer items-center justify-center rounded-md text-zinc-400 hover:text-zinc-500",children:a.jsx(Eye,{className:"size-5"})})}),a.jsx("button",{type:"button",disabled:x,onClick:b,className:Y("flex size-8 items-center justify-center rounded-md text-white",!!x&&"bg-indigo-300 cursor-not-allowed",!x&&"bg-indigo-500 hover:opacity-95 cursor-pointer"),children:a.jsx(rB,{className:"size-5"})})]})]})})};function uB({quota:e,loadStatus:t}){return e!==null||t==="error"}function zye({streamStatus:e}){return e==="opening"||e==="streaming"}function dB({isBootstrapped:e,streamStatus:t,isCopilotQuotaReady:n}){return!e||t==="loadingHistory"||!n}function Qye({target:e}){return e instanceof Element?e.closest("[data-chat-scroll]")===null:!0}function Hye({documentId:e,startAutoInitStream:t}){const n=l.useRef(!1),s=It(r=>r.documents[e]?.isBootstrapped??!1);l.useEffect(()=>{n.current=!1},[e]),l.useEffect(()=>{if(n.current||!s)return;const r=It.getState().documents[e];r!==void 0&&r.streamStatus!=="opening"&&r.streamStatus!=="streaming"&&r.streamStatus!=="error"&&(r.messages.length>0||(n.current=!0,t()))},[e,s,t])}const fB=["copilotQuota"];function Vye(){const e=ua(s=>s.setQuota),t=ua(s=>s.setLoadStatus),n=Vt({queryKey:fB,queryFn:({signal:s})=>n$({signal:s}),refetchOnMount:"always",retry:!1});return l.useEffect(()=>{if(n.isPending){t("loading");return}if(n.isError){t("error");return}n.isSuccess&&n.data!==void 0&&e(n.data)},[n.data,n.isError,n.isPending,n.isSuccess,t,e]),{refetchQuota:n.refetch}}function Gye({isHistorySuccess:e,historyData:t,isHistoryFetching:n}){return!(!e||t===void 0||n)}function qye({author:e}){return e==="user"}function HS({event:e}){return e.id?e.id:Hr()}function Wye({message:e,pills:t}){if(e!==null&&e!=="")return e;const n=t?.find(s=>"isMain"in s&&s.isMain===!0);return n===void 0||n.type==="document_ref"||n.type==="file_attachment"?"":n.text}function Kye({event:e}){const t=e.message??null,n=e.pills??null;if(n!==null&&n.some(i=>i.type==="echo_pill"))return null;if(t===null&&n===null)return e.text===null||e.text.length===0?null:{kind:"user",id:HS({event:e}),text:e.text};const s=Wye({message:t,pills:n}),r=iB({pills:(n??[]).filter(i=>"isMain"in i?i.isMain!==!0:!0)});return s===""&&r.length===0?null:{kind:"user",id:HS({event:e}),text:s,pills:r}}function $ye({chatChoice:e}){return{kind:"chatChoice",id:`chat-choice-${e.timestamp}`,multi:e.multi,options:e.options}}function Yye({log:e}){return{kind:"log",id:`log-${e.timestamp}`,lines:e.lines}}function Xye({events:e,chatChoices:t=[],logs:n=[]}){const s=[],r={index:0},i={index:0},o=({timestamp:u})=>{for(;i.index<n.length;){const d=n[i.index];if(d.timestamp>u)return;i.index+=1,d.lines.length!==0&&s.push(Yye({log:d}))}},c=({timestamp:u})=>{for(;r.index<t.length;){const d=t[r.index];if(d.timestamp>u)return;r.index+=1,d.options.length!==0&&s.push($ye({chatChoice:d}))}};for(const u of e)if(o({timestamp:u.timestamp}),c({timestamp:u.timestamp}),!u.partial){if(qye({author:u.author})){const d=Kye({event:u});if(d===null)continue;s.push(d);continue}u.text!==null&&u.text.length!==0&&s.push({kind:"assistantText",id:HS({event:u}),author:u.author,text:u.text,isStreaming:!1})}return o({timestamp:Number.POSITIVE_INFINITY}),c({timestamp:Number.POSITIVE_INFINITY}),s}function Jye({clientId:e,sessionId:t}){return Vt({queryKey:["copilotSessionHistory",e,t],queryFn:({signal:n})=>{if(!e)throw new Error("Missing client id");if(!t)throw new Error("Missing session id");return XK({clientId:e,sessionId:t,signal:n})},enabled:!!e&&!!t,refetchOnMount:"always"})}function Zye({clientId:e}){return Vt({queryKey:["copilotSessions",e],queryFn:({signal:t})=>{if(!e)throw new Error("Missing client id");return YK({clientId:e,signal:t})},enabled:!!e,refetchOnMount:"always"})}function ebe({error:e}){return e instanceof Error?e.message:h.molecules.chat.HISTORY_LOAD_ERROR}function tbe({logs:e,isVisible:t}){return t?e||[]:[]}function nbe({clientId:e,documentId:t,reconnectToStream:n}
965){const s=It(w=>w.markLoadingHistory),r=It(w=>w.applyEmptyBootstrap),i=It(w=>w.applyHistoryBootstrap),o=It(w=>w.markBootstrapError),c=Se(w=>w.user),u=sE({user:c}),d=Zye({clientId:e}),p=d.data?.find(w=>w.sessionId===t),g=Jye({clientId:e,sessionId:p?.sessionId}),A=d.isLoading||g.isLoading,E=d.error??g.error,x=g.data,y=g.isSuccess,I=g.isFetching,v=d.isSuccess,S=d.isFetching,b=!!p;l.useEffect(()=>{if(!A)return;const w=It.getState().documents[t];w?.isBootstrapped||w?.streamStatus!=="opening"&&w?.streamStatus!=="streaming"&&s(t)},[A,s,t]),l.useEffect(()=>{v&&(b||S||r(t))},[v,S,b,r,t]),l.useEffect(()=>{if(!Gye({isHistorySuccess:y,historyData:x,isHistoryFetching:I})||x===void 0)return;const _=x,N=It.getState().documents[t]?.streamStatus;N!=="opening"&&N!=="streaming"&&(i(t,_.sessionId,Xye({events:_.events,chatChoices:_.chatChoices??[],logs:tbe({logs:_.logs,isVisible:u})})),_.quota!==null&&ua.getState().setQuota(_.quota),_.isRunning&&n({shouldReplaceCurrentTurn:!0}))},[y,I,x,i,t,n,u]),l.useEffect(()=>{E&&o(t,ebe({error:E}))},[E,o,t])}async function sbe({queryClient:e}){await e.invalidateQueries({queryKey:fB})}async function rbe({queryClient:e,clientId:t,sessionId:n}){await e.invalidateQueries({queryKey:["copilotSessions",t]}),await e.invalidateQueries({queryKey:["copilotSessionHistory",t,n]})}var ibe=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var i in r)r.hasOwnProperty(i)&&(s[i]=r[i])},e(t,n)};return function(t,n){e(t,n);function s(){this.constructor=t}t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}})(),obe=Object.prototype.hasOwnProperty;function VS(e,t){return obe.call(e,t)}function GS(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var s=[];for(var r in e)VS(e,r)&&s.push(r);return s}function fi(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function qS(e){for(var t=0,n=e.length,s;t<n;){if(s=e.charCodeAt(t),s>=48&&s<=57){t++;continue}return!1}return!0}function Kc(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function pB(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function WS(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(WS(e[t]))return!0}else if(typeof e=="object"){for(var s=GS(e),r=s.length,i=0;i<r;i++)if(WS(e[s[i]]))return!0}}return!1}function p9(e,t){var n=[e];for(var s in t){var r=typeof t[s]=="object"?JSON.stringify(t[s],null,2):t[s];typeof r<"u"&&n.push(s+": "+r)}return n.join(`
966`)}var hB=(function(e){ibe(t,e);function t(n,s,r,i,o){var c=this.constructor,u=e.call(this,p9(n,{name:s,index:r,operation:i,tree:o}))||this;return u.name=s,u.index=r,u.operation=i,u.tree=o,Object.setPrototypeOf(u,c.prototype),u.message=p9(n,{name:s,index:r,operation:i,tree:o}),u}return t})(Error),ss=hB,abe=fi,Yd={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var s=e[t];return delete e[t],{newDocument:n,removed:s}},replace:function(e,t,n){var s=e[t];return e[t]=this.value,{newDocument:n,removed:s}},move:function(e,t,n){var s=x1(n,this.path);s&&(s=fi(s));var r=uu(n,{op:"remove",path:this.from}).removed;return uu(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:s}},copy:function(e,t,n){var s=x1(n,this.from);return uu(n,{op:"add",path:this.path,value:fi(s)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:fm(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},lbe={add:function(e,t,n){return qS(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var s=e.splice(t,1);return{newDocument:n,removed:s[0]}},replace:function(e,t,n){var s=e[t];return e[t]=this.value,{newDocument:n,removed:s}},move:Yd.move,copy:Yd.copy,test:Yd.test,_get:Yd._get};function x1(e,t){if(t=="")return e;var n={op:"_get",path:t};return uu(e,n),n.value}function uu(e,t,n,s,r,i){if(n===void 0&&(n=!1),s===void 0&&(s=!0),r===void 0&&(r=!0),i===void 0&&(i=0),n&&(typeof n=="function"?n(t,0,e,t.path):C1(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;
vendor: 4,418 bytes, line 966
966if(t.op==="move"||t.op==="copy")return o.newDocument=x1(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=fm(e,t.value),o.test===!1)throw new ss("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(n)throw new ss("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return o}}else{s||(e=fi(e));var c=t.path||"",u=c.split("/"),d=e,p=1,g=u.length,A=void 0,E=void 0,x=void 0;for(typeof n=="function"?x=n:x=C1;;){if(E=u[p],E&&E.indexOf("~")!=-1&&(E=pB(E)),r&&(E=="__proto__"||E=="prototype"&&p>0&&u[p-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&A===void 0&&(d[E]===void 0?A=u.slice(0,p).join("/"):p==g-1&&(A=t.path),A!==void 0&&x(t,0,e,A)),p++,Array.isArray(d)){if(E==="-")E=d.length;else{if(n&&!qS(E))throw new ss("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,t,e);qS(E)&&(E=~~E)}if(p>=g){if(n&&t.op==="add"&&E>d.length)throw new ss("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);var o=lbe[t.op].call(t,d,E,e);if(o.test===!1)throw new ss("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return o}}else if(p>=g){var o=Yd[t.op].call(t,d,E,e);if(o.test===!1)throw new ss("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return o}if(d=d[E],n&&p<g&&(!d||typeof d!="object"))throw new ss("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function QE(e,t,n,s,r){if(s===void 0&&(s=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new ss("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");s||(e=fi(e));for(var i=new Array(t.length),o=0,c=t.length;o<c;o++)i[o]=uu(e,t[o],n,!0,r,o),e=i[o].newDocument;return i.newDocument=e,i}function cbe(e,t,n){var s=uu(e,t);if(s.test===!1)throw new ss("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return s.newDocument}function C1(e,t,n,s){if(typeof e!="object"||e===null||Array.isArray(e))throw new ss("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Yd[e.op]){if(typeof e.path!="string")throw new ss("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ss('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ss("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ss("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&WS(e.value))throw new ss("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,i=s.split("/").length;if(r!==i+1&&r!==i)throw new ss("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==s)throw new ss("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},c=mB([o],n);if(c&&c.name==="OPERATION_PATH_UNRESOLVABLE")throw new ss("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ss("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function mB(e,t,n){try{if(!Array.isArray(e))throw new ss("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)QE(fi(t),fi(e),n||!0);else{n=n||C1;for(var s=0;s<e.length;s++)n(e[s],s,t,void 0)}}catch(r){if(r instanceof ss)return r;throw r}}function fm(e,t){if(e===t)return!0;
966if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),s=Array.isArray(t),r,i,o;if(n&&s){if(i=e.length,i!=t.length)return!1;for(r=i;r--!==0;)if(!fm(e[r],t[r]))return!1;return!0}if(n!=s)return!1;var c=Object.keys(e);if(i=c.length,i!==Object.keys(t).length)return!1;for(r=i;r--!==0;)if(!t.hasOwnProperty(c[r]))return!1;for(r=i;r--!==0;)if(o=c[r],!fm(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}const ube=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:ss,_areEquals:fm,applyOperation:uu,applyPatch:QE,applyReducer:cbe,deepClone:abe,getValueByPointer:x1,validate:mB,validator:C1},Symbol.toStringTag,{value:"Module"}));var D_=new WeakMap,dbe=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),fbe=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function pbe(e){return D_.get(e)}function hbe(e,t){return e.observers.get(t)}function mbe(e,t){e.observers.delete(t.callback)}function gbe(e,t){t.unobserve()}function Abe(e,t){var n=[],s,r=pbe(e);if(!r)r=new dbe(e),D_.set(e,r);else{var i=hbe(r,t);s=i&&i.observer}if(s)return s;if(s={},r.value=fi(e),t){s.callback=t,s.next=null;var o=function(){KS(s)},c=function(){clearTimeout(s.next),s.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",c),window.addEventListener("keyup",c),window.addEventListener("mousedown",c),window.addEventListener("keydown",c),window.addEventListener("change",c))}return s.patches=n,s.object=e,s.unobserve=function(){KS(s),clearTimeout(s.next),mbe(r,s),typeof window<"u"&&(window.removeEventListener("mouseup",c),window.removeEventListener("keyup",c),window.removeEventListener("mousedown",c),window.removeEventListener("keydown",c),window.removeEventListener("change",c))},r.observers.set(t,new fbe(t,s)),s}function KS(e,t){t===void 0&&(t=!1);var n=D_.get(e.object);k_(n.value,e.object,e.patches,"",t),e.patches.length&&QE(n.value,e.patches);var s=e.patches;return s.length>0&&(e.patches=[],e.callback&&e.callback(s)),s}function k_(e,t,n,s,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=GS(t),o=GS(e),c=!1,u=o.length-1;u>=0;u--){var d=o[u],p=e[d];if(VS(t,d)&&!(t[d]===void 0&&p!==void 0&&Array.isArray(t)===!1)){var g=t[d];typeof p=="object"&&p!=null&&typeof g=="object"&&g!=null&&Array.isArray(p)===Array.isArray(g)?k_(p,g,n,s+"/"+Kc(d),r):p!==g&&(r&&n.push({op:"test",path:s+"/"+Kc(d),value:fi(p)}),n.push({op:"replace",path:s+"/"+Kc(d),value:fi(g)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:s+"/"+Kc(d),value:fi(p)}),n.push({op:"remove",path:s+"/"+Kc(d)}),c=!0):(r&&n.push({op:"test",path:s,value:e}),n.push({op:"replace",path:s,value:t}))}if(!(!c&&i.length==o.length))for(var u=0;u<i.length;u++){var d=i[u];!VS(e,d)&&t[d]!==void 0&&n.push({op:"add",path:s+"/"+Kc(d),value:fi(t[d])})}}}function Ebe(e,t,n){n===void 0&&(n=!1);var s=[];return k_(e,t,s,"",n),s}const xbe=Object.freeze(Object.defineProperty({__proto__:null,compare:Ebe,generate:KS,observe:Abe,unobserve:gbe},Symbol.toStringTag,{value:"Module"}));Object.assign({},ube,xbe,{JsonPatchError:hB,deepClone:fi,escapePathComponent:Kc,unescapePathComponent:pB});function Cbe({lexicalJson:e,patch:t}){try{const n=structuredClone(e);return QE(n,t,!0,!0).newDocument}catch(n){return console.error("[copilot] failed to apply document patch",n),null}}function ybe({documentId:e,documentVersion:t,patch:n}){return`${e}:${t}:${JSON.stringify(n)}`}function bbe(){const[e]=rn(),t=bt(),n=l.useRef(null);return l.useCallback(({clientId:s,documentId:r,documentVersion:i,patch:o,isReplay:c})=>{const u=ybe({documentId:r,documentVersion:i,patch:o});if(n.current===u)return;if(c){const E=t.getQueryData(["clientDocument",s,r]);if(E!==void 0&&E.version!==i){console.warn("[copilot] replayed document patch skipped: already persisted","base:",i,"current:",E.version);return}}const p={editorState:JSON.parse(JSON.stringify(ff(e.getEditorState().toJSON())))},g=Cbe({lexicalJson:p,patch:o});if(g===null)return;const A=g.editorState;pt(A)&&(e.setEditorState(e.parseEditorState(JSON.stringify(A))),n.current=u)},[e,t])}function Ibe({pill:e}){const t={fileId:e.payload.fileId},n=e.payload.fileName?.trim()??"";n!==""&&(t.fileName=n);const s=e.payload.mimeType??"";s!==""&&(t.mimeType=s);const r={type:"file_attachment",payload:t};return e.isMain===!0&&(r.isMain=!0),r}function Sbe(e){if(!("sourceOptionKey"in e)||e.sourceOptionKey===void 0)return e;const t={...e};return delete t.sourceOptionKey,t}function vbe({pills:e}){const t=[];for(const n of e){if(n.type==="file_attachment"){if(!cB(n))continue;t.push(Ibe({pill:n}));continue}t.push(Sbe(n))}return t}function _be({text:e,pills:t}){const n=t.filter(s=>s.type!=="file_attachment");return{text:e,pills:n}}function gB({displayText:e}){if(e!==null&&e!==void 0&&e.trim()!=="")return e}function Tbe({event:e}
966){const t=gB({displayText:e.displayText});return t!==void 0?t:e.name.trim()===""?null:h.molecules.chat.TOOL_CALL_STARTING.replace("{name}",e.name)}function Nbe({event:e}){const t=gB({displayText:e.displayText});return t!==void 0?t:h.molecules.chat.ANALYZING}function wbe({option:e}){return[{type:"chat_choice",text:e.pillText,payload:e.pillPayload??null,isMain:!0},...e.extraPills??[]]}function Rbe({clientId:e,documentId:t}){const n=bt(),s=It(j=>j.setSessionId),r=It(j=>j.appendUserMessage),i=It(j=>j.removeMessage),o=It(j=>j.truncateAfterLastUserMessage),c=It(j=>j.startStreamOpening),u=It(j=>j.appendAssistantText),d=It(j=>j.appendChatChoice),p=It(j=>j.finishStream),g=It(j=>j.markStreamError),A=It(j=>j.clearStreamError),E=It(j=>j.prepareCopilotChatDocumentRemount),x=It(j=>j.appendToolActionMessage),y=It(j=>j.appendLogMessage),I=It(j=>j.suggestCopilotDocumentName),v=Hi(j=>j.enqueueDocumentMeta),S=Se(j=>j.user),b=sE({user:S}),w=It(j=>j.shiftEcho),_=It(j=>j.documents[t]?.streamStatus??"idle"),N=It(j=>j.documents[t]?.pendingEchoTexts??zE.pendingEchoTexts),R=Tr(j=>j.clearDraft),D=Tr(j=>j.restoreDraft),k=cc(j=>j.clearDocumentUploads),L=bbe(),O=l.useRef(null),P=l.useRef(!1),B=l.useCallback(({documentType:j,documentName:q,fallbackVersion:G})=>{if(j.trim()==="")return;const $=n.getQueryData(["clientDocument",e,t]),J=(()=>{if(q!==void 0&&(!$||jP({name:$.name})))return q})();J!==void 0&&I(t,J);const ne=$?$.version:G,X={documentType:j};J!==void 0&&(X.name=J),v({clientId:e,documentId:t,baseVersion:ne,fields:X,isUserRename:!1})},[e,t,n,I,v]),F=l.useCallback(async({stream:j,signal:q,onStreamOpened:G,onCopilotBusy:$,onClosedWithoutDone:J,onInvalidFilePill:ne,isReplay:X=!1,analyzingVariant:oe})=>{const ie=Hr();c(t,ie,oe);const ee={hasNotified:!1};try{for await(const te of j){if(q.aborted)break;if(ee.hasNotified||(ee.hasNotified=!0,G?.()),te.type==="session"){s(t,te.sessionId);continue}if(te.type==="text"){u(t,te.text,Hr());continue}if(te.type==="document_patch"){if(te.documentId!==t)continue;L({clientId:e,documentId:t,documentVersion:te.documentVersion,patch:te.patch,isReplay:X});continue}if(te.type==="document_meta_update"){if(te.documentId!==t)continue;B({documentType:te.documentType,documentName:te.documentName,fallbackVersion:te.documentVersion});continue}if(te.type==="chat_choice"){if(te.options.length===0)continue;d(t,{kind:"chatChoice",id:Hr(),multi:te.multi,options:te.options});continue}if(te.type==="tool_call"){const le=Tbe({event:te});if(le===null)continue;x(t,{kind:"toolAction",id:Hr(),text:le});continue}if(te.type==="tool_result"){const le=Nbe({event:te});x(t,{kind:"toolAction",id:Hr(),text:le});continue}if(te.type==="log"){if(!b)continue;y(t,{kind:"log",id:Hr(),lines:te.lines});continue}if(te.type==="error"){if(te.message.length>0){g(t,te.message);return}g(t,h.molecules.chat.ERROR_GENERIC);return}if(te.type==="done"){te.usage.quota!==void 0&&ua.getState().setQuota(te.usage.quota),p(t);return}}if(q.aborted)return;if(J!==void 0){p(t),J();return}g(t,h.molecules.chat.ERROR_STREAM_CLOSED_WITHOUT_DONE)}catch(te){if(q.aborted)return;const le=iO({error:te});if(le==="COPILOT_BUSY"&&$!==void 0){p(t),$();return}if(le==="COPILOT_QUOTA_EXCEEDED"){sbe({queryClient:n}),g(t,Sy({error:te}));return}if(le==="COPILOT_INVALID_FILE_PILL"&&ne!==void 0){p(t),ne({error:te});return}g(t,Sy({error:te}))}},[e,t,c,s,u,d,L,B,p,g,x,y,b,n]),z=l.useCallback(async({shouldReplaceCurrentTurn:j,analyzingVariant:q})=>{const G=It.getState().documents[t],$=G?.streamStatus??"idle";if($==="opening"||$==="streaming")return;const J=G?.sessionId??t;j&&o(t),It.getState().requestChatScrollToBottom(),O.current?.abort();const ne=new AbortController;O.current=ne;const X=e$({clientId:e,sessionId:J,signal:ne.signal});await F({stream:X,signal:ne.signal,isReplay:!0,analyzingVariant:q}),!ne.signal.aborted&&await rbe({queryClient:n,clientId:e,sessionId:J})},[e,F,t,n,o]),Q=l.useCallback(async()=>{O.current?.abort();const j=new AbortController;O.current=j;const q=C0({clientId:e,body:{documentId:t,autoInit:!0},signal:j.signal});await F({stream:q,signal:j.signal,analyzingVariant:"autoInit",onCopilotBusy:()=>{z({shouldReplaceCurrentTurn:!1,analyzingVariant:"autoInit"})},onClosedWithoutDone:()=>{z({shouldReplaceCurrentTurn:!0,analyzingVariant:"autoInit"})}})},[e,F,t,z]),M=l.useCallback(async({text:j,pills:q=[]})=>{const G=j.trim(),$=vbe({pills:q});if(!QS({trimmedText:G,pills:$}))return;O.current?.abort();const J=new AbortController;O.current=J;const ne=Hr();r(t,{kind:"user",id:ne,text:G,pills:$}),R(t),k(t);const X={documentId:t};G!==""&&(X.message=G),$.length>0&&(X.pills=$);const oe=C0({clientId:e,body:X,signal:J.signal}),ie={hasOpened:!1},ee={occurred:!1,error:null};if(await F({stream:oe,signal:J.signal,onStreamOpened:()=>{ie.hasOpened=!0},onCopilotBusy:()=>{i(t,ne),z({shouldReplaceCurrentTurn:!1})},onClosedWithoutDone:()=>{z({shouldReplaceCurrentTurn:!0})},onInvalidFilePill:({error:te})=>{ee.occurred=!0,ee.error=te}}),!J.signal.aborted&&!ie.hasOpened&&ee.occurred){i(t,ne),D(t,_be({text:j,pills:q})),ve({type:"failed",message:Sy({error:ee.error}),key:"COPILOT_INVALID_FILE_PILL",duration:4e3});return}},[r,k,R,e,F,t,z,i,D]),K=l.useCallback(async()=>{const j=Tr.getState().documents[t]??Df,q=j.text.trim();if(A(t),QS({trimmedText:q,pills:j.pills})){await M({text:j.text,pills:j.pills});return}const G=It.getState().documents[t];if(G===void 0)return;const $=[...G.messages].reverse().find(J=>J.kind==="user");$!==void 0&&(o(t),i(t,$.id),await M({text:$.text,pills:$.pills??[]}))},[A,t,i,M,o]),W=l.useCallback(async({option:j})=>{const q=wbe({option:j});O.current?.abort();const G=new AbortController;O.current=G;const $=Hr();r(t,{kind:"user",id:$,text:j.pillText,pills:j.extraPills??[]});const J=C0({clientId:e,body:{documentId:t,pills:q},signal:G.signal});await F({stream:J,signal:G.signal,onCopilotBusy:()=>{i(t,$),z({shouldReplaceCurrentTurn:!1})},onClosedWithoutDone:()=>{z({shouldReplaceCurrentTurn:!0})}})},[r,e,F,t,z,i]),H=l.useCallback(async({text:j})=>{O.current?.abort();const q=new AbortController;O.current=q;const $=C0({clientId:e,body:{documentId:t,pills:[{type:"echo_pill",text:j}]},signal:q.signal});await F({stream:$,signal:q.signal,onCopilotBusy:()=>{z({shouldReplaceCurrentTurn:!1})},onClosedWithoutDone:()=>{z({shouldReplaceCurrentTurn:!0})}})},[e,F,t,z]);return l.useEffect(()=>{if(_!=="idle"||N.length===0||P.current)return;const j=N[0];j!==void 0&&(P.current=!0,H({text:j}).finally(()=>{P.current=!1,w(t)}))},[_,t,N,H,w]),l.useEffect(()=>()=>{O.current?.abort();const j=It.getState().documents[t];j?.streamStatus==="opening"&&p(t),j?.streamStatus==="streaming"&&p(t),E(t)},[t,p,E]),{sendMessage:M,sendChoiceReply:W,retryFailedSend:K,reconnectToStream:z,startAutoInitStream:Q}}function Dbe({clientId:e,documentId:t}){const{sendMessage:n,sendChoiceReply:s,retryFailedSend:r,reconnectToStream:i,startAutoInitStream:o}=Rbe({clientId:e,documentId:t});Vye(),nbe({clientId:e,documentId:t,reconnectToStream:i}),Hye({documentId:t,startAutoInitStream:o});const c=It(x=>x.documents[t]?.messages??zE.messages),u=It(x=>x.documents[t]?.streamStatus??"idle"),d=It(x=>x.documents[t]?.isBootstrapped??!1),p=It(x=>x.documents[t]?.errorMessage??null),g=l.useCallback(async({text:x,pills:y})=>{await n({text:x,pills:y})},[n]),A=l.useCallback(async({option:x})=>{await s({option:x})},[s]),E=l.useCallback(async()=>{await r()},[r]);return{messages:c,streamStatus:u,isBootstrapped:d,errorMessage:p,sendMessage:g,sendChoiceReply:A,retryFailedSend:E}}function kbe({multi:e,option:t}){return!!(t.isBack||!e)}const Obe=({clientId:e,documentId:t})=>{const{messages:n,streamStatus:s,isBootstrapped:r,errorMessage:i,sendMessage:o,sendChoiceReply:c,retryFailedSend:u}=Dbe({clientId:e,documentId:t}),d=Tr(R=>R.addPill),p=Tr(R=>R.clearChatChoiceSelectionPills),g=Tr(R=>R.documents[t]?.pills??Df.pills),A=ua(R=>R.quota),E=ua(R=>R.loadStatus),x=l.useMemo(()=>{const R=new Set;for(const D of g)D.type==="chat_choice"&&D.sourceOptionKey!==void 0&&R.add(D.sourceOptionKey);return R},[g]),y=l.useMemo(()=>uB({quota:A,loadStatus:E}),[A,E]),I=l.useMemo(()=>zye({streamStatus:s}),[s]),v=l.useMemo(()=>s!=="error"?null:i,[s,i]),S=l.useMemo(()=>dB({isBootstrapped:r,streamStatus:s,isCopilotQuotaReady:y}),[r,y,s]),b=l.useRef(null);l.useEffect(()=>{const R=b.current;if(R===null)return;const D=k=>{Qye({target:k.target})&&k.preventDefault()};return R.addEventListener("wheel",D,{passive:!1}),()=>{R.removeEventListener("wheel",D)}},[]);const w=l.useCallback(({text:R,pills:D})=>{o({text:R,pills:D})},[o]),_=l.useCallback(()=>{u()},[u]),N=l.useCallback(({multi:R,option:D,optionKey:k})=>{if(kbe({multi:R,option:D})){D.isBack&&p(t),c({option:D});return}d(t,{type:"chat_choice",text:D.pillText,payload:D.pillPayload??null,sourceOptionKey:k});for(const L of D.extraPills??[])L.type!=="echo_pill"&&d(t,{...L,sourceOptionKey:k})},[d,p,t,c]);return a.jsxs("div",{ref:b,className:"flex h-full min-h-0 w-full flex-col rounded-t-[8px] bg-white shadow-[0px_2px_5px_0px_#0000000A,0px_10px_10px_0px_#00000008,0px_22px_13px_0px_#00000005,0px_39px_16px_0px_#00000003,0px_61px_17px_0px_#00000000]",children:[S&&a.jsx(ct,{isWithWrapper:!0,isNoPadding:!0}),!S&&a.jsxs(a.Fragment,{children:[a.jsx(Aye,{}),a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[a.jsx(tye,{clientId:e,messages:n,isStreamBusy:I,isChatChoiceClickBlocked:I,selectedChatChoiceKeys:x,onChatChoiceOptionClick:N,streamErrorMessage:v,onStreamErrorRetry:_}),a.jsx(Uye,{clientId:e,documentId:t,isSendDisabled:I,onSubmit:w})]})]})]})},Pbe=e=>l.createElement("svg",{width:108,height:108,viewBox:"0 0 108 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.3839 12.8373C24.3183 17.7547 19.5194 25.4031 16.3857 30.5946C14.857 33.1272 13.3119 35.63 12.1422 38.4024C11.7603 39.3076 11.3275 40.1806 10.9353 41.0794C10.7858 41.4222 10.2181 42.0639 10.546 42.139C10.839 42.2062 10.994 41.6858 11.2176 41.4586C12.8379 39.8128 14.5019 38.2237 16.1521 36.6178C20.945 31.9537 25.7502 27.3149 30.6736 22.8314C35.2672 18.648 39.7616 14.12 44.5915 10.2942C46.206 9.01544 47.7926 7.70063 49.4482 6.4907C51.4494 5.02828 49.0252 7.2542 48.6307 7.68418C38.5526 18.6677 30.4078 31.5437 21.2522 43.4664C17.5055 48.3453 13.2722 52.9187 9.98152 58.2343C9.03654 59.7608 8.19697 61.3671 7.25632 62.8967C6.89935 63.4772 6.29422 64.1203 6.01052 64.7706C5.93705 64.939 6.35643 64.7785 6.49716 64.6813C9.00408 62.9514 11.3516 60.7906 13.7189 58.8366C23.9182 50.4185 33.9702 41.77 44.0465 33.16C52.5532 25.8912 60.7792 18.0975 69.5271 11.2089C71.5103 9.64717 77.6757 5.34572 75.5809 6.70262C75.1114 7.00678 74.1008 7.91953 73.8874 8.10803C70.9739 10.6822 68.0748 13.283 65.1862 15.8936C56.5607 23.6891 48.6141 32.191 40.8055 41.0348C33.2819 49.5556 25.5593 57.8775 18.1766 66.5552C17.9855 66.7798 17.8094 66.9818 17.6607 67.2468C17.5784 67.3936 17.5024 67.484 17.398 67.6037C16.6726 68.4349 19.1895 66.458 20.0745 65.8637C41.3048 51.6071 62.4474 37.1299 82.4134 20.634C82.5755 20.5001 82.7972 20.4289 82.9 20.2325C83.3411 19.39 81.52 21.4026 80.8756 22.0506C74.8262 28.1337 68.985 34.4661 63.2591 40.9455C56.5012 48.593 49.891 56.4265 42.9856 63.9006C40.578 66.5065 37.9696 68.8233 35.54 71.3849C34.1361 72.8651 32.9776 74.6488 31.5495 76.0808C29.3227 78.3138 27.23 80.716 25.009 82.9517C23.7848 84.184 22.4664 85.3104 21.0867 86.309C20.5583 86.6915 20.0271 87.075 19.5392 87.5248C19.2348 87.8054 18.2876 88.2942 18.6632 88.4172C18.9714 88.5181 19.2739 88.1843 19.5586 88.0156C23.1137 85.9094 26.5863 83.5566 30.0604 81.2897C41.6322 73.7392 53.2268 66.1629 64.5828 58.1897C70.1095 54.3093 75.5692 50.2829 81.0216 46.266C82.1209 45.4561 83.2185 44.5488 84.3794 43.8456C84.4881 43.7797 84.6072 43.7737 84.6714 43.6448C85.2513 42.4819 86.6737 41.5764 87.6107 40.834C88.2201 40.3512 88.6777 39.9196 89.1875 39.2947C89.7995 38.5443 92.1593 36.0809 89.3529 38.7036C79.4799 47.9301 69.9398 57.5891 60.6897 67.626C52.6373 76.3632 44.5297 84.9593 36.0266 93.1242C33.442 95.606 30.8162 98.0324 28.2598 100.553C27.8216 100.985 26.5108 102.241 27.0335 101.958C29.0364 100.874 31.0562 99.1782 32.8732 97.8312C38.733 93.4868 44.5114 89.0005 50.3144 84.5579C62.1391 75.5053 73.9423 66.3682 86.2676 58.2232C91.3789 54.8454 96.5586 51.614 101.655 48.2068C103.261 47.1333 98.8478 51.0009 97.4214 52.3673C88.3802 61.0279 79.5448 70.0168 71.2985 79.6724C67.1862 84.4874 63.4149 89.8291 58.8599 94.128C57.811 95.118 61.2623 92.6709 62.4416 91.8972C68.9593 87.6214 75.4203 83.236 81.81 78.7131C88.1053 74.257 94.4733 69.7913 100.487 64.8375C101.901 63.6731 97.8651 67.4626 96.5455 68.7637C91.5812 73.6584 87.0605 79.0104 82.3745 84.2455C78.5407 88.5285 74.6969 92.8073 70.7924 97.0058C69.6393 98.2456 68.5157 99.6195 67.2788 100.754C64.5532 103.252 73.0602 96.2691 7
9665.9313 93.9942C78.9958 91.5661 82.0762 89.1754 85.2165 86.8779C85.831 86.4283 86.4403 85.9689 87.0657 85.5394C87.43 85.2892 88.2832 84.5843 88.2726 85.0709C88.2532 85.9564 87.2888 87.3531 86.9197 88.0602C86.1904 89.4576 85.4561 90.8358 84.8271 92.2988C84.6825 92.6352 83.3231 95.416 83.6203 95.7565",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("g",{clipPath:"url(#clip0_copilot_file_drop_overlay)"},l.createElement("path",{d:"M57.4712 32.0642L46.2829 33.2402C35.0945 34.4161 31.0895 39.3618 32.2655 50.5502L33.6766 63.9762C34.8525 75.1646 39.7983 79.1696 50.9866 77.9936",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.252 48.0842L77.9575 54.7973",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.2536 48.0841L68.3029 49.0248C61.5899 49.7304 59.117 47.7279 58.4115 41.0149L57.4707 32.0642L77.2536 48.0841Z",stroke:"black",strokeWidth:4,strokeLinejoin:"round"}),l.createElement("path",{d:"M78.7843 68.4688H58.9853M68.8848 58.5693V78.3683V58.5693Z",stroke:"black",strokeWidth:4})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_copilot_file_drop_overlay"},l.createElement("rect",{width:54,height:54,fill:"white",transform:"translate(24.8301 30.9695) rotate(-6)"})))),Lbe=()=>a.jsxs("div",{className:"pointer-events-none flex flex-col items-center",children:[a.jsx(Pbe,{className:"size-[108px] shrink-0"}),a.jsx("div",{className:"roboto-flex-100-600-1 mt-5 text-center text-[24px] leading-[28px] text-zinc-950",children:h.molecules.chat.FILE_DROP_OVERLAY_TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 mt-2 text-center text-[16px] leading-[20px] text-zinc-950",children:h.molecules.chat.FILE_DROP_OVERLAY_SUBTITLE})]});function Mbe({dataTransfer:e}){if(e===null)return[];const t=[];for(let n=0;n<e.files.length;n+=1)t.push(e.files[n]);return t}function dh({dataTransfer:e}){return!(e===null||!Array.from(e.types).includes("Files"))}function jbe({onFilesDrop:e}){const[t,n]=l.useState(!1),s=l.useRef(0),r=l.useCallback(()=>{s.current=0,n(!1)},[]);l.useEffect(()=>{const c=g=>{dh({dataTransfer:g.dataTransfer})&&(s.current+=1,n(!0))},u=g=>{dh({dataTransfer:g.dataTransfer})&&(s.current-=1,!(s.current>0)&&(s.current=0,n(!1)))},d=g=>{dh({dataTransfer:g.dataTransfer})&&g.preventDefault()},p=()=>{r()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",d),window.addEventListener("dragend",p),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",d),window.removeEventListener("dragend",p)}},[r]);const i=l.useCallback(c=>{dh({dataTransfer:c.dataTransfer})&&c.preventDefault()},[]),o=l.useCallback(c=>{if(!dh({dataTransfer:c.dataTransfer}))return;c.preventDefault(),r();const u=Mbe({dataTransfer:c.dataTransfer});u.length!==0&&e({files:u})},[e,r]);return{isOverlayVisible:t,handleOverlayDragOver:i,handleOverlayDrop:o}}const Bbe=({clientId:e,documentId:t})=>{const{attachSelectedFiles:n}=lB({clientId:e,documentId:t}),s=l.useCallback(({files:c})=>{n({files:c})},[n]),{isOverlayVisible:r,handleOverlayDragOver:i,handleOverlayDrop:o}=jbe({onFilesDrop:s});return r?Wn.createPortal(a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-white/[0.72] backdrop-blur-xl",onDragOver:i,onDrop:o,children:a.jsx(Lbe,{})}),document.body):null},AB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M15.8366 16.6667H7.0866L3.57826 13.0834C3.42306 12.9272 3.33594 12.716 3.33594 12.4959C3.33594 12.2757 3.42306 12.0645 3.57826 11.9084L11.9116 3.57503C12.0677 3.41982 12.2789 3.3327 12.4991 3.3327C12.7193 3.3327 12.9305 3.41982 13.0866 3.57503L17.2533 7.7417C17.4085 7.89783 17.4956 8.10904 17.4956 8.3292C17.4956 8.54935 17.4085 8.76056 17.2533 8.9167L9.5866 16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M15 11.0833L9.75 5.83331",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),O_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50217)"},l.createElement("path",{d:"M5.83594 4.16666H10.8359C11.6095 4.16666 12.3514 4.47395 12.8983 5.02093C13.4453 5.56791 13.7526 6.30978 13.7526 7.08332C13.7526 7.85687 13.4453 8.59874 12.8983 9.14572C12.3514 9.6927 11.6095 9.99999 10.8359 9.99999H5.83594V4.16666Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10.8359 10H11.6693C12.4428 10 13.1847 10.3073 13.7317 10.8543C14.2786 11.4013 14.5859 12.1431 14.5859 12.9167C14.5859 13.6902 14.2786 14.4321 13.7317 14.9791C13.1847 15.526 12.4428 15.8333 11.6693 15.8333H5.83594V10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50217"},l.createElement("rect",{width:20,height:20,fill:"white"})))),P_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50222)"},l.createElement("path",{d:"M9.16406 4.16666H14.1641",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.83594 15.8333H10.8359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.6693 4.16666L8.33594 15.8333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50222"},l.createElement("rect",{width:20,height:20,fill:"white"})))),L_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50228)"},l.createElement("path",{d:"M5.83594 4.16666V8.33332C5.83594 9.43839 6.27492 10.4982 7.05633 11.2796C7.83773 12.061 8.89754 12.5 10.0026 12.5C11.1077 12.5 12.1675 12.061 12.9489 11.2796C13.7303 10.4982 14.1693 9.43839 14.1693 8.33332V4.16666",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M4.16406 15.8333H15.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50228"},l.createElement("rect",{width:20,height:20,fill:"white"})))),M_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e}
966,l.createElement("g",{clipPath:"url(#clip0_18283_6077)"},l.createElement("path",{d:"M2.5 15.8334H5.83333L14.5833 7.08338C15.0254 6.64135 15.2737 6.04184 15.2737 5.41671C15.2737 4.79159 15.0254 4.19208 14.5833 3.75005C14.1413 3.30802 13.5418 3.05969 12.9167 3.05969C12.2915 3.05969 11.692 3.30802 11.25 3.75005L2.5 12.5V15.8334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M17.5026 12.5V15.8333H10.8359L12.5026 14.1667L14.1693 12.5H17.5026Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18283_6077"},l.createElement("rect",{width:20,height:20,fill:"white"})))),EB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M6.66406 5H17.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.66406 10H17.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.66406 15H17.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H2.50833",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 10H2.50833",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H2.50833",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),xB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50241)"},l.createElement("path",{d:"M9.16406 5H16.6641",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 10H16.6641",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 15H16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 13.3333C3.33594 12.8913 3.51153 12.4674 3.82409 12.1548C4.13665 11.8423 4.56058 11.6667 5.0026 11.6667C5.44463 11.6667 5.86855 11.8423 6.18112 12.1548C6.49368 12.4674 6.66927 12.8913 6.66927 13.3333C6.66927 13.8258 6.2526 14.1667 5.83594 14.5833L3.33594 16.6667H6.66927",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.0026 8.33334V3.33334L3.33594 5.00001",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50241"},l.createElement("rect",{width:20,height:20,fill:"white"})))),CB=l.createContext(new Set),yB=l.createContext(()=>{}),bB=e=>{const t=l.useId(),n=l.useContext(yB);l.useEffect(()=>{if(e)return n(t,!0),()=>{n(t,!1)}},[e,t,n])},j_=()=>l.useContext(CB).size>0,h9="0px 0.27px 2.06px 0px #00000008, 0px 0.89px 6.92px 0px #0000000C, 0px 4px 31px 0px #00000014",IA=({value:e,options:t,onChange:n,placeholder:s="—",triggerClassName:r,iconWrapperClassName:i,triggerSlot:o,menuPlacement:c="bottom-start",onOpenChange:u,disabled:d=!1})=>{const[p,g]=l.useState(!1),A=l.useRef(null),E=l.useRef(null),x=l.useRef(null);bB(p),l.useEffect(()=>{u!==void 0&&u(p)},[p,u]);const y=o!=null,I=l.useMemo(()=>t.find(_=>_.value===e)??null,[t,e]),v=l.useCallback(_=>{const N=_.target;N instanceof Node&&(A.current?.contains(N)||x.current?.contains(N)||g(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}),[v]),l.useEffect(()=>{if(!p)return;const _=N=>{N.key==="Escape"&&g(!1)};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[p]),l.useEffect(()=>{if(!p)return;const _=N=>{const R=N.target;R instanceof Element&&!R.contains(A.current)||g(!1)};return window.addEventListener("scroll",_,!0),()=>{window.removeEventListener("scroll",_,!0)}},[p]),l.useEffect(()=>{if(!p)return;const _=E.current,N=x.current;if(!_||!N)return;const R=y?Math.max(_.offsetWidth,180):_.offsetWidth;N.style.minWidth=`${R}px`,N.style.boxShadow=h9;const D=Ji(_,N,async()=>{const k=c==="right-start",L=await Ei(_,N,{placement:c,strategy:"fixed",middleware:[_o(k?6:0),s2({fallbackPlacements:k?["left-start","right-end","left-end"]:["top-start","bottom-end","top-end"]}
966),Ai({padding:8,crossAxis:!0})]});Object.assign(N.style,{left:`${L.x}px`,top:`${L.y}px`,boxShadow:h9,minWidth:`${R}px`})});return()=>D()},[p,y,c]);const S=l.useCallback(()=>{d||g(_=>!_)},[d]),b=l.useCallback(_=>{n(_),g(!1)},[n]),w=l.useCallback(_=>{_.preventDefault()},[]);return a.jsxs("div",{ref:A,className:"relative inline-flex",children:[a.jsx("button",{ref:E,type:"button",disabled:d,"aria-haspopup":"listbox","aria-expanded":p,className:Y(y?"inline-flex size-6 shrink-0 items-center justify-center rounded-md bg-transparent p-0 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 cursor-pointer disabled:cursor-default":"flex h-8 w-full items-center justify-between gap-1 rounded-md bg-white px-2 text-left text-[12px] font-medium text-zinc-950 hover:bg-zinc-100 cursor-pointer disabled:cursor-default group",r,p&&"bg-zinc-100"),onMouseDown:w,onClick:S,children:y?a.jsx("span",{className:"inline-flex items-center justify-center text-current",children:o}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[a.jsx("div",{className:Y("flex items-center justify-center size-5 group-hover:text-[#556FD5] rounded-md text-zinc-600",i,p&&"text-[#556FD5]!"),children:I?.icon?a.jsx("span",{className:"inline-flex size-5 min-w-5 shrink-0 items-center justify-center",children:I.icon}):null}),a.jsx("span",{className:"min-w-0 flex-1 w-[38px] truncate roboto-flex-100-400-1 text-zinc-950 text-[14px] leading-[20px]",children:I?.triggerLabel??I?.label??s})]}),a.jsx(al,{className:Y("size-4 shrink-0 text-zinc-500 transition-transform duration-0",p&&"rotate-180")})]})}),p?Wn.createPortal(a.jsx("div",{ref:x,role:"listbox",className:Y("fixed z-50 max-h-64 overflow-auto rounded-md bg-white p-1 gap-1 flex flex-col",c==="bottom-start"&&"mt-1.5"),children:t.map(_=>{const N=_.value===e;return a.jsxs("button",{type:"button",role:"option","aria-selected":N,className:Y("flex w-full items-center px-2 py-1.5 text-[14px] leading-[20px] hover:bg-zinc-50 truncate group gap-2 cursor-pointer roboto-flex-100-400-1 text-zinc-950",N&&"bg-zinc-100"),onMouseDown:w,onClick:()=>b(_.value),children:[a.jsx("div",{className:Y("flex items-center justify-center size-6 rounded-md",N&&"text-[#556FD5]"),children:_.icon?a.jsx("span",{className:"inline-flex size-5 min-w-5 shrink-0 items-center justify-center",children:_.icon}):null}),_.label]},_.value)})}),document.body):null]})},IB=e=>e==="text"||e==="h1"||e==="h2"||e==="h3"||e==="h4"||e==="h5",SB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18168_50272)"},l.createElement("path",{d:"M5 3.33334H15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 3.33334V16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M8.33594 16.6667H11.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 5L5 3.33333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M15 5L15 3.33333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18168_50272"},l.createElement("rect",{width:20,height:20,fill:"white"})))),vB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18168_50591)"},l.createElement("path",{d:"M5 3.33333H15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 3.33333V16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18168_50591"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Fbe=[{value:"arial",label:"Arial",icon:a.jsx(vB,{})},{value:"times",label:"Times New Roman",icon:a.jsx(SB,{})}],Ds={LEFT:"layout-left",CENTER:"layout-center",RIGHT:"layout-right",JUSTIFY:"layout-justify",OUTDENT:"layout-outdent",INDENT:"layout-indent"},Ube=e=>e==="center"?Ds.CENTER:e==="right"||e==="end"?Ds.RIGHT:e==="justify"?Ds.JUSTIFY:Ds.LEFT,_B=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18274_50733)"},l.createElement("path",{d:"M3.33594 5H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.66406 10H13.3307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18274_50733"},l.createElement("rect",{width:20,height:20,fill:"white"})))),TB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18274_4831)"},l.createElement("path",{d:"M3.33594 5H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 15H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18274_4831"},l.createElement("rect",{width:20,height:20,fill:"white"})))),NB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18274_31526)"},l.createElement("path",{d:"M3.33594 5H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H11.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 15H15.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18274_31526"},l.createElement("rect",{width:20,height:20,fill:"white"})))),wB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18274_3325)"},l.createElement("path",{d:"M3.33594 5H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M8.33594 10H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 15H16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18274_3325"},l.createElement("rect",{width:20,height:20,fill:"white"})))),B_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_2702)"},l.createElement("path",{d:"M16.6693 5H10.8359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M16.6641 10H9.16406",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M16.6693 15H10.8359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.66927 6.66675L3.33594 10.0001L6.66927 13.3334",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_2702"},l.createElement("rect",{width:20,height:20,fill:"white"})))),F_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M16.6667 5H7.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M16.6693 10H10.8359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M16.6667 15H7.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 6.66675L6.66927 10.0001L3.33594 13.3334",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),zbe=[{value:Ds.LEFT,label:h.molecules.editor.layoutDropdown.LEFT,icon:a.jsx(NB,{})},{value:Ds.CENTER,label:h.molecules.editor.layoutDropdown.CENTER,icon:a.jsx(_B,{})},{value:Ds.RIGHT,label:h.molecules.editor.layoutDropdown.RIGHT,icon:a.jsx(wB,{})},{value:Ds.JUSTIFY,label:h.molecules.editor.layoutDropdown.JUSTIFY,icon:a.jsx(TB,{})},{value:Ds.OUTDENT,label:h.molecules.editor.layoutDropdown.DECREASE_INDENT,icon:a.jsx(B_,{})},{value:Ds.INDENT,label:h.molecules.editor.layoutDropdown.INCREASE_INDENT,icon:a.jsx(F_,{})}],RB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18168_50602)"},l.createElement("path",{d:"M15.8307 15V8.33334L14.1641 10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 15H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H10.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 5H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18168_50602"},l.createElement("rect",{width:20,height:20,fill:"white"})))),DB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18168_50616)"},l.createElement("path",{d:"M14.1641 10C14.1641 9.55798 14.3397 9.13406 14.6522 8.8215C14.9648 8.50894 15.3887 8.33334 15.8307 8.33334C16.2728 8.33334 16.6967 8.50894 17.0092 8.8215C17.3218 9.13406 17.4974 9.55798 17.4974 10C17.4974 10.4925 17.1499 11.0983 16.8174 11.5483L14.1641 15.0008H17.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 15H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H10.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 5H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18168_50616"},l.createElement("rect",{width:20,height:20,fill:"white"})))),kB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_h3)"},l.createElement("path",{d:"M3.33594 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 15H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H10.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 5H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M15.83 11.67a1.67 1.67 0 1 0 -1.67 -1.67",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M14.17 13.33a1.67 1.67 0 1 0 1.67 -1.67",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_h3"},l.createElement("rect",{width:20,height:20,fill:"white"})))),OB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_h4)"},l.createElement("path",{d:"M3.33594 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 15H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H10.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 5H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M14.17 8.33V11.67H17.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M17.5 8.33V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_h4"},l.createElement("rect",{width:20,height:20,fill:"white"})))),PB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_h5)"},l.createElement("path",{d:"M3.33594 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 5V15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 15H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 15H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10H10.0026",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M2.5 5H4.16667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.16406 5H10.8307",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M17.5 8.33H14.17V11.67H17.5V15H14.17",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElem
966ent("clipPath",{id:"clip0_h5"},l.createElement("rect",{width:20,height:20,fill:"white"})))),LB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18168_50254)"},l.createElement("path",{d:"M6.66406 5L16.6641 5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 10L16.6693 10",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 15H13.3359",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18168_50254"},l.createElement("rect",{width:20,height:20,fill:"white"})))),MB=[{value:"text",label:h.molecules.editor.textStyleDropdown.TEXT,triggerLabel:h.molecules.editor.textStyleDropdown.TEXT,icon:a.jsx(LB,{})},{value:"h1",label:h.molecules.editor.textStyleDropdown.TITLE,triggerLabel:h.molecules.editor.textStyleDropdown.TITLE,icon:a.jsx(RB,{})},{value:"h2",label:h.molecules.editor.textStyleDropdown.SUBTITLE,triggerLabel:h.molecules.editor.textStyleDropdown.SUBTITLE,icon:a.jsx(DB,{})},{value:"h3",label:h.molecules.editor.textStyleDropdown.HEADING_3,triggerLabel:h.molecules.editor.textStyleDropdown.HEADING_3,icon:a.jsx(kB,{})},{value:"h4",label:h.molecules.editor.textStyleDropdown.HEADING_4,triggerLabel:h.molecules.editor.textStyleDropdown.HEADING_4,icon:a.jsx(OB,{})},{value:"h5",label:h.molecules.editor.textStyleDropdown.HEADING_5,triggerLabel:h.molecules.editor.textStyleDropdown.HEADING_5,icon:a.jsx(PB,{})}];function Qbe({selection:e}){const t=ca();
966return e.isBackward()?(t.anchor.set(e.focus.key,e.focus.offset,e.focus.type),t.focus.set(e.anchor.key,e.anchor.offset,e.anchor.type),t):(t.anchor.set(e.anchor.key,e.anchor.offset,e.anchor.type),t.focus.set(e.focus.key,e.focus.offset,e.focus.type),t)}function Hbe({node:e}){return $e(e)||Zo(e)||Ne(e)&&e.isInline()||nn(e)&&e.isInline()?e:null}function Vbe({createNode:e}){return e||yS}function Gbe({parentNode:e,currentNodeParent:t}){return!(e===null||!e.is(t))}function qbe({finalMark:e,isBackward:t}){if(Ne(e)){if(t){e.selectStart();return}e.selectEnd()}}function m9({selection:e,isBackward:t,id:n,createNode:s}){const r=Qbe({selection:e}),i={currentNodeParent:void 0,lastCreatedMarkNode:void 0},o=r.extract();for(const c of o){const u=i.lastCreatedMarkNode;if(Ne(u)&&u.isParentOf(c)||Ihe(c))continue;const d=Hbe({node:c});if(d===null){i.currentNodeParent=void 0,i.lastCreatedMarkNode=void 0;continue}if(d.is(i.currentNodeParent))continue;const p=d.getParent();if(Gbe({parentNode:p,currentNodeParent:i.currentNodeParent})||(i.lastCreatedMarkNode=void 0),i.currentNodeParent=p,i.lastCreatedMarkNode===void 0){const g=Vbe({createNode:s});i.lastCreatedMarkNode=g([n]),d.insertBefore(i.lastCreatedMarkNode)}i.lastCreatedMarkNode.append(d)}qbe({finalMark:i.lastCreatedMarkNode,isBackward:t})}const U_=3,HE=e=>{if(e===null)return null;const{overflowY:t}=window.getComputedStyle(e);return t==="auto"||t==="scroll"||t==="overlay"?e:HE(e.parentElement)},z_=({element:e})=>{if(e===null)return null;const t=HE(e);return t===null?null:t.scrollHeight-t.clientHeight<=1?z_({element:t.parentElement}):t},Wbe=({editor:e})=>{requestAnimationFrame(()=>{const t=e.getRootElement();if(!t)return;const n=HE(t);if(n!==null){n.scrollTo({top:0,behavior:"auto"});return}window.scrollTo({top:0,behavior:"auto"})})},jB=(e,t)=>{const n=e.getRangeAt(0);let s;if(e.anchorNode===t){let r=t;for(;r.firstElementChild!=null;)r=r.firstElementChild;s=r.getBoundingClientRect()}else s=n.getBoundingClientRect();return s},Kbe=10,$be=5,SA=(e,t,n,s=Kbe,r=$be)=>{const i=n.parentElement;if(e===null||!i){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}const o=t.getBoundingClientRect(),c=n.getBoundingClientRect(),u=i.getBoundingClientRect();let d=e.top-o.height-s,p=e.left-r;const g=window.getSelection();if(g&&g.rangeCount>0){const E=g.getRangeAt(0).startContainer;if(E.nodeType===Node.ELEMENT_NODE||E.parentElement){const x=E.nodeType===Node.ELEMENT_NODE?E:E.parentElement,y=window.getComputedStyle(x).textAlign;(y==="right"||y==="end")&&(p=e.right-o.width+r)}}d<u.top&&(d+=o.height+e.height+s*2),p+o.width>u.right&&(p=u.right-o.width-r),p<u.left&&(p=u.left+r),d-=c.top,p-=c.left,t.style.opacity="1",t.style.transform=`translate(${p}px, ${d}px)`},Ybe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M5.83594 5L14.1693 5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.83594 14.1667L10.0026 10L14.1693 14.1667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),Xbe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M5.83594 5.8333L10.0026 10L14.1693 5.8333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.83594 15L14.1693 15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),$S="open-editor-comment-dialog",g9="open-editor-comment-by-id",YS="editor-comment-dialog-state",BB=mt("OPEN_COMMENT_DIALOG"),FB=mt("OPEN_NEXT_OR_FIRST_COMMENT_DIALOG"),UB="__draft__:";function y1({commentId:e}){return!!e.startsWith(UB)}function Jbe(){return`${UB}${crypto.randomUUID()}`}function Q_(){const e=[],t=n=>{if(qu(n)&&e.push(n),!!Ne(n))for(const s of n.getChildren())t(s)};return t(St()),e}function xh(){const e=new Set,t=[];for(const n of Q_())for(const s of n.getIDs())y1({commentId:s})||e.has(s)||(e.add(s),t.push(s));return t}function Ku({commentId:e}){return Q_().filter(t=>t.hasID(e))}function Ch({commentId:e}){const t=Ku({commentId:e});return t.length===0?"":t[0].getCommentText()}function A9({commentId:e,text:t}){for(const n of Ku({commentId:e}))n.setCommentText(t)}
966function Pb({commentId:e}){for(const t of Ku({commentId:e})){if(t.getIDs().length<=1){She(t);continue}t.deleteID(e)}}function E9({draftId:e,text:t,newCommentId:n}){for(const s of Ku({commentId:e}))s.deleteID(e),s.addID(n),s.setCommentText(t)}function Zbe({isViewingThisDraft:e,liveText:t,storedDraftText:n}){return e?t:n}function zB({node:e}){if(qu(e))return e.getIDs();const t=e.getParent();return t===null?[]:zB({node:t})}function eIe({selection:e}){const t=new Set;for(const n of e.getNodes())for(const s of zB({node:n}))y1({commentId:s})||t.add(s);return Array.from(t)}function Xc({commentId:e}){const t=Ku({commentId:e});return t.length===0?null:t[0].getKey()}function QB({element:e}){return e===null?0:e.getBoundingClientRect().bottom}function tIe({editor:e,commentIds:t,anchorElem:n}){if(t.length===0)return-1;const s=QB({element:n.previousElementSibling}),r=n.getBoundingClientRect().top,i=Math.max(s,r,0);return e.getEditorState().read(()=>t.findIndex(o=>{const c=Xc({commentId:o});if(c===null)return!1;const u=e.getElementByKey(c);return u===null?!1:u.getBoundingClientRect().top>=i}))}function nIe({startNode:e,ids:t}){const n=t.findIndex(s=>{const r=Xc({commentId:s});if(r===null)return!1;const i=Xt(r);return i===null?!1:!!e.isBefore(i)});return n===-1?t.length:n}function HB({selection:e}){return e.anchor.isBefore(e.focus)?e.anchor:e.focus}function sIe({selection:e}){return e.anchor.isBefore(e.focus)?e.focus:e.anchor}function rIe({selection:e,commentId:t}){const n=Ku({commentId:t});if(n.length===0)return null;const s=HB({selection:e}),r=sIe({selection:e}),i=n[0].getFirstChild(),o=n[n.length-1].getLastChild();if(i===null||o===null)return null;const c=ca();c.anchor.set(i.getKey(),0,"text");const u=o.getTextContentSize();c.focus.set(o.getKey(),u,"text");const d=()=>s.isBefore(c.anchor)?s:c.anchor,p=()=>c.focus.isBefore(r)?r:c.focus,g=d(),A=p(),E=ca();return E.anchor.set(g.key,g.offset,g.type),E.focus.set(A.key,A.offset,A.type),E}function XS(){return crypto.randomUUID()}function iIe(){const e=[],t=({node:n,inheritedIds:s})=>{if(qu(n)){const r=new Set(s);for(const i of n.getIDs())r.add(i);for(const i of n.getChildren())t({node:i,inheritedIds:r});return}if(Ne(n)){for(const r of n.getChildren())t({node:r,inheritedIds:s});return}e.push({leafKey:n.getKey(),ids:new Set(s)})};return t({node:St(),inheritedIds:new Set}),e}function oIe({leafEntries:e,commentId:t}){const n=[];for(const[s,r]of e.entries())r.ids.has(t)&&n.push(s);return n}function aIe({indices:e}){const t=[];for(const[n,s]of e.entries()){if(n===0){t.push([s]);continue}const r=e[n-1];if(s===r+1){t[t.length-1].push(s);continue}t.push([s])}return t}function lIe({leafKey:e,commentId:t}){const n=[],s=({node:i})=>{i!==null&&(qu(i)&&i.hasID(t)&&n.push(i.getKey()),s({node:i.getParent()}))},r=Xt(e);return r===null?[]:(s({node:r.getParent()}),n)}function cIe(){const e=iIe(),t=xh(),n=[];for(const s of t){const r=oIe({leafEntries:e,commentId:s});if(r.length===0)continue;const i=aIe({indices:r});if(i.length<=1)continue;const o=Ch({commentId:s});for(const[c,u]of i.entries()){if(c===0)continue;const d=XS(),p=new Set;for(const g of u){const A=e[g].leafKey,E=lIe({leafKey:A,commentId:s});for(const x of E)p.add(x)}for(const g of p)n.push({nodeKey:g,oldCommentId:s,newCommentId:d,text:o})}}return n}function uIe({mutations:e}){for(const t of e){const n=Xt(t.nodeKey);qu(n)&&n.hasID(t.oldCommentId)&&(n.deleteID(t.oldCommentId),n.addID(t.newCommentId),n.setCommentText(t.text))}}const x9="comment-auto-split",dIe="historic",C9="history-merge",fIe=({anchorElem:e})=>{const[t]=rn(),n=l.useRef(null),s=l.useRef(null),[r,i]=l.useState(!1),[o,c]=l.useState(""),[u,d]=l.useState([]),[p,g]=l.useState(null),[A,E]=l.useState(null),[x,y]=l.useState(null),[I,v]=l.useState(null),S=l.useRef(null);l.useEffect(()=>{S.current=x},[x]);const b=l.useRef(null);l.useEffect(()=>{b.current=p},[p]);const w=l.useRef("");l.useEffect(()=>{w.current=o},[o]);const _=l.useMemo(()=>!(x===null||p!==x.draftId),[p,x]),N=l.useMemo(()=>!(p===null||_),[p,_]),R=l.useMemo(()=>x!==null?u.length+1:u.length,[u.length,x]),D=l.useMemo(()=>{if(p===null)return null;const ee=u.indexOf(p);return ee===-1?null:ee},[p,u]),k=l.useMemo(()=>_&&x!==null?x.virtualIndex:D===null?null:x!==null&&x.virtualIndex<=D?D+1:D,[D,x,_]),L=l.useMemo(()=>o.trim().length===0,[o]),O=l.useCallback(()=>{const ee=t.getRootElement(),te=n.current;if(!ee||!te)return;if(A!==null){const fe=t.getElementByKey(A);if(fe){SA(fe.getBoundingClientRect(),te,e);return}}if(x!==null){const fe=x.savedSelection.anchor.key,ue=t.getElementByKey(fe);if(ue){SA(ue.getBoundingClientRect(),te,e);return}}const le=window.getSelection();if(!le||le.rangeCount===0)return;const he=jB(le,ee);SA(he,te,e)},[A,e,x,t]),P=l.useCallback(()=>{const ee=t.getEditorState().read(()=>{const he=We();if(!Me(he))return{kind:"ignored",nextCommentIds:null};if(he.isCollapsed())return{kind:"ignored",nextCommentIds:null};const fe=xh(),ue=eIe({selection:he});if(ue.length===0){const ye=HB({selection:he}).getNode(),ce=nIe({startNode:ye,ids:fe});return{kind:"draft",selection:he.clone(),nextCommentIds:fe,virtualIndex:ce}}return{kind:"existing",selection:he.clone(),nextCommentIds:fe,existingId:ue[0]}});if(ee.kind==="ignored"){ee.nextCommentIds!==null&&d(ee.nextCommentIds);return}if(d(ee.nextCommentIds),ee.kind==="draft"){const he=Jbe(),fe={value:null};t.update(()=>{as(ee.selection.clone());const ue=We();Me(ue)&&(ue.isCollapsed()||(m9({selection:ue,isBackward:ue.isBackward(),id:he,createNode:ye=>h1(ye,"")}),fe.value=Xc({commentId:he}),as(null)))},{tag:C9}),y({draftId:he,savedSelection:ee.selection,virtualIndex:ee.virtualIndex,text:""}),g(he),E(fe.value),c(""),v(null),i(!0);return}const{existingId:te}=ee,le=t.getEditorState().read(()=>{const he=Ch({commentId:te}),fe=rIe({selection:ee.selection,commentId:te}),ue=Xc({commentId:te});return{existingText:he,unionSelection:fe,firstNodeKey:ue}});y(null),g(te),E(le.firstNodeKey),c(le.existingText),v(le.unionSelection),i(!0)},[t]),B=l.useCallback(()=>{const ee=b.current;if(ee===null||y1({commentId:ee}))return;const te=w.current;t.getEditorState().read(()=>Ch({commentId:ee}))!==te&&t.update(()=>{A9({commentId:ee,text:te})})},[t]),F=l.useCallback(()=>{B();const ee=S.current;if(ee!==null){const te=b.current===ee.draftId,he=Zbe({isViewingThisDraft:te,liveText:w.current,storedDraftText:ee.text}).trim();he.length===0&&t.update(()=>{Pb({commentId:ee.draftId})},{tag:C9}),he.length>0&&t.update(()=>{E9({draftId:ee.draftId,text:he,newCommentId:XS()})})}i(!1),c(""),d([]),g(null),E(null),y(null),v(null)},[B,t]),z=l.useCallback(ee=>{c(ee.target.value)},[]),Q=l.useCallback(({commentId:ee})=>{B(),t.getEditorState().read(()=>{const te=xh();
966if(!te.includes(ee))return;const le=Ch({commentId:ee}),he=Xc({commentId:ee});d(te),g(ee),E(he),c(le),v(null),i(!0)})},[B,t]),M=l.useCallback(({virtualIndex:ee})=>{if(B(),x!==null&&_&&x.virtualIndex!==ee&&y({...x,text:o}),x!==null&&ee===x.virtualIndex){const fe=t.getEditorState().read(()=>Xc({commentId:x.draftId}));g(x.draftId),E(fe),c(x.text),v(null),i(!0);return}const le=x!==null&&x.virtualIndex<ee?ee-1:ee,he=u[le];he&&Q({commentId:he})},[u,o,B,x,t,Q,_]),K=l.useCallback(()=>{k!==null&&(k<=0||M({virtualIndex:k-1}))},[k,M]),W=l.useCallback(()=>{k!==null&&(k>=R-1||M({virtualIndex:k+1}))},[k,M,R]),H=l.useCallback(()=>{R!==0&&M({virtualIndex:0})},[M,R]),j=l.useCallback(()=>{R!==0&&M({virtualIndex:R-1})},[M,R]),q=l.useCallback(()=>{if(o.trim().length===0)return;const ee=o;t.update(()=>{if(x!==null){E9({draftId:x.draftId,text:ee,newCommentId:XS()});return}if(I!==null&&p!==null){Pb({commentId:p}),as(I.clone());const te=We();if(!Me(te)||te.isCollapsed())return;m9({selection:te,isBackward:te.isBackward(),id:p,createNode:le=>h1(le,ee)});return}p!==null&&A9({commentId:p,text:ee})}),S.current=null,F()},[p,o,x,t,F,I]),G=l.useCallback(()=>{if(p===null){F();return}const ee=p;t.update(()=>{Pb({commentId:ee});const te=xh();if(te.length===0){F();return}const le=u.indexOf(ee),he=Math.max(0,le),fe=Math.min(he,te.length-1),ue=te[fe],ye=Ch({commentId:ue}),ce=Xc({commentId:ue});d(te),g(ue),E(ce),c(ye),v(null)})},[p,u,t,F]),$=l.useCallback(()=>{if(N){G();return}F()},[F,G,N]);if(l.useEffect(()=>t.registerCommand(BB,()=>(P(),!0),Ya),[t,P]),l.useEffect(()=>{const ee=()=>{P()};return window.addEventListener($S,ee),()=>{window.removeEventListener($S,ee)}},[P]),l.useEffect(()=>{const ee=te=>{if(!(te instanceof CustomEvent))return;const le=te.detail;if(!le||typeof le!="object"||!("commentId"in le))return;const he=le.commentId;typeof he=="string"&&Q({commentId:he})};return window.addEventListener(g9,ee),()=>{window.removeEventListener(g9,ee)}},[Q]),l.useEffect(()=>t.registerCommand(FB,()=>{if(R===0)return!1;if(!r){const te=tIe({editor:t,commentIds:u,anchorElem:e});return te>=0?(M({virtualIndex:te}),!0):(M({virtualIndex:0}),!0)}if(k===null)return M({virtualIndex:0}),!0;const ee=(k+1)%R;return M({virtualIndex:ee}),!0},Ya),[e,u,k,t,r,M,R]),l.useEffect(()=>{const ee=({markElement:ue})=>t.getEditorState().read(()=>{for(const ye of Q_()){if(t.getElementByKey(ye.getKey())!==ue)continue;const xe=ye.getIDs();return xe.length===0?null:xe[0]}return null}),te=ue=>{const ye=ce=>{const xe=ce.target;if(!(xe instanceof Element))return;const re=xe.closest(".editor-comment-mark");if(!re)return;const pe=ee({markElement:re});pe!==null&&(ce.preventDefault(),Q({commentId:pe}))};return ue.addEventListener("click",ye),()=>{ue.removeEventListener("click",ye)}},le={current:null},he=t.getRootElement();he&&(le.current=te(he));const fe=t.registerRootListener((ue,ye)=>{ye&&le.current&&(le.current(),le.current=null),ue&&(le.current=te(ue))});return()=>{le.current&&le.current(),fe()}},[t,Q]),l.useEffect(()=>{if(!r||A===null)return;const ee=t.getElementByKey(A);if(!ee)return;const te=ee.getBoundingClientRect(),le=QB({element:e.previousElementSibling}),he=window.innerHeight,fe=(le+he)/2,ye=(te.top+te.bottom)/2-fe;if(Math.abs(ye)<1)return;const ce=z_({element:t.getRootElement()});if(ce!==null){ce.scrollTo({top:ce.scrollTop+ye,behavior:"smooth"});return}window.scrollTo({top:window.scrollY+ye,behavior:"smooth"})},[A,e,t,r]),l.useEffect(()=>{if(!r)return;O();const ee=()=>{O()},te=e.parentElement;return window.addEventListener("resize",ee),te&&te.addEventListener("scroll",ee),()=>{window.removeEventListener("resize",ee),te&&te.removeEventListener("scroll",ee)}},[e,r,O]),l.useEffect(()=>{if(!r)return;const ee=()=>{const le=s.current;if(le===null)return;le.focus({preventScroll:!0});const he=le.value.length;le.setSelectionRange(he,he)};ee();const te=window.setTimeout(()=>{ee()},0);return()=>{window.clearTimeout(te)}},[p,r]),l.useEffect(()=>{if(!r)return;const ee=te=>{const le=te.target;le instanceof Node&&(n.current?.contains(le)||le instanceof Element&&le.closest('[data-keep-comment-dialog="true"]')||F())};return document.addEventListener("mousedown",ee,!0),()=>{document.removeEventListener("mousedown",ee,!0)}},[F,r]),l.useEffect(()=>{window.dispatchEvent(new CustomEvent(YS,{detail:{isOpen:r}}))},[r]),l.useEffect(()=>{const ee=()=>{const te=t.getEditorState().read(()=>cIe());te.length!==0&&t.update(()=>{uIe({mutations:te})},{tag:x9})};return ee(),t.registerUpdateListener(({tags:te})=>{te.has(dIe)||te.has(x9)||ee()})},[t]),l.useEffect(()=>{const ee="editor-comment-mark--active",te=()=>{const le=t.getRootElement();if(!le)return;const he=le.querySelectorAll(".editor-comment-mark");for(const ue of he)ue.classList.remove(ee);if(p===null)return;const fe=t.getEditorState().read(()=>Ku({commentId:p}).map(ue=>ue.getKey()));for(const ue of fe){const ye=t.getElementByKey(ue);ye!==null&&ye.classList.add(ee)}};return te(),t.registerUpdateListener(()=>{te()})},[p,t]),l.useEffect(()=>{const ee=()=>{const te=t.getEditorState().read(()=>xh());d(le=>le.length===te.length&&le.every((he,fe)=>he===te[fe])?le:te),r&&p!==null&&(y1({commentId:p})||te.includes(p)||F())};return ee(),t.registerUpdateListener(ee)},[p,t,F,r]),!r)return null;const J=()=>N?a.jsx(KA,{className:"size-5"}):a.jsx(ga,{className:"size-5"}),ne=()=>R===0||k===null||k===0,X=()=>R===0||k===null||k===R-1,oe=ne(),ie=X();return Wn.createPortal(a.jsxs("div",{ref:n,className:"absolute left-0 top-0 z-50 w-[424px] h-fit roun
966ded-lg bg-white p-2 shadow-[0px_0.27px_2.06px_0px_#00000008,0px_0.89px_6.92px_0px_#0000000C,0px_4px_31px_0px_#00000014]",children:[a.jsx("textarea",{ref:s,value:o,onChange:z,className:Y("min-h-[132px] w-full resize-none rounded-md p-2 text-sm outline-none",o.length>0&&"bg-zinc-200",o.length===0&&"bg-zinc-100"),placeholder:h.molecules.editor.COMMENT_PLACEHOLDER}),a.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:"rounded-md size-8 items-center justify-center flex text-zinc-600 hover:bg-zinc-100 cursor-pointer",onClick:$,children:J()}),k!==null&&a.jsx("span",{className:"roboto-flex-100-400-1 px-1 text-base leading-[24px] text-zinc-950",children:`${k+1} ${h.molecules.editor.COMMENT_INDEX_OF} ${R}`})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsxs("div",{className:"flex items-center gap-0.5",children:[a.jsx("button",{type:"button",className:"cursor-pointer rounded-md size-8 items-center justify-center flex text-zinc-600 hover:bg-zinc-100 disabled:text-zinc-300 disabled:hover:bg-transparent",onClick:H,disabled:oe,children:a.jsx(Ybe,{className:"size-5"})}),a.jsx("button",{type:"button",className:"cursor-pointer rounded-md size-8 items-center justify-center flex text-zinc-600 hover:bg-zinc-100 disabled:text-zinc-300 disabled:hover:bg-transparent",onClick:K,disabled:oe,children:a.jsx(al,{className:"size-5 rotate-180"})}),a.jsx("button",{type:"button",className:"cursor-pointer rounded-md size-8 items-center justify-center flex text-zinc-600 hover:bg-zinc-100 disabled:text-zinc-300 disabled:hover:bg-transparent",onClick:W,disabled:ie,children:a.jsx(al,{className:"size-5"})}),a.jsx("button",{type:"button",className:"cursor-pointer rounded-md size-8 items-center justify-center flex text-zinc-600 hover:bg-zinc-100 disabled:text-zinc-300 disabled:hover:bg-transparent",onClick:j,disabled:ie,children:a.jsx(Xbe,{className:"size-5"})})]}),a.jsx("div",{className:"ml-2 mr-11 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",className:"rounded-md size-8 items-center justify-center flex text-zinc-100 bg-zinc-950 hover:text-white cursor-pointer disabled:text-zinc-300 disabled:bg-zinc-100 disabled:hover:bg-transparent",onClick:q,disabled:L,children:a.jsx(rB,{className:"size-5"})})]})]})]}),e)},H_=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18360_50688)"},l.createElement("path",{d:"M2.5 16.6667L3.58333 13.4167C2.64704 12.0319 2.30833 10.392 2.63018 8.80194C2.95204 7.21185 3.91255 5.77975 5.33314 4.77192C6.75373 3.76409 8.53772 3.24911 10.3534 3.32273C12.1691 3.39634 13.8929 4.05355 15.2044 5.17216C16.5159 6.29076 17.3257 7.79464 17.4834 9.40418C17.6411 11.0137 17.1358 12.6194 16.0616 13.9226C14.9873 15.2259 13.4172 16.138 11.6432 16.4895C9.86911 16.8409 8.01184 16.6078 6.41667 15.8334L2.5 16.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18360_50688"},l.createElement("rect",{width:20,height:20,fill:"white"})))),Lb=1,Mb="bp72:hidden bp81_5:flex",pIe=()=>{const[e]=rn(),[t,n]=l.useState(!1),[s,r]=l.useState(!1),[i,o]=l.useState(!1),[c,u]=l.useState(!1),[d,p]=l.useState(!1),[g,A]=l.useState(!1),[E,x]=l.useState("paragraph"),[y,I]=l.useState(null),[v,S]=l.useState("text"),[b,w]=l.useState(Ds.LEFT),[_,N]=l.useState(!1),[R,D]=l.useState(!1),[k,L]=l.useState(!1),O=l.useCallback(()=>{e.getEditorState().read(()=>{const J=(()=>{const le=he=>{if(qu(he))return!0;if(!Ne(he))return!1;for(const fe of he.getChildren())if(le(fe))return!0;return!1};return le(St())})();N(J);const ne=We();if(!Me(ne)){I(null),D(!1),L(!1);return}const X=ne.getTextContent().replace(/\n/g,"").trim(),oe=!ne.isCollapsed()&&X.length>0;D(oe),L(oe),o(ne.hasFormat("bold")),u(ne.hasFormat("italic")),p(ne.hasFormat("underline")),A(ne.hasFormat("highlight"));const ie=ghe(ne,"font-family","");I(Ame(ie));const te=ne.anchor.getNode().getTopLevelElement();if(te===null){w(Ds.LEFT),x("paragraph"),S("text");return}if(Ne(te)?w(Ube(te.getFormatType())):w(Ds.LEFT),Ot(te)){x(te.getListType()==="number"?"ol":"ul"),S("text");return}if(x("paragraph"),PM(te)){const le=te.getTag();if(le==="h1"){S("h1");return}if(le==="h2"){S("h2");return}if(le==="h3"){S("h3");return}if(le==="h4"){S("h4");return}if(le==="h5"){S("h5");return}}S("text")})},[e]);l.useEffect(()=>Nr(e.registerUpdateListener(()=>{O()}),e.registerCommand(Um,()=>(O(),!1),Lb),e.registerCommand(Ah,J=>(n(J),!1),Lb),e.registerCommand(gh,J=>(r(J),!1),Lb)),[e,O]);const P=l.useCallback(()=>{e.dispatchCommand(IE,void 0)},[e]),B=l.useCallback(()=>{e.dispatchCommand(SE,void 0)},[e]),F=l.useCallback(()=>{e.dispatchCommand(mr,"bold")},[e]),z=l.useCallback(()=>{e.dispatchCommand(mr,"italic")},[e]),Q=l.useCallback(()=>{e.dispatchCommand(mr,"underline")},[e]),M=l.useCallback(()=>{e.dispatchCommand(mr,"highlight")},[e]),K=l.useCallback(()=>
966{if(E==="ul"){e.dispatchCommand(TS,void 0);return}e.dispatchCommand(BM,void 0)},[E,e]),W=l.useCallback(()=>{if(E==="ol"){e.dispatchCommand(TS,void 0);return}e.dispatchCommand(FM,void 0)},[E,e]),H=l.useCallback(J=>{J!=="arial"&&J!=="times"||e.update(()=>{const ne=We();Me(ne)&&QR(ne,{"font-family":wf[J]})})},[e]),j=l.useCallback(J=>{IB(J)&&e.update(()=>{const ne=We();if(Me(ne)){if(J==="text"){qa(ne,()=>hn());return}qa(ne,()=>fo(J))}})},[e]),q=l.useCallback(J=>{if(J===Ds.OUTDENT){e.dispatchCommand(oS,void 0);return}if(J===Ds.INDENT){e.dispatchCommand(pL,void 0);return}const X={[Ds.LEFT]:"left",[Ds.CENTER]:"center",[Ds.RIGHT]:"right",[Ds.JUSTIFY]:"justify"}[J];X&&e.dispatchCommand(mL,X)},[e]),G=l.useCallback(()=>{if(k){e.dispatchCommand(BB,void 0);return}if(_){e.dispatchCommand(FB,void 0);return}ve({type:"info",message:h.molecules.editor.SELECT_TEXT_FOR_COMMENT})},[k,e,_]),$=l.useCallback(()=>{e.update(()=>{const J=We();if(!(!Me(J)||J.isCollapsed())){for(const ne of J.extract())$e(ne)&&ne.setFormat(0);QR(J,{"font-family":null,"font-size":null,color:null,"background-color":null,"font-weight":null,"font-style":null,"text-decoration":null}),qa(J,()=>hn())}})},[e]);return a.jsxs("div",{className:"flex h-full items-center gap-1 border-b border-zinc-200 bg-transparent p-1",children:[a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.UNDO,"aria-label":h.molecules.editor.tooltips.UNDO,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer disabled:cursor-default disabled:text-zinc-300",t?"text-zinc-600":"text-zinc-300"),disabled:!t,onClick:P,children:a.jsx(dm,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.REDO,"aria-label":h.molecules.editor.tooltips.REDO,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer disabled:cursor-default disabled:text-zinc-300",s?"text-zinc-600":"text-zinc-300"),disabled:!s,onClick:B,children:a.jsx(dm,{className:"size-5 -scale-x-100"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"flex min-w-0 basis-[152px] flex-col gap-1",children:a.jsx(IA,{value:v,options:MB,onChange:j,iconWrapperClassName:Mb})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"flex min-w-0 grow basis-[120px] flex-col gap-1",children:a.jsx(IA,{value:y??"arial",options:Fbe,onChange:H,iconWrapperClassName:Mb})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.BOLD,"aria-label":h.molecules.editor.tooltips.BOLD,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",i?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:F,children:a.jsx(O_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.ITALIC,"aria-label":h.molecules.editor.tooltips.ITALIC,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",c?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:z,children:a.jsx(P_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.UNDERLINE,"aria-label":h.molecules.editor.tooltips.UNDERLINE,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",d?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:Q,children:a.jsx(L_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.HIGHLIGHT,"aria-label":h.molecules.editor.tooltips.HIGHLIGHT,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",g?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:M,children:a.jsx(M_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.BULLET_LIST,"aria-label":h.molecules.editor.tooltips.BULLET_LIST,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",E==="ul"?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:K,children:a.jsx(EB,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.NUMBERED_LIST,"aria-label":h.molecules.editor.tooltips.NUMBERED_LIST,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",E==="ol"?"text-zinc-950 bg-zinc-100":"text-zinc-600 bg-transparent"),onClick:W,children:a.jsx(xB,{className:"size-5"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"flex min-w-0 basis-[180px] flex-col gap-1",children:a.jsx(IA,{value:b,options:zbe,onChange:q,iconWrapperClassName:Mb})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.COMMENTS,"aria-label":h.molecules.editor.tooltips.COMMENTS,"data-keep-comment-dialog":"true",className:Y("flex items-center justify-center p-1.5 size-8 rounded-md hover:bg-zinc-100 text-zinc-600 cursor-pointer"),onClick:G,children:a.jsx(H_,{className:"size-5"})}),a.jsx("div",{"aria-hidden":"true",className:"min-w-0 shrink-[10] basis-[16px]"}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.CLEAR_STYLES,"aria-label":h.molecules.editor.tooltips.CLEAR_STYLES,className:Y("flex items-center justify-center size-8 rounded-md p-1.5 hover:bg-zinc-100 cursor-pointer disabled:cursor-default disabled:text-zinc-300 disabled:hover:bg-transparent",R?"text-zinc-600":"text-zinc-300"),onClick:$,disabled:!R,children:a.jsx(AB,{className:"size-[22px] [&_path]:stroke-[
9661.5]"})})]})},hIe=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?l.useLayoutEffect:l.useEffect;function mIe(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function gIe(){return(function(e){const[t]=rn(),n=l.useMemo(()=>e(t),[t,e]),[s,r]=l.useState(()=>n.initialValueFn()),i=l.useRef(s);return hIe(()=>{const{initialValueFn:o,subscribe:c}=n,u=o();return i.current!==u&&(i.current=u,r(u)),c(d=>{i.current=d,r(d)})},[n,e]),s})(mIe)}const AIe={name:"@lexical/react/ReactProvider"};function EIe(){return St().getTextContent()}function xIe(e,t=!0){if(e)return!1;let n=EIe();return t&&(n=n.trim()),n===""}function CIe(e){if(!xIe(e,!1))return!1;const t=St().getChildren(),n=t.length;if(n>1)return!1;for(let s=0;s<n;s++){const r=t[s];if(nn(r))return!1;if(Ne(r)){if(!Kf(r)||r.__indent!==0)return!1;const i=r.getChildren(),o=i.length;for(let c=0;c<o;c++){const u=i[s];if(!$e(u))return!1}}}return!0}function VB(e){return()=>CIe(e)}function yIe(e,...t){const n=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const r of t)s.append("v",r);throw n.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const V_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?l.useLayoutEffect:l.useEffect;function bIe({editor:e,ErrorBoundary:t}){return(function(n,s){const[r,i]=l.useState(()=>n.getDecorators());return V_(()=>n.registerDecoratorListener(o=>{Wn.flushSync(()=>{i(o)})}),[n]),l.useEffect(()=>{i(n.getDecorators())},[n]),l.useMemo(()=>{const o=[],c=Object.keys(r);for(let u=0;u<c.length;u++){const d=c[u],p=a.jsx(s,{onError:A=>n._onError(A),children:a.jsx(l.Suspense,{fallback:null,children:r[d]})}),g=n.getElementByKey(d);g!==null&&o.push(Wn.createPortal(p,g,d))}return o},[s,r,n])})(e,t)}function IIe({editor:e,ErrorBoundary:t}){return(function(n){const s=OM.maybeFromEditor(n);if(s&&s.hasExtensionByName(AIe.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])s.hasExtensionByName(r)&&yIe(320,r);return!0}return!1})(e)?null:a.jsx(bIe,{editor:e,ErrorBoundary:t})}function y9(e){return e.getEditorState().read(VB(e.isComposing()))}function SIe({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[s]=rn();return(function(r){V_(()=>Nr($he(r),Qhe(r)),[r])})(s),a.jsxs(a.Fragment,{children:[e,a.jsx(vIe,{content:t}),a.jsx(IIe,{editor:s,ErrorBoundary:n})]})}function vIe({content:e}){const[t]=rn(),n=(function(r){const[i,o]=l.useState(()=>y9(r));return V_(()=>{function c(){const u=y9(r);o(u)}return c(),Nr(r.registerUpdateListener(()=>{c()}),r.registerEditableListener(()=>{c()}))},[r]),i})(t),s=gIe();return n?typeof e=="function"?e(s):e:null}const _Ie=l.createContext(null),jb={didCatch:!1,error:null};let TIe=class extends l.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=jb}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(jb))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:s}=this.state,{resetKeys:r}=this.props;s&&n.error!==null&&NIe(t.resetKeys,r)&&(this.props.onReset?.({next:r,prev:t.resetKeys,reason:"keys"}),this.setState(jb))}render(){const{children:t,fallbackRender:n,FallbackComponent:s,fallback:r}=this.props,{didCatch:i,error:o}=this.state;let c=t;if(i){const u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")c=n(u);else if(s)c=l.createElement(s,u);else if(r!==void 0)c=r;else throw o}return l.createElement(_Ie.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},c)}};function NIe(e=[],t=[]){return e.length!==t.length||e.some((n,s)=>!Object.is(n,t[s]))}function wIe({children:e,onError:t}){return a.jsx(TIe,{fallback:a.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const GB=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?l.useLayoutEffect:l.useEffect;function RIe({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControl
966s:s,ariaDescribedBy:r,ariaErrorMessage:i,ariaExpanded:o,ariaInvalid:c,ariaLabel:u,ariaLabelledBy:d,ariaMultiline:p,ariaOwns:g,ariaRequired:A,autoCapitalize:E,className:x,id:y,role:I="textbox",spellCheck:v=!0,style:S,tabIndex:b,"data-testid":w,..._},N){const[R,D]=l.useState(e.isEditable()),k=l.useCallback(O=>{O&&O.ownerDocument&&O.ownerDocument.defaultView?e.setRootElement(O):e.setRootElement(null)},[e]),L=l.useMemo(()=>(function(...O){return P=>{for(const B of O)typeof B=="function"?B(P):B!=null&&(B.current=P)}})(N,k),[k,N]);return GB(()=>(D(e.isEditable()),e.registerEditableListener(O=>{D(O)})),[e]),a.jsx("div",{"aria-activedescendant":R?t:void 0,"aria-autocomplete":R?n:"none","aria-controls":R?s:void 0,"aria-describedby":r,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":R&&I==="combobox"?!!o:void 0,...c!=null?{"aria-invalid":c}:{},"aria-label":u,"aria-labelledby":d,"aria-multiline":p,"aria-owns":R?g:void 0,"aria-readonly":!R||void 0,"aria-required":A,autoCapitalize:E,className:x,contentEditable:R,"data-testid":w,id:y,ref:L,role:I,spellCheck:v,style:S,tabIndex:b,..._})}const DIe=l.forwardRef(RIe);function b9(e){return e.getEditorState().read(VB(e.isComposing()))}const kIe=l.forwardRef(OIe);function OIe(e,t){const{placeholder:n,...s}=e,[r]=rn();return a.jsxs(a.Fragment,{children:[a.jsx(DIe,{editor:r,...s,ref:t}),n!=null&&a.jsx(PIe,{editor:r,content:n})]})}function PIe({content:e,editor:t}){const n=(function(o){const[c,u]=l.useState(()=>b9(o));return GB(()=>{function d(){const p=b9(o);u(p)}return d(),Nr(o.registerUpdateListener(()=>{d()}),o.registerEditableListener(()=>{d()}))},[o]),c})(t),[s,r]=l.useState(t.isEditable());if(l.useLayoutEffect(()=>(r(t.isEditable()),t.registerEditableListener(o=>{r(o)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(s):e!==null&&(i=e),i===null?null:a.jsx("div",{"aria-hidden":!0,children:i})}function LIe(e,t,n,s,r){if(e===null||n.size===0&&s.size===0&&!r)return 0;const i=t._selection,o=e._selection;if(r)return 1;if(!(Me(i)&&Me(o)&&o.isCollapsed()&&i.isCollapsed()))return 0;const c=(function(v,S,b){const w=v._nodeMap,_=[];for(const N of S){const R=w.get(N);R!==void 0&&_.push(R)}for(const[N,R]of b){if(!R)continue;const D=w.get(N);D===void 0||Os(D)||_.push(D)}return _})(t,n,s);if(c.length===0)return 0;if(c.length>
9661){const v=t._nodeMap,S=v.get(i.anchor.key),b=v.get(o.anchor.key);return S&&b&&!e._nodeMap.has(S.__key)&&$e(S)&&S.__text.length===1&&i.anchor.offset===1?2:0}const u=c[0],d=e._nodeMap.get(u.__key);if(!$e(d)||!$e(u)||d.__mode!==u.__mode)return 0;const p=d.__text,g=u.__text;if(p===g)return 0;const A=i.anchor,E=o.anchor;if(A.key!==E.key||A.type!=="text")return 0;const x=A.offset,y=E.offset,I=g.length-p.length;return I===1&&y===x-1?2:I===-1&&y===x+1?3:I===-1&&y===x?4:0}function MIe(e,t,n){let s=n(),r=0,i=s,o=0,c=null;return(u,d,p,g,A,E)=>{const x=n();if(E.has(TL)&&(i=s,o=r,c=u),E.has(fS))return r=0,s=x,2;E.has(NL)&&c&&(s=i,r=o,u=c);const y=LIe(u,d,g,A,e.isComposing()),I=(()=>{const v=p===null||p.editor===e,S=E.has(mpe);if(!S&&v&&E.has(iu))return 0;if(y===1)return 2;if(u===null)return 1;const b=d._selection;if(!(g.size>0||A.size>0))return b!==null?0:2;const w=typeof t=="number"?t:t.peek();return S===!1&&y!==0&&y===r&&x<s+w&&v||g.size===1&&(function(_,N,R){const D=N._nodeMap.get(_),k=R._nodeMap.get(_),L=N._selection,O=R._selection;return!(Me(L)&&Me(O)&&L.anchor.type==="element"&&L.focus.type==="element"&&O.anchor.type==="text"&&O.focus.type==="text"||!$e(D)||!$e(k)||D.__parent!==k.__parent)&&JSON.stringify(N.read(()=>D.exportJSON()))===JSON.stringify(R.read(()=>k.exportJSON()))})(Array.from(g)[0],u,d)?0:1})();return s=x,r=y,I}}function I9(e){e.undoStack=[],e.redoStack=[],e.current=null}function qB(e,t,n,s=Date.now){const r=MIe(e,n,s);return Nr(e.registerCommand(IE,()=>((function(i,o){const c=o.redoStack,u=o.undoStack;if(u.length!==0){const d=o.current,p=u.pop();d!==null&&(c.push(d),i.dispatchCommand(gh,!0)),u.length===0&&i.dispatchCommand(Ah,!1),o.current=p||null,p&&p.editor.setEditorState(p.editorState,{tag:fS})}})(e,t),!0),Pt),e.registerCommand(SE,()=>((function(i,o){const c=o.redoStack,u=o.undoStack;if(c.length!==0){const d=o.current;d!==null&&(u.push(d),i.dispatchCommand(Ah,!0));const p=c.pop();c.length===0&&i.dispatchCommand(gh,!1),o.current=p||null,p&&p.editor.setEditorState(p.editorState,{tag:fS})}})(e,t),!0),Pt),e.registerCommand(rpe,()=>(I9(t),!1),Pt),e.registerCommand(ipe,()=>(I9(t),e.dispatchCommand(gh,!1),e.dispatchCommand(Ah,!1),!0),Pt),e.registerUpdateListener(({editorState:i,prevEditorState:o,dirtyLeaves:c,dirtyElements:u,tags:d})=>{const p=t.current,g=t.redoStack,A=t.undoStack,E=p===null?null:p.editorState;if(p!==null&&i===E)return;const x=r(o,i,p,c,u,d);if(x===1)g.length!==0&&(t.redoStack=[],e.dispatchCommand(gh,!1)),p!==null&&(A.push({...p}),e.dispatchCommand(Ah,!0));else if(x===2)return;t.current={editor:e,editorState:i}}))}function WB(){return{current:null,redoStack:[],undoStack:[]}}const Bb={build:(e,{delay:t,createInitialHistoryState:n,disabled:s,now:r})=>wM({delay:t,disabled:s,historyState:n(e),now:r}),config:{createInitialHistoryState:WB,delay:300,disabled:typeof window>"u",now:Date.now},name:"@lexical/history/History",register:(e,t,n)=>{const s=n.getOutput();return a_(()=>s.disabled.value?void 0:qB(e,s.historyState.value,s.delay,()=>s.now.peek()()))}};ohe(Bb,{disabled:!0});function jIe({delay:e,externalHistoryState:t}){const[n]=rn();return(function(s,r,i=1e3){const o=l.useMemo(()=>r||WB(),[r]);l.useEffect(()=>qB(s,o,i),[i,s,o])})(n,t,e),null}function BIe({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){const[n]=rn();return l.useEffect(()=>{if(!n.hasNodes([Wm,Xf]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),l.useEffect(()=>Nr(p8(n,{restoreNumbering:t}),e?rme(n):()=>{}),[n,e,t]),(function(s){l.useEffect(()=>p8(s),[s])})(n),null}const FIe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_6868)"},l.createElement("path",{d:"M11.6693 3.33334H15.0026C15.2236 3.33334 15.4356 3.42114 15.5919 3.57742C15.7481 3.7337 15.8359 3.94566 15.8359 4.16668V15.8333C15.8359 16.0544 15.7481 16.2663 15.5919 16.4226C15.4356 16.5789 15.2236 16.6667 15.0026 16.6667H11.6693C11.4483 16.6667 11.2363 16.5789 11.08 16.4226C10.9237 16.2663 10.8359 16.0544 10.8359 15.8333V4.16668C10.8359 3.94566 10.9237 3.7337 11.08 3.57742C11.2363 3.42114 11.4483 3.33334 11.6693 3.33334V3.33334Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M4.16406 10H7.4974",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5.83594 8.33334V11.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_6868"},l.createElement("rect",{width:20,height:20,fill:"white"})))),S9=e=>{let t=0,n=e.getParent();for(;n!==null;)t+=1,n=n.getParent();return t}
966,KB=()=>{const e=[],t=n=>{if(!Ps(n)&&(Us(n)&&e.push(n),Ne(n)))for(const s of n.getChildren())t(s)};for(const n of St().getChildren())t(n);return e},Vr=e=>{const t=e.getChildren();if(t.length<2)return!1;const n=t.at(-1);if(!Fn(n)||!n.getIsEditable())return!1;for(let s=0;s<t.length-1;s+=1){const r=t[s];if(!Fn(r)||r.getIsEditable())return!1}return!0},vA=e=>{let t=e;for(;t!==null;){if(Fn(t)&&t.getIsEditable()){const n=t.getParent();if(Us(n)&&Vr(n))return t}t=t.getParent()}return null},$B=(e,t)=>{const n=e.getNode();if(!_f(n,t))return!1;const s=t.getAllTextNodes();if(s.length>0){const r=s[0];return e.type==="text"&&e.key===r.getKey()&&e.offset===0}if(e.type==="element"&&e.offset===0){const r=e.getNode();return Ne(r)&&r.getParent()===t&&r===t.getFirstChild()}return!1},YB=(e,t)=>e.isCollapsed()&&$B(e.anchor,t),UIe=e=>{const t=e.getAllTextNodes();return t.length===0?!0:t.every(n=>n.getTextContentSize()===0)},fh=()=>{const e=We();if(!Me(e)||!e.isCollapsed())return!1;const t=vA(e.anchor.getNode());return t?UIe(t)?!0:YB(e,t):!1},zIe=e=>e.getChildren().some(t=>Fn(t))?!0:KB().length>0,v9=()=>{const e=KB();e.sort((s,r)=>S9(r)-S9(s));for(const s of e)s.remove();const t=St();for(const s of[...t.getChildren()])Fn(s)&&s.remove();if(t.getChildrenSize()===0){const s=hn();t.append(s),s.selectStart();return}const n=t.getFirstChild();n!==null&&Ne(n)&&n.selectStart()},QIe=e=>{const t=e.getAllTextNodes();if(t.length===0)return e.selectStart(),!0;const n=t[0],s=t[t.length-1],r=ca();return r.anchor.set(n.getKey(),0,"text"),r.focus.set(s.getKey(),s.getTextContentSize(),"text"),as(r),!0},_9=()=>{const e=We();Me(e)&&(e.format=0,e.style="")},HIe=12,XB=e=>{const t=e.exportJSON();if(!Ne(e))return t;const n=t;return n.children=e.getChildren().map(XB),n},VIe=({isUploadOpen:e,anchorElem:t})=>{const[n]=rn(),[s,r]=l.useState(!1),[i,o]=l.useState(2),c=l.useRef(null),u=l.useRef(null),[d,p]=l.useState(null),g=l.useCallback(I=>{I.preventDefault()},[]);l.useEffect(()=>n.registerUpdateListener(({editorState:I})=>{I.read(()=>{const v=St(),S=v.getChildren().filter(Us);for(const w of S){const _=n.getElementByKey(w.getKey());if(_ instanceof HTMLElement){if(Vr(w)){_.setAttribute("data-header-block","true");continue}_.removeAttribute("data-header-block")}}const b=S.find(Vr);if(!b){r(!1),o(2),zIe(v)&&queueMicrotask(()=>{n.update(()=>{v9()})});return}r(!0),o(b.getTemplateColumns()==="1fr 1fr 1fr"?3:2)})}),[n]),l.useEffect(()=>Nr(n.registerNodeTransform(cl,I=>{if(!I.getIsEditable())return;const v=I.getParent();Us(v)&&Vr(v)&&I.getChildrenSize()===0&&I.append(hn())}),n.registerCommand(vE,()=>fh(),ns),n.registerCommand(el,I=>I?fh():!1,ns),n.registerCommand(sm,()=>fh(),ns),n.registerCommand(O2,I=>{const v=We();if(!Me(v))return!1;const S=vA(v.anchor.getNode());return S?I.shiftKey?!!$B(v.focus,S):!!YB(v,S):!1},ns),n.registerCommand(aL,()=>{const I=We();if(!Me(I))return!1;const v=vA(I.anchor.getNode());return v?(v.selectStart(),!0):!1},ns),n.registerCommand(im,()=>{const I=We();if(!Me(I))return!1;const v=vA(I.anchor.getNode());return v?QIe(v):!1},ns),n.registerCommand(yu,I=>I?fh():!1,ns),n.registerCommand(bu,I=>I?fh():!1,ns)),[n]);const A=l.useCallback(I=>{n.update(()=>{const v=St(),S=v.getChildren().filter(L=>Us(L)&&!Vr(L));for(const L of S)L.remove();const b=v.getChildren().find(L=>Us(L)&&Vr(L));if(b&&Us(b)){const L=b.getTemplateColumns()==="1fr 1fr 1fr",O=I===3;if(L===O)return;if(O){const B=p1(!1);B.append(hn());const F=b.getFirstChild();F!==null?F.insertBefore(B):b.append(B),b.setTemplateColumns("1fr 1fr 1fr")}else{const B=b.getFirstChild();B!==null&&Fn(B)&&B.remove(),b.setTemplateColumns("1fr 1fr")}const P=b.getChildren().at(-1);Fn(P)&&(P.selectStart(),_9());return}
966v.getChildren().forEach(L=>{Us(L)&&L.remove()});const w=u.current,_=w?.children?.length??0,N=!!w&&_===I;let R=null;if(N&&w){const[L]=bS([w]);L&&Us(L)&&(R=L)}if(R===null){R=u_(I===2?"1fr 1fr":"1fr 1fr 1fr");const L=w?.children?.[_-1],O=Array.isArray(L?.children)&&L.children.length>0?L.children:null;for(let P=0;P<I;P+=1){const B=P===I-1,F=p1(B);B&&O?bS(O).forEach(Q=>F.append(Q)):F.append(hn()),R.append(F)}}u.current=null;const D=v.getFirstChild();D===null&&v.append(R),D!==null&&Ru(D)&&D.insertAfter(R),D!==null&&!Ru(D)&&D.insertBefore(R);const k=R.getChildren().at(-1);Fn(k)&&(k.selectStart(),_9())})},[n]),E=l.useCallback(()=>{A(2)},[A]),x=l.useCallback(()=>{A(3)},[A]),y=l.useCallback(()=>{n.update(()=>{const v=St().getChildren().find(S=>Us(S)&&Vr(S));v&&Us(v)&&(u.current=XB(v)),v9()}),r(!1),o(2)},[n]);return l.useLayoutEffect(()=>{if(!s){p(null);return}const I=()=>{const R=n.getRootElement(),D=c.current;if(!R||!D||t===null){p(null);return}const k=R.querySelector(".editor-layout-container");if(!(k instanceof HTMLElement)){p(null);return}const L=t.getBoundingClientRect(),O=k.getBoundingClientRect(),P=D.getBoundingClientRect(),F=O.left+O.width*(i===2?1:2)/i-P.width-HIe-L.left+t.scrollLeft,z=O.top-L.top+t.scrollTop;p({left:F,top:z})};I(),window.addEventListener("resize",I);const v=n.getRootElement(),S=HE(v);S?.addEventListener("scroll",I,{passive:!0});const b=new ResizeObserver(I),w=v?.querySelector(".editor-layout-container");w instanceof HTMLElement&&b.observe(w);const _=R=>R===null?[]:R===S?[R]:[R,..._(R.parentElement)],N=_(v?.parentElement??null);for(const R of N)b.observe(R);return()=>{window.removeEventListener("resize",I),S?.removeEventListener("scroll",I),b.disconnect()}},[n,s,e,i,t]),{hasHeaderBlock:s,layoutColumns:i,toolbarPosition:d,toolbarRef:c,handleToolbarPointerDown:g,handleInsertHeaderBlockTwo:E,handleInsertHeaderBlockThree:x,handleRemoveHeaderBlock:y}},GIe=({isUploadOpen:e,anchorElem:t,onHeaderBlockPresenceChange:n})=>{const{hasHeaderBlock:s,layoutColumns:r,toolbarPosition:i,toolbarRef:o,handleToolbarPointerDown:c,handleInsertHeaderBlockTwo:u,handleInsertHeaderBlockThree:d,handleRemoveHeaderBlock:p}=VIe({isUploadOpen:e,anchorElem:t});l.useEffect(()=>{n?.(s)},[s,n]);const g=l.useMemo(()=>i===null?{visibility:"hidden"}:{transform:`translate(${i.left}px, ${i.top}px)`,visibility:"visible"},[i]);return s?t===null?null:Wn.createPortal(a.jsxs("div",{ref:o,className:"absolute left-0 top-0 flex items-center gap-2",style:g,children:[a.jsx("button",{type:"button",className:"flex size-6 items-center justify-center text-zinc-400 hover:text-zinc-600 cursor-pointer",onMouseDown:c,onClick:p,children:a.jsx(ga,{className:"size-5"})}),r===3&&a.jsx("button",{type:"button",className:"flex size-6 items-center justify-center text-zinc-400 hover:text-zinc-600 cursor-pointer",onMouseDown:c,onClick:u,children:a.jsx(B_,{className:"size-5"})}),r===2&&a.jsx("button",{type:"button",className:"flex size-6 items-center justify-center text-zinc-400 hover:text-zinc-600 cursor-pointer",onMouseDown:c,onClick:d,children:a.jsx(F_,{className:"size-5"})})]}),t):a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-8 rounded-md hover:bg-zinc-100 cursor-pointer roboto-flex-100-400-1 group px-1.5",onMouseDown:c,onClick:u,children:[a.jsx(FIe,{className:"size-5 text-zinc-600 group-hover:text-zinc-950"}),a.jsx("span",{className:"text-[14px] font-medium text-zinc-500",children:h.molecules.editor.HEADER_BLOCK})]})},qIe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("g",{clipPath:"url(#clip0_18095_50363)"},l.createElement("path",{d:"M12.5 6.66669H12.5083",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M14.1693 3.33331H5.83594C4.45523 3.33331 3.33594 4.4526 3.33594 5.83331V14.1666C3.33594 15.5474 4.45523 16.6666 5.83594 16.6666H14.1693C15.55 16.6666 16.6693 15.5474 16.6693 14.1666V5.83331C16.6693 4.4526 15.55 3.33331 14.1693 3.33331Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 12.5L6.66927 9.16669C7.04932 8.80099 7.48043 8.60846 7.91927 8.60846C8.35811 8.60846 8.78922 8.80099 9.16927 9.16669L13.3359 13.3334",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M11.6641 11.6666L12.4974 10.8333C12.8774 10.4676 13.3086 10.2751 13.7474 10.2751C14.1862 10.2751 14.6173 10.4676 14.9974 10.8333L16.6641 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_18095_50363"},l.createElement("rect",{width:20,height:20,fill:"white"})))),T9=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M2.5 2.5L17.5 17.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.5 6.66663H12.5083",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6.66927 3.33337H14.1693C14.8323 3.33337 15.4682 3.59677 15.937 4.06561C16.4059 4.53445 16.6693 5.
96617033 16.6693 5.83337V13.3334M15.9368 15.935C15.4679 16.4036 14.8321 16.6668 14.1693 16.6667H5.83594C5.1729 16.6667 4.53701 16.4033 4.06817 15.9345C3.59933 15.4656 3.33594 14.8297 3.33594 14.1667V5.83337C3.33594 5.13921 3.61927 4.51087 4.07594 4.05754L15.9368 15.935Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 12.5L6.66927 9.16665C7.4426 8.42248 8.39594 8.42248 9.16927 9.16665L13.3359 13.3333",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M13.6016 10.2833C14.0824 10.2341 14.5699 10.4183 15.0016 10.8333L16.6682 12.5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),N9=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M10 3.33337V11.6667",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M10 3.33337L13.3333 6.66671",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.9974 3.33337L6.66406 6.66671",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M3.33594 16.6666H16.6693",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),WIe=e=>new Promise((t,n)=>{const s=new Image;s.onload=()=>{t({width:s.naturalWidth||1,height:s.naturalHeight||1})},s.onerror=()=>n(new Error("IMAGE_DIMENSIONS_READ_FAILED")),s.src=e}),Fb=["image/jpeg","image/png","image/webp"],KIe=10*1024*1024,$Ie=({isUploadOpen:e,onOpenUploadPanel:t,onCloseUploadPanel:n,onHeaderImagePresenceChange:s})=>{const[r]=rn(),i=l.useRef(null),[o,c]=l.useState(null),[u,d]=l.useState(null);l.useEffect(()=>()=>{u&&URL.revokeObjectURL(u.src)},[u]),l.useEffect(()=>{s?.(o!==null||u!==null)},[o,u,s]),l.useEffect(()=>{const v=()=>{const b=St().getFirstChild();return Ru(b)?{src:b.getSrc(),imageId:b.getImageId(),width:b.getWidth(),height:b.getHeight(),altText:b.getAltText()}:null};return r.getEditorState().read(()=>{c(v())}),r.registerUpdateListener(({editorState:S})=>{S.read(()=>{c(v())})})},[r]);const p=tt({mutationFn:hte,onSuccess:v=>{try{r.update(()=>{const S=St(),b=S.getFirstChild(),w=ime({src:v.url,imageId:v.id,width:v.width,height:v.height,altText:h.molecules.editor.IMAGE_ALT});if(b===null){S.append(w);return}if(Ru(b)){b.replace(w);return}b.insertBefore(w)}),d(S=>(S&&URL.revokeObjectURL(S.src),null)),n()}catch{ve({type:"failed",message:h.molecules.editor.IMAGE_UPLOAD_FAILED,key:"IMAGE_UPLOAD_FAILED",duration:4e3})}},onError:()=>{d(v=>(v&&URL.revokeObjectURL(v.src),null)),ve({type:"failed",message:h.molecules.editor.IMAGE_UPLOAD_FAILED,key:"IMAGE_UPLOAD_FAILED",duration:4e3})}}),g=l.useCallback(v=>{v.preventDefault()},[]),A=l.useCallback(()=>{i.current?.click()},[]),E=l.useCallback(async v=>{const S=v.target.files?.[0]??null;if(v.target.value="",!S)return;if(!Fb.includes(S.type)){ve({type:"warning",message:h.molecules.editor.IMAGE_WRONG_TYPE,key:"IMAGE_WRONG_TYPE",duration:4e3});return}if(S.size>KIe){ve({type:"warning",message:h.molecules.editor.IMAGE_TOO_LARGE,key:"IMAGE_TOO_LARGE",duration:4e3});return}const w=URL.createObjectURL(S);try{const{width:_,height:N}=await WIe(w);d(R=>(R&&URL.revokeObjectURL(R.src),{src:w,width:_,height:N}))}catch{URL.revokeObjectURL(w)}p.mutate({file:S})},[p]),x=l.useCallback(()=>{r.update(()=>{const v=St();for(const S of v.getChildren())S instanceof wu&&S.remove()}),d(v=>(v&&URL.revokeObjectURL(v.src),null)),t()},[r,t]),y=p.isPending,I=u!==null?{src:u.src,alt:"",width:u.width,height:u.height}:o!==null?{src:o.src,alt:o.altText,width:o.width,height:o.height}:null;return I!==null?a.jsxs("div",{className:"flex w-full flex-col gap-2",children:[a.jsx("input",{ref:i,type:"file",accept:Fb.join(","),className:"hidden",onChange:E,disabled:y}),a.jsxs("div",{className:"absolute left-2 top-3 flex items-center gap-0.5",children:[a.jsx("button",{type:"button",onMouseDown:g,onClick:x,disabled:y,"aria-label":h.molecules.editor.IMAGE_REMOVE,title:h.molecules.editor.IMAGE_REMOVE,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-zinc-400 hover:text-zinc-600 disabled:cursor-not-allowed disabled:opacity-60",children:a.jsx(T9,{className:"size-5"})}),a.jsx("button",{type:"button",onMouseDown:g,onClick:A,disabled:y,"aria-label":y?void 0:h.molecules.editor.UPLOAD_IMAGE,title:y?void 0:h.molecules.editor.UPLOAD_IMAGE,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-zinc-400 hover:text-zinc-600 disabled:cursor-not-allowed disabled:opacity-60",children:a.jsx(N9,{className:"size-5"})})]}),a.jsxs("button",{type:"button",onMouseDown:g,onClick:A,disabled:y,"aria-label":y?void 0:h.molecules.editor.IMAGE_REPLACE,title:y?void 0:h.molecules.editor.IMAGE_REPLACE,className:"relative flex w-full cursor-pointer items-center justify-start border-0 bg-transparent p-0 disabled:cursor-not-allowed",style:{aspectRatio:`${I.width} / ${I.height}`},children:[a.jsx("img",{src:I.src,alt:y?"":I.alt,width:I.width,height:I.height,style:{width:"100%",height:"100%",objectFit:"contain",opacity:y?.6:1}}),y?a.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:a.jsx(Co,{className:"size-8 animate-spin text-zinc-600"})}):null]})]}):a.jsxs("div",{className:"flex w-full flex-col gap-2",children:[a.jsx("input",{ref:i,type:"file",accept:Fb.join(","),className:"hidden",onChange:E,disabled:y}),a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsxs("div",{className:"absolute left-2 top-3 flex items-center gap-0.5",children:[a.jsx("button",{type:"button",onMouseDown:g,onClick:n,disabled:y,"aria-label":h.molecules.editor.IMAGE_REMOVE,title:h.molecules.editor.IMAGE_REMOVE,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-zinc-400 hover:text-zinc-600 disabled:cursor-not-allowed disabled:opacity-60",children:a.jsx(T9,{className:"size-5"})}),a.jsx("button",{type:"button",onMouseDown:g,onClick:A,disabled:y,"aria-label":y?void 0:h.molecules.editor.UPLOAD_IMAGE,title:y?void 0:h.molecules.editor.UPLOAD_IMAGE,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-zinc-400 hover:text-zinc-600 disabled:cursor-not-allowed disabled:opacity-60",children:a.jsx(N9,{className:"size-5"})})]}),!e&&a.jsxs("button",{type:"button",onMouseDown:g,onClick:t,className:"group flex h-8 cursor-pointer items-center gap-2 rounded-md px-1.5 roboto-flex-100-400-1 hover:bg-zinc-100",children:[a.jsx(qIe,{className:"size-5 text-zinc-600 group-hover:text-zinc-950"}),a.jsx("span",{className:"text-[14px] font-medium text-zinc-500 group-hover:text-zinc-950",children:h.molecules.editor.HEADER})]})]}),e&&a.jsxs("button",{type:"button",onMouseDown:g,onClick:A,disabled:y,className:"group flex h-[96px] w-full cursor-pointer flex-col items-center gap-1 rounded-lg border border-dashed border-zinc-300 bg-white pt-[18px] pb-[26px] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-zinc-300 disabled:cursor-not-allowed",children:[a.jsxs("span",{className:"flex h-8 flex-row items-center justify-center gap-2 rounded-md px-4 text-center transition-colors group-hover:bg-zinc-50 group-disabled:opacity-60",children:[y&&a.jsx(Co,{className:"size-5 animate-spin text-zinc-600"}),!y&&a.jsx(dE,{className:"size-5 text-zinc-600","aria-hidden":!0}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[14px] text-zinc-950",children:h.molecules.editor.UPLOAD_IMAGE})]}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[14px] leading-4 text-zinc-400",children:h.molecules.editor.IMAGE_HINT})]})]})},YIe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M7.4974 5.00004C7.95763 5.00004 8.33073 4.62694 8.33073 4.16671C8.33073 3.70647 7.95763 3.33337 7.4974 3.33337C7.03716 3.33337 6.66406 3.70647 6.66406 4.16671C6.66406 4.62694 7.03716 5.00004 7.4974 5.00004Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M7.4974 10.8333C7.95763 10.8333 8.33073 10.4602 8.33073 9.99996C8.33073 9.53972 7.95763 9.16663 7.4974 9.16663C7.03716 9.16663 6.66406 9.53972 6.66406 9.99996C6.66406 10.4602 7.03716 10.8333 7.4974 10.8333Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M7.4974 16.6667C7.95763 16.6667 8.33073 16.2936 8.33073 15.8333C8.33073 15.3731 7.95763 15 7.4974 15C7.03716 15 6.66406 15.3731 6.66406 15.8333C6.66406 16.2936 7.03716 16.6667 7.4974 16.6667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.4974 5.00004C12.9576 5.00004 13.3307 4.62694 13.3307 4.16671C13.3307 3.70647 12.9576 3.33337 12.4974 3.33337C12.0372 3.33337 11.6641 3.70647 11.6641 4.16671C11.6641 4.62694 12.0372 5.00004 12.4974 5.00004Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.4974 10.8333C12.9576 10.8333 13.3307 10.4602 13.3307 9.99996C13.3307 9.53972 12.9576 9.16663 12.4974 9.16663C12.0372 9.16663 11.6641 9.53972 11.6641 9.99996C11.6641 10.4602 12.0372 10.8333 12.4974 10.8333Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M12.4974 16.6667C12.9576 16.6667 13.3307 16.2936 13.3307 15.8333C13.3307 15.3731 12.9576 15 12.4974 15C12.0372 15 11.6641 15.3731 11.6641 15.8333C11.6641 16.2936 12.0372 16.6667 12.4974 16.6667Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function $0({element:e,marginSide:t}){if(e===null)return 0;const n=parseFloat(window.getComputedStyle(e)[t]);return Number.isNaN(n)?0:n}function JB({element:e}){const t=$0({element:e,marginSide:"marginTop"}),n=$0({element:e,marginSide:"marginBottom"}),s=$0({element:e.previousElementSibling,marginSide:"marginBottom"}),r=$0({element:e.nextElementSibling,marginSide:"marginTop"});return{collapsedMarginTop:Math.max(t,s),collapsedMarginBottom:Math.max(n,r)}}function jh({anchorElement:e,editor:t,pointX:n,pointY:s}){const r=e.getBoundingClientRect();return n<r.left||n>r.right?null:t.getEditorState().read(()=>{const i=St().getChildrenKeys();for(const o of i){const c=t.getElementByKey(o);if(c===null)continue;const u=c.getBoundingClientRect(),{collapsedMarginTop:d,collapsedMarginBottom:p}=JB({element:c});if(!(s<u.top-d)&&!(s>u.bottom+p))return c}return null})}const XIe=2,w9=32,JIe=4,Ub=48,ZIe=18,eSe=({anchorElem:e,onDraggingChange:t})=>{const[n]=rn(),s=j_(),r=l.useRef(null),i=l.useRef(null),o=l.useRef(null),c=l.useRef(null),[u,d]=l.useState(null),[p,g]=l.useState("text"),[A,E]=l.useState(!1),[x,y]=l.useState(!1),[I,v]=l.useState(!1),S=l.useRef(null),b=l.useCallback(W=>{const H=W.getAllTextNodes();if(H.length>0){const q=H[0],G=H[H.length-1],$=ca();
966$.anchor.set(q.getKey(),0,"text"),$.focus.set(G.getKey(),G.getTextContentSize(),"text"),as($);const J=We();return Me(J)?J:null}const j=W.select(0,W.getChildrenSize());return Me(j)?j:null},[]),w=l.useCallback(({lineHeight:W,rectHeight:H})=>Number.isNaN(W)?H:W,[]),_=l.useCallback(({menuHeight:W,fallbackHeight:H})=>W>0?W:H,[]),N=l.useCallback(({blockRect:W,edge:H,collapsedMarginTop:j,collapsedMarginBottom:q})=>H==="top"?W.top-j/2:W.bottom+q/2,[]),R=l.useCallback(({position:W})=>W==="before"?"top":"bottom",[]),D=l.useCallback(({rootElement:W,blockRect:H})=>{if(W===null)return{left:H.left,width:H.width};const j=W.getBoundingClientRect(),q=window.getComputedStyle(W),G=parseFloat(q.paddingLeft),$=parseFloat(q.paddingRight);return{left:j.left+G,width:j.width-G-$}},[]),k=l.useCallback(({scroller:W})=>{if(W===null)return{top:0,bottom:window.innerHeight};const H=W.getBoundingClientRect();return{top:H.top,bottom:H.bottom}},[]),L=l.useCallback(({anchorElement:W,scrollerTop:H})=>{const j=W.previousElementSibling;if(!(j instanceof HTMLElement))return H;const q=j.getBoundingClientRect().bottom;return q>H?q:H},[]);l.useEffect(()=>{t(x)},[x,t]);const O=l.useCallback(()=>u?n.read(()=>{const W=pr(u);return W?W.getTopLevelElementOrThrow().getKey():null}):null,[n,u]),P=l.useCallback(()=>{if(!u){g("text");return}const W=n.read(()=>{const H=pr(u);if(!H)return"text";const j=H.getTopLevelElementOrThrow();if(Ot(j))return"text";if(PM(j)){const q=j.getTag();if(q==="h1")return"h1";if(q==="h2")return"h2";if(q==="h3")return"h3";if(q==="h4")return"h4";if(q==="h5")return"h5"}return"text"});g(W)},[n,u]);l.useEffect(()=>{P()},[P]),l.useEffect(()=>n.registerUpdateListener(()=>{P()}),[n,P]);const B=l.useCallback(W=>W?n.read(()=>{const H=pr(W);if(!H)return!1;const j=H.getTopLevelElementOrThrow();return Ja(j)||Ps(j)?!0:Us(j)?Vr(j):!1}):!1,[n]);l.useEffect(()=>{E(B(u))},[B,u]);const F=l.useCallback(W=>W instanceof Element?W.closest("[data-draggable-block-menu]")!==null||W.closest("[data-block-typeahead]")!==null:!1,[]);l.useEffect(()=>{const W=e.parentElement;if(W===null)return;const H=q=>{if(c.current={x:q.x,y:q.y},S.current!==null||s||F(q.target))return;const G=jh({anchorElement:e,editor:n,pointX:q.x,pointY:q.y});d(G)},j=()=>{S.current===null&&(s||d(null))};return W.addEventListener("mousemove",H),W.addEventListener("mouseleave",j),()=>{W.removeEventListener("mousemove",H),W.removeEventListener("mouseleave",j)}},[e,n,F,s]),l.useEffect(()=>{s&&(I||d(null))},[s,I]),l.useEffect(()=>{const W=r.current;if(W===null)return;const H=o.current,j=()=>{W.style.opacity="0",W.style.pointerEvents="none",H!==null&&(H.style.opacity="0")};if(x){j();return}if(u===null){j();return}const q=()=>{if(B(u)){j();return}W.style.opacity="1",W.style.pointerEvents="";const X=u.getBoundingClientRect(),oe=window.getComputedStyle(u),ie=W.getBoundingClientRect(),ee=e.getBoundingClientRect(),te=parseInt(oe.lineHeight,10),le=w({lineHeight:te,rectHeight:X.bottom-X.top}),he=_({menuHeight:ie.height,fallbackHeight:le}),fe=X.top+(le-he)/2-ee.top+e.scrollTop;if(W.style.transform=`translate(4px, ${fe}px)`,H!==null){const ue=X.left-ee.left+e.scrollLeft,ye=X.top-ee.top+e.scrollTop,ce=Math.round(ye),xe=Math.round(ye+X.height);H.style.transform=`translate(${Math.round(ue)}px, ${ce}px)`,H.style.width=`${Math.round(X.width)}px`,H.style.height=`${xe-ce}px`,H.style.opacity="1"}},G=()=>{if(s){q();return}const X=c.current;if(X===null){q();return}const oe=jh({anchorElement:e,editor:n,pointX:X.x,pointY:X.y});if(oe!==u){d(oe);return}q()},$=requestAnimationFrame(q),J=n.registerUpdateListener(G);window.addEventListener("resize",G);const ne=new ResizeObserver(G);return ne.observe(e),()=>{cancelAnimationFrame($),J(),window.removeEventListener("resize",G),ne.disconnect()}},[e,B,n,u,s,x,_,w]),l.useEffect(()=>{const W=re=>n.read(()=>{const pe=pr(re);return pe===null?null:pe.getTopLevelElementOrThrow().getKey()}),H=re=>n.read(()=>{const pe=pr(re);if(pe===null)return!1;const _e=pe.getTopLevelElementOrThrow();return!!(Ja(_e)||Ps(_e))}),j=()=>n.getEditorState().read(()=>{for(const re of St().getChildrenKeys()){const pe=Xt(re);if(pe===null||Ja(pe)||Ps(pe)||Ru(pe)||Us(pe)&&Vr(pe))continue;const _e=n.getElementByKey(re);if(_e!==null)return{nodeKey:re,element:_e}}return null}),q=()=>n.getEditorState().read(()=>{const re=[...St().getChildrenKeys()].reverse();for(const pe of re){const _e=Xt(pe);if(_e===null||Ja(_e)||Ps(_e)||Ru(_e)||Us(_e)&&Vr(_e))continue;const Le=n.getElementByKey(pe);
966if(Le!==null)return{nodeKey:pe,element:Le}}return null}),G=()=>{const re=i.current;re!==null&&(re.style.opacity="0")},$=({blockElement:re,edge:pe})=>{const _e=i.current;if(_e===null)return;const Le=re.getBoundingClientRect(),Ee=e.getBoundingClientRect(),{collapsedMarginTop:se,collapsedMarginBottom:me}=JB({element:re}),ge=N({blockRect:Le,edge:pe,collapsedMarginTop:se,collapsedMarginBottom:me})-Ee.top-XIe+e.scrollTop,Pe=D({rootElement:n.getRootElement(),blockRect:Le}),Ue=Pe.left-Ee.left+e.scrollLeft-w9;_e.style.transform=`translate(${Ue}px, ${ge}px)`,_e.style.width=`${Pe.width+w9*2}px`,_e.style.opacity="1"},J=({clientX:re,clientY:pe})=>{const _e=j();if(_e!==null){const de=_e.element.getBoundingClientRect();if(pe<de.top)return{nodeKey:_e.nodeKey,position:"before",element:_e.element}}const Le=jh({anchorElement:e,editor:n,pointX:re,pointY:pe});if(Le===null){const de=e.getBoundingClientRect();if(re<de.left||re>de.right)return null;const ge=q();if(ge===null)return null;const Pe=ge.element.getBoundingClientRect();return pe<=Pe.bottom?null:{nodeKey:ge.nodeKey,position:"after",element:ge.element}}if(H(Le)){const de=q();return de===null?null:{nodeKey:de.nodeKey,position:"after",element:de.element}}if(B(Le))return _e===null?null:{nodeKey:_e.nodeKey,position:"before",element:_e.element};const Ee=W(Le);if(Ee===null)return null;const se=Le.getBoundingClientRect(),me=se.top+se.height/2;return pe<me?{nodeKey:Ee,position:"before",element:Le}:{nodeKey:Ee,position:"after",element:Le}},ne=({clientX:re,clientY:pe})=>{const _e=S.current;if(_e===null)return;const Le=J({clientX:re,clientY:pe});if(Le===null){_e.drop=null,G();return}_e.drop={nodeKey:Le.nodeKey,position:Le.position},$({blockElement:Le.element,edge:R({position:Le.position})})},X=({clientX:re,clientY:pe})=>{const _e=S.current;if(_e===null||_e.ghostElement===null)return;const Le=re-_e.grabOffsetX,Ee=pe-_e.grabOffsetY;_e.ghostElement.style.transform=`translate(${Le}px, ${Ee}px)`},oe=()=>{const re=S.current;if(re===null||!re.isDragging)return;const pe=k({scroller:re.scroller}),_e=L({anchorElement:e,scrollerTop:pe.top}),Le=re.lastClientY-_e,Ee=pe.bottom-re.lastClientY,se=ge=>{const Pe=Math.min(Math.max(ge/Ub,0),1);return ZIe*(1-Pe)},de=Le<Ub?-se(Le):Ee<Ub?se(Ee):0;de!==0&&(re.scroller===null&&window.scrollBy(0,de),re.scroller!==null&&(re.scroller.scrollTop+=de),ne({clientX:re.lastClientX,clientY:re.lastClientY})),re.autoscrollRafId=requestAnimationFrame(oe)},ie=()=>{const re=S.current;if(re===null)return;const pe=re.draggedBlockElement.cloneNode(!0);if(!(pe instanceof HTMLElement))return;const _e=re.draggedBlockElement.getBoundingClientRect();re.grabOffsetX=re.startX-_e.left,re.grabOffsetY=re.startY-_e.top,re.scroller=z_({element:e});const Le=pe;Le.setAttribute("aria-hidden","true"),Le.style.position="fixed",Le.style.left="0",Le.style.top="0",Le.style.margin="0",Le.style.width=`${_e.width}px`,Le.style.pointerEvents="none",Le.style.opacity="0.5",Le.style.zIndex="9999",Le.style.backgroundColor="#ffffff",Le.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.12)",document.body.appendChild(Le),re.ghostElement=Le,re.isDragging=!0,document.body.style.userSelect="none",document.body.style.cursor="grabbing",y(!0),re.autoscrollRafId=requestAnimationFrame(oe)},ee=()=>{requestAnimationFrame(()=>{const re=n.getRootElement();re!==null&&re.focus({preventScroll:!0})})},te=()=>{const re=S.current;re!==null&&(re.ghostElement!==null&&re.ghostElement.parentNode!==null&&re.ghostElement.parentNode.removeChild(re.ghostElement),re.autoscrollRafId!==null&&cancelAnimationFrame(re.autoscrollRafId),re.handleElement.hasPointerCapture(re.pointerId)&&re.handleElement.releasePointerCapture(re.pointerId)),G(),document.body.style.userSelect="",document.body.style.cursor="",y(!1),S.current=null},le=()=>{const re=S.current;if(re===null)return;const pe=re.drop;if(re.isDragging&&pe!==null&&pe.nodeKey!==re.draggedNodeKey){const _e=re.draggedNodeKey;n.update(()=>{const Le=Xt(_e);if(Le===null)return;const Ee=Xt(pe.nodeKey);Ee!==null&&(pe.position==="before"&&Ee.insertBefore(Le),pe.position==="after"&&Ee.insertAfter(Le),Ne(Le)&&Le.selectStart())})}te(),ee()},he=()=>{te(),ee()},fe=re=>{const pe=S.current;if(pe!==null&&pe.pointerId===re.pointerId){if(pe.lastClientX=re.clientX,pe.last
966ClientY=re.clientY,!pe.isDragging){const _e=re.clientX-pe.startX,Le=re.clientY-pe.startY;if(Math.hypot(_e,Le)<JIe)return;ie()}X({clientX:re.clientX,clientY:re.clientY}),ne({clientX:re.clientX,clientY:re.clientY})}},ue=re=>{const pe=S.current;pe!==null&&pe.pointerId===re.pointerId&&(re.preventDefault(),le())},ye=re=>{const pe=S.current;pe!==null&&pe.pointerId===re.pointerId&&he()},ce=re=>{re.key==="Escape"&&S.current!==null&&(re.preventDefault(),he())},xe=()=>{S.current!==null&&he()};return window.addEventListener("pointermove",fe),window.addEventListener("pointerup",ue),window.addEventListener("pointercancel",ye),window.addEventListener("keydown",ce),window.addEventListener("blur",xe),()=>{window.removeEventListener("pointermove",fe),window.removeEventListener("pointerup",ue),window.removeEventListener("pointercancel",ye),window.removeEventListener("keydown",ce),window.removeEventListener("blur",xe),S.current!==null&&he()}},[e,B,n,N,L,R,k,D]);const z=l.useCallback(W=>{W.preventDefault(),W.stopPropagation()},[]),Q=l.useCallback(W=>{if(W.button!==0||(W.preventDefault(),W.stopPropagation(),u===null)||B(u))return;const H=O();if(H===null)return;const j=W.currentTarget;j.setPointerCapture(W.pointerId),S.current={pointerId:W.pointerId,handleElement:j,startX:W.clientX,startY:W.clientY,grabOffsetX:0,grabOffsetY:0,draggedNodeKey:H,draggedBlockElement:u,isDragging:!1,ghostElement:null,drop:null,lastClientX:W.clientX,lastClientY:W.clientY,scroller:null,autoscrollRafId:null}},[B,u,O]),M=l.useCallback(W=>{const H=O();H&&n.update(()=>{const j=Xt(H);if(!j||!Ne(j))return;const q=b(j);if(q){if(W==="text"){qa(q,()=>hn());return}if(W==="h1"){qa(q,()=>fo("h1"));return}if(W==="h2"){qa(q,()=>fo("h2"));return}if(W==="h3"){qa(q,()=>fo("h3"));return}if(W==="h4"){qa(q,()=>fo("h4"));return}if(W==="h5"){qa(q,()=>fo("h5"));return}}})},[n,O,b]),K=l.useCallback(W=>{IB(W)&&M(W)},[M]);return Wn.createPortal(a.jsxs(a.Fragment,{children:[a.jsxs("div",{ref:o,className:"pointer-events-none absolute left-0 top-0 opacity-0 transition-opacity duration-150 will-change-transform",children:[a.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-zinc-500"}),a.jsx("div",{className:"absolute inset-x-0 -bottom-px h-px bg-zinc-500"})]}),a.jsxs("div",{ref:r,"data-draggable-block-menu":!0,className:Y("absolute left-0 top-0 flex items-center gap-0.5 rounded-md p-0.5 opacity-0 transition-opacity duration-150 ease-in-out will-change-transform",!!A&&"invisible pointer-events-none"),children:[a.jsx("div",{"data-block-typeahead":!0,className:"relative z-60 shrink-0",onPointerDown:z,children:a.jsx(IA,{value:p,options:MB,onChange:K,onOpenChange:v,menuPlacement:"right-start",triggerSlot:a.jsx(dE,{className:"size-3 shrink-0","aria-hidden":!0})})}),a.jsx("button",{type:"button",tabIndex:-1,title:h.molecules.editor.DRAG_BLOCK,className:"flex size-6 shrink-0 cursor-grab items-center justify-center rounded text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 active:cursor-grabbing",onPointerDown:Q,children:a.jsx(YIe,{className:"size-4 shrink-0","aria-hidden":!0})})]}),a.jsx("div",{ref:i,className:"pointer-events-none absolute left-0 top-0 z-20 h-1 rounded-sm bg-[#99e5ff] opacity-0 will-change-transform"})]}),e)},ZB=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M9.91797 6.58691C10.6194 8.13977 11.8631 9.3836 13.416 10.085L15.0723 10.833L13.416 11.582C11.863 12.2834 10.6194 13.5271 9.91797 15.0801L9.16895 16.7363L8.4209 15.0801C7.71954 13.5272 6.47571 12.2835 4.92285 11.582L3.26465 10.833L4.92285 10.085C6.4757 9.38357 7.7195 8.13977 8.4209 6.58691L9.16895 4.92871L9.91797 6.58691Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"bevel"}),l.createElement("path",{d:"M15.8359 3.69788C15.9795 3.86639 16.1362 4.02309 16.3047 4.16663C16.1362 4.31016 15.9795 4.46686 15.8359 4.63538C15.6924 4.46686 15.5357 4.31016 15.3672 4.16663C15.5357 4.02309 15.6924 3.86639 15.8359 3.69788Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"bevel"})),tSe=6,nSe=({referenceElement:e,items:t,onItemClick:n,onClose:s})=>{const r=l.useRef(null);l.useEffect(()=>{const o=r.current;return o===null?void 0:Ji(e,o,async()=>{const u=await Ei(e,o,{placement:"bottom-end",strategy:"fixed",middleware:[_o(tSe),s2({fallbackPlacements:["top-end","bottom-start","to
966p-start"]}),Ai({padding:8,crossAxis:!0})]});Object.assign(o.style,{left:`${u.x}px`,top:`${u.y}px`})})},[e]),l.useEffect(()=>{const o=u=>{const d=u.target;d instanceof Element&&d.closest("[data-ai-block-menu]")===null&&s()},c=u=>{u.key==="Escape"&&s()};return document.addEventListener("mousedown",o),window.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",o),window.removeEventListener("keydown",c)}},[s]);const i=l.useCallback(o=>{o.preventDefault()},[]);return Wn.createPortal(a.jsx("div",{ref:r,role:"menu","data-ai-block-menu":!0,className:"fixed z-50 flex max-h-82 min-w-80 flex-col rounded-[8px] bg-white shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)]",children:a.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-1",children:a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:t.map(o=>a.jsx("div",{className:"pt-0.5 pb-0.5 first:pt-0 last:pb-0 group",children:a.jsx("button",{type:"button",role:"menuitem",onMouseDown:i,onClick:()=>n({item:o}),className:"flex w-full cursor-pointer items-start rounded-[6px] px-3 pt-1.5 pb-1.5 text-left roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 group-hover:bg-zinc-50",children:a.jsx("span",{className:"min-w-0 whitespace-normal wrap-break-word",children:o.label})})},o.id))})})}),document.body)},sSe=({defenseLineId:e,onClose:t})=>{const{id:n,documentId:s}=st(),{clientData:r}=Zi(),{patchResourceItem:i}=Ca({clientId:n}),o=It(d=>d.enqueueEcho),c=l.useMemo(()=>r?.defenseLines?.find(p=>p.id===e)?.evidenceIds??[],[r,e]),u=l.useCallback(({evidenceIds:d})=>{i({pathSegments:M7({defenseLineId:e}),pathValues:{},bodyKey:"evidenceIds",bodyValue:d,onPatchSuccess:()=>{s!==void 0&&o(s,h.client.defenseLines.echo.EVIDENCE_UPDATED)}})},[i,e,s,o]);return a.jsx(G7,{onClose:t,onApply:u,initialSelectedEvidenceIds:c,applyLabel:h.client.defenseLines.buttons.SAVE})},rSe=({defenseLineId:e,onClose:t})=>{const{clientData:n}=Zi(),{effectiveTree:s}=y2({clientId:n?.id,defenseLineId:e}),r=l.useRef(!1),i=l.useMemo(()=>{const d=n?.defenseLines?.find(p=>p.id===e);return!d||!d.leafId?null:d.leafId},[n,e]),o=l.useMemo(()=>Zh({tree:s}),[s]),c=l.useMemo(()=>k7({leaves:o,leafId:i}),[o,i]),u=l.useMemo(()=>C2({leaves:o,leafId:i}),[o,i]);return l.useEffect(()=>{n&&i===null&&(r.current||(r.current=!0,ve({type:"warning",message:h.client.defenseLines.practice.NO_LEAF_WARNING})))},[n,i]),n?a.jsx(V7,{clientData:n,leafId:i,leafLabel:u,presetParams:c,onClose:t},i):a.jsx(Ws,{onClose:t,isForceAnimateOnStart:!0,children:a.jsx(ct,{isWithWrapper:!0})})},R9=()=>Is(t=>t.isModalDebugInfoVisible)?a.jsx("div",{className:"pointer-events-none fixed top-0 right-0 left-0 z-22 h-14",children:a.jsx("div",{className:"relative mx-auto h-full w-full max-w-360",children:a.jsx(a2,{variant:"modal"})})}):null,iSe=({node:e})=>!(!Us(e)||!Vr(e)),oSe=({node:e})=>!!(iSe({node:e})||Ps(e)||Ru(e)),eF=({blockNode:e})=>St().getChildren().slice(0,e.getIndexWithinParent()).filter(n=>!oSe({node:n})).length+1;function aSe({blockNode:e,point:t}){if(t.type!=="text")return null;const n=t.getNode().getKey(),s=e.getAllTextNodes(),r=s.findIndex(o=>o.getKey()===n);return r===-1?null:s.slice(0,r).reduce((o,c)=>o+c.getTextContentSize(),0)+t.offset}function D9({point:e}){const t=e.getNode().getTopLevelElement();return t===null||!Ne(t)?null:{paragraphIndex:t.getIndexWithinParent(),offset:aSe({blockNode:t,point:e})}}function tF({blockNodeKey:e}){const t=St().getChildren(),n=t.findIndex(r=>r.getKey()===e);if(n===-1)return null;const s=eF({blockNode:t[n]});return{type:"document_ref",start:{paragraphIndex:n,offset:null},end:{paragraphIndex:n,offset:null},payload:{text:`Блок ${s}`}}}function lSe(){const e=We();if(!Me(e)||e.isCollapsed())return null;const t=e.getTextContent();if(t.trim()==="")return null;const n=[e.anchor,e.focus];e.isBackward()&&n.reverse();const s=D9({point:n[0]}),r=D9({point:n[1]});return s===null||r===null?null:{type:"document_ref",start:s,end:r,payload:{text:t}}}const _A=k2("defenseLineId",{parse:e=>typeof e=="string"?e:null}),cSe=k2("defenseLineExempt",{parse:e=>e===!0}
966),uSe=8,dSe=2,fSe="bind_defense_line",pSe="bind_evidence",hSe="defense_line_practice",mSe=({anchorElem:e,isBlockDragging:t})=>{const[n]=rn(),s=j_(),r=l.useRef(null),[i,o]=l.useState(null),[c,u]=l.useState(null),[d,p]=l.useState(null),[g,A]=l.useState(null),[E,x]=l.useState(null),y=It(j=>j.requestComposerFocus),I=It(j=>j.requestComposerSend),v=Tr(j=>j.addPill),{documentId:S}=st(),b=ua(j=>j.quota),w=ua(j=>j.loadStatus),_=It(j=>j.documents[S??""]??zE),N=l.useMemo(()=>uB({quota:b,loadStatus:w}),[b,w]),R=l.useMemo(()=>dB({isBootstrapped:_.isBootstrapped,streamStatus:_.streamStatus,isCopilotQuotaReady:N}),[_.isBootstrapped,_.streamStatus,N]),D=MA(j=>j.blockMenu),k=MA(j=>j.isBlockMenuError),L=l.useMemo(()=>d!==null,[d]);bB(L);const O=l.useMemo(()=>d===null?!1:n.getEditorState().read(()=>{const j=Xt(d);return j===null?!1:Nh(j,_A)!==null}),[n,d]),P=l.useMemo(()=>{const j=D;if(j!==void 0)return j.filter(q=>q.id===fSe?!O:q.id===pSe||q.id===hSe?O:!0)},[D,O]),B=l.useCallback(j=>n.read(()=>{const q=pr(j);if(q===null)return!1;const G=q.getTopLevelElementOrThrow();return Ja(G)||Ps(G)?!0:Us(G)?!!Vr(G):!1}),[n]),F=l.useCallback(()=>{if(L){p(null);return}if(c===null)return;if(k){oO();return}const j=D;if(j===void 0||j.length===0)return;const q=n.read(()=>{const G=pr(c);return G===null?null:G.getTopLevelElementOrThrow().getKey()});q!==null&&(n.update(()=>{const G=Xt(q);Ne(G)&&G.selectStart()}),p(q))},[D,k,n,c,L]),z=l.useCallback(()=>{p(null)},[]);l.useEffect(()=>{t&&p(null)},[t]);const Q=l.useCallback(({item:j})=>{const q=d;p(null);for(const G of j.actions){if(G==="add_text_pill"){if(S===void 0||j.pillText===null||j.pillText==="")continue;v(S,{type:"text_pill",text:j.pillText,payload:{action:j.id}});continue}if(G==="add_block_pill"){if(S===void 0||q===null)continue;const $=n.read(()=>tF({blockNodeKey:q}));if($===null)continue;v(S,$);continue}if(G==="focus_chat"){y();continue}if(G==="open_evidence_popup"){if(q===null)continue;const $=n.read(()=>{const J=Xt(q);return J===null?null:Nh(J,_A)});if($===null)continue;A($);continue}if(G==="open_defense_line_practice_popup"){if(q===null)continue;const $=n.read(()=>{const J=Xt(q);return J===null?null:Nh(J,_A)});if($===null)continue;x($);continue}if(G==="send_now"){I();continue}}},[v,S,n,d,y,I]),M=l.useCallback(()=>{A(null)},[]),K=l.useCallback(()=>{x(null)},[]),W=l.useCallback(j=>{j.preventDefault()},[]),H=l.useMemo(()=>Wn.createPortal(a.jsxs("div",{ref:r,"data-ai-block-menu":!0,className:"pointer-events-none absolute left-0 top-0 opacity-0 will-change-[transform,opacity]",children:[a.jsx("button",{ref:o,type:"button","aria-haspopup":"menu","aria-expanded":L,onMouseDown:W,onClick:F,className:Y("flex size-6 cursor-pointer items-center justify-center rounded-full",!L&&"text-indigo-500 hover:bg-indigo-50 hover:text-indigo-600",!!L&&"bg-indigo-50 text-indigo-600"),children:a.jsx(ZB,{className:"size-5 shrink-0","aria-hidden":!0})}),!!L&&i!==null&&P!==void 0&&a.jsx(nSe,{referenceElement:i,items:P,onItemClick:Q,onClose:z})]}),e),[e,P,z,Q,F,W,L,i]);return l.useEffect(()=>{R&&(u(null),p(null))},[R]),l.useEffect(()=>{const j=e.parentElement;if(j===null||R||L||s)return;const q=$=>{if(t)return;const J=$.target;if(!(J instanceof Element)){u(null);return}if(J.closest("[data-ai-block-menu]")!==null)return;const ne=jh({anchorElement:e,editor:n,pointX:$.x,pointY:$.y});if(ne===null){u(null);return}if(B(ne)){u(null);return}u(ne)},G=()=>{u(null)};return j.addEventListener("mousemove",q),j.addEventListener("mouseleave",G),()=>{j.removeEventListener("mousemove",q),j.removeEventListener("mouseleave",G)}},[e,B,n,R,L,t,s]),l.useEffect(()=>{s&&(L||u(null))},[s,L]),l.useEffect(()=>{const j=r.current;if(j===null)return;if(t){j.style.opacity="0",j.style.pointerEvents="none";return}if(c===null){j.style.opacity="0",j.style.pointerEvents="none";return}const q=c.getBoundingClientRect(),G=e.getBoundingClientRect(),$=q.right-G.left+uSe,J=q.top-G.top+e.scrollTop-dSe;j.style.opacity="1",j.style.pointerEvents="auto",j.style.transform=`translate(${$}px, ${J}px)`},[e,c,t]),l.useEffect(()=>{if(!L)return;const j=q=>{const G=q.target;G instanceof Element&&!G.contains(e)||p(null)};return window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("scroll",j,!0)}},[e,L]),n.isEditable()?a.jsxs(a.Fragment,{children:[H,g!==null&&Wn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx(R9,{}),a.jsx(sSe,{defenseLineId:g,onClose:M})]}),document.body),E!==null&&Wn.createPortal(a.jsxs(a.Fragment,{children:[a.jsx(R9,{}),a.jsx(rSe,{defenseLineId:E,onClose:K})]}),document.body)]}):null},gSe=e=>l.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M15 5L5.00003 15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M5 5L15 15",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ASe=({blockElement:e,pointY:t})=>{const n=e.querySelectorAll(":scope > .editor-layout-item:nth-child(3n + 3)");for(const s of n){if(!(s instanceof HTMLElement))continue;const r=s.getBoundingClientRect();if(!(t<r.top)&&!(t>r.bottom))return s}return null},zb=()=>{const e=p1(!0);return e.append(hn()),e},ESe=({roleCell:e})=>{const t=e.getNextSibling();if(!Fn(t))return;const n=t.getNextSibling();if(!Fn(n))return;
966const s=zb(),r=zb(),i=zb();n.insertAfter(s),s.insertAfter(r),r.insertAfter(i),s.selectStart()},xSe=({roleCell:e})=>{const t=e.getParent();if(!Ps(t))return;const n=e.getNextSibling();if(!Fn(n))return;const s=n.getNextSibling();Fn(s)&&(e.remove(),n.remove(),s.remove(),t.getChildrenSize()<=2&&t.remove())},CSe=({anchorElem:e})=>{const[t]=rn(),[n,s]=l.useState(null),r=l.useRef(null),i=l.useRef(null),o=l.useCallback(g=>t.read(()=>{const A=pr(g);return A===null?!1:!!Ps(A.getTopLevelElementOrThrow())}),[t]),c=l.useCallback(({pointX:g,pointY:A})=>{const E=jh({anchorElement:e,editor:t,pointX:g,pointY:A});return E===null||!o(E)?null:ASe({blockElement:E,pointY:A})},[e,t,o]),u=l.useCallback(g=>{g.preventDefault()},[]),d=l.useCallback(()=>{n!==null&&(t.update(()=>{const g=pr(n);Fn(g)&&xSe({roleCell:g})}),requestAnimationFrame(()=>{const g=i.current;if(g===null){s(null);return}s(c({pointX:g.x,pointY:g.y}))}))},[t,n,c]),p=l.useCallback(()=>{n!==null&&t.update(()=>{const g=pr(n);Fn(g)&&ESe({roleCell:g})})},[t,n]);return l.useEffect(()=>{const g=e.parentElement;if(g===null)return;const A=x=>{const y=r.current;y!==null&&x.target instanceof Node&&y.contains(x.target)||(i.current={x:x.x,y:x.y},s(c({pointX:x.x,pointY:x.y})))},E=()=>{s(null)};return g.addEventListener("mousemove",A),g.addEventListener("mouseleave",E),()=>{g.removeEventListener("mousemove",A),g.removeEventListener("mouseleave",E)}},[e,c]),l.useEffect(()=>{const g=r.current;if(g===null)return;if(n===null){g.style.opacity="0",g.style.pointerEvents="none";return}const E=requestAnimationFrame(()=>{const y=(()=>{const _=n.firstElementChild;return _ instanceof HTMLElement?_:n})(),I=y.getBoundingClientRect(),v=()=>{const _=Number.parseFloat(window.getComputedStyle(y).lineHeight);return Number.isFinite(_)?_:I.height},S=e.getBoundingClientRect(),b=g.getBoundingClientRect(),w=I.top+(v()-b.height)/2-S.top+e.scrollTop;g.style.opacity="1",g.style.pointerEvents="",g.style.transform=`translate(4px, ${w}px)`});return()=>{cancelAnimationFrame(E)}},[e,n]),Wn.createPortal(a.jsxs("div",{ref:r,"data-signatory-hover-controls":!0,className:"absolute left-0 top-0 flex items-center gap-0.5 rounded-md p-0.5 opacity-0 transition-opacity duration-150 ease-in-out will-change-transform",children:[a.jsx(Ls,{text:h.molecules.editor.SIGNATORY_BLOCK_DELETE,isFollowCursor:!1,children:a.jsx("button",{type:"button",tabIndex:-1,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded text-zinc-600 hover:bg-zinc-100 hover:text-zinc-800",onPointerDown:u,onClick:d,children:a.jsx(gSe,{className:"size-5 shrink-0","aria-hidden":!0})})}),a.jsx(Ls,{text:h.molecules.editor.SIGNATORY_BLOCK,isFollowCursor:!1,children:a.jsx("button",{type:"button",tabIndex:-1,className:"flex size-6 shrink-0 cursor-pointer items-center justify-center rounded text-zinc-600 hover:bg-zinc-100 hover:text-zinc-800",onPointerDown:u,onClick:p,children:a.jsx(QM,{className:"size-5 shrink-0","aria-hidden":!0})})})]}),e)},nF=e=>e===null?!1:Us(e)&&Vr(e)?!0:nF(e.getParent()),sF=e=>e===null?!1:Ps(e)?!0:sF(e.getParent()),G_=e=>!!(nF(e)||sF(e)),rF=()=>{const e=We();if(!Me(e)||e.isCollapsed())return!1;const t=e.anchor.getNode().getTopLevelElement(),n=e.focus.getNode().getTopLevelElement();return!(t===null||n===null||t===n)},ySe=({anchorElem:e,activeBlockKey:t,isUploadOpen:n,hasHeaderImage:s,hasHeaderBlock:r})=>{const[i]=rn(),o=l.useRef(null),[c,u]=l.useState(null),d=l.useCallback(()=>t===null?null:i.read(()=>{if(rF())return null;const E=Xt(t);return E===null||!Ne(E)||G_(E)?null:{number:eF({blockNode:E})}}),[t,i]);l.useEffect(()=>(u(d()),i.registerUpdateListener(()=>{u(d())})),[d,i]);const p=l.useCallback(()=>{const E=o.current;if(E===null)return;if(c===null){E.style.opacity="0";return}if(t===null){E.style.opacity="0";return}const x=i.getElementByKey(t);if(x===null){E.style.opacity="0";return}const y=x.getBoundingClientRect(),I=e.getBoundingClientRect(),v=y.left-I.left+e.scrollLeft,S=y.top-I.top+e.scrollTop,b=Math.round(S),w=Math.round(S+y.height);E.style.transform=`translate(${Math.round(v)}px, ${b}px)`,E.style.width=`${Math.round(y.width)}px`,E.style.height=`${w-b}px`,E.style.opacity="1"},[t,e,i,c]);l.useEffect(()=>{p()},[p]);const g=l.useRef(p);l.useEffect(()=>{g.current=p},[p]),l.useEffect(()=>{const E=()=>g.current();window.addEventListener("scroll",E,!0),window.addEventListener("resize",E);const x=i.registerUpdateListener(()=>g.current()),y=new ResizeObserver(()=>g.current());return y.observe(e),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E),x(),y.disconnect()}},[e,i]);const A=l.useRef(0);return l.useEffect(()=>{const E=x=>{g.current(),!(x<=0)&&(A.current=requestAnimationFrame(()=>{E(x-1)}))};return E(U_),()=>{cancelAnimationFrame(A.current)}},[n,s,r]),i.isEditable()?Wn.createPortal(a.jsx("div",{ref:o,"data-active-block-frame":!0,className:"pointer-events-none absolute left-0 top-0 z-10 opacity-0 will-change-transform",children:c!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"roboto-flex-100-400-1 absolute left-1/2 top-0 flex h-3 -translate-x-1/2 -translate-y-full items-center gap-1 whitespace-nowrap rounded-t-[4px] bg-zinc-500 px-1 text-[12px] leading-3 text-white",children:["Блок ",c.number]}),a.jsx("div",{className:"roboto-flex-100-400-1 absolute bottom-0 left-1/2 flex h-3 -translate-x-1/2 translate-y-full items-center whitespace-nowrap rounded-b-[4px] bg-zinc-100 px-1 text-[12px] leading-3 text-zinc-500",children:"shift + enter — создать новый блок"}),a.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-zinc-500"}),a.jsx("div",{className:"absolute inset-x-0 -bottom-px h-px bg-zinc-500"})]})}),e):null},bSe=({activeBlockKey:e})=>{const[t]=rn(),{documentId:n}=st(),s=Tr(d=>d.addPill),r=It(d=>{if(n)return d.documents[n]?.streamStatus}),i=l.useRef(null),o=l.useRef(r),c=l.useCallback(()=>e===null||!t.isEditable()?null:t.read(()=>
966{if(rF())return null;const d=Xt(e);return d===null||!Ne(d)||G_(d)?null:e}),[e,t]),u=l.useCallback(({framedBlockKey:d})=>{if(n===void 0)return;const p=t.read(()=>tF({blockNodeKey:d}));p!==null&&s(n,p)},[s,n,t]);return l.useEffect(()=>{const d=()=>{const p=c();p!==i.current&&(i.current=p,p!==null&&u({framedBlockKey:p}))};return d(),t.registerUpdateListener(()=>d())},[c,t,u]),l.useEffect(()=>{const d=o.current;if(o.current=r,r!=="opening"||d==="opening")return;const p=c();i.current=p,p!==null&&u({framedBlockKey:p})},[r,c,u]),null},ISe=8,SSe=24,vSe=2,_Se=8,TSe="Блок не привязан к линии защиты: при генерации текста данного блока не учитывается релевантная практика, доказательства и нормативка.",NSe=({anchorElem:e,isUploadOpen:t,hasHeaderImage:n,hasHeaderBlock:s})=>{const[r]=rn(),[i,o]=l.useState([]),c=l.useRef(new Map),u=l.useCallback(()=>r.read(()=>{const A=[];for(const E of St().getChildren())Ne(E)&&(G_(E)||Nh(E,_A)===null&&(Nh(E,cSe)||A.push(E.getKey())));return A}),[r]);l.useEffect(()=>{const A=()=>{const E=u();o(x=>x.length===E.length&&x.every((I,v)=>I===E[v])?x:E)};return A(),r.registerUpdateListener(()=>A())},[u,r]);const d=l.useCallback(()=>{const A=e.getBoundingClientRect();for(const[E,x]of c.current){const y=r.getElementByKey(E);if(y===null){x.style.opacity="0";continue}const I=y.getBoundingClientRect(),v=I.right-A.left+ISe+SSe+_Se,S=I.top-A.top+e.scrollTop-vSe;x.style.transform=`translate(${Math.round(v)}px, ${Math.round(S)}px)`,x.style.opacity="1"}},[e,r]);l.useEffect(()=>{d()},[d,i]);const p=l.useRef(d);l.useEffect(()=>{p.current=d},[d]),l.useEffect(()=>{const A=()=>p.current();window.addEventListener("scroll",A,!0),window.addEventListener("resize",A);const E=r.registerUpdateListener(()=>p.current()),x=new ResizeObserver(()=>p.current());return x.observe(e),()=>{window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A),E(),x.disconnect()}},[e,r]);const g=l.useRef(0);return l.useEffect(()=>{const A=E=>{p.current(),!(E<=0)&&(g.current=requestAnimationFrame(()=>{A(E-1)}))};return A(U_),()=>{cancelAnimationFrame(g.current)}},[t,n,s]),Wn.createPortal(a.jsx(a.Fragment,{children:i.map(A=>a.jsx("div",{"data-defense-line-warning":!0,ref:E=>{if(E===null){c.current.delete(A);return}c.current.set(A,E)},className:"pointer-events-none absolute left-0 top-0 z-10 opacity-0 will-change-transform",children:a.jsx("div",{className:"pointer-events-auto flex size-6 cursor-pointer items-center justify-center",children:a.jsx(Do,{isFullWidth:!1,horizontalPosition:"right",content:a.jsx("div",{className:"roboto-flex-100-400-1 w-64 text-[14px] leading-[16px] text-white",children:TSe}),children:a.jsx($k,{className:"size-4 shrink-0","aria-hidden":!0})})})},A))}),e)},wSe=()=>{const[e]=rn(),[t,n]=l.useState(null);return l.useEffect(()=>e.registerUpdateListener(({editorState:s})=>{const r=s.read(()=>{const i=We();return Me(i)?i.anchor.getNode().getTopLevelElementOrThrow().getKey():null});r!==null&&n(i=>i===r?i:r)}),[e]),t},RSe=e=>{const t=e.anchor.getNode(),n=e.focus.getNode();return t===n?t:e.isBackward()?zR(e.focus)?t:n:zR(e.anchor)?n:t},iF=e=>{const n=e.getRootElement()?.ownerDocument.defaultView;return n?vi(n):null},DSe=({anchorElem:e,editor:t,isBold:n,isItalic:s,isUnderline:r,isHighlight:i,onScrollDismiss:o})=>{const c=l.useRef(null),u=l.useCallback(()=>{t.dispatchCommand(mr,"bold")},[t]),d=l.useCallback(()=>{t.dispatchCommand(mr,"italic")},[t]),p=l.useCallback(()=>{t.dispatchCommand(mr,"underline")},[t]),g=l.useCallback(()=>{t.dispatchCommand(mr,"highlight")},[t]),A=l.useCallback(()=>
966{window.dispatchEvent(new Event($S))},[]),{documentId:E}=st(),x=Tr(N=>N.addPill),y=It(N=>N.requestComposerFocus),I=l.useCallback(()=>{if(E===void 0)return;const N=t.read(()=>lSe());N!==null&&(x(E,N),t.update(()=>{as(null)}),y())},[x,E,t,y]),v=h.molecules.editor.tooltips.ADD_COMMENT,S=h.molecules.editor.tooltips.ADD_COPILOT_PILL,b=l.useCallback(N=>{if(c.current&&(N.buttons===1||N.buttons===3)&&c.current.style.pointerEvents!=="none"){const R=document.elementFromPoint(N.clientX,N.clientY);R&&!c.current.contains(R)&&(c.current.style.pointerEvents="none")}},[]),w=l.useCallback(()=>{c.current&&c.current.style.pointerEvents!=="auto"&&(c.current.style.pointerEvents="auto")},[]);l.useEffect(()=>(document.addEventListener("mousemove",b),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",w)}),[b,w]);const _=l.useCallback(()=>{const N=c.current,R=iF(t),D=t.getRootElement();!N||!R||!D||t.getEditorState().read(()=>{const k=We();if(k===null||!Me(k)||R.isCollapsed||!D.contains(R.anchorNode))return;const L=jB(R,D);SA(L,N,e)})},[e,t]);return l.useLayoutEffect(()=>{_()},[_]),l.useEffect(()=>{const N=()=>{_()},R=D=>{const k=D.target;k instanceof Element&&!k.contains(e)||o()};return window.addEventListener("resize",N),window.addEventListener("scroll",R,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",R,!0)}},[e,_,o]),l.useEffect(()=>(_(),Nr(t.registerUpdateListener(({editorState:N})=>{N.read(()=>{_()})}),t.registerCommand(Um,()=>(_(),!1),Ya))),[t,_]),t.isEditable()?a.jsxs("div",{ref:c,className:"pointer-events-auto absolute left-0 top-0 z-50 flex h-fit items-center gap-0.5 rounded-lg border border-zinc-200 bg-white p-1 opacity-0 shadow-md transition-opacity",role:"toolbar",children:[a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.BOLD,"aria-label":h.molecules.editor.tooltips.BOLD,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",n?"bg-zinc-100 text-[#556FD5] hover:text-zinc-950":"bg-transparent text-zinc-600"),onClick:u,children:a.jsx(O_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.ITALIC,"aria-label":h.molecules.editor.tooltips.ITALIC,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",s?"bg-zinc-100 text-[#556FD5] hover:text-zinc-950":"bg-transparent text-zinc-600"),onClick:d,children:a.jsx(P_,{className:"size-5"})}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.UNDERLINE,"aria-label":h.molecules.editor.tooltips.UNDERLINE,className:Y("flex size-8 items-center justify-center rounded-md p-2 hover:bg-zinc-100 cursor-pointer",r?"bg-zinc-100 text-[#556FD5] hover:text-zinc-950":"bg-transparent text-zinc-600"),onClick:p,children:a.jsx(L_,{className:"size-5"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",title:h.molecules.editor.tooltips.HIGHLIGHT,"aria-label":h.molecules.editor.tooltips.HIGHLIGHT,className:Y("flex size-8 items-center justify-center rounded-md p-2 cursor-pointer",i?"bg-zinc-100 text-[#556FD5] hover:text-zinc-950":"bg-transparent text-zinc-600 hover:bg-zinc-100"),onClick:g,children:a.jsx(M_,{className:"size-5"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",title:v,"aria-label":v,className:"flex size-8 cursor-pointer items-center justify-center rounded-md p-2 text-zinc-600 hover:bg-zinc-100",onMouseDown:N=>{N.preventDefault(),A()},children:a.jsx(H_,{className:"size-5"})}),E!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",title:S,"aria-label":S,className:"flex size-8 cursor-pointer items-center justify-center rounded-md p-2 text-zinc-600 hover:bg-zinc-100",onMouseDown:N=>{N.preventDefault(),I()},children:a.jsx(ZB,{className:"size-5"})})]})]}):null},kSe=({anchorElem:e,isBlockDragging:t})=>{const[n]=rn(),[s,r]=l.useState(!1),[i,o]=l.useState(!1),[c,u]=l.useState(!1),[d,p]=l.useState(!1),[g,A]=l.useState(!1),E=j_(),x=l.useRef(!1),y=l.useCallback(()=>{r(!1)},[]),I=l.useCallback(()=>
966{if(x.current){r(!1);return}n.getEditorState().read(()=>{if(n.isComposing())return;const v=We(),S=iF(n),b=n.getRootElement();if(b===null||S===null||!b.contains(S.anchorNode)){r(!1);return}if(!Me(v)){r(!1);return}const w=RSe(v);o(v.hasFormat("bold")),u(v.hasFormat("italic")),p(v.hasFormat("underline")),A(v.hasFormat("highlight")),v.getTextContent()!==""&&($e(w)||Kf(w))?r(!0):r(!1);const _=v.getTextContent().replace(/\n/g,"");!v.isCollapsed()&&_===""&&r(!1)})},[n]);return l.useEffect(()=>(document.addEventListener("selectionchange",I),()=>{document.removeEventListener("selectionchange",I)}),[I]),l.useEffect(()=>Nr(n.registerUpdateListener(()=>{I()}),n.registerRootListener(()=>{n.getRootElement()===null&&r(!1)})),[n,I]),l.useEffect(()=>{const v=()=>{x.current=!0,r(!1)},S=()=>{x.current&&(x.current=!1,requestAnimationFrame(()=>{I()}))},b=k=>{k.key==="Shift"&&(x.current=!0,r(!1))},w=k=>{k.key==="Shift"&&x.current&&(x.current=!1,requestAnimationFrame(()=>{I()}))},_=k=>{k&&(k.addEventListener("pointerdown",v),k.addEventListener("keydown",b))},N=k=>{k&&(k.removeEventListener("pointerdown",v),k.removeEventListener("keydown",b))};let R=n.getRootElement();_(R),document.addEventListener("pointerup",S),document.addEventListener("keyup",w);const D=n.registerRootListener((k,L)=>{N(L),_(k),R=k});return()=>{N(R),document.removeEventListener("pointerup",S),document.removeEventListener("keyup",w),D()}},[n,I]),t||!s||E?null:Wn.createPortal(a.jsx(DSe,{anchorElem:e,editor:n,isBold:i,isItalic:c,isUnderline:d,isHighlight:g,onScrollDismiss:y}),e)},OSe=500,PSe=424,k9=128,Qb=10,LSe=5,Hb=16;function O9(){const e=[],t=n=>{if(qu(n)&&e.push(n),!!Ne(n))for(const s of n.getChildren())t(s)};return t(St()),e}const MSe=({anchorElem:e})=>{const[t]=rn(),[n,s]=l.useState(null),[r,i]=l.useState(null),[o,c]=l.useState(!1),u=l.useRef(null),d=l.useRef(null),p=l.useRef(null),g=l.useRef(!1),A=l.useRef(!1),E=l.useRef(!1);l.useEffect(()=>{g.current=n!==null},[n]);const x=l.useCallback(()=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),y=l.useCallback(()=>{p.current!==null&&(window.cancelAnimationFrame(p.current),p.current=null)},[]),I=l.useCallback(()=>{x(),y(),c(!1),s(null),i(null)},[y,x]),v=l.useCallback(({markElement:_})=>t.getEditorState().read(()=>{for(const N of O9()){if(t.getElementByKey(N.getKey())!==_)continue;const D=N.getIDs();if(D.length!==1)return null;const k=N.getCommentText();return{commentId:D[0],text:k}}return null}),[t]),S=l.useCallback(({markElement:_})=>{if(A.current||E.current||!_.isConnected)return;const N=v({markElement:_});N&&N.text.trim().length!==0&&s({commentId:N.commentId,text:N.text,markElement:_})},[v]),b=l.useCallback(({markElement:_})=>{E.current||(x(),d.current=window.setTimeout(()=>{d.current=null,S({markElement:_})},OSe))},[S,x]);if(l.useEffect(()=>{const _=N=>{if(!(N instanceof CustomEvent))return;const R=N.detail;if(!R||typeof R!="object"||!("isOpen"in R))return;const D=R.isOpen;typeof D=="boolean"&&(A.current=D,D&&I())};return window.addEventListener(YS,_),()=>{window.removeEventListener(YS,_)}},[I]),l.useEffect(()=>{const _=()=>{E.current=!0,I()},N=()=>{E.current=!1};return e.addEventListener("dragstart",_),e.addEventListener("dragend",N),e.addEventListener("drop",N),()=>{e.removeEventListener("dragstart",_),e.removeEventListener("dragend",N),e.removeEventListener("drop",N)}},[e,I]),l.useEffect(()=>{const _=k=>{const L=P=>{if(P.pointerType!=="mouse")return;const B=P.target;if(!(B instanceof Element))return;const F=B.closest(".editor-comment-mark");if(!F||!(F instanceof HTMLElement))return;const z=P.relatedTarget;if(!(z instanceof Element&&z.closest(".editor-comment-mark")===F)){if(y(),g.current){x(),S({markElement:F});return}b({markElement:F})}},O=P=>{if(P.pointerType!=="mouse")return;const B=P.target;if(!(B instanceof Element))return;const F=B.closest(".editor-comment-mark");if(!F)return;const z=P.relatedTarget;z instanceof Element&&z.closest(".editor-comment-mark")===F||(x(),y(),p.current=window.requestAnimationFrame(()=>{p.current=null,I()}))};return k.addEventListener("pointerover",L),k.addEventListener("pointerout",O),()=>{k.removeEventListener("pointerover",L),k.removeEventListener("pointerout",O)}},N={current:null},R=t.getRootElement();R&&(N.current=_(R));const D=t.registerRootListener((k,L)=>{L&&N.current&&(N.current(),N.current=null),k&&(N.current=_(k))});return()=>{N.current&&N.current(),D()}},[S,y,x,t,I,b]),l.useLayoutEffect(()=>{if(!n){c(!1),i(null);return}if(!u.current)return;const N=n.markElement.getBoundingClientRect(),R=e.getBoundingClientRect(),O=(N.top-Hb>=k9+Qb?N.top-k9-Qb:N.bottom+Qb)-R.top,P=N.left-LSe,B=Hb,F=window.innerWidth-PSe-Hb,Q=Math.max(B,Math.min(P,F))-R.left;i({left:Q,top:O});const M=window.requestAnimationFrame(()=>{c(!0)});return()=>{window.cancelAnimationFrame(M)}},[e,n]),l.useEffect(()=>{if(!n)return;const _=()=>{I()};return window.addEventListener("scroll",_,!0),window.addEventListener("wheel",_),window.addEventListener("resize",_),window.addEventListener("pointerdown",_),()=>{window.removeEventListener("scroll",_,!0),window.removeEventListener("wheel",_),window.removeEventListener("resize",_),window.removeEventListener("pointerdown",_)}},[n,I]),l.useEffect(()=>{if(n)return t.registerUpdateListener(()=>{if(!n.markElement.isConnected){I();return}const _=t.getEditorState().read(()=>{for(const D of O9()){if(!D.hasID(n.commentId))continue;
966const k=t.getElementByKey(D.getKey());if(k&&k instanceof HTMLElement)return{markElement:k,text:D.getCommentText()}}return null});if(!_){I();return}if(_.text.trim().length===0){I();return}const N=_.markElement===n.markElement,R=_.text===n.text;N&&R||s({commentId:n.commentId,text:_.text,markElement:_.markElement})})},[n,t,I]),l.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current),p.current!==null&&window.cancelAnimationFrame(p.current)},[]),!n)return null;const w=(()=>{const _="0px 4px 31px rgba(0, 0, 0, 0.08), 0px 0.893452px 6.92426px rgba(0, 0, 0, 0.0476886), 0px 0.266004px 2.06153px rgba(0, 0, 0, 0.0323114)";return r?{left:r.left,top:r.top,boxShadow:_}:{left:0,top:0,boxShadow:_}})();return Wn.createPortal(a.jsx("div",{ref:u,style:w,className:Y("absolute z-50 h-32 w-[424px] overflow-hidden rounded-lg bg-white px-5 py-3.5 text-zinc-950","roboto-flex-100-400-1 text-[14px] leading-[20px]","whitespace-pre-wrap break-words","line-clamp-[5]","select-none pointer-events-none","transition-opacity duration-[250ms] ease-out",!!o&&"opacity-100",!o&&"opacity-0"),children:n.text}),e)},jSe=({style:e})=>{const t=e.split(";").map(n=>n.trim()).find(n=>n.toLowerCase().startsWith("font-family"));return t===void 0?"":t},BSe=e=>{const t=e.anchor,n=t.getNode();if($e(n)){if(t.offset<n.getTextContentSize())return n;const s=n.getNextSibling();return $e(s)&&s.getTextContentSize()>0?s:null}if(Ne(n)){const s=n.getChildAtIndex(t.offset);return $e(s)&&s.getTextContentSize()>0?s:null}return null},FSe=()=>{const e=We();if(!Me(e))return;const t=BSe(e);if(t!==null){e.format=t.getFormat(),e.style=t.getStyle();return}e.format=0,e.style=jSe({style:e.style})},USe=()=>{const[e]=rn();return l.useEffect(()=>e.registerCommand(rm,t=>{if(t===null)return!1;const n=We();if(!Me(n))return!1;t.preventDefault();const s=t.shiftKey;return s&&e.dispatchCommand(Cu,void 0),s||e.dispatchCommand(Jl,!1),FSe(),!0},ns),[e]),null},zSe=({node:e})=>!(!Ne(e)||e.isInline()||Kf(e)),QSe=({nodes:e})=>{for(;e.length>0&&Zo(e[0]);)e.shift();for(;e.length>0&&Zo(e[e.length-1]);)e.pop()},HSe=()=>{const[e]=rn();return l.useEffect(()=>e.registerCommand(ZP,({nodes:t,selection:n})=>{if(QSe({nodes:t}),t.length===0||!Me(n))return!1;const s=t[0];if(!zSe({node:s}))return!1;const i=n.anchor.getNode().getTopLevelElement();if(!Kf(i)||i.isEmpty())return!1;try{n.isCollapsed()||n.removeText();const o=n.insertParagraph();if(o===null)return!0;const c=hn();o.insertBefore(c),c.selectStart();const u=We();return Me(u)&&(u.insertNodes(t),i.isAttached()&&i.isEmpty()&&i.remove(),o.isAttached()&&o.isEmpty()&&o.remove()),!0}catch(o){return console.error("PreserveFirstBlockOnPastePlugin: paste insertion failed",o),!0}},ns),[e]),null},oF=e=>!(!Us(e)||!Vr(e)),aF=e=>!!(oF(e)||Ps(e)||Ja(e)),VSe=e=>!(!Fn(e)||!Ps(e.getParent())),q_=({node:e})=>{if(!Ne(e))return e;const t=e.getFirstChild();return t===null?e:q_({node:t})},b1=({node:e})=>{if(!Ne(e))return e;const t=e.getChildren();if(t.length===0)return e;const n=t.filter(s=>!(Zo(s)||$e(s)&&s.getTextContentSize()===0));return n.length>0?b1({node:n[n.length-1]}):b1({node:t[t.length-1]})},lF=({point:e,node:t})=>{if(Ne(t)){e.set(t.getKey(),0,"element");return}if($e(t)){e.set(t.getKey(),0,"text");return}const n=t.getParent();n!==null&&e.set(n.getKey(),t.getIndexWithinParent(),"element")},cF=({point:e,node:t})=>{if(Ne(t)){e.set(t.getKey(),t.getChildrenSize(),"element");return}if($e(t)){e.set(t.getKey(),t.getTextContentSize(),"text");return}const n=t.getParent();n!==null&&e.set(n.getKey(),t.getIndexWithinParent()+1,"element")},TA=({firstNode:e,lastNode:t})=>{const n=q_({node:e}),s=b1({node:t}),r=ca();lF({point:r.anchor,node:n}),cF({point:r.focus,node:s}),as(r)},P9=({a:e,b:t})=>!(e.key!==t.key||e.offset!==t.offset||e.type!==t.type),GSe=({selection:e})=>e.isBackward()?{start:e.focus,end:e.anchor}:{start:e.anchor,end:e.focus},qSe=({selection:e,block:t})=>{const n=q_({node:t}),s=b1({node:t}),r=ca();lF({point:r.anchor,node:n}),cF({point:r.focus,node:s});const{start:i,end:o}=GSe({selection:e});return!(!P9({a:i,b:r.anchor})||!P9({a:o,b:r.focus}))},L9=()=>{const e=St().getChildren().filter(t=>!aF(t));e.length!==0&&TA({firstNode:e[0],lastNode:e[e.length-1]})},WSe=()=>{const[e]=rn();return l.useEffect(()=>e.registerCommand(im,()=>{try{const t=We();if(!Me(t))return L9(),!0;const n=t.anchor.getNode(),s=Vs(n,oF);if(s!==null)return TA({firstNode:s,lastNode:s}),!0;const r=Vs(n,VSe);if(r!==null)return TA({firstNode:r,lastNode:r}),!0;const i=n.getTopLevelElement();if(i!==null&&!aF(i)){const o=t.focus.getNode().getTopLevelElement(),c=o!==null&&o!==i,u=qSe({selection:t,block:i});if(!c&&!u)return TA({firstNode:i,lastNode:i}),!0}return L9(),!0}catch(t){return console.error("SelectAllScopePlugin: select-all failed",t),!0}},ns),[e]),null},KSe=()=>{const[e]=rn();return l.useEffect(()=>{const t=()=>{e.update(()=>{const n=St(),s=n.getChildren(),r=s.filter(Ja);if(s.some(Ps)){for(const o of r)o.remove();return}for(const o of r.slice(1))o.remove();const i=r[0];if(!i){n.append(qM());return}n.getLastChild()!==i&&n.append(i)},{tag:"history-merge"})};return t(),e.registerUpdateListener(({editorState:n})=>{n.read(()=>{const r=St(),i=r.getChildren(),o=i.filter(Ja);return i.some(Ps)?o.length>0:o.length!==1||r.getLastChild()!==o[0]})&&queueMicrotask(t)})},[e]),null},$Se=e=>!(!Fn(e)||!Ps(e.getParent())),M9=e=>{const t=Vs(e,$Se);return Fn(t)?t:null},YSe=e=>{const t=e.getAllTextNodes();return t.length===0?!0:t.every(n=>n.getTextContentSize()===0)},XSe=(e,t)=>{if(!_f(e.getNode(),t))return!1;const n=t.getAllTextNodes();return n.length>0?!(e.type!=="text"||e.key!==n[0].getKey()||e.offset!==0):!(e.type!=="element"||e.offset!==0)},JSe=(e,t)=>{if(!_f(e.getNode(),t))return!1;const n=t.getAllTextNodes();if(n.length>0){const s=n[n.length-1];return!(e.type!=="text"||e.key!==s.getKey()||e.offset!==s.getTextContentSize())}return e.type==="element"},Vc=({isBackward:e})=>{const t=We();if(!Me(t))return!1;const n=M9(t.anchor.getNode()),s=M9(t.focus.getNode()),r=n===null?null:n.getKey(),i=s===null?null:s.getKey();return r!==i?!0:n===null||!t.isCollapsed()?!1:!!(YSe(n)||e&&XSe(t.anchor,n)||!e&&JSe(t.anchor,n))},I1=e=>{if(!Fn(e)||!Ps(e.getParent()))return!1;const t=e.getIndexWithinParent();return!(t<2||(t-2)%3!==1)},Y0=()=>
966{const e=We();return Me(e)?Vs(e.anchor.getNode(),I1)!==null||Vs(e.focus.getNode(),I1)!==null:!1},ZSe=({signatureCell:e})=>{const t=Vu();if(!Me(t))return!1;const n=e.getPreviousSibling();if(!Fn(n))return!1;const s=Vs(t.anchor.getNode(),Fn);return!(s===null||s.getKey()!==n.getKey())},eve=({isArrowNav:e})=>{const t=We();if(!Me(t)||!t.isCollapsed())return;const n=Vs(t.anchor.getNode(),I1);if(!Fn(n))return;const s=n.getNextSibling();if(e&&ZSe({signatureCell:n})&&Fn(s)){s.selectStart();return}const r=n.getPreviousSibling();Fn(r)&&r.selectEnd()},tve=()=>{const[e]=rn(),t=l.useRef("pointer");return l.useEffect(()=>{const n=()=>{t.current="pointer"},s=r=>{r.key.startsWith("Arrow")&&(t.current="arrow")};return Nr(e.registerNodeTransform(cl,r=>{Ps(r.getParent())&&(r.getChildrenSize()>0||r.append(hn()))}),e.registerNodeTransform(cl,r=>{I1(r)&&(r.getTextContentSize()===0&&r.getChildrenSize()<=1||(r.clear(),r.append(hn())))}),e.registerUpdateListener(({editorState:r})=>{r.read(()=>{for(const i of St().getChildren())if(Ps(i))for(const o of i.getChildren()){if(!Fn(o))continue;const c=e.getElementByKey(o.getKey());if(c instanceof HTMLElement){if(o.getTextContentSize()===0){c.setAttribute("data-empty","true");continue}c.removeAttribute("data-empty")}}})}),e.registerCommand(vE,()=>Vc({isBackward:!0}),ns),e.registerCommand(P2,()=>Vc({isBackward:!1}),ns),e.registerCommand(el,r=>Vc({isBackward:r}),ns),e.registerCommand(yu,r=>Vc({isBackward:r}),ns),e.registerCommand(bu,r=>Vc({isBackward:r}),ns),e.registerCommand(sm,()=>Vc({isBackward:!0}),ns),e.registerCommand(TE,()=>Vc({isBackward:!0}),ns),e.registerCommand(ru,()=>Y0(),ns),e.registerCommand(Cu,()=>Y0(),ns),e.registerCommand(Jl,()=>Y0(),ns),e.registerCommand(bE,()=>Y0(),ns),e.registerRootListener((r,i)=>{i!==null&&(i.removeEventListener("pointerdown",n),i.removeEventListener("keydown",s)),r!==null&&(r.addEventListener("pointerdown",n),r.addEventListener("keydown",s))}),e.registerCommand(Um,()=>(eve({isArrowNav:t.current==="arrow"}),!1),Ya))},[e]),null},S1={count:0},uF=e=>{if(e<=0){S1.count>0&&(S1.count-=1);return}requestAnimationFrame(()=>uF(e-1))},nve=()=>S1.count>0,sve=({frames:e})=>{S1.count+=1,uF(e)},rve=120,ive=e=>{const n=zt()?.mainWrapperRef,s=l.useRef(null);l.useEffect(()=>{const r=n?.current;if(!e||!r)return;s.current=null;const i=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<rve&&requestAnimationFrame(()=>{r.scrollTop=r.scrollHeight-r.clientHeight})},o=new ResizeObserver(c=>{const u=c[0];if(!u)return;const d=u.contentRect.height,p=s.current;s.current=d,!(p!==null&&d<p-1)&&(nve()||i())});return o.observe(e),()=>o.disconnect()},[e,n])},ove=({children:e})=>{const[t,n]=l.useState(()=>new Set),s=l.useCallback((i,o)=>{n(c=>{if(c.has(i)===o)return c;const d=new Set(c);return o?d.add(i):d.delete(i),d})},[]),r=l.useMemo(()=>t,[t]);return a.jsx(yB.Provider,{value:s,children:a.jsx(CB.Provider,{value:r,children:e})})},ave=()=>{const[e]=rn(),t=wSe(),[n,s]=l.useState(!1),[r,i]=l.useState(null),[o,c]=l.useState(!1),[u,d]=l.useState(!1),[p,g]=l.useState(!1),A=l.useRef(!0),E=l.useCallback(v=>{i(v)},[]);ive(r),l.useEffect(()=>{if(A.current){A.current=!1;return}sve({frames:U_}),Wbe({editor:e})},[e,o]);const x=l.useCallback(()=>{c(!0)},[]),y=l.useCallback(()=>{c(!1)},[]),I=o||u;return a.jsx(ove,{children:a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("div",{className:"relative flex min-w-0 flex-1 flex-col",children:[a.jsx("div",{className:"sticky top-14 z-10 shrink-0 bg-white",children:a.jsx(pIe,{})}),a.jsxs("div",{ref:E,className:"relative isolate flex min-w-0 flex-1 flex-col",children:[a.jsxs("div",{className:Y("mt-2 flex shrink-0 gap-0 px-16",!!I&&"flex-col",!I&&"flex-row"),children:[a.jsx($Ie,{isUploadOpen:o,onOpenUploadPanel:x,onCloseUploadPanel:y,onHeaderImagePresenceChange:d}),a.jsx("div",{className:Y("flex w-full justify-end",!!I&&!p&&"mt-2"),children:a.jsx(GIe,{isUploadOpen:o,anchorElem:r,onHeaderBlockPresenceChange:g})})]}),a.jsx("div",{className:Y("relative flex min-w-0 flex-1 flex-col",!!p&&"mt-10",!p&&"mt-2"),children:a.jsx(SIe,{contentEditable:a.jsx(kIe,{className:"ContentEditable__root min-w-0 flex-1 resize-none px-16 pb-36 pt-0 text-[15px] outline-0",style:{fontFamily:wf.arial}}),ErrorBoundary:wIe})}),r?a.jsxs(a.Fragment,{children:[a.jsx(ySe,{anchorElem:r,activeBlockKey:t,isUploadOpe
966n:o,hasHeaderImage:u,hasHeaderBlock:p}),a.jsx(eSe,{anchorElem:r,onDraggingChange:s}),a.jsx(mSe,{anchorElem:r,isBlockDragging:n}),a.jsx(NSe,{anchorElem:r,isUploadOpen:o,hasHeaderImage:u,hasHeaderBlock:p}),a.jsx(CSe,{anchorElem:r}),a.jsx(kSe,{anchorElem:r,isBlockDragging:n}),a.jsx(fIe,{anchorElem:r}),a.jsx(MSe,{anchorElem:r})]}):null]})]}),a.jsx(bSe,{activeBlockKey:t}),a.jsx(jIe,{}),a.jsx(BIe,{}),a.jsx(USe,{}),a.jsx(HSe,{}),a.jsx(WSe,{}),a.jsx(KSe,{}),a.jsx(tve,{})]})})},lve=()=>({namespace:"Editor",theme:KM,onError(e){throw e},nodes:[...WM()]}),cve=e=>l.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M14 16L2 7.98938L14 0L10.7527 7.98938L14 16Z",fill:"currentColor"})),dF=l.forwardRef(({value:e,handleChange:t,placeholder:n,className:s,onBlur:r,onKeyDown:i,disabled:o=!1},c)=>{const u=l.useCallback(d=>{t(d.target.value)},[t]);return a.jsx("input",{ref:c,type:"text",value:e,onChange:u,onBlur:r,onKeyDown:i,disabled:o,placeholder:n,className:Y("h-full min-w-0 flex-1 bg-transparent border-0 outline-none ring-0 focus:ring-0 shadow-none","roboto-flex-25-700-1 text-[20px] leading-[20px] uppercase","text-zinc-950 placeholder:text-zinc-300","disabled:pointer-events-none disabled:opacity-50",s)})});dF.displayName="DocumentNameInput";const uve=!1,dve=({clientId:e,documentId:t,documentVersion:n,serverDocumentName:s,documentName:r,handleDocumentNameChange:i,backLinkPath:o,handleDownloadClick:c,handlePrintClick:u,isDownloadPending:d=!1,isPrintPending:p=!1,isPrintDisabled:g=!1,autosaveStatus:A="idle",documentTitleFocusRequestCount:E=0})=>{const x=l.useRef(null),y=Hi(w=>w.enqueueDocumentMeta);l.useLayoutEffect(()=>{E!==0&&x.current?.focus()},[E]);const I=l.useCallback(()=>{const w=r.trim();if(!w){i(s);return}w!==s.trim()&&y({clientId:e,documentId:t,baseVersion:n,fields:{name:w},isUserRename:!0})},[e,t,r,n,y,i,s]),v=l.useCallback(()=>{I()},[I]),S=l.useCallback(w=>{w.key==="Enter"&&w.currentTarget.blur()},[]),b=p||d;return a.jsxs("div",{className:"flex h-14 w-full shrink-0 items-center",children:[a.jsx(Hs,{className:"flex h-full shrink-0 cursor-pointer items-center justify-center pl-3 pr-6 text-gray-400 hover:text-zinc-600",to:o,children:a.jsx(cve,{className:"size-4"})}),a.jsx(dF,{ref:x,value:r,handleChange:i,onBlur:v,onKeyDown:S,placeholder:h.client.documents.NEW_DOCUMENT,className:"pr-6"}),A==="saving"&&a.jsx("span",{className:"roboto-flex-100-400-1 shrink-0 truncate pr-6 text-[13px] leading-[16px] text-zinc-500 max-w-[140px] bp48:max-w-none","aria-live":"polite",children:h.client.documents.autosave.SAVING}),a.jsxs("div",{className:"flex h-full items-center",children:[uve,a.jsx("button",{type:"button",className:"group flex h-full shrink-0 cursor-pointer items-center justify-center px-1 disabled:pointer-events-none disabled:opacity-50",onClick:u,disabled:b||g,children:a.jsx("span",{className:"flex size-8 items-center justify-center rounded-full bg-zinc-100 text-zinc-600 group-hover:bg-zinc-200 group-hover:text-zinc-950",children:a.jsx($I,{className:"size-5"})})}),a.jsx("button",{type:"button",className:"group flex h-full shrink-0 cursor-pointer items-center pl-1 disabled:pointer-events-none disabled:opacity-50",onClick:c,disabled:b,children:a.jsx("span",{className:"roboto-flex-25-700-1 flex h-8 items-center justify-center whitespace-nowrap rounded-full bg-zinc-900 px-3 py-2 text-[14px] leading-[16px] uppercase text-zinc-100 group-hover:bg-zinc-950 group-hover:text-white",children:h.client.documents.documentMenu.DOWNLOAD})})]})]})},fve=({documentTitle:e,assignPrint:t})=>{const[n]=rn();return l.useEffect(()=>(t(()=>Tme(n,e)),()=>{t(null)}),[t,e,n]),null},JS="document-hydrate",pve=({documentId:e,lexicalJson:t,serverContentEpoch:n})=>{const[s]=rn(),r=l.useRef(t);return r.current=t,l.useLayoutEffect(()=>{const i=Yc(r.current),o=Yc(s.getEditorState().toJSON());i!==o&&s.setEditorState(s.parseEditorState(i),{tag:JS})},[e,s,n]),null},hve=1,mve=({documentVersion:e})=>{const[t]=rn();return l.useEffect(()=>{e===hve&&t.update(()=>{VM()||GM({isWithDateCaret:!1})},{tag:"history-merge"})},[t,e]),null},gve=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?l.useLayoutEffect:l.useEffect;function Ave({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[s]=rn();return gve(()=>{if(n)return s.registerUpdateListener(({editorState:r,dirtyElements:i,dirtyLeaves:o,prevEditorState:c,tags:u})=>{t&&i.size===0&&o.size===0||e&&u.has(iu)||c.isEmpty()||n(r,s,u)})},[s,e,t,n]),null}const Eve=1e3,Vb=450,j9=3e3,xve=({clientId:e,documentId:t,documentVersion:n,lexicalJsonFromServer:s,onAutosaveStatusChange:r,onServerDocumentContentReplaced:i})=>{const[o]=rn(),c=bt(),u=Hi(P=>P.enqueueDocumentContent),d=Hi(P=>P.seedDocumentVersion),p=Hi(P=>P.registerDocumentWriteHandlers),g=Hi(P=>P.releaseDocumentWriteQueue),A=w2({clientId:e,documentId:t}),E=Hi(P=>P.statusByKey[A]),x=l.useRef(Yc(s)),y=l.useRef(""),I=l.useRef(null),v=l.useRef(0),S=l.useRef(()=>{}),b=l.useRef(n);b.current=n;const w=l.useCallback(()=>{I.current&&(clearTimeout(I.current),I.current=null)},[]),_=l.useCallback(()=>{const P=Yc(o.getEditorState().toJSON());return y.current=P,{editorState:JSON.parse(P)}},[o]),N=l.useCallback(async()=>{const P=await c.fetchQuery({queryKey:["clientDocument",e,t],queryFn:({signal:B})=>Bm({clientId:e,documentId:t,signal:B})});return v.current=Date.now()+Vb,i(),ve({type:"failed",message:h.client.documents.autosave.VERSION_CONFLICT,key:"DOCUMENT_VERSION_CONFLICT",duration:j9}),P},[e,t,c,i]),R=l.useCallback(({document:P,sentContent:B})=>{B&&(x.current=y.current);const F=z=>{const Q={...z,version:P.version,name:P.name,updatedAt:P.updatedAt};return P.documentType!==void 0&&(Q.documentType=P.documentType),B&&(Q.lexicalJson={editorState:JSON.parse(y.current)}),Q};c.setQueryData(["clientDocument",e,t],z=>!z||z.id!==P.id?z:F(z)),c.setQueryData(["clientDocuments",e],z=>z&&z.map(Q=>Q.id!==P.id?Q:F(Q)))},[e,t,c]),D=l.useCallback(()=>
966{if(Date.now()<v.current){S.current();return}Yc(o.getEditorState().toJSON())!==x.current&&u({clientId:e,documentId:t,baseVersion:b.current})},[o,e,t,u]),k=l.useCallback(()=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{I.current=null,D()},Eve)},[D]),L=l.useCallback((P,B,F)=>{F.has(JS)||k()},[k]),O=l.useCallback(()=>{w(),D()},[w,D]);return l.useEffect(()=>{S.current=k},[k]),l.useEffect(()=>{d({clientId:e,documentId:t,version:n})},[e,t,n,d]),l.useEffect(()=>{p({clientId:e,documentId:t,handlers:{resolveLexicalJson:_,onContentConflict:N,onVersionSettled:R,flushPendingContent:O}})},[e,t,p,_,N,R,O]),l.useEffect(()=>{if(E==="saving"){r("saving");return}r("idle")},[E,r]),l.useEffect(()=>{E==="error"&&ve({type:"failed",message:h.client.documents.autosave.ERROR,key:"DOCUMENT_AUTOSAVE_ERROR",duration:j9})},[E]),l.useEffect(()=>{w(),v.current=Date.now()+Vb},[t,w]),l.useLayoutEffect(()=>o.registerUpdateListener(({tags:P})=>{P.has(JS)&&Promise.resolve().then(()=>{x.current=Yc(o.getEditorState().toJSON()),w(),v.current=Date.now()+Vb})}),[o,w]),l.useEffect(()=>()=>{(()=>{const B=I.current!==null;w(),!(!B||Yc(o.getEditorState().toJSON())===x.current)&&u({clientId:e,documentId:t,baseVersion:b.current})})(),g({clientId:e,documentId:t})},[w,o,e,t,u,g]),l.useEffect(()=>{const P=()=>{I.current!==null&&(w(),D())},B=()=>{document.visibilityState==="hidden"&&P()};return window.addEventListener("pagehide",P),document.addEventListener("visibilitychange",B),()=>{window.removeEventListener("pagehide",P),document.removeEventListener("visibilitychange",B)}},[w,D]),a.jsx(Ave,{ignoreHistoryMergeTagChange:!1,onChange:L})},fF=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cve=fF?l.useLayoutEffect:l.useEffect,X0={tag:iu};function yve({initialConfig:e,children:t}){const n=l.useMemo(()=>{const{theme:s,namespace:r,nodes:i,onError:o,editorState:c,html:u}=e,d=ame(null,s),p=U2({editable:e.editable,html:u,namespace:r,nodes:i,onError:g=>o(g,p),theme:s});return(function(g,A){if(A!==null){if(A===void 0)g.update(()=>{const E=St();if(E.isEmpty()){const x=hn();E.append(x);const y=fF?document.activeElement:null;(We()!==null||y!==null&&y===g.getRootElement())&&x.select()}},X0);else if(A!==null)switch(typeof A){case"string":{const E=g.parseEditorState(A);g.setEditorState(E,X0);break}case"object":g.setEditorState(A,X0);break;case"function":g.update(()=>{St().isEmpty()&&A(g)},X0)}}})(p,c),[p,d]},[]);return Cve(()=>{const s=e.editable,[r]=n;r.setEditable(s===void 0||s)},[]),a.jsx(zM.Provider,{value:n,children:t})}const bve=(e,t)=>Vt({queryKey:["clientDocument",e,t],queryFn:({signal:n})=>{if(!e||!t)throw new Error("Missing client or document id");return Bm({clientId:e,documentId:t,signal:n})},enabled:!!e&&!!t}),Ive=()=>{const{id:e,documentId:t}=st(),{data:n,isPending:s,isError:r}=bve(e,t),{handleExportDocumentClick:i,isExportDocumentPending:o}=FP({clientId:e,documentId:t}),c=l.useRef(null),[u,d]=l.useState(!1),{handleLexicalPrintClick:p,isLexicalPrintPending:g}=JM({clientId:e,documentId:t,getEditorPrint:c}),[A,E]=l.useState(""),[x,y]=l.useState(0),[I,v]=l.useState("idle"),[S,b]=l.useState(0),w=l.useRef(""),_=It(F=>F.copilotDocumentNameSuggestion),N=It(F=>F.clearCopilotDocumentNameSuggestion),R=l.useCallback(F=>{v(F)},[]),D=l.useCallback(()=>{b(F=>F+1)},[]);l.useLayoutEffect(()=>{b(0)},[n?.id]),l.useLayoutEffect(()=>{if(!n||w.current===n.id)return;w.current=n.id;const F=n.name??"";if(F.trim()===h.client.documents.NEW_DOCUMENT){E(""),y(Q=>Q+1);return}E(F)},[n]),l.useLayoutEffect(()=>{const F=_;if(!F||(N(),F.documentId!==t))return;const z=A.trim();z!==""&&z!==h.client.documents.NEW_DOCUMENT||E(F.name)},[_,t,A,N]);const k=l.useMemo(()=>lve(),[]),L=l.useCallback(F=>{c.current=F,d(!!F)},[]),O=l.useCallback(F=>{E(F)},[]),P=l.useCallback(()=>{i()},[i]),B=l.useCallback(()=>{p()},[p]);return!e||!t?null:r&&!n?a.jsx(ia,{type:Gr.DOCUMENT_NOT_FOUND,backTo:`/clients/${e}/documents`}):s||!n?a.jsx("div",{className:"flex min-h-screen w-full items-center justify-center px-4",children:a.jsx(ct,{delay:0})}):a.jsxs("div",{className:"flex min-h-screen w-full flex-col px-4",children:[a.jsx(Bbe,{clientId:e,documentId:n.id}),a.jsx("div",{className:"flex w-full flex-1 flex-col",children:a.jsxs(yve,{initialConfig:k,children:[a.jsx(xve,{clientId:e,documentId:n.id,documentVersion:n.version,lexicalJsonFromServer:n.lexicalJson,onAutosaveStatusChange:R,onServerDocumentContentReplaced:D}),a.jsx(pve,{documentId:n.id,lexicalJson:n.lexicalJson,serverContentEpoch:S}),a.jsx(mve,{documentVersion:n.version}),a.jsx(fve,{documentTitle:A,assignPrint:L}),a.jsxs("div",{className:"flex w-full flex-1 flex-col",children:[a.jsx("div",{className:"sticky top-0 z-20 w-full shrink-0 bg-zinc-50",children:a.jsx(dve,{clientId:e,documentId:t,documentVersion:n.version,serverDocumentName:n.name??"",documentName:A,documentTitleFocusRequestCount:x,handleDocumentNameChange:O,backLinkPath:`/clients/${e}/documents`,handleDownloadClick:P,handlePrintClick:B,isDownloadPending:o,isPrintPending:g,isPrintDisabled:!u,autosaveStatus:I})}),a.jsxs("div",{className:Y("flex w-full min-w-0 flex-1 flex-col gap-4","bp72:flex-row bp72:items-stretch bp72:gap-4"),children:[a.jsx("div",{className:"flex min-w-0 flex-1 flex-col rounded-t-lg bg-white shadow-[0px_2px_5px_0px_rgba(0,0,0,0.04),0px_10px_10px_0px_rgba(0,0,0,0.03),0px_22px_13px_0px_rgba(0,0,0,0.02),0px_39px_16px_0px_rgba(0,0,0,0.01),0px_61px_17px_0px_rgba(0,0,0,0)]",children:a.jsx(ave,{})}),a.jsx("div",{className:Y("hidden sticky top-14 h-[calc(100vh-3.5rem)] w-[408px] shrink-0 will-change-transform bp72:block"),children:a.jsx(Obe,{clientId:e,documentId:n.id})})]})]})]},n.id)})]})};function Sve({data:e}){if(!pt(e))return null;const t=e.sessionId,n=e.lastEventNumber;return typeof t!="string"||t.length===0||typeof n!="number"||!Number.isInteger(n)||n<0?null:{sessionId:t,lastEventNumber:n}}const pF=rt(async function({clientId:t,documentId:n,signal:s}){const r=pa(),i=Ke(`${fc({clientId:t})}/documents/${n}/session/`),o=await qe(i,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${r}`},signal:s});if(He(o))throw{httpCode:503,errorData:o.error};const c=await Ye(o);if(He(c))throw{httpCode:503,errorData:c.error};if(c.status==="error")throw{httpCode:o.status,errorData:c.error};const u=Sve({data:c.data});if(u!==null)return u;throw{httpCode:500,errorData:{code:"BAD_DOCUMENT_SESSION_RESPONSE",message:"Unexpected document session response shape"}}});async function vve({clientId:e,sessionId:t,lastAppliedEventNumber:n,signal:s}){const r=Ke(`${fc({clientId:e})}/sessions/${t}/stream/`);return Xk({url:r,method:"GET",getAccessToken:pa,signal:s,extraHeaders:{"Last-Event-ID":String(n)}})}const B9=1,VE=["bold","italic","underline","highlight"],W_=["left","center","right","justify"],_ve=["bullet","ordered"],Bh=[1,2,3,4,5],Tve=["judicial_act","reversal_grounds","position","circumstances","requalification","unfinished_crime","mitigation","text"],Yl=["letterhead","address","title","subtitle","body","pleas","signatures"],Nve=["half","third"],GE=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,K_=/[\n\r\u2028\u2029]/,wve=["paragraph","heading","listItem"],Rve=["paragraph","listItem"],Dve=["schemaVersion","zones"],kve=["kind","imageId","width","height"],Ove=["kind","isEnabled","width","blocks"],Pve=["kind","blocks"],Lve=["kind","blocks"],Mve=["kind","items"],jve=["kind","blocks"],Bve=["kind","dateRuns","rows"],Fve=["id","roleRuns","fullNameRuns"],Uve=["id","sectionKind","name","children"],$_=["id","type","align","indent","runs"],zve=[...$_,"level"],Qve=[...$_,"listKind","startNumber"],hF=["id","type","runs"],Hve=[...hF,"listKind","startNumber"],Vve=["text","formats","fontId","commentIds","placeholder"],Gve=["id","label"];function nl(e,t){for(const n of e)if(n===t)return!0;return!1}function Ki({value:e}){if(e===void 0)return"undefined";const t=JSON.stringify(e);return t===void 0?"unsupported value":t}function Jr({value:e,path:t,knownKeys:n}){for(const s of Object.keys(e))if(!n.includes(s))return`${t}.${s}: unknown field`}
966function qE({value:e,path:t,seenIds:n}){if(typeof e!="string")return`${t}: id must be a string`;if(!GE.test(e))return`${t}: id must be a bare uuid v4, got ${Ki({value:e})}`;if(n.has(e))return`${t}: duplicate id "${e}"`;n.add(e)}function qve({value:e,path:t}){if(!pt(e))return`${t}: run must be an object`;const n=Jr({value:e,path:t,knownKeys:Vve});if(n!==void 0)return n;if(typeof e.text!="string")return`${t}.text: must be a string`;if(K_.test(e.text))return`${t}.text: line break characters are not allowed`;if(e.formats!==void 0){if(!Array.isArray(e.formats))return`${t}.formats: must be an array`;const s=new Set;for(const[r,i]of e.formats.entries()){if(!nl(VE,i))return`${t}.formats.${r}: unknown format ${Ki({value:i})}`;if(s.has(i))return`${t}.formats.${r}: duplicate format "${i}"`;s.add(i)}}if(e.fontId!==void 0&&typeof e.fontId!="string")return`${t}.fontId: must be a string`;if(e.commentIds!==void 0){if(!Array.isArray(e.commentIds))return`${t}.commentIds: must be an array`;for(const[s,r]of e.commentIds.entries()){if(typeof r!="string")return`${t}.commentIds.${s}: must be a string`;if(!GE.test(r))return`${t}.commentIds.${s}: must be a bare uuid v4`}}if(e.placeholder!==void 0){const s=Wve({value:e.placeholder,path:`${t}.placeholder`});if(s!==void 0)return s}if(e.text===""&&e.placeholder===void 0)return`${t}.text: empty text is allowed only inside an empty placeholder field`}function Wve({value:e,path:t}){if(!pt(e))return`${t}: must be an object`;const n=Jr({value:e,path:t,knownKeys:Gve});if(n!==void 0)return n;if(typeof e.id!="string")return`${t}.id: must be a string`;if(!GE.test(e.id))return`${t}.id: must be a bare uuid v4`;if(typeof e.label!="string")return`${t}.label: must be a string`;if(e.label.length===0)return`${t}.label: must not be empty`;if(K_.test(e.label))return`${t}.label: line break characters are not allowed`}function Kve({runs:e,path:t,seenIds:n}){const s={chain:null},r=()=>{const o=s.chain;if(s.chain=null,o!==null){if(n.has(o.id))return`${t}: placeholder id ${o.id} is used by more than one chain`;if(n.add(o.id),o.hasEmptyText&&o.runCount>1)return`${t}: empty run text inside a multi-run placeholder field`}};for(const[o,c]of e.entries()){if(!pt(c))continue;const u=c.placeholder;if(!pt(u)){const A=r();if(A!==void 0)return A;continue}const d=u.id,p=u.label;if(typeof d!="string"||typeof p!="string")continue;if(s.chain!==null&&s.chain.id===d){if(s.chain.label!==p)return`${t}.${o}.placeholder.label: differs from the chain label`;s.chain.runCount+=1,c.text===""&&(s.chain.hasEmptyText=!0);continue}const g=r();if(g!==void 0)return g;s.chain={id:d,label:p,runCount:1,hasEmptyText:c.text===""}}const i=r();if(i!==void 0)return i}function pm({value:e,path:t,seenIds:n}){if(!Array.isArray(e))return`${t}: must be an array`;for(const[s,r]of e.entries()){const i=qve({value:r,path:`${t}.${s}`});if(i!==void 0)return i}return Kve({runs:e,path:t,seenIds:n})}function mF({value:e,path:t}){if(!nl(_ve,e.listKind))return`${t}.listKind: unknown list kind ${Ki({value:e.listKind})}`;if(e.startNumber!==void 0){if(typeof e.startNumber!="number")return`${t}.startNumber: must be an integer`;if(!Number.isInteger(e.startNumber))return`${t}.startNumber: must be an integer`;if(e.startNumber<1)return`${t}.startNumber: must be >= 1`;if(e.listKind!=="ordered")return`${t}.startNumber: allowed only for ordered lists`}}function $ve({type:e}){return e==="heading"?zve:e==="listItem"?Qve:$_}function WE({value:e,path:t,seenIds:n}){if(!pt(e))return`${t}: block must be an object`;if(!nl(wve,e.type))return`${t}.type: unknown block type ${Ki({value:e.type})}`;const s=Jr({value:e,path:t,knownKeys:$ve({type:e.type})});if(s!==void 0)return s;const r=qE({value:e.id,path:`${t}.id`,seenIds:n});if(r!==void 0)return r;if(e.align!==void 0&&!nl(W_,e.align))return`${t}.align: unknown align ${Ki({value:e.align})}`;if(e.indent!==void 0){if(typeof e.indent!="number")return`${t}.indent: must be an integer`;if(!Number.isInteger(e.indent))return`${t}.indent: must be an integer`;if(e.indent<0)return`${t}.indent: must be >= 0`}if(e.type==="heading"&&!nl(Bh,e.level))return`${t}.level: must be an integer 1-5, got ${Ki({value:e.level})}`;if(e.type==="listItem"){const i=mF({value:e,path:t});if(i!==void 0)return i}return pm({value:e.runs,path:`${t}.runs`,seenIds:n})}
966function gF({value:e,path:t,seenIds:n}){if(!pt(e))return`${t}: section must be an object`;const s=Jr({value:e,path:t,knownKeys:Uve});if(s!==void 0)return s;const r=qE({value:e.id,path:`${t}.id`,seenIds:n});if(r!==void 0)return r;if(!nl(Tve,e.sectionKind))return`${t}.sectionKind: unknown section kind ${Ki({value:e.sectionKind})}`;if(e.name!==void 0){if(typeof e.name!="string")return`${t}.name: must be a string`;if(e.name==="")return`${t}.name: must not be empty`;if(K_.test(e.name))return`${t}.name: line break characters are not allowed`;if(e.sectionKind!=="text")return`${t}.name: allowed only for "text" sections`}if(!Array.isArray(e.children))return`${t}.children: must be an array`;for(const[i,o]of e.children.entries()){const c=WE({value:o,path:`${t}.children.${i}`,seenIds:n});if(c!==void 0)return c}}function Yve({type:e}){return e==="listItem"?Hve:hF}function Xve({value:e,path:t,seenIds:n}){if(!pt(e))return`${t}: block must be an object`;if(e.type==="heading")return`${t}.type: headings are not allowed in the address zone`;if(!nl(Rve,e.type))return`${t}.type: unknown block type ${Ki({value:e.type})}`;const s=Jr({value:e,path:t,knownKeys:Yve({type:e.type})});if(s!==void 0)return s;const r=qE({value:e.id,path:`${t}.id`,seenIds:n});if(r!==void 0)return r;if(e.type==="listItem"){const i=mF({value:e,path:t});if(i!==void 0)return i}return pm({value:e.runs,path:`${t}.runs`,seenIds:n})}function Jve({value:e,path:t}){const n=Jr({value:e,path:t,knownKeys:kve});if(n!==void 0)return n;if(!("imageId"in e))return`${t}.imageId: required (null means an empty upload slot)`;
966if(e.imageId!==null&&typeof e.imageId!="string")return`${t}.imageId: must be a string or null`;for(const s of["width","height"]){const r=e[s];if(r!==void 0){if(typeof r!="number")return`${t}.${s}: must be an integer`;if(!Number.isInteger(r))return`${t}.${s}: must be an integer`;if(r<=0)return`${t}.${s}: must be > 0`}}}function Zve({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:Ove});if(s!==void 0)return s;if(typeof e.isEnabled!="boolean")return`${t}.isEnabled: must be a boolean`;if(!nl(Nve,e.width))return`${t}.width: unknown width ${Ki({value:e.width})}`;if(!Array.isArray(e.blocks))return`${t}.blocks: must be an array`;for(const[r,i]of e.blocks.entries()){const o=Xve({value:i,path:`${t}.blocks.${r}`,seenIds:n});if(o!==void 0)return o}}function e2e({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:Pve});return s!==void 0?s:Y_({value:e,path:t,seenIds:n})}function t2e({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:Lve});return s!==void 0?s:Y_({value:e,path:t,seenIds:n})}function Y_({value:e,path:t,seenIds:n}){if(!Array.isArray(e.blocks))return`${t}.blocks: must be an array`;for(const[s,r]of e.blocks.entries()){const i=WE({value:r,path:`${t}.blocks.${s}`,seenIds:n});if(i!==void 0)return i}}function n2e({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:Mve});if(s!==void 0)return s;if(!Array.isArray(e.items))return`${t}.items: must be an array`;for(const[r,i]of e.items.entries()){const o=gF({value:i,path:`${t}.items.${r}`,seenIds:n});if(o!==void 0)return o}}function s2e({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:jve});return s!==void 0?s:Y_({value:e,path:t,seenIds:n})}function r2e({value:e,path:t,seenIds:n}){if(!pt(e))return`${t}: signatory row must be an object`;const s=Jr({value:e,path:t,knownKeys:Fve});if(s!==void 0)return s;const r=qE({value:e.id,path:`${t}.id`,seenIds:n});if(r!==void 0)return r;const i=pm({value:e.roleRuns,path:`${t}.roleRuns`,seenIds:n});return i!==void 0?i:pm({value:e.fullNameRuns,path:`${t}.fullNameRuns`,seenIds:n})}function i2e({value:e,path:t,seenIds:n}){const s=Jr({value:e,path:t,knownKeys:Bve});if(s!==void 0)return s;const r=pm({value:e.dateRuns,path:`${t}.dateRuns`,seenIds:n});if(r!==void 0)return r;if(!Array.isArray(e.rows))return`${t}.rows: must be an array`;for(const[i,o]of e.rows.entries()){const c=r2e({value:o,path:`${t}.rows.${i}`,seenIds:n});if(c!==void 0)return c}}function X_({value:e,path:t,seenIds:n}){return e.kind==="letterhead"?Jve({value:e,path:t}):e.kind==="address"?Zve({value:e,path:t,seenIds:n}):e.kind==="title"?e2e({value:e,path:t,seenIds:n}):e.kind==="subtitle"?t2e({value:e,path:t,seenIds:n}):e.kind==="body"?n2e({value:e,path:t,seenIds:n}):e.kind==="pleas"?s2e({value:e,path:t,seenIds:n}):e.kind==="signatures"?i2e({value:e,path:t,seenIds:n}):`${t}.kind: unknown zone kind ${Ki({value:e.kind})}`}function AF({value:e,path:t}){const n=[];for(const[r,i]of e.entries()){if(!pt(i))return`${t}.${r}: zone must be an object`;if(!nl(Yl,i.kind))return`${t}.${r}.kind: unknown zone kind ${Ki({value:i.kind})}`;n.push(i.kind)}const s=new Set;for(const[r,i]of n.entries()){if(s.has(i))return`${t}.${r}.kind: zone "${i}" occurs more than once`;s.add(i)}if(!s.has("body"))return`${t}: "body" zone is required`;for(const[r,i]of n.entries()){const o=n[r-1];if(o!==void 0&&Yl.indexOf(i)<Yl.indexOf(o))return`${t}: zones out of canonical order (${Yl.join(" -> ")})`}}function EF({value:e}){if(!pt(e))return"content: must be an object";const t=Jr({value:e,path:"content",knownKeys:Dve});if(t!==void 0)return t;if(e.schemaVersion!==B9)return`content.schemaVersion: expected ${B9}, got ${Ki({value:e.schemaVersion})}`;if(!Array.isArray(e.zones))return"content.zones: must be an array";const n=AF({value:e.zones,path:"content.zones"});if(n!==void 0)return n;const s=new Set;for(const[r,i]of e.zones.entries()){if(!pt(i))return`content.zones.${r}: zone must be an object`;const o=X_({value:i,path:`content.zones.${r}`,seenIds:s});if(o!==void 0)return o}}function o2e(e){return EF({value:e})===void 0}
966function a2e(e){return gF({value:e,path:"section",seenIds:new Set})===void 0}function xF(e){return WE({value:e,path:"block",seenIds:new Set})===void 0}function J_(e){return typeof e!="string"?!1:!!GE.test(e)}function CF(e){return pt(e)?X_({value:e,path:"zone",seenIds:new Set})===void 0:!1}function l2e({value:e,path:t}){if(!Array.isArray(e))return`${t}: must be an array`;const n=AF({value:e,path:t});if(n!==void 0)return n;const s=new Set;for(const[r,i]of e.entries()){if(!pt(i))return`${t}.${r}: zone must be an object`;const o=X_({value:i,path:`${t}.${r}`,seenIds:s});if(o!==void 0)return o}}function c2e({value:e,path:t}){if(!Array.isArray(e))return`${t}: must be an array`;const n=new Set;for(const[s,r]of e.entries()){const i=WE({value:r,path:`${t}.${s}`,seenIds:n});if(i!==void 0)return i}}function u2e({value:e}){const t=EF({value:e});return t!==void 0?{issue:t}:o2e(e)?{content:e}:{issue:"content: failed to parse"}}function v1({a:e,b:t}){return!(e.blockId!==t.blockId||e.offset!==t.offset)}function Xd({range:e}){return!!v1({a:e.start,b:e.end})}function Er({runs:e}){return e.reduce((n,s)=>n+s.text.length,0)}function uc({runs:e,offset:t}){return!(!Number.isInteger(t)||t<0||t>Er({runs:e}))}function d2e({zone:e,zoneIndex:t,blockId:n}){const s=e.blocks.findIndex(r=>
966r.id===n);return s===-1?null:{container:{containerKind:"textZone",zoneIndex:t,zoneKind:e.kind},containerZoneKind:e.kind,siblings:e.blocks,blockIndex:s,block:e.blocks[s]}}function xn({content:e,blockId:t}){for(const[n,s]of e.zones.entries()){if(s.kind==="letterhead"||s.kind==="signatures")continue;if(s.kind==="body"){for(const[i,o]of s.items.entries()){const c=o.children.findIndex(u=>u.id===t);if(c!==-1)return{container:{containerKind:"section",zoneIndex:n,sectionIndex:i,sectionId:o.id},containerZoneKind:"body",siblings:o.children,blockIndex:c,block:o.children[c]}}continue}if(s.kind==="address"){const i=s.blocks.findIndex(o=>o.id===t);if(i===-1)continue;return{container:{containerKind:"address",zoneIndex:n},containerZoneKind:"address",siblings:s.blocks,blockIndex:i,block:s.blocks[i]}}const r=d2e({zone:s,zoneIndex:n,blockId:t});if(r!==null)return r}return null}function da({content:e,container:t,startIndex:n,deleteCount:s,buildSectionBlocks:r,buildAddressBlocks:i}){const o=e.zones.map((c,u)=>{if(u!==t.zoneIndex)return c;if(t.containerKind==="section"){if(c.kind!=="body")return c;const d=c.items.map((p,g)=>{if(g!==t.sectionIndex)return p;const A=p.children.slice(n,n+s),E=[...p.children.slice(0,n),...r({removed:A}),...p.children.slice(n+s)];return{...p,children:E}});return{...c,items:d}}if(t.containerKind==="address"){if(c.kind!=="address")return c;const d=c.blocks.slice(n,n+s),p=[...c.blocks.slice(0,n),...i({removed:d}),...c.blocks.slice(n+s)];return{...c,blocks:p}}return c.kind==="title"?{...c,blocks:Gb({blocks:c.blocks,startIndex:n,deleteCount:s,buildSectionBlocks:r})}:c.kind==="subtitle"?{...c,blocks:Gb({blocks:c.blocks,startIndex:n,deleteCount:s,buildSectionBlocks:r})}:c.kind==="pleas"?{...c,blocks:Gb({blocks:c.blocks,startIndex:n,deleteCount:s,buildSectionBlocks:r})}:c});return{...e,zones:o}}function Gb({blocks:e,startIndex:t,deleteCount:n,buildSectionBlocks:s}){const r=e.slice(t,t+n);return[...e.slice(0,t),...s({removed:r}),...e.slice(t+n)]}function KE({blockId:e}){return{changedNodeIds:[e],changedZoneKinds:[]}}function Z_({found:e,nodeIds:t}){return e.container.containerKind==="section"?{changedNodeIds:[...t,e.container.sectionId],changedZoneKinds:[]}:{changedNodeIds:[...t],changedZoneKinds:[e.containerZoneKind]}}const f2e=`
967\r\u2028\u2029`,yF=new RegExp(`[${f2e}]`),bF="\0";function J0({values:e}){return e===void 0?"":[...e].sort().join(bF)}function F9({run:e}){return e.fontId===void 0?"":e.fontId}function U9({run:e}){return e.placeholder===void 0?"":e.placeholder.id+bF+e.placeholder.label}function p2e({a:e,b:t}){return!(U9({run:e})!==U9({run:t})||F9({run:e})!==F9({run:t})||J0({values:e.formats})!==J0({values:t.formats})||J0({values:e.commentIds})!==J0({values:t.commentIds}))}function np({runs:e}){const t=[],n={offset:0};return e.forEach((s,r)=>{const i=n.offset;n.offset+=s.text.length;const o=s.placeholder;if(o===void 0)return;const c=t.at(-1);if(c!==void 0&&c.placeholder.id===o.id&&c.lastRunIndex===r-1){c.lastRunIndex=r,c.endOffset=n.offset;return}t.push({placeholder:o,firstRunIndex:r,lastRunIndex:r,startOffset:i,endOffset:n.offset})}),t}function Cc({runs:e,placeholderId:t}){for(const n of np({runs:e}))if(n.placeholder.id===t)return n;return null}function eT({runs:e,offset:t}){for(const n of np({runs:e}))if(n.startOffset<t&&t<n.endOffset)return!0;return!1}function h2e({chains:e}){const t=new Map;return e.forEach(n=>{const s=n.lastRunIndex-n.firstRunIndex+1;for(const r of Array(s).keys())t.set(n.firstRunIndex+r,n)}),t}function Gs({runs:e}){const t=new Set;np({runs:e}).forEach(s=>{s.startOffset===s.endOffset&&t.add(s.firstRunIndex)});const n=[];return e.forEach((s,r)=>{if(s.text.length===0){if(!t.has(r))return;n.push(s);return}const i=n.at(-1);if(i===void 0){n.push(s);return}if(!p2e({a:i,b:s})){n.push(s);return}n[n.length-1]={...i,text:i.text+s.text}}),n}function m2e({runs:e,offset:t}){const n={total:0},s=e.findIndex(r=>t<=n.total+r.text.length?!0:(n.total+=r.text.length,!1));return s===-1?null:{runIndex:s,localOffset:t-n.total}}function hm({run:e}){const{placeholder:t,...n}=e;return n}function g2e({runs:e}){return Gs({runs:e.map(t=>t.placeholder===void 0||t.text.length===0?t:hm({run:t}))})}function A2e({runs:e}){return Gs({runs:e.map(t=>{const n=t.placeholder;return n===void 0?t:{...hm({run:t}),text:n.label}})})}function Fh({runs:e,runIndex:t,localOffset:n,text:s}){const r=e[t],i={...r,text:r.text.slice(0,n)+s+r.text.slice(n)};return Gs({runs:[...e.slice(0,t),i,...e.slice(t+1)]})}function ZS({runs:e,index:t,run:n}){return Gs({runs:[...e.slice(0,t),n,...e.slice(t)]})}function E2e({runs:e,offset:t,text:n,placeholderId:s}){const r=Cc({runs:e,placeholderId:s});if(r===null||t<r.startOffset||t>r.endOffset)return null;if(r.startOffset===r.endOffset){const o={...e[r.firstRunIndex],text:n};return Gs({runs:[...e.slice(0,r.firstRunIndex),o,...e.slice(r.lastRunIndex+1)]})}if(t===r.startOffset)return Fh({runs:e,runIndex:r.firstRunIndex,localOffset:0,text:n});if(t===r.endOffset){const i=e[r.lastRunIndex];return Fh({runs:e,runIndex:r.lastRunIndex,localOffset:i.text.length,text:n})}return null}function x2e({runs:e,offset:t,text:n,placeholderId:s}){const r=Cc({runs:e,placeholderId:s});if(r===null||t!==r.endOffset)return null;const i=e[r.lastRunIndex],o={...hm({run:i}),text:n};return ZS({runs:e,index:r.lastRunIndex+1,run:o})}function C2e({runs:e,offset:t,text:n,placeholderId:s,afterPlaceholderId:r}){if(n.length===0)return e;if(yF.test(n))return null;if(s!==void 0){const d=E2e({runs:e,offset:t,text:n,placeholderId:s});if(d!==null)return d}if(r!==void 0){const d=x2e({runs:e,offset:t,text:n,placeholderId:r});if(d!==null)return d}if(e.length===0)return t!==0?null:[{text:n}];const i=m2e({runs:e,offset:t});if(i===null)return null;const o=e[i.runIndex];if(o.placeholder===void 0)return Fh({runs:e,runIndex:i.runIndex,localOffset:i.localOffset,text:n});if(i.localOffset===0){const d={...hm({run:o}),text:n};return ZS({runs:e,index:i.runIndex,run:d})}if(i.localOffset<o.text.length)return Fh({runs:e,runIndex:i.runIndex,localOffset:i.localOffset,text:n});const c=e[i.runIndex+1];if(c!==void 0&&c.placeholder!==void 0&&c.placeholder.id===o.placeholder.id)return Fh({runs:e,runIndex:i.runIndex,localOffset:i.localOffset,text:n});const u={...hm({run:o}),text:n};return ZS({runs:e,index:i.runIndex+1,run:u})}function z9({result:e,run:t,runStart:n,start:s,end:r}){const i=t.text.slice(0,Math.max(s-n,0)),o=t.text.slice(Math.min(Math.max(r-n,0),t.text.length));i.length>0&&e.push({...t,text:i}),o.length>0&&e.push({...t,text:o})}function mm({runs:e,start:t,end:n,preserveFieldContainers:s}){if(n<=t)return e;const r=np({runs:e}),i=new Map;r.forEach(p=>{i.set(p.firstRunIndex,p)});const o=[],c={offset:0};e.forEach(p=>{o.push(c.offset),c.offset+=p.text.length});const u=[],d={index:0};for(;d.index<e.length;){const p=i.get(d.index);if(p===void 0){z9({result:u,run:e[d.index],runStart:o[d.index],start:t,end:n}),d.index+=1;continue}
967if(d.index=p.lastRunIndex+1,p.startOffset===p.endOffset){if(s!==!0&&t<p.startOffset&&n>p.endOffset)continue;u.push(e[p.firstRunIndex]);continue}const g=t<=p.startOffset&&n>=p.endOffset,A=t===p.startOffset&&n===p.endOffset;if(g&&!A&&s!==!0)continue;const E=[];if(e.slice(p.firstRunIndex,p.lastRunIndex+1).forEach((x,y)=>{z9({result:E,run:x,runStart:o[p.firstRunIndex+y],start:t,end:n})}),E.length===0){u.push({...e[p.firstRunIndex],text:""});continue}u.push(...E)}return Gs({runs:u})}function y2e({runs:e,start:t,end:n,mapRun:s}){if(n<=t)return e;const r=[],i={offset:0};return e.forEach(o=>{const c=i.offset,u=c+o.text.length;if(i.offset=u,u<=t){r.push(o);return}if(c>=n){r.push(o);return}if(o.text.length===0){r.push(s(o));return}const d=Math.max(t-c,0),p=Math.min(Math.max(n-c,0),o.text.length),g=o.text.slice(0,d),A=o.text.slice(d,p),E=o.text.slice(p);g.length>0&&r.push({...o,text:g}),A.length>0&&r.push(s({...o,text:A})),E.length>0&&r.push({...o,text:E})}),Gs({runs:r})}function tT({runs:e,offset:t,headPlaceholderId:n}){const s=h2e({chains:np({runs:e})}),r=[],i=[],o={offset:0};return e.forEach((c,u)=>{const d=o.offset,p=d+c.text.length;o.offset=p;const g=s.get(u);if(g!==void 0){if(g.endOffset<=t&&g.startOffset<t){r.push(c);return}if(g.startOffset===g.endOffset&&g.startOffset===t&&g.placeholder.id===n){r.push(c);return}i.push(c);return}if(p<=t){r.push(c);return}if(d>=t){i.push(c);return}const A=c.text.slice(0,t-d),E=c.text.slice(t-d);A.length>0&&r.push({...c,text:A}),E.length>0&&i.push({...c,text:E})}),{before:Gs({runs:r}),after:Gs({runs:i})}}function b2e({run:e}){return e.formats===void 0?[]:e.formats}function I2e({target:e}){return e.startOffset<=e.endOffset?{start:e.startOffset,end:e.endOffset}:{start:e.endOffset,end:e.startOffset}}function IF({content:e,targets:t,mapRun:n}){if(t.length===0)return null;const s={content:e};for(const i of t){const o=xn({content:s.content,blockId:i.blockId});if(o===null)return null;const{start:c,end:u}=I2e({target:i});if(c===u)continue;if(!uc({runs:o.block.runs,offset:c})||!uc({runs:o.block.runs,offset:u}))return null;const d=y2e({runs:o.block.runs,start:c,end:u,mapRun:n});s.content=da({content:s.content,container:o.container,startIndex:o.blockIndex,deleteCount:1,buildSectionBlocks:({removed:p})=>[{...p[0],runs:d}],buildAddressBlocks:({removed:p})=>[{...p[0],runs:d}]})}const r=[...new Set(t.map(i=>i.blockId))];return{content:s.content,changes:{changedNodeIds:r,changedZoneKinds:[]}}}function S2e({run:e,format:t,isEnabled:n}){const s=b2e({run:e});if(n)return s.includes(t)?e:{...e,formats:[...s,t]};if(!s.includes(t))return e;const r=s.filter(c=>c!==t);if(r.length>0)return{...e,formats:r};const{formats:i,...o}=e;return o}function ev({content:e,targets:t,format:n,isEnabled:s}){return IF({content:e,targets:t,mapRun:r=>S2e({run:r,format:n,isEnabled:s})})}function v2e({run:e,fontId:t}){if(t===null){if(e.fontId===void 0)return e;const{fontId:n,...s}=e;return s}return e.fontId===t?e:{...e,fontId:t}}function tv({content:e,targets:t,fontId:n}){return IF({content:e,targets:t,mapRun:s=>v2e({run:s,fontId:n})})}function nT({content:e,blockIds:t,mapSectionBlock:n,mapAddressBlock:s}){if(t.length===0)return null;const r={content:e};for(const o of t){const c=xn({content:r.content,blockId:o});if(c===null)return null;const u={value:!1};if(r.content=da({content:r.content,container:c.container,startIndex:c.blockIndex,deleteCount:1,buildSectionBlocks:({removed:d})=>{const p=n({source:d[0]});return p===null?(u.value=!0,d):[p]},buildAddressBlocks:({removed:d})=>{const p=s({source:d[0]});return p===null?(u.value=!0,d):[p]}}),u.value)return null}const i=[...new Set(t)];return{content:r.content,changes:{changedNodeIds:i,changedZoneKinds:[]}}}function _2e({source:e}){const t={id:e.id,runs:e.runs};return e.align!==void 0&&(t.align=e.align),e.indent!==void 0&&(t.indent=e.indent),t}function SF({source:e,target:t}){return e.type!==t.type?!1:e.type==="heading"&&t.type==="heading"?e.level===t.level:e.type==="listItem"&&t.type==="listItem"?e.listKind===t.listKind:!0}function T2e({source:e,target:t}){if(SF({source:e,target:t}))return e;const n=_2e({source:e});return t.type==="paragraph"?{...n,type:"paragraph"}:t.type==="heading"?{...n,type:"heading",level:t.level}:{...n,type:"listItem",listKind:t.listKind}}function N2e({source:e,target:t}){return t.type==="heading"?null:SF({source:e,target:t})?e:t.type==="paragraph"?{id:e.id,type:"paragraph",runs:e.runs}:{id:e.id,type:"listItem",listKind:t.listKind,runs:e.runs}}function qb({content:e,blockIds:t,target:n}){return nT({content:e,blockIds:t,mapSectionBlock:({source:s})=>T2e({source:s,target:n}),mapAddressBlock:({source:s})=>N2e({source:s,target:n})})}function Q9({content:e,blockIds:t,align:n}){return nT({content:e,blockIds:t,mapSectionBlock:({source:s})=>{const{align:r,...i}=s;return n==="left"?i:{...i,align:n}},mapAddressBlock:()=>null})}function H9({content:e,blockIds:t,indent:n}){return!Number.isInteger(n)||n<0?null:nT({content:e,blockIds:t,mapSectionBlock:({source:s})=>{const{indent:r,...i}=s;return n===0?i:{...i,indent:n}},mapAddressBlock:()=>null})}function w2e({content:e}){const t=[];for(const n of e.zones)if(n.kind!=="letterhead"&&n.kind!=="signatures"){if(n.kind==="body"){for(const s of n.items)for(const r of s.children)t.push({block:r,zoneKind:"body"});continue}if(n.kind==="address"){for(const s of n.blocks)t.push({block:s,zoneKind:"address"});continue}for(const s of n.blocks)t.push({block:s,zoneKind:n.kind})}return t}function R2e({index:e,startIndex:t,range:n}){return e===t?n.start.offset:0}function D2e({index:e,endIndex:t,range:n,textLength:s}){return e===t?n.end.offset:s}function vF({content:e,range:t}){const n=w2e({content:e}),s=n.findIndex(c=>c.block.id===t.start.blockId);if(s===-1)return null;const r=n.findIndex(c=>c.block.id===t.end.blockId);if(r===-1||r<s)return null;const i=[];for(const[c,u]of n.slice(s,r+1).entries()){const d=s+c,p=Er({runs:u.block.runs});i.push({block:u.block,zoneKind:u.zoneKind,textLength:p,startOffset:R2e({index:d,startIndex:s,range:t}),endOffset:D2e({index:d,endIndex:r,range:t,textLength:p})})}const o=i[i.length-1];return i.length>1&&o.startOffset===0&&o.endOffset===0?i.slice(0,-1):i}function sT({runs:e,startOffset:t,endOffset:n}){const s=[],r={offset:0};for(const i of e){const o=r.offset,c=o+i.text.length;if(r.offset=c,i.text.length!==0&&!(c<=t)){if(o>=n)break;s.push(i)}}return s}function k2e({run:e,format:t}){return e.formats===void 0?!1:!!e.formats.includes(t)}function O2e({runs:e,startOffset:t,endOffset:n,format:s}){const r=sT({runs:e,startOffset:t,endOffset:n});if(r.length===0)return!1;for(const i of r)if(!k2e({run:i,format:s}))return!1;return!0}function Uh({run:e}){return e.fontId===void 0?null:e.fontId}function P2e({runs:e,startOffset:t,endOffset:n}){const s=sT({runs:e,startOffset:t,endOffset:n});if(s.length===0)return{kind:"empty"};const r=Uh({run:s[0]});for(const i of s)if(Uh({run:i})!==r)return{kind:"mixed"};return{kind:"uniform",fontId:r}}function Wb({run:e}){return e.formats===void 0?[]:e.formats}function rT({runs:e,offset:t}){if(e.length===0)return{formats:[],fontId:null};if(t<=0)return{formats:Wb({run:e[0]}),fontId:Uh({run:e[0]})};const n={offset:0};for(const r of e){const i=n.offset+r.text.length;if(n.offset=i,i>=t&&r.text.length>0)return{formats:Wb({run:r}),fontId:Uh({run:r})}}const s=e[e.length-1];return{formats:Wb({run:s}
967),fontId:Uh({run:s})}}function L2e(e){for(const t of W_)if(t===e)return!0;return!1}const M2e=["text","h1","h2","h3","h4","h5"];function j2e(e){for(const t of M2e)if(t===e)return!0;return!1}const nv=8,B2e={isRunFormattingAllowed:!0,isFontAllowed:!0,isTextStyleAllowed:!0,isListAllowed:!0,isAlignAllowed:!0,isIndentAllowed:!0},F2e={pickPolicy:()=>B2e},NA={hasSelection:!1,isCollapsed:!1,activeRunFormats:[],fontId:null,isFontMixed:!1,textStyle:null,align:null,isBulletListActive:!1,isOrderedListActive:!1,canFormatRuns:!1,canSetFont:!1,canSetTextStyle:!1,canToggleList:!1,canSetAlign:!1,canIndent:!1,canOutdent:!1,canClearFormatting:!1},U2e={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5"};function V9({block:e}){return!("align"in e)||e.align===void 0?"left":e.align}function sv({block:e}){return!("indent"in e)||e.indent===void 0?0:e.indent}function G9({block:e}){return e.type==="heading"?U2e[e.level]:"text"}function z2e({block:e,listKind:t}){return!(e.type!=="listItem"||e.listKind!==t)}function rv({paragraphs:e,listKind:t}){if(e.length===0)return!1;for(const n of e)if(!z2e({block:n.block,listKind:t}))return!1;return!0}function _F({paragraphs:e,format:t}){const n={hasCoveredText:!1};for(const s of e){if(sT({runs:s.block.runs,startOffset:s.startOffset,endOffset:s.endOffset}).length===0)continue;if(n.hasCoveredText=!0,!O2e({runs:s.block.runs,startOffset:s.startOffset,endOffset:s.endOffset,format:t}))return!1}return n.hasCoveredText}function Q2e({paragraphs:e}){const t={fontId:null,hasValue:!1};for(const n of e){const s=P2e({runs:n.block.runs,startOffset:n.startOffset,endOffset:n.endOffset});if(s.kind!=="empty"){if(s.kind==="mixed")return{fontId:null,isMixed:!0};if(!t.hasValue){t.fontId=s.fontId,t.hasValue=!0;continue}if(t.fontId!==s.fontId)return{fontId:null,isMixed:!0}}}return{fontId:t.fontId,isMixed:!1}}function H2e({paragraphs:e}){if(e.length===0)return null;const t=G9({block:e[0].block});for(const n of e)if(G9({block:n.block})!==t)return null;return t}function V2e({paragraphs:e}){if(e.length===0)return null;const t=V9({block:e[0].block});for(const n of e)if(V9({block:n.block})!==t)return null;return t}function Bo({paragraphs:e,policyProvider:t,flag:n}){if(e.length===0)return!1;for(const s of e)if(!t.pickPolicy({zoneKind:s.zoneKind})[n])return!1;return!0}function G2e({paragraphs:e,isCollapsed:t}){return t?rT({runs:e[0].block.runs,offset:e[0].startOffset}).formats:VE.filter(n=>_F({paragraphs:e,format:n}))}function q2e({paragraphs:e,isCollapsed:t}){return t?{fontId:rT({runs:e[0].block.runs,offset:e[0].startOffset}).fontId,isMixed:!1}:Q2e({paragraphs:e})}function W2e({content:e,selection:t,policyProvider:n}){if(t===null)return NA;const s=vF({content:e,range:t.range});if(s===null||s.length===0)return NA;const r=Xd({range:t.range}),i=q2e({paragraphs:s,isCollapsed:r}),o=Bo({paragraphs:s,policyProvider:n,flag:"isRunFormattingAllowed"}),c=Bo({paragraphs:s,policyProvider:n,flag:"isFontAllowed"}),u=o&&c&&Bo({paragraphs:s,policyProvider:n,flag:"isTextStyleAllowed"})&&Bo({paragraphs:s,policyProvider:n,flag:"isAlignAllowed"})&&Bo({paragraphs:s,policyProvider:n,flag:"isIndentAllowed"});return{hasSelection:!0,isCollapsed:r,activeRunFormats:G2e({paragraphs:s,isCollapsed:r}),fontId:i.fontId,isFontMixed:i.isMixed,textStyle:H2e({paragraphs:s}),align:V2e({paragraphs:s}),isBulletListActive:rv({paragraphs:s,listKind:"bullet"}),isOrderedListActive:rv({paragraphs:s,listKind:"ordered"}),canFormatRuns:o,canSetFont:c,canSetTextStyle:Bo({paragraphs:s,policyProvider:n,flag:"isTextStyleAllowed"}),canToggleList:Bo({paragraphs:s,policyProvider:n,flag:"isListAllowed"}),canSetAlign:Bo({paragraphs:s,policyProvider:n,flag:"isAlignAllowed"}),canIndent:Bo({paragraphs:s,policyProvider:n,flag:"isIndentAllowed"})&&s.some(d=>sv({block:d.block})<nv),canOutdent:Bo({paragraphs:s,policyProvider:n,flag:"isIndentAllowed"})&&s.some(d=>sv({block:d.block})>0),canClearFormatting:u&&!r}}const K2e={h1:1,h2:2,h3:3,h4:4,h5:5};function q9({content:e,steps:t}){if(t.length===0)return null;const n={content:e,nodeIds:new Set,zoneKinds:new Set};for(const r of t){const i=r({content:n.content});if(i===null)return null;n.content=i.content;for(const o of i.changes.changedNodeIds)n.nodeIds.add(o);
967for(const o of i.changes.changedZoneKinds)n.zoneKinds.add(o)}const s={changedNodeIds:[...n.nodeIds],changedZoneKinds:[...n.zoneKinds]};return{content:n.content,changes:s}}function Kb({paragraphs:e}){const t=[];for(const n of e)n.startOffset>=n.endOffset||t.push({blockId:n.block.id,startOffset:n.startOffset,endOffset:n.endOffset});return t}function Z0({paragraphs:e}){return e.map(t=>t.block.id)}function $2e({value:e}){return e==="text"?{type:"paragraph"}:{type:"heading",level:K2e[e]}}function Y2e({paragraphs:e,listKind:t}){return rv({paragraphs:e,listKind:t})?{type:"paragraph"}:{type:"listItem",listKind:t}}function X2e({value:e}){return e<0?0:e>nv?nv:e}function J2e({model:e,selectionLayer:t,policyProvider:n=F2e}){const s={selection:null,toolbar:NA,pending:null},r=new Set;function i(){for(const N of r)N({state:s.toolbar})}function o({position:N}){return!(s.pending===null||!v1({a:s.pending.position,b:N}))}function c(){const N=W2e({content:e.getContent(),selection:s.selection,policyProvider:n});if(s.pending!==null&&N.isCollapsed&&s.selection!==null&&o({position:s.selection.range.start})){s.toolbar={...N,activeRunFormats:s.pending.style.formats,fontId:s.pending.style.fontId,isFontMixed:!1},i();return}s.toolbar=N,i()}const u=e.subscribe({onChange:()=>{c()}});function d({paragraphs:N,flag:R}){if(N.length===0)return!1;for(const D of N)if(!n.pickPolicy({zoneKind:D.zoneKind})[R])return!1;return!0}function p(){const N=t.readSelection();if(N===null)return null;const R=vF({content:e.getContent(),range:N.range});return R===null||R.length===0?null:{selection:N,paragraphs:R}}function g({result:N,selection:R}){e.commit({content:N.content,changes:N.changes,meta:{record:"format",selectionBefore:{anchor:R.anchor,focus:R.focus},selectionAfter:{anchor:R.anchor,focus:R.focus}}}),t.setSelection({anchor:R.anchor,focus:R.focus}),s.selection=R,c()}function A({context:N}){const R=N.selection.range.start;if(s.pending!==null&&o({position:R}))return s.pending.style;const D=rT({runs:N.paragraphs[0].block.runs,offset:R.offset});return{formats:D.formats,fontId:D.fontId}}function E({context:N,style:R}){s.pending={position:N.selection.range.start,style:R},s.selection=N.selection,c()}function x({base:N,format:R}){return N.formats.includes(R)?{formats:N.formats.filter(D=>D!==R),fontId:N.fontId}:{formats:[...N.formats,R],fontId:N.fontId}}function y({format:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isRunFormattingAllowed"}))return!1;if(Xd({range:R.selection.range})){const O=A({context:R});return E({context:R,style:x({base:O,format:N})}),!0}const D=Kb({paragraphs:R.paragraphs});if(D.length===0)return!1;const k=_F({paragraphs:R.paragraphs,format:N}),L=ev({content:e.getContent(),targets:D,format:N,isEnabled:!k});return L===null?!1:(g({result:L,selection:R.selection}),!0)}function I({fontId:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isFontAllowed"}))return!1;if(Xd({range:R.selection.range})){const L=A({context:R});return E({context:R,style:{formats:L.formats,fontId:N}}),!0}const D=Kb({paragraphs:R.paragraphs});if(D.length===0)return!1;const k=tv({content:e.getContent(),targets:D,fontId:N});return k===null?!1:(g({result:k,selection:R.selection}),!0)}function v({value:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isTextStyleAllowed"}))return!1;const D=qb({content:e.getContent(),blockIds:Z0({paragraphs:R.paragraphs}),target:$2e({value:N})});return D===null?!1:(g({result:D,selection:R.selection}),!0)}function S({listKind:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isListAllowed"}))return!1;const D=qb({content:e.getContent(),blockIds:Z0({paragraphs:R.paragraphs}),target:Y2e({paragraphs:R.paragraphs,listKind:N})});return D===null?!1:(g({result:D,selection:R.selection}),!0)}function b({align:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isAlignAllowed"}))return!1;const D=Q9({content:e.getContent(),blockIds:Z0({paragraphs:R.paragraphs}),align:N});return D===null?!1:(g({result:D,selection:R.selection}),!0)}function w({delta:N}){const R=p();if(R===null||!d({paragraphs:R.paragraphs,flag:"isIndentAllowed"}))return!1;const D=new Map;for(const O of R.paragraphs){const P=sv({block:O.block}),B=X2e({value:P+N});if(B===P)continue;const F=D.get(B);if(F===void 0){D.set(B,[O.block.id]);continue}F.push(O.block.id)}if(D.size===0)return!1;const k=[...D.entries()].map(([O,P])=>({content:B})=>H9({content:B,blockIds:P,indent:O})),L=q9({content:e.getContent(),steps:k});return L===null?!1:(g({result:L,selection:R.selection}),!0)}function _(){const N=p();if(N===null||Xd({range:N.selection.range})||!d({paragraphs:N.paragraphs,flag:"isRunFormattingAllowed"})||!d({paragraphs:N.paragraphs,flag:"isFontAllowed"})||!d({paragraphs:N.paragraphs,flag:"isTextStyleAllowed"})||!d({paragraphs:N.paragraphs,flag:"isAlignAllowed"})||!d({paragraphs:N.paragraphs,flag:"isIndentAllowed"}))return!1;const R=Kb({paragraphs:N.paragraphs}),D=Z0({paragraphs:N.paragraphs}),k=[];for(const O of VE)R.length!==0&&k.push(({content:P})=>ev({content:P,targets:R,format:O,isEnabled:!1}));R.length>0&&k.push(({content:O})=>tv({content:O,targets:R,fontId:null})),k.push(({content:O})=>qb({content:O,blockIds:D,target:{type:"paragraph"}})),k.push(({content:O})=>Q9({content:O,blockIds:D,align:"left"})),k.push(({content:O})=>H9({content:O,blockIds:D,indent:0}));const L=q9({content:e.getContent(),steps:k});return L===null?!1:(g({result:L,selection:N.selection}),!0)}return{getState:()=>
967s.toolbar,subscribe:({onChange:N})=>(r.add(N),()=>{r.delete(N)}),notifySelection:({selection:N})=>{s.selection=N,s.pending!==null&&N===null&&(s.pending=null),s.pending!==null&&N!==null&&(Xd({range:N.range})||(s.pending=null)),s.pending!==null&&N!==null&&(o({position:N.range.start})||(s.pending=null)),c()},readPendingRunStyleForInsert:({position:N})=>s.pending===null||!o({position:N})?null:s.pending.style,toggleRunFormat:y,setFont:I,setTextStyle:v,toggleList:S,setAlign:b,changeIndent:w,clearFormatting:_,destroy:()=>{u(),r.clear()}}}const Z2e={KeyB:"bold",KeyI:"italic",KeyU:"underline"};function e_e({root:e,controller:t}){function n(s){if(!s.ctrlKey&&!s.metaKey||s.altKey||s.shiftKey)return;const r=Z2e[s.code];r!==void 0&&(s.preventDefault(),t.toggleRunFormat({format:r}))}return e.addEventListener("keydown",n),{destroy:()=>{e.removeEventListener("keydown",n)}}}function t_e({zone:e,index:t}){if(e.kind!=="letterhead"){if(e.kind==="body"){e.items.forEach((n,s)=>{t.set(n.id,{nodeType:"section",bodyItemIndex:s}),n.children.forEach((r,i)=>{t.set(r.id,{nodeType:"sectionBlock",sectionId:n.id,bodyItemIndex:s,blockIndex:i})})});return}if(e.kind==="signatures"){e.rows.forEach((n,s)=>{t.set(n.id,{nodeType:"signatoryRow",rowIndex:s})});return}e.blocks.forEach((n,s)=>{t.set(n.id,{nodeType:"zoneBlock",zoneKind:e.kind,blockIndex:s})})}}function iv({content:e}){const t=new Map;return e.zones.forEach(n=>{t_e({zone:n,index:t})}),t}function n_e({content:e}){const t={content:e,index:iv({content:e})},n=new Set;function s(){return t.content}function r({id:u}){const d=t.index.get(u);return d===void 0?null:d}function i({id:u}){return!!t.index.has(u)}function o({onChange:u}){return n.add(u),()=>{n.delete(u)}}function c({content:u,changes:d,meta:p}){const g=t.content;t.content=u,t.index=iv({content:u}),n.forEach(A=>{A({content:u,previousContent:g,changes:d,meta:p})})}return{getContent:s,getNodeLocation:r,hasNode:i,subscribe:o,commit:c}}function TF({content:e,sectionId:t}){for(const[n,s]of e.zones.entries()){if(s.kind!=="body")continue;const r=s.items.findIndex(i=>i.id===t);return r===-1?null:{zoneIndex:n,sectionIndex:r,section:s.items[r],items:s.items}}return null}function s_e({content:e,blockId:t}){for(const[n,s]of e.zones.entries())if(s.kind==="body")for(const[r,i]of s.items.entries()){const o=i.children.findIndex(c=>c.id===t);if(o!==-1)return{zoneIndex:n,sectionIndex:r,section:i,blockIndex:o,block:i.children[o]}}return null}function $E({content:e,buildItems:t}){if(e.zones.findIndex(r=>r.kind==="body")===-1)return null;const s=e.zones.map(r=>r.kind!=="body"?r:{...r,items:t({items:r.items})});return{...e,zones:s}}function iT({content:e}){return new Set(iv({content:e}).keys())}function oT({kind:e}){return Yl.indexOf(e)}function ov({zone:e}){return e.kind==="letterhead"?[]:e.kind==="body"?e.items.flatMap(t=>[t.id,...t.children.map(n=>n.id)]):e.kind==="signatures"?e.rows.map(t=>t.id):e.blocks.map(t=>t.id)}function NF({usedIds:e,candidateIds:t}){const n=new Set;for(const s of t){if(e.has(s)||n.has(s))return!0;n.add(s)}return!1}function r_e({content:e,zone:t}){if(t.kind==="body")return null;const n=e.zones.findIndex(c=>c.kind===t.kind),s=iT({content:e});if(n!==-1&&ov({zone:e.zones[n]}).forEach(c=>{s.delete(c)}),NF({usedIds:s,candidateIds:ov({zone:t})}))return null;if(n!==-1){const c=e.zones.map((u,d)=>d!==n?u:t);return{content:{...e,zones:c},changes:{changedNodeIds:[],changedZoneKinds:[t.kind]}}}const r=oT({kind:t.kind}),i=i_e({content:e,orderIndex:r}),o=[...e.zones.slice(0,i),t,...e.zones.slice(i)];return{content:{...e,zones:o},changes:{changedNodeIds:[],changedZoneKinds:[t.kind]}}}function i_e({content:e,orderIndex:t}){const n=e.zones.findIndex(s=>oT({kind:s.kind})>t);return n===-1?e.zones.length:n}function wF({content:e,zones:t}){if(t.length===0)return null;const n=new Set,s={lastOrderIndex:-1};for(const i of t){if(n.has(i.kind))return null;n.add(i.kind);const o=oT({kind:i.kind});if(o<=s.lastOrderIndex)return null;s.lastOrderIndex=o}if(!n.has("body"))return null;const r=t.flatMap(i=>ov({zone:i}));return NF({usedIds:new Set,candidateIds:r})?null:{content:{...e,zones:t}
967,changes:{changedNodeIds:[],changedZoneKinds:t.map(i=>i.kind)}}}function eg(){return crypto.randomUUID()}function o_e({range:e}){return e.start.offset<=e.end.offset?{start:e.start.offset,end:e.end.offset}:{start:e.end.offset,end:e.start.offset}}function _1({content:e,range:t,preserveFieldContainers:n}){if(t.start.blockId!==t.end.blockId)return null;const{start:s,end:r}=o_e({range:t});if(s===r)return null;const i=xn({content:e,blockId:t.start.blockId});if(i===null||!uc({runs:i.block.runs,offset:s})||!uc({runs:i.block.runs,offset:r}))return null;const o=mm({runs:i.block.runs,start:s,end:r,preserveFieldContainers:n});return{content:da({content:e,container:i.container,startIndex:i.blockIndex,deleteCount:1,buildSectionBlocks:({removed:u})=>[{...u[0],runs:o}],buildAddressBlocks:({removed:u})=>[{...u[0],runs:o}]}),changes:KE({blockId:t.start.blockId}),caretPosition:{blockId:t.start.blockId,offset:s}}}function W9({provided:e}){return e!==void 0?e:eg()}function a_e({a:e,b:t}){return!(e.container.containerKind!==t.container.containerKind||e.container.zoneIndex!==t.container.zoneIndex||e.container.containerKind==="section"&&t.container.containerKind==="section"&&e.container.sectionIndex!==t.container.sectionIndex)}function K9({found:e,offset:t}){return!(!Number.isInteger(t)||t<0||t>Er({runs:e.block.runs}))}function l_e({found:e,nodeIds:t}){return e.container.containerKind==="section"?{changedNodeIds:[...t,e.container.sectionId],changedZoneKinds:[]}:{changedNodeIds:[...t],changedZoneKinds:[e.containerZoneKind]}}function c_e({content:e,range:t,startFound:n,endFound:s}){if(n.blockIndex>=s.blockIndex)return null;const r=mm({runs:n.block.runs,start:t.start.offset,end:Er({runs:n.block.runs})}),i=mm({runs:s.block.runs,start:0,end:t.end.offset}),o=Gs({runs:[...r,...i]}),c=s.blockIndex-n.blockIndex+1,u=n.siblings.slice(n.blockIndex+1,s.blockIndex+1).map(p=>p.id);return{content:da({content:e,container:n.container,startIndex:n.blockIndex,deleteCount:c,buildSectionBlocks:({removed:p})=>{const g=p[0];return g===void 0?[]:[{...g,runs:o}]},buildAddressBlocks:({removed:p})=>{const g=p[0];return g===void 0?[]:[{...g,runs:o}]}}),changes:l_e({found:n,nodeIds:[t.start.blockId,...u]}),caretPosition:t.start}}function u_e({range:e,startFound:t,endFound:n}){return!(t.container.containerKind!=="section"||n.container.containerKind!=="section"||n.container.sectionIndex!==t.container.sectionIndex+1||t.blockIndex!==t.siblings.length-1||e.start.offset!==Er({runs:t.block.runs})||n.blockIndex!==0||e.end.offset!==0)}function $9({sections:e,edge:t}){if(t==="end"){for(const n of[...e].reverse()){const s=n.children[n.children.length-1];if(s!==void 0)return{blockId:s.id,offset:Er({runs:s.runs})}}return null}for(const n of e){const s=n.children[0];if(s!==void 0)return{blockId:s.id,offset:0}}return null}function d_e({sections:e}){for(const t of e)if(t.children.length>0)return!0;return!1}function f_e({content:e,range:t,startFound:n,endFound:s,emptySectionId:r,emptyBlockId:i}){if(n.container.containerKind!=="section"||s.container.containerKind!=="section")return null;const o=n.container.sectionIndex,c=s.container.sectionIndex;if(o>=c)return null;const u=e.zones[n.container.zoneIndex];if(u===void 0||u.kind!=="body"||u_e({range:t,startFound:n,endFound:s}))return null;const d=u.items[o],p=u.items[c],g=d.children[n.blockIndex],A=p.children[s.blockIndex];if(g===void 0||A===void 0)return null;const E=n.blockIndex===0&&t.start.offset===0,x=Er({runs:A.runs}),y=s.blockIndex===p.children.length-1&&t.end.offset===x,I=mm({runs:g.runs,start:t.start.offset,end:Er({runs:g.runs})}),v=mm({runs:A.runs,start:0,end:t.end.offset}),S=[];E||S.push({...d,children:[...d.children.slice(0,n.blockIndex),{...g,runs:I}]}),y||S.push({...p,children:[{...A,runs:v},...p.children.slice(s.blockIndex+1)]});const b=[...u.items.slice(0,o),...S,...u.items.slice(c+1)],w=u.items.slice(o,c+1).filter(k=>!(!E&&k.id===d.id||!y&&k.id===p.id)).map(k=>k.id),_={position:null};E||(_.position=t.start),_.position===null&&!y&&(_.position={blockId:t.end.blockId,offset:0}),_.position===null&&(_.position=$9({sections:u.items.slice(0,o),edge:"end"})),_.position===null&&(_.position=$9({sections:u.items.slice(c+1),edge:"start"}));const N=[];if(p_e({finalItems:b,caretParts:_})){const k=W9({provided:r}),L=W9({provided:i});b.push({id:k,sectionKind:"text",children:[{id:L,type:"paragraph",runs:[]}]}),N.push(k,L),_.position={blockId:L,offset:0}}if(_.position===null)return null;const R=e.zones.map((k,L)=>
967L!==n.container.zoneIndex||k.kind!=="body"?k:{...k,items:b}),D=new Set([...w,...N,t.start.blockId,t.end.blockId,d.id,p.id]);return{content:{...e,zones:R},changes:{changedNodeIds:[...D],changedZoneKinds:["body"]},caretPosition:_.position}}function p_e({finalItems:e,caretParts:t}){return!d_e({sections:e})||t.position===null}function yh({content:e,range:t,emptySectionId:n,emptyBlockId:s}){if(Xd({range:t}))return null;const r=xn({content:e,blockId:t.start.blockId});if(r===null)return null;const i=xn({content:e,blockId:t.end.blockId});return i===null||!K9({found:r,offset:t.start.offset})||!K9({found:i,offset:t.end.offset})?null:t.start.blockId===t.end.blockId?_1({content:e,range:t}):a_e({a:r,b:i})?c_e({content:e,range:t,startFound:r,endFound:i}):r.container.zoneIndex!==i.container.zoneIndex?null:f_e({content:e,range:t,startFound:r,endFound:i,emptySectionId:n,emptyBlockId:s})}function RF({content:e,placeholderId:t}){for(const n of e.zones){if(n.kind==="body"){for(const s of n.items)for(const r of s.children)if(eA({runs:r.runs,placeholderId:t}))return r.id;continue}if(n.kind==="title"||n.kind==="subtitle"){for(const s of n.blocks)if(eA({runs:s.runs,placeholderId:t}))return s.id;continue}if(n.kind==="pleas"){for(const s of n.blocks)if(eA({runs:s.runs,placeholderId:t}))return s.id;continue}if(n.kind==="address"){for(const s of n.blocks)if(eA({runs:s.runs,placeholderId:t}))return s.id}}return null}function eA({runs:e,placeholderId:t}){for(const n of e)if(n.placeholder!==void 0&&n.placeholder.id===t)return!0;return!1}function T1({content:e,blockId:t,placeholderId:n}){const s=xn({content:e,blockId:t});if(s===null)return null;const r=Cc({runs:s.block.runs,placeholderId:n});if(r===null)return null;const i=Gs({runs:[...s.block.runs.slice(0,r.firstRunIndex),...s.block.runs.slice(r.lastRunIndex+1)]});return{content:da({content:e,container:s.container,startIndex:s.blockIndex,deleteCount:1,buildSectionBlocks:({removed:c})=>[{...c[0],runs:i}],buildAddressBlocks:({removed:c})=>[{...c[0],runs:i}]}),changes:KE({blockId:t}),caretPosition:{blockId:t,offset:r.startOffset}}}const bh={changedNodeIds:[],changedZoneKinds:[]};function Qo({a:e,b:t}){const n=new Set([...e.changedNodeIds,...t.changedNodeIds]),s=new Set([...e.changedZoneKinds,...t.changedZoneKinds]);return{changedNodeIds:[...n],changedZoneKinds:[...s]}}const h_e={arial:"Arial, Helvetica, sans-serif",times_new_roman:"'Times New Roman', Times, serif"},m_e=2;function g_e({text:e}){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function A_e({run:e}){if(e.fontId===void 0)return null;const t=h_e[e.fontId];return t===void 0?null:t}function tA({run:e,format:t}){return e.formats===void 0?!1:!!e.formats.includes(t)}function E_e({run:e}){const n={current:g_e({text:e.text})};tA({run:e,format:"highlight"})&&(n.current=`<mark>${n.current}</mark>`),tA({run:e,format:"underline"})&&(n.current=`<u>${n.current}</u>`),tA({run:e,format:"italic"})&&(n.current=`<i>${n.current}</i>`),tA({run:e,format:"bold"})&&(n.current=`<b>${n.current}</b>`);const s=A_e({run:e});return s!==null&&(n.current=`<span style="font-family: ${s}">${n.current}</span>`),n.current}function x_e({runs:e}){const t=e.map(n=>E_e({run:n})).join("");return t.length===0?"<br>":t}function C_e({block:e}){const t=[];return e.align!==void 0&&t.push(`text-align: ${e.align}`),e.indent!==void 0&&e.indent>0&&t.push(`margin-left: ${e.indent*m_e}em`),t.length===0?"":` style="${t.join("; ")}"`}function Y9({block:e,tag:t}){const n=C_e({block:e}),s=x_e({runs:e.runs});return`<${t}${n}>${s}</${t}>`}function y_e({block:e}){if(e.listKind==="ordered"){const t=b_e({block:e});return{tag:"ol",listKind:"ordered",items:[],startAttribute:t}}return{tag:"ul",listKind:"bullet",items:[],startAttribute:""}}function b_e({block:e}){return e.startNumber===void 0?"":` start="${e.startNumber}"`}function $b({openList:e,out:t}){return e===null||t.push(`<${e.tag}${e.startAttribute}>${e.items.join("")}</${e.tag}>`),null}function I_e({openList:e,block:t}){return e===null||e.listKind!==t.listKind||t.listKind==="ordered"&&t.startNumber!==void 0}function S_e({section:e}){const t=[],n={openList:null};for(const s of e.blocks){if(s.type!=="listItem"){n.openList=$b({openList:n.openList,out:t}),t.push(Y9({block:s,tag:v_e({block:s})}));continue}I_e({openList:n.openList,block:s})&&($b({openList:n.openList,out:t}),n.openList=y_e({block:s})),n.openList?.items.push(Y9({block:s,tag:"li"}))}return $b({openList:n.openList,out:t}),t.join("")}function v_e({block:e}){return e.type==="heading"?`h${e.level}`:"p"}function X9({sections:e}){return e.map(t=>S_e({section:t})).join("")}function DF({text:e,granularity:t}){if(typeof Intl.Segmenter!="function")return null;const n=new Intl.Segmenter(void 0,{granularity:t}),s=[0];for(const r of n.segment(e))s.push(r.index+r.segment.length);return s}function kF({code:e}){return e>=55296&&e<=56319}function OF({code:e}){return e>=56320&&e<=57343}function __e({text:e,offset:t}){if(t>=2){const n=e.charCodeAt(t-1),s=e.charCodeAt(t-2);if(OF({code:n})&&kF({code:s}))return t-2}return t-1}function T_e({text:e,offset:t}){if(t+2<=e.length){const n=e.charCodeAt(t),s=e.charCodeAt(t+1);if(kF({code:n})&&OF({code:s}))return t+2}return t+1}function N1({text:e,offset:t}){if(t<=0)return 0;const n=DF({text:e,granularity:"grapheme"});if(n===null)return __e({text:e,offset:t});const s=n.filter(r=>r<t);return s.length===0?0:s[s.length-1]}function w1({text:e,offset:t}){if(t>=e.length)return e.length;const n=DF({text:e,granularity:"grapheme"});if(n===null)return T_e({text:e,offset:t});const s=n.find(r=>r>t);return s===void 0?e.length:s}const N_e=/\s/;function R1({text:e,index:t}){return!!N_e.test(e[t])}function w_e({text:e,offset:t}){const n={position:t};for(;n.position>0&&R1({text:e,index:n.position-1});)n.position-=1;for(;n.position>0&&!R1({text:e,index:n.position-1});)n.position=N1({text:e,offset:n.position});return n.position}
967function R_e({text:e,offset:t}){const n={position:t};for(;n.position<e.length&&R1({text:e,index:n.position});)n.position+=1;for(;n.position<e.length&&!R1({text:e,index:n.position});)n.position=w1({text:e,offset:n.position});return n.position}const YE="[data-placeholder-id]",kf="[data-placeholder-pad]";function aT({node:e}){const t=lT({node:e});if(t===null)return null;const n=t.closest(YE);return n instanceof HTMLElement?n:null}function Yb({wrapper:e}){return!e.hasAttribute("data-placeholder-filled")}function lT({node:e}){if(e instanceof Element)return e;const t=e.parentElement;return t===null?null:t}function PF({wrapper:e}){return e.getAttribute("data-placeholder-id")}function Za({wrapper:e,kind:t}){const n=PF({wrapper:e});return n===null?null:{wrapper:e,placeholderId:n,kind:t}}function Xb({node:e,side:t}){const n={current:e};for(;;){const s=n.current;if(s instanceof Element&&s.hasAttribute("data-block-id"))return null;const r=D_e({node:n.current,side:t});if(r!==null)return r;const i=n.current.parentNode;if(i===null)return null;n.current=i}}function D_e({node:e,side:t}){return t==="before"?e.previousSibling:e.nextSibling}function D1({node:e,offset:t,side:n}){if(e instanceof Text)return n==="after"&&t<e.data.length||n==="before"&&t>0?null:Xb({node:e,side:n});if(n==="after"){const r=e.childNodes[t];return r!==void 0?r:Xb({node:e,side:n})}const s=e.childNodes[t-1];return s!==void 0?s:Xb({node:e,side:n})}function k1({candidate:e}){return e===null||!(e instanceof HTMLElement)||!e.matches(YE)?null:e}function k_e({node:e,offset:t}){const n=lT({node:e});if(n===null)return null;const s=n.closest(kf);if(!(s instanceof HTMLElement))return null;const r=aT({node:s});return r===null?null:s===r.firstChild?t<=0?Za({wrapper:r,kind:"outside-before"}):Za({wrapper:r,kind:"inside"}):t>=cT({node:e})?Za({wrapper:r,kind:"outside-after"}):Za({wrapper:r,kind:"inside"})}function cT({node:e}){if(e instanceof Text)return e.data.length;const t=e.textContent;return t===null?0:t.length}function O1({root:e,node:t,offset:n}){if(!e.contains(t))return null;const s=k_e({node:t,offset:n});if(s!==null)return s;const r=aT({node:t});if(r!==null)return Za({wrapper:r,kind:"inside"});const i=k1({candidate:D1({node:t,offset:n,side:"after"})});if(i!==null)return Za({wrapper:i,kind:"outside-before"});const o=k1({candidate:D1({node:t,offset:n,side:"before"})});return o!==null?Za({wrapper:o,kind:"outside-after"}):null}function av({root:e}){const t=e.ownerDocument.getSelection();if(t===null||!t.isCollapsed)return null;const n=t.focusNode;return n===null?null:O1({root:e,node:n,offset:t.focusOffset})}function uT({root:e}){const t=e.ownerDocument.getSelection();if(t===null)return null;if(t.isCollapsed)return av({root:e});const n=t.anchorNode,s=t.focusNode;if(n===null||s===null)return null;const r=O1({root:e,node:n,offset:t.anchorOffset}),i=O1({root:e,node:s,offset:t.focusOffset});return r===null||i===null||r.wrapper!==i.wrapper?null:r.kind==="inside"?Za({wrapper:r.wrapper,kind:"inside"}):i.kind==="inside"?Za({wrapper:i.wrapper,kind:"inside"}):null}function O_e({root:e}){const t=e.ownerDocument.getSelection();if(t===null||t.rangeCount===0||t.isCollapsed)return null;const n=t.getRangeAt(0);return O1({root:e,node:n.startContainer,offset:n.startOffset})}function J9({wrapper:e,padSide:t,container:n,offset:s}){const r=P_e({wrapper:e,padSide:t});if(r===null)return!1;const i=n===r,o=n instanceof Text&&n.parentElement===r;return!i&&!o?!1:t==="first"?s===0:s>=cT({node:n})}function P_e({wrapper:e,padSide:t}){const n=L_e({wrapper:e,padSide:t});return!(n instanceof HTMLElement)||!n.matches(kf)?null:n}function L_e({wrapper:e,padSide:t}){return t==="first"?e.firstChild:e.lastChild}function M_e({range:e,node:t}){const n=t.parentNode;if(n===null)return!1;const s=Array.prototype.indexOf.call(n.childNodes,t);return s<0||!Z9({range:e,parent:n,index:s,node:t,side:"start"})?!1:Z9({range:e,parent:n,index:s,node:t,side:"end"})}function Z9({range:e,parent:t,index:n,node:s,side:r}){return r==="start"?e.isPointInRange(t,n)?!0:s instanceof HTMLElement?J9({wrapper:s,padSide:"first",container:e.startContainer,offset:e.startOffset}):!1:e.isPointInRange(t,n+1)?!0:s instanceof HTMLElement?J9({wrapper:s,padSide:"last",container:e.endContainer,offset:e.endOffset}):!1}function dT({root:e}){const t=e.ownerDocument.getSelection();if(t===null)return[];if(t.rangeCount===0)return[];if(t.isCollapsed)return[];const n=t.getRangeAt(0),s=[];
967return e.querySelectorAll(YE).forEach(r=>{r instanceof HTMLElement&&M_e({range:n,node:r})&&s.push(r)}),s}function lv({root:e,content:t,range:n}){if(n.start.blockId!==n.end.blockId)return null;const s=dT({root:e});if(s.length!==1)return null;const r=PF({wrapper:s[0]});if(r===null)return null;const i=xn({content:t,blockId:n.start.blockId});if(i===null)return null;const o=Cc({runs:i.block.runs,placeholderId:r});return o===null||o.startOffset!==n.start.offset||o.endOffset!==n.end.offset?null:{blockId:n.start.blockId,placeholderId:r,label:o.placeholder.label}}function eD({element:e,side:t}){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);if(t==="first"){const r=n.nextNode();return r instanceof Text?r:null}const s={last:null};for(;;){const r=n.nextNode();if(r===null)break;r instanceof Text&&(s.last=r)}return s.last}function qi({node:e,offset:t}){const n=e.ownerDocument;if(n===null)return;const s=n.getSelection();s!==null&&s.collapse(e,t)}function tD({wrapper:e,side:t}){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),s={first:null,last:null};for(;;){const r=n.nextNode();if(r===null)break;if(!(r instanceof Text))continue;const i=r.parentElement;i!==null&&i.closest(kf)!==null||(s.first===null&&(s.first=r),s.last=r)}return t==="first"?s.first:s.last}function eu({wrapper:e,edge:t}){if(t==="start"){const s=tD({wrapper:e,side:"first"});if(s!==null){qi({node:s,offset:0});return}qi({node:e,offset:1});return}const n=tD({wrapper:e,side:"last"});if(n!==null){qi({node:n,offset:n.data.length});return}qi({node:e,offset:1})}function Of({wrapper:e,side:t}){if(t==="before"){const s=e.previousSibling;if(s instanceof Text){qi({node:s,offset:s.data.length});return}if(s instanceof HTMLElement){const r=eD({element:s,side:"last"});if(r!==null){qi({node:r,offset:r.data.length});return}}nD({wrapper:e,side:t});return}const n=e.nextSibling;if(n instanceof Text){qi({node:n,offset:0});return}if(n instanceof HTMLElement){const s=eD({element:n,side:"first"});if(s!==null){qi({node:s,offset:0});return}}nD({wrapper:e,side:t})}function nD({wrapper:e,side:t}){const n=e.parentNode;if(n===null)return;const s=Array.prototype.indexOf.call(n.childNodes,e);if(!(s<0)){if(t==="before"){qi({node:n,offset:s});return}qi({node:n,offset:s+1})}}function sD({wrapper:e}){const t=e.ownerDocument.getSelection();if(t===null)return;const n=e.childNodes.length;if(n<3){t.setBaseAndExtent(e,0,e,n);return}t.setBaseAndExtent(e,1,e,n-1)}function j_e({root:e}){const t=uT({root:e});return t===null||t.kind!=="inside"?null:t.wrapper}function LF({root:e,placeholderId:t}){const s=[...e.querySelectorAll(YE)].find(r=>r.getAttribute("data-placeholder-id")===t);return s instanceof HTMLElement?s:null}function fT({root:e,content:t,position:n,affinity:s}){const r=xn({content:t,blockId:n.blockId});if(r===null)return;const i=Cc({runs:r.block.runs,placeholderId:s.placeholderId});if(i===null)return;const o=LF({root:e,placeholderId:s.placeholderId});if(o===null)return;const c=n.offset===i.startOffset,u=n.offset===i.endOffset;if(!(!c&&!u)){if(s.side==="inside"){if(i.startOffset===i.endOffset){eu({wrapper:o,edge:"start"});return}if(u){eu({wrapper:o,edge:"end"});return}eu({wrapper:o,edge:"start"});return}if(s.side==="outside-before"){if(!c)return;Of({wrapper:o,side:"before"});return}u&&Of({wrapper:o,side:"after"})}}function B_e({root:e,content:t,position:n,side:s}){const r=xn({content:t,blockId:n.blockId});if(r===null)return!1;const o=np({runs:r.block.runs}).find(u=>s==="outside-before"?u.startOffset===n.offset:u.endOffset===n.offset);if(o===void 0)return!1;const c=LF({root:e,placeholderId:o.placeholder.id});return c===null?!1:s==="outside-before"?(Of({wrapper:c,side:"before"}),!0):(Of({wrapper:c,side:"after"}),!0)}function rD({wrapper:e,root:t}){const n=t.ownerDocument.getSelection();if(n===null)return null;const s=n.focusNode;if(s===null||!e.contains(s))return null;const r=lT({node:s});if(r!==null){const u=r.closest(kf);if(u instanceof HTMLElement)return u===e.firstChild?0:MF({wrapper:e})}const i=t.ownerDocument.createRange();i.setStart(e,0);try{i.setEnd(s,n.focusOffset)}catch{return null}const o=i.toString().length,c=e.firstChild;return c instanceof HTMLElement&&c.matches(kf)?Math.max(o-cT({node:c}),0):o}function F_e({root:e,onLog:t}){function n({line:c}){t!==void 0&&t({line:c})}function s({side:c}){const u=e.ownerDocument.getSelection();if(u===null||!u.isCollapsed)return null;const d=u.focusNode;return!(d instanceof Text)||!e.contains(d)||aT({node:d})!==null?null:c==="before"?u.focusOffset===0||N1({text:d.data,offset:u.focu
967sOffset})!==0||k1({candidate:D1({node:d,offset:0,side:"before"})})===null?null:{node:d,offset:0}:u.focusOffset===d.data.length||w1({text:d.data,offset:u.focusOffset})!==d.data.length||k1({candidate:D1({node:d,offset:d.data.length,side:"after"})})===null?null:{node:d,offset:d.data.length}}function r({event:c}){const u=av({root:e});if(u!==null&&u.kind==="outside-before"){c.preventDefault(),eu({wrapper:u.wrapper,edge:"start"}),n({line:"поле: каретка внутрь (начало)"});return}if(u!==null&&u.kind==="inside"){const p=u.wrapper,g=rD({wrapper:p,root:e});if(g===null)return;const A=MF({wrapper:p});if(g===A){c.preventDefault(),Of({wrapper:p,side:"after"}),n({line:"поле: каретка наружу (после)"});return}if(w1({text:cv({wrapper:p}),offset:g})!==A)return;c.preventDefault(),eu({wrapper:p,edge:"end"});return}const d=s({side:"after"});d!==null&&(c.preventDefault(),qi({node:d.node,offset:d.offset}))}function i({event:c}){const u=av({root:e});if(u!==null&&u.kind==="outside-after"){c.preventDefault(),eu({wrapper:u.wrapper,edge:"end"}),n({line:"поле: каретка внутрь (конец)"});return}if(u!==null&&u.kind==="inside"){const p=u.wrapper,g=rD({wrapper:p,root:e});if(g===null)return;if(g===0){c.preventDefault(),Of({wrapper:p,side:"before"}),n({line:"поле: каретка наружу (до)"});return}if(N1({text:cv({wrapper:p}),offset:g})!==0)return;c.preventDefault(),eu({wrapper:p,edge:"start"});return}const d=s({side:"before"});d!==null&&(c.preventDefault(),qi({node:d.node,offset:d.offset}))}function o(c){if(!(c.key!=="ArrowLeft"&&c.key!=="ArrowRight")&&!c.shiftKey&&!c.ctrlKey&&!c.metaKey&&!c.altKey){if(c.key==="ArrowRight"){r({event:c});return}i({event:c})}}return e.addEventListener("keydown",o),{destroy:()=>{e.removeEventListener("keydown",o)}}}function cv({wrapper:e}){const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(;;){const s=t.nextNode();if(s===null)break;if(!(s instanceof Text))continue;const r=s.parentElement;r!==null&&r.closest(kf)!==null||n.push(s.data)}return n.join("")}function MF({wrapper:e}){return cv({wrapper:e}).length}function iD({value:e,fallback:t}){return e===null?t:e}function U_e({runs:e,startOffset:t,endOffset:n,coveredEmptyFieldIds:s}){const r=Er({runs:e}),i=iD({value:t,fallback:0}),o=iD({value:n,fallback:r}),c=[],u={offset:0};for(const d of e){const p=u.offset,g=p+d.text.length;if(u.offset=g,d.placeholder!==void 0){const x=i<p&&p<o,y=p>=i&&p<=o;if(x){c.push(d);continue}y&&s.has(d.placeholder.id)&&c.push(d);continue}const A=Math.max(i-p,0),E=Math.min(Math.max(o-p,0),d.text.length);E<=A||c.push({...d,text:d.text.slice(A,E)})}return c}function jF({block:e,startOffset:t,endOffset:n,coveredEmptyFieldIds:s}){const{id:r,...i}=e;return{...i,runs:A2e({runs:U_e({runs:g2e({runs:e.runs}),startOffset:t,endOffset:n,coveredEmptyFieldIds:s})})}}function BF({content:e,range:t,coveredEmptyFieldIds:n}){const s=xn({content:e,blockId:t.start.blockId});if(s===null)return null;const r=xn({content:e,blockId:t.end.blockId});if(r===null||s.container.zoneIndex!==r.container.zoneIndex)return null;if(s.container.containerKind===r.container.containerKind&&Jb({found:s})===Jb({found:r}))return[Zb({content:e,sectionIndex:Jb({found:s}),zoneIndex:s.container.zoneIndex,fromBlockIndex:s.blockIndex,toBlockIndex:r.blockIndex,startOffset:t.start.offset,endOffset:t.end.offset,coveredEmptyFieldIds:n})].filter(A=>A!==null);if(s.container.containerKind!=="section"||r.container.containerKind!=="section")return null;const o=e.zones[s.container.zoneIndex];if(o===void 0||o.kind!=="body")return null;const c=s.container.sectionIndex,u=r.container.sectionIndex;if(c>=u)return null;const d=[],p=Zb({content:e,sectionIndex:c,zoneIndex:s.container.zoneIndex,fromBlockIndex:s.blockIndex,toBlockIndex:null,startOffset:t.start.offset,endOffset:null,coveredEmptyFieldIds:n});if(p===null)return null;d.push(p);for(const A of o.items.slice(c+1,u))d.push(z_e({section:A,coveredEmptyFieldIds:n}));const g=Zb({content:e,sectionIndex:u,zoneIndex:r.container.zoneIndex,fromBlockIndex:null,toBlockIndex:r.blockIndex,startOffset:null,endOffset:t.end.offset,coveredEmptyFieldIds:n});return g===null?null:(d.push(g),d)}function Jb({found:e}){return e.container.containerKind==="section"?e.container.sectionIndex:-1}function z_e({section:e,coveredEmptyFieldIds:t}){return{sectionKind:e.sectionKind,...FF({section:e}),blocks:e.children.map(n=>jF({block:n,startOffset:null,endOffset:null,coveredEmptyFieldIds:t}))}}function FF({section:e}){return e.name===void 0?{}:{name:e.name}}function Zb({content:e,zoneIndex:t,sectionIndex:n,fromBlockIndex:s,toBlockIndex:r,startOffset:i,endOffset:o,coveredEmptyFieldIds:c}){const u=e.zones[t];if(u===void 0)return null;const d=Q_e({zone:u,sectionIndex:n});if(d===null)return null;const p=oD({bound:s,fallback:0}),g=oD({bound:r,fallback:d.list.length-1}),A=d.list.slice(p,g+1).map((E,x,y)=>{const I=x===0,v=x===y.length-1;
967return jF({block:E,startOffset:aD({isEdge:I,offset:i}),endOffset:aD({isEdge:v,offset:o}),coveredEmptyFieldIds:c})});return{sectionKind:d.sectionKind,...d.nameField,blocks:A}}function oD({bound:e,fallback:t}){return e===null?t:e}function aD({isEdge:e,offset:t}){return e?t:null}function Q_e({zone:e,sectionIndex:t}){if(e.kind==="body"){const n=e.items[t];return n===void 0?null:{list:n.children,sectionKind:n.sectionKind,nameField:FF({section:n})}}return e.kind==="title"||e.kind==="subtitle"||e.kind==="pleas"?{list:e.blocks,sectionKind:"text",nameField:{}}:null}function H_e({content:e,range:t,coveredEmptyFieldIds:n}){const s=BF({content:e,range:t,coveredEmptyFieldIds:n});return s===null?null:s.flatMap(i=>i.blocks.map(o=>o.runs.map(c=>c.text).join(""))).join(`
968
969`)}function V_e({content:e,range:t,coveredEmptyFieldIds:n}){const s=BF({content:e,range:t,coveredEmptyFieldIds:n});return s===null?null:{version:1,sections:s}}const uv="application/x-plevako-editor";function G_e({root:e,model:t,selectionLayer:n,onLog:s}){function r({line:d}){s!==void 0&&s({line:d})}function i(){const d=new Set;for(const p of dT({root:e})){const g=p.getAttribute("data-placeholder-id");g!==null&&d.add(g)}return d}function o({event:d}){const p=n.readSelection();if(p===null)return!1;const g=p.range;if(g.start.blockId===g.end.blockId&&g.start.offset===g.end.offset){const S=lv({root:e,content:t.getContent(),range:g});if(S===null)return!1;const b=d.clipboardData;if(b===null)return!1;d.preventDefault(),b.setData("text/plain",S.label);const w={version:1,sections:[{sectionKind:"text",blocks:[{type:"paragraph",runs:[{text:S.label}]}]}]};return b.setData("text/html",X9({sections:w.sections})),b.setData(uv,JSON.stringify(w)),!0}const E=t.getContent(),x=i(),y=H_e({content:E,range:g,coveredEmptyFieldIds:x});if(y===null)return!1;const I=V_e({content:E,range:g,coveredEmptyFieldIds:x});if(I===null)return!1;const v=d.clipboardData;return v===null?!1:(d.preventDefault(),v.setData("text/plain",y),v.setData("text/html",X9({sections:I.sections})),v.setData(uv,JSON.stringify(I)),!0)}function c(d){o({event:d})&&r({line:"copy: сериализовано моделью"})}function u(d){const p=uT({root:e}),g=[...i()];if(!o({event:d}))return;const A=n.readSelection();if(A===null)return;const E=lv({root:e,content:t.getContent(),range:A.range});if(E!==null){const I=T1({content:t.getContent(),blockId:E.blockId,placeholderId:E.placeholderId});if(I!==null){t.commit({content:I.content,changes:I.changes,meta:{record:"deletion",selectionBefore:{anchor:A.anchor,focus:A.focus},selectionAfter:{anchor:I.caretPosition,focus:I.caretPosition}}}),n.setCaret({position:I.caretPosition}),r({line:"cut: поле вырезано целиком"});return}}const x=yh({content:t.getContent(),range:A.range});if(x===null){r({line:"cut: удаление неприменимо, буфер заполнен"});return}const y={content:x.content,changes:x.changes};for(const I of g){const v=RF({content:y.content,placeholderId:I});if(v===null)continue;const S=T1({content:y.content,blockId:v,placeholderId:I});S!==null&&(y.content=S.content,y.changes=Qo({a:y.changes,b:S.changes}))}t.commit({content:y.content,changes:y.changes,meta:{record:"deletion",selectionBefore:{anchor:A.anchor,focus:A.focus},selectionAfter:{anchor:x.caretPosition,focus:x.caretPosition}}}),n.setCaret({position:x.caretPosition}),p!==null&&p.kind==="inside"&&fT({root:e,content:y.content,position:x.caretPosition,affinity:{placeholderId:p.placeholderId,side:"inside"}}),r({line:"cut: сериализовано и удалено"})}return e.addEventListener("copy",c),e.addEventListener("cut",u),{destroy:()=>{e.removeEventListener("copy",c),e.removeEventListener("cut",u)}}}function dv({content:e,position:t,text:n,placeholderId:s,afterPlaceholderId:r}){if(n.length===0)return null;const i=xn({content:e,blockId:t.blockId});if(i===null||!uc({runs:i.block.runs,offset:t.offset}))return null;const o=C2e({runs:i.block.runs,offset:t.offset,text:n,placeholderId:s,afterPlaceholderId:r});return o===null?null:{content:da({content:e,container:i.container,startIndex:i.blockIndex,deleteCount:1,buildSectionBlocks:({removed:u})=>[{...u[0],runs:o}],buildAddressBlocks:({removed:u})=>[{...u[0],runs:o}]}),changes:KE({blockId:t.blockId}),caretPosition:{blockId:t.blockId,offset:t.offset+n.length}}}const pT="[data-block-id]",q_e="[data-placeholder-label-view]",W_e="[data-placeholder-pad]",UF=`${q_e}, ${W_e}`;function K_e({node:e}){const t=zF({node:e});return t===null?!1:t.closest(UF)!==null}function zF({node:e}){if(e instanceof Element)return e;const t=e.parentElement;return t===null?null:t}function $_e({node:e}){const t=zF({node:e});if(t===null)return null;const n=t.closest(pT);return n instanceof HTMLElement?n:null}function Y_e({block:e}){const t=[];
969return e.querySelectorAll(UF).forEach(n=>{const s=e.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_TEXT);for(;;){const r=s.nextNode();if(r===null)break;r instanceof Text&&t.push(r)}}),t}function X_e({range:e,labelNode:t,point:n}){return t===n.node?Math.min(n.offset,t.data.length):e.comparePoint(t,0)===1?0:e.comparePoint(t,t.data.length)<=0?t.data.length:0}function J_e({block:e,point:t}){const n=e.ownerDocument.createRange();n.setStart(e,0);try{n.setEnd(t.node,t.offset)}catch{return null}const s=n.toString().length,r=Y_e({block:e}).reduce((i,o)=>i+X_e({range:n,labelNode:o,point:t}),0);return s-r}function Z_e({block:e,point:t}){const n=e.getAttribute("data-block-id");if(n===null)return null;const s=J_e({block:e,point:t});return s===null?null:{blockId:n,offset:s}}function eTe({block:e}){const t=e.getAttribute("data-block-id");return t===null?null:{blockId:t,offset:0}}function tTe({block:e}){const t=e.getAttribute("data-block-id");return t===null?null:{blockId:t,offset:fv({block:e}).length}}function nTe({candidate:e,boundaryNode:t,containerNode:n}){if(t===void 0){const r=n.compareDocumentPosition(e);return(r&Node.DOCUMENT_POSITION_CONTAINED_BY)!==0?!1:(r&Node.DOCUMENT_POSITION_FOLLOWING)!==0}return!!(e===t||t.contains(e)||(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0)}function sTe({root:e,point:t}){const n=[...e.querySelectorAll(pT)];if(n.length===0)return null;const s=t.node.childNodes[t.offset],r=n.find(o=>nTe({candidate:o,boundaryNode:s,containerNode:t.node}));if(r instanceof HTMLElement)return eTe({block:r});const i=n[n.length-1];return i instanceof HTMLElement?tTe({block:i}):null}function gm({root:e,point:t}){if(!e.contains(t.node))return null;const n=$_e({node:t.node});return n!==null?Z_e({block:n,point:t}):sTe({root:e,point:t})}function QF({element:e}){const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(;;){const s=t.nextNode();if(s===null)break;s instanceof Text&&(K_e({node:s})||n.push(s))}return n}function fv({block:e}){return QF({element:e}).map(t=>t.data).join("")}function pv({root:e,blockId:t}){const s=[...e.querySelectorAll(pT)].find(r=>r.getAttribute("data-block-id")===t);return s instanceof HTMLElement?s:null}function lD({root:e,position:t}){if(!Number.isInteger(t.offset)||t.offset<0)return null;const n=pv({root:e,blockId:t.blockId});if(n===null)return null;const s=QF({element:n});if(s.length===0)return t.offset!==0?null:{node:n,offset:0};const r={consumed:0};for(const i of s){const o=i.data.length;if(t.offset<=r.consumed+o)return{node:i,offset:t.offset-r.consumed};r.consumed+=o}return null}function rTe({text:e,index:t}){const n=e.charCodeAt(t);return n>=55296&&n<=56319}function iTe({text:e,index:t}){const n=e.charCodeAt(t);return n>=56320&&n<=57343}function oTe({before:e,after:t}){const n=Math.min(e.length,t.length),s={length:0};for(;s.length<n&&e[s.length]===t[s.length];)s.length+=1;return s.length>0&&rTe({text:e,index:s.length-1})&&(s.length-=1),s.length}function aTe({before:e,after:t,prefixLength:n}){const s=Math.min(e.length,t.length)-n,r={length:0};for(;r.length<s;){const o=e.length-1-r.length,c=t.length-1-r.length;if(e[o]!==t[c])break;r.length+=1}const i=e.length-r.length;return r.length>0&&iTe({text:e,index:i})&&(r.length-=1),r.length}function nA({before:e,after:t}){if(e===t)return null;const n=oTe({before:e,after:t}),s=aTe({before:e,after:t,prefixLength:n});return{start:n,deletedLength:e.length-n-s,insertedText:t.slice(n,t.length-s)}}const cD=/[\n\r\u2028\u2029]/g;function wA({position:e}){return{anchor:e,focus:e}}function lTe({caretPosition:e}){if(e!==null)return wA({position:e})}function cTe({content:e,blockId:t}){const n=xn({content:e,blockId:t});return n===null?null:n.block.runs.map(s=>s.text).join("")}function uTe({root:e}){const n=e.ownerDocument.getSelection();return n===null||n.focusNode===null?null:gm({root:e,point:{node:n.focusNode,offset:n.focusOffset}})}function dTe({root:e,model:t,selectionLayer:n,onLog:s,onParityIssue:r}){const i={isComposing:!1,compositionBlockId:null,isReconciling:!1};function o({line:w}){s!==void 0&&s({line:w})}function c({line:w}){if(r===void 0){o({line:`PARITY: ${w}`});return}r({line:w})}function u({blockId:w,blockElement:_}){const N=[..._.querySelectorAll("[data-placeholder-id]")];
969for(const R of N){if(!(R instanceof HTMLElement))continue;const D=R.getAttribute("data-placeholder-id");if(D===null)continue;const k=d({wrapper:R});if(k===null)continue;if(A({wrapper:R}),y.takeRecords(),k.text.length===0)return o({line:`сервисный текст поля восстановлен в блоке ${w}`}),!0;const L=t.getContent(),O=xn({content:L,blockId:w});if(O===null)return!0;const P=Cc({runs:O.block.runs,placeholderId:D});if(P===null)return!0;const B=g({chain:P,spot:k.spot}),F=dv({content:L,position:{blockId:w,offset:B},text:k.text.replace(cD," "),placeholderId:D});return F===null||(t.commit({content:F.content,changes:F.changes,meta:{record:"typing",selectionBefore:wA({position:{blockId:w,offset:B}}),selectionAfter:wA({position:F.caretPosition})}}),n.setCaret({position:F.caretPosition}),fT({root:e,content:F.content,position:F.caretPosition,affinity:{placeholderId:D,side:"inside"}}),o({line:`добор в поле ${w}: «${k.text}»`})),!0}return!1}function d({wrapper:w}){const _=w.getAttribute("data-placeholder-label"),N=w.querySelector("[data-placeholder-label-view]");if(N!==null&&_!==null){const L=p({node:N});if(L!==_){const O=nA({before:_,after:L});if(O!==null)return{text:O.insertedText,spot:"label"}}}const R=" ",D=w.firstChild;if(D instanceof HTMLElement&&p({node:D})!==R){const L=nA({before:R,after:p({node:D})});if(L!==null)return{text:L.insertedText,spot:"left-pad"}}const k=w.lastChild;if(k instanceof HTMLElement&&p({node:k})!==R){const L=nA({before:R,after:p({node:k})});if(L!==null)return{text:L.insertedText,spot:"right-pad"}}return null}function p({node:w}){const _=w.textContent;return _===null?"":_}function g({chain:w,spot:_}){return _==="right-pad"?w.endOffset:w.startOffset}function A({wrapper:w}){const N=w.querySelector("[data-placeholder-label-view]"),R=w.getAttribute("data-placeholder-label");N!==null&&R!==null&&(N.textContent=R);const D=w.firstChild;D instanceof HTMLElement&&p({node:D})!==" "&&(D.textContent=" ");const k=w.lastChild;k instanceof HTMLElement&&p({node:k})!==" "&&(k.textContent=" ")}function E({blockId:w}){const _=pv({root:e,blockId:w});if(_===null)return!1;if(u({blockId:w,blockElement:_}))return!0;const N=t.getContent(),R=cTe({content:N,blockId:w});if(R===null)return!1;const k=fv({block:_}).replace(cD," "),L=nA({before:R,after:k});if(L===null)return!1;const O=uTe({root:e}),P={current:{content:N,changes:bh}};if(L.deletedLength>0){const B=_1({content:P.current.content,range:{start:{blockId:w,offset:L.start},end:{blockId:w,offset:L.start+L.deletedLength}}});if(B===null)return c({line:`добор не применился (delete) в блоке ${w}`}),!1;P.current={content:B.content,changes:B.changes}}if(L.insertedText.length>0){const B=dv({content:P.current.content,position:{blockId:w,offset:L.start},text:L.insertedText});if(B===null)return c({line:`добор не применился (insert) в блоке ${w}`}),!1;P.current={content:B.content,changes:Qo({a:P.current.changes,b:B.changes})}}return t.commit({content:P.current.content,changes:P.current.changes,meta:{record:"typing",selectionBefore:wA({position:{blockId:w,offset:L.start}}),selectionAfter:lTe({caretPosition:O})}}),O!==null&&n.setCaret({position:O}),o({line:`добор блока ${w}: «${L.insertedText}»`}),!0}function x(){const _=t.getContent().zones.find(N=>N.kind==="body");if(_!==void 0&&_.kind==="body")for(const N of _.items)for(const R of N.children){const D=pv({root:e,blockId:R.id});if(D===null){c({line:`блок ${R.id} отсутствует в DOM`});continue}const k=R.runs.map(O=>O.text).join(""),L=fv({block:D});L!==k&&c({line:`тексты разошлись в блоке ${R.id}: модель «${k}», DOM «${L}»`})}}const y=new MutationObserver(w=>{if(i.isComposing)return;const _=new Set,N={value:!1};for(const R of w){const D=R.target,k=I({node:D});if(k===null){N.value=!0;continue}if(k.closest('[contenteditable="false"]')!==null)continue;const L=k.closest("[data-block-id]");if(L===null){N.value=!0;continue}const O=L.getAttribute("data-block-id");O!==null&&_.add(O)}i.isReconciling=!0;for(const R of _)E({blockId:R});i.isReconciling=!1,x(),N.value&&c({line:"структурная мутация DOM мимо роутера (починка — этап интеграции)"})});function I({node:w}){if(w instanceof Element)return w;const _=w.parentElement;return _===null?null:_}y.observe(e,{subtree:!0,childList:!0,characterData:!0}
969);const v=t.subscribe({onChange:()=>{y.takeRecords(),!i.isReconciling&&x()}});function S(){i.isComposing=!0;const w=n.readSelection();if(w===null){i.compositionBlockId=null;return}i.compositionBlockId=w.range.start.blockId}function b(){const w=i.compositionBlockId;i.compositionBlockId=null,setTimeout(()=>{i.isComposing=!1;const _=y.takeRecords(),N=new Set;w!==null&&N.add(w);for(const R of _){const D=I({node:R.target});if(D===null||D.closest('[contenteditable="false"]')!==null)continue;const k=D.closest("[data-block-id]");if(k===null)continue;const L=k.getAttribute("data-block-id");L!==null&&N.add(L)}i.isReconciling=!0;for(const R of N)E({blockId:R});i.isReconciling=!1,x()},0)}return e.addEventListener("compositionstart",S),e.addEventListener("compositionend",b),{isComposing:()=>i.isComposing,destroy:()=>{y.disconnect(),v(),e.removeEventListener("compositionstart",S),e.removeEventListener("compositionend",b)}}}function hT({source:e,id:t,runs:n}){if(e.type==="listItem"){const{startNumber:s,...r}=e;return{...r,id:t,runs:n}}return{...e,id:t,runs:n}}function fTe({source:e,id:t,runs:n}){if(e.type==="listItem"){const{startNumber:s,...r}=e;return{...r,id:t,runs:n}}return{...e,id:t,runs:n}}function uD({content:e,position:t,newBlockId:n,headPlaceholderId:s}){const r=xn({content:e,blockId:t.blockId});if(r===null||!uc({runs:r.block.runs,offset:t.offset})||eT({runs:r.block.runs,offset:t.offset}))return null;const i=pTe({newBlockId:n}),{before:o,after:c}=tT({runs:r.block.runs,offset:t.offset,headPlaceholderId:s});return{content:da({content:e,container:r.container,startIndex:r.blockIndex,deleteCount:1,buildSectionBlocks:({removed:d})=>[{...d[0],runs:o},hT({source:d[0],id:i,runs:c})],buildAddressBlocks:({removed:d})=>[{...d[0],runs:o},fTe({source:d[0],id:i,runs:c})]}),changes:Z_({found:r,nodeIds:[t.blockId,i]}),newBlockId:i,caretPosition:{blockId:i,offset:0}}}function pTe({newBlockId:e}){return e===void 0?eg():e}function dD({content:e,position:t,blocks:n}){if(n.length===0)return null;const s=xn({content:e,blockId:t.blockId});if(s===null||s.containerZoneKind==="address"||!uc({runs:s.block.runs,offset:t.offset})||eT({runs:s.block.runs,offset:t.offset}))return null;const{before:r,after:i}=tT({runs:s.block.runs,offset:t.offset});if(n.length===1){const A=Gs({runs:[...r,...n[0].runs,...i]});return{content:da({content:e,container:s.container,startIndex:s.blockIndex,deleteCount:1,buildSectionBlocks:({removed:x})=>[{...x[0],runs:A}],buildAddressBlocks:({removed:x})=>x}),changes:KE({blockId:t.blockId}),caretPosition:{blockId:t.blockId,offset:t.offset+Er({runs:n[0].runs})}}}const o=n[0],c=n[n.length-1],u=n.slice(1,-1),d=Gs({runs:[...r,...o.runs]}),p=Gs({runs:[...c.runs,...i]});return{content:da({content:e,container:s.container,startIndex:s.blockIndex,deleteCount:1,buildSectionBlocks:({removed:A})=>[{...A[0],runs:d},...u,hT({source:A[0],id:c.id,runs:p})],buildAddressBlocks:({removed:A})=>A}),changes:Z_({found:s,nodeIds:[t.blockId,...u.map(A=>A.id),c.id]}),caretPosition:{blockId:c.id,offset:Er({runs:c.runs})}}}function hTe({content:e,blockId:t}){const n=xn({content:e,blockId:t});if(n===null||n.blockIndex===0)return null;const s=n.siblings[n.blockIndex-1],r=Er({runs:s.runs});return{content:da({content:e,container:n.container,startIndex:n.blockIndex-1,deleteCount:2,buildSectionBlocks:({removed:o})=>[{...o[0],runs:Gs({runs:[...o[0].runs,...o[1].runs]})}],buildAddressBlocks:({removed:o})=>[{...o[0],runs:Gs({runs:[...o[0].runs,...o[1].runs]})}]}),changes:Z_({found:n,nodeIds:[s.id,t]}),caretPosition:{blockId:s.id,offset:r}}}function mT({nodeIds:e}){return{changedNodeIds:[...e],changedZoneKinds:["body"]}}function mTe({section:e}){return[e.id,...e.children.map(t=>t.id)]}function HF({usedIds:e,candidateIds:t}){const n=new Set;for(const s of t){if(e.has(s)||n.has(s))return!0;n.add(s)}return!1}function gTe({content:e,section:t,afterSectionId:n}){const s=iT({content:e});if(HF({usedIds:s,candidateIds:mTe({section:t})})||n!==null&&TF({content:e,sectionId:n})===null)return null;const r=$E({content:e,buildItems:({items:i})=>{if(n===null)return[t,...i];const o=i.findIndex(c=>c.id===n);return[...i.slice(0,o+1),t,...i.slice(o+1)]}});return r===null?null:{content:r,changes:mT({nodeIds:[t.id]})}}function ATe({content:e,sectionId:t,children:n}){const s=TF({content:e,sectionId:t});if(s===null)return null;const r=iT({content:e});
969if(s.section.children.forEach(o=>{r.delete(o.id)}),HF({usedIds:r,candidateIds:n.map(o=>o.id)}))return null;const i=yTe({content:e,sectionId:t,nextSection:{...s.section,children:n}});return i===null?null:{content:i,changes:{changedNodeIds:[t],changedZoneKinds:[]}}}function ETe({content:e,position:t,newSectionId:n,newBlockId:s,headPlaceholderId:r}){const i=s_e({content:e,blockId:t.blockId});if(i===null||!uc({runs:i.block.runs,offset:t.offset})||eT({runs:i.block.runs,offset:t.offset}))return null;const o=fD({provided:n}),c=Er({runs:i.block.runs}),u=t.offset===0,d=i.blockIndex<i.section.children.length-1;if(u||t.offset===c&&d)return xTe({content:e,found:i,tailSectionId:o,isAtParagraphStart:u});const p=fD({provided:s}),{before:g,after:A}=tT({runs:i.block.runs,offset:t.offset,headPlaceholderId:r}),E=[...i.section.children.slice(0,i.blockIndex),{...i.block,runs:g}],x=[hT({source:i.block,id:p,runs:A}),...i.section.children.slice(i.blockIndex+1)],y={id:o,sectionKind:"text",children:x},I=$E({content:e,buildItems:({items:v})=>[...v.slice(0,i.sectionIndex),{...i.section,children:E},y,...v.slice(i.sectionIndex+1)]});return I===null?null:{content:I,changes:mT({nodeIds:[i.section.id,o,t.blockId,p]}),newSectionId:o,caretPosition:{blockId:p,offset:0}}}function fD({provided:e}){return e===void 0?eg():e}function xTe({content:e,found:t,tailSectionId:n,isAtParagraphStart:s}){const r=CTe({found:t,isAtParagraphStart:s}),i=t.section.children.slice(0,r),o=t.section.children.slice(r),c=o[0];if(c===void 0)return null;const u={id:n,sectionKind:"text",children:o},d=$E({content:e,buildItems:({items:p})=>[...p.slice(0,t.sectionIndex),{...t.section,children:i},u,...p.slice(t.sectionIndex+1)]});return d===null?null:{content:d,changes:mT({nodeIds:[t.section.id,n,c.id]}),newSectionId:n,caretPosition:{blockId:c.id,offset:0}}}function CTe({found:e,isAtParagraphStart:t}){return t?e.blockIndex:e.blockIndex+1}function yTe({content:e,sectionId:t,nextSection:n}){return $E({content:e,buildItems:({items:s})=>s.map(r=>r.id!==t?r:n)})}function hv(e){return!(e===null||typeof e!="object"||Array.isArray(e))}function bTe({raw:e}){try{return JSON.parse(e)}catch{return null}}function ITe({run:e}){if(e.text.length===0&&e.placeholder!==void 0)return null;const t={text:e.text};return e.formats!==void 0&&(t.formats=e.formats),e.fontId!==void 0&&(t.fontId=e.fontId),t}function STe({block:e}){const t=[];for(const n of e.runs){const s=ITe({run:n});s!==null&&t.push(s)}return{...e,runs:Gs({runs:t})}}function vTe({value:e}){if(!hv(e))return null;const t={...e,id:eg()};if(!xF(t))return null;for(const n of t.runs)if(yF.test(n.text))return null;return STe({block:t})}function _Te({raw:e}){const t=bTe({raw:e});if(!hv(t)||t.version!==1||!Array.isArray(t.sections))return null;const n=[];for(const s of t.sections){if(!hv(s)||typeof s.sectionKind!="string"||!Array.isArray(s.blocks))return null;for(const r of s.blocks){const i=vTe({value:r});if(i===null)return null;n.push(i)}}return n.length===0?null:n}const TTe=["urn:schemas-microsoft-com","mso-","MsoNormal","MsoList"];function NTe({html:e}){for(const t of TTe)if(e.includes(t))return!0;return!1}function XE({element:e}){const t=e.getAttribute("style");return t===null?"":t}function VF({element:e}){const t=XE({element:e});return t.includes("mso-list")?!!t.includes("Ignore"):!1}function wTe({element:e}){if(e.tagName.toLowerCase()!=="p")return!1;if(XE({element:e}).includes("mso-list"))return!0;const t=e.getAttribute("class");return t===null?!1:!!t.includes("MsoListParagraph")}function RTe({paragraph:e}){for(const t of[...e.querySelectorAll("span")]){if(!VF({element:t}))continue;const n=DTe({raw:t.textContent}),s=/^(\d+)[.)]/.exec(n);return s!==null?{listKind:"ordered",startNumber:Number.parseInt(s[1],10)}:/^[a-zа-яё][.)]/i.test(n)?{listKind:"ordered",startNumber:null}:{listKind:"bullet",startNumber:null}}return{listKind:"bullet",startNumber:null}}function DTe({raw:e}){return e===null?"":e.trim()}function kTe({paragraph:e}){for(const t of[...e.querySelectorAll("span")])VF({element:t})&&t.remove()}const OTe=["p","h1","h2","h3","h4","h5","h6","li","div","span"],PTe=/(?:^|;)\s*font-family\s*:/i,LTe=/(?:^|;)\s*font-family\s*:\s*([^;]+)/i;function MTe({document:e}){const t=[];for(const n of[...e.querySelectorAll("style")]){const s=n.textContent;s!==null&&t.push(s)}return t.join(`
970`).replace(/<!--|-->/g,"").replace(/\/\*[\s\S]*?\*\//g,"")}function jTe({css:e}){const t=new Map;for(const n of e.matchAll(/([^{}]+)\{([^{}]*)\}/g)){const s=n[1];if(s.includes("@"))continue;const r=LTe.exec(n[2]);if(r===null)continue;const i=r[1].trim();if(i.length!==0)for(const o of s.split(",")){const c=o.trim();c.length!==0&&t.set(c,i)}}return t}function BTe({map:e,element:t}){const n=t.tagName.toLowerCase(),s=t.getAttribute("class");if(s!==null)for(const i of s.trim().split(/\s+/)){if(i.length===0)continue;const o=e.get(`${n}.${i}`);if(o!==void 0)return o;const c=e.get(`.${i}`);if(c!==void 0)return c}const r=e.get(n);return r!==void 0?r:null}function FTe({raw:e,declaration:t}){return e.length===0?t:e.trimEnd().endsWith(";")?`${e}${t}`:`${e};${t}`}function UTe({document:e}){const t=MTe({document:e});if(t.length===0)return;const n=jTe({css:t});if(n.size!==0)for(const s of[...e.querySelectorAll(OTe.join(","))]){const r=XE({element:s});if(PTe.test(r))continue;const i=BTe({map:n,element:s});i!==null&&s.setAttribute("style",FTe({raw:r,declaration:`font-family:${i}`}))}}function zTe({document:e}){const t=[...e.querySelectorAll("*")].filter(n=>n.tagName.includes(":"));for(const n of t){const s=n.parentNode;if(s!==null){for(;n.firstChild!==null;)s.insertBefore(n.firstChild,n);n.remove()}}}function QTe({paragraph:e,document:t}){const n=RTe({paragraph:e});kTe({paragraph:e});const s=t.createElement("li"),r=XE({element:e}),i=[],o=/text-align:\s*(left|center|right|justify)/.exec(r);o!==null&&i.push(`text-align:${o[1]}`);const c=/(?:^|;)\s*(font-family\s*:[^;]+)/i.exec(r);for(c!==null&&i.push(c[1]),i.length>0&&s.setAttribute("style",i.join(";"));e.firstChild!==null;)s.append(e.firstChild);return{item:s,marker:n}}function HTe({document:e}){const t=[...e.querySelectorAll("p")].filter(s=>wTe({element:s})),n={list:null,listKind:null,previous:null};for(const s of t){const{item:r,marker:i}=QTe({paragraph:s,document:e}),o=GTe({previous:n.previous,current:s});if(n.list===null||!o||n.listKind!==i.listKind){const d=e.createElement(VTe({listKind:i.listKind}));i.listKind==="ordered"&&i.startNumber!==null&&i.startNumber>1&&d.setAttribute("start",String(i.startNumber)),s.replaceWith(d),d.append(r),n.list=d,n.listKind=i.listKind,n.previous=d;continue}const u=n.list;u!==null&&(s.remove(),u.append(r),n.previous=u)}}function VTe({listKind:e}){return e==="ordered"?"ol":"ul"}function GTe({previous:e,current:t}){if(e===null)return!1;const n={node:e.nextSibling};for(;n.node!==null;){if(n.node===t)return!0;
970if(n.node.nodeType===8){n.node=n.node.nextSibling;continue}if(n.node.nodeType===3){const s=n.node.textContent;if(s!==null&&s.trim().length===0){n.node=n.node.nextSibling;continue}return!1}return!1}return!1}function qTe({document:e}){UTe({document:e}),zTe({document:e}),HTe({document:e})}const pD=8,WTe=2,KTe=40,$Te=36,YTe={bold:!1,italic:!1,underline:!1,highlight:!1,fontId:null};function P1(e){return e.nodeType===1}function GF(e){return e.nodeType===3}function gT({element:e}){return e.style}function XTe({value:e,inherited:t}){if(e==="")return t;if(e==="bold"||e==="bolder")return!0;if(e==="normal"||e==="lighter")return!1;const n=Number.parseInt(e,10);return Number.isNaN(n)?t:n>=600}function JTe({value:e,inherited:t}){return e===""?t:e==="italic"||e==="oblique"}function ZTe({value:e,inherited:t}){return e===""?t:e.includes("underline")?!0:e.includes("none")?!1:t}const e5e=new Set(["","transparent","initial","inherit","unset","white","#fff","#ffffff","rgb(255, 255, 255)"]);function t5e({value:e,inherited:t}){return e5e.has(e.toLowerCase())?t:!0}function n5e({value:e}){const t=e.toLowerCase();return t.includes("times")?"times_new_roman":t.includes("arial")||t.includes("helvetica")?"arial":null}function Jd({element:e,state:t}){const n=e.tagName.toLowerCase(),s={...t};n==="b"&&(s.bold=!0),n==="strong"&&(s.bold=!0),n==="i"&&(s.italic=!0),n==="em"&&(s.italic=!0),n==="u"&&(s.underline=!0),n==="mark"&&(s.highlight=!0);const r=gT({element:e});s.bold=XTe({value:r.fontWeight,inherited:s.bold}),s.italic=JTe({value:r.fontStyle,inherited:s.italic}),s.underline=ZTe({value:s5e({style:r}),inherited:s.underline}),s.highlight=t5e({value:r.backgroundColor,inherited:s.highlight});const i=n5e({value:r.fontFamily});return i!==null&&(s.fontId=i),s}function s5e({style:e}){const t=e.textDecorationLine;return t!==""?t:e.textDecoration}function AT({text:e,state:t}){const n={text:e},s=[];return t.bold&&s.push("bold"),t.italic&&s.push("italic"),t.underline&&s.push("underline"),t.highlight&&s.push("highlight"),s.length>0&&(n.formats=s),t.fontId!==null&&(n.fontId=t.fontId),n}function r5e({element:e}){const t=gT({element:e}).textAlign;for(const n of W_)if(t===n)return n;return null}function i5e({element:e}){const t=gT({element:e}).marginLeft;if(t==="")return 0;const n=Number.parseFloat(t);if(Number.isNaN(n)||n<=0)return 0;const s=o5e({value:t}),r=Math.round(n/s);return r<0?0:r>pD?pD:r}function o5e({value:e}){return e.endsWith("em")?WTe:e.endsWith("pt")?$Te:KTe}function a5e({tag:e}){const t=/^h([1-6])$/.exec(e);if(t===null)return null;const n=Number.parseInt(t[1],10);for(const s of Bh)if(n===s)return s;return Bh[Bh.length-1]}function Zd({element:e,base:t}){const n={...t,runs:[]},s=r5e({element:e});s!==null&&s!=="left"&&(n.align=s);const r=i5e({element:e});return r>0&&(n.indent=r),n}function ef({node:e,state:t,output:n,openDraftTemplate:s}){if(GF(e)){const o=e.data.replace(/\s+/g," ");if(o.length===0)return;n.open===null&&(n.open=s(),n.drafts.push(n.open)),n.open.runs.push(AT({text:o,state:t}));return}if(!P1(e))return;const r=e.tagName.toLowerCase();if(r==="br"){n.open=null;return}if(r==="img"||r==="script"||r==="style")return;const i=Jd({element:e,state:t});for(const o of[...e.childNodes])ef({node:o,state:i,output:n,openDraftTemplate:s})}function l5e({draft:e}){const t=[],n={endsWithSpace:!0};for(const i of e.runs){const o=c5e({text:i.text,isAfterSpace:n.endsWithSpace});
970o.length!==0&&(n.endsWithSpace=o.endsWith(" "),t.push({...i,text:o}))}if(t.length>0){const i=t.length-1;t[i]={...t[i],text:t[i].text.replace(/\s+$/,"")}}const s=Gs({runs:t.filter(i=>i.text.length>0)});return s.some(i=>i.text.length>0)?{...e,runs:s}:null}function c5e({text:e,isAfterSpace:t}){return t?e.replace(/^\s+/,""):e}function mv({element:e,state:t,output:n}){const s=e.tagName.toLowerCase(),r=RA({tag:s});if(r===null)return;const o={start:u5e({element:e,listKind:r})};for(const c of[...e.childNodes]){if(!P1(c))continue;const u=c.tagName.toLowerCase();if(u==="li"){const d={type:"listItem",listKind:r,...qF({start:o.start})};o.start=void 0;const p=Zd({element:c,base:d});n.drafts.push(p),n.open=p;const g=Jd({element:c,state:t});for(const A of[...c.childNodes]){if(P1(A)&&RA({tag:A.tagName.toLowerCase()})!==null){mv({element:A,state:g,output:n});continue}ef({node:A,state:g,output:n,openDraftTemplate:()=>Zd({element:c,base:d})})}n.open=null;continue}RA({tag:u})!==null&&mv({element:c,state:t,output:n})}n.open=null}function RA({tag:e}){return e==="ol"?"ordered":e==="ul"?"bullet":null}function u5e({element:e,listKind:t}){if(t!=="ordered")return;const n=e.getAttribute("start");if(n===null)return;const s=Number.parseInt(n,10);if(!Number.isNaN(s)&&!(s<1)&&s!==1)return s}function qF({start:e}){return e===void 0?{}:{startNumber:e}}function d5e({element:e,state:t,output:n}){for(const s of[...e.querySelectorAll("tr")]){const r=[];for(const o of[...s.children]){const c=o.textContent;if(c===null)continue;const u=c.replace(/\s+/g," ").trim();u.length!==0&&r.push(u)}const i=r.join(" ");i.length!==0&&n.drafts.push({type:"paragraph",runs:[AT({text:i,state:t})]})}n.open=null}const f5e=new Set(["div","section","article","main","header","footer","blockquote","body"]),p5e=new Set(["p","h1","h2","h3","h4","h5","h6","ul","ol","li","table","div","blockquote","pre","section","article"]);function h5e({element:e}){for(const t of[...e.children])if(p5e.has(t.tagName.toLowerCase()))return!0;return!1}function gv({node:e,state:t,output:n}){if(GF(e)){ef({node:e,state:t,output:n,openDraftTemplate:()=>({type:"paragraph",runs:[]})});return}if(!P1(e))return;const s=e.tagName.toLowerCase();if(s==="script"||s==="style"||s==="img")return;if(s==="p"){n.open=null;const i={type:"paragraph"},o=Zd({element:e,base:i});n.drafts.push(o),n.open=o;for(const c of[...e.childNodes])ef({node:c,state:Jd({element:e,state:t}),output:n,openDraftTemplate:()=>Zd({element:e,base:i})});n.open=null;return}const r=a5e({tag:s});if(r!==null){n.open=null;const i={type:"heading",level:r},o=Zd({element:e,base:i});n.drafts.push(o),n.open=o;for(const c of[...e.childNodes])ef({node:c,state:Jd({element:e,state:t}),output:n,openDraftTemplate:()=>Zd({element:e,base:i})});n.open=null;return}if(RA({tag:s})!==null){n.open=null,mv({element:e,state:t,output:n});return}if(s==="table"){n.open=null,d5e({element:e,state:t,output:n});return}if(s==="pre"){n.open=null;const i=e.textContent;if(i===null)return;const o=i.replace(/\s+/g," ").trim();o.length>0&&n.drafts.push({type:"paragraph",runs:[AT({text:o,state:t})]});return}if(s==="br"){n.open=null;return}if(f5e.has(s)){const i=Jd({element:e,state:t});for(const o of[...e.childNodes])gv({node:o,state:i,output:n});n.open=null;return}if(h5e({element:e})){const i=Jd({element:e,state:t});for(const o of[...e.childNodes])gv({node:o,state:i,output:n});n.open=null;return}ef({node:e,state:t,output:n,openDraftTemplate:()=>({type:"paragraph",runs:[]})})}function m5e({draft:e}){const t=eg();return e.type==="heading"?{id:t,type:"heading",level:g5e({draft:e}),...eI({draft:e}),...tI({draft:e}),runs:e.runs}:e.type==="listItem"?{id:t,type:"listItem",listKind:A5e({draft:e}),...qF({start:e.startNumber}),...eI({draft:e}),...tI({draft:e}),runs:e.runs}:{id:t,type:"paragraph",...eI({draft:e}),...tI({draft:e}),runs:e.runs}}function g5e({draft:e}){return e.level!==void 0?e.level:Bh[0]}function A5e({draft:e}){return e.listKind!==void 0?e.listKind:"bullet"}function eI({draft:e}){return e.align===void 0?{}:{align:e.align}}function tI({draft:e}){return e.indent===void 0?{}:{indent:e.indent}}function E5e({html:e}){const t=new DOMParser().parseFromString(e,"text/html");NTe({html:e})&&qTe({document:t});const n={drafts:[],open:null};gv({node:t.body,state:YTe,output:n});const s=[];for(const r of n.drafts){const i=l5e({draft:r});i!==null&&s.push(m5e({draft:i}))}return s.length===0?null:s}function nI({content:e,blockId:t}){const n=xn({content:e,blockId:t});return n===null?null:n.block.runs.map(s=>s.text).join("")}function hD({range:e}){return e.start.blockId===e.end.blockId}function ph({content:e,range:t}){if(t.start.blockId===t.end.blockId)return t.start.offset===t.end.offset?"collapsed":"singleBlock";const n=xn({content:e,blockId:t.start.blockId});if(n===null)return"unknown";const s=xn({content:e,blockId:t.end.blockId});return s===null?"unknown":n.container.zoneIndex!==s.container.zoneIndex?"crossZone":n.container.containerKind==="section"&&s.container.containerKind==="section"&&n.container.sectionIndex!==s.container.sectionIndex?"crossSection":"sameContainer"}function x5e({caret:e,boundary:t,direction:n}){return n==="backward"?{start:{blockId:e.blockId,offset:t},end:e}:{start:e,end:{blockId:e.blockId,offset:t}}}function sI({text:e}){return e.replace(/\r\n?/g,`
971`).split(/\n+/)}function C5e({context:e,startContext:t}){return e!==null&&e.kind==="inside"?{placeholderId:e.placeholderId}:e!==null&&e.kind==="outside-after"?{afterPlaceholderId:e.placeholderId}:t!==null&&t.kind==="outside-after"?{afterPlaceholderId:t.placeholderId}:{}}function y5e({context:e,startContext:t}){return e!==null?{placeholderId:e.placeholderId,side:e.kind}:t===null?null:{placeholderId:t.placeholderId,side:t.kind}}function b5e({direction:e,kind:t}){return t==="inside"||e==="backward"&&t==="outside-after"||e==="forward"&&t==="outside-before"}function I5e({context:e}){if(e!==null&&e.kind==="outside-after")return e.placeholderId}function S5e({direction:e}){return e==="backward"?"outside-after":"outside-before"}function v5e({content:e,position:t,placeholderId:n,direction:s}){const r=xn({content:e,blockId:t.blockId});if(r===null)return!1;const i=Cc({runs:r.block.runs,placeholderId:n});return i===null?!1:s==="backward"&&t.offset===i.startOffset||s==="forward"&&t.offset===i.endOffset}function _5e({index:e,hints:t}){return e>0?{}:t}function T5e({root:e,model:t,selectionLayer:n,onLog:s,pickPendingRunStyle:r,onHistoryUndo:i,onHistoryRedo:o}){function c({line:M}){s!==void 0&&s({line:M})}const u={affinity:null,deletionFallbackSide:null};function d(){const M=n.readSelection();if(M!==null)return{anchor:M.anchor,focus:M.focus}}function p({flow:M,record:K}){t.commit({content:M.content,changes:M.changes,meta:{record:K,selectionBefore:d(),selectionAfter:{anchor:M.caretPosition,focus:M.caretPosition}}}),n.setCaret({position:M.caretPosition});const W=u.affinity;if(W!==null){fT({root:e,content:M.content,position:M.caretPosition,affinity:W});return}const H=u.deletionFallbackSide;H!==null&&B_e({root:e,content:M.content,position:M.caretPosition,side:H})}function g({blockId:M,placeholderId:K}){const W=T1({content:t.getContent(),blockId:M,placeholderId:K});if(W===null){c({line:"удаление поля неприменимо"});return}p({flow:{content:W.content,changes:W.changes,caretPosition:W.caretPosition}
971,record:"deletion"}),c({line:"поле удалено целиком"})}function A(){const M=e.ownerDocument.getSelection();return!!(M===null||M.isCollapsed)}function E(){const M=[];for(const K of dT({root:e})){const W=K.getAttribute("data-placeholder-id");W!==null&&(M.includes(W)||M.push(W))}return M}function x({content:M,changes:K,coveredFieldIds:W}){const H={content:M,changes:K};for(const j of W){const q=RF({content:H.content,placeholderId:j});if(q===null)continue;const G=T1({content:H.content,blockId:q,placeholderId:j});G!==null&&(H.content=G.content,H.changes=Qo({a:H.changes,b:G.changes}))}return H}function y({selection:M}){const K=M.range,W=t.getContent(),H=E(),j=ph({content:W,range:K});if(j==="collapsed"){if(H.length>0){const $=x({content:W,changes:bh,coveredFieldIds:H});return{content:$.content,changes:$.changes,caretPosition:K.start}}return{content:W,changes:bh,caretPosition:K.start}}if(j==="crossZone"||j==="unknown")return c({line:"правки через границы зон в v1 погашены"}),null;if(j==="crossSection")return null;const q=yh({content:W,range:K});if(q===null)return null;const G=x({content:q.content,changes:q.changes,coveredFieldIds:H});return{content:G.content,changes:G.changes,caretPosition:q.caretPosition}}function I({selection:M}){const K=yh({content:t.getContent(),range:M.range});return K===null?(c({line:"межблоковое удаление неприменимо (шов блоков?)"}),null):(p({flow:{content:K.content,changes:K.changes,caretPosition:K.caretPosition},record:"deletion"}),{content:K.content,changes:bh,caretPosition:K.caretPosition})}function v({flow:M,text:K,hints:W}){const H=sI({text:K}),j={current:M};for(const[q,G]of H.entries()){if(q>0){const J=uD({content:j.current.content,position:j.current.caretPosition});if(J===null)return null;j.current={content:J.content,changes:Qo({a:j.current.changes,b:J.changes}),caretPosition:J.caretPosition}}if(G.length===0)continue;const $=dv({content:j.current.content,position:j.current.caretPosition,text:G,..._5e({index:q,hints:W})});if($===null)return null;j.current={content:$.content,changes:Qo({a:j.current.changes,b:$.changes}),caretPosition:$.caretPosition}}return j.current}function S({selection:M,text:K,hints:W}){if(W.placeholderId!==void 0&&sI({text:K}).length>1){c({line:"многострочная вставка внутрь поля погашена"});return}if(ph({content:t.getContent(),range:M.range})==="crossSection"){const G=I({selection:M});if(G===null)return;const $=v({flow:G,text:K,hints:{}});if($===null)return;p({flow:$,record:"typing"});return}const j=y({selection:M});if(j===null)return;const q=v({flow:j,text:K,hints:W});if(q===null){c({line:"вставка текста неприменима"});return}p({flow:w({insertStart:j.caretPosition,flow:q,text:K}),record:"typing"})}function b({selection:M,blocks:K,hints:W}){if(W.placeholderId!==void 0)return!1;if(ph({content:t.getContent(),range:M.range})==="crossSection"){const G=I({selection:M});if(G===null)return!0;const $=dD({content:G.content,position:G.caretPosition,blocks:K});return $===null?(c({line:"вставка фрагмента после межблокового удаления неприменима"}),!0):(p({flow:{content:$.content,changes:$.changes,caretPosition:$.caretPosition},record:"structure"}),!0)}const j=y({selection:M});if(j===null)return!0;const q=dD({content:j.content,position:j.caretPosition,blocks:K});return q===null?!1:(p({flow:{content:q.content,changes:Qo({a:j.changes,b:q.changes}),caretPosition:q.caretPosition},record:"structure"}),!0)}function w({insertStart:M,flow:K,text:W}){if(r===void 0||sI({text:W}).length>1||K.caretPosition.blockId!==M.blockId||K.caretPosition.offset<=M.offset)return K;const H=r({position:M});if(H===null)return K;const j=[{blockId:M.blockId,startOffset:M.offset,endOffset:K.caretPosition.offset}],q={content:K.content,changes:K.changes};for(const $ of VE){const J=ev({content:q.content,targets:j,format:$,isEnabled:H.formats.includes($)});if(J===null)return K;q.content=J.content,q.changes=Qo({a:q.changes,b:J.changes})}const G=tv({content:q.content,targets:j,fontId:H.fontId});return G===null?K:{content:G.content,changes:Qo({a:q.changes,b:G.changes}),caretPosition:K.caretPosition}}function _({selection:M,headPlaceholderId:K}){if(ph({content:t.getContent(),range:M.range})==="crossSection"){I({selection:M});return}const H=y({selection:M});if(H===null)return;const j=uD({content:H.content,position:H.caretPosition,headPlaceholderId:K});if(j===null){c({line:"Enter: разрез неприменим"});return}p({flow:{content:j.content,changes:Qo({a:H.changes,b:j.changes}),caretPosition:j.caretPosition},record:"structure"})}function N({selection:M,headPlaceholderId:K}){if(ph({content:t.getContent(),range:M.range})==="crossSection"){I({selection:M});return}const H=y({selection:M});if(H===null)return;const j=ETe({content:H.content,position:H.caretPosition,headPlaceholderId:K});if(j===null){c({line:"Shift+Enter: разрез блока неприменим (вне тела?)"});return}p({flow:{content:j.content,changes:Qo({a:H.changes,b:j.changes}),caretPosition:j.caretPosition},record:"structure"})}function R({caret:M}){const K=Array.from(e.querySelectorAll("[data-block-id]")),W=K.findIndex(q=>q.getAttribute("data-block-id")===M.blockId);if(W<=0)return!1;const H=K[W-1].getAttribute("data-block-id");if(H===null)return!1;const j=nI({content:t.getContent(),blockId:H});return j===null?!1:(n.setCaret({position:{blockId:H,offset:j.length}}),c({line:"Backspace на стыке блоков — переход в конец предыдущего"}),!0)}function D({blockId:M,boundaryJumpFrom:K}){const W=hTe({content:t.getContent(),blockId:M});if(W===null){if(K!==void 0&&R({caret:K}))return;c({line:"удаление на границе блока — no-op (гард)"});return}p({flow:{content:W.content,changes:W.changes,caretPosition:W.caretPosition},record:"structure"})}function k({text:M,offset:K,direction:W,granularity:H}){return H==="line"?W==="backward"?0:M.length:H==="word"?W==="backward"?w_e({text:M,offset:K}):R_e({text:M,offset:K}):W==="backward"?N1({text:M,offset:K}):w1({text:M,offset:K})}function L({caret:M,direction:K,granularity:W}){const H=t.getContent(),j=nI({content:H,blockId:M.blockId});if(j===null)return;if(K==="backward"&&M.offset===0){D({blockId:M.blockId,boundaryJumpFrom:M});return}if(K==="forward"&&M.offset===j.length){const J=xn({content:H,blockId:M.blockId});if(J===null)return;const ne=J.siblings[J.blockIndex+1];if(ne===void 0){c({line:"удаление вперёд в конце контейнера — no-op"});return}D({blockId:ne.id});return}const q=k({text:j,offset:M.offset,direction:K,granularity:W});if(q===M.offset)return;const G=x5e({caret:M,boundary:q,direction:K}),$=_1({content:H,range:G,preserveFieldContainers:!0});$!==null&&p({flow:{content:$.content,changes:$.changes,caretPosition:$.caretPosition}
971,record:"deletion"})}function O({range:M}){const K=t.getContent(),W=xn({content:K,blockId:M.start.blockId});if(W===null)return null;const H=W.siblings[W.blockIndex+1];if(H===void 0||H.id!==M.end.blockId)return null;const j=nI({content:K,blockId:M.start.blockId});return j===null||M.start.offset!==j.length||M.end.offset!==0?null:H.id}function P({event:M}){if(typeof M.getTargetRanges!="function")return null;const K=M.getTargetRanges();if(K.length===0)return null;const W=K[0],H=gm({root:e,point:{node:W.startContainer,offset:W.startOffset}});if(H===null)return null;const j=gm({root:e,point:{node:W.endContainer,offset:W.endOffset}});return j===null?null:{start:H,end:j}}function B({event:M,selection:K,direction:W,granularity:H,fieldContext:j}){const q=K.range,G=A();G&&(u.deletionFallbackSide=S5e({direction:W}));const $=lv({root:e,content:t.getContent(),range:q});if($!==null){g($);return}const J=E(),ne=q.start.blockId===q.end.blockId&&q.start.offset===q.end.offset;if(!ne){const oe=yh({content:t.getContent(),range:q});if(oe===null){c({line:"удаление выделения неприменимо (межзонное? шов блоков?)"});return}const ie=x({content:oe.content,changes:oe.changes,coveredFieldIds:J});p({flow:{content:ie.content,changes:ie.changes,caretPosition:oe.caretPosition},record:"deletion"});return}if(!G){if(J.length>0){const oe=x({content:t.getContent(),changes:bh,coveredFieldIds:J});p({flow:{content:oe.content,changes:oe.changes,caretPosition:q.start},record:"deletion"});return}c({line:"выделение без модельного текста — no-op"});return}if(j!==null&&j.kind==="inside"&&Yb({wrapper:j.wrapper})){c({line:"удаление внутри пустого поля — no-op (подпись не текст)"});return}if(j!==null&&j.kind==="inside"&&v5e({content:t.getContent(),position:q.start,placeholderId:j.placeholderId,direction:W})){c({line:"удаление за край поля изнутри — no-op"});return}if(j!==null&&!Yb({wrapper:j.wrapper})&&b5e({direction:W,kind:j.kind})&&(u.affinity={placeholderId:j.placeholderId,side:"inside"}),H==="character"&&j!==null&&j.kind!=="inside"&&Yb({wrapper:j.wrapper})){if(W==="backward"&&j.kind==="outside-after"){g({blockId:q.start.blockId,placeholderId:j.placeholderId});return}if(W==="forward"&&j.kind==="outside-before"){g({blockId:q.start.blockId,placeholderId:j.placeholderId});return}}const X=P({event:M});if(X!==null&&!hD({range:X})){const oe=O({range:X});if(oe!==null){D({blockId:oe});return}const ie=yh({content:t.getContent(),range:X});if(ie===null){if(ne&&W==="backward"&&q.start.offset===0&&R({caret:q.start}))return;c({line:"удаление на границе блока — no-op (гард)"});return}p({flow:{content:ie.content,changes:ie.changes,caretPosition:ie.caretPosition},record:"deletion"});return}L({caret:q.start,direction:W,granularity:H})}function F({event:M,selection:K,hints:W}){const H=M.data;if(typeof H!="string")return;const j=P({event:M});if(j===null){S({selection:K,text:H,hints:W});return}if(!hD({range:j})){c({line:"замена через границы абзацев ждёт deleteRange"});return}const q=_1({content:t.getContent(),range:j});if(q===null)return;const G=v({flow:{content:q.content,changes:q.changes,caretPosition:q.caretPosition},text:H,hints:W});G!==null&&p({flow:G,record:"typing"})}function z(M){const K=M.inputType;if(K==="insertCompositionText"||K==="deleteCompositionText")return;M.preventDefault();const W=n.readSelection();if(W===null){c({line:`ввод вне модели погашен: ${K}`});return}const H=uT({root:e}),j=O_e({root:e});u.affinity=y5e({context:H,startContext:j}),u.deletionFallbackSide=null;const q=C5e({context:H,startContext:j});if(K==="insertText"){const $=M.data;if(typeof $!="string"||$.length===0)return;S({selection:W,text:$,hints:q});return}const G=I5e({context:H});if(K==="insertParagraph"){if(q.placeholderId!==void 0){c({line:"Enter внутри поля погашен (поле не разрезается)"});return}_({selection:W,headPlaceholderId:G});return}if(K==="insertLineBreak"){if(q.placeholderId!==void 0){c({line:"Shift+Enter внутри поля погашен (поле не разрезается)"});return}N({selection:W,headPlaceholderId:G});return}if(K==="insertFromPaste"){const $=M.dataTransfer;if($===null)return;const J=$.getData(uv);if(J.length>0){const oe=_Te({raw:J});if(oe===null&&c({line:"внутренний формат буфера не распознан — вставка plain"}),oe!==null){if(b({selection:W,blocks:oe,hints:q})){c({line:"paste: внутренний фрагмент вставлен"});return}c({line:"paste: фрагмент здесь неприменим — вставка plain"})}}const ne=$.getData("text/html");if(ne.length>0){const oe=E5e({html:ne});if(oe===null&&c({line:"paste: из HTML ничего не извлечено — вставка plain"}),oe!==null){if(b({selection:W,blocks:oe,hints:q})){c({line:"paste: HTML-фрагмент вставлен"});return}c({line:"paste: HTML здесь неприменим — вставка plain"})}}const X=$.getData("text/plain");if(X.length===0){c({line:"в буфере нет пригодных форматов — вставка погашена"});return}S({selection:W,text:X,hints:q});return}if(K==="insertReplacementText"){F({event:M,selection:W,hints:q});return}if(K==="deleteContentBackward"){B({event:M,selection:W,direction:"backward",granularity:"character",fieldContext:H});return}if(K==="deleteContentForward"){B({event:M,selection:W,direction:"forward",granularity:"character",fieldContext:H});return}if(K==="deleteWordBackward"){B({event:M,selection:W,direction:"backward",granularity:"word",fieldContext:H});return}
971if(K==="deleteWordForward"){B({event:M,selection:W,direction:"forward",granularity:"word",fieldContext:H});return}if(K==="deleteSoftLineBackward"||K==="deleteHardLineBackward"){B({event:M,selection:W,direction:"backward",granularity:"line",fieldContext:H});return}if(K==="deleteSoftLineForward"||K==="deleteHardLineForward"){B({event:M,selection:W,direction:"forward",granularity:"line",fieldContext:H});return}if(K==="deleteByCut"){B({event:M,selection:W,direction:"backward",granularity:"character",fieldContext:H});return}if(K==="historyUndo"){if(i===void 0){c({line:"historyUndo: журнал не подключён"});return}i();return}if(K==="historyRedo"){if(o===void 0){c({line:"historyRedo: журнал не подключён"});return}o();return}if(K==="insertFromDrop"||K==="deleteByDrag"){c({line:"перенос текста мышью в v1 погашен"});return}c({line:`не поддержанный inputType погашен: ${K}`})}const Q=M=>{M instanceof InputEvent&&z(M)};return e.addEventListener("beforeinput",Q),{destroy:()=>{e.removeEventListener("beforeinput",Q)}}}function sA({a:e,b:t}){return!(e.start.blockId!==t.start.blockId||e.start.offset!==t.start.offset||e.end.blockId!==t.end.blockId||e.end.offset!==t.end.offset)}function N5e({content:e,blockId:t}){const n=xn({content:e,blockId:t});return n===null?null:{start:{blockId:t,offset:0},end:{blockId:t,offset:Er({runs:n.block.runs})}}}function w5e({content:e,blockId:t}){const n=xn({content:e,blockId:t});if(n===null)return null;const s=n.siblings[0],r=n.siblings[n.siblings.length-1];return s===void 0||r===void 0?null:{start:{blockId:s.id,offset:0},end:{blockId:r.id,offset:Er({runs:r.runs})}}}function R5e({content:e}){const t=e.zones.find(c=>c.kind==="body");if(t===void 0||t.kind!=="body")return null;const n=t.items.filter(c=>c.children.length>0),s=n[0],r=n[n.length-1];if(s===void 0||r===void 0)return null;const i=s.children[0],o=r.children[r.children.length-1];return{start:{blockId:i.id,offset:0},end:{blockId:o.id,offset:Er({runs:o.runs})}}}function mD({content:e,blockId:t}){const n=xn({content:e,blockId:t});return n===null?!1:n.container.containerKind==="section"}function D5e({content:e,range:t}){if(t.start.blockId===t.end.blockId)return!0;const n=xn({content:e,blockId:t.start.blockId});if(n===null)return!1;const s=xn({content:e,blockId:t.end.blockId});return!(s===null||n.container.containerKind!==s.container.containerKind||n.container.zoneIndex!==s.container.zoneIndex||n.container.containerKind==="section"&&s.container.containerKind==="section"&&n.container.sectionIndex!==s.container.sectionIndex)}function k5e({root:e,model:t,selectionLayer:n,pickMode:s,onLog:r}){function i({line:p}){r!==void 0&&r({line:p})}function o(){return s===void 0?"document":s()}function c({content:p,range:g,wrapper:A}){const E=A.getAttribute("data-placeholder-id");if(E===null)return!1;const x=xn({content:p,blockId:g.start.blockId});if(x===null)return!1;const y=Cc({runs:x.block.runs,placeholderId:E});if(y===null)return!1;if(y.startOffset===y.endOffset){const v=e.ownerDocument.getSelection();return v===null||!v.isCollapsed&&v.toString()===y.placeholder.label?!1:(sD({wrapper:A}),i({line:"Ctrl+A: подпись поля"}),!0)}const I={start:{blockId:g.start.blockId,offset:y.startOffset},end:{blockId:g.start.blockId,offset:y.endOffset}};return sA({a:I,b:g})?!1:(sD({wrapper:A}),i({line:"Ctrl+A: содержимое поля"}),!0)}function u(){const p=n.readSelection();if(p===null)return;const g=t.getContent(),A=p.range,E=A.start.blockId,x=j_e({root:e});if(x!==null&&c({content:g,range:A,wrapper:x}))return;const y=R5e({content:g});if(y!==null&&sA({a:y,b:A})){i({line:"Ctrl+A: уже выделено всё тело"});return}if(!D5e({content:g,range:A})){if(o()==="document"&&mD({content:g,blockId:E})&&y!==null){n.setSelection({anchor:y.start,focus:y.end}),i({line:"Ctrl+A: всё тело"});return}i({line:"Ctrl+A: стоп — граница блока/зоны"});return}const I=w5e({content:g,blockId:E});if(I!==null&&sA({a:I,b:A})){if(o()==="document"&&mD({content:g,blockId:E})&&y!==null){n.setSelection({anchor:y.start,focus:y.end}),i({line:"Ctrl+A: всё тело"});return}i({line:"Ctrl+A: стоп — граница блока/зоны"});return}const v=A.start.blockId!==A.end.blockId,S=N5e({content:g,blockId:E});if(!v&&S!==null&&!sA({a:S,b:A})){n.setSelection({anchor:S.start,focus:S.end}),i({line:"Ctrl+A: абзац"});return}I!==null&&(n.setSelection({anchor:I.start,focus:I.end}),i({line:"Ctrl+A: блок целиком"}))}function d(p){!p.ctrlKey&&!p.metaKey||p.altKey||p.key.toLowerCase()!=="a"&&p.co
971de!=="KeyA"||(p.preventDefault(),u())}return e.addEventListener("keydown",d),{destroy:()=>{e.removeEventListener("keydown",d)}}}function gD({model:e,position:t}){const n=e.getNodeLocation({id:t.blockId});return n===null?null:n.nodeType==="sectionBlock"?{zoneOrder:Yl.indexOf("body"),itemIndex:n.bodyItemIndex,blockIndex:n.blockIndex}:n.nodeType==="zoneBlock"?{zoneOrder:Yl.indexOf(n.zoneKind),itemIndex:0,blockIndex:n.blockIndex}:null}function O5e({model:e,a:t,b:n}){const s=gD({model:e,position:t});if(s===null)return null;const r=gD({model:e,position:n});return r===null?null:s.zoneOrder!==r.zoneOrder?s.zoneOrder-r.zoneOrder:s.itemIndex!==r.itemIndex?s.itemIndex-r.itemIndex:s.blockIndex!==r.blockIndex?s.blockIndex-r.blockIndex:t.offset-n.offset}function P5e({model:e,anchor:t,focus:n}){const s=O5e({model:e,a:t,b:n});return s===null?null:s>0?{range:{start:n,end:t},isBackward:!0}:{range:{start:t,end:n},isBackward:!1}}function L5e({a:e,b:t}){return e===null&&t===null?!0:!(e===null||t===null||!v1({a:e.anchor,b:t.anchor})||!v1({a:e.focus,b:t.focus}))}function M5e({root:e,model:t,onSelectionChange:n}){const s=e.ownerDocument,r={lastNotified:null};function i(){const d=s.getSelection();if(d===null||d.anchorNode===null||d.focusNode===null)return null;const p=gm({root:e,point:{node:d.anchorNode,offset:d.anchorOffset}});if(p===null)return null;const g=gm({root:e,point:{node:d.focusNode,offset:d.focusOffset}});if(g===null)return null;const A=P5e({model:t,anchor:p,focus:g});return A===null?null:{anchor:p,focus:g,range:A.range,isBackward:A.isBackward}}function o(){if(n===void 0)return;const d=i();L5e({a:d,b:r.lastNotified})||(r.lastNotified=d,n({selection:d}))}function c({anchor:d,focus:p}){const g=lD({root:e,position:d});if(g===null)return!1;const A=lD({root:e,position:p});if(A===null)return!1;const E=s.getSelection();return E===null?!1:(E.setBaseAndExtent(g.node,g.offset,A.node,A.offset),!0)}function u({position:d}){return!!c({anchor:d,focus:d})}return s.addEventListener("selectionchange",o),{readSelection:i,setCaret:u,setSelection:c,destroy:()=>{s.removeEventListener("selectionchange",o)}}}const j5e="[data-placeholder-id]";function B5e({block:e}){return e.type==="paragraph"?"p":e.type==="heading"?`h${e.level}`:"li"}function AD({run:e}){const t=document.createElement("span");return t.textContent=e.text,e.formats!==void 0&&e.formats.length>0&&t.setAttribute("data-formats",[...e.formats].sort().join(" ")),e.fontId!==void 0&&t.setAttribute("data-font-id",e.fontId),e.commentIds!==void 0&&e.commentIds.length>0&&t.setAttribute("data-comment-ids",e.commentIds.join(" ")),t}function F5e({placeholder:e}){const t=document.createElement("span");return t.setAttribute("data-placeholder-id",e.id),t.setAttribute("data-placeholder-label",e.label),t.style.display="inline-block",t}function U5e({placeholder:e}){const t=document.createElement("span");return t.setAttribute("data-placeholder-label-view","true"),t.textContent=e.label,t}function ED(){const e=document.createElement("span");return e.setAttribute("data-placeholder-pad","true"),e.textContent=" ",e}function z5e({runs:e}){const t=[],n={id:null,wrapper:null};return e.forEach(s=>{if(s.placeholder===void 0){n.id=null,n.wrapper=null,t.push(AD({run:s}));return}n.id!==s.placeholder.id&&(n.id=s.placeholder.id,n.wrapper=F5e({placeholder:s.placeholder}),t.push(n.wrapper));const r=n.wrapper;if(r!==null){if(s.text.length===0){r.appendChild(U5e({placeholder:s.placeholder}));return}r.appendChild(AD({run:s})),r.setAttribute("data-placeholder-filled","true")}}),t.forEach(s=>{s.matches(j5e)&&(s.insertBefore(ED(),s.firstChild),s.appendChild(ED()))}),t}function xD({element:e,block:t}){e.setAttribute("data-block-id",t.id),t.align===void 0&&e.style.removeProperty("text-align"),t.align!==void 0&&(e.style.textAlign=t.align),t.indent===void 0&&e.style.removeProperty("margin-left"),t.indent!==void 0&&(e.style.marginLeft=`${t.indent*2}em`);const n=z5e({runs:t.runs});if(n.length===0){e.replaceChildren(document.createElement("br"));return}e.replaceChildren(...n)}function Q5e({block:e,state:t}){const n=B5e({block:e}),s=t.blockElements.get(e.id);if(s!==void 0&&s.tagName.toLowerCase()===n)return t.prevBlocks.get(e.id)!==e&&xD({element:s,block:e}),t.prevBlocks.set(e.id,e),s;const r=document.createElement(n);return xD({element:r,block:e}),t.blockElements.set(e.id,r),t.prevBlocks.set(e.id,e),r}function H5e({block:e}){const t=V5e({listKind:e.listKind}),n=document.createElement(t);return n.setAttribute("data-list",e.listKind),e.listKind==="ordered"&&e.startNumber!==void 0&&n.setAttribute("start",String(e.startNumber)),{element:n,listKind:e.listKind}}function V5e({listKind:e}){return e==="ordered"?"ol":"ul"}function G5e({section:e}){const t=document.createElement("div");return t.setAttribute("data-section-placeholder",e.sectionKind),t}function q5e({element:e,section:t,state:n}){e.setAttribute("data-section-kind",t.sectionKind),t.name===void 0&&e.removeAttribute("data-section-name"),t.name!==void 0&&e.setAttribute("data-section-name",t.name);const s=n.prevSections.get(t.id);if(s!==void 0){const o=new Set(t.children.map(c=>c.id));
971s.children.forEach(c=>{o.has(c.id)||(n.blockElements.delete(c.id),n.prevBlocks.delete(c.id))})}if(t.children.length===0){e.replaceChildren(G5e({section:t}));return}const r=[],i={current:null};t.children.forEach(o=>{const c=Q5e({block:o,state:n});if(o.type!=="listItem"){i.current=null,r.push(c);return}W5e({openWrap:i.current,block:o})&&(i.current=H5e({block:o}));const d=i.current;d!==null&&(r.includes(d.element)||r.push(d.element),d.element.appendChild(c))}),e.replaceChildren(...r)}function W5e({openWrap:e,block:t}){return e===null||e.listKind!==t.listKind||t.listKind==="ordered"&&t.startNumber!==void 0}function CD({sectionId:e,state:t}){const n=t.prevSections.get(e);n!==void 0&&n.children.forEach(s=>{t.blockElements.delete(s.id),t.prevBlocks.delete(s.id)}),t.prevSections.delete(e),t.sectionElements.delete(e)}function yD({container:e,content:t,state:n}){const s=t.zones.find(o=>o.kind==="body");if(s===void 0){e.replaceChildren(),[...n.prevSections.keys()].forEach(o=>{CD({sectionId:o,state:n})});return}if(s.kind!=="body")return;const r=new Set(s.items.map(o=>o.id));[...n.sectionElements.entries()].forEach(([o,c])=>{r.has(o)||(c.remove(),CD({sectionId:o,state:n}))});const i={node:e.firstChild};s.items.forEach(o=>{const c=n.sectionElements.get(o.id),u=K5e({existing:c,section:o});if(n.prevSections.get(o.id)!==o&&q5e({element:u,section:o,state:n}),n.sectionElements.set(o.id,u),n.prevSections.set(o.id,o),i.node===u){i.node=u.nextSibling;return}e.insertBefore(u,i.node)})}function K5e({existing:e,section:t}){if(e!==void 0)return e;const n=document.createElement("section");return n.setAttribute("data-section-id",t.id),n}function $5e({model:e,container:t}){const n={prevSections:new Map,prevBlocks:new Map,sectionElements:new Map,blockElements:new Map};t.setAttribute("data-document-body","true"),yD({container:t,content:e.getContent(),state:n});const s=e.subscribe({onChange:({content:r})=>{yD({container:t,content:r,state:n})}});return{destroy:()=>{s(),t.replaceChildren(),t.removeAttribute("data-document-body")}}}function WF({raw:e}){try{const t=JSON.parse(e);return pt(t)?t:null}catch{return null}}function ET(e){return!(typeof e!="number"||!Number.isInteger(e)||e<0)}function bD(e){return!(typeof e!="string"||e.length===0)}function Y5e({raw:e}){const t=WF({raw:e});return t===null||!ET(t.eventNumber)||t.eventNumber===0||!bD(t.eventType)||!bD(t.createdAt)||!("payload"in t)?null:{eventNumber:t.eventNumber,eventType:t.eventType,payload:t.payload,createdAt:t.createdAt}}function X5e({value:e}){return!pt(e)||!ET(e.snapshotVersion)||e.snapshotVersion===0||!Array.isArray(e.feed)?null:{snapshotVersion:e.snapshotVersion,feed:e.feed}}function J5e({raw:e}){const t=WF({raw:e});if(t===null||!ET(t.resumeAfterNumber))return null;const n=X5e({value:t.snapshot});return n===null?null:{snapshot:n,resumeAfterNumber:t.resumeAfterNumber}}const Z5e="sessionEvent",eNe="snapshot";function tNe({consumers:e}){const t=new Map;return e.forEach(n=>{n.eventTypes.forEach(s=>{if(t.has(s))throw new Error(`documentSessionChannel: duplicate consumer for eventType "${s}"`);t.set(s,n)})}),t}function nNe({frame:e,event:t}){if(e.id===void 0)return"sessionEvent frame without id";const n=Number.parseInt(e.id,10);return Number.isInteger(n)?n!==t.eventNumber?`sessionEvent frame id ${n} != eventNumber ${t.eventNumber}`:null:`sessionEvent frame id is not a number: "${e.id}"`}function sNe({consumers:e,snapshotConsumer:t}){const n=tNe({consumers:e}),s={lastAppliedEventNumber:0};function r({frame:u}){const d=Y5e({raw:u.data});if(d===null)return{kind:"protocolError",reason:"malformed sessionEvent data"};const p=nNe({frame:u,event:d});if(p!==null)return{kind:"protocolError",reason:p};if(d.eventNumber<=s.lastAppliedEventNumber)return{kind:"duplicate",eventNumber:d.eventNumber};const g=s.lastAppliedEventNumber+1;if(d.eventNumber>g)return{kind:"gap",expectedEventNumber:g,receivedEventNumber:d.eventNumber};const A=n.get(d.eventType);return A===void 0?{kind:"unknownEventType",eventType:d.eventType}:(A.onEvent(d),s.lastAppliedEventNumber=d.eventNumber,{kind:"applied",eventNumber:d.eventNumber})}function i({frame:u}){const d=J5e({raw:u.data});return d===null?{kind:"protocolError",reason:"malformed snapshot data"}:(t.onSnapshot(d),s.lastAppliedEventNumber=d.resumeAfterNumber,{kind:"snapshotApplied",resumeAfterNumber:d.resumeAfterNumber})}function o({frame:u}){return u.type===Z5e?r({frame:u}):u.type===eNe?i({frame:u}):{kind:"protocolError",reason:`unexpected frame type "${u.type}"`}}function c(){return s.lastAppliedEventNumber}return{handleFrame:o,getLastAppliedEventNumber:c}}const rNe=6e4,iNe=1e3,oNe=3e4;function aNe({attempt:e}){const t=Math.min(e,5),n=Math.min(oNe,iNe*2**t);return Math.floor(n/2+Math.random()*(n/2))}function lNe({error:e}){return!pt(e)||typeof e.httpCode!="number"?null:e.httpCode}function cNe({code:e}){return e===401||e===403||e===404}async function uNe({ms:e,signal:t}){return new Promise(n=>{const s=setTimeout(()=>n(),e);t.addEventListener("abort",()=>{clearTimeout(s),n()},{once:!0})})}async function dNe({signal:e}){if(!navigator.onLine)return new Promise(t=>{const n=()=>{window.removeEventListener("online",n),t()};window.addEventListener("online",n),e.addEventListener("abort",n,{once:!0})})}function fNe({clientId:e,documentId:t,consumers:n,snapshotConsumer:s,onStatusChange:r,onSessionEstablished:i}){const o=sNe({consumers:n,snapshotConsumer:s}
971),c={isStarted:!1,attempt:0,sessionId:null,stopController:null,readController:null,idleTimerId:null};function u(){c.idleTimerId!==null&&(clearTimeout(c.idleTimerId),c.idleTimerId=null)}function d(){u(),c.idleTimerId=setTimeout(()=>{c.readController?.abort()},rNe)}function p(){c.readController?.abort()}function g({reason:S}){c.stopController?.abort(),u(),window.removeEventListener("offline",p),r({kind:"error",reason:S})}async function A({signal:S}){if(c.sessionId!==null)return c.sessionId;const b=await pF({clientId:e,documentId:t,signal:S});return c.sessionId=b.sessionId,i?.(b),b.sessionId}async function E({stopSignal:S}){const b=await A({signal:S}),w=new AbortController;c.readController=w,S.addEventListener("abort",p,{once:!0});try{const _=await vve({clientId:e,sessionId:b,lastAppliedEventNumber:o.getLastAppliedEventNumber(),signal:w.signal});c.attempt=0,r({kind:"connected"}),d();for await(const N of Zk({body:_,signal:w.signal,onActivity:d})){const R=o.handleFrame({frame:N});if(R.kind==="gap")return"retry";if(R.kind==="unknownEventType")return g({reason:`неизвестный тип события: ${R.eventType}`}),"fatal";if(R.kind==="protocolError")return g({reason:R.reason}),"fatal"}return"retry"}finally{u(),S.removeEventListener("abort",p),c.readController=null}}async function x({stopSignal:S}){for(r({kind:"connecting"});!S.aborted;){try{if(await E({stopSignal:S})==="fatal")return}catch(b){if(S.aborted)return;const w=lNe({error:b});if(cNe({code:w})){g({reason:`канал закрыт: HTTP ${w}`});return}console.warn("documentSessionChannel: attempt failed",b)}if(S.aborted)return;c.attempt+=1,r({kind:"reconnecting",attempt:c.attempt}),await dNe({signal:S}),await uNe({ms:aNe({attempt:c.attempt}),signal:S})}}function y(){if(c.isStarted)return;c.isStarted=!0;const S=new AbortController;c.stopController=S,window.addEventListener("offline",p),x({stopSignal:S.signal})}function I(){c.isStarted&&(c.isStarted=!1,window.removeEventListener("offline",p),c.stopController?.abort(),c.stopController=null,u(),r({kind:"stopped"}))}function v(){return o.getLastAppliedEventNumber()}return{start:y,stop:I,getLastAppliedEventNumber:v}}function pNe({journal:e,selectionApplier:t}){function n({outcome:i}){i!==null&&i.selection!==null&&t.setSelection({anchor:i.selection.anchor,focus:i.selection.focus})}function s(){n({outcome:e.undo()})}function r(){n({outcome:e.redo()})}return{undo:s,redo:r}}function hNe({root:e,controller:t}){function n(s){if(!(!s.ctrlKey&&!s.metaKey)&&!s.altKey){if(s.code==="KeyZ"){if(s.preventDefault(),s.shiftKey){t.redo();return}t.undo();return}s.code==="KeyY"&&(s.shiftKey||(s.preventDefault(),t.redo()))}}return e.addEventListener("keydown",n),{destroy:()=>{e.removeEventListener("keydown",n)}}}const mNe=100,gNe=1e3;function ANe({first:e,second:t}){const n=new Set([...e.changedNodeIds,...t.changedNodeIds]),s=new Set([...e.changedZoneKinds,...t.changedZoneKinds]);return{changedNodeIds:[...n],changedZoneKinds:[...s]}}function ENe({selection:e}){return e===null?null:e.focus.blockId}function xNe({kind:e}){return e==="typing"||e==="deletion"}function CNe({meta:e}){return e.record==="history"?null:e.record}function ID({selection:e}){return e===void 0?null:e}function yNe({model:e,now:t=()=>Date.now()}){const n={undoStack:[],redoStack:[],isTopOpen:!1,lastNotified:null},s=new Set;function r(){return{canUndo:n.undoStack.length>0,canRedo:n.redoStack.length>0}}function i(){const x=r(),y=n.lastNotified;y!==null&&y.canUndo===x.canUndo&&y.canRedo===x.canRedo||(n.lastNotified=x,s.forEach(I=>{I(x)}))}function o({kind:x,commitAt:y,blockId:I}){if(!n.isTopOpen||!xNe({kind:x})||I===null)return null;const v=n.undoStack.at(-1);return v===void 0||v.kind!==x||v.coalesceBlockId!==I||y-v.lastCommitAt>gNe?null:v}function c(x){const y=x.meta,I=CNe({meta:y});if(I===null)return;n.redoStack.length=0;const v=ID({selection:y.selectionBefore}),S=ID({selection:y.selectionAfter}),b=t(),w=ENe({selection:S}),_=o({kind:I,commitAt:b,blockId:w});if(_!==null){_.nextContent=x.content,_.changes=ANe({first:_.changes,second:x.changes}),_.selectionAfter=S,_.lastCommitAt=b,i();return}const N={kind:I,domainLabel:y.domainLabel,previousContent:x.previousContent,nextContent:x.content,changes:x.changes,selectionBefore:v,selectionAfter:S,lastCommitAt:b,coalesceBlockId:w};n.undoStack.push(N),n.undoStack.length>mNe&&n.undoStack.shift(),n.isTopOpen=!0,i()}function u(){n.isTopOpen=!1;const x=n.undoStack.pop();return x===void 0?null:(n.redoStack.push(x),e.commit({content:x.previousContent,changes:x.changes,meta:{record:"history"}}),i(),{selection:x.selectionBefore})}function d(){n.isTopOpen=!1;const x=n.redoStack.pop();return x===void 0?null:(n.undoStack.push(x),e.commit({content:x.nextContent,changes:x.changes,meta:{record:"history"}}),i(),{selection:x.selectionAfter})}function p({onChange:x}){return s.add(x),()=>{s.delete(x)}}function g(){n.undoStack.length=0,n.redoStack.length=0,n.isTopOpen=!1,i()}const A=e.subscribe({onChange:c});function E(){A(),s.clear()}return{undo:u,redo:d,getState:r,subscribe:p,reset:g,destroy:E}}const zi={templateInserted:"document.templateInserted",zoneUpdated:"document.zoneUpdated",sectionInserted:"document.sectionInserted",
971sectionUpdated:"document.sectionUpdated",generationStarted:"document.generationStarted",generationFailed:"document.generationFailed"},bNe=[zi.templateInserted,zi.zoneUpdated,zi.sectionInserted,zi.sectionUpdated,zi.generationStarted,zi.generationFailed],INe=["zones"],SNe=["zone"],vNe=["afterSectionId","section"],_Ne=["sectionId","children"],TNe=["target"],NNe=["sectionId"],wNe=["zoneKind"];function ku({value:e,path:t,knownKeys:n}){for(const s of Object.keys(e))if(!n.includes(s))return`${t}.${s}: unknown field`}function RNe({payload:e}){const t=ku({value:e,path:"payload",knownKeys:INe});if(t!==void 0)return{issue:t};const n=l2e({value:e.zones,path:"payload.zones"});if(n!==void 0)return{issue:n};if(!Array.isArray(e.zones))return{issue:"payload.zones: must be an array"};const s=[];for(const r of e.zones){if(!CF(r))return{issue:"payload.zones: failed to parse"};s.push(r)}return{event:{kind:"templateInserted",zones:s}}}function DNe({payload:e}){const t=ku({value:e,path:"payload",knownKeys:SNe});return t!==void 0?{issue:t}:CF(e.zone)?e.zone.kind==="body"?{issue:"payload.zone: body is updated by section events only, not as a zone"}:{event:{kind:"zoneUpdated",zone:e.zone}}:{issue:"payload.zone: not a valid document zone"}}function kNe({payload:e}){const t=ku({value:e,path:"payload",knownKeys:vNe});return t!==void 0?{issue:t}:"afterSectionId"in e?e.afterSectionId!==null&&!J_(e.afterSectionId)?{issue:"payload.afterSectionId: must be a bare uuid v4 or null"}:a2e(e.section)?{event:{kind:"sectionInserted",afterSectionId:e.afterSectionId,section:e.section}}:{issue:"payload.section: not a valid document section"}:{issue:"payload.afterSectionId: required (null means the start of the body)"}}function ONe({payload:e}){const t=ku({value:e,path:"payload",knownKeys:_Ne});if(t!==void 0)return{issue:t};if(!J_(e.sectionId))return{issue:"payload.sectionId: must be a bare uuid v4"};const n=c2e({value:e.children,path:"payload.children"});if(n!==void 0)return{issue:n};if(!Array.isArray(e.children))return{issue:"payload.children: must be an array"};const s=[];for(const r of e.children){if(!xF(r))return{issue:"payload.children: failed to parse"};s.push(r)}return{event:{kind:"sectionUpdated",sectionId:e.sectionId,children:s}}}function PNe({value:e}){if(!pt(e))return{issue:"payload.target: must be an object"};if("sectionId"in e){const s=ku({value:e,path:"payload.target",knownKeys:NNe});return s!==void 0?{issue:s}:J_(e.sectionId)?{target:{sectionId:e.sectionId}}:{issue:"payload.target.sectionId: must be a bare uuid v4"}}const t=ku({value:e,path:"payload.target",knownKeys:wNe});if(t!==void 0)return{issue:t};const n=Yl.find(s=>s===e.zoneKind);return n===void 0?{issue:"payload.target.zoneKind: unknown zone kind"}:n==="body"?{issue:"payload.target.zoneKind: body is generated per section, not as a zone"}:{target:{zoneKind:n}}}function SD({payload:e,kind:t}){const n=ku({value:e,path:"payload",knownKeys:TNe});if(n!==void 0)return{issue:n};const s=PNe({value:e.target});return s.target===void 0?{issue:s.issue}:{event:{kind:t,target:s.target}}}function LNe({eventType:e,payload:t}){return pt(t)?e===zi.templateInserted?RNe({payload:t}):e===zi.zoneUpdated?DNe({payload:t}):e===zi.sectionInserted?kNe({payload:t}):e===zi.sectionUpdated?ONe({payload:t}):e===zi.generationStarted?SD({payload:t,kind:"generationStarted"}):e===zi.generationFailed?SD({payload:t,kind:"generationFailed"}):{issue:`eventType: unknown document event "${e}"`}:{issue:"payload: must be an object"}}function MNe({model:e,generations:t,historicalBoundary:n,onSkipped:s,onFatalIssue:r}){const i=({parsed:u})=>{const d=e.getContent();return u.kind==="templateInserted"?wF({content:d,zones:u.zones}):u.kind==="zoneUpdated"?r_e({content:d,zone:u.zone}):u.kind==="sectionInserted"?gTe({content:d,section:u.section,afterSectionId:u.afterSectionId}):u.kind==="sectionUpdated"?ATe({content:d,sectionId:u.sectionId,children:u.children}):null},o=({parsed:u})=>{if(u.kind==="sectionUpdated"){t.finishGeneration({sectionId:u.sectionId});return}u.kind==="zoneUpdated"&&t.finishGeneration({zoneKind:u.zone.kind})};return{eventTypes:bNe,onEvent:u=>{const d=LNe({eventType:u.eventType,payload:u.payload});
971if(d.event===void 0){r({reason:`документное событие #${u.eventNumber} не разобрано — ${d.issue}`});return}const p=d.event;if(p.kind==="generationStarted"){t.startGeneration(p.target);return}if(p.kind==="generationFailed"){t.finishGeneration(p.target);return}if(o({parsed:p}),u.eventNumber<=n){s({line:`событие #${u.eventNumber} (${u.eventType}) историческое (граница №${n}) — документ уже актуален`});return}const g=i({parsed:p});if(g===null){s({line:`событие #${u.eventNumber} (${u.eventType}) неприменимо: цель не найдена или узлы конфликтуют`});return}e.commit({content:g.content,changes:g.changes,meta:{record:"domain",domainLabel:u.eventType}})}}}function jNe({data:e}){if(!pt(e))return null;const t=e.commandId,n=e.status;return typeof t!="string"||t.length===0||n!=="accepted"?null:{commandId:t,status:n}}const BNe=rt(async function({clientId:t,sessionId:n,envelope:s,signal:r}){const i=pa(),o=Ke(`${fc({clientId:t})}/sessions/${n}/commands/`),c=await qe(o,{method:"POST",credentials:"include",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(s),signal:r});if(He(c))throw{httpCode:503,errorData:c.error};const u=await Ye(c);if(He(u))throw{httpCode:503,errorData:u.error};if(u.status==="error")throw{httpCode:c.status,errorData:u.error};const d=jNe({data:u.data});if(d!==null)return d;throw{httpCode:500,errorData:{code:"BAD_SESSION_COMMAND_ACK",message:"Unexpected session command ack shape"}}}),FNe=4,UNe=400;function zNe({transport:e}){return e||BNe}function QNe({maxAttempts:e}){return e===void 0?FNe:e<1?1:e}function HNe({baseDelayMs:e}){return e===void 0?UNe:e<0?0:e}function VNe({sleep:e}){return e||(({ms:t})=>new Promise(n=>{setTimeout(n,t)}))}function GNe({random:e}){return e||Math.random}function qNe({error:e}){return pt(e)?typeof e.httpCode!="number"?{httpCode:0,errorData:e}:{httpCode:e.httpCode,errorData:e.errorData}:{httpCode:0,errorData:e}}function WNe({httpCode:e}){return e>=500}function KNe({attemptNumber:e,baseDelayMs:t,random:n}){const s=t*2**(e-1),r=.5+n()*.5;return Math.round(s*r)}async function $Ne(e){const{clientId:t,sessionId:n,commandType:s,payload:r,signal:i}=e,o=zNe({transport:e.transport}),c=QNe({maxAttempts:e.maxAttempts}),u=HNe({baseDelayMs:e.baseDelayMs}),d=VNe({sleep:e.sleep}),p=GNe({random:e.random}),g={commandId:crypto.randomUUID(),commandType:s,payload:r},A=Array.from({length:c},(E,x)=>x+1);for(const E of A){if(i?.aborted)return{kind:"failed",httpCode:0,errorData:{code:"ABORTED",message:"Command sending aborted"}};try{return{kind:"accepted",ack:await o({clientId:t,sessionId:n,envelope:g,signal:i})}}catch(x){const y=qNe({error:x});if(y.httpCode>=400&&y.httpCode<500)return{kind:"invalid",httpCode:y.httpCode,errorData:y.errorData};if(!WNe({httpCode:y.httpCode}))return{kind:"failed",httpCode:y.httpCode,errorData:y.errorData};if(E===c)return{kind:"failed",httpCode:y.httpCode,errorData:y.errorData};await d({ms:KNe({attemptNumber:E,baseDelayMs:u,random:p})})}}return{kind:"failed",httpCode:0,errorData:{code:"UNREACHABLE",message:"No delivery attempts made"}}}const rA=$n(e=>({sectionIds:[],zoneKinds:[],startGeneration:t=>e(n=>"sectionId"in t?n.sectionIds.includes(t.sectionId)?{}:{sectionIds:[...n.sectionIds,t.sectionId]}:n.zoneKinds.includes(t.zoneKind)?{}:{zoneKinds:[...n.zoneKinds,t.zoneKind]}),finishGeneration:t=>e(n=>"sectionId"in t?n.sectionIds.includes(t.sectionId)?{sectionIds:n.sectionIds.filter(s=>s!==t.sectionId)}:{}:n.zoneKinds.includes(t.zoneKind)?{zoneKinds:n.zoneKinds.filter(s=>s!==t.zoneKind)}:{}),reset:()=>e({sectionIds:[],zoneKinds:[]})})),hh=$n(e=>({status:{kind:"idle"},session:null,setStatus:t=>e({status:t}),setSession:t=>e({session:t}),reset:()=>e({status:{kind:"idle"},session:null})})),rI=({value:e,placeholder:t="",isDisabled:n=!1,isCloseOnScroll:s=!1,options:r,onChange:i})=>{const[o,c]=l.useState(!1),u=l.useRef(null),d=l.useRef(null),p=l.useRef([]),g=l.useCallback(_=>{u.current&&(u.current.contains(_.target)||c(!1))},[]);l.useEffect(()=>(document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}),[g]),l.useEffect(()=>{n&&c(!1)},[n]),l.useEffect(()=>{if(!o)return;const _=u.current,N=d.current;if(!_||!N)return;const R=Ji(_,N,async()=>{const D=_.getBoundingClientRect(),k=Io({referenceTop:D.top,referenceBottom:D.bottom,floatingHeight:N.offsetHeight,viewportHe
971ight:window.innerHeight,gap:6,preferredDirection:"down"}),L=await Ei(_,N,{placement:hc[k],strategy:"absolute",middleware:[_o(6),Ai({padding:16})]}),O=xi-D.top,P=Math.max(L.y,O);Object.assign(N.style,{left:`${L.x}px`,top:`${P}px`,minWidth:`${Math.max(D.width,180)}px`})});return()=>R()},[o]),l.useEffect(()=>{if(!o||!s)return;const _=performance.now(),N=()=>{performance.now()-_<fl||c(!1)},R=[],D=k=>{if(!k)return;const L=k.parentElement;if(!L)return;L.scrollHeight>L.clientHeight&&(L.addEventListener("scroll",N,{passive:!0}),R.push(L)),D(L)};return D(u.current),window.addEventListener("scroll",N,{passive:!0}),window.addEventListener("resize",N,{passive:!0}),R.push(window),p.current=R,()=>{p.current.forEach(k=>{if(k instanceof Window){k.removeEventListener("scroll",N),k.removeEventListener("resize",N);return}k.removeEventListener("scroll",N)}),p.current=[]}},[o,s]);const A=l.useMemo(()=>{if(e!==null)return r.find(_=>_.value===e)},[r,e]),E=l.useMemo(()=>A===void 0?t:A.triggerLabel!==void 0?A.triggerLabel:A.label,[A,t]),x=l.useMemo(()=>A===void 0,[A]),y=l.useCallback(_=>{_.preventDefault()},[]),I=l.useCallback(()=>{n||c(_=>!_)},[n]),v=l.useCallback(_=>{_.isDisabled||(i?.(_.value),c(!1))},[i]),S=l.useMemo(()=>o?a.jsx("div",{ref:d,onMouseDown:y,className:"absolute z-50 flex max-h-82 w-max flex-col rounded-[8px] bg-white shadow-[0px_4px_31px_rgba(0,0,0,0.08),_0px_0.893452px_6.92426px_rgba(0,0,0,0.0476886),_0px_0.266004px_2.06153px_rgba(0,0,0,0.0323114)]",children:a.jsx("div",{className:"flex flex-1 flex-col overflow-hidden p-1",children:a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:r.map(_=>a.jsx("div",{onClick:()=>v(_),className:Y("group pt-0.5 pb-0.5 first:pt-0 last:pb-0",!_.isDisabled&&"cursor-pointer",!!_.isDisabled&&"cursor-default"),children:a.jsxs("div",{className:Y("roboto-flex-100-400-1 flex items-center gap-2 rounded-[6px] py-1.5 pr-0.5 pl-2 text-[14px] leading-[20px]",!_.isDisabled&&"text-zinc-950 group-hover:bg-zinc-50",!!_.isDisabled&&"text-zinc-300"),children:[!!_.icon&&a.jsx("span",{className:Y("flex size-5 shrink-0 items-center justify-center [&_svg]:size-5",!_.isDisabled&&"text-zinc-600",!!_.isDisabled&&"text-zinc-300"),children:_.icon}),a.jsx("span",{className:"whitespace-nowrap",children:_.label}),a.jsx("span",{className:"ml-auto flex h-5 w-6 items-center justify-center",children:_.value===e&&a.jsx(qr,{className:"size-4 text-zinc-900"})})]})},_.value))})})}):null,[o,r,e,y,v]),b=l.useMemo(()=>{const _="flex h-8 w-full items-center gap-1 rounded-md px-2 select-none";return n?Y(_,"cursor-default text-zinc-300"):o?Y(_,"cursor-pointer bg-zinc-100 text-zinc-950"):Y(_,"cursor-pointer text-zinc-950 hover:bg-zinc-100")},[n,o]),w=l.useMemo(()=>n?"flex size-5 shrink-0 items-center justify-center text-zinc-300 [&_svg]:size-5":"flex size-5 shrink-0 items-center justify-center text-zinc-600 [&_svg]:size-5",[n]);return a.jsxs("div",{ref:u,className:"relative min-w-0 select-none",children:[a.jsxs("div",{className:b,onMouseDown:y,onClick:I,children:[!!A?.icon&&a.jsx("span",{className:w,children:A.icon}),a.jsx("span",{className:Y("roboto-flex-100-400-1 min-w-0 flex-1 truncate text-left text-[14px] leading-[20px]",!n&&x&&"text-zinc-400"),children:E}),a.jsx(Bu,{className:Y("size-2 shrink-0",!o&&"rotate-180",n&&"text-zinc-300",!n&&"text-zinc-400")})]}),S]})},YNe=[{value:"text",label:h.molecules.editor.textStyleDropdown.TEXT,icon:a.jsx(LB,{})},{value:"h1",label:h.molecules.editor.textStyleDropdown.TITLE,icon:a.jsx(RB,{})},{value:"h2",label:h.molecules.editor.textStyleDropdown.SUBTITLE,icon:a.jsx(DB,{})},{value:"h3",label:h.molecules.editor.textStyleDropdown.HEADING_3,icon:a.jsx(kB,{})},{value:"h4",label:h.molecules.editor.textStyleDropdown.HEADING_4,icon:a.jsx(OB,{})},{value:"h5",label:h.molecules.editor.textStyleDropdown.HEADING_5,icon:a.jsx(PB,{})}],XNe={arial:{value:"arial",label:"Arial",icon:a.jsx(vB,{})},times_new_roman:{value:"times_new_roman",label:"Times New Roman",icon:a.jsx(SB,{})}},JNe=["arial","times_new_roman"],ZNe={left:{value:"left",label:h.molecules.editor.layoutDropdown.LEFT,icon:a.jsx(NB,{})},center:{value:"center",label:h.molecules.editor.layoutDropdown.CENTER,icon:a.jsx(_B,{})},right:{value:"right",label:h.molecules.editor.layoutDropdown.RIGHT,icon:a.jsx(wB,{})},justify:{value:"justify",label:h.molecules.editor.layoutDropdown.JUSTIFY,icon:a.jsx(TB,{})}},e3e=["left","center","right","justify"],KF="outdent",Av="indent",t3e=[{value:KF,label:h.molecules.editor.layoutDropdown.DECREASE_INDENT,icon:a.jsx(B_,{})},{value:Av,label:h.molecules.editor.layoutDropdown.INCREASE_INDENT,icon:a.jsx(F_,{})}],n3e=({controller:e,undoJournal:t,undoController:n})=>{const[s,r]=l.useState(e.getState()),[i,o]=l.useState({canUndo:!1,canRedo:!1}),c=kn(L=>L.catalogues?.enums),u=l.useMemo(()=>s.isFontMixed||!s.hasSelection?null:s.fontId===null?"arial":s.fontId,[s]),d=l.useMemo(()=>!(s.canSetAlign||s.canIndent||s.canOutdent),[s]),p=l.useMemo(()=>(()=>{const O=c?.fontIds;return O||JNe})().map(O=>{const P=XNe[O];return P||{value:O,label:O}}),[c]),g=l.useMemo(()=>{const O=(()=>{const B=c?.alignKinds;return B||e3e})().flatMap(B=>{const F=ZNe[B];return F?[F]:[]}),P=t3e.map(B=>B.value===Av?{...B,isDisabled:!s.canIndent}:{...B,isDisabled:!s.canOutdent});return[...O,...P]},[c,s]),A=l.useCallback(L=>{L.preventDefault()},[]),E=l.useCallback(()=>{e.toggleRunFormat({format:"bold"})},[e]),x=l.useCallback(()=>{e.toggleRunFormat({format:"italic"})},[e]),y=l.useCallback(()=>{e.toggleRunFormat({format:"underline"})},[e]),I=l.useCallback(()=>{e.toggleRunFormat({format:"highlight"})},[e]),v=l.useCallback(()=>
971{n!==null&&n.undo()},[n]),S=l.useCallback(()=>{n!==null&&n.redo()},[n]),b=l.useCallback(()=>{e.toggleList({listKind:"bullet"})},[e]),w=l.useCallback(()=>{e.toggleList({listKind:"ordered"})},[e]),_=l.useCallback(()=>{e.clearFormatting()},[e]),N=l.useCallback(L=>{j2e(L)&&e.setTextStyle({value:L})},[e]),R=l.useCallback(L=>{e.setFont({fontId:L})},[e]),D=l.useCallback(L=>{if(L===Av){e.changeIndent({delta:1});return}if(L===KF){e.changeIndent({delta:-1});return}L2e(L)&&e.setAlign({align:L})},[e]),k=l.useCallback(({isActive:L,isEnabled:O})=>Y("flex size-8 items-center justify-center rounded-md p-2",O&&"cursor-pointer hover:bg-zinc-100",!O&&"cursor-default",O&&L&&"bg-zinc-100 text-zinc-950",O&&!L&&"bg-transparent text-zinc-600",!O&&"text-zinc-300"),[]);return l.useEffect(()=>(r(e.getState()),e.subscribe({onChange:({state:L})=>r(L)})),[e]),l.useEffect(()=>{if(t===null){o({canUndo:!1,canRedo:!1});return}return o(t.getState()),t.subscribe({onChange:L=>o(L)})},[t]),a.jsxs("div",{className:"flex items-center gap-1 border-b border-zinc-200 bg-white p-1",children:[a.jsx("button",{type:"button",disabled:!i.canUndo,title:h.molecules.editor.tooltips.UNDO,className:k({isActive:!1,isEnabled:i.canUndo}),onMouseDown:A,onClick:v,children:a.jsx(dm,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!i.canRedo,title:h.molecules.editor.tooltips.REDO,className:k({isActive:!1,isEnabled:i.canRedo}),onMouseDown:A,onClick:S,children:a.jsx(dm,{className:"size-5 -scale-x-100"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"w-[168px] min-w-0 shrink-0",children:a.jsx(rI,{value:s.textStyle,placeholder:h.molecules.editor.toolbarDropdownPlaceholders.TEXT_STYLE,isDisabled:!s.canSetTextStyle,isCloseOnScroll:!0,options:YNe,onChange:N})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"w-[168px] min-w-0 shrink-0",children:a.jsx(rI,{value:u,placeholder:h.molecules.editor.toolbarDropdownPlaceholders.FONT,isDisabled:!s.canSetFont,isCloseOnScroll:!0,options:p,onChange:R})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",disabled:!s.canFormatRuns,title:h.molecules.editor.tooltips.BOLD,onMouseDown:A,onClick:E,className:k({isActive:s.activeRunFormats.includes("bold"),isEnabled:s.canFormatRuns}),children:a.jsx(O_,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!s.canFormatRuns,title:h.molecules.editor.tooltips.ITALIC,onMouseDown:A,onClick:x,className:k({isActive:s.activeRunFormats.includes("italic"),isEnabled:s.canFormatRuns}),children:a.jsx(P_,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!s.canFormatRuns,title:h.molecules.editor.tooltips.UNDERLINE,onMouseDown:A,onClick:y,className:k({isActive:s.activeRunFormats.includes("underline"),isEnabled:s.canFormatRuns}),children:a.jsx(L_,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!s.canFormatRuns,title:h.molecules.editor.tooltips.HIGHLIGHT,onMouseDown:A,onClick:I,className:k({isActive:s.activeRunFormats.includes("highlight"),isEnabled:s.canFormatRuns}),children:a.jsx(M_,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!s.canToggleList,title:h.molecules.editor.tooltips.BULLET_LIST,onMouseDown:A,onClick:b,className:k({isActive:s.isBulletListActive,isEnabled:s.canToggleList}),children:a.jsx(EB,{className:"size-5"})}),a.jsx("button",{type:"button",disabled:!s.canToggleList,title:h.molecules.editor.tooltips.NUMBERED_LIST,onMouseDown:A,onClick:w,className:k({isActive:s.isOrderedListActive,isEnabled:s.canToggleList}),children:a.jsx(xB,{className:"size-5"})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("div",{className:"w-[196px] min-w-0 shrink-0",children:a.jsx(rI,{value:s.align,placeholder:h.molecules.editor.toolbarDropdownPlaceholders.LAYOUT,isDisabled:d,isCloseOnScroll:!0,options:g,onChange:D})}),a.jsx("div",{className:"mx-1 h-6 w-px bg-zinc-200"}),a.jsx("button",{type:"button",disabled:!0,title:h.molecules.editor.tooltips.COMMENTS,className:"flex size-8 cursor-default items-center justify-center rounded-md p-2 text-zinc-300",children:a.jsx(H_,{className:"size-5"})}
971),a.jsx("div",{"aria-hidden":!0,className:"min-w-0 flex-1"}),a.jsx("button",{type:"button",disabled:!s.canClearFormatting,title:h.molecules.editor.tooltips.CLEAR_STYLES,onMouseDown:A,onClick:_,className:Y("flex size-8 items-center justify-center rounded-md p-2",s.canClearFormatting&&"cursor-pointer text-zinc-600 hover:bg-zinc-100",!s.canClearFormatting&&"cursor-default text-zinc-300"),children:a.jsx(AB,{className:"size-[22px] [&_path]:stroke-[1.5]"})})]})};function s3e(){const{id:e,documentId:t}=st(),n=hh($=>$.status),s=hh($=>$.session),r=hh($=>$.setStatus),i=hh($=>$.setSession),o=hh($=>$.reset),c=rA($=>$.sectionIds),u=rA($=>$.zoneKinds),[d,p]=l.useState(""),[g,A]=l.useState(""),[E,x]=l.useState([]),[y,I]=l.useState(!1),[v,S]=l.useState(!1),[b,w]=l.useState(null),[_,N]=l.useState(null),[R,D]=l.useState(null),k=l.useRef(null),L=l.useRef(null),O=l.useMemo(()=>n.kind==="idle"?"канал: ожидание":n.kind==="connecting"?"канал: подключение":n.kind==="connected"?"канал: подключён":n.kind==="reconnecting"?`канал: переподключение (попытка ${n.attempt})`:n.kind==="stopped"?"канал: остановлен":`канал: ошибка — ${n.reason}`,[n]),P=l.useMemo(()=>n.kind==="connected"?"document-v2__status document-v2__status--connected":n.kind==="error"?"document-v2__status document-v2__status--error":"document-v2__status",[n]),B=l.useMemo(()=>s===null?"":`сессия ${s.sessionId.slice(0,8)}… · хвост №${s.lastEventNumber}`,[s]),F=l.useMemo(()=>{const $=c.length+u.length;return $===0?"":`генерируется: ${$}`},[c,u]),z=l.useMemo(()=>E.join(`
972`),[E]),Q=l.useCallback(({line:$})=>{const J=new Date().toLocaleTimeString();x(ne=>[...ne.slice(-199),`${J} ${$}`])},[]),M=l.useCallback(async({mode:$})=>{if(!e||s===null)return;I(!0),Q({line:`→ команда test (${$})`});const J=await $Ne({clientId:e,sessionId:s.sessionId,commandType:"test",payload:{text:`стенд: ${$}`,mode:$}});J.kind==="accepted"&&Q({line:`← ack ${J.ack.commandId.slice(0,8)}… — принята, ждём событие`}),J.kind==="invalid"&&Q({line:`← отклонена (HTTP ${J.httpCode}): ${JSON.stringify(J.errorData)}`}),J.kind==="failed"&&Q({line:`← не доставлена (HTTP ${J.httpCode}): ${JSON.stringify(J.errorData)}`}),I(!1)},[e,s,Q]),K=l.useCallback(()=>{M({mode:"echo"})},[M]),W=l.useCallback(()=>{M({mode:"reject"})},[M]),H=l.useCallback(()=>{M({mode:"fail"})},[M]),j=l.useCallback(()=>{const $=L.current;if($===null)return;const J=({text:oe})=>({id:crypto.randomUUID(),type:"paragraph",runs:[{text:oe}]}),ne=[{kind:"title",blocks:[J({text:"ХОДАТАЙСТВО об изменении меры пресечения"})]},{kind:"body",items:[{id:crypto.randomUUID(),sectionKind:"circumstances",children:[J({text:"12 февраля 2024 года во дворе жилого дома произошло возгорание автомобиля."}),J({text:"Доверитель находился по месту жительства, что подтверждается показаниями свидетелей."})]},{id:crypto.randomUUID(),sectionKind:"position",children:[J({text:"Сторона защиты полагает, что основания для содержания под стражей отпали."})]}]}],X=wF({content:$.getContent(),zones:ne});if(X===null){Q({line:"шаблон (dev): неприменим — конфликт узлов"});return}$.commit({content:X.content,changes:X.changes,meta:{record:"domain",domainLabel:"dev.templateInserted"}}),Q({line:"шаблон (dev): вставлен локально, в сохранение не идёт"})},[Q]),q=l.useMemo(()=>!!(y||s===null),[y,s]),G=l.useMemo(()=>!v,[v]);return l.useEffect(()=>{if(!e||!t)return;const $=k.current;if($===null)return;const J={isDisposed:!1},ne=new AbortController,X=[];return(async()=>{try{const ie=await pF({clientId:e,documentId:t,signal:ne.signal});if(J.isDisposed)return;i(ie);const ee=ie.lastEventNumber;Q({line:`сессия получена, граница исторических — №${ee}`});const te=await Bm({clientId:e,documentId:t,signal:ne.signal});if(J.isDisposed)return;const le=u2e({value:te.contentJson});if(le.content===void 0){A(`Документ не разобран: ${le.issue}`);return}p(te.name);const he=n_e({content:le.content});L.current=he,S(!0);const fe=$5e({model:he,container:$});X.push(fe.destroy),$.contentEditable="true",$.spellcheck=!1;const ue={current:null},ye=M5e({root:$,model:he,onSelectionChange:({selection:Be})=>ue.current?.notifySelection({selection:Be})});X.push(ye.destroy);const ce=J2e({model:he,selectionLayer:ye});ue.current=ce,X.push(ce.destroy),w(ce);const xe=e_e({root:$,controller:ce});X.push(xe.destroy);const re=yNe({model:he});X.push(re.destroy),N(re);const pe=pNe({journal:re,selectionApplier:ye});D(pe);const _e=hNe({root:$,controller:pe});X.push(_e.destroy);const Le=T5e({root:$,model:he,selectionLayer:ye,pickPendingRunStyle:({position:Be})=>ce.readPendingRunStyleForInsert({position:Be}),onHistoryUndo:()=>pe.undo(),onHistoryRedo:()=>pe.redo()});X.push(Le.destroy);const Ee=dTe({root:$,model:he,selectionLayer:ye,onParityIssue:({line:Be})=>Q({line:`!!! parity: ${Be}`})});X.push(Ee.destroy);const se=G_e({root:$,model:he,selectionLayer:ye});X.push(se.destroy);const me=k5e({root:$,model:he,selectionLayer:ye});X.push(me.destroy);const de=F_e({root:$});X.push(de.destroy);const ge={current:null},Pe=MNe({model:he,generations:rA.getState(),historicalBoundary:ee,onSkipped:({line:Be})=>Q({line:`события: ${Be}`}),onFatalIssue:({reason:Be})=>{Q({line:`!!! ${Be}`}),r({kind:"error",reason:Be}),ge.current?.stop()}}),Ue=fNe({clientId:e,documentId:t,consumers:[Pe,{eventTypes:["test.echoed","test.rejected","command.failed"],onEvent:Be=>Q({line:`#${Be.eventNumber} ${Be.eventType} ${JSON.stringify(Be.payload)}`})}],snapshotConsumer:{onSnapshot:Be=>Q({line:`snapshot v${Be.snapshot.snapshotVersion}: лента из ${Be.snapshot.feed.length} элементов, продолжение с №${Be.resumeAfterNumber}`})},onStatusChange:r,onSessionEstablished:i});ge.current=Ue,X.push(Ue.stop),Ue.start()}catch(ie){if(J.isDisposed)return;Q({line:`ошибка загрузки: ${JSON.stringify(ie)}`}
972),A("Не удалось загрузить документ")}})(),()=>{J.isDisposed=!0,ne.abort(),X.forEach(ie=>ie()),o(),rA.getState().reset(),L.current=null,S(!1),w(null),N(null),D(null),$.replaceChildren(),$.contentEditable="false"}},[e,t,Q,r,i,o]),e?t?a.jsxs("div",{className:"document-v2",children:[a.jsxs("div",{className:"document-v2__bar",children:[a.jsx("span",{className:"document-v2__badge",children:"Редактор v2 (стенд)"}),a.jsx("span",{children:d}),a.jsx("span",{className:P,children:O}),!!B&&a.jsx("span",{className:"document-v2__session",children:B}),!!F&&a.jsx("span",{className:"document-v2__session",children:F}),a.jsxs("span",{className:"document-v2__commands",children:[a.jsx("button",{type:"button",className:"document-v2__command-button",disabled:G,onClick:j,children:"шаблон: вставить (dev)"}),a.jsx("button",{type:"button",className:"document-v2__command-button",disabled:q,onClick:K,children:"команда: эхо"}),a.jsx("button",{type:"button",className:"document-v2__command-button",disabled:q,onClick:W,children:"команда: отказ"}),a.jsx("button",{type:"button",className:"document-v2__command-button",disabled:q,onClick:H,children:"команда: сбой"})]})]}),!!g&&a.jsx("div",{className:"document-v2__issue",children:g}),a.jsx("div",{className:"document-v2__toolbar",children:!!b&&a.jsx(n3e,{controller:b,undoJournal:_,undoController:R})}),a.jsxs("div",{className:"document-v2__content",children:[a.jsx("div",{className:"document-v2__page",children:a.jsx("div",{className:"document-v2__sheet",ref:k})}),a.jsx("pre",{className:"document-v2__log",children:z})]})]}):a.jsx("div",{className:"document-v2"}):a.jsx("div",{className:"document-v2"})}const r3e=({clientId:e})=>Vt({queryKey:["fabulizerHistory",e],queryFn:()=>{if(!e)throw new Error("Missing client id");return pne({clientId:e}).then(t=>t.filter(n=>!Array.isArray(n.childRuns)||n.childRuns.length===0))},enabled:!!e}),i3e=e=>{const{data:t}=Vt({queryKey:["client",e],queryFn:()=>s7({id:e}),enabled:!!e,staleTime:3e5,refetchOnWindowFocus:!0,refetchOnMount:"always"});return l.useMemo(()=>{const n=new Map;return(t?.episodes??[]).forEach((r,i)=>{r?.id&&n.set(r.id,i+1)}),n},[t?.episodes])},o3e=({clientId:e,setObjectToFabulize:t,setStatus:n,setIsAutoCommit:s,setStatusPrevious:r,setIsFabulizerReady:i,setIsOpen:o,setText:c,setExternalData:u,setCommitData:d})=>{const p=bt();return tt({mutationFn:oE,onSuccess:()=>{r(null),e&&p.invalidateQueries({queryKey:["fabulizerHistory",e]})},onError:async g=>{if(ve({type:"failed",message:h.client.fabulizer.errors.START_FAILED,key:"FABULIZER_START_FAILED"}),!(g.errorData?.code!=="ALREADY_STARTED"||!e))try{const A=await jI({clientId:e});if(A.resourceType!==os)return;t({to:`/clients/${e}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}),n(A.status),s(A.autoCommit),r(null),i(!0),o(!0,!0),c(A.text),u(null),d(()=>null)}catch{return}}})},a3e=Oe.memo(({item:e,eventBasePath:t,fabulaEventOrdinalById:n,isRetryDisabled:s,isRetryPending:r,onRetry:i})=>{const o=l.useCallback(({item:A})=>A.historyOutcome==="cancelled"?"cancelled":A.historyOutcome==="committed_manual"||A.historyOutcome==="committed_auto"?"success":A.historyOutcome==="failed"||A.status==="error"?"error":A.status==="awaiting_choice"||A.status==="awaitingChoice"?"ready_to_save":"analyzing",[]),c=l.useCallback(({dateString:A})=>{if(!A)return"";const E=new Date(A);return Mu(E)?Gv(E,new Date)?`${h.client.fabula.fabulizerHistory.TODAY} ${is(E,"HH:mm")}`:_r({dateString:A,isWithTime:!0}):""},[]),u=l.useMemo(()=>o({item:e}),[o,e]),d=l.useMemo(()=>{const A=e.savedAt??e.startedAt;return c({dateString:A})},[c,e.savedAt,e.startedAt]),p=s||r,g=l.useMemo(()=>{const A=e.events.filter(v=>!v.isDeleted),E=e.events.filter(v=>v.isDeleted),x=Math.max(0,...Array.from(n.values())),y=A.map((v,S)=>({eventItem:v,ordinal:n.get(v.id)??S+1})),I=E.map((v,S)=>({eventItem:v,ordinal:x+S+1}));return[...y,...I]},[e.events,n]);return a.jsxs("div",{className:Y("py-8 flex flex-row gap-8"),children:[a.jsxs("div",{className:"w-full min-w-0",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:h.client.fabula.fabulizerHistory.ENTERED_FABULA}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-2 wrap-break-word",children:a.jsx(tn,{text:e.text})}),u==="error"&&a.jsxs("div",{className:"mt-6",children:[a.jsxs("div",{className:"flex flex-row items-center gap-1.5",children:[a.jsx(nu,{className:"size-5 text-red-500 shrink-0"}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950",children:h.client.fabula.fabulizerHistory.ANALYSIS_ERROR})]}),a.jsx(ut,{type:"button",variant:"h8",className:"mt-4",disabled:p,isPending:r,onClick:i,children:h.client.fabula.fabulizerHistory.ANALYSIS_ERROR_BUTTON})]}),u==="success"&&a.jsxs("div",{className:"mt-6",children:[a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500",children:g.length>0?h.client.fabula.fabulizerHistory.ADDED:h.client.fabula.fabulizerHistory.NO_EPISODES_ADDED}),g.length>0&&a.jsx("div",{className:"mt-2 flex flex-row flex-wrap gap-1 items-start",children:g.map(({eventItem:A,ordinal:E},x)=>{const y=`${h.client.fabula.infoCards.TITLE} ${E}`,I=x===g.length-1;return a.jsx("div",{className:"flex flex-row flex-wrap items-center gap-0",children:a.jsx("div",{className:"flex flex-row gap-2 items-start flex-wrap",children:A.isDeleted?a.jsxs("div",{className:"min-w-0 h-6",children:[a.jsx("span",{className:"roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-950 line-through",children:y}),a.jsxs("span",{className:"roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-400",children:[" ","(",h.client.fabula.fabulizerHistory.EPISODE_DELETED_DESCRIPTION,")"]}),!I&&a.jsx("span",{className:"roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-400 shrink-0",children:", "})]}):a.jsxs("div",{className:"flex flex-row items-center min-w-0 flex-wrap",children:[a.jsx(Hs,{to:`${t}/${A.id}`,state:{isPreventScrollToTop:!0},className:"roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-950 underline decoration-[2%] underline-offset-[25%] decoration-zinc-950 hover:text-zinc-700 min-w-0",children:y}),A.isManualEdited&&a.jsxs("span",{className:"roboto-flex-25-400-1 text-[16px] leading-[24px] text-zinc-400",children:[" ","(",h.client.fabula.fabulizerHistory.EVENT_MANUA
972L_EDITED,")"]}),!I&&a.jsx("span",{className:Y("roboto-flex-25-400-1  text-[16px] leading-[24px]  shrink-0",A.isManualEdited?"text-zinc-400":"text-zinc-950"),children:", "})]})})},A.id)})})]}),u==="cancelled"&&a.jsxs("div",{className:"mt-6",children:[a.jsxs("div",{className:"flex flex-row items-center gap-1.5",children:[a.jsx(nu,{className:"size-5 text-red-500 shrink-0"}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[24px] text-zinc-950",children:h.client.fabula.fabulizerHistory.CANCELLED_LABEL})]}),a.jsx(ut,{type:"button",variant:"h8",className:"mt-4",disabled:p,isPending:r,onClick:i,children:h.client.fabula.fabulizerHistory.ANALYSIS_ERROR_BUTTON})]})]}),a.jsx("span",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-500 shrink-0 w-[212px] text-right",children:d})]})}),l3e=e=>l.createElement("svg",{width:108,height:108,viewBox:"0 0 108 108",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M27.3839 12.8372C24.3183 17.7546 19.5194 25.403 16.3857 30.5945C14.857 33.1271 13.3119 35.6299 12.1422 38.4023C11.7603 39.3074 11.3275 40.1804 10.9353 41.0793C10.7858 41.4221 10.2181 42.0637 10.546 42.1389C10.839 42.2061 10.994 41.6856 11.2176 41.4585C12.8379 39.8126 14.5019 38.2236 16.1521 36.6176C20.945 31.9535 25.7502 27.3148 30.6736 22.8312C35.2672 18.6479 39.7616 14.1199 44.5915 10.2941C46.206 9.01532 47.7926 7.70051 49.4482 6.49057C51.4494 5.02816 49.0252 7.25408 48.6307 7.68406C38.5526 18.6676 30.4078 31.5436 21.2522 43.4662C17.5055 48.3452 13.2722 52.9185 9.98152 58.2342C9.03654 59.7607 8.19697 61.367 7.25632 62.8966C6.89935 63.477 6.29422 64.1202 6.01052 64.7705C5.93705 64.9388 6.35643 64.7783 6.49716 64.6812C9.00408 62.9513 11.3516 60.7905 13.7189 58.8365C23.9182 50.4183 33.9702 41.7699 44.0465 33.1599C52.5532 25.8911 60.7792 18.0974 69.5271 11.2087C71.5103 9.64705 77.6757 5.3456 75.5809 6.7025C75.1114 7.00666 74.1008 7.91941 73.8874 8.10791C70.9739 10.6821 68.0748 13.2828 65.1862 15.8934C56.5607 23.6889 48.6141 32.1908 40.8055 41.0347C33.2819 49.5555 25.5593 57.8774 18.1766 66.5551C17.9855 66.7797 17.8094 66.9817 17.6607 67.2467C17.5784 67.3935 17.5024 67.4839 17.398 67.6036C16.6726 68.4348 19.1895 66.4578 20.0745 65.8636C41.3048 51.607 62.4474 37.1298 82.4134 20.6339C82.5755 20.4999 82.7972 20.4288 82.9 20.2324C83.3411 19.3899 81.52 21.4025 80.8756 22.0505C74.8262 28.1336 68.985 34.466 63.2591 40.9454C56.5012 48.5928 49.891 56.4264 42.9856 63.9004C40.578 66.5064 37.9696 68.8231 35.54 71.3848C34.1361 72.865 32.9776 74.6487 31.5495 76.0807C29.3227 78.3137 27.23 80.7159 25.009 82.9515C23.7848 84.1839 22.4664 85.3103 21.0867 86.3089C20.5583 86.6914 20.0271 87.0749 19.5392 87.5247C19.2348 87.8053 18.2876 88.294 18.6632 88.417C18.9714 88.5179 19.2739 88.1842 19.5586 88.0155C23.1137 85.9093 26.5863 83.5564 30.0604 81.2896C41.6322 73.7391 53.2268 66.1628 64.5828 58.1896C70.1095 54.3092 75.5692 50.2828 81.0216 46.2659C82.1209 45.456 83.2185 44.5487 84.3794 43.8455C84.4881 43.7796 84.6072 43.7736 84.6714 43.6447C85.2513 42.4817 86.6737 41.5763 87.6107 40.8339C88.2201 40.3511 88.6777 39.9195 89.1875 39.2946C89.7995 38.5442 92.1593 36.0808 89.3529 38.7035C79.4799 47.93 69.9398 57.589 60.6897 67.6259C52.6373 76.3631 44.5297 84.9592 36.0266 93.124C33.442 95.6058 30.8162 98.0323 28.2598 100.553C27.8216 100.985 26.5108 102.241 27.0335 101.958C29.0364 100.873 31.0562 99.1781 32.8732 97.831C38.733 93.4867 44.5114 89.0004 50.3144 84.5577C62.1391 75.5052 73.9423 66.3681 86.2676 58.223C91.3789 54.8453 96.5586 51.6139 101.655 48.2067C103.261 47.1332 98.8478 51.0008 97.4214 52.3672C88.3802 61.0277 79.5448 70.0166 71.2985 79.6723C67.1862 84.4873 63.4149 89.829 58.8599 94.1279C57.811 95.1179 61.2623 92.6707 62.4416 91.8971C68.9593 87.6213 75.4203 83.2359 81.81 78.713C88.1053 74.2569 94.4733 69.7911 100.487 64.8374C101.901 63.673 97.8651 67.4625 96.5455 68.7636C91.5812 73.6583 87.0605 79.0103 82.3745 84.2454C78.5407 88.5284 74.6969 92.8072 70.7924 97.0056C69.6393 98.2455 68.5157 99.6194 67.2788 100.753C64.5532 103.252 73.0602 96.2689 75.9313 93.9941C78.9958 91.566 82.0762 89.1753 85.2165 86.8778C85.831 86.4282 86.4403 85.9688 87.0657 85.5393C87.43 85.2891 88.2832 84.5842 88.2726 85.0708C88.2532 85.9563 87.2888 87.353 86.9197 88.0601C86.1904 89.4574 85.4561 90.8357 84.8271 92.2986C84.6825 92.635 83.3231 95.4159 83.6203 95.7564",stroke:"#F4F4F5",strokeWidth:12,strokeLinecap:"round"}),l.createElement("g",{clipPath:"url(#clip0_17952_51343)"},l.createElement("path",{d:"M57.4576 32.0653L46.2692 33.2413C35.0808 34.4172 31.0758 39.3629 32.2518 50.5513L33.6629 63.9773C34.8389 75.1657 39.7846 79.1707 50.973 77.9947",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.2402 48.0852L77.9458 54.7982",stroke:"black",strokeWidth:4}),l.createElement("path",{d:"M77.2399 48.0852L68.2892 49.0259C61.5762 49.7315 59.1034 47.729 58.3978 41.016L57.457 32.0653L77.2399 48.0852Z",stroke:"black",strokeWidth:4,strokeLinejoin:"round"}),l.createElement("path",{d:"M69.1493 60.4228C71.6152 63.3683 74.6285 65.8092 78.0223 67.6089C75.0771 70.0746 72.6367 73.0882 70.8372 76.4818C68.3712 73.5363 65.3571 71.0963 61.9633 69.2967C64.909 66.8307 67.3496 63.8168 69.1493 60.4228Z",stroke:"black",strokeWidth:4})),l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_17952_51343"},l.createElement("rect",{width:54,height:54,fill:"white",transform:"translate(24.8203 30.9703) rotate(-6)"})))),c3e=({handleClose:e,handleOpenFabulizer:t})=>a.jsxs("div",{className:"flex flex-col pt-4 pb-8 h-[calc(100vh-7.5rem)] justify-center items-center",children:[a.jsx(l3e,{className:"w-24 h-24"}),a.jsx("div",{className:"roboto-flex-100-600-1 text-[24px] leading-[28px] text-zinc-950 mt-5 text-center",children:h.client.fabula.fabulizerHistory.EMPTY_TITLE}),a.jsx("div",{className:"roboto-flex-100-400-1 text-[16px] leading-[20px] text-zinc-950 mt-1.5 text-center",children:h.client.fabula.fabulizerHistory.EMPTY_DESCRIPTION}),a.jsxs("div",{className:"flex gap-3 mt-8",children:[a.jsx(ut,{type:"button",variant:"h16inverse",onClick:e,children:h.client.fabulizer.buttons.DONE}),a.jsx(ut,{type:"button",variant:"h16",onClick:t,children:h.client.fabula.emptyPage.buttons.TO_FABULIZER})]})]}),u3e=Oe.memo(c3e),d3e=()=>{const e=l.useRef(null),t=l.useRef(!1),n=l.useRef(null),s=l.useRef({}),r=l.useRef(null),i=at(),o=Fe(),c=bt(),{clientId:u}=st(),{isClientNotFound:d,isFetching:p,isSuccess:g}=Zi({clientId:u}),A=u?`/clients/${u}/overview/fabula`:"",{status:E,objectToFabulize:x,setText:y,setStatus:I,setStatusPrevious:v,setObjectToFabulize:S,setIsAutoCommit:b,setIsFabulizerReady:w,setIsOpen:_,setExternalData:N,setCommitData:R}=wt({clientId:u}),{openFabulizer:D}=Fu(),k=!(E==="notStarted"||x?.type!==os),{data:L=[],isLoading:O,isFetching:P,isError:B,refetch:F}=r3e({clientId:u}),z=l.useMemo(()=>L.filter(X=>X.historyOutcome==="cancelled"||X.historyOutcome==="committed_manual"||X.historyOutcome==="committed_auto"||X.historyOutcome==="failed"||X.status==="error"),[L]),Q=i3e(u);l.useEffect(()=>{B&&(d||p||ve({type:"failed",message:h.client.fabula.fabulizerHistory.LOAD_ERROR,key:"FABULIZER_HISTORY_LOAD_ERROR"}))},[B,d,p]),l.useEffect(()=>{t.current&&!k&&F(),t.current=k},[k,F]),l.useEffect(()=>{if(n.current===null){n.current=E;return}n.current==="pending"&&(E==="awaitingChoice"||E==="autoCommitted"||E==="error")&&x?.type===os&&F(),n.current=E},[E,x?.type,F]),l.useEffect(()=>{const X=r.current;if(!X)return;const oe=L.find(ee=>ee.parentRunId===X);if(!oe)return;const ie=s.current[oe.id];ie&&requestAnimationFrame(()=>{ie.scrollIntoView({behavior:"auto",block:"nearest"}),r.current=null})},[L]);const{mutate:M,isPending:K,variables:W}=o3e({clientId:u,setObjectToFabulize:S,setStatus:I,setIsAutoCommit:b,setStatusPrevious:v,setIsFabulizerReady:w,setIsOpen:_,setText:y,setExternalData:N,setCommitData:R}),[H,j]=l.useState(!1);l.useEffect(()=>{P||j(!1)},[P]);const q=l.useCallback(()=>{c.removeQueries({queryKey:["fabulizerHistory",u]});const X=o.state?.returnToPath;if(typeof X=="string"&&X.startsWith("/clients/")&&!X.endsWith("/fabulizer-history")){i(X,{state:{isPreventScrollToTop:!0}});return}u&&i(`/clients/${u}/overview/fabula`,{state:{isPreventScrollToTop:!0}})},[u,o.state,i,c]),G=l.useCallback(({item:X})=>{u&&(k||(D({clientId:u,to:`/clients/${u}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}),j(!0),y(X.text),b(X.isAutoCommit),v(E),I("pending"),M({clientId:u,text:X.text,resourceType:os,parentRunId:X.id,isAutoCommit:X.isAutoCommit}),r.current=X.id,q()))},[u,q,k,D,M,b,I,v,y,E]),$=l.useCallback(()=>{u&&(q(),D({clientId:u,to:`/clients/${u}/overview/fabula`,breadcrumbsNames:[h.client.navigation.FABULA],type:os}))},[u,q,D]),J=l.useMemo(()=>!(B||z.length>0||P||K),[B,z.length,P,K]),ne=l.useMemo(()=>O?a.jsx(ct,{isWithWrapper:!0}):!g&&!d?a.jsx(ct,{isWithWrapper:!0}):J?a.jsx(u3e,{handleClose:q,handleOpenFabulizer:$}):B?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"roboto-flex-25-700-1 text-[24px] leading-[24px] text-zinc-950 uppercase mt-6",children:h.client.fabula.buttons.FABULIZER_HISTORY}),z.length>0&&a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"divide-y divide-zinc-200",children:z.map(X=>a.jsx("div",{ref:oe=>{s.current[X.id]=oe},children:a.jsx(a3e,{item:X,clientId:u??"",eventBasePath:A,fabulaEventOrdinalById:Q,isRetryDisabled:k,isRetryPending:H&&W?.parentRunId===X.id,onRetry:()=>G({item:X})})},X.id))})})]}),[O,g,d,J,B,z,u,A,Q,k,H,W?.parentRunId,G,q,$]);return a.jsxs(Ws,{onClose:q,contentRef:e,isForceAnimateOnStart:!0,children:[!!d&&a.jsx(ia,{type:Gr.CLIENT_NOT_FOUND,isInBottomSheet:!0}),!d&&ne]})}
972,iI=({toSuffix:e})=>{const{id:t}=st();return t?a.jsx(Qn,{to:`/clients/${t}${e}`,replace:!0}):a.jsx(Qn,{to:"/clients",replace:!0})},f3e=()=>{const t=Fe().pathname.split("/")[2],{isClientNotFound:n,isPending:s}=Zi({clientId:t}),[r]=l.useState(()=>s||!n);return n&&!r?null:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})};function p3e(){vv({title:"ИИ-партнер адвоката",meta:[{name:"viewport",content:"width=device-width, initial-scale=1"},{name:"description",content:"Система ведения дел, анализа и поиска уголовной практики на основе искусственного интеллекта"},{property:"og:title",content:"ИИ-партнер адвоката"},{property:"og:description",content:"Система ведения дел, анализа и поиска уголовной практики на основе искусственного интеллекта"},{property:"og:type",content:"website"},{property:"og:url",content:window.location.origin},{property:"og:site_name",content:"Plevako.ai"},{property:"og:locale",content:"ru_RU"},{property:"og:image",content:`${window.location.origin}/images/android-chrome-512x512.png`},{property:"og:image:width",content:"512"},{property:"og:image:height",content:"512"}],link:[{rel:"canonical",href:window.location.origin}]});const e=yk(),t=Pv(),n=bk(),s=Fe(),r=s.pathname.startsWith("/legal-base"),i=l.useMemo(()=>N$({pathname:s.pathname,state:s.state}),[s.pathname,s.state]),o=l.useMemo(()=>T$({pathname:s.pathname,state:s.state}),[s.pathname,s.state]),c=l.useMemo(()=>!!(i||o),[i,o]),u=l.useMemo(()=>{if(!r)return s;if(i)return w$({search:s.search,hash:s.hash,state:s.state,key:s.key});if(o){const ee=Qv({pathname:s.pathname,state:s.state});return ee?R$({returnPath:ee,search:s.search,hash:s.hash,state:s.state,key:s.key}):s}return s},[r,i,o,s]),d=I$({state:s.state}),p=d.returnToPath,g=d.returnToSearch,A=d.returnToHash,E=d.returnToState,x=l.useMemo(()=>r?typeof p=="string"?{pathname:p,search:g??"",hash:A??"",state:E??null,key:s.key}:{pathname:_$({pathname:s.pathname}),search:"",hash:"",state:null,key:s.key}:s,[r,p,g,A,E,s]),y=x.state,I=y?.isFromDefenseStrategyDetailedPage??!1,v=y?.isFromDefenseStrategyEvidenceDetailedPage??!1,S=y?.isFromDefenseStrategyCircumstancesDetailedPage??!1,b=y?.isFromDefenseStrategyEvidencePage??!1,w=y?.isFromDefenseStrategyCircumstancesPage??!1,_=y?.isFromDefenseStrategySecondInstancePage??!1,N=y?.isCaseSourceOpenedFromQuotesPage??!1,R=y?.isCaseOpenedFromQuotesPage===!0,D=y?.isCaseOpenedFromOverviewPopup===!0,k=y?.practicePopupOpen===!0,L=y?.evidencePopupTarget??null,O=l.useMemo(()=>{const ee=y?.pageType,te=b||v;return!te&&!(w||S)||!ee?null:te?ee==="prosecution"?"prosecution":"defense":ee==="aggravating"?"aggravating":"mitigating"},[y,b,v,w,S]),P=l.useMemo(()=>!(!x.pathname.startsWith("/clients/")||x.pathname==="/clients/archived"||x.pathname==="/clients/add"||x.pathname==="/clients"||LP({pathname:x.pathname})),[x.pathname]),B=l.useMemo(()=>x.pathname.startsWith("/clients/")?x.pathname==="/clients/add":!1,[x.pathname]),F=l.useMemo(()=>/^\/clients\/[^/]+\/fabulizer-history$/.test(x.pathname),[x.pathname]),z=l.useMemo(()=>{if(!x.pathname.startsWith("/clients/"))return!1;const ee=x.pathname.split("/");if(ee[3]!=="cases")return!1;const te=ee[4];if(!YA({value:te}))return!1;const le=ee[5];if(!le||le==="saved")return!1;const he=ee[6];return!(he&&!YA({value:he}))},[x.pathname]),Q=l.useMemo(()=>{if(!x.pathname.endsWith("/source")||y?.isCaseSourceOpenedFromCaseCard!==!0)return!1;const ee=y.returnToPath;return!(typeof ee!="string"||!ee.startsWith("/clients/"))},[x.pathname,y]),M=l.useMemo(()=>{if(!Q)return x;const ee=y.returnToPath;return typeof ee!="string"?x:{pathname:ee,search:"",hash:"",state:y.returnToState??y}},[Q,x,y]),K=l.useMemo(()=>{if(z&&I)return!0;if(!x.pathname.startsWith("/clients/"))return!1;const ee=x.pathname.split("/");if(ee[3]!=="defense-strategy")return!1;const te=ee[4];return te&&te!=="first-instance"&&te!=="second-instance"&&te!=="evidence"&&te!=="circumstances"?!1:!!x.state?.defenseRequestsGoal?.goal},[x.pathname,x.state,z,I]),W=l.useMemo(()=>
972{if(z&&D){const te=y?.returnToState;return!!(te?.practicePopupOpen===!0||te?.evidencePopupTarget)}const ee=x.pathname.split("/");return ee[3]!=="overview"||ee[4]!=="defense-lines"?!1:!!(k||L)},[z,D,y,x.pathname,k,L]),H=l.useMemo(()=>!!x.state?.evidence,[x.state?.evidence]),j=l.useMemo(()=>!!x.state?.circumstances,[x.state?.circumstances]),q=l.useMemo(()=>!!x.state?.newsItem,[x.state?.newsItem]),G=l.useMemo(()=>!!x.state?.testimonialItem,[x.state?.testimonialItem]),$=l.useMemo(()=>{if(I)return{pathname:"/clients",search:"",hash:"",state:x.state};if(v)return{pathname:"/clients",search:"",hash:"",state:x.state};if(S)return{pathname:"/clients",search:"",hash:"",state:x.state};if(b)return{pathname:"/clients",search:"",hash:"",state:x.state};if(w)return{pathname:"/clients",search:"",hash:"",state:x.state};if(_)return{pathname:"/clients",search:"",hash:"",state:x.state};if(!x.pathname.startsWith("/clients/"))return x;const ee=x.state?.isFromArchived??!1;return P?{pathname:`/clients${ee?"/archived":""}`,search:"",hash:"",state:x.state}:B?{pathname:`/clients${ee?"/archived":""}`,search:"",hash:"",state:x.state}:x},[x,P,B,I,v,S,b,w,_]),J=l.useMemo(()=>{if(z&&_)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/second-instance`,search:"",hash:"",state:x.state};if(z&&I){const ee=x.pathname.split("/"),te=ee[2],he=ee[4]==="second-instance"?"second-instance":"first-instance";return{pathname:`/clients/${te}/defense-strategy/${he}`,search:"",hash:"",state:x.state}}return x},[x,z,I,_]),ne=l.useMemo(()=>{if(z&&D){const ee=y?.returnToPath;if(typeof ee=="string"&&ee.startsWith("/clients/")){const te=y?.returnToState;return{pathname:ee,search:"",hash:"",state:te??x.state}}}return x},[z,D,y,x]),X=l.useMemo(()=>{if(z&&b){const ee=x.pathname.split("/"),te=ee[2];return ee[4]==="second-instance"?{pathname:`/clients/${te}/defense-strategy/second-instance`,search:"",hash:"",state:x.state}:{pathname:`/clients/${te}/defense-strategy/first-instance/evidence${O==="prosecution"?"/prosecution":""}`,search:"",hash:"",state:x.state}}if(z&&v){const ee=x.pathname.split("/"),te=ee[2];return ee[4]==="second-instance"?{pathname:`/clients/${te}/defense-strategy/second-instance`,search:"",hash:"",state:x.state}:{pathname:`/clients/${te}/defense-strategy/first-instance/evidence${O==="prosecution"?"/prosecution":""}`,search:"",hash:"",state:x.state}}return x},[x,z,b,v,O]),oe=l.useMemo(()=>{if(z&&w){const ee=x.pathname.split("/"),te=ee[2];return ee[4]==="second-instance"?{pathname:`/clients/${te}/defense-strategy/second-instance`,search:"",hash:"",state:x.state}:{pathname:`/clients/${te}/defense-strategy/first-instance/circumstances${O==="aggravating"?"/aggravating":""}`,search:"",hash:"",state:x.state}}if(z&&S){const ee=x.pathname.split("/"),te=ee[2];return ee[4]==="second-instance"?{pathname:`/clients/${te}/defense-strategy/second-instance`,search:"",hash:"",state:x.state}:{pathname:`/clients/${te}/defense-strategy/first-instance/circumstances${O==="aggravating"?"/aggravating":""}`,search:"",hash:"",state:x.state}}return x},[x,z,w,S,O]),ie=l.useMemo(()=>{if(F){const ee=x.state?.returnToPath;if(typeof ee=="string"&&ee.startsWith("/clients/")&&!ee.endsWith("/fabulizer-history"))return{...x,pathname:ee,search:"",hash:"",state:x.state};const le=x.pathname.split("/")[2];return{...x,pathname:`/clients/${le}/overview/fabula`,search:"",hash:"",state:x.state}}if(z&&N&&x.pathname.endsWith("/source"))return{pathname:`/clients/${x.pathname.split("/")[2]}/quotes`,search:"",hash:"",state:x.state};if(z&&R){const te=x.pathname.split("/")[2],he=x.state?.returnToHash??"";return{pathname:`/clients/${te}/quotes`,search:"",hash:he,state:void 0}}if(z&&D){const ee=x.state?.returnToPath;if(typeof ee=="string"&&ee.startsWith("/clients/")){const te=x.state?.returnToState;return{pathname:ee,search:"",hash:"",state:te??x.state}}}if(z&&_)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/second-instance`,search:"",hash:"",state:x.state};if(I)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/first-instance`,search:"",hash:"",state:x.state};
972if(z&&v)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/first-instance/evidence${O==="prosecution"?"/prosecution":""}`,search:"",hash:"",state:x.state};if(z&&S)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/first-instance/circumstances${O==="aggravating"?"/aggravating":""}`,search:"",hash:"",state:x.state};if(z&&b)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/first-instance/evidence${O==="prosecution"?"/prosecution":""}`,search:"",hash:"",state:x.state};if(z&&w)return{pathname:`/clients/${x.pathname.split("/")[2]}/defense-strategy/first-instance/circumstances${O==="aggravating"?"/aggravating":""}`,search:"",hash:"",state:x.state};if(z){const ee=x.pathname.split("/"),te=ee[2],le=ee[4],he=x.state?.isSaved??!1;return{pathname:`/clients/${te}/cases/${le??"first-instance"}${he?"/saved":""}`,search:"",hash:"",state:x.state}}return x},[x,F,z,N,R,D,I,v,S,b,w,_,O]);return l.useEffect(()=>{document.body.style.overflow=P||B||q||G?"hidden":"auto"},[P,B,q,G]),a.jsxs(O$,{children:[a.jsx(hfe,{isClientPage:P}),a.jsxs(Ur,{location:$,children:[a.jsx(Re,{path:"/",element:a.jsx(ute,{}),children:a.jsx(Re,{path:"/",element:a.jsx(KZ,{})})}),a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1})}),children:[a.jsx(Re,{path:"profile/payment/:tariffId",element:a.jsx(lfe,{})}),a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsxs(Re,{path:"profile",element:a.jsx(Qde,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(Gde,{})}),a.jsx(Re,{path:"subscription",element:a.jsx(efe,{})}),a.jsx(Re,{path:"payment-history",element:a.jsx(tfe,{})})]}),a.jsxs(Re,{path:"clients",element:a.jsx(vte,{isClientPage:P,isAddClientPage:B}),children:[a.jsx(Re,{index:!0,element:a.jsx(kte,{})}),a.jsx(Re,{path:"archived",element:a.jsx(Ote,{})})]}),a.jsx(Re,{path:"clients/:id/cases/*",element:a.jsx(Vw,{})}),a.jsxs(Re,{path:"legal-base",element:a.jsx(Sw,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(Iw,{})}),a.jsx(Re,{path:":baseId",element:a.jsx(_0,{})}),a.jsx(Re,{path:":baseId/:articleId",element:a.jsx(_0,{})})]})]})]}),a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{})}),children:a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsx(Re,{path:"profile/change-password",element:a.jsx(jde,{})}),a.jsx(Re,{path:"profile/change-phone",element:a.jsx(cfe,{})}),a.jsx(Re,{path:"profile/change-phone/check-email",element:a.jsx(dfe,{})}),a.jsx(Re,{path:"profile/change-email",element:a.jsx(ffe,{})}),a.jsx(Re,{path:"profile/change-email/sms",element:a.jsx(pfe,{})})]})}),a.jsx(Re,{element:a.jsx(Zs,{access:"guestOnly",element:a.jsx(Cs,{})}),children:a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsx(Re,{path:"forgot-password",element:a.jsx(Rde,{})}),a.jsx(Re,{path:"forgot-password/sent",element:a.jsx(Dde,{})})]})}),a.jsx(Re,{element:a.jsx(Zs,{access:"public",element:a.jsx(Cs,{isWaitingForAppReady:!1})}),children:a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsx(Re,{path:"/confirm-email",element:a.jsx(Fde,{})}),a.jsx(Re,{path:"/book-demo",element:a.jsx(Ude,{})}),a.jsx(Re,{path:"/book-demo-success",element:a.jsx(zde,{})})]})}),a.jsx(Re,{element:a.jsx(Zs,{access:"public",element:a.jsx(Cs,{isWaitingForAppReady:!1})}),children:a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsx(Re,{path:"/setup-new-password",element:a.jsx(Pde,{})}),a.jsx(Re,{path:"/setup-new-phone",element:a.jsx(Lde,{})}),a.jsx(Re,{path:"/setup-new-phone/sms",element:a.jsx(Mde,{})})]})}),a.jsx(Re,{element:a.jsx(Zs,{access:"guestOnly",element:a.jsx(Cs,{})}),children:a.jsxs(Re,{element:a.jsx(Hl,{}),children:[a.jsx(Re,{path:"sign-in",element:a.jsx(yde,{})}),a.jsx(Re,{path:"sign-in/phone",element:a.jsx(bde,{})}),a.jsx(Re,{path:"sign-in/sms",element:a.jsx(Tde,{})}),!e&&a.jsxs(a.Fragment,{children:[a.jsx(Re,{path:"sign-up",element:a.jsx(Nde,{})}),a.jsx(Re,{path:"sign-up/sms",element:a.jsx(wde,{})})]})]})}),a.jsx(Re,{path:"*",element:a.jsx(Cs,{}),children:a.jsx(Re,{path:"*",element:a.jsx(Hl,{}),children:a.jsx(Re,{path:"*",element:a.jsx(Vw,{})})})})]}),!!P&&a.jsxs(Ur,{location:ie,children:[a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{background:"zinc50",isMainFillViewportHe
972ight:!0,isFullscreen:!0,isJustifyBetween:!1})}),children:[!!n&&a.jsx(Re,{path:"clients/:id/documents/:documentId",element:a.jsx(iI,{toSuffix:""})}),!n&&a.jsx(Re,{path:"clients/:id/documents/:documentId",element:a.jsx(Ive,{})}),!n&&a.jsx(Re,{path:"clients/:id/documents/:documentId/v2",element:a.jsx(s3e,{})})]}),a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isFullscreen:!0})}),children:a.jsxs(Re,{path:"clients/:id",element:a.jsx(Rne,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(Ire,{})}),a.jsxs(Re,{path:"cases",element:a.jsx(pae,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(hae,{})}),a.jsxs(Re,{path:"first-instance",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(Aae,{})}),a.jsx(Re,{path:"saved",element:a.jsx(Aw,{})})]}),a.jsxs(Re,{path:"second-instance",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(bae,{})}),a.jsx(Re,{path:"saved",element:a.jsx(Aw,{})})]})]}),a.jsxs(Re,{path:"defense-strategy",element:a.jsx(Nae,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(wae,{})}),a.jsxs(Re,{path:"first-instance",element:a.jsx(Rae,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(eh,{})}),a.jsx(Re,{path:"evidence",element:a.jsx(eh,{})}),a.jsx(Re,{path:"evidence/prosecution",element:a.jsx(eh,{})}),a.jsx(Re,{path:"circumstances",element:a.jsx(eh,{})}),a.jsx(Re,{path:"circumstances/aggravating",element:a.jsx(eh,{})})]}),a.jsx(Re,{path:"second-instance",element:a.jsx(ale,{}),children:a.jsx(Re,{index:!0,element:a.jsx(yw,{})})})]}),a.jsx(Re,{path:"quotes",element:a.jsx(Zme,{})}),!!n&&a.jsx(Re,{path:"documents/*",element:a.jsx(iI,{toSuffix:""})}),!n&&a.jsx(Re,{path:"documents",element:a.jsx(jme,{})}),a.jsxs(Re,{path:"overview",element:a.jsx(Vl,{}),children:[a.jsxs(Re,{path:"participants",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(tw,{})}),a.jsx(Re,{path:"witnesses",element:a.jsx(tw,{})}),a.jsx(Re,{path:"victims",element:a.jsx(vre,{})})]}),a.jsxs(Re,{path:"circumstances",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(rw,{})}),a.jsx(Re,{path:":circumstanceId",element:a.jsx(rw,{})})]}),a.jsxs(Re,{path:"evidence",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(iw,{})}),a.jsx(Re,{path:":evidenceId",element:a.jsx(iw,{})})]}),!!t&&a.jsx(Re,{path:"defense-lines/*",element:a.jsx(iI,{toSuffix:"/overview/fabula"})}),!t&&a.jsxs(Re,{path:"defense-lines",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(uw,{})}),a.jsx(Re,{path:":defenseLineId",element:a.jsx(uw,{})})]}),a.jsxs(Re,{path:"stage",children:[a.jsx(Re,{index:!0,element:a.jsx(sw,{})}),a.jsx(Re,{path:":stageId",element:a.jsx(sw,{})})]}),a.jsxs(Re,{path:"fabula",element:a.jsx(Vl,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(By,{})}),a.jsx(Re,{path:":episodeId",element:a.jsx(By,{})}),a.jsx(Re,{path:":episodeId/:legacyFelonyId",element:a.jsx(By,{})})]})]})]})})]}),!!P&&F&&a.jsx(Ur,{location:x,children:a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(f3e,{})}),children:a.jsx(Re,{path:"/clients/:clientId/fabulizer-history",element:a.jsx(d3e,{})})})}),!!B&&a.jsx(Ur,{location:x,children:a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:a.jsx(Re,{path:"clients/add",element:a.jsx(Gle,{})})})}),!!K&&a.jsx(Ur,{location:J,children:a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:[a.jsx(Re,{path:"clients/:id/defense-strategy/first-instance",element:a.jsx(nle,{})}),a.jsx(Re,{path:"clients/:id/defense-strategy/second-instance",element:a.jsx(yw,{})})]})}),!!H&&a.jsx(Ur,{location:X,children:a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:[a.jsx(Re,{path:"clients/:id/defense-strategy/first-instance/evidence",element:a.jsx(Ew,{})}),a.jsx(Re,{path:"clients/:id/defense-strategy/first-instance/evidence/prosecution",element:a.jsx(Ew,{})})]})}),!!j&&a.jsx(Ur,{location:oe,children:a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:[a.jsx(Re,{path:"clients/:id/defense-strategy/first-instance/circumstances",element:a.jsx(xw,{})}),a.jsx(Re,{path:"clients/:id/defense-strategy/first-instance/circumstances/aggravating",element:a.jsx(xw,{})})]})}),!!q&&a.jsx(Ur,{location:x,children:a.jsx(Re,{element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0}),children:a.jsx(Re,{path:"/",element:a.jsx(Fle,{})})})}),!!G&&a.jsx(Ur,{location:x,children:a.jsx(Re,{element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0}),children:a.jsx(Re,{path:"/",element:a.jsx(Ule,{})})})}),!!(W&&!t)&&a.jsx(Ur,{location:ne,children:a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:[a.jsx(Re,{path:"clients/:id/overview/defense-lines",element:a.jsx(pw,{})}),a.jsx(Re,{path:"clients/:id/overview/defense-lines/:defenseLineId",element:a.jsx(pw,{})})]})}),!!z&&a.jsxs(a.Fragment,{children:[a.jsx(Ur,{location:M,children:a.jsxs(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:[a.jsx(Re,{path:"clients/:id/cases/:listInstance/:caseId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"clients/:id/cases/:listInstance/:caseId/:caseInstance",element:a.jsx(vn,{})}),a.jsx(Re,{path:"clients/:id/cases/:listInstance/:caseId/:caseInstance/information",element:a.jsx(vn,{})}),a.jsx(Re,{path:"clients/:id/cases/:listInstance/:caseId/:caseInstance/information/general",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/information/accu
972sed",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/information/witnesses",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/information/victims",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/overview",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/:eventId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/fabula/:eventId/:felonyId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/circumstances/:relatedCircumstanceId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/evidence/:accusedId/:itemId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/testimony",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/evidence/testimony/:accusedId/:itemId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions/:accusedId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/complaints-and-submissions/:accusedId/:itemId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request/:accusedId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/defense-request/:accusedId/:requestId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/:groupId",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/accusation-request/:groupId/:requestIndex",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions",element:a.jsx(vn,{})}),a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/conclusions/:accusedIndex",element:a.jsx(vn,{})})]})}),x.pathname.endsWith("/source")&&a.jsx(Ur,{location:x,children:a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isModal:!0})}),children:a.jsx(Re,{path:"/clients/:id/cases/:listInstance/:caseId/:caseInstance/source",element:a.jsx(Cde,{})})})})]}),!!r&&a.jsxs(a.Fragment,{children:[a.jsx(Ur,{location:u,children:a.jsx(Re,{element:a.jsx(Zs,{access:"authOnly",element:a.jsx(Cs,{isJustifyBetween:!1,isFullscreen:!0})}),children:a.jsx(Re,{element:a.jsx(Hl,{}),children:a.jsxs(Re,{path:"legal-base",element:a.jsx(Sw,{}),children:[a.jsx(Re,{index:!0,element:a.jsx(Iw,{})}),a.jsx(Re,{path:":baseId",element:a.jsx(_0,{})}),a.jsx(Re,{path:":baseId/:articleId",element:a.jsx(_0,{})})]})})})}),!!c&&a.jsx(Ur,{location:s,children:a.jsx(Re,{path:"legal-base/:baseId/:articleId",element:a.jsx(dce,{})})})]})]})}async function h3e(){const e=await qe("/runtime-config.json",{cache:"no-store"});if(He(e))throw new Error("Runtime config request failed due to network issues");if(!e.ok)throw new Error("Runtime config request failed");return await e.json()}const m3e=()=>{const e=rl(s=>s.runtimeConfig),t=rl(s=>s.setRuntimeConfig),n=Vt({queryKey:["runtimeConfig"],queryFn:h3e,enabled:!e,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1});l.useEffect(()=>{if(n.isError){t(null);return}n.data&&t(n.data)},[n.data,n.isError,t])},g3e=({children:e})=>(m3e(),rl(n=>n.runtimeConfig)?e:a.jsx(ct,{isFullScreen:!0})),A3e=({accessToken:e})=>e?e.length<=8?"…":`…${e.slice(-8)}`:null,E3e=()=>typeof window>"u"?null:window.location.pathname,x3e=()=>{const e=Se.getState();return{hasAccessToken:!!e.accessToken,accessTokenTail:A3e({accessToken:e.accessToken}),userId:e.user?.id??null,isAppReady:e.isAppReady,isUserLoadResolved:e.isUserLoadResolved,clearReason:e.clearReason,path:E3e
972()}},C3e=()=>{if(typeof window>"u")return;sG({provider:x3e});const e={print:()=>{const t=[...Ck.getState().entries];return console.group("[plevako] auth log"),console.table(t.map(n=>({time:n.timestamp,stage:n.stage,message:n.message,userId:n.snapshot.userId,hasToken:n.snapshot.hasAccessToken,clearReason:n.snapshot.clearReason,path:n.snapshot.path,callSite:n.callSite}))),console.log("full entries:",t),console.groupEnd(),t}};globalThis.__plevakoAuthLog=e,typeof window<"u"&&(window.__plevakoAuthLog=e)},y3e=({error:e})=>{if(e){if(e instanceof Response||typeof e.status=="number")return e.status;if(typeof e.httpCode=="number")return e.httpCode}},b3e=(e,t)=>{const n=y3e({error:t});return!(typeof n!="number"||n<500||e>=3)},I3e={defaultOptions:{queries:{retry:b3e}}},S3e=new zQ(I3e),v3e=XD();C3e();hQ.createRoot(document.getElementById("root")).render(a.jsx(l.StrictMode,{children:a.jsx(QQ,{client:S3e,children:a.jsx(hH,{head:v3e,children:a.jsx(g3e,{children:a.jsx(FV,{children:a.jsx(p3e,{})})})})})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.